feffery_utils_components 0.2.0-rc24 → 0.2.0-rc25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DESCRIPTION +1 -1
- package/MANIFEST.in +1 -1
- package/Project.toml +1 -1
- package/README.md +1 -1
- package/feffery_utils_components/FefferyDiv.py +12 -3
- package/feffery_utils_components/FefferyMotion.py +9 -3
- package/feffery_utils_components/__init__.py +23 -1
- package/feffery_utils_components/async-feffery_animated_3d_background_p5.js +3 -1
- package/feffery_utils_components/async-feffery_animated_3d_background_p5.js.map +1 -0
- package/feffery_utils_components/async-feffery_animated_3d_background_three.js +3 -1
- package/feffery_utils_components/async-feffery_animated_3d_background_three.js.map +1 -0
- package/feffery_utils_components/async-feffery_animated_image.js +4 -1
- package/feffery_utils_components/async-feffery_animated_image.js.map +1 -0
- package/feffery_utils_components/async-feffery_aplayer.js +3 -1
- package/feffery_utils_components/async-feffery_aplayer.js.map +1 -0
- package/feffery_utils_components/async-feffery_auto_animate.js +3 -1
- package/feffery_utils_components/async-feffery_auto_animate.js.map +1 -0
- package/feffery_utils_components/async-feffery_auto_fit.js +3 -1
- package/feffery_utils_components/async-feffery_auto_fit.js.map +1 -0
- package/feffery_utils_components/async-feffery_burger.js +3 -1
- package/feffery_utils_components/async-feffery_burger.js.map +1 -0
- package/feffery_utils_components/async-feffery_captcha.js +3 -1
- package/feffery_utils_components/async-feffery_captcha.js.map +1 -0
- package/feffery_utils_components/async-feffery_color_pickers.js +4 -1
- package/feffery_utils_components/async-feffery_color_pickers.js.map +1 -0
- package/feffery_utils_components/async-feffery_dom2image.js +4 -4
- package/feffery_utils_components/async-feffery_dom2image.js.map +1 -0
- package/feffery_utils_components/async-feffery_dplayer.js +4 -1
- package/feffery_utils_components/async-feffery_dplayer.js.map +1 -0
- package/feffery_utils_components/async-feffery_emoji_picker.js +4 -1
- package/feffery_utils_components/async-feffery_emoji_picker.js.map +1 -0
- package/feffery_utils_components/async-feffery_excel_preview.js +4 -1
- package/feffery_utils_components/async-feffery_excel_preview.js.map +1 -0
- package/feffery_utils_components/async-feffery_extra_spinner.js +4 -1
- package/feffery_utils_components/async-feffery_extra_spinner.js.map +1 -0
- package/feffery_utils_components/async-feffery_fancy_button.js +3 -1
- package/feffery_utils_components/async-feffery_fancy_button.js.map +1 -0
- package/feffery_utils_components/async-feffery_grid.js +3 -1
- package/feffery_utils_components/async-feffery_grid.js.map +1 -0
- package/feffery_utils_components/async-feffery_http_requests.js +4 -1
- package/feffery_utils_components/async-feffery_http_requests.js.map +1 -0
- package/feffery_utils_components/async-feffery_image_cropper.js +4 -1
- package/feffery_utils_components/async-feffery_image_cropper.js.map +1 -0
- package/feffery_utils_components/async-feffery_json_viewer.js +3 -1
- package/feffery_utils_components/async-feffery_json_viewer.js.map +1 -0
- package/feffery_utils_components/async-feffery_local_large_storage.js +4 -1
- package/feffery_utils_components/async-feffery_local_large_storage.js.map +1 -0
- package/feffery_utils_components/async-feffery_markdown_editor.js +3 -3
- package/feffery_utils_components/async-feffery_markdown_editor.js.map +1 -0
- package/feffery_utils_components/async-feffery_motion.js +3 -1
- package/feffery_utils_components/async-feffery_motion.js.map +1 -0
- package/feffery_utils_components/async-feffery_music_player.js +4 -1
- package/feffery_utils_components/async-feffery_music_player.js.map +1 -0
- package/feffery_utils_components/async-feffery_photo_sphere_viewer.js +4 -1
- package/feffery_utils_components/async-feffery_photo_sphere_viewer.js.map +1 -0
- package/feffery_utils_components/async-feffery_resizable.js +3 -1
- package/feffery_utils_components/async-feffery_resizable.js.map +1 -0
- package/feffery_utils_components/async-feffery_rich_text_editor.js +4 -4
- package/feffery_utils_components/async-feffery_rich_text_editor.js.map +1 -0
- package/feffery_utils_components/async-feffery_rnd.js +3 -1
- package/feffery_utils_components/async-feffery_rnd.js.map +1 -0
- package/feffery_utils_components/async-feffery_seamless_scroll.js +3 -1
- package/feffery_utils_components/async-feffery_seamless_scroll.js.map +1 -0
- package/feffery_utils_components/async-feffery_shortcut_panel.js +32 -29
- package/feffery_utils_components/async-feffery_shortcut_panel.js.map +1 -0
- package/feffery_utils_components/async-feffery_slider_captcha.js +4 -1
- package/feffery_utils_components/async-feffery_slider_captcha.js.map +1 -0
- package/feffery_utils_components/async-feffery_sortable.js +3 -1
- package/feffery_utils_components/async-feffery_sortable.js.map +1 -0
- package/feffery_utils_components/async-feffery_vditor.js +4 -1
- package/feffery_utils_components/async-feffery_vditor.js.map +1 -0
- package/feffery_utils_components/async-feffery_word_preview.js +4 -1
- package/feffery_utils_components/async-feffery_word_preview.js.map +1 -0
- package/feffery_utils_components/async-fuc-shared.js +4 -135
- package/feffery_utils_components/async-fuc-shared.js.map +1 -0
- package/feffery_utils_components/feffery_utils_components.min.js +27 -30
- package/feffery_utils_components/feffery_utils_components.min.js.map +1 -0
- package/feffery_utils_components/metadata.json +85 -0
- package/feffery_utils_components/package-info.json +1 -1
- package/package.json +1 -1
- package/src/lib/components/animations/FefferyMotion.react.js +12 -0
- package/src/lib/components/container/FefferyDiv.react.js +115 -55
- package/src/lib/fragments/animations/FefferyMotion.react.js +30 -23
- package/tests/MotionTest/app.py +50 -0
- package/usage.py +25 -25
- package/webpack.config.js +3 -11
|
@@ -1 +1,4 @@
|
|
|
1
|
-
(window.webpackJsonpfeffery_utils_components=window.webpackJsonpfeffery_utils_components||[]).push([[32],{516:function(e,t,n){n.r(t);var V=n(1),W=n.n(V),o=n(874),G=n.n(o),F=(n(875),n(63)),K=n(25),Z=n(550),J=n(495),o=n(219);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function X(o){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach(function(e){var t,n;t=o,e=r[n=e],(n=(()=>{var e=((e,t)=>{if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return String(e);if("object"!=i(n=n.call(e,t)))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(n,"string");return"symbol"==i(e)?e:e+""})())in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}function Y(e,t){return(e=>{if(Array.isArray(e))return e})(e)||((e,t)=>{var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);s=!0);}catch(e){c=!0,r=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}})(e,t)||((e,t)=>{var n;if(e)return"string"==typeof e?r(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0})(e,t)||(()=>{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function l(e){var j=e.id,t=e.className,R=e.style,P=e.key,q=e.debounceWait,n=e.undoDelay,o=e.height,r=e.minHeight,i=e.width,a=e.placeholder,l=e.lang,s=e.tab,c=e.typewriterMode,d=e.cdn,p=e.mode,u=e.debuggerMode,m=e.value,f=e.theme,h=e.icon,v=e.toolbar,g=e.toolbarConfig,b=e.counter,y=e.cache,w=e.preview,E=e.image,k=e.link,x=e.hint,S=e.upload,_=e.resize,T=e.classes,L=e.fullscreen,C=e.outline,A=e.setProps,M=(e=Y(Object(V.useState)(),2))[0],H=e[1],B=(e=Y(Object(V.useState)("initial"),2))[0],O=e[1],z=Object(Z.a)(function(e){A({value:e,htmlValue:M.getHTML()})},{debounceWait:q,manual:!0}).run,N=Object(V.useMemo)(function(){return j||Object(J.a)()},[]),D=Object(V.useMemo)(function(){return X(X({},b),{},{after:function(e){A({wordCount:e})}})},[b]),I=Object(V.useMemo)(function(){return X(X({},_),{},{after:function(e){A({resizeHeight:e})}})},[_]),U=Object(V.useMemo)(function(){return Object.entries({debugger:u,counter:D,resize:I,undoDelay:n,height:o,minHeight:r,width:i,placeholder:a,lang:l,tab:s,typewriterMode:c,cdn:d,mode:p,value:m,theme:f,icon:h,toolbar:v,toolbarConfig:g,cache:y,preview:w,image:E,link:k,hint:x,upload:S,classes:T,fullscreen:L,outline:C}).reduce(function(e,t){var t=Y(t,2),n=t[0],t=t[1];return Object(K.isUndefined)(t)||(e[n]=t),e},{})},[n,o,r,i,a,l,s,c,d,p,u,m,f,h,v,g,D,y,w,E,k,x,S,I,T,L,C]);return Object(V.useEffect)(function(){return M&&"initial"===B&&M.setValue(Object(K.isUndefined)(m)?"":m),function(){O("initial")}},[M,m]),Object(V.useEffect)(function(){var e=new G.a(N,X(X({},U),{},{after:function(){H(e)},input:function(e){O("event"),z(e)},select:function(e){A({selectedValue:e})}}));return function(){null!=M&&M.destroy(),H(void 0)}},[]),W.a.createElement("div",{id:N,className:Object(K.isString)(t)?t:t?Object(F.a)(t):void 0,key:P,style:R})}(t.default=l).defaultProps=o.b,l.propTypes=o.c},874:function(e,t,n){e.exports=(()=>{var y={85:e=>{function T(){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}T.Diff=function(e,t){return[e,t]},T.prototype.diff_main=function(e,t,n,o){var r,i,a,o=o=void 0===o?this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout:o;if(null==e||null==t)throw new Error("Null input. (diff_main)");return e==t?e?[new T.Diff(0,e)]:[]:(n=n=void 0===n||n,a=this.diff_commonPrefix(e,t),r=e.substring(0,a),e=e.substring(a),t=t.substring(a),a=this.diff_commonSuffix(e,t),i=e.substring(e.length-a),e=e.substring(0,e.length-a),t=t.substring(0,t.length-a),a=this.diff_compute_(e,t,n,o),r&&a.unshift(new T.Diff(0,r)),i&&a.push(new T.Diff(0,i)),this.diff_cleanupMerge(a),a)},T.prototype.diff_compute_=function(e,t,n,o){var r,i,a,l,s;return e?t?-1!=(a=(l=e.length>t.length?e:t).indexOf(r=t.length<e.length?t:e))?(l=[new T.Diff(1,l.substring(0,a)),new T.Diff(0,r),new T.Diff(1,l.substring(a+r.length))],e.length>t.length&&(l[0][0]=l[2][0]=-1),l):1==r.length?[new T.Diff(-1,e),new T.Diff(1,t)]:(a=this.diff_halfMatch_(e,t))?(l=a[0],r=a[1],s=a[2],i=a[3],a=a[4],l=this.diff_main(l,s,n,o),s=this.diff_main(r,i,n,o),l.concat([new T.Diff(0,a)],s)):n&&100<e.length&&100<t.length?this.diff_lineMode_(e,t,o):this.diff_bisect_(e,t,o):[new T.Diff(-1,e)]:[new T.Diff(1,t)]},T.prototype.diff_lineMode_=function(e,t,n){var o=this.diff_linesToChars_(e,t),r=(e=o.chars1,o.lineArray),i=this.diff_main(e,t=o.chars2,!1,n);this.diff_charsToLines_(i,r),this.diff_cleanupSemantic(i),i.push(new T.Diff(0,""));for(var a=0,l=0,s=0,c="",d="";a<i.length;){switch(i[a][0]){case 1:s++,d+=i[a][1];break;case-1:l++,c+=i[a][1];break;case 0:if(1<=l&&1<=s){i.splice(a-l-s,l+s);for(var a=a-l-s,p=this.diff_main(c,d,!1,n),u=p.length-1;0<=u;u--)i.splice(a,0,p[u]);a+=p.length}l=s=0,d=c=""}a++}return i.pop(),i},T.prototype.diff_bisect_=function(e,t,n){for(var o=e.length,r=t.length,i=Math.ceil((o+r)/2),a=i,l=2*i,s=new Array(l),c=new Array(l),d=0;d<l;d++)s[d]=-1,c[d]=-1;s[a+1]=0;for(var p=o-r,u=p%2!=(c[a+1]=0),m=0,f=0,h=0,v=0,g=0;g<i&&!((new Date).getTime()>n);g++){for(var b=-g+m;b<=g-f;b+=2){for(var y=a+b,w=(x=b==-g||b!=g&&s[y-1]<s[y+1]?s[y+1]:s[y-1]+1)-b;x<o&&w<r&&e.charAt(x)==t.charAt(w);)x++,w++;if(o<(s[y]=x))f+=2;else if(r<w)m+=2;else if(u&&0<=(S=a+p-b)&&S<l&&-1!=c[S]&&x>=(k=o-c[S]))return this.diff_bisectSplit_(e,t,x,w,n)}for(var E=-g+h;E<=g-v;E+=2){for(var k,x,S=a+E,_=(k=E==-g||E!=g&&c[S-1]<c[S+1]?c[S+1]:c[S-1]+1)-E;k<o&&_<r&&e.charAt(o-k-1)==t.charAt(r-_-1);)k++,_++;if(o<(c[S]=k))v+=2;else if(r<_)h+=2;else if(!u)if(0<=(y=a+p-E)&&y<l&&-1!=s[y]&&(w=a+(x=s[y])-y,x>=(k=o-k)))return this.diff_bisectSplit_(e,t,x,w,n)}}return[new T.Diff(-1,e),new T.Diff(1,t)]},T.prototype.diff_bisectSplit_=function(e,t,n,o,r){var i=e.substring(0,n),a=t.substring(0,o),e=e.substring(n),n=t.substring(o),t=this.diff_main(i,a,!1,r),o=this.diff_main(e,n,!1,r);return t.concat(o)},T.prototype.diff_linesToChars_=function(e,t){var a=[],l={};function n(e){for(var t="",n=0,o=-1,r=a.length;o<e.length-1;){-1==(o=e.indexOf("\n",n))&&(o=e.length-1);var i=e.substring(n,o+1);(l.hasOwnProperty?l.hasOwnProperty(i):void 0!==l[i])?t+=String.fromCharCode(l[i]):(r==s&&(i=e.substring(n),o=e.length),t+=String.fromCharCode(r),l[i]=r,a[r++]=i),n=o+1}return t}a[0]="";var s=4e4,e=n(e),s=65535;return{chars1:e,chars2:n(t),lineArray:a}},T.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var o=e[n][1],r=[],i=0;i<o.length;i++)r[i]=t[o.charCodeAt(i)];e[n][1]=r.join("")}},T.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,o=Math.min(e.length,t.length),r=o,i=0;n<r;)e.substring(i,r)==t.substring(i,r)?i=n=r:o=r,r=Math.floor((o-n)/2+n);return r},T.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,o=Math.min(e.length,t.length),r=o,i=0;n<r;)e.substring(e.length-r,e.length-i)==t.substring(t.length-r,t.length-i)?i=n=r:o=r,r=Math.floor((o-n)/2+n);return r},T.prototype.diff_commonOverlap_=function(e,t){var n=e.length,o=t.length;if(0==n||0==o)return 0;o<n?e=e.substring(n-o):n<o&&(t=t.substring(0,n));var r=Math.min(n,o);if(e==t)return r;for(var i=0,a=1;;){var l=e.substring(r-a),l=t.indexOf(l);if(-1==l)return i;a+=l,0!=l&&e.substring(r-a)!=t.substring(0,a)||(i=a,a++)}},T.prototype.diff_halfMatch_=function(e,t){var u,n,o,r,i,a,l,s;return!(this.Diff_Timeout<=0)&&(n=e.length>t.length?e:t,s=t.length<e.length?t:e,!(n.length<4||2*s.length<n.length))&&(u=this,l=c(n,s,Math.ceil(n.length/4)),s=c(n,s,Math.ceil(n.length/2)),l||s)?(n=!s||l&&l[4].length>s[4].length?l:s,e.length>t.length?(o=n[0],r=n[1],i=n[2],a=n[3]):(i=n[0],a=n[1],o=n[2],r=n[3]),[o,r,i,a,n[4]]):null;function c(e,t,n){for(var o,r,i,a,l=e.substring(n,n+Math.floor(e.length/4)),s=-1,c="";-1!=(s=t.indexOf(l,s+1));){var d=u.diff_commonPrefix(e.substring(n),t.substring(s)),p=u.diff_commonSuffix(e.substring(0,n),t.substring(0,s));c.length<p+d&&(c=t.substring(s-p,s)+t.substring(s,s+d),o=e.substring(0,n-p),r=e.substring(n+d),i=t.substring(0,s-p),a=t.substring(s+d))}return 2*c.length>=e.length?[o,r,i,a,c]:null}},T.prototype.diff_cleanupSemantic=function(e){for(var t,n,o,r,i=!1,a=[],l=0,s=null,c=0,d=0,p=0,u=0,m=0;c<e.length;)0==e[c][0]?(d=u,p=m,m=u=0,s=e[a[l++]=c][1]):(1==e[c][0]?u+=e[c][1].length:m+=e[c][1].length,s&&s.length<=Math.max(d,p)&&s.length<=Math.max(u,m)&&(e.splice(a[l-1],0,new T.Diff(-1,s)),e[a[l-1]+1][0]=1,l--,c=0<--l?a[l-1]:-1,m=u=p=d=0,i=!(s=null))),c++;for(i&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),c=1;c<e.length;)-1==e[c-1][0]&&1==e[c][0]&&(t=e[c-1][1],n=e[c][1],o=this.diff_commonOverlap_(t,n),(r=this.diff_commonOverlap_(n,t))<=o?(o>=t.length/2||o>=n.length/2)&&(e.splice(c,0,new T.Diff(0,n.substring(0,o))),e[c-1][1]=t.substring(0,t.length-o),e[c+1][1]=n.substring(o),c++):(r>=t.length/2||r>=n.length/2)&&(e.splice(c,0,new T.Diff(0,t.substring(0,r))),e[c-1][0]=1,e[c-1][1]=n.substring(0,n.length-r),e[c+1][0]=-1,e[c+1][1]=t.substring(r),c++),c++),c++},T.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){var n,o,r,i,a,l;return e&&t?(a=e.charAt(e.length-1),l=t.charAt(0),n=a.match(T.nonAlphaNumericRegex_),o=l.match(T.nonAlphaNumericRegex_),r=n&&a.match(T.whitespaceRegex_),i=o&&l.match(T.whitespaceRegex_),a=r&&a.match(T.linebreakRegex_),l=i&&l.match(T.linebreakRegex_),e=a&&e.match(T.blanklineEndRegex_),t=l&&t.match(T.blanklineStartRegex_),e||t?5:a||l?4:n&&!r&&i?3:r||i?2:n||o?1:0):6}for(var n=1;n<e.length-1;){if(0==e[n-1][0]&&0==e[n+1][0]){var o,r=e[n-1][1],i=e[n][1],a=e[n+1][1],l=this.diff_commonSuffix(r,i);l&&(o=i.substring(i.length-l),r=r.substring(0,r.length-l),i=o+i.substring(0,i.length-l),a=o+a);for(var s=r,c=i,d=a,p=t(r,i)+t(i,a);i.charAt(0)===a.charAt(0);){r+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var u=t(r,i)+t(i,a);p<=u&&(p=u,s=r,c=i,d=a)}e[n-1][1]!=s&&(s?e[n-1][1]=s:(e.splice(n-1,1),n--),e[n][1]=c,d?e[n+1][1]=d:(e.splice(n+1,1),n--))}n++}},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(e){for(var t=!1,n=[],o=0,r=null,i=0,a=!1,l=!1,s=!1,c=!1;i<e.length;)0==e[i][0]?(r=e[i][1].length<this.Diff_EditCost&&(s||c)?(a=s,l=c,e[n[o++]=i][1]):(o=0,null),s=c=!1):(-1==e[i][0]?c=!0:s=!0,r&&(a&&l&&s&&c||r.length<this.Diff_EditCost/2&&a+l+s+c==3)&&(e.splice(n[o-1],0,new T.Diff(-1,r)),e[n[o-1]+1][0]=1,o--,a&&l?(s=c=!0,o=0):(i=0<--o?n[o-1]:-1,s=c=!1),t=!(r=null))),i++;t&&this.diff_cleanupMerge(e)},T.prototype.diff_cleanupMerge=function(e){e.push(new T.Diff(0,""));for(var t,n=0,o=0,r=0,i="",a="";n<e.length;)switch(e[n][0]){case 1:r++,a+=e[n][1],n++;break;case-1:o++,i+=e[n][1],n++;break;case 0:1<o+r?(0!==o&&0!==r&&(0!==(t=this.diff_commonPrefix(a,i))&&(0<n-o-r&&0==e[n-o-r-1][0]?e[n-o-r-1][1]+=a.substring(0,t):(e.splice(0,0,new T.Diff(0,a.substring(0,t))),n++),a=a.substring(t),i=i.substring(t)),0!==(t=this.diff_commonSuffix(a,i)))&&(e[n][1]=a.substring(a.length-t)+e[n][1],a=a.substring(0,a.length-t),i=i.substring(0,i.length-t)),n-=o+r,e.splice(n,o+r),i.length&&(e.splice(n,0,new T.Diff(-1,i)),n++),a.length&&(e.splice(n,0,new T.Diff(1,a)),n++),n++):0!==n&&0==e[n-1][0]?(e[n-1][1]+=e[n][1],e.splice(n,1)):n++,o=r=0,a=i=""}""===e[e.length-1][1]&&e.pop();for(var l=!1,n=1;n<e.length-1;)0==e[n-1][0]&&0==e[n+1][0]&&(e[n][1].substring(e[n][1].length-e[n-1][1].length)==e[n-1][1]?(e[n][1]=e[n-1][1]+e[n][1].substring(0,e[n][1].length-e[n-1][1].length),e[n+1][1]=e[n-1][1]+e[n+1][1],e.splice(n-1,1),l=!0):e[n][1].substring(0,e[n+1][1].length)==e[n+1][1]&&(e[n-1][1]+=e[n+1][1],e[n][1]=e[n][1].substring(e[n+1][1].length)+e[n+1][1],e.splice(n+1,1),l=!0)),n++;l&&this.diff_cleanupMerge(e)},T.prototype.diff_xIndex=function(e,t){for(var n=0,o=0,r=0,i=0,a=0;a<e.length&&(1!==e[a][0]&&(n+=e[a][1].length),-1!==e[a][0]&&(o+=e[a][1].length),!(t<n));a++)r=n,i=o;return e.length!=a&&-1===e[a][0]?i:i+(t-r)},T.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,r=/>/g,i=/\n/g,a=0;a<e.length;a++){var l=e[a][0],s=e[a][1].replace(n,"&").replace(o,"<").replace(r,">").replace(i,"¶<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case-1:t[a]='<del style="background:#ffe6e6;">'+s+"</del>";break;case 0:t[a]="<span>"+s+"</span>"}}return t.join("")},T.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},T.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)-1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},T.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,r=0;r<e.length;r++){var i=e[r][0],a=e[r][1];switch(i){case 1:n+=a.length;break;case-1:o+=a.length;break;case 0:t+=Math.max(n,o),o=n=0}}return t+Math.max(n,o)},T.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]="+"+encodeURI(e[n][1]);break;case-1:t[n]="-"+e[n][1].length;break;case 0:t[n]="="+e[n][1].length}return t.join("\t").replace(/%20/g," ")},T.prototype.diff_fromDelta=function(e,t){for(var n=[],o=0,r=0,i=t.split(/\t/g),a=0;a<i.length;a++){var l=i[a].substring(1);switch(i[a].charAt(0)){case"+":try{n[o++]=new T.Diff(1,decodeURI(l))}catch(e){throw new Error("Illegal escape in diff_fromDelta: "+l)}break;case"-":case"=":var s=parseInt(l,10);if(isNaN(s)||s<0)throw new Error("Invalid number in diff_fromDelta: "+l);s=e.substring(r,r+=s);"="==i[a].charAt(0)?n[o++]=new T.Diff(0,s):n[o++]=new T.Diff(-1,s);break;default:if(i[a])throw new Error("Invalid diff operation in diff_fromDelta: "+i[a])}}if(r!=e.length)throw new Error("Delta length ("+r+") does not equal source text length ("+e.length+").");return n},T.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},T.prototype.match_bitap_=function(e,n,o){if(n.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var t=this.match_alphabet_(n),r=this;function i(e,t){e/=n.length,t=Math.abs(o-t);return r.Match_Distance?e+t/r.Match_Distance:t?1:e}var a=this.Match_Threshold;-1!=(p=e.indexOf(n,o))&&(a=Math.min(i(0,p),a),-1!=(p=e.lastIndexOf(n,o+n.length)))&&(a=Math.min(i(0,p),a));for(var l,s,c,d=1<<n.length-1,p=-1,u=n.length+e.length,m=0;m<n.length;m++){for(l=0,s=u;l<s;)i(m,o+s)<=a?l=s:u=s,s=Math.floor((u-l)/2+l);var u=s,f=Math.max(1,o-s+1),h=Math.min(o+s,e.length)+n.length,v=Array(h+2);v[h+1]=(1<<m)-1;for(var g=h;f<=g;g--){var b=t[e.charAt(g-1)];if(v[g]=0===m?(v[g+1]<<1|1)&b:(v[g+1]<<1|1)&b|(c[g+1]|c[g])<<1|1|c[g+1],v[g]&d){b=i(m,g-1);if(b<=a){if(a=b,!((p=g-1)>o))break;f=Math.max(1,2*o-p)}}}if(i(m+1,o)>a)break;c=v}return p},T.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},T.prototype.patch_addContext_=function(e,t){if(0!=t.length){if(null===e.start2)throw Error("patch not initialized");for(var n=t.substring(e.start2,e.start2+e.length1),o=0;t.indexOf(n)!=t.lastIndexOf(n)&&n.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,n=t.substring(e.start2-o,e.start2+e.length1+o);o+=this.Patch_Margin;var r=t.substring(e.start2-o,e.start2),i=(r&&e.diffs.unshift(new T.Diff(0,r)),t.substring(e.start2+e.length1,e.start2+e.length1+o));i&&e.diffs.push(new T.Diff(0,i)),e.start1-=r.length,e.start2-=r.length,e.length1+=r.length+i.length,e.length2+=r.length+i.length}},T.prototype.patch_make=function(e,t,n){var o,r;if("string"==typeof e&&"string"==typeof t&&void 0===n)2<(r=this.diff_main(o=e,t,!0)).length&&(this.diff_cleanupSemantic(r),this.diff_cleanupEfficiency(r));else if(e&&"object"==typeof e&&void 0===t&&void 0===n)o=this.diff_text1(r=e);else if("string"==typeof e&&t&&"object"==typeof t&&void 0===n)o=e,r=t;else{if("string"!=typeof e||"string"!=typeof t||!n||"object"!=typeof n)throw new Error("Unknown call format to patch_make.");o=e,r=n}if(0===r.length)return[];for(var i=[],a=new T.patch_obj,l=0,s=0,c=0,d=o,p=o,u=0;u<r.length;u++){var m=r[u][0],f=r[u][1];switch(l||0===m||(a.start1=s,a.start2=c),m){case 1:a.diffs[l++]=r[u],a.length2+=f.length,p=p.substring(0,c)+f+p.substring(c);break;case-1:a.length1+=f.length,a.diffs[l++]=r[u],p=p.substring(0,c)+p.substring(c+f.length);break;case 0:f.length<=2*this.Patch_Margin&&l&&r.length!=u+1?(a.diffs[l++]=r[u],a.length1+=f.length,a.length2+=f.length):f.length>=2*this.Patch_Margin&&l&&(this.patch_addContext_(a,d),i.push(a),a=new T.patch_obj,l=0,d=p,s=c)}1!==m&&(s+=f.length),-1!==m&&(c+=f.length)}return l&&(this.patch_addContext_(a,d),i.push(a)),i},T.prototype.patch_deepCopy=function(e){for(var t=[],n=0;n<e.length;n++){var o=e[n],r=new T.patch_obj;r.diffs=[];for(var i=0;i<o.diffs.length;i++)r.diffs[i]=new T.Diff(o.diffs[i][0],o.diffs[i][1]);r.start1=o.start1,r.start2=o.start2,r.length1=o.length1,r.length2=o.length2,t[n]=r}return t},T.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,r=[],i=0;i<e.length;i++){var a,l=e[i].start2+o,s=this.diff_text1(e[i].diffs),c=-1;if(s.length>this.Match_MaxBits?-1!=(a=this.match_main(t,s.substring(0,this.Match_MaxBits),l))&&(-1==(c=this.match_main(t,s.substring(s.length-this.Match_MaxBits),l+s.length-this.Match_MaxBits))||c<=a)&&(a=-1):a=this.match_main(t,s,l),-1==a)r[i]=!1,o-=e[i].length2-e[i].length1;else if(r[i]=!0,o=a-l,s==(l=-1==c?t.substring(a,a+s.length):t.substring(a,c+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[i].diffs)+t.substring(a+s.length);else{var d=this.diff_main(s,l,!1);if(s.length>this.Match_MaxBits&&this.diff_levenshtein(d)/s.length>this.Patch_DeleteThreshold)r[i]=!1;else{this.diff_cleanupSemanticLossless(d);for(var p,u=0,m=0;m<e[i].diffs.length;m++){var f=e[i].diffs[m];0!==f[0]&&(p=this.diff_xIndex(d,u)),1===f[0]?t=t.substring(0,a+p)+f[1]+t.substring(a+p):-1===f[0]&&(t=t.substring(0,a+p)+t.substring(a+this.diff_xIndex(d,u+f[1].length))),-1!==f[0]&&(u+=f[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),r]},T.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,n="",o=1;o<=t;o++)n+=String.fromCharCode(o);for(o=0;o<e.length;o++)e[o].start1+=t,e[o].start2+=t;var r,i=e[0],a=i.diffs;return 0==a.length||0!=a[0][0]?(a.unshift(new T.Diff(0,n)),i.start1-=t,i.start2-=t,i.length1+=t,i.length2+=t):t>a[0][1].length&&(r=t-a[0][1].length,a[0][1]=n.substring(a[0][1].length)+a[0][1],i.start1-=r,i.start2-=r,i.length1+=r,i.length2+=r),0==(a=(i=e[e.length-1]).diffs).length||0!=a[a.length-1][0]?(a.push(new T.Diff(0,n)),i.length1+=t,i.length2+=t):t>a[a.length-1][1].length&&(r=t-a[a.length-1][1].length,a[a.length-1][1]+=n.substring(0,r),i.length1+=r,i.length2+=r),n},T.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,n=0;n<e.length;n++)if(!(e[n].length1<=t)){var o=e[n];e.splice(n--,1);for(var r=o.start1,i=o.start2,a="";0!==o.diffs.length;){var l=new T.patch_obj,s=!0;for(l.start1=r-a.length,l.start2=i-a.length,""!==a&&(l.length1=l.length2=a.length,l.diffs.push(new T.Diff(0,a)));0!==o.diffs.length&&l.length1<t-this.Patch_Margin;){var c=o.diffs[0][0],d=o.diffs[0][1];1===c?(l.length2+=d.length,i+=d.length,l.diffs.push(o.diffs.shift()),s=!1):-1===c&&1==l.diffs.length&&0==l.diffs[0][0]&&d.length>2*t?(l.length1+=d.length,r+=d.length,s=!1,l.diffs.push(new T.Diff(c,d)),o.diffs.shift()):(d=d.substring(0,t-l.length1-this.Patch_Margin),l.length1+=d.length,r+=d.length,0===c?(l.length2+=d.length,i+=d.length):s=!1,l.diffs.push(new T.Diff(c,d)),d==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(d.length))}var a=(a=this.diff_text2(l.diffs)).substring(a.length-this.Patch_Margin),p=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==p&&(l.length1+=p.length,l.length2+=p.length,0!==l.diffs.length&&0===l.diffs[l.diffs.length-1][0]?l.diffs[l.diffs.length-1][1]+=p:l.diffs.push(new T.Diff(0,p))),s||e.splice(++n,0,l)}}},T.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},T.prototype.patch_fromText=function(e){var t=[];if(e)for(var n=e.split("\n"),o=0,r=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<n.length;){var i=n[o].match(r);if(!i)throw new Error("Invalid patch string: "+n[o]);var a=new T.patch_obj;for(t.push(a),a.start1=parseInt(i[1],10),""===i[2]?(a.start1--,a.length1=1):"0"==i[2]?a.length1=0:(a.start1--,a.length1=parseInt(i[2],10)),a.start2=parseInt(i[3],10),""===i[4]?(a.start2--,a.length2=1):"0"==i[4]?a.length2=0:(a.start2--,a.length2=parseInt(i[4],10)),o++;o<n.length;){var l=n[o].charAt(0);try{var s=decodeURI(n[o].substring(1))}catch(e){throw new Error("Illegal escape in patch_fromText: "+s)}if("-"==l)a.diffs.push(new T.Diff(-1,s));else if("+"==l)a.diffs.push(new T.Diff(1,s));else if(" "==l)a.diffs.push(new T.Diff(0,s));else{if("@"==l)break;if(""!==l)throw new Error('Invalid patch mode "'+l+'" in: '+s)}o++}}return t},(T.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],n=0;n<this.diffs.length;n++){switch(this.diffs[n][0]){case 1:e="+";break;case-1:e="-";break;case 0:e=" "}t[n+1]=e+encodeURI(this.diffs[n][1])+"\n"}return t.join("").replace(/%20/g," ")},e.exports=T,e.exports.diff_match_patch=T,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},664:(e,t,n)=>{n.d(t,{default:()=>H});function o(i,a,l){return T(void 0,void 0,void 0,function(){var t,o,r;return L(this,function(e){switch(e.label){case 0:return t=C(l),[4,A(a,t)];case 1:if(o=e.sent(),t.transform&&(o=t.transform(o)),i.innerHTML=o,i.classList.add("vditor-reset"),t.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(t.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return r="vditorI18nScript"+t.lang,document.querySelectorAll('head script[id^="'.concat("vditorI18nScript",'"]')).forEach(function(e){e.id!==r&&document.head.removeChild(e)}),[4,(0,k.G)("".concat(t.cdn,"/dist/js/i18n/").concat(t.lang,".js"),r)];case 3:e.sent(),e.label=4;case 4:return[3,6];case 5:window.VditorI18n=t.i18n,e.label=6;case 6:return t.icon?[4,(0,k.G)("".concat(t.cdn,"/dist/js/icons/").concat(t.icon,".js"),"vditorIconScript")]:[3,8];case 7:e.sent(),e.label=8;case 8:return(0,E.Z)(t.theme.current,t.theme.path),1===t.anchor&&i.classList.add("vditor-reset--anchor"),(0,d.O)(i,t.hljs),(0,m.s)(t.hljs,i,t.cdn),(0,h.H)(i,{cdn:t.cdn,math:t.math}),(0,g.i)(i,t.cdn,t.mode),(0,b.K)(i,t.cdn,t.mode),(0,p.P)(i,t.cdn),(0,u.v)(i,t.cdn),(0,c.p)(i,t.cdn,t.mode),(0,y.P)(i,t.cdn,t.mode),(0,w.B)(i,t.cdn),(0,s.Q)(i,t.cdn),t.render.media.enable&&(0,v.Y)(i),t.speech.enable&&_(i),0!==t.anchor&&(n=t.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(t){1===n&&t.classList.add("vditor-anchor--left"),t.onclick=function(){var e=t.getAttribute("href").substr(1),e=document.getElementById("vditorAnchor-"+e).offsetTop;document.querySelector("html").scrollTop=e}}),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),t.after&&t.after(),t.lazyLoadImage&&f(i),i.addEventListener("click",function(e){var e=(0,x.lG)(e.target,"SPAN");e&&(0,x.fb)(e,"vditor-toc")&&(e=i.querySelector("#"+e.getAttribute("data-target-id")))&&window.scrollTo(window.scrollX,e.offsetTop)}),[2]}var n})})}var s=n(386),t=n(781),c=n(379),d=n(895),p=n(169),u=n(572),m=n(702),f=function(e){void 0===e&&(e=document);function t(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src}),e.removeAttribute("data-src")}if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach(function(e){e.getAttribute("data-src")&&t(e)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)}))},h=n(982),v=n(431),g=n(570),b=n(593),y=n(558),r=n(182),w=n(931),i=n(793),E=n(652),k=n(998),x=n(118),a=n(2),l=n(65),S=n(307),_=function(o,r){var i,a,l,e,s;void 0===r&&(r="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance&&(e=function(){var t,n;return speechSynthesis.getVoices().forEach(function(e){e.lang===r.replace("_","-")&&(t=e),e.default&&(n=e)}),t=t||n},i='<svg><use xlink:href="#vditor-icon-play"></use></svg>',a='<svg><use xlink:href="#vditor-icon-pause"></use></svg>',document.getElementById("vditorIconScript")||(i='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',a='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>'),(l=document.querySelector(".vditor-speech"))||((l=document.createElement("button")).className="vditor-speech",o.insertAdjacentElement("beforeend",l),void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=e)),e=e(),(s=new SpeechSynthesisUtterance).voice=e,s.onend=s.onerror=function(){l.style.display="none",speechSynthesis.cancel(),l.classList.remove("vditor-speech--current"),l.innerHTML=i},o.addEventListener(void 0!==window.ontouchstart?"touchend":"click",function(e){var t,n=e.target;n.classList.contains("vditor-speech")||n.parentElement.classList.contains("vditor-speech")?(l.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),l.innerHTML=a):(speechSynthesis.pause(),l.innerHTML=i)):(s.text=l.getAttribute("data-text"),speechSynthesis.speak(s),l.classList.add("vditor-speech--current"),l.innerHTML=a),(0,S.Hc)(window.vditorSpeechRange),o.focus()):(l.style.display="none",speechSynthesis.cancel(),l.classList.remove("vditor-speech--current"),l.innerHTML=i,0!==getSelection().rangeCount&&(t=(n=getSelection().getRangeAt(0)).toString().trim())&&(window.vditorSpeechRange=n.cloneRange(),n=n.getBoundingClientRect(),l.innerHTML=i,l.style.display="block",l.style.top=n.top+n.height+document.querySelector("html").scrollTop-20+"px",void 0!==window.ontouchstart?l.style.left=e.changedTouches[e.changedTouches.length-1].pageX+2+"px":l.style.left=e.clientX+2+"px",l.setAttribute("data-text",t)))}))},T=function(e,a,l,s){return new(l=l||Promise)(function(n,t){function o(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof l?t:new l(function(e){e(t)})).then(o,r)}i((s=s.apply(e,a||[])).next())})},L=function(o,r){var i,a,l,s={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(n){return function(e){var t=[n,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(l=2&t[0]?a.return:t[0]?a.throw||((l=a.return)&&l.call(a),0):a.next)&&!(l=l.call(a,t[1])).done)return l;switch(a=0,(t=l?[2&t[0],l.value]:t)[0]){case 0:case 1:l=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!((l=0<(l=s.trys).length&&l[l.length-1])||6!==t[0]&&2!==t[0])){s=0;continue}if(3===t[0]&&(!l||t[1]>l[0]&&t[1]<l[3]))s.label=t[1];else if(6===t[0]&&s.label<l[1])s.label=l[1],l=t;else{if(!(l&&s.label<l[2])){l[2]&&s.ops.pop(),s.trys.pop();continue}s.label=l[2],s.ops.push(t)}}t=r.call(o,s)}catch(e){t=[6,e],a=0}finally{i=l=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},C=function(e){var t,n={anchor:0,cdn:i.g.CDN,customEmoji:{},emojiPath:"".concat(i.g.CDN,"/dist/images/emoji"),hljs:i.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:i.g.MARKDOWN_OPTIONS,math:i.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:i.g.THEME_OPTIONS};return e.cdn&&(null!=(t=e.theme)&&t.path||(n.theme.path="".concat(e.cdn,"/dist/css/content-theme")),e.emojiPath||(n.emojiPath="".concat(e.cdn,"/dist/images/emoji"))),(0,a.T)(n,e)},A=function(t,n){var o=C(n);return(0,k.G)("".concat(o.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){var e=(0,l.X)({autoSpace:o.markdown.autoSpace,gfmAutoLink:o.markdown.gfmAutoLink,codeBlockPreview:o.markdown.codeBlockPreview,emojiSite:o.emojiPath,emojis:o.customEmoji,fixTermTypo:o.markdown.fixTermTypo,footnotes:o.markdown.footnotes,headingAnchor:0!==o.anchor,inlineMathDigit:o.math.inlineDigit,lazyLoadImage:o.lazyLoadImage,linkBase:o.markdown.linkBase,linkPrefix:o.markdown.linkPrefix,listStyle:o.markdown.listStyle,mark:o.markdown.mark,mathBlockPreview:o.markdown.mathBlockPreview,paragraphBeginningSpace:o.markdown.paragraphBeginningSpace,sanitize:o.markdown.sanitize,toc:o.markdown.toc});return null!=n&&n.renderers&&e.SetJSRenderers({renderers:{Md2HTML:n.renderers}}),e.SetHeadingID(!0),e.Md2HTML(t)})},M=n(971),n=n(34);O.adapterRender=t,O.previewImage=M.E,O.codeRender=d.O,O.graphvizRender=u.v,O.highlightRender=m.s,O.mathRender=h.H,O.mermaidRender=g.i,O.markmapRender=b.K,O.flowchartRender=p.P,O.chartRender=c.p,O.abcRender=s.Q,O.mindmapRender=y.P,O.plantumlRender=w.B,O.outlineRender=r.k,O.mediaRender=v.Y,O.speechRender=_,O.lazyLoadImageRender=f,O.md2html=A,O.preview=o,O.setCodeTheme=n.Y,O.setContentTheme=E.Z;let H=O;function O(){}},793:(e,t,n)=>{n.d(t,{H:()=>o,g:()=>r});var o="3.10.5",r=(i.ZWSP="",i.DROP_EDITOR="application/editor",i.MOBILE_WIDTH=520,i.CLASS_MENU_DISABLED="vditor-menu--disabled",i.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"],i.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"],i.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"],i.CDN="https://unpkg.com/vditor@".concat("3.10.5"),i.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},i.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},i.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},i.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:"".concat(i.CDN,"/dist/css/content-theme")},i);function i(){}},386:(e,t,n)=>{n.d(t,{Q:()=>a});var o=n(793),r=n(998),i=n(781),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=o.g.CDN);var n=i.abcRenderAdapter.getElements(e);0<n.length&&(0,r.G)("".concat(t,"/dist/js/abcjs/abcjs_basic.min.js"),"vditorAbcjsScript").then(function(){n.forEach(function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,i.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))})})}},781:(e,t,n)=>{n.r(t),n.d(t,{abcRenderAdapter:()=>s,chartRenderAdapter:()=>l,flowchartRenderAdapter:()=>d,graphvizRenderAdapter:()=>c,markmapRenderAdapter:()=>i,mathRenderAdapter:()=>o,mermaidRenderAdapter:()=>r,mindmapRenderAdapter:()=>a,plantumlRenderAdapter:()=>p});var o={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},r={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-markmap")}},a={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},l={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},s={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},p={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},379:(e,t,n)=>{n.d(t,{p:()=>o});var r=n(793),i=n(998),a=n(781),o=function(e,t,o){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=a.chartRenderAdapter.getElements(e);0<n.length&&(0,i.G)("".concat(t,"/dist/js/echarts/echarts.min.js"),"vditorEchartsScript").then(function(){n.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t,n=a.chartRenderAdapter.getCode(e).trim();if(n)try{"true"!==e.getAttribute("data-processed")&&(t=JSON.parse(n),echarts.init(e,"dark"===o?"dark":void 0).setOption(t),e.setAttribute("data-processed","true"))}catch(n){e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>".concat(n)}}})})}},895:(e,t,n)=>{n.d(t,{O:()=>o});var a=n(528),l=n(793),o=function(n,i){Array.from(n.querySelectorAll("pre > code")).filter(function(e,t){return!(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||e.classList.contains("language-mermaid")||e.classList.contains("language-flowchart")||e.classList.contains("language-echarts")||e.classList.contains("language-mindmap")||e.classList.contains("language-plantuml")||e.classList.contains("language-markmap")||e.classList.contains("language-abc")||e.classList.contains("language-graphviz")||e.classList.contains("language-math")||-1<e.style.maxHeight.indexOf("px")||n.classList.contains("vditor-preview")&&5<t)}).forEach(function(e){var t=e.innerText,n=(e.classList.contains("highlight-chroma")?((n=e.cloneNode(!0)).querySelectorAll(".highlight-ln").forEach(function(e){e.remove()}),t=n.innerText):t.endsWith("\n")&&(t=t.substr(0,t.length-1)),'<svg><use xlink:href="#vditor-icon-copy"></use></svg>'),o=(document.getElementById("vditorIconScript")||(n='<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>'),document.createElement("div")),r=(o.className="vditor-copy",o.innerHTML='<span aria-label="'.concat((null==(r=window.VditorI18n)?void 0:r.copy)||"复制","\"\nonmouseover=\"this.setAttribute('aria-label', '").concat((null==(r=window.VditorI18n)?void 0:r.copy)||"复制","')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '").concat((null==(r=window.VditorI18n)?void 0:r.copied)||"已复制","');this.previousElementSibling.blur()\">").concat(n,"</span>"),document.createElement("textarea"));r.value=(0,a.X)(t),o.insertAdjacentElement("afterbegin",r),i&&i.renderMenu&&i.renderMenu(e,o),e.before(o),e.style.maxHeight=window.outerHeight-40+"px",e.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(l.g.ZWSP,"</span>"))})}},169:(e,t,n)=>{n.d(t,{P:()=>a});var o=n(793),r=n(998),i=n(781),a=function(e,t){void 0===t&&(t=o.g.CDN);var n=i.flowchartRenderAdapter.getElements(e);0!==n.length&&(0,r.G)("".concat(t,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){n.forEach(function(e){var t;"true"!==e.getAttribute("data-processed")&&(t=flowchart.parse(i.flowchartRenderAdapter.getCode(e)),e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true"))})})}},572:(e,t,n)=>{n.d(t,{v:()=>a});var o=n(793),r=n(998),i=n(781),a=function(e,t){void 0===t&&(t=o.g.CDN);var n=i.graphvizRenderAdapter.getElements(e);0!==n.length&&(0,r.G)("".concat(t,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){n.forEach(function(t){var e=i.graphvizRenderAdapter.getCode(t);if(!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!t.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==t.getAttribute("data-processed")&&""!==e.trim()){try{var n=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),o=(window.URL||window.webkitURL).createObjectURL(n),r=new Worker(o);new Viz({worker:r}).renderSVGElement(e).then(function(e){t.innerHTML=e.outerHTML}).catch(function(e){t.innerHTML="graphviz render error: <br>".concat(e),t.className="vditor-reset--error"})}catch(t){console.error("graphviz error",t)}t.setAttribute("data-processed","true")}})})}},702:(e,t,n)=>{n.d(t,{s:()=>o});var a=n(793),l=n(998),s=n(296),o=function(i,e,t){void 0===e&&(e=document),void 0===t&&(t=a.g.CDN);var n=i.style,o=(a.g.CODE_THEME.includes(n)||(n="github"),document.getElementById("vditorHljsStyle")),r="".concat(t,"/dist/js/highlight.js/styles/").concat(n,".css");o&&o.getAttribute("href")!==r&&o.remove(),(0,s.c)("".concat(t,"/dist/js/highlight.js/styles/").concat(n,".css"),"vditorHljsStyle"),!1!==i.enable&&0!==e.querySelectorAll("pre > code").length&&(0,l.G)("".concat(t,"/dist/js/highlight.js/highlight.pack.js"),"vditorHljsScript").then(function(){(0,l.G)("".concat(t,"/dist/js/highlight.js/solidity.min.js"),"vditorHljsSolidityScript").then(function(){(0,l.G)("".concat(t,"/dist/js/highlight.js/yul.min.js"),"vditorHljsYulScript").then(function(){e.querySelectorAll("pre > code").forEach(function(e){var n,o,r,t;e.parentElement.classList.contains("vditor-ir__marker--pre")||e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.classList.contains("language-mermaid")||e.classList.contains("language-flowchart")||e.classList.contains("language-echarts")||e.classList.contains("language-mindmap")||e.classList.contains("language-plantuml")||e.classList.contains("language-abc")||e.classList.contains("language-graphviz")||e.classList.contains("language-math")||(""!==i.defaultLang&&-1===e.className.indexOf("language-")&&e.classList.add("language-"+i.defaultLang),hljs.highlightElement(e),!i.lineNumber)||(e.classList.add("vditor-linenumber"),(n=e.querySelector(".vditor-linenumber__temp"))||((n=document.createElement("div")).className="vditor-linenumber__temp",e.insertAdjacentElement("beforeend",n)),t=getComputedStyle(e).whiteSpace,o="pre-wrap"!==t&&"pre-line"!==t?!1:!0,r="",(t=e.textContent.split(/\r\n|\r|\n/g)).pop(),t.map(function(e){var t="";o&&(n.textContent=e||"\n",t=' style="height:'.concat(n.getBoundingClientRect().height,'px"')),r+="<span".concat(t,"></span>")}),n.style.display="none",r='<span class="vditor-linenumber__rows">'.concat(r,"</span>"),e.insertAdjacentHTML("beforeend",r))})})})})}},593:(e,t,n)=>{n.d(t,{K:()=>o});var r=n(793),i=n(998),a=n(781),l={},s=function(e,t){var n=window.markmap,o=n.Transformer,r=n.Markmap,n=n.deriveOptions,o=new o;e.innerHTML='<svg style="width:100%"></svg>';var r=r.create(e.firstChild,null),t=(o=(e=o).transform(t),(t=Object.keys(o.features).filter(function(e){return!l[e]})).forEach(function(e){l[e]=!0}),e=e.getAssets(t),t=e.styles,e=e.scripts,i=window.markmap,t&&i.loadCSS(t),e&&i.loadJS(e),o),i=t.root,e=t.frontmatter,o=n(null==e?void 0:e.markmap);r.setData(i,o),r.fit()},o=function(e,t,n){void 0===t&&(t=r.g.CDN);var o=a.markmapRenderAdapter.getElements(e);0!==o.length&&(0,i.G)("".concat(t,"/dist/js/markmap/markmap.min.js"),"vditorMermaidScript").then(function(){o.forEach(function(e){var t,n=a.markmapRenderAdapter.getCode(e);"true"!==e.getAttribute("data-processed")&&""!==n.trim()&&((t=document.createElement("div")).className="language-markmap",e.parentNode.appendChild(t),s(t,n),"CODE"==e.parentNode.childNodes[0].nodeName)&&e.parentNode.removeChild(e.parentNode.childNodes[0])})})}},982:(e,t,n)=>{n.d(t,{H:()=>a});var o=n(793),r=n(998),i=n(296),s=n(528),c=n(781),a=function(e,n){var a,l=c.mathRenderAdapter.getElements(e);0!==l.length&&(e={cdn:o.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}},n&&n.math&&(n.math=Object.assign({},e.math,n.math)),"KaTeX"===(n=Object.assign({},e,n)).math.engine?((0,i.c)("".concat(n.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,r.G)("".concat(n.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,r.G)("".concat(n.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){l.forEach(function(t){if(!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.getAttribute("data-math")){var e=(0,s.X)(c.mathRenderAdapter.getCode(t));t.setAttribute("data-math",e);try{t.innerHTML=katex.renderToString(e,{displayMode:"DIV"===t.tagName,output:"html",macros:n.math.macros})}catch(e){t.innerHTML=e.message,t.className="language-math vditor-reset--error"}t.addEventListener("copy",function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))})}})})})):"MathJax"===n.math.engine&&(window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(n.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:n.math.macros}},Object.assign(window.MathJax,n.math.mathJaxOptions)),(0,r.J)("".concat(n.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript"),a=function(t,n){var o=(0,s.X)(t.textContent).trim(),e=window.MathJax.getMetricsFor(t);e.display="DIV"===t.tagName,window.MathJax.tex2svgPromise(o,e).then(function(e){t.innerHTML="",t.setAttribute("data-math",o),t.append(e),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();e=e.querySelector('[data-mml-node="merror"]');e&&""!==e.textContent.trim()&&(t.innerHTML=e.textContent.trim(),t.className="vditor-reset--error"),n&&n()})},window.MathJax.startup.promise.then(function(){for(var t,n,o,r,e=[],i=0;i<l.length;i++)(t=>{var n=l[t];n.parentElement.classList.contains("vditor-wysiwyg__pre")||n.parentElement.classList.contains("vditor-ir__marker--pre")||n.getAttribute("data-math")||!(0,s.X)(n.textContent).trim()||e.push(function(e){t===l.length-1?a(n):a(n,e)})})(i);0!==(t=e).length&&(n=0,o=t[t.length-1],(r=function(){var e=t[n++];e===o?e():e(r)})())})))}},431:(e,t,n)=>{n.d(t,{Y:()=>o});var f=n(446),o=function(e){e&&e.querySelectorAll("a").forEach(function(e){var n,o,r,t,i,a,l,s,c,d,p,u,m=e.getAttribute("href");m&&(m.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?((u=e).insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(m,'"></video>')),u.remove()):m.match(/^.+.(mp3|wav|flac)$/)?((u=e).insertAdjacentHTML("afterend",'<audio controls="controls" src="'.concat(m,'"></audio>')),u.remove()):(e=e,t=(m=m).match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),i=m.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),a=m.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),l=m.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),s=m.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),c=m.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),d=m.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),p=m.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/),t&&11===t[1].length?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'.concat(t[1]+(t[2]?"?start="+t[2]:""),'"></iframe>')),e.remove()):i&&i[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'.concat(i[1],'"></iframe>')),e.remove()):a&&a[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='.concat(a[1],'"></iframe>')),e.remove()):l&&l[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'.concat(l[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),e.remove()):s&&s[0]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='.concat(encodeURIComponent(s[0]),'"></iframe>')),e.remove()):c&&c[2]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'.concat(c[2],'"></iframe>')),e.remove()):-1<m.indexOf("bilibili.com")&&(-1<m.indexOf("bvid=")||d&&d[1])?(n={bvid:(0,f.o)("bvid",m)||d&&d[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"},new URL(m.startsWith("http")?m:"https:"+m).search.split("&").forEach(function(e,t){e&&(t=(e=0===t?e.substr(1):e).split("="),n[t[0]]=t[1])}),o="https://player.bilibili.com/player.html?",(r=Object.keys(n)).forEach(function(e,t){o+="".concat(e,"=").concat(n[e]),t<r.length-1&&(o+="&")}),e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(o,'"></iframe>')),e.remove()):p&&p[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(p[1],'"></iframe>')),e.remove())))})}},570:(e,t,n)=>{n.d(t,{i:()=>o});var r=n(793),i=n(998),a=n(781),l=n(446),s=function(e,a,l,s){return new(l=l||Promise)(function(n,t){function o(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof l?t:new l(function(e){e(t)})).then(o,r)}i((s=s.apply(e,a||[])).next())})},c=function(o,r){var i,a,l,s={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(n){return function(e){var t=[n,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(l=2&t[0]?a.return:t[0]?a.throw||((l=a.return)&&l.call(a),0):a.next)&&!(l=l.call(a,t[1])).done)return l;switch(a=0,(t=l?[2&t[0],l.value]:t)[0]){case 0:case 1:l=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!((l=0<(l=s.trys).length&&l[l.length-1])||6!==t[0]&&2!==t[0])){s=0;continue}if(3===t[0]&&(!l||t[1]>l[0]&&t[1]<l[3]))s.label=t[1];else if(6===t[0]&&s.label<l[1])s.label=l[1],l=t;else{if(!(l&&s.label<l[2])){l[2]&&s.ops.pop(),s.trys.pop();continue}s.label=l[2],s.ops.push(t)}}t=r.call(o,s)}catch(e){t=[6,e],a=0}finally{i=l=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},o=function(e,t,n){void 0===t&&(t=r.g.CDN);var o=a.mermaidRenderAdapter.getElements(e);0!==o.length&&(0,i.G)("".concat(t,"/dist/js/mermaid/mermaid.min.js"),"vditorMermaidScript").then(function(){var e={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};"dark"===n&&(e.theme="dark"),mermaid.initialize(e),o.forEach(function(r){return s(void 0,void 0,void 0,function(){var t,n,o;return c(this,function(e){switch(e.label){case 0:if(t=a.mermaidRenderAdapter.getCode(r),"true"===r.getAttribute("data-processed")||""===t.trim())return[2];t="mermaid"+(0,l.W)(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,mermaid.render(t,r.textContent)];case 2:return n=e.sent(),r.innerHTML=n.svg,[3,4];case 3:return n=e.sent(),o=document.querySelector("#"+t),r.innerHTML="".concat(o.outerHTML,'<br>\n<div style="text-align: left"><small>').concat(n.message.replace(/\n/,"<br>"),"</small></div>"),o.parentElement.remove(),[3,4];case 4:return r.setAttribute("data-processed","true"),[2]}})})})})}},558:(e,t,n)=>{n.d(t,{P:()=>o});var r=n(793),i=n(998),a=n(781),o=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var o=a.mindmapRenderAdapter.getElements(e);0<o.length&&(0,i.G)("".concat(t,"/dist/js/echarts/echarts.min.js"),"vditorEchartsScript").then(function(){o.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=a.mindmapRenderAdapter.getCode(e);if(t)try{"true"!==e.getAttribute("data-processed")&&(echarts.init(e,"dark"===n?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(e,t){return null!=(t=null==t?void 0:t.data)&&t.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true"))}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>".concat(t)}}})})}},182:(e,t,n)=>{n.d(t,{k:()=>o});var s=n(946),c=n(982),o=function(r,i,a){var e,t,o="",l=[];return Array.from(r.children).forEach(function(e,t){var n;(0,s.W)(e)&&(a&&(n=e.id.lastIndexOf("_"),e.id=e.id.substring(0,-1===n?void 0:n)+"_"+t),l.push(e.id),o+=e.outerHTML.replace("<wbr>",""))}),""===o?i.innerHTML="":(e=document.createElement("div"),a?(a.lute.SetToC(!0),"wysiwyg"!==a.currentMode||a.preview.element.contains(r)?"ir"!==a.currentMode||a.preview.element.contains(r)?e.innerHTML=a.lute.HTML2VditorDOM("<p>[ToC]</p>"+o):e.innerHTML=a.lute.SpinVditorIRDOM("<p>[ToC]</p>"+o):e.innerHTML=a.lute.SpinVditorDOM("<p>[ToC]</p>"+o),a.lute.SetToC(a.options.preview.markdown.toc)):(i.classList.add("vditor-outline"),(t=Lute.New()).SetToC(!0),e.innerHTML=t.HTML2VditorDOM("<p>[ToC]</p>"+o)),(t=e.firstElementChild.querySelectorAll("li > span[data-target-id]")).forEach(function(e,t){var n;e.nextElementSibling&&"UL"===e.nextElementSibling.tagName?(n="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>",document.getElementById("vditorIconScript")||(n='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML="".concat(n,"<span>").concat(e.innerHTML,"</span>")):e.innerHTML="<svg></svg><span>".concat(e.innerHTML,"</span>"),e.setAttribute("data-target-id",l[t])}),o=e.firstElementChild.innerHTML,0===t.length?i.innerHTML="":(i.innerHTML=o,a&&(0,c.H)(i,{cdn:a.options.cdn,math:a.options.preview.math}),i.firstElementChild.addEventListener("click",function(e){for(var t=e.target;t&&!t.isEqualNode(i);){if(t.classList.contains("vditor-outline__action")){t.classList.contains("vditor-outline__action--close")?(t.classList.remove("vditor-outline__action--close"),t.parentElement.nextElementSibling.setAttribute("style","display:block")):(t.classList.add("vditor-outline__action--close"),t.parentElement.nextElementSibling.setAttribute("style","display:none")),e.preventDefault(),e.stopPropagation();break}if(t.getAttribute("data-target-id")){e.preventDefault(),e.stopPropagation();var n,o=document.getElementById(t.getAttribute("data-target-id"));if(!o)return;a?"auto"===a.options.height?(n=o.offsetTop+a.element.offsetTop,a.options.toolbarConfig.pin||(n+=a.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,n)):(a.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,a.element.offsetTop),a.preview.element.contains(r)?r.parentElement.scrollTop=o.offsetTop:r.scrollTop=o.offsetTop):window.scrollTo(window.scrollX,o.offsetTop);break}t=t.parentElement}})),o)}},931:(e,t,n)=>{n.d(t,{B:()=>a});var o=n(793),r=n(998),i=n(781),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=o.g.CDN);var n=i.plantumlRenderAdapter.getElements(e);0!==n.length&&(0,r.G)("".concat(t,"/dist/js/plantuml/plantuml-encoder.min.js"),"vditorPlantumlScript").then(function(){n.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'.concat(plantumlEncoder.encode(t),'"/>')}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>".concat(t)}}})})}},65:(e,t,n)=>{n.d(t,{X:()=>o});var o=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),t.SetGFMAutoLink(e.gfmAutoLink),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},971:(e,t,n)=>{n.d(t,{E:()=>o});var o=function(t,e,n){void 0===e&&(e="zh_CN"),void 0===n&&(n="classic");var e=t.getBoundingClientRect(),o=(document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'.concat("dark"===n?" vditor--dark":"",'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n ').concat(window.VditorI18n.spin,"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X ").concat(window.VditorI18n.close,'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: ').concat(t.width,"px;height:").concat(t.height,"px;transform: translate3d(").concat(e.left,"px, ").concat(e.top-36,'px, 0)" src="').concat(t.getAttribute("src"),'">\n </div>\n</div>')),document.body.style.overflow="hidden",document.querySelector(".vditor-img img")),r="translate3d(".concat(Math.max(0,window.innerWidth-t.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-36-t.naturalHeight)/2,"px, 0)"),i=(setTimeout(function(){o.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(r)),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)}),document.querySelector(".vditor-img__btn"));i.addEventListener("click",function(){var e=parseInt(i.getAttribute("data-deg"),10)+90;e/90%2==1&&t.naturalWidth>o.parentElement.clientHeight?o.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-t.naturalWidth)/2,"px, ").concat(t.naturalWidth/2-t.naturalHeight/2,"px, 0) rotateZ(").concat(e,"deg)"):o.style.transform="".concat(r," rotateZ(").concat(e,"deg)"),i.setAttribute("data-deg",e.toString()),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)})}},34:(e,t,n)=>{n.d(t,{Y:()=>i});var o=n(793),r=n(296),i=function(e,t){void 0===t&&(t=o.g.CDN),o.g.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),t="".concat(t,"/dist/js/highlight.js/styles/").concat(e,".css");n?n.getAttribute("href")!==t&&(n.remove(),(0,r.c)(t,"vditorHljsStyle")):(0,r.c)(t,"vditorHljsStyle")}},652:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(296),r=function(e,t){var n;e&&t&&(n=document.getElementById("vditorContentTheme"),t="".concat(t,"/").concat(e,".css"),n?n.getAttribute("href")!==t&&(n.remove(),(0,o.c)(t,"vditorContentTheme")):(0,o.c)(t,"vditorContentTheme"))}},998:(e,t,n)=>{n.d(t,{G:()=>r,J:()=>o});var o=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest,e=(n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send(""),document.createElement("script"));e.type="text/javascript",e.text=n.responseText,e.id=t,document.head.appendChild(e)},r=function(o,r){return new Promise(function(e,t){if(document.getElementById(r))return e(!0),!1;var n=document.createElement("script");n.src=o,n.async=!0,document.head.appendChild(n),n.onerror=function(e){t(e)},n.onload=function(){if(document.getElementById(r))return n.remove(),e(!0),!1;n.id=r,e(!0)}})}},296:(e,t,n)=>{n.d(t,{c:()=>o});var o=function(e,t){var n;document.getElementById(t)||((n=document.createElement("link")).id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n))}},528:(e,t,n)=>{n.d(t,{X:()=>o});var o=function(e){return e.replace(/\u00a0/g," ")}},796:(e,t,n)=>{n.d(t,{G6:()=>o,Le:()=>a,i7:()=>c,ns:()=>s,pK:()=>i,vU:()=>r,yl:()=>l});var o=function(){return-1<navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")},r=function(){return-1<navigator.userAgent.toLowerCase().indexOf("firefox")},i=function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}},a=function(){return-1<navigator.userAgent.indexOf("iPhone")?"touchstart":"click"},l=function(e){return 0<=navigator.platform.toUpperCase().indexOf("MAC")?!(!e.metaKey||e.ctrlKey):!(e.metaKey||!e.ctrlKey)},s=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?-1<e.indexOf("⇧")&&r()&&(e=e.replace(";",":").replace("=","+").replace("-","_")):-1<(e=(e=e.startsWith("⌘")?e.replace("⌘","⌘+"):e.startsWith("⌥")&&"⌘"!==e.substr(1,1)?e.replace("⌥","⌥+"):e.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")&&(e=e.replace(";",":").replace("=","+").replace("-","_")),e},c=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},446:(e,t,n)=>{n.d(t,{W:()=>o,o:()=>r});var o=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(parseInt(e,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(e,10)/4).toString(16)})},r=function(e,t){var t=(t=void 0===t?window.location.search:t).substring(t.indexOf("?")),n=t.indexOf("#");return new URLSearchParams(t.substring(0,0<=n?n:void 0)).get(e)}},118:(e,t,n)=>{n.d(t,{DX:()=>p,E2:()=>r,F9:()=>s,JQ:()=>o,O9:()=>a,a1:()=>l,fb:()=>d,lG:()=>c});var i=n(946),o=function(e,t){for(var n,o=d(e,t),r=!1;o&&!o.classList.contains("vditor-reset")&&!r;)(n=d(o.parentElement,t))?o=n:r=!0;return o||!1},r=function(e,t){for(var n,o=(0,i.S)(e,t),r=!1;o&&!o.classList.contains("vditor-reset")&&!r;)(n=(0,i.S)(o.parentElement,t))?o=n:r=!0;return o||!1},a=function(e){var t=r(e,"UL"),e=r(e,"OL"),n=t;return n=!e||t&&!e.contains(t)?n:e},l=function(e,t,n){if(!e)return!1;for(var o=e=3===e.nodeType?e.parentElement:e,r=!1;o&&!r&&!o.classList.contains("vditor-reset");)o.getAttribute(t)===n?r=!0:o=o.parentElement;return r&&o},s=function(e){if(!e)return!1;var t=e=3===e.nodeType?e.parentElement:e,n=!1,e=l(e,"data-block","0");if(e)return e;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},c=function(e,t){if(!e)return!1;for(var n=e=3===e.nodeType?e.parentElement:e,o=!1;n&&!o&&!n.classList.contains("vditor-reset");)n.nodeName===t?o=!0:n=n.parentElement;return o&&n},d=function(e,t){if(!e)return!1;for(var n=e=3===e.nodeType?e.parentElement:e,o=!1;n&&!o&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?o=!0:n=n.parentElement;return o&&n},p=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},946:(e,t,n)=>{n.d(t,{S:()=>o,W:()=>r});var o=function(e,t){if(!e)return!1;for(var n=e=3===e.nodeType?e.parentElement:e,o=!1;n&&!o&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?o=!0:n=n.parentElement;return o&&n},r=function(e){e=o(e,"H");return!(!e||2!==e.tagName.length||"HR"===e.tagName)&&e}},2:(e,t,n)=>{n.d(t,{T:()=>a});var a=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},o=0;o<e.length;o++){r=void 0;i=void 0;var r=e[o];for(var i in r)r.hasOwnProperty(i)&&("[object Object]"===Object.prototype.toString.call(r[i])?n[i]=a(n[i],r[i]):n[i]=r[i])}return n}},307:(e,t,n)=>{n.d(t,{$j:()=>p,Gb:()=>s,Hc:()=>d,Ny:()=>l,ib:()=>u,im:()=>c,oC:()=>m,zh:()=>a});var o=n(793),r=n(796),i=n(118),a=function(e){var t,n=e[e.currentMode].element;return 0<getSelection().rangeCount&&(t=getSelection().getRangeAt(0),n.isEqualNode(t.startContainer)||n.contains(t.startContainer))?t:e[e.currentMode].range||(n.focus(),(t=n.ownerDocument.createRange()).setStart(n,0),t.collapse(!0),t)},l=function(e){var t=window.getSelection().getRangeAt(0);if(!e.contains(t.startContainer)&&!(0,i.fb)(t.startContainer,"vditor-panel--none"))return{left:0,top:0};e=e.parentElement.getBoundingClientRect();if(0===t.getClientRects().length)if(3===t.startContainer.nodeType){var n=t.startContainer.parentElement;if(!(n&&0<n.getClientRects().length))return{left:0,top:0};n=n.getClientRects()[0]}else{var o=t.startContainer.children;if(o[t.startOffset]&&0<o[t.startOffset].getClientRects().length?n=o[t.startOffset].getClientRects()[0]:0<t.startContainer.childNodes.length?(o=t.cloneRange(),t.selectNode(t.startContainer.childNodes[Math.max(0,t.startOffset-1)]),n=t.getClientRects()[0],t.setEnd(o.endContainer,o.endOffset),t.setStart(o.startContainer,o.startOffset)):n=t.startContainer.getClientRects()[0],!n){for(var r=t.startContainer.childNodes[t.startOffset];!r.getClientRects||(r.getClientRects,0===r.getClientRects().length);)r=r.parentElement;n=r.getClientRects()[0]}}else n=t.getClientRects()[0];return{left:n.left-e.left,top:n.top-e.top}},s=function(e,t){if(!t){if(0===getSelection().rangeCount)return!1;t=getSelection().getRangeAt(0)}t=t.commonAncestorContainer;return e.isEqualNode(t)||e.contains(t)},d=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},c=function(e,t,n){var o={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return o;n=window.getSelection().getRangeAt(0)}return s(t,n)&&(t=n.cloneRange(),e.childNodes[0]&&e.childNodes[0].childNodes[0]?t.setStart(e.childNodes[0].childNodes[0],0):t.selectNodeContents(e),t.setEnd(n.startContainer,n.startOffset),o.start=t.toString().length,o.end=o.start+n.toString().length),o},p=function(e,t,n){var o=0,r=0,i=n.childNodes[r],a=!1,l=!1,s=(e=Math.max(0,e),t=Math.max(0,t),n.ownerDocument.createRange());for(s.setStart(i||n,0),s.collapse(!0);!l&&i;){var c=o+i.textContent.length;if(!a&&o<=e&&e<=c&&(0===e?s.setStart(i,0):3===i.childNodes[0].nodeType?s.setStart(i.childNodes[0],e-o):i.nextSibling?s.setStartBefore(i.nextSibling):s.setStartAfter(i),a=!0,e===t)){l=!0;break}a&&o<=t&&t<=c&&(0===t?s.setEnd(i,0):3===i.childNodes[0].nodeType?s.setEnd(i.childNodes[0],t-o):i.nextSibling?s.setEndBefore(i.nextSibling):s.setEndAfter(i),l=!0),o=c,i=n.childNodes[++r]}return!l&&n.childNodes[r-1]&&s.setStartBefore(n.childNodes[r-1]),d(s),s},u=function(e,t){e=e.querySelector("wbr");if(e){if(e.previousElementSibling)if(e.previousElementSibling.isSameNode(e.previousSibling)){if(e.previousElementSibling.lastChild)return t.setStartBefore(e),t.collapse(!0),d(t),!(0,r.i7)()||"EM"!==e.previousElementSibling.tagName&&"STRONG"!==e.previousElementSibling.tagName&&"S"!==e.previousElementSibling.tagName||(t.insertNode(document.createTextNode(o.g.ZWSP)),t.collapse(!1)),void e.remove();t.setStartAfter(e.previousElementSibling)}else t.setStart(e.previousSibling,e.previousSibling.textContent.length);else e.previousSibling?t.setStart(e.previousSibling,e.previousSibling.textContent.length):e.nextSibling?3===e.nextSibling.nodeType?t.setStart(e.nextSibling,0):t.setStartBefore(e.nextSibling):t.setStart(e.parentElement,0);t.collapse(!0),e.remove(),d(t)}},m=function(e,t){var n,o=document.createElement("div"),r=(o.innerHTML=e,o.querySelectorAll("p")),o=(1===r.length&&!r[0].previousSibling&&!r[0].nextSibling&&0<t[t.currentMode].element.children.length&&"P"===o.firstElementChild.tagName&&(e=r[0].innerHTML.trim()),document.createElement("div")),r=(o.innerHTML=e,a(t));""!==r.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),o.firstElementChild&&"0"===o.firstElementChild.getAttribute("data-block")?(o.lastElementChild.insertAdjacentHTML("beforeend","<wbr>"),(n=(0,i.F9)(r.startContainer))?n.insertAdjacentHTML("afterend",o.innerHTML):t[t.currentMode].element.insertAdjacentHTML("beforeend",o.innerHTML),u(t[t.currentMode].element,r)):((n=document.createElement("template")).innerHTML=e,r.insertNode(n.content.cloneNode(!0)),r.collapse(!1),d(r))}}},w={};function o(e){var t=w[e];return void 0!==t||(t=w[e]={exports:{}},y[e](t,t.exports,o)),t.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var E={};{function S(e,t){var n;(e=(0,B.lG)(e.target,"SPAN"))&&(0,B.fb)(e,"vditor-toc")&&(e=t[t.currentMode].element.querySelector("#"+e.getAttribute("data-target-id")))&&("auto"===t.options.height?(n=e.offsetTop+t.element.offsetTop,t.options.toolbarConfig.pin||(n+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,n)):(t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=e.offsetTop))}function _(e){"dark"===e.options.theme?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")}o.d(E,{default:()=>e});var T,L=o(664),N=o(793),C=o(528),D=function(e){return"sv"===e.currentMode?(0,C.X)("".concat(e.sv.element.textContent,"\n").replace(/\n\n$/,"\n")):"wysiwyg"===e.currentMode?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},A=o(998),M=(fe.prototype.renderEchart=function(e){var t=this;"block"===e.devtools.element.style.display&&(0,A.G)("".concat(e.options.cdn,"/dist/js/echarts/echarts.min.js"),"vditorEchartsScript").then(function(){t.ASTChart||(t.ASTChart=echarts.init(e.devtools.element.lastElementChild));try{t.element.lastElementChild.style.display="block",t.element.firstElementChild.innerHTML="",t.ASTChart.setOption({series:[{data:JSON.parse(e.lute.RenderEChartsJSON(D(e))),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}}),t.ASTChart.resize()}catch(e){t.element.lastElementChild.style.display="none",t.element.firstElementChild.innerHTML=e}})},fe),I=o(796),j=function(t,e){e.forEach(function(e){t[e]&&(e=t[e].children[0])&&e.classList.contains("vditor-menu--current")&&e.classList.remove("vditor-menu--current")})},R=function(t,e){e.forEach(function(e){t[e]&&(e=t[e].children[0])&&!e.classList.contains("vditor-menu--current")&&e.classList.add("vditor-menu--current")})},P=function(t,e){e.forEach(function(e){t[e]&&(e=t[e].children[0])&&e.classList.contains(N.g.CLASS_MENU_DISABLED)&&e.classList.remove(N.g.CLASS_MENU_DISABLED)})},q=function(t,e){e.forEach(function(e){t[e]&&(e=t[e].children[0])&&!e.classList.contains(N.g.CLASS_MENU_DISABLED)&&e.classList.add(N.g.CLASS_MENU_DISABLED)})},H=function(t,e){e.forEach(function(e){t[e]&&(t[e].style.display="none")})},O=function(t,e){e.forEach(function(e){t[e]&&(t[e].style.display="block")})},s=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(e){n&&e.isEqualNode(n)||(e.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")},a=function(t,n,o,e){o.addEventListener((0,I.Le)(),function(e){e.preventDefault(),e.stopPropagation(),o.classList.contains(N.g.CLASS_MENU_DISABLED)||(t.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(e){e.classList.remove("vditor-hint--current")}),"block"===n.style.display?n.style.display="none":(s(t,["subToolbar","hint","popover"],o.parentElement.parentElement),o.classList.contains("vditor-tooltipped")||o.classList.add("vditor-hint--current"),n.style.display="block",t.toolbar.element.getBoundingClientRect().right-o.getBoundingClientRect().right<250?n.classList.add("vditor-panel--left"):n.classList.remove("vditor-panel--left")))})},B=o(118),z=o(946),J=function(e,t,n,o){o&&console.log("".concat(e," - ").concat(n,": ").concat(t))},X=o(386),Y=o(379),Q=o(895),$=o(169),ee=o(572),te=o(702),ne=o(982),oe=o(570),re=o(593),ie=o(558),ae=o(931),U=function(t,n){var o;t&&("html-block"!==t.parentElement.getAttribute("data-type")&&("abc"===(o=t.firstElementChild.className.replace("language-",""))?(0,X.Q)(t,n.options.cdn):"mermaid"===o?(0,oe.i)(t,n.options.cdn,n.options.theme):"markmap"===o?(0,re.K)(t,n.options.cdn,n.options.theme):"flowchart"===o?(0,$.P)(t,n.options.cdn):"echarts"===o?(0,Y.p)(t,n.options.cdn,n.options.theme):"mindmap"===o?(0,ie.P)(t,n.options.cdn,n.options.theme):"plantuml"===o?(0,ae.B)(t,n.options.cdn):"graphviz"===o?(0,ee.v)(t,n.options.cdn):"math"===o?(0,ne.H)(t,{cdn:n.options.cdn,math:n.options.preview.math}):n.options.customRenders.find(function(e){if(e.language===o)return e.render(t,n),!0})||((0,te.s)(Object.assign({},n.options.preview.hljs),t,n.options.cdn),(0,Q.O)(t,n.options.preview.hljs))),t.setAttribute("data-render","1"))},V=o(307),h=function(t){var e,n;"sv"!==t.currentMode&&(e=t[t.currentMode].element,""===(n=t.outline.render(t))&&(n="[ToC]"),e.querySelectorAll('[data-type="toc-block"]').forEach(function(e){e.innerHTML=n,(0,ne.H)(e,{cdn:t.options.cdn,math:t.options.preview.math})}))},le=function(e,t,n,o){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if("Backspace"===n.key&&0===(0,V.im)(e,t[t.currentMode].element,o).start)return e.previousElementSibling.remove(),x(t),!0;if(mt(t,n,o,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if("Delete"===n.key&&(0,V.im)(e,t[t.currentMode].element,o).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),x(t),!0;if(ut(t,n,o,e,e.nextElementSibling))return!0}if("Backspace"===n.key||"Delete"===n.key){e=(0,B.fb)(o.startContainer,"vditor-toc");if(e)return e.remove(),x(t),!0}},se=function(t,e,n,o){void 0===n&&(n=!1);var r=(0,B.F9)(e.startContainer);if(r&&!n&&"code-block"!==r.getAttribute("data-type")){if(bt(r.innerHTML)&&r.previousElementSibling||yt(r.innerHTML))return;for(var i=(0,V.im)(r,t.ir.element,e).start,a=!0,l=i-1;l>r.textContent.substr(0,i).lastIndexOf("\n");l--)if(" "!==r.textContent.charAt(l)&&"\t"!==r.textContent.charAt(l)){a=!1;break}0===i&&(a=!1);for(var s=!0,l=i-1;l<r.textContent.length;l++)if(" "!==r.textContent.charAt(l)&&"\n"!==r.textContent.charAt(l)){s=!1;break}if(a)return void("function"==typeof t.options.input&&t.options.input(D(t)));if(s&&!(0,B.fb)(e.startContainer,"vditor-ir__marker"))return(n=e.startContainer.previousSibling)&&3!==n.nodeType&&n.classList.contains("vditor-ir__node--expand")&&n.classList.remove("vditor-ir__node--expand"),void("function"==typeof t.options.input&&t.options.input(D(t)))}t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")}),(r=r||t.ir.element).querySelector("wbr")||((n=(0,B.fb)(e.startContainer,"vditor-ir__preview"))?n.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):e.insertNode(document.createElement("wbr"))),r.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")});var c,d,n=(r="link-ref-defs-block"===r.getAttribute("data-type")?t.ir.element:r).isEqualNode(t.ir.element),p=(0,B.a1)(r,"data-type","footnotes-block"),u="";n?u=r.innerHTML:(d=(0,z.S)(e.startContainer,"BLOCKQUOTE"),(f=(0,B.O9)(e.startContainer))&&(r=f),!d||f&&d.contains(f)||(r=d),u=(r=p?p:r).outerHTML,"UL"===r.tagName||"OL"===r.tagName?(f=r.previousElementSibling,d=r.nextElementSibling,!f||"UL"!==f.tagName&&"OL"!==f.tagName||(u=f.outerHTML+u,f.remove()),!d||"UL"!==d.tagName&&"OL"!==d.tagName||(u+=d.outerHTML,d.remove()),u=u.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")):r.previousElementSibling&&""!==r.previousElementSibling.textContent.replace(N.g.ZWSP,"")&&o&&"insertParagraph"===o.inputType&&(u=r.previousElementSibling.outerHTML+u,r.previousElementSibling.remove()),r.innerText.startsWith("```")||(t.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!r.isEqualNode(e)&&(u+=e.outerHTML,e.remove())}),t.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!r.isEqualNode(e)&&(u+=e.outerHTML,e.remove())}))),J("SpinVditorIRDOM",u,"argument",t.options.debugger),u=t.lute.SpinVditorIRDOM(u),J("SpinVditorIRDOM",u,"result",t.options.debugger),n?r.innerHTML=u:(r.outerHTML=u,p&&(f=(0,B.a1)(t.ir.element.querySelector("wbr"),"data-type","footnotes-def"))&&(o=(d=f.textContent).substring(1,d.indexOf("]:")),n=t.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(o,'"]')))&&n.setAttribute("aria-label",d.substr(o.length+3).trim().substr(0,24)));var m,p=t.ir.element.querySelectorAll("[data-type='link-ref-defs-block']"),f=(p.forEach(function(e,t){0===t?c=e:(c.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),0<p.length&&t.ir.element.insertAdjacentElement("beforeend",p[0]),t.ir.element.querySelectorAll("[data-type='footnotes-block']"));f.forEach(function(e,t){0===t?m=e:(m.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),0<f.length&&t.ir.element.insertAdjacentElement("beforeend",f[0]),(0,V.ib)(t.ir.element,e),t.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){U(e,t)}),h(t),v(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},p=function(e,t){var n,o;return!(""===e||(-1===e.indexOf("⇧")&&-1===e.indexOf("⌘")&&-1===e.indexOf("⌥")?(0,I.yl)(t)||t.altKey||t.shiftKey||t.code!==e:"⇧Tab"===e?(0,I.yl)(t)||t.altKey||!t.shiftKey||"Tab"!==t.code:(n=e.split(""),e.startsWith("⌥")?(o=3===n.length?n[2]:n[1],(3===n.length?!(0,I.yl)(t):(0,I.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(o)?"Digit":"Key")+o):(e=(o=2<(n="⌘Enter"===e?["⌘","Enter"]:n).length&&"⇧"===n[0])?n[2]:n[1],!o||!(0,I.vU)()&&/Mac/.test(navigator.platform)||("-"===e?e="_":"="===e&&(e="+")),!(0,I.yl)(t)||t.key.toLowerCase()!==e.toLowerCase()||t.altKey||!(!o&&!t.shiftKey||o&&t.shiftKey)))))},ce=function(o,e){e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")});var t,e=(0,B.JQ)(o.startContainer,"vditor-ir__node"),n=!o.collapsed&&(0,B.JQ)(o.endContainer,"vditor-ir__node");if(o.collapsed||e&&e===n){e&&(e.classList.add("vditor-ir__node--expand"),e.classList.remove("vditor-ir__node--hidden"),(0,V.Hc)(o));n=(()=>{var e=o.startContainer;if(3!==e.nodeType||e.nodeValue.length===o.startOffset){for(var t=e.nextSibling;t&&""===t.textContent;)t=t.nextSibling;if(t)return!(!t||3===t.nodeType||!t.classList.contains("vditor-ir__node")||t.getAttribute("data-block"))&&t;var n=(0,B.fb)(e,"vditor-ir__marker");if(n&&!n.nextSibling){n=e.parentElement.parentElement.nextSibling;if(n&&3!==n.nodeType&&n.classList.contains("vditor-ir__node"))return n}}return!1})();if(!n)return e=o.startContainer,t=e.previousSibling,(e=!(3!==e.nodeType||0!==o.startOffset||!t||3===t.nodeType||!t.classList.contains("vditor-ir__node")||t.getAttribute("data-block"))&&t)?(e.classList.add("vditor-ir__node--expand"),void e.classList.remove("vditor-ir__node--hidden")):void 0;n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden")}},de=o(971),pe=function(e,r){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(e){for(var t=e.parentElement,n=t.nextSibling;n&&n.textContent.startsWith(" ");){var o=n;o.childNodes.forEach(function(e){t.append(e.cloneNode(!0))}),n=n.nextSibling,o.remove()}r&&r(t)})},c=function(t,e){var n,o=getSelection().getRangeAt(0).cloneRange(),r=o.startContainer,i=(3!==o.startContainer.nodeType&&"DIV"===o.startContainer.tagName&&(r=o.startContainer.childNodes[o.startOffset-1]),(0,B.a1)(r,"data-block","0"));if(i&&e&&("deleteContentBackward"===e.inputType||" "===e.data)){for(var a=(0,V.im)(i,t.sv.element,o).start,l=!0,s=a-1;s>i.textContent.substr(0,a).lastIndexOf("\n");s--)if(" "!==i.textContent.charAt(s)&&"\t"!==i.textContent.charAt(s)){l=!1;break}if(l=0===a?!1:l)return void u(t);if("deleteContentBackward"===e.inputType){var c=(0,B.a1)(r,"data-type","code-block-open-marker")||(0,B.a1)(r,"data-type","code-block-close-marker");if(c){if("code-block-close-marker"===c.getAttribute("data-type")&&(d=We(r,"code-block-open-marker")))return d.textContent=c.textContent,void u(t);if("code-block-open-marker"===c.getAttribute("data-type")&&(d=We(r,"code-block-close-marker",!1)))return d.textContent=c.textContent,void u(t)}var d=(0,B.a1)(r,"data-type","math-block-open-marker");if(d)return void((c=d.nextElementSibling.nextElementSibling)&&"math-block-close-marker"===c.getAttribute("data-type")&&(c.remove(),u(t)));i.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()}),i.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()});var d=(0,B.a1)(r,"data-type","heading-marker");if(d&&-1===d.textContent.indexOf("#"))return void u(t)}if((" "===e.data||"deleteContentBackward"===e.inputType)&&((0,B.a1)(r,"data-type","padding")||(0,B.a1)(r,"data-type","li-marker")||(0,B.a1)(r,"data-type","task-marker")||(0,B.a1)(r,"data-type","blockquote-marker")))return void u(t)}i&&"$$"===i.textContent.trimRight()?u(t):("link-ref-defs-block"===(null==(c=(i=i||t.sv.element).firstElementChild)?void 0:c.getAttribute("data-type"))&&(i=t.sv.element),-1===(i=(0,B.a1)(r,"data-type","footnotes-link")?t.sv.element:i).textContent.indexOf(Lute.Caret)&&o.insertNode(document.createTextNode(Lute.Caret)),i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),i.querySelectorAll("font").forEach(function(e){e.outerHTML=e.innerHTML}),d=i.textContent,d=(e=i.isEqualNode(t.sv.element))?i.textContent:(i.previousElementSibling&&(d=i.previousElementSibling.textContent+d,i.previousElementSibling.remove()),i.previousElementSibling&&0===d.indexOf("---\n")&&(d=i.previousElementSibling.textContent+d,i.previousElementSibling.remove()),n="",t.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(n+=e.parentElement.textContent+"\n",e.parentElement.remove())}),t.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(n+=e.parentElement.textContent+"\n",e.parentElement.remove())}),n+d),d=Ge(d,t),e?i.innerHTML=d:i.outerHTML=d,t.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){t.sv.element.insertAdjacentElement("beforeend",e.parentElement)}),pe(t.sv.element,function(e){t.sv.element.insertAdjacentElement("beforeend",e)}),(0,V.ib)(t.sv.element,o),k(t),u(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0}))},ue=o(652),l=function(e){var t,n=window.innerWidth<=N.g.MOBILE_WIDTH?10:35;"none"!==e.wysiwyg.element.parentElement.style.display&&(t=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.wysiwyg.element.style.padding="10px ".concat(Math.max(n,t),"px")),"none"!==e.ir.element.parentElement.style.display&&(t=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px ".concat(Math.max(n,t),"px")),"block"!==e.preview.element.style.display?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+("left"===e.options.outline.position?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+("left"===e.options.outline.position?e.outline.element.offsetWidth:0)+"px"},me=function(e){var t;e.options.typewriterMode&&(t=window.innerHeight,t="number"==typeof e.options.height?(t=e.options.height,"number"==typeof e.options.minHeight&&(t=Math.max(t,e.options.minHeight)),Math.min(window.innerHeight,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 fe(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}function he(){window.removeEventListener("resize",T)}var ve,ge,be=function(n){clearTimeout(n[n.currentMode].hlToolbarTimeoutId),n[n.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){var e,t;"false"!==n[n.currentMode].element.getAttribute("contenteditable")&&(0,V.Gb)(n[n.currentMode].element)&&(j(n.toolbar.elements,N.g.EDIT_TOOLBARS),P(n.toolbar.elements,N.g.EDIT_TOOLBARS),e=(t=(0,V.zh)(n)).startContainer,(e=3===t.startContainer.nodeType?t.startContainer.parentElement:e).classList.contains("vditor-reset")&&(e=e.childNodes[t.startOffset]),("sv"===n.currentMode?(0,B.a1)(e,"data-type","heading"):(0,z.W)(e))&&R(n.toolbar.elements,["headings"]),("sv"===n.currentMode?(0,B.a1)(e,"data-type","blockquote"):(0,B.lG)(e,"BLOCKQUOTE"))&&R(n.toolbar.elements,["quote"]),(0,B.a1)(e,"data-type","strong")&&R(n.toolbar.elements,["bold"]),(0,B.a1)(e,"data-type","em")&&R(n.toolbar.elements,["italic"]),(0,B.a1)(e,"data-type","s")&&R(n.toolbar.elements,["strike"]),(0,B.a1)(e,"data-type","a")&&R(n.toolbar.elements,["link"]),((t=(0,B.lG)(e,"LI"))?(t.classList.contains("vditor-task")?R(n.toolbar.elements,["check"]):"OL"===t.parentElement.tagName?R(n.toolbar.elements,["ordered-list"]):"UL"===t.parentElement.tagName&&R(n.toolbar.elements,["list"]),P):q)(n.toolbar.elements,["outdent","indent"]),(0,B.a1)(e,"data-type","code-block")&&(q(n.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),R(n.toolbar.elements,["code"])),(0,B.a1)(e,"data-type","code")&&(q(n.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),R(n.toolbar.elements,["inline-code"])),(0,B.a1)(e,"data-type","table"))&&q(n.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])},200)},W=function(t,n){(n=void 0===n?{enableAddUndoStack:!0,enableHint:!1,enableInput:!0}:n).enableHint&&t.hint.render(t),clearTimeout(t.wysiwyg.afterRenderTimeoutId),t.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){var e;t.wysiwyg.composingLock||(e=D(t),"function"==typeof t.options.input&&n.enableInput&&t.options.input(e),t.options.counter.enable&&t.counter.render(t,e),t.options.cache.enable&&(0,I.pK)()&&(localStorage.setItem(t.options.cache.id,e),t.options.cache.after)&&t.options.cache.after(e),t.devtools&&t.devtools.renderEchart(t),n.enableAddUndoStack&&t.undo.addToUndoStack(t))},t.options.undoDelay)},ye=function(e){for(var t="",n=e.nextSibling;n;)3===n.nodeType?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},we=function(e){for(var t="",n=e.previousSibling;n;)t=3===n.nodeType?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},Ee=function(o,r){Array.from(o.wysiwyg.element.childNodes).find(function(e){var t,n;return 3===e.nodeType?((t=document.createElement("p")).setAttribute("data-block","0"),t.textContent=e.textContent,n=3===r.startContainer.nodeType?r.startOffset:e.textContent.length,e.parentNode.insertBefore(t,e),e.remove(),r.setStart(t.firstChild,Math.min(t.firstChild.textContent.length,n)),r.collapse(!0),(0,V.Hc)(r),!0):e.getAttribute("data-block")?void 0:("P"===e.tagName?e.remove():("DIV"===e.tagName?(r.insertNode(document.createElement("wbr")),e.outerHTML='<p data-block="0">'.concat(e.innerHTML,"</p>")):"BR"===e.tagName?e.outerHTML='<p data-block="0">'.concat(e.outerHTML,"<wbr></p>"):(r.insertNode(document.createElement("wbr")),e.outerHTML='<p data-block="0">'.concat(e.outerHTML,"</p>")),(0,V.ib)(o.wysiwyg.element,r),r=getSelection().getRangeAt(0)),!0)})},ke=function(e,t){var n=(0,V.zh)(e),o=(0,B.F9)(n.startContainer);(o=(o=o||n.startContainer.childNodes[n.startOffset])||0!==e.wysiwyg.element.children.length?o:e.wysiwyg.element)&&!o.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),"<wbr>"===o.innerHTML.trim()&&(o.innerHTML="<wbr><br>"),"BLOCKQUOTE"===o.tagName||o.classList.contains("vditor-reset")?o.innerHTML="<".concat(t,' data-block="0">').concat(o.innerHTML.trim(),"</").concat(t,">"):o.outerHTML="<".concat(t,' data-block="0">').concat(o.innerHTML.trim(),"</").concat(t,">"),(0,V.ib)(e.wysiwyg.element,n),h(e))},xe=function(e){var t=getSelection().getRangeAt(0),n=(0,B.F9)(t.startContainer);(n=n||t.startContainer.childNodes[t.startOffset])&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>"),(0,V.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},Se=function(e,t,n){void 0===n&&(n=!0);var o=e.previousElementSibling,r=o.ownerDocument.createRange();"CODE"===o.tagName?(o.style.display="inline-block",n?r.setStart(o.firstChild,1):r.selectNodeContents(o)):(o.style.display="block",o.firstChild.firstChild||o.firstChild.appendChild(document.createTextNode("")),r.selectNodeContents(o.firstChild)),n?r.collapse(!0):r.collapse(!1),(0,V.Hc)(r),e.firstElementChild.classList.contains("language-mindmap")||k(t)},G=function(e,t){if(p("⇧⌘X",t))return(e=e.wysiwyg.popover.querySelector('[data-type="remove"]'))&&e.click(),t.preventDefault(),!0},f=function(O){clearTimeout(O.wysiwyg.hlToolbarTimeoutId),O.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){var t,e,n,o,r,i,u,a,l,s,c,d,p,m,f,h,v,g,b,y,w,E,k,x,S,_,T,L,C,A,M,H;"false"!==O.wysiwyg.element.getAttribute("contenteditable")&&(0,V.Gb)(O.wysiwyg.element)&&(j(O.toolbar.elements,N.g.EDIT_TOOLBARS),P(O.toolbar.elements,N.g.EDIT_TOOLBARS),e=(t=getSelection().getRangeAt(0)).startContainer,e=3===t.startContainer.nodeType?t.startContainer.parentElement:e.childNodes[t.startOffset>=e.childNodes.length?e.childNodes.length-1:t.startOffset],(n=(0,B.a1)(e,"data-type","footnotes-block"))?(O.wysiwyg.popover.innerHTML="",K(n,O),F(O,n)):(((n=(0,B.lG)(e,"LI"))?(n.classList.contains("vditor-task")?R(O.toolbar.elements,["check"]):"OL"===n.parentElement.tagName?R(O.toolbar.elements,["ordered-list"]):"UL"===n.parentElement.tagName&&R(O.toolbar.elements,["list"]),P):q)(O.toolbar.elements,["outdent","indent"]),(0,B.lG)(e,"BLOCKQUOTE")&&R(O.toolbar.elements,["quote"]),((0,B.lG)(e,"B")||(0,B.lG)(e,"STRONG"))&&R(O.toolbar.elements,["bold"]),((0,B.lG)(e,"I")||(0,B.lG)(e,"EM"))&&R(O.toolbar.elements,["italic"]),((0,B.lG)(e,"STRIKE")||(0,B.lG)(e,"S"))&&R(O.toolbar.elements,["strike"]),O.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(e){e.classList.remove("vditor-comment--focus")}),(i=(0,B.fb)(e,"vditor-comment"))&&(1<(o=i.getAttribute("data-cmtids").split(" ")).length&&i.nextSibling.isSameNode(i.nextElementSibling)&&(r=i.nextElementSibling.getAttribute("data-cmtids").split(" "),o.find(function(e){if(r.includes(e))return o=[e],!0})),O.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){-1<e.getAttribute("data-cmtids").indexOf(o[0])&&e.classList.add("vditor-comment--focus")})),(i=(0,B.lG)(e,"A"))&&R(O.toolbar.elements,["link"]),u=(0,B.lG)(e,"TABLE"),a=(0,z.W)(e),(0,B.lG)(e,"CODE")?(0,B.lG)(e,"PRE")?(q(O.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),R(O.toolbar.elements,["code"])):(q(O.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),R(O.toolbar.elements,["inline-code"])):a?(q(O.toolbar.elements,["bold"]),R(O.toolbar.elements,["headings"])):u&&q(O.toolbar.elements,["table"]),(l=(0,B.fb)(e,"vditor-toc"))?(O.wysiwyg.popover.innerHTML="",K(l,O),F(O,l)):((s=(0,z.S)(e,"BLOCKQUOTE"))&&(O.wysiwyg.popover.innerHTML="",Te(t,s,O),Le(t,s,O),K(s,O),F(O,s)),n&&(O.wysiwyg.popover.innerHTML="",Te(t,n,O),Le(t,n,O),K(n,O),F(O,n)),u&&(O.options.lang,O.wysiwyg.popover.innerHTML="",c=function(){var e=u.rows.length,t=u.rows[0].cells.length,n=parseInt(g.value,10)||e,o=parseInt(y.value,10)||t;if(n!==e||t!==o){if(t!==o)for(var r=o-t,i=0;i<u.rows.length;i++)if(0<r)for(var a=0;a<r;a++)0===i?u.rows[i].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):u.rows[i].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var l=t-1;o<=l;l--)u.rows[i].cells[l].remove();if(e!==n){var s=n-e;if(0<s){for(var c="<tr>",d=0;d<o;d++)c+="<td> </td>";for(var p=0;p<s;p++)u.querySelector("tbody")?u.querySelector("tbody").insertAdjacentHTML("beforeend",c):u.querySelector("thead").insertAdjacentHTML("afterend",c+"</tr>")}else for(d=e-1;n<=d;d--)u.rows[d].remove(),1===u.rows.length&&u.querySelector("tbody").remove()}"function"==typeof O.options.input&&O.options.input(D(O))}},d=function(e){gt(u,e),("right"===e?(p.classList.remove("vditor-icon--current"),m.classList.remove("vditor-icon--current"),f):"center"===e?(p.classList.remove("vditor-icon--current"),f.classList.remove("vditor-icon--current"),m):(m.classList.remove("vditor-icon--current"),f.classList.remove("vditor-icon--current"),p)).classList.add("vditor-icon--current"),(0,V.Hc)(t),W(O)},_=(0,B.lG)(e,"TD"),w=(0,B.lG)(e,"TH"),H="left",_?H=_.getAttribute("align")||"left":w&&(H=w.getAttribute("align")||"center"),(p=document.createElement("button")).setAttribute("type","button"),p.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,I.ns)("⇧⌘L")+">"),p.setAttribute("data-type","left"),p.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',p.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("left"===H?" vditor-icon--current":""),p.onclick=function(){d("left")},(m=document.createElement("button")).setAttribute("type","button"),m.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,I.ns)("⇧⌘C")+">"),m.setAttribute("data-type","center"),m.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',m.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("center"===H?" vditor-icon--current":""),m.onclick=function(){d("center")},(f=document.createElement("button")).setAttribute("type","button"),f.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,I.ns)("⇧⌘R")+">"),f.setAttribute("data-type","right"),f.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',f.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("right"===H?" vditor-icon--current":""),f.onclick=function(){d("right")},(_=document.createElement("button")).setAttribute("type","button"),_.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,I.ns)("⌘=")+">"),_.setAttribute("data-type","insertRow"),_.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',_.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",_.onclick=function(){var e=getSelection().getRangeAt(0).startContainer,e=(0,B.lG)(e,"TD")||(0,B.lG)(e,"TH");e&&xt(O,t,e)},(w=document.createElement("button")).setAttribute("type","button"),w.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,I.ns)("⇧⌘F")+">"),w.setAttribute("data-type","insertRow"),w.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',w.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",w.onclick=function(){var e=getSelection().getRangeAt(0).startContainer,e=(0,B.lG)(e,"TD")||(0,B.lG)(e,"TH");e&&St(O,t,e)},(H=document.createElement("button")).setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,I.ns)("⇧⌘=")+">"),H.setAttribute("data-type","insertColumn"),H.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",H.onclick=function(){var e=getSelection().getRangeAt(0).startContainer,e=(0,B.lG)(e,"TD")||(0,B.lG)(e,"TH");e&&_t(O,u,e)},(M=document.createElement("button")).setAttribute("type","button"),M.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,I.ns)("⇧⌘G")+">"),M.setAttribute("data-type","insertColumn"),M.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',M.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",M.onclick=function(){var e=getSelection().getRangeAt(0).startContainer,e=(0,B.lG)(e,"TD")||(0,B.lG)(e,"TH");e&&_t(O,u,e,"beforebegin")},(h=document.createElement("button")).setAttribute("type","button"),h.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,I.ns)("⌘-")+">"),h.setAttribute("data-type","deleteRow"),h.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',h.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",h.onclick=function(){var e=getSelection().getRangeAt(0).startContainer,e=(0,B.lG)(e,"TD")||(0,B.lG)(e,"TH");e&&Tt(O,t,e)},(v=document.createElement("button")).setAttribute("type","button"),v.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,I.ns)("⇧⌘-")+">"),v.setAttribute("data-type","deleteColumn"),v.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',v.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",v.onclick=function(){var e=getSelection().getRangeAt(0).startContainer,e=(0,B.lG)(e,"TD")||(0,B.lG)(e,"TH");e&&Lt(O,t,u,e)},(C=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),C.className="vditor-tooltipped vditor-tooltipped__n",g=document.createElement("input"),C.appendChild(g),g.type="number",g.min="1",g.className="vditor-input",g.style.width="42px",g.style.textAlign="center",g.setAttribute("placeholder",window.VditorI18n.row),g.value=u.rows.length.toString(),g.oninput=function(){c()},g.onkeydown=function(e){if(!e.isComposing)return"Tab"===e.key?(y.focus(),y.select(),void e.preventDefault()):void(G(O,e)||Z(e,t))},(b=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.column),b.className="vditor-tooltipped vditor-tooltipped__n",y=document.createElement("input"),b.appendChild(y),y.type="number",y.min="1",y.className="vditor-input",y.style.width="42px",y.style.textAlign="center",y.setAttribute("placeholder",window.VditorI18n.column),y.value=u.rows[0].cells.length.toString(),y.oninput=function(){c()},y.onkeydown=function(e){if(!e.isComposing)return"Tab"===e.key?(g.focus(),g.select(),void e.preventDefault()):void(G(O,e)||Z(e,t))},Te(t,u,O),Le(t,u,O),K(u,O),O.wysiwyg.popover.insertAdjacentElement("beforeend",p),O.wysiwyg.popover.insertAdjacentElement("beforeend",m),O.wysiwyg.popover.insertAdjacentElement("beforeend",f),O.wysiwyg.popover.insertAdjacentElement("beforeend",w),O.wysiwyg.popover.insertAdjacentElement("beforeend",_),O.wysiwyg.popover.insertAdjacentElement("beforeend",M),O.wysiwyg.popover.insertAdjacentElement("beforeend",H),O.wysiwyg.popover.insertAdjacentElement("beforeend",h),O.wysiwyg.popover.insertAdjacentElement("beforeend",v),O.wysiwyg.popover.insertAdjacentElement("beforeend",C),O.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),O.wysiwyg.popover.insertAdjacentElement("beforeend",b),F(O,u)),(w=(0,B.a1)(e,"data-type","link-ref"))&&_e(O,w,t),(E=(0,B.a1)(e,"data-type","footnotes-ref"))&&(O.options.lang,O.wysiwyg.popover.innerHTML="",(C=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,I.ns)("⌥Enter")+">"),C.className="vditor-tooltipped vditor-tooltipped__n",k=document.createElement("input"),C.appendChild(k),k.className="vditor-input",k.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,I.ns)("⌥Enter")+">"),k.style.width="120px",k.value=E.getAttribute("data-footnotes-label"),k.oninput=function(){""!==k.value.trim()&&E.setAttribute("data-footnotes-label",k.value),"function"==typeof O.options.input&&O.options.input(D(O))},k.onkeydown=function(e){e.isComposing||G(O,e)||Z(e,t)},K(E,O),O.wysiwyg.popover.insertAdjacentElement("beforeend",C),F(O,E)),x=(0,B.fb)(e,"vditor-wysiwyg__block"),S=!!x&&-1<x.getAttribute("data-type").indexOf("block"),O.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){x&&(!S||x.contains(e))||(e.previousElementSibling.style.display="none")}),x&&S?(O.wysiwyg.popover.innerHTML="",Te(t,x,O),Le(t,x,O),K(x,O),"code-block"===x.getAttribute("data-type")&&((_=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.language+"<"+(0,I.ns)("⌥Enter")+">"),_.className="vditor-tooltipped vditor-tooltipped__n",T=document.createElement("input"),_.appendChild(T),L=x.firstElementChild.firstElementChild,T.className="vditor-input",T.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,I.ns)("⌥Enter")+">"),T.value=-1<L.className.indexOf("language-")?L.className.split("-")[1].split(" ")[0]:"",T.oninput=function(e){""!==T.value.trim()?L.className="language-".concat(T.value):(L.className="",O.hint.recentLanguage=""),x.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(x.lastElementChild.innerHTML=x.firstElementChild.innerHTML,U(x.lastElementChild,O)),W(O),1===e.detail&&(t.setStart(L.firstChild,0),t.collapse(!0),(0,V.Hc)(t))},T.onkeydown=function(e){e.isComposing||G(O,e)||("Escape"===e.key&&"block"===O.hint.element.style.display?(O.hint.element.style.display="none",e.preventDefault()):(O.hint.select(e,O),Z(e,t)))},T.onkeyup=function(e){var t,n;e.isComposing||"Enter"===e.key||"ArrowUp"===e.key||"Escape"===e.key||"ArrowDown"===e.key||(t=[],n=T.value.substring(0,T.selectionStart),(O.options.preview.hljs.langs||N.g.CODE_LANGUAGES).forEach(function(e){-1<e.indexOf(n.toLowerCase())&&t.push({html:e,value:e})}),O.hint.genHTML(t,n,O),e.preventDefault())},O.wysiwyg.popover.insertAdjacentElement("beforeend",_)),F(O,x)):x=void 0,a&&(O.wysiwyg.popover.innerHTML="",(C=document.createElement("span")).setAttribute("aria-label","ID<"+(0,I.ns)("⌥Enter")+">"),C.className="vditor-tooltipped vditor-tooltipped__n",A=document.createElement("input"),C.appendChild(A),A.className="vditor-input",A.setAttribute("placeholder","ID<"+(0,I.ns)("⌥Enter")+">"),A.style.width="120px",A.value=a.getAttribute("data-id")||"",A.oninput=function(){a.setAttribute("data-id",A.value),"function"==typeof O.options.input&&O.options.input(D(O))},A.onkeydown=function(e){e.isComposing||G(O,e)||Z(e,t)},Te(t,a,O),Le(t,a,O),K(a,O),O.wysiwyg.popover.insertAdjacentElement("beforeend",C),F(O,a)),i&&Ae(O,i,t),s||n||u||x||i||w||E||a||l||((M=(0,B.a1)(e,"data-block","0"))&&M.parentElement.isEqualNode(O.wysiwyg.element)?(O.wysiwyg.popover.innerHTML="",Te(t,M,O),Le(t,M,O),K(M,O),F(O,M)):O.wysiwyg.popover.style.display="none"),O.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(e){e.style.display="none"}),(H=(0,B.a1)(t.startContainer,"data-type","backslash"))&&(H.querySelector("span").style.display="inline"))))},200)},F=function(e,t){var n=t,t=(0,B.lG)(t,"TABLE");t&&(n=t),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())},_e=function(t,n,o){void 0===o&&(o=getSelection().getRangeAt(0)),t.wysiwyg.popover.innerHTML="";function e(){""!==i.value.trim()&&("IMG"===n.tagName?n.setAttribute("alt",i.value):n.textContent=i.value),""!==l.value.trim()&&n.setAttribute("data-link-label",l.value),"function"==typeof t.options.input&&t.options.input(D(t))}var r=document.createElement("span"),i=(r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n",document.createElement("input")),a=(r.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=n.getAttribute("alt")||n.textContent,i.oninput=function(){e()},i.onkeydown=function(e){G(t,e)||Z(e,o)||Ce(t,n,e,l)},document.createElement("span")),l=(a.setAttribute("aria-label",window.VditorI18n.linkRef),a.className="vditor-tooltipped vditor-tooltipped__n",document.createElement("input"));a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.linkRef),l.value=n.getAttribute("data-link-label"),l.oninput=function(){e()},l.onkeydown=function(e){G(t,e)||Z(e,o)||Ce(t,n,e,i)},K(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",r),t.wysiwyg.popover.insertAdjacentElement("beforeend",a),F(t,n)},Te=function(e,t,n){var o,r=t.previousElementSibling;r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)&&((o=document.createElement("button")).setAttribute("type","button"),o.setAttribute("data-type","up"),o.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,I.ns)("⇧⌘U")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,V.ib)(n.wysiwyg.element,e),W(n),f(n),k(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o))},Le=function(e,t,n){var o,r=t.nextElementSibling;r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)&&((o=document.createElement("button")).setAttribute("type","button"),o.setAttribute("data-type","down"),o.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,I.ns)("⇧⌘D")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,V.ib)(n.wysiwyg.element,e),W(n),f(n),k(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o))},K=function(t,n){var e=document.createElement("button");e.setAttribute("type","button"),e.setAttribute("data-type","remove"),e.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,I.ns)("⇧⌘X")+">"),e.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',e.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",e.onclick=function(){var e=(0,V.zh)(n);e.setStartAfter(t),(0,V.Hc)(e),t.remove(),W(n),f(n),["H1","H2","H3","H4","H5","H6"].includes(t.tagName)&&h(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",e)},Ce=function(e,t,n,o){n.isComposing||("Tab"===n.key?(o.focus(),o.select(),n.preventDefault()):(0,I.yl)(n)||n.shiftKey||!n.altKey||"Enter"!==n.key||(o=(0,V.zh)(e),t.insertAdjacentHTML("afterend",N.g.ZWSP),o.setStartAfter(t.nextSibling),o.collapse(!0),(0,V.Hc)(o),n.preventDefault()))},Ae=function(t,n,o){t.wysiwyg.popover.innerHTML="";function e(){""!==i.value.trim()&&(n.innerHTML=i.value),n.setAttribute("href",l.value),n.setAttribute("title",c.value),W(t)}n.querySelectorAll("[data-marker]").forEach(function(e){e.removeAttribute("data-marker")});var r=document.createElement("span"),i=(r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n",document.createElement("input")),a=(r.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=n.innerHTML||"",i.oninput=function(){e()},i.onkeydown=function(e){G(t,e)||Z(e,o)||Ce(t,n,e,l)},document.createElement("span")),l=(a.setAttribute("aria-label",window.VditorI18n.link),a.className="vditor-tooltipped vditor-tooltipped__n",document.createElement("input")),s=(a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.link),l.value=n.getAttribute("href")||"",l.oninput=function(){e()},l.onkeydown=function(e){G(t,e)||Z(e,o)||Ce(t,n,e,c)},document.createElement("span")),c=(s.setAttribute("aria-label",window.VditorI18n.tooltipText),s.className="vditor-tooltipped vditor-tooltipped__n",document.createElement("input"));s.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.tooltipText),c.style.width="60px",c.value=n.getAttribute("title")||"",c.oninput=function(){e()},c.onkeydown=function(e){G(t,e)||Z(e,o)||Ce(t,n,e,i)},K(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",r),t.wysiwyg.popover.insertAdjacentElement("beforeend",a),t.wysiwyg.popover.insertAdjacentElement("beforeend",s),F(t,n)},Z=function(e,t){if(!(0,I.yl)(e)&&!e.shiftKey&&"Enter"===e.key||"Escape"===e.key)return t&&(0,V.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},Me=function(e){"wysiwyg"===e.currentMode?f(e):"ir"===e.currentMode&&be(e)},He=function(t,e,n){void 0===n&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var o=t.wysiwyg.element;o.innerHTML=t.lute.Md2VditorDOM(e),o.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(e){U(e,t),e.previousElementSibling.setAttribute("style","display:none")}),W(t,n)},Oe=function(e,t,n){for(var o,r,i,a,l,s=e.startContainer.parentElement,c=!1,d="",p="",u=(u=we((o=e).startContainer),r=ye(o.startContainer),i=o.startContainer.textContent,o=o.startOffset,((l=a="")!==i.substr(0,o)&&i.substr(0,o)!==N.g.ZWSP||u)&&(a="".concat(u).concat(i.substr(0,o))),{afterHTML:l=""!==i.substr(o)&&i.substr(o)!==N.g.ZWSP||r?"".concat(i.substr(o)).concat(r):l,beforeHTML:a}),m=u.beforeHTML,f=u.afterHTML;s&&!c;){var h,v,g,b=s.tagName;"S"===(b="B"===(b="I"===(b="STRIKE"===b?"S":b)?"EM":b)?"STRONG":b)||"STRONG"===b||"EM"===b?(g=v=h="","0"!==s.parentElement.getAttribute("data-block")&&(v=we(s),g=ye(s)),(m||v)&&(m=h="".concat(v,"<").concat(b,">").concat(m,"</").concat(b,">")),("bold"===n&&"STRONG"===b||"italic"===n&&"EM"===b||"strikeThrough"===n&&"S"===b)&&(h+="".concat(d).concat(N.g.ZWSP,"<wbr>").concat(p),c=!0),(f||g)&&(h+=f="<".concat(b,">").concat(f,"</").concat(b,">").concat(g)),"0"!==s.parentElement.getAttribute("data-block")?(s=s.parentElement).innerHTML=h:(s.outerHTML=h,s=s.parentElement),d="<".concat(b,">")+d,p="</".concat(b,">")+p):c=!0}(0,V.ib)(t.wysiwyg.element,e)},i=function(p,u){var m=this,e=(this.element=document.createElement("div"),u.className&&(e=this.element.classList).add.apply(e,u.className.split(" ")),u.hotkey?" <".concat((0,I.ns)(u.hotkey),">"):""),e=(2===u.level&&(e=u.hotkey?" <".concat((0,I.ns)(u.hotkey),">"):""),u.tip?u.tip+e:"".concat(window.VditorI18n[u.name]).concat(e)),t="upload"===u.name?"div":"button";2===u.level?this.element.innerHTML="<".concat(t,' data-type="').concat(u.name,'">').concat(e,"</").concat(t,">"):(this.element.classList.add("vditor-toolbar__item"),(t=document.createElement(t)).setAttribute("data-type",u.name),t.className="vditor-tooltipped vditor-tooltipped__".concat(u.tipPosition),t.setAttribute("aria-label",e),t.innerHTML=u.icon,this.element.appendChild(t)),u.prefix&&this.element.children[0].addEventListener((0,I.Le)(),function(e){var t,n,o,r,i,a,l,s,c,d;e.preventDefault(),m.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)||("wysiwyg"===p.currentMode?(t=p,n=m.element.children[0],t.wysiwyg.composingLock&&e instanceof CustomEvent||(o=e=!0,t.wysiwyg.element.querySelector("wbr")&&t.wysiwyg.element.querySelector("wbr").remove(),r=(0,V.zh)(t),i=n.getAttribute("data-type"),n.classList.contains("vditor-menu--current")?"quote"===(i="strike"===i?"strikeThrough":i)?(d=(d=(0,B.lG)(r.startContainer,"BLOCKQUOTE"))||r.startContainer.childNodes[r.startOffset])&&(e=!1,n.classList.remove("vditor-menu--current"),r.insertNode(document.createElement("wbr")),d.outerHTML=""===d.innerHTML.trim()?'<p data-block="0">'.concat(d.innerHTML,"</p>"):d.innerHTML,(0,V.ib)(t.wysiwyg.element,r)):"inline-code"===i?(d=(d=(0,B.lG)(r.startContainer,"CODE"))||r.startContainer.childNodes[r.startOffset])&&(d.outerHTML=d.innerHTML.replace(N.g.ZWSP,"")+"<wbr>",(0,V.ib)(t.wysiwyg.element,r)):"link"===i?(r.collapsed&&r.selectNode(r.startContainer.parentElement),document.execCommand("unlink",!1,"")):"check"===i||"list"===i||"ordered-list"===i?(ft(t,r,i),(0,V.ib)(t.wysiwyg.element,r),e=!1,n.classList.remove("vditor-menu--current")):(e=!1,n.classList.remove("vditor-menu--current"),""===r.toString()?Oe(r,t,i):document.execCommand(i,!1,"")):(0===t.wysiwyg.element.childNodes.length&&(t.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,V.ib)(t.wysiwyg.element,r)),d=(0,B.F9)(r.startContainer),"quote"===i?(d=d||r.startContainer.childNodes[r.startOffset])&&(e=!1,n.classList.add("vditor-menu--current"),r.insertNode(document.createElement("wbr")),(c=(0,B.lG)(r.startContainer,"LI"))&&d.contains(c)?c.innerHTML='<blockquote data-block="0">'.concat(c.innerHTML,"</blockquote>"):d.outerHTML='<blockquote data-block="0">'.concat(d.outerHTML,"</blockquote>"),(0,V.ib)(t.wysiwyg.element,r)):"check"===i||"list"===i||"ordered-list"===i?(ft(t,r,i,!1),(0,V.ib)(t.wysiwyg.element,r),e=!1,j(t.toolbar.elements,["check","list","ordered-list"]),n.classList.add("vditor-menu--current")):"inline-code"===i?(""===r.toString()?((a=document.createElement("code")).textContent=N.g.ZWSP,r.insertNode(a),r.setStart(a.firstChild,1),r.collapse(!0),(0,V.Hc)(r)):3===r.startContainer.nodeType&&(a=document.createElement("code"),r.surroundContents(a),r.insertNode(a),(0,V.Hc)(r)),n.classList.add("vditor-menu--current")):"code"===i?((a=document.createElement("div")).className="vditor-wysiwyg__block",a.setAttribute("data-type","code-block"),a.setAttribute("data-block","0"),a.setAttribute("data-marker","```"),""===r.toString()?a.innerHTML="<pre><code><wbr>\n</code></pre>":(a.innerHTML="<pre><code>".concat(r.toString(),"<wbr></code></pre>"),r.deleteContents()),r.insertNode(a),d&&(d.outerHTML=t.lute.SpinVditorDOM(d.outerHTML)),(0,V.ib)(t.wysiwyg.element,r),t.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(e){U(e,t)}),n.classList.add("vditor-menu--disabled")):"link"===i?(""===r.toString()?((c=document.createElement("a")).innerText=N.g.ZWSP,r.insertNode(c),r.setStart(c.firstChild,1),r.collapse(!0),Ae(t,c,r),(c=t.wysiwyg.popover.querySelector("input")).value="",c.focus(),o=!1):((a=document.createElement("a")).setAttribute("href",""),a.innerHTML=r.toString(),r.surroundContents(a),r.insertNode(a),(0,V.Hc)(r),Ae(t,a,r),(c=t.wysiwyg.popover.querySelectorAll("input"))[0].value=a.innerText,c[1].focus()),e=!1,n.classList.add("vditor-menu--current")):"table"===i?(l='<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>',""===r.toString().trim()?(d&&""===d.innerHTML.trim().replace(N.g.ZWSP,"")?d.outerHTML=l:document.execCommand("insertHTML",!1,l),r.selectNode(t.wysiwyg.element.querySelector("wbr").previousSibling),t.wysiwyg.element.querySelector("wbr").remove(),(0,V.Hc)(r)):(l='<table data-block="0"><thead><tr>',c=r.toString().split("\n"),s=c[0].split(",").length>c[0].split("\t").length?",":"\t",c.forEach(function(e,t){0===t?(e.split(s).forEach(function(e,t){l+="<th>".concat(e,0===t?"<wbr></th>":"</th>")}),l+="</tr></thead>"):(l+=1===t?"<tbody><tr>":"<tr>",e.split(s).forEach(function(e){l+="<td>".concat(e,"</td>")}),l+="</tr>")}),l+="</tbody></table>",document.execCommand("insertHTML",!1,l),(0,V.ib)(t.wysiwyg.element,r)),e=!1,n.classList.add("vditor-menu--disabled")):"line"===i?d&&(c='<hr data-block="0"><p data-block="0"><wbr>\n</p>',""===d.innerHTML.trim()?d.outerHTML=c:d.insertAdjacentHTML("afterend",c),(0,V.ib)(t.wysiwyg.element,r)):(e=!1,n.classList.add("vditor-menu--current"),"strike"===i&&(i="strikeThrough"),""!==r.toString()||"bold"!==i&&"italic"!==i&&"strikeThrough"!==i?document.execCommand(i,!1,""):(d="strong","italic"===i?d="em":"strikeThrough"===i&&(d="s"),(a=document.createElement(d)).textContent=N.g.ZWSP,r.insertNode(a),a.previousSibling&&a.previousSibling.textContent===N.g.ZWSP&&(a.previousSibling.textContent=""),r.setStart(a.firstChild,1),r.collapse(!0),(0,V.Hc)(r)))),e&&f(t),o&&W(t))):("ir"===p.currentMode?qt:Ze)(p,m.element.children[0],u.prefix||"",u.suffix||""))})},d=(ve=function(e,t){return(ve=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(t,e,n){var o="string"!=typeof n?(s(t,["subToolbar","hint"]),n.preventDefault(),D(t)):n;t.currentMode===e&&"string"!=typeof n||(t.devtools&&t.devtools.renderEchart(t),"both"===t.options.preview.mode&&"sv"===e?t.preview.element.style.display="block":t.preview.element.style.display="none",P(t.toolbar.elements,N.g.EDIT_TOOLBARS),j(t.toolbar.elements,N.g.EDIT_TOOLBARS),q(t.toolbar.elements,["outdent","indent"]),"ir"===e?(H(t.toolbar.elements,["both"]),O(t.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),t.sv.element.style.display="none",t.wysiwyg.element.parentElement.style.display="none",t.ir.element.parentElement.style.display="block",t.lute.SetVditorIR(!0),t.lute.SetVditorWYSIWYG(!1),t.lute.SetVditorSV(!1),t.currentMode="ir",t.ir.element.innerHTML=t.lute.Md2VditorIRDOM(o),v(t,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),l(t),t.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){U(e,t)}),t.ir.element.querySelectorAll(".vditor-toc").forEach(function(e){(0,ne.H)(e,{cdn:t.options.cdn,math:t.options.preview.math})})):"wysiwyg"===e?(H(t.toolbar.elements,["both"]),O(t.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),t.sv.element.style.display="none",t.wysiwyg.element.parentElement.style.display="block",t.ir.element.parentElement.style.display="none",t.lute.SetVditorIR(!1),t.lute.SetVditorWYSIWYG(!0),t.lute.SetVditorSV(!1),t.currentMode="wysiwyg",l(t),He(t,o,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),t.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(e){(0,ne.H)(e,{cdn:t.options.cdn,math:t.options.preview.math})}),t.wysiwyg.popover.style.display="none"):"sv"===e&&(O(t.toolbar.elements,["both"]),H(t.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),t.wysiwyg.element.parentElement.style.display="none",t.ir.element.parentElement.style.display="none","both"!==t.options.preview.mode&&"editor"!==t.options.preview.mode||(t.sv.element.style.display="block"),t.lute.SetVditorIR(!1),t.lute.SetVditorWYSIWYG(!1),t.lute.SetVditorSV(!0),t.currentMode="sv",e=Ge(o,t),t.sv.element.innerHTML=e="<div data-block='0'></div>"===e?"":e,pe(t.sv.element),u(t,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),l(t)),t.undo.resetIcon(t),"string"!=typeof n&&(t[t.currentMode].element.focus(),Me(t)),h(t),me(t),t.toolbar.elements["edit-mode"]&&(t.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-menu--current")}),t.toolbar.elements["edit-mode"].querySelector('button[data-mode="'.concat(t.currentMode,'"]')).classList.add("vditor-menu--current")),t.outline.toggle(t,"sv"!==t.currentMode&&t.options.outline.enable,"string"!=typeof n))}),Ne=(r=>{function e(e,t){var n=r.call(this,e,t)||this,o=document.createElement("div");return o.className="vditor-hint".concat(2===t.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'.concat(window.VditorI18n.wysiwyg," <").concat((0,I.ns)("⌥⌘7"),'></button>\n<button data-mode="ir">').concat(window.VditorI18n.instantRendering," <").concat((0,I.ns)("⌥⌘8"),'></button>\n<button data-mode="sv">').concat(window.VditorI18n.splitView," <").concat((0,I.ns)("⌥⌘9"),"></button>"),n.element.appendChild(o),n._bindEvent(e,o,t),n}var t=e,n=r;if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=t}return ve(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o),e.prototype._bindEvent=function(t,e,n){var o=this.element.children[0];a(t,e,o,n.level),e.children.item(0).addEventListener((0,I.Le)(),function(e){d(t,"wysiwyg",e),e.preventDefault(),e.stopPropagation()}),e.children.item(1).addEventListener((0,I.Le)(),function(e){d(t,"ir",e),e.preventDefault(),e.stopPropagation()}),e.children.item(2).addEventListener((0,I.Le)(),function(e){d(t,"sv",e),e.preventDefault(),e.stopPropagation()})},e})(i),De=function(e,t){return(0,V.Gb)(e,t)?getSelection().toString():""},Ie=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(D(e)),s(e,["subToolbar","hint"])})},je=function(t,e){e.addEventListener("dblclick",function(e){"IMG"===e.target.tagName&&(t.options.image.preview?t.options.image.preview(e.target):t.options.image.isPreview&&(0,de.E)(e.target,t.options.lang,t.options.theme))})},Re=function(n,e){e.addEventListener("blur",function(e){var t;"ir"===n.currentMode?(t=n.ir.element.querySelector(".vditor-ir__node--expand"))&&t.classList.remove("vditor-ir__node--expand"):"wysiwyg"!==n.currentMode||n.wysiwyg.selectPopover.contains(e.relatedTarget)||n.wysiwyg.hideComment(),n[n.currentMode].range=(0,V.zh)(n),n.options.blur&&n.options.blur(D(n))})},Pe=function(t,e){e.addEventListener("dragstart",function(e){e.dataTransfer.setData(N.g.DROP_EDITOR,N.g.DROP_EDITOR)}),e.addEventListener("drop",function(e){e.dataTransfer.getData(N.g.DROP_EDITOR)?x(t):(e.dataTransfer.types.includes("Files")||e.dataTransfer.types.includes("text/html"))&&It(t,e,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})},qe=function(t,e,n){e.addEventListener("copy",function(e){return n(e,t)})},Be=function(t,e,n){e.addEventListener("cut",function(e){n(e,t),t.options.comment.enable&&"wysiwyg"===t.currentMode&&t.wysiwyg.getComments(t),document.execCommand("delete")})},k=function(e){var t,n;"wysiwyg"===e.currentMode&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode&&(t=e[e.currentMode].element,n=(0,V.Ny)(t).top,"auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),"auto"===e.options.height&&!e.element.classList.contains("vditor--fullscreen")||(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10))},ze=function(n,e){e.addEventListener("keydown",function(t){if(!t.isComposing&&n.options.keydown&&n.options.keydown(t),!(1<n.options.hint.extend.length||n.toolbar.elements.emoji)||!n.hint.select(t,n)){if(n.options.comment.enable&&"wysiwyg"===n.currentMode&&("Backspace"===t.key||p("⌘X",t))&&n.wysiwyg.getComments(n),"sv"===n.currentMode){if(((e,t)=>{if(e.sv.composingLock=t.isComposing,!t.isComposing&&(-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t),"Enter"===t.key||"Tab"===t.key||"Backspace"===t.key||-1!==t.key.indexOf("Arrow")||(0,I.yl)(t)||"Escape"===t.key)){var n=(0,V.zh)(e),o=n.startContainer,r=(3!==n.startContainer.nodeType&&"DIV"===n.startContainer.tagName&&(o=n.startContainer.childNodes[n.startOffset-1]),(0,B.a1)(o,"data-type","text")),i=(0,B.a1)(o,"data-type","blockquote-marker");if((i=!i&&0===n.startOffset&&r&&r.previousElementSibling&&"blockquote-marker"===r.previousElementSibling.getAttribute("data-type")?r.previousElementSibling:i)&&"Enter"===t.key&&!(0,I.yl)(t)&&!t.altKey&&""===i.nextElementSibling.textContent.trim()&&(0,V.im)(i,e.sv.element,n).start===i.textContent.length)return"padding"===(null==(a=i.previousElementSibling)?void 0:a.getAttribute("data-type"))&&i.previousElementSibling.setAttribute("data-action","enter-remove"),i.remove(),u(e),t.preventDefault(),1;var a=(0,B.a1)(o,"data-type","li-marker"),i=(0,B.a1)(o,"data-type","task-marker");if(a||i&&"task-marker"!==i.nextElementSibling.getAttribute("data-type")&&(a=i),a=a||0!==n.startOffset||!r||!r.previousElementSibling||"li-marker"!==r.previousElementSibling.getAttribute("data-type")&&"task-marker"!==r.previousElementSibling.getAttribute("data-type")?a:r.previousElementSibling){var i=(0,V.im)(a,e.sv.element,n).start,r="task-marker"===a.getAttribute("data-type"),l=a;if(r&&(l=a.previousElementSibling.previousElementSibling.previousElementSibling),i===a.textContent.length){if("Enter"===t.key&&!(0,I.yl)(t)&&!t.altKey&&!t.shiftKey&&""===a.nextElementSibling.textContent.trim())return("padding"===(null==(i=l.previousElementSibling)?void 0:i.getAttribute("data-type"))?(l.previousElementSibling.remove(),c):(r&&(l.remove(),a.previousElementSibling.previousElementSibling.remove(),a.previousElementSibling.remove()),a.nextElementSibling.remove(),a.remove(),u))(e),t.preventDefault(),1;if("Tab"===t.key)return t.shiftKey?"padding"===l.previousElementSibling.getAttribute("data-type")&&l.previousElementSibling.remove():l.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(l.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(l.textContent)&&(l.textContent=l.textContent.replace(/^\d{1,}/,"1"),n.selectNodeContents(a.firstChild),n.collapse(!1)),c(e),t.preventDefault(),1}}if(Et(e,n,t))return 1;i=(0,B.a1)(o,"data-block","0"),r=(0,z.S)(o,"SPAN");if("Enter"===t.key&&!(0,I.yl)(t)&&!t.altKey&&!t.shiftKey&&i){var l=!1,a=i.textContent.match(/^\n+/),o=((0,V.im)(i,e.sv.element).start<=(a?a[0].length:0)&&(l=!0),"\n");if(r){if("enter-remove"===(null==(a=r.previousElementSibling)?void 0:a.getAttribute("data-action")))return r.previousElementSibling.remove(),u(e),t.preventDefault(),1;o+=Fe(r)}return n.insertNode(document.createTextNode(o)),n.collapse(!1),(i&&""!==i.textContent.trim()&&!l?c:u)(e),t.preventDefault(),1}if("Backspace"===t.key&&!(0,I.yl)(t)&&!t.altKey&&!t.shiftKey){if(r&&"newline"===(null==(a=r.previousElementSibling)?void 0:a.getAttribute("data-type"))&&1===(0,V.im)(r,e.sv.element,n).start&&-1===r.getAttribute("data-type").indexOf("code-block-"))return n.setStart(r,0),n.extractContents(),(""!==r.textContent.trim()?c:u)(e),t.preventDefault(),1;if(i&&0===(0,V.im)(i,e.sv.element,n).start&&i.previousElementSibling)return n.extractContents(),"newline"===(o=i.previousElementSibling.lastElementChild).getAttribute("data-type")&&(o.remove(),o=i.previousElementSibling.lastElementChild),"newline"!==o.getAttribute("data-type")&&(o.insertAdjacentHTML("afterend",i.innerHTML),i.remove()),(""===i.textContent.trim()||null!=(l=i.previousElementSibling)&&l.querySelector('[data-type="code-block-open-marker"]')?("newline"!==o.getAttribute("data-type")&&(n.selectNodeContents(o.lastChild),n.collapse(!1)),u):c)(e),t.preventDefault(),1}}})(n,t))return}else if("wysiwyg"===n.currentMode){if(((e,t)=>{if(e.wysiwyg.composingLock=t.isComposing,!t.isComposing){-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,V.zh)(e),o=n.startContainer;if(it(t,e,o)&&(at(n,e,t),Nt(n),"Enter"===t.key||"Tab"===t.key||"Backspace"===t.key||-1!==t.key.indexOf("Arrow")||(0,I.yl)(t)||"Escape"===t.key||"Delete"===t.key)){var r=(0,B.F9)(o),i=(0,B.lG)(o,"P");if(kt(t,e,i,n))return 1;if(wt(n,e,i,t))return 1;if(Ct(e,t,n))return 1;var a=(0,B.fb)(o,"vditor-wysiwyg__block");if(a){if("Escape"===t.key&&2===a.children.length)return e.wysiwyg.popover.style.display="none",a.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),1;if(!(0,I.yl)(t)&&!t.shiftKey&&t.altKey&&"Enter"===t.key&&"code-block"===a.getAttribute("data-type"))return(l=e.wysiwyg.popover.querySelector(".vditor-input")).focus(),l.select(),t.preventDefault(),1;if("0"===a.getAttribute("data-block")){if(At(e,t,a.firstElementChild,n))return 1;if(ut(e,t,n,a.firstElementChild,a))return 1;if("yaml-front-matter"!==a.getAttribute("data-type")&&mt(e,t,n,a.firstElementChild,a))return 1}}if(Mt(e,n,t,i))return 1;var l=(0,B.E2)(o,"BLOCKQUOTE");if(l&&!t.shiftKey&&t.altKey&&"Enter"===t.key)return(0,I.yl)(t)?n.setStartBefore(l):n.setStartAfter(l),(0,V.Hc)(n),(a=document.createElement("p")).setAttribute("data-block","0"),a.innerHTML="\n",n.insertNode(a),n.collapse(!0),(0,V.Hc)(n),W(e),k(e),t.preventDefault(),1;var s,l=(0,z.W)(o);if(l){if("H6"===l.tagName&&o.textContent.length===n.startOffset&&!(0,I.yl)(t)&&!t.shiftKey&&!t.altKey&&"Enter"===t.key)return(a=document.createElement("p")).textContent="\n",a.setAttribute("data-block","0"),o.parentElement.insertAdjacentElement("afterend",a),n.setStart(a,0),(0,V.Hc)(n),W(e),k(e),t.preventDefault(),1;if(p("⌘=",t))return 0<(c=parseInt(l.tagName.substr(1),10)-1)&&(ke(e,"h".concat(c)),W(e)),t.preventDefault(),1;if(p("⌘-",t))return(c=parseInt(l.tagName.substr(1),10)+1)<7&&(ke(e,"h".concat(c)),W(e)),t.preventDefault(),1;"Backspace"!==t.key||(0,I.yl)(t)||t.shiftKey||t.altKey||1!==l.textContent.length||xe(e)}if(Ht(e,n,t))return 1;if(t.altKey&&"Enter"===t.key&&!(0,I.yl)(t)&&!t.shiftKey&&(a=(0,B.lG)(o,"A"),c=(0,B.a1)(o,"data-type","link-ref"),d=(0,B.a1)(o,"data-type","footnotes-ref"),a||c||d||l&&2===l.tagName.length)&&((a=e.wysiwyg.popover.querySelector("input")).focus(),a.select()),G(e,t))return 1;if(p("⇧⌘U",t)&&(s=e.wysiwyg.popover.querySelector('[data-type="up"]')))return s.click(),t.preventDefault(),1;if(p("⇧⌘D",t)&&(s=e.wysiwyg.popover.querySelector('[data-type="down"]')))return s.click(),t.preventDefault(),1;if(Et(e,n,t))return 1;if(!(0,I.yl)(t)&&t.shiftKey&&!t.altKey&&"Enter"===t.key&&"LI"!==o.parentElement.tagName&&"P"!==o.parentElement.tagName)return["STRONG","STRIKE","S","I","EM","B"].includes(o.parentElement.tagName)?n.insertNode(document.createTextNode("\n"+N.g.ZWSP)):n.insertNode(document.createTextNode("\n")),n.collapse(!1),(0,V.Hc)(n),W(e),k(e),t.preventDefault(),1;if("Backspace"===t.key&&!(0,I.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(Ot(e,n,t,i))return 1;if(r){if(r.previousElementSibling&&r.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&"0"===r.previousElementSibling.getAttribute("data-block")&&"UL"!==r.tagName&&"OL"!==r.tagName){var c=(0,V.im)(r,e.wysiwyg.element,n).start;if(0===c&&0===n.startOffset||1===c&&r.innerText.startsWith(N.g.ZWSP))return Se(r.previousElementSibling.lastElementChild,e,!1),""===r.innerHTML.trim().replace(N.g.ZWSP,"")&&(r.remove(),W(e)),t.preventDefault(),1}var d=n.startOffset;if(""===n.toString()&&3===o.nodeType&&"\n"===o.textContent.charAt(d-2)&&o.textContent.charAt(d-1)!==N.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(o.parentElement.tagName))return o.textContent=o.textContent.substring(0,d-1)+N.g.ZWSP,n.setStart(o,d),n.collapse(!0),W(e),t.preventDefault(),1;o.textContent===N.g.ZWSP&&1===n.startOffset&&!o.previousSibling&&(()=>{for(var e=n.startContainer.nextSibling;e&&""===e.textContent;)e=e.nextSibling;return e&&3!==e.nodeType&&("CODE"===e.tagName||"math-inline"===e.getAttribute("data-type")||"html-entity"===e.getAttribute("data-type")||"html-inline"===e.getAttribute("data-type"))})()&&(o.textContent=""),r.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"}),r.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"})}}return(0,I.vU)()&&1===n.startOffset&&-1<o.textContent.indexOf(N.g.ZWSP)&&o.previousSibling&&3!==o.previousSibling.nodeType&&"CODE"===o.previousSibling.tagName&&("Backspace"===t.key||"ArrowLeft"===t.key)?(n.selectNodeContents(o.previousSibling),n.collapse(!1),t.preventDefault(),1):(Dt(t,r,n)||(lt(n,t.key),"ArrowDown"===t.key&&(l=o.nextSibling)&&3!==l.nodeType&&"math-inline"===l.getAttribute("data-type")&&n.setStartAfter(l),r&&le(r,e,t,n)))&&(t.preventDefault(),1)}}})(n,t))return}else if("ir"===n.currentMode&&((e,t)=>{if(e.ir.composingLock=t.isComposing,!t.isComposing){-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,V.zh)(e),o=n.startContainer;if(it(t,e,o)&&(at(n,e,t),Nt(n),"Enter"===t.key||"Tab"===t.key||"Backspace"===t.key||-1!==t.key.indexOf("Arrow")||(0,I.yl)(t)||"Escape"===t.key||"Delete"===t.key)){var r=(0,B.a1)(o,"data-newline","1"),r=(!(0,I.yl)(t)&&!t.altKey&&!t.shiftKey&&"Enter"===t.key&&r&&n.startOffset<r.textContent.length&&((i=r.previousElementSibling)&&(n.insertNode(document.createTextNode(i.textContent)),n.collapse(!1)),i=r.nextSibling)&&(n.insertNode(document.createTextNode(i.textContent)),n.collapse(!0)),(0,B.lG)(o,"P"));if(kt(t,e,r,n))return 1;if(wt(n,e,r,t))return 1;if(Mt(e,n,t,r))return 1;var i=(0,B.fb)(o,"vditor-ir__marker--pre");if(i&&"PRE"===i.tagName){var a=i.firstChild;if(At(e,t,i,n))return 1;if(("math-block"===a.getAttribute("data-type")||"html-block"===a.getAttribute("data-type"))&&mt(e,t,n,a,i.parentElement))return 1;if(ut(e,t,n,a,i.parentElement))return 1}a=(0,B.a1)(o,"data-type","code-block-info");if(a){if("Enter"===t.key||"Tab"===t.key)return n.selectNodeContents(a.nextElementSibling.firstChild),n.collapse(!0),t.preventDefault(),s(e,["hint"]),1;if("Backspace"===t.key&&(1===(i=(0,V.im)(a,e.ir.element).start)&&n.setStart(o,0),2===i)&&(e.hint.recentLanguage=""),mt(e,t,n,a,a.parentElement))return s(e,["hint"]),1}i=(0,B.lG)(o,"TD")||(0,B.lG)(o,"TH");if(-1<t.key.indexOf("Arrow")&&i){a=ct(i);if(a&&mt(e,t,n,i,a))return 1;a=dt(i);if(a&&ut(e,t,n,i,a))return 1}if(Ct(e,t,n))return 1;if(Ht(e,n,t))return 1;if(Et(e,n,t))return 1;i=(0,z.W)(o);if(i){if(p("⌘=",t))return(l=i.querySelector(".vditor-ir__marker--heading"))&&1<l.textContent.trim().length&&Rt(e,l.textContent.substr(1)),t.preventDefault(),1;if(p("⌘-",t))return(l=i.querySelector(".vditor-ir__marker--heading"))&&l.textContent.trim().length<6&&Rt(e,l.textContent.trim()+"# "),t.preventDefault(),1}a=(0,B.F9)(o);if("Backspace"===t.key&&!(0,I.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(Ot(e,n,t,r))return 1;if(a&&a.previousElementSibling&&"UL"!==a.tagName&&"OL"!==a.tagName&&("code-block"===a.previousElementSibling.getAttribute("data-type")||"math-block"===a.previousElementSibling.getAttribute("data-type"))){var l=(0,V.im)(a,e.ir.element,n).start;if(0===l||1===l&&a.innerText.startsWith(N.g.ZWSP))return n.selectNodeContents(a.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),n.collapse(!1),ce(n,e),""===a.textContent.trim().replace(N.g.ZWSP,"")&&(a.remove(),v(e)),t.preventDefault(),1}i&&(r=i.firstElementChild.textContent.length,(0,V.im)(i,e.ir.element).start===r)&&(n.setStart(i.firstElementChild.firstChild,r-1),n.collapse(!0),(0,V.Hc)(n))}return("ArrowUp"===t.key||"ArrowDown"===t.key)&&a&&(a.querySelectorAll(".vditor-ir__node").forEach(function(e){e.contains(o)||e.classList.add("vditor-ir__node--hidden")}),Dt(t,a,n))||(lt(n,t.key),a&&le(a,e,t,n)&&(t.preventDefault(),1))}}})(n,t))return;if(n.options.ctrlEnter&&p("⌘Enter",t))n.options.ctrlEnter(D(n));else if(p("⌘Z",t)&&!n.toolbar.elements.undo)n.undo.undo(n);else if(p("⌘Y",t)&&!n.toolbar.elements.redo)n.undo.redo(n);else{var e;if("Escape"!==t.key)return(0,I.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[1-6]$/.test(t.code)?("wysiwyg"===n.currentMode?(e=t.code.replace("Digit","H"),(0,B.lG)(getSelection().getRangeAt(0).startContainer,e)?xe(n):ke(n,e),W(n)):"sv"===n.currentMode?Ke(n,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "):"ir"===n.currentMode&&Rt(n,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "),t.preventDefault(),!0):(0,I.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[7-9]$/.test(t.code)?("Digit7"===t.code?d(n,"wysiwyg",t):"Digit8"===t.code?d(n,"ir",t):"Digit9"===t.code&&d(n,"sv",t),!0):void n.options.toolbar.find(function(e){return!e.hotkey||e.toolbar?!!e.toolbar&&!!e.toolbar.find(function(e){return!!e.hotkey&&(p(e.hotkey,t)?(n.toolbar.elements[e.name].children[0].dispatchEvent(new CustomEvent((0,I.Le)())),t.preventDefault(),!0):void 0)}):p(e.hotkey,t)?(n.toolbar.elements[e.name].children[0].dispatchEvent(new CustomEvent((0,I.Le)())),t.preventDefault(),!0):void 0});"block"===n.hint.element.style.display?n.hint.element.style.display="none":n.options.esc&&!t.isComposing&&n.options.esc(D(n))}t.preventDefault()}})},Ue=function(n,e){e.addEventListener("selectstart",function(t){e.onmouseup=function(){setTimeout(function(){var e=De(n[n.currentMode].element);e.trim()?("wysiwyg"===n.currentMode&&n.options.comment.enable&&((0,B.a1)(t.target,"data-type","footnotes-block")||(0,B.a1)(t.target,"data-type","link-ref-defs-block")?n.wysiwyg.hideComment():n.wysiwyg.showComment()),n.options.select&&n.options.select(e)):"wysiwyg"===n.currentMode&&n.options.comment.enable&&n.wysiwyg.hideComment()})}})},Ve=function(e,t){var n=(0,V.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var t=(t=(0,B.a1)(n.startContainer,"data-block","0"))||e.sv.element,o="<div data-block='0'>"+(o=e.lute.SpinVditorSVDOM(t.textContent)).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">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>";t.isEqualNode(e.sv.element)?t.innerHTML=o:t.outerHTML=o,pe(e.sv.element),(0,V.ib)(e.sv.element,n),k(e)},We=function(e,t,n){void 0===n&&(n=!0);var o=e;for(3===o.nodeType&&(o=o.parentElement);o;){if(o.getAttribute("data-type")===t)return o;o=n?o.previousElementSibling:o.nextElementSibling}return!1},Ge=function(e,t){return J("SpinVditorSVDOM",e,"argument",t.options.debugger),e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).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">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",J("SpinVditorSVDOM",e,"result",t.options.debugger),e},Fe=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,o=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"!==t?e.textContent:"",r=!1;for("newline"===t&&(r=!0);n&&!r;){var i,a,l=n.getAttribute("data-type");"li-marker"===l||"blockquote-marker"===l||"task-marker"===l||"padding"===l?(i=n.textContent,"li-marker"!==l||"code-block-open-marker"!==t&&"code-block-info"!==t?"code-block-close-marker"===t&&n.nextElementSibling.isSameNode(e)?(a=We(e,"code-block-open-marker"))&&a.previousElementSibling&&(n=a.previousElementSibling,o=i+o):o=i+o:o=i.replace(/\S/g," ")+o):"newline"===l&&(r=!0),n=n.previousElementSibling}return o},u=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=D(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,I.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)},Ke=function(e,t){var e=(0,V.zh)(e),n=(0,z.S)(e.startContainer,"SPAN");n&&""!==n.textContent.trim()&&(t="\n"+t),e.collapse(!0),document.execCommand("insertHTML",!1,t)},Ze=function(e,t,n,o){var r,i=(0,V.zh)(e),t=t.getAttribute("data-type"),a=(0===e.sv.element.childNodes.length&&(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">\n</span></span>',(0,V.ib)(e.sv.element,i)),(0,B.F9)(i.startContainer)),l=(0,z.S)(i.startContainer,"SPAN");a&&("link"===t?(r=void 0,r=""===i.toString()?"".concat(n).concat(Lute.Caret).concat(o):"".concat(n).concat(i.toString()).concat(o.replace(")",Lute.Caret+")")),document.execCommand("insertHTML",!1,r)):"italic"===t||"bold"===t||"strike"===t||"inline-code"===t||"code"===t||"table"===t||"line"===t?(r=void 0,r=(""===i.toString()?"".concat(n):"".concat(n).concat(i.toString())).concat(Lute.Caret).concat("code"===t?"":o),"table"===t||"code"===t&&l&&""!==l.textContent?r="\n\n"+r:"line"===t&&(r="\n\n".concat(n,"\n").concat(Lute.Caret)),document.execCommand("insertHTML",!1,r)):("check"!==t&&"list"!==t&&"ordered-list"!==t&&"quote"!==t||!l?((0,V.ib)(e.sv.element,i),u):(o="* ","check"===t?o="* [ ] ":"ordered-list"===t?o="1. ":"quote"===t&&(o="> "),(n=We(l,"newline"))?n.insertAdjacentText("afterend",o):a.insertAdjacentText("afterbegin",o),c))(e))},Je=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},Xe=function(t,n){t.options.upload.setHeaders&&(t.options.upload.headers=t.options.upload.setHeaders()),t.options.upload.headers&&Object.keys(t.options.upload.headers).forEach(function(e){n.setRequestHeader(e,t.options.upload.headers[e])})},Ye=function(e,a,l,s){return new(l=l||Promise)(function(n,t){function o(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof l?t:new l(function(e){e(t)})).then(o,r)}i((s=s.apply(e,a||[])).next())})},Qe=function(o,r){var i,a,l,s={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(n){return function(e){var t=[n,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(l=2&t[0]?a.return:t[0]?a.throw||((l=a.return)&&l.call(a),0):a.next)&&!(l=l.call(a,t[1])).done)return l;switch(a=0,(t=l?[2&t[0],l.value]:t)[0]){case 0:case 1:l=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!((l=0<(l=s.trys).length&&l[l.length-1])||6!==t[0]&&2!==t[0])){s=0;continue}if(3===t[0]&&(!l||t[1]>l[0]&&t[1]<l[3]))s.label=t[1];else if(6===t[0]&&s.label<l[1])s.label=l[1],l=t;else{if(!(l&&s.label<l[2])){l[2]&&s.ops.pop(),s.trys.pop();continue}s.label=l[2],s.ops.push(t)}}t=r.call(o,s)}catch(e){t=[6,e],a=0}finally{i=l=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},$e=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},et=function(h,v,g){return Ye(void 0,void 0,void 0,function(){var t,n,o,r,l,i,a,s,c,d,p,u,m,f;return Qe(this,function(e){switch(e.label){case 0:for(t=[],n=!0===h.options.upload.multiple?v.length:1,u=0;u<n;u++)(o=v[u])instanceof DataTransferItem&&(o=o.getAsFile()),t.push(o);return h.options.upload.handler?[4,h.options.upload.handler(t)]:[3,2];case 1:return r=e.sent(),g&&(g.value=""),"string"==typeof r&&h.tip.show(r),[2];case 2:return h.options.upload.url&&h.upload?h.options.upload.file?[4,h.options.upload.file(t)]:[3,4]:(g&&(g.value=""),h.tip.show("please config: options.upload.url"),[2]);case 3:t=e.sent(),e.label=4;case 4:if(h.options.upload.validate&&"string"==typeof(r=h.options.upload.validate(t)))h.tip.show(r);else if(l=Je(h),h.upload.range=(0,V.zh)(h),0===(i=((r,i)=>{r.tip.hide();for(var a=[],l="",s="",e=(r.options.lang,i.length),t=0;t<e;t++)(e=>{var t=i[e],e=!0,n=(t.name||(l+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),e=!1),t.size>r.options.upload.max&&(l+="<li>".concat(t.name," ").concat(window.VditorI18n.over," ").concat(r.options.upload.max/1024/1024,"M</li>"),e=!1),t.name.lastIndexOf(".")),o=t.name.substr(n),n=r.options.upload.filename(t.name.substr(0,n))+o;r.options.upload.accept&&!r.options.upload.accept.split(",").some(function(e){e=e.trim();if(0===e.indexOf(".")){if(o.toLowerCase()===e.toLowerCase())return!0}else if(t.type.split("/")[0]===e.split("/")[0])return!0;return!1})&&(l+="<li>".concat(t.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),e=!1),e&&(a.push(t),s+="<li>".concat(n," ").concat(window.VditorI18n.uploading,"</li>"))})(t);return r.tip.show("<ul>".concat(l).concat(s,"</ul>")),a})(h,t)).length)g&&(g.value="");else{for(a=new FormData,s=h.options.upload.extraData,c=0,d=Object.keys(s);c<d.length;c++)p=d[c],a.append(p,s[p]);for(u=0,m=i.length;u<m;u++)a.append(h.options.upload.fieldName,i[u]);(f=new XMLHttpRequest).open("POST",h.options.upload.url),h.options.upload.token&&f.setRequestHeader("X-Upload-Token",h.options.upload.token),h.options.upload.withCredentials&&(f.withCredentials=!0),Xe(h,f),h.upload.isUploading=!0,l.setAttribute("contenteditable","false"),f.onreadystatechange=function(){var e,r,i,n,a;f.readyState===XMLHttpRequest.DONE&&(h.upload.isUploading=!1,l.setAttribute("contenteditable","true"),200<=f.status&&f.status<300?h.options.upload.success?h.options.upload.success(l,f.responseText):(e=f.responseText,h.options.upload.format&&(e=h.options.upload.format(v,f.responseText)),e=e,Je(r=h).focus(),i=JSON.parse(e),n="",1===i.code&&(n="".concat(i.msg)),i.data.errFiles&&0<i.data.errFiles.length&&(n="<ul><li>".concat(n,"</li>"),i.data.errFiles.forEach(function(e){var t=e.lastIndexOf("."),e=r.options.upload.filename(e.substr(0,t))+e.substr(t);n+="<li>".concat(e," ").concat(window.VditorI18n.uploadError,"</li>")}),n+="</ul>"),n?r.tip.show(n):r.tip.hide(),a="",Object.keys(i.data.succMap).forEach(function(e){var t=i.data.succMap[e],n=e.lastIndexOf("."),o=e.substr(n),e=r.options.upload.filename(e.substr(0,n))+o;0===(o=o.toLowerCase()).indexOf(".wav")||0===o.indexOf(".mp3")||0===o.indexOf(".ogg")?"wysiwyg"===r.currentMode?a+='<div class="vditor-wysiwyg__block" data-type="html-block"\n data-block="0"><pre><code><audio controls="controls" src="'.concat(t,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(t,'"></audio></pre></div>\n'):"ir"===r.currentMode?a+='<audio controls="controls" src="'.concat(t,'"></audio>\n'):a+="[".concat(e,"](").concat(t,")\n"):0===o.indexOf(".apng")||0===o.indexOf(".bmp")||0===o.indexOf(".gif")||0===o.indexOf(".ico")||0===o.indexOf(".cur")||0===o.indexOf(".jpg")||0===o.indexOf(".jpeg")||0===o.indexOf(".jfif")||0===o.indexOf(".pjp")||0===o.indexOf(".pjpeg")||0===o.indexOf(".png")||0===o.indexOf(".svg")||0===o.indexOf(".webp")?"wysiwyg"===r.currentMode?a+='<img alt="'.concat(e,'" src="').concat(t,'">\n'):a+=".concat(t,")\n"):"wysiwyg"===r.currentMode?a+='<a href="'.concat(t,'">').concat(e,"</a>\n"):a+="[".concat(e,"](").concat(t,")\n")}),(0,V.Hc)(r.upload.range),document.execCommand("insertHTML",!1,a),r.upload.range=getSelection().getRangeAt(0).cloneRange()):h.options.upload.error?h.options.upload.error(f.responseText):h.tip.show(f.responseText),g&&(g.value=""),h.upload.element.style.display="none")},f.upload.onprogress=function(e){e.lengthComputable&&(e=e.loaded/e.total*100,h.upload.element.style.display="block",h.upload.element.style.width=e+"%")},f.send(a)}return[2]}})})},tt=function(t,n,e){var o,r,i,a,l,s,c,d=(0,B.F9)(n.startContainer);d=d||t.wysiwyg.element,(e&&"formatItalic"!==e.inputType&&"deleteByDrag"!==e.inputType&&"insertFromDrop"!==e.inputType&&"formatBold"!==e.inputType&&"formatRemove"!==e.inputType&&"formatStrikeThrough"!==e.inputType&&"insertUnorderedList"!==e.inputType&&"insertOrderedList"!==e.inputType&&"formatOutdent"!==e.inputType&&"formatIndent"!==e.inputType&&""!==e.inputType||!e)&&((s=(()=>{for(var e=n.startContainer.previousSibling;e;){if(3!==e.nodeType&&"A"===e.tagName&&!e.previousSibling&&""===e.innerHTML.replace(N.g.ZWSP,"")&&e.nextSibling)return e;e=e.previousSibling}return!1})())&&s.remove(),t.wysiwyg.element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr")),d.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),d.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}),null!=(s=d.previousElementSibling)&&s.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}),r="",s=(d="link-ref-defs-block"===d.getAttribute("data-type")?t.wysiwyg.element:d).isEqualNode(t.wysiwyg.element),c=(0,B.a1)(d,"data-type","footnotes-block"),s?r=d.innerHTML:((i=(0,B.O9)(n.startContainer))&&!c&&(d=(0,z.S)(n.startContainer,"BLOCKQUOTE")?(0,B.F9)(n.startContainer)||d:i),r=(d=c?c:d).outerHTML,"UL"!==d.tagName&&"OL"!==d.tagName||(i=d.previousElementSibling,a=d.nextElementSibling,!i||"UL"!==i.tagName&&"OL"!==i.tagName||(r=i.outerHTML+r,i.remove()),!a||"UL"!==a.tagName&&"OL"!==a.tagName||(r+=a.outerHTML,a.remove()),r=r.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")),d.innerText.startsWith("```")||(t.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!d.isEqualNode(e)&&(r+=e.outerHTML,e.remove())}),t.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!d.isEqualNode(e)&&(r+=e.outerHTML,e.remove())}))),'<p data-block="0">```<wbr></p>'===(r=r.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,""))&&t.hint.recentLanguage&&(r='<p data-block="0">```<wbr></p>'.replace("```","```"+t.hint.recentLanguage)),J("SpinVditorDOM",r,"argument",t.options.debugger),r=t.lute.SpinVditorDOM(r),J("SpinVditorDOM",r,"result",t.options.debugger),s?d.innerHTML=r:(d.outerHTML=r,c&&(i=(0,B.E2)(t.wysiwyg.element.querySelector("wbr"),"LI"))&&(a=t.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(i.getAttribute("data-marker"),'"]')))&&a.setAttribute("aria-label",i.textContent.trim().substr(0,24))),(s=t.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']")).forEach(function(e,t){0===t?o=e:(o.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),0<s.length&&t.wysiwyg.element.insertAdjacentElement("beforeend",s[0]),(c=t.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']")).forEach(function(e,t){0===t?l=e:(l.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),0<c.length&&t.wysiwyg.element.insertAdjacentElement("beforeend",c[0]),(0,V.ib)(t.wysiwyg.element,n),t.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(e){U(e,t)}),e)&&("deleteContentBackward"===e.inputType||"deleteContentForward"===e.inputType)&&t.options.comment.enable&&(t.wysiwyg.triggerRemoveComment(t),t.options.comment.adjustTop(t.wysiwyg.getComments(t,!0))),h(t),W(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},nt=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},ot=function(e,a,l,s){return new(l=l||Promise)(function(n,t){function o(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof l?t:new l(function(e){e(t)})).then(o,r)}i((s=s.apply(e,a||[])).next())})},rt=function(o,r){var i,a,l,s={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(n){return function(e){var t=[n,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(l=2&t[0]?a.return:t[0]?a.throw||((l=a.return)&&l.call(a),0):a.next)&&!(l=l.call(a,t[1])).done)return l;switch(a=0,(t=l?[2&t[0],l.value]:t)[0]){case 0:case 1:l=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!((l=0<(l=s.trys).length&&l[l.length-1])||6!==t[0]&&2!==t[0])){s=0;continue}if(3===t[0]&&(!l||t[1]>l[0]&&t[1]<l[3]))s.label=t[1];else if(6===t[0]&&s.label<l[1])s.label=l[1],l=t;else{if(!(l&&s.label<l[2])){l[2]&&s.ops.pop(),s.trys.pop();continue}s.label=l[2],s.ops.push(t)}}t=r.call(o,s)}catch(e){t=[6,e],a=0}finally{i=l=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},it=function(e,t,n){if(229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&"sv"!==t.currentMode){e=(0,B.F9)(n);if(e&&""===e.textContent.trim())return!(t[t.currentMode].composingLock=!0)}return!0},at=function(e,t,n){"Enter"===n.key||"Tab"===n.key||"Backspace"===n.key||-1<n.key.indexOf("Arrow")||(0,I.yl)(n)||"Escape"===n.key||n.shiftKey||n.altKey||(n=(0,B.lG)(e.startContainer,"P")||(0,B.lG)(e.startContainer,"LI"))&&0===(0,V.im)(n,t[t.currentMode].element,e).start&&(n.nodeValue&&(n.nodeValue=n.nodeValue.replace(/\u2006/g,"")),t=document.createTextNode(N.g.ZWSP),e.insertNode(t),e.setStartAfter(t))},lt=function(e,t){var n;"ArrowDown"!==t&&"ArrowUp"!==t||(n=(0,B.a1)(e.startContainer,"data-type","math-inline")||(0,B.a1)(e.startContainer,"data-type","html-entity")||(0,B.a1)(e.startContainer,"data-type","html-inline"))&&("ArrowDown"===t&&e.setStartAfter(n.parentElement),"ArrowUp"===t)&&e.setStartBefore(n.parentElement)},st=function(e,t){var n=(0,V.zh)(e),o=(0,B.F9)(n.startContainer);o&&(o.insertAdjacentHTML(t,'<p data-block="0">'.concat(N.g.ZWSP,"<wbr>\n</p>")),(0,V.ib)(e[e.currentMode].element,n),Me(e),x(e))},ct=function(e){var t=(0,B.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},dt=function(e){var t=(0,B.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},pt=function(e,t,n){void 0===n&&(n=!0);var o=e.previousElementSibling;return(o=o||(e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:"TBODY"===e.parentElement.parentElement.tagName&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null))&&(t.selectNodeContents(o),n||t.collapse(!1),(0,V.Hc)(t)),o},ut=function(e,t,n,o,r){var i=(0,V.im)(o,e[e.currentMode].element,n);return("ArrowDown"===t.key&&-1===o.textContent.trimRight().substr(i.start).indexOf("\n")||"ArrowRight"===t.key&&i.start>=o.textContent.trimRight().length)&&(!(i=r.nextElementSibling)||"TABLE"===i.tagName||i.getAttribute("data-type")?(r.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(N.g.ZWSP,"<wbr></p>")),(0,V.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(i),n.collapse(!0),(0,V.Hc)(n)),t.preventDefault(),!0)},mt=function(e,t,n,o,r){var i=(0,V.im)(o,e[e.currentMode].element,n);return("ArrowUp"===t.key&&-1===o.textContent.substr(0,i.start).indexOf("\n")||("ArrowLeft"===t.key||"Backspace"===t.key&&""===n.toString())&&0===i.start)&&(!(o=r.previousElementSibling)||"TABLE"===o.tagName||o.getAttribute("data-type")?(r.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(N.g.ZWSP,"<wbr></p>")),(0,V.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(o),n.collapse(!1),(0,V.Hc)(n)),t.preventDefault(),!0)},ft=function(e,t,n,o){void 0===o&&(o=!0);var r=(0,B.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),o&&r){for(var i="",a=0;a<r.parentElement.childElementCount;a++){var l=r.parentElement.children[a].querySelector("input");l&&l.remove(),i+='<p data-block="0">'.concat(r.parentElement.children[a].innerHTML.trimLeft(),"</p>")}r.parentElement.insertAdjacentHTML("beforebegin",i),r.parentElement.remove()}else r?"check"===n?r.parentElement.querySelectorAll("li").forEach(function(e){e.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(0===e.textContent.indexOf(" ")?"":" ")),e.classList.add("vditor-task")}):(r.querySelector("input")&&r.parentElement.querySelectorAll("li").forEach(function(e){e.querySelector("input").remove(),e.classList.remove("vditor-task")}),o=void 0,"list"===n?(o=document.createElement("ul")).setAttribute("data-marker","*"):(o=document.createElement("ol")).setAttribute("data-marker","1."),o.setAttribute("data-block","0"),o.setAttribute("data-tight",r.parentElement.getAttribute("data-tight")),o.innerHTML=r.parentElement.innerHTML,r.parentElement.parentNode.replaceChild(o,r.parentElement)):((o=(0,B.a1)(t.startContainer,"data-block","0"))||(e[e.currentMode].element.querySelector("wbr").remove(),(o=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),"check"===n?(o.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(o.innerHTML,"</li></ul>")),o.remove()):"list"===n?(o.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(o.innerHTML,"</li></ul>")),o.remove()):"ordered-list"===n&&(o.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(o.innerHTML,"</li></ol>")),o.remove()))},ht=function(t,n,e){var o,r,i,a=n.previousElementSibling;n&&a?(o=[n],Array.from(e.cloneContents().children).forEach(function(e,t){3!==e.nodeType&&n&&""!==e.textContent.trim()&&n.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==t&&o.push(n),n=n.nextElementSibling)}),t[t.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),e.insertNode(document.createElement("wbr")),r=a.parentElement,i="",o.forEach(function(e){var t=e.getAttribute("data-marker");1!==t.length&&(t="1".concat(t.slice(-1))),i+='<li data-node-id="'.concat(e.getAttribute("data-node-id"),'" data-marker="').concat(t,'">').concat(e.innerHTML,"</li>"),e.remove()}),a.insertAdjacentHTML("beforeend","<".concat(r.tagName,' data-block="0">').concat(i,"</").concat(r.tagName,">")),"wysiwyg"===t.currentMode?r.outerHTML=t.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),(0,V.ib)(t[t.currentMode].element,e),(a=(0,B.O9)(e.startContainer))&&a.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){U(e,t),"wysiwyg"===t.currentMode&&e.previousElementSibling.setAttribute("style","display:none")}),x(t),Me(t)):t[t.currentMode].element.focus()},vt=function(t,n,e,o){var r,i,a,l,s,c=(0,B.lG)(n.parentElement,"LI");c?(t[t.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),e.insertNode(document.createElement("wbr")),r=(s=n.parentElement).cloneNode(),i=[n],Array.from(e.cloneContents().children).forEach(function(e,t){3!==e.nodeType&&n&&""!==e.textContent.trim()&&n.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==t&&i.push(n),n=n.nextElementSibling)}),a=!1,l="",s.querySelectorAll("li").forEach(function(e){a&&(l+=e.outerHTML,(e.nextElementSibling||e.previousElementSibling?e:e.parentElement).remove()),e.isSameNode(i[i.length-1])&&(a=!0)}),i.reverse().forEach(function(e){c.insertAdjacentElement("afterend",e)}),l&&(r.innerHTML=l,i[0].insertAdjacentElement("beforeend",r)),"wysiwyg"===t.currentMode?o.outerHTML=t.lute.SpinVditorDOM(o.outerHTML):o.outerHTML=t.lute.SpinVditorIRDOM(o.outerHTML),(0,V.ib)(t[t.currentMode].element,e),(s=(0,B.O9)(e.startContainer))&&s.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){U(e,t),"wysiwyg"===t.currentMode&&e.previousElementSibling.setAttribute("style","display:none")}),x(t),Me(t)):t[t.currentMode].element.focus()},gt=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,o=e.rows[0].cells.length,r=e.rows.length,i=0,a=0;a<r;a++)for(var l=0;l<o;l++)if(e.rows[a].cells[l].isSameNode(n)){i=l;break}for(var s=0;s<r;s++)e.rows[s].cells[i].setAttribute("align",t)},bt=function(e){var t=e.trimRight().split("\n").pop();return""!==t&&(""===t.replace(/ |-/g,"")||""===t.replace(/ |_/g,"")||""===t.replace(/ |\*/g,""))&&2<t.replace(/ /g,"").length&&!(-1<t.indexOf("-")&&-1===t.trimLeft().indexOf(" ")&&1<e.trimRight().split("\n").length)&&0!==t.indexOf(" ")&&0!==t.indexOf("\t")},yt=function(e){var t=e.trimRight().split("\n");return 0!==(e=t.pop()).indexOf(" ")&&0!==e.indexOf("\t")&&""!==(e=e.trimLeft())&&0!==t.length&&(""===e.replace(/-/g,"")||""===e.replace(/=/g,""))},x=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),"wysiwyg"===e.currentMode?W(e,t):"ir"===e.currentMode?v(e,t):"sv"===e.currentMode&&u(e,t)},wt=function(e,t,n,o){var r=e.startContainer,i=(0,B.lG)(r,"LI");if(i){if(!(0,I.yl)(o)&&!o.altKey&&"Enter"===o.key&&!o.shiftKey&&n&&i.contains(n)&&n.nextElementSibling)return i&&!i.textContent.endsWith("\n")&&i.insertAdjacentText("beforeend","\n"),e.insertNode(document.createTextNode("\n\n")),e.collapse(!1),x(t),o.preventDefault(),!0;if(!((0,I.yl)(o)||o.shiftKey||o.altKey||"Backspace"!==o.key||i.previousElementSibling||""!==e.toString()||0!==(0,V.im)(i,t[t.currentMode].element,e).start))return i.nextElementSibling?(i.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(i.innerHTML,"</p>")),i.remove()):i.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(i.innerHTML,"</p>"),(0,V.ib)(t[t.currentMode].element,e),x(t),o.preventDefault(),!0;if(!(0,I.yl)(o)&&!o.shiftKey&&!o.altKey&&"Backspace"===o.key&&""===i.textContent.trim().replace(N.g.ZWSP,"")&&""===e.toString()&&"LI"===(null==(n=i.previousElementSibling)?void 0:n.tagName))return i.previousElementSibling.insertAdjacentText("beforeend","\n\n"),e.selectNodeContents(i.previousElementSibling),e.collapse(!1),i.remove(),(0,V.ib)(t[t.currentMode].element,e),x(t),o.preventDefault(),!0;if(!(0,I.yl)(o)&&!o.altKey&&"Tab"===o.key){n=!1;if((n=0===e.startOffset&&(3===r.nodeType&&!r.previousSibling||3!==r.nodeType&&"LI"===r.nodeName)||i.classList.contains("vditor-task")&&1===e.startOffset&&3!==r.previousSibling.nodeType&&"INPUT"===r.previousSibling.tagName?!0:n)||""!==e.toString())return o.shiftKey?vt(t,i,e,i.parentElement):ht(t,i,e),o.preventDefault(),!0}}return!1},Et=function(e,t,n){if(e.options.tab&&"Tab"===n.key)return n.shiftKey||(""!==t.toString()&&t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)),(0,V.Hc)(t),x(e),n.preventDefault(),!0},kt=function(e,t,n,o){if(n){if(!(0,I.yl)(e)&&!e.altKey&&"Enter"===e.key){var r=String.raw(ge=ge||nt(["",""],["",""]),n.textContent).replace(/\\\|/g,"").trim(),i=r.split("|");if(r.startsWith("|")&&r.endsWith("|")&&3<i.length)return r=i.map(function(){return"---"}).join("|"),r=n.textContent+"\n"+r.substring(3,r.length-3)+"\n|<wbr>",n.outerHTML=t.lute.SpinVditorDOM(r),(0,V.ib)(t[t.currentMode].element,o),x(t),k(t),e.preventDefault(),!0;if(bt(n.innerHTML)&&n.previousElementSibling)return i="",1<(r=n.innerHTML.trimRight().split("\n")).length&&(r.pop(),i='<p data-block="0">'.concat(r.join("\n"),"</p>")),n.insertAdjacentHTML("afterend","".concat(i,'<hr data-block="0"><p data-block="0"><wbr>\n</p>')),n.remove(),(0,V.ib)(t[t.currentMode].element,o),x(t),k(t),e.preventDefault(),!0;if(yt(n.innerHTML))return"wysiwyg"===t.currentMode?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'),(0,V.ib)(t[t.currentMode].element,o),x(t),k(t),e.preventDefault(),!0}return o.collapsed&&n.previousElementSibling&&"Backspace"===e.key&&!(0,I.yl)(e)&&!e.altKey&&!e.shiftKey&&1<n.textContent.trimRight().split("\n").length&&0===(0,V.im)(n,t[t.currentMode].element,o).start&&((r=(0,B.DX)(n.previousElementSibling)).textContent.endsWith("\n")||(r.textContent=r.textContent+"\n"),r.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(n.innerHTML)),n.remove(),(0,V.ib)(t[t.currentMode].element,o)),!1}},xt=function(e,t,n){for(var o="",r=0;r<n.parentElement.childElementCount;r++)o+='<td align="'.concat(n.parentElement.children[r].getAttribute("align"),'"> </td>');"TH"===n.tagName?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(o,"</tr></tbody>")):n.parentElement.insertAdjacentHTML("afterend","<tr>".concat(o,"</tr>")),x(e)},St=function(e,t,n){for(var o,r="",i=0;i<n.parentElement.childElementCount;i++)r+="TH"===n.tagName?'<th align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </th>'):'<td align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </td>');"TH"===n.tagName?(n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(r,"</tr></thead>")),t.insertNode(document.createElement("wbr")),o=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>"),n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",o),n.parentElement.parentElement.remove(),(0,V.ib)(e.ir.element,t)):n.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(r,"</tr>")),x(e)},_t=function(e,t,n,o){void 0===o&&(o="afterend");for(var r=0,i=n.previousElementSibling;i;)r++,i=i.previousElementSibling;for(var a=0;a<t.rows.length;a++)0===a?t.rows[a].cells[r].insertAdjacentHTML(o,"<th> </th>"):t.rows[a].cells[r].insertAdjacentHTML(o,"<td> </td>");x(e)},Tt=function(e,t,n){var o;"TD"===n.tagName&&(o=n.parentElement.parentElement,n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(o.previousElementSibling.lastElementChild.lastElementChild),(1===o.childElementCount?o:n.parentElement).remove(),t.collapse(!1),(0,V.Hc)(t),x(e))},Lt=function(e,t,n,o){for(var r=0,i=o.previousElementSibling;i;)r++,i=i.previousElementSibling;(o.previousElementSibling||o.nextElementSibling)&&(t.selectNodeContents(o.previousElementSibling||o.nextElementSibling),t.collapse(!0));for(var a=0;a<n.rows.length;a++){var l=n.rows[a].cells;if(1===l.length){n.remove(),Me(e);break}l[r].remove()}(0,V.Hc)(t),x(e)},Ct=function(e,t,n){var o=n.startContainer,r=(0,B.lG)(o,"TD")||(0,B.lG)(o,"TH");if(r){if(!(0,I.yl)(t)&&!t.altKey&&"Enter"===t.key)return r.lastElementChild&&(!r.lastElementChild||r.lastElementChild.isSameNode(r.lastChild)&&"BR"===r.lastElementChild.tagName)||r.insertAdjacentHTML("beforeend","<br>"),o=document.createElement("br"),n.insertNode(o),n.setStartAfter(o),x(e),k(e),t.preventDefault(),!0;if("Tab"===t.key)return t.shiftKey?pt(r,n):(i=(i=r.nextElementSibling)||(r.parentElement.nextElementSibling?r.parentElement.nextElementSibling.firstElementChild:"THEAD"===r.parentElement.parentElement.tagName&&r.parentElement.parentElement.nextElementSibling?r.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null))&&(n.selectNodeContents(i),(0,V.Hc)(n)),t.preventDefault(),!0;var i,a,o=r.parentElement.parentElement.parentElement;if("ArrowUp"===t.key){if(t.preventDefault(),"TH"===r.tagName)o.previousElementSibling?(n.selectNodeContents(o.previousElementSibling),n.collapse(!1),(0,V.Hc)(n)):st(e,"beforebegin");else{for(var l=0,s=r.parentElement;l<s.cells.length&&!s.cells[l].isSameNode(r);l++);var c=(c=s.previousElementSibling)||s.parentElement.previousElementSibling.firstChild;n.selectNodeContents(c.cells[l]),n.collapse(!1),(0,V.Hc)(n)}return!0}if("ArrowDown"===t.key){if(t.preventDefault(),(s=r.parentElement).nextElementSibling||"TD"!==r.tagName){for(l=0;l<s.cells.length&&!s.cells[l].isSameNode(r);l++);i=(i=s.nextElementSibling)||s.parentElement.nextElementSibling.firstChild,n.selectNodeContents(i.cells[l]),n.collapse(!0),(0,V.Hc)(n)}else o.nextElementSibling?(n.selectNodeContents(o.nextElementSibling),n.collapse(!0),(0,V.Hc)(n)):st(e,"afterend");return!0}if("wysiwyg"===e.currentMode&&!(0,I.yl)(t)&&"Enter"===t.key&&!t.shiftKey&&t.altKey)return(c=e.wysiwyg.popover.querySelector(".vditor-input")).focus(),c.select(),t.preventDefault(),!0;if(!(0,I.yl)(t)&&!t.shiftKey&&!t.altKey&&"Backspace"===t.key&&0===n.startOffset&&""===n.toString())return!pt(r,n,!1)&&o&&(""===o.textContent.trim()?(o.outerHTML='<p data-block="0"><wbr>\n</p>',(0,V.ib)(e[e.currentMode].element,n)):(n.setStartBefore(o),n.collapse(!0)),x(e)),t.preventDefault(),!0;if(p("⇧⌘F",t))return St(e,n,r),t.preventDefault(),!0;if(p("⌘=",t))return xt(e,n,r),t.preventDefault(),!0;if(p("⇧⌘G",t))return _t(e,o,r,"beforebegin"),t.preventDefault(),!0;if(p("⇧⌘=",t))return _t(e,o,r),t.preventDefault(),!0;if(p("⌘-",t))return Tt(e,n,r),t.preventDefault(),!0;if(p("⇧⌘-",t))return Lt(e,n,o,r),t.preventDefault(),!0;if(p("⇧⌘L",t)){if("ir"===e.currentMode)return gt(o,"left"),x(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="left"]'))return a.click(),t.preventDefault(),!0}if(p("⇧⌘C",t)){if("ir"===e.currentMode)return gt(o,"center"),x(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="center"]'))return a.click(),t.preventDefault(),!0}if(p("⇧⌘R",t)){if("ir"===e.currentMode)return gt(o,"right"),x(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="right"]'))return a.click(),t.preventDefault(),!0}}return!1},At=function(e,t,n,o){if("PRE"===n.tagName&&p("⌘A",t))return o.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&"Tab"===t.key&&!t.shiftKey&&""===o.toString())return o.insertNode(document.createTextNode(e.options.tab)),o.collapse(!1),x(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,I.yl)(t)&&!t.shiftKey&&!t.altKey){var r=(0,V.im)(n,e[e.currentMode].element,o);if((0===r.start||1===r.start&&"\n"===n.innerText)&&""===o.toString())return n.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(n.firstElementChild.innerHTML,"</p>"),(0,V.ib)(e[e.currentMode].element,o),x(e),t.preventDefault(),!0}return!(0,I.yl)(t)&&!t.altKey&&"Enter"===t.key&&(n.firstElementChild.textContent.endsWith("\n")||n.firstElementChild.insertAdjacentText("beforeend","\n"),o.extractContents(),o.insertNode(document.createTextNode("\n")),o.collapse(!1),(0,V.Hc)(o),(0,I.vU)()||("wysiwyg"===e.currentMode?tt:se)(e,o),k(e),t.preventDefault(),!0)},Mt=function(e,t,n,o){var r=t.startContainer,i=(0,B.lG)(r,"BLOCKQUOTE");if(i&&""===t.toString()){if("Backspace"===n.key&&!(0,I.yl)(n)&&!n.shiftKey&&!n.altKey&&0===(0,V.im)(i,e[e.currentMode].element,t).start)return t.insertNode(document.createElement("wbr")),i.outerHTML=i.innerHTML,(0,V.ib)(e[e.currentMode].element,t),x(e),n.preventDefault(),!0;if(o&&"Enter"===n.key&&!(0,I.yl)(n)&&!n.shiftKey&&!n.altKey&&"BLOCKQUOTE"===o.parentElement.tagName){var a=!1;if("\n"===o.innerHTML.replace(N.g.ZWSP,"")||""===o.innerHTML.replace(N.g.ZWSP,"")?(a=!0,o.remove()):o.innerHTML.endsWith("\n\n")&&(0,V.im)(o,e[e.currentMode].element,t).start===o.textContent.length-1&&(o.innerHTML=o.innerHTML.substr(0,o.innerHTML.length-2),a=!0),a)return i.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(N.g.ZWSP,"<wbr>\n</p>")),(0,V.ib)(e[e.currentMode].element,t),x(e),n.preventDefault(),!0}o=(0,B.F9)(r);if("wysiwyg"===e.currentMode&&o&&p("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),o.outerHTML='<blockquote data-block="0">'.concat(o.outerHTML,"</blockquote>"),(0,V.ib)(e.wysiwyg.element,t),W(e),n.preventDefault(),!0;if(ut(e,n,t,i,i))return!0;if(mt(e,n,t,i,i))return!0}return!1},Ht=function(e,t,n){var o,r,i,a,l,s,c=t.startContainer,d=(0,B.fb)(c,"vditor-task");if(d){if(p("⇧⌘J",n))return(a=d.firstElementChild).checked?a.removeAttribute("checked"):a.setAttribute("checked","checked"),x(e),n.preventDefault(),!0;if("Backspace"===n.key&&!(0,I.yl)(n)&&!n.shiftKey&&!n.altKey&&""===t.toString()&&1===t.startOffset&&(3===c.nodeType&&c.previousSibling&&"INPUT"===c.previousSibling.tagName||3!==c.nodeType))return a=d.previousElementSibling,d.querySelector("input").remove(),(a?((0,B.DX)(a).parentElement.insertAdjacentHTML("beforeend","<wbr>"+d.innerHTML.trim()),d):(d.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(d.innerHTML.trim()||"\n","</p>")),d.nextElementSibling?d:d.parentElement)).remove(),(0,V.ib)(e[e.currentMode].element,t),x(e),n.preventDefault(),!0;if("Enter"===n.key&&!(0,I.yl)(n)&&!n.shiftKey&&!n.altKey)return""===d.textContent.trim()?(0,B.fb)(d.parentElement,"vditor-task")?(a=(0,B.O9)(c))&&vt(e,d,t,a):d.nextElementSibling?(r=o="",i=!1,Array.from(d.parentElement.children).forEach(function(e){d.isSameNode(e)?i=!0:i?o+=e.outerHTML:r+=e.outerHTML}),a=d.parentElement.tagName,l="OL"===d.parentElement.tagName?"":' data-marker="'.concat(d.parentElement.getAttribute("data-marker"),'"'),s="",r&&(s="UL"===d.parentElement.tagName?"":' start="1"',r="<".concat(a,' data-tight="true"').concat(l,' data-block="0">').concat(r,"</").concat(a,">")),d.parentElement.outerHTML="".concat(r,'<p data-block="0"><wbr>\n</p><').concat(a,'\n data-tight="true"').concat(l,' data-block="0"').concat(s,">").concat(o,"</").concat(a,">")):(d.parentElement.insertAdjacentHTML("afterend",'<p data-block="0"><wbr>\n</p>'),(1===d.parentElement.querySelectorAll("li").length?d.parentElement:d).remove()):3!==c.nodeType&&0===t.startOffset&&"INPUT"===c.firstChild.tagName?t.setStart(c.childNodes[1],1):(t.setEndAfter(d.lastChild),d.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(d.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(t.extractContents())),(0,V.ib)(e[e.currentMode].element,t),x(e),k(e),n.preventDefault(),!0}return!1},Ot=function(e,t,n,o){if(3!==t.startContainer.nodeType){var r=t.startContainer.children[t.startOffset];if(r&&"HR"===r.tagName)return t.selectNodeContents(r.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(o){var i,r=o.previousElementSibling;if(r&&0===(0,V.im)(o,e[e.currentMode].element,t).start&&((0,I.vU)()&&"HR"===r.tagName||"TABLE"===r.tagName))return("TABLE"===r.tagName?((i=r.lastElementChild.lastElementChild.lastElementChild).innerHTML=i.innerHTML.trimLeft()+"<wbr>"+o.textContent.trim(),o):r).remove(),(0,V.ib)(e[e.currentMode].element,t),x(e),n.preventDefault(),!0}return!1},Nt=function(e){(0,I.vU)()&&3!==e.startContainer.nodeType&&"HR"===e.startContainer.tagName&&e.setStartBefore(e.startContainer)},Dt=function(e,t,n){var o;return!(!(0,I.vU)()||("ArrowUp"===e.key&&t&&"TABLE"===(null==(o=t.previousElementSibling)?void 0:o.tagName)?(o=t.previousElementSibling,n.selectNodeContents(o.rows[o.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),0):"ArrowDown"!==e.key||!t||"TABLE"!==(null==(o=t.nextElementSibling)?void 0:o.tagName)||(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),0)))},It=function(y,w,E){return ot(void 0,void 0,void 0,function(){var l,s,c,d,p,u,m,f,h,v,g,b;return rt(this,function(e){switch(e.label){case 0:return"true"!==y[y.currentMode].element.getAttribute("contenteditable")?[2]:(w.stopPropagation(),w.preventDefault(),"clipboardData"in w?(l=w.clipboardData.getData("text/html"),s=w.clipboardData.getData("text/plain"),c=w.clipboardData.files):(l=w.dataTransfer.getData("text/html"),s=w.dataTransfer.getData("text/plain"),w.dataTransfer.types.includes("Files")&&(c=w.dataTransfer.items)),d={},p=function(e,t){var o;return t?y.options.upload.renderLinkDest?y.options.upload.renderLinkDest(y,e,t):(t=e.TokensStr(),34===e.__internal_object__.Parent.Type&&t&&-1===t.indexOf("file://")&&y.options.upload.linkToImgUrl&&((o=new XMLHttpRequest).open("POST",y.options.upload.linkToImgUrl),y.options.upload.token&&o.setRequestHeader("X-Upload-Token",y.options.upload.token),y.options.upload.withCredentials&&(o.withCredentials=!0),Xe(y,o),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status){var e=o.responseText,t=(y.options.upload.linkToImgFormat&&(e=y.options.upload.linkToImgFormat(o.responseText)),JSON.parse(e));if(0!==t.code)return void y.tip.show(t.msg);var n=t.data.originalURL;"sv"===y.currentMode?y.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(e){e.textContent===n&&(e.textContent=t.data.url)}):((e=y[y.currentMode].element.querySelector('img[src="'.concat(n,'"]'))).src=t.data.url,"ir"===y.currentMode&&(e.previousElementSibling.previousElementSibling.innerHTML=t.data.url)),x(y)}else y.tip.show(o.responseText);y.options.upload.linkToImgCallback&&y.options.upload.linkToImgCallback(o.responseText)}},o.send(JSON.stringify({url:t}))),"ir"===y.currentMode?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(t),"</span>"),Lute.WalkContinue]:"wysiwyg"===y.currentMode?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(t),"</span>"),Lute.WalkContinue]):["",Lute.WalkContinue]},l.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'.concat(s,'">').concat(s,"</a>")&&l.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='\x3c!--StartFragment--\x3e<a href="'.concat(s,'">').concat(s,"</a>\x3c!--EndFragment--\x3e")||(l=""),(u=(new DOMParser).parseFromString(l,"text/html")).body&&(l=u.body.innerHTML),l=Lute.Sanitize(l),y.wysiwyg.getComments(y),u=y[y.currentMode].element.scrollHeight,t=l,n=s,void 0===(o=y.currentMode)&&(o="sv"),(r=document.createElement("div")).innerHTML=t,i=!1,1===r.childElementCount&&-1<r.lastElementChild.style.fontFamily.indexOf("monospace")&&(i=!0),a=r.querySelectorAll("pre"),1===r.childElementCount&&1===a.length&&"vditor-wysiwyg"!==a[0].className&&"vditor-sv"!==a[0].className&&(i=!0),0===t.indexOf('\n<p class="p1">')&&(i=!0),m=!!(i=!(1!==r.childElementCount||"TABLE"!==r.firstElementChild.tagName||!r.querySelector(".line-number")||!r.querySelector(".line-content"))||i)&&(/\n/.test(r=n||t)||1===a.length?"wysiwyg"===o?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(r.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+r.replace(/&/g,"&").replace(/</g,"<")+"\n```":"wysiwyg"===o?"<code>".concat(r.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(r,"`")),(v="sv"===y.currentMode?(0,B.a1)(w.target,"data-type","code-block"):(0,B.lG)(w.target,"CODE"))?("sv"===y.currentMode?document.execCommand("insertHTML",!1,s.replace(/&/g,"&").replace(/</g,"<")):(b=(0,V.im)(w.target,y[y.currentMode].element),"PRE"!==v.parentElement.tagName&&(s+=N.g.ZWSP),v.textContent=v.textContent.substring(0,b.start)+s+v.textContent.substring(b.end),(0,V.$j)(b.start+s.length,b.start+s.length,v.parentElement),null!=(b=v.parentElement)&&b.nextElementSibling.classList.contains("vditor-".concat(y.currentMode,"__preview"))&&(v.parentElement.nextElementSibling.innerHTML=v.outerHTML,U(v.parentElement.nextElementSibling,y))),[3,8]):[3,1]);case 1:return m?(E.pasteCode(m),[3,8]):[3,2];case 2:return""===l.trim()?[3,3]:((b=document.createElement("div")).innerHTML=l,b.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),b.querySelectorAll(".vditor-copy").forEach(function(e){e.remove()}),"ir"===y.currentMode?(d.HTML2VditorIRDOM={renderLinkDest:p},y.lute.SetJSRenderers({renderers:d}),(0,V.oC)(y.lute.HTML2VditorIRDOM(b.innerHTML),y)):"wysiwyg"===y.currentMode?(d.HTML2VditorDOM={renderLinkDest:p},y.lute.SetJSRenderers({renderers:d}),(0,V.oC)(y.lute.HTML2VditorDOM(b.innerHTML),y)):(d.Md2VditorSVDOM={renderLinkDest:p},y.lute.SetJSRenderers({renderers:d}),Ve(y,y.lute.HTML2Md(b.innerHTML).trimRight())),y.outline.render(y),[3,8]);case 3:return 0<c.length?y.options.upload.url||y.options.upload.handler?[4,et(y,c)]:[3,5]:[3,7];case 4:return e.sent(),[3,6];case 5:f=new FileReader,"clipboardData"in w?(c=w.clipboardData.files,h=c[0]):w.dataTransfer.types.includes("Files")&&(c=w.dataTransfer.items,h=c[0].getAsFile()),h&&h.type.startsWith("image")&&(f.readAsDataURL(h),f.onload=function(){var e="";"wysiwyg"===y.currentMode?e+='<img alt="'.concat(h.name,'" src="').concat(f.result.toString(),'">\n'):e+=".concat(f.result.toString(),")\n"),document.execCommand("insertHTML",!1,e)}),e.label=6;case 6:return[3,8];case 7:""!==s.trim()&&0===c.length&&(""!==(g=(0,V.zh)(y)).toString()&&y.lute.IsValidLinkDest(s)&&(s="[".concat(g.toString(),"](").concat(s,")")),"ir"===y.currentMode?(d.Md2VditorIRDOM={renderLinkDest:p},y.lute.SetJSRenderers({renderers:d}),(0,V.oC)(y.lute.Md2VditorIRDOM(s),y)):"wysiwyg"===y.currentMode?(d.Md2VditorDOM={renderLinkDest:p},y.lute.SetJSRenderers({renderers:d}),(0,V.oC)(y.lute.Md2VditorDOM(s),y)):(d.Md2VditorSVDOM={renderLinkDest:p},y.lute.SetJSRenderers({renderers:d}),Ve(y,s)),y.outline.render(y)),e.label=8;case 8:return"sv"!==y.currentMode&&((v=(0,B.F9)((0,V.zh)(y).startContainer))&&(g=(0,V.zh)(y),y[y.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),g.insertNode(document.createElement("wbr")),"wysiwyg"===y.currentMode?v.outerHTML=y.lute.SpinVditorDOM(v.outerHTML):v.outerHTML=y.lute.SpinVditorIRDOM(v.outerHTML),(0,V.ib)(y[y.currentMode].element,g)),y[y.currentMode].element.querySelectorAll(".vditor-".concat(y.currentMode,"__preview[data-render='2']")).forEach(function(e){U(e,y)})),y.wysiwyg.triggerRemoveComment(y),x(y),y[y.currentMode].element.scrollHeight-u>Math.min(y[y.currentMode].element.clientHeight,window.innerHeight)/2&&k(y),[2]}var t,n,o,r,i,a})})},jt=function(e){e.hint.render(e);var t,n,o=(0,V.zh)(e).startContainer,o=(0,B.a1)(o,"data-type","code-block-info");o&&(""===o.textContent.replace(N.g.ZWSP,"")&&e.hint.recentLanguage?(o.textContent=N.g.ZWSP+e.hint.recentLanguage,(0,V.zh)(e).selectNodeContents(o)):(t=[],n=o.textContent.substring(0,(0,V.im)(o,e.ir.element).start).replace(N.g.ZWSP,""),(e.options.preview.hljs.langs||N.g.CODE_LANGUAGES).forEach(function(e){-1<e.indexOf(n.toLowerCase())&&t.push({html:e,value:e})}),e.hint.genHTML(t,n,e)))},v=function(t,n){(n=void 0===n?{enableAddUndoStack:!0,enableHint:!1,enableInput:!0}:n).enableHint&&jt(t),clearTimeout(t.ir.processTimeoutId),t.ir.processTimeoutId=window.setTimeout(function(){var e;t.ir.composingLock||(e=D(t),"function"==typeof t.options.input&&n.enableInput&&t.options.input(e),t.options.counter.enable&&t.counter.render(t,e),t.options.cache.enable&&(0,I.pK)()&&(localStorage.setItem(t.options.cache.id,e),t.options.cache.after)&&t.options.cache.after(e),t.devtools&&t.devtools.renderEchart(t),n.enableAddUndoStack&&t.undo.addToUndoStack(t))},t.options.undoDelay)},Rt=function(e,t){var n,o=(0,V.zh)(e),r=(0,B.F9)(o.startContainer)||o.startContainer;r&&((n=r.querySelector(".vditor-ir__marker--heading"))?n.innerHTML=t:(r.insertAdjacentText("afterbegin",t),o.selectNodeContents(r),o.collapse(!1)),se(e,o.cloneRange()),be(e))},Pt=function(e,t,n){n=(0,B.a1)(e.startContainer,"data-type",n);n&&(n.firstElementChild.remove(),n.lastElementChild.remove(),e.insertNode(document.createElement("wbr")),(e=document.createElement("div")).innerHTML=t.lute.SpinVditorIRDOM(n.outerHTML),n.outerHTML=e.firstElementChild.innerHTML.trim())},qt=function(e,t,n,o){var r,i,a=(0,V.zh)(e),l=t.getAttribute("data-type"),s=a.startContainer,c=(3===s.nodeType&&(s=s.parentElement),!0);t.classList.contains("vditor-menu--current")?"quote"===l?(s=(0,B.lG)(s,"BLOCKQUOTE"))&&(a.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'.concat(s.innerHTML,"</p>"):s.innerHTML):"link"===l?(s=(0,B.a1)(a.startContainer,"data-type","a"))&&((r=(0,B.fb)(a.startContainer,"vditor-ir__link"))?(a.insertNode(document.createElement("wbr")),s.outerHTML=r.innerHTML):s.outerHTML=s.querySelector(".vditor-ir__link").innerHTML+"<wbr>"):"italic"===l?Pt(a,e,"em"):"bold"===l?Pt(a,e,"strong"):"strike"===l?Pt(a,e,"s"):"inline-code"===l?Pt(a,e,"code"):"check"!==l&&"list"!==l&&"ordered-list"!==l||(ft(e,a,l),c=!1,t.classList.remove("vditor-menu--current")):(0===e.ir.element.childNodes.length&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,V.ib)(e.ir.element,a)),r=(0,B.F9)(a.startContainer),"line"===l?r&&(s='<hr data-block="0"><p data-block="0"><wbr>\n</p>',""===r.innerHTML.trim()?r.outerHTML=s:r.insertAdjacentHTML("afterend",s)):"quote"===l?r&&(a.insertNode(document.createElement("wbr")),r.outerHTML='<blockquote data-block="0">'.concat(r.outerHTML,"</blockquote>"),c=!1,t.classList.add("vditor-menu--current")):"link"===l?(i=void 0,i=""===a.toString()?"".concat(n,"<wbr>").concat(o):"".concat(n).concat(a.toString()).concat(o.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,i),c=!1,t.classList.add("vditor-menu--current")):"italic"===l||"bold"===l||"strike"===l||"inline-code"===l||"code"===l||"table"===l?(i=void 0,""===a.toString()?i="".concat(n,"<wbr>").concat(o):(i="code"===l?"".concat(n,"\n").concat(a.toString(),"<wbr>").concat(o):"table"===l?"".concat(n).concat(a.toString(),"<wbr>").concat(o):"".concat(n).concat(a.toString()).concat(o,"<wbr>"),a.deleteContents()),"table"!==l&&"code"!==l||(i="\n"+i+"\n\n"),(s=document.createElement("span")).innerHTML=i,a.insertNode(s),se(e,a),"table"===l&&(a.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,V.Hc)(a))):"check"!==l&&"list"!==l&&"ordered-list"!==l||(ft(e,a,l,!1),c=!1,j(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))),(0,V.ib)(e.ir.element,a),v(e),c&&be(e)},Bt=function(o,r){var i,a,l,s={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(n){return function(e){var t=[n,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,a&&(l=2&t[0]?a.return:t[0]?a.throw||((l=a.return)&&l.call(a),0):a.next)&&!(l=l.call(a,t[1])).done)return l;switch(a=0,(t=l?[2&t[0],l.value]:t)[0]){case 0:case 1:l=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!((l=0<(l=s.trys).length&&l[l.length-1])||6!==t[0]&&2!==t[0])){s=0;continue}if(3===t[0]&&(!l||t[1]>l[0]&&t[1]<l[3]))s.label=t[1];else if(6===t[0]&&s.label<l[1])s.label=l[1],l=t;else{if(!(l&&s.label<l[2])){l[2]&&s.ops.pop(),s.trys.pop();continue}s.label=l[2],s.ops.push(t)}}t=r.call(o,s)}catch(e){t=[6,e],a=0}finally{i=l=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},zt=(kr.prototype.render=function(o){var e,r,t,n,i=this;window.getSelection().focusNode&&(e=(e=getSelection().getRangeAt(0)).startContainer.textContent.substring(0,e.startOffset)||"",void 0===(r=this.getKey(e,o.options.hint.extend))?(this.element.style.display="none",clearTimeout(this.timeId)):":"===this.splitChar?(t=""===r?o.options.hint.emoji:o.lute.GetEmojis(),n=[],Object.keys(t).forEach(function(e){0===e.indexOf(r.toLowerCase())&&(-1<t[e].indexOf(".")?n.push({html:'<img src="'.concat(t[e],'" title=":').concat(e,':"/> :').concat(e,":"),value:":".concat(e,":")}):n.push({html:'<span class="vditor-hint__emoji">'.concat(t[e],"</span>").concat(e),value:t[e]}))}),this.genHTML(n,r,o)):o.options.hint.extend.forEach(function(n){n.key===i.splitChar&&(clearTimeout(i.timeId),i.timeId=window.setTimeout(function(){return e=i,s=function(){var t;return Bt(this,function(e){switch(e.label){case 0:return t=this.genHTML,[4,n.hint(r)];case 1:return t.apply(this,[e.sent(),r,o]),[2]}})},new(l=(l=a=void 0)||Promise)(function(n,t){function o(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof l?t:new l(function(e){e(t)})).then(o,r)}i((s=s.apply(e,a||[])).next())});var e,a,l,s},o.options.hint.delay))}))},kr.prototype.genHTML=function(e,a,n){var t,o,r,l,i=this;0!==e.length?(t=n[n.currentMode].element,o=(r=(0,V.Ny)(t)).left+("left"===n.options.outline.position?n.outline.element.offsetWidth:0),r=r.top,l="",e.forEach(function(e,t){var n,o,r,i;7<t||(n=e.html,""!==a&&(o=n.lastIndexOf(">")+1,-1<(i=(r=n.substr(o)).toLowerCase().indexOf(a.toLowerCase())))&&(r=r.substring(0,i)+"<b>"+r.substring(i,i+a.length)+"</b>"+r.substring(i+a.length),n=n.substr(0,o)+r),l+='<button type="button" data-value="'.concat(encodeURIComponent(e.value),' "\n').concat(0===t?"class='vditor-hint--current'":"","> ").concat(n,"</button>"))}),this.element.innerHTML=l,e=parseInt(document.defaultView.getComputedStyle(t,null).getPropertyValue("line-height"),10),this.element.style.top="".concat(r+(e||22),"px"),this.element.style.left="".concat(o,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(t){t.addEventListener("click",function(e){i.fillEmoji(t,n),e.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(r-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")):this.element.style.display="none"},kr.prototype.select=function(e,t){var n,o;return!(0===this.element.querySelectorAll("button").length||"none"===this.element.style.display||(n=this.element.querySelector(".vditor-hint--current"),"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.nextElementSibling?n.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",0):"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.previousElementSibling?n.previousElementSibling.className="vditor-hint--current":(o=this.element.children.length,this.element.children[o-1].className="vditor-hint--current"),0):(0,I.yl)(e)||e.shiftKey||e.altKey||"Enter"!==e.key||e.isComposing||(e.preventDefault(),e.stopPropagation(),this.fillEmoji(n,t),0)))},kr.prototype.getKey=function(n,e){var t,o,r=this;return this.lastIndex=-1,this.splitChar="",e.forEach(function(e){var t=n.lastIndexOf(e.key);r.lastIndex<t&&(r.splitChar=e.key,r.lastIndex=t)}),-1!==this.lastIndex&&(o=(e=n.split(this.splitChar))[e.length-1],1<e.length&&o.trim()===o)&&(2===e.length&&""===e[0]&&e[1].length<32?t=e[1]:(e=e[e.length-2].slice(-1)," "===(0,C.X)(e)&&o.length<32&&(t=o))),t},kr),Ut=(Er.prototype.copy=function(e,t){var n,o=getSelection().getRangeAt(0);""!==o.toString()&&(e.stopPropagation(),e.preventDefault(),(n=document.createElement("div")).appendChild(o.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorIRDOM2Md(n.innerHTML).trim()),e.clipboardData.setData("text/html",""))},Er.prototype.bindEvent=function(r){var i=this;this.element.addEventListener("paste",function(e){It(r,e,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){s(r,["hint"])}),this.element.addEventListener("compositionstart",function(e){i.composingLock=!0}),this.element.addEventListener("compositionend",function(e){(0,I.vU)()||se(r,getSelection().getRangeAt(0).cloneRange()),i.composingLock=!1}),this.element.addEventListener("input",function(e){if("deleteByDrag"!==e.inputType&&"insertFromDrop"!==e.inputType)return i.preventInput?(i.preventInput=!1,void v(r,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(i.composingLock||"‘"===e.data||"“"===e.data||"《"===e.data||se(r,getSelection().getRangeAt(0).cloneRange(),!1,e))}),this.element.addEventListener("click",function(e){var t,n,o;"INPUT"===e.target.tagName?(e.target.checked?e.target.setAttribute("checked","checked"):e.target.removeAttribute("checked"),i.preventInput=!0,v(r)):(t=(0,V.zh)(r),(n=(n=(0,B.fb)(e.target,"vditor-ir__preview"))||(0,B.fb)(t.startContainer,"vditor-ir__preview"))&&(n.previousElementSibling.firstElementChild?t.selectNodeContents(n.previousElementSibling.firstElementChild):t.selectNodeContents(n.previousElementSibling),t.collapse(!0),(0,V.Hc)(t),k(r)),"IMG"===e.target.tagName&&(n=e.target.parentElement.querySelector(".vditor-ir__marker--link"))&&(t.selectNode(n),(0,V.Hc)(t)),!(n=(0,B.a1)(e.target,"data-type","a"))||n.classList.contains("vditor-ir__node--expand")?(e.target.isEqualNode(i.element)&&i.element.lastElementChild&&t.collapsed&&(o=i.element.lastElementChild.getBoundingClientRect(),e.y>o.top+o.height)&&("P"===i.element.lastElementChild.tagName&&""===i.element.lastElementChild.textContent.trim().replace(N.g.ZWSP,"")?(t.selectNodeContents(i.element.lastElementChild),t.collapse(!1)):(i.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(N.g.ZWSP,"<wbr></p>")),(0,V.ib)(i.element,t))),""===t.toString()?ce(t,r):setTimeout(function(){ce((0,V.zh)(r),r)}),S(e,r),be(r)):r.options.link.click?r.options.link.click(n.querySelector(":scope > .vditor-ir__marker--link")):r.options.link.isOpen&&window.open(n.querySelector(":scope > .vditor-ir__marker--link").textContent))}),this.element.addEventListener("keyup",function(e){if(!e.isComposing&&!(0,I.yl)(e))if("Enter"===e.key&&k(r),be(r),"Backspace"!==e.key&&"Delete"!==e.key||""===r.ir.element.innerHTML||1!==r.ir.element.childNodes.length||!r.ir.element.firstElementChild||"P"!==r.ir.element.firstElementChild.tagName||0!==r.ir.element.firstElementChild.childElementCount||""!==r.ir.element.textContent&&"\n"!==r.ir.element.textContent){var t=(0,V.zh)(r),n=("Backspace"===e.key?((0,I.vU)()&&"\n"===t.startContainer.textContent&&1===t.startOffset&&(t.startContainer.textContent="",ce(t,r)),i.element.querySelectorAll(".language-math").forEach(function(e){e=e.querySelector("br");e&&e.remove()})):-1<e.key.indexOf("Arrow")?("ArrowLeft"!==e.key&&"ArrowRight"!==e.key||jt(r),ce(t,r)):229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&ce(t,r),(0,B.fb)(t.startContainer,"vditor-ir__preview"));if(n)return"ArrowUp"===e.key||"ArrowLeft"===e.key?(n.previousElementSibling.firstElementChild?t.selectNodeContents(n.previousElementSibling.firstElementChild):t.selectNodeContents(n.previousElementSibling),t.collapse(!1),e.preventDefault(),!0):"SPAN"!==n.tagName||"ArrowDown"!==e.key&&"ArrowRight"!==e.key?void 0:("html-entity"===n.parentElement.getAttribute("data-type")?(n.parentElement.insertAdjacentText("afterend",N.g.ZWSP),t.setStart(n.parentElement.nextSibling,1)):t.selectNodeContents(n.parentElement.lastElementChild),t.collapse(!1),e.preventDefault(),!0)}else r.ir.element.innerHTML=""})},Er),Vt=function(e){return"sv"===e.currentMode?e.lute.Md2HTML(D(e)):"wysiwyg"===e.currentMode?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},Wt=o(65),Gt=o(182),Ft=(wr.prototype.render=function(e){return"block"===e.preview.element.style.display?(0,Gt.k)(e.preview.previewElement,this.element.lastElementChild,e):(0,Gt.k)(e[e.currentMode].element,this.element.lastElementChild,e)},wr.prototype.toggle=function(e,t,n){void 0===n&&(n=!0);var o=null==(o=e.toolbar.elements.outline)?void 0:o.firstElementChild;(t=void 0===t?!0:t)&&window.innerWidth>=N.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(e),null!=o&&o.classList.add("vditor-menu--current")):(this.element.style.display="none",null!=o&&o.classList.remove("vditor-menu--current")),n&&0<getSelection().rangeCount&&(t=getSelection().getRangeAt(0),e[e.currentMode].element.contains(t.startContainer))&&(0,V.Hc)(t),l(e)},wr),Kt=o(431),Zt=(yr.prototype.render=function(n,e){var o,r,i=this;clearTimeout(this.mdTimeoutId),"none"!==this.element.style.display?e?this.previewElement.innerHTML=e:""!==D(n).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")?(o=(new Date).getTime(),r=D(n),this.mdTimeoutId=window.setTimeout(function(){var t,e;n.options.preview.url?((t=new XMLHttpRequest).open("POST",n.options.preview.url),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onreadystatechange=function(){var e;t.readyState===XMLHttpRequest.DONE&&(200===t.status?0!==(e=JSON.parse(t.responseText)).code?n.tip.show(e.msg):(n.options.preview.transform&&(e.data=n.options.preview.transform(e.data)),i.previewElement.innerHTML=e.data,i.afterRender(n,o)):(e=n.lute.Md2HTML(r),n.options.preview.transform&&(e=n.options.preview.transform(e)),i.previewElement.innerHTML=e,i.afterRender(n,o)))},t.send(JSON.stringify({markdownText:r}))):(e=n.lute.Md2HTML(r),n.options.preview.transform&&(e=n.options.preview.transform(e)),i.previewElement.innerHTML=e,i.afterRender(n,o))},n.options.preview.delay)):this.previewElement.innerHTML="":"renderPerformance"===this.element.getAttribute("data-type")&&n.tip.hide()},yr.prototype.afterRender=function(t,e){t.options.preview.parse&&t.options.preview.parse(this.element);var n=(new Date).getTime()-e,e=(2600<(new Date).getTime()-e?(t.tip.show(window.VditorI18n.performanceTip.replace("${x}",n.toString())),t.preview.element.setAttribute("data-type","renderPerformance")):"renderPerformance"===t.preview.element.getAttribute("data-type")&&(t.tip.hide(),t.preview.element.removeAttribute("data-type")),t.preview.element.querySelector(".vditor-comment--focus")),n=(e&&e.classList.remove("vditor-comment--focus"),(0,Q.O)(t.preview.previewElement,t.options.preview.hljs),(0,te.s)(t.options.preview.hljs,t.preview.previewElement,t.options.cdn),(0,oe.i)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,re.K)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,$.P)(t.preview.previewElement,t.options.cdn),(0,ee.v)(t.preview.previewElement,t.options.cdn),(0,Y.p)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,ie.P)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,ae.B)(t.preview.previewElement,t.options.cdn),(0,X.Q)(t.preview.previewElement,t.options.cdn),t.options.preview.render.media.enable&&(0,Kt.Y)(t.preview.previewElement),t.options.customRenders.forEach(function(e){e.render(t.preview.previewElement,t)}),t.preview.element),o=t.outline.render(t);""===o&&(o="[ToC]"),n.querySelectorAll('[data-type="toc-block"]').forEach(function(e){e.innerHTML=o,(0,ne.H)(e,{cdn:t.options.cdn,math:t.options.preview.math})}),(0,ne.H)(t.preview.previewElement,{cdn:t.options.cdn,math:t.options.preview.math})},yr.prototype.copyToX=function(e,t,n){"zhihu"!==(n=void 0===n?"mp-wechat":n)?t.querySelectorAll(".katex-html .base").forEach(function(e){e.style.display="initial"}):t.querySelectorAll(".language-math").forEach(function(e){e.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'.concat(e.getAttribute("data-math"),'\\" style="display: block; margin: 0 auto; max-width: 100%;">')}),t.style.backgroundColor="#fff",t.querySelectorAll("code").forEach(function(e){e.style.backgroundImage="none"}),this.element.append(t);var o=t.ownerDocument.createRange();o.selectNode(t),(0,V.Hc)(o),document.execCommand("copy"),t.remove(),e.tip.show(["zhihu","mp-wechat"].includes(n)?"已复制,可到".concat("zhihu"===n?"知乎":"微信公众号平台","进行粘贴"):"已复制到剪切板")},yr),Jt=(br.prototype.bindEvent=function(i){var a=this;this.element.addEventListener("mousedown",function(e){var t=document,n=e.clientY,o=i.element.offsetHeight,r=63+i.element.querySelector(".vditor-toolbar").clientHeight;t.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),a.element.classList.add("vditor-resize--selected"),t.onmousemove=function(e){"top"===i.options.resize.position?i.element.style.height=Math.max(r,o+(n-e.clientY))+"px":i.element.style.height=Math.max(r,o+(e.clientY-n))+"px",i.options.typewriterMode&&(i.sv.element.style.paddingBottom=i.sv.element.parentElement.offsetHeight/2+"px")},t.onmouseup=function(){i.options.resize.after&&i.options.resize.after(i.element.offsetHeight-o),window.captureEvents&&window.captureEvents(),t.onmousemove=null,t.onmouseup=null,t.ondragstart=null,t.onselectstart=null,t.onselect=null,a.element.classList.remove("vditor-resize--selected")}})},br),Xt=(gr.prototype.copy=function(e,t){e.stopPropagation(),e.preventDefault(),e.clipboardData.setData("text/plain",De(t[t.currentMode].element))},gr.prototype.bindEvent=function(r){var i=this;this.element.addEventListener("paste",function(e){It(r,e,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){var e,t,n,o;"block"===r.preview.element.style.display&&(e=i.element.scrollTop,t=i.element.clientHeight,n=i.element.scrollHeight-parseFloat(i.element.style.paddingBottom||"0"),(o=r.preview.element).scrollTop=.5<e/t?(e+t)*o.scrollHeight/n-t:e*o.scrollHeight/n)}),this.element.addEventListener("compositionstart",function(e){i.composingLock=!0}),this.element.addEventListener("compositionend",function(e){(0,I.vU)()||c(r,e),i.composingLock=!1}),this.element.addEventListener("input",function(e){if("deleteByDrag"!==e.inputType&&"insertFromDrop"!==e.inputType&&!i.composingLock&&"‘"!==e.data&&"“"!==e.data&&"《"!==e.data)return i.preventInput?(i.preventInput=!1,void u(r,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void c(r,e)}),this.element.addEventListener("keyup",function(e){e.isComposing||(0,I.yl)(e)||("Backspace"!==e.key&&"Delete"!==e.key||""===r.sv.element.innerHTML||1!==r.sv.element.childNodes.length||!r.sv.element.firstElementChild||"DIV"!==r.sv.element.firstElementChild.tagName||2!==r.sv.element.firstElementChild.childElementCount||""!==r.sv.element.firstElementChild.textContent&&"\n"!==r.sv.element.textContent?"Enter"===e.key&&k(r):r.sv.element.innerHTML="")})},gr),Yt=(vr.prototype.show=function(e,t){var n=this;void 0===t&&(t=6e3),this.element.className="vditor-tip vditor-tip--show",0===t?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,'\n<div class="vditor-tip__close">X</div></div>'),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){n.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,"</div>"),setTimeout(function(){n.hide()},t)),this.element.removeAttribute("style"),setTimeout(function(){n.element.getBoundingClientRect().top<46&&(n.element.style.position="fixed",n.element.style.top="46px")},150)},vr.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},vr),Qt=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),R(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",j(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},$t=(Ro=function(e,t){return(Ro=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ro(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(hr,jo=i),hr),en=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},tn=o(34),nn=(Io=function(e,t){return(Io=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Io(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(fr,Do=i),fr),on=(No=function(e,t){return(No=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}No(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(mr,Oo=i),mr),rn=(ur.prototype.render=function(e,t){var n,t=t.endsWith("\n")?t.length-1:t.length;"text"===e.options.counter.type&&e[e.currentMode]&&((n=e[e.currentMode].element.cloneNode(!0)).querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){e.remove()}),t=n.textContent.length),"number"==typeof e.options.counter.max?(t>e.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(t,"/").concat(e.options.counter.max)):this.element.innerHTML="".concat(t),this.element.setAttribute("aria-label",e.options.counter.type),e.options.counter.after&&e.options.counter.after(t,{enable:e.options.counter.enable,max:e.options.counter.max,type:e.options.counter.type})},ur),an=(Ho=function(e,t){return(Ho=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ho(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(pr,Mo=i),pr),ln=(Ao=function(e,t){return(Ao=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ao(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(dr,Co=i),dr),sn=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},cn=(Lo=function(e,t){return(Lo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Lo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(cr,To=i),cr.prototype.bindEvent=function(r){var i=this;this.element.lastElementChild.addEventListener((0,I.Le)(),function(e){var t,n,o=(0,z.S)(e.target,"BUTTON");o&&(e.preventDefault(),e=o.getAttribute("data-value"),o=(0,V.zh)(r),t=e,"wysiwyg"===r.currentMode?t=r.lute.SpinVditorDOM(e):"ir"===r.currentMode&&(t=r.lute.SpinVditorIRDOM(e)),-1<e.indexOf(":")&&"sv"!==r.currentMode?((n=document.createElement("div")).innerHTML=t,t=n.firstElementChild.firstElementChild.outerHTML+" ",(0,V.oC)(t,r)):(o.extractContents(),o.insertNode(document.createTextNode(e))),o.collapse(!1),(0,V.Hc)(o),i.element.lastElementChild.style.display="none",x(r))}),this.element.lastElementChild.addEventListener("mouseover",function(e){e=(0,z.S)(e.target,"BUTTON");e&&(i.element.querySelector(".vditor-emojis__tip").innerHTML=e.getAttribute("data-key"))})},cr),dn=function(e,t,n){var o=document.createElement("a");"download"in o?(o.download=n,o.style.display="none",o.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(o),o.click(),o.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},pn=(_o=function(e,t){return(_o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}_o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(sr,So=i),sr),un=(xo=function(e,t){return(xo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}xo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(lr,ko=i),lr.prototype._bindEvent=function(n,t){this.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),n.element.className.includes("vditor--fullscreen")?(t.level||(this.innerHTML=t.icon),n.element.style.zIndex="",document.body.style.overflow="",n.element.classList.remove("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(e){var t=n.toolbar.elements[e].firstChild;t&&(t.className=t.className.replace("__s","__n"),n.options.toolbar.forEach(function(e){"string"!=typeof e&&e.tipPosition&&e.name===t.dataset.type&&(t.className="vditor-tooltipped vditor-tooltipped__".concat(e.tipPosition))}))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__s","__n"))):(t.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(e){e=n.toolbar.elements[e].firstChild;e&&(e.className=e.className.replace("__n","__s"))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__n","__s"))),n.devtools&&n.devtools.renderEchart(n),t.click&&t.click(e,n),l(n),me(n)})},lr),mn=(Eo=function(e,t){return(Eo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Eo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(ar,wo=i),ar.prototype._bindEvent=function(t,n){var o=this.element.children[0];o.addEventListener((0,I.Le)(),function(e){e.preventDefault(),clearTimeout(t.wysiwyg.afterRenderTimeoutId),clearTimeout(t.ir.processTimeoutId),clearTimeout(t.sv.processTimeoutId),o.classList.contains(N.g.CLASS_MENU_DISABLED)||(o.blur(),o.classList.contains("vditor-menu--current")?("wysiwyg"===t.currentMode?(xe(t),W(t)):"ir"===t.currentMode&&Rt(t,""),o.classList.remove("vditor-menu--current")):(s(t,["subToolbar"]),n.style.display="block"))});for(var e=0;e<6;e++)n.children.item(e).addEventListener((0,I.Le)(),function(e){e.preventDefault(),"wysiwyg"===t.currentMode?(ke(t,e.target.getAttribute("data-tag")),W(t),o.classList.add("vditor-menu--current")):"ir"===t.currentMode?(Rt(t,e.target.getAttribute("data-value")),o.classList.add("vditor-menu--current")):Ke(t,e.target.getAttribute("data-value")),n.style.display="none"})},ar),fn=(yo=function(e,t){return(yo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},(n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}yo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(ir,bo=i),ir),hn=(go=function(e,t){return(go=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},rr),t=vo=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function vn(){this.constructor=hn}go(hn,t),hn.prototype=null===t?Object.create(t):(vn.prototype=t.prototype,new vn);var gn=rr,bn=(ho=function(e,t){return(ho=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},or),t=fo=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function yn(){this.constructor=bn}ho(bn,t),bn.prototype=null===t?Object.create(t):(yn.prototype=t.prototype,new yn);var wn=or,En=(mo=function(e,t){return(mo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},nr),t=uo=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function kn(){this.constructor=En}mo(En,t),En.prototype=null===t?Object.create(t):(kn.prototype=t.prototype,new kn);var xn=nr,Sn=(po=function(e,t){return(po=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},tr),t=co=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function _n(){this.constructor=Sn}po(Sn,t),Sn.prototype=null===t?Object.create(t):(_n.prototype=t.prototype,new _n);var Tn=tr,Ln=(so=function(e,t){return(so=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},er),t=lo=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function Cn(){this.constructor=Ln}so(Ln,t),Ln.prototype=null===t?Object.create(t):(Cn.prototype=t.prototype,new Cn);var An=er,Mn=(ao=function(e,t){return(ao=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},$o),t=io=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function Hn(){this.constructor=Mn}ao(Mn,t),Mn.prototype=null===t?Object.create(t):(Hn.prototype=t.prototype,new Hn);var On=$o,Nn=(ro=function(e,t){return(ro=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},Qo),t=oo=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function Dn(){this.constructor=Nn}ro(Nn,t),Nn.prototype=null===t?Object.create(t):(Dn.prototype=t.prototype,new Dn),Qo.prototype._bindEvent=function(n){var o=this;this.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault();var t,e=o.element.firstElementChild;e.classList.contains(N.g.CLASS_MENU_DISABLED)||(t=N.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]),e.classList.contains("vditor-menu--current")?(e.classList.remove("vditor-menu--current"),"sv"===n.currentMode?(n.sv.element.style.display="block","both"===n.options.preview.mode?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"),P(n.toolbar.elements,t),n.outline.render(n)):(q(n.toolbar.elements,t),n.preview.element.style.display="block","sv"===n.currentMode?n.sv.element.style.display="none":n[n.currentMode].element.parentElement.style.display="none",n.preview.render(n),e.classList.add("vditor-menu--current"),s(n,["subToolbar","hint","popover"]),setTimeout(function(){n.outline.render(n)},n.options.preview.delay+10)),l(n))})};var In=Qo,jn=(g.prototype.cloneChannelData=function(e,t){this.leftChannel.push(new Float32Array(e)),this.rightChannel.push(new Float32Array(t)),this.recordingLength+=2048},g.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},g.prototype.stopRecording=function(){this.isRecording=!1},g.prototype.buildWavFileBlob=function(){for(var e=this.mergeBuffers(this.leftChannel),t=this.mergeBuffers(this.rightChannel),n=new Float32Array(e.length),o=0;o<e.length;++o)n[o]=.5*(e[o]+t[o]);var r=44+2*(n=this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE?this.downSampleBuffer(n,this.SAMPLE_RATE):n).length,i=new ArrayBuffer(r),a=new DataView(i),i=(this.writeUTFBytes(a,0,"RIFF"),a.setUint32(4,r,!0),this.writeUTFBytes(a,8,"WAVE"),this.writeUTFBytes(a,12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,this.SAMPLE_RATE,!0),a.setUint32(28,2*this.SAMPLE_RATE,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),2*n.length);this.writeUTFBytes(a,36,"data"),a.setUint32(40,i,!0);for(var l=n.length,s=44,c=0;c<l;c++)a.setInt16(s,32767*n[c],!0),s+=2;return new Blob([a],{type:"audio/wav"})},g.prototype.downSampleBuffer=function(e,t){if(t===this.DEFAULT_SAMPLE_RATE)return e;if(t>this.DEFAULT_SAMPLE_RATE)return e;for(var n=this.DEFAULT_SAMPLE_RATE/t,t=Math.round(e.length/n),o=new Float32Array(t),r=0,i=0;r<o.length;){for(var a=Math.round((r+1)*n),l=0,s=0,c=i;c<a&&c<e.length;c++)l+=e[c],s++;o[r]=l/s,r++,i=a}return o},g.prototype.mergeBuffers=function(e){for(var t=new Float32Array(this.recordingLength),n=0,o=e.length,r=0;r<o;++r){var i=e[r];t.set(i,n),n+=i.length}return t},g.prototype.writeUTFBytes=function(e,t,n){for(var o=n.length,r=0;r<o;r++)e.setUint8(t+r,n.charCodeAt(r))},g),Rn=(no=function(e,t){return(no=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},Yo),t=to=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function Pn(){this.constructor=Rn}no(Rn,t),Rn.prototype=null===t?Object.create(t):(Pn.prototype=t.prototype,new Pn),Yo.prototype._bindEvent=function(n){var o,r=this;this.element.children[0].addEventListener((0,I.Le)(),function(e){var t;e.preventDefault(),r.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)||(t=n[n.currentMode].element,o?o.isRecording?(o.stopRecording(),n.tip.hide(),e=new File([o.buildWavFileBlob()],"record".concat((new Date).getTime(),".wav"),{type:"video/webm"}),et(n,[e]),r.element.children[0].classList.remove("vditor-menu--current")):(n.tip.show(window.VditorI18n.recording),t.setAttribute("contenteditable","false"),o.startRecordingNewWavFile(),r.element.children[0].classList.add("vditor-menu--current")):navigator.mediaDevices.getUserMedia({audio:!0}).then(function(e){(o=new jn(e)).recorder.onaudioprocess=function(e){var t;o.isRecording&&(t=e.inputBuffer.getChannelData(0),e=e.inputBuffer.getChannelData(1),o.cloneChannelData(t,e))},o.startRecordingNewWavFile(),n.tip.show(window.VditorI18n.recording),t.setAttribute("contenteditable","false"),r.element.children[0].classList.add("vditor-menu--current")}).catch(function(){n.tip.show(window.VditorI18n["record-tip"])}))})};var qn=Yo,Bn=(eo=function(e,t){return(eo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},Xo),t=$n=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function zn(){this.constructor=Bn}eo(Bn,t),Bn.prototype=null===t?Object.create(t):(zn.prototype=t.prototype,new zn);var Un=Xo,Vn=(Qn=function(e,t){return(Qn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},Jo),t=Yn=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function Wn(){this.constructor=Vn}Qn(Vn,t),Vn.prototype=null===t?Object.create(t):(Wn.prototype=t.prototype,new Wn);var Gn=Jo,Fn=(Xn=function(e,t){return(Xn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},Zo),t=Jn=i;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function Kn(){this.constructor=Fn}Xn(Fn,t),Fn.prototype=null===t?Object.create(t):(Kn.prototype=t.prototype,new Kn),Zo.prototype._bindEvent=function(t){var n=this;this.element.children[0].addEventListener((0,I.Le)(),function(e){n.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)&&(e.stopPropagation(),e.preventDefault())}),this.element.querySelector("input").addEventListener("change",function(e){n.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)?(e.stopPropagation(),e.preventDefault()):0!==e.target.files.length&&et(t,e.target.files,e.target)})};var Zn,Jn,Xn,Yn,Qn,$n,eo,to,no,oo,ro,io,ao,lo,so,co,po,uo,mo,fo,ho,vo,go,bo,yo,wo,Eo,ko,xo,So,_o,To,Lo,Co,Ao,Mo,Ho,Oo,No,Do,Io,jo,Ro,Po,qo=Zo,Bo=(Ko.prototype.updateConfig=function(e,t){e.options.toolbarConfig=Object.assign({hide:!1,pin:!1},t),e.options.toolbarConfig.hide?this.element.classList.add("vditor-toolbar--hide"):this.element.classList.remove("vditor-toolbar--hide"),e.options.toolbarConfig.pin?this.element.classList.add("vditor-toolbar--pin"):this.element.classList.remove("vditor-toolbar--pin")},Ko.prototype.genItem=function(e,t,n){var o,r;switch(t.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":o=new i(e,t);break;case"emoji":o=new cn(e,t);break;case"headings":o=new mn(e,t);break;case"|":o=new sn;break;case"br":o=new en;break;case"undo":o=new Gn(e,t);break;case"redo":o=new Un(e,t);break;case"help":o=new fn(e,t);break;case"both":o=new $t(e,t);break;case"preview":o=new In(e,t);break;case"fullscreen":o=new un(e,t);break;case"upload":o=new qo(e,t);break;case"record":o=new qn(e,t);break;case"info":o=new wn(e,t);break;case"edit-mode":o=new Ne(e,t);break;case"devtools":o=new ln(e,t);break;case"outdent":o=new An(e,t);break;case"indent":o=new gn(e,t);break;case"outline":o=new On(e,t);break;case"insert-after":o=new xn(e,t);break;case"insert-before":o=new Tn(e,t);break;case"code-theme":o=new nn(e,t);break;case"content-theme":o=new on(e,t);break;case"export":o=new pn(e,t);break;default:o=new an(e,t)}if(o)return"br"!==(r=t.name)&&"|"!==r||(r+=n),this.elements[r]=o.element,o.element},Ko),zo=o(85),Uo=(m.prototype.clearStack=function(e){this.resetStack(),this.resetIcon(e)},m.prototype.resetIcon=function(e){e.toolbar&&((1<this[e.currentMode].undoStack.length?P:q)(e.toolbar.elements,["undo"]),(0!==this[e.currentMode].redoStack.length?P:q)(e.toolbar.elements,["redo"]))},m.prototype.undo=function(e){var t;"false"===e[e.currentMode].element.getAttribute("contenteditable")||this[e.currentMode].undoStack.length<2||(t=this[e.currentMode].undoStack.pop())&&(this[e.currentMode].redoStack.push(t),this.renderDiff(t,e),this[e.currentMode].hasUndo=!0,s(e,["hint"]))},m.prototype.redo=function(e){var t;"false"!==e[e.currentMode].element.getAttribute("contenteditable")&&(t=this[e.currentMode].redoStack.pop())&&(this[e.currentMode].undoStack.push(t),this.renderDiff(t,e,!0))},m.prototype.recordFirstPosition=function(e,t){0===getSelection().rangeCount||1!==this[e.currentMode].undoStack.length||0===this[e.currentMode].undoStack[0].length||0<this[e.currentMode].redoStack.length||(0,I.vU)()&&"Backspace"===t.key||(0,I.G6)()||(t=this.addCaret(e)).replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[e.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[e.currentMode].undoStack[0][0].diffs[0][1]=t,this[e.currentMode].lastText=t)},m.prototype.addToUndoStack=function(e){var t=this.addCaret(e,!0),n=this.dmp.diff_main(t,this[e.currentMode].lastText,!0),n=this.dmp.patch_make(t,this[e.currentMode].lastText,n);0===n.length&&0<this[e.currentMode].undoStack.length||(this[e.currentMode].lastText=t,this[e.currentMode].undoStack.push(n),this[e.currentMode].undoStack.length>this.stackSize&&this[e.currentMode].undoStack.shift(),this[e.currentMode].hasUndo&&(this[e.currentMode].redoStack=[],this[e.currentMode].hasUndo=!1,q(e.toolbar.elements,["redo"])),1<this[e.currentMode].undoStack.length&&P(e.toolbar.elements,["undo"]))},m.prototype.renderDiff=function(e,t,n){n=((n=void 0!==n&&n)?((n=this.dmp.patch_deepCopy(e).reverse()).forEach(function(e){e.diffs.forEach(function(e){e[0]=-e[0]})}),this.dmp.patch_apply(n,this[t.currentMode].lastText)):this.dmp.patch_apply(e,this[t.currentMode].lastText))[0];this[t.currentMode].lastText=n,t[t.currentMode].element.innerHTML=n,"sv"!==t.currentMode&&t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){U(e,t)}),t[t.currentMode].element.querySelector("wbr")?((0,V.ib)(t[t.currentMode].element,t[t.currentMode].element.ownerDocument.createRange()),k(t)):((e=getSelection().getRangeAt(0)).setEndBefore(t[t.currentMode].element),e.collapse(!1)),h(t),x(t,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),Me(t),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){U(e,t)}),(1<this[t.currentMode].undoStack.length?P:q)(t.toolbar.elements,["undo"]),(0!==this[t.currentMode].redoStack.length?P:q)(t.toolbar.elements,["redo"])},m.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},m.prototype.addCaret=function(e,t){void 0===t&&(t=!1),0===getSelection().rangeCount||e[e.currentMode].element.querySelector("wbr")||(r=getSelection().getRangeAt(0),e[e.currentMode].element.contains(r.startContainer)&&(n=r.cloneRange(),(o=document.createElement("span")).className="vditor-wbr",r.insertNode(o))),e.ir.element.cloneNode(!0).querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='1']")).forEach(function(e){e.firstElementChild&&(e.firstElementChild.classList.contains("language-echarts")||e.firstElementChild.classList.contains("language-plantuml")||e.firstElementChild.classList.contains("language-mindmap")?(e.firstElementChild.removeAttribute("_echarts_instance_"),e.firstElementChild.removeAttribute("data-processed"),e.firstElementChild.innerHTML=e.previousElementSibling.firstElementChild.innerHTML,e.setAttribute("data-render","2")):e.firstElementChild.classList.contains("language-math")&&(e.setAttribute("data-render","2"),e.firstElementChild.textContent=e.firstElementChild.getAttribute("data-math"),e.firstElementChild.removeAttribute("data-math")))});var n,o,r=e[e.currentMode].element.innerHTML;return e[e.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(e){e.remove()}),t&&n&&(0,V.Hc)(n),r.replace('<span class="vditor-wbr"></span>',"<wbr>")},m),Vo=o(2),Wo=(Fo.prototype.merge=function(){this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),null!=(e=null==(e=this.options.preview)?void 0:e.theme)&&e.list&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),null!=(e=null==(e=null==(e=this.options.preview)?void 0:e.render)?void 0:e.media)&&e.enable&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),null!=(e=this.options.hint)&&e.emoji&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn)&&(null!=(e=null==(e=this.options.preview)?void 0:e.theme)&&e.path||(this.defaultOptions.preview.theme.path="".concat(this.options.cdn,"/dist/css/content-theme")),null!=(e=this.options.hint)&&e.emojiPath||(this.defaultOptions.hint.emojiPath="".concat(this.options.cdn,"/dist/images/emoji")));var e=(0,Vo.T)(this.defaultOptions,this.options);if(e.cache.enable&&!e.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return e},Fo.prototype.mergeToolbar=function(e){var o=this,r=[{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 |\n| --- | --- | --- |\n| | | |\n| | | |",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"}],i=[];return e.forEach(function(t){var n=t;r.forEach(function(e){"string"==typeof t&&e.name===t&&(n=e),"object"==typeof t&&e.name===t.name&&(n=Object.assign({},e,t))}),t.toolbar&&(n.toolbar=o.mergeToolbar(t.toolbar)),i.push(n)}),i},Fo),Go=(r.prototype.getComments=function(e,t){var n=this;if(void 0===t&&(t=!1),"wysiwyg"!==e.currentMode||!e.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(e){n.commentIds=n.commentIds.concat(e.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var o=[];return t?(this.commentIds.forEach(function(e){o.push({id:e,top:n.element.querySelector('.vditor-comment[data-cmtids="'.concat(e,'"]')).offsetTop})}),o):void 0},r.prototype.triggerRemoveComment=function(e){var t,n,o;"wysiwyg"===e.currentMode&&e.options.comment.enable&&0<e.wysiwyg.commentIds.length&&(n=JSON.parse(JSON.stringify(this.commentIds)),this.getComments(e),n=n,o=this.commentIds,t=new Set(o),0<(o=n.filter(function(e){return!t.has(e)})).length)&&e.options.comment.remove(o)},r.prototype.showComment=function(){var e=(0,V.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(e.left,"px;display:block;top:").concat(Math.max(-8,e.top-21),"px"))},r.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},r.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},r.prototype.copy=function(e,t){var n,o,r=getSelection().getRangeAt(0);""!==r.toString()&&(e.stopPropagation(),e.preventDefault(),o=(0,B.lG)(r.startContainer,"CODE"),n=(0,B.lG)(r.endContainer,"CODE"),o&&n&&n.isSameNode(o)?(n="",n="PRE"===o.parentElement.tagName?r.toString():"`"+r.toString()+"`",e.clipboardData.setData("text/plain",n)):(o=(0,B.lG)(r.startContainer,"A"),n=(0,B.lG)(r.endContainer,"A"),o&&n&&n.isSameNode(o)?(n=(n=o.getAttribute("title")||"")&&' "'.concat(n,'"'),e.clipboardData.setData("text/plain","[".concat(r.toString(),"](").concat(o.getAttribute("href")).concat(n,")"))):((o=document.createElement("div")).appendChild(r.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorDOM2Md(o.innerHTML).trim()))),e.clipboardData.setData("text/html",""))},r.prototype.bindEvent=function(c){var d=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){var e,t;s(c,["hint"]),"block"===d.popover.style.display&&"block"===d.selectPopover.style.display&&(e=parseInt(d.popover.getAttribute("data-top"),10),"auto"===c.options.height?c.options.toolbarConfig.pin&&(t=Math.max(e,window.scrollY-c.element.offsetTop-8)+"px","block"===d.popover.style.display&&(d.popover.style.top=t),"block"===d.selectPopover.style.display)&&(d.selectPopover.style.top=t):c.options.toolbarConfig.pin&&0===c.toolbar.element.getBoundingClientRect().top&&(t=Math.max(window.scrollY-c.element.offsetTop-8,Math.min(e-c.wysiwyg.element.scrollTop,d.element.clientHeight-21))+"px","block"===d.popover.style.display&&(d.popover.style.top=t),"block"===d.selectPopover.style.display)&&(d.selectPopover.style.top=t))}),this.element.addEventListener("scroll",function(){var e,t;s(c,["hint"]),c.options.comment&&c.options.comment.enable&&c.options.comment.scroll&&c.options.comment.scroll(c.wysiwyg.element.scrollTop),"block"===d.popover.style.display&&(e=parseInt(d.popover.getAttribute("data-top"),10)-c.wysiwyg.element.scrollTop,t=-8,c.options.toolbarConfig.pin&&0===c.toolbar.element.getBoundingClientRect().top&&(t=window.scrollY-c.element.offsetTop+t),t=Math.max(t,Math.min(e,d.element.clientHeight-21))+"px",d.popover.style.top=t,d.selectPopover.style.top=t)}),this.element.addEventListener("paste",function(e){It(c,e,{pasteCode:function(e){var t=(0,V.zh)(c),n=document.createElement("template"),e=(n.innerHTML=e,t.insertNode(n.content.cloneNode(!0)),(0,B.a1)(t.startContainer,"data-block","0"));e?e.outerHTML=c.lute.SpinVditorDOM(e.outerHTML):c.wysiwyg.element.innerHTML=c.lute.SpinVditorDOM(c.wysiwyg.element.innerHTML),(0,V.ib)(c.wysiwyg.element,t)}})}),this.element.addEventListener("compositionstart",function(){d.composingLock=!0}),this.element.addEventListener("compositionend",function(e){var t=(0,z.W)(getSelection().getRangeAt(0).startContainer);t&&""===t.textContent?h(c):((0,I.vU)()||tt(c,getSelection().getRangeAt(0).cloneRange(),e),d.composingLock=!1)}),this.element.addEventListener("input",function(e){if("deleteByDrag"!==e.inputType&&"insertFromDrop"!==e.inputType)if(d.preventInput)d.preventInput=!1,W(c);else if(d.composingLock||"‘"===e.data||"“"===e.data||"《"===e.data)W(c);else{var t=getSelection().getRangeAt(0),n=(0,B.F9)(t.startContainer);if(n||(Ee(c,t),n=(0,B.F9)(t.startContainer)),n){for(var o=(0,V.im)(n,c.wysiwyg.element,t).start,r=!0,i=o-1;i>n.textContent.substr(0,o).lastIndexOf("\n");i--)if(" "!==n.textContent.charAt(i)&&"\t"!==n.textContent.charAt(i)){r=!1;break}0===o&&(r=!1);for(var a=!0,i=o-1;i<n.textContent.length;i++)if(" "!==n.textContent.charAt(i)&&"\n"!==n.textContent.charAt(i)){a=!1;break}var l=(0,z.W)(getSelection().getRangeAt(0).startContainer);l&&""===l.textContent&&(h(c),l.remove()),r&&"code-block"!==n.getAttribute("data-type")||a||yt(n.innerHTML)||bt(n.innerHTML)&&n.previousElementSibling?"function"==typeof c.options.input&&c.options.input(D(c)):("insertParagraph"===e.inputType&&"<p><br></p><p><br></p>"===d.element.innerHTML&&n.previousElementSibling.remove(),tt(c,t,e))}}}),this.element.addEventListener("click",function(e){var t,n,o,r,i,a,l;function s(){n.setAttribute("src",r.value),n.setAttribute("alt",a.value),n.setAttribute("title",l.value),"function"==typeof t.options.input&&t.options.input(D(t))}"INPUT"===e.target.tagName?((o=e.target).checked?o.setAttribute("checked","checked"):o.removeAttribute("checked"),d.preventInput=!0,W(c)):"IMG"!==e.target.tagName||e.target.parentElement.classList.contains("vditor-wysiwyg__preview")?(o=(0,B.lG)(e.target,"A"))?(c.options.link.click?c.options.link.click(o):c.options.link.isOpen&&window.open(o.getAttribute("href")),e.preventDefault()):(o=(0,V.zh)(c),e.target.isEqualNode(d.element)&&d.element.lastElementChild&&o.collapsed&&(i=d.element.lastElementChild.getBoundingClientRect(),e.y>i.top+i.height)&&("P"===d.element.lastElementChild.tagName&&""===d.element.lastElementChild.textContent.trim().replace(N.g.ZWSP,"")?(o.selectNodeContents(d.element.lastElementChild),o.collapse(!1)):(d.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(N.g.ZWSP,"<wbr></p>")),(0,V.ib)(d.element,o))),f(c),(i=(i=(0,B.fb)(e.target,"vditor-wysiwyg__preview"))||(0,B.fb)((0,V.zh)(c).startContainer,"vditor-wysiwyg__preview"))&&Se(i,c),S(e,c)):"link-ref"===e.target.getAttribute("data-type")?_e(c,e.target):(t=c,n=e.target,t.wysiwyg.popover.innerHTML="",(o=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.imageURL),o.className="vditor-tooltipped vditor-tooltipped__n",r=document.createElement("input"),o.appendChild(r),r.className="vditor-input",r.setAttribute("placeholder",window.VditorI18n.imageURL),r.value=n.getAttribute("src")||"",r.oninput=function(){s()},r.onkeydown=function(e){G(t,e)},(i=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.alternateText),i.className="vditor-tooltipped vditor-tooltipped__n",a=document.createElement("input"),i.appendChild(a),a.className="vditor-input",a.setAttribute("placeholder",window.VditorI18n.alternateText),a.style.width="52px",a.value=n.getAttribute("alt")||"",a.oninput=function(){s()},a.onkeydown=function(e){G(t,e)},(e=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.title),e.className="vditor-tooltipped vditor-tooltipped__n",l=document.createElement("input"),e.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.title),l.value=n.getAttribute("title")||"",l.oninput=function(){s()},l.onkeydown=function(e){G(t,e)},K(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",o),t.wysiwyg.popover.insertAdjacentElement("beforeend",i),t.wysiwyg.popover.insertAdjacentElement("beforeend",e),F(t,n))}),this.element.addEventListener("keyup",function(e){if(!e.isComposing&&!(0,I.yl)(e)){"Enter"===e.key&&k(c),"Backspace"!==e.key&&"Delete"!==e.key||""===c.wysiwyg.element.innerHTML||1!==c.wysiwyg.element.childNodes.length||!c.wysiwyg.element.firstElementChild||"P"!==c.wysiwyg.element.firstElementChild.tagName||0!==c.wysiwyg.element.firstElementChild.childElementCount||""!==c.wysiwyg.element.textContent&&"\n"!==c.wysiwyg.element.textContent||(c.wysiwyg.element.innerHTML="");var t=(0,V.zh)(c);if("Backspace"===e.key&&(0,I.vU)()&&"\n"===t.startContainer.textContent&&1===t.startOffset&&(t.startContainer.textContent=""),Ee(c,t),f(c),"ArrowDown"===e.key||"ArrowRight"===e.key||"Backspace"===e.key||"ArrowLeft"===e.key||"ArrowUp"===e.key){"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||c.hint.render(c);var n=(0,B.fb)(t.startContainer,"vditor-wysiwyg__preview");if(n=!n&&3!==t.startContainer.nodeType&&0<t.startOffset&&(r=t.startContainer).classList.contains("vditor-wysiwyg__block")?r.lastElementChild:n)if("none"!==n.previousElementSibling.style.display){var o=n.previousElementSibling;if("PRE"===o.tagName&&(o=o.firstElementChild),"ArrowDown"===e.key||"ArrowRight"===e.key){var r,i=(()=>{for(var e=r;e&&!e.nextSibling;)e=e.parentElement;return e.nextSibling})(r=n.parentElement);if(i&&3!==i.nodeType){var a=i.querySelector(".vditor-wysiwyg__preview");if(a)return void Se(a,c)}if(3===i.nodeType){for(;0===i.textContent.length&&i.nextSibling;)i=i.nextSibling;t.setStart(i,1)}else t.setStart(i.firstChild,0)}else t.selectNodeContents(o),t.collapse(!1)}else"ArrowDown"===e.key||"ArrowRight"===e.key?Se(n,c):Se(n,c,!1)}}})},r),n=(Zn=function(e,t){return(Zn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Zn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function r(n){var d=this,e=(this.composingLock=!1,this.commentIds=[],document.createElement("div"));e.className="vditor-wysiwyg",e.innerHTML='<pre class="vditor-reset" placeholder="'.concat(n.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>\n<div class="vditor-panel vditor-panel--none"></div>\n<div class="vditor-panel vditor-panel--none">\n <button type="button" aria-label="').concat(window.VditorI18n.comment,'" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">\n <svg><use xlink:href="#vditor-icon-comment"></use></svg>\n </button>\n</div>'),this.element=e.firstElementChild,this.popover=e.firstElementChild.nextElementSibling,this.selectPopover=e.lastElementChild,this.bindEvent(n),Ie(n,this.element),je(n,this.element),Re(n,this.element),ze(n,this.element),Ue(n,this.element),Pe(n,this.element),qe(n,this.element,this.copy),Be(n,this.element,this.copy),n.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var o,r,i=Lute.NewNodeID(),e=getSelection().getRangeAt(0),a=e.cloneRange(),l=e.extractContents(),s=!1,c=!1,t=(l.childNodes.forEach(function(e,t){var n=!1;3!==e.nodeType&&e.classList.contains("vditor-comment")?e.classList.contains("vditor-comment")&&e.setAttribute("data-cmtids",e.getAttribute("data-cmtids")+" "+i):n=!0,n&&(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&0===t&&0<a.startOffset?(e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(e.innerHTML,"</span>"),o=e):3!==e.nodeType&&"0"===e.getAttribute("data-block")&&t===l.childNodes.length-1&&a.endOffset<a.endContainer.textContent.length?(e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(e.innerHTML,"</span>"),r=e):3!==e.nodeType&&"0"===e.getAttribute("data-block")?(0===t?s=!0:t===l.childNodes.length-1&&(c=!0),e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(e.innerHTML,"</span>")):((n=document.createElement("span")).classList.add("vditor-comment"),n.setAttribute("data-cmtids",i),e.parentNode.insertBefore(n,e),n.appendChild(e)))}),(0,B.F9)(a.startContainer)),t=(t&&(o?(t.insertAdjacentHTML("beforeend",o.innerHTML),o.remove()):""===t.textContent.trim().replace(N.g.ZWSP,"")&&s&&t.remove()),(0,B.F9)(a.endContainer));t&&(r?(t.insertAdjacentHTML("afterbegin",r.innerHTML),r.remove()):""===t.textContent.trim().replace(N.g.ZWSP,"")&&c&&t.remove()),e.insertNode(l),n.options.comment.add(i,e.toString(),d.getComments(n,!0)),W(n,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),d.hideComment()})}function Fo(e){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:N.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",confused:"😕",eyes:"👀️",heart:"❤️",rocket:"🚀️",smile:"😄",tada:"🎉️"},emojiPath:"".concat(N.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:N.g.HLJS_OPTIONS,markdown:N.g.MARKDOWN_OPTIONS,math:N.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:N.g.THEME_OPTIONS,render:{media:{enable:!0}}},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(e){return e.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=e}function m(){this.stackSize=50,this.resetStack(),this.dmp=new zo}function Ko(r){var i=this,e=r.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",e.toolbar.forEach(function(e,n){var o,t=i.genItem(r,e,n);i.element.appendChild(t),e.toolbar&&((o=document.createElement("div")).className="vditor-hint vditor-panel--arrow",o.addEventListener((0,I.Le)(),function(e){o.style.display="none"}),e.toolbar.forEach(function(e,t){e.level=2,o.appendChild(i.genItem(r,e,n+t))}),t.appendChild(o),a(r,o,t.children[0]))}),r.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),r.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),r.options.counter.enable&&(r.counter=new rn(r),this.element.appendChild(r.counter.element))}function Zo(e,t){var n=Jn.call(this,e,t)||this,o='<input type="file"';return e.options.upload.multiple&&(o+=' multiple="multiple"'),e.options.upload.accept&&(o+=' accept="'.concat(e.options.upload.accept,'"')),n.element.children[0].innerHTML="".concat(t.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>').concat(o,">"),n._bindEvent(e),n}function Jo(t,e){var n=Yn.call(this,t,e)||this;return q({undo:n.element},["undo"]),n.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),n.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)||t.undo.undo(t)}),n}function Xo(t,e){var n=$n.call(this,t,e)||this;return q({redo:n.element},["redo"]),n.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),n.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)||t.undo.redo(t)}),n}function Yo(e,t){t=to.call(this,e,t)||this;return t._bindEvent(e),t}function g(e){var t;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)t=new AudioContext;else{if(!webkitAudioContext)return;t=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=t.sampleRate;var n=t.createGain();t.createMediaStreamSource(e).connect(n),this.recorder=t.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(t.destination),this.readyFlag=!0}function Qo(e,t){t=oo.call(this,e,t)||this;return t._bindEvent(e),t}function $o(t,e){var n=io.call(this,t,e)||this;return t.options.outline&&n.element.firstElementChild.classList.add("vditor-menu--current"),n.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),t.toolbar.elements.outline.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)||(t.options.outline.enable=!n.element.firstElementChild.classList.contains("vditor-menu--current"),t.outline.toggle(t,t.options.outline.enable))}),n}function er(n,e){var o=lo.call(this,n,e)||this;return o.element.children[0].addEventListener((0,I.Le)(),function(e){var t;e.preventDefault(),!o.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)&&"sv"!==n.currentMode&&(e=(0,V.zh)(n),t=(0,B.lG)(e.startContainer,"LI"))&&vt(n,t,e,t.parentElement)}),o}function tr(t,e){var n=co.call(this,t,e)||this;return n.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),n.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||st(t,"beforebegin")}),n}function nr(t,e){var n=uo.call(this,t,e)||this;return n.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),n.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||st(t,"afterend")}),n}function or(t,e){e=fo.call(this,t,e)||this;return e.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">\n<p style="text-align: center;margin: 14px 0">\n <em>下一代的 Markdown 编辑器,为未来而构建</em>\n</p>\n<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">\n <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>\n <div> </div>\n <div style="flex: 1;min-width: 250px">\n Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。\n 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。\n </div>\n</div>\n<div style="display: flex;flex-wrap: wrap;">\n <ul style="list-style: none;flex: 1;min-width:148px">\n <li>\n 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>\n </li>\n <li>\n 开源协议:MIT\n </li>\n </ul>\n <ul style="list-style: none;margin-right: 18px">\n <li>\n 组件版本:Vditor v'.concat(N.H," / Lute v").concat(Lute.Version,'\n </li>\n <li>\n 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>\n </li>\n </ul>\n</div>\n</div>'),0)}),e}function rr(n,e){var o=vo.call(this,n,e)||this;return o.element.children[0].addEventListener((0,I.Le)(),function(e){var t;e.preventDefault(),!o.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)&&"sv"!==n.currentMode&&(e=(0,V.zh)(n),t=(0,B.lG)(e.startContainer,"LI"))&&ht(n,t,e)}),o}function ir(t,e){e=bo.call(this,t,e)||this;return e.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">\n<div style="margin-top: 14px;flex: 1">\n <div>Markdown 使用指南</div>\n <ul style="list-style: none">\n <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>\n <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>\n <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>\n <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>\n </ul>\n</div>\n<div style="margin-top: 14px;flex: 1">\n <div>Vditor 支持</div>\n <ul style="list-style: none">\n <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>\n <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>\n <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>\n <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>\n </ul>\n</div></div>',0)}),e}function ar(e,t){var t=wo.call(this,e,t)||this,n=document.createElement("div");return n.className="vditor-hint vditor-panel--arrow",n.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,I.ns)("<⌥⌘1>"),'</button>\n<button data-tag="h2" data-value="## ">').concat(window.VditorI18n.heading2," <").concat((0,I.ns)("⌥⌘2"),'></button>\n<button data-tag="h3" data-value="### ">').concat(window.VditorI18n.heading3," <").concat((0,I.ns)("⌥⌘3"),'></button>\n<button data-tag="h4" data-value="#### ">').concat(window.VditorI18n.heading4," <").concat((0,I.ns)("⌥⌘4"),'></button>\n<button data-tag="h5" data-value="##### ">').concat(window.VditorI18n.heading5," <").concat((0,I.ns)("⌥⌘5"),'></button>\n<button data-tag="h6" data-value="###### ">').concat(window.VditorI18n.heading6," <").concat((0,I.ns)("⌥⌘6"),"></button>"),t.element.appendChild(n),t._bindEvent(e,n),t}function lr(e,t){var n=ko.call(this,e,t)||this;return n._bindEvent(e,t),n}function sr(l,e){var t=So.call(this,l,e)||this,n=t.element.children[0],o=document.createElement("div");return o.className="vditor-hint".concat(2===e.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-type="markdown">Markdown</button>\n<button data-type="pdf">PDF</button>\n<button data-type="html">HTML</button>',o.addEventListener((0,I.Le)(),function(e){var t,n,o,r,i,a=e.target;if("BUTTON"===a.tagName){switch(a.getAttribute("data-type")){case"markdown":i=D(r=l),dn(r,i,i.substr(0,10)+".md");break;case"pdf":(n=l).tip.show(window.VditorI18n.generate,3800),(o=document.querySelector("#vditorExportIframe")).contentDocument.open(),o.contentDocument.write('<link rel="stylesheet" href="'.concat(n.options.cdn,'/dist/index.css"/>\n<script src="').concat(n.options.cdn,'/dist/method.min.js"><\/script>\n<div id="preview" style="width: 800px"></div>\n<script>\nwindow.addEventListener("message", (e) => {\n if(!e.data) {\n return;\n }\n Vditor.preview(document.getElementById(\'preview\'), e.data, {\n cdn: "').concat(n.options.cdn,'",\n markdown: {\n theme: ').concat(JSON.stringify(n.options.preview.theme),'\n },\n hljs: {\n style: "').concat(n.options.preview.hljs.style,'"\n }\n });\n setTimeout(() => {\n window.print();\n }, 3600);\n}, false);\n<\/script>')),o.contentDocument.close(),setTimeout(function(){o.contentWindow.postMessage(D(n),"*")},200);break;case"html":i=Vt(r=l),t='<html><head><link rel="stylesheet" type="text/css" href="'.concat(r.options.cdn,'/dist/index.css"/>\n<script src="').concat(r.options.cdn,"/dist/js/i18n/").concat(r.options.lang,'.js"><\/script>\n<script src="').concat(r.options.cdn,'/dist/method.min.js"><\/script></head>\n<body><div class="vditor-reset" id="preview">').concat(i,"</div>\n<script>\n const previewElement = document.getElementById('preview')\n Vditor.setContentTheme('").concat(r.options.preview.theme.current,"', '").concat(r.options.preview.theme.path,"');\n Vditor.codeRender(previewElement);\n Vditor.highlightRender(").concat(JSON.stringify(r.options.preview.hljs),", previewElement, '").concat(r.options.cdn,"');\n Vditor.mathRender(previewElement, {\n cdn: '").concat(r.options.cdn,"',\n math: ").concat(JSON.stringify(r.options.preview.math),",\n });\n Vditor.mermaidRender(previewElement, '").concat(r.options.cdn,"', '").concat(r.options.theme,"');\n Vditor.markmapRender(previewElement, '").concat(r.options.cdn,"', '").concat(r.options.theme,"');\n Vditor.flowchartRender(previewElement, '").concat(r.options.cdn,"');\n Vditor.graphvizRender(previewElement, '").concat(r.options.cdn,"');\n Vditor.chartRender(previewElement, '").concat(r.options.cdn,"', '").concat(r.options.theme,"');\n Vditor.mindmapRender(previewElement, '").concat(r.options.cdn,"', '").concat(r.options.theme,"');\n Vditor.abcRender(previewElement, '").concat(r.options.cdn,"');\n ").concat(r.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",'\n Vditor.speechRender(previewElement);\n<\/script>\n<script src="').concat(r.options.cdn,"/dist/js/icons/").concat(r.options.icon,'.js"><\/script></body></html>'),dn(r,t,i.substr(0,10)+".html")}s(l,["subToolbar"]),e.preventDefault(),e.stopPropagation()}}),t.element.appendChild(o),a(l,o,n,e.level),t}function cr(n,e){var t=To.call(this,n,e)||this,o=document.createElement("div"),r=(o.className="vditor-panel vditor-panel--arrow","");return Object.keys(n.options.hint.emoji).forEach(function(e){var t=n.options.hint.emoji[e];-1<t.indexOf(".")?r+='<button data-value=":'.concat(e,': " data-key=":').concat(e,':"><img\ndata-value=":').concat(e,': " data-key=":').concat(e,':" class="vditor-emojis__icon" src="').concat(t,'"/></button>'):r+='<button data-value="'.concat(t,' "\n data-key="').concat(e,'"><span class="vditor-emojis__icon">').concat(t,"</span></button>")}),o.innerHTML='<div class="vditor-emojis" style="max-height: '.concat("auto"===n.options.height?"auto":n.options.height-80,'px">').concat(r,'</div><div class="vditor-emojis__tail">\n <span class="vditor-emojis__tip"></span><span>').concat(n.options.hint.emojiTail||"","</span>\n</div>"),t.element.appendChild(o),a(n,o,t.element.firstElementChild,e.level),t.bindEvent(n),t}function dr(n,e){var o=Co.call(this,n,e)||this;return o.element.firstElementChild.addEventListener((0,I.Le)(),function(e){var t=o.element.firstElementChild;t.classList.contains(N.g.CLASS_MENU_DISABLED)||(e.preventDefault(),t.classList.contains("vditor-menu--current")?(t.classList.remove("vditor-menu--current"),n.devtools.element.style.display="none",l(n)):(t.classList.add("vditor-menu--current"),n.devtools.element.style.display="block",l(n),n.devtools.renderEchart(n)))}),o}function pr(t,n){var e=Mo.call(this,t,n)||this;return e.element.children[0].innerHTML=n.icon,e.element.children[0].addEventListener((0,I.Le)(),function(e){e.preventDefault(),e.currentTarget.classList.contains(N.g.CLASS_MENU_DISABLED)||n.click(e,t)}),e}function ur(e){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(e,"")}function mr(t,e){var n=Oo.call(this,t,e)||this,o=n.element.children[0],r=document.createElement("div"),i=(r.className="vditor-hint".concat(2===e.level?"":" vditor-panel--arrow"),"");return Object.keys(t.options.preview.theme.list).forEach(function(e){i+='<button data-type="'.concat(e,'">').concat(t.options.preview.theme.list[e],"</button>")}),r.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(i,"</div>"),r.addEventListener((0,I.Le)(),function(e){"BUTTON"===e.target.tagName&&(s(t,["subToolbar"]),t.options.preview.theme.current=e.target.getAttribute("data-type"),(0,ue.Z)(t.options.preview.theme.current,t.options.preview.theme.path),e.preventDefault(),e.stopPropagation())}),n.element.appendChild(r),a(t,r,o,e.level),n}function fr(t,e){var n=Do.call(this,t,e)||this,o=n.element.children[0],r=document.createElement("div"),i=(r.className="vditor-hint".concat(2===e.level?"":" vditor-panel--arrow"),"");return N.g.CODE_THEME.forEach(function(e){i+="<button>".concat(e,"</button>")}),r.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(i,"</div>"),r.addEventListener((0,I.Le)(),function(e){"BUTTON"===e.target.tagName&&(s(t,["subToolbar"]),t.options.preview.hljs.style=e.target.textContent,(0,tn.Y)(e.target.textContent,t.options.cdn),e.preventDefault(),e.stopPropagation())}),n.element.appendChild(r),a(t,r,o,e.level),n}function hr(t,e){var n=jo.call(this,t,e)||this;return"both"===t.options.preview.mode&&n.element.children[0].classList.add("vditor-menu--current"),n.element.children[0].addEventListener((0,I.Le)(),function(e){n.element.firstElementChild.classList.contains(N.g.CLASS_MENU_DISABLED)||(e.preventDefault(),"sv"===t.currentMode&&("both"===t.options.preview.mode?Qt("editor",t):Qt("both",t)))}),n}function vr(){this.element=document.createElement("div"),this.element.className="vditor-tip"}function gr(e){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",e.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(e),Ie(e,this.element),Re(e,this.element),ze(e,this.element),Ue(e,this.element),Pe(e,this.element),qe(e,this.element,this.copy),Be(e,this.element,this.copy)}function br(e){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--".concat(e.options.resize.position),this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(e)}function yr(o){var r=this,i=(this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",o.options.classes.preview&&this.previewElement.classList.add(o.options.classes.preview),this.previewElement.style.maxWidth=o.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(e){var t;"TEXTAREA"!==e.target.tagName&&((t=document.createElement("div")).className="vditor-reset",t.appendChild(getSelection().getRangeAt(0).cloneContents()),r.copyToX(o,t,"default"),e.preventDefault())}),this.previewElement.addEventListener("click",function(e){var t=(0,B.lG)(e.target,"SPAN");t&&(0,B.fb)(t,"vditor-toc")?(t=r.previewElement.querySelector("#"+t.getAttribute("data-target-id")))&&(r.element.scrollTop=t.offsetTop):"A"===e.target.tagName?(o.options.link.click?o.options.link.click(e.target):o.options.link.isOpen&&window.open(e.target.getAttribute("href")),e.preventDefault()):"IMG"===e.target.tagName&&(o.options.image.preview?o.options.image.preview(e.target):o.options.image.isPreview&&(0,de.E)(e.target,o.options.lang,o.options.theme))}),this.element.appendChild(this.previewElement),o.options.preview.actions);if(0!==i.length){var a=document.createElement("div");a.className="vditor-preview__action";for(var e=[],t=0;t<i.length;t++){var n=i[t];if("object"!=typeof n)switch(n){case"desktop":e.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":e.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":e.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":e.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":e.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 e.push('<button type="button" data-type="'.concat(n.key,'" class="').concat(n.className,'"').concat(n.tooltip?' aria-label="'.concat(n.tooltip,'"'):"",'">').concat(n.text,"</button>"))}a.innerHTML=e.join(""),a.addEventListener((0,I.Le)(),function(e){var t,n,e=(0,z.S)(e.target,"BUTTON");e&&(t=e.getAttribute("data-type"),(n=i.find(function(e){return(null==e?void 0:e.key)===t}))?n.click(t):"mp-wechat"!==t&&"zhihu"!==t?(r.previewElement.style.width="desktop"===t?"auto":"tablet"===t?"780px":"360px",r.previewElement.scrollWidth>r.previewElement.parentElement.clientWidth&&(r.previewElement.style.width="auto"),r.render(o),a.querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-preview__action--current")}),e.classList.add("vditor-preview__action--current")):r.copyToX(o,r.previewElement.cloneNode(!0),t))}),this.element.insertBefore(a,this.previewElement)}}function wr(e){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(e,'</div>\n<div class="vditor-outline__content"></div>')}function Er(e){this.composingLock=!1;var t=document.createElement("div");t.className="vditor-ir",t.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>'),this.element=t.firstElementChild,this.bindEvent(e),Ie(e,this.element),je(e,this.element),Re(e,this.element),ze(e,this.element),Ue(e,this.element),Pe(e,this.element),qe(e,this.element,this.copy),Be(e,this.element,this.copy)}function kr(e){var a=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(e,t){a.element.style.display="none";var n,o=decodeURIComponent(e.getAttribute("data-value")),e=window.getSelection().getRangeAt(0);if("ir"===t.currentMode){var r=(0,B.a1)(e.startContainer,"data-type","code-block-info");if(r)return r.textContent=N.g.ZWSP+o.trimRight(),e.selectNodeContents(r),e.collapse(!1),v(t),r.parentElement.querySelectorAll("code").forEach(function(e){e.className="language-"+o.trimRight()}),U(r.parentElement.querySelector(".vditor-ir__preview"),t),void(a.recentLanguage=o.trimRight())}if("wysiwyg"===t.currentMode&&3!==e.startContainer.nodeType){var r=e.startContainer,i=void 0;if((i=r.classList.contains("vditor-input")?r:r.firstElementChild)&&i.classList.contains("vditor-input"))return i.value=o.trimRight(),e.selectNodeContents(i),e.collapse(!1),i.dispatchEvent(new CustomEvent("input",{detail:1})),void(a.recentLanguage=o.trimRight())}e.setStart(e.startContainer,a.lastIndex),e.deleteContents(),t.options.hint.parse?"sv"===t.currentMode?(0,V.oC)(t.lute.SpinVditorSVDOM(o),t):"wysiwyg"===t.currentMode?(0,V.oC)(t.lute.SpinVditorDOM(o),t):(0,V.oC)(t.lute.SpinVditorIRDOM(o),t):(0,V.oC)(o,t),":"===a.splitChar&&-1<o.indexOf(":")&&"sv"!==t.currentMode&&e.insertNode(document.createTextNode(" ")),e.collapse(!1),(0,V.Hc)(e),"wysiwyg"===t.currentMode?(n=(0,B.fb)(e.startContainer,"vditor-wysiwyg__block"))&&n.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(n.lastElementChild.innerHTML=n.firstElementChild.innerHTML,U(n.lastElementChild,t)):"ir"===t.currentMode&&(n=(0,B.fb)(e.startContainer,"vditor-ir__marker--pre"))&&n.nextElementSibling.classList.contains("vditor-ir__preview")&&(n.nextElementSibling.innerHTML=n.innerHTML,U(n.nextElementSibling,t)),x(t)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",e.push({key:":"})}Po=L.default,n(b,Po),b.prototype.showErrorTip=function(e){var t=new Yt;document.body.appendChild(t.element),t.show(e,0)},b.prototype.updateToolbarConfig=function(e){this.vditor.toolbar.updateConfig(this.vditor,e)},b.prototype.setTheme=function(e,t,n,o){this.vditor.options.theme=e,_(this.vditor),t&&(this.vditor.options.preview.theme.current=t,(0,ue.Z)(t,o||this.vditor.options.preview.theme.path)),n&&(this.vditor.options.preview.hljs.style=n,(0,tn.Y)(n,this.vditor.options.cdn))},b.prototype.getValue=function(){return D(this.vditor)},b.prototype.getCurrentMode=function(){return this.vditor.currentMode},b.prototype.focus=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.focus():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.focus():"ir"===this.vditor.currentMode&&this.vditor.ir.element.focus()},b.prototype.blur=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.blur():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.blur():"ir"===this.vditor.currentMode&&this.vditor.ir.element.blur()},b.prototype.disabled=function(){s(this.vditor,["subToolbar","hint","popover"]),q(this.vditor.toolbar.elements,N.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},b.prototype.enable=function(){P(this.vditor.toolbar.elements,N.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},b.prototype.getSelection=function(){return"wysiwyg"===this.vditor.currentMode?De(this.vditor.wysiwyg.element):"sv"===this.vditor.currentMode?De(this.vditor.sv.element):"ir"===this.vditor.currentMode?De(this.vditor.ir.element):void 0},b.prototype.renderPreview=function(e){this.vditor.preview.render(this.vditor,e)},b.prototype.getCursorPosition=function(){return(0,V.Ny)(this.vditor[this.vditor.currentMode].element)},b.prototype.isUploading=function(){return this.vditor.upload.isUploading},b.prototype.clearCache=function(){localStorage.removeItem(this.vditor.options.cache.id)},b.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},b.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},b.prototype.html2md=function(e){return this.vditor.lute.HTML2Md(e)},b.prototype.exportJSON=function(e){return this.vditor.lute.RenderJSON(e)},b.prototype.getHTML=function(){return Vt(this.vditor)},b.prototype.tip=function(e,t){this.vditor.tip.show(e,t)},b.prototype.setPreviewMode=function(e){Qt(e,this.vditor)},b.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},b.prototype.updateValue=function(e){document.execCommand("insertHTML",!1,e)},b.prototype.insertValue=function(e,t){void 0===t&&(t=!0);var n=(0,V.zh)(this.vditor),o=(n.collapse(!0),document.createElement("template"));o.innerHTML=e,n.insertNode(o.content.cloneNode(!0)),n.collapse(!1),"sv"===this.vditor.currentMode?(this.vditor.sv.preventInput=!0,t&&c(this.vditor)):"wysiwyg"===this.vditor.currentMode?t&&tt(this.vditor,getSelection().getRangeAt(0)):"ir"===this.vditor.currentMode&&(this.vditor.ir.preventInput=!0,t)&&se(this.vditor,getSelection().getRangeAt(0),!0)},b.prototype.setValue=function(e,t){var n=this;void 0===t&&(t=!1),"sv"===this.vditor.currentMode?(this.vditor.sv.element.innerHTML="<div data-block='0'>".concat(this.vditor.lute.SpinVditorSVDOM(e),"</div>"),u(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):"wysiwyg"===this.vditor.currentMode?He(this.vditor,e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(e),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){U(e,n.vditor)}),v(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),e||(s(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),t&&this.clearStack()},b.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},b.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var e=document.getElementById("vditorIconScript");e&&e.remove(),this.clearCache(),he(),this.vditor.wysiwyg.unbindListener()},b.prototype.getCommentIds=function(){return"wysiwyg"!==this.vditor.currentMode?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},b.prototype.hlCommentIds=function(e){var t;"wysiwyg"===this.vditor.currentMode&&(t=function(t){t.classList.remove("vditor-comment--hover"),e.forEach(function(e){-1<t.getAttribute("data-cmtids").indexOf(e)&&t.classList.add("vditor-comment--hover")})},this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display)&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})},b.prototype.unHlCommentIds=function(e){var t;"wysiwyg"===this.vditor.currentMode&&(t=function(t){e.forEach(function(e){-1<t.getAttribute("data-cmtids").indexOf(e)&&t.classList.remove("vditor-comment--hover")})},this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display)&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})},b.prototype.removeCommentIds=function(e){var n,r=this;"wysiwyg"===this.vditor.currentMode&&(n=function(e,n){var o=e.getAttribute("data-cmtids").split(" ");o.find(function(e,t){if(e===n)return o.splice(t,1),!0}),0===o.length?(e.outerHTML=e.innerHTML,(0,V.zh)(r.vditor).collapse(!0)):e.setAttribute("data-cmtids",o.join(" "))},e.forEach(function(t){r.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){n(e,t)}),"none"!==r.vditor.preview.element.style.display&&r.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){n(e,t)})}),W(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}))},b.prototype.init=function(e,r){var i=this;this.vditor={currentMode:r.mode,element:e,hint:new zt(r.hint.extend),lute:void 0,options:r,originalInnerHTML:e.innerHTML,outline:new Ft(window.VditorI18n.outline),tip:new Yt},this.vditor.sv=new Xt(this.vditor),this.vditor.undo=new Uo,this.vditor.wysiwyg=new Go(this.vditor),this.vditor.ir=new Ut(this.vditor),this.vditor.toolbar=new Bo(this.vditor),r.resize.enable&&(this.vditor.resize=new Jt(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new M),(r.upload.url||r.upload.handler)&&(this.vditor.upload=new $e),(0,A.G)(r._lutePath||"".concat(r.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){var t,n,e,o;i.vditor.lute=(0,Wt.X)({autoSpace:i.vditor.options.preview.markdown.autoSpace,gfmAutoLink:i.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:i.vditor.options.preview.markdown.codeBlockPreview,emojiSite:i.vditor.options.hint.emojiPath,emojis:i.vditor.options.hint.emoji,fixTermTypo:i.vditor.options.preview.markdown.fixTermTypo,footnotes:i.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:i.vditor.options.preview.math.inlineDigit,linkBase:i.vditor.options.preview.markdown.linkBase,linkPrefix:i.vditor.options.preview.markdown.linkPrefix,listStyle:i.vditor.options.preview.markdown.listStyle,mark:i.vditor.options.preview.markdown.mark,mathBlockPreview:i.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:i.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:i.vditor.options.preview.markdown.sanitize,toc:i.vditor.options.preview.markdown.toc}),i.vditor.preview=new Zt(i.vditor),(t=i.vditor).element.innerHTML="",t.element.classList.add("vditor"),t.options.rtl&&t.element.setAttribute("dir","rtl"),_(t),(0,ue.Z)(t.options.preview.theme.current,t.options.preview.theme.path),"number"==typeof t.options.height?t.element.style.height=t.options.height+"px":t.element.style.height=t.options.height,"number"==typeof t.options.minHeight&&(t.element.style.minHeight=t.options.minHeight+"px"),"number"==typeof t.options.width?t.element.style.width=t.options.width+"px":t.element.style.width=t.options.width,t.element.appendChild(t.toolbar.element),(o=document.createElement("div")).className="vditor-content","left"===t.options.outline.position&&o.appendChild(t.outline.element),o.appendChild(t.wysiwyg.element.parentElement),o.appendChild(t.sv.element),o.appendChild(t.ir.element.parentElement),o.appendChild(t.preview.element),t.toolbar.elements.devtools&&o.appendChild(t.devtools.element),"right"===t.options.outline.position&&(t.outline.element.classList.add("vditor-outline--right"),o.appendChild(t.outline.element)),t.upload&&o.appendChild(t.upload.element),t.options.resize.enable&&o.appendChild(t.resize.element),o.appendChild(t.hint.element),o.appendChild(t.tip.element),t.element.appendChild(o),o.addEventListener("click",function(){s(t,["subToolbar"])}),t.toolbar.elements.export&&t.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),d(t,t.options.mode,(me(e=t),he(),window.addEventListener("resize",T=function(){l(e),me(e)}),o=(0,I.pK)()&&localStorage.getItem(e.options.cache.id),e.options.cache.enable&&o||(e.options.value?o=e.options.value:e.originalInnerHTML?o=e.lute.HTML2Md(e.originalInnerHTML):e.options.cache.enable||(o="")),o||"")),document.execCommand("DefaultParagraphSeparator",!1,"p"),-1<navigator.userAgent.indexOf("iPhone")&&void 0!==window.visualViewport&&(n=!1,o=function(e){n||(n=!0,requestAnimationFrame(function(){n=!1;var e=t.toolbar.element;e.style.transform="none",e.getBoundingClientRect().top<0&&(e.style.transform="translate(0, ".concat(-e.getBoundingClientRect().top,"px)"))}))},window.visualViewport.addEventListener("scroll",o),window.visualViewport.addEventListener("resize",o)),r.after&&r.after(),r.icon&&(0,A.J)("".concat(r.cdn,"/dist/js/icons/").concat(r.icon,".js"),"vditorIconScript")})};let e=b;function b(e,t){var n=Po.call(this)||this;if(n.version=N.H,"string"==typeof e){if(t?t.cache?t.cache.id||(t.cache.id="vditor".concat(e)):t.cache={id:"vditor".concat(e)}:t={cache:{id:"vditor".concat(e)}},!document.getElementById(e))return n.showErrorTip("Failed to get element by id: ".concat(e)),n;e=document.getElementById(e)}var o=new Wo(t).merge();if(o.i18n)window.VditorI18n=o.i18n,n.init(e,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 r="vditorI18nScript"+o.lang;document.querySelectorAll('head script[id^="'.concat("vditorI18nScript",'"]')).forEach(function(e){e.id!==r&&document.head.removeChild(e)}),(0,A.G)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),r).then(function(){n.init(e,o)}).catch(function(e){n.showErrorTip("GET ".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}return n}}return E.default})()},875:function(e,t,n){var o=n(876);"string"==typeof o&&(o=[[e.i,o,""]]);n(91)(o,{insertAt:"top",hmr:!0,transform:void 0,insertInto:void 0}),o.locals&&(e.exports=o.locals)},876:function(e,t,n){(t=n(90)(!1)).push([e.i,'/*!\n * Vditor v3.10.5 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n/*!\n * Vditor v3.10.5 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n.vditor {\n --border-color: #d1d5da;\n --second-color: rgba(88, 96, 105, 0.36);\n --panel-background-color: #fff;\n --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n --toolbar-background-color: #f6f8fa;\n --toolbar-icon-color: #586069;\n --toolbar-icon-hover-color: #4285f4;\n --toolbar-height: 35px;\n --toolbar-divider-margin-top: 8px;\n --textarea-background-color: #fafbfc;\n --textarea-text-color: #24292e;\n --resize-icon-color: var(--toolbar-icon-color);\n --resize-background-color: var(--toolbar-background-color);\n --resize-hover-icon-color: var(--panel-background-color);\n --resize-hover-background-color: var(--toolbar-icon-hover-color);\n --count-background-color: rgba(27, 31, 35, 0.05);\n --heading-border-color: #eaecef;\n --blockquote-color: #6a737d;\n --ir-heading-color: #660e7a;\n --ir-title-color: #808080;\n --ir-bi-color: #0033b3;\n --ir-link-color: #008000;\n --ir-bracket-color: #0000ff;\n --ir-paren-color: #008000;\n}\n.vditor--dark {\n --border-color: #141414;\n --second-color: rgba(185, 185, 185, 0.36);\n --panel-background-color: #24292e;\n --panel-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);\n --toolbar-background-color: #1d2125;\n --toolbar-icon-color: #b9b9b9;\n --toolbar-icon-hover-color: #fff;\n --textarea-background-color: #2f363d;\n --textarea-text-color: #d1d5da;\n --resize-icon-color: var(--border-color);\n --resize-background-color: var(--second-color);\n --resize-hover-icon-color: var(--toolbar-icon-hover-color);\n --resize-hover-background-color: rgba(185, 185, 185, 0.86);\n --count-background-color: rgba(66, 133, 244, 0.36);\n --heading-border-color: var(--textarea-text-color);\n --blockquote-color: var(--toolbar-icon-color);\n --ir-heading-color: #9876aa;\n --ir-title-color: #808080;\n --ir-bi-color: #cc7832;\n --ir-link-color: #ffc66d;\n --ir-bracket-color: #287bde;\n --ir-paren-color: #6a8759;\n}\n/**\n * tool tip.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 0.1.0.0, Jan 25, 2019\n */\n@-webkit-keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.vditor-tooltipped {\n position: relative;\n cursor: pointer;\n}\n.vditor-tooltipped::after {\n position: absolute;\n z-index: 1000000;\n display: none;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: normal;\n -webkit-font-smoothing: subpixel-antialiased;\n color: #fff;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: #3b3e43;\n border-radius: 3px;\n line-height: 16px;\n opacity: 0;\n}\n.vditor-tooltipped::before {\n position: absolute;\n z-index: 1000001;\n display: none;\n width: 0;\n height: 0;\n color: #3b3e43;\n pointer-events: none;\n content: "";\n border: 5px solid transparent;\n opacity: 0;\n}\n.vditor-tooltipped--hover::before,\n.vditor-tooltipped--hover::after,\n.vditor-tooltipped:hover::before,\n.vditor-tooltipped:hover::after,\n.vditor-tooltipped:active::before,\n.vditor-tooltipped:active::after,\n.vditor-tooltipped:focus::before,\n.vditor-tooltipped:focus::after {\n display: inline-block;\n text-decoration: none;\n -webkit-animation-name: tooltip-appear;\n animation-name: tooltip-appear;\n -webkit-animation-duration: 0.15s;\n animation-duration: 0.15s;\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-timing-function: ease-in;\n animation-timing-function: ease-in;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__se::after,\n.vditor-tooltipped__sw::after {\n top: 100%;\n right: 50%;\n margin-top: 5px;\n}\n.vditor-tooltipped__s::before,\n.vditor-tooltipped__se::before,\n.vditor-tooltipped__sw::before {\n top: auto;\n right: 50%;\n bottom: -5px;\n margin-right: -5px;\n border-bottom-color: #3b3e43;\n}\n.vditor-tooltipped__se::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__sw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__n::after,\n.vditor-tooltipped__ne::after,\n.vditor-tooltipped__nw::after {\n right: 50%;\n bottom: 100%;\n margin-bottom: 5px;\n}\n.vditor-tooltipped__n::before,\n.vditor-tooltipped__ne::before,\n.vditor-tooltipped__nw::before {\n top: -5px;\n right: 50%;\n bottom: auto;\n margin-right: -5px;\n border-top-color: #3b3e43;\n}\n.vditor-tooltipped__ne::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__nw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__n::after {\n transform: translateX(50%);\n}\n.vditor-tooltipped__w::after {\n right: 100%;\n bottom: 50%;\n margin-right: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__w::before {\n top: 50%;\n bottom: 50%;\n left: -5px;\n margin-top: -5px;\n border-left-color: #3b3e43;\n}\n.vditor-tooltipped__e::after {\n bottom: 50%;\n left: 100%;\n margin-left: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__e::before {\n top: 50%;\n right: -5px;\n bottom: 50%;\n margin-top: -5px;\n border-right-color: #3b3e43;\n}\n@media screen and (max-width: 520px) {\n .vditor-tooltipped:before,\n .vditor-tooltipped:after {\n content: none;\n }\n}\n/**\n * panel.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 1.0.0.0, Jan 22, 2020\n */\n@-webkit-keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n@keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n.vditor-panel {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px;\n z-index: 3;\n font-size: 14px;\n display: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n max-width: 320px;\n min-width: 80px;\n -webkit-animation-duration: 0.15s;\n animation-duration: 0.15s;\n -webkit-animation-name: scale-in;\n animation-name: scale-in;\n -webkit-animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n color: var(--toolbar-icon-color);\n}\n.vditor-panel--none {\n padding: 0;\n -webkit-animation: none;\n animation: none;\n min-width: auto;\n max-width: none;\n white-space: nowrap;\n opacity: 0.86;\n}\n.vditor-panel--arrow:before {\n position: absolute;\n width: 0;\n height: 0;\n pointer-events: none;\n content: " ";\n border: 7px solid transparent;\n top: -14px;\n left: 5px;\n border-bottom-color: var(--panel-background-color);\n}\n.vditor-panel--left {\n right: 0;\n}\n.vditor-panel--left.vditor-panel--arrow:before {\n right: 5px;\n left: auto;\n}\n.vditor-input {\n border: 0;\n padding: 3px 5px;\n background-color: var(--panel-background-color);\n font-size: 12px;\n color: var(--textarea-text-color);\n}\n.vditor-input:focus {\n background-color: var(--toolbar-background-color);\n outline: none;\n}\n.vditor-icon {\n color: var(--toolbar-icon-color);\n cursor: pointer;\n float: left;\n padding: 4px 5px;\n height: 21px;\n width: 23px;\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n}\n.vditor-icon:hover,\n.vditor-icon--current {\n color: var(--toolbar-icon-hover-color);\n background-color: transparent;\n}\n.vditor-icon:focus {\n outline: none;\n}\n.vditor-icon svg {\n height: 13px !important;\n width: 13px !important;\n float: left;\n fill: currentColor;\n pointer-events: none;\n}\n.vditor-toolbar {\n background-color: var(--toolbar-background-color);\n border-bottom: 1px solid var(--border-color);\n padding: 0 5px;\n line-height: 1;\n}\n.vditor-toolbar--pin {\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1;\n}\n.vditor-toolbar--hide {\n transition: all 0.15s ease-in-out;\n height: 5px;\n overflow: hidden;\n}\n.vditor-toolbar--hide:hover {\n background-color: var(--toolbar-background-color);\n height: auto;\n overflow: visible;\n}\n.vditor-toolbar__item {\n float: left;\n position: relative;\n}\n.vditor-toolbar__item .vditor-tooltipped {\n color: var(--toolbar-icon-color);\n border: 0;\n padding: 10px 5px;\n background-color: transparent;\n height: var(--toolbar-height);\n width: 25px;\n box-sizing: border-box;\n font-size: 0;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n outline: none;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n cursor: pointer;\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-toolbar__item svg {\n fill: currentColor;\n display: inline-block;\n stroke-width: 0;\n stroke: currentColor;\n width: 15px;\n height: 15px;\n}\n.vditor-toolbar__item input {\n position: absolute;\n width: 25px;\n height: var(--toolbar-height);\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0.001;\n overflow: hidden;\n}\n.vditor-toolbar__divider {\n float: left;\n height: calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n border-left: 1px solid var(--second-color);\n margin: var(--toolbar-divider-margin-top) 8px;\n}\n.vditor-toolbar__br {\n width: 100%;\n padding: 0 !important;\n height: 0 !important;\n}\n.vditor-menu--current {\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-menu--disabled {\n color: var(--second-color) !important;\n cursor: not-allowed !important;\n}\n.vditor-emojis {\n display: inline-block;\n overflow: auto;\n}\n.vditor-emojis::-webkit-scrollbar {\n display: none;\n}\n.vditor-emojis__tip {\n flex: 1;\n min-width: 1px;\n width: 200px;\n margin-right: 10px;\n color: var(--toolbar-icon-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-emojis__tail {\n margin-top: 5px;\n font-size: 12px;\n color: var(--toolbar-icon-color);\n display: flex;\n}\n.vditor-emojis__tail a {\n text-decoration: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-emojis__tail a:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-emojis button {\n cursor: pointer;\n border-radius: 3px;\n float: left;\n height: 30px;\n width: 30px;\n text-align: center;\n line-height: 26px;\n padding: 3px;\n box-sizing: border-box;\n font-size: 16px;\n transition: all 0.15s ease-in-out;\n border: 0;\n margin: 0;\n background-color: transparent;\n overflow: hidden;\n}\n.vditor-emojis button:focus {\n outline: none;\n}\n.vditor-emojis button:hover .vditor-emojis__icon {\n display: inline-block;\n transform: scale(1.2);\n}\n.vditor-emojis img {\n height: 20px;\n width: 20px;\n float: left;\n margin: 3px 0 0 3px;\n}\n@media screen and (max-width: 520px) {\n .vditor-toolbar__item {\n padding: 0 12px;\n }\n .vditor-panel--left.vditor-panel--arrow:before {\n right: 17px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .vditor-toolbar__item .vditor-tooltipped:hover {\n color: var(--toolbar-icon-hover-color);\n }\n}\n@-webkit-keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n@keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n.vditor {\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border-color);\n border-radius: 3px;\n box-sizing: border-box;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n}\n.vditor--fullscreen {\n position: fixed;\n top: 0;\n width: 100% !important;\n left: 0;\n height: 100vh !important;\n z-index: 90;\n border-radius: 0;\n}\n.vditor-content {\n display: flex;\n min-height: 60px;\n flex: 1;\n min-width: 1px;\n position: relative;\n}\n.vditor-preview {\n flex: 1;\n min-width: 1px;\n overflow: auto;\n margin-left: -1px;\n border-left: 1px solid var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n background-color: var(--textarea-background-color);\n}\n.vditor-preview::-webkit-scrollbar {\n display: none;\n}\n.vditor-preview__action {\n text-align: center;\n padding: 10px;\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button {\n background-color: var(--toolbar-background-color);\n color: var(--toolbar-icon-color);\n line-height: 20px;\n border: 0;\n margin: 0 10px;\n cursor: pointer;\n padding: 0 7px;\n font-size: 12px;\n}\n.vditor-preview__action button.vditor-preview__action--current,\n.vditor-preview__action button:hover {\n color: var(--toolbar-icon-hover-color);\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button:focus {\n outline: none;\n}\n.vditor-preview__action button svg {\n fill: currentColor;\n height: 15px;\n width: 15px;\n vertical-align: middle;\n}\n.vditor-preview > .vditor-reset {\n padding: 10px;\n margin: 0 auto;\n}\n.vditor-preview img:not(.emoji) {\n cursor: pointer;\n}\n.vditor-devtools {\n display: none;\n background-color: var(--textarea-background-color);\n overflow: auto;\n flex: 1;\n min-width: 1px;\n box-shadow: inset 1px 0 var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n padding: 10px;\n}\n.vditor-counter {\n padding: 3px;\n color: var(--toolbar-icon-color);\n background-color: var(--count-background-color);\n border-radius: 3px;\n font-size: 12px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n float: right;\n margin: 8px 3px 0 0;\n}\n.vditor-counter--error {\n color: #d23f31;\n background-color: rgba(210, 63, 49, 0.1);\n}\n.vditor-resize {\n padding: 3px 0;\n cursor: row-resize;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n width: 100%;\n}\n.vditor-resize--top {\n top: -3px;\n}\n.vditor-resize--bottom {\n bottom: -3px;\n}\n.vditor-resize > div {\n height: 3px;\n background-color: var(--resize-background-color);\n transition: all 0.15s ease-in-out;\n}\n.vditor-resize:hover > div,\n.vditor-resize--selected > div {\n background-color: var(--resize-hover-background-color);\n}\n.vditor-resize:hover svg,\n.vditor-resize--selected svg {\n color: var(--resize-hover-icon-color);\n}\n.vditor-resize svg {\n fill: currentColor;\n stroke-width: 0;\n stroke: currentColor;\n width: 13px;\n height: 3px;\n display: block;\n margin: 0 auto;\n color: var(--resize-icon-color);\n}\n.vditor-upload {\n position: absolute;\n height: 3px;\n left: 0;\n top: -2px;\n transition: all 0.15s ease-in-out;\n background-color: #4285f4;\n}\n.vditor-tip {\n position: absolute;\n font-size: 12px;\n top: 10px;\n -webkit-animation-duration: 0.15s;\n animation-duration: 0.15s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n left: 50%;\n z-index: 5;\n}\n.vditor-tip--show {\n display: block;\n -webkit-animation-name: slideInDown;\n animation-name: slideInDown;\n}\n.vditor-tip__content {\n text-align: left;\n display: inline-block;\n line-height: 16px;\n padding: 3px 10px;\n border-radius: 3px;\n background: var(--toolbar-background-color);\n position: relative;\n margin-left: -50%;\n color: var(--toolbar-icon-color);\n max-width: 100%;\n box-shadow: var(--panel-shadow);\n}\n.vditor-tip__content ul {\n margin: 2px 0;\n padding: 0 0 0 18px;\n}\n.vditor-tip__content a {\n color: #4285f4;\n}\n.vditor-tip__close {\n position: absolute;\n color: var(--toolbar-icon-color);\n top: -7px;\n right: -15px;\n font-weight: bold;\n cursor: pointer;\n}\n.vditor-tip__close:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n z-index: 100;\n}\n.vditor-img__bar {\n border-bottom: 1px solid var(--border-color);\n background-color: var(--toolbar-background-color);\n text-align: center;\n height: 36px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.vditor-img__btn {\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-left: 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-img__btn:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img__btn svg {\n height: 14px;\n width: 14px;\n margin-right: 8px;\n fill: currentColor;\n}\n.vditor-img__img {\n flex: 1;\n background-color: var(--textarea-background-color);\n overflow: auto;\n cursor: zoom-out;\n}\n.vditor-img__img img {\n max-width: none;\n}\n.vditor-hint {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px 0;\n z-index: 4;\n line-height: 20px;\n list-style: none;\n font-size: 12px;\n margin: 0;\n max-width: 250px;\n min-width: 80px;\n display: none;\n}\n.vditor-hint .vditor-hint {\n margin-top: -31px;\n left: 100%;\n right: auto;\n}\n.vditor-hint .vditor-hint.vditor-panel--left {\n right: 100%;\n left: auto;\n}\n.vditor-hint button {\n color: var(--toolbar-icon-color);\n display: block;\n padding: 3px 10px;\n border: 0;\n border-radius: 0;\n line-height: 20px;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n margin: 0;\n background-color: transparent;\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-hint button:focus {\n outline: none;\n}\n.vditor-hint--current,\n.vditor-hint button:not(.vditor-menu--disabled):hover {\n background-color: var(--toolbar-background-color) !important;\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-hint__emoji {\n font-size: 16px;\n float: left;\n margin-right: 3px;\n}\n.vditor-hint img {\n height: 20px;\n width: 20px;\n float: left;\n margin-right: 3px;\n}\n.vditor-reset {\n color: #24292e;\n font-variant-ligatures: no-common-ligatures;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-wrap: break-word;\n overflow: auto;\n line-height: 1.5;\n font-size: 16px;\n word-break: break-word;\n}\n.vditor-reset--anchor {\n padding-left: 20px;\n}\n.vditor-reset--error {\n color: #d23f31;\n font-size: 12px;\n display: block;\n line-height: 16px;\n}\n.vditor-reset ul ul ul {\n list-style-type: square;\n}\n.vditor-reset ul ul {\n list-style-type: circle;\n}\n.vditor-reset ul {\n list-style-type: disc;\n}\n.vditor-reset ul,\n.vditor-reset ol {\n padding-left: 2em;\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset li + li {\n margin-top: 0.25em;\n}\n.vditor-reset li p {\n margin-top: 16px;\n}\n.vditor-reset audio {\n max-width: 100%;\n}\n.vditor-reset audio:focus {\n outline: none;\n}\n.vditor-reset video {\n max-height: 90vh;\n max-width: 100%;\n}\n.vditor-reset img {\n max-width: 100%;\n}\n.vditor-reset img.emoji {\n cursor: auto;\n max-width: 20px;\n vertical-align: sub;\n}\n.vditor-reset h1,\n.vditor-reset h2,\n.vditor-reset h3,\n.vditor-reset h4,\n.vditor-reset h5,\n.vditor-reset h6 {\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n.vditor-reset h1:hover .vditor-anchor svg,\n.vditor-reset h2:hover .vditor-anchor svg,\n.vditor-reset h3:hover .vditor-anchor svg,\n.vditor-reset h4:hover .vditor-anchor svg,\n.vditor-reset h5:hover .vditor-anchor svg,\n.vditor-reset h6:hover .vditor-anchor svg {\n visibility: visible;\n}\n.vditor-reset h1 {\n font-size: 1.75em;\n}\n.vditor-reset h2 {\n font-size: 1.55em;\n}\n.vditor-reset h3 {\n font-size: 1.38em;\n}\n.vditor-reset h4 {\n font-size: 1.25em;\n}\n.vditor-reset h5 {\n font-size: 1.13em;\n}\n.vditor-reset h6 {\n font-size: 1em;\n}\n.vditor-reset hr {\n height: 2px;\n padding: 0;\n margin: 24px 0;\n background-color: #eaecef;\n border: 0;\n}\n.vditor-reset p {\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset blockquote {\n padding: 0 1em;\n color: #6a737d;\n border-left: 0.25em solid #eaecef;\n margin: 0 0 16px 0;\n}\n.vditor-reset blockquote > :first-child {\n margin-top: 0;\n}\n.vditor-reset blockquote > :last-child {\n margin-bottom: 0;\n}\n.vditor-reset ins > iframe {\n border: 0;\n}\n.vditor-reset iframe {\n border: 1px solid #d1d5da;\n max-width: 100%;\n box-sizing: border-box;\n}\n.vditor-reset iframe.iframe__video {\n min-width: 80%;\n min-height: 36vh;\n}\n.vditor-reset table {\n border-collapse: collapse;\n empty-cells: show;\n margin-bottom: 16px;\n overflow: auto;\n border-spacing: 0;\n display: block;\n word-break: keep-all;\n width: 100%;\n}\n.vditor-reset table tr {\n background-color: #fafbfc;\n border-top: 1px solid #c6cbd1;\n}\n.vditor-reset table td,\n.vditor-reset table th {\n padding: 6px 13px;\n border: 1px solid #dfe2e5;\n word-break: normal;\n white-space: nowrap;\n}\n.vditor-reset table td:first-child::after,\n.vditor-reset table th:first-child::after {\n content: "";\n display: inline-block;\n vertical-align: top;\n min-height: 24px;\n}\n.vditor-reset table th {\n font-weight: 600;\n}\n.vditor-reset table tbody tr:nth-child(2n) {\n background-color: #fff;\n}\n.vditor-reset code:not(.hljs):not(.highlight-chroma) {\n padding: 0.2em 0.4em;\n margin: 0;\n font-size: 85%;\n border-radius: 3px;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-break: break-word;\n background-size: 20px 20px;\n white-space: pre-wrap;\n}\n.vditor-reset pre {\n margin: 1em 0;\n}\n.vditor-reset pre > code {\n margin: 0;\n font-size: 85%;\n padding: 0.5em;\n border-radius: 5px;\n display: block;\n overflow: auto;\n white-space: pre;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n background-size: 20px 20px;\n background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg==);\n word-break: initial;\n word-wrap: normal;\n}\n.vditor-reset pre:hover div.vditor-copy {\n display: block;\n}\n.vditor-reset .language-math,\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap,\n.vditor-reset .language-plantuml,\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-abc,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n margin-bottom: 16px;\n}\n.vditor-reset .language-math mjx-container:focus {\n outline: none;\n cursor: context-menu;\n}\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap {\n overflow: hidden;\n height: 420px;\n}\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n text-align: center;\n}\n.vditor-reset .language-graphviz parsererror {\n overflow: auto;\n}\n.vditor-reset kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #24292e;\n vertical-align: middle;\n background-color: #fafbfc;\n border: solid 1px #d1d5da;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #d1d5da;\n}\n.vditor-reset summary {\n cursor: pointer;\n}\n.vditor-reset summary:focus {\n outline: none;\n}\n.vditor-reset svg {\n height: auto;\n width: auto;\n stroke-width: initial;\n}\n.vditor-reset p:last-child,\n.vditor-reset blockquote:last-child,\n.vditor-reset pre:last-child,\n.vditor-reset ul:last-child,\n.vditor-reset ol:last-child,\n.vditor-reset hr:last-child {\n margin-bottom: 0;\n}\n.vditor-comment {\n border-bottom: 2px solid #f8e6ab;\n}\n.vditor-comment--focus,\n.vditor-comment--hover {\n background-color: #faf1d1;\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-comment--focus .vditor-comment,\n.vditor-comment--hover .vditor-comment {\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-task {\n list-style: none !important;\n word-break: break-all;\n}\n.vditor-task input {\n margin: 0 0.2em 0.25em -1.6em;\n font-size: 12px;\n vertical-align: middle;\n}\n.vditor-copy {\n position: relative;\n display: none;\n z-index: 1;\n}\n.vditor-copy textarea {\n position: absolute;\n left: -100000px;\n height: 10px;\n}\n.vditor-copy span {\n cursor: pointer;\n position: absolute;\n right: 15px;\n top: 0.5em;\n}\n.vditor-copy svg {\n color: #586069;\n height: 14px;\n width: 14px !important;\n display: block;\n fill: currentColor;\n}\n.vditor-linenumber {\n padding-left: 4em !important;\n position: relative;\n}\n.vditor-linenumber__rows {\n position: absolute;\n pointer-events: none;\n top: 0.5em;\n left: 0;\n width: 3em;\n /* works for line-numbers below 1000 lines */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n counter-reset: linenumber;\n}\n.vditor-linenumber__rows > span {\n pointer-events: none;\n display: block;\n}\n.vditor-linenumber__rows > span::before {\n counter-increment: linenumber;\n content: counter(linenumber);\n color: rgba(158, 150, 150, 0.38);\n display: block;\n padding-right: 1em;\n text-align: right;\n}\n.vditor-speech {\n position: absolute;\n display: none;\n background-color: #f6f8fa;\n border: 1px solid #d1d5da;\n border-radius: 3px;\n padding: 3px;\n cursor: pointer;\n color: #586069;\n}\n.vditor-speech:hover,\n.vditor-speech--current {\n color: #4285f4;\n}\n.vditor-speech svg {\n height: 14px;\n width: 14px;\n fill: currentColor;\n display: block;\n stroke-width: 0;\n stroke: currentColor;\n}\n.vditor-anchor {\n margin-left: 5px;\n}\n.vditor-anchor--left {\n float: left;\n padding-right: 4px;\n margin-left: -20px;\n}\n.vditor-anchor svg {\n visibility: hidden;\n}\n.vditor-anchor:hover svg {\n visibility: visible;\n}\n.vditor-anchor:focus {\n outline: none;\n}\n.vditor-linkcard {\n margin: 31px auto 16px;\n transition: all 0.15s ease-in-out;\n cursor: pointer;\n max-width: 768px;\n padding: 0 10px;\n}\n.vditor-linkcard a {\n border-radius: 3px;\n background-color: #f6f8fa;\n overflow: hidden;\n max-height: 250px;\n display: flex;\n text-decoration: none;\n flex-wrap: wrap-reverse;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n}\n.vditor-linkcard a:hover {\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.13), 0 3px 6px rgba(0, 0, 0, 0.26);\n text-decoration: none;\n}\n.vditor-linkcard a:visited .vditor-linkcard__abstract {\n color: rgba(88, 96, 105, 0.36);\n}\n.vditor-linkcard__info {\n padding: 10px;\n min-width: 200px;\n box-sizing: border-box;\n flex: 1;\n}\n.vditor-linkcard__title {\n font-size: 14px;\n font-weight: 400;\n color: #24292e;\n display: flex;\n align-items: center;\n}\n.vditor-linkcard__title img {\n cursor: pointer;\n height: 20px;\n width: 20px;\n border-radius: 3px;\n flex-shrink: 0;\n margin-right: 5px;\n}\n.vditor-linkcard__abstract {\n word-wrap: break-word;\n word-break: break-all;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n font-size: 13px;\n color: #586069;\n margin: 5px 0;\n}\n.vditor-linkcard__site {\n font-size: 12px;\n color: #4285f4;\n}\n.vditor-linkcard__image {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n max-width: 250px;\n min-width: 126px;\n cursor: pointer;\n background-color: rgba(88, 96, 105, 0.36);\n}\n.vditor-footnotes__goto-ref {\n text-decoration: none;\n}\n.vditor-toc {\n margin-bottom: 16px;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n color: #4285f4;\n}\n.vditor-toc .vditor-outline__action {\n display: none;\n}\n.vditor-toc ul {\n list-style: none !important;\n padding-left: 1em;\n}\n.vditor-toc > ul {\n padding-left: 0;\n}\n.vditor-toc span {\n cursor: pointer;\n}\n.vditor-toc li > span > svg {\n width: 0;\n height: 0;\n}\n.vditor-outline {\n width: 250px;\n border-right: 1px solid var(--border-color);\n background-color: var(--panel-background-color);\n display: none;\n overflow: auto;\n}\n.vditor-outline--right {\n border-right: 0;\n border-left: 1px solid var(--border-color);\n}\n.vditor-outline::-webkit-scrollbar {\n display: none;\n}\n.vditor-outline ul {\n list-style: none !important;\n padding-left: 1em;\n margin: 0;\n}\n.vditor-outline__content > ul {\n padding-left: 0;\n}\n.vditor-outline li > span {\n display: flex;\n align-items: center;\n padding: 5px 10px;\n cursor: pointer;\n color: var(--textarea-text-color);\n}\n.vditor-outline li > span > svg {\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.vditor-outline li > span:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-outline li > span > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vditor-outline__title {\n border-bottom: 1px dashed var(--border-color);\n padding: 5px 10px;\n color: var(--toolbar-icon-color);\n font-size: 12px;\n}\n.vditor-outline__action {\n transition: all 0.15s ease-in-out;\n fill: currentColor;\n margin-right: 5px;\n flex-shrink: 0;\n}\n.vditor-outline__action--close {\n transform: rotate(-90deg);\n}\n.vditor-wysiwyg {\n box-sizing: border-box;\n flex: 1;\n position: relative;\n width: 100%;\n min-width: 1px;\n}\n.vditor-wysiwyg pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-wysiwyg pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-wysiwyg pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-wysiwyg pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-wysiwyg blockquote:empty::before,\n.vditor-wysiwyg pre > code:empty::before,\n.vditor-wysiwyg p:empty::before,\n.vditor-wysiwyg h1:empty::after,\n.vditor-wysiwyg h2:empty::after,\n.vditor-wysiwyg h3:empty::after,\n.vditor-wysiwyg h4:empty::after,\n.vditor-wysiwyg h5:empty::after,\n.vditor-wysiwyg h6:empty::after {\n content: \' \';\n}\n.vditor-wysiwyg code[data-marker="`"] {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n.vditor-wysiwyg__block pre:first-child {\n margin-bottom: -1em;\n}\n.vditor-wysiwyg__block pre:first-child code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-wysiwyg__block pre:last-child {\n margin-bottom: 1em;\n}\n.vditor-wysiwyg__preview {\n cursor: pointer;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-wysiwyg > .vditor-reset > h1:before,\n.vditor-wysiwyg > .vditor-reset > h2:before,\n.vditor-wysiwyg > .vditor-reset > h3:before,\n.vditor-wysiwyg > .vditor-reset > h4:before,\n.vditor-wysiwyg > .vditor-reset > h5:before,\n.vditor-wysiwyg > .vditor-reset > h6:before,\n.vditor-wysiwyg div.vditor-wysiwyg__block:before,\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n.vditor-wysiwyg div[data-type="footnotes-block"]:before,\n.vditor-wysiwyg .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-wysiwyg > .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-wysiwyg > .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-wysiwyg > .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-wysiwyg > .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-wysiwyg > .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-wysiwyg div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block:before {\n content: "</>";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="yaml-front-matter"]:before {\n content: "F";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="math-block"]:before {\n content: "$$";\n}\n.vditor-wysiwyg .vditor-toc:before {\n content: "ToC";\n}\n.vditor-wysiwyg hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-wysiwyg details {\n white-space: initial;\n}\n.vditor-wysiwyg a {\n cursor: pointer;\n}\n.vditor-wysiwyg span[data-type="backslash"] > span {\n display: none;\n color: var(--second-color);\n}\n.vditor-wysiwyg span[data-type="link-ref"],\n.vditor-wysiwyg sup[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-wysiwyg span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n.vditor-wysiwyg div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n@media screen and (max-width: 520px) {\n .vditor-wysiwyg h1:before,\n .vditor-wysiwyg h2:before,\n .vditor-wysiwyg h3:before,\n .vditor-wysiwyg h4:before,\n .vditor-wysiwyg h5:before,\n .vditor-wysiwyg h6:before,\n .vditor-wysiwyg div.vditor-wysiwyg__block:before,\n .vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n .vditor-wysiwyg div[data-type="footnotes-block"]:before,\n .vditor-wysiwyg .vditor-toc:before {\n content: none;\n }\n}\n.vditor-ir {\n box-sizing: border-box;\n flex: 1;\n min-width: 1px;\n position: relative;\n width: 100%;\n}\n.vditor-ir__node[data-type="code-block"]:before,\n.vditor-ir__node[data-type="code-block"]:after,\n.vditor-ir__node[data-type="yaml-front-matter"]:before,\n.vditor-ir__node[data-type="yaml-front-matter"]:after,\n.vditor-ir__node[data-type="math-block"]:before,\n.vditor-ir__node[data-type="math-block"]:after {\n content: \' \';\n color: var(--second-color);\n}\n.vditor-ir__node:not(.vditor-ir__node--expand) .vditor-ir__marker {\n padding: 0 !important;\n}\n.vditor-ir__node:not(.vditor-ir__node--expand)[data-type="a"] {\n cursor: pointer;\n}\n.vditor-ir__node[data-type="link-ref"],\n.vditor-ir__node[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-ir__node[data-type="html-block"] {\n margin-bottom: 1em;\n}\n.vditor-ir__node .vditor-ir__marker {\n width: 0;\n overflow: hidden;\n display: inline-block;\n height: 0;\n transition: all 0.15s ease-in-out;\n}\n.vditor-ir__node--hidden .vditor-ir__marker {\n visibility: hidden;\n}\n.vditor-ir__node--expand .vditor-ir__marker {\n color: var(--second-color);\n display: inline;\n height: auto;\n width: auto;\n}\n.vditor-ir__node--expand .vditor-ir__marker--hide {\n display: none;\n}\n.vditor-ir__node--expand .vditor-ir__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bracket {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir__node--expand .vditor-ir__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--pre code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-ir__node--expand[data-type="code-block"]:before,\n.vditor-ir__node--expand[data-type="code-block"]:after {\n content: \'```\';\n}\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:before,\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:after {\n content: \'---\';\n}\n.vditor-ir__node--expand[data-type="math-block"]:before,\n.vditor-ir__node--expand[data-type="math-block"]:after {\n content: \'$$\';\n}\n.vditor-ir__node span[data-type="code-block-open-marker"],\n.vditor-ir__node span[data-type="code-block-close-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-open-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-close-marker"],\n.vditor-ir__node span[data-type="math-block-open-marker"],\n.vditor-ir__node span[data-type="math-block-close-marker"] {\n display: none;\n}\n.vditor-ir__preview {\n cursor: pointer;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-ir__link {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-ir pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-ir pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-ir pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-ir pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-ir pre.vditor-reset pre {\n margin: 0;\n}\n.vditor-ir hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-ir blockquote:empty::before,\n.vditor-ir pre > code:empty::before,\n.vditor-ir p:empty::before,\n.vditor-ir h1:empty::after,\n.vditor-ir h2:empty::after,\n.vditor-ir h3:empty::after,\n.vditor-ir h4:empty::after,\n.vditor-ir h5:empty::after,\n.vditor-ir h6:empty::after {\n content: \' \';\n}\n.vditor-ir .vditor-reset > h1:before,\n.vditor-ir .vditor-reset > h2:before,\n.vditor-ir .vditor-reset > h3:before,\n.vditor-ir .vditor-reset > h4:before,\n.vditor-ir .vditor-reset > h5:before,\n.vditor-ir .vditor-reset > h6:before,\n.vditor-ir div[data-type="link-ref-defs-block"]:before,\n.vditor-ir div[data-type="footnotes-block"]:before,\n.vditor-ir .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-ir .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-ir .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-ir .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-ir .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-ir .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-ir div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n.vditor-ir div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-ir div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-ir div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ul,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ol,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > p,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > blockquote,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > pre,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > table,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > hr {\n margin-left: 8px;\n}\n.vditor-ir .vditor-toc:before {\n content: "ToC";\n}\n.vditor-ir .vditor-toc span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n@media screen and (max-width: 520px) {\n .vditor-ir h1:before,\n .vditor-ir h2:before,\n .vditor-ir h3:before,\n .vditor-ir h4:before,\n .vditor-ir h5:before,\n .vditor-ir h6:before,\n .vditor-ir div[data-type="link-ref-defs-block"]:before,\n .vditor-ir div[data-type="footnotes-block"]:before,\n .vditor-ir .vditor-toc:before {\n content: none;\n }\n}\n.vditor-sv {\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n margin: 0 1px 0 0;\n overflow: auto;\n width: 100%;\n flex: 1;\n min-width: 1px;\n border: 0;\n resize: none;\n padding: 10px 9px 10px 10px;\n box-sizing: border-box;\n background-color: var(--panel-background-color);\n outline: 0 none;\n font-size: 16px;\n line-height: 22px;\n color: var(--textarea-text-color);\n border-radius: 0 0 3px 3px;\n font-variant-ligatures: no-common-ligatures;\n white-space: pre-wrap;\n word-break: break-word;\n word-wrap: break-word;\n}\n.vditor-sv[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-sv:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-sv:focus {\n background-color: var(--textarea-background-color);\n}\n.vditor-sv:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-sv span[data-type="newline"] + span[data-type="text"]:empty {\n display: inherit;\n}\n.vditor-sv .sup {\n vertical-align: super;\n font-size: smaller;\n}\n.vditor-sv .strong {\n font-weight: bold;\n}\n.vditor-sv .em {\n font-style: italic;\n}\n.vditor-sv .s {\n text-decoration: line-through;\n}\n.vditor-sv .mark:not(.vditor-sv__marker) {\n background-color: yellow;\n color: black;\n}\n.vditor-sv .h1 {\n font-size: 1.75em;\n line-height: 44px;\n}\n.vditor-sv .h2 {\n font-size: 1.55em;\n line-height: 38px;\n}\n.vditor-sv .h3 {\n font-size: 1.38em;\n line-height: 27px;\n}\n.vditor-sv .h4 {\n font-size: 1.25em;\n line-height: 25px;\n}\n.vditor-sv .h5 {\n font-size: 1.13em;\n}\n.vditor-sv .h6 {\n font-size: 1em;\n}\n.vditor-sv__marker {\n color: var(--second-color);\n}\n.vditor-sv__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-sv__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-sv__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-sv__marker--bracket {\n color: var(--ir-bracket-color);\n}\n.vditor-sv__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-sv__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--strong {\n font-weight: bold;\n}\n',""]),e.exports=t}}]);
|
|
1
|
+
/*! For license information please see async-feffery_vditor.js.LICENSE.txt */
|
|
2
|
+
(window.webpackJsonpfeffery_utils_components=window.webpackJsonpfeffery_utils_components||[]).push([[32],{516:function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(874),a=n.n(i),l=(n(875),n(63)),s=n(25),c=n(550),d=n(495),p=n(219);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var b=function(e){var t=e.id,n=e.className,i=e.style,p=e.key,u=e.debounceWait,f=e.undoDelay,v=e.height,g=e.minHeight,b=e.width,y=e.placeholder,w=e.lang,E=e.tab,k=e.typewriterMode,x=e.cdn,S=e.mode,_=e.debuggerMode,L=e.value,T=e.theme,C=e.icon,A=e.toolbar,M=e.toolbarConfig,H=e.counter,O=e.cache,N=e.preview,D=e.image,I=e.link,j=e.hint,R=e.upload,P=e.resize,q=e.classes,B=e.fullscreen,z=e.outline,U=(e.htmlValue,e.selectedValue,e.wordCount,e.resizeHeight,e.setProps),V=(e.loading_state,h(Object(r.useState)(),2)),W=V[0],G=V[1],F=h(Object(r.useState)("initial"),2),K=F[0],Z=F[1],J=Object(c.a)((function(e){U({value:e,htmlValue:W.getHTML()})}),{debounceWait:u,manual:!0}).run,X=Object(r.useMemo)((function(){return t||Object(d.a)()}),[]),Y=Object(r.useMemo)((function(){return m(m({},H),{},{after:function(e){U({wordCount:e})}})}),[H]),Q=Object(r.useMemo)((function(){return m(m({},P),{},{after:function(e){U({resizeHeight:e})}})}),[P]),$=Object(r.useMemo)((function(){var e={debugger:_,counter:Y,resize:Q,undoDelay:f,height:v,minHeight:g,width:b,placeholder:y,lang:w,tab:E,typewriterMode:k,cdn:x,mode:S,value:L,theme:T,icon:C,toolbar:A,toolbarConfig:M,cache:O,preview:N,image:D,link:I,hint:j,upload:R,classes:q,fullscreen:B,outline:z};return Object.entries(e).reduce((function(e,t){var n=h(t,2),r=n[0],o=n[1];return Object(s.isUndefined)(o)||(e[r]=o),e}),{})}),[f,v,g,b,y,w,E,k,x,S,_,L,T,C,A,M,Y,O,N,D,I,j,R,Q,q,B,z]);return Object(r.useEffect)((function(){return W&&"initial"===K&&W.setValue(Object(s.isUndefined)(L)?"":L),function(){Z("initial")}}),[W,L]),Object(r.useEffect)((function(){var e=new a.a(X,m(m({},$),{},{after:function(){G(e)},input:function(e){Z("event"),J(e)},select:function(e){U({selectedValue:e})}}));return function(){null==W||W.destroy(),G(void 0)}}),[]),o.a.createElement("div",{id:X,className:Object(s.isString)(n)?n:n?Object(l.a)(n):void 0,key:p,style:i})};t.default=b,b.defaultProps=p.b,b.propTypes=p.c},874:function(e,t,n){var r;r=()=>(()=>{var e={85:e=>{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};t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,o){void 0===o&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=o;if(null==e||null==n)throw new Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===r&&(r=!0);var a=r,l=this.diff_commonPrefix(e,n),s=e.substring(0,l);e=e.substring(l),n=n.substring(l),l=this.diff_commonSuffix(e,n);var c=e.substring(e.length-l);e=e.substring(0,e.length-l),n=n.substring(0,n.length-l);var d=this.diff_compute_(e,n,a,i);return s&&d.unshift(new t.Diff(0,s)),c&&d.push(new t.Diff(0,c)),this.diff_cleanupMerge(d),d},t.prototype.diff_compute_=function(e,n,r,o){var i;if(!e)return[new t.Diff(1,n)];if(!n)return[new t.Diff(-1,e)];var a=e.length>n.length?e:n,l=e.length>n.length?n:e,s=a.indexOf(l);if(-1!=s)return i=[new t.Diff(1,a.substring(0,s)),new t.Diff(0,l),new t.Diff(1,a.substring(s+l.length))],e.length>n.length&&(i[0][0]=i[2][0]=-1),i;if(1==l.length)return[new t.Diff(-1,e),new t.Diff(1,n)];var c=this.diff_halfMatch_(e,n);if(c){var d=c[0],p=c[1],u=c[2],f=c[3],m=c[4],v=this.diff_main(d,u,r,o),h=this.diff_main(p,f,r,o);return v.concat([new t.Diff(0,m)],h)}return r&&e.length>100&&n.length>100?this.diff_lineMode_(e,n,o):this.diff_bisect_(e,n,o)},t.prototype.diff_lineMode_=function(e,n,r){var o=this.diff_linesToChars_(e,n);e=o.chars1,n=o.chars2;var i=o.lineArray,a=this.diff_main(e,n,!1,r);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,s=0,c=0,d="",p="";l<a.length;){switch(a[l][0]){case 1:c++,p+=a[l][1];break;case-1:s++,d+=a[l][1];break;case 0:if(s>=1&&c>=1){a.splice(l-s-c,s+c),l=l-s-c;for(var u=this.diff_main(d,p,!1,r),f=u.length-1;f>=0;f--)a.splice(l,0,u[f]);l+=u.length}c=0,s=0,d="",p=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,n,r){for(var o=e.length,i=n.length,a=Math.ceil((o+i)/2),l=a,s=2*a,c=new Array(s),d=new Array(s),p=0;p<s;p++)c[p]=-1,d[p]=-1;c[l+1]=0,d[l+1]=0;for(var u=o-i,f=u%2!=0,m=0,v=0,h=0,g=0,b=0;b<a&&!((new Date).getTime()>r);b++){for(var y=-b+m;y<=b-v;y+=2){for(var w=l+y,E=(L=y==-b||y!=b&&c[w-1]<c[w+1]?c[w+1]:c[w-1]+1)-y;L<o&&E<i&&e.charAt(L)==n.charAt(E);)L++,E++;if(c[w]=L,L>o)v+=2;else if(E>i)m+=2;else if(f&&(S=l+u-y)>=0&&S<s&&-1!=d[S]&&L>=(x=o-d[S]))return this.diff_bisectSplit_(e,n,L,E,r)}for(var k=-b+h;k<=b-g;k+=2){for(var x,S=l+k,_=(x=k==-b||k!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1)-k;x<o&&_<i&&e.charAt(o-x-1)==n.charAt(i-_-1);)x++,_++;if(d[S]=x,x>o)g+=2;else if(_>i)h+=2;else if(!f){var L;if((w=l+u-k)>=0&&w<s&&-1!=c[w])if(E=l+(L=c[w])-w,L>=(x=o-x))return this.diff_bisectSplit_(e,n,L,E,r)}}}return[new t.Diff(-1,e),new t.Diff(1,n)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,o){var i=e.substring(0,n),a=t.substring(0,r),l=e.substring(n),s=t.substring(r),c=this.diff_main(i,a,!1,o),d=this.diff_main(l,s,!1,o);return c.concat(d)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function o(e){for(var t="",o=0,a=-1,l=n.length;a<e.length-1;){-1==(a=e.indexOf("\n",o))&&(a=e.length-1);var s=e.substring(o,a+1);(r.hasOwnProperty?r.hasOwnProperty(s):void 0!==r[s])?t+=String.fromCharCode(r[s]):(l==i&&(s=e.substring(o),a=e.length),t+=String.fromCharCode(l),r[s]=l,n[l++]=s),o=a+1}return t}n[0]="";var i=4e4,a=o(e);return i=65535,{chars1:a,chars2:o(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],o=[],i=0;i<r.length;i++)o[i]=t[r.charCodeAt(i)];e[n][1]=o.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(i,o)==t.substring(i,o)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(e.length-o,e.length-i)==t.substring(t.length-o,t.length-i)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var o=Math.min(n,r);if(e==t)return o;for(var i=0,a=1;;){var l=e.substring(o-a),s=t.indexOf(l);if(-1==s)return i;a+=s,0!=s&&e.substring(o-a)!=t.substring(0,a)||(i=a,a++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;var o=this;function i(e,t,n){for(var r,i,a,l,s=e.substring(n,n+Math.floor(e.length/4)),c=-1,d="";-1!=(c=t.indexOf(s,c+1));){var p=o.diff_commonPrefix(e.substring(n),t.substring(c)),u=o.diff_commonSuffix(e.substring(0,n),t.substring(0,c));d.length<u+p&&(d=t.substring(c-u,c)+t.substring(c,c+p),r=e.substring(0,n-u),i=e.substring(n+p),a=t.substring(0,c-u),l=t.substring(c+p))}return 2*d.length>=e.length?[r,i,a,l,d]:null}var a,l,s,c,d,p=i(n,r,Math.ceil(n.length/4)),u=i(n,r,Math.ceil(n.length/2));return p||u?(a=u?p&&p[4].length>u[4].length?p:u:p,e.length>t.length?(l=a[0],s=a[1],c=a[2],d=a[3]):(c=a[0],d=a[1],l=a[2],s=a[3]),[l,s,c,d,a[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var n=!1,r=[],o=0,i=null,a=0,l=0,s=0,c=0,d=0;a<e.length;)0==e[a][0]?(r[o++]=a,l=c,s=d,c=0,d=0,i=e[a][1]):(1==e[a][0]?c+=e[a][1].length:d+=e[a][1].length,i&&i.length<=Math.max(l,s)&&i.length<=Math.max(c,d)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,a=--o>0?r[o-1]:-1,l=0,s=0,c=0,d=0,i=null,n=!0)),a++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(-1==e[a-1][0]&&1==e[a][0]){var p=e[a-1][1],u=e[a][1],f=this.diff_commonOverlap_(p,u),m=this.diff_commonOverlap_(u,p);f>=m?(f>=p.length/2||f>=u.length/2)&&(e.splice(a,0,new t.Diff(0,u.substring(0,f))),e[a-1][1]=p.substring(0,p.length-f),e[a+1][1]=u.substring(f),a++):(m>=p.length/2||m>=u.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,m))),e[a-1][0]=1,e[a-1][1]=u.substring(0,u.length-m),e[a+1][0]=-1,e[a+1][1]=p.substring(m),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),o=n.charAt(0),i=r.match(t.nonAlphaNumericRegex_),a=o.match(t.nonAlphaNumericRegex_),l=i&&r.match(t.whitespaceRegex_),s=a&&o.match(t.whitespaceRegex_),c=l&&r.match(t.linebreakRegex_),d=s&&o.match(t.linebreakRegex_),p=c&&e.match(t.blanklineEndRegex_),u=d&&n.match(t.blanklineStartRegex_);return p||u?5:c||d?4:i&&!l&&s?3:l||s?2:i||a?1:0}for(var r=1;r<e.length-1;){if(0==e[r-1][0]&&0==e[r+1][0]){var o=e[r-1][1],i=e[r][1],a=e[r+1][1],l=this.diff_commonSuffix(o,i);if(l){var s=i.substring(i.length-l);o=o.substring(0,o.length-l),i=s+i.substring(0,i.length-l),a=s+a}for(var c=o,d=i,p=a,u=n(o,i)+n(i,a);i.charAt(0)===a.charAt(0);){o+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var f=n(o,i)+n(i,a);f>=u&&(u=f,c=o,d=i,p=a)}e[r-1][1]!=c&&(c?e[r-1][1]=c:(e.splice(r-1,1),r--),e[r][1]=d,p?e[r+1][1]=p:(e.splice(r+1,1),r--))}r++}},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(e){for(var n=!1,r=[],o=0,i=null,a=0,l=!1,s=!1,c=!1,d=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(c||d)?(r[o++]=a,l=c,s=d,i=e[a][1]):(o=0,i=null),c=d=!1):(-1==e[a][0]?d=!0:c=!0,i&&(l&&s&&c&&d||i.length<this.Diff_EditCost/2&&l+s+c+d==3)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,i=null,l&&s?(c=d=!0,o=0):(a=--o>0?r[o-1]:-1,c=d=!1),n=!0)),a++;n&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var n,r=0,o=0,i=0,a="",l="";r<e.length;)switch(e[r][0]){case 1:i++,l+=e[r][1],r++;break;case-1:o++,a+=e[r][1],r++;break;case 0:o+i>1?(0!==o&&0!==i&&(0!==(n=this.diff_commonPrefix(l,a))&&(r-o-i>0&&0==e[r-o-i-1][0]?e[r-o-i-1][1]+=l.substring(0,n):(e.splice(0,0,new t.Diff(0,l.substring(0,n))),r++),l=l.substring(n),a=a.substring(n)),0!==(n=this.diff_commonSuffix(l,a))&&(e[r][1]=l.substring(l.length-n)+e[r][1],l=l.substring(0,l.length-n),a=a.substring(0,a.length-n))),r-=o+i,e.splice(r,o+i),a.length&&(e.splice(r,0,new t.Diff(-1,a)),r++),l.length&&(e.splice(r,0,new t.Diff(1,l)),r++),r++):0!==r&&0==e[r-1][0]?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,i=0,o=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var s=!1;for(r=1;r<e.length-1;)0==e[r-1][0]&&0==e[r+1][0]&&(e[r][1].substring(e[r][1].length-e[r-1][1].length)==e[r-1][1]?(e[r][1]=e[r-1][1]+e[r][1].substring(0,e[r][1].length-e[r-1][1].length),e[r+1][1]=e[r-1][1]+e[r+1][1],e.splice(r-1,1),s=!0):e[r][1].substring(0,e[r+1][1].length)==e[r+1][1]&&(e[r-1][1]+=e[r+1][1],e[r][1]=e[r][1].substring(e[r+1][1].length)+e[r+1][1],e.splice(r+1,1),s=!0)),r++;s&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var n,r=0,o=0,i=0,a=0;for(n=0;n<e.length&&(1!==e[n][0]&&(r+=e[n][1].length),-1!==e[n][0]&&(o+=e[n][1].length),!(r>t));n++)i=r,a=o;return e.length!=n&&-1===e[n][0]?a:a+(t-i)},t.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=/</g,o=/>/g,i=/\n/g,a=0;a<e.length;a++){var l=e[a][0],s=e[a][1].replace(n,"&").replace(r,"<").replace(o,">").replace(i,"¶<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case-1:t[a]='<del style="background:#ffe6e6;">'+s+"</del>";break;case 0:t[a]="<span>"+s+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)-1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,n=0,r=0,o=0;o<e.length;o++){var i=e[o][0],a=e[o][1];switch(i){case 1:n+=a.length;break;case-1:r+=a.length;break;case 0:t+=Math.max(n,r),n=0,r=0}}return t+=Math.max(n,r)},t.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]="+"+encodeURI(e[n][1]);break;case-1:t[n]="-"+e[n][1].length;break;case 0:t[n]="="+e[n][1].length}return t.join("\t").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,n){for(var r=[],o=0,i=0,a=n.split(/\t/g),l=0;l<a.length;l++){var s=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{r[o++]=new t.Diff(1,decodeURI(s))}catch(e){throw new Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":var c=parseInt(s,10);if(isNaN(c)||c<0)throw new Error("Invalid number in diff_fromDelta: "+s);var d=e.substring(i,i+=c);"="==a[l].charAt(0)?r[o++]=new t.Diff(0,d):r[o++]=new t.Diff(-1,d);break;default:if(a[l])throw new Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(i!=e.length)throw new Error("Delta length ("+i+") does not equal source text length ("+e.length+").");return r},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),o=this;function i(e,r){var i=e/t.length,a=Math.abs(n-r);return o.Match_Distance?i+a/o.Match_Distance:a?1:i}var a=this.Match_Threshold,l=e.indexOf(t,n);-1!=l&&(a=Math.min(i(0,l),a),-1!=(l=e.lastIndexOf(t,n+t.length))&&(a=Math.min(i(0,l),a)));var s,c,d=1<<t.length-1;l=-1;for(var p,u=t.length+e.length,f=0;f<t.length;f++){for(s=0,c=u;s<c;)i(f,n+c)<=a?s=c:u=c,c=Math.floor((u-s)/2+s);u=c;var m=Math.max(1,n-c+1),v=Math.min(n+c,e.length)+t.length,h=Array(v+2);h[v+1]=(1<<f)-1;for(var g=v;g>=m;g--){var b=r[e.charAt(g-1)];if(h[g]=0===f?(h[g+1]<<1|1)&b:(h[g+1]<<1|1)&b|(p[g+1]|p[g])<<1|1|p[g+1],h[g]&d){var y=i(f,g-1);if(y<=a){if(a=y,!((l=g-1)>n))break;m=Math.max(1,2*n-l)}}}if(i(f+1,n)>a)break;p=h}return l},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var r=n.substring(e.start2,e.start2+e.length1),o=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,r=n.substring(e.start2-o,e.start2+e.length1+o);o+=this.Patch_Margin;var i=n.substring(e.start2-o,e.start2);i&&e.diffs.unshift(new t.Diff(0,i));var a=n.substring(e.start2+e.length1,e.start2+e.length1+o);a&&e.diffs.push(new t.Diff(0,a)),e.start1-=i.length,e.start2-=i.length,e.length1+=i.length+a.length,e.length2+=i.length+a.length}},t.prototype.patch_make=function(e,n,r){var o,i;if("string"==typeof e&&"string"==typeof n&&void 0===r)o=e,(i=this.diff_main(o,n,!0)).length>2&&(this.diff_cleanupSemantic(i),this.diff_cleanupEfficiency(i));else if(e&&"object"==typeof e&&void 0===n&&void 0===r)i=e,o=this.diff_text1(i);else if("string"==typeof e&&n&&"object"==typeof n&&void 0===r)o=e,i=n;else{if("string"!=typeof e||"string"!=typeof n||!r||"object"!=typeof r)throw new Error("Unknown call format to patch_make.");o=e,i=r}if(0===i.length)return[];for(var a=[],l=new t.patch_obj,s=0,c=0,d=0,p=o,u=o,f=0;f<i.length;f++){var m=i[f][0],v=i[f][1];switch(s||0===m||(l.start1=c,l.start2=d),m){case 1:l.diffs[s++]=i[f],l.length2+=v.length,u=u.substring(0,d)+v+u.substring(d);break;case-1:l.length1+=v.length,l.diffs[s++]=i[f],u=u.substring(0,d)+u.substring(d+v.length);break;case 0:v.length<=2*this.Patch_Margin&&s&&i.length!=f+1?(l.diffs[s++]=i[f],l.length1+=v.length,l.length2+=v.length):v.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(l,p),a.push(l),l=new t.patch_obj,s=0,p=u,c=d)}1!==m&&(c+=v.length),-1!==m&&(d+=v.length)}return s&&(this.patch_addContext_(l,p),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=new t.patch_obj;i.diffs=[];for(var a=0;a<o.diffs.length;a++)i.diffs[a]=new t.Diff(o.diffs[a][0],o.diffs[a][1]);i.start1=o.start1,i.start2=o.start2,i.length1=o.length1,i.length2=o.length2,n[r]=i}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var r=0,o=[],i=0;i<e.length;i++){var a,l,s=e[i].start2+r,c=this.diff_text1(e[i].diffs),d=-1;if(c.length>this.Match_MaxBits?-1!=(a=this.match_main(t,c.substring(0,this.Match_MaxBits),s))&&(-1==(d=this.match_main(t,c.substring(c.length-this.Match_MaxBits),s+c.length-this.Match_MaxBits))||a>=d)&&(a=-1):a=this.match_main(t,c,s),-1==a)o[i]=!1,r-=e[i].length2-e[i].length1;else if(o[i]=!0,r=a-s,c==(l=-1==d?t.substring(a,a+c.length):t.substring(a,d+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[i].diffs)+t.substring(a+c.length);else{var p=this.diff_main(c,l,!1);if(c.length>this.Match_MaxBits&&this.diff_levenshtein(p)/c.length>this.Patch_DeleteThreshold)o[i]=!1;else{this.diff_cleanupSemanticLossless(p);for(var u,f=0,m=0;m<e[i].diffs.length;m++){var v=e[i].diffs[m];0!==v[0]&&(u=this.diff_xIndex(p,f)),1===v[0]?t=t.substring(0,a+u)+v[1]+t.substring(a+u):-1===v[0]&&(t=t.substring(0,a+u)+t.substring(a+this.diff_xIndex(p,f+v[1].length))),-1!==v[0]&&(f+=v[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),o]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r="",o=1;o<=n;o++)r+=String.fromCharCode(o);for(o=0;o<e.length;o++)e[o].start1+=n,e[o].start2+=n;var i=e[0],a=i.diffs;if(0==a.length||0!=a[0][0])a.unshift(new t.Diff(0,r)),i.start1-=n,i.start2-=n,i.length1+=n,i.length2+=n;else if(n>a[0][1].length){var l=n-a[0][1].length;a[0][1]=r.substring(a[0][1].length)+a[0][1],i.start1-=l,i.start2-=l,i.length1+=l,i.length2+=l}return 0==(a=(i=e[e.length-1]).diffs).length||0!=a[a.length-1][0]?(a.push(new t.Diff(0,r)),i.length1+=n,i.length2+=n):n>a[a.length-1][1].length&&(l=n-a[a.length-1][1].length,a[a.length-1][1]+=r.substring(0,l),i.length1+=l,i.length2+=l),r},t.prototype.patch_splitMax=function(e){for(var n=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=n)){var o=e[r];e.splice(r--,1);for(var i=o.start1,a=o.start2,l="";0!==o.diffs.length;){var s=new t.patch_obj,c=!0;for(s.start1=i-l.length,s.start2=a-l.length,""!==l&&(s.length1=s.length2=l.length,s.diffs.push(new t.Diff(0,l)));0!==o.diffs.length&&s.length1<n-this.Patch_Margin;){var d=o.diffs[0][0],p=o.diffs[0][1];1===d?(s.length2+=p.length,a+=p.length,s.diffs.push(o.diffs.shift()),c=!1):-1===d&&1==s.diffs.length&&0==s.diffs[0][0]&&p.length>2*n?(s.length1+=p.length,i+=p.length,c=!1,s.diffs.push(new t.Diff(d,p)),o.diffs.shift()):(p=p.substring(0,n-s.length1-this.Patch_Margin),s.length1+=p.length,i+=p.length,0===d?(s.length2+=p.length,a+=p.length):c=!1,s.diffs.push(new t.Diff(d,p)),p==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(p.length))}l=(l=this.diff_text2(s.diffs)).substring(l.length-this.Patch_Margin);var u=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==u&&(s.length1+=u.length,s.length2+=u.length,0!==s.diffs.length&&0===s.diffs[s.diffs.length-1][0]?s.diffs[s.diffs.length-1][1]+=u:s.diffs.push(new t.Diff(0,u))),c||e.splice(++r,0,s)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var n=[];if(!e)return n;for(var r=e.split("\n"),o=0,i=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<r.length;){var a=r[o].match(i);if(!a)throw new Error("Invalid patch string: "+r[o]);var l=new t.patch_obj;for(n.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),o++;o<r.length;){var s=r[o].charAt(0);try{var c=decodeURI(r[o].substring(1))}catch(e){throw new Error("Illegal escape in patch_fromText: "+c)}if("-"==s)l.diffs.push(new t.Diff(-1,c));else if("+"==s)l.diffs.push(new t.Diff(1,c));else if(" "==s)l.diffs.push(new t.Diff(0,c));else{if("@"==s)break;if(""!==s)throw new Error('Invalid patch mode "'+s+'" in: '+c)}o++}}return n},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],n=0;n<this.diffs.length;n++){switch(this.diffs[n][0]){case 1:e="+";break;case-1:e="-";break;case 0:e=" "}t[n+1]=e+encodeURI(this.diffs[n][1])+"\n"}return t.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},664:(e,t,n)=>{"use strict";n.d(t,{default:()=>N});var r=n(386),o=n(781),i=n(379),a=n(895),l=n(169),s=n(572),c=n(702),d=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",(function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src})),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach((function(e){e.getAttribute("data-src")&&t(e)})),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)}))):(window.vditorImageIntersectionObserver=new IntersectionObserver((function(e){e.forEach((function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)}))})),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)})))},p=n(982),u=n(431),f=n(570),m=n(593),v=n(558),h=n(182),g=n(931),b=n(793),y=n(652),w=n(998),E=n(118),k=n(2),x=n(65),S=n(307),_=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var n=function(){var e,n;return speechSynthesis.getVoices().forEach((function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)})),e||(e=n),e},r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',o='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',o='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var i=document.querySelector(".vditor-speech");i||((i=document.createElement("button")).className="vditor-speech",e.insertAdjacentElement("beforeend",i),void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=n));var a=n(),l=new SpeechSynthesisUtterance;l.voice=a,l.onend=l.onerror=function(){i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r},e.addEventListener(void 0!==window.ontouchstart?"touchend":"click",(function(t){var n=t.target;if(n.classList.contains("vditor-speech")||n.parentElement.classList.contains("vditor-speech"))return i.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=o):(speechSynthesis.pause(),i.innerHTML=r)):(l.text=i.getAttribute("data-text"),speechSynthesis.speak(l),i.classList.add("vditor-speech--current"),i.innerHTML=o),(0,S.Hc)(window.vditorSpeechRange),void e.focus();if(i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r,0!==getSelection().rangeCount){var a=getSelection().getRangeAt(0),s=a.toString().trim();if(s){window.vditorSpeechRange=a.cloneRange();var c=a.getBoundingClientRect();i.innerHTML=r,i.style.display="block",i.style.top=c.top+c.height+document.querySelector("html").scrollTop-20+"px",void 0!==window.ontouchstart?i.style.left=t.changedTouches[t.changedTouches.length-1].pageX+2+"px":i.style.left=t.clientX+2+"px",i.setAttribute("data-text",s)}}}))}},L=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))},T=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},C=function(e){var t,n={anchor:0,cdn:b.g.CDN,customEmoji:{},emojiPath:"".concat(b.g.CDN,"/dist/images/emoji"),hljs:b.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:b.g.MARKDOWN_OPTIONS,math:b.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:b.g.THEME_OPTIONS};return e.cdn&&((null===(t=e.theme)||void 0===t?void 0:t.path)||(n.theme.path="".concat(e.cdn,"/dist/css/content-theme")),e.emojiPath||(n.emojiPath="".concat(e.cdn,"/dist/images/emoji"))),(0,k.T)(n,e)},A=function(e,t){var n=C(t);return(0,w.G)("".concat(n.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then((function(){var r=(0,x.X)({autoSpace:n.markdown.autoSpace,gfmAutoLink:n.markdown.gfmAutoLink,codeBlockPreview:n.markdown.codeBlockPreview,emojiSite:n.emojiPath,emojis:n.customEmoji,fixTermTypo:n.markdown.fixTermTypo,footnotes:n.markdown.footnotes,headingAnchor:0!==n.anchor,inlineMathDigit:n.math.inlineDigit,lazyLoadImage:n.lazyLoadImage,linkBase:n.markdown.linkBase,linkPrefix:n.markdown.linkPrefix,listStyle:n.markdown.listStyle,mark:n.markdown.mark,mathBlockPreview:n.markdown.mathBlockPreview,paragraphBeginningSpace:n.markdown.paragraphBeginningSpace,sanitize:n.markdown.sanitize,toc:n.markdown.toc});return(null==t?void 0:t.renderers)&&r.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),r.SetHeadingID(!0),r.Md2HTML(e)}))},M=function(e,t,n){return L(void 0,void 0,void 0,(function(){var o,h,b;return T(this,(function(k){switch(k.label){case 0:return o=C(n),[4,A(t,o)];case 1:if(h=k.sent(),o.transform&&(h=o.transform(h)),e.innerHTML=h,e.classList.add("vditor-reset"),o.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(o.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return b="vditorI18nScript"+o.lang,document.querySelectorAll('head script[id^="'.concat("vditorI18nScript",'"]')).forEach((function(e){e.id!==b&&document.head.removeChild(e)})),[4,(0,w.G)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),b)];case 3:k.sent(),k.label=4;case 4:return[3,6];case 5:window.VditorI18n=o.i18n,k.label=6;case 6:return o.icon?[4,(0,w.G)("".concat(o.cdn,"/dist/js/icons/").concat(o.icon,".js"),"vditorIconScript")]:[3,8];case 7:k.sent(),k.label=8;case 8:return(0,y.Z)(o.theme.current,o.theme.path),1===o.anchor&&e.classList.add("vditor-reset--anchor"),(0,a.O)(e,o.hljs),(0,c.s)(o.hljs,e,o.cdn),(0,p.H)(e,{cdn:o.cdn,math:o.math}),(0,f.i)(e,o.cdn,o.mode),(0,m.K)(e,o.cdn,o.mode),(0,l.P)(e,o.cdn),(0,s.v)(e,o.cdn),(0,i.p)(e,o.cdn,o.mode),(0,v.P)(e,o.cdn,o.mode),(0,g.B)(e,o.cdn),(0,r.Q)(e,o.cdn),o.render.media.enable&&(0,u.Y)(e),o.speech.enable&&_(e),0!==o.anchor&&(x=o.anchor,document.querySelectorAll(".vditor-anchor").forEach((function(e){1===x&&e.classList.add("vditor-anchor--left"),e.onclick=function(){var t=e.getAttribute("href").substr(1),n=document.getElementById("vditorAnchor-"+t).offsetTop;document.querySelector("html").scrollTop=n}})),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),o.after&&o.after(),o.lazyLoadImage&&d(e),e.addEventListener("click",(function(t){var n=(0,E.lG)(t.target,"SPAN");if(n&&(0,E.fb)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop)}})),[2]}var x}))}))},H=n(971),O=n(34);const N=function(){function e(){}return e.adapterRender=o,e.previewImage=H.E,e.codeRender=a.O,e.graphvizRender=s.v,e.highlightRender=c.s,e.mathRender=p.H,e.mermaidRender=f.i,e.markmapRender=m.K,e.flowchartRender=l.P,e.chartRender=i.p,e.abcRender=r.Q,e.mindmapRender=v.P,e.plantumlRender=g.B,e.outlineRender=h.k,e.mediaRender=u.Y,e.speechRender=_,e.lazyLoadImageRender=d,e.md2html=A,e.preview=M,e.setCodeTheme=O.Y,e.setContentTheme=y.Z,e}()},793:(e,t,n)=>{"use strict";n.d(t,{H:()=>r,g:()=>o});var r="3.10.5",o=function(){function e(){}return e.ZWSP="",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.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"],e.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"],e.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"],e.CDN="https://unpkg.com/vditor@".concat("3.10.5"),e.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},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:"".concat(e.CDN,"/dist/css/content-theme")},e}()},386:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var r=n(793),o=n(998),i=n(781),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.abcRenderAdapter.getElements(e);n.length>0&&(0,o.G)("".concat(t,"/dist/js/abcjs/abcjs_basic.min.js"),"vditorAbcjsScript").then((function(){n.forEach((function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,i.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))}))}))}},781:(e,t,n)=>{"use strict";n.r(t),n.d(t,{abcRenderAdapter:()=>s,chartRenderAdapter:()=>l,flowchartRenderAdapter:()=>d,graphvizRenderAdapter:()=>c,markmapRenderAdapter:()=>i,mathRenderAdapter:()=>r,mermaidRenderAdapter:()=>o,mindmapRenderAdapter:()=>a,plantumlRenderAdapter:()=>p});var r={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},o={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-markmap")}},a={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},l={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},s={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},p={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},379:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(793),o=n(998),i=n(781),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=i.chartRenderAdapter.getElements(e);a.length>0&&(0,o.G)("".concat(t,"/dist/js/echarts/echarts.min.js"),"vditorEchartsScript").then((function(){a.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.chartRenderAdapter.getCode(e).trim();if(t)try{if("true"===e.getAttribute("data-processed"))return;var r=JSON.parse(t);echarts.init(e,"dark"===n?"dark":void 0).setOption(r),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>".concat(t)}}}))}))}},895:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(528),o=n(793),i=function(e,t){Array.from(e.querySelectorAll("pre > code")).filter((function(t,n){return!(t.parentElement.classList.contains("vditor-wysiwyg__pre")||t.parentElement.classList.contains("vditor-ir__marker--pre")||t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-markmap")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math")||t.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&n>5)})).forEach((function(e){var n,i,a,l=e.innerText;if(e.classList.contains("highlight-chroma")){var s=e.cloneNode(!0);s.querySelectorAll(".highlight-ln").forEach((function(e){e.remove()})),l=s.innerText}else l.endsWith("\n")&&(l=l.substr(0,l.length-1));var c='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(c='<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 d=document.createElement("div");d.className="vditor-copy",d.innerHTML='<span aria-label="'.concat((null===(n=window.VditorI18n)||void 0===n?void 0:n.copy)||"复制","\"\nonmouseover=\"this.setAttribute('aria-label', '").concat((null===(i=window.VditorI18n)||void 0===i?void 0:i.copy)||"复制","')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '").concat((null===(a=window.VditorI18n)||void 0===a?void 0:a.copied)||"已复制","');this.previousElementSibling.blur()\">").concat(c,"</span>");var p=document.createElement("textarea");p.value=(0,r.X)(l),d.insertAdjacentElement("afterbegin",p),t&&t.renderMenu&&t.renderMenu(e,d),e.before(d),e.style.maxHeight=window.outerHeight-40+"px",e.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(o.g.ZWSP,"</span>"))}))}},169:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(793),o=n(998),i=n(781),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.flowchartRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then((function(){n.forEach((function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(i.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}}))}))}},572:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var r=n(793),o=n(998),i=n(781),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.graphvizRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then((function(){n.forEach((function(e){var t=i.graphvizRenderAdapter.getCode(e);if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var n=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),r=(window.URL||window.webkitURL).createObjectURL(n),o=new Worker(r);new Viz({worker:o}).renderSVGElement(t).then((function(t){e.innerHTML=t.outerHTML})).catch((function(t){e.innerHTML="graphviz render error: <br>".concat(t),e.className="vditor-reset--error"}))}catch(e){console.error("graphviz error",e)}e.setAttribute("data-processed","true")}}))}))}},702:(e,t,n)=>{"use strict";n.d(t,{s:()=>a});var r=n(793),o=n(998),i=n(296),a=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.g.CDN);var a=e.style;r.g.CODE_THEME.includes(a)||(a="github");var l=document.getElementById("vditorHljsStyle"),s="".concat(n,"/dist/js/highlight.js/styles/").concat(a,".css");l&&l.getAttribute("href")!==s&&l.remove(),(0,i.c)("".concat(n,"/dist/js/highlight.js/styles/").concat(a,".css"),"vditorHljsStyle"),!1!==e.enable&&0!==t.querySelectorAll("pre > code").length&&(0,o.G)("".concat(n,"/dist/js/highlight.js/highlight.pack.js"),"vditorHljsScript").then((function(){(0,o.G)("".concat(n,"/dist/js/highlight.js/solidity.min.js"),"vditorHljsSolidityScript").then((function(){(0,o.G)("".concat(n,"/dist/js/highlight.js/yul.min.js"),"vditorHljsYulScript").then((function(){t.querySelectorAll("pre > code").forEach((function(t){if(!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))&&(""!==e.defaultLang&&-1===t.className.indexOf("language-")&&t.classList.add("language-"+e.defaultLang),hljs.highlightElement(t),e.lineNumber)){t.classList.add("vditor-linenumber");var n=t.querySelector(".vditor-linenumber__temp");n||((n=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",n));var r=getComputedStyle(t).whiteSpace,o=!1;"pre-wrap"!==r&&"pre-line"!==r||(o=!0);var i="",a=t.textContent.split(/\r\n|\r|\n/g);a.pop(),a.map((function(e){var t="";o&&(n.textContent=e||"\n",t=' style="height:'.concat(n.getBoundingClientRect().height,'px"')),i+="<span".concat(t,"></span>")})),n.style.display="none",i='<span class="vditor-linenumber__rows">'.concat(i,"</span>"),t.insertAdjacentHTML("beforeend",i)}}))}))}))}))}},593:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(793),o=n(998),i=n(781),a={},l=function(e,t){var n=window.markmap,r=n.Transformer,o=n.Markmap,i=n.deriveOptions,l=(n.globalCSS,new r);e.innerHTML='<svg style="width:100%"></svg>';var s=e.firstChild,c=o.create(s,null),d=function(e,t){var n=e.transform(t),r=Object.keys(n.features).filter((function(e){return!a[e]}));r.forEach((function(e){a[e]=!0}));var o=e.getAssets(r),i=o.styles,l=o.scripts,s=window.markmap;return i&&s.loadCSS(i),l&&s.loadJS(l),n}(l,t),p=d.root,u=d.frontmatter,f=i(null==u?void 0:u.markmap);c.setData(p,f),c.fit()},s=function(e,t,n){void 0===t&&(t=r.g.CDN);var a=i.markmapRenderAdapter.getElements(e);0!==a.length&&(0,o.G)("".concat(t,"/dist/js/markmap/markmap.min.js"),"vditorMermaidScript").then((function(){a.forEach((function(e){var t=i.markmapRenderAdapter.getCode(e);if("true"!==e.getAttribute("data-processed")&&""!==t.trim()){var n=document.createElement("div");n.className="language-markmap",e.parentNode.appendChild(n),l(n,t),"CODE"==e.parentNode.childNodes[0].nodeName&&e.parentNode.removeChild(e.parentNode.childNodes[0])}}))}))}},982:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});var r=n(793),o=n(998),i=n(296),a=n(528),l=n(781),s=function(e,t){var n=l.mathRenderAdapter.getElements(e);if(0!==n.length){var s={cdn:r.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},s.math,t.math)),"KaTeX"===(t=Object.assign({},s,t)).math.engine)(0,i.c)("".concat(t.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,o.G)("".concat(t.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then((function(){(0,o.G)("".concat(t.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then((function(){n.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&!e.getAttribute("data-math")){var n=(0,a.X)(l.mathRenderAdapter.getCode(e));e.setAttribute("data-math",n);try{e.innerHTML=katex.renderToString(n,{displayMode:"DIV"===e.tagName,output:"html",macros:t.math.macros})}catch(t){e.innerHTML=t.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",(function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))}))}}))}))}));else if("MathJax"===t.math.engine){window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(t.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:t.math.macros}},Object.assign(window.MathJax,t.math.mathJaxOptions)),(0,o.J)("".concat(t.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var c=function(e,t){var n=(0,a.X)(e.textContent).trim(),r=window.MathJax.getMetricsFor(e);r.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(n,r).then((function(r){e.innerHTML="",e.setAttribute("data-math",n),e.append(r),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var o=r.querySelector('[data-mml-node="merror"]');o&&""!==o.textContent.trim()&&(e.innerHTML=o.textContent.trim(),e.className="vditor-reset--error"),t&&t()}))};window.MathJax.startup.promise.then((function(){for(var e=[],t=function(t){var r=n[t];r.parentElement.classList.contains("vditor-wysiwyg__pre")||r.parentElement.classList.contains("vditor-ir__marker--pre")||r.getAttribute("data-math")||!(0,a.X)(r.textContent).trim()||e.push((function(e){t===n.length-1?c(r):c(r,e)}))},r=0;r<n.length;r++)t(r);!function(e){if(0!==e.length){var t=0,n=e[e.length-1],r=function(){var o=e[t++];o===n?o():o(r)};r()}}(e)}))}}}},431:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(446),o=function(e){e&&e.querySelectorAll("a").forEach((function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(t,'"></video>')),e.remove()}(e,t):t.match(/^.+.(mp3|wav|flac)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'.concat(t,'"></audio>')),e.remove()}(e,t):function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),o=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),a=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),l=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),c=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),d=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(n&&11===n[1].length)e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'.concat(n[1]+(n[2]?"?start="+n[2]:""),'"></iframe>')),e.remove();else if(o&&o[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'.concat(o[1],'"></iframe>')),e.remove();else if(i&&i[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='.concat(i[1],'"></iframe>')),e.remove();else if(a&&a[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'.concat(a[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),e.remove();else if(l&&l[0])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='.concat(encodeURIComponent(l[0]),'"></iframe>')),e.remove();else if(s&&s[2])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'.concat(s[2],'"></iframe>')),e.remove();else if(t.indexOf("bilibili.com")>-1&&(t.indexOf("bvid=")>-1||c&&c[1])){var p={bvid:(0,r.o)("bvid",t)||c&&c[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(t.startsWith("http")?t:"https:"+t).search.split("&").forEach((function(e,t){if(e){0===t&&(e=e.substr(1));var n=e.split("=");p[n[0]]=n[1]}}));var u="https://player.bilibili.com/player.html?",f=Object.keys(p);f.forEach((function(e,t){u+="".concat(e,"=").concat(p[e]),t<f.length-1&&(u+="&")})),e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(u,'"></iframe>')),e.remove()}else d&&d[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(d[1],'"></iframe>')),e.remove())}(e,t))}))}},570:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var r=n(793),o=n(998),i=n(781),a=n(446),l=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))},s=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},c=function(e,t,n){void 0===t&&(t=r.g.CDN);var c=i.mermaidRenderAdapter.getElements(e);0!==c.length&&(0,o.G)("".concat(t,"/dist/js/mermaid/mermaid.min.js"),"vditorMermaidScript").then((function(){var e={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};"dark"===n&&(e.theme="dark"),mermaid.initialize(e),c.forEach((function(e){return l(void 0,void 0,void 0,(function(){var t,n,r,o,l;return s(this,(function(s){switch(s.label){case 0:if(t=i.mermaidRenderAdapter.getCode(e),"true"===e.getAttribute("data-processed")||""===t.trim())return[2];n="mermaid"+(0,a.W)(),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,mermaid.render(n,e.textContent)];case 2:return r=s.sent(),e.innerHTML=r.svg,[3,4];case 3:return o=s.sent(),l=document.querySelector("#"+n),e.innerHTML="".concat(l.outerHTML,'<br>\n<div style="text-align: left"><small>').concat(o.message.replace(/\n/,"<br>"),"</small></div>"),l.parentElement.remove(),[3,4];case 4:return e.setAttribute("data-processed","true"),[2]}}))}))}))}))}},558:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(793),o=n(998),i=n(781),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=i.mindmapRenderAdapter.getElements(e);a.length>0&&(0,o.G)("".concat(t,"/dist/js/echarts/echarts.min.js"),"vditorEchartsScript").then((function(){a.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.mindmapRenderAdapter.getCode(e);if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===n?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(e,t){var n;return(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>".concat(t)}}}))}))}},182:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=n(946),o=n(982),i=function(e,t,n){var i="",a=[];if(Array.from(e.children).forEach((function(e,t){if((0,r.W)(e)){if(n){var o=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===o?void 0:o)+"_"+t}a.push(e.id),i+=e.outerHTML.replace("<wbr>","")}})),""===i)return t.innerHTML="","";var l=document.createElement("div");if(n)n.lute.SetToC(!0),"wysiwyg"!==n.currentMode||n.preview.element.contains(e)?"ir"!==n.currentMode||n.preview.element.contains(e)?l.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+i),n.lute.SetToC(n.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var s=Lute.New();s.SetToC(!0),l.innerHTML=s.HTML2VditorDOM("<p>[ToC]</p>"+i)}var c=l.firstElementChild.querySelectorAll("li > span[data-target-id]");return c.forEach((function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var n="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(n='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML="".concat(n,"<span>").concat(e.innerHTML,"</span>")}else e.innerHTML="<svg></svg><span>".concat(e.innerHTML,"</span>");e.setAttribute("data-target-id",a[t])})),i=l.firstElementChild.innerHTML,0===c.length?(t.innerHTML="",i):(t.innerHTML=i,n&&(0,o.H)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",(function(r){for(var o=r.target;o&&!o.isEqualNode(t);){if(o.classList.contains("vditor-outline__action")){o.classList.contains("vditor-outline__action--close")?(o.classList.remove("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:block")):(o.classList.add("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(o.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var i=document.getElementById(o.getAttribute("data-target-id"));if(!i)return;if(n)if("auto"===n.options.height){var a=i.offsetTop+n.element.offsetTop;n.options.toolbarConfig.pin||(a+=n.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,a)}else n.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,n.element.offsetTop),n.preview.element.contains(e)?e.parentElement.scrollTop=i.offsetTop:e.scrollTop=i.offsetTop;else window.scrollTo(window.scrollX,i.offsetTop);break}o=o.parentElement}})),i)}},931:(e,t,n)=>{"use strict";n.d(t,{B:()=>a});var r=n(793),o=n(998),i=n(781),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.plantumlRenderAdapter.getElements(e);0!==n.length&&(0,o.G)("".concat(t,"/dist/js/plantuml/plantuml-encoder.min.js"),"vditorPlantumlScript").then((function(){n.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'.concat(plantumlEncoder.encode(t),'"/>')}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>".concat(t)}}}))}))}},65:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),t.SetGFMAutoLink(e.gfmAutoLink),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},971:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});var r=function(e,t,n){void 0===t&&(t="zh_CN"),void 0===n&&(n="classic");var r=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'.concat("dark"===n?" vditor--dark":"",'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n ').concat(window.VditorI18n.spin,"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X ").concat(window.VditorI18n.close,'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: ').concat(e.width,"px;height:").concat(e.height,"px;transform: translate3d(").concat(r.left,"px, ").concat(r.top-36,'px, 0)" src="').concat(e.getAttribute("src"),'">\n </div>\n</div>')),document.body.style.overflow="hidden";var o=document.querySelector(".vditor-img img"),i="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-36-e.naturalHeight)/2,"px, 0)");setTimeout((function(){o.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(i)),setTimeout((function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)}),400)}));var a=document.querySelector(".vditor-img__btn");a.addEventListener("click",(function(){var t=parseInt(a.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>o.parentElement.clientHeight?o.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(e.naturalWidth/2-e.naturalHeight/2,"px, 0) rotateZ(").concat(t,"deg)"):o.style.transform="".concat(i," rotateZ(").concat(t,"deg)"),a.setAttribute("data-deg",t.toString()),setTimeout((function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)}),400)}))}},34:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(793),o=n(296),i=function(e,t){void 0===t&&(t=r.g.CDN),r.g.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),i="".concat(t,"/dist/js/highlight.js/styles/").concat(e,".css");n?n.getAttribute("href")!==i&&(n.remove(),(0,o.c)(i,"vditorHljsStyle")):(0,o.c)(i,"vditorHljsStyle")}},652:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(296),o=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),o="".concat(t,"/").concat(e,".css");n?n.getAttribute("href")!==o&&(n.remove(),(0,r.c)(o,"vditorContentTheme")):(0,r.c)(o,"vditorContentTheme")}}},998:(e,t,n)=>{"use strict";n.d(t,{G:()=>o,J:()=>r});var r=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest;n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send("");var r=document.createElement("script");r.type="text/javascript",r.text=n.responseText,r.id=t,document.head.appendChild(r)},o=function(e,t){return new Promise((function(n,r){if(document.getElementById(t))return n(!0),!1;var o=document.createElement("script");o.src=e,o.async=!0,document.head.appendChild(o),o.onerror=function(e){r(e)},o.onload=function(){if(document.getElementById(t))return o.remove(),n(!0),!1;o.id=t,n(!0)}}))}},296:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var r=function(e,t){if(!document.getElementById(t)){var n=document.createElement("link");n.id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n)}}},528:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){return e.replace(/\u00a0/g," ")}},796:(e,t,n)=>{"use strict";n.d(t,{G6:()=>r,Le:()=>a,i7:()=>c,ns:()=>s,pK:()=>i,vU:()=>o,yl:()=>l});var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},o=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},i=function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}},a=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},l=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!e.metaKey||e.ctrlKey):!(e.metaKey||!e.ctrlKey)},s=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?e.indexOf("⇧")>-1&&o()&&(e=e.replace(";",":").replace("=","+").replace("-","_")):(e=(e=e.startsWith("⌘")?e.replace("⌘","⌘+"):e.startsWith("⌥")&&"⌘"!==e.substr(1,1)?e.replace("⌥","⌥+"):e.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(e=e.replace(";",":").replace("=","+").replace("-","_")),e},c=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},446:(e,t,n)=>{"use strict";n.d(t,{W:()=>r,o:()=>o});var r=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(parseInt(e,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(e,10)/4).toString(16)}))},o=function(e,t){void 0===t&&(t=window.location.search);var n=t.substring(t.indexOf("?")),r=n.indexOf("#");return new URLSearchParams(n.substring(0,r>=0?r:void 0)).get(e)}},118:(e,t,n)=>{"use strict";n.d(t,{DX:()=>p,E2:()=>i,F9:()=>s,JQ:()=>o,O9:()=>a,a1:()=>l,fb:()=>d,lG:()=>c});var r=n(946),o=function(e,t){for(var n=d(e,t),r=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(r=d(n.parentElement,t))?n=r:o=!0;return n||!1},i=function(e,t){for(var n=(0,r.S)(e,t),o=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(o=(0,r.S)(n.parentElement,t))?n=o:i=!0;return n||!1},a=function(e){var t=i(e,"UL"),n=i(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},l=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,o=!1;r&&!o&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?o=!0:r=r.parentElement;return o&&r},s=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=l(e,"data-block","0");if(r)return r;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},c=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.nodeName===t?r=!0:n=n.parentElement;return r&&n},d=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},p=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},946:(e,t,n)=>{"use strict";n.d(t,{S:()=>r,W:()=>o});var r=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?r=!0:n=n.parentElement;return r&&n},o=function(e){var t=r(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},2:(e,t,n)=>{"use strict";n.d(t,{T:()=>r});var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},o=function(e){for(var t in e)e.hasOwnProperty(t)&&("[object Object]"===Object.prototype.toString.call(e[t])?n[t]=r(n[t],e[t]):n[t]=e[t])},i=0;i<e.length;i++)o(e[i]);return n}},307:(e,t,n)=>{"use strict";n.d(t,{$j:()=>p,Gb:()=>s,Hc:()=>c,Ny:()=>l,ib:()=>u,im:()=>d,oC:()=>f,zh:()=>a});var r=n(793),o=n(796),i=n(118),a=function(e){var t,n=e[e.currentMode].element;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),n.isEqualNode(t.startContainer)||n.contains(t.startContainer))?t:e[e.currentMode].range?e[e.currentMode].range:(n.focus(),(t=n.ownerDocument.createRange()).setStart(n,0),t.collapse(!0),t)},l=function(e){var t=window.getSelection().getRangeAt(0);if(!e.contains(t.startContainer)&&!(0,i.fb)(t.startContainer,"vditor-panel--none"))return{left:0,top:0};var n,r=e.parentElement.getBoundingClientRect();if(0===t.getClientRects().length)if(3===t.startContainer.nodeType){var o=t.startContainer.parentElement;if(!(o&&o.getClientRects().length>0))return{left:0,top:0};n=o.getClientRects()[0]}else{var a=t.startContainer.children;if(a[t.startOffset]&&a[t.startOffset].getClientRects().length>0)n=a[t.startOffset].getClientRects()[0];else if(t.startContainer.childNodes.length>0){var l=t.cloneRange();t.selectNode(t.startContainer.childNodes[Math.max(0,t.startOffset-1)]),n=t.getClientRects()[0],t.setEnd(l.endContainer,l.endOffset),t.setStart(l.startContainer,l.startOffset)}else n=t.startContainer.getClientRects()[0];if(!n){for(var s=t.startContainer.childNodes[t.startOffset];!s.getClientRects||s.getClientRects&&0===s.getClientRects().length;)s=s.parentElement;n=s.getClientRects()[0]}}else n=t.getClientRects()[0];return{left:n.left-r.left,top:n.top-r.top}},s=function(e,t){if(!t){if(0===getSelection().rangeCount)return!1;t=getSelection().getRangeAt(0)}var n=t.commonAncestorContainer;return e.isEqualNode(n)||e.contains(n)},c=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},d=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(s(t,n)){var o=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?o.setStart(e.childNodes[0].childNodes[0],0):o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),r.start=o.toString().length,r.end=r.start+n.toString().length}return r},p=function(e,t,n){var r=0,o=0,i=n.childNodes[o],a=!1,l=!1;e=Math.max(0,e),t=Math.max(0,t);var s=n.ownerDocument.createRange();for(s.setStart(i||n,0),s.collapse(!0);!l&&i;){var d=r+i.textContent.length;if(!a&&e>=r&&e<=d&&(0===e?s.setStart(i,0):3===i.childNodes[0].nodeType?s.setStart(i.childNodes[0],e-r):i.nextSibling?s.setStartBefore(i.nextSibling):s.setStartAfter(i),a=!0,e===t)){l=!0;break}a&&t>=r&&t<=d&&(0===t?s.setEnd(i,0):3===i.childNodes[0].nodeType?s.setEnd(i.childNodes[0],t-r):i.nextSibling?s.setEndBefore(i.nextSibling):s.setEndAfter(i),l=!0),r=d,i=n.childNodes[++o]}return!l&&n.childNodes[o-1]&&s.setStartBefore(n.childNodes[o-1]),c(s),s},u=function(e,t){var n=e.querySelector("wbr");if(n){if(n.previousElementSibling)if(n.previousElementSibling.isSameNode(n.previousSibling)){if(n.previousElementSibling.lastChild)return t.setStartBefore(n),t.collapse(!0),c(t),!(0,o.i7)()||"EM"!==n.previousElementSibling.tagName&&"STRONG"!==n.previousElementSibling.tagName&&"S"!==n.previousElementSibling.tagName||(t.insertNode(document.createTextNode(r.g.ZWSP)),t.collapse(!1)),void n.remove();t.setStartAfter(n.previousElementSibling)}else t.setStart(n.previousSibling,n.previousSibling.textContent.length);else n.previousSibling?t.setStart(n.previousSibling,n.previousSibling.textContent.length):n.nextSibling?3===n.nextSibling.nodeType?t.setStart(n.nextSibling,0):t.setStartBefore(n.nextSibling):t.setStart(n.parentElement,0);t.collapse(!0),n.remove(),c(t)}},f=function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.querySelectorAll("p");1===r.length&&!r[0].previousSibling&&!r[0].nextSibling&&t[t.currentMode].element.children.length>0&&"P"===n.firstElementChild.tagName&&(e=r[0].innerHTML.trim());var o=document.createElement("div");o.innerHTML=e;var l=a(t);if(""!==l.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),o.firstElementChild&&"0"===o.firstElementChild.getAttribute("data-block")){o.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var s=(0,i.F9)(l.startContainer);s?s.insertAdjacentHTML("afterend",o.innerHTML):t[t.currentMode].element.insertAdjacentHTML("beforeend",o.innerHTML),u(t[t.currentMode].element,l)}else{var d=document.createElement("template");d.innerHTML=e,l.insertNode(d.content.cloneNode(!0)),l.collapse(!1),c(l)}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>Zn});var e,t=n(664),o=n(793),i=n(528),a=function(e){return"sv"===e.currentMode?(0,i.X)("".concat(e.sv.element.textContent,"\n").replace(/\n\n$/,"\n")):"wysiwyg"===e.currentMode?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},l=n(998),s=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(e){var t=this;"block"===e.devtools.element.style.display&&(0,l.G)("".concat(e.options.cdn,"/dist/js/echarts/echarts.min.js"),"vditorEchartsScript").then((function(){t.ASTChart||(t.ASTChart=echarts.init(e.devtools.element.lastElementChild));try{t.element.lastElementChild.style.display="block",t.element.firstElementChild.innerHTML="",t.ASTChart.setOption({series:[{data:JSON.parse(e.lute.RenderEChartsJSON(a(e))),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}}),t.ASTChart.resize()}catch(e){t.element.lastElementChild.style.display="none",t.element.firstElementChild.innerHTML=e}}))},e}(),c=n(796),d=function(e,t){t.forEach((function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains("vditor-menu--current")&&n.classList.remove("vditor-menu--current")}}))},p=function(e,t){t.forEach((function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains("vditor-menu--current")&&n.classList.add("vditor-menu--current")}}))},u=function(e,t){t.forEach((function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains(o.g.CLASS_MENU_DISABLED)&&n.classList.remove(o.g.CLASS_MENU_DISABLED)}}))},f=function(e,t){t.forEach((function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains(o.g.CLASS_MENU_DISABLED)&&n.classList.add(o.g.CLASS_MENU_DISABLED)}}))},m=function(e,t){t.forEach((function(t){e[t]&&e[t]&&(e[t].style.display="none")}))},v=function(e,t){t.forEach((function(t){e[t]&&e[t]&&(e[t].style.display="block")}))},h=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach((function(e){n&&e.isEqualNode(n)||(e.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")},g=function(e,t,n,r){n.addEventListener((0,c.Le)(),(function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach((function(e){e.classList.remove("vditor-hint--current")})),"block"===t.style.display?t.style.display="none":(h(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")))}))},b=n(118),y=n(946),w=function(e,t,n,r){r&&console.log("".concat(e," - ").concat(n,": ").concat(t))},E=n(386),k=n(379),x=n(895),S=n(169),_=n(572),L=n(702),T=n(982),C=n(570),A=n(593),M=n(558),H=n(931),O=function(e,t){if(e)if("html-block"!==e.parentElement.getAttribute("data-type")){var n=e.firstElementChild.className.replace("language-","");"abc"===n?(0,E.Q)(e,t.options.cdn):"mermaid"===n?(0,C.i)(e,t.options.cdn,t.options.theme):"markmap"===n?(0,A.K)(e,t.options.cdn,t.options.theme):"flowchart"===n?(0,S.P)(e,t.options.cdn):"echarts"===n?(0,k.p)(e,t.options.cdn,t.options.theme):"mindmap"===n?(0,M.P)(e,t.options.cdn,t.options.theme):"plantuml"===n?(0,H.B)(e,t.options.cdn):"graphviz"===n?(0,_.v)(e,t.options.cdn):"math"===n?(0,T.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find((function(r){if(r.language===n)return r.render(e,t),!0}))||((0,L.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,x.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")},N=n(307),D=function(e){if("sv"!==e.currentMode){var t=e[e.currentMode].element,n=e.outline.render(e);""===n&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach((function(t){t.innerHTML=n,(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}))}},I=function(e,t){var n=(0,b.lG)(e.target,"SPAN");if(n&&(0,b.fb)(n,"vditor-toc")){var r=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(r)if("auto"===t.options.height){var o=r.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(o+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,o)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=r.offsetTop}},j=function(e,t,n,r){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if("Backspace"===n.key&&0===(0,N.im)(e,t[t.currentMode].element,r).start)return e.previousElementSibling.remove(),dt(t),!0;if(rt(t,n,r,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if("Delete"===n.key&&(0,N.im)(e,t[t.currentMode].element,r).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),dt(t),!0;if(nt(t,n,r,e,e.nextElementSibling))return!0}if("Backspace"===n.key||"Delete"===n.key){var o=(0,b.fb)(r.startContainer,"vditor-toc");if(o)return o.remove(),dt(t),!0}},R=function(e,t,n,r){void 0===n&&(n=!1);var i=(0,b.F9)(t.startContainer);if(i&&!n&&"code-block"!==i.getAttribute("data-type")){if(st(i.innerHTML)&&i.previousElementSibling||ct(i.innerHTML))return;for(var l=(0,N.im)(i,e.ir.element,t).start,s=!0,c=l-1;c>i.textContent.substr(0,l).lastIndexOf("\n");c--)if(" "!==i.textContent.charAt(c)&&"\t"!==i.textContent.charAt(c)){s=!1;break}0===l&&(s=!1);var d=!0;for(c=l-1;c<i.textContent.length;c++)if(" "!==i.textContent.charAt(c)&&"\n"!==i.textContent.charAt(c)){d=!1;break}if(s)return void("function"==typeof e.options.input&&e.options.input(a(e)));if(d&&!(0,b.fb)(t.startContainer,"vditor-ir__marker")){var p=t.startContainer.previousSibling;return p&&3!==p.nodeType&&p.classList.contains("vditor-ir__node--expand")&&p.classList.remove("vditor-ir__node--expand"),void("function"==typeof e.options.input&&e.options.input(a(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach((function(e){e.classList.remove("vditor-ir__node--expand")})),i||(i=e.ir.element),!i.querySelector("wbr")){var u=(0,b.fb)(t.startContainer,"vditor-ir__preview");u?u.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}i.querySelectorAll("[style]").forEach((function(e){e.removeAttribute("style")})),"link-ref-defs-block"===i.getAttribute("data-type")&&(i=e.ir.element);var f,m=i.isEqualNode(e.ir.element),v=(0,b.a1)(i,"data-type","footnotes-block"),h="";if(m)h=i.innerHTML;else{var g=(0,y.S)(t.startContainer,"BLOCKQUOTE"),E=(0,b.O9)(t.startContainer);if(E&&(i=E),g&&(!E||E&&!g.contains(E))&&(i=g),v&&(i=v),h=i.outerHTML,"UL"===i.tagName||"OL"===i.tagName){var k=i.previousElementSibling,x=i.nextElementSibling;!k||"UL"!==k.tagName&&"OL"!==k.tagName||(h=k.outerHTML+h,k.remove()),!x||"UL"!==x.tagName&&"OL"!==x.tagName||(h+=x.outerHTML,x.remove()),h=h.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else i.previousElementSibling&&""!==i.previousElementSibling.textContent.replace(o.g.ZWSP,"")&&r&&"insertParagraph"===r.inputType&&(h=i.previousElementSibling.outerHTML+h,i.previousElementSibling.remove());i.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach((function(e){e&&!i.isEqualNode(e)&&(h+=e.outerHTML,e.remove())})),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach((function(e){e&&!i.isEqualNode(e)&&(h+=e.outerHTML,e.remove())})))}if(w("SpinVditorIRDOM",h,"argument",e.options.debugger),h=e.lute.SpinVditorIRDOM(h),w("SpinVditorIRDOM",h,"result",e.options.debugger),m)i.innerHTML=h;else if(i.outerHTML=h,v){var S=(0,b.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(S){var _=S.textContent,L=_.substring(1,_.indexOf("]:")),T=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(L,'"]'));T&&T.setAttribute("aria-label",_.substr(L.length+3).trim().substr(0,24))}}var C,A=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");A.forEach((function(e,t){0===t?f=e:(f.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())})),A.length>0&&e.ir.element.insertAdjacentElement("beforeend",A[0]);var M=e.ir.element.querySelectorAll("[data-type='footnotes-block']");M.forEach((function(e,t){0===t?C=e:(C.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())})),M.length>0&&e.ir.element.insertAdjacentElement("beforeend",M[0]),(0,N.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach((function(t){O(t,e)})),D(e),Ct(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},P=function(e,t){if(""===e)return!1;if(-1===e.indexOf("⇧")&&-1===e.indexOf("⌘")&&-1===e.indexOf("⌥"))return!((0,c.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if("⇧Tab"===e)return!((0,c.yl)(t)||t.altKey||!t.shiftKey||"Tab"!==t.code);var n=e.split("");if(e.startsWith("⌥")){var r=3===n.length?n[2]:n[1];return!((3===n.length?!(0,c.yl)(t):(0,c.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(r)?"Digit":"Key")+r)}"⌘Enter"===e&&(n=["⌘","Enter"]);var o=n.length>2&&"⇧"===n[0],i=o?n[2]:n[1];return!o||!(0,c.vU)()&&/Mac/.test(navigator.platform)||("-"===i?i="_":"="===i&&(i="+")),!(!(0,c.yl)(t)||t.key.toLowerCase()!==i.toLowerCase()||t.altKey||!(!o&&!t.shiftKey||o&&t.shiftKey))},q=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach((function(e){e.classList.remove("vditor-ir__node--expand")}));var n=(0,b.JQ)(e.startContainer,"vditor-ir__node"),r=!e.collapsed&&(0,b.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===r){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,N.Hc)(e));var o=function(e){var t=e.startContainer;if(3===t.nodeType&&t.nodeValue.length!==e.startOffset)return!1;for(var n=t.nextSibling;n&&""===n.textContent;)n=n.nextSibling;if(!n){var r=(0,b.fb)(t,"vditor-ir__marker");if(r&&!r.nextSibling){var o=t.parentElement.parentElement.nextSibling;if(o&&3!==o.nodeType&&o.classList.contains("vditor-ir__node"))return o}return!1}return!(!n||3===n.nodeType||!n.classList.contains("vditor-ir__node")||n.getAttribute("data-block"))&&n}(e);if(o)return o.classList.add("vditor-ir__node--expand"),void o.classList.remove("vditor-ir__node--hidden");var i=function(e){var t=e.startContainer,n=t.previousSibling;return!(3!==t.nodeType||0!==e.startOffset||!n||3===n.nodeType||!n.classList.contains("vditor-ir__node")||n.getAttribute("data-block"))&&n}(e);return i?(i.classList.add("vditor-ir__node--expand"),void i.classList.remove("vditor-ir__node--hidden")):void 0}},B=n(971),z=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach((function(e){for(var n=e.parentElement,r=n.nextSibling;r&&r.textContent.startsWith(" ");){var o=r;o.childNodes.forEach((function(e){n.append(e.cloneNode(!0))})),r=r.nextSibling,o.remove()}t&&t(n)}))},U=function(e,t){var n,r=getSelection().getRangeAt(0).cloneRange(),o=r.startContainer;3!==r.startContainer.nodeType&&"DIV"===r.startContainer.tagName&&(o=r.startContainer.childNodes[r.startOffset-1]);var i=(0,b.a1)(o,"data-block","0");if(i&&t&&("deleteContentBackward"===t.inputType||" "===t.data)){for(var a=(0,N.im)(i,e.sv.element,r).start,l=!0,s=a-1;s>i.textContent.substr(0,a).lastIndexOf("\n");s--)if(" "!==i.textContent.charAt(s)&&"\t"!==i.textContent.charAt(s)){l=!1;break}if(0===a&&(l=!1),l)return void je(e);if("deleteContentBackward"===t.inputType){var c=(0,b.a1)(o,"data-type","code-block-open-marker")||(0,b.a1)(o,"data-type","code-block-close-marker");if(c){var d;if("code-block-close-marker"===c.getAttribute("data-type")&&(d=Ne(o,"code-block-open-marker")))return d.textContent=c.textContent,void je(e);if("code-block-open-marker"===c.getAttribute("data-type")&&(d=Ne(o,"code-block-close-marker",!1)))return d.textContent=c.textContent,void je(e)}var p=(0,b.a1)(o,"data-type","math-block-open-marker");if(p){var u=p.nextElementSibling.nextElementSibling;return void(u&&"math-block-close-marker"===u.getAttribute("data-type")&&(u.remove(),je(e)))}i.querySelectorAll('[data-type="code-block-open-marker"]').forEach((function(e){1===e.textContent.length&&e.remove()})),i.querySelectorAll('[data-type="code-block-close-marker"]').forEach((function(e){1===e.textContent.length&&e.remove()}));var f=(0,b.a1)(o,"data-type","heading-marker");if(f&&-1===f.textContent.indexOf("#"))return void je(e)}if((" "===t.data||"deleteContentBackward"===t.inputType)&&((0,b.a1)(o,"data-type","padding")||(0,b.a1)(o,"data-type","li-marker")||(0,b.a1)(o,"data-type","task-marker")||(0,b.a1)(o,"data-type","blockquote-marker")))return void je(e)}if(i&&"$$"===i.textContent.trimRight())je(e);else{i||(i=e.sv.element),"link-ref-defs-block"===(null===(n=i.firstElementChild)||void 0===n?void 0:n.getAttribute("data-type"))&&(i=e.sv.element),(0,b.a1)(o,"data-type","footnotes-link")&&(i=e.sv.element),-1===i.textContent.indexOf(Lute.Caret)&&r.insertNode(document.createTextNode(Lute.Caret)),i.querySelectorAll("[style]").forEach((function(e){e.removeAttribute("style")})),i.querySelectorAll("font").forEach((function(e){e.outerHTML=e.innerHTML}));var m=i.textContent,v=i.isEqualNode(e.sv.element);if(v)m=i.textContent;else{i.previousElementSibling&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove()),i.previousElementSibling&&0===m.indexOf("---\n")&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove());var h="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach((function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())})),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach((function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())})),m=h+m}m=De(m,e),v?i.innerHTML=m:i.outerHTML=m,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach((function(t){e.sv.element.insertAdjacentElement("beforeend",t.parentElement)})),z(e.sv.element,(function(t){e.sv.element.insertAdjacentElement("beforeend",t)})),(0,N.ib)(e.sv.element,r),Ae(e),je(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},V=n(652),W=function(e){"dark"===e.options.theme?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},G=function(e){var t=window.innerWidth<=o.g.MOBILE_WIDTH?10:35;if("none"!==e.wysiwyg.element.parentElement.style.display){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px ".concat(Math.max(t,n),"px")}"none"!==e.ir.element.parentElement.style.display&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px ".concat(Math.max(t,n),"px")),"block"!==e.preview.element.style.display?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+("left"===e.options.outline.position?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+("left"===e.options.outline.position?e.outline.element.offsetWidth:0)+"px"},F=function(e){if(e.options.typewriterMode){var t=window.innerHeight;"number"==typeof e.options.height?(t=e.options.height,"number"==typeof e.options.minHeight&&(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 K(){window.removeEventListener("resize",e)}var Z,J,X=function(t){F(t),K(),window.addEventListener("resize",e=function(){G(t),F(t)});var n=(0,c.pK)()&&localStorage.getItem(t.options.cache.id);return t.options.cache.enable&&n||(t.options.value?n=t.options.value:t.originalInnerHTML?n=t.lute.HTML2Md(t.originalInnerHTML):t.options.cache.enable||(n="")),n||""},Y=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout((function(){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&(0,N.Gb)(e[e.currentMode].element)){d(e.toolbar.elements,o.g.EDIT_TOOLBARS),u(e.toolbar.elements,o.g.EDIT_TOOLBARS);var t=(0,N.zh)(e),n=t.startContainer;3===t.startContainer.nodeType&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),("sv"===e.currentMode?(0,b.a1)(n,"data-type","heading"):(0,y.W)(n))&&p(e.toolbar.elements,["headings"]),("sv"===e.currentMode?(0,b.a1)(n,"data-type","blockquote"):(0,b.lG)(n,"BLOCKQUOTE"))&&p(e.toolbar.elements,["quote"]),(0,b.a1)(n,"data-type","strong")&&p(e.toolbar.elements,["bold"]),(0,b.a1)(n,"data-type","em")&&p(e.toolbar.elements,["italic"]),(0,b.a1)(n,"data-type","s")&&p(e.toolbar.elements,["strike"]),(0,b.a1)(n,"data-type","a")&&p(e.toolbar.elements,["link"]);var r=(0,b.lG)(n,"LI");r?(r.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):"OL"===r.parentElement.tagName?p(e.toolbar.elements,["ordered-list"]):"UL"===r.parentElement.tagName&&p(e.toolbar.elements,["list"]),u(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,b.a1)(n,"data-type","code-block")&&(f(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,b.a1)(n,"data-type","code")&&(f(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,b.a1)(n,"data-type","table")&&f(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}}),200)},Q=function(e,t){void 0===t&&(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=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,c.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)},$=function(e){for(var t="",n=e.nextSibling;n;)3===n.nodeType?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},ee=function(e){for(var t="",n=e.previousSibling;n;)t=3===n.nodeType?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},te=function(e,t){Array.from(e.wysiwyg.element.childNodes).find((function(n){if(3===n.nodeType){var r=document.createElement("p");r.setAttribute("data-block","0"),r.textContent=n.textContent;var o=3===t.startContainer.nodeType?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(r,n),n.remove(),t.setStart(r.firstChild,Math.min(r.firstChild.textContent.length,o)),t.collapse(!0),(0,N.Hc)(t),!0}if(!n.getAttribute("data-block"))return"P"===n.tagName?n.remove():("DIV"===n.tagName?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>")):"BR"===n.tagName?n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"<wbr></p>"):(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"</p>")),(0,N.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0}))},ne=function(e,t){var n=(0,N.zh)(e),r=(0,b.F9)(n.startContainer);r||(r=n.startContainer.childNodes[n.startOffset]),r||0!==e.wysiwyg.element.children.length||(r=e.wysiwyg.element),r&&!r.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),"<wbr>"===r.innerHTML.trim()&&(r.innerHTML="<wbr><br>"),"BLOCKQUOTE"===r.tagName||r.classList.contains("vditor-reset")?r.innerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"):r.outerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"),(0,N.ib)(e.wysiwyg.element,n),D(e))},re=function(e){var t=getSelection().getRangeAt(0),n=(0,b.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>"),(0,N.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},oe=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling,o=r.ownerDocument.createRange();"CODE"===r.tagName?(r.style.display="inline-block",n?o.setStart(r.firstChild,1):o.selectNodeContents(r)):(r.style.display="block",r.firstChild.firstChild||r.firstChild.appendChild(document.createTextNode("")),o.selectNodeContents(r.firstChild)),n?o.collapse(!0):o.collapse(!1),(0,N.Hc)(o),e.firstElementChild.classList.contains("language-mindmap")||Ae(t)},ie=function(e,t){if(P("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},ae=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout((function(){if("false"!==e.wysiwyg.element.getAttribute("contenteditable")&&(0,N.Gb)(e.wysiwyg.element)){d(e.toolbar.elements,o.g.EDIT_TOOLBARS),u(e.toolbar.elements,o.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=3===t.startContainer.nodeType?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var r=(0,b.a1)(n,"data-type","footnotes-block");if(r)return e.wysiwyg.popover.innerHTML="",pe(r,e),void le(e,r);var i=(0,b.lG)(n,"LI");i?(i.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):"OL"===i.parentElement.tagName?p(e.toolbar.elements,["ordered-list"]):"UL"===i.parentElement.tagName&&p(e.toolbar.elements,["list"]),u(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,b.lG)(n,"BLOCKQUOTE")&&p(e.toolbar.elements,["quote"]),((0,b.lG)(n,"B")||(0,b.lG)(n,"STRONG"))&&p(e.toolbar.elements,["bold"]),((0,b.lG)(n,"I")||(0,b.lG)(n,"EM"))&&p(e.toolbar.elements,["italic"]),((0,b.lG)(n,"STRIKE")||(0,b.lG)(n,"S"))&&p(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach((function(e){e.classList.remove("vditor-comment--focus")}));var l=(0,b.fb)(n,"vditor-comment");if(l){var s=l.getAttribute("data-cmtids").split(" ");if(s.length>1&&l.nextSibling.isSameNode(l.nextElementSibling)){var m=l.nextElementSibling.getAttribute("data-cmtids").split(" ");s.find((function(e){if(m.includes(e))return s=[e],!0}))}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach((function(e){e.getAttribute("data-cmtids").indexOf(s[0])>-1&&e.classList.add("vditor-comment--focus")}))}var v=(0,b.lG)(n,"A");v&&p(e.toolbar.elements,["link"]);var h=(0,b.lG)(n,"TABLE"),g=(0,y.W)(n);(0,b.lG)(n,"CODE")?(0,b.lG)(n,"PRE")?(f(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"])):(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"])):g?(f(e.toolbar.elements,["bold"]),p(e.toolbar.elements,["headings"])):h&&f(e.toolbar.elements,["table"]);var w=(0,b.fb)(n,"vditor-toc");if(w)return e.wysiwyg.popover.innerHTML="",pe(w,e),void le(e,w);var E=(0,y.S)(n,"BLOCKQUOTE");if(E&&(e.wysiwyg.popover.innerHTML="",ce(t,E,e),de(t,E,e),pe(E,e),le(e,E)),i&&(e.wysiwyg.popover.innerHTML="",ce(t,i,e),de(t,i,e),pe(i,e),le(e,i)),h){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var k=function(){var t=h.rows.length,n=h.rows[0].cells.length,r=parseInt(P.value,10)||t,o=parseInt(B.value,10)||n;if(r!==t||n!==o){if(n!==o)for(var i=o-n,l=0;l<h.rows.length;l++)if(i>0)for(var s=0;s<i;s++)0===l?h.rows[l].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):h.rows[l].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var c=n-1;c>=o;c--)h.rows[l].cells[c].remove();if(t!==r){var d=r-t;if(d>0){for(var p="<tr>",u=0;u<o;u++)p+="<td> </td>";for(var f=0;f<d;f++)h.querySelector("tbody")?h.querySelector("tbody").insertAdjacentHTML("beforeend",p):h.querySelector("thead").insertAdjacentHTML("afterend",p+"</tr>")}else for(u=t-1;u>=r;u--)h.rows[u].remove(),1===h.rows.length&&h.querySelector("tbody").remove()}"function"==typeof e.options.input&&e.options.input(a(e))}},x=function(n){lt(h,n),"right"===n?(T.classList.remove("vditor-icon--current"),C.classList.remove("vditor-icon--current"),A.classList.add("vditor-icon--current")):"center"===n?(T.classList.remove("vditor-icon--current"),A.classList.remove("vditor-icon--current"),C.classList.add("vditor-icon--current")):(C.classList.remove("vditor-icon--current"),A.classList.remove("vditor-icon--current"),T.classList.add("vditor-icon--current")),(0,N.Hc)(t),Q(e)},S=(0,b.lG)(n,"TD"),_=(0,b.lG)(n,"TH"),L="left";S?L=S.getAttribute("align")||"left":_&&(L=_.getAttribute("align")||"center");var T=document.createElement("button");T.setAttribute("type","button"),T.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,c.ns)("⇧⌘L")+">"),T.setAttribute("data-type","left"),T.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',T.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("left"===L?" vditor-icon--current":""),T.onclick=function(){x("left")};var C=document.createElement("button");C.setAttribute("type","button"),C.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,c.ns)("⇧⌘C")+">"),C.setAttribute("data-type","center"),C.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',C.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("center"===L?" vditor-icon--current":""),C.onclick=function(){x("center")};var A=document.createElement("button");A.setAttribute("type","button"),A.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,c.ns)("⇧⌘R")+">"),A.setAttribute("data-type","right"),A.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',A.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("right"===L?" vditor-icon--current":""),A.onclick=function(){x("right")};var M=document.createElement("button");M.setAttribute("type","button"),M.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,c.ns)("⌘=")+">"),M.setAttribute("data-type","insertRow"),M.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',M.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",M.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&mt(e,t,r)};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,c.ns)("⇧⌘F")+">"),H.setAttribute("data-type","insertRow"),H.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",H.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&vt(e,t,r)};var D=document.createElement("button");D.setAttribute("type","button"),D.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,c.ns)("⇧⌘=")+">"),D.setAttribute("data-type","insertColumn"),D.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',D.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",D.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,b.lG)(t,"TD")||(0,b.lG)(t,"TH");n&&ht(e,h,n)};var I=document.createElement("button");I.setAttribute("type","button"),I.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,c.ns)("⇧⌘G")+">"),I.setAttribute("data-type","insertColumn"),I.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',I.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",I.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,b.lG)(t,"TD")||(0,b.lG)(t,"TH");n&&ht(e,h,n,"beforebegin")};var j=document.createElement("button");j.setAttribute("type","button"),j.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,c.ns)("⌘-")+">"),j.setAttribute("data-type","deleteRow"),j.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',j.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",j.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&>(e,t,r)};var R=document.createElement("button");R.setAttribute("type","button"),R.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,c.ns)("⇧⌘-")+">"),R.setAttribute("data-type","deleteColumn"),R.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',R.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",R.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&bt(e,t,h,r)},(J=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),J.className="vditor-tooltipped vditor-tooltipped__n";var P=document.createElement("input");J.appendChild(P),P.type="number",P.min="1",P.className="vditor-input",P.style.width="42px",P.style.textAlign="center",P.setAttribute("placeholder",window.VditorI18n.row),P.value=h.rows.length.toString(),P.oninput=function(){k()},P.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(B.focus(),B.select(),void n.preventDefault()):void(ie(e,n)||me(n,t))};var q=document.createElement("span");q.setAttribute("aria-label",window.VditorI18n.column),q.className="vditor-tooltipped vditor-tooltipped__n";var B=document.createElement("input");q.appendChild(B),B.type="number",B.min="1",B.className="vditor-input",B.style.width="42px",B.style.textAlign="center",B.setAttribute("placeholder",window.VditorI18n.column),B.value=h.rows[0].cells.length.toString(),B.oninput=function(){k()},B.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(P.focus(),P.select(),void n.preventDefault()):void(ie(e,n)||me(n,t))},ce(t,h,e),de(t,h,e),pe(h,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",T),e.wysiwyg.popover.insertAdjacentElement("beforeend",C),e.wysiwyg.popover.insertAdjacentElement("beforeend",A),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",M),e.wysiwyg.popover.insertAdjacentElement("beforeend",I),e.wysiwyg.popover.insertAdjacentElement("beforeend",D),e.wysiwyg.popover.insertAdjacentElement("beforeend",j),e.wysiwyg.popover.insertAdjacentElement("beforeend",R),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",q),le(e,h)}var z=(0,b.a1)(n,"data-type","link-ref");z&&se(e,z,t);var U=(0,b.a1)(n,"data-type","footnotes-ref");if(U){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(J=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,c.ns)("⌥Enter")+">"),J.className="vditor-tooltipped vditor-tooltipped__n";var V=document.createElement("input");J.appendChild(V),V.className="vditor-input",V.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,c.ns)("⌥Enter")+">"),V.style.width="120px",V.value=U.getAttribute("data-footnotes-label"),V.oninput=function(){""!==V.value.trim()&&U.setAttribute("data-footnotes-label",V.value),"function"==typeof e.options.input&&e.options.input(a(e))},V.onkeydown=function(n){n.isComposing||ie(e,n)||me(n,t)},pe(U,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),le(e,U)}var W=(0,b.fb)(n,"vditor-wysiwyg__block"),G=!!W&&W.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach((function(e){(!W||W&&G&&!W.contains(e))&&(e.previousElementSibling.style.display="none")})),W&&G){if(e.wysiwyg.popover.innerHTML="",ce(t,W,e),de(t,W,e),pe(W,e),"code-block"===W.getAttribute("data-type")){var F=document.createElement("span");F.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,c.ns)("⌥Enter")+">"),F.className="vditor-tooltipped vditor-tooltipped__n";var K=document.createElement("input");F.appendChild(K);var Z=W.firstElementChild.firstElementChild;K.className="vditor-input",K.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,c.ns)("⌥Enter")+">"),K.value=Z.className.indexOf("language-")>-1?Z.className.split("-")[1].split(" ")[0]:"",K.oninput=function(n){""!==K.value.trim()?Z.className="language-".concat(K.value):(Z.className="",e.hint.recentLanguage=""),W.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(W.lastElementChild.innerHTML=W.firstElementChild.innerHTML,O(W.lastElementChild,e)),Q(e),1===n.detail&&(t.setStart(Z.firstChild,0),t.collapse(!0),(0,N.Hc)(t))},K.onkeydown=function(n){if(!n.isComposing&&!ie(e,n)){if("Escape"===n.key&&"block"===e.hint.element.style.display)return e.hint.element.style.display="none",void n.preventDefault();e.hint.select(n,e),me(n,t)}},K.onkeyup=function(t){if(!t.isComposing&&"Enter"!==t.key&&"ArrowUp"!==t.key&&"Escape"!==t.key&&"ArrowDown"!==t.key){var n=[],r=K.value.substring(0,K.selectionStart);(e.options.preview.hljs.langs||o.g.CODE_LANGUAGES).forEach((function(e){e.indexOf(r.toLowerCase())>-1&&n.push({html:e,value:e})})),e.hint.genHTML(n,r,e),t.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",F)}le(e,W)}else W=void 0;if(g){var J;e.wysiwyg.popover.innerHTML="",(J=document.createElement("span")).setAttribute("aria-label","ID<"+(0,c.ns)("⌥Enter")+">"),J.className="vditor-tooltipped vditor-tooltipped__n";var X=document.createElement("input");J.appendChild(X),X.className="vditor-input",X.setAttribute("placeholder","ID<"+(0,c.ns)("⌥Enter")+">"),X.style.width="120px",X.value=g.getAttribute("data-id")||"",X.oninput=function(){g.setAttribute("data-id",X.value),"function"==typeof e.options.input&&e.options.input(a(e))},X.onkeydown=function(n){n.isComposing||ie(e,n)||me(n,t)},ce(t,g,e),de(t,g,e),pe(g,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),le(e,g)}if(v&&fe(e,v,t),!(E||i||h||W||v||z||U||g||w)){var Y=(0,b.a1)(n,"data-block","0");Y&&Y.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",ce(t,Y,e),de(t,Y,e),pe(Y,e),le(e,Y)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach((function(e){e.style.display="none"}));var $=(0,b.a1)(t.startContainer,"data-type","backslash");$&&($.querySelector("span").style.display="inline")}}),200)},le=function(e,t){var n=t,r=(0,b.lG)(t,"TABLE");r&&(n=r),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())},se=function(e,t,n){void 0===n&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&("IMG"===t.tagName?t.setAttribute("alt",i.value):t.textContent=i.value),""!==s.value.trim()&&t.setAttribute("data-link-label",s.value),"function"==typeof e.options.input&&e.options.input(a(e))},o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.getAttribute("alt")||t.textContent,i.oninput=function(){r()},i.onkeydown=function(r){ie(e,r)||me(r,n)||ue(e,t,r,s)};var l=document.createElement("span");l.setAttribute("aria-label",window.VditorI18n.linkRef),l.className="vditor-tooltipped vditor-tooltipped__n";var s=document.createElement("input");l.appendChild(s),s.className="vditor-input",s.setAttribute("placeholder",window.VditorI18n.linkRef),s.value=t.getAttribute("data-link-label"),s.oninput=function(){r()},s.onkeydown=function(r){ie(e,r)||me(r,n)||ue(e,t,r,i)},pe(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",l),le(e,t)},ce=function(e,t,n){var r=t.previousElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","up"),o.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,c.ns)("⇧⌘U")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,N.ib)(n.wysiwyg.element,e),Q(n),ae(n),Ae(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},de=function(e,t,n){var r=t.nextElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","down"),o.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,c.ns)("⇧⌘D")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,N.ib)(n.wysiwyg.element,e),Q(n),ae(n),Ae(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},pe=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,c.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 n=(0,N.zh)(t);n.setStartAfter(e),(0,N.Hc)(n),e.remove(),Q(t),ae(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&D(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},ue=function(e,t,n,r){if(!n.isComposing){if("Tab"===n.key)return r.focus(),r.select(),void n.preventDefault();if(!(0,c.yl)(n)&&!n.shiftKey&&n.altKey&&"Enter"===n.key){var i=(0,N.zh)(e);t.insertAdjacentHTML("afterend",o.g.ZWSP),i.setStartAfter(t.nextSibling),i.collapse(!0),(0,N.Hc)(i),n.preventDefault()}}},fe=function(e,t,n){e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&(t.innerHTML=i.value),t.setAttribute("href",l.value),t.setAttribute("title",c.value),Q(e)};t.querySelectorAll("[data-marker]").forEach((function(e){e.removeAttribute("data-marker")}));var o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.innerHTML||"",i.oninput=function(){r()},i.onkeydown=function(r){ie(e,r)||me(r,n)||ue(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.link),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.link),l.value=t.getAttribute("href")||"",l.oninput=function(){r()},l.onkeydown=function(r){ie(e,r)||me(r,n)||ue(e,t,r,c)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.tooltipText),s.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");s.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.tooltipText),c.style.width="60px",c.value=t.getAttribute("title")||"",c.oninput=function(){r()},c.onkeydown=function(r){ie(e,r)||me(r,n)||ue(e,t,r,i)},pe(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),le(e,t)},me=function(e,t){if(!(0,c.yl)(e)&&!e.shiftKey&&"Enter"===e.key||"Escape"===e.key)return t&&(0,N.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},ve=function(e){"wysiwyg"===e.currentMode?ae(e):"ir"===e.currentMode&&Y(e)},he=function(e,t,n){void 0===n&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var r=e.wysiwyg.element;r.innerHTML=e.lute.Md2VditorDOM(t),r.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach((function(t){O(t,e),t.previousElementSibling.setAttribute("style","display:none")})),Q(e,n)},ge=function(e,t,n){for(var r=e.startContainer.parentElement,i=!1,a="",l="",s=function(e){var t=ee(e.startContainer),n=$(e.startContainer),r=e.startContainer.textContent,i=e.startOffset,a="",l="";return(""!==r.substr(0,i)&&r.substr(0,i)!==o.g.ZWSP||t)&&(a="".concat(t).concat(r.substr(0,i))),(""!==r.substr(i)&&r.substr(i)!==o.g.ZWSP||n)&&(l="".concat(r.substr(i)).concat(n)),{afterHTML:l,beforeHTML:a}}(e),c=s.beforeHTML,d=s.afterHTML;r&&!i;){var p=r.tagName;if("STRIKE"===p&&(p="S"),"I"===p&&(p="EM"),"B"===p&&(p="STRONG"),"S"===p||"STRONG"===p||"EM"===p){var u="",f="",m="";"0"!==r.parentElement.getAttribute("data-block")&&(f=ee(r),m=$(r)),(c||f)&&(c=u="".concat(f,"<").concat(p,">").concat(c,"</").concat(p,">")),("bold"===n&&"STRONG"===p||"italic"===n&&"EM"===p||"strikeThrough"===n&&"S"===p)&&(u+="".concat(a).concat(o.g.ZWSP,"<wbr>").concat(l),i=!0),(d||m)&&(u+=d="<".concat(p,">").concat(d,"</").concat(p,">").concat(m)),"0"!==r.parentElement.getAttribute("data-block")?(r=r.parentElement).innerHTML=u:(r.outerHTML=u,r=r.parentElement),a="<".concat(p,">")+a,l="</".concat(p,">")+l}else i=!0}(0,N.ib)(t.wysiwyg.element,e)},be=function(e,t){var n,r=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var i=t.hotkey?" <".concat((0,c.ns)(t.hotkey),">"):"";2===t.level&&(i=t.hotkey?" <".concat((0,c.ns)(t.hotkey),">"):"");var a=t.tip?t.tip+i:"".concat(window.VditorI18n[t.name]).concat(i),l="upload"===t.name?"div":"button";if(2===t.level)this.element.innerHTML="<".concat(l,' data-type="').concat(t.name,'">').concat(a,"</").concat(l,">");else{this.element.classList.add("vditor-toolbar__item");var s=document.createElement(l);s.setAttribute("data-type",t.name),s.className="vditor-tooltipped vditor-tooltipped__".concat(t.tipPosition),s.setAttribute("aria-label",a),s.innerHTML=t.icon,this.element.appendChild(s)}t.prefix&&this.element.children[0].addEventListener((0,c.Le)(),(function(n){n.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||("wysiwyg"===e.currentMode?function(e,t,n){if(!(e.wysiwyg.composingLock&&n instanceof CustomEvent)){var r=!0,i=!0;e.wysiwyg.element.querySelector("wbr")&&e.wysiwyg.element.querySelector("wbr").remove();var a=(0,N.zh)(e),l=t.getAttribute("data-type");if(t.classList.contains("vditor-menu--current"))if("strike"===l&&(l="strikeThrough"),"quote"===l){var s=(0,b.lG)(a.startContainer,"BLOCKQUOTE");s||(s=a.startContainer.childNodes[a.startOffset]),s&&(r=!1,t.classList.remove("vditor-menu--current"),a.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'.concat(s.innerHTML,"</p>"):s.innerHTML,(0,N.ib)(e.wysiwyg.element,a))}else if("inline-code"===l){var c=(0,b.lG)(a.startContainer,"CODE");c||(c=a.startContainer.childNodes[a.startOffset]),c&&(c.outerHTML=c.innerHTML.replace(o.g.ZWSP,"")+"<wbr>",(0,N.ib)(e.wysiwyg.element,a))}else"link"===l?a.collapsed?(a.selectNode(a.startContainer.parentElement),document.execCommand("unlink",!1,"")):document.execCommand("unlink",!1,""):"check"===l||"list"===l||"ordered-list"===l?(ot(e,a,l),(0,N.ib)(e.wysiwyg.element,a),r=!1,t.classList.remove("vditor-menu--current")):(r=!1,t.classList.remove("vditor-menu--current"),""===a.toString()?ge(a,e,l):document.execCommand(l,!1,""));else{0===e.wysiwyg.element.childNodes.length&&(e.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,N.ib)(e.wysiwyg.element,a));var p=(0,b.F9)(a.startContainer);if("quote"===l){if(p||(p=a.startContainer.childNodes[a.startOffset]),p){r=!1,t.classList.add("vditor-menu--current"),a.insertNode(document.createElement("wbr"));var u=(0,b.lG)(a.startContainer,"LI");u&&p.contains(u)?u.innerHTML='<blockquote data-block="0">'.concat(u.innerHTML,"</blockquote>"):p.outerHTML='<blockquote data-block="0">'.concat(p.outerHTML,"</blockquote>"),(0,N.ib)(e.wysiwyg.element,a)}}else if("check"===l||"list"===l||"ordered-list"===l)ot(e,a,l,!1),(0,N.ib)(e.wysiwyg.element,a),r=!1,d(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current");else if("inline-code"===l){if(""===a.toString())(f=document.createElement("code")).textContent=o.g.ZWSP,a.insertNode(f),a.setStart(f.firstChild,1),a.collapse(!0),(0,N.Hc)(a);else if(3===a.startContainer.nodeType){var f=document.createElement("code");a.surroundContents(f),a.insertNode(f),(0,N.Hc)(a)}t.classList.add("vditor-menu--current")}else if("code"===l)(f=document.createElement("div")).className="vditor-wysiwyg__block",f.setAttribute("data-type","code-block"),f.setAttribute("data-block","0"),f.setAttribute("data-marker","```"),""===a.toString()?f.innerHTML="<pre><code><wbr>\n</code></pre>":(f.innerHTML="<pre><code>".concat(a.toString(),"<wbr></code></pre>"),a.deleteContents()),a.insertNode(f),p&&(p.outerHTML=e.lute.SpinVditorDOM(p.outerHTML)),(0,N.ib)(e.wysiwyg.element,a),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach((function(t){O(t,e)})),t.classList.add("vditor-menu--disabled");else if("link"===l){if(""===a.toString()){var m=document.createElement("a");m.innerText=o.g.ZWSP,a.insertNode(m),a.setStart(m.firstChild,1),a.collapse(!0),fe(e,m,a);var v=e.wysiwyg.popover.querySelector("input");v.value="",v.focus(),i=!1}else{(f=document.createElement("a")).setAttribute("href",""),f.innerHTML=a.toString(),a.surroundContents(f),a.insertNode(f),(0,N.Hc)(a),fe(e,f,a);var h=e.wysiwyg.popover.querySelectorAll("input");h[0].value=f.innerText,h[1].focus()}r=!1,t.classList.add("vditor-menu--current")}else if("table"===l){var g='<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())p&&""===p.innerHTML.trim().replace(o.g.ZWSP,"")?p.outerHTML=g:document.execCommand("insertHTML",!1,g),a.selectNode(e.wysiwyg.element.querySelector("wbr").previousSibling),e.wysiwyg.element.querySelector("wbr").remove(),(0,N.Hc)(a);else{g='<table data-block="0"><thead><tr>';var y=a.toString().split("\n"),w=y[0].split(",").length>y[0].split("\t").length?",":"\t";y.forEach((function(e,t){0===t?(e.split(w).forEach((function(e,t){g+="<th>".concat(e,0===t?"<wbr></th>":"</th>")})),g+="</tr></thead>"):(g+=1===t?"<tbody><tr>":"<tr>",e.split(w).forEach((function(e){g+="<td>".concat(e,"</td>")})),g+="</tr>")})),g+="</tbody></table>",document.execCommand("insertHTML",!1,g),(0,N.ib)(e.wysiwyg.element,a)}r=!1,t.classList.add("vditor-menu--disabled")}else if("line"===l){if(p){var E='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===p.innerHTML.trim()?p.outerHTML=E:p.insertAdjacentHTML("afterend",E),(0,N.ib)(e.wysiwyg.element,a)}}else if(r=!1,t.classList.add("vditor-menu--current"),"strike"===l&&(l="strikeThrough"),""!==a.toString()||"bold"!==l&&"italic"!==l&&"strikeThrough"!==l)document.execCommand(l,!1,"");else{var k="strong";"italic"===l?k="em":"strikeThrough"===l&&(k="s"),(f=document.createElement(k)).textContent=o.g.ZWSP,a.insertNode(f),f.previousSibling&&f.previousSibling.textContent===o.g.ZWSP&&(f.previousSibling.textContent=""),a.setStart(f.firstChild,1),a.collapse(!0),(0,N.Hc)(a)}}r&&ae(e),i&&Q(e)}}(e,r.element.children[0],n):"ir"===e.currentMode?Ht(e,r.element.children[0],t.prefix||"",t.suffix||""):Pe(e,r.element.children[0],t.prefix||"",t.suffix||""))}))},ye=(Z=function(e,t){return(Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),we=function(e,t,n){var r;if("string"!=typeof n?(h(e,["subToolbar","hint"]),n.preventDefault(),r=a(e)):r=n,e.currentMode!==t||"string"==typeof n){if(e.devtools&&e.devtools.renderEchart(e),"both"===e.options.preview.mode&&"sv"===t?e.preview.element.style.display="block":e.preview.element.style.display="none",u(e.toolbar.elements,o.g.EDIT_TOOLBARS),d(e.toolbar.elements,o.g.EDIT_TOOLBARS),f(e.toolbar.elements,["outdent","indent"]),"ir"===t)m(e.toolbar.elements,["both"]),v(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(r),Ct(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),G(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach((function(t){O(t,e)})),e.ir.element.querySelectorAll(".vditor-toc").forEach((function(t){(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}));else if("wysiwyg"===t)m(e.toolbar.elements,["both"]),v(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",G(e),he(e,r,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach((function(t){(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})})),e.wysiwyg.popover.style.display="none";else if("sv"===t){v(e.toolbar.elements,["both"]),m(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",("both"===e.options.preview.mode||"editor"===e.options.preview.mode)&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var i=De(r,e);"<div data-block='0'></div>"===i&&(i=""),e.sv.element.innerHTML=i,z(e.sv.element),je(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),G(e)}e.undo.resetIcon(e),"string"!=typeof n&&(e[e.currentMode].element.focus(),ve(e)),D(e),F(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach((function(e){e.classList.remove("vditor-menu--current")})),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'.concat(e.currentMode,'"]')).classList.add("vditor-menu--current")),e.outline.toggle(e,"sv"!==e.currentMode&&e.options.outline.enable,"string"!=typeof n)}},Ee=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'.concat(window.VditorI18n.wysiwyg," <").concat((0,c.ns)("⌥⌘7"),'></button>\n<button data-mode="ir">').concat(window.VditorI18n.instantRendering," <").concat((0,c.ns)("⌥⌘8"),'></button>\n<button data-mode="sv">').concat(window.VditorI18n.splitView," <").concat((0,c.ns)("⌥⌘9"),"></button>"),r.element.appendChild(o),r._bindEvent(t,o,n),r}return ye(t,e),t.prototype._bindEvent=function(e,t,n){var r=this.element.children[0];g(e,t,r,n.level),t.children.item(0).addEventListener((0,c.Le)(),(function(t){we(e,"wysiwyg",t),t.preventDefault(),t.stopPropagation()})),t.children.item(1).addEventListener((0,c.Le)(),(function(t){we(e,"ir",t),t.preventDefault(),t.stopPropagation()})),t.children.item(2).addEventListener((0,c.Le)(),(function(t){we(e,"sv",t),t.preventDefault(),t.stopPropagation()}))},t}(be),ke=function(e,t){return(0,N.Gb)(e,t)?getSelection().toString():""},xe=function(e,t){t.addEventListener("focus",(function(){e.options.focus&&e.options.focus(a(e)),h(e,["subToolbar","hint"])}))},Se=function(e,t){t.addEventListener("dblclick",(function(t){"IMG"===t.target.tagName&&(e.options.image.preview?e.options.image.preview(t.target):e.options.image.isPreview&&(0,B.E)(t.target,e.options.lang,e.options.theme))}))},_e=function(e,t){t.addEventListener("blur",(function(t){if("ir"===e.currentMode){var n=e.ir.element.querySelector(".vditor-ir__node--expand");n&&n.classList.remove("vditor-ir__node--expand")}else"wysiwyg"!==e.currentMode||e.wysiwyg.selectPopover.contains(t.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,N.zh)(e),e.options.blur&&e.options.blur(a(e))}))},Le=function(e,t){t.addEventListener("dragstart",(function(e){e.dataTransfer.setData(o.g.DROP_EDITOR,o.g.DROP_EDITOR)})),t.addEventListener("drop",(function(t){t.dataTransfer.getData(o.g.DROP_EDITOR)?dt(e):(t.dataTransfer.types.includes("Files")||t.dataTransfer.types.includes("text/html"))&&Lt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}))},Te=function(e,t,n){t.addEventListener("copy",(function(t){return n(t,e)}))},Ce=function(e,t,n){t.addEventListener("cut",(function(t){n(t,e),e.options.comment.enable&&"wysiwyg"===e.currentMode&&e.wysiwyg.getComments(e),document.execCommand("delete")}))},Ae=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,N.Ny)(t).top;"auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),("auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},Me=function(e,t){t.addEventListener("keydown",(function(t){if(!t.isComposing&&e.options.keydown&&e.options.keydown(t),!(e.options.hint.extend.length>1||e.toolbar.elements.emoji)||!e.hint.select(t,e)){if(e.options.comment.enable&&"wysiwyg"===e.currentMode&&("Backspace"===t.key||P("⌘X",t))&&e.wysiwyg.getComments(e),"sv"===e.currentMode){if(function(e,t){var n,r,o,i,a;if(e.sv.composingLock=t.isComposing,t.isComposing)return!1;if(-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,c.yl)(t)&&"Escape"!==t.key)return!1;var l=(0,N.zh)(e),s=l.startContainer;3!==l.startContainer.nodeType&&"DIV"===l.startContainer.tagName&&(s=l.startContainer.childNodes[l.startOffset-1]);var d=(0,b.a1)(s,"data-type","text"),p=(0,b.a1)(s,"data-type","blockquote-marker");if(!p&&0===l.startOffset&&d&&d.previousElementSibling&&"blockquote-marker"===d.previousElementSibling.getAttribute("data-type")&&(p=d.previousElementSibling),p&&"Enter"===t.key&&!(0,c.yl)(t)&&!t.altKey&&""===p.nextElementSibling.textContent.trim()&&(0,N.im)(p,e.sv.element,l).start===p.textContent.length)return"padding"===(null===(n=p.previousElementSibling)||void 0===n?void 0:n.getAttribute("data-type"))&&p.previousElementSibling.setAttribute("data-action","enter-remove"),p.remove(),je(e),t.preventDefault(),!0;var u=(0,b.a1)(s,"data-type","li-marker"),f=(0,b.a1)(s,"data-type","task-marker"),m=u;if(m||f&&"task-marker"!==f.nextElementSibling.getAttribute("data-type")&&(m=f),m||0!==l.startOffset||!d||!d.previousElementSibling||"li-marker"!==d.previousElementSibling.getAttribute("data-type")&&"task-marker"!==d.previousElementSibling.getAttribute("data-type")||(m=d.previousElementSibling),m){var v=(0,N.im)(m,e.sv.element,l).start,h="task-marker"===m.getAttribute("data-type"),g=m;if(h&&(g=m.previousElementSibling.previousElementSibling.previousElementSibling),v===m.textContent.length){if("Enter"===t.key&&!(0,c.yl)(t)&&!t.altKey&&!t.shiftKey&&""===m.nextElementSibling.textContent.trim())return"padding"===(null===(r=g.previousElementSibling)||void 0===r?void 0:r.getAttribute("data-type"))?(g.previousElementSibling.remove(),U(e)):(h&&(g.remove(),m.previousElementSibling.previousElementSibling.remove(),m.previousElementSibling.remove()),m.nextElementSibling.remove(),m.remove(),je(e)),t.preventDefault(),!0;if("Tab"===t.key)return t.shiftKey?"padding"===g.previousElementSibling.getAttribute("data-type")&&g.previousElementSibling.remove():g.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(g.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(g.textContent)&&(g.textContent=g.textContent.replace(/^\d{1,}/,"1"),l.selectNodeContents(m.firstChild),l.collapse(!1)),U(e),t.preventDefault(),!0}}if(ut(e,l,t))return!0;var w=(0,b.a1)(s,"data-block","0"),E=(0,y.S)(s,"SPAN");if("Enter"===t.key&&!(0,c.yl)(t)&&!t.altKey&&!t.shiftKey&&w){var k=!1,x=w.textContent.match(/^\n+/);(0,N.im)(w,e.sv.element).start<=(x?x[0].length:0)&&(k=!0);var S="\n";if(E){if("enter-remove"===(null===(o=E.previousElementSibling)||void 0===o?void 0:o.getAttribute("data-action")))return E.previousElementSibling.remove(),je(e),t.preventDefault(),!0;S+=Ie(E)}return l.insertNode(document.createTextNode(S)),l.collapse(!1),w&&""!==w.textContent.trim()&&!k?U(e):je(e),t.preventDefault(),!0}if("Backspace"===t.key&&!(0,c.yl)(t)&&!t.altKey&&!t.shiftKey){if(E&&"newline"===(null===(i=E.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-type"))&&1===(0,N.im)(E,e.sv.element,l).start&&-1===E.getAttribute("data-type").indexOf("code-block-"))return l.setStart(E,0),l.extractContents(),""!==E.textContent.trim()?U(e):je(e),t.preventDefault(),!0;if(w&&0===(0,N.im)(w,e.sv.element,l).start&&w.previousElementSibling){l.extractContents();var _=w.previousElementSibling.lastElementChild;return"newline"===_.getAttribute("data-type")&&(_.remove(),_=w.previousElementSibling.lastElementChild),"newline"!==_.getAttribute("data-type")&&(_.insertAdjacentHTML("afterend",w.innerHTML),w.remove()),""===w.textContent.trim()||(null===(a=w.previousElementSibling)||void 0===a?void 0:a.querySelector('[data-type="code-block-open-marker"]'))?("newline"!==_.getAttribute("data-type")&&(l.selectNodeContents(_.lastChild),l.collapse(!1)),je(e)):U(e),t.preventDefault(),!0}}return!1}(e,t))return}else if("wysiwyg"===e.currentMode){if(function(e,t){if(e.wysiwyg.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,N.zh)(e),r=n.startContainer;if(!Je(t,e,r))return!1;if(Xe(n,e,t),St(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,c.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key)return!1;var i=(0,b.F9)(r),a=(0,b.lG)(r,"P");if(ft(t,e,a,n))return!0;if(pt(n,e,a,t))return!0;if(yt(e,t,n))return!0;var l=(0,b.fb)(r,"vditor-wysiwyg__block");if(l){if("Escape"===t.key&&2===l.children.length)return e.wysiwyg.popover.style.display="none",l.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),!0;if(!(0,c.yl)(t)&&!t.shiftKey&&t.altKey&&"Enter"===t.key&&"code-block"===l.getAttribute("data-type")){var s=e.wysiwyg.popover.querySelector(".vditor-input");return s.focus(),s.select(),t.preventDefault(),!0}if("0"===l.getAttribute("data-block")){if(wt(e,t,l.firstElementChild,n))return!0;if(nt(e,t,n,l.firstElementChild,l))return!0;if("yaml-front-matter"!==l.getAttribute("data-type")&&rt(e,t,n,l.firstElementChild,l))return!0}}if(Et(e,n,t,a))return!0;var d=(0,b.E2)(r,"BLOCKQUOTE");if(d&&!t.shiftKey&&t.altKey&&"Enter"===t.key){(0,c.yl)(t)?n.setStartBefore(d):n.setStartAfter(d),(0,N.Hc)(n);var p=document.createElement("p");return p.setAttribute("data-block","0"),p.innerHTML="\n",n.insertNode(p),n.collapse(!0),(0,N.Hc)(n),Q(e),Ae(e),t.preventDefault(),!0}var u,f=(0,y.W)(r);if(f){if("H6"===f.tagName&&r.textContent.length===n.startOffset&&!(0,c.yl)(t)&&!t.shiftKey&&!t.altKey&&"Enter"===t.key){var m=document.createElement("p");return m.textContent="\n",m.setAttribute("data-block","0"),r.parentElement.insertAdjacentElement("afterend",m),n.setStart(m,0),(0,N.Hc)(n),Q(e),Ae(e),t.preventDefault(),!0}var v;if(P("⌘=",t))return(v=parseInt(f.tagName.substr(1),10)-1)>0&&(ne(e,"h".concat(v)),Q(e)),t.preventDefault(),!0;if(P("⌘-",t))return(v=parseInt(f.tagName.substr(1),10)+1)<7&&(ne(e,"h".concat(v)),Q(e)),t.preventDefault(),!0;"Backspace"!==t.key||(0,c.yl)(t)||t.shiftKey||t.altKey||1!==f.textContent.length||re(e)}if(kt(e,n,t))return!0;if(t.altKey&&"Enter"===t.key&&!(0,c.yl)(t)&&!t.shiftKey){var h=(0,b.lG)(r,"A"),g=(0,b.a1)(r,"data-type","link-ref"),w=(0,b.a1)(r,"data-type","footnotes-ref");if(h||g||w||f&&2===f.tagName.length){var E=e.wysiwyg.popover.querySelector("input");E.focus(),E.select()}}if(ie(e,t))return!0;if(P("⇧⌘U",t)&&(u=e.wysiwyg.popover.querySelector('[data-type="up"]')))return u.click(),t.preventDefault(),!0;if(P("⇧⌘D",t)&&(u=e.wysiwyg.popover.querySelector('[data-type="down"]')))return u.click(),t.preventDefault(),!0;if(ut(e,n,t))return!0;if(!(0,c.yl)(t)&&t.shiftKey&&!t.altKey&&"Enter"===t.key&&"LI"!==r.parentElement.tagName&&"P"!==r.parentElement.tagName)return["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName)?n.insertNode(document.createTextNode("\n"+o.g.ZWSP)):n.insertNode(document.createTextNode("\n")),n.collapse(!1),(0,N.Hc)(n),Q(e),Ae(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,c.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(xt(e,n,t,a))return!0;if(i){if(i.previousElementSibling&&i.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&"0"===i.previousElementSibling.getAttribute("data-block")&&"UL"!==i.tagName&&"OL"!==i.tagName){var k=(0,N.im)(i,e.wysiwyg.element,n).start;if(0===k&&0===n.startOffset||1===k&&i.innerText.startsWith(o.g.ZWSP))return oe(i.previousElementSibling.lastElementChild,e,!1),""===i.innerHTML.trim().replace(o.g.ZWSP,"")&&(i.remove(),Q(e)),t.preventDefault(),!0}var x=n.startOffset;if(""===n.toString()&&3===r.nodeType&&"\n"===r.textContent.charAt(x-2)&&r.textContent.charAt(x-1)!==o.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName))return r.textContent=r.textContent.substring(0,x-1)+o.g.ZWSP,n.setStart(r,x),n.collapse(!0),Q(e),t.preventDefault(),!0;r.textContent===o.g.ZWSP&&1===n.startOffset&&!r.previousSibling&&function(e){for(var t=e.startContainer.nextSibling;t&&""===t.textContent;)t=t.nextSibling;return!(!t||3===t.nodeType||"CODE"!==t.tagName&&"math-inline"!==t.getAttribute("data-type")&&"html-entity"!==t.getAttribute("data-type")&&"html-inline"!==t.getAttribute("data-type"))}(n)&&(r.textContent=""),i.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach((function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"})),i.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach((function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"}))}}if((0,c.vU)()&&1===n.startOffset&&r.textContent.indexOf(o.g.ZWSP)>-1&&r.previousSibling&&3!==r.previousSibling.nodeType&&"CODE"===r.previousSibling.tagName&&("Backspace"===t.key||"ArrowLeft"===t.key))return n.selectNodeContents(r.previousSibling),n.collapse(!1),t.preventDefault(),!0;if(_t(t,i,n))return t.preventDefault(),!0;if(Ye(n,t.key),"ArrowDown"===t.key){var S=r.nextSibling;S&&3!==S.nodeType&&"math-inline"===S.getAttribute("data-type")&&n.setStartAfter(S)}return!(!i||!j(i,e,t,n)||(t.preventDefault(),0))}(e,t))return}else if("ir"===e.currentMode&&function(e,t){if(e.ir.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,N.zh)(e),r=n.startContainer;if(!Je(t,e,r))return!1;if(Xe(n,e,t),St(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,c.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key)return!1;var i=(0,b.a1)(r,"data-newline","1");if(!(0,c.yl)(t)&&!t.altKey&&!t.shiftKey&&"Enter"===t.key&&i&&n.startOffset<i.textContent.length){var a=i.previousElementSibling;a&&(n.insertNode(document.createTextNode(a.textContent)),n.collapse(!1));var l=i.nextSibling;l&&(n.insertNode(document.createTextNode(l.textContent)),n.collapse(!0))}var s=(0,b.lG)(r,"P");if(ft(t,e,s,n))return!0;if(pt(n,e,s,t))return!0;if(Et(e,n,t,s))return!0;var d=(0,b.fb)(r,"vditor-ir__marker--pre");if(d&&"PRE"===d.tagName){var p=d.firstChild;if(wt(e,t,d,n))return!0;if(("math-block"===p.getAttribute("data-type")||"html-block"===p.getAttribute("data-type"))&&rt(e,t,n,p,d.parentElement))return!0;if(nt(e,t,n,p,d.parentElement))return!0}var u=(0,b.a1)(r,"data-type","code-block-info");if(u){if("Enter"===t.key||"Tab"===t.key)return n.selectNodeContents(u.nextElementSibling.firstChild),n.collapse(!0),t.preventDefault(),h(e,["hint"]),!0;if("Backspace"===t.key){var f=(0,N.im)(u,e.ir.element).start;1===f&&n.setStart(r,0),2===f&&(e.hint.recentLanguage="")}if(rt(e,t,n,u,u.parentElement))return h(e,["hint"]),!0}var m=(0,b.lG)(r,"TD")||(0,b.lG)(r,"TH");if(t.key.indexOf("Arrow")>-1&&m){var v=$e(m);if(v&&rt(e,t,n,m,v))return!0;var g=et(m);if(g&&nt(e,t,n,m,g))return!0}if(yt(e,t,n))return!0;if(kt(e,n,t))return!0;if(ut(e,n,t))return!0;var w=(0,y.W)(r);if(w){var E;if(P("⌘=",t))return(E=w.querySelector(".vditor-ir__marker--heading"))&&E.textContent.trim().length>1&&At(e,E.textContent.substr(1)),t.preventDefault(),!0;if(P("⌘-",t))return(E=w.querySelector(".vditor-ir__marker--heading"))&&E.textContent.trim().length<6&&At(e,E.textContent.trim()+"# "),t.preventDefault(),!0}var k=(0,b.F9)(r);if("Backspace"===t.key&&!(0,c.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(xt(e,n,t,s))return!0;if(k&&k.previousElementSibling&&"UL"!==k.tagName&&"OL"!==k.tagName&&("code-block"===k.previousElementSibling.getAttribute("data-type")||"math-block"===k.previousElementSibling.getAttribute("data-type"))){var x=(0,N.im)(k,e.ir.element,n).start;if(0===x||1===x&&k.innerText.startsWith(o.g.ZWSP))return n.selectNodeContents(k.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),n.collapse(!1),q(n,e),""===k.textContent.trim().replace(o.g.ZWSP,"")&&(k.remove(),Ct(e)),t.preventDefault(),!0}if(w){var S=w.firstElementChild.textContent.length;(0,N.im)(w,e.ir.element).start===S&&(n.setStart(w.firstElementChild.firstChild,S-1),n.collapse(!0),(0,N.Hc)(n))}}return!(("ArrowUp"!==t.key&&"ArrowDown"!==t.key||!k||(k.querySelectorAll(".vditor-ir__node").forEach((function(e){e.contains(r)||e.classList.add("vditor-ir__node--hidden")})),!_t(t,k,n)))&&(Ye(n,t.key),!k||!j(k,e,t,n)||(t.preventDefault(),0)))}(e,t))return;if(e.options.ctrlEnter&&P("⌘Enter",t))return e.options.ctrlEnter(a(e)),void t.preventDefault();if(P("⌘Z",t)&&!e.toolbar.elements.undo)return e.undo.undo(e),void t.preventDefault();if(P("⌘Y",t)&&!e.toolbar.elements.redo)return e.undo.redo(e),void t.preventDefault();if("Escape"===t.key)return"block"===e.hint.element.style.display?e.hint.element.style.display="none":e.options.esc&&!t.isComposing&&e.options.esc(a(e)),void t.preventDefault();if((0,c.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[1-6]$/.test(t.code)){if("wysiwyg"===e.currentMode){var n=t.code.replace("Digit","H");(0,b.lG)(getSelection().getRangeAt(0).startContainer,n)?re(e):ne(e,n),Q(e)}else"sv"===e.currentMode?Re(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "):"ir"===e.currentMode&&At(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" ");return t.preventDefault(),!0}if((0,c.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[7-9]$/.test(t.code))return"Digit7"===t.code?we(e,"wysiwyg",t):"Digit8"===t.code?we(e,"ir",t):"Digit9"===t.code&&we(e,"sv",t),!0;e.options.toolbar.find((function(n){return!n.hotkey||n.toolbar?!!n.toolbar&&!!n.toolbar.find((function(n){return!!n.hotkey&&(P(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,c.Le)())),t.preventDefault(),!0):void 0)})):P(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,c.Le)())),t.preventDefault(),!0):void 0}))}}))},He=function(e,t){t.addEventListener("selectstart",(function(n){t.onmouseup=function(){setTimeout((function(){var t=ke(e[e.currentMode].element);t.trim()?("wysiwyg"===e.currentMode&&e.options.comment.enable&&((0,b.a1)(n.target,"data-type","footnotes-block")||(0,b.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(t)):"wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.hideComment()}))}}))},Oe=function(e,t){var n=(0,N.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var r=(0,b.a1)(n.startContainer,"data-block","0");r||(r=e.sv.element);var o=e.lute.SpinVditorSVDOM(r.textContent);o="<div data-block='0'>"+o.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">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",r.isEqualNode(e.sv.element)?r.innerHTML=o:r.outerHTML=o,z(e.sv.element),(0,N.ib)(e.sv.element,n),Ae(e)},Ne=function(e,t,n){void 0===n&&(n=!0);var r=e;for(3===r.nodeType&&(r=r.parentElement);r;){if(r.getAttribute("data-type")===t)return r;r=n?r.previousElementSibling:r.nextElementSibling}return!1},De=function(e,t){return w("SpinVditorSVDOM",e,"argument",t.options.debugger),e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).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">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",w("SpinVditorSVDOM",e,"result",t.options.debugger),e},Ie=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,r=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"!==t?e.textContent:"",o=!1;for("newline"===t&&(o=!0);n&&!o;){var i=n.getAttribute("data-type");if("li-marker"===i||"blockquote-marker"===i||"task-marker"===i||"padding"===i){var a=n.textContent;if("li-marker"!==i||"code-block-open-marker"!==t&&"code-block-info"!==t)if("code-block-close-marker"===t&&n.nextElementSibling.isSameNode(e)){var l=Ne(e,"code-block-open-marker");l&&l.previousElementSibling&&(n=l.previousElementSibling,r=a+r)}else r=a+r;else r=a.replace(/\S/g," ")+r}else"newline"===i&&(o=!0);n=n.previousElementSibling}return r},je=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,c.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)},Re=function(e,t){var n=(0,N.zh)(e),r=(0,y.S)(n.startContainer,"SPAN");r&&""!==r.textContent.trim()&&(t="\n"+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},Pe=function(e,t,n,r){var o=(0,N.zh)(e),i=t.getAttribute("data-type");0===e.sv.element.childNodes.length&&(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">\n</span></span>',(0,N.ib)(e.sv.element,o));var a=(0,b.F9)(o.startContainer),l=(0,y.S)(o.startContainer,"SPAN");if(a){if("link"===i){var s=void 0;return s=""===o.toString()?"".concat(n).concat(Lute.Caret).concat(r):"".concat(n).concat(o.toString()).concat(r.replace(")",Lute.Caret+")")),void document.execCommand("insertHTML",!1,s)}if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i||"line"===i)return s=void 0,s=""===o.toString()?"".concat(n).concat(Lute.Caret).concat("code"===i?"":r):"".concat(n).concat(o.toString()).concat(Lute.Caret).concat("code"===i?"":r),"table"===i||"code"===i&&l&&""!==l.textContent?s="\n\n"+s:"line"===i&&(s="\n\n".concat(n,"\n").concat(Lute.Caret)),void document.execCommand("insertHTML",!1,s);if(("check"===i||"list"===i||"ordered-list"===i||"quote"===i)&&l){var c="* ";"check"===i?c="* [ ] ":"ordered-list"===i?c="1. ":"quote"===i&&(c="> ");var d=Ne(l,"newline");return d?d.insertAdjacentText("afterend",c):a.insertAdjacentText("afterbegin",c),void U(e)}(0,N.ib)(e.sv.element,o),je(e)}},qe=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},Be=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])}))},ze=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))},Ue=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},Ve=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},We=function(e,t,n){return ze(void 0,void 0,void 0,(function(){var r,o,i,a,l,s,c,d,p,u,f,m,v,h;return Ue(this,(function(g){switch(g.label){case 0:for(r=[],o=!0===e.options.upload.multiple?t.length:1,m=0;m<o;m++)(i=t[m])instanceof DataTransferItem&&(i=i.getAsFile()),r.push(i);return e.options.upload.handler?[4,e.options.upload.handler(r)]:[3,2];case 1:return a=g.sent(),n&&(n.value=""),"string"==typeof a?(e.tip.show(a),[2]):[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(r)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:r=g.sent(),g.label=4;case 4:if(e.options.upload.validate&&"string"==typeof(a=e.options.upload.validate(r)))return e.tip.show(a),[2];if(l=qe(e),e.upload.range=(0,N.zh)(e),0===(s=function(e,t){e.tip.hide();for(var n=[],r="",o="",i=(e.options.lang,e.options,function(i,a){var l=t[a],s=!0;l.name||(r+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),s=!1),l.size>e.options.upload.max&&(r+="<li>".concat(l.name," ").concat(window.VditorI18n.over," ").concat(e.options.upload.max/1024/1024,"M</li>"),s=!1);var c=l.name.lastIndexOf("."),d=l.name.substr(c),p=e.options.upload.filename(l.name.substr(0,c))+d;e.options.upload.accept&&(e.options.upload.accept.split(",").some((function(e){var t=e.trim();if(0===t.indexOf(".")){if(d.toLowerCase()===t.toLowerCase())return!0}else if(l.type.split("/")[0]===t.split("/")[0])return!0;return!1}))||(r+="<li>".concat(l.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),s=!1)),s&&(n.push(l),o+="<li>".concat(p," ").concat(window.VditorI18n.uploading,"</li>"))}),a=t.length,l=0;l<a;l++)i(0,l);return e.tip.show("<ul>".concat(r).concat(o,"</ul>")),n}(e,r)).length)return n&&(n.value=""),[2];for(c=new FormData,d=e.options.upload.extraData,p=0,u=Object.keys(d);p<u.length;p++)f=u[p],c.append(f,d[f]);for(m=0,v=s.length;m<v;m++)c.append(e.options.upload.fieldName,s[m]);return(h=new XMLHttpRequest).open("POST",e.options.upload.url),e.options.upload.token&&h.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(h.withCredentials=!0),Be(e,h),e.upload.isUploading=!0,l.setAttribute("contenteditable","false"),h.onreadystatechange=function(){if(h.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,l.setAttribute("contenteditable","true"),h.status>=200&&h.status<300)if(e.options.upload.success)e.options.upload.success(l,h.responseText);else{var r=h.responseText;e.options.upload.format&&(r=e.options.upload.format(t,h.responseText)),function(e,t){qe(t).focus();var n=JSON.parse(e),r="";1===n.code&&(r="".concat(n.msg)),n.data.errFiles&&n.data.errFiles.length>0&&(r="<ul><li>".concat(r,"</li>"),n.data.errFiles.forEach((function(e){var n=e.lastIndexOf("."),o=t.options.upload.filename(e.substr(0,n))+e.substr(n);r+="<li>".concat(o," ").concat(window.VditorI18n.uploadError,"</li>")})),r+="</ul>"),r?t.tip.show(r):t.tip.hide();var o="";Object.keys(n.data.succMap).forEach((function(e){var r=n.data.succMap[e],i=e.lastIndexOf("."),a=e.substr(i),l=t.options.upload.filename(e.substr(0,i))+a;0===(a=a.toLowerCase()).indexOf(".wav")||0===a.indexOf(".mp3")||0===a.indexOf(".ogg")?"wysiwyg"===t.currentMode?o+='<div class="vditor-wysiwyg__block" data-type="html-block"\n data-block="0"><pre><code><audio controls="controls" src="'.concat(r,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(r,'"></audio></pre></div>\n'):"ir"===t.currentMode?o+='<audio controls="controls" src="'.concat(r,'"></audio>\n'):o+="[".concat(l,"](").concat(r,")\n"):0===a.indexOf(".apng")||0===a.indexOf(".bmp")||0===a.indexOf(".gif")||0===a.indexOf(".ico")||0===a.indexOf(".cur")||0===a.indexOf(".jpg")||0===a.indexOf(".jpeg")||0===a.indexOf(".jfif")||0===a.indexOf(".pjp")||0===a.indexOf(".pjpeg")||0===a.indexOf(".png")||0===a.indexOf(".svg")||0===a.indexOf(".webp")?"wysiwyg"===t.currentMode?o+='<img alt="'.concat(l,'" src="').concat(r,'">\n'):o+=".concat(r,")\n"):"wysiwyg"===t.currentMode?o+='<a href="'.concat(r,'">').concat(l,"</a>\n"):o+="[".concat(l,"](").concat(r,")\n")})),(0,N.Hc)(t.upload.range),document.execCommand("insertHTML",!1,o),t.upload.range=getSelection().getRangeAt(0).cloneRange()}(r,e)}else e.options.upload.error?e.options.upload.error(h.responseText):e.tip.show(h.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},h.upload.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total*100;e.upload.element.style.display="block",e.upload.element.style.width=n+"%"}},h.send(c),[2]}}))}))},Ge=function(e,t,n){var r,i=(0,b.F9)(t.startContainer);if(i||(i=e.wysiwyg.element),n&&"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.inputType||!n){var a=function(e){for(var t=e.previousSibling;t;){if(3!==t.nodeType&&"A"===t.tagName&&!t.previousSibling&&""===t.innerHTML.replace(o.g.ZWSP,"")&&t.nextSibling)return t;t=t.previousSibling}return!1}(t.startContainer);a&&a.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach((function(e){e.remove()})),t.insertNode(document.createElement("wbr")),i.querySelectorAll("[style]").forEach((function(e){e.removeAttribute("style")})),i.querySelectorAll(".vditor-comment").forEach((function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))})),null===(r=i.previousElementSibling)||void 0===r||r.querySelectorAll(".vditor-comment").forEach((function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}));var l="";"link-ref-defs-block"===i.getAttribute("data-type")&&(i=e.wysiwyg.element);var s,c=i.isEqualNode(e.wysiwyg.element),d=(0,b.a1)(i,"data-type","footnotes-block");if(c)l=i.innerHTML;else{var p=(0,b.O9)(t.startContainer);if(p&&!d){var u=(0,y.S)(t.startContainer,"BLOCKQUOTE");i=u?(0,b.F9)(t.startContainer)||i:p}if(d&&(i=d),l=i.outerHTML,"UL"===i.tagName||"OL"===i.tagName){var f=i.previousElementSibling,m=i.nextElementSibling;!f||"UL"!==f.tagName&&"OL"!==f.tagName||(l=f.outerHTML+l,f.remove()),!m||"UL"!==m.tagName&&"OL"!==m.tagName||(l+=m.outerHTML,m.remove()),l=l.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}i.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach((function(e){e&&!i.isEqualNode(e)&&(l+=e.outerHTML,e.remove())})),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach((function(e){e&&!i.isEqualNode(e)&&(l+=e.outerHTML,e.remove())})))}if('<p data-block="0">```<wbr></p>'===(l=l.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,""))&&e.hint.recentLanguage&&(l='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),w("SpinVditorDOM",l,"argument",e.options.debugger),l=e.lute.SpinVditorDOM(l),w("SpinVditorDOM",l,"result",e.options.debugger),c)i.innerHTML=l;else if(i.outerHTML=l,d){var v=(0,b.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(v){var h=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(v.getAttribute("data-marker"),'"]'));h&&h.setAttribute("aria-label",v.textContent.trim().substr(0,24))}}var g,E=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");E.forEach((function(e,t){0===t?s=e:(s.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())})),E.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",E[0]);var k=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");k.forEach((function(e,t){0===t?g=e:(g.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())})),k.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",k[0]),(0,N.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach((function(t){O(t,e)})),n&&("deleteContentBackward"===n.inputType||"deleteContentForward"===n.inputType)&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}D(e),Q(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},Fe=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Ke=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))},Ze=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},Je=function(e,t,n){if(229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&"sv"!==t.currentMode){var r=(0,b.F9)(n);if(r&&""===r.textContent.trim())return t[t.currentMode].composingLock=!0,!1}return!0},Xe=function(e,t,n){if(!("Enter"===n.key||"Tab"===n.key||"Backspace"===n.key||n.key.indexOf("Arrow")>-1||(0,c.yl)(n)||"Escape"===n.key||n.shiftKey||n.altKey)){var r=(0,b.lG)(e.startContainer,"P")||(0,b.lG)(e.startContainer,"LI");if(r&&0===(0,N.im)(r,t[t.currentMode].element,e).start){r.nodeValue&&(r.nodeValue=r.nodeValue.replace(/\u2006/g,""));var i=document.createTextNode(o.g.ZWSP);e.insertNode(i),e.setStartAfter(i)}}},Ye=function(e,t){if("ArrowDown"===t||"ArrowUp"===t){var n=(0,b.a1)(e.startContainer,"data-type","math-inline")||(0,b.a1)(e.startContainer,"data-type","html-entity")||(0,b.a1)(e.startContainer,"data-type","html-inline");n&&("ArrowDown"===t&&e.setStartAfter(n.parentElement),"ArrowUp"===t&&e.setStartBefore(n.parentElement))}},Qe=function(e,t){var n=(0,N.zh)(e),r=(0,b.F9)(n.startContainer);r&&(r.insertAdjacentHTML(t,'<p data-block="0">'.concat(o.g.ZWSP,"<wbr>\n</p>")),(0,N.ib)(e[e.currentMode].element,n),ve(e),dt(e))},$e=function(e){var t=(0,b.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},et=function(e){var t=(0,b.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},tt=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling;return r||(r=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:"TBODY"===e.parentElement.parentElement.tagName&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),r&&(t.selectNodeContents(r),n||t.collapse(!1),(0,N.Hc)(t)),r},nt=function(e,t,n,r,i){var a=(0,N.im)(r,e[e.currentMode].element,n);if("ArrowDown"===t.key&&-1===r.textContent.trimRight().substr(a.start).indexOf("\n")||"ArrowRight"===t.key&&a.start>=r.textContent.trimRight().length){var l=i.nextElementSibling;return!l||l&&("TABLE"===l.tagName||l.getAttribute("data-type"))?(i.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(o.g.ZWSP,"<wbr></p>")),(0,N.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(l),n.collapse(!0),(0,N.Hc)(n)),t.preventDefault(),!0}return!1},rt=function(e,t,n,r,i){var a=(0,N.im)(r,e[e.currentMode].element,n);if("ArrowUp"===t.key&&-1===r.textContent.substr(0,a.start).indexOf("\n")||("ArrowLeft"===t.key||"Backspace"===t.key&&""===n.toString())&&0===a.start){var l=i.previousElementSibling;return!l||l&&("TABLE"===l.tagName||l.getAttribute("data-type"))?(i.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(o.g.ZWSP,"<wbr></p>")),(0,N.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(l),n.collapse(!1),(0,N.Hc)(n)),t.preventDefault(),!0}return!1},ot=function(e,t,n,r){void 0===r&&(r=!0);var o=(0,b.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach((function(e){e.remove()})),t.insertNode(document.createElement("wbr")),r&&o){for(var i="",a=0;a<o.parentElement.childElementCount;a++){var l=o.parentElement.children[a].querySelector("input");l&&l.remove(),i+='<p data-block="0">'.concat(o.parentElement.children[a].innerHTML.trimLeft(),"</p>")}o.parentElement.insertAdjacentHTML("beforebegin",i),o.parentElement.remove()}else if(o)if("check"===n)o.parentElement.querySelectorAll("li").forEach((function(e){e.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(0===e.textContent.indexOf(" ")?"":" ")),e.classList.add("vditor-task")}));else{o.querySelector("input")&&o.parentElement.querySelectorAll("li").forEach((function(e){e.querySelector("input").remove(),e.classList.remove("vditor-task")}));var s=void 0;"list"===n?(s=document.createElement("ul")).setAttribute("data-marker","*"):(s=document.createElement("ol")).setAttribute("data-marker","1."),s.setAttribute("data-block","0"),s.setAttribute("data-tight",o.parentElement.getAttribute("data-tight")),s.innerHTML=o.parentElement.innerHTML,o.parentElement.parentNode.replaceChild(s,o.parentElement)}else{var c=(0,b.a1)(t.startContainer,"data-block","0");c||(e[e.currentMode].element.querySelector("wbr").remove(),(c=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),"check"===n?(c.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(c.innerHTML,"</li></ul>")),c.remove()):"list"===n?(c.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(c.innerHTML,"</li></ul>")),c.remove()):"ordered-list"===n&&(c.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(c.innerHTML,"</li></ol>")),c.remove())}},it=function(e,t,n){var r=t.previousElementSibling;if(t&&r){var o=[t];Array.from(n.cloneContents().children).forEach((function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&o.push(t),t=t.nextElementSibling)})),e[e.currentMode].element.querySelectorAll("wbr").forEach((function(e){e.remove()})),n.insertNode(document.createElement("wbr"));var i=r.parentElement,a="";o.forEach((function(e){var t=e.getAttribute("data-marker");1!==t.length&&(t="1".concat(t.slice(-1))),a+='<li data-node-id="'.concat(e.getAttribute("data-node-id"),'" data-marker="').concat(t,'">').concat(e.innerHTML,"</li>"),e.remove()})),r.insertAdjacentHTML("beforeend","<".concat(i.tagName,' data-block="0">').concat(a,"</").concat(i.tagName,">")),"wysiwyg"===e.currentMode?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,N.ib)(e[e.currentMode].element,n);var l=(0,b.O9)(n.startContainer);l&&l.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach((function(t){O(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")})),dt(e),ve(e)}else e[e.currentMode].element.focus()},at=function(e,t,n,r){var o=(0,b.lG)(t.parentElement,"LI");if(o){e[e.currentMode].element.querySelectorAll("wbr").forEach((function(e){e.remove()})),n.insertNode(document.createElement("wbr"));var i=t.parentElement,a=i.cloneNode(),l=[t];Array.from(n.cloneContents().children).forEach((function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&l.push(t),t=t.nextElementSibling)}));var s=!1,c="";i.querySelectorAll("li").forEach((function(e){s&&(c+=e.outerHTML,e.nextElementSibling||e.previousElementSibling?e.remove():e.parentElement.remove()),e.isSameNode(l[l.length-1])&&(s=!0)})),l.reverse().forEach((function(e){o.insertAdjacentElement("afterend",e)})),c&&(a.innerHTML=c,l[0].insertAdjacentElement("beforeend",a)),"wysiwyg"===e.currentMode?r.outerHTML=e.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=e.lute.SpinVditorIRDOM(r.outerHTML),(0,N.ib)(e[e.currentMode].element,n);var d=(0,b.O9)(n.startContainer);d&&d.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach((function(t){O(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")})),dt(e),ve(e)}else e[e.currentMode].element.focus()},lt=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,r=e.rows[0].cells.length,o=e.rows.length,i=0,a=0;a<o;a++)for(var l=0;l<r;l++)if(e.rows[a].cells[l].isSameNode(n)){i=l;break}for(var s=0;s<o;s++)e.rows[s].cells[i].setAttribute("align",t)},st=function(e){var t=e.trimRight().split("\n").pop();return""!==t&&(""===t.replace(/ |-/g,"")||""===t.replace(/ |_/g,"")||""===t.replace(/ |\*/g,""))&&t.replace(/ /g,"").length>2&&!(t.indexOf("-")>-1&&-1===t.trimLeft().indexOf(" ")&&e.trimRight().split("\n").length>1)&&0!==t.indexOf(" ")&&0!==t.indexOf("\t")},ct=function(e){var t=e.trimRight().split("\n");return 0!==(e=t.pop()).indexOf(" ")&&0!==e.indexOf("\t")&&""!==(e=e.trimLeft())&&0!==t.length&&(""===e.replace(/-/g,"")||""===e.replace(/=/g,""))},dt=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),"wysiwyg"===e.currentMode?Q(e,t):"ir"===e.currentMode?Ct(e,t):"sv"===e.currentMode&&je(e,t)},pt=function(e,t,n,r){var i,a=e.startContainer,l=(0,b.lG)(a,"LI");if(l){if(!(0,c.yl)(r)&&!r.altKey&&"Enter"===r.key&&!r.shiftKey&&n&&l.contains(n)&&n.nextElementSibling)return l&&!l.textContent.endsWith("\n")&&l.insertAdjacentText("beforeend","\n"),e.insertNode(document.createTextNode("\n\n")),e.collapse(!1),dt(t),r.preventDefault(),!0;if(!((0,c.yl)(r)||r.shiftKey||r.altKey||"Backspace"!==r.key||l.previousElementSibling||""!==e.toString()||0!==(0,N.im)(l,t[t.currentMode].element,e).start))return l.nextElementSibling?(l.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(l.innerHTML,"</p>")),l.remove()):l.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(l.innerHTML,"</p>"),(0,N.ib)(t[t.currentMode].element,e),dt(t),r.preventDefault(),!0;if(!(0,c.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&""===l.textContent.trim().replace(o.g.ZWSP,"")&&""===e.toString()&&"LI"===(null===(i=l.previousElementSibling)||void 0===i?void 0:i.tagName))return l.previousElementSibling.insertAdjacentText("beforeend","\n\n"),e.selectNodeContents(l.previousElementSibling),e.collapse(!1),l.remove(),(0,N.ib)(t[t.currentMode].element,e),dt(t),r.preventDefault(),!0;if(!(0,c.yl)(r)&&!r.altKey&&"Tab"===r.key){var s=!1;if((0===e.startOffset&&(3===a.nodeType&&!a.previousSibling||3!==a.nodeType&&"LI"===a.nodeName)||l.classList.contains("vditor-task")&&1===e.startOffset&&3!==a.previousSibling.nodeType&&"INPUT"===a.previousSibling.tagName)&&(s=!0),s||""!==e.toString())return r.shiftKey?at(t,l,e,l.parentElement):it(t,l,e),r.preventDefault(),!0}}return!1},ut=function(e,t,n){if(e.options.tab&&"Tab"===n.key)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,N.Hc)(t),dt(e),n.preventDefault(),!0},ft=function(e,t,n,r){if(n){if(!(0,c.yl)(e)&&!e.altKey&&"Enter"===e.key){var o=String.raw(J||(J=Fe(["",""],["",""])),n.textContent).replace(/\\\|/g,"").trim(),i=o.split("|");if(o.startsWith("|")&&o.endsWith("|")&&i.length>3){var a=i.map((function(){return"---"})).join("|");return a=n.textContent+"\n"+a.substring(3,a.length-3)+"\n|<wbr>",n.outerHTML=t.lute.SpinVditorDOM(a),(0,N.ib)(t[t.currentMode].element,r),dt(t),Ae(t),e.preventDefault(),!0}if(st(n.innerHTML)&&n.previousElementSibling){var l="",s=n.innerHTML.trimRight().split("\n");return s.length>1&&(s.pop(),l='<p data-block="0">'.concat(s.join("\n"),"</p>")),n.insertAdjacentHTML("afterend","".concat(l,'<hr data-block="0"><p data-block="0"><wbr>\n</p>')),n.remove(),(0,N.ib)(t[t.currentMode].element,r),dt(t),Ae(t),e.preventDefault(),!0}if(ct(n.innerHTML))return"wysiwyg"===t.currentMode?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'),(0,N.ib)(t[t.currentMode].element,r),dt(t),Ae(t),e.preventDefault(),!0}if(r.collapsed&&n.previousElementSibling&&"Backspace"===e.key&&!(0,c.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split("\n").length>1&&0===(0,N.im)(n,t[t.currentMode].element,r).start){var d=(0,b.DX)(n.previousElementSibling);return d.textContent.endsWith("\n")||(d.textContent=d.textContent+"\n"),d.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(n.innerHTML)),n.remove(),(0,N.ib)(t[t.currentMode].element,r),!1}return!1}},mt=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)r+='<td align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </td>');"TH"===n.tagName?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(r,"</tr></tbody>")):n.parentElement.insertAdjacentHTML("afterend","<tr>".concat(r,"</tr>")),dt(e)},vt=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)"TH"===n.tagName?r+='<th align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </th>'):r+='<td align="'.concat(n.parentElement.children[o].getAttribute("align"),'"> </td>');if("TH"===n.tagName){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(r,"</tr></thead>")),t.insertNode(document.createElement("wbr"));var i=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",i),n.parentElement.parentElement.remove(),(0,N.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(r,"</tr>"));dt(e)},ht=function(e,t,n,r){void 0===r&&(r="afterend");for(var o=0,i=n.previousElementSibling;i;)o++,i=i.previousElementSibling;for(var a=0;a<t.rows.length;a++)0===a?t.rows[a].cells[o].insertAdjacentHTML(r,"<th> </th>"):t.rows[a].cells[o].insertAdjacentHTML(r,"<td> </td>");dt(e)},gt=function(e,t,n){if("TD"===n.tagName){var r=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(r.previousElementSibling.lastElementChild.lastElementChild),1===r.childElementCount?r.remove():n.parentElement.remove(),t.collapse(!1),(0,N.Hc)(t),dt(e)}},bt=function(e,t,n,r){for(var o=0,i=r.previousElementSibling;i;)o++,i=i.previousElementSibling;(r.previousElementSibling||r.nextElementSibling)&&(t.selectNodeContents(r.previousElementSibling||r.nextElementSibling),t.collapse(!0));for(var a=0;a<n.rows.length;a++){var l=n.rows[a].cells;if(1===l.length){n.remove(),ve(e);break}l[o].remove()}(0,N.Hc)(t),dt(e)},yt=function(e,t,n){var r=n.startContainer,o=(0,b.lG)(r,"TD")||(0,b.lG)(r,"TH");if(o){if(!(0,c.yl)(t)&&!t.altKey&&"Enter"===t.key){o.lastElementChild&&(!o.lastElementChild||o.lastElementChild.isSameNode(o.lastChild)&&"BR"===o.lastElementChild.tagName)||o.insertAdjacentHTML("beforeend","<br>");var i=document.createElement("br");return n.insertNode(i),n.setStartAfter(i),dt(e),Ae(e),t.preventDefault(),!0}if("Tab"===t.key)return t.shiftKey?(tt(o,n),t.preventDefault(),!0):((p=o.nextElementSibling)||(p=o.parentElement.nextElementSibling?o.parentElement.nextElementSibling.firstElementChild:"THEAD"===o.parentElement.parentElement.tagName&&o.parentElement.parentElement.nextElementSibling?o.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),p&&(n.selectNodeContents(p),(0,N.Hc)(n)),t.preventDefault(),!0);var a=o.parentElement.parentElement.parentElement;if("ArrowUp"===t.key){if(t.preventDefault(),"TH"===o.tagName)return a.previousElementSibling?(n.selectNodeContents(a.previousElementSibling),n.collapse(!1),(0,N.Hc)(n)):Qe(e,"beforebegin"),!0;for(var l=0,s=o.parentElement;l<s.cells.length&&!s.cells[l].isSameNode(o);l++);var d=s.previousElementSibling;return d||(d=s.parentElement.previousElementSibling.firstChild),n.selectNodeContents(d.cells[l]),n.collapse(!1),(0,N.Hc)(n),!0}if("ArrowDown"===t.key){var p;if(t.preventDefault(),!(s=o.parentElement).nextElementSibling&&"TD"===o.tagName)return a.nextElementSibling?(n.selectNodeContents(a.nextElementSibling),n.collapse(!0),(0,N.Hc)(n)):Qe(e,"afterend"),!0;for(l=0;l<s.cells.length&&!s.cells[l].isSameNode(o);l++);return(p=s.nextElementSibling)||(p=s.parentElement.nextElementSibling.firstChild),n.selectNodeContents(p.cells[l]),n.collapse(!0),(0,N.Hc)(n),!0}if("wysiwyg"===e.currentMode&&!(0,c.yl)(t)&&"Enter"===t.key&&!t.shiftKey&&t.altKey){var u=e.wysiwyg.popover.querySelector(".vditor-input");return u.focus(),u.select(),t.preventDefault(),!0}if(!(0,c.yl)(t)&&!t.shiftKey&&!t.altKey&&"Backspace"===t.key&&0===n.startOffset&&""===n.toString())return!tt(o,n,!1)&&a&&(""===a.textContent.trim()?(a.outerHTML='<p data-block="0"><wbr>\n</p>',(0,N.ib)(e[e.currentMode].element,n)):(n.setStartBefore(a),n.collapse(!0)),dt(e)),t.preventDefault(),!0;if(P("⇧⌘F",t))return vt(e,n,o),t.preventDefault(),!0;if(P("⌘=",t))return mt(e,n,o),t.preventDefault(),!0;if(P("⇧⌘G",t))return ht(e,a,o,"beforebegin"),t.preventDefault(),!0;if(P("⇧⌘=",t))return ht(e,a,o),t.preventDefault(),!0;if(P("⌘-",t))return gt(e,n,o),t.preventDefault(),!0;if(P("⇧⌘-",t))return bt(e,n,a,o),t.preventDefault(),!0;if(P("⇧⌘L",t)){if("ir"===e.currentMode)return lt(a,"left"),dt(e),t.preventDefault(),!0;if(f=e.wysiwyg.popover.querySelector('[data-type="left"]'))return f.click(),t.preventDefault(),!0}if(P("⇧⌘C",t)){if("ir"===e.currentMode)return lt(a,"center"),dt(e),t.preventDefault(),!0;if(f=e.wysiwyg.popover.querySelector('[data-type="center"]'))return f.click(),t.preventDefault(),!0}if(P("⇧⌘R",t)){if("ir"===e.currentMode)return lt(a,"right"),dt(e),t.preventDefault(),!0;var f;if(f=e.wysiwyg.popover.querySelector('[data-type="right"]'))return f.click(),t.preventDefault(),!0}}return!1},wt=function(e,t,n,r){if("PRE"===n.tagName&&P("⌘A",t))return r.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&"Tab"===t.key&&!t.shiftKey&&""===r.toString())return r.insertNode(document.createTextNode(e.options.tab)),r.collapse(!1),dt(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,c.yl)(t)&&!t.shiftKey&&!t.altKey){var o=(0,N.im)(n,e[e.currentMode].element,r);if((0===o.start||1===o.start&&"\n"===n.innerText)&&""===r.toString())return n.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(n.firstElementChild.innerHTML,"</p>"),(0,N.ib)(e[e.currentMode].element,r),dt(e),t.preventDefault(),!0}return!(0,c.yl)(t)&&!t.altKey&&"Enter"===t.key&&(n.firstElementChild.textContent.endsWith("\n")||n.firstElementChild.insertAdjacentText("beforeend","\n"),r.extractContents(),r.insertNode(document.createTextNode("\n")),r.collapse(!1),(0,N.Hc)(r),(0,c.vU)()||("wysiwyg"===e.currentMode?Ge(e,r):R(e,r)),Ae(e),t.preventDefault(),!0)},Et=function(e,t,n,r){var i=t.startContainer,a=(0,b.lG)(i,"BLOCKQUOTE");if(a&&""===t.toString()){if("Backspace"===n.key&&!(0,c.yl)(n)&&!n.shiftKey&&!n.altKey&&0===(0,N.im)(a,e[e.currentMode].element,t).start)return t.insertNode(document.createElement("wbr")),a.outerHTML=a.innerHTML,(0,N.ib)(e[e.currentMode].element,t),dt(e),n.preventDefault(),!0;if(r&&"Enter"===n.key&&!(0,c.yl)(n)&&!n.shiftKey&&!n.altKey&&"BLOCKQUOTE"===r.parentElement.tagName){var l=!1;if("\n"===r.innerHTML.replace(o.g.ZWSP,"")||""===r.innerHTML.replace(o.g.ZWSP,"")?(l=!0,r.remove()):r.innerHTML.endsWith("\n\n")&&(0,N.im)(r,e[e.currentMode].element,t).start===r.textContent.length-1&&(r.innerHTML=r.innerHTML.substr(0,r.innerHTML.length-2),l=!0),l)return a.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(o.g.ZWSP,"<wbr>\n</p>")),(0,N.ib)(e[e.currentMode].element,t),dt(e),n.preventDefault(),!0}var s=(0,b.F9)(i);if("wysiwyg"===e.currentMode&&s&&P("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),s.outerHTML='<blockquote data-block="0">'.concat(s.outerHTML,"</blockquote>"),(0,N.ib)(e.wysiwyg.element,t),Q(e),n.preventDefault(),!0;if(nt(e,n,t,a,a))return!0;if(rt(e,n,t,a,a))return!0}return!1},kt=function(e,t,n){var r=t.startContainer,o=(0,b.fb)(r,"vditor-task");if(o){if(P("⇧⌘J",n)){var i=o.firstElementChild;return i.checked?i.removeAttribute("checked"):i.setAttribute("checked","checked"),dt(e),n.preventDefault(),!0}if("Backspace"===n.key&&!(0,c.yl)(n)&&!n.shiftKey&&!n.altKey&&""===t.toString()&&1===t.startOffset&&(3===r.nodeType&&r.previousSibling&&"INPUT"===r.previousSibling.tagName||3!==r.nodeType)){var a=o.previousElementSibling;return o.querySelector("input").remove(),a?((0,b.DX)(a).parentElement.insertAdjacentHTML("beforeend","<wbr>"+o.innerHTML.trim()),o.remove()):(o.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(o.innerHTML.trim()||"\n","</p>")),o.nextElementSibling?o.remove():o.parentElement.remove()),(0,N.ib)(e[e.currentMode].element,t),dt(e),n.preventDefault(),!0}if("Enter"===n.key&&!(0,c.yl)(n)&&!n.shiftKey&&!n.altKey){if(""===o.textContent.trim())if((0,b.fb)(o.parentElement,"vditor-task")){var l=(0,b.O9)(r);l&&at(e,o,t,l)}else if(o.nextElementSibling){var s="",d="",p=!1;Array.from(o.parentElement.children).forEach((function(e){o.isSameNode(e)?p=!0:p?s+=e.outerHTML:d+=e.outerHTML}));var u=o.parentElement.tagName,f="OL"===o.parentElement.tagName?"":' data-marker="'.concat(o.parentElement.getAttribute("data-marker"),'"'),m="";d&&(m="UL"===o.parentElement.tagName?"":' start="1"',d="<".concat(u,' data-tight="true"').concat(f,' data-block="0">').concat(d,"</").concat(u,">")),o.parentElement.outerHTML="".concat(d,'<p data-block="0"><wbr>\n</p><').concat(u,'\n data-tight="true"').concat(f,' data-block="0"').concat(m,">").concat(s,"</").concat(u,">")}else o.parentElement.insertAdjacentHTML("afterend",'<p data-block="0"><wbr>\n</p>'),1===o.parentElement.querySelectorAll("li").length?o.parentElement.remove():o.remove();else 3!==r.nodeType&&0===t.startOffset&&"INPUT"===r.firstChild.tagName?t.setStart(r.childNodes[1],1):(t.setEndAfter(o.lastChild),o.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(o.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(t.extractContents()));return(0,N.ib)(e[e.currentMode].element,t),dt(e),Ae(e),n.preventDefault(),!0}}return!1},xt=function(e,t,n,r){if(3!==t.startContainer.nodeType){var o=t.startContainer.children[t.startOffset];if(o&&"HR"===o.tagName)return t.selectNodeContents(o.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(r){var i=r.previousElementSibling;if(i&&0===(0,N.im)(r,e[e.currentMode].element,t).start&&((0,c.vU)()&&"HR"===i.tagName||"TABLE"===i.tagName)){if("TABLE"===i.tagName){var a=i.lastElementChild.lastElementChild.lastElementChild;a.innerHTML=a.innerHTML.trimLeft()+"<wbr>"+r.textContent.trim(),r.remove()}else i.remove();return(0,N.ib)(e[e.currentMode].element,t),dt(e),n.preventDefault(),!0}}return!1},St=function(e){(0,c.vU)()&&3!==e.startContainer.nodeType&&"HR"===e.startContainer.tagName&&e.setStartBefore(e.startContainer)},_t=function(e,t,n){var r,o;if(!(0,c.vU)())return!1;if("ArrowUp"===e.key&&t&&"TABLE"===(null===(r=t.previousElementSibling)||void 0===r?void 0:r.tagName)){var i=t.previousElementSibling;return n.selectNodeContents(i.rows[i.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!("ArrowDown"!==e.key||!t||"TABLE"!==(null===(o=t.nextElementSibling)||void 0===o?void 0:o.tagName)||(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),0))},Lt=function(e,t,n){return Ke(void 0,void 0,void 0,(function(){var r,i,a,l,s,c,d,p,u,f,m,v,h,g,y,w;return Ze(this,(function(E){switch(E.label){case 0:return"true"!==e[e.currentMode].element.getAttribute("contenteditable")?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(r=t.clipboardData.getData("text/html"),i=t.clipboardData.getData("text/plain"),a=t.clipboardData.files):(r=t.dataTransfer.getData("text/html"),i=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(a=t.dataTransfer.items)),l={},s=function(t,n){if(!n)return["",Lute.WalkContinue];if(e.options.upload.renderLinkDest)return e.options.upload.renderLinkDest(e,t,n);var r=t.TokensStr();if(34===t.__internal_object__.Parent.Type&&r&&-1===r.indexOf("file://")&&e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&o.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(o.withCredentials=!0),Be(e,o),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status){var t=o.responseText;e.options.upload.linkToImgFormat&&(t=e.options.upload.linkToImgFormat(o.responseText));var n=JSON.parse(t);if(0!==n.code)return void e.tip.show(n.msg);var r=n.data.originalURL;if("sv"===e.currentMode)e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach((function(e){e.textContent===r&&(e.textContent=n.data.url)}));else{var i=e[e.currentMode].element.querySelector('img[src="'.concat(r,'"]'));i.src=n.data.url,"ir"===e.currentMode&&(i.previousElementSibling.previousElementSibling.innerHTML=n.data.url)}dt(e)}else e.tip.show(o.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(o.responseText)}},o.send(JSON.stringify({url:r}))}return"ir"===e.currentMode?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]:"wysiwyg"===e.currentMode?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]},r.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'.concat(i,'">').concat(i,"</a>")&&r.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='\x3c!--StartFragment--\x3e<a href="'.concat(i,'">').concat(i,"</a>\x3c!--EndFragment--\x3e")||(r=""),(c=(new DOMParser).parseFromString(r,"text/html")).body&&(r=c.body.innerHTML),r=Lute.Sanitize(r),e.wysiwyg.getComments(e),d=e[e.currentMode].element.scrollHeight,p=function(e,t,n){void 0===n&&(n="sv");var r=document.createElement("div");r.innerHTML=e;var o=!1;1===r.childElementCount&&r.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(o=!0);var i=r.querySelectorAll("pre");if(1===r.childElementCount&&1===i.length&&"vditor-wysiwyg"!==i[0].className&&"vditor-sv"!==i[0].className&&(o=!0),0===e.indexOf('\n<p class="p1">')&&(o=!0),1===r.childElementCount&&"TABLE"===r.firstElementChild.tagName&&r.querySelector(".line-number")&&r.querySelector(".line-content")&&(o=!0),o){var a=t||e;return/\n/.test(a)||1===i.length?"wysiwyg"===n?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(a.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+a.replace(/&/g,"&").replace(/</g,"<")+"\n```":"wysiwyg"===n?"<code>".concat(a.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(a,"`")}return!1}(r,i,e.currentMode),(u="sv"===e.currentMode?(0,b.a1)(t.target,"data-type","code-block"):(0,b.lG)(t.target,"CODE"))?("sv"===e.currentMode?document.execCommand("insertHTML",!1,i.replace(/&/g,"&").replace(/</g,"<")):(f=(0,N.im)(t.target,e[e.currentMode].element),"PRE"!==u.parentElement.tagName&&(i+=o.g.ZWSP),u.textContent=u.textContent.substring(0,f.start)+i+u.textContent.substring(f.end),(0,N.$j)(f.start+i.length,f.start+i.length,u.parentElement),(null===(w=u.parentElement)||void 0===w?void 0:w.nextElementSibling.classList.contains("vditor-".concat(e.currentMode,"__preview")))&&(u.parentElement.nextElementSibling.innerHTML=u.outerHTML,O(u.parentElement.nextElementSibling,e))),[3,8]):[3,1]);case 1:return p?(n.pasteCode(p),[3,8]):[3,2];case 2:return""===r.trim()?[3,3]:((m=document.createElement("div")).innerHTML=r,m.querySelectorAll("[style]").forEach((function(e){e.removeAttribute("style")})),m.querySelectorAll(".vditor-copy").forEach((function(e){e.remove()})),"ir"===e.currentMode?(l.HTML2VditorIRDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,N.oC)(e.lute.HTML2VditorIRDOM(m.innerHTML),e)):"wysiwyg"===e.currentMode?(l.HTML2VditorDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,N.oC)(e.lute.HTML2VditorDOM(m.innerHTML),e)):(l.Md2VditorSVDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),Oe(e,e.lute.HTML2Md(m.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return a.length>0?e.options.upload.url||e.options.upload.handler?[4,We(e,a)]:[3,5]:[3,7];case 4:return E.sent(),[3,6];case 5:v=new FileReader,"clipboardData"in t?(a=t.clipboardData.files,h=a[0]):t.dataTransfer.types.includes("Files")&&(a=t.dataTransfer.items,h=a[0].getAsFile()),h&&h.type.startsWith("image")&&(v.readAsDataURL(h),v.onload=function(){var t="";"wysiwyg"===e.currentMode?t+='<img alt="'.concat(h.name,'" src="').concat(v.result.toString(),'">\n'):t+=".concat(v.result.toString(),")\n"),document.execCommand("insertHTML",!1,t)}),E.label=6;case 6:return[3,8];case 7:""!==i.trim()&&0===a.length&&(""!==(y=(0,N.zh)(e)).toString()&&e.lute.IsValidLinkDest(i)&&(i="[".concat(y.toString(),"](").concat(i,")")),"ir"===e.currentMode?(l.Md2VditorIRDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,N.oC)(e.lute.Md2VditorIRDOM(i),e)):"wysiwyg"===e.currentMode?(l.Md2VditorDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,N.oC)(e.lute.Md2VditorDOM(i),e)):(l.Md2VditorSVDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),Oe(e,i)),e.outline.render(e)),E.label=8;case 8:return"sv"!==e.currentMode&&((g=(0,b.F9)((0,N.zh)(e).startContainer))&&(y=(0,N.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach((function(e){e.remove()})),y.insertNode(document.createElement("wbr")),"wysiwyg"===e.currentMode?g.outerHTML=e.lute.SpinVditorDOM(g.outerHTML):g.outerHTML=e.lute.SpinVditorIRDOM(g.outerHTML),(0,N.ib)(e[e.currentMode].element,y)),e[e.currentMode].element.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach((function(t){O(t,e)}))),e.wysiwyg.triggerRemoveComment(e),dt(e),e[e.currentMode].element.scrollHeight-d>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&Ae(e),[2]}}))}))},Tt=function(e){e.hint.render(e);var t=(0,N.zh)(e).startContainer,n=(0,b.a1)(t,"data-type","code-block-info");if(n)if(""===n.textContent.replace(o.g.ZWSP,"")&&e.hint.recentLanguage)n.textContent=o.g.ZWSP+e.hint.recentLanguage,(0,N.zh)(e).selectNodeContents(n);else{var r=[],i=n.textContent.substring(0,(0,N.im)(n,e.ir.element).start).replace(o.g.ZWSP,"");(e.options.preview.hljs.langs||o.g.CODE_LANGUAGES).forEach((function(e){e.indexOf(i.toLowerCase())>-1&&r.push({html:e,value:e})})),e.hint.genHTML(r,i,e)}},Ct=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&Tt(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout((function(){if(!e.ir.composingLock){var n=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,c.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)},At=function(e,t){var n=(0,N.zh)(e),r=(0,b.F9)(n.startContainer)||n.startContainer;if(r){var o=r.querySelector(".vditor-ir__marker--heading");o?o.innerHTML=t:(r.insertAdjacentText("afterbegin",t),n.selectNodeContents(r),n.collapse(!1)),R(e,n.cloneRange()),Y(e)}},Mt=function(e,t,n){var r=(0,b.a1)(e.startContainer,"data-type",n);if(r){r.firstElementChild.remove(),r.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var o=document.createElement("div");o.innerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),r.outerHTML=o.firstElementChild.innerHTML.trim()}},Ht=function(e,t,n,r){var o=(0,N.zh)(e),i=t.getAttribute("data-type"),a=o.startContainer;3===a.nodeType&&(a=a.parentElement);var l=!0;if(t.classList.contains("vditor-menu--current"))if("quote"===i){var s=(0,b.lG)(a,"BLOCKQUOTE");s&&(o.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'.concat(s.innerHTML,"</p>"):s.innerHTML)}else if("link"===i){var c=(0,b.a1)(o.startContainer,"data-type","a");if(c){var p=(0,b.fb)(o.startContainer,"vditor-ir__link");p?(o.insertNode(document.createElement("wbr")),c.outerHTML=p.innerHTML):c.outerHTML=c.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else"italic"===i?Mt(o,e,"em"):"bold"===i?Mt(o,e,"strong"):"strike"===i?Mt(o,e,"s"):"inline-code"===i?Mt(o,e,"code"):"check"!==i&&"list"!==i&&"ordered-list"!==i||(ot(e,o,i),l=!1,t.classList.remove("vditor-menu--current"));else{0===e.ir.element.childNodes.length&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,N.ib)(e.ir.element,o));var u=(0,b.F9)(o.startContainer);if("line"===i){if(u){var f='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===u.innerHTML.trim()?u.outerHTML=f:u.insertAdjacentHTML("afterend",f)}}else if("quote"===i)u&&(o.insertNode(document.createElement("wbr")),u.outerHTML='<blockquote data-block="0">'.concat(u.outerHTML,"</blockquote>"),l=!1,t.classList.add("vditor-menu--current"));else if("link"===i){var m=void 0;m=""===o.toString()?"".concat(n,"<wbr>").concat(r):"".concat(n).concat(o.toString()).concat(r.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,m),l=!1,t.classList.add("vditor-menu--current")}else if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i){m=void 0,""===o.toString()?m="".concat(n,"<wbr>").concat(r):(m="code"===i?"".concat(n,"\n").concat(o.toString(),"<wbr>").concat(r):"table"===i?"".concat(n).concat(o.toString(),"<wbr>").concat(r):"".concat(n).concat(o.toString()).concat(r,"<wbr>"),o.deleteContents()),"table"!==i&&"code"!==i||(m="\n"+m+"\n\n");var v=document.createElement("span");v.innerHTML=m,o.insertNode(v),R(e,o),"table"===i&&(o.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,N.Hc)(o))}else"check"!==i&&"list"!==i&&"ordered-list"!==i||(ot(e,o,i,!1),l=!1,d(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,N.ib)(e.ir.element,o),Ct(e),l&&Y(e)},Ot=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))},Nt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},Dt=function(){function e(e){var t=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(e,n){t.element.style.display="none";var r=decodeURIComponent(e.getAttribute("data-value")),i=window.getSelection().getRangeAt(0);if("ir"===n.currentMode){var a=(0,b.a1)(i.startContainer,"data-type","code-block-info");if(a)return a.textContent=o.g.ZWSP+r.trimRight(),i.selectNodeContents(a),i.collapse(!1),Ct(n),a.parentElement.querySelectorAll("code").forEach((function(e){e.className="language-"+r.trimRight()})),O(a.parentElement.querySelector(".vditor-ir__preview"),n),void(t.recentLanguage=r.trimRight())}if("wysiwyg"===n.currentMode&&3!==i.startContainer.nodeType){var l=i.startContainer,s=void 0;if((s=l.classList.contains("vditor-input")?l:l.firstElementChild)&&s.classList.contains("vditor-input"))return s.value=r.trimRight(),i.selectNodeContents(s),i.collapse(!1),s.dispatchEvent(new CustomEvent("input",{detail:1})),void(t.recentLanguage=r.trimRight())}if(i.setStart(i.startContainer,t.lastIndex),i.deleteContents(),n.options.hint.parse?"sv"===n.currentMode?(0,N.oC)(n.lute.SpinVditorSVDOM(r),n):"wysiwyg"===n.currentMode?(0,N.oC)(n.lute.SpinVditorDOM(r),n):(0,N.oC)(n.lute.SpinVditorIRDOM(r),n):(0,N.oC)(r,n),":"===t.splitChar&&r.indexOf(":")>-1&&"sv"!==n.currentMode&&i.insertNode(document.createTextNode(" ")),i.collapse(!1),(0,N.Hc)(i),"wysiwyg"===n.currentMode)(c=(0,b.fb)(i.startContainer,"vditor-wysiwyg__block"))&&c.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(c.lastElementChild.innerHTML=c.firstElementChild.innerHTML,O(c.lastElementChild,n));else if("ir"===n.currentMode){var c;(c=(0,b.fb)(i.startContainer,"vditor-ir__marker--pre"))&&c.nextElementSibling.classList.contains("vditor-ir__preview")&&(c.nextElementSibling.innerHTML=c.innerHTML,O(c.nextElementSibling,n))}dt(n)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",e.push({key:":"})}return e.prototype.render=function(e){var t=this;if(window.getSelection().focusNode){var n,r=getSelection().getRangeAt(0);n=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(n,e.options.hint.extend);if(void 0===o)this.element.style.display="none",clearTimeout(this.timeId);else if(":"===this.splitChar){var i=""===o?e.options.hint.emoji:e.lute.GetEmojis(),a=[];Object.keys(i).forEach((function(e){0===e.indexOf(o.toLowerCase())&&(i[e].indexOf(".")>-1?a.push({html:'<img src="'.concat(i[e],'" title=":').concat(e,':"/> :').concat(e,":"),value:":".concat(e,":")}):a.push({html:'<span class="vditor-hint__emoji">'.concat(i[e],"</span>").concat(e),value:i[e]}))})),this.genHTML(a,o,e)}else e.options.hint.extend.forEach((function(n){n.key===t.splitChar&&(clearTimeout(t.timeId),t.timeId=window.setTimeout((function(){return Ot(t,void 0,void 0,(function(){var t;return Nt(this,(function(r){switch(r.label){case 0:return t=this.genHTML,[4,n.hint(o)];case 1:return t.apply(this,[r.sent(),o,e]),[2]}}))}))}),e.options.hint.delay))}))}},e.prototype.genHTML=function(e,t,n){var r=this;if(0!==e.length){var o=n[n.currentMode].element,i=(0,N.Ny)(o),a=i.left+("left"===n.options.outline.position?n.outline.element.offsetWidth:0),l=i.top,s="";e.forEach((function(e,n){if(!(n>7)){var r=e.html;if(""!==t){var o=r.lastIndexOf(">")+1,i=r.substr(o),a=i.toLowerCase().indexOf(t.toLowerCase());a>-1&&(i=i.substring(0,a)+"<b>"+i.substring(a,a+t.length)+"</b>"+i.substring(a+t.length),r=r.substr(0,o)+i)}s+='<button type="button" data-value="'.concat(encodeURIComponent(e.value),' "\n').concat(0===n?"class='vditor-hint--current'":"","> ").concat(r,"</button>")}})),this.element.innerHTML=s;var c=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(l+(c||22),"px"),this.element.style.left="".concat(a,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach((function(e){e.addEventListener("click",(function(t){r.fillEmoji(e,n),t.preventDefault()}))})),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(l-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(e,t){if(0===this.element.querySelectorAll("button").length||"none"===this.element.style.display)return!1;var n=this.element.querySelector(".vditor-hint--current");if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.nextElementSibling?n.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.previousElementSibling)n.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,c.yl)(e)||e.shiftKey||e.altKey||"Enter"!==e.key||e.isComposing||(e.preventDefault(),e.stopPropagation(),this.fillEmoji(n,t),0))},e.prototype.getKey=function(e,t){var n,r=this;if(this.lastIndex=-1,this.splitChar="",t.forEach((function(t){var n=e.lastIndexOf(t.key);r.lastIndex<n&&(r.splitChar=t.key,r.lastIndex=n)})),-1===this.lastIndex)return n;var o=e.split(this.splitChar),a=o[o.length-1];if(o.length>1&&a.trim()===a)if(2===o.length&&""===o[0]&&o[1].length<32)n=o[1];else{var l=o[o.length-2].slice(-1);" "===(0,i.X)(l)&&a.length<32&&(n=a)}return n},e}(),It=function(){function e(e){this.composingLock=!1;var t=document.createElement("div");t.className="vditor-ir",t.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>'),this.element=t.firstElementChild,this.bindEvent(e),xe(e,this.element),Se(e,this.element),_e(e,this.element),Me(e,this.element),He(e,this.element),Le(e,this.element),Te(e,this.element,this.copy),Ce(e,this.element,this.copy)}return e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=document.createElement("div");r.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorIRDOM2Md(r.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",(function(t){Lt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})),this.element.addEventListener("scroll",(function(){h(e,["hint"])})),this.element.addEventListener("compositionstart",(function(e){t.composingLock=!0})),this.element.addEventListener("compositionend",(function(n){(0,c.vU)()||R(e,getSelection().getRangeAt(0).cloneRange()),t.composingLock=!1})),this.element.addEventListener("input",(function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType)return t.preventInput?(t.preventInput=!1,void Ct(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data||R(e,getSelection().getRangeAt(0).cloneRange(),!1,n))})),this.element.addEventListener("click",(function(n){if("INPUT"===n.target.tagName)return n.target.checked?n.target.setAttribute("checked","checked"):n.target.removeAttribute("checked"),t.preventInput=!0,void Ct(e);var r=(0,N.zh)(e),i=(0,b.fb)(n.target,"vditor-ir__preview");if(i||(i=(0,b.fb)(r.startContainer,"vditor-ir__preview")),i&&(i.previousElementSibling.firstElementChild?r.selectNodeContents(i.previousElementSibling.firstElementChild):r.selectNodeContents(i.previousElementSibling),r.collapse(!0),(0,N.Hc)(r),Ae(e)),"IMG"===n.target.tagName){var a=n.target.parentElement.querySelector(".vditor-ir__marker--link");a&&(r.selectNode(a),(0,N.Hc)(r))}var l=(0,b.a1)(n.target,"data-type","a");if(!l||l.classList.contains("vditor-ir__node--expand")){if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&r.collapsed){var s=t.element.lastElementChild.getBoundingClientRect();n.y>s.top+s.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(o.g.ZWSP,"")?(r.selectNodeContents(t.element.lastElementChild),r.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(o.g.ZWSP,"<wbr></p>")),(0,N.ib)(t.element,r)))}""===r.toString()?q(r,e):setTimeout((function(){q((0,N.zh)(e),e)})),I(n,e),Y(e)}else e.options.link.click?e.options.link.click(l.querySelector(":scope > .vditor-ir__marker--link")):e.options.link.isOpen&&window.open(l.querySelector(":scope > .vditor-ir__marker--link").textContent)})),this.element.addEventListener("keyup",(function(n){if(!n.isComposing&&!(0,c.yl)(n))if("Enter"===n.key&&Ae(e),Y(e),"Backspace"!==n.key&&"Delete"!==n.key||""===e.ir.element.innerHTML||1!==e.ir.element.childNodes.length||!e.ir.element.firstElementChild||"P"!==e.ir.element.firstElementChild.tagName||0!==e.ir.element.firstElementChild.childElementCount||""!==e.ir.element.textContent&&"\n"!==e.ir.element.textContent){var r=(0,N.zh)(e);"Backspace"===n.key?((0,c.vU)()&&"\n"===r.startContainer.textContent&&1===r.startOffset&&(r.startContainer.textContent="",q(r,e)),t.element.querySelectorAll(".language-math").forEach((function(e){var t=e.querySelector("br");t&&t.remove()}))):n.key.indexOf("Arrow")>-1?("ArrowLeft"!==n.key&&"ArrowRight"!==n.key||Tt(e),q(r,e)):229===n.keyCode&&""===n.code&&"Unidentified"===n.key&&q(r,e);var i=(0,b.fb)(r.startContainer,"vditor-ir__preview");if(i){if("ArrowUp"===n.key||"ArrowLeft"===n.key)return i.previousElementSibling.firstElementChild?r.selectNodeContents(i.previousElementSibling.firstElementChild):r.selectNodeContents(i.previousElementSibling),r.collapse(!1),n.preventDefault(),!0;if("SPAN"===i.tagName&&("ArrowDown"===n.key||"ArrowRight"===n.key))return"html-entity"===i.parentElement.getAttribute("data-type")?(i.parentElement.insertAdjacentText("afterend",o.g.ZWSP),r.setStart(i.parentElement.nextSibling,1)):r.selectNodeContents(i.parentElement.lastElementChild),r.collapse(!1),n.preventDefault(),!0}}else e.ir.element.innerHTML=""}))},e}(),jt=function(e){return"sv"===e.currentMode?e.lute.Md2HTML(a(e)):"wysiwyg"===e.currentMode?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},Rt=n(65),Pt=n(182),qt=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(e,'</div>\n<div class="vditor-outline__content"></div>')}return e.prototype.render=function(e){return"block"===e.preview.element.style.display?(0,Pt.k)(e.preview.previewElement,this.element.lastElementChild,e):(0,Pt.k)(e[e.currentMode].element,this.element.lastElementChild,e)},e.prototype.toggle=function(e,t,n){var r;void 0===t&&(t=!0),void 0===n&&(n=!0);var i=null===(r=e.toolbar.elements.outline)||void 0===r?void 0:r.firstElementChild;if(t&&window.innerWidth>=o.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(e),null==i||i.classList.add("vditor-menu--current")):(this.element.style.display="none",null==i||i.classList.remove("vditor-menu--current")),n&&getSelection().rangeCount>0){var a=getSelection().getRangeAt(0);e[e.currentMode].element.contains(a.startContainer)&&(0,N.Hc)(a)}G(e)},e}(),Bt=n(431),zt=function(){function e(e){var t=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",e.options.classes.preview&&this.previewElement.classList.add(e.options.classes.preview),this.previewElement.style.maxWidth=e.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",(function(n){if("TEXTAREA"!==n.target.tagName){var r=document.createElement("div");r.className="vditor-reset",r.appendChild(getSelection().getRangeAt(0).cloneContents()),t.copyToX(e,r,"default"),n.preventDefault()}})),this.previewElement.addEventListener("click",(function(n){var r=(0,b.lG)(n.target,"SPAN");if(r&&(0,b.fb)(r,"vditor-toc")){var o=t.previewElement.querySelector("#"+r.getAttribute("data-target-id"));o&&(t.element.scrollTop=o.offsetTop)}else{if("A"===n.target.tagName)return e.options.link.click?e.options.link.click(n.target):e.options.link.isOpen&&window.open(n.target.getAttribute("href")),void n.preventDefault();"IMG"===n.target.tagName&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,B.E)(n.target,e.options.lang,e.options.theme))}})),this.element.appendChild(this.previewElement);var n=e.options.preview.actions;if(0!==n.length){var r=document.createElement("div");r.className="vditor-preview__action";for(var o=[],i=0;i<n.length;i++){var a=n[i];if("object"!=typeof a)switch(a){case"desktop":o.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":o.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":o.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":o.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":o.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}else o.push('<button type="button" data-type="'.concat(a.key,'" class="').concat(a.className,'"').concat(a.tooltip?' aria-label="'.concat(a.tooltip,'"'):"",'">').concat(a.text,"</button>"))}r.innerHTML=o.join(""),r.addEventListener((0,c.Le)(),(function(o){var i=(0,y.S)(o.target,"BUTTON");if(i){var a=i.getAttribute("data-type"),l=n.find((function(e){return(null==e?void 0:e.key)===a}));l?l.click(a):"mp-wechat"!==a&&"zhihu"!==a?(t.previewElement.style.width="desktop"===a?"auto":"tablet"===a?"780px":"360px",t.previewElement.scrollWidth>t.previewElement.parentElement.clientWidth&&(t.previewElement.style.width="auto"),t.render(e),r.querySelectorAll("button").forEach((function(e){e.classList.remove("vditor-preview__action--current")})),i.classList.add("vditor-preview__action--current")):t.copyToX(e,t.previewElement.cloneNode(!0),a)}})),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(e,t){var n=this;if(clearTimeout(this.mdTimeoutId),"none"!==this.element.style.display)if(t)this.previewElement.innerHTML=t;else if(""!==a(e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")){var r=(new Date).getTime(),o=a(e);this.mdTimeoutId=window.setTimeout((function(){if(e.options.preview.url){var t=new XMLHttpRequest;t.open("POST",e.options.preview.url),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE)if(200===t.status){var i=JSON.parse(t.responseText);if(0!==i.code)return void e.tip.show(i.msg);e.options.preview.transform&&(i.data=e.options.preview.transform(i.data)),n.previewElement.innerHTML=i.data,n.afterRender(e,r)}else{var a=e.lute.Md2HTML(o);e.options.preview.transform&&(a=e.options.preview.transform(a)),n.previewElement.innerHTML=a,n.afterRender(e,r)}},t.send(JSON.stringify({markdownText:o}))}else{var i=e.lute.Md2HTML(o);e.options.preview.transform&&(i=e.options.preview.transform(i)),n.previewElement.innerHTML=i,n.afterRender(e,r)}}),e.options.preview.delay)}else this.previewElement.innerHTML="";else"renderPerformance"===this.element.getAttribute("data-type")&&e.tip.hide()},e.prototype.afterRender=function(e,t){e.options.preview.parse&&e.options.preview.parse(this.element);var n=(new Date).getTime()-t;(new Date).getTime()-t>2600?(e.tip.show(window.VditorI18n.performanceTip.replace("${x}",n.toString())),e.preview.element.setAttribute("data-type","renderPerformance")):"renderPerformance"===e.preview.element.getAttribute("data-type")&&(e.tip.hide(),e.preview.element.removeAttribute("data-type"));var r=e.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,x.O)(e.preview.previewElement,e.options.preview.hljs),(0,L.s)(e.options.preview.hljs,e.preview.previewElement,e.options.cdn),(0,C.i)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,A.K)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,S.P)(e.preview.previewElement,e.options.cdn),(0,_.v)(e.preview.previewElement,e.options.cdn),(0,k.p)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,M.P)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,H.B)(e.preview.previewElement,e.options.cdn),(0,E.Q)(e.preview.previewElement,e.options.cdn),e.options.preview.render.media.enable&&(0,Bt.Y)(e.preview.previewElement),e.options.customRenders.forEach((function(t){t.render(e.preview.previewElement,e)}));var o=e.preview.element,i=e.outline.render(e);""===i&&(i="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach((function(t){t.innerHTML=i,(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})})),(0,T.H)(e.preview.previewElement,{cdn:e.options.cdn,math:e.options.preview.math})},e.prototype.copyToX=function(e,t,n){void 0===n&&(n="mp-wechat"),"zhihu"!==n?t.querySelectorAll(".katex-html .base").forEach((function(e){e.style.display="initial"})):t.querySelectorAll(".language-math").forEach((function(e){e.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'.concat(e.getAttribute("data-math"),'\\" style="display: block; margin: 0 auto; max-width: 100%;">')})),t.style.backgroundColor="#fff",t.querySelectorAll("code").forEach((function(e){e.style.backgroundImage="none"})),this.element.append(t);var r=t.ownerDocument.createRange();r.selectNode(t),(0,N.Hc)(r),document.execCommand("copy"),t.remove(),e.tip.show(["zhihu","mp-wechat"].includes(n)?"已复制,可到".concat("zhihu"===n?"知乎":"微信公众号平台","进行粘贴"):"已复制到剪切板")},e}(),Ut=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--".concat(e.options.resize.position),this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(e)}return e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("mousedown",(function(n){var r=document,o=n.clientY,i=e.element.offsetHeight,a=63+e.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),t.element.classList.add("vditor-resize--selected"),r.onmousemove=function(t){"top"===e.options.resize.position?e.element.style.height=Math.max(a,i+(o-t.clientY))+"px":e.element.style.height=Math.max(a,i+(t.clientY-o))+"px",e.options.typewriterMode&&(e.sv.element.style.paddingBottom=e.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){e.options.resize.after&&e.options.resize.after(e.element.offsetHeight-i),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,t.element.classList.remove("vditor-resize--selected")}}))},e}(),Vt=function(){function e(e){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",e.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(e),xe(e,this.element),_e(e,this.element),Me(e,this.element),He(e,this.element),Le(e,this.element),Te(e,this.element,this.copy),Ce(e,this.element,this.copy)}return e.prototype.copy=function(e,t){e.stopPropagation(),e.preventDefault(),e.clipboardData.setData("text/plain",ke(t[t.currentMode].element))},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",(function(t){Lt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})),this.element.addEventListener("scroll",(function(){if("block"===e.preview.element.style.display){var n=t.element.scrollTop,r=t.element.clientHeight,o=t.element.scrollHeight-parseFloat(t.element.style.paddingBottom||"0"),i=e.preview.element;i.scrollTop=n/r>.5?(n+r)*i.scrollHeight/o-r:n*i.scrollHeight/o}})),this.element.addEventListener("compositionstart",(function(e){t.composingLock=!0})),this.element.addEventListener("compositionend",(function(n){(0,c.vU)()||U(e,n),t.composingLock=!1})),this.element.addEventListener("input",(function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&!t.composingLock&&"‘"!==n.data&&"“"!==n.data&&"《"!==n.data)return t.preventInput?(t.preventInput=!1,void je(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void U(e,n)})),this.element.addEventListener("keyup",(function(t){t.isComposing||(0,c.yl)(t)||("Backspace"!==t.key&&"Delete"!==t.key||""===e.sv.element.innerHTML||1!==e.sv.element.childNodes.length||!e.sv.element.firstElementChild||"DIV"!==e.sv.element.firstElementChild.tagName||2!==e.sv.element.firstElementChild.childElementCount||""!==e.sv.element.firstElementChild.textContent&&"\n"!==e.sv.element.textContent?"Enter"===t.key&&Ae(e):e.sv.element.innerHTML="")}))},e}(),Wt=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(e,t){var n=this;void 0===t&&(t=6e3),this.element.className="vditor-tip vditor-tip--show",0===t?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,'\n<div class="vditor-tip__close">X</div></div>'),this.element.querySelector(".vditor-tip__close").addEventListener("click",(function(){n.hide()}))):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,"</div>"),setTimeout((function(){n.hide()}),t)),this.element.removeAttribute("style"),setTimeout((function(){n.element.getBoundingClientRect().top<46&&(n.element.style.position="fixed",n.element.style.top="46px")}),150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),Gt=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",d(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},Ft=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return"both"===t.options.preview.mode&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,c.Le)(),(function(e){r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.preventDefault(),"sv"===t.currentMode&&("both"===t.options.preview.mode?Gt("editor",t):Gt("both",t)))})),r}return Ft(t,e),t}(be),Zt=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},Jt=n(34),Xt=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yt=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=r.element.children[0],a=document.createElement("div");a.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var l="";return o.g.CODE_THEME.forEach((function(e){l+="<button>".concat(e,"</button>")})),a.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(l,"</div>"),a.addEventListener((0,c.Le)(),(function(e){"BUTTON"===e.target.tagName&&(h(t,["subToolbar"]),t.options.preview.hljs.style=e.target.textContent,(0,Jt.Y)(e.target.textContent,t.options.cdn),e.preventDefault(),e.stopPropagation())})),r.element.appendChild(a),g(t,a,i,n.level),r}return Xt(t,e),t}(be),Qt=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$t=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var a="";return Object.keys(t.options.preview.theme.list).forEach((function(e){a+='<button data-type="'.concat(e,'">').concat(t.options.preview.theme.list[e],"</button>")})),i.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(a,"</div>"),i.addEventListener((0,c.Le)(),(function(e){"BUTTON"===e.target.tagName&&(h(t,["subToolbar"]),t.options.preview.theme.current=e.target.getAttribute("data-type"),(0,V.Z)(t.options.preview.theme.current,t.options.preview.theme.path),e.preventDefault(),e.stopPropagation())})),r.element.appendChild(i),g(t,i,o,n.level),r}return Qt(t,e),t}(be),en=function(){function e(e){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(e,"")}return e.prototype.render=function(e,t){var n=t.endsWith("\n")?t.length-1:t.length;if("text"===e.options.counter.type&&e[e.currentMode]){var r=e[e.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach((function(e){e.remove()})),n=r.textContent.length}"number"==typeof e.options.counter.max?(n>e.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(n,"/").concat(e.options.counter.max)):this.element.innerHTML="".concat(n),this.element.setAttribute("aria-label",e.options.counter.type),e.options.counter.after&&e.options.counter.after(n,{enable:e.options.counter.enable,max:e.options.counter.max,type:e.options.counter.type})},e}(),tn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].innerHTML=n.icon,r.element.children[0].addEventListener((0,c.Le)(),(function(e){e.preventDefault(),e.currentTarget.classList.contains(o.g.CLASS_MENU_DISABLED)||n.click(e,t)})),r}return tn(t,e),t}(be),rn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),on=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.firstElementChild.addEventListener((0,c.Le)(),(function(e){var n=r.element.firstElementChild;n.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.preventDefault(),n.classList.contains("vditor-menu--current")?(n.classList.remove("vditor-menu--current"),t.devtools.element.style.display="none",G(t)):(n.classList.add("vditor-menu--current"),t.devtools.element.style.display="block",G(t),t.devtools.renderEchart(t)))})),r}return rn(t,e),t}(be),an=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},ln=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sn=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var i="";return Object.keys(t.options.hint.emoji).forEach((function(e){var n=t.options.hint.emoji[e];n.indexOf(".")>-1?i+='<button data-value=":'.concat(e,': " data-key=":').concat(e,':"><img\ndata-value=":').concat(e,': " data-key=":').concat(e,':" class="vditor-emojis__icon" src="').concat(n,'"/></button>'):i+='<button data-value="'.concat(n,' "\n data-key="').concat(e,'"><span class="vditor-emojis__icon">').concat(n,"</span></button>")})),o.innerHTML='<div class="vditor-emojis" style="max-height: '.concat("auto"===t.options.height?"auto":t.options.height-80,'px">').concat(i,'</div><div class="vditor-emojis__tail">\n <span class="vditor-emojis__tip"></span><span>').concat(t.options.hint.emojiTail||"","</span>\n</div>"),r.element.appendChild(o),g(t,o,r.element.firstElementChild,n.level),r.bindEvent(t),r}return ln(t,e),t.prototype.bindEvent=function(e){var t=this;this.element.lastElementChild.addEventListener((0,c.Le)(),(function(n){var r=(0,y.S)(n.target,"BUTTON");if(r){n.preventDefault();var o=r.getAttribute("data-value"),i=(0,N.zh)(e),a=o;if("wysiwyg"===e.currentMode?a=e.lute.SpinVditorDOM(o):"ir"===e.currentMode&&(a=e.lute.SpinVditorIRDOM(o)),o.indexOf(":")>-1&&"sv"!==e.currentMode){var l=document.createElement("div");l.innerHTML=a,a=l.firstElementChild.firstElementChild.outerHTML+" ",(0,N.oC)(a,e)}else i.extractContents(),i.insertNode(document.createTextNode(o));i.collapse(!1),(0,N.Hc)(i),t.element.lastElementChild.style.display="none",dt(e)}})),this.element.lastElementChild.addEventListener("mouseover",(function(e){var n=(0,y.S)(e.target,"BUTTON");n&&(t.element.querySelector(".vditor-emojis__tip").innerHTML=n.getAttribute("data-key"))}))},t}(be),cn=function(e,t,n){var r=document.createElement("a");"download"in r?(r.download=n,r.style.display="none",r.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(r),r.click(),r.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},dn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pn=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");return i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),i.innerHTML='<button data-type="markdown">Markdown</button>\n<button data-type="pdf">PDF</button>\n<button data-type="html">HTML</button>',i.addEventListener((0,c.Le)(),(function(e){var n=e.target;if("BUTTON"===n.tagName){switch(n.getAttribute("data-type")){case"markdown":!function(e){var t=a(e);cn(e,t,t.substr(0,10)+".md")}(t);break;case"pdf":!function(e){e.tip.show(window.VditorI18n.generate,3800);var t=document.querySelector("#vditorExportIframe");t.contentDocument.open(),t.contentDocument.write('<link rel="stylesheet" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script>\n<div id="preview" style="width: 800px"></div>\n<script>\nwindow.addEventListener("message", (e) => {\n if(!e.data) {\n return;\n }\n Vditor.preview(document.getElementById(\'preview\'), e.data, {\n cdn: "').concat(e.options.cdn,'",\n markdown: {\n theme: ').concat(JSON.stringify(e.options.preview.theme),'\n },\n hljs: {\n style: "').concat(e.options.preview.hljs.style,'"\n }\n });\n setTimeout(() => {\n window.print();\n }, 3600);\n}, false);\n<\/script>')),t.contentDocument.close(),setTimeout((function(){t.contentWindow.postMessage(a(e),"*")}),200)}(t);break;case"html":!function(e){var t=jt(e),n='<html><head><link rel="stylesheet" type="text/css" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,"/dist/js/i18n/").concat(e.options.lang,'.js"><\/script>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script></head>\n<body><div class="vditor-reset" id="preview">').concat(t,"</div>\n<script>\n const previewElement = document.getElementById('preview')\n Vditor.setContentTheme('").concat(e.options.preview.theme.current,"', '").concat(e.options.preview.theme.path,"');\n Vditor.codeRender(previewElement);\n Vditor.highlightRender(").concat(JSON.stringify(e.options.preview.hljs),", previewElement, '").concat(e.options.cdn,"');\n Vditor.mathRender(previewElement, {\n cdn: '").concat(e.options.cdn,"',\n math: ").concat(JSON.stringify(e.options.preview.math),",\n });\n Vditor.mermaidRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.markmapRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.flowchartRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.graphvizRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.chartRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.mindmapRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.abcRender(previewElement, '").concat(e.options.cdn,"');\n ").concat(e.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",'\n Vditor.speechRender(previewElement);\n<\/script>\n<script src="').concat(e.options.cdn,"/dist/js/icons/").concat(e.options.icon,'.js"><\/script></body></html>');cn(e,n,t.substr(0,10)+".html")}(t)}h(t,["subToolbar"]),e.preventDefault(),e.stopPropagation()}})),r.element.appendChild(i),g(t,i,o,n.level),r}return dn(t,e),t}(be),un=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t,n),r}return un(t,e),t.prototype._bindEvent=function(e,t){this.element.children[0].addEventListener((0,c.Le)(),(function(n){n.preventDefault(),e.element.className.includes("vditor--fullscreen")?(t.level||(this.innerHTML=t.icon),e.element.style.zIndex="",document.body.style.overflow="",e.element.classList.remove("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach((function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__s","__n"),e.options.toolbar.forEach((function(e){"string"!=typeof e&&e.tipPosition&&e.name===n.dataset.type&&(n.className="vditor-tooltipped vditor-tooltipped__".concat(e.tipPosition))})))})),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__s","__n"))):(t.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),e.element.style.zIndex=e.options.fullscreen.index.toString(),document.body.style.overflow="hidden",e.element.classList.add("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach((function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__n","__s"))})),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__n","__s"))),e.devtools&&e.devtools.renderEchart(e),t.click&&t.click(n,e),G(e),F(e)}))},t}(be),mn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vn=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint vditor-panel--arrow",o.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,c.ns)("<⌥⌘1>"),'</button>\n<button data-tag="h2" data-value="## ">').concat(window.VditorI18n.heading2," <").concat((0,c.ns)("⌥⌘2"),'></button>\n<button data-tag="h3" data-value="### ">').concat(window.VditorI18n.heading3," <").concat((0,c.ns)("⌥⌘3"),'></button>\n<button data-tag="h4" data-value="#### ">').concat(window.VditorI18n.heading4," <").concat((0,c.ns)("⌥⌘4"),'></button>\n<button data-tag="h5" data-value="##### ">').concat(window.VditorI18n.heading5," <").concat((0,c.ns)("⌥⌘5"),'></button>\n<button data-tag="h6" data-value="###### ">').concat(window.VditorI18n.heading6," <").concat((0,c.ns)("⌥⌘6"),"></button>"),r.element.appendChild(o),r._bindEvent(t,o),r}return mn(t,e),t.prototype._bindEvent=function(e,t){var n=this.element.children[0];n.addEventListener((0,c.Le)(),(function(r){r.preventDefault(),clearTimeout(e.wysiwyg.afterRenderTimeoutId),clearTimeout(e.ir.processTimeoutId),clearTimeout(e.sv.processTimeoutId),n.classList.contains(o.g.CLASS_MENU_DISABLED)||(n.blur(),n.classList.contains("vditor-menu--current")?("wysiwyg"===e.currentMode?(re(e),Q(e)):"ir"===e.currentMode&&At(e,""),n.classList.remove("vditor-menu--current")):(h(e,["subToolbar"]),t.style.display="block"))}));for(var r=0;r<6;r++)t.children.item(r).addEventListener((0,c.Le)(),(function(r){r.preventDefault(),"wysiwyg"===e.currentMode?(ne(e,r.target.getAttribute("data-tag")),Q(e),n.classList.add("vditor-menu--current")):"ir"===e.currentMode?(At(e,r.target.getAttribute("data-value")),n.classList.add("vditor-menu--current")):Re(e,r.target.getAttribute("data-value")),t.style.display="none"}))},t}(be),hn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,c.Le)(),(function(e){e.preventDefault(),t.tip.show('<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">\n<div style="margin-top: 14px;flex: 1">\n <div>Markdown 使用指南</div>\n <ul style="list-style: none">\n <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>\n <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>\n <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>\n <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>\n </ul>\n</div>\n<div style="margin-top: 14px;flex: 1">\n <div>Vditor 支持</div>\n <ul style="list-style: none">\n <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>\n <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>\n <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>\n <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>\n </ul>\n</div></div>',0)})),r}return hn(t,e),t}(be),bn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,c.Le)(),(function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,N.zh)(t),i=(0,b.lG)(n.startContainer,"LI");i&&it(t,i,n)}})),r}return bn(t,e),t}(be),wn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),En=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,c.Le)(),(function(e){e.preventDefault(),t.tip.show('<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">\n<p style="text-align: center;margin: 14px 0">\n <em>下一代的 Markdown 编辑器,为未来而构建</em>\n</p>\n<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">\n <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>\n <div> </div>\n <div style="flex: 1;min-width: 250px">\n Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。\n 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。\n </div>\n</div>\n<div style="display: flex;flex-wrap: wrap;">\n <ul style="list-style: none;flex: 1;min-width:148px">\n <li>\n 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>\n </li>\n <li>\n 开源协议:MIT\n </li>\n </ul>\n <ul style="list-style: none;margin-right: 18px">\n <li>\n 组件版本:Vditor v'.concat(o.H," / Lute v").concat(Lute.Version,'\n </li>\n <li>\n 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>\n </li>\n </ul>\n</div>\n</div>'),0)})),r}return wn(t,e),t}(be),kn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,c.Le)(),(function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||Qe(t,"afterend")})),r}return kn(t,e),t}(be),Sn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_n=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,c.Le)(),(function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||Qe(t,"beforebegin")})),r}return Sn(t,e),t}(be),Ln=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,c.Le)(),(function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,N.zh)(t),i=(0,b.lG)(n.startContainer,"LI");i&&at(t,i,n,i.parentElement)}})),r}return Ln(t,e),t}(be),Cn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),An=function(e){function t(t,n){var r=e.call(this,t,n)||this;return t.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,c.Le)(),(function(e){e.preventDefault(),t.toolbar.elements.outline.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||(t.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),t.outline.toggle(t,t.options.outline.enable))})),r}return Cn(t,e),t}(be),Mn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return Mn(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,c.Le)(),(function(n){n.preventDefault();var r=t.element.firstElementChild;if(!r.classList.contains(o.g.CLASS_MENU_DISABLED)){var i=o.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);r.classList.contains("vditor-menu--current")?(r.classList.remove("vditor-menu--current"),"sv"===e.currentMode?(e.sv.element.style.display="block","both"===e.options.preview.mode?e.preview.element.style.display="block":e.preview.element.style.display="none"):(e[e.currentMode].element.parentElement.style.display="block",e.preview.element.style.display="none"),u(e.toolbar.elements,i),e.outline.render(e)):(f(e.toolbar.elements,i),e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),r.classList.add("vditor-menu--current"),h(e,["subToolbar","hint","popover"]),setTimeout((function(){e.outline.render(e)}),e.options.preview.delay+10)),G(e)}}))},t}(be),On=function(){function e(e){var t;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)t=new AudioContext;else{if(!webkitAudioContext)return;t=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=t.sampleRate;var n=t.createGain();t.createMediaStreamSource(e).connect(n),this.recorder=t.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(t.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(e,t){this.leftChannel.push(new Float32Array(e)),this.rightChannel.push(new Float32Array(t)),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 e=this.mergeBuffers(this.leftChannel),t=this.mergeBuffers(this.rightChannel),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=.5*(e[r]+t[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var o=44+2*n.length,i=new ArrayBuffer(o),a=new DataView(i);this.writeUTFBytes(a,0,"RIFF"),a.setUint32(4,o,!0),this.writeUTFBytes(a,8,"WAVE"),this.writeUTFBytes(a,12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,this.SAMPLE_RATE,!0),a.setUint32(28,2*this.SAMPLE_RATE,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0);var l=2*n.length;this.writeUTFBytes(a,36,"data"),a.setUint32(40,l,!0);for(var s=n.length,c=44,d=0;d<s;d++)a.setInt16(c,32767*n[d],!0),c+=2;return new Blob([a],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(e,t){if(t===this.DEFAULT_SAMPLE_RATE)return e;if(t>this.DEFAULT_SAMPLE_RATE)return e;for(var n=this.DEFAULT_SAMPLE_RATE/t,r=Math.round(e.length/n),o=new Float32Array(r),i=0,a=0;i<o.length;){for(var l=Math.round((i+1)*n),s=0,c=0,d=a;d<l&&d<e.length;d++)s+=e[d],c++;o[i]=s/c,i++,a=l}return o},e.prototype.mergeBuffers=function(e){for(var t=new Float32Array(this.recordingLength),n=0,r=e.length,o=0;o<r;++o){var i=e[o];t.set(i,n),n+=i.length}return t},e.prototype.writeUTFBytes=function(e,t,n){for(var r=n.length,o=0;o<r;o++)e.setUint8(t+o,n.charCodeAt(o))},e}(),Nn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return Nn(t,e),t.prototype._bindEvent=function(e){var t,n=this;this.element.children[0].addEventListener((0,c.Le)(),(function(r){if(r.preventDefault(),!n.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)){var i=e[e.currentMode].element;if(t)if(t.isRecording){t.stopRecording(),e.tip.hide();var a=new File([t.buildWavFileBlob()],"record".concat((new Date).getTime(),".wav"),{type:"video/webm"});We(e,[a]),n.element.children[0].classList.remove("vditor-menu--current")}else e.tip.show(window.VditorI18n.recording),i.setAttribute("contenteditable","false"),t.startRecordingNewWavFile(),n.element.children[0].classList.add("vditor-menu--current");else navigator.mediaDevices.getUserMedia({audio:!0}).then((function(r){(t=new On(r)).recorder.onaudioprocess=function(e){if(t.isRecording){var n=e.inputBuffer.getChannelData(0),r=e.inputBuffer.getChannelData(1);t.cloneChannelData(n,r)}},t.startRecordingNewWavFile(),e.tip.show(window.VditorI18n.recording),i.setAttribute("contenteditable","false"),n.element.children[0].classList.add("vditor-menu--current")})).catch((function(){e.tip.show(window.VditorI18n["record-tip"])}))}}))},t}(be),In=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,c.Le)(),(function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||t.undo.redo(t)})),r}return In(t,e),t}(be),Rn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,c.Le)(),(function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||t.undo.undo(t)})),r}return Rn(t,e),t}(be),qn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bn=function(e){function t(t,n){var r=e.call(this,t,n)||this,o='<input type="file"';return t.options.upload.multiple&&(o+=' multiple="multiple"'),t.options.upload.accept&&(o+=' accept="'.concat(t.options.upload.accept,'"')),r.element.children[0].innerHTML="".concat(n.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>').concat(o,">"),r._bindEvent(t),r}return qn(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,c.Le)(),(function(e){if(t.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED))return e.stopPropagation(),void e.preventDefault()})),this.element.querySelector("input").addEventListener("change",(function(n){if(t.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED))return n.stopPropagation(),void n.preventDefault();0!==n.target.files.length&&We(e,n.target.files,n.target)}))},t}(be),zn=function(){function e(e){var t=this,n=e.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",n.toolbar.forEach((function(n,r){var o=t.genItem(e,n,r);if(t.element.appendChild(o),n.toolbar){var i=document.createElement("div");i.className="vditor-hint vditor-panel--arrow",i.addEventListener((0,c.Le)(),(function(e){i.style.display="none"})),n.toolbar.forEach((function(n,o){n.level=2,i.appendChild(t.genItem(e,n,r+o))})),o.appendChild(i),g(e,i,o.children[0])}})),e.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),e.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),e.options.counter.enable&&(e.counter=new en(e),this.element.appendChild(e.counter.element))}return e.prototype.updateConfig=function(e,t){e.options.toolbarConfig=Object.assign({hide:!1,pin:!1},t),e.options.toolbarConfig.hide?this.element.classList.add("vditor-toolbar--hide"):this.element.classList.remove("vditor-toolbar--hide"),e.options.toolbarConfig.pin?this.element.classList.add("vditor-toolbar--pin"):this.element.classList.remove("vditor-toolbar--pin")},e.prototype.genItem=function(e,t,n){var r;switch(t.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 be(e,t);break;case"emoji":r=new sn(e,t);break;case"headings":r=new vn(e,t);break;case"|":r=new an;break;case"br":r=new Zt;break;case"undo":r=new Pn(e,t);break;case"redo":r=new jn(e,t);break;case"help":r=new gn(e,t);break;case"both":r=new Kt(e,t);break;case"preview":r=new Hn(e,t);break;case"fullscreen":r=new fn(e,t);break;case"upload":r=new Bn(e,t);break;case"record":r=new Dn(e,t);break;case"info":r=new En(e,t);break;case"edit-mode":r=new Ee(e,t);break;case"devtools":r=new on(e,t);break;case"outdent":r=new Tn(e,t);break;case"indent":r=new yn(e,t);break;case"outline":r=new An(e,t);break;case"insert-after":r=new xn(e,t);break;case"insert-before":r=new _n(e,t);break;case"code-theme":r=new Yt(e,t);break;case"content-theme":r=new $t(e,t);break;case"export":r=new pn(e,t);break;default:r=new nn(e,t)}if(r){var o=t.name;return"br"!==o&&"|"!==o||(o+=n),this.elements[o]=r.element,r.element}},e}(),Un=n(85),Vn=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new Un}return e.prototype.clearStack=function(e){this.resetStack(),this.resetIcon(e)},e.prototype.resetIcon=function(e){e.toolbar&&(this[e.currentMode].undoStack.length>1?u(e.toolbar.elements,["undo"]):f(e.toolbar.elements,["undo"]),0!==this[e.currentMode].redoStack.length?u(e.toolbar.elements,["redo"]):f(e.toolbar.elements,["redo"]))},e.prototype.undo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&!(this[e.currentMode].undoStack.length<2)){var t=this[e.currentMode].undoStack.pop();t&&(this[e.currentMode].redoStack.push(t),this.renderDiff(t,e),this[e.currentMode].hasUndo=!0,h(e,["hint"]))}},e.prototype.redo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")){var t=this[e.currentMode].redoStack.pop();t&&(this[e.currentMode].undoStack.push(t),this.renderDiff(t,e,!0))}},e.prototype.recordFirstPosition=function(e,t){if(0!==getSelection().rangeCount&&!(1!==this[e.currentMode].undoStack.length||0===this[e.currentMode].undoStack[0].length||this[e.currentMode].redoStack.length>0||(0,c.vU)()&&"Backspace"===t.key||(0,c.G6)())){var n=this.addCaret(e);n.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[e.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[e.currentMode].undoStack[0][0].diffs[0][1]=n,this[e.currentMode].lastText=n)}},e.prototype.addToUndoStack=function(e){var t=this.addCaret(e,!0),n=this.dmp.diff_main(t,this[e.currentMode].lastText,!0),r=this.dmp.patch_make(t,this[e.currentMode].lastText,n);0===r.length&&this[e.currentMode].undoStack.length>0||(this[e.currentMode].lastText=t,this[e.currentMode].undoStack.push(r),this[e.currentMode].undoStack.length>this.stackSize&&this[e.currentMode].undoStack.shift(),this[e.currentMode].hasUndo&&(this[e.currentMode].redoStack=[],this[e.currentMode].hasUndo=!1,f(e.toolbar.elements,["redo"])),this[e.currentMode].undoStack.length>1&&u(e.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(e,t,n){var r;if(void 0===n&&(n=!1),n){var o=this.dmp.patch_deepCopy(e).reverse();o.forEach((function(e){e.diffs.forEach((function(e){e[0]=-e[0]}))})),r=this.dmp.patch_apply(o,this[t.currentMode].lastText)[0]}else r=this.dmp.patch_apply(e,this[t.currentMode].lastText)[0];if(this[t.currentMode].lastText=r,t[t.currentMode].element.innerHTML=r,"sv"!==t.currentMode&&t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach((function(e){O(e,t)})),t[t.currentMode].element.querySelector("wbr"))(0,N.ib)(t[t.currentMode].element,t[t.currentMode].element.ownerDocument.createRange()),Ae(t);else{var i=getSelection().getRangeAt(0);i.setEndBefore(t[t.currentMode].element),i.collapse(!1)}D(t),dt(t,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),ve(t),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach((function(e){O(e,t)})),this[t.currentMode].undoStack.length>1?u(t.toolbar.elements,["undo"]):f(t.toolbar.elements,["undo"]),0!==this[t.currentMode].redoStack.length?u(t.toolbar.elements,["redo"]):f(t.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(e,t){var n;if(void 0===t&&(t=!1),0!==getSelection().rangeCount&&!e[e.currentMode].element.querySelector("wbr")){var r=getSelection().getRangeAt(0);if(e[e.currentMode].element.contains(r.startContainer)){n=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}e.ir.element.cloneNode(!0).querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='1']")).forEach((function(e){e.firstElementChild&&(e.firstElementChild.classList.contains("language-echarts")||e.firstElementChild.classList.contains("language-plantuml")||e.firstElementChild.classList.contains("language-mindmap")?(e.firstElementChild.removeAttribute("_echarts_instance_"),e.firstElementChild.removeAttribute("data-processed"),e.firstElementChild.innerHTML=e.previousElementSibling.firstElementChild.innerHTML,e.setAttribute("data-render","2")):e.firstElementChild.classList.contains("language-math")&&(e.setAttribute("data-render","2"),e.firstElementChild.textContent=e.firstElementChild.getAttribute("data-math"),e.firstElementChild.removeAttribute("data-math")))}));var i=e[e.currentMode].element.innerHTML;return e[e.currentMode].element.querySelectorAll(".vditor-wbr").forEach((function(e){e.remove()})),t&&n&&(0,N.Hc)(n),i.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),Wn=n(2),Gn=function(){function e(e){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:o.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",confused:"😕",eyes:"👀️",heart:"❤️",rocket:"🚀️",smile:"😄",tada:"🎉️"},emojiPath:"".concat(o.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:o.g.HLJS_OPTIONS,markdown:o.g.MARKDOWN_OPTIONS,math:o.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:o.g.THEME_OPTIONS,render:{media:{enable:!0}}},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(e){return e.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=e}return e.prototype.merge=function(){var e,t,n,r,o,i,a,l,s;this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),(null===(t=null===(e=this.options.preview)||void 0===e?void 0:e.theme)||void 0===t?void 0:t.list)&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),(null===(o=null===(r=null===(n=this.options.preview)||void 0===n?void 0:n.render)||void 0===r?void 0:r.media)||void 0===o?void 0:o.enable)&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),(null===(i=this.options.hint)||void 0===i?void 0:i.emoji)&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&((null===(l=null===(a=this.options.preview)||void 0===a?void 0:a.theme)||void 0===l?void 0:l.path)||(this.defaultOptions.preview.theme.path="".concat(this.options.cdn,"/dist/css/content-theme")),(null===(s=this.options.hint)||void 0===s?void 0:s.emojiPath)||(this.defaultOptions.hint.emojiPath="".concat(this.options.cdn,"/dist/images/emoji"))));var c=(0,Wn.T)(this.defaultOptions,this.options);if(c.cache.enable&&!c.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return c},e.prototype.mergeToolbar=function(e){var t=this,n=[{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 |\n| --- | --- | --- |\n| | | |\n| | | |",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 e.forEach((function(e){var o=e;n.forEach((function(t){"string"==typeof e&&t.name===e&&(o=t),"object"==typeof e&&t.name===e.name&&(o=Object.assign({},t,e))})),e.toolbar&&(o.toolbar=t.mergeToolbar(e.toolbar)),r.push(o)})),r},e}(),Fn=function(){function e(e){var t=this;this.composingLock=!1,this.commentIds=[];var n=document.createElement("div");n.className="vditor-wysiwyg",n.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>\n<div class="vditor-panel vditor-panel--none"></div>\n<div class="vditor-panel vditor-panel--none">\n <button type="button" aria-label="').concat(window.VditorI18n.comment,'" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">\n <svg><use xlink:href="#vditor-icon-comment"></use></svg>\n </button>\n</div>'),this.element=n.firstElementChild,this.popover=n.firstElementChild.nextElementSibling,this.selectPopover=n.lastElementChild,this.bindEvent(e),xe(e,this.element),Se(e,this.element),_e(e,this.element),Me(e,this.element),He(e,this.element),Le(e,this.element),Te(e,this.element,this.copy),Ce(e,this.element,this.copy),e.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var n,r,i=Lute.NewNodeID(),a=getSelection().getRangeAt(0),l=a.cloneRange(),s=a.extractContents(),c=!1,d=!1;s.childNodes.forEach((function(e,t){var o=!1;if(3===e.nodeType?o=!0:e.classList.contains("vditor-comment")?e.classList.contains("vditor-comment")&&e.setAttribute("data-cmtids",e.getAttribute("data-cmtids")+" "+i):o=!0,o)if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&0===t&&l.startOffset>0)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(e.innerHTML,"</span>"),n=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&t===s.childNodes.length-1&&l.endOffset<l.endContainer.textContent.length)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(e.innerHTML,"</span>"),r=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block"))0===t?c=!0:t===s.childNodes.length-1&&(d=!0),e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(e.innerHTML,"</span>");else{var a=document.createElement("span");a.classList.add("vditor-comment"),a.setAttribute("data-cmtids",i),e.parentNode.insertBefore(a,e),a.appendChild(e)}}));var p=(0,b.F9)(l.startContainer);p&&(n?(p.insertAdjacentHTML("beforeend",n.innerHTML),n.remove()):""===p.textContent.trim().replace(o.g.ZWSP,"")&&c&&p.remove());var u=(0,b.F9)(l.endContainer);u&&(r?(u.insertAdjacentHTML("afterbegin",r.innerHTML),r.remove()):""===u.textContent.trim().replace(o.g.ZWSP,"")&&d&&u.remove()),a.insertNode(s),e.options.comment.add(i,a.toString(),t.getComments(e,!0)),Q(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),t.hideComment()})}return e.prototype.getComments=function(e,t){var n=this;if(void 0===t&&(t=!1),"wysiwyg"!==e.currentMode||!e.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach((function(e){n.commentIds=n.commentIds.concat(e.getAttribute("data-cmtids").split(" "))})),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return t?(this.commentIds.forEach((function(e){r.push({id:e,top:n.element.querySelector('.vditor-comment[data-cmtids="'.concat(e,'"]')).offsetTop})})),r):void 0},e.prototype.triggerRemoveComment=function(e){var t,n,r;if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.commentIds.length>0){var o=JSON.parse(JSON.stringify(this.commentIds));this.getComments(e);var i=(t=o,n=this.commentIds,r=new Set(n),t.filter((function(e){return!r.has(e)})));i.length>0&&e.options.comment.remove(i)}},e.prototype.showComment=function(){var e=(0,N.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(e.left,"px;display:block;top:").concat(Math.max(-8,e.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(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=(0,b.lG)(n.startContainer,"CODE"),o=(0,b.lG)(n.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var i="";return i="PRE"===r.parentElement.tagName?n.toString():"`"+n.toString()+"`",e.clipboardData.setData("text/plain",i),void e.clipboardData.setData("text/html","")}var a=(0,b.lG)(n.startContainer,"A"),l=(0,b.lG)(n.endContainer,"A");if(a&&l&&l.isSameNode(a)){var s=a.getAttribute("title")||"";return s&&(s=' "'.concat(s,'"')),e.clipboardData.setData("text/plain","[".concat(n.toString(),"](").concat(a.getAttribute("href")).concat(s,")")),void e.clipboardData.setData("text/html","")}var c=document.createElement("div");c.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorDOM2Md(c.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(h(e,["hint"]),"block"===t.popover.style.display&&"block"===t.selectPopover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10);if("auto"===e.options.height){if(e.options.toolbarConfig.pin){var r=Math.max(n,window.scrollY-e.element.offsetTop-8)+"px";"block"===t.popover.style.display&&(t.popover.style.top=r),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=r)}}else if(e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top){var o=Math.max(window.scrollY-e.element.offsetTop-8,Math.min(n-e.wysiwyg.element.scrollTop,t.element.clientHeight-21))+"px";"block"===t.popover.style.display&&(t.popover.style.top=o),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",(function(){if(h(e,["hint"]),e.options.comment&&e.options.comment.enable&&e.options.comment.scroll&&e.options.comment.scroll(e.wysiwyg.element.scrollTop),"block"===t.popover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10)-e.wysiwyg.element.scrollTop,r=-8;e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top&&(r=window.scrollY-e.element.offsetTop+r);var o=Math.max(r,Math.min(n,t.element.clientHeight-21))+"px";t.popover.style.top=o,t.selectPopover.style.top=o}})),this.element.addEventListener("paste",(function(t){Lt(e,t,{pasteCode:function(t){var n=(0,N.zh)(e),r=document.createElement("template");r.innerHTML=t,n.insertNode(r.content.cloneNode(!0));var o=(0,b.a1)(n.startContainer,"data-block","0");o?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):e.wysiwyg.element.innerHTML=e.lute.SpinVditorDOM(e.wysiwyg.element.innerHTML),(0,N.ib)(e.wysiwyg.element,n)}})})),this.element.addEventListener("compositionstart",(function(){t.composingLock=!0})),this.element.addEventListener("compositionend",(function(n){var r=(0,y.W)(getSelection().getRangeAt(0).startContainer);r&&""===r.textContent?D(e):((0,c.vU)()||Ge(e,getSelection().getRangeAt(0).cloneRange(),n),t.composingLock=!1)})),this.element.addEventListener("input",(function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput)return t.preventInput=!1,void Q(e);if(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data)Q(e);else{var r=getSelection().getRangeAt(0),o=(0,b.F9)(r.startContainer);if(o||(te(e,r),o=(0,b.F9)(r.startContainer)),o){for(var i=(0,N.im)(o,e.wysiwyg.element,r).start,l=!0,s=i-1;s>o.textContent.substr(0,i).lastIndexOf("\n");s--)if(" "!==o.textContent.charAt(s)&&"\t"!==o.textContent.charAt(s)){l=!1;break}0===i&&(l=!1);var c=!0;for(s=i-1;s<o.textContent.length;s++)if(" "!==o.textContent.charAt(s)&&"\n"!==o.textContent.charAt(s)){c=!1;break}var d=(0,y.W)(getSelection().getRangeAt(0).startContainer);d&&""===d.textContent&&(D(e),d.remove()),l&&"code-block"!==o.getAttribute("data-type")||c||ct(o.innerHTML)||st(o.innerHTML)&&o.previousElementSibling?"function"==typeof e.options.input&&e.options.input(a(e)):("insertParagraph"===n.inputType&&"<p><br></p><p><br></p>"===t.element.innerHTML&&o.previousElementSibling.remove(),Ge(e,r,n))}}}})),this.element.addEventListener("click",(function(n){if("INPUT"===n.target.tagName){var r=n.target;return r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),t.preventInput=!0,void Q(e)}if("IMG"!==n.target.tagName||n.target.parentElement.classList.contains("vditor-wysiwyg__preview")){var i=(0,b.lG)(n.target,"A");if(i)return e.options.link.click?e.options.link.click(i):e.options.link.isOpen&&window.open(i.getAttribute("href")),void n.preventDefault();var l=(0,N.zh)(e);if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&l.collapsed){var s=t.element.lastElementChild.getBoundingClientRect();n.y>s.top+s.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(o.g.ZWSP,"")?(l.selectNodeContents(t.element.lastElementChild),l.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(o.g.ZWSP,"<wbr></p>")),(0,N.ib)(t.element,l)))}ae(e);var c=(0,b.fb)(n.target,"vditor-wysiwyg__preview");c||(c=(0,b.fb)((0,N.zh)(e).startContainer,"vditor-wysiwyg__preview")),c&&oe(c,e),I(n,e)}else"link-ref"===n.target.getAttribute("data-type")?se(e,n.target):function(e,t){var n=e.target;t.wysiwyg.popover.innerHTML="";var r=function(){n.setAttribute("src",i.value),n.setAttribute("alt",s.value),n.setAttribute("title",d.value),"function"==typeof t.options.input&&t.options.input(a(t))},o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.imageURL),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.imageURL),i.value=n.getAttribute("src")||"",i.oninput=function(){r()},i.onkeydown=function(e){ie(t,e)};var l=document.createElement("span");l.setAttribute("aria-label",window.VditorI18n.alternateText),l.className="vditor-tooltipped vditor-tooltipped__n";var s=document.createElement("input");l.appendChild(s),s.className="vditor-input",s.setAttribute("placeholder",window.VditorI18n.alternateText),s.style.width="52px",s.value=n.getAttribute("alt")||"",s.oninput=function(){r()},s.onkeydown=function(e){ie(t,e)};var c=document.createElement("span");c.setAttribute("aria-label",window.VditorI18n.title),c.className="vditor-tooltipped vditor-tooltipped__n";var d=document.createElement("input");c.appendChild(d),d.className="vditor-input",d.setAttribute("placeholder",window.VditorI18n.title),d.value=n.getAttribute("title")||"",d.oninput=function(){r()},d.onkeydown=function(e){ie(t,e)},pe(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",o),t.wysiwyg.popover.insertAdjacentElement("beforeend",l),t.wysiwyg.popover.insertAdjacentElement("beforeend",c),le(t,n)}(n,e)})),this.element.addEventListener("keyup",(function(t){if(!t.isComposing&&!(0,c.yl)(t)){"Enter"===t.key&&Ae(e),"Backspace"!==t.key&&"Delete"!==t.key||""===e.wysiwyg.element.innerHTML||1!==e.wysiwyg.element.childNodes.length||!e.wysiwyg.element.firstElementChild||"P"!==e.wysiwyg.element.firstElementChild.tagName||0!==e.wysiwyg.element.firstElementChild.childElementCount||""!==e.wysiwyg.element.textContent&&"\n"!==e.wysiwyg.element.textContent||(e.wysiwyg.element.innerHTML="");var n=(0,N.zh)(e);if("Backspace"===t.key&&(0,c.vU)()&&"\n"===n.startContainer.textContent&&1===n.startOffset&&(n.startContainer.textContent=""),te(e,n),ae(e),"ArrowDown"===t.key||"ArrowRight"===t.key||"Backspace"===t.key||"ArrowLeft"===t.key||"ArrowUp"===t.key){"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||e.hint.render(e);var r=(0,b.fb)(n.startContainer,"vditor-wysiwyg__preview");if(!r&&3!==n.startContainer.nodeType&&n.startOffset>0&&(i=n.startContainer).classList.contains("vditor-wysiwyg__block")&&(r=i.lastElementChild),r)if("none"!==r.previousElementSibling.style.display){var o=r.previousElementSibling;if("PRE"===o.tagName&&(o=o.firstElementChild),"ArrowDown"===t.key||"ArrowRight"===t.key){var i,a=function(e){for(var t=e;t&&!t.nextSibling;)t=t.parentElement;return t.nextSibling}(i=r.parentElement);if(a&&3!==a.nodeType){var l=a.querySelector(".vditor-wysiwyg__preview");if(l)return void oe(l,e)}if(3===a.nodeType){for(;0===a.textContent.length&&a.nextSibling;)a=a.nextSibling;n.setStart(a,1)}else n.setStart(a.firstChild,0)}else n.selectNodeContents(o),n.collapse(!1)}else"ArrowDown"===t.key||"ArrowRight"===t.key?oe(r,e):oe(r,e,!1)}}}))},e}(),Kn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Zn=function(e){function t(t,n){var r=e.call(this)||this;if(r.version=o.H,"string"==typeof t){if(n?n.cache?n.cache.id||(n.cache.id="vditor".concat(t)):n.cache={id:"vditor".concat(t)}:n={cache:{id:"vditor".concat(t)}},!document.getElementById(t))return r.showErrorTip("Failed to get element by id: ".concat(t)),r;t=document.getElementById(t)}var i=new Gn(n).merge();if(i.i18n)window.VditorI18n=i.i18n,r.init(t,i);else{if(!["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(i.lang))throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");var a="vditorI18nScript"+i.lang;document.querySelectorAll('head script[id^="'.concat("vditorI18nScript",'"]')).forEach((function(e){e.id!==a&&document.head.removeChild(e)})),(0,l.G)("".concat(i.cdn,"/dist/js/i18n/").concat(i.lang,".js"),a).then((function(){r.init(t,i)})).catch((function(e){r.showErrorTip("GET ".concat(i.cdn,"/dist/js/i18n/").concat(i.lang,".js net::ERR_ABORTED 404 (Not Found)"))}))}return r}return Kn(t,e),t.prototype.showErrorTip=function(e){var t=new Wt;document.body.appendChild(t.element),t.show(e,0)},t.prototype.updateToolbarConfig=function(e){this.vditor.toolbar.updateConfig(this.vditor,e)},t.prototype.setTheme=function(e,t,n,r){this.vditor.options.theme=e,W(this.vditor),t&&(this.vditor.options.preview.theme.current=t,(0,V.Z)(t,r||this.vditor.options.preview.theme.path)),n&&(this.vditor.options.preview.hljs.style=n,(0,Jt.Y)(n,this.vditor.options.cdn))},t.prototype.getValue=function(){return a(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.focus():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.focus():"ir"===this.vditor.currentMode&&this.vditor.ir.element.focus()},t.prototype.blur=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.blur():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.blur():"ir"===this.vditor.currentMode&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){h(this.vditor,["subToolbar","hint","popover"]),f(this.vditor.toolbar.elements,o.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){u(this.vditor.toolbar.elements,o.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"wysiwyg"===this.vditor.currentMode?ke(this.vditor.wysiwyg.element):"sv"===this.vditor.currentMode?ke(this.vditor.sv.element):"ir"===this.vditor.currentMode?ke(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(e){this.vditor.preview.render(this.vditor,e)},t.prototype.getCursorPosition=function(){return(0,N.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(e){return this.vditor.lute.HTML2Md(e)},t.prototype.exportJSON=function(e){return this.vditor.lute.RenderJSON(e)},t.prototype.getHTML=function(){return jt(this.vditor)},t.prototype.tip=function(e,t){this.vditor.tip.show(e,t)},t.prototype.setPreviewMode=function(e){Gt(e,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(e){document.execCommand("insertHTML",!1,e)},t.prototype.insertValue=function(e,t){void 0===t&&(t=!0);var n=(0,N.zh)(this.vditor);n.collapse(!0);var r=document.createElement("template");r.innerHTML=e,n.insertNode(r.content.cloneNode(!0)),n.collapse(!1),"sv"===this.vditor.currentMode?(this.vditor.sv.preventInput=!0,t&&U(this.vditor)):"wysiwyg"===this.vditor.currentMode?t&&Ge(this.vditor,getSelection().getRangeAt(0)):"ir"===this.vditor.currentMode&&(this.vditor.ir.preventInput=!0,t&&R(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t=!1),"sv"===this.vditor.currentMode?(this.vditor.sv.element.innerHTML="<div data-block='0'>".concat(this.vditor.lute.SpinVditorSVDOM(e),"</div>"),je(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):"wysiwyg"===this.vditor.currentMode?he(this.vditor,e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(e),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach((function(e){O(e,n.vditor)})),Ct(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),e||(h(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),t&&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 e=document.getElementById("vditorIconScript");e&&e.remove(),this.clearCache(),K(),this.vditor.wysiwyg.unbindListener()},t.prototype.getCommentIds=function(){return"wysiwyg"!==this.vditor.currentMode?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){t.classList.remove("vditor-comment--hover"),e.forEach((function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.add("vditor-comment--hover")}))};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach((function(e){t(e)})),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach((function(e){t(e)}))}},t.prototype.unHlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){e.forEach((function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.remove("vditor-comment--hover")}))};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach((function(e){t(e)})),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach((function(e){t(e)}))}},t.prototype.removeCommentIds=function(e){var t=this;if("wysiwyg"===this.vditor.currentMode){var n=function(e,n){var r=e.getAttribute("data-cmtids").split(" ");r.find((function(e,t){if(e===n)return r.splice(t,1),!0})),0===r.length?(e.outerHTML=e.innerHTML,(0,N.zh)(t.vditor).collapse(!0)):e.setAttribute("data-cmtids",r.join(" "))};e.forEach((function(e){t.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach((function(t){n(t,e)})),"none"!==t.vditor.preview.element.style.display&&t.vditor.preview.element.querySelectorAll(".vditor-comment").forEach((function(t){n(t,e)}))})),Q(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(e,t){var n=this;this.vditor={currentMode:t.mode,element:e,hint:new Dt(t.hint.extend),lute:void 0,options:t,originalInnerHTML:e.innerHTML,outline:new qt(window.VditorI18n.outline),tip:new Wt},this.vditor.sv=new Vt(this.vditor),this.vditor.undo=new Vn,this.vditor.wysiwyg=new Fn(this.vditor),this.vditor.ir=new It(this.vditor),this.vditor.toolbar=new zn(this.vditor),t.resize.enable&&(this.vditor.resize=new Ut(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new s),(t.upload.url||t.upload.handler)&&(this.vditor.upload=new Ve),(0,l.G)(t._lutePath||"".concat(t.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then((function(){n.vditor.lute=(0,Rt.X)({autoSpace:n.vditor.options.preview.markdown.autoSpace,gfmAutoLink:n.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:n.vditor.options.preview.markdown.codeBlockPreview,emojiSite:n.vditor.options.hint.emojiPath,emojis:n.vditor.options.hint.emoji,fixTermTypo:n.vditor.options.preview.markdown.fixTermTypo,footnotes:n.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:n.vditor.options.preview.math.inlineDigit,linkBase:n.vditor.options.preview.markdown.linkBase,linkPrefix:n.vditor.options.preview.markdown.linkPrefix,listStyle:n.vditor.options.preview.markdown.listStyle,mark:n.vditor.options.preview.markdown.mark,mathBlockPreview:n.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:n.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:n.vditor.options.preview.markdown.sanitize,toc:n.vditor.options.preview.markdown.toc}),n.vditor.preview=new zt(n.vditor),function(e){e.element.innerHTML="",e.element.classList.add("vditor"),e.options.rtl&&e.element.setAttribute("dir","rtl"),W(e),(0,V.Z)(e.options.preview.theme.current,e.options.preview.theme.path),"number"==typeof e.options.height?e.element.style.height=e.options.height+"px":e.element.style.height=e.options.height,"number"==typeof e.options.minHeight&&(e.element.style.minHeight=e.options.minHeight+"px"),"number"==typeof e.options.width?e.element.style.width=e.options.width+"px":e.element.style.width=e.options.width,e.element.appendChild(e.toolbar.element);var t=document.createElement("div");if(t.className="vditor-content","left"===e.options.outline.position&&t.appendChild(e.outline.element),t.appendChild(e.wysiwyg.element.parentElement),t.appendChild(e.sv.element),t.appendChild(e.ir.element.parentElement),t.appendChild(e.preview.element),e.toolbar.elements.devtools&&t.appendChild(e.devtools.element),"right"===e.options.outline.position&&(e.outline.element.classList.add("vditor-outline--right"),t.appendChild(e.outline.element)),e.upload&&t.appendChild(e.upload.element),e.options.resize.enable&&t.appendChild(e.resize.element),t.appendChild(e.hint.element),t.appendChild(e.tip.element),e.element.appendChild(t),t.addEventListener("click",(function(){h(e,["subToolbar"])})),e.toolbar.elements.export&&e.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),we(e,e.options.mode,X(e)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&void 0!==window.visualViewport){var n=!1,r=function(t){n||(n=!0,requestAnimationFrame((function(){n=!1;var t=e.toolbar.element;t.style.transform="none",t.getBoundingClientRect().top<0&&(t.style.transform="translate(0, ".concat(-t.getBoundingClientRect().top,"px)"))})))};window.visualViewport.addEventListener("scroll",r),window.visualViewport.addEventListener("resize",r)}}(n.vditor),t.after&&t.after(),t.icon&&(0,l.J)("".concat(t.cdn,"/dist/js/icons/").concat(t.icon,".js"),"vditorIconScript")}))},t}(t.default)})(),r=r.default})(),e.exports=r()},875:function(e,t,n){var r=n(876);"string"==typeof r&&(r=[[e.i,r,""]]);var o={insertAt:"top",hmr:!0,transform:void 0,insertInto:void 0};n(91)(r,o);r.locals&&(e.exports=r.locals)},876:function(e,t,n){(t=n(90)(!1)).push([e.i,'/*!\n * Vditor v3.10.5 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n/*!\n * Vditor v3.10.5 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n.vditor {\n --border-color: #d1d5da;\n --second-color: rgba(88, 96, 105, 0.36);\n --panel-background-color: #fff;\n --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n --toolbar-background-color: #f6f8fa;\n --toolbar-icon-color: #586069;\n --toolbar-icon-hover-color: #4285f4;\n --toolbar-height: 35px;\n --toolbar-divider-margin-top: 8px;\n --textarea-background-color: #fafbfc;\n --textarea-text-color: #24292e;\n --resize-icon-color: var(--toolbar-icon-color);\n --resize-background-color: var(--toolbar-background-color);\n --resize-hover-icon-color: var(--panel-background-color);\n --resize-hover-background-color: var(--toolbar-icon-hover-color);\n --count-background-color: rgba(27, 31, 35, 0.05);\n --heading-border-color: #eaecef;\n --blockquote-color: #6a737d;\n --ir-heading-color: #660e7a;\n --ir-title-color: #808080;\n --ir-bi-color: #0033b3;\n --ir-link-color: #008000;\n --ir-bracket-color: #0000ff;\n --ir-paren-color: #008000;\n}\n.vditor--dark {\n --border-color: #141414;\n --second-color: rgba(185, 185, 185, 0.36);\n --panel-background-color: #24292e;\n --panel-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);\n --toolbar-background-color: #1d2125;\n --toolbar-icon-color: #b9b9b9;\n --toolbar-icon-hover-color: #fff;\n --textarea-background-color: #2f363d;\n --textarea-text-color: #d1d5da;\n --resize-icon-color: var(--border-color);\n --resize-background-color: var(--second-color);\n --resize-hover-icon-color: var(--toolbar-icon-hover-color);\n --resize-hover-background-color: rgba(185, 185, 185, 0.86);\n --count-background-color: rgba(66, 133, 244, 0.36);\n --heading-border-color: var(--textarea-text-color);\n --blockquote-color: var(--toolbar-icon-color);\n --ir-heading-color: #9876aa;\n --ir-title-color: #808080;\n --ir-bi-color: #cc7832;\n --ir-link-color: #ffc66d;\n --ir-bracket-color: #287bde;\n --ir-paren-color: #6a8759;\n}\n/**\n * tool tip.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 0.1.0.0, Jan 25, 2019\n */\n@-webkit-keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.vditor-tooltipped {\n position: relative;\n cursor: pointer;\n}\n.vditor-tooltipped::after {\n position: absolute;\n z-index: 1000000;\n display: none;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: normal;\n -webkit-font-smoothing: subpixel-antialiased;\n color: #fff;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: #3b3e43;\n border-radius: 3px;\n line-height: 16px;\n opacity: 0;\n}\n.vditor-tooltipped::before {\n position: absolute;\n z-index: 1000001;\n display: none;\n width: 0;\n height: 0;\n color: #3b3e43;\n pointer-events: none;\n content: "";\n border: 5px solid transparent;\n opacity: 0;\n}\n.vditor-tooltipped--hover::before,\n.vditor-tooltipped--hover::after,\n.vditor-tooltipped:hover::before,\n.vditor-tooltipped:hover::after,\n.vditor-tooltipped:active::before,\n.vditor-tooltipped:active::after,\n.vditor-tooltipped:focus::before,\n.vditor-tooltipped:focus::after {\n display: inline-block;\n text-decoration: none;\n -webkit-animation-name: tooltip-appear;\n animation-name: tooltip-appear;\n -webkit-animation-duration: 0.15s;\n animation-duration: 0.15s;\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-timing-function: ease-in;\n animation-timing-function: ease-in;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__se::after,\n.vditor-tooltipped__sw::after {\n top: 100%;\n right: 50%;\n margin-top: 5px;\n}\n.vditor-tooltipped__s::before,\n.vditor-tooltipped__se::before,\n.vditor-tooltipped__sw::before {\n top: auto;\n right: 50%;\n bottom: -5px;\n margin-right: -5px;\n border-bottom-color: #3b3e43;\n}\n.vditor-tooltipped__se::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__sw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__n::after,\n.vditor-tooltipped__ne::after,\n.vditor-tooltipped__nw::after {\n right: 50%;\n bottom: 100%;\n margin-bottom: 5px;\n}\n.vditor-tooltipped__n::before,\n.vditor-tooltipped__ne::before,\n.vditor-tooltipped__nw::before {\n top: -5px;\n right: 50%;\n bottom: auto;\n margin-right: -5px;\n border-top-color: #3b3e43;\n}\n.vditor-tooltipped__ne::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__nw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__n::after {\n transform: translateX(50%);\n}\n.vditor-tooltipped__w::after {\n right: 100%;\n bottom: 50%;\n margin-right: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__w::before {\n top: 50%;\n bottom: 50%;\n left: -5px;\n margin-top: -5px;\n border-left-color: #3b3e43;\n}\n.vditor-tooltipped__e::after {\n bottom: 50%;\n left: 100%;\n margin-left: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__e::before {\n top: 50%;\n right: -5px;\n bottom: 50%;\n margin-top: -5px;\n border-right-color: #3b3e43;\n}\n@media screen and (max-width: 520px) {\n .vditor-tooltipped:before,\n .vditor-tooltipped:after {\n content: none;\n }\n}\n/**\n * panel.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 1.0.0.0, Jan 22, 2020\n */\n@-webkit-keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n@keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n.vditor-panel {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px;\n z-index: 3;\n font-size: 14px;\n display: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n max-width: 320px;\n min-width: 80px;\n -webkit-animation-duration: 0.15s;\n animation-duration: 0.15s;\n -webkit-animation-name: scale-in;\n animation-name: scale-in;\n -webkit-animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n color: var(--toolbar-icon-color);\n}\n.vditor-panel--none {\n padding: 0;\n -webkit-animation: none;\n animation: none;\n min-width: auto;\n max-width: none;\n white-space: nowrap;\n opacity: 0.86;\n}\n.vditor-panel--arrow:before {\n position: absolute;\n width: 0;\n height: 0;\n pointer-events: none;\n content: " ";\n border: 7px solid transparent;\n top: -14px;\n left: 5px;\n border-bottom-color: var(--panel-background-color);\n}\n.vditor-panel--left {\n right: 0;\n}\n.vditor-panel--left.vditor-panel--arrow:before {\n right: 5px;\n left: auto;\n}\n.vditor-input {\n border: 0;\n padding: 3px 5px;\n background-color: var(--panel-background-color);\n font-size: 12px;\n color: var(--textarea-text-color);\n}\n.vditor-input:focus {\n background-color: var(--toolbar-background-color);\n outline: none;\n}\n.vditor-icon {\n color: var(--toolbar-icon-color);\n cursor: pointer;\n float: left;\n padding: 4px 5px;\n height: 21px;\n width: 23px;\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n}\n.vditor-icon:hover,\n.vditor-icon--current {\n color: var(--toolbar-icon-hover-color);\n background-color: transparent;\n}\n.vditor-icon:focus {\n outline: none;\n}\n.vditor-icon svg {\n height: 13px !important;\n width: 13px !important;\n float: left;\n fill: currentColor;\n pointer-events: none;\n}\n.vditor-toolbar {\n background-color: var(--toolbar-background-color);\n border-bottom: 1px solid var(--border-color);\n padding: 0 5px;\n line-height: 1;\n}\n.vditor-toolbar--pin {\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1;\n}\n.vditor-toolbar--hide {\n transition: all 0.15s ease-in-out;\n height: 5px;\n overflow: hidden;\n}\n.vditor-toolbar--hide:hover {\n background-color: var(--toolbar-background-color);\n height: auto;\n overflow: visible;\n}\n.vditor-toolbar__item {\n float: left;\n position: relative;\n}\n.vditor-toolbar__item .vditor-tooltipped {\n color: var(--toolbar-icon-color);\n border: 0;\n padding: 10px 5px;\n background-color: transparent;\n height: var(--toolbar-height);\n width: 25px;\n box-sizing: border-box;\n font-size: 0;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n outline: none;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n cursor: pointer;\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-toolbar__item svg {\n fill: currentColor;\n display: inline-block;\n stroke-width: 0;\n stroke: currentColor;\n width: 15px;\n height: 15px;\n}\n.vditor-toolbar__item input {\n position: absolute;\n width: 25px;\n height: var(--toolbar-height);\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0.001;\n overflow: hidden;\n}\n.vditor-toolbar__divider {\n float: left;\n height: calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n border-left: 1px solid var(--second-color);\n margin: var(--toolbar-divider-margin-top) 8px;\n}\n.vditor-toolbar__br {\n width: 100%;\n padding: 0 !important;\n height: 0 !important;\n}\n.vditor-menu--current {\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-menu--disabled {\n color: var(--second-color) !important;\n cursor: not-allowed !important;\n}\n.vditor-emojis {\n display: inline-block;\n overflow: auto;\n}\n.vditor-emojis::-webkit-scrollbar {\n display: none;\n}\n.vditor-emojis__tip {\n flex: 1;\n min-width: 1px;\n width: 200px;\n margin-right: 10px;\n color: var(--toolbar-icon-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-emojis__tail {\n margin-top: 5px;\n font-size: 12px;\n color: var(--toolbar-icon-color);\n display: flex;\n}\n.vditor-emojis__tail a {\n text-decoration: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-emojis__tail a:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-emojis button {\n cursor: pointer;\n border-radius: 3px;\n float: left;\n height: 30px;\n width: 30px;\n text-align: center;\n line-height: 26px;\n padding: 3px;\n box-sizing: border-box;\n font-size: 16px;\n transition: all 0.15s ease-in-out;\n border: 0;\n margin: 0;\n background-color: transparent;\n overflow: hidden;\n}\n.vditor-emojis button:focus {\n outline: none;\n}\n.vditor-emojis button:hover .vditor-emojis__icon {\n display: inline-block;\n transform: scale(1.2);\n}\n.vditor-emojis img {\n height: 20px;\n width: 20px;\n float: left;\n margin: 3px 0 0 3px;\n}\n@media screen and (max-width: 520px) {\n .vditor-toolbar__item {\n padding: 0 12px;\n }\n .vditor-panel--left.vditor-panel--arrow:before {\n right: 17px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .vditor-toolbar__item .vditor-tooltipped:hover {\n color: var(--toolbar-icon-hover-color);\n }\n}\n@-webkit-keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n@keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n.vditor {\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border-color);\n border-radius: 3px;\n box-sizing: border-box;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n}\n.vditor--fullscreen {\n position: fixed;\n top: 0;\n width: 100% !important;\n left: 0;\n height: 100vh !important;\n z-index: 90;\n border-radius: 0;\n}\n.vditor-content {\n display: flex;\n min-height: 60px;\n flex: 1;\n min-width: 1px;\n position: relative;\n}\n.vditor-preview {\n flex: 1;\n min-width: 1px;\n overflow: auto;\n margin-left: -1px;\n border-left: 1px solid var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n background-color: var(--textarea-background-color);\n}\n.vditor-preview::-webkit-scrollbar {\n display: none;\n}\n.vditor-preview__action {\n text-align: center;\n padding: 10px;\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button {\n background-color: var(--toolbar-background-color);\n color: var(--toolbar-icon-color);\n line-height: 20px;\n border: 0;\n margin: 0 10px;\n cursor: pointer;\n padding: 0 7px;\n font-size: 12px;\n}\n.vditor-preview__action button.vditor-preview__action--current,\n.vditor-preview__action button:hover {\n color: var(--toolbar-icon-hover-color);\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button:focus {\n outline: none;\n}\n.vditor-preview__action button svg {\n fill: currentColor;\n height: 15px;\n width: 15px;\n vertical-align: middle;\n}\n.vditor-preview > .vditor-reset {\n padding: 10px;\n margin: 0 auto;\n}\n.vditor-preview img:not(.emoji) {\n cursor: pointer;\n}\n.vditor-devtools {\n display: none;\n background-color: var(--textarea-background-color);\n overflow: auto;\n flex: 1;\n min-width: 1px;\n box-shadow: inset 1px 0 var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n padding: 10px;\n}\n.vditor-counter {\n padding: 3px;\n color: var(--toolbar-icon-color);\n background-color: var(--count-background-color);\n border-radius: 3px;\n font-size: 12px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n float: right;\n margin: 8px 3px 0 0;\n}\n.vditor-counter--error {\n color: #d23f31;\n background-color: rgba(210, 63, 49, 0.1);\n}\n.vditor-resize {\n padding: 3px 0;\n cursor: row-resize;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: absolute;\n width: 100%;\n}\n.vditor-resize--top {\n top: -3px;\n}\n.vditor-resize--bottom {\n bottom: -3px;\n}\n.vditor-resize > div {\n height: 3px;\n background-color: var(--resize-background-color);\n transition: all 0.15s ease-in-out;\n}\n.vditor-resize:hover > div,\n.vditor-resize--selected > div {\n background-color: var(--resize-hover-background-color);\n}\n.vditor-resize:hover svg,\n.vditor-resize--selected svg {\n color: var(--resize-hover-icon-color);\n}\n.vditor-resize svg {\n fill: currentColor;\n stroke-width: 0;\n stroke: currentColor;\n width: 13px;\n height: 3px;\n display: block;\n margin: 0 auto;\n color: var(--resize-icon-color);\n}\n.vditor-upload {\n position: absolute;\n height: 3px;\n left: 0;\n top: -2px;\n transition: all 0.15s ease-in-out;\n background-color: #4285f4;\n}\n.vditor-tip {\n position: absolute;\n font-size: 12px;\n top: 10px;\n -webkit-animation-duration: 0.15s;\n animation-duration: 0.15s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n left: 50%;\n z-index: 5;\n}\n.vditor-tip--show {\n display: block;\n -webkit-animation-name: slideInDown;\n animation-name: slideInDown;\n}\n.vditor-tip__content {\n text-align: left;\n display: inline-block;\n line-height: 16px;\n padding: 3px 10px;\n border-radius: 3px;\n background: var(--toolbar-background-color);\n position: relative;\n margin-left: -50%;\n color: var(--toolbar-icon-color);\n max-width: 100%;\n box-shadow: var(--panel-shadow);\n}\n.vditor-tip__content ul {\n margin: 2px 0;\n padding: 0 0 0 18px;\n}\n.vditor-tip__content a {\n color: #4285f4;\n}\n.vditor-tip__close {\n position: absolute;\n color: var(--toolbar-icon-color);\n top: -7px;\n right: -15px;\n font-weight: bold;\n cursor: pointer;\n}\n.vditor-tip__close:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n z-index: 100;\n}\n.vditor-img__bar {\n border-bottom: 1px solid var(--border-color);\n background-color: var(--toolbar-background-color);\n text-align: center;\n height: 36px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.vditor-img__btn {\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-left: 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-img__btn:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img__btn svg {\n height: 14px;\n width: 14px;\n margin-right: 8px;\n fill: currentColor;\n}\n.vditor-img__img {\n flex: 1;\n background-color: var(--textarea-background-color);\n overflow: auto;\n cursor: zoom-out;\n}\n.vditor-img__img img {\n max-width: none;\n}\n.vditor-hint {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px 0;\n z-index: 4;\n line-height: 20px;\n list-style: none;\n font-size: 12px;\n margin: 0;\n max-width: 250px;\n min-width: 80px;\n display: none;\n}\n.vditor-hint .vditor-hint {\n margin-top: -31px;\n left: 100%;\n right: auto;\n}\n.vditor-hint .vditor-hint.vditor-panel--left {\n right: 100%;\n left: auto;\n}\n.vditor-hint button {\n color: var(--toolbar-icon-color);\n display: block;\n padding: 3px 10px;\n border: 0;\n border-radius: 0;\n line-height: 20px;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n margin: 0;\n background-color: transparent;\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-hint button:focus {\n outline: none;\n}\n.vditor-hint--current,\n.vditor-hint button:not(.vditor-menu--disabled):hover {\n background-color: var(--toolbar-background-color) !important;\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-hint__emoji {\n font-size: 16px;\n float: left;\n margin-right: 3px;\n}\n.vditor-hint img {\n height: 20px;\n width: 20px;\n float: left;\n margin-right: 3px;\n}\n.vditor-reset {\n color: #24292e;\n font-variant-ligatures: no-common-ligatures;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-wrap: break-word;\n overflow: auto;\n line-height: 1.5;\n font-size: 16px;\n word-break: break-word;\n}\n.vditor-reset--anchor {\n padding-left: 20px;\n}\n.vditor-reset--error {\n color: #d23f31;\n font-size: 12px;\n display: block;\n line-height: 16px;\n}\n.vditor-reset ul ul ul {\n list-style-type: square;\n}\n.vditor-reset ul ul {\n list-style-type: circle;\n}\n.vditor-reset ul {\n list-style-type: disc;\n}\n.vditor-reset ul,\n.vditor-reset ol {\n padding-left: 2em;\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset li + li {\n margin-top: 0.25em;\n}\n.vditor-reset li p {\n margin-top: 16px;\n}\n.vditor-reset audio {\n max-width: 100%;\n}\n.vditor-reset audio:focus {\n outline: none;\n}\n.vditor-reset video {\n max-height: 90vh;\n max-width: 100%;\n}\n.vditor-reset img {\n max-width: 100%;\n}\n.vditor-reset img.emoji {\n cursor: auto;\n max-width: 20px;\n vertical-align: sub;\n}\n.vditor-reset h1,\n.vditor-reset h2,\n.vditor-reset h3,\n.vditor-reset h4,\n.vditor-reset h5,\n.vditor-reset h6 {\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n.vditor-reset h1:hover .vditor-anchor svg,\n.vditor-reset h2:hover .vditor-anchor svg,\n.vditor-reset h3:hover .vditor-anchor svg,\n.vditor-reset h4:hover .vditor-anchor svg,\n.vditor-reset h5:hover .vditor-anchor svg,\n.vditor-reset h6:hover .vditor-anchor svg {\n visibility: visible;\n}\n.vditor-reset h1 {\n font-size: 1.75em;\n}\n.vditor-reset h2 {\n font-size: 1.55em;\n}\n.vditor-reset h3 {\n font-size: 1.38em;\n}\n.vditor-reset h4 {\n font-size: 1.25em;\n}\n.vditor-reset h5 {\n font-size: 1.13em;\n}\n.vditor-reset h6 {\n font-size: 1em;\n}\n.vditor-reset hr {\n height: 2px;\n padding: 0;\n margin: 24px 0;\n background-color: #eaecef;\n border: 0;\n}\n.vditor-reset p {\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset blockquote {\n padding: 0 1em;\n color: #6a737d;\n border-left: 0.25em solid #eaecef;\n margin: 0 0 16px 0;\n}\n.vditor-reset blockquote > :first-child {\n margin-top: 0;\n}\n.vditor-reset blockquote > :last-child {\n margin-bottom: 0;\n}\n.vditor-reset ins > iframe {\n border: 0;\n}\n.vditor-reset iframe {\n border: 1px solid #d1d5da;\n max-width: 100%;\n box-sizing: border-box;\n}\n.vditor-reset iframe.iframe__video {\n min-width: 80%;\n min-height: 36vh;\n}\n.vditor-reset table {\n border-collapse: collapse;\n empty-cells: show;\n margin-bottom: 16px;\n overflow: auto;\n border-spacing: 0;\n display: block;\n word-break: keep-all;\n width: 100%;\n}\n.vditor-reset table tr {\n background-color: #fafbfc;\n border-top: 1px solid #c6cbd1;\n}\n.vditor-reset table td,\n.vditor-reset table th {\n padding: 6px 13px;\n border: 1px solid #dfe2e5;\n word-break: normal;\n white-space: nowrap;\n}\n.vditor-reset table td:first-child::after,\n.vditor-reset table th:first-child::after {\n content: "";\n display: inline-block;\n vertical-align: top;\n min-height: 24px;\n}\n.vditor-reset table th {\n font-weight: 600;\n}\n.vditor-reset table tbody tr:nth-child(2n) {\n background-color: #fff;\n}\n.vditor-reset code:not(.hljs):not(.highlight-chroma) {\n padding: 0.2em 0.4em;\n margin: 0;\n font-size: 85%;\n border-radius: 3px;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-break: break-word;\n background-size: 20px 20px;\n white-space: pre-wrap;\n}\n.vditor-reset pre {\n margin: 1em 0;\n}\n.vditor-reset pre > code {\n margin: 0;\n font-size: 85%;\n padding: 0.5em;\n border-radius: 5px;\n display: block;\n overflow: auto;\n white-space: pre;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n background-size: 20px 20px;\n background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg==);\n word-break: initial;\n word-wrap: normal;\n}\n.vditor-reset pre:hover div.vditor-copy {\n display: block;\n}\n.vditor-reset .language-math,\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap,\n.vditor-reset .language-plantuml,\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-abc,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n margin-bottom: 16px;\n}\n.vditor-reset .language-math mjx-container:focus {\n outline: none;\n cursor: context-menu;\n}\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap {\n overflow: hidden;\n height: 420px;\n}\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n text-align: center;\n}\n.vditor-reset .language-graphviz parsererror {\n overflow: auto;\n}\n.vditor-reset kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #24292e;\n vertical-align: middle;\n background-color: #fafbfc;\n border: solid 1px #d1d5da;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #d1d5da;\n}\n.vditor-reset summary {\n cursor: pointer;\n}\n.vditor-reset summary:focus {\n outline: none;\n}\n.vditor-reset svg {\n height: auto;\n width: auto;\n stroke-width: initial;\n}\n.vditor-reset p:last-child,\n.vditor-reset blockquote:last-child,\n.vditor-reset pre:last-child,\n.vditor-reset ul:last-child,\n.vditor-reset ol:last-child,\n.vditor-reset hr:last-child {\n margin-bottom: 0;\n}\n.vditor-comment {\n border-bottom: 2px solid #f8e6ab;\n}\n.vditor-comment--focus,\n.vditor-comment--hover {\n background-color: #faf1d1;\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-comment--focus .vditor-comment,\n.vditor-comment--hover .vditor-comment {\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-task {\n list-style: none !important;\n word-break: break-all;\n}\n.vditor-task input {\n margin: 0 0.2em 0.25em -1.6em;\n font-size: 12px;\n vertical-align: middle;\n}\n.vditor-copy {\n position: relative;\n display: none;\n z-index: 1;\n}\n.vditor-copy textarea {\n position: absolute;\n left: -100000px;\n height: 10px;\n}\n.vditor-copy span {\n cursor: pointer;\n position: absolute;\n right: 15px;\n top: 0.5em;\n}\n.vditor-copy svg {\n color: #586069;\n height: 14px;\n width: 14px !important;\n display: block;\n fill: currentColor;\n}\n.vditor-linenumber {\n padding-left: 4em !important;\n position: relative;\n}\n.vditor-linenumber__rows {\n position: absolute;\n pointer-events: none;\n top: 0.5em;\n left: 0;\n width: 3em;\n /* works for line-numbers below 1000 lines */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n counter-reset: linenumber;\n}\n.vditor-linenumber__rows > span {\n pointer-events: none;\n display: block;\n}\n.vditor-linenumber__rows > span::before {\n counter-increment: linenumber;\n content: counter(linenumber);\n color: rgba(158, 150, 150, 0.38);\n display: block;\n padding-right: 1em;\n text-align: right;\n}\n.vditor-speech {\n position: absolute;\n display: none;\n background-color: #f6f8fa;\n border: 1px solid #d1d5da;\n border-radius: 3px;\n padding: 3px;\n cursor: pointer;\n color: #586069;\n}\n.vditor-speech:hover,\n.vditor-speech--current {\n color: #4285f4;\n}\n.vditor-speech svg {\n height: 14px;\n width: 14px;\n fill: currentColor;\n display: block;\n stroke-width: 0;\n stroke: currentColor;\n}\n.vditor-anchor {\n margin-left: 5px;\n}\n.vditor-anchor--left {\n float: left;\n padding-right: 4px;\n margin-left: -20px;\n}\n.vditor-anchor svg {\n visibility: hidden;\n}\n.vditor-anchor:hover svg {\n visibility: visible;\n}\n.vditor-anchor:focus {\n outline: none;\n}\n.vditor-linkcard {\n margin: 31px auto 16px;\n transition: all 0.15s ease-in-out;\n cursor: pointer;\n max-width: 768px;\n padding: 0 10px;\n}\n.vditor-linkcard a {\n border-radius: 3px;\n background-color: #f6f8fa;\n overflow: hidden;\n max-height: 250px;\n display: flex;\n text-decoration: none;\n flex-wrap: wrap-reverse;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n}\n.vditor-linkcard a:hover {\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.13), 0 3px 6px rgba(0, 0, 0, 0.26);\n text-decoration: none;\n}\n.vditor-linkcard a:visited .vditor-linkcard__abstract {\n color: rgba(88, 96, 105, 0.36);\n}\n.vditor-linkcard__info {\n padding: 10px;\n min-width: 200px;\n box-sizing: border-box;\n flex: 1;\n}\n.vditor-linkcard__title {\n font-size: 14px;\n font-weight: 400;\n color: #24292e;\n display: flex;\n align-items: center;\n}\n.vditor-linkcard__title img {\n cursor: pointer;\n height: 20px;\n width: 20px;\n border-radius: 3px;\n flex-shrink: 0;\n margin-right: 5px;\n}\n.vditor-linkcard__abstract {\n word-wrap: break-word;\n word-break: break-all;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n font-size: 13px;\n color: #586069;\n margin: 5px 0;\n}\n.vditor-linkcard__site {\n font-size: 12px;\n color: #4285f4;\n}\n.vditor-linkcard__image {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n max-width: 250px;\n min-width: 126px;\n cursor: pointer;\n background-color: rgba(88, 96, 105, 0.36);\n}\n.vditor-footnotes__goto-ref {\n text-decoration: none;\n}\n.vditor-toc {\n margin-bottom: 16px;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n color: #4285f4;\n}\n.vditor-toc .vditor-outline__action {\n display: none;\n}\n.vditor-toc ul {\n list-style: none !important;\n padding-left: 1em;\n}\n.vditor-toc > ul {\n padding-left: 0;\n}\n.vditor-toc span {\n cursor: pointer;\n}\n.vditor-toc li > span > svg {\n width: 0;\n height: 0;\n}\n.vditor-outline {\n width: 250px;\n border-right: 1px solid var(--border-color);\n background-color: var(--panel-background-color);\n display: none;\n overflow: auto;\n}\n.vditor-outline--right {\n border-right: 0;\n border-left: 1px solid var(--border-color);\n}\n.vditor-outline::-webkit-scrollbar {\n display: none;\n}\n.vditor-outline ul {\n list-style: none !important;\n padding-left: 1em;\n margin: 0;\n}\n.vditor-outline__content > ul {\n padding-left: 0;\n}\n.vditor-outline li > span {\n display: flex;\n align-items: center;\n padding: 5px 10px;\n cursor: pointer;\n color: var(--textarea-text-color);\n}\n.vditor-outline li > span > svg {\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.vditor-outline li > span:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-outline li > span > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vditor-outline__title {\n border-bottom: 1px dashed var(--border-color);\n padding: 5px 10px;\n color: var(--toolbar-icon-color);\n font-size: 12px;\n}\n.vditor-outline__action {\n transition: all 0.15s ease-in-out;\n fill: currentColor;\n margin-right: 5px;\n flex-shrink: 0;\n}\n.vditor-outline__action--close {\n transform: rotate(-90deg);\n}\n.vditor-wysiwyg {\n box-sizing: border-box;\n flex: 1;\n position: relative;\n width: 100%;\n min-width: 1px;\n}\n.vditor-wysiwyg pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-wysiwyg pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-wysiwyg pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-wysiwyg pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-wysiwyg blockquote:empty::before,\n.vditor-wysiwyg pre > code:empty::before,\n.vditor-wysiwyg p:empty::before,\n.vditor-wysiwyg h1:empty::after,\n.vditor-wysiwyg h2:empty::after,\n.vditor-wysiwyg h3:empty::after,\n.vditor-wysiwyg h4:empty::after,\n.vditor-wysiwyg h5:empty::after,\n.vditor-wysiwyg h6:empty::after {\n content: \' \';\n}\n.vditor-wysiwyg code[data-marker="`"] {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n.vditor-wysiwyg__block pre:first-child {\n margin-bottom: -1em;\n}\n.vditor-wysiwyg__block pre:first-child code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-wysiwyg__block pre:last-child {\n margin-bottom: 1em;\n}\n.vditor-wysiwyg__preview {\n cursor: pointer;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-wysiwyg > .vditor-reset > h1:before,\n.vditor-wysiwyg > .vditor-reset > h2:before,\n.vditor-wysiwyg > .vditor-reset > h3:before,\n.vditor-wysiwyg > .vditor-reset > h4:before,\n.vditor-wysiwyg > .vditor-reset > h5:before,\n.vditor-wysiwyg > .vditor-reset > h6:before,\n.vditor-wysiwyg div.vditor-wysiwyg__block:before,\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n.vditor-wysiwyg div[data-type="footnotes-block"]:before,\n.vditor-wysiwyg .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-wysiwyg > .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-wysiwyg > .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-wysiwyg > .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-wysiwyg > .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-wysiwyg > .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-wysiwyg div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block:before {\n content: "</>";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="yaml-front-matter"]:before {\n content: "F";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="math-block"]:before {\n content: "$$";\n}\n.vditor-wysiwyg .vditor-toc:before {\n content: "ToC";\n}\n.vditor-wysiwyg hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-wysiwyg details {\n white-space: initial;\n}\n.vditor-wysiwyg a {\n cursor: pointer;\n}\n.vditor-wysiwyg span[data-type="backslash"] > span {\n display: none;\n color: var(--second-color);\n}\n.vditor-wysiwyg span[data-type="link-ref"],\n.vditor-wysiwyg sup[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-wysiwyg span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n.vditor-wysiwyg div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n@media screen and (max-width: 520px) {\n .vditor-wysiwyg h1:before,\n .vditor-wysiwyg h2:before,\n .vditor-wysiwyg h3:before,\n .vditor-wysiwyg h4:before,\n .vditor-wysiwyg h5:before,\n .vditor-wysiwyg h6:before,\n .vditor-wysiwyg div.vditor-wysiwyg__block:before,\n .vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n .vditor-wysiwyg div[data-type="footnotes-block"]:before,\n .vditor-wysiwyg .vditor-toc:before {\n content: none;\n }\n}\n.vditor-ir {\n box-sizing: border-box;\n flex: 1;\n min-width: 1px;\n position: relative;\n width: 100%;\n}\n.vditor-ir__node[data-type="code-block"]:before,\n.vditor-ir__node[data-type="code-block"]:after,\n.vditor-ir__node[data-type="yaml-front-matter"]:before,\n.vditor-ir__node[data-type="yaml-front-matter"]:after,\n.vditor-ir__node[data-type="math-block"]:before,\n.vditor-ir__node[data-type="math-block"]:after {\n content: \' \';\n color: var(--second-color);\n}\n.vditor-ir__node:not(.vditor-ir__node--expand) .vditor-ir__marker {\n padding: 0 !important;\n}\n.vditor-ir__node:not(.vditor-ir__node--expand)[data-type="a"] {\n cursor: pointer;\n}\n.vditor-ir__node[data-type="link-ref"],\n.vditor-ir__node[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-ir__node[data-type="html-block"] {\n margin-bottom: 1em;\n}\n.vditor-ir__node .vditor-ir__marker {\n width: 0;\n overflow: hidden;\n display: inline-block;\n height: 0;\n transition: all 0.15s ease-in-out;\n}\n.vditor-ir__node--hidden .vditor-ir__marker {\n visibility: hidden;\n}\n.vditor-ir__node--expand .vditor-ir__marker {\n color: var(--second-color);\n display: inline;\n height: auto;\n width: auto;\n}\n.vditor-ir__node--expand .vditor-ir__marker--hide {\n display: none;\n}\n.vditor-ir__node--expand .vditor-ir__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bracket {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir__node--expand .vditor-ir__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--pre code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-ir__node--expand[data-type="code-block"]:before,\n.vditor-ir__node--expand[data-type="code-block"]:after {\n content: \'```\';\n}\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:before,\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:after {\n content: \'---\';\n}\n.vditor-ir__node--expand[data-type="math-block"]:before,\n.vditor-ir__node--expand[data-type="math-block"]:after {\n content: \'$$\';\n}\n.vditor-ir__node span[data-type="code-block-open-marker"],\n.vditor-ir__node span[data-type="code-block-close-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-open-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-close-marker"],\n.vditor-ir__node span[data-type="math-block-open-marker"],\n.vditor-ir__node span[data-type="math-block-close-marker"] {\n display: none;\n}\n.vditor-ir__preview {\n cursor: pointer;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-ir__link {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-ir pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-ir pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-ir pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-ir pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-ir pre.vditor-reset pre {\n margin: 0;\n}\n.vditor-ir hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-ir blockquote:empty::before,\n.vditor-ir pre > code:empty::before,\n.vditor-ir p:empty::before,\n.vditor-ir h1:empty::after,\n.vditor-ir h2:empty::after,\n.vditor-ir h3:empty::after,\n.vditor-ir h4:empty::after,\n.vditor-ir h5:empty::after,\n.vditor-ir h6:empty::after {\n content: \' \';\n}\n.vditor-ir .vditor-reset > h1:before,\n.vditor-ir .vditor-reset > h2:before,\n.vditor-ir .vditor-reset > h3:before,\n.vditor-ir .vditor-reset > h4:before,\n.vditor-ir .vditor-reset > h5:before,\n.vditor-ir .vditor-reset > h6:before,\n.vditor-ir div[data-type="link-ref-defs-block"]:before,\n.vditor-ir div[data-type="footnotes-block"]:before,\n.vditor-ir .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-ir .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-ir .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-ir .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-ir .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-ir .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-ir div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n.vditor-ir div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-ir div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-ir div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ul,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ol,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > p,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > blockquote,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > pre,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > table,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > hr {\n margin-left: 8px;\n}\n.vditor-ir .vditor-toc:before {\n content: "ToC";\n}\n.vditor-ir .vditor-toc span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n@media screen and (max-width: 520px) {\n .vditor-ir h1:before,\n .vditor-ir h2:before,\n .vditor-ir h3:before,\n .vditor-ir h4:before,\n .vditor-ir h5:before,\n .vditor-ir h6:before,\n .vditor-ir div[data-type="link-ref-defs-block"]:before,\n .vditor-ir div[data-type="footnotes-block"]:before,\n .vditor-ir .vditor-toc:before {\n content: none;\n }\n}\n.vditor-sv {\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n margin: 0 1px 0 0;\n overflow: auto;\n width: 100%;\n flex: 1;\n min-width: 1px;\n border: 0;\n resize: none;\n padding: 10px 9px 10px 10px;\n box-sizing: border-box;\n background-color: var(--panel-background-color);\n outline: 0 none;\n font-size: 16px;\n line-height: 22px;\n color: var(--textarea-text-color);\n border-radius: 0 0 3px 3px;\n font-variant-ligatures: no-common-ligatures;\n white-space: pre-wrap;\n word-break: break-word;\n word-wrap: break-word;\n}\n.vditor-sv[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-sv:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-sv:focus {\n background-color: var(--textarea-background-color);\n}\n.vditor-sv:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-sv span[data-type="newline"] + span[data-type="text"]:empty {\n display: inherit;\n}\n.vditor-sv .sup {\n vertical-align: super;\n font-size: smaller;\n}\n.vditor-sv .strong {\n font-weight: bold;\n}\n.vditor-sv .em {\n font-style: italic;\n}\n.vditor-sv .s {\n text-decoration: line-through;\n}\n.vditor-sv .mark:not(.vditor-sv__marker) {\n background-color: yellow;\n color: black;\n}\n.vditor-sv .h1 {\n font-size: 1.75em;\n line-height: 44px;\n}\n.vditor-sv .h2 {\n font-size: 1.55em;\n line-height: 38px;\n}\n.vditor-sv .h3 {\n font-size: 1.38em;\n line-height: 27px;\n}\n.vditor-sv .h4 {\n font-size: 1.25em;\n line-height: 25px;\n}\n.vditor-sv .h5 {\n font-size: 1.13em;\n}\n.vditor-sv .h6 {\n font-size: 1em;\n}\n.vditor-sv__marker {\n color: var(--second-color);\n}\n.vditor-sv__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-sv__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-sv__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-sv__marker--bracket {\n color: var(--ir-bracket-color);\n}\n.vditor-sv__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-sv__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--strong {\n font-weight: bold;\n}\n',""]),e.exports=t}}]);
|
|
3
|
+
//# sourceMappingURL=async-feffery_vditor.js.map
|
|
4
|
+
//# sourceMappingURL=async-feffery_vditor.js.map
|