2023-10-17 11:41:08 +08:00

127 lines
120 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{d as G,al as J,G as le,a as Z,j as s,b as Re,ak as j,F as je,X as M,W as se,r as V,dt as tn,x as De,ao as nn,ax as ln,du as Fe,dv as on,dw as rn,C as an,dx as sn,c as he,e as cn,n as ht,w as U,g as pe,l as ge,f as xe,aj as pt,u as te,h as Se,at as Te,y as un,v as ft,_ as dn}from"./index.js";import{_ as mn}from"./Bar.vue_vue_type_script_setup_true_lang.js";import{_ as hn}from"./Pie.vue_vue_type_script_setup_true_lang.js";import{_ as pn}from"./Line.vue_vue_type_script_setup_true_lang.js";import{g as fn}from"./list3.js";import{T as ze}from"./index64.js";import{_ as gn}from"./Github.vue_vue_type_script_setup_true_lang.js";import{u as vn}from"./index60.js";import"./app.js";import"./columns17.js";import"./office-building.js";import"./iphone.js";import"./user-3-fill.js";var bn=Object.defineProperty,kn=Object.defineProperties,yn=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,wn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,vt=(l,e,t)=>e in l?bn(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,Q=(l,e)=>{for(var t in e||(e={}))wn.call(e,t)&&vt(l,t,e[t]);if(gt)for(var t of gt(e))xn.call(e,t)&&vt(l,t,e[t]);return l},Le=(l,e)=>kn(l,yn(e));const d="md-editor",$n="md-editor-v3",Cn="https://at.alicdn.com/t/c/font_2605852_gymddm8qwtd.js",q="https://cdnjs.cloudflare.com/ajax/libs",_n=`${q}/highlight.js/11.7.0/highlight.min.js`,bt={main:`${q}/prettier/2.8.0/standalone.js`,markdown:`${q}/prettier/2.8.0/parser-markdown.js`},kt={css:`${q}/cropperjs/1.5.13/cropper.min.css`,js:`${q}/cropperjs/1.5.13/cropper.min.js`},En=`${q}/screenfull.js/5.2.0/screenfull.min.js`,Nt=["bold","underline","italic","strikeThrough","-","title","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","mermaid","katex","-","revoke","next","save","=","prettier","pageFullscreen","fullscreen","preview","htmlPreview","catalog","github"],Ut=["markdownTotal","=","scrollSwitch"],yt={"zh-CN":{toolbarTips:{bold:"加粗",underline:"下划线",italic:"斜体",strikeThrough:"删除线",title:"标题",sub:"下标",sup:"上标",quote:"引用",unorderedList:"无序列表",orderedList:"有序列表",task:"任务列表",codeRow:"行内代码",code:"块级代码",link:"链接",image:"图片",table:"表格",mermaid:"mermaid图",katex:"katex公式",revoke:"后退",next:"前进",save:"保存",prettier:"美化",pageFullscreen:"浏览器全屏",fullscreen:"屏幕全屏",preview:"预览",htmlPreview:"html代码预览",catalog:"目录",github:"源码地址"},titleItem:{h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题"},imgTitleItem:{link:"添加链接",upload:"上传图片",clip2upload:"裁剪上传"},linkModalTips:{linkTitle:"添加链接",imageTitle:"添加图片",descLabel:"链接描述:",descLabelPlaceHolder:"请输入描述...",urlLabel:"链接地址:",urlLabelPlaceHolder:"请输入链接...",buttonOK:"确定"},clipModalTips:{title:"裁剪图片上传",buttonUpload:"上传"},copyCode:{text:"复制代码",successTips:"已复制!",failTips:"复制失败!"},mermaid:{flow:"流程图",sequence:"时序图",gantt:"甘特图",class:"类图",state:"状态图",pie:"饼图",relationship:"关系图",journey:"旅程图"},katex:{inline:"行内公式",block:"块级公式"},footer:{markdownTotal:"字数",scrollAuto:"同步滚动"}},"en-US":{toolbarTips:{bold:"bold",underline:"underline",italic:"italic",strikeThrough:"strikeThrough",title:"title",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"unordered list",orderedList:"ordered list",task:"task list",codeRow:"inline code",code:"block-level code",link:"link",image:"image",table:"table",mermaid:"mermaid",katex:"formula",revoke:"revoke",next:"undo revoke",save:"save",prettier:"prettier",pageFullscreen:"fullscreen in page",fullscreen:"fullscreen",preview:"preview",htmlPreview:"html preview",catalog:"catalog",github:"source code"},titleItem:{h1:"Lv1 Heading",h2:"Lv2 Heading",h3:"Lv3 Heading",h4:"Lv4 Heading",h5:"Lv5 Heading",h6:"Lv6 Heading"},imgTitleItem:{link:"Add Img Link",upload:"Upload Img",clip2upload:"Clip Upload"},linkModalTips:{linkTitle:"Add Link",imageTitle:"Add Image",descLabel:"Desc:",descLabelPlaceHolder:"Enter a description...",urlLabel:"Link:",urlLabelPlaceHolder:"Enter a link...",buttonOK:"OK"},clipModalTips:{title:"Crop Image",buttonUpload:"Upload"},copyCode:{text:"Copy",successTips:"Copied!",failTips:"Copy failed!"},mermaid:{flow:"flow",sequence:"sequence",gantt:"gantt",class:"class",state:"state",pie:"pie",relationship:"relationship",journey:"journey"},katex:{inline:"inline",block:"block"},footer:{markdownTotal:"Word Count",scrollAuto:"Scroll Auto"}}},Sn=`${q}/mermaid/9.3.0/mermaid.min.js`,wt={js:`${q}/KaTeX/0.16.3/katex.min.js`,css:`${q}/KaTeX/0.16.3/katex.min.css`},xt={a11y:{light:`${q}/highlight.js/11.7.0/styles/a11y-light.min.css`,dark:`${q}/highlight.js/11.7.0/styles/a11y-dark.min.css`},atom:{light:`${q}/highlight.js/11.7.0/styles/atom-one-light.min.css`,dark:`${q}/highlight.js/11.7.0/styles/atom-one-dark.min.css`},github:{light:`${q}/highlight.js/11.7.0/styles/github.min.css`,dark:`${q}/highlight.js/11.7.0/styles/github-dark.min.css`},gradient:{light:`${q}/highlight.js/11.7.0/styles/gradient-light.min.css`,dark:`${q}/highlight.js/11.7.0/styles/gradient-dark.min.css`},kimbie:{light:`${q}/highlight.js/11.7.0/styles/kimbie-light.min.css`,dark:`${q}/highlight.js/11.7.0/styles/kimbie-dark.min.css`},paraiso:{light:`${q}/highlight.js/11.7.0/styles/paraiso-light.min.css`,dark:`${q}/highlight.js/11.7.0/styles/paraiso-dark.min.css`},qtcreator:{light:`${q}/highlight.js/11.7.0/styles/qtcreator-light.min.css`,dark:`${q}/highlight.js/11.7.0/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${q}/highlight.js/11.7.0/styles/stackoverflow-light.min.css`,dark:`${q}/highlight.js/11.7.0/styles/stackoverflow-dark.min.css`}},W={markedRenderer:l=>l,markedExtensions:[],markedOptions:{},editorExtensions:{},editorConfig:{}},Tn=l=>{if(l)for(const e in l){const t=l[e];t&&(W[e]=t)}};class zn{constructor(){this.pools={}}remove(e,t,n){const o=this.pools[e]&&this.pools[e][t];o&&(this.pools[e][t]=o.filter(a=>a!==n))}clear(e){this.pools[e]={}}on(e,t){return this.pools[e]||(this.pools[e]={}),this.pools[e][t.name]||(this.pools[e][t.name]=[]),this.pools[e][t.name].push(t.callback),this.pools[e][t.name].includes(t.callback)}emit(e,t,...n){this.pools[e]||(this.pools[e]={});const o=this.pools[e][t];o&&o.forEach(a=>{try{a(...n)}catch(r){console.error(`${t} monitor event exception`,r)}})}}var b=new zn;const ce=(l,e=0,t=e)=>new Promise((n,i)=>{l.setSelectionRange?setTimeout(()=>{l.setSelectionRange(e,t),l.focus(),n(!0)},0):(console.error("Can not reset position!"),i())}),lt=(l,e,t)=>{const{deviationStart:n=0,deviationEnd:i=0,direct:o=!1,select:a=!1}=t;let r="";if(l.selectionStart||l.selectionStart===0){const m=l.selectionStart,u=l.selectionEnd||0,{prefixVal:c=l.value.substring(0,m),subfixVal:h=l.value.substring(u,l.value.length)}=t;r=c+e+h,ce(l,a?m+n:m+e.length+i,m+e.length+i)}else r+=e;return o&&(l.value=r),r},In=(l,e={newWindow:!0,nofollow:!0})=>{l||console.error("error link!");const t=document.createElement("a");t.href=l,t.style.display="none",e.newWindow&&(t.target="_blank"),e.nofollow&&(t.rel="noopener noreferrer"),document.body.appendChild(t),t.click(),document.body.removeChild(t)},$t=(l,e)=>{const t=tt(()=>{l.removeEventListener("scroll",n),l.addEventListener("scroll",n),e.removeEventListener("scroll",n),e.addEventListener("scroll",n)},50),n=i=>{const o=l.clientHeight,a=e.clientHeight,r=l.scrollHeight,m=e.scrollHeight,u=(r-o)/(m-a);i.target===l?(e.removeEventListener("scroll",n),e.scrollTo({top:l.scrollTop/u}),t()):(l.removeEventListener("scroll",n),l.scrollTo({top:e.scrollTop*u}),t())};return[t,()=>{l.removeEventListener("scroll",n),e.removeEventListener("scroll",n)}]},An=(l,e="image.png")=>{const t=l.split(","),n=t[0].match(/:(.*?);/);if(n){const i=n[1],o=atob(t[1]);let a=o.length;const r=new Uint8Array(a);for(;a--;)r[a]=o.charCodeAt(a);return new File([r],e,{type:i})}return null},Ct=l=>{if(!l.trim())return l;const e=l.split(`
`),t=['<span rn-wrapper aria-hidden="true">'];return e.forEach(()=>{t.push("<span></span>")}),t.push("</span>"),`<span class="code-block">${l}</span>${t.join("")}`},tt=(l,e=200)=>{let t=0;return(...n)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{l.apply(globalThis,n),t=0},e)}},Fn=(l,e=200)=>{let t=0,n=null;return(...i)=>{const o=a=>{t===0&&(t=a),a-t>=e?(l.apply(globalThis,n),n=null,t=0):window.requestAnimationFrame(o)};n===null&&window.requestAnimationFrame(o),n=i}},_t=(l,e="$")=>{const t=l.split(e);let n=e,i="";for(let o=1;o<t.length;o++)if(/\\$/.test(t[o]))n+=t[o]+"$",i+=t[o]+"$";else{n+=t[o]+e,i+=t[o];break}return[n,i]},Ln=l=>{var e;return navigator.userAgent.indexOf("Firefox")>-1?l.value.substring(l.selectionStart,l.selectionEnd):((e=window.getSelection())==null?void 0:e.toString())||""},Dn=(l,e)=>{const t=l==null?void 0:l.getBoundingClientRect();if(e===document.documentElement)return t.top-e.clientTop;const n=e==null?void 0:e.getBoundingClientRect();return t.top-n.top},Rn=(l,e)=>{const t=Q({},l);return e.forEach(n=>{Reflect.deleteProperty(t,n)}),t},Et=(l,e)=>{const t=n=>{const i=l.parentElement||document.body,o=i.offsetWidth,a=i.offsetHeight,{clientWidth:r}=document.documentElement,{clientHeight:m}=document.documentElement,u=n.offsetX,c=n.offsetY,h=p=>{let w=p.x+document.body.scrollLeft-document.body.clientLeft-u,C=p.y+document.body.scrollTop-document.body.clientTop-c;w=w<1?1:w<r-o-1?w:r-o-1,C=C<1?1:C<m-a-1?C:m-a-1,e?e(w,C):(i.style.left=`${w}px`,i.style.top=`${C}px`)};document.addEventListener("mousemove",h);const f=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f)};return l.addEventListener("mousedown",t),()=>{l.removeEventListener("mousedown",t)}},ne=(l,e="")=>{const t=document.getElementById(l.id);t?e!==""&&l.onload instanceof Function&&(Reflect.get(window,e)?l.onload(new Event("load")):t.addEventListener("load",l.onload)):document.head.appendChild(l)},jn=tt((l,e,t)=>{const n=document.getElementById(l);n&&n.setAttribute(e,t)},10),Ye="onSave",at="changeCatalogVisible",qt="changeFullscreen",St="pageFullscreenChanged",Tt="fullscreenChanged",zt="previewChanged",It="htmlPreviewChanged",At="catalogVisibleChanged",Vt="textarea_focus",Pn=(l,e)=>{const{editorId:t,noPrettier:n,previewOnly:i}=l,o=J({buildFinished:!1,html:""}),a=r=>{if(r.target===document.querySelector(`#${l.editorId}-textarea`))if(b.emit(t,"selectTextChange"),r.ctrlKey||r.metaKey)switch(r.code){case"KeyS":{r.shiftKey?b.emit(t,"replace","strikeThrough"):(b.emit(t,Ye,l.modelValue),r.preventDefault());break}case"KeyB":{b.emit(t,"replace","bold"),r.preventDefault();break}case"KeyU":{r.shiftKey?(b.emit(t,"replace","unorderedList"),r.preventDefault()):(b.emit(t,"replace","underline"),r.preventDefault());break}case"KeyI":{r.shiftKey?(b.emit(t,"openModals","image"),r.preventDefault()):(b.emit(t,"replace","italic"),r.preventDefault());break}case"Digit1":{b.emit(t,"replace","h1"),r.preventDefault();break}case"Digit2":{b.emit(t,"replace","h2"),r.preventDefault();break}case"Digit3":{b.emit(t,"replace","h3"),r.preventDefault();break}case"Digit4":{b.emit(t,"replace","h4"),r.preventDefault();break}case"Digit5":{b.emit(t,"replace","h5"),r.preventDefault();break}case"Digit6":{b.emit(t,"replace","h6"),r.preventDefault();break}case"ArrowUp":{b.emit(t,"replace","sup"),r.preventDefault();break}case"ArrowDown":{b.emit(t,"replace","sub"),r.preventDefault();break}case"KeyQ":{if(r.key==="a"){r.target.select();return}b.emit(t,"replace","quote"),r.preventDefault();break}case"KeyA":if(r.key==="q"){b.emit(t,"replace","quote"),r.preventDefault();break}else return;case"KeyO":{b.emit(t,"replace","orderedList"),r.preventDefault();break}case"KeyC":{if(r.shiftKey)b.emit(t,"replace","code"),r.preventDefault();else if(r.altKey)b.emit(t,"replace","codeRow"),r.preventDefault();else{r.preventDefault(),b.emit(t,"replace","ctrlC");break}break}case"KeyL":{b.emit(t,"openModals","link"),r.preventDefault();break}case"KeyZ":{if(r.key==="w")return;r.shiftKey?(b.emit(t,"ctrlShiftZ"),r.preventDefault()):(b.emit(t,"ctrlZ"),r.preventDefault());break}case"KeyW":if(r.key==="z"){r.shiftKey?(b.emit(t,"ctrlShiftZ"),r.preventDefault()):(b.emit(t,"ctrlZ"),r.preventDefault());break}else return;case"KeyF":{r.shiftKey&&(n||(b.emit(t,"replace","prettier"),r.preventDefault()));break}case"KeyT":{r.altKey&&r.shiftKey&&(b.emit(t,"replace","table"),r.preventDefault());break}case"KeyX":{b.emit(t,"replace","ctrlX"),r.preventDefault();break}case"KeyD":{r.preventDefault(),b.emit(t,"replace","ctrlD");break}}else r.code==="Tab"&&(r.preventDefault(),r.shiftKey?b.emit(t,"replace","shiftTab"):b.emit(t,"replace","tab"))};M(()=>l.modelValue,()=>{o.buildFinished=!1}),Z(()=>{i||(window.addEventListener("keydown",a),b.on(t,{name:"buildFinished",callback(r){o.buildFinished=!0,o.html=r}}),b.on(t,{name:Ye,callback(){const r=new Promise(m=>{if(o.buildFinished)m(o.html);else{const u=c=>{m(c),b.remove(t,"buildFinished",u)};b.on(t,{name:"buildFinished",callback:u})}});l.onSave?l.onSave(l.modelValue,r):e.emit("onSave",l.modelValue,r)}}))}),Re(()=>{i||window.removeEventListener("keydown",a)})},On=l=>{var e;const{editorId:t,previewOnly:n}=l,i=(e=W==null?void 0:W.editorExtensions)==null?void 0:e.highlight;se("editorId",t),se("tabWidth",l.tabWidth),se("theme",le(()=>l.theme)),se("highlight",le(()=>{const a=Q(Q({},xt),i==null?void 0:i.css),r=l.codeStyleReverse&&l.codeStyleReverseList.includes(l.previewTheme)?"dark":l.theme;return{js:(i==null?void 0:i.js)||_n,css:a[l.codeTheme]?a[l.codeTheme][r]:xt.atom[r]}})),se("historyLength",l.historyLength),se("previewOnly",n),se("showCodeRowNumber",l.showCodeRowNumber);const o=le(()=>{var a;const r=Q(Q({},yt),(a=W==null?void 0:W.editorConfig)==null?void 0:a.languageUserDefined);return r[l.language]?r[l.language]:yt["zh-CN"]});se("usedLanguageText",o),se("previewTheme",le(()=>l.previewTheme))},Hn=l=>{var e,t,n,i,o,a;const{noPrettier:r,previewOnly:m,noIconfont:u,noUploadImg:c}=l,{editorExtensions:h}=W,f=r||!!((t=(e=W.editorExtensions)==null?void 0:e.prettier)!=null&&t.prettierInstance),p=r||!!((i=(n=W.editorExtensions)==null?void 0:n.prettier)!=null&&i.parserMarkdownInstance),w=c||!!((a=(o=W.editorExtensions)==null?void 0:o.cropper)!=null&&a.instance);Z(()=>{var C,y,g,x;const E=document.createElement("script");E.src=(h==null?void 0:h.iconfont)||Cn,E.id=`${d}-icon`;const S=document.createElement("script"),z=document.createElement("script");S.src=((C=h==null?void 0:h.prettier)==null?void 0:C.standaloneJs)||bt.main,S.id=`${d}-prettier`,z.src=((y=h==null?void 0:h.prettier)==null?void 0:y.parserMarkdownJs)||bt.markdown,z.id=`${d}-prettierMD`;const R=document.createElement("link");R.rel="stylesheet",R.href=((g=h==null?void 0:h.cropper)==null?void 0:g.css)||kt.css,R.id=`${d}-cropperCss`;const F=document.createElement("script");F.src=((x=h==null?void 0:h.cropper)==null?void 0:x.js)||kt.js,F.id=`${d}-cropper`,m||(u||ne(E),w||(ne(R),ne(F)),f||ne(S),p||ne(z))})},Bn=(l,e)=>{const{editorId:t,previewOnly:n}=l,i=J({pageFullscreen:l.pageFullscreen,fullscreen:!1,preview:l.preview,htmlPreview:l.preview?!1:l.htmlPreview}),o=(m,u)=>{i[m]=u===void 0?!i[m]:u,m==="preview"&&i.preview?i.htmlPreview=!1:m==="htmlPreview"&&i.htmlPreview&&(i.preview=!1)};let a="";const r=()=>{i.pageFullscreen||i.fullscreen?document.body.style.overflow="hidden":document.body.style.overflow=a};return M(()=>[i.pageFullscreen,i.fullscreen],r),Z(()=>{n||b.on(t,{name:"uploadImage",callback(m,u){const c=h=>{b.emit(t,"replace","image",{desc:"",urls:h}),u&&u()};l.onUploadImg?l.onUploadImg(m,c):e.emit("onUploadImg",m,c)}}),a=document.body.style.overflow,r()}),[i,o]},Mn=l=>{const{editorId:e}=l,t=V(!1);Z(()=>{b.on(e,{name:at,callback:i=>{i===void 0?t.value=!t.value:t.value=i}})});const n=le(()=>!l.toolbarsExclude.includes("catalog")&&l.toolbars.includes("catalog"));return[t,n]},Nn=(l,e,t,n,i)=>{const{editorId:o}=l;M(()=>n.pageFullscreen,r=>{b.emit(o,St,r)}),M(()=>n.fullscreen,r=>{b.emit(o,Tt,r)}),M(()=>n.preview,r=>{b.emit(o,zt,r)}),M(()=>n.htmlPreview,r=>{b.emit(o,It,r)}),M(t,r=>{b.emit(o,At,r)});const a={on(r,m){switch(r){case"pageFullscreen":{b.on(o,{name:St,callback(u){m(u)}});break}case"fullscreen":{b.on(o,{name:Tt,callback(u){m(u)}});break}case"preview":{b.on(o,{name:zt,callback(u){m(u)}});break}case"htmlPreview":{b.on(o,{name:It,callback(u){m(u)}});break}case"catalog":{b.on(o,{name:At,callback(u){m(u)}});break}}},togglePageFullscreen(r){i("pageFullscreen",r)},toggleFullscreen(r){b.emit(o,qt,r)},togglePreview(r){i("preview",r)},toggleHtmlPreview(r){i("htmlPreview",r)},toggleCatalog(r){b.emit(o,at,r)},triggerSave(){b.emit(o,Ye)},insert(r){b.emit(o,"replace","universal",{generate:r})},focus(){b.emit(o,Vt)}};e.expose(a)};var Un=G({setup(){return()=>s("div",{class:`${d}-divider`},null)}});const ie=({instance:l,ctx:e,props:t={}},n="default")=>{const i=(l==null?void 0:l.$slots[n])||(e==null?void 0:e.slots[n]);return(i?i(l):"")||t[n]},qn=()=>({trigger:{type:String,default:"hover"},overlay:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},onChange:{type:Function,default:()=>()=>{}},relative:{type:String,default:"html"}});var Ce=G({props:qn(),setup(l,e){const t=`${d}-dropdown-hidden`,n=J({overlayClass:[t],overlayStyle:{},triggerHover:!1,overlayHover:!1}),i=V(),o=V(),a=()=>{var h;l.trigger==="hover"&&(n.triggerHover=!0);const f=i.value,p=o.value,w=f.getBoundingClientRect(),C=f.offsetTop,y=f.offsetLeft,g=w.height,x=w.width,E=((h=document.querySelector(l.relative))==null?void 0:h.scrollLeft)||0;n.overlayStyle=Le(Q({},n.overlayStyle),{top:C+g+"px",left:y-p.offsetWidth/2+x/2-E+"px"}),l.onChange(!0)},r=()=>{n.overlayHover=!0};M(()=>l.visible,h=>{h?n.overlayClass=n.overlayClass.filter(f=>f!==t):n.overlayClass.push(t)});const m=h=>{const f=i.value,p=o.value;!f.contains(h.target)&&!p.contains(h.target)&&l.onChange(!1)};let u=-1;const c=h=>{i.value===h.target?n.triggerHover=!1:n.overlayHover=!1,clearTimeout(u),u=window.setTimeout(()=>{!n.overlayHover&&!n.triggerHover&&l.onChange(!1)},10)};return Z(()=>{l.trigger==="click"?(i.value.addEventListener("click",a),document.addEventListener("click",m)):(i.value.addEventListener("mouseenter",a),i.value.addEventListener("mouseleave",c),o.value.addEventListener("mouseenter",r),o.value.addEventListener("mouseleave",c))}),Re(()=>{l.trigger==="click"?(i.value.removeEventListener("click",a),document.removeEventListener("click",m)):(i.value.removeEventListener("mouseenter",a),i.value.removeEventListener("mouseleave",c),o.value.removeEventListener("mouseenter",r),o.value.removeEventListener("mouseleave",c))}),()=>{const h=ie({ctx:e}),f=ie({props:l,ctx:e},"overlay"),p=tn(h instanceof Array?h[0]:h,{ref:i}),w=s("div",{class:[`${d}-dropdown`,n.overlayClass],style:n.overlayStyle,ref:o},[s("div",{class:`${d}-dropdown-overlay`},[f instanceof Array?f[0]:f])]);return[p,w]}}});const Vn=()=>({title:{type:String,default:""},visible:{type:Boolean,default:!1},width:{type:String,default:"auto"},height:{type:String,default:"auto"},onClose:{type:Function,default:()=>()=>{}},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:()=>()=>{}},class:{type:String}});var st=G({props:Vn(),setup(l,e){const t=V(l.visible),n=V([`${d}-modal`]),i=V(),o=V();let a=()=>{};const r=J({initPos:{left:"0px",top:"0px"},historyPos:{left:"0px",top:"0px"}}),m=le(()=>l.isFullscreen?{width:"100%",height:"100%"}:{width:l.width,height:l.height});return Z(()=>{a=Et(o.value,(u,c)=>{r.initPos.left=u+"px",r.initPos.top=c+"px"})}),Re(()=>{a()}),M(()=>l.isFullscreen,u=>{u?a():a=Et(o.value,(c,h)=>{r.initPos.left=c+"px",r.initPos.top=h+"px"})}),M(()=>l.visible,u=>{u?(n.value.push("zoom-in"),t.value=u,De(()=>{const c=i.value.offsetWidth/2,h=i.value.offsetHeight/2,f=document.documentElement.clientWidth/2,p=document.documentElement.clientHeight/2;r.initPos.left=f-c+"px",r.initPos.top=p-h+"px"}),setTimeout(()=>{n.value=n.value.filter(c=>c!=="zoom-in")},140)):(n.value.push("zoom-out"),setTimeout(()=>{n.value=n.value.filter(c=>c!=="zoom-out"),t.value=u},130))}),()=>{const u=ie({ctx:e}),c=ie({props:l,ctx:e},"title");return s("div",{class:[l.class],style:{display:t.value?"block":"none"}},[s("div",{class:`${d}-modal-mask`,onClick:l.onClose},null),s("div",{class:n.value,style:Q(Q({},r.initPos),m.value),ref:i},[s("div",{class:`${d}-modal-header`,ref:o},[c||""]),s("div",{class:`${d}-modal-body`},[u]),s("div",{class:`${d}-modal-func`},[l.showAdjust&&s("div",{class:`${d}-modal-adjust`,onClick:h=>{h.stopPropagation(),l.isFullscreen?r.initPos=r.historyPos:(r.historyPos=r.initPos,r.initPos={left:"0",top:"0"}),l.onAdjust(!l.isFullscreen)}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":`#md-editor-icon-${l.isFullscreen?"suoxiao":"fangda"}`},null)])]),s("div",{class:`${d}-modal-close`,onClick:h=>{h.stopPropagation(),l.onClose&&l.onClose()}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-close"},null)])])])])])}}});const Kn=()=>({type:{type:String,default:"link"},visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>()=>{}},onOk:{type:Function,default:()=>()=>{}}});var Zn=G({props:Kn(),setup(l){const e=j("usedLanguageText"),t=j("editorId"),n=le(()=>{var o,a;switch(l.type){case"link":return(o=e.value.linkModalTips)==null?void 0:o.linkTitle;case"image":return(a=e.value.linkModalTips)==null?void 0:a.imageTitle;default:return""}}),i=J({desc:"",url:""});return M(()=>l.visible,o=>{o||setTimeout(()=>{i.desc="",i.url=""},200)}),()=>s(st,{title:n.value,visible:l.visible,onClose:l.onCancel},{default:()=>{var o,a,r,m,u;return[s("div",{class:`${d}-form-item`},[s("label",{class:`${d}-label`,for:`link-desc-${t}`},[(o=e.value.linkModalTips)==null?void 0:o.descLabel]),s("input",{placeholder:(a=e.value.linkModalTips)==null?void 0:a.descLabelPlaceHolder,class:`${d}-input`,id:`link-desc-${t}`,type:"text",value:i.desc,onChange:c=>{i.desc=c.target.value},autocomplete:"off"},null)]),s("div",{class:`${d}-form-item`},[s("label",{class:`${d}-label`,for:`link-url-${t}`},[(r=e.value.linkModalTips)==null?void 0:r.urlLabel]),s("input",{placeholder:(m=e.value.linkModalTips)==null?void 0:m.urlLabelPlaceHolder,class:`${d}-input`,id:`link-url-${t}`,type:"text",value:i.url,onChange:c=>{i.url=c.target.value},autocomplete:"off"},null)]),s("div",{class:`${d}-form-item`},[s("button",{class:[`${d}-btn`,`${d}-btn-row`],type:"button",onClick:()=>{l.onOk(i),i.desc="",i.url=""}},[(u=e.value.linkModalTips)==null?void 0:u.buttonOK])])]}})}});const Gn=()=>({visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>()=>{}},onOk:{type:Function,default:()=>()=>{}}});var Wn=G({props:Gn(),setup(l){var e,t;const n=j("usedLanguageText"),i=j("editorId");let o=(t=(e=W==null?void 0:W.editorExtensions)==null?void 0:e.cropper)==null?void 0:t.instance;const a=V(),r=V(),m=V(),u=J({cropperInited:!1,imgSelected:!1,imgSrc:"",isFullscreen:!1});let c=null;M(()=>l.visible,()=>{l.visible&&!u.cropperInited&&(o=o||window.Cropper,a.value.onchange=()=>{if(!o){b.emit(i,"errorCatcher",{name:"Cropper",message:"Cropper is undefined"});return}const f=a.value.files||[];if(u.imgSelected=!0,(f==null?void 0:f.length)>0){const p=new FileReader;p.onload=w=>{u.imgSrc=w.target.result,De(()=>{c=new o(r.value,{viewMode:2,preview:`.${d}-clip-preview-target`})})},p.readAsDataURL(f[0])}})}),M(()=>[u.imgSelected],()=>{m.value.style=""}),M(()=>u.isFullscreen,()=>{De(()=>{c==null||c.destroy(),m.value.style="",r.value&&(c=new o(r.value,{viewMode:2,preview:`.${d}-clip-preview-target`}))})});const h=()=>{c.clear(),c.destroy(),c=null,a.value.value="",u.imgSelected=!1};return()=>{var f;return s(st,{class:`${d}-modal-clip`,title:(f=n.value.clipModalTips)==null?void 0:f.title,visible:l.visible,onClose:l.onCancel,showAdjust:!0,isFullscreen:u.isFullscreen,onAdjust:p=>{u.isFullscreen=p},width:"668px",height:"421px"},{default:()=>{var p,w;return[s("div",{class:`${d}-form-item ${d}-clip`},[s("div",{class:`${d}-clip-main`},[u.imgSelected?s("div",{class:`${d}-clip-cropper`},[s("img",{src:u.imgSrc,ref:r,style:{display:"none"},alt:""},null),s("div",{class:`${d}-clip-delete`,onClick:h},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-delete"},null)])])]):s("div",{class:`${d}-clip-upload`,onClick:()=>{a.value.click()}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-upload"},null)])])]),s("div",{class:`${d}-clip-preview`},[s("div",{class:`${d}-clip-preview-target`,ref:m},null)])]),s("div",{class:`${d}-form-item`},[s("button",{class:`${d}-btn`,type:"button",onClick:()=>{if(c){const C=c.getCroppedCanvas();b.emit(i,"uploadImage",[An(C.toDataURL("image/png"))],l.onOk),h()}}},[((p=n.value.clipModalTips)==null?void 0:p.buttonUpload)||((w=n.value.linkModalTips)==null?void 0:w.buttonOK)])]),s("input",{ref:a,accept:"image/*",type:"file",multiple:!1,style:{display:"none"}},null)]}})}}});const Xn=()=>({type:{type:String,default:"link"},linkVisible:{type:Boolean,default:!1},clipVisible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>()=>{}},onOk:{type:Function,default:()=>()=>{}}});var Qn=G({props:Xn(),setup(l){return()=>s(je,null,[s(Zn,{type:l.type,visible:l.linkVisible,onOk:l.onOk,onCancel:l.onCancel},null),s(Wn,{visible:l.clipVisible,onOk:l.onOk,onCancel:l.onCancel},null)])}});const Yn=l=>{var e,t,n,i;const o=j("editorId"),a=j("previewOnly");let r=(t=(e=W.editorExtensions)==null?void 0:e.screenfull)==null?void 0:t.instance;const m=(i=(n=W.editorExtensions)==null?void 0:n.screenfull)==null?void 0:i.js,u=V(!1),c=p=>{if(!r){b.emit(o,"errorCatcher",{name:"fullscreen",message:"fullscreen is undefined"});return}r.isEnabled?(u.value=!0,(p===void 0?!r.isFullscreen:p)?r.request():r.exit()):console.error("browser does not support screenfull!")},h=()=>{r&&r.isEnabled&&r.on("change",()=>{(u.value||l.setting.fullscreen)&&(u.value=!1,l.updateSetting("fullscreen"))})},f=()=>{r=window.screenfull,h()};return Z(()=>{if(h(),!a&&!r){const p=document.createElement("script");p.src=m||En,p.onload=f,p.id=`${d}-screenfull`,ne(p,"screenfull")}}),Z(()=>{a||b.on(o,{name:qt,callback:c})}),{fullscreenHandler:c}},Jn=()=>({tableShape:{type:Array,default:()=>[6,4]},onSelected:{type:Function,default:()=>{}}}),el=G({name:"TableShape",props:Jn(),setup(l){const e=J({x:-1,y:-1});return()=>s("div",{class:`${d}-table-shape`,onMouseleave:()=>{e.x=-1,e.y=-1}},[new Array(l.tableShape[1]).fill("").map((t,n)=>s("div",{class:`${d}-table-shape-row`,key:`table-shape-row-${n}`},[new Array(l.tableShape[0]).fill("").map((i,o)=>s("div",{class:`${d}-table-shape-col`,key:`table-shape-col-${o}`,onMouseenter:()=>{e.x=n,e.y=o},onClick:()=>{l.onSelected(e)}},[s("div",{class:[`${d}-table-shape-col-default`,n<=e.x&&o<=e.y&&`${d}-table-shape-col-include`]},null)]))]))])}}),tl=()=>({noPrettier:{type:Boolean},toolbars:{type:Array,default:()=>[]},toolbarsExclude:{type:Array,default:()=>[]},setting:{type:Object,default:()=>({})},screenfull:{type:Object,default:null},screenfullJs:{type:String,default:""},updateSetting:{type:Function,default:()=>()=>{}},tableShape:{type:Array,default:()=>[6,4]},defToolbars:{type:Object},noUploadImg:{type:Boolean}});var nl=G({name:"MDEditorToolbar",props:tl(),setup(l){const e=j("editorId"),t=j("usedLanguageText"),{fullscreenHandler:n}=Yn(l),i=`${e}-toolbar-wrapper`,o=J({title:!1,catalog:!1,image:!1,table:!1,mermaid:!1,katex:!1}),a=(p,w)=>{b.emit(e,"replace",p,w)},r=J({type:"link",linkVisible:!1,clipVisible:!1}),m=V();Z(()=>{b.on(e,{name:"openModals",callback(p){r.type=p,r.linkVisible=!0}})});const u=le(()=>{const p=l.toolbars.filter(g=>!l.toolbarsExclude.includes(g)),w=p.indexOf("="),C=w===-1?p:p.slice(0,w+1),y=w===-1?[]:p.slice(w,Number.MAX_SAFE_INTEGER);return[C,y]}),c=V(),h=()=>{b.emit(e,"uploadImage",Array.from(c.value.files||[])),c.value.value=""};Z(()=>{c.value.addEventListener("change",h)});const f=p=>{var w,C,y,g,x,E,S,z,R,F,v,K,O,H,T,k,$,D,L,P,Y,ae,ee,be,Pe,Oe,He,me,Be,Me,fe,Ne,Ue,ke,ye,qe,Ve,we,Ke,Ze,Ee,dt,mt;if(Nt.includes(p))switch(p){case"-":return s(Un,null,null);case"bold":return s("div",{class:`${d}-toolbar-item`,title:(w=t.value.toolbarTips)==null?void 0:w.bold,onClick:()=>{a("bold")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-bold"},null)])]);case"underline":return s("div",{class:`${d}-toolbar-item`,title:(C=t.value.toolbarTips)==null?void 0:C.underline,onClick:()=>{a("underline")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-underline"},null)])]);case"italic":return s("div",{class:`${d}-toolbar-item`,title:(y=t.value.toolbarTips)==null?void 0:y.italic,onClick:()=>{a("italic")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-italic"},null)])]);case"strikeThrough":return s("div",{class:`${d}-toolbar-item`,title:(g=t.value.toolbarTips)==null?void 0:g.strikeThrough,onClick:()=>{a("strikeThrough")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-strike-through"},null)])]);case"title":return s(Ce,{relative:`#${i}`,visible:o.title,onChange:B=>{o.title=B},overlay:s("ul",{class:`${d}-menu`,onClick:()=>{o.title=!1}},[s("li",{class:`${d}-menu-item`,onClick:()=>{a("h1")}},[(x=t.value.titleItem)==null?void 0:x.h1]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("h2")}},[(E=t.value.titleItem)==null?void 0:E.h2]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("h3")}},[(S=t.value.titleItem)==null?void 0:S.h3]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("h4")}},[(z=t.value.titleItem)==null?void 0:z.h4]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("h5")}},[(R=t.value.titleItem)==null?void 0:R.h5]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("h6")}},[(F=t.value.titleItem)==null?void 0:F.h6])])},{default:()=>{var B;return[s("div",{class:`${d}-toolbar-item`,title:(B=t.value.toolbarTips)==null?void 0:B.title},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-title"},null)])])]}});case"sub":return s("div",{class:`${d}-toolbar-item`,title:(v=t.value.toolbarTips)==null?void 0:v.sub,onClick:()=>{a("sub")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-sub"},null)])]);case"sup":return s("div",{class:`${d}-toolbar-item`,title:(K=t.value.toolbarTips)==null?void 0:K.sup,onClick:()=>{a("sup")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-sup"},null)])]);case"quote":return s("div",{class:`${d}-toolbar-item`,title:(O=t.value.toolbarTips)==null?void 0:O.quote,onClick:()=>{a("quote")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-quote"},null)])]);case"unorderedList":return s("div",{class:`${d}-toolbar-item`,title:(H=t.value.toolbarTips)==null?void 0:H.unorderedList,onClick:()=>{a("unorderedList")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-unordered-list"},null)])]);case"orderedList":return s("div",{class:`${d}-toolbar-item`,title:(T=t.value.toolbarTips)==null?void 0:T.orderedList,onClick:()=>{a("orderedList")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-ordered-list"},null)])]);case"task":return s("div",{class:`${d}-toolbar-item`,title:(k=t.value.toolbarTips)==null?void 0:k.task,onClick:()=>{a("task")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-task"},null)])]);case"codeRow":return s("div",{class:`${d}-toolbar-item`,title:($=t.value.toolbarTips)==null?void 0:$.codeRow,onClick:()=>{a("codeRow")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-code-row"},null)])]);case"code":return s("div",{class:`${d}-toolbar-item`,title:(D=t.value.toolbarTips)==null?void 0:D.code,onClick:()=>{a("code")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-code"},null)])]);case"link":return s("div",{class:`${d}-toolbar-item`,title:(L=t.value.toolbarTips)==null?void 0:L.link,onClick:()=>{r.type="link",r.linkVisible=!0}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-link"},null)])]);case"image":return l.noUploadImg?s("div",{class:`${d}-toolbar-item`,title:(P=t.value.toolbarTips)==null?void 0:P.image,onClick:()=>{r.type="image",r.linkVisible=!0}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-image"},null)])]):s(Ce,{relative:`#${i}`,visible:o.image,onChange:B=>{o.image=B},overlay:s("ul",{class:`${d}-menu`,onClick:()=>{o.title=!1}},[s("li",{class:`${d}-menu-item`,onClick:()=>{r.type="image",r.linkVisible=!0}},[(Y=t.value.imgTitleItem)==null?void 0:Y.link]),s("li",{class:`${d}-menu-item`,onClick:()=>{c.value.click()}},[(ae=t.value.imgTitleItem)==null?void 0:ae.upload]),s("li",{class:`${d}-menu-item`,onClick:()=>{r.clipVisible=!0}},[(ee=t.value.imgTitleItem)==null?void 0:ee.clip2upload])])},{default:()=>{var B;return[s("div",{class:`${d}-toolbar-item`,title:(B=t.value.toolbarTips)==null?void 0:B.image},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-image"},null)])])]}});case"table":return s(Ce,{relative:`#${i}`,visible:o.table,onChange:B=>{o.table=B},key:"bar-table",overlay:s(el,{tableShape:l.tableShape,onSelected:B=>{a("table",{selectedShape:B})}},null)},{default:()=>{var B;return[s("div",{class:`${d}-toolbar-item`,title:(B=t.value.toolbarTips)==null?void 0:B.table},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-table"},null)])])]}});case"revoke":return s("div",{class:`${d}-toolbar-item`,title:(be=t.value.toolbarTips)==null?void 0:be.revoke,onClick:()=>{b.emit(e,"ctrlZ")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-revoke"},null)])]);case"next":return s("div",{class:`${d}-toolbar-item`,title:(Pe=t.value.toolbarTips)==null?void 0:Pe.next,onClick:()=>{b.emit(e,"ctrlShiftZ")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-next"},null)])]);case"save":return s("div",{class:`${d}-toolbar-item`,title:(Oe=t.value.toolbarTips)==null?void 0:Oe.save,onClick:()=>{b.emit(e,Ye)}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-baocun"},null)])]);case"prettier":return l.noPrettier?"":s("div",{class:`${d}-toolbar-item`,title:(He=t.value.toolbarTips)==null?void 0:He.prettier,onClick:()=>{a("prettier")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-prettier"},null)])]);case"pageFullscreen":return!l.setting.fullscreen&&s("div",{class:`${d}-toolbar-item`,title:(me=t.value.toolbarTips)==null?void 0:me.pageFullscreen,onClick:()=>{l.updateSetting("pageFullscreen")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":`#md-editor-icon-${l.setting.pageFullscreen?"suoxiao":"fangda"}`},null)])]);case"fullscreen":return s("div",{class:`${d}-toolbar-item`,title:(Be=t.value.toolbarTips)==null?void 0:Be.fullscreen,onClick:()=>{n()}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":`#md-editor-icon-${l.setting.fullscreen?"fullscreen-exit":"fullscreen"}`},null)])]);case"preview":return s("div",{class:`${d}-toolbar-item`,title:(Me=t.value.toolbarTips)==null?void 0:Me.preview,onClick:()=>{l.updateSetting("preview")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-preview"},null)])]);case"htmlPreview":return s("div",{class:`${d}-toolbar-item`,title:(fe=t.value.toolbarTips)==null?void 0:fe.htmlPreview,onClick:()=>{l.updateSetting("htmlPreview")}},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-coding"},null)])]);case"catalog":return s("div",{class:`${d}-toolbar-item`,title:(Ne=t.value.toolbarTips)==null?void 0:Ne.catalog,onClick:()=>{b.emit(e,at)},key:"bar-catalog"},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-catalog"},null)])]);case"github":return s("div",{class:`${d}-toolbar-item`,title:(Ue=t.value.toolbarTips)==null?void 0:Ue.github,onClick:()=>In("https://github.com/imzbf/md-editor-v3")},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-github"},null)])]);case"mermaid":return s(Ce,{relative:`#${i}`,visible:o.mermaid,onChange:B=>{o.mermaid=B},overlay:s("ul",{class:`${d}-menu`,onClick:()=>{o.mermaid=!1}},[s("li",{class:`${d}-menu-item`,onClick:()=>{a("flow")}},[(ke=t.value.mermaid)==null?void 0:ke.flow]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("sequence")}},[(ye=t.value.mermaid)==null?void 0:ye.sequence]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("gantt")}},[(qe=t.value.mermaid)==null?void 0:qe.gantt]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("class")}},[(Ve=t.value.mermaid)==null?void 0:Ve.class]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("state")}},[(we=t.value.mermaid)==null?void 0:we.state]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("pie")}},[(Ke=t.value.mermaid)==null?void 0:Ke.pie]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("relationship")}},[(Ze=t.value.mermaid)==null?void 0:Ze.relationship]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("journey")}},[(Ee=t.value.mermaid)==null?void 0:Ee.journey])]),key:"bar-mermaid"},{default:()=>{var B;return[s("div",{class:`${d}-toolbar-item`,title:(B=t.value.toolbarTips)==null?void 0:B.mermaid},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-mermaid"},null)])])]}});case"katex":return s(Ce,{relative:`#${i}`,visible:o.katex,onChange:B=>{o.katex=B},overlay:s("ul",{class:`${d}-menu`,onClick:()=>{o.katex=!1}},[s("li",{class:`${d}-menu-item`,onClick:()=>{a("katexInline")}},[(dt=t.value.katex)==null?void 0:dt.inline]),s("li",{class:`${d}-menu-item`,onClick:()=>{a("katexBlock")}},[(mt=t.value.katex)==null?void 0:mt.block])]),key:"bar-katex"},{default:()=>{var B;return[s("div",{class:`${d}-toolbar-item`,title:(B=t.value.toolbarTips)==null?void 0:B.katex},[s("svg",{class:`${d}-icon`,"aria-hidden":"true"},[s("use",{"xlink:href":"#md-editor-icon-formula"},null)])])]}})}else return l.defToolbars instanceof Array?l.defToolbars[p]||"":l.defToolbars&&l.defToolbars.children instanceof Array&&l.defToolbars.children[p]||""};return()=>{const p=u.value[0].map(C=>f(C)),w=u.value[1].map(C=>f(C));return s(je,null,[l.toolbars.length>0&&s("div",{class:`${d}-toolbar-wrapper`,id:i},[s("div",{class:`${d}-toolbar`},[s("div",{class:`${d}-toolbar-left`,ref:m},[p]),s("div",{class:`${d}-toolbar-right`},[w])])]),s("input",{ref:c,accept:"image/*",type:"file",multiple:!0,style:{display:"none"}},null),s(Qn,{linkVisible:r.linkVisible,clipVisible:r.clipVisible,type:r.type,onCancel:()=>{r.linkVisible=!1,r.clipVisible=!1},onOk:C=>{C&&a(r.type,{desc:C.desc,url:C.url}),r.linkVisible=!1,r.clipVisible=!1}},null)])}}});function Kt(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let _e=Kt();function ll(l){_e=l}const Zt=/[&<>"']/,il=new RegExp(Zt.source,"g"),Gt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ol=new RegExp(Gt.source,"g"),rl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ft=l=>rl[l];function X(l,e){if(e){if(Zt.test(l))return l.replace(il,Ft)}else if(Gt.test(l))return l.replace(ol,Ft);return l}const al=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Wt(l){return l.replace(al,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const sl=/(^|[^\[])\^/g;function N(l,e){l=typeof l=="string"?l:l.source,e=e||"";const t={replace:(n,i)=>(i=i.source||i,i=i.replace(sl,"$1"),l=l.replace(n,i),t),getRegex:()=>new RegExp(l,e)};return t}const cl=/[^\w:]/g,ul=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Lt(l,e,t){if(l){let n;try{n=decodeURIComponent(Wt(t)).replace(cl,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}e&&!ul.test(t)&&(t=pl(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Ge={},dl=/^[^:]+:\/*[^/]*$/,ml=/^([^:]+:)[\s\S]*$/,hl=/^([^:]+:\/*[^/]*)[\s\S]*$/;function pl(l,e){Ge[" "+l]||(dl.test(l)?Ge[" "+l]=l+"/":Ge[" "+l]=Xe(l,"/",!0)),l=Ge[" "+l];const t=l.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:l.replace(ml,"$1")+e:e.charAt(0)==="/"?t?e:l.replace(hl,"$1")+e:l+e}const Je={exec:function(){}};function oe(l){let e=1,t,n;for(;e<arguments.length;e++){t=arguments[e];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(l[n]=t[n])}return l}function Dt(l,e){const t=l.replace(/\|/g,(o,a,r)=>{let m=!1,u=a;for(;--u>=0&&r[u]==="\\";)m=!m;return m?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function Xe(l,e,t){const n=l.length;if(n===0)return"";let i=0;for(;i<n;){const o=l.charAt(n-i-1);if(o===e&&!t)i++;else if(o!==e&&t)i++;else break}return l.slice(0,n-i)}function fl(l,e){if(l.indexOf(e[1])===-1)return-1;const t=l.length;let n=0,i=0;for(;i<t;i++)if(l[i]==="\\")i++;else if(l[i]===e[0])n++;else if(l[i]===e[1]&&(n--,n<0))return i;return-1}function Xt(l){l&&l.sanitize&&!l.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Rt(l,e){if(e<1)return"";let t="";for(;e>1;)e&1&&(t+=l),e>>=1,l+=l;return t+l}function jt(l,e,t,n){const i=e.href,o=e.title?X(e.title):null,a=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){n.state.inLink=!0;const r={type:"link",raw:t,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,r}return{type:"image",raw:t,href:i,title:o,text:X(a)}}function gl(l,e){const t=l.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[a]=o;return a.length>=n.length?i.slice(n.length):i}).join(`
`)}class ct{constructor(e){this.options=e||_e}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Xe(n,`
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=gl(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=Xe(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(n,[]),text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,i,o,a,r,m,u,c,h,f,p,w,C=t[1].trim();const y=C.length>1,g={type:"list",raw:"",ordered:y,start:y?+C.slice(0,-1):"",loose:!1,items:[]};C=y?`\\d{1,9}\\${C.slice(-1)}`:`\\${C}`,this.options.pedantic&&(C=y?C:"[*+-]");const x=new RegExp(`^( {0,3}${C})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(w=!1,!(!(t=x.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),c=t[2].split(`
`,1)[0],h=e.split(`
`,1)[0],this.options.pedantic?(a=2,p=c.trimLeft()):(a=t[2].search(/[^ ]/),a=a>4?1:a,p=c.slice(a),a+=t[1].length),m=!1,!c&&/^ *$/.test(h)&&(n+=h+`
`,e=e.substring(h.length+1),w=!0),!w){const S=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),z=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),F=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;e&&(f=e.split(`
`,1)[0],c=f,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(c)||F.test(c)||S.test(c)||z.test(e)));){if(c.search(/[^ ]/)>=a||!c.trim())p+=`
`+c.slice(a);else if(!m)p+=`
`+c;else break;!m&&!c.trim()&&(m=!0),n+=f+`
`,e=e.substring(f.length+1)}}g.loose||(u?g.loose=!0:/\n *\n *$/.test(n)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(p),i&&(o=i[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!i,checked:o,loose:!1,text:p}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const E=g.items.length;for(r=0;r<E;r++){this.lexer.state.top=!1,g.items[r].tokens=this.lexer.blockTokens(g.items[r].text,[]);const S=g.items[r].tokens.filter(R=>R.type==="space"),z=S.every(R=>{const F=R.raw.split("");let v=0;for(const K of F)if(K===`
`&&(v+=1),v>1)return!0;return!1});!g.loose&&S.length&&z&&(g.loose=!0,g.items[r].loose=!0)}return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const n={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(t[0]):X(t[0]);n.type="paragraph",n.text=i,n.tokens=this.lexer.inline(i)}return n}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(t){const n={type:"table",header:Dt(t[1]).map(i=>({text:i})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(n.header.length===n.align.length){n.raw=t[0];let i=n.align.length,o,a,r,m;for(o=0;o<i;o++)/^ *-+: *$/.test(n.align[o])?n.align[o]="right":/^ *:-+: *$/.test(n.align[o])?n.align[o]="center":/^ *:-+ *$/.test(n.align[o])?n.align[o]="left":n.align[o]=null;for(i=n.rows.length,o=0;o<i;o++)n.rows[o]=Dt(n.rows[o],n.header.length).map(u=>({text:u}));for(i=n.header.length,a=0;a<i;a++)n.header[a].tokens=this.lexer.inline(n.header[a].text);for(i=n.rows.length,a=0;a<i;a++)for(m=n.rows[a],r=0;r<m.length;r++)m[r].tokens=this.lexer.inline(m[r].text);return n}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:X(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):X(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const a=Xe(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{const a=fl(t[2],"()");if(a>-1){const m=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,m).trim(),t[3]=""}}let i=t[2],o="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a&&(i=a[1],o=a[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),jt(t,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(/\s+/g," ");if(i=t[i.toLowerCase()],!i){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return jt(n,i,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrong.lDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;const o=i[1]||i[2]||"";if(!o||o&&(n===""||this.rules.inline.punctuation.exec(n))){const a=i[0].length-1;let r,m,u=a,c=0;const h=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+a);(i=h.exec(t))!=null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(m=r.length,i[3]||i[4]){u+=m;continue}else if((i[5]||i[6])&&a%3&&!((a+m)%3)){c+=m;continue}if(u-=m,u>0)continue;m=Math.min(m,m+u+c);const f=e.slice(0,a+i.index+(i[0].length-r.length)+m);if(Math.min(a,m)%2){const w=f.slice(1,-1);return{type:"em",raw:f,text:w,tokens:this.lexer.inlineTokens(w)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return i&&o&&(n=n.substring(1,n.length-1)),n=X(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let i,o;return n[2]==="@"?(i=X(this.options.mangle?t(n[1]):n[1]),o="mailto:"+i):(i=X(n[1]),o=i),{type:"link",raw:n[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let i,o;if(n[2]==="@")i=X(this.options.mangle?t(n[0]):n[0]),o="mailto:"+i;else{let a;do a=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(a!==n[0]);i=X(n[0]),n[1]==="www."?o="http://"+i:o=i}return{type:"link",raw:n[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):X(n[0]):n[0]:i=X(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}}}}const A={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Je,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};A._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;A._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;A.def=N(A.def).replace("label",A._label).replace("title",A._title).getRegex();A.bullet=/(?:[*+-]|\d{1,9}[.)])/;A.listItemStart=N(/^( *)(bull) */).replace("bull",A.bullet).getRegex();A.list=N(A.list).replace(/bull/g,A.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+A.def.source+")").getRegex();A._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";A._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;A.html=N(A.html,"i").replace("comment",A._comment).replace("tag",A._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();A.paragraph=N(A._paragraph).replace("hr",A.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",A._tag).getRegex();A.blockquote=N(A.blockquote).replace("paragraph",A.paragraph).getRegex();A.normal=oe({},A);A.gfm=oe({},A.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});A.gfm.table=N(A.gfm.table).replace("hr",A.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",A._tag).getRegex();A.gfm.paragraph=N(A._paragraph).replace("hr",A.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",A.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",A._tag).getRegex();A.pedantic=oe({},A.normal,{html:N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",A._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Je,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:N(A.normal._paragraph).replace("hr",A.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",A.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const _={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Je,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Je,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};_._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";_.punctuation=N(_.punctuation).replace(/punctuation/g,_._punctuation).getRegex();_.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;_.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;_._comment=N(A._comment).replace("(?:-->|$)","-->").getRegex();_.emStrong.lDelim=N(_.emStrong.lDelim).replace(/punct/g,_._punctuation).getRegex();_.emStrong.rDelimAst=N(_.emStrong.rDelimAst,"g").replace(/punct/g,_._punctuation).getRegex();_.emStrong.rDelimUnd=N(_.emStrong.rDelimUnd,"g").replace(/punct/g,_._punctuation).getRegex();_._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;_._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;_._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;_.autolink=N(_.autolink).replace("scheme",_._scheme).replace("email",_._email).getRegex();_._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;_.tag=N(_.tag).replace("comment",_._comment).replace("attribute",_._attribute).getRegex();_._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;_._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;_._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;_.link=N(_.link).replace("label",_._label).replace("href",_._href).replace("title",_._title).getRegex();_.reflink=N(_.reflink).replace("label",_._label).replace("ref",A._label).getRegex();_.nolink=N(_.nolink).replace("ref",A._label).getRegex();_.reflinkSearch=N(_.reflinkSearch,"g").replace("reflink",_.reflink).replace("nolink",_.nolink).getRegex();_.normal=oe({},_);_.pedantic=oe({},_.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:N(/^!?\[(label)\]\((.*?)\)/).replace("label",_._label).getRegex(),reflink:N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_._label).getRegex()});_.gfm=oe({},_.normal,{escape:N(_.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/});_.gfm.url=N(_.gfm.url,"i").replace("email",_.gfm._extended_email).getRegex();_.breaks=oe({},_.gfm,{br:N(_.br).replace("{2,}","*").getRegex(),text:N(_.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function vl(l){return l.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Pt(l){let e="",t,n;const i=l.length;for(t=0;t<i;t++)n=l.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),e+="&#"+n+";";return e}class de{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_e,this.options.tokenizer=this.options.tokenizer||new ct,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:A.normal,inline:_.normal};this.options.pedantic?(t.block=A.pedantic,t.inline=_.pedantic):this.options.gfm&&(t.block=A.gfm,this.options.breaks?t.inline=_.breaks:t.inline=_.gfm),this.tokenizer.rules=t}static get rules(){return{block:A,inline:_}}static lex(e,t){return new de(t).lex(e)}static lexInline(e,t){return new de(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
`),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(r,m,u)=>m+" ".repeat(u.length));let n,i,o,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+n.raw,i.text+=`
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+n.raw,i.text+=`
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let r=1/0;const m=e.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},m),typeof u=="number"&&u>=0&&(r=Math.min(r,u))}),r<1/0&&r>=0&&(o=e.substring(0,r+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){i=t[t.length-1],a&&i.type==="paragraph"?(i.raw+=`
`+n.raw,i.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n),a=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&i.type==="text"?(i.raw+=`
`+n.raw,i.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(e){const r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,o,a=e,r,m,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,r.index)+"["+Rt("a",r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,r.index)+"["+Rt("a",r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,r.index+r[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(m||(u=""),m=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(n=c.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,a,u)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e,Pt)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e,Pt))){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const h=e.slice(1);let f;this.options.extensions.startInline.forEach(function(p){f=p.call({lexer:this},h),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(o=e.substring(0,c+1))}if(n=this.tokenizer.inlineText(o,vl)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),m=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}}class ut{constructor(e){this.options=e||_e}code(e,t,n){const i=(t||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(e,i);o!=null&&o!==e&&(n=!0,e=o)}return e=e.replace(/\n$/,"")+`
`,i?'<pre><code class="'+this.options.langPrefix+X(i)+'">'+(n?e:X(e,!0))+`</code></pre>
`:"<pre><code>"+(n?e:X(e,!0))+`</code></pre>
`}blockquote(e){return`<blockquote>
${e}</blockquote>
`}html(e){return e}heading(e,t,n,i){if(this.options.headerIds){const o=this.options.headerPrefix+i.slug(n);return`<h${t} id="${o}">${e}</h${t}>
`}return`<h${t}>${e}</h${t}>
`}hr(){return this.options.xhtml?`<hr/>
`:`<hr>
`}list(e,t,n){const i=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+i+o+`>
`+e+"</"+i+`>
`}listitem(e){return`<li>${e}</li>
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>
`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+t+`</table>
`}tablerow(e){return`<tr>
${e}</tr>
`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(e=Lt(this.options.sanitize,this.options.baseUrl,e),e===null)return n;let i='<a href="'+e+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>",i}image(e,t,n){if(e=Lt(this.options.sanitize,this.options.baseUrl,e),e===null)return n;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=this.options.xhtml?"/>":">",i}text(e){return e}}class Qt{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Yt{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[e];do i++,n=e+"-"+i;while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=i,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class re{constructor(e){this.options=e||_e,this.options.renderer=this.options.renderer||new ut,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Qt,this.slugger=new Yt}static parse(e,t){return new re(t).parse(e)}static parseInline(e,t){return new re(t).parseInline(e)}parse(e,t=!0){let n="",i,o,a,r,m,u,c,h,f,p,w,C,y,g,x,E,S,z,R;const F=e.length;for(i=0;i<F;i++){if(p=e[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(R=this.options.extensions.renderers[p.type].call({parser:this},p),R!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type))){n+=R||"";continue}switch(p.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{n+=this.renderer.heading(this.parseInline(p.tokens),p.depth,Wt(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue}case"code":{n+=this.renderer.code(p.text,p.lang,p.escaped);continue}case"table":{for(h="",c="",r=p.header.length,o=0;o<r;o++)c+=this.renderer.tablecell(this.parseInline(p.header[o].tokens),{header:!0,align:p.align[o]});for(h+=this.renderer.tablerow(c),f="",r=p.rows.length,o=0;o<r;o++){for(u=p.rows[o],c="",m=u.length,a=0;a<m;a++)c+=this.renderer.tablecell(this.parseInline(u[a].tokens),{header:!1,align:p.align[a]});f+=this.renderer.tablerow(c)}n+=this.renderer.table(h,f);continue}case"blockquote":{f=this.parse(p.tokens),n+=this.renderer.blockquote(f);continue}case"list":{for(w=p.ordered,C=p.start,y=p.loose,r=p.items.length,f="",o=0;o<r;o++)x=p.items[o],E=x.checked,S=x.task,g="",x.task&&(z=this.renderer.checkbox(E),y?x.tokens.length>0&&x.tokens[0].type==="paragraph"?(x.tokens[0].text=z+" "+x.tokens[0].text,x.tokens[0].tokens&&x.tokens[0].tokens.length>0&&x.tokens[0].tokens[0].type==="text"&&(x.tokens[0].tokens[0].text=z+" "+x.tokens[0].tokens[0].text)):x.tokens.unshift({type:"text",text:z}):g+=z),g+=this.parse(x.tokens,y),f+=this.renderer.listitem(g,S,E);n+=this.renderer.list(f,w,C);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(f=p.tokens?this.parseInline(p.tokens):p.text;i+1<F&&e[i+1].type==="text";)p=e[++i],f+=`
`+(p.tokens?this.parseInline(p.tokens):p.text);n+=t?this.renderer.paragraph(f):f;continue}default:{const v='Token with "'+p.type+'" type was not found.';if(this.options.silent){console.error(v);return}else throw new Error(v)}}}return n}parseInline(e,t){t=t||this.renderer;let n="",i,o,a;const r=e.length;for(i=0;i<r;i++){if(o=e[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(a=this.options.extensions.renderers[o.type].call({parser:this},o),a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){n+=a||"";continue}switch(o.type){case"escape":{n+=t.text(o.text);break}case"html":{n+=t.html(o.text);break}case"link":{n+=t.link(o.href,o.title,this.parseInline(o.tokens,t));break}case"image":{n+=t.image(o.href,o.title,o.text);break}case"strong":{n+=t.strong(this.parseInline(o.tokens,t));break}case"em":{n+=t.em(this.parseInline(o.tokens,t));break}case"codespan":{n+=t.codespan(o.text);break}case"br":{n+=t.br();break}case"del":{n+=t.del(this.parseInline(o.tokens,t));break}case"text":{n+=t.text(o.text);break}default:{const m='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(m);return}else throw new Error(m)}}}return n}}function I(l,e,t){if(typeof l>"u"||l===null)throw new Error("marked(): input parameter is undefined or null");if(typeof l!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=oe({},I.defaults,e||{}),Xt(e),t){const i=e.highlight;let o;try{o=de.lex(l,e)}catch(m){return t(m)}const a=function(m){let u;if(!m)try{e.walkTokens&&I.walkTokens(o,e.walkTokens),u=re.parse(o,e)}catch(c){m=c}return e.highlight=i,m?t(m):t(null,u)};if(!i||i.length<3||(delete e.highlight,!o.length))return a();let r=0;I.walkTokens(o,function(m){m.type==="code"&&(r++,setTimeout(()=>{i(m.text,m.lang,function(u,c){if(u)return a(u);c!=null&&c!==m.text&&(m.text=c,m.escaped=!0),r--,r===0&&a()})},0))}),r===0&&a();return}function n(i){if(i.message+=`
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+X(i.message+"",!0)+"</pre>";throw i}try{const i=de.lex(l,e);if(e.walkTokens){if(e.async)return Promise.all(I.walkTokens(i,e.walkTokens)).then(()=>re.parse(i,e)).catch(n);I.walkTokens(i,e.walkTokens)}return re.parse(i,e)}catch(i){n(i)}}I.options=I.setOptions=function(l){return oe(I.defaults,l),ll(I.defaults),I};I.getDefaults=Kt;I.defaults=_e;I.use=function(...l){const e=I.defaults.extensions||{renderers:{},childTokens:{}};l.forEach(t=>{const n=oe({},t);if(n.async=I.defaults.async||n.async,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=e.renderers[i.name];o?e.renderers[i.name]=function(...a){let r=i.renderer.apply(this,a);return r===!1&&(r=o.apply(this,a)),r}:e.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[i.level]?e[i.level].unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),n.extensions=e),t.renderer){const i=I.defaults.renderer||new ut;for(const o in t.renderer){const a=i[o];i[o]=(...r)=>{let m=t.renderer[o].apply(i,r);return m===!1&&(m=a.apply(i,r)),m}}n.renderer=i}if(t.tokenizer){const i=I.defaults.tokenizer||new ct;for(const o in t.tokenizer){const a=i[o];i[o]=(...r)=>{let m=t.tokenizer[o].apply(i,r);return m===!1&&(m=a.apply(i,r)),m}}n.tokenizer=i}if(t.walkTokens){const i=I.defaults.walkTokens;n.walkTokens=function(o){let a=[];return a.push(t.walkTokens.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}I.setOptions(n)})};I.walkTokens=function(l,e){let t=[];for(const n of l)switch(t=t.concat(e.call(I,n)),n.type){case"table":{for(const i of n.header)t=t.concat(I.walkTokens(i.tokens,e));for(const i of n.rows)for(const o of i)t=t.concat(I.walkTokens(o.tokens,e));break}case"list":{t=t.concat(I.walkTokens(n.items,e));break}default:I.defaults.extensions&&I.defaults.extensions.childTokens&&I.defaults.extensions.childTokens[n.type]?I.defaults.extensions.childTokens[n.type].forEach(function(i){t=t.concat(I.walkTokens(n[i],e))}):n.tokens&&(t=t.concat(I.walkTokens(n.tokens,e)))}return t};I.parseInline=function(l,e){if(typeof l>"u"||l===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof l!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected");e=oe({},I.defaults,e||{}),Xt(e);try{const t=de.lexInline(l,e);return e.walkTokens&&I.walkTokens(t,e.walkTokens),re.parseInline(t,e)}catch(t){if(t.message+=`
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+X(t.message+"",!0)+"</pre>";throw t}};I.Parser=re;I.parser=re.parse;I.Renderer=ut;I.TextRenderer=Qt;I.Lexer=de;I.lexer=de.lex;I.Tokenizer=ct;I.Slugger=Yt;I.parse=I;re.parse;de.lex;var bl=function(){var l=document.getSelection();if(!l.rangeCount)return function(){};for(var e=document.activeElement,t=[],n=0;n<l.rangeCount;n++)t.push(l.getRangeAt(n));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return l.removeAllRanges(),function(){l.type==="Caret"&&l.removeAllRanges(),l.rangeCount||t.forEach(function(i){l.addRange(i)}),e&&e.focus()}},kl=bl,Ot={"text/plain":"Text","text/html":"Url",default:"Text"},yl="Copy to clipboard: #{key}, Enter";function wl(l){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return l.replace(/#{\s*key\s*}/g,e)}function xl(l,e){var t,n,i,o,a,r,m=!1;e||(e={}),t=e.debug||!1;try{i=kl(),o=document.createRange(),a=document.getSelection(),r=document.createElement("span"),r.textContent=l,r.style.all="unset",r.style.position="fixed",r.style.top=0,r.style.clip="rect(0, 0, 0, 0)",r.style.whiteSpace="pre",r.style.webkitUserSelect="text",r.style.MozUserSelect="text",r.style.msUserSelect="text",r.style.userSelect="text",r.addEventListener("copy",function(c){if(c.stopPropagation(),e.format)if(c.preventDefault(),typeof c.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Ot[e.format]||Ot.default;window.clipboardData.setData(h,l)}else c.clipboardData.clearData(),c.clipboardData.setData(e.format,l);e.onCopy&&(c.preventDefault(),e.onCopy(c.clipboardData))}),document.body.appendChild(r),o.selectNodeContents(r),a.addRange(o);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");m=!0}catch(c){t&&console.error("unable to copy using execCommand: ",c),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",l),e.onCopy&&e.onCopy(window.clipboardData),m=!0}catch(h){t&&console.error("unable to copy using clipboardData: ",h),t&&console.error("falling back to prompt"),n=wl("message"in e?e.message:yl),window.prompt(n,l)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(o):a.removeAllRanges()),r&&document.body.removeChild(r),i()}return m}var Ae=xl;/*! medium-zoom 1.0.8 | MIT License | https://github.com/francoischalifour/medium-zoom */var ve=Object.assign||function(l){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(l[n]=t[n])}return l},We=function(e){return e.tagName==="IMG"},$l=function(e){return NodeList.prototype.isPrototypeOf(e)},Qe=function(e){return e&&e.nodeType===1},Ht=function(e){var t=e.currentSrc||e.src;return t.substr(-4).toLowerCase()===".svg"},Bt=function(e){try{return Array.isArray(e)?e.filter(We):$l(e)?[].slice.call(e).filter(We):Qe(e)?[e].filter(We):typeof e=="string"?[].slice.call(document.querySelectorAll(e)).filter(We):[]}catch{throw new TypeError(`The provided selector is invalid.
Expects a CSS selector, a Node element, a NodeList or an array.
See: https://github.com/francoischalifour/medium-zoom`)}},Cl=function(e){var t=document.createElement("div");return t.classList.add("medium-zoom-overlay"),t.style.background=e,t},_l=function(e){var t=e.getBoundingClientRect(),n=t.top,i=t.left,o=t.width,a=t.height,r=e.cloneNode(),m=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,u=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return r.removeAttribute("id"),r.style.position="absolute",r.style.top=n+m+"px",r.style.left=i+u+"px",r.style.width=o+"px",r.style.height=a+"px",r.style.transform="",r},$e=function(e,t){var n=ve({bubbles:!1,cancelable:!1,detail:void 0},t);if(typeof window.CustomEvent=="function")return new CustomEvent(e,n);var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),i},El=function l(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=window.Promise||function(T){function k(){}T(k,k)},i=function(T){var k=T.target;if(k===K){w();return}E.indexOf(k)!==-1&&C({target:k})},o=function(){if(!(z||!v.original)){var T=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(R-T)>F.scrollOffset&&setTimeout(w,150)}},a=function(T){var k=T.key||T.keyCode;(k==="Escape"||k==="Esc"||k===27)&&w()},r=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},k=T;if(T.background&&(K.style.background=T.background),T.container&&T.container instanceof Object&&(k.container=ve({},F.container,T.container)),T.template){var $=Qe(T.template)?T.template:document.querySelector(T.template);k.template=$}return F=ve({},F,k),E.forEach(function(D){D.dispatchEvent($e("medium-zoom:update",{detail:{zoom:O}}))}),O},m=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return l(ve({},F,T))},u=function(){for(var T=arguments.length,k=Array(T),$=0;$<T;$++)k[$]=arguments[$];var D=k.reduce(function(L,P){return[].concat(L,Bt(P))},[]);return D.filter(function(L){return E.indexOf(L)===-1}).forEach(function(L){E.push(L),L.classList.add("medium-zoom-image")}),S.forEach(function(L){var P=L.type,Y=L.listener,ae=L.options;D.forEach(function(ee){ee.addEventListener(P,Y,ae)})}),O},c=function(){for(var T=arguments.length,k=Array(T),$=0;$<T;$++)k[$]=arguments[$];v.zoomed&&w();var D=k.length>0?k.reduce(function(L,P){return[].concat(L,Bt(P))},[]):E;return D.forEach(function(L){L.classList.remove("medium-zoom-image"),L.dispatchEvent($e("medium-zoom:detach",{detail:{zoom:O}}))}),E=E.filter(function(L){return D.indexOf(L)===-1}),O},h=function(T,k){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return E.forEach(function(D){D.addEventListener("medium-zoom:"+T,k,$)}),S.push({type:"medium-zoom:"+T,listener:k,options:$}),O},f=function(T,k){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return E.forEach(function(D){D.removeEventListener("medium-zoom:"+T,k,$)}),S=S.filter(function(D){return!(D.type==="medium-zoom:"+T&&D.listener.toString()===k.toString())}),O},p=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},k=T.target,$=function(){var L={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},P=void 0,Y=void 0;if(F.container)if(F.container instanceof Object)L=ve({},L,F.container),P=L.width-L.left-L.right-F.margin*2,Y=L.height-L.top-L.bottom-F.margin*2;else{var ae=Qe(F.container)?F.container:document.querySelector(F.container),ee=ae.getBoundingClientRect(),be=ee.width,Pe=ee.height,Oe=ee.left,He=ee.top;L=ve({},L,{width:be,height:Pe,left:Oe,top:He})}P=P||L.width-F.margin*2,Y=Y||L.height-F.margin*2;var me=v.zoomedHd||v.original,Be=Ht(me)?P:me.naturalWidth||P,Me=Ht(me)?Y:me.naturalHeight||Y,fe=me.getBoundingClientRect(),Ne=fe.top,Ue=fe.left,ke=fe.width,ye=fe.height,qe=Math.min(Math.max(ke,Be),P)/ke,Ve=Math.min(Math.max(ye,Me),Y)/ye,we=Math.min(qe,Ve),Ke=(-Ue+(P-ke)/2+F.margin+L.left)/we,Ze=(-Ne+(Y-ye)/2+F.margin+L.top)/we,Ee="scale("+we+") translate3d("+Ke+"px, "+Ze+"px, 0)";v.zoomed.style.transform=Ee,v.zoomedHd&&(v.zoomedHd.style.transform=Ee)};return new n(function(D){if(k&&E.indexOf(k)===-1){D(O);return}var L=function be(){z=!1,v.zoomed.removeEventListener("transitionend",be),v.original.dispatchEvent($e("medium-zoom:opened",{detail:{zoom:O}})),D(O)};if(v.zoomed){D(O);return}if(k)v.original=k;else if(E.length>0){var P=E;v.original=P[0]}else{D(O);return}if(v.original.dispatchEvent($e("medium-zoom:open",{detail:{zoom:O}})),R=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,z=!0,v.zoomed=_l(v.original),document.body.appendChild(K),F.template){var Y=Qe(F.template)?F.template:document.querySelector(F.template);v.template=document.createElement("div"),v.template.appendChild(Y.content.cloneNode(!0)),document.body.appendChild(v.template)}if(v.original.parentElement&&v.original.parentElement.tagName==="PICTURE"&&v.original.currentSrc&&(v.zoomed.src=v.original.currentSrc),document.body.appendChild(v.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),v.original.classList.add("medium-zoom-image--hidden"),v.zoomed.classList.add("medium-zoom-image--opened"),v.zoomed.addEventListener("click",w),v.zoomed.addEventListener("transitionend",L),v.original.getAttribute("data-zoom-src")){v.zoomedHd=v.zoomed.cloneNode(),v.zoomedHd.removeAttribute("srcset"),v.zoomedHd.removeAttribute("sizes"),v.zoomedHd.removeAttribute("loading"),v.zoomedHd.src=v.zoomed.getAttribute("data-zoom-src"),v.zoomedHd.onerror=function(){clearInterval(ae),console.warn("Unable to reach the zoom image target "+v.zoomedHd.src),v.zoomedHd=null,$()};var ae=setInterval(function(){v.zoomedHd.complete&&(clearInterval(ae),v.zoomedHd.classList.add("medium-zoom-image--opened"),v.zoomedHd.addEventListener("click",w),document.body.appendChild(v.zoomedHd),$())},10)}else if(v.original.hasAttribute("srcset")){v.zoomedHd=v.zoomed.cloneNode(),v.zoomedHd.removeAttribute("sizes"),v.zoomedHd.removeAttribute("loading");var ee=v.zoomedHd.addEventListener("load",function(){v.zoomedHd.removeEventListener("load",ee),v.zoomedHd.classList.add("medium-zoom-image--opened"),v.zoomedHd.addEventListener("click",w),document.body.appendChild(v.zoomedHd),$()})}else $()})},w=function(){return new n(function(T){if(z||!v.original){T(O);return}var k=function $(){v.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(v.zoomed),v.zoomedHd&&document.body.removeChild(v.zoomedHd),document.body.removeChild(K),v.zoomed.classList.remove("medium-zoom-image--opened"),v.template&&document.body.removeChild(v.template),z=!1,v.zoomed.removeEventListener("transitionend",$),v.original.dispatchEvent($e("medium-zoom:closed",{detail:{zoom:O}})),v.original=null,v.zoomed=null,v.zoomedHd=null,v.template=null,T(O)};z=!0,document.body.classList.remove("medium-zoom--opened"),v.zoomed.style.transform="",v.zoomedHd&&(v.zoomedHd.style.transform=""),v.template&&(v.template.style.transition="opacity 150ms",v.template.style.opacity=0),v.original.dispatchEvent($e("medium-zoom:close",{detail:{zoom:O}})),v.zoomed.addEventListener("transitionend",k)})},C=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},k=T.target;return v.original?w():p({target:k})},y=function(){return F},g=function(){return E},x=function(){return v.original},E=[],S=[],z=!1,R=0,F=t,v={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(e)==="[object Object]"?F=e:(e||typeof e=="string")&&u(e),F=ve({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},F);var K=Cl(F.background);document.addEventListener("click",i),document.addEventListener("keyup",a),document.addEventListener("scroll",o),window.addEventListener("resize",w);var O={open:p,close:w,toggle:C,update:r,clone:m,attach:u,detach:c,on:h,off:f,getOptions:y,getImages:g,getZoomedImage:x};return O};function Sl(l,e){e===void 0&&(e={});var t=e.insertAt;if(!(!l||typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=l:i.appendChild(document.createTextNode(l))}}var Tl=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";Sl(Tl);var zl=El;const Ie=l=>{const e=l.value,t=e.substring(0,l.selectionStart),n=e.substring(l.selectionEnd,e.length),i=t.lastIndexOf(`
`),o=t.substring(0,i+1),a=n.indexOf(`
`),r=n.substring(a===-1?n.length:a,n.length),m=t.substring(i+1,t.length),u=n.substring(0,a);return{prefixStr:t,subfixStr:n,prefixStrEndRow:o,subfixStrEndRow:r,prefixSupply:m,subfixSupply:u}},Il=(l,e="",t,n)=>{var i,o,a,r,m,u;let c="",h=0,f=0,p=!1,w,C;const y=(i=W.editorConfig)==null?void 0:i.mermaidTemplate;if(/^h[1-6]{1}$/.test(l)){const g=l.replace(/^h(\d)/,(x,E)=>new Array(Number(E)).fill("#",0,E).join(""));c=`${g} ${e}`,h=g.length+1}else if(l==="prettier"){const g=window.prettier||((a=(o=W.editorExtensions)==null?void 0:o.prettier)==null?void 0:a.prettierInstance),x=[((r=window.prettierPlugins)==null?void 0:r.markdown)||((u=(m=W.editorExtensions)==null?void 0:m.prettier)==null?void 0:u.parserMarkdownInstance)];return!g||x[0]===void 0?(b.emit(n.editorId,"errorCatcher",{name:"prettier",message:"prettier is undefined"}),t.value):g.format(t.value,{parser:"markdown",plugins:x})}else switch(l){case"bold":{c=`**${e}**`,h=2,f=-2;break}case"underline":{c=`<u>${e}</u>`,h=3,f=-4;break}case"italic":{c=`*${e}*`,h=1,f=-1;break}case"strikeThrough":{c=`~${e}~`,h=1,f=-1;break}case"sub":{c=`<sub>${e}</sub>`,h=5,f=-6;break}case"sup":{c=`<sup>${e}</sup>`,h=5,f=-6;break}case"codeRow":{c="`"+e+"`",h=1,f=-1;break}case"quote":{c=`> ${e}`,h=2;break}case"orderedList":{c=`1. ${e}`,h=3;break}case"unorderedList":{c=`- ${e}`,h=2;break}case"task":{c=`- [ ] ${e}`,h=6,p=!0;break}case"code":{const g=n.text||e||"",x=n.mode||"language";c=`\`\`\`${x}
${g}
\`\`\`
`,h=3,f=3+x.length-c.length,p=!0;break}case"table":{c="|";const{selectedShape:g={x:1,y:1}}=n,{x,y:E}=g;for(let S=0;S<=E;S++)c+=" col |";c+=`
|`;for(let S=0;S<=E;S++)c+=" - |";for(let S=0;S<=x;S++){c+=`
|`;for(let z=0;z<=E;z++)c+=" content |"}h=2,f=5-c.length,p=!0;break}case"link":{const{desc:g,url:x}=n;c=`[${g}](${x})`;break}case"image":{const{desc:g,url:x,urls:E}=n;E instanceof Array?c=E.reduce((S,z)=>S+`![${g}](${z})
`,""):c=`![${g}](${x})
`;break}case"tab":{const{tabWidth:g=2}=n,x=new Array(g).fill(" ").join("");if(e==="")c=x;else if(/\n/.test(e)){const{prefixStr:E,subfixStr:S,prefixSupply:z,subfixSupply:R}=Ie(t);c=`${z}${e}${R}`.split(`
`).map(K=>`${x}${K}`).join(`
`),w=E.substring(0,E.length-z.length),C=S.substring(R.length,S.length),p=!0,h=g,f=-z.length-R.length}else{const S=t.value.substring(0,t.selectionStart);/\n$/.test(S)||S===""?(c=`${x}${e}`,p=!0):c=x}break}case"shiftTab":{const{tabWidth:g=2}=n,{prefixStr:x,prefixStrEndRow:E,subfixStrEndRow:S,prefixSupply:z,subfixSupply:R}=Ie(t),F=new RegExp(`^\\s{${g}}`),v=(K=!1,O=!1)=>{const H=`${z}${e}${R}`;if(F.test(H)){const T=x.length-(O?0:g),k=K?T+e.length-g:T;return ce(t,T,k),`${E}${H.replace(F,"")}${S}`}else if(/^\s/.test(H)){const T=H.replace(/^\s/,""),k=H.length-T.length,$=t.selectionStart-(O?0:k),D=K?$+e.length-k:$;return ce(t,$,D),`${E}${T}${S}`}else c=e};if(e===""){const K=v();if(K)return K}else if(/\n/.test(e)){const O=`${z}${e}${R}`.split(`
`);let[H,T]=[0,0];const k=O.map(($,D)=>{if(F.test($))return D===0&&(H=g),T+=g,$.replace(F,"");if(/^\s/.test($)){const L=$.replace(/^\s/,"");return T+=$.length-L.length,L}return $}).join(`
`);return ce(t,t.selectionStart-H,t.selectionEnd-T),`${E}${k}${S}`}else{const K=v(!0,!0);if(K)return K}break}case"ctrlC":{const{prefixSupply:g,subfixSupply:x}=Ie(t);return Ae(e===""?`${g}${x}`:e),t.value}case"ctrlX":{const{prefixStrEndRow:g,subfixStrEndRow:x,prefixStr:E,subfixStr:S,prefixSupply:z,subfixSupply:R}=Ie(t);return e===""?(Ae(`${z}${R}`),ce(t,g.length),`${g}${x.replace(/^\n/,"")}`):(Ae(e),ce(t,E.length),`${E}${S}`)}case"ctrlD":{const{prefixStrEndRow:g,subfixStrEndRow:x}=Ie(t);return ce(t,g.length),`${g}${x.replace(/^\n/,"")}`}case"flow":{c=`\`\`\`mermaid
${(y==null?void 0:y.flow)||`flowchart TD
Start --> Stop`}
\`\`\`
`,h=2;break}case"sequence":{c=`\`\`\`mermaid
${(y==null?void 0:y.sequence)||`sequenceDiagram
A->>B: hello!
B-->>A: hi!
A-)B: bye!`}
\`\`\`
`,h=2;break}case"gantt":{c=`\`\`\`mermaid
${(y==null?void 0:y.gantt)||`gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1, 20d`}
\`\`\`
`,h=2;break}case"class":{c=`\`\`\`mermaid
${(y==null?void 0:y.class)||`classDiagram
class Animal
Vehicle <|-- Car`}
\`\`\`
`,h=2;break}case"state":{c=`\`\`\`mermaid
${(y==null?void 0:y.state)||`stateDiagram-v2
s1 --> s2`}
\`\`\`
`,h=2;break}case"pie":{c=`\`\`\`mermaid
${(y==null?void 0:y.pie)||`pie title Pets adopted by volunteers
"Dogs" : 386
"Cats" : 85
"Rats" : 15`}
\`\`\`
`,h=2;break}case"relationship":{c=`\`\`\`mermaid
${(y==null?void 0:y.relationship)||`erDiagram
CAR ||--o{ NAMED-DRIVER : allows
PERSON ||--o{ NAMED-DRIVER : is`}
\`\`\`
`,h=2;break}case"journey":{c=`\`\`\`mermaid
${(y==null?void 0:y.journey)||`journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me`}
\`\`\`
`,h=2;break}case"katexInline":{c="$$",h=1,f=-1;break}case"katexBlock":{c=`$$
$$
`,h=1,f=-4;break}case"universal":{const{generate:g}=n,x=g(e);c=x.targetValue,p=x.select,h=x.deviationStart,f=x.deviationEnd}}return lt(t,c,{deviationStart:h,deviationEnd:f,select:p,prefixVal:w,subfixVal:C})};var Mt={block(l,e){return{name:"KaTexBlockExtension",level:"block",start:t=>{var n;return(n=t.match(/\n\$\$\n/))==null?void 0:n.index},tokenizer(t){if(/^\$\$\n/.test(t)&&t.split("$$").length>2){const n=_t(t,"$$");return{type:"KaTexBlockExtension",raw:n[0],text:n[1].trim(),tokens:[]}}},renderer(t){const n=e||typeof window<"u"&&window.katex;if(n){const i=n.renderToString(t.text,{throwOnError:!1,displayMode:!0});return`<p class="${l}-katex-block" data-processed>${i}</p>`}else return`<p class="${l}-katex-block">${t.text}</p>`}}},inline(l,e){return{name:"KaTexInlineExtension",level:"inline",start:t=>{var n;return(n=t.match(/\$[^\n]*/))==null?void 0:n.index},tokenizer(t){if(/^\$[^\n]*\$/.test(t)){const n=_t(t);return{type:"KaTexInlineExtension",raw:n[0],text:n[1].trim(),tokens:[]}}},renderer(t){const n=e||typeof window<"u"&&window.katex;if(n){const i=n.renderToString(t.text,{throwOnError:!1});return`<span class="${l}-katex-inline" data-processed>${i}</span>`}else return`<span class="${l}-katex-inline">${t.text}</span>`}}}};const Jt=["abstract","attention","bug","caution","danger","error","example","failure","hint","info","note","question","quote","success","tip","warning"],nt=new RegExp(`^!!!\\s+(${Jt.join("|")})\\s+(.*)$`),Al=/^!!!\s*$/,Fl={name:"alert",level:"block",start(l){var e;return(e=l.match(new RegExp(`(^|[\\r\\n])!!!\\s+(${Jt.join("|")})\\s+(.*)`)))==null?void 0:e.index},tokenizer(l){const e=l.split(/\n/);if(nt.test(e[0])){const t={x:-1,y:-1},n=[];for(let i=0,o=e.length;i<o;i++)nt.test(e[i])?t.x=i:Al.test(e[i])&&(t.y=i,t.x>=0&&(n.push(Q({},t)),t.x=-1,t.y=-1));if(n.length){const i=n[0],[o,a,r]=nt.exec(e[i.x])||[],m=e.slice(i.x+1,i.y).join(`
`),c={type:"alert",raw:e.slice(i.x,i.y+1).join(`
`),icon:a,title:r,text:m,titleTokens:[],tokens:[],childTokens:["title","text"]};return this.lexer.inlineTokens(c.title,c.titleTokens),this.lexer.blockTokens(c.text,c.tokens),c}}},renderer(l){return`<div class="md-editor-alert md-editor-alert-${l.icon}">
<p class="md-editor-alert-title">${this.parser.parseInline(l.titleTokens,null)}</p>
${this.parser.parse(l.tokens)}
</div>`}},Ll=(l,e,t)=>{var n,i;const o=j("previewOnly"),a=j("historyLength"),r=j("editorId");if(o)return;let m=-1;const u={list:[{content:l.value,startPos:((n=e.value)==null?void 0:n.selectionStart)||0,endPos:((i=e.value)==null?void 0:i.selectionEnd)||0}],userUpdated:!0,curr:0},c=[0,0];let h=c;const f=C=>{var y,g;const x=((y=e.value)==null?void 0:y.selectionStart)||0,E=((g=e.value)==null?void 0:g.selectionEnd)||0;u.list[u.curr].startPos=x,u.list[u.curr].endPos=E,u.userUpdated=!1,u.curr=C;const S=u.list[u.curr];h=[S.startPos,S.endPos],l.onChange(S.content),ce(e.value,S.startPos,S.endPos).then(()=>{b.emit(r,"selectTextChange")})},p=C=>{var y,g;clearTimeout(m);const x=((y=e.value)==null?void 0:y.selectionStart)||0,E=((g=e.value)==null?void 0:g.selectionEnd)||0;m=setTimeout(()=>{if(u.userUpdated){u.curr<u.list.length-1&&(u.list=u.list.slice(0,u.curr+1)),u.list.length>a&&u.list.shift();const S=u.list.pop()||{startPos:0,endPos:0,content:C};S.startPos=h[0],S.endPos=h[1],h=c,Array.prototype.push.call(u.list,S,{content:C,startPos:x,endPos:E}),u.curr=u.list.length-1}else u.userUpdated=!0},150)},w=C=>{var y,g;(h===c||C)&&(h=[(y=e.value)==null?void 0:y.selectionStart,(g=e.value)==null?void 0:g.selectionEnd])};M([Fe(l,"value"),t],()=>{t.value&&p(l.value)}),M(()=>l.value,()=>{b.emit(r,"selectTextChange")},{flush:"post"}),Z(()=>{b.on(r,{name:"ctrlZ",callback(){f(u.curr-1<0?0:u.curr-1)}}),b.on(r,{name:"ctrlShiftZ",callback(){f(u.curr+1===u.list.length?u.curr:u.curr+1)}}),b.on(r,{name:"saveHistoryPos",callback:w})})},Dl=(l,e)=>{var t,n,i;const{markedRenderer:o,markedExtensions:a,markedOptions:r,editorExtensions:m,editorConfig:u}=W,c=j("showCodeRowNumber"),h=j("editorId"),f=j("highlight"),p=j("previewOnly"),w=(t=m==null?void 0:m.highlight)==null?void 0:t.instance,C=(n=m==null?void 0:m.mermaid)==null?void 0:n.instance,y=(i=m==null?void 0:m.katex)==null?void 0:i.instance,g=m==null?void 0:m.katex,x=V(!1),E=V(!1),S=V([]);let z=new I.Renderer;I.use({extensions:[Fl]});const R=z.code;z.code=(k,$,D)=>{if(!l.noMermaid&&$==="mermaid"){const L=`${d}-mermaid-${Date.now().toString(36)}`;try{let P;return C?P=C.render(L,k):typeof window<"u"&&window.mermaid?P=window.mermaid.render(L,k):P=`<p class="${d}-mermaid-loading">${k}</p>`,`<p class="${d}-mermaid">${P}</p>`}catch(P){return`<p class="${d}-mermaid-error">Error: ${(P==null?void 0:P.message)||""}</p>`}}return R.call(z,k,$,D)},z.image=(k,$,D)=>`<span class="figure"><img src="${k}" title="${$||""}" alt="${D||""}" zoom><span class="figcaption">${D||""}</span></span>`,z.listitem=(k,$)=>$?`<li class="li-task">${k}</li>`:`<li>${k}</li>`;const F=z.heading;o instanceof Function&&(z=o(z));const v=z.heading,K=F!==v;z.heading=(k,$,D,L)=>{if(S.value.push({text:D,level:$}),K)return v.call(z,k,$,D,L,S.value.length);const P=l.markedHeadingId(D,$,S.value.length);return k!==D?`<h${$} id="${P}">${k}</h${$}>`:`<h${$} id="${P}"><a href="#${P}">${D}</a></h${$}>`},I.setOptions(Q({breaks:!0},r)),l.noKatex||I.use({extensions:[Mt.inline(d,y),Mt.block(d,y)]}),w&&I.setOptions({highlight:(k,$)=>{let D;const L=w.getLanguage($);return $&&L?D=w.highlight(k,{language:$,ignoreIllegals:!0}).value:D=w.highlightAuto(k).value,c?Ct(D):`<span class="code-block">${D}</span>`}}),a instanceof Array&&a.length>0&&I.use({extensions:a});const O=V(l.sanitize(I(l.value||"",{renderer:z}))),H=tt(()=>{S.value=[];const k=l.sanitize(I(l.value||"",{renderer:z}));O.value=k,b.emit(h,"buildFinished",k),l.onHtmlChanged(k)},(u==null?void 0:u.renderDelay)!==void 0?u==null?void 0:u.renderDelay:p?0:500);M([x,Fe(e,"reRender"),Fe(e,"mermaidInited"),E,Fe(l,"value")],H);const T=()=>{I.setOptions({highlight:(k,$)=>{let D;const L=window.hljs.getLanguage($);return $&&L?D=window.hljs.highlight(k,{language:$,ignoreIllegals:!0}).value:D=window.hljs.highlightAuto(k).value,c?Ct(D):`<span class="code-block">${D}</span>`}}),x.value=!0};return M(()=>S.value,k=>{l.onGetCatalog(k),b.emit(h,"catalogChanged",k)}),Z(()=>{if(!l.noKatex&&!y){const k=document.createElement("script");k.src=(g==null?void 0:g.js)||wt.js,k.onload=()=>{E.value=!0},k.id=`${d}-katex`;const $=document.createElement("link");$.rel="stylesheet",$.href=(g==null?void 0:g.css)||wt.css,$.id=`${d}-katexCss`,ne(k,"katex"),ne($)}if(!w){const k=document.createElement("link");k.rel="stylesheet",k.href=f.value.css,k.id=`${d}-hlCss`;const $=document.createElement("script");$.src=f.value.js,$.onload=T,$.id=`${d}-hljs`,ne(k),ne($,"hljs")}}),M(()=>f.value.css,k=>{jn(`${d}-hlCss`,"href",k)}),Z(()=>{b.on(h,{name:"pushCatalog",callback(){b.emit(h,"catalogChanged",S.value)}})}),{html:O}},Rl=(l,e,t,n,i)=>{const o=j("previewOnly"),a=j("usedLanguageText"),r=j("editorId");let m=()=>{},u=()=>{};const c=()=>{document.querySelectorAll(`#${r}-preview pre`).forEach(p=>{var w,C;(w=p.querySelector(".copy-button"))==null||w.remove();const y=((C=a.value.copyCode)==null?void 0:C.text)||"复制代码",g=document.createElement("span");g.setAttribute("class","copy-button"),g.innerText=y,g.addEventListener("click",()=>{var x,E;const S=p.querySelector("code").innerText,z=Ae(l.formatCopiedText(S)),R=((x=a.value.copyCode)==null?void 0:x.successTips)||"已复制!",F=((E=a.value.copyCode)==null?void 0:E.failTips)||"已复制!";g.innerText=z?R:F,setTimeout(()=>{g.innerText=y},1500)}),p.appendChild(g)})},h=()=>{De(()=>{l.setting.preview&&!o&&l.scrollAuto&&(m(),u()),c()})},f=p=>{p&&!o&&De(()=>{m(),[u,m]=$t(t.value,n.value||i.value),u()})};M(()=>e.value,h),M(()=>a.value,c),M(()=>l.setting.preview,f),M(()=>l.setting.htmlPreview,f),M(()=>l.scrollAuto,p=>{p?u():m()}),Z(()=>{c(),!o&&(n.value||i.value)&&([u,m]=$t(t.value,n.value||i.value)),l.scrollAuto&&u()})},jl=(l,e)=>{const t=j("previewOnly"),n=j("tabWidth"),i=j("editorId"),o=V("");Z(()=>{var a;t||((a=e.value)==null||a.addEventListener("keypress",r=>{var m,u,c;if(r.key==="Enter"){const h=(m=e.value)==null?void 0:m.selectionStart,f=(u=e.value)==null?void 0:u.value.substring(0,h),p=(c=e.value)==null?void 0:c.value.substring(h),w=f==null?void 0:f.lastIndexOf(`
`),C=f==null?void 0:f.substring(w+1,h);if(/^\d+\.\s|^-\s/.test(C))if(r.cancelBubble=!0,r.preventDefault(),r.stopPropagation(),/^(\d+\.|-)\s+(\[[x\s]\]\s+)?$/.test(C)){const y=f==null?void 0:f.replace(/(\d+\.|-)\s+(\[[x\s]\]\s+)?$/,"");l.onChange(y+p),ce(e.value,y==null?void 0:y.length)}else if(/^-\s+.+/.test(C)){const y=/^-\s+\[[x\s]\]/.test(C)?`
- [ ] `:`
- `;l.onChange(lt(e.value,y,{}))}else{const y=C==null?void 0:C.match(/\d+(?=\.)/),g=y&&Number(y[0])+1||1,x=/^\d\.\s+\[[x\s]\]/.test(C)?`
${g}. [ ] `:`
${g}. `;l.onChange(lt(e.value,x,{}))}}}),b.on(i,{name:"replace",callback(r,m={}){l.onChange(Il(r,o.value,e.value,Le(Q({},m),{tabWidth:n,editorId:i})))}}))}),M(()=>l.value,()=>{o.value=""}),b.on(i,{name:"selectTextChange",callback(){o.value=Ln(e.value)}})},Pl=l=>{const e=j("theme"),{editorExtensions:t}=W,n=t==null?void 0:t.mermaid,i=J({reRender:!1,mermaidInited:!!(n!=null&&n.instance)}),o=()=>{l.noMermaid||(n!=null&&n.instance?n.instance.initialize({theme:e.value==="dark"?"dark":"default"}):window.mermaid&&window.mermaid.initialize({theme:e.value==="dark"?"dark":"default"}),i.reRender=!i.reRender)};M(()=>e.value,o);let a;return Z(()=>{!l.noMermaid&&!(n!=null&&n.instance)?(a=document.createElement("script"),a.src=(n==null?void 0:n.js)||Sn,a.onload=()=>{window.mermaid.initialize({theme:e.value==="dark"?"dark":"default",logLevel:"Fatal"}),i.mermaidInited=!0},a.id=`${d}-mermaid`,ne(a,"mermaid")):l.noMermaid||o()}),i},Ol=(l,e)=>{const t=j("editorId"),n=j("previewOnly"),i=o=>{if(o.clipboardData){if(o.clipboardData.files.length>0){const{files:a}=o.clipboardData;b.emit(t,"uploadImage",Array.from(a).filter(r=>/image\/.*/.test(r.type))),o.preventDefault()}if(l.autoDetectCode&&o.clipboardData.types.includes("vscode-editor-data")){const a=JSON.parse(o.clipboardData.getData("vscode-editor-data"));b.emit(t,"replace","code",{mode:a.mode,text:o.clipboardData.getData("text/plain")}),o.preventDefault()}}};Z(()=>{n||e.value.addEventListener("paste",i)}),Re(()=>{n||e.value.removeEventListener("paste",i)})},Hl=(l,e)=>{const t=j("editorId"),n=tt(()=>{const i=document.querySelectorAll(`#${t}-preview img[zoom]`);i.length!==0&&zl(i,{background:"#00000073"})});Z(n),M([e,Fe(l.setting,"preview")],n)},Bl=l=>{const e=j("editorId");b.on(e,{name:Vt,callback(){var t;(t=l.value)==null||t.focus()}})},Ml=()=>({value:{type:String,default:""},onChange:{type:Function,default:()=>()=>{}},setting:{type:Object,default:()=>({})},onHtmlChanged:{type:Function,default:()=>()=>{}},onGetCatalog:{type:Function,default:()=>()=>{}},markedHeadingId:{type:Function,default:()=>""},noMermaid:{type:Boolean,default:!1},sanitize:{type:Function,default:l=>l},placeholder:{type:String,default:""},noKatex:{type:Boolean,default:!1},scrollAuto:{type:Boolean},formatCopiedText:{type:Function,default:l=>l},autofocus:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},maxlength:{type:Number},autoDetectCode:{type:Boolean}});var Nl=G({name:"MDEditorContent",props:Ml(),setup(l){const e=V(!0),t=j("previewOnly"),n=j("showCodeRowNumber"),i=j("previewTheme"),o=j("editorId"),a=V(),r=V(),m=V(),u=Pl(l),{html:c}=Dl(l,u);return Rl(l,c,a,r,m),jl(l,a),Ll(l,a,e),Ol(l,a),Hl(l,c),Bl(a),()=>{const h=Rn(l,["formatCopiedText","markedHeadingId","noKatex","noMermaid","onChange","onGetCatalog","onHtmlChanged","sanitize","scrollAuto","setting","autoDetectCode"]);return s(je,null,[s("div",{class:`${d}-content`},[!t&&s("div",{class:`${d}-input-wrapper`},[s("textarea",nn(h,{id:`${o}-textarea`,ref:a,onBlur:()=>{b.emit(o,"selectTextChange")},onKeydown:()=>{b.emit(o,"saveHistoryPos",!0)},onCompositionstart:()=>{e.value=!1},onInput:f=>{l.onChange(f.target.value)},onCompositionend:()=>{e.value=!0},class:[l.setting.preview||l.setting.htmlPreview?"":"textarea-only"]}),null)]),l.setting.preview&&s("div",{id:`${o}-preview-wrapper`,class:`${d}-preview-wrapper`,ref:r,key:"content-preview-wrapper"},[s("article",{id:`${o}-preview`,class:[`${d}-preview`,`${i==null?void 0:i.value}-theme`,n&&`${d}-scrn`],innerHTML:c.value},null)]),l.setting.htmlPreview&&s("div",{class:`${d}-preview-wrapper`,ref:m,key:"html-preview-wrapper"},[s("div",{class:`${d}-html`},[c.value])])])])}}}),Ul=G({props:{modelValue:{type:String,default:""}},setup(l){const e=j("usedLanguageText");return()=>{var t,n;return s("div",{class:`${d}-footer-item`},[s("label",{class:`${d}-footer-label`},[`${(t=e.value.footer)==null?void 0:t.markdownTotal}:`]),s("span",null,[((n=l.modelValue)==null?void 0:n.length)||0])])}}});const ql=()=>({checked:{type:Boolean,default:!1},onChange:{type:Function,default:()=>()=>{}}});var Vl=G({props:ql(),setup(l){return()=>s("div",{class:[`${d}-checkbox`,l.checked&&`${d}-checkbox-checked`],onClick:()=>{l.onChange(!l.checked)}},null)}});const Kl=()=>({scrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>()=>{}}});var Zl=G({props:Kl(),setup(l){const e=j("usedLanguageText");return()=>{var t;return s("div",{class:`${d}-footer-item`},[s("label",{class:`${d}-footer-label`,onClick:()=>{l.onScrollAutoChange(!l.scrollAuto)}},[(t=e.value.footer)==null?void 0:t.scrollAuto]),s(Vl,{checked:l.scrollAuto,onChange:l.onScrollAutoChange},null)])}}});const Gl=()=>({modelValue:{type:String,default:""},footers:{type:Array,default:[]},scrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>()=>{}},defFooters:{type:Object}});var Wl=G({name:"MDEditorFooter",props:Gl(),setup(l){const e=le(()=>{const n=l.footers.indexOf("="),i=n===-1?l.footers:l.footers.slice(0,n),o=n===-1?[]:l.footers.slice(n,Number.MAX_SAFE_INTEGER);return[i,o]}),t=n=>{if(Ut.includes(n))switch(n){case"markdownTotal":return s(Ul,{modelValue:l.modelValue},null);case"scrollSwitch":return s(Zl,{scrollAuto:l.scrollAuto,onScrollAutoChange:l.onScrollAutoChange},null)}else return l.defFooters instanceof Array?l.defFooters[n]||"":l.defFooters&&l.defFooters.children instanceof Array&&l.defFooters.children[n]||""};return()=>{const n=e.value[0].map(o=>t(o)),i=e.value[1].map(o=>t(o));return s("div",{class:`${d}-footer`},[s("div",{class:`${d}-footer-left`},[n]),s("div",{class:`${d}-footer-right`},[i])])}}});const Xl=()=>({tocItem:{type:Object,default:()=>({})},markedHeadingId:{type:Function,default:()=>()=>{}},scrollElement:{type:[String,Object],default:""},onClick:{type:Function,default:()=>()=>{}},scrollElementOffsetTop:{type:Number,default:0}}),en=G({props:Xl(),setup(l){return()=>{const{tocItem:e,markedHeadingId:t,scrollElement:n,onClick:i,scrollElementOffsetTop:o}=l;return s("div",{class:[`${d}-catalog-link`,e.active&&`${d}-catalog-active`],onClick:a=>{i(a,e),a.stopPropagation();const r=t(e.text,e.level,e.index),m=document.getElementById(r),u=n instanceof Element?n:document.querySelector(n);if(m&&u){let c=m.offsetParent,h=m.offsetTop;if(u.contains(c))for(;c&&u!=c;)h+=c==null?void 0:c.offsetTop,c=c==null?void 0:c.offsetParent;u==null||u.scrollTo({top:h-o,behavior:"smooth"})}}},[s("span",{title:e.text},[e.text]),s("div",{class:`${d}-catalog-wrapper`},[e.children&&e.children.map(a=>s(en,{markedHeadingId:t,key:`${e.text}-link-${a.level}-${a.text}`,tocItem:a,scrollElement:n,onClick:i,scrollElementOffsetTop:o},null))])])}}}),Ql=()=>({editorId:{type:String},class:{type:String,default:""},markedHeadingId:{type:Function,default:l=>l},scrollElement:{type:[String,Object]},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0}}),et=G({name:"MdCatalog",props:Ql(),emits:["onClick"],setup(l,e){const t=l.editorId,n=J({list:[],show:!1,scrollElement:l.scrollElement||`#${t}-preview-wrapper`}),i=le(()=>{const o=[];return n.list.forEach(({text:a,level:r,active:m},u)=>{const c={level:r,text:a,index:u+1,active:!!m};if(o.length===0)o.push(c);else{let h=o[o.length-1];if(c.level>h.level)for(let f=h.level+1;f<=6;f++){const{children:p}=h;if(!p){h.children=[c];break}if(h=p[p.length-1],c.level<=h.level){p.push(c);break}}else o.push(c)}}),o});return Z(()=>{b.on(t,{name:"catalogChanged",callback:o=>{n.list=o.map((a,r)=>r===0?Le(Q({},a),{active:!0}):Q({},a))}}),b.emit(t,"pushCatalog")}),Z(()=>{var o;const a=n.scrollElement instanceof HTMLElement?n.scrollElement:document.querySelector(n.scrollElement);(o=a===document.documentElement?window:a)==null||o.addEventListener("scroll",Fn(()=>{if(n.list.length===0)return!1;const{activeHead:r}=n.list.reduce((m,u,c)=>{const h=document.getElementById(l.markedHeadingId(u.text,u.level,c+1));if(h instanceof HTMLElement){const f=Dn(h,a);if(f<l.offsetTop&&f>m.minTop)return{activeHead:u,minTop:f}}return m},{activeHead:n.list[0],minTop:Number.MIN_SAFE_INTEGER});n.list=n.list.map(m=>m===r?Le(Q({},m),{active:!0}):Le(Q({},m),{active:!1}))}))}),()=>s("div",{class:`${d}-catalog${l.theme==="dark"?"-dark":""} ${l.class}`},[i.value.map(o=>s(en,{markedHeadingId:l.markedHeadingId,tocItem:o,key:`link-${o.level}-${o.text}`,scrollElement:n.scrollElement,onClick:(a,r)=>{e.emit("onClick",a,r)},scrollElementOffsetTop:l.scrollElementOffsetTop},null))])}}),Yl=()=>({modelValue:{type:String,default:""},theme:{type:String,default:"light"},class:{type:String,default:""},historyLength:{type:Number,default:10},onChange:{type:Function},onSave:{type:Function},onUploadImg:{type:Function},pageFullscreen:{type:Boolean,default:!1},preview:{type:Boolean,default:!0},htmlPreview:{type:Boolean,default:!1},previewOnly:{type:Boolean,default:!1},language:{type:String,default:"zh-CN"},toolbars:{type:Array,default:Nt},toolbarsExclude:{type:Array,default:[]},noPrettier:{type:Boolean,default:!1},onHtmlChanged:{type:Function},onGetCatalog:{type:Function},editorId:{type:String,default:$n},tabWidth:{type:Number,default:2},showCodeRowNumber:{type:Boolean,default:!1},previewTheme:{type:String,default:"default"},style:{type:Object,default:()=>({})},markedHeadingId:{type:Function,default:Jl},tableShape:{type:Array,default:()=>[6,4]},noMermaid:{type:Boolean,default:!1},sanitize:{type:Function,default:l=>l},placeholder:{type:String,default:""},noKatex:{type:Boolean,default:!1},defToolbars:{type:[String,Object]},onError:{type:Function},codeTheme:{type:String,default:"atom"},footers:{type:Array,default:Ut},scrollAuto:{type:Boolean,default:!0},defFooters:{type:[String,Object]},noIconfont:{type:Boolean},formatCopiedText:{type:Function,default:l=>l},noUploadImg:{type:Boolean},codeStyleReverse:{type:Boolean,default:!0},codeStyleReverseList:{type:Array,default:["default","mk-cute"]},autoFocus:{type:Boolean},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{type:Number},autoDetectCode:{type:Boolean}}),Jl=l=>l,ue=G({name:"MdEditorV3",props:Yl(),emits:["onChange","onSave","onUploadImg","onHtmlChanged","onGetCatalog","onError","update:modelValue"],setup(l,e){const{editorId:t,previewOnly:n,noKatex:i,noMermaid:o,noPrettier:a,noUploadImg:r}=l,m=J({scrollAuto:l.scrollAuto});Pn(l,e),On(l),Hn(l);const[u,c]=Bn(l,e),[h,f]=Mn(l);return Re(()=>{b.clear(t)}),Nn(l,e,h,u,c),()=>{var p;const w=ie({props:l,ctx:e},"defToolbars"),C=ie({props:l,ctx:e},"defFooters");return s("div",{id:t,class:[d,l.class,l.theme==="dark"&&`${d}-dark`,u.fullscreen||u.pageFullscreen?`${d}-fullscreen`:"",n&&`${d}-previewOnly`],style:l.style},[!n&&s(nl,{noPrettier:a,toolbars:l.toolbars,toolbarsExclude:l.toolbarsExclude,setting:u,updateSetting:c,tableShape:l.tableShape,defToolbars:w,noUploadImg:r},null),s(Nl,{value:l.modelValue,onChange:y=>{b.emit(t,"saveHistoryPos"),l.onChange?l.onChange(y):(e.emit("update:modelValue",y),e.emit("onChange",y))},setting:u,onHtmlChanged:y=>{l.onHtmlChanged?l.onHtmlChanged(y):e.emit("onHtmlChanged",y)},onGetCatalog:y=>{l.onGetCatalog?l.onGetCatalog(y):e.emit("onGetCatalog",y)},markedHeadingId:l.markedHeadingId,noMermaid:o,sanitize:l.sanitize,placeholder:l.placeholder,noKatex:i,scrollAuto:m.scrollAuto,formatCopiedText:l.formatCopiedText,autofocus:l.autoFocus,disabled:l.disabled,readonly:l.readOnly,maxlength:l.maxLength,autoDetectCode:l.autoDetectCode},null),!n&&((p=l.footers)==null?void 0:p.length)>0&&s(Wl,{modelValue:l.modelValue,footers:l.footers,defFooters:C,scrollAuto:m.scrollAuto,onScrollAutoChange:y=>m.scrollAuto=y},null),f.value&&!n&&s(et,{theme:l.theme,style:{display:h.value?"block":"none"},class:`${d}-catalog-editor`,editorId:t,markedHeadingId:l.markedHeadingId},null)])}}}),ei=()=>({title:{type:String,default:""},trigger:{type:[String,Object]},onClick:{type:Function}});var it=G({name:"NormalToolbar",props:ei(),emits:["onClick"],setup(l,e){return()=>{const t=ie({props:l,ctx:e},"trigger");return s("div",{class:`${d}-toolbar-item`,title:l.title,onClick:n=>{l.onClick instanceof Function?l.onClick(n):e.emit("onClick",n)}},[t])}}});const ti=()=>({title:{type:String,default:""},visible:{type:Boolean},trigger:{type:[String,Object]},onChange:{type:Function},overlay:{type:[String,Object]}});var ot=G({name:"DropdownToolbar",props:ti(),emits:["onChange"],setup(l,e){const t=j("editorId");return()=>{const n=ie({props:l,ctx:e},"trigger"),i=ie({props:l,ctx:e},"overlay");return s(Ce,{relative:`#${t}-toolbar-wrapper`,visible:l.visible,onChange:o=>{l.onChange instanceof Function?l.onChange(o):e.emit("onChange",o)},overlay:i},{default:()=>[s("div",{class:`${d}-toolbar-item`,title:l.title||""},[n])]})}}});function ni(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!ln(l)}const li=()=>({title:{type:String,default:""},modalTitle:{type:String,default:""},visible:{type:Boolean},width:{type:String,default:"auto"},height:{type:String,default:"auto"},trigger:{type:[String,Object]},onClick:{type:Function},onClose:{type:Function},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function}});var rt=G({name:"ModalToolbar",props:li(),emits:["onClick","onClose","onAdjust"],setup(l,e){return()=>{const t=ie({props:l,ctx:e},"trigger"),n=ie({props:l,ctx:e},"default");return s(je,null,[s("div",{class:`${d}-toolbar-item`,title:l.title,onClick:()=>{l.onClick instanceof Function?l.onClick():e.emit("onClick")}},[t]),s(st,{width:l.width,height:l.height,title:l.modalTitle,visible:l.visible,onClose:()=>{l.onClose instanceof Function?l.onClose():e.emit("onClose")},showAdjust:l.showAdjust,isFullscreen:l.isFullscreen,onAdjust:i=>{l.onAdjust instanceof Function?l.onAdjust(i):e.emit("onAdjust",i)}},ni(n)?n:{default:()=>[n]})])}}});ue.install=l=>(l.component(ue.name,ue),l.component(it.name,it),l.component(ot.name,ot),l.component(et.name,et),l.component(rt.name,rt),l);ue.NormalToolbar=it;ue.DropdownToolbar=ot;ue.MdCatalog=et;ue.ModalToolbar=rt;ue.config=Tn;const ii=G({name:"Welcome",__name:"index",setup(l){const e=V(),t=V(!0),{version:n}={dependencies:{"@amap/amap-jsapi-loader":"^1.0.1","@howdyjs/mouse-menu":"^2.0.9","@logicflow/core":"^1.2.15","@logicflow/extension":"^1.2.16","@pureadmin/descriptions":"^1.1.1","@pureadmin/table":"^2.3.3","@pureadmin/utils":"^1.9.10","@vueuse/core":"^10.4.1","@vueuse/motion":"^2.0.0","@wangeditor/editor":"^5.1.23","@wangeditor/editor-for-vue":"^5.1.12","@zxcvbn-ts/core":"^3.0.4","animate.css":"^4.1.1",axios:"^1.5.1","china-area-data":"^5.0.1",cropperjs:"^1.6.1",dayjs:"^1.11.10",echarts:"^5.4.3","el-table-infinite-scroll":"^3.0.3","element-plus":"^2.3.14","intro.js":"^7.2.0","js-cookie":"^3.0.5",jsbarcode:"^3.11.5",localforage:"^1.10.0","md-editor-v3":"2.7.2","mint-filter":"^4.0.3",mitt:"^3.0.1",mockjs:"^1.1.0",nprogress:"^0.2.0",path:"^0.12.7",pinia:"^2.1.6","pinyin-pro":"^3.16.7",qrcode:"^1.5.3",qs:"^6.11.2","responsive-storage":"^2.2.0",sortablejs:"^1.15.0",swiper:"^10.3.1",typeit:"^8.7.1","v-contextmenu":"3.0.0","v3-infinite-loading":"^1.3.1","version-rocket":"^1.7.0",vue:"^3.3.4","vue-i18n":"^9.5.0","vue-json-pretty":"^2.2.4","vue-pdf-embed":"^1.2.1","vue-router":"^4.2.5","vue-tippy":"^6.3.1","vue-types":"^5.1.1","vue-virtual-scroller":"2.0.0-beta.8","vue-waterfall-plugin-next":"^2.2.4","vue3-danmaku":"^1.6.0",vuedraggable:"^4.1.0","wavesurfer.js":"^7.3.4",xgplayer:"^3.0.9",xlsx:"^0.18.5"},devDependencies:{"@commitlint/cli":"^17.7.2","@commitlint/config-conventional":"^17.7.0","@iconify-icons/ep":"^1.2.12","@iconify-icons/ri":"^1.2.10","@iconify/vue":"^4.1.1","@intlify/unplugin-vue-i18n":"^1.4.0","@pureadmin/theme":"^3.1.0","@types/intro.js":"^5.1.2","@types/js-cookie":"^3.0.4","@types/mockjs":"^1.0.8","@types/node":"^20.8.2","@types/nprogress":"0.2.0","@types/qrcode":"^1.5.2","@types/qs":"^6.9.8","@types/sortablejs":"^1.15.3","@typescript-eslint/eslint-plugin":"^6.7.4","@typescript-eslint/parser":"^6.7.4","@vitejs/plugin-vue":"^4.4.0","@vitejs/plugin-vue-jsx":"^3.0.2","@vue/eslint-config-prettier":"^8.0.0","@vue/eslint-config-typescript":"^12.0.0",autoprefixer:"^10.4.16",cloc:"^2.11.0",cssnano:"^6.0.1",eslint:"^8.50.0","eslint-plugin-prettier":"^5.0.0","eslint-plugin-vue":"^9.17.0",husky:"^8.0.3","lint-staged":"^14.0.1",picocolors:"^1.0.0",postcss:"^8.4.31","postcss-html":"^1.5.0","postcss-import":"^15.1.0","postcss-scss":"^4.0.9",prettier:"^3.0.3",rimraf:"^5.0.5","rollup-plugin-visualizer":"^5.9.2",sass:"^1.69.0","sass-loader":"^13.3.2",stylelint:"^15.10.3","stylelint-config-html":"^1.1.0","stylelint-config-recess-order":"^4.3.0","stylelint-config-recommended":"^13.0.0","stylelint-config-recommended-scss":"^13.0.0","stylelint-config-recommended-vue":"^1.5.0","stylelint-config-standard":"^34.0.0","stylelint-config-standard-scss":"^11.0.0","stylelint-order":"^6.0.3","stylelint-prettier":"^4.0.2","stylelint-scss":"^5.2.1",svgo:"^3.0.2",tailwindcss:"^3.3.3",terser:"^5.21.0",typescript:"^5.2.2",vite:"^4.4.11","vite-plugin-cdn-import":"^0.3.5","vite-plugin-compression":"^0.5.1","vite-plugin-mock":"2.9.6","vite-plugin-remove-console":"^2.1.1","vite-svg-loader":"^4.0.0","vue-eslint-parser":"^9.3.1","vue-tsc":"^1.8.15"},name:"vue-pure-admin",version:"4.5.0"},i=le(()=>["text-base","font-medium"]),{height:o}=on();return setTimeout(()=>{t.value=!t.value},800),fn().then(({data:a})=>{e.value=a.list.map(r=>({content:r.body,timestamp:rn(r.published_at).format("YYYY/MM/DD hh:mm:ss A"),icon:an(vn({background:sn({type:"hex"})}))}))}),(a,r)=>{const m=he("el-timeline-item"),u=he("el-timeline"),c=he("el-empty"),h=he("el-scrollbar"),f=he("el-skeleton"),p=he("el-card"),w=he("el-col"),C=he("el-row"),y=cn("motion");return pe(),ht("div",null,[s(C,{gutter:24},{default:U(()=>[ge((pe(),xe(w,{xs:24,sm:24,md:12,lg:12,xl:12,class:"mb-[18px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:200}}},{default:U(()=>[s(p,{shadow:"never",style:pt({height:`calc(${te(o)}px - 35vh - 250px)`})},{header:U(()=>[Se("a",{class:Te(i.value),href:"https://github.com/pure-admin/vue-pure-admin/releases",target:"_black"},[s(te(ze),{className:"type-it2",values:[`PureAdmin v${te(n)}`],cursor:!1,speed:60},null,8,["values"])],2)]),default:U(()=>[s(f,{animated:"",rows:7,loading:t.value},{default:U(()=>[s(h,{height:`calc(${te(o)}px - 35vh - 340px)`},{default:U(()=>{var g,x;return[ge(s(u,null,{default:U(()=>[(pe(!0),ht(je,null,un(e.value,(E,S)=>(pe(),xe(m,{key:S,icon:E.icon,timestamp:E.timestamp},{default:U(()=>[s(te(ue),{modelValue:E.content,"onUpdate:modelValue":z=>E.content=z,"preview-only":""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["icon","timestamp"]))),128))]),_:1},512),[[ft,((g=e.value)==null?void 0:g.length)>0]]),ge(s(c,null,null,512),[[ft,((x=e.value)==null?void 0:x.length)===0]])]}),_:1},8,["height"])]),_:1},8,["loading"])]),_:1},8,["style"])]),_:1})),[[y]]),ge((pe(),xe(w,{xs:24,sm:24,md:12,lg:12,xl:12,class:"mb-[18px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:200}}},{default:U(()=>[s(p,{shadow:"never",style:pt({height:`calc(${te(o)}px - 35vh - 250px)`})},{header:U(()=>[Se("a",{class:Te(i.value),href:"https://github.com/xiaoxian521",target:"_black"},[s(te(ze),{className:"type-it1",values:["GitHub"],cursor:!1,speed:120})],2)]),default:U(()=>[s(f,{animated:"",rows:7,loading:t.value},{default:U(()=>[s(h,{height:`calc(${te(o)}px - 35vh - 340px)`},{default:U(()=>[s(gn)]),_:1},8,["height"])]),_:1},8,["loading"])]),_:1},8,["style"])]),_:1})),[[y]]),ge((pe(),xe(w,{xs:24,sm:24,md:12,lg:8,xl:8,class:"mb-[18px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:400}}},{default:U(()=>[s(p,{shadow:"never"},{header:U(()=>[Se("a",{class:Te(i.value),href:"https://github.com/pure-admin/vue-pure-admin",target:"_black"},[s(te(ze),{className:"type-it4",values:["GitHub线"],cursor:!1,speed:120})],2)]),default:U(()=>[s(f,{animated:"",rows:7,loading:t.value},{default:U(()=>[s(pn)]),_:1},8,["loading"])]),_:1})]),_:1})),[[y]]),ge((pe(),xe(w,{xs:24,sm:24,md:12,lg:8,xl:8,class:"mb-[18px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:400}}},{default:U(()=>[s(p,{shadow:"never"},{header:U(()=>[Se("a",{class:Te(i.value),href:"https://github.com/pure-admin/vue-pure-admin",target:"_black"},[s(te(ze),{className:"type-it3",values:["GitHub"],cursor:!1,speed:120})],2)]),default:U(()=>[s(f,{animated:"",rows:7,loading:t.value},{default:U(()=>[s(hn)]),_:1},8,["loading"])]),_:1})]),_:1})),[[y]]),ge((pe(),xe(w,{xs:24,sm:24,md:24,lg:8,xl:8,class:"mb-[18px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:400}}},{default:U(()=>[s(p,{shadow:"never"},{header:U(()=>[Se("a",{class:Te(i.value),href:"https://github.com/pure-admin/vue-pure-admin",target:"_black"},[s(te(ze),{className:"type-it5",values:["GitHub"],cursor:!1,speed:120})],2)]),default:U(()=>[s(f,{animated:"",rows:7,loading:t.value},{default:U(()=>[s(mn)]),_:1},8,["loading"])]),_:1})]),_:1})),[[y]])]),_:1})])}}});const bi=dn(ii,[["__scopeId","data-v-1d934bf1"]]);export{bi as default};