md-editor-v3 6.5.6 → 7.0.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/MdEditor.cjs +1 -1
- package/lib/cjs/chunks/config.cjs +14 -1
- package/lib/cjs/chunks/index2.cjs +1 -1
- package/lib/cjs/chunks/index3.cjs +1 -1
- package/lib/cjs/chunks/index4.cjs +45 -45
- package/lib/cjs/chunks/index5.cjs +7 -2
- package/lib/es/MdEditor.mjs +5 -4
- package/lib/es/chunks/config.mjs +919 -69
- package/lib/es/chunks/event-bus.mjs +5 -5
- package/lib/es/chunks/index2.mjs +11 -11
- package/lib/es/chunks/index3.mjs +60 -57
- package/lib/es/chunks/index4.mjs +701 -635
- package/lib/es/chunks/index5.mjs +199 -32
- package/lib/preview.css +2 -2
- package/lib/style.css +4 -4
- package/lib/types/index.d.ts +12 -12
- package/package.json +3 -2
package/lib/cjs/MdEditor.cjs
CHANGED
|
@@ -37,4 +37,4 @@ dateFormat YYYY-MM-DD`,class:`classDiagram
|
|
|
37
37
|
| Column`;for(let r=0;r<=l;r++)i+=" |";i+=`
|
|
38
38
|
|`;for(let r=0;r<=l;r++)i+=" - |";for(let r=0;r<=a;r++){i+=`
|
|
39
39
|
|`;for(let s=0;s<=l;s++)i+=" |"}return i+=`
|
|
40
|
-
`,{text:i,options:{deviationStart:3,deviationEnd:10-i.length}}},yo=(t,o)=>{const{generate:a}=o,l=a(t);return{text:l.targetValue,options:{select:l.select??!0,deviationStart:l.deviationStart||0,deviationEnd:l.deviationEnd||0}}},re=(t,o={wholeLine:!1})=>{const a=t.view.state,l=a.selection.main;if(l.empty){const i=a.doc.lineAt(l.from);return[a.doc.lineAt(l.from).text,i.from,i.to]}else if(o.wholeLine){const i=a.doc.lineAt(l.from),r=a.doc.lineAt(l.to);return[a.doc.sliceString(i.from,r.to),i.from,r.to]}return[a.doc.sliceString(l.from,l.to),l.from,l.to]};j.EditorView.EDIT_CONTEXT=!1;const $e=t=>t.extension instanceof Function?t.extension(t.options):t.extension,No=t=>{const o=$e(t);return t.compartment?t.compartment.of(o):o},ko=t=>{const o=e.inject("tabWidth"),a=e.inject("editorId"),l=e.inject("theme"),i=e.inject("previewTheme"),r=e.inject("language"),s=e.inject("usedLanguageText"),d=e.inject("disabled"),c=e.inject("contentDisabled"),m=e.inject("showToolbarName"),u=e.inject("customIcon"),f=e.inject("noUploadImg"),p=e.inject("tableShape"),g=e.inject("noPrettier"),T=e.inject("codeTheme"),k=e.inject("setting"),R=e.inject("updateSetting"),E=e.inject("catalogVisible"),N=e.inject("defToolbars"),I=e.inject("floatingToolbars"),V=e.inject("rootRef"),$=e.ref(),y=e.shallowRef(),M=e.ref(!1),B=new S.Compartment,C=new S.Compartment,te=new S.Compartment,ie=new S.Compartment,Ve=new S.Compartment,Se=oo(a,{noPrettier:g}),se=()=>[...Se,...P.defaultKeymap,...P.historyKeymap,P.indentWithTab],Y={paste:to(t,y),blur:t.onBlur,focus:t.onFocus,drop:t.onDrop,compositionstart:()=>{M.value=!0},compositionend:(h,L)=>{M.value=!1,t.updateModelValue(L.state.doc.toString())},input:h=>{t.onInput&&t.onInput(h);const{data:L}=h;t.maxlength&&t.modelValue.length+L.length>t.maxlength&&x.bus.emit(a,x.ERROR_CATCHER,{name:"overlength",message:"The input text is too long",data:L})}},Ie=Rt({privide(h){h.provide("editorId",a),h.provide("theme",l),h.provide("previewTheme",i),h.provide("language",r),h.provide("disabled",d),h.provide("contentDisabled",c),h.provide("noUploadImg",f),h.provide("tableShape",p),h.provide("noPrettier",g),h.provide("codeTheme",T),h.provide("showToolbarName",m),h.provide("setting",k),h.provide("updateSetting",R),h.provide("usedLanguageText",s),h.provide("catalogVisible",E),h.provide("defToolbars",N),h.provide("tabWidth",o),h.provide("customIcon",u),h.provide("floatingToolbars",I),h.provide("rootRef",V)}}),je=[{type:"theme",extension:({theme:h})=>h.value==="light"?he:Ne,compartment:B,options:{theme:l}},{type:"updateListener",extension:j.EditorView.updateListener.of(h=>{h.docChanged&&(t.onChange(h.state.doc.toString()),M.value||t.updateModelValue(h.state.doc.toString()))})},{type:"domEventHandlers",extension:j.EditorView.domEventHandlers(Y),compartment:ie},{type:"completions",extension:me(t.completions),compartment:C},{type:"history",extension:P.history(),compartment:te}],ce=n.globalConfig.codeMirrorExtensions([{type:"lineWrapping",extension:j.EditorView.lineWrapping},{type:"keymap",extension:j.keymap.of(se())},{type:"drawSelection",extension:j.drawSelection()},{type:"markdown",extension:Ae.markdown({codeLanguages:Me.languages})},{type:"linkShortener",extension:h=>uo(h),options:{maxLength:30}},{type:"floatingToolbar",extension:I.value.length>0?Ie:[],compartment:Ve}],{editorId:a,theme:l.value,keyBindings:se()}),Ee=()=>[...je,...ce].map(No);return e.onMounted(()=>{const h=new j.EditorView({doc:t.modelValue,parent:$.value,extensions:Ee()}),L=new _e(h);y.value=L,setTimeout(()=>{L.setTabSize(o),L.setDisabled(d.value),L.setReadOnly(t.readonly),t.placeholder&&L.setPlaceholder(t.placeholder),typeof t.maxlength=="number"&&L.setMaxLength(t.maxlength),t.autofocus&&h.focus()},0),x.bus.on(a,{name:x.CTRL_Z,callback(){P.undo(h)}}),x.bus.on(a,{name:x.CTRL_SHIFT_Z,callback(){P.redo(h)}}),x.bus.on(a,{name:x.REPLACE,async callback({direct:H,params:D={},source:_="interaction"}){const Z=()=>c.value&&_!=="programmatic";if(Z())return;const A=async F=>{const{text:O,options:Re}=await mo(H,y.value,F);Z()||y.value?.replaceSelectedText(O,Re,a)};if(H==="image"&&D.transform){const F=t.transformImgUrl(D.url);F instanceof Promise?F.then(O=>A({...D,url:O})).catch(O=>{console.error(O)}):await A({...D,url:F})}else await A(D)}}),x.bus.on(a,{name:x.EVENT_LISTENER,callback:G.throttle(H=>{const D={...Y},_=Object.keys(Y);for(const Z in H){const A=Z;_.includes(A)?D[A]=(F,O)=>{H[A](F,O),F.defaultPrevented||Y[A](F,O)}:D[A]=H[A]}y.value?.view.dispatch({effects:ie.reconfigure(j.EditorView.domEventHandlers(D))})})}),x.bus.on(a,{name:x.TASK_STATE_CHANGED,callback:(H,D)=>{if(c.value)return;const _=h.state.doc.line(H);h.dispatch(h.state.update({changes:{from:_.from,to:_.to,insert:D}}))}}),x.bus.on(a,{name:x.SEND_EDITOR_VIEW,callback(){x.bus.emit(a,x.GET_EDITOR_VIEW,h)}}),x.bus.emit(a,x.GET_EDITOR_VIEW,h)}),e.watch(l,()=>{y.value?.view.dispatch({effects:B.reconfigure(l.value==="light"?he:Ne)})},{deep:!0}),e.watch(()=>t.completions,()=>{y.value?.view.dispatch({effects:C.reconfigure(me(t.completions))})},{deep:!0}),e.watch(()=>t.modelValue,()=>{y.value?.getValue()!==t.modelValue&&y.value?.setValue(t.modelValue)}),e.watch(()=>t.placeholder,()=>{y.value?.setPlaceholder(t.placeholder)}),e.watch([d],()=>{y.value?.setDisabled(d.value)}),e.watch(()=>t.readonly,()=>{y.value?.setReadOnly(t.readonly)}),e.watch(()=>t.maxlength,()=>{t.maxlength&&y.value?.setMaxLength(t.maxlength)}),We(()=>{const h=ce.find(L=>L.type==="floatingToolbar");h?.compartment&&(I.value.length>0?y.value?.view.dispatch({effects:h.compartment.reconfigure($e(h))}):y.value?.view.dispatch({effects:h.compartment.reconfigure([])}))},I),{inputWrapperRef:$,codeMirrorUt:y,resetHistory(){y.value?.view.dispatch({effects:te.reconfigure([])}),y.value?.view.dispatch({effects:te.reconfigure(P.history())})}}},$o=(t,o,a)=>{const l=e.inject("setting"),i=e.computed(()=>/px$/.test(`${t.inputBoxWidth}`)?"50%":t.inputBoxWidth),r=e.reactive({resizedWidth:i.value}),s=e.reactive({width:i.value}),d=e.reactive({insetInlineStart:i.value,display:"initial"}),c=f=>{const p=o.value?.offsetWidth||0,g=o.value?.getBoundingClientRect().x||0;let T=f.x-g;T/p<n.MinInputBoxWidth?T=p*n.MinInputBoxWidth:T>p-p*n.MinInputBoxWidth&&(T=p-p*n.MinInputBoxWidth);const k=`${T/p*100}%`;s.width=k,d.insetInlineStart=k,r.resizedWidth=k,t.oninputBoxWidthChange?.(k)},m=f=>{f.target===a.value&&document.addEventListener("mousemove",c)},u=()=>{document.removeEventListener("mousemove",c)};return e.watch([a],()=>{document.removeEventListener("mousedown",m),document.removeEventListener("mouseup",u),document.addEventListener("mousedown",m),document.addEventListener("mouseup",u)}),e.onMounted(()=>{document.addEventListener("mousedown",m),document.addEventListener("mouseup",u)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",m),document.removeEventListener("mouseup",u)}),e.watch([i],([f])=>{r.resizedWidth=f,s.width=f,d.insetInlineStart=f}),e.watch([()=>l.value.htmlPreview,()=>l.value.preview,()=>l.value.previewOnly],()=>{l.value.previewOnly?(s.width="0%",d.display="none"):!l.value.htmlPreview&&!l.value.preview?(s.width="100%",d.display="none"):(s.width=r.resizedWidth,d.display="initial")},{immediate:!0}),{inputWrapperStyle:s,resizeOperateStyle:d}},Vo=()=>{const t=e.inject("editorId"),o=e.ref(!0),a=G.createSmoothScroll();return{onCatalogActive:(s,d)=>{const c=document.querySelector(`#${t} .${n.prefix}-catalog-editor`);if(!d||!o.value||!c)return;const m=d.offsetTop-c.scrollTop;(m>100||m<100)&&a(c,d.offsetTop-100)},onMouseenter:()=>o.value=!1,onMouseleave:()=>o.value=!0}},ne=e.defineComponent({name:`${n.prefixHump}CustomScrollbar`,props:{id:{type:String,default:void 0},class:{type:[String,Array],default:void 0},scrollTarget:{type:String,default:void 0},alwaysShowTrack:{type:Boolean,default:!1},onMouseenter:{type:Function,default:()=>{}},onMouseleave:{type:Function,default:()=>{}}},setup(t,{slots:o}){const a=e.ref(null),l=e.ref(null),i=e.ref(null),r=e.ref(null);let s=null,d=null,c=!1,m=0,u=0;const f=()=>{if(!l.value||!a.value||!i.value||!r.value)return;const N=a.value.clientHeight,I=l.value.scrollHeight,V=l.value.scrollTop;if(I<=N){i.value.style.display="none",t.alwaysShowTrack||(r.value.style.display="none");return}else i.value.style.display="block",r.value.style.display="block";const $=N/I,y=Math.max(N*$,20),M=N-y,B=Math.min(V*$,M);i.value.style.height=`${y}px`,i.value.style.top=`${B}px`},p=()=>f(),g=N=>{c=!0,m=N.clientY,u=l.value.scrollTop,document.body.style.userSelect="none"},T=N=>{if(!c||!l.value||!a.value)return;const I=N.clientY-m,V=l.value.scrollHeight/a.value.clientHeight;l.value.scrollTop=u+I*V},k=()=>{c=!1,document.body.style.userSelect=""},R=N=>{l.value&&l.value.removeEventListener("scroll",p),l.value=N,l.value?(l.value.addEventListener("scroll",p),f()):r.value&&!t.alwaysShowTrack&&(r.value.style.display="none")},E=()=>{if(!a.value)return;const N=t.scrollTarget?a.value.querySelector(t.scrollTarget):a.value.firstElementChild;R(N)};return e.onMounted(async()=>{await e.nextTick();const N=a.value;N&&(E(),s=new MutationObserver(()=>{d&&cancelAnimationFrame(d),d=requestAnimationFrame(()=>{E()})}),s.observe(N,{childList:!0,subtree:!0}),window.addEventListener("resize",f),i.value?.addEventListener("mousedown",g),document.addEventListener("mousemove",T),document.addEventListener("mouseup",k))}),e.onBeforeUnmount(()=>{s?.disconnect(),l.value&&l.value.removeEventListener("scroll",p),window.removeEventListener("resize",f),i.value?.removeEventListener("mousedown",g),document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",k)}),()=>e.createVNode("div",{id:t.id,class:[`${n.prefix}-custom-scrollbar`,t.class],ref:a,onMouseenter:t.onMouseenter,onMouseleave:t.onMouseleave},[o.default?.(),e.createVNode("div",{class:`${n.prefix}-custom-scrollbar__track`,ref:r},[e.createVNode("div",{class:`${n.prefix}-custom-scrollbar__thumb`,ref:i},null)])])}}),So=G.createSmoothScroll(),Io={flex:1},jo=e.defineComponent({name:"MDEditorContent",props:v.contentProps,setup(t,o){const a=e.inject("editorId"),l=e.inject("catalogVisible"),i=e.inject("theme"),r=e.inject("setting"),s=e.ref(""),d=e.ref(),c=e.ref(),{inputWrapperRef:m,codeMirrorUt:u,resetHistory:f}=ko(t),{inputWrapperStyle:p,resizeOperateStyle:g}=$o(t,d,c);Pe(t,s,u);const{onCatalogActive:T,onMouseenter:k,onMouseleave:R}=Vo(),E=(V,$)=>{if(!r.value.preview&&$.line!==void 0){V.preventDefault();const y=u.value?.view;if(y){const M=y.state.doc.line($.line+1),B=y.lineBlockAt(M.from)?.top,C=y.scrollDOM;So(C,B)}}},N=e.computed(()=>r.value.preview?"preview":"editor"),I=V=>{s.value=V,t.onHtmlChanged(V)};return o.expose({getSelectedText(){return u.value?.getSelectedText()},focus(V){u.value?.focus(V)},resetHistory:f,getEditorView(){return u.value?.view}}),()=>e.createVNode("div",{class:`${n.prefix}-content`},[e.createVNode("div",{class:`${n.prefix}-content-wrapper`,ref:d},[e.createVNode(ne,{alwaysShowTrack:!0,scrollTarget:`#${a} .cm-scroller`,style:p},{default:()=>[e.createVNode("div",{class:`${n.prefix}-input-wrapper`,ref:m},null)]}),(r.value.htmlPreview||r.value.preview)&&e.createVNode("div",{class:`${n.prefix}-resize-operate`,style:g,ref:c},null),e.createVNode(ne,{style:Io},{default:()=>[e.createVNode(v.ContentPreview,{modelValue:t.modelValue,onChange:t.onChange,onHtmlChanged:I,onGetCatalog:t.onGetCatalog,mdHeadingId:t.mdHeadingId,noMermaid:t.noMermaid,sanitize:t.sanitize,noKatex:t.noKatex,formatCopiedText:t.formatCopiedText,noHighlight:t.noHighlight,noImgZoomIn:t.noImgZoomIn,sanitizeMermaid:t.sanitizeMermaid,codeFoldable:t.codeFoldable,autoFoldThreshold:t.autoFoldThreshold,onRemount:t.onRemount,previewComponent:t.previewComponent,noEcharts:t.noEcharts},null)]})]),l.value&&e.createVNode(ne,{class:`${n.prefix}-catalog-${t.catalogLayout}`,onMouseenter:k,onMouseleave:R},{default:()=>[e.createVNode(Q.MdCatalog,{theme:i.value,class:`${n.prefix}-catalog-editor`,editorId:a,mdHeadingId:t.mdHeadingId,key:"internal-catalog",scrollElementOffsetTop:2,syncWith:N.value,onClick:E,catalogMaxDepth:t.catalogMaxDepth,onActive:T},null)]})])}}),Eo=e.defineComponent({props:{modelValue:{type:String,default:""}},setup(t){const o=e.inject("usedLanguageText");return()=>e.createVNode("div",{class:`${n.prefix}-footer-item`},[e.createVNode("label",{class:`${n.prefix}-footer-label`},[`${o.value.footer?.markdownTotal}:`]),e.createVNode("span",null,[t.modelValue?.length||0])])}}),Ro={checked:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},disabled:{type:Boolean,default:void 0}},Lo=e.defineComponent({name:`${n.prefix}-checkbox`,props:Ro,setup(t){return()=>e.createVNode("div",{class:[`${n.prefix}-checkbox`,t.checked&&`${n.prefix}-checkbox-checked`,t.disabled&&`${n.prefix}-disabled`],onClick:()=>{t.disabled||t.onChange(!t.checked)}},null)}}),Do={scrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}}},Ao=e.defineComponent({props:Do,setup(t){const o=e.inject("usedLanguageText"),a=e.inject("disabled");return()=>e.createVNode("div",{class:[`${n.prefix}-footer-item`,a?.value&&`${n.prefix}-disabled`]},[e.createVNode("label",{class:`${n.prefix}-footer-label`,onClick:()=>{a?.value||t.onScrollAutoChange(!t.scrollAuto)}},[o?.value.footer?.scrollAuto]),e.createVNode(Lo,{checked:t.scrollAuto,onChange:t.onScrollAutoChange,disabled:a?.value},null)])}}),Mo={modelValue:{type:String,default:""},footers:{type:Array,default:[]},scrollAuto:{type:Boolean},noScrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}},defFooters:{type:Object}},Fo=e.defineComponent({name:"MDEditorFooter",props:Mo,setup(t){const o=e.inject("theme"),a=e.inject("language"),l=e.inject("disabled"),i=e.computed(()=>{const s=t.footers.indexOf("="),d=s===-1?t.footers:t.footers.slice(0,s),c=s===-1?[]:t.footers.slice(s,Number.MAX_SAFE_INTEGER);return[d,c]}),r=s=>{if(n.allFooter.includes(s))switch(s){case"markdownTotal":return e.createVNode(Eo,{modelValue:t.modelValue},null);case"scrollSwitch":return!t.noScrollAuto&&e.createVNode(Ao,{scrollAuto:t.scrollAuto,onScrollAutoChange:t.onScrollAutoChange},null)}else if(t.defFooters instanceof Array){const d=t.defFooters[s];return d?e.cloneVNode(d,{theme:d.props?.theme||o.value,language:d.props?.language||a.value,disabled:d.props?.disabled||l?.value}):""}else if(t.defFooters&&t.defFooters.children instanceof Array){const d=t.defFooters.children[s];return d?e.cloneVNode(d,{theme:d.props?.theme||o.value,language:d.props?.language||a.value,disabled:d.props?.disabled||l?.value}):""}else return""};return()=>{const s=i.value[0].map(c=>r(c)),d=i.value[1].map(c=>r(c));return e.createVNode("div",{class:`${n.prefix}-footer`},[e.createVNode("div",{class:`${n.prefix}-footer-left`},[s]),e.createVNode("div",{class:`${n.prefix}-footer-right`},[d])])}}}),Bo={toolbars:{type:Array,default:()=>[]},toolbarsExclude:{type:Array,default:()=>[]}},Ho=e.defineComponent({name:"MDEditorToolbar",props:Bo,setup(t){const o=e.inject("editorId"),a=e.inject("showToolbarName"),l=`${o}-toolbar-wrapper`,i=e.ref(),r=e.ref(),{barRender:s}=ke(),d=e.computed(()=>{const c=t.toolbars.filter(p=>!t.toolbarsExclude.includes(p)),m=c.indexOf("="),u=m===-1?c:c.slice(0,m+1),f=m===-1?[]:c.slice(m,Number.MAX_SAFE_INTEGER);return[u,f]});return e.watch(()=>t.toolbars,()=>{e.nextTick(()=>{i.value&&G.draggingScroll(i.value)})},{immediate:!0}),()=>{const c=d.value[0].map(u=>s(u)),m=d.value[1].map(u=>s(u));return e.createVNode(e.Fragment,null,[t.toolbars.length>0&&e.createVNode("div",{class:`${n.prefix}-toolbar-wrapper`,ref:i,id:l},[e.createVNode("div",{class:[`${n.prefix}-toolbar`,a.value&&`${n.prefix}-stn`]},[e.createVNode("div",{class:`${n.prefix}-toolbar-left`,ref:r},[c]),e.createVNode("div",{class:`${n.prefix}-toolbar-right`},[m])])])])}}}),J=e.defineComponent({name:"MdEditorV3",props:v.editorProps,emits:v.editorEmits,setup(t,o){const{noKatex:a,noMermaid:l,noHighlight:i}=t,r=e.reactive({scrollAuto:t.scrollAuto}),s=e.ref(),d=e.ref(),c=e.computed(()=>de.getSlot({props:t,ctx:o},"defToolbars")),m=e.computed(()=>de.getSlot({props:t,ctx:o},"defFooters")),u=v.useEditorId(t),[f,p]=v.useConfig(t,o,{editorId:u}),g=v.useCatalog(t,{editorId:u});v.useOnSave(t,o,{editorId:u}),v.useExpansion(t),v.useErrorCatcher(t,o,{editorId:u}),v.useExpose(t,o,{editorId:u,catalogVisible:g,setting:f,updateSetting:p,codeRef:d}),v.useProvide(t,{rootRef:s,editorId:u,setting:f,updateSetting:p,catalogVisible:g,defToolbars:c}),e.onBeforeUnmount(()=>{x.bus.clear(u)});const T=C=>{o.emit("update:modelValue",C)},k=C=>{t.onChange?.(C),o.emit("onChange",C)},R=C=>{t.onHtmlChanged?.(C),o.emit("onHtmlChanged",C)},E=C=>{t.onGetCatalog?.(C),o.emit("onGetCatalog",C)},N=C=>{t.onBlur?.(C),o.emit("onBlur",C)},I=C=>{t.onFocus?.(C),o.emit("onFocus",C)},V=C=>{t.onInput?.(C),o.emit("onInput",C)},$=C=>{t.onDrop?.(C),o.emit("onDrop",C)},y=C=>{t.oninputBoxWidthChange?.(C),o.emit("oninputBoxWidthChange",C)},M=()=>{t.onRemount?.(),o.emit("onRemount")},B=C=>{r.scrollAuto=C};return()=>e.createVNode("div",{id:u,class:[n.prefix,t.class,t.theme==="dark"&&`${n.prefix}-dark`,f.fullscreen||f.pageFullscreen?`${n.prefix}-fullscreen`:""],style:t.style,ref:s},[t.toolbars.length>0&&e.createVNode(Ho,{toolbars:t.toolbars,toolbarsExclude:t.toolbarsExclude},null),e.createVNode(jo,{ref:d,modelValue:t.modelValue,mdHeadingId:t.mdHeadingId,noMermaid:l,sanitize:t.sanitize,placeholder:t.placeholder,noKatex:a,scrollAuto:r.scrollAuto,formatCopiedText:t.formatCopiedText,autofocus:t.autoFocus,readonly:t.readOnly,maxlength:t.maxLength,autoDetectCode:t.autoDetectCode,noHighlight:i,updateModelValue:T,onChange:k,onHtmlChanged:R,onGetCatalog:E,onBlur:N,onFocus:I,onInput:V,completions:t.completions,noImgZoomIn:t.noImgZoomIn,onDrop:$,inputBoxWidth:t.inputBoxWidth,oninputBoxWidthChange:y,sanitizeMermaid:t.sanitizeMermaid,transformImgUrl:t.transformImgUrl,codeFoldable:t.codeFoldable,autoFoldThreshold:t.autoFoldThreshold,onRemount:M,catalogLayout:t.catalogLayout,catalogMaxDepth:t.catalogMaxDepth,noEcharts:t.noEcharts,previewComponent:t.previewComponent},null),t.footers.length>0&&e.createVNode(Fo,{modelValue:t.modelValue,footers:t.footers,defFooters:m.value,noScrollAuto:!f.preview&&!f.htmlPreview||f.previewOnly,scrollAuto:r.scrollAuto,onScrollAutoChange:B},null)])}});J.install=t=>(t.component(J.name,J),t.use(De).use(W.DropdownToolbar).use(Le).use(Q.MdCatalog).use(v.MdPreview),t);module.exports=J;
|
|
40
|
+
`,{text:i,options:{deviationStart:3,deviationEnd:10-i.length}}},yo=(t,o)=>{const{generate:a}=o,l=a(t);return{text:l.targetValue,options:{select:l.select??!0,deviationStart:l.deviationStart||0,deviationEnd:l.deviationEnd||0}}},re=(t,o={wholeLine:!1})=>{const a=t.view.state,l=a.selection.main;if(l.empty){const i=a.doc.lineAt(l.from);return[a.doc.lineAt(l.from).text,i.from,i.to]}else if(o.wholeLine){const i=a.doc.lineAt(l.from),r=a.doc.lineAt(l.to);return[a.doc.sliceString(i.from,r.to),i.from,r.to]}return[a.doc.sliceString(l.from,l.to),l.from,l.to]};j.EditorView.EDIT_CONTEXT=!1;const $e=t=>t.extension instanceof Function?t.extension(t.options):t.extension,No=t=>{const o=$e(t);return t.compartment?t.compartment.of(o):o},ko=t=>{const o=e.inject("tabWidth"),a=e.inject("editorId"),l=e.inject("theme"),i=e.inject("previewTheme"),r=e.inject("language"),s=e.inject("usedLanguageText"),d=e.inject("disabled"),c=e.inject("contentDisabled"),m=e.inject("showToolbarName"),u=e.inject("customIcon"),f=e.inject("noUploadImg"),p=e.inject("tableShape"),g=e.inject("noPrettier"),T=e.inject("codeTheme"),k=e.inject("setting"),R=e.inject("updateSetting"),E=e.inject("catalogVisible"),N=e.inject("defToolbars"),I=e.inject("floatingToolbars"),V=e.inject("rootRef"),$=e.ref(),y=e.shallowRef(),M=e.ref(!1),B=new S.Compartment,C=new S.Compartment,te=new S.Compartment,ie=new S.Compartment,Ve=new S.Compartment,Se=oo(a,{noPrettier:g}),se=()=>[...Se,...P.defaultKeymap,...P.historyKeymap,P.indentWithTab],Y={paste:to(t,y),blur:t.onBlur,focus:t.onFocus,drop:t.onDrop,compositionstart:()=>{M.value=!0},compositionend:(h,L)=>{M.value=!1,t.updateModelValue(L.state.doc.toString())},input:h=>{t.onInput&&t.onInput(h);const{data:L}=h;t.maxlength&&t.modelValue.length+L.length>t.maxlength&&x.bus.emit(a,x.ERROR_CATCHER,{name:"overlength",message:"The input text is too long",data:L})}},Ie=Rt({privide(h){h.provide("editorId",a),h.provide("theme",l),h.provide("previewTheme",i),h.provide("language",r),h.provide("disabled",d),h.provide("contentDisabled",c),h.provide("noUploadImg",f),h.provide("tableShape",p),h.provide("noPrettier",g),h.provide("codeTheme",T),h.provide("showToolbarName",m),h.provide("setting",k),h.provide("updateSetting",R),h.provide("usedLanguageText",s),h.provide("catalogVisible",E),h.provide("defToolbars",N),h.provide("tabWidth",o),h.provide("customIcon",u),h.provide("floatingToolbars",I),h.provide("rootRef",V)}}),je=[{type:"theme",extension:({theme:h})=>h.value==="light"?he:Ne,compartment:B,options:{theme:l}},{type:"updateListener",extension:j.EditorView.updateListener.of(h=>{h.docChanged&&(t.onChange(h.state.doc.toString()),M.value||t.updateModelValue(h.state.doc.toString()))})},{type:"domEventHandlers",extension:j.EditorView.domEventHandlers(Y),compartment:ie},{type:"completions",extension:me(t.completions),compartment:C},{type:"history",extension:P.history(),compartment:te}],ce=n.globalConfig.codeMirrorExtensions([{type:"lineWrapping",extension:j.EditorView.lineWrapping},{type:"keymap",extension:j.keymap.of(se())},{type:"drawSelection",extension:j.drawSelection()},{type:"markdown",extension:Ae.markdown({codeLanguages:Me.languages})},{type:"linkShortener",extension:h=>uo(h),options:{maxLength:30}},{type:"floatingToolbar",extension:I.value.length>0?Ie:[],compartment:Ve}],{editorId:a,theme:l.value,keyBindings:se()}),Ee=()=>[...je,...ce].map(No);return e.onMounted(()=>{const h=new j.EditorView({doc:t.modelValue,parent:$.value,extensions:Ee()}),L=new _e(h);y.value=L,setTimeout(()=>{L.setTabSize(o),L.setDisabled(d.value),L.setReadOnly(t.readonly),t.placeholder&&L.setPlaceholder(t.placeholder),typeof t.maxlength=="number"&&L.setMaxLength(t.maxlength),t.autofocus&&h.focus()},0),x.bus.on(a,{name:x.CTRL_Z,callback(){P.undo(h)}}),x.bus.on(a,{name:x.CTRL_SHIFT_Z,callback(){P.redo(h)}}),x.bus.on(a,{name:x.REPLACE,async callback({direct:H,params:D={},source:_="interaction"}){const Z=()=>c.value&&_!=="programmatic";if(Z())return;const A=async F=>{const{text:O,options:Re}=await mo(H,y.value,F);Z()||y.value?.replaceSelectedText(O,Re,a)};if(H==="image"&&D.transform){const F=t.transformImgUrl(D.url);F instanceof Promise?F.then(O=>A({...D,url:O})).catch(O=>{console.error(O)}):await A({...D,url:F})}else await A(D)}}),x.bus.on(a,{name:x.EVENT_LISTENER,callback:G.throttle(H=>{const D={...Y},_=Object.keys(Y);for(const Z in H){const A=Z;_.includes(A)?D[A]=(F,O)=>{H[A](F,O),F.defaultPrevented||Y[A](F,O)}:D[A]=H[A]}y.value?.view.dispatch({effects:ie.reconfigure(j.EditorView.domEventHandlers(D))})})}),x.bus.on(a,{name:x.TASK_STATE_CHANGED,callback:(H,D)=>{if(c.value)return;const _=h.state.doc.line(H);h.dispatch(h.state.update({changes:{from:_.from,to:_.to,insert:D}}))}}),x.bus.on(a,{name:x.SEND_EDITOR_VIEW,callback(){x.bus.emit(a,x.GET_EDITOR_VIEW,h)}}),x.bus.emit(a,x.GET_EDITOR_VIEW,h)}),e.watch(l,()=>{y.value?.view.dispatch({effects:B.reconfigure(l.value==="light"?he:Ne)})},{deep:!0}),e.watch(()=>t.completions,()=>{y.value?.view.dispatch({effects:C.reconfigure(me(t.completions))})},{deep:!0}),e.watch(()=>t.modelValue,()=>{y.value?.getValue()!==t.modelValue&&y.value?.setValue(t.modelValue)}),e.watch(()=>t.placeholder,()=>{y.value?.setPlaceholder(t.placeholder)}),e.watch([d],()=>{y.value?.setDisabled(d.value)}),e.watch(()=>t.readonly,()=>{y.value?.setReadOnly(t.readonly)}),e.watch(()=>t.maxlength,()=>{t.maxlength&&y.value?.setMaxLength(t.maxlength)}),We(()=>{const h=ce.find(L=>L.type==="floatingToolbar");h?.compartment&&(I.value.length>0?y.value?.view.dispatch({effects:h.compartment.reconfigure($e(h))}):y.value?.view.dispatch({effects:h.compartment.reconfigure([])}))},I),{inputWrapperRef:$,codeMirrorUt:y,resetHistory(){y.value?.view.dispatch({effects:te.reconfigure([])}),y.value?.view.dispatch({effects:te.reconfigure(P.history())})}}},$o=(t,o,a)=>{const l=e.inject("setting"),i=e.computed(()=>/px$/.test(`${t.inputBoxWidth}`)?"50%":t.inputBoxWidth),r=e.reactive({resizedWidth:i.value}),s=e.reactive({width:i.value}),d=e.reactive({insetInlineStart:i.value,display:"initial"}),c=f=>{const p=o.value?.offsetWidth||0,g=o.value?.getBoundingClientRect().x||0;let T=f.x-g;T/p<n.MinInputBoxWidth?T=p*n.MinInputBoxWidth:T>p-p*n.MinInputBoxWidth&&(T=p-p*n.MinInputBoxWidth);const k=`${T/p*100}%`;s.width=k,d.insetInlineStart=k,r.resizedWidth=k,t.onInputBoxWidthChange?.(k)},m=f=>{f.target===a.value&&document.addEventListener("mousemove",c)},u=()=>{document.removeEventListener("mousemove",c)};return e.watch([a],()=>{document.removeEventListener("mousedown",m),document.removeEventListener("mouseup",u),document.addEventListener("mousedown",m),document.addEventListener("mouseup",u)}),e.onMounted(()=>{document.addEventListener("mousedown",m),document.addEventListener("mouseup",u)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",m),document.removeEventListener("mouseup",u)}),e.watch([i],([f])=>{r.resizedWidth=f,s.width=f,d.insetInlineStart=f}),e.watch([()=>l.value.htmlPreview,()=>l.value.preview,()=>l.value.previewOnly],()=>{l.value.previewOnly?(s.width="0%",d.display="none"):!l.value.htmlPreview&&!l.value.preview?(s.width="100%",d.display="none"):(s.width=r.resizedWidth,d.display="initial")},{immediate:!0}),{inputWrapperStyle:s,resizeOperateStyle:d}},Vo=()=>{const t=e.inject("editorId"),o=e.ref(!0),a=G.createSmoothScroll();return{onCatalogActive:(s,d)=>{const c=document.querySelector(`#${t} .${n.prefix}-catalog-editor`);if(!d||!o.value||!c)return;const m=d.offsetTop-c.scrollTop;(m>100||m<100)&&a(c,d.offsetTop-100)},onMouseenter:()=>o.value=!1,onMouseleave:()=>o.value=!0}},ne=e.defineComponent({name:`${n.prefixHump}CustomScrollbar`,props:{id:{type:String,default:void 0},class:{type:[String,Array],default:void 0},scrollTarget:{type:String,default:void 0},alwaysShowTrack:{type:Boolean,default:!1},onMouseenter:{type:Function,default:()=>{}},onMouseleave:{type:Function,default:()=>{}}},setup(t,{slots:o}){const a=e.ref(null),l=e.ref(null),i=e.ref(null),r=e.ref(null);let s=null,d=null,c=!1,m=0,u=0;const f=()=>{if(!l.value||!a.value||!i.value||!r.value)return;const N=a.value.clientHeight,I=l.value.scrollHeight,V=l.value.scrollTop;if(I<=N){i.value.style.display="none",t.alwaysShowTrack||(r.value.style.display="none");return}else i.value.style.display="block",r.value.style.display="block";const $=N/I,y=Math.max(N*$,20),M=N-y,B=Math.min(V*$,M);i.value.style.height=`${y}px`,i.value.style.top=`${B}px`},p=()=>f(),g=N=>{c=!0,m=N.clientY,u=l.value.scrollTop,document.body.style.userSelect="none"},T=N=>{if(!c||!l.value||!a.value)return;const I=N.clientY-m,V=l.value.scrollHeight/a.value.clientHeight;l.value.scrollTop=u+I*V},k=()=>{c=!1,document.body.style.userSelect=""},R=N=>{l.value&&l.value.removeEventListener("scroll",p),l.value=N,l.value?(l.value.addEventListener("scroll",p),f()):r.value&&!t.alwaysShowTrack&&(r.value.style.display="none")},E=()=>{if(!a.value)return;const N=t.scrollTarget?a.value.querySelector(t.scrollTarget):a.value.firstElementChild;R(N)};return e.onMounted(async()=>{await e.nextTick();const N=a.value;N&&(E(),s=new MutationObserver(()=>{d&&cancelAnimationFrame(d),d=requestAnimationFrame(()=>{E()})}),s.observe(N,{childList:!0,subtree:!0}),window.addEventListener("resize",f),i.value?.addEventListener("mousedown",g),document.addEventListener("mousemove",T),document.addEventListener("mouseup",k))}),e.onBeforeUnmount(()=>{s?.disconnect(),l.value&&l.value.removeEventListener("scroll",p),window.removeEventListener("resize",f),i.value?.removeEventListener("mousedown",g),document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",k)}),()=>e.createVNode("div",{id:t.id,class:[`${n.prefix}-custom-scrollbar`,t.class],ref:a,onMouseenter:t.onMouseenter,onMouseleave:t.onMouseleave},[o.default?.(),e.createVNode("div",{class:`${n.prefix}-custom-scrollbar__track`,ref:r},[e.createVNode("div",{class:`${n.prefix}-custom-scrollbar__thumb`,ref:i},null)])])}}),So=G.createSmoothScroll(),Io={flex:1},jo=e.defineComponent({name:"MDEditorContent",props:v.contentProps,setup(t,o){const a=e.inject("editorId"),l=e.inject("catalogVisible"),i=e.inject("theme"),r=e.inject("setting"),s=e.ref(""),d=e.ref(),c=e.ref(),{inputWrapperRef:m,codeMirrorUt:u,resetHistory:f}=ko(t),{inputWrapperStyle:p,resizeOperateStyle:g}=$o(t,d,c);Pe(t,s,u);const{onCatalogActive:T,onMouseenter:k,onMouseleave:R}=Vo(),E=(V,$)=>{if(!r.value.preview&&$.line!==void 0){V.preventDefault();const y=u.value?.view;if(y){const M=y.state.doc.line($.line+1),B=y.lineBlockAt(M.from)?.top,C=y.scrollDOM;So(C,B)}}},N=e.computed(()=>r.value.preview?"preview":"editor"),I=V=>{s.value=V,t.onHtmlChanged(V)};return o.expose({getSelectedText(){return u.value?.getSelectedText()},focus(V){u.value?.focus(V)},resetHistory:f,getEditorView(){return u.value?.view}}),()=>e.createVNode("div",{class:`${n.prefix}-content`},[e.createVNode("div",{class:`${n.prefix}-content-wrapper`,ref:d},[e.createVNode(ne,{alwaysShowTrack:!0,scrollTarget:`#${a} .cm-scroller`,style:p},{default:()=>[e.createVNode("div",{class:`${n.prefix}-input-wrapper`,ref:m},null)]}),(r.value.htmlPreview||r.value.preview)&&e.createVNode("div",{class:`${n.prefix}-resize-operate`,style:g,ref:c},null),e.createVNode(ne,{style:Io},{default:()=>[e.createVNode(v.ContentPreview,{modelValue:t.modelValue,onChange:t.onChange,onHtmlChanged:I,onGetCatalog:t.onGetCatalog,mdHeadingId:t.mdHeadingId,noMermaid:t.noMermaid,sanitize:t.sanitize,noKatex:t.noKatex,formatCopiedText:t.formatCopiedText,noHighlight:t.noHighlight,noImgZoomIn:t.noImgZoomIn,sanitizeMermaid:t.sanitizeMermaid,codeFoldable:t.codeFoldable,autoFoldThreshold:t.autoFoldThreshold,onRemount:t.onRemount,previewComponent:t.previewComponent,noEcharts:t.noEcharts},null)]})]),l.value&&e.createVNode(ne,{class:`${n.prefix}-catalog-${t.catalogLayout}`,onMouseenter:k,onMouseleave:R},{default:()=>[e.createVNode(Q.MdCatalog,{theme:i.value,class:`${n.prefix}-catalog-editor`,editorId:a,mdHeadingId:t.mdHeadingId,key:"internal-catalog",scrollElementOffsetTop:2,syncWith:N.value,onClick:E,catalogMaxDepth:t.catalogMaxDepth,onActive:T},null)]})])}}),Eo=e.defineComponent({props:{modelValue:{type:String,default:""}},setup(t){const o=e.inject("usedLanguageText");return()=>e.createVNode("div",{class:`${n.prefix}-footer-item`},[e.createVNode("label",{class:`${n.prefix}-footer-label`},[`${o.value.footer?.markdownTotal}:`]),e.createVNode("span",null,[t.modelValue?.length||0])])}}),Ro={checked:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},disabled:{type:Boolean,default:void 0}},Lo=e.defineComponent({name:`${n.prefix}-checkbox`,props:Ro,setup(t){return()=>e.createVNode("div",{class:[`${n.prefix}-checkbox`,t.checked&&`${n.prefix}-checkbox-checked`,t.disabled&&`${n.prefix}-disabled`],onClick:()=>{t.disabled||t.onChange(!t.checked)}},null)}}),Do={scrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}}},Ao=e.defineComponent({props:Do,setup(t){const o=e.inject("usedLanguageText"),a=e.inject("disabled");return()=>e.createVNode("div",{class:[`${n.prefix}-footer-item`,a?.value&&`${n.prefix}-disabled`]},[e.createVNode("label",{class:`${n.prefix}-footer-label`,onClick:()=>{a?.value||t.onScrollAutoChange(!t.scrollAuto)}},[o?.value.footer?.scrollAuto]),e.createVNode(Lo,{checked:t.scrollAuto,onChange:t.onScrollAutoChange,disabled:a?.value},null)])}}),Mo={modelValue:{type:String,default:""},footers:{type:Array,default:[]},scrollAuto:{type:Boolean},noScrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}},defFooters:{type:Object}},Fo=e.defineComponent({name:"MDEditorFooter",props:Mo,setup(t){const o=e.inject("theme"),a=e.inject("language"),l=e.inject("disabled"),i=e.computed(()=>{const s=t.footers.indexOf("="),d=s===-1?t.footers:t.footers.slice(0,s),c=s===-1?[]:t.footers.slice(s,Number.MAX_SAFE_INTEGER);return[d,c]}),r=s=>{if(n.allFooter.includes(s))switch(s){case"markdownTotal":return e.createVNode(Eo,{modelValue:t.modelValue},null);case"scrollSwitch":return!t.noScrollAuto&&e.createVNode(Ao,{scrollAuto:t.scrollAuto,onScrollAutoChange:t.onScrollAutoChange},null)}else if(t.defFooters instanceof Array){const d=t.defFooters[s];return d?e.cloneVNode(d,{theme:d.props?.theme||o.value,language:d.props?.language||a.value,disabled:d.props?.disabled||l?.value}):""}else if(t.defFooters&&t.defFooters.children instanceof Array){const d=t.defFooters.children[s];return d?e.cloneVNode(d,{theme:d.props?.theme||o.value,language:d.props?.language||a.value,disabled:d.props?.disabled||l?.value}):""}else return""};return()=>{const s=i.value[0].map(c=>r(c)),d=i.value[1].map(c=>r(c));return e.createVNode("div",{class:`${n.prefix}-footer`},[e.createVNode("div",{class:`${n.prefix}-footer-left`},[s]),e.createVNode("div",{class:`${n.prefix}-footer-right`},[d])])}}}),Bo={toolbars:{type:Array,default:()=>[]},toolbarsExclude:{type:Array,default:()=>[]}},Ho=e.defineComponent({name:"MDEditorToolbar",props:Bo,setup(t){const o=e.inject("editorId"),a=e.inject("showToolbarName"),l=`${o}-toolbar-wrapper`,i=e.ref(),r=e.ref(),{barRender:s}=ke(),d=e.computed(()=>{const c=t.toolbars.filter(p=>!t.toolbarsExclude.includes(p)),m=c.indexOf("="),u=m===-1?c:c.slice(0,m+1),f=m===-1?[]:c.slice(m,Number.MAX_SAFE_INTEGER);return[u,f]});return e.watch(()=>t.toolbars,()=>{e.nextTick(()=>{i.value&&G.draggingScroll(i.value)})},{immediate:!0}),()=>{const c=d.value[0].map(u=>s(u)),m=d.value[1].map(u=>s(u));return e.createVNode(e.Fragment,null,[t.toolbars.length>0&&e.createVNode("div",{class:`${n.prefix}-toolbar-wrapper`,ref:i,id:l},[e.createVNode("div",{class:[`${n.prefix}-toolbar`,a.value&&`${n.prefix}-stn`]},[e.createVNode("div",{class:`${n.prefix}-toolbar-left`,ref:r},[c]),e.createVNode("div",{class:`${n.prefix}-toolbar-right`},[m])])])])}}}),J=e.defineComponent({name:"MdEditorV3",props:v.editorProps,emits:v.editorEmits,setup(t,o){const{noKatex:a,noMermaid:l,noHighlight:i}=t,r=e.reactive({scrollAuto:t.scrollAuto}),s=e.ref(),d=e.ref(),c=e.computed(()=>de.getSlot({props:t,ctx:o},"defToolbars")),m=e.computed(()=>de.getSlot({props:t,ctx:o},"defFooters")),u=v.useEditorId(t),[f,p]=v.useConfig(t,o,{editorId:u}),g=v.useCatalog(t,{editorId:u});v.useOnSave(t,o,{editorId:u}),v.useExpansion(t),v.useErrorCatcher(t,o,{editorId:u}),v.useExpose(t,o,{editorId:u,catalogVisible:g,setting:f,updateSetting:p,codeRef:d}),v.useProvide(t,{rootRef:s,editorId:u,setting:f,updateSetting:p,catalogVisible:g,defToolbars:c}),e.onBeforeUnmount(()=>{x.bus.clear(u)});const T=C=>{o.emit("update:modelValue",C)},k=C=>{t.onChange?.(C),o.emit("onChange",C)},R=C=>{t.onHtmlChanged?.(C),o.emit("onHtmlChanged",C)},E=C=>{t.onGetCatalog?.(C),o.emit("onGetCatalog",C)},N=C=>{t.onBlur?.(C),o.emit("onBlur",C)},I=C=>{t.onFocus?.(C),o.emit("onFocus",C)},V=C=>{t.onInput?.(C),o.emit("onInput",C)},$=C=>{t.onDrop?.(C),o.emit("onDrop",C)},y=C=>{t.onInputBoxWidthChange?.(C),o.emit("onInputBoxWidthChange",C)},M=()=>{t.onRemount?.(),o.emit("onRemount")},B=C=>{r.scrollAuto=C};return()=>e.createVNode("div",{id:u,class:[n.prefix,t.class,f.fullscreen||f.pageFullscreen?`${n.prefix}-fullscreen`:""],"data-theme":t.theme,style:t.style,ref:s},[t.toolbars.length>0&&e.createVNode(Ho,{toolbars:t.toolbars,toolbarsExclude:t.toolbarsExclude},null),e.createVNode(jo,{ref:d,modelValue:t.modelValue,mdHeadingId:t.mdHeadingId,noMermaid:l,sanitize:t.sanitize,placeholder:t.placeholder,noKatex:a,scrollAuto:r.scrollAuto,formatCopiedText:t.formatCopiedText,autofocus:t.autoFocus,readonly:t.readOnly,maxlength:t.maxLength,autoDetectCode:t.autoDetectCode,noHighlight:i,updateModelValue:T,onChange:k,onHtmlChanged:R,onGetCatalog:E,onBlur:N,onFocus:I,onInput:V,completions:t.completions,noImgZoomIn:t.noImgZoomIn,onDrop:$,inputBoxWidth:t.inputBoxWidth,onInputBoxWidthChange:y,sanitizeMermaid:t.sanitizeMermaid,transformImgUrl:t.transformImgUrl,codeFoldable:t.codeFoldable,autoFoldThreshold:t.autoFoldThreshold,onRemount:M,catalogLayout:t.catalogLayout,catalogMaxDepth:t.catalogMaxDepth,noEcharts:t.noEcharts,previewComponent:t.previewComponent},null),t.footers.length>0&&e.createVNode(Fo,{modelValue:t.modelValue,footers:t.footers,defFooters:m.value,noScrollAuto:!f.preview&&!f.htmlPreview||f.previewOnly,scrollAuto:r.scrollAuto,onScrollAutoChange:B},null)])}});J.install=t=>(t.component(J.name,J),t.use(De).use(W.DropdownToolbar).use(Le).use(Q.MdCatalog).use(v.MdPreview),t);module.exports=J;
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
"use strict";const o=require("@vavt/util"),a="md-editor",l="MdEditor",s="https://unpkg.com",c=`${s}/@highlightjs/cdn-assets@11.11.1/highlight.min.js`,i={main:`${s}/prettier@3.8.1/standalone.js`,markdown:`${s}/prettier@3.8.1/plugins/markdown.js`},g={css:`${s}/cropperjs@1.6.2/dist/cropper.min.css`,js:`${s}/cropperjs@1.6.2/dist/cropper.min.js`},d=`${s}/screenfull@5.2.0/dist/screenfull.js`,h=`${s}/mermaid@11.12.3/dist/mermaid.min.js`,m={js:`${s}/katex@0.16.33/dist/katex.min.js`,css:`${s}/katex@0.16.33/dist/katex.min.css`},t={a11y:{light:`${s}/@highlightjs/cdn-assets@11.11.1/styles/a11y-light.min.css`,dark:`${s}/@highlightjs/cdn-assets@11.11.1/styles/a11y-dark.min.css`},atom:{light:`${s}/@highlightjs/cdn-assets@11.11.1/styles/atom-one-light.min.css`,dark:`${s}/@highlightjs/cdn-assets@11.11.1/styles/atom-one-dark.min.css`},github:{light:`${s}/@highlightjs/cdn-assets@11.11.1/styles/github.min.css`,dark:`${s}/@highlightjs/cdn-assets@11.11.1/styles/github-dark.min.css`},gradient:{light:`${s}/@highlightjs/cdn-assets@11.11.1/styles/gradient-light.min.css`,dark:`${s}/@highlightjs/cdn-assets@11.11.1/styles/gradient-dark.min.css`},kimbie:{light:`${s}/@highlightjs/cdn-assets@11.11.1/styles/kimbie-light.min.css`,dark:`${s}/@highlightjs/cdn-assets@11.11.1/styles/kimbie-dark.min.css`},paraiso:{light:`${s}/@highlightjs/cdn-assets@11.11.1/styles/paraiso-light.min.css`,dark:`${s}/@highlightjs/cdn-assets@11.11.1/styles/paraiso-dark.min.css`},qtcreator:{light:`${s}/@highlightjs/cdn-assets@11.11.1/styles/qtcreator-light.min.css`,dark:`${s}/@highlightjs/cdn-assets@11.11.1/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${s}/@highlightjs/cdn-assets@11.11.1/styles/stackoverflow-light.min.css`,dark:`${s}/@highlightjs/cdn-assets@11.11.1/styles/stackoverflow-dark.min.css`}},u=`${s}/echarts@6.0.0/dist/echarts.min.js`,p={highlight:{js:{integrity:"sha384-RH2xi4eIQ/gjtbs9fUXM68sLSi99C7ZWBRX1vDrVv6GQXRibxXLbwO2NGZB74MbU",crossOrigin:"anonymous"},css:{a11y:{light:{integrity:"sha384-qdZDAN3jffvh670RHw1wxLekabidEFaNRninYgIzBvMbL6WlHdXeHS/Bt+vx33lN",crossOrigin:"anonymous"},dark:{integrity:"sha384-2QAAjX8pqaM5azX68KWI2wExF6Q13kY4kEiQFY4b/1zPe6rpgmTByNpDEllH3sb+",crossOrigin:"anonymous"}},atom:{light:{integrity:"sha384-w6Ujm1VWa9HYFqGc89oAPn/DWDi2gUamjNrq9DRvEYm2X3ClItg9Y9xs1ViVo5b5",crossOrigin:"anonymous"},dark:{integrity:"sha384-oaMLBGEzBOJx3UHwac0cVndtX5fxGQIfnAeFZ35RTgqPcYlbprH9o9PUV/F8Le07",crossOrigin:"anonymous"}},github:{light:{integrity:"sha384-eFTL69TLRZTkNfYZOLM+G04821K1qZao/4QLJbet1pP4tcF+fdXq/9CdqAbWRl/L",crossOrigin:"anonymous"},dark:{integrity:"sha384-wH75j6z1lH97ZOpMOInqhgKzFkAInZPPSPlZpYKYTOqsaizPvhQZmAtLcPKXpLyH",crossOrigin:"anonymous"}},gradient:{light:{integrity:"sha384-yErHBR8aEZPxRl3XmR8dGSRAclMlnSRRw8sXQLcmPWzWUvb56BzQmBw3EWHl7QGI",crossOrigin:"anonymous"},dark:{integrity:"sha384-lUCvtSOdvDbp5hLWKgwz/taFu1HxlpqES2OVP5UG2JMTfnU481gXcBhGF9lAGoSr",crossOrigin:"anonymous"}},kimbie:{light:{integrity:"sha384-tloeSLUPczAvoZ48TUz+OxRie0oYLCRwlkadUXovGzzJEIbNQB2TkfUuvJ6SW5Mi",crossOrigin:"anonymous"},dark:{integrity:"sha384-o5F1vUaMNOmou1sQrsWiFo4/QUGSV0svqNZW+EesmKxWC8MpFJcveBhAyfvTHbGb",crossOrigin:"anonymous"}},paraiso:{light:{integrity:"sha384-5j6QHU2Hwg1ehtlIQNDebhETDB8bga3/88hzBFsMRaGmgQHCftqIN7GZNDNw0vTL",crossOrigin:"anonymous"},dark:{integrity:"sha384-I5vnnMQu0LWDQnHpT61xyoMwKarAB8jpZkB2ioFOlmzUFnIFaV4QbUwlBBOMKhTH",crossOrigin:"anonymous"}},qtcreator:{light:{integrity:"sha384-iEBgHrwi8Hv4dSZBz+MOGvS05rF7I7fGKM2fASQyE9jn2Istg9Qd5dSoK18WyRTB",crossOrigin:"anonymous"},dark:{integrity:"sha384-D6LXJGWNR4QV7gnpuP3ccbvOYoR02td3cU0y7lESABPg/tzCSC4m+y+M2TtrmpHc",crossOrigin:"anonymous"}},stackoverflow:{light:{integrity:"sha384-FMwt7cTGo4aLxZnno5k0xTj0W4gmi48Kwept+y/oQmE6cFk36Kr+QJZOKNOQwORe",crossOrigin:"anonymous"},dark:{integrity:"sha384-iL+x+BroCyHm/p2c6sMA9umXhdCWp2cKe4QUjPeMzHgwXAk+ZxHyIGP3NZTZensU",crossOrigin:"anonymous"}}}},prettier:{standaloneJs:{integrity:"sha384-Q+dEbdxfNurK4ryC0T77wU8G3EYhxdAierqqKOppGHnJ4e/85wVnMXDNWbaYYghP",crossOrigin:"anonymous"},parserMarkdownJs:{integrity:"sha384-UGdkYlLyq47VQhe9mHyNzuPhBTL9GA9YO5Vb0sXf2fnMYGuSMGAbZ8upsQj1+u4O",crossOrigin:"anonymous"}},cropper:{js:{integrity:"sha384-jrOgQzBlDeUNdmQn3rUt/PZD+pdcRBdWd/HWRqRo+n2OR2QtGyjSaJC0GiCeH+ir",crossOrigin:"anonymous"},css:{integrity:"sha384-6LFfkTKLRlzFtgx8xsWyBdKGpcMMQTkv+dB7rAbugeJAu1Ym2q1Aji1cjHBG12Xh",crossOrigin:"anonymous"}},screenfull:{js:{integrity:"sha384-Qfbv8upMDu/ikv42M0Jnym2hahbDQ77Nm8PGU0G+iA6UIwt1+scE6P1qKXA0anWU",crossOrigin:"anonymous"}},mermaid:{js:{integrity:"sha384-jFhLSLFn4m565eRAS0CDMWubMqOtfZWWbE8kqgGdU+VHbJ3B2G/4X8u+0BM8MtdU",crossOrigin:"anonymous"}},katex:{js:{integrity:"sha384-YPHNAPyrxGS8BNnA7Q4ommqra8WQPEjooVSLzFgwgs8OXJBvadbyvx4QpfiFurGr",crossOrigin:"anonymous"},css:{integrity:"sha384-fgYS3VC1089n2J3rVcEbXDHlnDLQ9B2Y1hvpQ720q1NvxCduQqT4JoGc4u2QCnzE",crossOrigin:"anonymous"}},echarts:{js:{integrity:"sha384-F07Cpw5v8spSU0H113F33m2NQQ/o6GqPTnTjf45ssG4Q6q58ZwhxBiQtIaqvnSpR",crossOrigin:"anonymous"}}},y=["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","previewOnly","htmlPreview","catalog","github"],k=["markdownTotal","=","scrollSwitch"],b={"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:"预览",previewOnly:"仅预览",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",previewOnly:"preview only",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 Image Link",upload:"Upload Images",clip2upload:"Crop And 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:"Character Count",scrollAuto:"Scroll Auto"}}},r={editorExtensions:{highlight:{js:c,css:t},prettier:{standaloneJs:i.main,parserMarkdownJs:i.markdown},cropper:{...g},screenfull:{js:d},mermaid:{js:h,enableZoom:!0},katex:{...m},echarts:{js:u,parseOption:e=>new Function(`return ${e}`)()}},editorExtensionsAttrs:{},editorConfig:{languageUserDefined:{},mermaidTemplate:{},renderDelay:500,zIndex:2e4},codeMirrorExtensions:e=>e,markdownItConfig:()=>{},markdownItPlugins:e=>e,mermaidConfig:e=>e,katexConfig:e=>e,echartsConfig:e=>e},v=e=>o.deepMerge(r,e,{excludeKeys(n){return/[iI]{1}nstance/.test(n)}}),f=.1;exports.MinInputBoxWidth=f;exports.allFooter=k;exports.allToolbar=y;exports.codeCss=t;exports.config=v;exports.editorExtensionsAttrs=p;exports.globalConfig=r;exports.prefix=a;exports.prefixHump=l;exports.staticTextDefault=b;
|
|
1
|
+
"use strict";const tu=require("@vavt/util");var ru=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,iu=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,nu=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Q={Space_Separator:ru,ID_Start:iu,ID_Continue:nu},c={isSpaceSeparator(D){return typeof D=="string"&&Q.Space_Separator.test(D)},isIdStartChar(D){return typeof D=="string"&&(D>="a"&&D<="z"||D>="A"&&D<="Z"||D==="$"||D==="_"||Q.ID_Start.test(D))},isIdContinueChar(D){return typeof D=="string"&&(D>="a"&&D<="z"||D>="A"&&D<="Z"||D>="0"&&D<="9"||D==="$"||D==="_"||D===""||D===""||Q.ID_Continue.test(D))},isDigit(D){return typeof D=="string"&&/[0-9]/.test(D)},isHexDigit(D){return typeof D=="string"&&/[0-9A-Fa-f]/.test(D)}};let q,m,w,H,x,y,d,G,P;var su=function(i,F){q=String(i),m="start",w=[],H=0,x=1,y=0,d=void 0,G=void 0,P=void 0;do d=Fu(),Au[m]();while(d.type!=="eof");return typeof F=="function"?J({"":P},"",F):P};function J(D,i,F){const a=D[i];if(a!=null&&typeof a=="object")if(Array.isArray(a))for(let p=0;p<a.length;p++){const B=String(p),v=J(a,B,F);v===void 0?delete a[B]:Object.defineProperty(a,B,{value:v,writable:!0,enumerable:!0,configurable:!0})}else for(const p in a){const B=J(a,p,F);B===void 0?delete a[p]:Object.defineProperty(a,p,{value:B,writable:!0,enumerable:!0,configurable:!0})}return F.call(D,i,a)}let r,e,N,b,n;function Fu(){for(r="default",e="",N=!1,b=1;;){n=k();const D=Z[r]();if(D)return D}}function k(){if(q[H])return String.fromCodePoint(q.codePointAt(H))}function u(){const D=k();return D===`
|
|
2
|
+
`?(x++,y=0):D?y+=D.length:y++,D&&(H+=D.length),D}const Z={default(){switch(n){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
3
|
+
`:case"\r":case"\u2028":case"\u2029":u();return;case"/":u(),r="comment";return;case void 0:return u(),A("eof")}if(c.isSpaceSeparator(n)){u();return}return Z[m]()},comment(){switch(n){case"*":u(),r="multiLineComment";return;case"/":u(),r="singleLineComment";return}throw o(u())},multiLineComment(){switch(n){case"*":u(),r="multiLineCommentAsterisk";return;case void 0:throw o(u())}u()},multiLineCommentAsterisk(){switch(n){case"*":u();return;case"/":u(),r="default";return;case void 0:throw o(u())}u(),r="multiLineComment"},singleLineComment(){switch(n){case`
|
|
4
|
+
`:case"\r":case"\u2028":case"\u2029":u(),r="default";return;case void 0:return u(),A("eof")}u()},value(){switch(n){case"{":case"[":return A("punctuator",u());case"n":return u(),O("ull"),A("null",null);case"t":return u(),O("rue"),A("boolean",!0);case"f":return u(),O("alse"),A("boolean",!1);case"-":case"+":u()==="-"&&(b=-1),r="sign";return;case".":e=u(),r="decimalPointLeading";return;case"0":e=u(),r="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":e=u(),r="decimalInteger";return;case"I":return u(),O("nfinity"),A("numeric",1/0);case"N":return u(),O("aN"),A("numeric",NaN);case'"':case"'":N=u()==='"',e="",r="string";return}throw o(u())},identifierNameStartEscape(){if(n!=="u")throw o(u());u();const D=W();switch(D){case"$":case"_":break;default:if(!c.isIdStartChar(D))throw V();break}e+=D,r="identifierName"},identifierName(){switch(n){case"$":case"_":case"":case"":e+=u();return;case"\\":u(),r="identifierNameEscape";return}if(c.isIdContinueChar(n)){e+=u();return}return A("identifier",e)},identifierNameEscape(){if(n!=="u")throw o(u());u();const D=W();switch(D){case"$":case"_":case"":case"":break;default:if(!c.isIdContinueChar(D))throw V();break}e+=D,r="identifierName"},sign(){switch(n){case".":e=u(),r="decimalPointLeading";return;case"0":e=u(),r="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":e=u(),r="decimalInteger";return;case"I":return u(),O("nfinity"),A("numeric",b*(1/0));case"N":return u(),O("aN"),A("numeric",NaN)}throw o(u())},zero(){switch(n){case".":e+=u(),r="decimalPoint";return;case"e":case"E":e+=u(),r="decimalExponent";return;case"x":case"X":e+=u(),r="hexadecimal";return}return A("numeric",b*0)},decimalInteger(){switch(n){case".":e+=u(),r="decimalPoint";return;case"e":case"E":e+=u(),r="decimalExponent";return}if(c.isDigit(n)){e+=u();return}return A("numeric",b*Number(e))},decimalPointLeading(){if(c.isDigit(n)){e+=u(),r="decimalFraction";return}throw o(u())},decimalPoint(){switch(n){case"e":case"E":e+=u(),r="decimalExponent";return}if(c.isDigit(n)){e+=u(),r="decimalFraction";return}return A("numeric",b*Number(e))},decimalFraction(){switch(n){case"e":case"E":e+=u(),r="decimalExponent";return}if(c.isDigit(n)){e+=u();return}return A("numeric",b*Number(e))},decimalExponent(){switch(n){case"+":case"-":e+=u(),r="decimalExponentSign";return}if(c.isDigit(n)){e+=u(),r="decimalExponentInteger";return}throw o(u())},decimalExponentSign(){if(c.isDigit(n)){e+=u(),r="decimalExponentInteger";return}throw o(u())},decimalExponentInteger(){if(c.isDigit(n)){e+=u();return}return A("numeric",b*Number(e))},hexadecimal(){if(c.isHexDigit(n)){e+=u(),r="hexadecimalInteger";return}throw o(u())},hexadecimalInteger(){if(c.isHexDigit(n)){e+=u();return}return A("numeric",b*Number(e))},string(){switch(n){case"\\":u(),e+=au();return;case'"':if(N)return u(),A("string",e);e+=u();return;case"'":if(!N)return u(),A("string",e);e+=u();return;case`
|
|
5
|
+
`:case"\r":throw o(u());case"\u2028":case"\u2029":ou(n);break;case void 0:throw o(u())}e+=u()},start(){switch(n){case"{":case"[":return A("punctuator",u())}r="value"},beforePropertyName(){switch(n){case"$":case"_":e=u(),r="identifierName";return;case"\\":u(),r="identifierNameStartEscape";return;case"}":return A("punctuator",u());case'"':case"'":N=u()==='"',r="string";return}if(c.isIdStartChar(n)){e+=u(),r="identifierName";return}throw o(u())},afterPropertyName(){if(n===":")return A("punctuator",u());throw o(u())},beforePropertyValue(){r="value"},afterPropertyValue(){switch(n){case",":case"}":return A("punctuator",u())}throw o(u())},beforeArrayValue(){if(n==="]")return A("punctuator",u());r="value"},afterArrayValue(){switch(n){case",":case"]":return A("punctuator",u())}throw o(u())},end(){throw o(u())}};function A(D,i){return{type:D,value:i,line:x,column:y}}function O(D){for(const i of D){if(k()!==i)throw o(u());u()}}function au(){switch(k()){case"b":return u(),"\b";case"f":return u(),"\f";case"n":return u(),`
|
|
6
|
+
`;case"r":return u(),"\r";case"t":return u()," ";case"v":return u(),"\v";case"0":if(u(),c.isDigit(k()))throw o(u());return"\0";case"x":return u(),Cu();case"u":return u(),W();case`
|
|
7
|
+
`:case"\u2028":case"\u2029":return u(),"";case"\r":return u(),k()===`
|
|
8
|
+
`&&u(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw o(u());case void 0:throw o(u())}return u()}function Cu(){let D="",i=k();if(!c.isHexDigit(i)||(D+=u(),i=k(),!c.isHexDigit(i)))throw o(u());return D+=u(),String.fromCodePoint(parseInt(D,16))}function W(){let D="",i=4;for(;i-- >0;){const F=k();if(!c.isHexDigit(F))throw o(u());D+=u()}return String.fromCodePoint(parseInt(D,16))}const Au={start(){if(d.type==="eof")throw j();z()},beforePropertyName(){switch(d.type){case"identifier":case"string":G=d.value,m="afterPropertyName";return;case"punctuator":L();return;case"eof":throw j()}},afterPropertyName(){if(d.type==="eof")throw j();m="beforePropertyValue"},beforePropertyValue(){if(d.type==="eof")throw j();z()},beforeArrayValue(){if(d.type==="eof")throw j();if(d.type==="punctuator"&&d.value==="]"){L();return}z()},afterPropertyValue(){if(d.type==="eof")throw j();switch(d.value){case",":m="beforePropertyName";return;case"}":L()}},afterArrayValue(){if(d.type==="eof")throw j();switch(d.value){case",":m="beforeArrayValue";return;case"]":L()}},end(){}};function z(){let D;switch(d.type){case"punctuator":switch(d.value){case"{":D={};break;case"[":D=[];break}break;case"null":case"boolean":case"numeric":case"string":D=d.value;break}if(P===void 0)P=D;else{const i=w[w.length-1];Array.isArray(i)?i.push(D):Object.defineProperty(i,G,{value:D,writable:!0,enumerable:!0,configurable:!0})}if(D!==null&&typeof D=="object")w.push(D),Array.isArray(D)?m="beforeArrayValue":m="beforePropertyName";else{const i=w[w.length-1];i==null?m="end":Array.isArray(i)?m="afterArrayValue":m="afterPropertyValue"}}function L(){w.pop();const D=w[w.length-1];D==null?m="end":Array.isArray(D)?m="afterArrayValue":m="afterPropertyValue"}function o(D){return U(D===void 0?`JSON5: invalid end of input at ${x}:${y}`:`JSON5: invalid character '${X(D)}' at ${x}:${y}`)}function j(){return U(`JSON5: invalid end of input at ${x}:${y}`)}function V(){return y-=5,U(`JSON5: invalid identifier character at ${x}:${y}`)}function ou(D){console.warn(`JSON5: '${X(D)}' in strings is not valid ECMAScript; consider escaping`)}function X(D){const i={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(i[D])return i[D];if(D<" "){const F=D.charCodeAt(0).toString(16);return"\\x"+("00"+F).substring(F.length)}return D}function U(D){const i=new SyntaxError(D);return i.lineNumber=x,i.columnNumber=y,i}var Eu=function(i,F,a){const p=[];let B="",v,$,S="",K;if(F!=null&&typeof F=="object"&&!Array.isArray(F)&&(a=F.space,K=F.quote,F=F.replacer),typeof F=="function")$=F;else if(Array.isArray(F)){v=[];for(const s of F){let E;typeof s=="string"?E=s:(typeof s=="number"||s instanceof String||s instanceof Number)&&(E=String(s)),E!==void 0&&v.indexOf(E)<0&&v.push(E)}}return a instanceof Number?a=Number(a):a instanceof String&&(a=String(a)),typeof a=="number"?a>0&&(a=Math.min(10,Math.floor(a)),S=" ".substr(0,a)):typeof a=="string"&&(S=a.substr(0,10)),M("",{"":i});function M(s,E){let t=E[s];switch(t!=null&&(typeof t.toJSON5=="function"?t=t.toJSON5(s):typeof t.toJSON=="function"&&(t=t.toJSON(s))),$&&(t=$.call(E,s,t)),t instanceof Number?t=Number(t):t instanceof String?t=String(t):t instanceof Boolean&&(t=t.valueOf()),t){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof t=="string")return T(t);if(typeof t=="number")return String(t);if(typeof t=="object")return Array.isArray(t)?eu(t):uu(t)}function T(s){const E={"'":.1,'"':.2},t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let f="";for(let l=0;l<s.length;l++){const h=s[l];switch(h){case"'":case'"':E[h]++,f+=h;continue;case"\0":if(c.isDigit(s[l+1])){f+="\\x00";continue}}if(t[h]){f+=t[h];continue}if(h<" "){let I=h.charCodeAt(0).toString(16);f+="\\x"+("00"+I).substring(I.length);continue}f+=h}const g=K||Object.keys(E).reduce((l,h)=>E[l]<E[h]?l:h);return f=f.replace(new RegExp(g,"g"),t[g]),g+f+g}function uu(s){if(p.indexOf(s)>=0)throw TypeError("Converting circular structure to JSON5");p.push(s);let E=B;B=B+S;let t=v||Object.keys(s),f=[];for(const l of t){const h=M(l,s);if(h!==void 0){let I=Du(l)+":";S!==""&&(I+=" "),I+=h,f.push(I)}}let g;if(f.length===0)g="{}";else{let l;if(S==="")l=f.join(","),g="{"+l+"}";else{let h=`,
|
|
9
|
+
`+B;l=f.join(h),g=`{
|
|
10
|
+
`+B+l+`,
|
|
11
|
+
`+E+"}"}}return p.pop(),B=E,g}function Du(s){if(s.length===0)return T(s);const E=String.fromCodePoint(s.codePointAt(0));if(!c.isIdStartChar(E))return T(s);for(let t=E.length;t<s.length;t++)if(!c.isIdContinueChar(String.fromCodePoint(s.codePointAt(t))))return T(s);return s}function eu(s){if(p.indexOf(s)>=0)throw TypeError("Converting circular structure to JSON5");p.push(s);let E=B;B=B+S;let t=[];for(let g=0;g<s.length;g++){const l=M(String(g),s);t.push(l!==void 0?l:"null")}let f;if(t.length===0)f="[]";else if(S==="")f="["+t.join(",")+"]";else{let g=`,
|
|
12
|
+
`+B,l=t.join(g);f=`[
|
|
13
|
+
`+B+l+`,
|
|
14
|
+
`+E+"]"}return p.pop(),B=E,f}};const cu={parse:su,stringify:Eu};var lu=cu;const Bu="md-editor",fu="MdEditor",C="https://unpkg.com",du=`${C}/@highlightjs/cdn-assets@11.12.0/highlight.min.js`,R={main:`${C}/prettier@3.9.6/standalone.js`,markdown:`${C}/prettier@3.9.6/plugins/markdown.js`},gu={css:`${C}/cropperjs@1.6.3/dist/cropper.min.css`,js:`${C}/cropperjs@1.6.3/dist/cropper.min.js`},hu=`${C}/screenfull@5.2.0/dist/screenfull.js`,mu=`${C}/mermaid@11.17.2/dist/mermaid.min.js`,pu={js:`${C}/katex@0.18.5/dist/katex.min.js`,css:`${C}/katex@0.18.5/dist/katex.min.css`},Y={a11y:{light:`${C}/@highlightjs/cdn-assets@11.12.0/styles/a11y-light.min.css`,dark:`${C}/@highlightjs/cdn-assets@11.12.0/styles/a11y-dark.min.css`},atom:{light:`${C}/@highlightjs/cdn-assets@11.12.0/styles/atom-one-light.min.css`,dark:`${C}/@highlightjs/cdn-assets@11.12.0/styles/atom-one-dark.min.css`},github:{light:`${C}/@highlightjs/cdn-assets@11.12.0/styles/github.min.css`,dark:`${C}/@highlightjs/cdn-assets@11.12.0/styles/github-dark.min.css`},gradient:{light:`${C}/@highlightjs/cdn-assets@11.12.0/styles/gradient-light.min.css`,dark:`${C}/@highlightjs/cdn-assets@11.12.0/styles/gradient-dark.min.css`},kimbie:{light:`${C}/@highlightjs/cdn-assets@11.12.0/styles/kimbie-light.min.css`,dark:`${C}/@highlightjs/cdn-assets@11.12.0/styles/kimbie-dark.min.css`},paraiso:{light:`${C}/@highlightjs/cdn-assets@11.12.0/styles/paraiso-light.min.css`,dark:`${C}/@highlightjs/cdn-assets@11.12.0/styles/paraiso-dark.min.css`},qtcreator:{light:`${C}/@highlightjs/cdn-assets@11.12.0/styles/qtcreator-light.min.css`,dark:`${C}/@highlightjs/cdn-assets@11.12.0/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${C}/@highlightjs/cdn-assets@11.12.0/styles/stackoverflow-light.min.css`,dark:`${C}/@highlightjs/cdn-assets@11.12.0/styles/stackoverflow-dark.min.css`}},yu=`${C}/echarts@6.1.0/dist/echarts.min.js`,bu={highlight:{js:{integrity:"sha384-wjfDDhOPPdjtva8vWBhWeVprSpmxisEu5aYT3q1JyACqXpdKpo3PWZTMVq24MBix",crossOrigin:"anonymous"},css:{a11y:{light:{integrity:"sha384-qdZDAN3jffvh670RHw1wxLekabidEFaNRninYgIzBvMbL6WlHdXeHS/Bt+vx33lN",crossOrigin:"anonymous"},dark:{integrity:"sha384-2QAAjX8pqaM5azX68KWI2wExF6Q13kY4kEiQFY4b/1zPe6rpgmTByNpDEllH3sb+",crossOrigin:"anonymous"}},atom:{light:{integrity:"sha384-w6Ujm1VWa9HYFqGc89oAPn/DWDi2gUamjNrq9DRvEYm2X3ClItg9Y9xs1ViVo5b5",crossOrigin:"anonymous"},dark:{integrity:"sha384-oaMLBGEzBOJx3UHwac0cVndtX5fxGQIfnAeFZ35RTgqPcYlbprH9o9PUV/F8Le07",crossOrigin:"anonymous"}},github:{light:{integrity:"sha384-eFTL69TLRZTkNfYZOLM+G04821K1qZao/4QLJbet1pP4tcF+fdXq/9CdqAbWRl/L",crossOrigin:"anonymous"},dark:{integrity:"sha384-wH75j6z1lH97ZOpMOInqhgKzFkAInZPPSPlZpYKYTOqsaizPvhQZmAtLcPKXpLyH",crossOrigin:"anonymous"}},gradient:{light:{integrity:"sha384-yErHBR8aEZPxRl3XmR8dGSRAclMlnSRRw8sXQLcmPWzWUvb56BzQmBw3EWHl7QGI",crossOrigin:"anonymous"},dark:{integrity:"sha384-lUCvtSOdvDbp5hLWKgwz/taFu1HxlpqES2OVP5UG2JMTfnU481gXcBhGF9lAGoSr",crossOrigin:"anonymous"}},kimbie:{light:{integrity:"sha384-tloeSLUPczAvoZ48TUz+OxRie0oYLCRwlkadUXovGzzJEIbNQB2TkfUuvJ6SW5Mi",crossOrigin:"anonymous"},dark:{integrity:"sha384-o5F1vUaMNOmou1sQrsWiFo4/QUGSV0svqNZW+EesmKxWC8MpFJcveBhAyfvTHbGb",crossOrigin:"anonymous"}},paraiso:{light:{integrity:"sha384-5j6QHU2Hwg1ehtlIQNDebhETDB8bga3/88hzBFsMRaGmgQHCftqIN7GZNDNw0vTL",crossOrigin:"anonymous"},dark:{integrity:"sha384-I5vnnMQu0LWDQnHpT61xyoMwKarAB8jpZkB2ioFOlmzUFnIFaV4QbUwlBBOMKhTH",crossOrigin:"anonymous"}},qtcreator:{light:{integrity:"sha384-iEBgHrwi8Hv4dSZBz+MOGvS05rF7I7fGKM2fASQyE9jn2Istg9Qd5dSoK18WyRTB",crossOrigin:"anonymous"},dark:{integrity:"sha384-D6LXJGWNR4QV7gnpuP3ccbvOYoR02td3cU0y7lESABPg/tzCSC4m+y+M2TtrmpHc",crossOrigin:"anonymous"}},stackoverflow:{light:{integrity:"sha384-FMwt7cTGo4aLxZnno5k0xTj0W4gmi48Kwept+y/oQmE6cFk36Kr+QJZOKNOQwORe",crossOrigin:"anonymous"},dark:{integrity:"sha384-iL+x+BroCyHm/p2c6sMA9umXhdCWp2cKe4QUjPeMzHgwXAk+ZxHyIGP3NZTZensU",crossOrigin:"anonymous"}}}},prettier:{standaloneJs:{integrity:"sha384-+W7xqeAu5I/86lmhtNbTUhXsleRqShVIHN475c2jis2jC/2u7yauvSMLvoWpOcRR",crossOrigin:"anonymous"},parserMarkdownJs:{integrity:"sha384-i4vYrgvZzKDF8P9xog44TQUyDL6uIGMYBrmvTQSgClA0mKyxAHAv9ACYN+FgJLWc",crossOrigin:"anonymous"}},cropper:{js:{integrity:"sha384-aKBOyDyHi7nysLl4xSArmbTpotGkhOQNGnSQaljyIveY3ofQZ3GWak4U9F5NcPxI",crossOrigin:"anonymous"},css:{integrity:"sha384-4B0iRmDz7QrXJK2xob77YvAC46zoUOJDr2MOKrkWWR7QoJg9i63rGSnCwIjGYGHs",crossOrigin:"anonymous"}},screenfull:{js:{integrity:"sha384-Qfbv8upMDu/ikv42M0Jnym2hahbDQ77Nm8PGU0G+iA6UIwt1+scE6P1qKXA0anWU",crossOrigin:"anonymous"}},mermaid:{js:{integrity:"sha384-EOXBFmc3gx5mb+vn0vPvvGqACToJD24hhacX5Yx+8NUUQrHIle/Qi5Bg9o3zKwW2",crossOrigin:"anonymous"}},katex:{js:{integrity:"sha384-TTF8eEsEKInX2meLzP5V1z/npGYIElXYGksx93f0qBZHu6IL3PdzVB8objytx+TR",crossOrigin:"anonymous"},css:{integrity:"sha384-2dNi/m6JtSiviznrOIZ5fTiZ5As0In2QwkuXSgoqcQtCNplvJAbt+jveeN+8en73",crossOrigin:"anonymous"}},echarts:{js:{integrity:"sha384-C2iskrW/uPW46KzOjrvJIQo4YkV8lkD+QS0CrDN18IIPIpT/g2USu8bTP3nvmIAD",crossOrigin:"anonymous"}}},wu=["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","previewOnly","htmlPreview","catalog","github"],ku=["markdownTotal","=","scrollSwitch"],xu={"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:"预览",previewOnly:"仅预览",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",previewOnly:"preview only",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 Image Link",upload:"Upload Images",clip2upload:"Crop And 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:"Character Count",scrollAuto:"Scroll Auto"}}},_={editorExtensions:{highlight:{js:du,css:Y},prettier:{standaloneJs:R.main,parserMarkdownJs:R.markdown},cropper:{...gu},screenfull:{js:hu},mermaid:{js:mu,enableZoom:!0},katex:{...pu},echarts:{js:yu,parseOption:D=>{let i;try{i=lu.parse(D)}catch(F){const a=F instanceof Error?F.message:String(F);throw new SyntaxError(`Invalid ECharts option: ${a}`,{cause:F})}if(!i||typeof i!="object"||Array.isArray(i))throw new TypeError("ECharts option must be an object.");return i}}},editorExtensionsAttrs:{},editorConfig:{languageUserDefined:{},mermaidTemplate:{},renderDelay:500,zIndex:2e4},codeMirrorExtensions:D=>D,markdownItConfig:()=>{},markdownItPlugins:D=>D,mermaidConfig:D=>D,katexConfig:D=>D,echartsConfig:D=>D},vu=D=>tu.deepMerge(_,D,{excludeKeys(i){return/[iI]{1}nstance/.test(i)}}),Su=.1;exports.MinInputBoxWidth=Su;exports.allFooter=ku;exports.allToolbar=wu;exports.codeCss=Y;exports.config=vu;exports.editorExtensionsAttrs=bu;exports.globalConfig=_;exports.prefix=Bu;exports.prefixHump=fu;exports.staticTextDefault=xu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),i=require("./config.cjs"),S=require("./index5.cjs"),x=require("./dom.cjs"),k=require("./vue-tsx.cjs"),
|
|
1
|
+
"use strict";const e=require("vue"),i=require("./config.cjs"),t=require("@lucide/vue"),S=require("./index5.cjs"),x=require("./dom.cjs"),k=require("./vue-tsx.cjs"),V=()=>e.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-github-icon"},[e.createVNode("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"},null),e.createVNode("path",{d:"M9 18c-4.51 2-5-2-7-2"},null)]),P={bold:t.Bold,underline:t.Underline,italic:t.Italic,"strike-through":t.Strikethrough,title:t.Heading,sub:t.Subscript,sup:t.Superscript,quote:t.Quote,"unordered-list":t.List,"ordered-list":t.ListOrdered,task:t.ListTodo,"code-row":t.Code,code:t.SquareCode,link:t.Link,image:t.Image,table:t.Table,revoke:t.Reply,next:t.Forward,save:t.Save,prettier:t.SquareCode,minimize:t.Minimize2,maximize:t.Maximize2,"fullscreen-exit":t.Shrink,fullscreen:t.Expand,"preview-only":t.View,preview:t.Eye,"preview-html":t.CodeXml,catalog:t.ListTree,github:V,mermaid:t.ChartArea,formula:t.SquareSigma,close:t.X,delete:t.Trash2,upload:t.Upload},$=e.defineComponent({name:`${i.prefix}-icon-set`,props:{name:{type:String,default:""}},setup(n){return()=>e.h(P[n.name],{class:`${i.prefix}-icon`})}}),p=e.defineComponent({name:`${i.prefix}-icon`,props:{name:{type:String,default:""}},setup(n){const d=e.inject("customIcon");return()=>{const r=d.value[n.name];return typeof r=="object"?typeof r.component=="object"?e.h(r.component,r.props):e.createVNode("span",{innerHTML:r.component},null):e.createVNode($,{name:n.name},null)}}}),B={title:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},width:{type:String,default:"auto"},height:{type:String,default:"auto"},onClose:{type:Function},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:()=>{}},class:{type:String,default:void 0},style:{type:[Object,String],default:()=>({})},showMask:{type:Boolean,default:!0}},m=e.defineComponent({name:"MdModal",props:B,emits:["onClose"],setup(n,d){const r=e.inject("theme"),C=e.inject("rootRef"),f=e.ref(n.visible),c=e.ref([`${i.prefix}-modal`]),h=e.ref(),v=e.ref(),y=e.ref(),b=e.shallowRef();let u=()=>{};const o=e.reactive({maskStyle:{zIndex:-1},modalStyle:{zIndex:-1},initPos:{insetInlineStart:"0px",insetBlockStart:"0px"},historyPos:{insetInlineStart:"0px",insetBlockStart:"0px"}}),w=e.computed(()=>n.isFullscreen?{width:"100%",height:"100%"}:{width:n.width,height:n.height});e.watch(()=>n.isFullscreen,l=>{l?u():e.nextTick(()=>{u=x.keyMove(v.value,(a,s)=>{o.initPos.insetInlineStart=a+"px",o.initPos.insetBlockStart=s+"px"})})}),e.watch(()=>n.visible,l=>{l?(o.maskStyle.zIndex=i.globalConfig.editorConfig.zIndex+S.getZIndexIncrement(),o.modalStyle.zIndex=i.globalConfig.editorConfig.zIndex+S.getZIndexIncrement(),c.value.push("zoom-in"),f.value=l,e.nextTick(()=>{const a=h.value.offsetWidth/2,s=h.value.offsetHeight/2,N=document.documentElement.clientWidth/2,M=document.documentElement.clientHeight/2;o.initPos.insetInlineStart=N-a+"px",o.initPos.insetBlockStart=M-s+"px",n.isFullscreen||(u=x.keyMove(v.value,(j,z)=>{o.initPos.insetInlineStart=j+"px",o.initPos.insetBlockStart=z+"px"}))}),setTimeout(()=>{c.value=c.value.filter(a=>a!=="zoom-in")},140)):(c.value.push("zoom-out"),u(),setTimeout(()=>{c.value=c.value.filter(a=>a!=="zoom-out"),f.value=l},130))});const g=e.computed(()=>({display:f.value?"block":"none"})),I=e.computed(()=>{if(typeof n.style=="string"){const l=Object.entries(g.value).map(([a,s])=>`${a}: ${s}`).join("; ");return[n.style,l].join("; ")}else return n.style instanceof Object?{...g.value,...n.style}:g.value});return e.onMounted(()=>{const l=C.value?.getRootNode();y.value=l instanceof Document?document.body:l}),()=>{const l=k.getSlot({ctx:d}),a=k.getSlot({props:n,ctx:d},"title");return y.value?e.createVNode(e.Teleport,{to:y.value},{default:()=>[e.createVNode("div",{ref:b,class:`${i.prefix}-modal-container`,"data-theme":r.value},[e.createVNode("div",{class:n.class,style:I.value},[n.showMask&&e.createVNode("div",{class:`${i.prefix}-modal-mask`,style:o.maskStyle,onClick:()=>{n.onClose?.(),d.emit("onClose")}},null),e.createVNode("div",{class:c.value,style:{...o.modalStyle,...o.initPos,...w.value},ref:h},[e.createVNode("div",{class:`${i.prefix}-modal-header`,ref:v},[a||""]),e.createVNode("div",{class:`${i.prefix}-modal-body`},[l]),e.createVNode("div",{class:`${i.prefix}-modal-func`},[n.showAdjust&&e.createVNode("div",{class:`${i.prefix}-modal-adjust`,onClick:s=>{s.stopPropagation(),n.isFullscreen?o.initPos=o.historyPos:(o.historyPos=o.initPos,o.initPos={insetInlineStart:"0",insetBlockStart:"0"}),n.onAdjust(!n.isFullscreen)}},[e.createVNode(p,{name:n.isFullscreen?"minimize":"maximize"},null)]),e.createVNode("div",{class:`${i.prefix}-modal-close`,onClick:s=>{s.stopPropagation(),n.onClose?.(),d.emit("onClose")}},[e.createVNode(p,{name:"close"},null)])])])])])]}):""}}});m.install=n=>(n.component(m.name,m),n);exports.Icon=p;exports.MdModal=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("vue"),
|
|
1
|
+
"use strict";const o=require("vue"),D=require("./config.cjs"),P=require("@vavt/util"),S=require("./event-bus.cjs"),F=require("./index5.cjs"),G=`.${D.prefix}-preview > [data-line]`,w=(e,l)=>+getComputedStyle(e).getPropertyValue(l).replace("px",""),j=(e,l)=>{const I=P.debounce(()=>{e.removeEventListener("scroll",c),e.addEventListener("scroll",c),l.removeEventListener("scroll",c),l.addEventListener("scroll",c)},50),c=k=>{const u=e.clientHeight,y=l.clientHeight,m=e.scrollHeight,d=l.scrollHeight,s=(m-u)/(d-y);k.target===e?(l.removeEventListener("scroll",c),l.scrollTo({top:e.scrollTop/s}),I()):(e.removeEventListener("scroll",c),e.scrollTo({top:l.scrollTop*s}),I())};return[()=>{I().finally(()=>{e.dispatchEvent(new Event("scroll"))})},()=>{e.removeEventListener("scroll",c),l.removeEventListener("scroll",c)}]},U=(e,l,I)=>{const{view:c}=I,k=P.createSmoothScroll(),u=r=>c.lineBlockAt(c.state.doc.line(r+1).from).top,y=r=>c.lineBlockAt(c.state.doc.line(r+1).from).bottom;let m=[],d=[],s=[];const N=()=>{m=[],d=Array.from(l.querySelectorAll(G)),s=d.map(n=>Number(n.dataset.line));const r=[...s],{lines:h}=c.state.doc;r[0]!==0&&r.unshift(0);let C=r.shift()||0,t=r.shift()||h;for(let n=0;n<h;n++)n===t&&(C=n,t=r.shift()||h),m.push({start:C,end:t-1})},R=(r,h)=>{let C=1;for(let t=d.length-1;t-1>=0;t--){const n=d[t];if(n.offsetTop<=h){C=Number(n.dataset.line);break}}for(let t=m.length-1;t>=0;t--)if(u(m[t].start)<=r){C=C<m[t].start?C:m[t].start;break}return C};let A=0,$=0;const V=()=>{if($!==0)return!1;A++;const{scrollDOM:r}=c;let h=w(l,"padding-block-start");const C=c.lineBlockAtHeight(r.scrollTop),{number:t}=c.state.doc.lineAt(C.from),n=m[t-1];if(!n)return!1;let H=1;const f=l.querySelector(`[data-line="${n.start}"]`)||l.firstElementChild?.firstElementChild,v=l.querySelector(`[data-line="${n.end+1}"]`)||l.lastElementChild?.lastElementChild,g=r.scrollHeight-r.clientHeight,i=l.scrollHeight-l.clientHeight;let T=u(n.start);const b=y(n.end);let a=f.offsetTop,x=v.offsetTop-a;T===0&&(a=0,f===v?(h=0,x=0):x=v.offsetTop),H=(r.scrollTop-T)/(b-T);const M=v==l.lastElementChild?.lastElementChild?v.offsetTop+v.clientHeight:v.offsetTop;if(b>=g||M>i){const L=R(g,i);T=u(L),H=(r.scrollTop-T)/(g-T);const E=l.querySelector(`[data-line="${L}"]`);T>0&&E&&(a=E.offsetTop),x=i-a+w(l,"padding-block-start")}const q=a-h+x*H;k(l,q,()=>{A--})},B=()=>{if(A!==0)return;$++;const{scrollDOM:r}=c,h=l.scrollTop,C=l.scrollHeight,t=r.scrollHeight-r.clientHeight,n=l.scrollHeight-l.clientHeight;let H=l.firstElementChild?.firstElementChild,f=l.firstElementChild?.lastElementChild;if(s.length>0){let L=Math.ceil(s[s.length-1]*(h/C)),E=s.findLastIndex(p=>p<=L);E=E===-1?0:E,L=s[E];for(let p=E;p>=0&&p<s.length;)if(d[p].offsetTop>h){if(p-1>=0){p--;continue}L=-1,E=-1;break}else{if(p+1<s.length&&d[p+1].offsetTop<h){p++;continue}L=s[p],E=p;break}switch(E){case-1:{H=l.firstElementChild?.firstElementChild,f=d[0];break}case s.length-1:{H=d[E],f=l.firstElementChild?.lastElementChild;break}default:H=d[E],f=d[E+1]}}let v=H===l.firstElementChild?.firstElementChild?0:H.offsetTop-w(H,"margin-block-start"),g=f.offsetTop,i=0;const{start:T,end:b}=m[Number(H.dataset.line||0)];let a=u(T);const x=u(b+1===c.state.doc.lines?b:b+1);let M=0;const q=f==l.lastElementChild?.lastElementChild?f.offsetTop+f.offsetHeight:f.offsetTop;if(x>t||q>n){const L=R(t,n),E=l.querySelector(`[data-line="${L}"]`);v=E?E.offsetTop-w(E,"margin-block-start"):v,a=u(L),i=(h-v)/(n-v),M=t-a}else H===l.firstElementChild?.firstElementChild?(H===f&&(g=f.offsetTop+f.offsetHeight+w(f,"margin-block-end")),M=x,a=0,i=Math.max(h/g,0)):(i=Math.max((h-v)/(g-v),0),M=x-a);k(e,a+M*i,()=>{$--})},O=r=>{const{scrollDOM:h,contentHeight:C}=c,t=h.clientHeight;if(C<=t||l.firstElementChild.clientHeight<=l.clientHeight||c.state.doc.lines<=m[m.length-1]?.end)return!1;r.target===e?V():B()};return[()=>{N(),e.addEventListener("scroll",O),l.addEventListener("scroll",O),e.dispatchEvent(new Event("scroll"))},()=>{e.removeEventListener("scroll",O),l.removeEventListener("scroll",O)}]},z={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},onActive:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},W=o.defineComponent({props:z,setup(e){const l=o.inject("scrollElementRef"),I=o.inject("roorNodeRef"),c=o.ref();o.watch(()=>e.tocItem.active,u=>{u&&e.onActive(e.tocItem,c.value)}),o.onMounted(()=>{e.tocItem.active&&e.onActive(e.tocItem,c.value)});const k=u=>{if(u.stopPropagation(),e.onClick(u,e.tocItem),u.defaultPrevented)return;const y=e.mdHeadingId({text:e.tocItem.text,level:e.tocItem.level,index:e.tocItem.index,currentToken:e.tocItem.currentToken,nextToken:e.tocItem.nextToken}),m=I.value.getElementById(y),d=l.value;if(m&&d){let s=m.offsetParent,N=m.offsetTop;if(d.contains(s))for(;s&&d!=s;)N+=s?.offsetTop,s=s?.offsetParent;const R=m.previousElementSibling;let A=0;R||(A=w(m,"margin-block-start")),d?.scrollTo({top:N-e.scrollElementOffsetTop-A,behavior:"smooth"})}};return()=>o.createVNode("div",{ref:c,class:[`${D.prefix}-catalog-link`,e.tocItem.active&&`${D.prefix}-catalog-active`],onClick:k},[o.createVNode("span",{title:e.tocItem.text},[e.tocItem.text]),e.tocItem.children&&e.tocItem.children.length>0&&o.createVNode("div",{class:`${D.prefix}-catalog-wrapper`},[e.tocItem.children.map(u=>o.createVNode(W,{mdHeadingId:e.mdHeadingId,key:`${e.tocItem.text}-link-${u.level}-${u.text}`,tocItem:u,onActive:e.onActive,onClick:e.onClick,scrollElementOffsetTop:e.scrollElementOffsetTop},null))])])}}),J={editorId:{type:String,default:void 0},class:{type:String,default:""},mdHeadingId:{type:Function,default:({text:e})=>e},scrollElement:{type:[String,Object],default:void 0},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0},onClick:{type:Function,default:void 0},onActive:{type:Function,default:void 0},isScrollElementInShadow:{type:Boolean,default:!1},syncWith:{type:String,default:"preview"},catalogMaxDepth:{type:Number,default:void 0}},_=o.defineComponent({name:"MdCatalog",props:J,emits:["onClick","onActive"],setup(e,l){const I=e.editorId,c=`#${I}-preview-wrapper`,k=o.reactive({list:[],show:!1,scrollElement:e.scrollElement||c}),u=o.shallowRef(),y=o.ref(),m=o.ref(),d=o.ref(),s=o.ref(),N=o.shallowRef(),R=o.ref({});o.provide("scrollElementRef",m),o.provide("roorNodeRef",s);const A=o.computed(()=>{const t=[];return k.list.forEach((n,H)=>{if(e.catalogMaxDepth&&n.level>e.catalogMaxDepth)return;const{text:f,level:v,line:g}=n,i={level:v,text:f,line:g,index:H+1,active:u.value===n};if(t.length===0)t.push(i);else{let T=t[t.length-1];if(i.level>T.level)for(let b=T.level+1;b<=6;b++){const{children:a}=T;if(!a){T.children=[i];break}if(T=a[a.length-1],i.level<=T.level){a.push(i);break}}else t.push(i)}}),t}),$=()=>{if(k.scrollElement instanceof HTMLElement)return k.scrollElement;let t=document;return(k.scrollElement===c||e.isScrollElementInShadow)&&(t=y.value?.getRootNode()),t.querySelector(k.scrollElement)},V=t=>{if(t.length===0)return u.value=void 0,k.list=[],!1;const{activeHead:n,activeIndex:H}=t.reduce((g,i,T)=>{let b=0;if(e.syncWith==="preview"){const a=s.value?.getElementById(e.mdHeadingId({text:i.text,level:i.level,index:T+1,currentToken:i.currentToken,nextToken:i.nextToken}));a instanceof HTMLElement&&(b=F.getRelativeTop(a,m.value))}else{const a=N.value;if(a){const x=a.lineBlockAt(a.state.doc.line(i.line+1).from).top,M=a.scrollDOM.scrollTop;b=x-M}}return b<e.offsetTop&&b>g.minTop?{activeHead:i,activeIndex:T,minTop:b}:g},{activeHead:t[0],activeIndex:0,minTop:Number.MIN_SAFE_INTEGER});let f=n;const{catalogMaxDepth:v}=e;if(v&&f.level>v){for(let g=H;g>=0;g--){const i=t[g];if(i.level<=v){f=i;break}}if(f.level>v){const g=t.find(i=>i.level<=v);g&&(f=g)}}u.value=f,k.list=t},B=(t,n)=>{R.value.top=n.offsetTop+w(n,"padding-block-start")+"px",e.onActive?.(t,n),l.emit("onActive",t,n)},O=()=>{V(k.list)},r=t=>{if(d.value?.removeEventListener("scroll",O),e.syncWith==="editor")d.value=N.value?.scrollDOM;else{const n=$();m.value=n,d.value=n===document.documentElement?document:n}V(t),d.value?.addEventListener("scroll",O)},h=t=>{N.value=t};o.watch([()=>e.syncWith,N,()=>e.catalogMaxDepth],()=>{r(k.list)}),o.onMounted(()=>{s.value=y.value.getRootNode(),S.bus.on(I,{name:S.CATALOG_CHANGED,callback:r}),S.bus.on(I,{name:S.GET_EDITOR_VIEW,callback:h}),S.bus.emit(I,S.PUSH_CATALOG),S.bus.emit(I,S.SEND_EDITOR_VIEW)}),o.onBeforeUnmount(()=>{S.bus.remove(I,S.CATALOG_CHANGED,r),S.bus.remove(I,S.GET_EDITOR_VIEW,h),d.value?.removeEventListener("scroll",O)});const C=(t,n)=>{e.onClick?.(t,n),l.emit("onClick",t,n)};return()=>o.createVNode("div",{class:[`${D.prefix}-catalog`,e.class||""],"data-theme":e.theme,ref:y},[A.value.length>0&&o.createVNode(o.Fragment,null,[o.createVNode("div",{class:`${D.prefix}-catalog-indicator`,style:R.value},null),o.createVNode("div",{class:`${D.prefix}-catalog-container`},[A.value.map(t=>o.createVNode(W,{mdHeadingId:e.mdHeadingId,tocItem:t,key:`link-${t.level}-${t.text}`,onActive:B,onClick:C,scrollElementOffsetTop:e.scrollElementOffsetTop},null))])])])}});_.install=e=>(e.component(_.name,_),e);exports.MdCatalog=_;exports.scrollAuto=U;exports.scrollAutoWithScale=j;
|