@doocs/md-cli 2.1.2 → 2.1.3

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.
@@ -1,658 +0,0 @@
1
- import{_ as __vitePreload,l as lineNumbers,h as highlightActiveLineGutter,a as highlightSpecialChars,b as history,f as foldGutter,d as drawSelection,c as dropCursor,E as EditorState,i as indentOnInput,s as syntaxHighlighting,e as bracketMatching,g as closeBrackets,j as autocompletion,r as rectangularSelection,k as crosshairCursor,m as highlightActiveLine,n as highlightSelectionMatches,o as keymap,p as closeBracketsKeymap,q as defaultKeymap,t as searchKeymap,u as historyKeymap,v as foldKeymap,w as completionKeymap,x as lintKeymap,y as acceptCompletion,z as indentWithTab,A as defaultHighlightStyle,B as css$1,C as undo,D as redo,F as javascript$1,G as markdown$1,P as Prec,H as EditorView,I as placeholder,J as languages,K as markdownLanguage,L as vsCodeDark,M as vsCodeLight,N as Compartment,S as StateEffect,O as StateField,Q as Decoration}from"./md-codemirror-DdzaCDSe.js";import{Q as k,R as DOMPurify,U as defineComponent,V as ref,W as onMounted,X as createBlock,Y as openBlock,Z as withCtx,_ as createElementBlock,$ as createCommentVNode,a0 as unref,a1 as createBaseVNode,a2 as Transition,a3 as mergeProps,a4 as Toaster_default,a5 as deflateSync,a6 as cloneDeep,a7 as toMerged,a8 as frontMatter,a9 as readingTime,aa as axios,ab as B,ac as juice,ad as defineStore,ae as useDark,af as useStorage,ag as computed,ah as v4,ai as onBeforeUnmount,aj as onBeforeMount,ak as watch,al as reactive,am as markRaw,an as useToggle,ao as toast,ap as toPng,aq as storeToRefs,ar as toDisplayString,as as Se,at as renderSlot,au as normalizeProps,av as guardReactiveProps,aw as Tv,ax as twMerge,ay as clsx,az as createVNode,aA as kv,aB as Ov,aC as Av,aD as normalizeClass,aE as O,aF as cva,aG as Nv,aH as Mv,aI as Fv,aJ as Vv,aK as nu,aL as $u,aM as Pu,aN as Xl,aO as X,aP as Iv,aQ as reactiveOmit,aR as useForwardPropsEmits,aS as RadioGroupRoot_default,aT as Vh,aU as useForwardProps,aV as RadioGroupItem_default,aW as RadioGroupIndicator_default,aX as Circle,aY as useVModel,aZ as withDirectives,a_ as vModelText,a$ as isRef,b0 as useAttrs,b1 as vModelDynamic,b2 as Ot,b3 as Bu,b4 as toTypedSchema,b5 as create$3,b6 as create$6,b7 as createTextVNode,b8 as Form,b9 as Field,ba as toRaw,bb as gy,bc as Cy,bd as Plus,be as by,bf as wy,bg as Minus,bh as Fragment,bi as renderList,bj as Cg,bk as useLocalStorage,bl as useTemplateRef,bm as onUnmounted,bn as _g,bo as Ay,bp as normalizeStyle,bq as Ry,br as gg,bs as bg,bt as Ky,bu as Xy,bv as qy,bw as Yy,bx as Check,by as Jy,bz as tg,bA as ChevronDown,bB as eg,bC as ChevronUp,bD as Hy,bE as ng,bF as ag,bG as Wy,bH as jy,bI as Qy,bJ as wg,bK as xg,bL as create$7,bM as useFileDialog,bN as withModifiers,bO as CloudUpload,bP as Re,bQ as Sun,bR as Moon,bS as Iu,bT as vShow,bU as PenLine,bV as List,bW as throttle,bX as ArrowUpFromLine,bY as rm,bZ as um,b_ as dm,b$ as vm,c0 as fm,c1 as im,c2 as Rv,c3 as ap,c4 as uh,c5 as fh,c6 as ch,c7 as vh,c8 as dh,c9 as resolveComponent,ca as ChevronRight,cb as Ellipsis,cc as SquarePlus,cd as History,ce as Trash2,cf as Ch,cg as hh,ch as gh,ci as wh,cj as ou,ck as Hg,cl as Wg,cm as Ug,cn as qg,co as jg,cp as withKeys,cq as ArrowUpNarrowWide,cr as ChevronsDownUp,cs as ChevronsUpDown,ct as nextTick,cu as customRef,cv as Eye,cw as EyeOff,cx as Info,cy as Image,cz as Settings,cA as MessageCircle,cB as LoaderCircle,cC as Download,cD as Copy,cE as RefreshCcw,cF as vModelCheckbox,cG as Expand,cH as Wv,cI as jv,cJ as Gh,cK as Yh,cL as Xh,cM as qh,cN as Uh,cO as sy,cP as ry,cQ as ty,cR as ay,cS as iy,cT as toRefs,cU as Rh,cV as Oh,cW as kh,cX as Ah,cY as ey,cZ as Jh,c_ as Undo2,c$ as Redo2,d0 as Table,d1 as ContactRound,d2 as ClipboardPaste,d3 as Upload,d4 as FileCode,d5 as FileText,d6 as FileCog,d7 as useClipboard,d8 as Menu,d9 as SquarePen,da as resolveDynamicComponent,db as Pause,dc as Send,dd as WandSparkles,de as Settings2,df as Bot,dg as GripVertical,dh as SplitterResizeHandle_default,di as SplitterGroup_default,dj as Replace,dk as ReplaceAll,dl as useDebounceFn,dm as qiniu,dn as Buffer,dp as COS,dq as OSS,dr as CryptoJS,ds as S3Client,dt as getSignedUrl,du as PutObjectCommand,dv as upload,dw as SplitterPanel_default,dx as Pen,dy as imageCompression,dz as createApp,dA as createPinia}from"./md-vendor_.pnpm-CE4UQQls.js";import{y as yaml,x as xml,w as wasm,v as vbnet,t as typescript,s as swift,b as sql,d as shell,e as scss,r as rust,f as ruby,h as r,p as pythonRepl,i as python,j as plaintext,k as phpTemplate,l as php,m as perl,o as objectivec,n as markdown,q as makefile,u as lua,z as less,A as kotlin,B as json,C as javascript,D as java,E as ini,F as graphql,G as go,H as diff,I as css,J as csharp,K as cpp,L as c,M as bash,N as HighlightJS}from"./md-hljs-DD_2U1md.js";import{s as standaloneExports,p as parserPostcss,a as parserBabel,b as parserMarkdown}from"./md-prettier-CQTFnaAe.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function o(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(n){if(n.ep)return;n.ep=!0;const s=o(n);fetch(n.href,s)}})();function ucfirst(t){return t.slice(0,1).toUpperCase()+t.slice(1).toLowerCase()}async function initializeMermaid(){typeof window<"u"&&window.mermaid?window.mermaid.initialize({startOnLoad:!1}):(await __vitePreload(()=>import("mermaid"),[])).default.initialize({startOnLoad:!1})}function renderMarkdown(t,e){const{markdownContent:o,readingTime:a}=e.parseFrontMatterAndContent(t);let n=k.parse(o);return n=DOMPurify.sanitize(n,{ADD_TAGS:["mp-common-profile"]}),{html:n,readingTime:a}}function postProcessHtml(t,e,o){let a=t;return a=o.buildReadingTime(e)+a,a=a.replace(/(style=".*?)"/,'$1;margin-top: 0"'),a+=o.buildFootnotes(),a+=o.buildAddition(),a+=`
2
- <style>
3
- .hljs.code__pre > .mac-sign {
4
- display: ${o.getOpts().isMacCodeBlock?"flex":"none"};
5
- }
6
- </style>
7
- `,a+=`
8
- <style>
9
- .code__pre {
10
- padding: 0 !important;
11
- }
12
-
13
- .hljs.code__pre code {
14
- display: -webkit-box;
15
- padding: 0.5em 1em 1em;
16
- overflow-x: auto;
17
- text-indent: 0;
18
- }
19
- h2 strong {
20
- color: inherit !important;
21
- }
22
- </style>
23
- `,o.createContainer(a)}function customizeTheme(t,e){const o=JSON.parse(JSON.stringify(t)),{fontSize:a,color:n}=e;if(a)for(let s=1;s<=6;s++){const l=o.block[`h${s}`]["font-size"];o.block[`h${s}`]["font-size"]=`${a*Number.parseFloat(l)}px`}return n&&(o.base["--md-primary-color"]=n),o}function customCssWithTemplate(t,e,o){const a=customizeTheme(o,{color:e}),n=(i,d,f)=>{f.forEach(p=>{d[p]&&(i[p]=Object.assign(i[p]||{},d[p]))})},s=["container","h1","h2","h3","h4","h5","h6","code","code_pre","p","hr","blockquote","blockquote_note","blockquote_tip","blockquote_important","blockquote_warning","blockquote_caution","blockquote_p","blockquote_p_note","blockquote_p_tip","blockquote_p_important","blockquote_p_warning","blockquote_p_caution","blockquote_title","blockquote_title_note","blockquote_title_tip","blockquote_title_important","blockquote_title_warning","blockquote_title_caution","image","ul","ol","block_katex"],l=["listitem","codespan","link","wx_link","strong","table","thead","th","td","footnote","figcaption","em","inline_katex"];return n(a.block,t,s),n(a.inline,t,l),a}function getStyleString(t){return Object.entries(t??{}).map(([e,o])=>`${e}: ${o}`).join("; ")}const _hoisted_1$v={key:0,class:"loading"},_sfc_main$1Q=defineComponent({__name:"AppSplash",setup(t){const e=ref(!0);return onMounted(()=>{setTimeout(()=>{e.value=!1},100)}),(o,a)=>(openBlock(),createBlock(Transition,{name:"fade"},{default:withCtx(()=>[unref(e)?(openBlock(),createElementBlock("div",_hoisted_1$v,[...a[0]||(a[0]=[createBaseVNode("strong",null,"致力于让 Markdown 编辑更简单",-1)])])):createCommentVNode("",!0)]),_:1}))}}),_export_sfc=(t,e)=>{const o=t.__vccOpts||t;for(const[a,n]of e)o[a]=n;return o},__unplugin_components_0$1=_export_sfc(_sfc_main$1Q,[["__scopeId","data-v-8d32b142"]]),_sfc_main$1P=defineComponent({__name:"Sonner",props:{id:{},invert:{type:Boolean},theme:{},position:{},closeButtonPosition:{},hotkey:{},richColors:{type:Boolean},expand:{type:Boolean},duration:{},gap:{},visibleToasts:{},closeButton:{type:Boolean},toastOptions:{},class:{},style:{},offset:{},mobileOffset:{},dir:{},swipeDirections:{},icons:{},containerAriaLabel:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Toaster_default),mergeProps({class:"toaster group"},e),null,16))}});function markedAlert(t={}){const{className:e="markdown-alert",variants:o=[],withoutStyle:a=!1}=t,n=resolveVariants(o);function s(i,d,f=!1){const{styles:p}=t;return{className:e,variant:i,icon:d.icon,title:d.title??ucfirst(i),titleClassName:`${e}-title`,fromContainer:f,wrapperStyle:{...p?.blockquote,...p?.[`blockquote_${i}`]},titleStyle:{...p?.blockquote_title,...p?.[`blockquote_title_${i}`]},contentStyle:{...p?.blockquote_p,...p?.[`blockquote_p_${i}`]}}}function l(i){const{meta:d,tokens:f=[]}=i;let p=this.parser.parse(f);p=p.replace(/<p .*?>/g,`<p style="${getStyleString(d.contentStyle)}">`);let g=`<blockquote class="${d.className} ${d.className}-${d.variant}" style="${getStyleString(d.wrapperStyle)}">
24
- `;return g+=`<p class="${d.titleClassName}" style="${getStyleString(d.titleStyle)}">`,a||(g+=d.icon.replace("<svg",`<svg style="fill: ${d.titleStyle?.color??"inherit"}"`)),g+=d.title,g+=`</p>
25
- `,g+=p,g+=`</blockquote>
26
- `,g}return{walkTokens(i){if(i.type!=="blockquote")return;const d=n.find(({type:f})=>new RegExp(createSyntaxPattern(f),"i").test(i.text));if(d){const{type:f}=d,p=new RegExp(createSyntaxPattern(f),"i");Object.assign(i,{type:"alert",meta:s(f,d)});const g=i.tokens?.[0];if(g.raw?.replace(p,"").trim()){const m=g.tokens[0];Object.assign(m,{raw:m.raw.replace(p,""),text:m.text.replace(p,"")}),g.tokens[1]?.type==="br"&&g.tokens.splice(1,1)}else i.tokens?.shift()}},extensions:[{name:"alert",level:"block",renderer:l},{name:"alertContainer",level:"block",start(i){return i.match(/^:::/)?.index},tokenizer(i,d){const f=/^:::\s*(\w+)\s*\n([\s\S]*?)\n:::/.exec(i);if(f){const[p,g,E]=f,m=n.find(S=>S.type===g);return m?{type:"alert",raw:p,text:E.trim(),tokens:this.lexer.blockTokens(E.trim()),meta:s(g,m,!0)}:void 0}},renderer:l}]}}const defaultAlertVariant=[{type:"note",icon:'<svg class="octicon octicon-info" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'},{type:"info",icon:'<svg class="octicon octicon-info" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'},{type:"tip",icon:'<svg class="octicon octicon-light-bulb" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>'},{type:"important",icon:'<svg class="octicon octicon-report" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>'},{type:"warning",icon:'<svg class="octicon octicon-alert" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>'},{type:"caution",icon:'<svg class="octicon octicon-stop" style="margin-right: 0.25em;" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'}];function resolveVariants(t){return t.length?Object.values([...defaultAlertVariant,...t].reduce((e,o)=>(e[o.type]=o,e),{})):defaultAlertVariant}function createSyntaxPattern(t){return`^(?:\\[!${t}])\\s*?
27
- *`}const fnMap=new Map;function markedFootnotes(){return{extensions:[{name:"footnoteDef",level:"block",start(t){return fnMap.clear(),t.match(/^\[\^/)?.index},tokenizer(t){const e=t.match(/^\[\^(.*)\]:(.*)/);if(e){const[o,a,n]=e,s=fnMap.size+1;return fnMap.set(a,{index:s,text:n}),{type:"footnoteDef",raw:o,fnId:a,index:s,text:n}}},renderer(t){const{index:e,text:o,fnId:a}=t,n=`
28
- <code>${e}.</code>
29
- <span>${o}</span>
30
- <a id="fnDef-${a}" href="#fnRef-${a}" style="color: var(--md-primary-color);">↩︎</a>
31
- <br>`;return e===1?`
32
- <p style="font-size: 80%;margin: 0.5em 8px;word-break:break-all;">${n}`:e===fnMap.size?`${n}</p>`:n}},{name:"footnoteRef",level:"inline",start(t){return t.match(/\[\^/)?.index},tokenizer(t){const e=t.match(/^\[\^(.*?)\]/);if(e){const[o,a]=e;if(fnMap.has(a))return{type:"footnoteRef",raw:o,fnId:a}}},renderer(t){const{fnId:e}=t,{index:o}=fnMap.get(e);return`<sup style="color: var(--md-primary-color);">
33
- <a href="#fnDef-${e}" id="fnRef-${e}">[${o}]</a>
34
- </sup>`}}]}}const inlineRule=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:?!。,:]|$)/,inlineRuleNonStandard=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1/,blockRule=/^\s{0,3}(\${1,2})[ \t]*\n([\s\S]+?)\n\s{0,3}\1[ \t]*(?:\n|$)/,inlineLatexRule=/^\\\(([^\\]*(?:\\.[^\\]*)*?)\\\)/,blockLatexRule=/^\\\[([^\\]*(?:\\.[^\\]*)*?)\\\]/;function createRenderer(t,e,o,a=!0){return n=>{window.MathJax.texReset();const l=window.MathJax.tex2svg(n.text,{display:t}).firstChild,i=l.style["min-width"]||l.getAttribute("width");return l.removeAttribute("width"),a&&(l.style.display="initial",l.style.setProperty("max-width","300vw","important"),l.style.flexShrink="0",l.style.width=i),t?`<section ${o}>${l.outerHTML}</section>`:`<span ${e}>${l.outerHTML}</span>`}}function inlineKatex(t,e){const o=t&&t.nonStandard,a=o?inlineRuleNonStandard:inlineRule;return{name:"inlineKatex",level:"inline",start(n){let s,l=n;for(;l;){if(s=l.indexOf("$"),s===-1)return;if((o?s>-1:s===0||l.charAt(s-1)===" ")&&l.substring(s).match(a))return s;l=l.substring(s+1).replace(/^\$+/,"")}},tokenizer(n){const s=n.match(a);if(s)return{type:"inlineKatex",raw:s[0],text:s[2].trim(),displayMode:s[1].length===2}},renderer:e}}function blockKatex(t,e){return{name:"blockKatex",level:"block",tokenizer(o){const a=o.match(blockRule);if(a)return{type:"blockKatex",raw:a[0],text:a[2].trim(),displayMode:a[1].length===2}},renderer:e}}function inlineLatexKatex(t,e){return{name:"inlineLatexKatex",level:"inline",start(o){const a=o.indexOf("\\(");return a!==-1?a:void 0},tokenizer(o){const a=o.match(inlineLatexRule);if(a)return{type:"inlineLatexKatex",raw:a[0],text:a[1].trim(),displayMode:!1}},renderer:e}}function blockLatexKatex(t,e){return{name:"blockLatexKatex",level:"block",start(o){const a=o.indexOf("\\[");return a!==-1?a:void 0},tokenizer(o){const a=o.match(blockLatexRule);if(a)return{type:"blockLatexKatex",raw:a[0],text:a[1].trim(),displayMode:!0}},renderer:e}}function MDKatex(t,e,o,a=!0){return{extensions:[inlineKatex(t,createRenderer(!1,e,o,a)),blockKatex(t,createRenderer(!0,e,o,a)),inlineLatexKatex(t,createRenderer(!1,e,o,a)),blockLatexKatex(t,createRenderer(!0,e,o,a))]}}function markedMarkup(t={}){const{styles:e}=t;return{extensions:[{name:"markup_highlight",level:"inline",start(o){return o.match(/==(?!=)/)?.index},tokenizer(o){const n=/^==((?:[^=]|=(?!=))+)==/.exec(o);if(n)return{type:"markup_highlight",raw:n[0],text:n[1]}},renderer(o){return`<span class="markup-highlight" style="${getStyleString(e?.markup_highlight??{})}">${o.text}</span>`}},{name:"markup_underline",level:"inline",start(o){return o.match(/\+\+(?!\+)/)?.index},tokenizer(o){const n=/^\+\+((?:[^+]|\+(?!\+))+)\+\+/.exec(o);if(n)return{type:"markup_underline",raw:n[0],text:n[1]}},renderer(o){return`<span class="markup-underline" style="${getStyleString(e?.markup_underline??{})}">${o.text}</span>`}},{name:"markup_wavyline",level:"inline",start(o){return o.match(/~(?!~)/)?.index},tokenizer(o){const n=/^~([^~\n]+)~(?!~)/.exec(o);if(n)return{type:"markup_wavyline",raw:n[0],text:n[1]}},renderer(o){return`<span class="markup-wavyline" style="${getStyleString(e?.markup_wavyline??{})}">${o.text}</span>`}}]}}function encode6bit(t){return t<10?String.fromCharCode(48+t):(t-=10,t<26?String.fromCharCode(65+t):(t-=26,t<26?String.fromCharCode(97+t):(t-=26,t===0?"-":t===1?"_":"?")))}function append3bytes(t,e,o){const a=t>>2,n=(t&3)<<4|e>>4,s=(e&15)<<2|o>>6,l=o&63;let i="";return i+=encode6bit(a&63),i+=encode6bit(n&63),i+=encode6bit(s&63),i+=encode6bit(l&63),i}function encode64(t){let e="";for(let o=0;o<t.length;o+=3)o+2===t.length?e+=append3bytes(t.charCodeAt(o),t.charCodeAt(o+1),0):o+1===t.length?e+=append3bytes(t.charCodeAt(o),0,0):e+=append3bytes(t.charCodeAt(o),t.charCodeAt(o+1),t.charCodeAt(o+2));return e}function performDeflate(t){try{const e=new TextEncoder().encode(t),o=deflateSync(e,{level:9});return String.fromCharCode(...o)}catch(e){return console.warn("Deflate compression failed:",e),t}}function encodePlantUML(t){try{const e=performDeflate(t);return encode64(e)}catch(e){console.warn("PlantUML encoding failed, using fallback:",e);const o=new TextEncoder().encode(t);return`~1${btoa(String.fromCharCode(...o)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}`}}function generatePlantUMLUrl(t,e){const o=encodePlantUML(t),a=e.format==="svg"?"svg":"png";return`${e.serverUrl}/${a}/${o}`}function renderPlantUMLDiagram(t,e){const{text:o}=t,a=!o.trim().includes("@start")||!o.trim().includes("@end")?`@startuml
35
- ${o.trim()}
36
- @enduml`:o,n=generatePlantUMLUrl(a,e);if(e.inlineSvg&&e.format==="svg"){const s=`plantuml-placeholder-${Math.random().toString(36).slice(2,11)}`;fetchSvgContent(n).then(i=>{const d=document.querySelector(`[data-placeholder="${s}"]`);d&&(d.outerHTML=createPlantUMLHTML(n,e,i))});const l=e.styles.container?Object.entries(e.styles.container).map(([i,d])=>`${i.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${d}`).join("; "):"";return`<div class="${e.className}" style="${l}" data-placeholder="${s}">
37
- <div style="color: #666; font-style: italic;">正在加载PlantUML图表...</div>
38
- </div>`}return createPlantUMLHTML(n,e)}async function fetchSvgContent(t){try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.text()).replace(/(<svg[^>]*)\swidth="[^"]*"/g,"$1").replace(/(<svg[^>]*)\sheight="[^"]*"/g,"$1").replace(/(<svg[^>]*style="[^"]*?)width:[^;]*;?/g,"$1").replace(/(<svg[^>]*style="[^"]*?)height:[^;]*;?/g,"$1")}catch(e){return console.warn(`Failed to fetch SVG content from ${t}:`,e),'<div style="color: #666; font-style: italic;">PlantUML图表加载失败</div>'}}function createPlantUMLHTML(t,e,o){const a=e.styles.container?Object.entries(e.styles.container).map(([n,s])=>`${n.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${s}`).join("; "):"";return o?`<div class="${e.className}" style="${a}">
39
- ${o}
40
- </div>`:`<div class="${e.className}" style="${a}">
41
- <img src="${t}" alt="PlantUML Diagram" style="max-width: 100%; height: auto;" />
42
- </div>`}function markedPlantUML(t={}){const e={serverUrl:t.serverUrl||"https://www.plantuml.com/plantuml",format:t.format||"svg",className:t.className||"plantuml-diagram",inlineSvg:t.inlineSvg||!1,styles:{container:{textAlign:"center",margin:"16px 8px",overflowX:"auto",...t.styles?.container}}};return{extensions:[{name:"plantuml",level:"block",start(o){return o.match(/^```plantuml/m)?.index},tokenizer(o){const a=/^```plantuml\r?\n([\s\S]*?)\r?\n```/.exec(o);if(a){const[n,s]=a;return{type:"plantuml",raw:n,text:s.trim()}}},renderer(o){return renderPlantUMLDiagram(o,e)}}],walkTokens(o){o.type==="code"&&o.lang==="plantuml"&&(o.type="plantuml")}}}function markedRuby(){return{extensions:[{name:"ruby",level:"inline",start(t){return t.match(/\[/)?.index},tokenizer(t){let o=/^\[([^\]]+)\]\{([^}]+)\}/.exec(t);if(o)return{type:"ruby",raw:o[0],text:o[1].trim(),ruby:o[2].trim(),format:"basic"};if(o=/^\[([^\]]+)\]\^\(([^)]+)\)/.exec(t),o)return{type:"ruby",raw:o[0],text:o[1].trim(),ruby:o[2].trim(),format:"basic-hat"}},renderer(t){const{text:e,ruby:o,format:a}=t,n=/[・.。-]/g;if(n.test(o)){const l=o.split(n).filter(f=>f.trim()!==""),i=e.split(""),d=[];if(i.length>=l.length){let f=0;for(let p=0;p<l.length;p++){const g=l[p],E=i.length-f,m=l.length-p;let S=1;m===1&&(S=E);const _=i.slice(f,f+S).join("");d.push(`<ruby data-text="${_}" data-ruby="${g}" data-format="${a}">${_}<rp>(</rp><rt>${g}</rt><rp>)</rp></ruby>`),f+=S}f<i.length&&d.push(i.slice(f).join(""))}else for(let f=0;f<i.length;f++){const p=i[f],g=l[f]||"";g?d.push(`<ruby data-text="${p}" data-ruby="${g}" data-format="${a}">${p}<rp>(</rp><rt>${g}</rt><rp>)</rp></ruby>`):d.push(p)}return d.join("")}return`<ruby data-text="${e}" data-ruby="${o}" data-format="${a}">${e}<rp>(</rp><rt>${o}</rt><rp>)</rp></ruby>`}}]}}function markedSlider(t={}){return{extensions:[{name:"horizontalSlider",level:"block",start(e){return e.match(/^<!\[/)?.index},tokenizer(e){const o=/^<(!\[.*?\]\(.*?\)(?:,!\[.*?\]\(.*?\))*)>/,a=e.match(o);if(a)return{type:"horizontalSlider",raw:a[0],text:a[1]}},renderer(e){const{text:o}=e,a=o.match(/!\[(.*?)\]\((.*?)\)/g)||[];return a.length===0?"":`
43
- <section style="box-sizing: border-box; font-size: 16px;">
44
- <section data-role="outer" style="font-family: 微软雅黑; font-size: 16px;">
45
- <section data-role="paragraph" style="margin: 0px auto; box-sizing: border-box; width: 100%;">
46
- <section style="margin: 0px auto; text-align: center;">
47
- <section style="display: inline-block; width: 100%;">
48
- <!-- 微信公众号支持的滑动图片容器 -->
49
- <section style="overflow-x: scroll; -webkit-overflow-scrolling: touch; white-space: nowrap; width: 100%; text-align: center;">
50
- ${a.map(s=>{const l=s.match(/!\[(.*?)\]/)||[],i=s.match(/\]\((.*?)\)/)||[],d=l[1]||"",f=i[1]||"",{styles:p}=t,g=p?getStyleString(p.image):"";return{src:f,alt:d,imgStyles:g}}).map((s,l)=>`<section style="display: inline-block; width: 100%; margin-right: 0; vertical-align: top;">
51
- <img src="${s.src}" alt="${s.alt}" title="${s.alt}" style="${s.imgStyles}; width: 100%; height: auto; border-radius: 4px; vertical-align: top;"/>
52
- <p style="margin-top: 5px; font-size: 14px; color: #666; text-align: center; white-space: normal;">${s.alt}</p>
53
- </section>`).join("")}
54
- </section>
55
- </section>
56
- </section>
57
- </section>
58
- </section>
59
- <p style="font-size: 14px; color: #999; text-align: center; margin-top: 5px;"><<< 左右滑动看更多 >>></p>
60
- </section>
61
- `}}]}}function markedToc(){let t=[],e=!0;return{walkTokens(o){if(e&&(t=[],e=!1),o.type==="heading"){const a=o.text||"",n=o.depth||1,s=t.length;t.push({text:a,depth:n,index:s})}},extensions:[{name:"toc",level:"block",start(o){const a=o.match(/^\s*\[TOC\]\s*$/m);return a?a.index:void 0},tokenizer(o){const a=/^\[TOC\]/.exec(o);if(a)return{type:"toc",raw:a[0]}},renderer(){if(!t.length)return"";let o='<nav class="markdown-toc"><ul class="toc-ul toc-level-1 pl-4 border-l ml-2">',a=1;t.forEach(({text:n,depth:s,index:l})=>{if(s>a)for(let i=a+1;i<=s;i++)o+=`<ul class="toc-ul toc-level-${i} pl-4 border-l ml-2">`;else if(s<a)for(let i=a;i>s;i--)o+="</ul>";o+=`<li class="toc-li toc-level-${s} mb-1"><a class="text-gray-700 hover:text-blue-600 underline transition-colors" href="#${l}">${n}</a></li>`,a=s});for(let n=a;n>1;n--)o+="</ul>";return o+="</ul></nav>",e=!0,o}}]}}const COMMON_LANGUAGES={bash,c,cpp,csharp,css,diff,go,graphql,ini,java,javascript,json,kotlin,less,lua,makefile,markdown,objectivec,perl,php,"php-template":phpTemplate,plaintext,python,"python-repl":pythonRepl,r,ruby,rust,scss,shell,sql,swift,typescript,vbnet,wasm,xml,yaml};Object.entries(COMMON_LANGUAGES).forEach(([t,e])=>{HighlightJS.registerLanguage(t,e)});k.setOptions({breaks:!0});k.use(markedSlider());function buildTheme({theme:t,fonts:e,size:o,isUseIndent:a,isUseJustify:n}){const s=cloneDeep(t),l=toMerged(s.base,{"font-family":e,"font-size":o});a&&(s.block.p={"text-indent":"2em",...s.block.p}),n&&(s.block.p={"text-align":"justify",...s.block.p});const i=d=>Object.fromEntries(Object.entries(d).map(([f,p])=>[f,toMerged(l,p)]));return{...i(s.inline),...i(s.block)}}function escapeHtml(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/`/g,"&#96;")}function buildAddition(){return`
62
- <style>
63
- .preview-wrapper pre::before {
64
- position: absolute;
65
- top: 0;
66
- right: 0;
67
- color: #ccc;
68
- text-align: center;
69
- font-size: 0.8em;
70
- padding: 5px 10px 0;
71
- line-height: 15px;
72
- height: 15px;
73
- font-weight: 600;
74
- }
75
- </style>
76
- `}function getStyles(t,e,o=""){const a=t[e];return a?`style="${getStyleString(a)}${o}"`:""}function buildFootnoteArray(t){return t.map(([e,o,a])=>a===o?`<code style="font-size: 90%; opacity: 0.6;">[${e}]</code>: <i style="word-break: break-all">${o}</i><br/>`:`<code style="font-size: 90%; opacity: 0.6;">[${e}]</code> ${o}: <i style="word-break: break-all">${a}</i><br/>`).join(`
77
- `)}function transform(t,e,o){const a=t.split("-");for(const n of a){if(n==="alt"&&e)return e;if(n==="title"&&o)return o}return""}const macCodeSvg=`
78
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" width="45px" height="13px" viewBox="0 0 450 130">
79
- <ellipse cx="50" cy="65" rx="50" ry="52" stroke="rgb(220,60,54)" stroke-width="2" fill="rgb(237,108,96)" />
80
- <ellipse cx="225" cy="65" rx="50" ry="52" stroke="rgb(218,151,33)" stroke-width="2" fill="rgb(247,193,81)" />
81
- <ellipse cx="400" cy="65" rx="50" ry="52" stroke="rgb(27,161,37)" stroke-width="2" fill="rgb(100,200,86)" />
82
- </svg>
83
- `.trim();function parseFrontMatterAndContent(t){try{const e=frontMatter(t),o=e.attributes,a=e.body,n=readingTime(a);return{yamlData:o,markdownContent:a,readingTime:n}}catch(e){return console.error("Error parsing front-matter:",e),{yamlData:{},markdownContent:t,readingTime:readingTime(t)}}}function initRenderer(t){const e=[];let o=0,a=buildTheme(t),n=0;const s=[],l=[];function i(){return t}function d(w,u=""){return getStyles(a,w,u)}function f(w,u,C){const x=C??w;return`<${x} ${/^h\d$/.test(x)?'data-heading="true"':""} ${d(w)}>${u}</${x}>`}function p(w,u){const C=e.find(([,,x])=>x===u);return C?C[0]:(e.push([++o,w,u]),o)}function g(w){e.length=0,o=0,E(w)}function E(w){t={...t,...w};const u=JSON.stringify(a);a=buildTheme(t);const C=JSON.stringify(a);u!==C&&(k.use(markedAlert({styles:a})),k.use(MDKatex({nonStandard:!0},d("inline_katex",";line-height: 1;"),d("block_katex",";text-align: center;"))),k.use(markedMarkup({styles:a})))}function m(w){return!t.countStatus||!w.words?"":`
84
- <blockquote ${d("blockquote")}>
85
- <p ${d("blockquote_p")}>字数 ${w?.words},阅读大约需 ${Math.ceil(w?.minutes)} 分钟</p>
86
- </blockquote>
87
- `}const S=()=>e.length?f("h4","引用链接")+f("footnotes",buildFootnoteArray(e),"p"):"",_={heading({tokens:w,depth:u}){const C=this.parser.parseInline(w),x=`h${u}`;return f(x,C)},paragraph({tokens:w}){const u=this.parser.parseInline(w),C=u.includes("<figure")&&u.includes("<img"),x=u.trim()==="";return C||x?u:f("p",u)},blockquote({tokens:w}){let u=this.parser.parse(w);return u=u.replace(/<p .*?>/g,`<p ${d("blockquote_p")}>`),f("blockquote",u)},code({text:w,lang:u=""}){if(u.startsWith("mermaid"))return clearTimeout(n),n=setTimeout(async()=>{typeof window<"u"&&window.mermaid?await window.mermaid.run():await(await __vitePreload(()=>import("mermaid"),[])).default.run()},0),`<pre class="mermaid">${w}</pre>`;const C=u.split(" ")[0],x=HighlightJS.getLanguage(C)?C:"plaintext";let b="";if(t.isShowLineNumber){const T=w.replace(/\r\n/g,`
88
- `).split(`
89
- `).map(q=>{let z=HighlightJS.highlight(q,{language:x}).value;return z=z.replace(/(<span[^>]*>[^<]*<\/span>)(\s+)(<span[^>]*>[^<]*<\/span>)/g,(G,N,K,W)=>N+W.replace(/^(<span[^>]*>)/,`$1${K}`)),z=z.replace(/(\s+)(<span[^>]*>)/g,(G,N,K)=>K.replace(/^(<span[^>]*>)/,`$1${N}`)),z=z.replace(/\t/g," "),z=z.replace(/(>[^<]+)|(^[^<]+)/g,G=>G.replace(/\s/g,"&nbsp;")),z===""?"&nbsp;":z}),Y=T.map((q,z)=>`<section style="padding:0 10px 0 0;line-height:1.75">${z+1}</section>`).join(""),V=`<div style="white-space:pre;min-width:max-content;line-height:1.75">${T.join("<br/>")}</div>`;b=`
90
- <section style="display:flex;align-items:flex-start;overflow-x:hidden;overflow-y:auto;width:100%;max-width:100%;padding:0;box-sizing:border-box">
91
- <section class="line-numbers" style="text-align:right;padding:8px 0;border-right:1px solid rgba(0,0,0,0.04);user-select:none;background:var(--code-bg,transparent);">${Y}</section>
92
- <section class="code-scroll" style="flex:1 1 auto;overflow-x:auto;overflow-y:visible;padding:8px;min-width:0;box-sizing:border-box">${V}</section>
93
- </section>
94
- `}else b=HighlightJS.highlight(w,{language:x}).value,b=b.replace(/(<span[^>]*>[^<]*<\/span>)(\s+)(<span[^>]*>[^<]*<\/span>)/g,($,T,Y,te)=>T+te.replace(/^(<span[^>]*>)/,`$1${Y}`)),b=b.replace(/(\s+)(<span[^>]*>)/g,($,T,Y)=>Y.replace(/^(<span[^>]*>)/,`$1${T}`)),b=b.replace(/\t/g," "),b=b.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>").replace(/(>[^<]+)|(^[^<]+)/g,$=>$.replace(/\s/g,"&nbsp;"));const v=`<span class="mac-sign" style="padding: 10px 14px 0;">${macCodeSvg}</span>`,y=`<code class="language-${u}" ${d("code")}>${b}</code>`;return`<pre class="hljs code__pre" ${d("code_pre")}>${v}${y}</pre>`},codespan({text:w}){const u=escapeHtml(w);return f("codespan",u,"code")},list({ordered:w,items:u,start:C=1}){s.push(w),l.push(Number(C));const x=u.map(b=>this.listitem(b)).join("");return s.pop(),l.pop(),f(w?"ol":"ul",x)},listitem(w){const u=s[s.length-1],C=l[l.length-1];l[l.length-1]=C+1;const x=u?`${C}. `:"• ";let b;try{b=this.parser.parseInline(w.tokens)}catch{b=this.parser.parse(w.tokens).replace(/^<p(?:\s[^>]*)?>([\s\S]*?)<\/p>/,"$1")}return f("listitem",`${x}${b}`,"li")},image({href:w,title:u,text:C}){const x=f("figcaption",transform(t.legend,C,u)),b=d("figure"),v=d("image");return`<figure ${b}><img ${v} src="${w}" title="${u}" alt="${C}"/>${x}</figure>`},link({href:w,title:u,text:C,tokens:x}){const b=this.parser.parseInline(x);if(/^https?:\/\/mp\.weixin\.qq\.com/.test(w))return`<a href="${w}" title="${u||C}" ${d("wx_link")}>${b}</a>`;if(w===C)return b;if(t.citeStatus){const v=p(u||C,w);return`<span ${d("link")}>${b}<sup>[${v}]</sup></span>`}return f("link",b,"span")},strong({tokens:w}){return f("strong",this.parser.parseInline(w))},em({tokens:w}){return f("em",this.parser.parseInline(w),"span")},table({header:w,rows:u}){const C=w.map(b=>{const v=this.parser.parseInline(b.tokens);return f("th",v)}).join(""),x=u.map(b=>{const v=b.map(y=>this.tablecell(y)).join("");return f("tr",v)}).join("");return`
95
- <section style="max-width: 100%; overflow: auto">
96
- <table class="preview-table" ${d("table")}>
97
- <thead ${d("thead")}>${C}</thead>
98
- <tbody>${x}</tbody>
99
- </table>
100
- </section>
101
- `},tablecell(w){const u=this.parser.parseInline(w.tokens);return f("td",u)},hr(w){return f("hr","")}};return k.use({renderer:_}),k.use(markedMarkup({styles:a})),k.use(markedToc()),k.use(markedSlider({styles:a})),k.use(markedAlert({styles:a})),k.use(MDKatex({nonStandard:!0},d("inline_katex",";line-height: 1;"),d("block_katex",";text-align: center;"))),k.use(markedFootnotes()),k.use(markedPlantUML({inlineSvg:!0})),k.use(markedRuby()),{buildAddition,buildFootnotes:S,setOptions:E,reset:g,parseFrontMatterAndContent,buildReadingTime:m,createContainer(w){return f("container",w,"section")},getOpts:i}}const DEFAULT_SERVICE_ENDPOINT="https://proxy-ai.doocs.org/v1",DEFAULT_SERVICE_TEMPERATURE=1,DEFAULT_SERVICE_MAX_TOKEN=1024,DEFAULT_SERVICE_TYPE="default",DEFAULT_SERVICE_KEY="",serviceOptions=[{value:"default",label:"内置服务",endpoint:DEFAULT_SERVICE_ENDPOINT,models:["Qwen/Qwen2.5-7B-Instruct","Qwen/Qwen2.5-Coder-7B-Instruct","Qwen/Qwen2-7B-Instruct","deepseek-ai/DeepSeek-R1-Distill-Qwen-7B","THUDM/GLM-Z1-9B-0414","THUDM/GLM-4-9B-0414","internlm/internlm2_5-7b-chat","qwen/qwen3-30b-a3b:free","qwen/qwen3-8b:free","qwen/qwen3-14b:free","qwen/qwen3-32b:free","qwen/qwen3-235b-a22b:free","tngtech/deepseek-r1t-chimera:free","thudm/glm-z1-9b:free","thudm/glm-z1-32b:free","thudm/glm-4-9b:free","thudm/glm-4-32b:free","microsoft/mai-ds-r1:free","arliai/qwq-32b-arliai-rpr-v1:free","nvidia/llama-3.3-nemotron-super-49b-v1:free","nvidia/llama-3.1-nemotron-ultra-253b-v1:free","meta-llama/llama-4-maverick:free","meta-llama/llama-4-scout:free","deepseek/deepseek-v3-base:free","qwen/qwen2.5-vl-3b-instruct:free","qwen/qwen2.5-vl-32b-instruct:free"]},{value:"deepseek",label:"DeepSeek",endpoint:"https://api.deepseek.com/v1",models:["deepseek-chat","deepseek-reasoner"]},{value:"openai",label:"OpenAI",endpoint:"https://api.openai.com/v1",models:["gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","gpt-4-turbo","gpt-4o","gpt-3.5-turbo"]},{value:"qwen",label:"通义千问",endpoint:"https://dashscope.aliyuncs.com/compatible-mode/v1",models:["qwen-vl-max-2025-04-02","deepseek-v3","deepseek-r1-distill-llama-70b","deepseek-r1-distill-qwen-32b","deepseek-r1-distill-qwen-14b","deepseek-r1-distill-llama-8b","deepseek-r1-distill-qwen-1.5b","deepseek-r1-distill-qwen-7b","deepseek-r1","qwen1.5-7b-chat","qwen-coder-plus-1106","qwen-coder-plus","qwen-coder-plus-latest","qwen2.5-coder-3b-instruct","qwen2.5-coder-0.5b-instruct","qwen2.5-coder-14b-instruct","qwen2.5-coder-32b-instruct","qwen-coder-turbo-0919","qwen2.5-0.5b-instruct","qwen2.5-1.5b-instruct","qwen2.5-3b-instruct","qwen2.5-7b-instruct","qwen2.5-14b-instruct","qwen2.5-32b-instruct","qwen2.5-72b-instruct","qwen2.5-coder-7b-instruct","qwen2.5-math-1.5b-instruct","qwen2.5-math-7b-instruct","qwen2.5-math-72b-instruct","qwen-turbo-0919","qwen-turbo-latest","qwen-plus-0919","qwen-plus-latest","qwen-max-0919","qwen-max-latest","qwen-coder-turbo","qwen-coder-turbo-latest","qwen-math-turbo-0919","qwen-math-turbo","qwen-math-turbo-latest","qwen-math-plus-0919","qwen-math-plus","qwen-math-plus-latest","qwen2-57b-a14b-instruct","qwen2-72b-instruct","qwen2-7b-instruct","qwen2-0.5b-instruct","qwen2-1.5b-instruct","qwen-long","qwen-vl-max","qwen-vl-plus","qwen-max-0428","qwen1.5-110b-chat","qwen-72b-chat","codeqwen1.5-7b-chat","qwen1.5-0.5b-chat","qwen-1.8b-chat","qwen-1.8b-longcontext-chat","qwen-7b-chat","qwen-14b-chat","qwen1.5-14b-chat","qwen1.5-1.8b-chat","qwen1.5-32b-chat","qwen1.5-72b-chat","qwen-max-1201","qwen-max-longcontext","qwen-max-0403","qwen-max-0107","qwen-turbo","qwen-max","qwen-plus"]},{value:"hunyuan",label:"腾讯混元",endpoint:"https://api.hunyuan.cloud.tencent.com/v1",models:["hunyuan-pro","hunyuan-vision","hunyuan-lite","hunyuan-standard","hunyuan-standard-32K","hunyuan-standard-256k","hunyuan-code","hunyuan-role","hunyuan-functioncall","hunyuan-turbo-vision","hunyuan-turbo"]},{value:"doubao",label:"火山方舟",endpoint:"https://ark.cn-beijing.volces.com/api/v3",models:["doubao-1-5-thinking-pro-250415","doubao-1-5-thinking-pro-m-250415","deepseek-r1-250120","deepseek-r1-distill-qwen-32b-250120","deepseek-r1-distill-qwen-7b-250120","deepseek-v3-250324","deepseek-v3-241226","doubao-1-5-vision-pro-250328","doubao-1-5-vision-lite-250315","doubao-1-5-vision-pro-32k-250115","doubao-1-5-ui-tars-250328","doubao-vision-pro-32k-241028","doubao-vision-lite-32k-241015","doubao-1-5-pro-32k-250115","doubao-1-5-pro-256k-250115","doubao-1-5-lite-32k-250115","doubao-pro-4k-240515","doubao-pro-32k-241215","doubao-pro-32k-240828","doubao-pro-32k-240615","doubao-pro-256k-241115","doubao-lite-4k-character-240828","doubao-lite-32k-240828","doubao-lite-32k-character-241015","doubao-lite-128k-240828","moonshot-v1-8k","moonshot-v1-32k","moonshot-v1-128k"]},{value:"siliconflow",label:"硅基流动",endpoint:"https://api.siliconflow.cn/v1",models:["Qwen/Qwen3-235B-A22B","Qwen/Qwen3-30B-A3B","Qwen/Qwen3-32B","Qwen/Qwen3-14B","Qwen/Qwen3-8B","THUDM/GLM-Z1-32B-0414","THUDM/GLM-4-32B-0414","THUDM/GLM-Z1-Rumination-32B-0414","THUDM/GLM-4-9B-0414","Qwen/QwQ-32B","Pro/deepseek-ai/DeepSeek-R1","Pro/deepseek-ai/DeepSeek-V3","deepseek-ai/DeepSeek-R1","deepseek-ai/DeepSeek-V3","deepseek-ai/DeepSeek-R1-Distill-Qwen-32B","deepseek-ai/DeepSeek-R1-Distill-Qwen-14B","deepseek-ai/DeepSeek-R1-Distill-Qwen-7B","Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B","Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B","deepseek-ai/DeepSeek-V2.5","Qwen/Qwen2.5-72B-Instruct-128K","Qwen/Qwen2.5-72B-Instruct","Qwen/Qwen2.5-32B-Instruct","Qwen/Qwen2.5-14B-Instruct","Qwen/Qwen2.5-7B-Instruct","Qwen/Qwen2.5-Coder-32B-Instruct","Qwen/Qwen2.5-Coder-7B-Instruct","Qwen/Qwen2-7B-Instruct","Qwen/QwQ-32B-Preview","TeleAI/TeleChat2","THUDM/glm-4-9b-chat","Vendor-A/Qwen/Qwen2.5-72B-Instruct","internlm/internlm2_5-7b-chat","internlm/internlm2_5-20b-chat","Pro/Qwen/Qwen2.5-7B-Instruct","Pro/Qwen/Qwen2-7B-Instruct","Pro/Qwen/Qwen2-1.5B-Instruct","Pro/THUDM/chatglm3-6b","Pro/THUDM/glm-4-9b-chat"]},{value:"302ai",label:"302.AI",endpoint:" https://api.302.ai/v1",models:["chatgpt-4o-latest","gpt-4o","gpt-4o-mini","gpt-4-turbo","o1-preview","o1-mini","claude-3-5-sonnet-latest","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","grok-beta"]},{value:"bigmodel",label:"智谱 AI",endpoint:"https://open.bigmodel.cn/api/paas/v4/",models:["glm-4-plus","glm-4-0520","glm-4","glm-4-air","glm-4-airx","glm-4-long","glm-4-flashx","glm-4-flash"]},{value:"baichuan",label:"百川智能",endpoint:"https://api.baichuan-ai.com/v1",models:["Baichuan4","Baichuan3-Turbo","Baichuan3-Turbo-128k","Baichuan2-Turbo"]},{value:"lingyiwanwu",label:"零一万物",endpoint:"https://api.lingyiwanwu.com/v1",models:["yi-lightning"]},{value:"moonshot",label:"月之暗面",endpoint:"https://api.moonshot.cn/v1",models:["moonshot-v1-8k","moonshot-v1-32k","moonshot-v1-128k"]},{value:"ernie",label:"百度千帆",endpoint:"https://qianfan.baidubce.com/v2",models:["ernie-4.5-turbo-128k","ernie-4.5-turbo-32k","ernie-4.5-8k-preview","ernie-4.0-8k","ernie-4.0-8k-latest","ernie-4.0-8k-preview","ernie-4.0-turbo-128k","ernie-4.0-turbo-8k","ernie-4.0-turbo-8k-latest","ernie-4.0-turbo-8k-preview","ernie-3.5-128k","ernie-3.5-8k","ernie-3.5-8k-preview","ernie-speed-128k","ernie-speed-8k","ernie-speed-pro-128k","ernie-lite-8k","ernie-lite-pro-128k","ernie-tiny-8k","ernie-novel-8k"]},{value:"custom",label:"自定义兼容 OpenAI API 的服务",endpoint:"",models:[]}];serviceOptions[0].models[0];const imageServiceOptions=[{value:"default",label:"内置服务",endpoint:DEFAULT_SERVICE_ENDPOINT,models:["Kwai-Kolors/Kolors"]},{value:"openai",label:"OpenAI",endpoint:"https://api.openai.com/v1",models:["gpt-image-1","dall-e-3"]},{value:"siliconflow",label:"硅基流动",endpoint:"https://api.siliconflow.cn/v1",models:["Kwai-Kolors/Kolors","Qwen/Qwen-Image"]},{value:"302ai",label:"302.AI",endpoint:"https://api.302.ai/302",models:["302ai-flux-1-srpo","bagel-image","baidu-irag-01","dall-e-3","dall-e-2","doubao-seedream-3-0-t2i-250415","doubao-v2","doubao-v2-l","doubao-v2.1","doubao-v3","doubao-seedream-4-0-250828","flux-kontext-max","flux-kontext-pro","google-v3","google-v3-fast","google-v4-preview","gemini-2.5-flash-image","302-gemini-2.5-flash-image","gpt-image-1","hidream-i1-full","hidream-i1-dev","hidream-i1-fast","higgsfield","ideogram-v1","ideogram-v1-turbo","ideogram-v2","ideogram-v2-turbo","ideogram-v2a","ideogram-v2a-turbo","ideogram-v3-turbo","ideogram-v3-quality","ideogram-v3","kling-v1","kling-v1-5","kling-v2","luma","luma-flash","midjourney-v6","midjourney-v6-1","midjourney-v7","nijijourney-v6","minimaxi-image-01","qwen","qwen-lora","official-qwen-image","official-qwen-image-plus","wan2.2-t2i-flash","wan2.2-t2i-plus","wanx2.1-t2i-turbo","wanx2.1-t2i-plus","wanx2.0-t2i-turbo","wan2.5-t2i-preview","recraft-v3","recraft-20b","stable-v1","stable-sd2","stable-sd3-ultra","stable-sd3","stable-sd3-medium","stable-sd3-large","stable-sd3-turbo","cogview-4-250304","cogview-4"]},{value:"custom",label:"自定义兼容 OpenAI API 的服务",endpoint:"",models:[]}];imageServiceOptions[0].models[0];const githubConfig={username:"bucketio",repoList:Array.from({length:20},(t,e)=>`img${e}`),branch:"main",accessTokenList:["ghp_sqQg5y7XC7Fy8XdoocsmdVEYRiRiTZPvbwzTL4MRjQc","ghp_jB5JXzBjpGbgzdoocsmdogWfSHhfCKGVstozw1cAsPv","ghp_zvy8wkHo259g7doocsmdJnUKOQd1WO1SPzZ9G0O9cJD","ghp_DnCJc2Ms0RVZ1doocsmdiWOAN78FurfSeD1Pv2Y28pO","ghp_EsMYDv9WVjXWP5doocsmd1nnDml2DEP95rOiz44bSo0","ghp_L4isHf01nllOOdoocsmdHBGoDG6jscCA09WV44QDvlg","ghp_qWciwYXHPakAUGdoocsmdBOBZdRcV08JThKey3mBZNJ","ghp_rxkvIO08wVL2DMdoocsmd2jDEhcatp2rfVyhd3A7RiS","ghp_1RvkWKboSxr0yVdoocsmd7OtBCpecYwoV6deh3utifJ","ghp_cduanDnAug60ngdoocsmdF1uDstXUi6S9RMhY1qdada","ghp_q6mxuJIkqAcsCXdoocsmdkkjWvzGlMVRuy5zI0IWNDx","ghp_Pv4npPeJpChKFMTdoocsmdCQneopUcqJrqrjl3vrt9A","ghp_gKMCFqMaQiLTqhjdoocsmd7BJE8RyK6AdRw4b42CutS","ghp_2oShgb33qFlqBmadoocsmdludmuLYxBFY5bao1XrsVo","ghp_eYyd3kxWTZmsV8doocsmdDFbAa7AEGQTJgmOd0GUmtY"]},giteeConfig={username:"filesss",repoList:Array.from({length:20},(t,e)=>`img${e}`),branch:"main",accessTokenList:["ed5fc9866bd6c2fdoocsmddd433f806fd2f399c","5448ffebbbf1151doocsmdc4e337cf814fc8a62","25b05efd2557ca2doocsmd75b5c0835e3395911","11628c7a5aef015doocsmd2eeff9fb9566f0458","cb2f5145ed938dedoocsmdbd063b4ed244eecf8","d8c0b57500672c1doocsmd55f48b866b5ebcd98","78c56eadb88e453doocsmd43ddd95753351771a","03e1a688003948fdoocsmda16fcf41e6f03f1f0","c49121cf4d191fbdoocsmdd6a7877ed537e474a","adfeb2fadcdc4aadoocsmdfe1ee869ac9c968ff","116c94549ca4a0ddoocsmd192653af5c0694616","ecf30ed7f2eb184doocsmd51ea4ec8300371d9e","5837cf2bd5afd93doocsmd73904bed31934949e","b5b7e1c7d57e01fdoocsmd5266f552574297d78","684d55564ffbd0bdoocsmd7d747e5cc23aed6d6","3fc04a9d272ab71doocsmd010c56cb57d88d2ba"]},prefix="MD",isMac=/Mac/i.test(navigator.userAgent),ctrlKey="Mod",ctrlSign=isMac?"⌘":"Ctrl",altSign=isMac?"⌥":"Alt",shiftSign=isMac?"⇧":"Shift",storeLabels={isDark:"深色模式",isEditOnLeft:"左侧编辑",isMacCodeBlock:"Mac 代码块",isShowLineNumber:"代码块行号",isCiteStatus:"微信外链接底部引用状态",isCountStatus:"字数统计状态",isUseIndent:"使用缩进",isUseJustify:"使用两端对齐",isOpenRightSlider:"开启右侧滑块",isOpenPostSlider:"开启右侧发布滑块",showAIToolbox:"AI 工具箱状态",theme:"主题",fontFamily:"字体",fontSize:"字体大小",primaryColor:"自定义主题色",codeBlockTheme:"代码块主题",legend:"图注格式",fontSizeNumber:"字体大小",currentPostId:"当前文章 ID",currentPostIndex:"当前文章索引",posts:"内容列表",cssContentConfig:"自定义 CSS",titleList:"文章标题列表",readingTime:"阅读时间",isShowCssEditor:"显示 CSS 编辑器",isShowInsertFormDialog:"显示插入表单对话框",isShowInsertMpCardDialog:"显示插入公众号名片对话框",isShowUploadImgDialog:"显示上传图片对话框",aiDialogVisible:"AI 对话框可见"},defaultTheme={base:{"--md-primary-color":"#000000","text-align":"left","line-height":"1.75"},block:{container:{},h1:{display:"table",padding:"0 1em","border-bottom":"2px solid var(--md-primary-color)",margin:"2em auto 1em",color:"hsl(var(--foreground))","font-size":"1.2em","font-weight":"bold","text-align":"center"},h2:{display:"table",padding:"0 0.2em",margin:"4em auto 2em",color:"#fff",background:"var(--md-primary-color)","font-size":"1.2em","font-weight":"bold","text-align":"center"},h3:{"padding-left":"8px","border-left":"3px solid var(--md-primary-color)",margin:"2em 8px 0.75em 0",color:"hsl(var(--foreground))","font-size":"1.1em","font-weight":"bold","line-height":"1.2"},h4:{margin:"2em 8px 0.5em",color:"var(--md-primary-color)","font-size":"1em","font-weight":"bold"},h5:{margin:"1.5em 8px 0.5em",color:"var(--md-primary-color)","font-size":"1em","font-weight":"bold"},h6:{margin:"1.5em 8px 0.5em","font-size":"1em",color:"var(--md-primary-color)"},p:{margin:"1.5em 8px","letter-spacing":"0.1em",color:"hsl(var(--foreground))"},blockquote:{"font-style":"normal",padding:"1em","border-left":"4px solid var(--md-primary-color)","border-radius":"6px",color:"rgba(0,0,0,0.5)",background:"var(--blockquote-background)","margin-bottom":"1em"},blockquote_p:{display:"block","font-size":"1em","letter-spacing":"0.1em",color:"hsl(var(--foreground))"},blockquote_note:{},blockquote_tip:{},blockquote_info:{},blockquote_important:{},blockquote_warning:{},blockquote_caution:{},blockquote_title:{display:"flex","align-items":"center",gap:"0.5em","margin-bottom":"0.5em"},blockquote_title_note:{color:"#478be6"},blockquote_title_tip:{color:"#57ab5a"},blockquote_title_info:{color:"#93c5fd"},blockquote_title_important:{color:"#986ee2"},blockquote_title_warning:{color:"#c69026"},blockquote_title_caution:{color:"#e5534b"},blockquote_p_note:{},blockquote_p_tip:{},blockquote_p_info:{},blockquote_p_important:{},blockquote_p_warning:{},blockquote_p_caution:{},code_pre:{"font-size":"90%","overflow-x":"auto","border-radius":"8px",padding:"1em","line-height":"1.5",margin:"10px 8px"},code:{margin:0,"white-space":"nowrap","font-size":"90%","font-family":"Menlo, Operator Mono, Consolas, Monaco, monospace"},image:{display:"block","max-width":"100%",margin:"0.1em auto 0.5em","border-radius":"4px"},ol:{"padding-left":"1em","margin-left":"0",color:"hsl(var(--foreground))"},ul:{"list-style":"circle","padding-left":"1em","margin-left":"0",color:"hsl(var(--foreground))"},footnotes:{margin:"0.5em 8px","font-size":"80%",color:"hsl(var(--foreground))"},figure:{margin:"1.5em 8px",color:"hsl(var(--foreground))"},hr:{"border-style":"solid","border-width":"2px 0 0","border-color":"rgba(0,0,0,0.1)","-webkit-transform-origin":"0 0","-webkit-transform":"scale(1, 0.5)","transform-origin":"0 0",transform:"scale(1, 0.5)",height:"0.4em",margin:"1.5em 0"},block_katex:{"max-width":"100%","overflow-x":"auto","-webkit-overflow-scrolling":"touch",padding:"0.5em 0"}},inline:{listitem:{display:"block",margin:"0.2em 8px",color:"hsl(var(--foreground))"},codespan:{"font-size":"90%",color:"#d14",background:"rgba(27,31,35,.05)",padding:"3px 5px","border-radius":"4px"},em:{"font-style":"italic","font-size":"inherit"},link:{color:"#576b95"},wx_link:{color:"#576b95","text-decoration":"none"},strong:{color:"var(--md-primary-color)","font-weight":"bold","font-size":"inherit"},table:{color:"hsl(var(--foreground))"},thead:{"font-weight":"bold",color:"hsl(var(--foreground))"},th:{border:"1px solid #dfdfdf",padding:"0.25em 0.5em",color:"hsl(var(--foreground))","word-break":"keep-all",background:"rgba(0, 0, 0, 0.05)"},td:{border:"1px solid #dfdfdf",padding:"0.25em 0.5em",color:"hsl(var(--foreground))","word-break":"keep-all"},footnote:{"font-size":"12px",color:"hsl(var(--foreground))"},figcaption:{"text-align":"center",color:"#888","font-size":"0.8em"},inline_katex:{"max-width":"100%","overflow-x":"auto"},markup_highlight:{"background-color":"var(--md-primary-color)",padding:"2px 4px","border-radius":"2px",color:"#fff"},markup_underline:{"text-decoration":"underline","text-decoration-color":"var(--md-primary-color)"},markup_wavyline:{"text-decoration":"underline wavy","text-decoration-color":"var(--md-primary-color)","text-decoration-thickness":"2px"}}},graceTheme=toMerged(defaultTheme,{base:{},block:{container:{},h1:{padding:"0.5em 1em","border-bottom":"2px solid var(--md-primary-color)","font-size":"1.4em","text-shadow":"2px 2px 4px rgba(0,0,0,0.1)"},h2:{padding:"0.3em 1em","border-radius":"8px","font-size":"1.3em","box-shadow":"0 4px 6px rgba(0,0,0,0.1)"},h3:{"padding-left":"12px","font-size":"1.2em","border-left":"4px solid var(--md-primary-color)","border-bottom":"1px dashed var(--md-primary-color)"},h4:{"font-size":"1.1em"},h5:{"font-size":"1em"},h6:{"font-size":"1em"},p:{},blockquote:{"font-style":"italic",padding:"1em 1em 1em 2em","border-left":"4px solid var(--md-primary-color)","border-radius":"6px",color:"rgba(0,0,0,0.6)","box-shadow":"0 4px 6px rgba(0,0,0,0.05)","margin-bottom":"1em"},blockquote_p:{},"markdown-alert":{"font-style":"italic"},code_pre:{"box-shadow":"inset 0 0 10px rgba(0,0,0,0.05)"},code:{"font-family":"'Fira Code', Menlo, Operator Mono, Consolas, Monaco, monospace"},image:{"border-radius":"8px","box-shadow":"0 4px 8px rgba(0,0,0,0.1)"},ol:{"padding-left":"1.5em"},ul:{"list-style":"none","padding-left":"1.5em"},footnotes:{},figure:{},hr:{height:"1px",border:"none",margin:"2em 0",background:"linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0))"}},inline:{listitem:{margin:"0.5em 8px"},codespan:{},em:{},link:{},wx_link:{},strong:{},table:{"border-collapse":"separate","border-spacing":"0","border-radius":"8px",margin:"1em 8px",color:"hsl(var(--foreground))","box-shadow":"0 4px 6px rgba(0,0,0,0.1)",overflow:"hidden"},thead:{color:"#fff"},td:{padding:"0.5em 1em"},footnote:{color:"rgba(0,0,0,0.5)"},figcaption:{}}}),simpleTheme=toMerged(defaultTheme,{base:{},block:{container:{},h1:{padding:"0.5em 1em","font-size":"1.4em","text-shadow":"1px 1px 3px rgba(0,0,0,0.05)"},h2:{padding:"0.3em 1.2em","font-size":"1.3em","border-radius":"8px 24px 8px 24px","box-shadow":"0 2px 6px rgba(0,0,0,0.06)"},h3:{"padding-left":"12px","font-size":"1.2em","border-radius":"6px","line-height":"2.4em","border-left":"4px solid var(--md-primary-color)","border-right":"1px solid color-mix(in srgb, var(--md-primary-color) 10%, transparent)","border-bottom":"1px solid color-mix(in srgb, var(--md-primary-color) 10%, transparent)","border-top":"1px solid color-mix(in srgb, var(--md-primary-color) 10%, transparent)",background:"color-mix(in srgb, var(--md-primary-color) 8%, transparent)"},h4:{"font-size":"1.1em","border-radius":"6px"},h5:{"border-radius":"6px"},h6:{"border-radius":"6px"},blockquote:{"font-style":"italic",padding:"1em 1em 1em 2em",color:"rgba(0,0,0,0.6)","border-bottom":"0.2px solid rgba(0, 0, 0, 0.04)","border-top":"0.2px solid rgba(0, 0, 0, 0.04)","border-right":"0.2px solid rgba(0, 0, 0, 0.04)"},blockquote_note:{"font-style":"italic"},blockquote_tip:{"font-style":"italic"},blockquote_info:{"font-style":"italic"},blockquote_important:{"font-style":"italic"},blockquote_warning:{"font-style":"italic"},blockquote_caution:{"font-style":"italic"},blockquote_title:{},blockquote_title_note:{},blockquote_title_tip:{},blockquote_title_info:{},blockquote_title_important:{},blockquote_title_warning:{},blockquote_title_caution:{},blockquote_p_note:{},blockquote_p_tip:{},blockquote_p_info:{},blockquote_p_important:{},blockquote_p_warning:{},blockquote_p_caution:{},code_pre:{border:"1px solid rgba(0, 0, 0, 0.04)"},code:{"font-family":"'Fira Code', Menlo, Operator Mono, Consolas, Monaco, monospace"},image:{"border-radius":"8px",border:"1px solid rgba(0, 0, 0, 0.04)"},ol:{"padding-left":"1.5em"},ul:{"list-style":"none","padding-left":"1.5em"},hr:{height:"1px",border:"none",margin:"2em 0",background:"linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0))"}},inline:{listitem:{margin:"0.5em 8px"}}}),themeMap={default:defaultTheme,grace:graceTheme,simple:simpleTheme},themeOptions=[{label:"经典",value:"default",desc:""},{label:"优雅",value:"grace",desc:"@brzhang"},{label:"简洁",value:"simple",desc:"@okooo5km"}],fontFamilyOptions=[{label:"无衬线",value:"-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif",desc:"字体123Abc"},{label:"衬线",value:"Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif",desc:"字体123Abc"},{label:"等宽",value:"Menlo, Monaco, 'Courier New', monospace",desc:"字体123Abc"}],fontSizeOptions=[{label:"14px",value:"14px",desc:"更小"},{label:"15px",value:"15px",desc:"稍小"},{label:"16px",value:"16px",desc:"推荐"},{label:"17px",value:"17px",desc:"稍大"},{label:"18px",value:"18px",desc:"更大"}],colorOptions=[{label:"经典蓝",value:"#0F4C81",desc:"稳重冷静"},{label:"翡翠绿",value:"#009874",desc:"自然平衡"},{label:"活力橘",value:"#FA5151",desc:"热情活力"},{label:"柠檬黄",value:"#FECE00",desc:"明亮温暖"},{label:"薰衣紫",value:"#92617E",desc:"优雅神秘"},{label:"天空蓝",value:"#55C9EA",desc:"清爽自由"},{label:"玫瑰金",value:"#B76E79",desc:"奢华现代"},{label:"橄榄绿",value:"#556B2F",desc:"沉稳自然"},{label:"石墨黑",value:"#333333",desc:"内敛极简"},{label:"雾烟灰",value:"#A9A9A9",desc:"柔和低调"},{label:"樱花粉",value:"#FFB7C5",desc:"浪漫甜美"}],widthOptions=[{label:"移动端",value:"w-[375px]",desc:"固定"},{label:"电脑端",value:"w-full",desc:"适应"}],codeBlockUrlPrefix="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/highlightjs/11.11.1/styles/",codeBlockThemeList=["1c-light","a11y-dark","a11y-light","agate","an-old-hope","androidstudio","arduino-light","arta","ascetic","atom-one-dark-reasonable","atom-one-dark","atom-one-light","brown-paper","codepen-embed","color-brewer","dark","default","devibeans","docco","far","felipec","foundation","github-dark-dimmed","github-dark","github","gml","googlecode","gradient-dark","gradient-light","grayscale","hybrid","idea","intellij-light","ir-black","isbl-editor-dark","isbl-editor-light","kimbie-dark","kimbie-light","lightfair","lioshi","magula","mono-blue","monokai-sublime","monokai","night-owl","nnfx-dark","nnfx-light","nord","obsidian","panda-syntax-dark","panda-syntax-light","paraiso-dark","paraiso-light","pojoaque","purebasic","qtcreator-dark","qtcreator-light","rainbow","routeros","school-book","shades-of-purple","srcery","stackoverflow-dark","stackoverflow-light","sunburst","tokyo-night-dark","tokyo-night-light","tomorrow-night-blue","tomorrow-night-bright","vs","vs2015","xcode","xt256"],codeBlockThemeOptions=codeBlockThemeList.map(t=>({label:t,value:`${codeBlockUrlPrefix}${t}.min.css`,desc:""})),legendOptions=[{label:"title 优先",value:"title-alt",desc:""},{label:"alt 优先",value:"alt-title",desc:""},{label:"只显示 title",value:"title",desc:""},{label:"只显示 alt",value:"alt",desc:""},{label:"不显示",value:"none",desc:""}],defaultStyleConfig={isCiteStatus:!1,isMacCodeBlock:!0,isShowLineNumber:!1,isCountStatus:!1,theme:themeOptions[0].value,fontFamily:fontFamilyOptions[0].value,fontSize:fontSizeOptions[2].value,primaryColor:colorOptions[0].value,codeBlockTheme:codeBlockThemeOptions[23].value,legend:legendOptions[3].value},basicSetup=[lineNumbers(),highlightActiveLineGutter(),highlightSpecialChars(),history(),foldGutter(),drawSelection(),dropCursor(),EditorState.allowMultipleSelections.of(!0),indentOnInput(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),bracketMatching(),closeBrackets(),autocompletion(),rectangularSelection(),crosshairCursor(),highlightActiveLine(),highlightSelectionMatches(),keymap.of([...closeBracketsKeymap,...defaultKeymap,...searchKeymap,...historyKeymap,...foldKeymap,...completionKeymap,...lintKeymap,{key:"Tab",run:acceptCompletion},indentWithTab])];[highlightSpecialChars(),history(),drawSelection(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),keymap.of([...defaultKeymap,...historyKeymap])];function downloadFile(t,e,o="text/plain"){if(typeof document>"u")throw new TypeError("downloadFile can only be used in browser environment");const a=document.createElement("a");if(a.download=e,a.style.display="none",t.startsWith("data:"))a.href=t;else if(o==="text/html")a.href=`data:text/html;charset=utf-8,${encodeURIComponent(t)}`;else{const n=new Blob([t],{type:o});a.href=URL.createObjectURL(n)}document.body.appendChild(a),a.click(),document.body.removeChild(a),!t.startsWith("data:")&&o!=="text/html"&&URL.revokeObjectURL(a.href)}function toBase64(t){return new Promise((e,o)=>{const a=new FileReader;a.readAsDataURL(t),a.onload=()=>e(a.result.split(",").pop()),a.onerror=n=>o(n)})}function createTable({data:t,rows:e,cols:o}){let a="";for(let n=0;n<e+2;++n){a+="| ";const s=[];for(let l=0;l<o;++l){const i=n>1?n-1:n;s.push(n===1?"---":t[`k_${i}_${l}`]||" ")}a+=s.join(" | "),a+=` |
102
- `}return a}async function formatDoc(t,e="markdown"){const o=e==="css"?"css":e==="javascript"?"babel":"markdown",a=e==="css"?[parserPostcss]:e==="javascript"?[parserBabel]:[parserMarkdown,parserBabel];return await standaloneExports.format(t,{parser:o,plugins:a,printWidth:80,tabWidth:2,useTabs:!1,semi:!1,singleQuote:!0,quoteProps:"as-needed",trailingComma:"es5",bracketSpacing:!0,bracketSameLine:!1,arrowParens:"avoid",proseWrap:"preserve",htmlWhitespaceSensitivity:"css",endOfLine:"lf"})}async function formatCSS(t){const e=t.state.doc.toString(),o=await formatDoc(e,"css");t.dispatch({changes:{from:0,to:t.state.doc.length,insert:o}})}function cssSetup(){return[basicSetup,css$1(),keymap.of([{key:"Shift-Alt-f",run:t=>(formatCSS(t),!0)}])]}function toggleFormat(t,{prefix:e,suffix:o,check:a,afterInsertCursorOffset:n=0}){const s=t.state.selection.main,l=t.state.doc.sliceString(s.from,s.to),i=a?.(l)??!1;let d;if(i)d=l.slice(e.length,l.length-o.length),t.dispatch(t.state.replaceSelection(d));else if(d=`${e}${l}${o}`,t.dispatch(t.state.replaceSelection(d)),n!==0){const p=t.state.selection.main.head+n;t.dispatch({selection:{anchor:p}})}}function applyHeading(t,e){const o=t.state.selection.ranges,a=[],n=`${"#".repeat(e)} `;if(o.forEach(s=>{const l=t.state.doc.lineAt(s.from),i=t.state.doc.lineAt(s.to);for(let d=l.number;d<=i.number;d++){const f=t.state.doc.line(d),g=t.state.doc.sliceString(f.from,f.to).replace(/^#{1,6}\s+/,"").trimStart(),E=n+g;a.push({from:f.from,to:f.to,insert:E})}}),a.length>0){const l=t.state.doc.lineAt(o[0].from).from+n.length;t.dispatch({changes:a,selection:{anchor:l}})}}function formatBold(t){toggleFormat(t,{prefix:"**",suffix:"**",check:e=>e.startsWith("**")&&e.endsWith("**"),afterInsertCursorOffset:-2})}function formatItalic(t){toggleFormat(t,{prefix:"*",suffix:"*",check:e=>e.startsWith("*")&&e.endsWith("*"),afterInsertCursorOffset:-1})}function formatStrikethrough(t){toggleFormat(t,{prefix:"~~",suffix:"~~",check:e=>e.startsWith("~~")&&e.endsWith("~~"),afterInsertCursorOffset:-2})}function formatLink(t){toggleFormat(t,{prefix:"[",suffix:"]()",check:e=>e.startsWith("[")&&e.endsWith("]()"),afterInsertCursorOffset:-1})}function formatCode(t){toggleFormat(t,{prefix:"`",suffix:"`",check:e=>e.startsWith("`")&&e.endsWith("`"),afterInsertCursorOffset:-1})}function formatUnorderedList(t){const e=t.state.selection.main,a=t.state.doc.sliceString(e.from,e.to).split(`
103
- `),s=a.every(l=>l.trim().startsWith("- "))?a.map(l=>l.replace(/^- +/,"")).join(`
104
- `):a.map(l=>`- ${l}`).join(`
105
- `);t.dispatch(t.state.replaceSelection(s))}function formatOrderedList(t){const e=t.state.selection.main,a=t.state.doc.sliceString(e.from,e.to).split(`
106
- `),s=a.every(l=>/^\d+\.\s/.test(l.trim()))?a.map(l=>l.replace(/^\d+\.\s+/,"")).join(`
107
- `):a.map((l,i)=>`${i+1}. ${l}`).join(`
108
- `);t.dispatch(t.state.replaceSelection(s))}function undoAction(t){return undo(t)}function redoAction(t){return redo(t)}async function formatJavaScript(t){const e=t.state.doc.toString(),o=await formatDoc(e,"javascript");t.dispatch({changes:{from:0,to:t.state.doc.length,insert:o}})}function javascriptSetup(){return[basicSetup,javascript$1(),keymap.of([{key:"Shift-Alt-f",run:t=>(formatJavaScript(t),!0)}])]}async function formatMarkdown(t){const e=t.state.doc.toString(),o=await formatDoc(e,"markdown");t.dispatch({changes:{from:0,to:t.state.doc.length,insert:o}})}function markdownKeymap(t){const{onSearch:e}=t||{};return keymap.of([{key:"Mod-z",run:undoAction},{key:"Mod-y",run:redoAction},{key:"Mod-Shift-z",run:redoAction},{key:"Mod-b",run:o=>(formatBold(o),!0)},{key:"Mod-i",run:o=>(formatItalic(o),!0)},{key:"Mod-d",run:o=>(formatStrikethrough(o),!0)},{key:"Mod-k",run:o=>(formatLink(o),!0)},{key:"Mod-e",run:o=>(formatCode(o),!0)},{key:"Mod-h",run:o=>(applyHeading(o,1),!0)},{key:"Mod-1",run:o=>(applyHeading(o,1),!0)},{key:"Mod-2",run:o=>(applyHeading(o,2),!0)},{key:"Mod-3",run:o=>(applyHeading(o,3),!0)},{key:"Mod-4",run:o=>(applyHeading(o,4),!0)},{key:"Mod-5",run:o=>(applyHeading(o,5),!0)},{key:"Mod-6",run:o=>(applyHeading(o,6),!0)},{key:"Mod-u",run:o=>(formatUnorderedList(o),!0)},{key:"Mod-o",run:o=>(formatOrderedList(o),!0)},...e?[{key:"Mod-f",run:o=>(e(o),!0)}]:[],{key:"Shift-Alt-f",run:o=>(formatMarkdown(o),!0)},{key:"Mod-g",run:()=>!0}])}function markdownSetup(t){return[history(),highlightSelectionMatches(),closeBrackets(),markdown$1({base:markdownLanguage,codeLanguages:languages,addKeymap:!0}),Prec.high(markdownKeymap(t)),keymap.of([...defaultKeymap,...historyKeymap,...closeBracketsKeymap]),EditorView.lineWrapping,EditorState.allowMultipleSelections.of(!0),placeholder("开始写作...")]}const customStyles=EditorView.theme({".cm-gutterElement":{display:"flex",justifyContent:"right",alignItems:"center"}});function lightTheme(){return[vsCodeLight,customStyles]}function darkTheme(){return[vsCodeDark,customStyles]}function theme(t){return t?darkTheme():lightTheme()}const DEFAULT_CONTENT=`# 探索 Markdown 的奇妙世界
109
-
110
- 欢迎来到 Markdown 的奇妙世界!无论你是写作爱好者、开发者、博主,还是想要简单记录点什么的人,Markdown 都能成为你新的好伙伴。它不仅让写作变得简单明了,还能轻松地将内容转化为漂亮的网页格式。今天,我们将全面探讨 Markdown 的基础和进阶语法,让你在这个过程中充分享受写作的乐趣!
111
-
112
- Markdown 是一种轻量级标记语言,用于格式化纯文本。它以简单、直观的语法而著称,可以快速地生成 HTML。Markdown 是写作与代码的完美结合,既简单又强大。
113
-
114
- ## Markdown 基础语法
115
-
116
- ### 1. 标题:让你的内容层次分明
117
-
118
- 用 \`#\` 号来创建标题。标题从 \`#\` 开始,\`#\` 的数量表示标题的级别。
119
-
120
- \`\`\`markdown
121
- # 一级标题
122
-
123
- ## 二级标题
124
-
125
- ### 三级标题
126
-
127
- #### 四级标题
128
- \`\`\`
129
-
130
- 以上代码将渲染出一组层次分明的标题,使你的内容井井有条。
131
-
132
- ### 2. 段落与换行:自然流畅
133
-
134
- Markdown 中的段落就是一行接一行的文本。要创建新段落,只需在两行文本之间空一行。
135
-
136
- ### 3. 字体样式:强调你的文字
137
-
138
- - **粗体**:用两个星号或下划线包裹文字,如 \`**粗体**\` 或 \`__粗体__\`。
139
- - _斜体_:用一个星号或下划线包裹文字,如 \`*斜体*\` 或 \`_斜体_\`。
140
- - ~~删除线~~:用两个波浪线包裹文字,如 \`~~删除线~~\`。
141
- - ==高亮==:用两个等号包裹文字,如 \`==高亮==\`。
142
- - ++下划线++:用两个加号包裹文字,如 \`++下划线++\`。
143
- - ~波浪线~:用一个波浪线包裹文字,如 \`~波浪线~\`。
144
-
145
- 这些简单的标记可以让你的内容更有层次感和重点突出。
146
-
147
- ### 4. 列表:整洁有序
148
-
149
- - **无序列表**:用 \`-\`、\`*\` 或 \`+\` 加空格开始一行。
150
- - **有序列表**:使用数字加点号(\`1.\`、\`2.\`)开始一行。
151
-
152
- 在列表中嵌套其他内容?只需缩进即可实现嵌套效果。
153
-
154
- - 无序列表项 1
155
- 1. 嵌套有序列表项 1
156
- 2. 嵌套有序列表项 2
157
- - 无序列表项 2
158
-
159
- 1. 有序列表项 1
160
- 2. 有序列表项 2
161
-
162
- ### 5. 链接与图片:丰富内容
163
-
164
- - **链接**:用方括号和圆括号创建链接 \`[显示文本](链接地址)\`。
165
- - **图片**:和链接类似,只需在前面加上 \`!\`,如 \`![描述文本](图片链接)\`。
166
-
167
- [访问 Doocs](https://github.com/doocs)
168
-
169
- ![doocs](https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/logo-2.png)
170
-
171
- 轻松实现富媒体内容展示!
172
-
173
- > 因微信公众号平台不支持除公众号内容以外的链接,故其他平台的链接,会呈现链接样式但无法点击跳转。
174
-
175
- > 对于这些链接请注意明文书写,或点击左上角「格式->微信外链接转底部引用」开启引用,这样就可以在底部观察到链接指向。
176
-
177
- 另外,使用 \`<![alt](url),![alt](url)>\` 语法可以创建横屏滑动幻灯片,支持微信公众号平台。建议使用相似尺寸的图片以获得最佳显示效果。
178
-
179
- ### 6. 引用:引用名言或引人深思的句子
180
-
181
- 使用 \`>\` 来创建引用,只需在文本前面加上它。多层引用?在前一层 \`>\` 后再加一个就行。
182
-
183
- > 这是一个引用
184
- >
185
- > > 这是一个嵌套引用
186
-
187
- 这让你的引用更加富有层次感。
188
-
189
- ### 7. 代码块:展示你的代码
190
-
191
- - **行内代码**:用反引号包裹,如 \`code\`。
192
- - **代码块**:用三个反引号包裹,并指定语言,如:
193
-
194
- \`\`\`js
195
- console.log(\`Hello, Doocs!\`)
196
- \`\`\`
197
-
198
- 语法高亮让你的代码更易读。
199
-
200
- ### 8. 分割线:分割内容
201
-
202
- 用三个或更多的 \`-\`、\`*\` 或 \`_\` 来创建分割线。
203
-
204
- ---
205
-
206
- 为你的内容添加视觉分隔。
207
-
208
- ### 9. 表格:清晰展示数据
209
-
210
- Markdown 支持简单的表格,用 \`|\` 和 \`-\` 分隔单元格和表头。
211
-
212
- | 项目人员 | 邮箱 | 微信号 |
213
- | ------------------------------------------- | ---------------------- | ------------ |
214
- | [yanglbme](https://github.com/yanglbme) | contact@yanglibin.info | YLB0109 |
215
- | [YangFong](https://github.com/YangFong) | yangfong2022@gmail.com | yq2419731931 |
216
- | [thinkasany](https://github.com/thinkasany) | thinkasany@gmail.com | thinkasany |
217
-
218
- 这样的表格让数据展示更为清爽!
219
-
220
- > 手动编写标记太麻烦?我们提供了便捷方式。左上方点击「编辑->插入表格」,即可快速实现表格渲染。
221
-
222
- ## Markdown 进阶技巧
223
-
224
- ### 1. LaTeX 公式:完美展示数学表达式
225
-
226
- Markdown 允许嵌入 LaTeX 语法展示数学公式:
227
-
228
- - **行内公式**:用 \`$\` 包裹公式,如 $E = mc^2$。
229
- - **块级公式**:用 \`$$\` 包裹公式,如:
230
-
231
- $$
232
- \\begin{aligned}
233
- d_{i, j} &\\leftarrow d_{i, j} + 1 \\\\
234
- d_{i, y + 1} &\\leftarrow d_{i, y + 1} - 1 \\\\
235
- d_{x + 1, j} &\\leftarrow d_{x + 1, j} - 1 \\\\
236
- d_{x + 1, y + 1} &\\leftarrow d_{x + 1, y + 1} + 1
237
- \\end{aligned}
238
- $$
239
-
240
- 现在还支持 **LaTeX 标准格式**:
241
-
242
- - **行内公式**:用 \`\\(...\\)\` 包裹公式,如 \\(x^2 + y^2 = z^2\\)。
243
- - **块级公式**:用 \`\\[...\\]\` 包裹公式,如:
244
-
245
- \\[
246
- \\int\\_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}
247
- \\]
248
-
249
- 混合使用示例:传统格式 $a + b = c$ 和 LaTeX 格式 \\(d + e = f\\) 可以在同一段落中共存。
250
-
251
- 1. 列表内块公式 1
252
-
253
- $$
254
- \\chi^2 = \\sum \\frac{(O - E)^2}{E}
255
- $$
256
-
257
- 2. 列表内块公式 2
258
-
259
- $$
260
- \\chi^2 = \\sum \\frac{(|O - E| - 0.5)^2}{E}
261
- $$
262
-
263
- 这是展示复杂数学表达的利器!
264
-
265
- ### 2. Mermaid 流程图:可视化流程
266
-
267
- Mermaid 是强大的可视化工具,可以在 Markdown 中创建流程图、时序图等。
268
-
269
- \`\`\`mermaid
270
- graph LR
271
- A[GraphCommand] --> B[update]
272
- A --> C[goto]
273
- A --> D[send]
274
-
275
- B --> B1[更新状态]
276
- C --> C1[流程控制]
277
- D --> D1[消息传递]
278
- \`\`\`
279
-
280
- \`\`\`mermaid
281
- graph TD;
282
- A-->B;
283
- A-->C;
284
- B-->D;
285
- C-->D;
286
- \`\`\`
287
-
288
- \`\`\`mermaid
289
- pie
290
- title Key elements in Product X
291
- "Calcium" : 42.96
292
- "Potassium" : 50.05
293
- "Magnesium" : 10.01
294
- "Iron" : 5
295
- \`\`\`
296
-
297
- \`\`\`mermaid
298
- pie
299
- title 为什么总是宅在家里?
300
- "喜欢宅" : 45
301
- "天气太热" : 70
302
- "穷" : 500
303
- "没人约" : 95
304
- \`\`\`
305
-
306
- 这种方式不仅能直观展示流程,还能提升文档的专业性。
307
-
308
- > 更多用法,参见:[Mermaid User Guide](https://mermaid.js.org/intro/getting-started.html)。
309
-
310
- ### 3. PlantUML 流程图:可视化流程
311
-
312
- PlantUML 是强大的可视化工具,可以在 Markdown 中创建流程图、时序图等。
313
-
314
- \`\`\`plantuml
315
- @startuml
316
- participant Participant as Foo
317
- actor Actor as Foo1
318
- boundary Boundary as Foo2
319
- control Control as Foo3
320
- entity Entity as Foo4
321
- database Database as Foo5
322
- collections Collections as Foo6
323
- queue Queue as Foo7
324
- Foo -> Foo1 : To actor
325
- Foo -> Foo2 : To boundary
326
- Foo -> Foo3 : To control
327
- Foo -> Foo4 : To entity
328
- Foo -> Foo5 : To database
329
- Foo -> Foo6 : To collections
330
- Foo -> Foo7: To queue
331
- @enduml
332
- \`\`\`
333
-
334
- > 更多用法,参见:[PlantUML 主页](https://plantuml.com/zh/)。
335
-
336
- ### 4. Ruby 注音:注音标注
337
-
338
- 支持两种格式:
339
-
340
- \`\`\`md
341
- 1. [文字]{注音}
342
- 2. [文字]^(注音)
343
- \`\`\`
344
-
345
- 渲染效果如下:
346
-
347
- [你好]{nǐ hǎo} [世界]{shì jiè}
348
-
349
- 支持四种分隔符: \`・\`(中点)、\`.\` (全角句点)、\`。\` (中文句号)、\`-\` (英文减号)
350
-
351
- 示例:
352
-
353
- \`\`\`md
354
- [你好世界]{nǐ・hǎo・shì・jiè}
355
- [小夜時雨]^(さ・よ・しぐれ)
356
- \`\`\`
357
-
358
- [你好世界]{nǐ・hǎo・shì・jiè}
359
- [小夜時雨]^(さ・よ・しぐれ)
360
-
361
- 当字符串数量与分隔符数量不匹配时,会自动匹配到最合适的分隔符。
362
-
363
- \`\`\`md
364
- [小夜時雨]{さ・よ・しぐれ}
365
- [小夜時雨]{さ・よ}
366
- [小夜]{さ・よ・しぐれ}
367
- [小夜時雨]{さ・よ・しぐれ・extra}
368
- \`\`\`
369
-
370
- [小夜時雨]{さ・よ・しぐれ}
371
- [小夜時雨]{さ・よ}
372
- [小夜]{さ・よ・しぐれ}
373
- [小夜時雨]{さ・よ・しぐれ・extra}
374
-
375
- ## 结语
376
-
377
- Markdown 是一种简单、强大且易于掌握的标记语言,通过学习基础和进阶语法,你可以快速创作内容并有效传达信息。无论是技术文档、个人博客还是项目说明,Markdown 都是你的得力助手。希望这篇内容能够带你全面了解 Markdown 的潜力,让你的写作更加丰富多彩!
378
-
379
- 现在,拿起 Markdown 编辑器,开始创作吧!探索 Markdown 的世界,你会发现它远比想象中更精彩!
380
-
381
- #### 推荐阅读
382
-
383
- - [阿里又一个 20k+ stars 开源项目诞生,恭喜 fastjson!](https://mp.weixin.qq.com/s/RNKDCK2KoyeuMeEs6GUrow)
384
- - [刷掉 90% 候选人的互联网大厂海量数据面试题(附题解 + 方法总结)](https://mp.weixin.qq.com/s/rjGqxUvrEqJNlo09GrT1Dw)
385
- - [好用!期待已久的文本块功能究竟如何在 Java 13 中发挥作用?](https://mp.weixin.qq.com/s/kalGv5T8AZGxTnLHr2wDsA)
386
- - [2019 GitHub 开源贡献排行榜新鲜出炉!微软谷歌领头,阿里跻身前 12!](https://mp.weixin.qq.com/s/_q812aGD1b9QvZ2WFI0Qgw)
387
-
388
- ---
389
-
390
- <center>
391
- <img src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png" style="width: 100px;">
392
- </center>
393
- `,DEFAULT_CSS_CONTENT=`/**
394
- * 按 Alt/Option + Shift + F 可格式化
395
- * 如需使用主题色,请使用 var(--md-primary-color) 代替颜色值
396
- * 如:color: var(--md-primary-color);
397
- *
398
- * 召集令:如果你有好看的主题样式,欢迎分享,让更多人能够使用到你的主题。
399
- * 提交区:https://github.com/doocs/md/discussions/426
400
- */
401
- /* 顶层容器样式 */
402
- container {
403
- }
404
- /* 一级标题样式 */
405
- h1 {
406
- }
407
- /* 二级标题样式 */
408
- h2 {
409
- }
410
- /* 三级标题样式 */
411
- h3 {
412
- }
413
- /* 四级标题样式 */
414
- h4 {
415
- }
416
- /* 五级标题样式 */
417
- h5 {
418
- }
419
- /* 六级标题样式 */
420
- h6 {
421
- }
422
- /* 图片样式 */
423
- image {
424
- }
425
- /* 引用样式 */
426
- blockquote {
427
- }
428
- /* 引用段落样式 */
429
- blockquote_p {
430
- }
431
- /* 段落样式 */
432
- p {
433
- }
434
- /* 分割线样式 */
435
- hr {
436
- }
437
- /* 行内代码样式 */
438
- codespan {
439
- }
440
- /* 斜体样式 */
441
- em {
442
- }
443
- /* 粗体样式 */
444
- strong {
445
- }
446
- /* 链接样式 */
447
- link {
448
- }
449
- /* 微信链接样式 */
450
- wx_link {
451
- }
452
- /* 有序列表样式 */
453
- ol {
454
- }
455
- /* 无序列表样式 */
456
- ul {
457
- }
458
- /* 列表项样式 */
459
- listitem {
460
- }
461
- /* 代码块样式 */
462
- code {
463
- }
464
- /* 代码块外层样式 */
465
- code_pre {
466
- }
467
- /* 行内公式样式 */
468
- inline_katex {
469
- }
470
- /* 公式块样式 */
471
- block_katex {
472
- }
473
- /* 表格样式 */
474
- table {
475
- }
476
- /* 表格头样式 */
477
- thead{
478
- }
479
- /* 表格标题格样式 */
480
- th {
481
- }
482
- /* 表格内容格样式 */
483
- td {
484
- }
485
-
486
- /* GFM note 样式 */
487
- blockquote_note {
488
- }
489
- /* GFM tip 样式 */
490
- blockquote_tip {
491
- }
492
- /* GFM info 样式 */
493
- blockquote_info {
494
- }
495
- /* GFM important 样式 */
496
- blockquote_important {
497
- }
498
- /* GFM warning 样式 */
499
- blockquote_warning {
500
- }
501
- /* GFM caution 样式 */
502
- blockquote_caution {
503
- }
504
- /* GFM 通用标题 */
505
- blockquote_title {
506
- }
507
- /* GFM note 标题 */
508
- blockquote_title_note {
509
- }
510
- /* GFM tip 标题 */
511
- blockquote_title_tip {
512
- }
513
- /* GFM info 标题 */
514
- blockquote_title_info {
515
- }
516
- /* GFM important 标题 */
517
- blockquote_title_important {
518
- }
519
- /* GFM warning 标题 */
520
- blockquote_title_warning {
521
- }
522
- /* GFM caution 标题 */
523
- blockquote_title_caution {
524
- }
525
- /* GFM note 段落样式 */
526
- blockquote_p_note {
527
- }
528
- /* GFM tip 段落样式 */
529
- blockquote_p_tip {
530
- }
531
- /* GFM info 段落样式 */
532
- blockquote_p_info {
533
- }
534
- /* GFM important 段落样式 */
535
- blockquote_p_important {
536
- }
537
- /* GFM warning 段落样式 */
538
- blockquote_p_warning {
539
- }
540
- /* GFM caution 段落样式 */
541
- blockquote_p_caution {
542
- }
543
- `;function sanitizeTitle(t){const o=/[\\/:*?"<>|]/g;if(!o.test(t)&&t.length<=100)return t.trim()||"untitled";const a=t.replace(o,"_").trim();return(a.length>100?a.slice(0,100):a)||"untitled"}function removeLeft(t){const e=t.split(`
544
- `),o=e.filter(a=>a.trim()).map(a=>a.match(/(^\s+)?/)[0].length).sort((a,n)=>a-n)[0];return e.map(a=>a.slice(o)).join(`
545
- `)}function checkImage(t){if(!/\.(?:gif|jpe?g|png)$/i.test(t.name))return{ok:!1,msg:"请上传 JPG/PNG/GIF 格式的图片"};const o=10;return t.size>o*1024*1024?{ok:!1,msg:`由于公众号限制,图片大小不能超过 ${o}M`}:{ok:!0,msg:""}}function css2json(t){t=t.replace(/\/\*[\s\S]*?\*\//g,"");const e={},o=a=>a.reduce((n,s)=>{const[l,...i]=s.split(":").map(d=>d.trim());return l&&(n[l]=i.join(":")),n},{});for(;t.includes("{")&&t.includes("}");){const a=t.indexOf("{"),n=t.indexOf("}"),s=t.substring(a+1,n).split(";").map(d=>d.trim()).filter(Boolean),l=t.substring(0,a).split(",").map(d=>d.trim()),i=o(s);l.forEach(d=>{e[d]={...e[d]||{},...i}}),t=t.slice(n+1).trim()}return e}const service=axios.create({baseURL:"",timeout:30*1e3});service.interceptors.request.use(t=>(/^(?:post|put|delete)$/i.test(`${t.method}`)&&t.data&&t.data.upload&&(t.headers["Content-Type"]="multipart/form-data"),t),t=>{Promise.reject(t)});service.interceptors.response.use(t=>t.data?t.data:Promise.reject(t),t=>Promise.reject(t));function utf16to8(t){let e="";const o=t.length;for(let a=0;a<o;a++){const n=t.charCodeAt(a);n>=1&&n<=127?e+=t.charAt(a):n>2047?(e+=String.fromCharCode(224|n>>12&15),e+=String.fromCharCode(128|n>>6&63),e+=String.fromCharCode(128|n&63)):(e+=String.fromCharCode(192|n>>6&31),e+=String.fromCharCode(128|n&63))}return e}function utf8to16(t){let e="",o=0;const a=t.length;for(;o<a;){const n=t.charCodeAt(o++);let s,l;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=t.charAt(o-1);break;case 12:case 13:s=t.charCodeAt(o++),e+=String.fromCharCode((n&31)<<6|s&63);break;case 14:s=t.charCodeAt(o++),l=t.charCodeAt(o++),e+=String.fromCharCode((n&15)<<12|(s&63)<<6|l&63);break}}return e}const base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",base64DecodeChars=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];function base64encode(t){let e="",o=0;const a=t.length;for(;o<a;){const n=t.charCodeAt(o++)&255;if(o===a){e+=base64EncodeChars.charAt(n>>2),e+=base64EncodeChars.charAt((n&3)<<4),e+="==";break}const s=t.charCodeAt(o++);if(o===a){e+=base64EncodeChars.charAt(n>>2),e+=base64EncodeChars.charAt((n&3)<<4|(s&240)>>4),e+=base64EncodeChars.charAt((s&15)<<2),e+="=";break}const l=t.charCodeAt(o++);e+=base64EncodeChars.charAt(n>>2),e+=base64EncodeChars.charAt((n&3)<<4|(s&240)>>4),e+=base64EncodeChars.charAt((s&15)<<2|(l&192)>>6),e+=base64EncodeChars.charAt(l&63)}return e}function base64decode(t){let e,o,a,n,s=0;const l=t.length;let i="";for(;s<l;){do e=base64DecodeChars[t.charCodeAt(s++)&255];while(s<l&&e===-1);if(e===-1)break;do o=base64DecodeChars[t.charCodeAt(s++)&255];while(s<l&&o===-1);if(o===-1)break;i+=String.fromCharCode(e<<2|(o&48)>>4);do{if(a=t.charCodeAt(s++)&255,a===61)return i;a=base64DecodeChars[a]}while(s<l&&a===-1);if(a===-1)break;i+=String.fromCharCode((o&15)<<4|(a&60)>>2);do{if(n=t.charCodeAt(s++)&255,n===61)return i;n=base64DecodeChars[n]}while(s<l&&n===-1);if(n===-1)break;i+=String.fromCharCode((a&3)<<6|n)}return i}function safe64(t){return t=t.replace(/\+/g,"-"),t=t.replace(/\//g,"_"),t}const tokenTools=Object.freeze(Object.defineProperty({__proto__:null,base64decode,base64encode,safe64,utf16to8,utf8to16},Symbol.toStringTag,{value:"Module"}));function addPrefix(t){return`${prefix}__${t}`}function downloadMD(t,e="untitled"){const o=sanitizeTitle(e);downloadFile(t,`${o}.md`,"text/markdown;charset=utf-8")}function setStyles(t){function e(s,l=["width","height","inlineSize","webkitLogicalWidth","webkitLogicalHeight"]){const i=getComputedStyle(s,null);return Object.entries(i).filter(([d])=>{const f=d.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`);return i.getPropertyValue(f)&&!l.includes(d)}).map(([d,f])=>`${d.replace(/[A-Z]/g,g=>`-${g.toLowerCase()}`)}:${f};`).join("")}switch(!0){case o(t):case a(t):case n(t):t.setAttribute("style",e(t))}t.children.length&&Array.from(t.children).forEach(s=>setStyles(s));function o(s){return s.tagName==="PRE"&&Array.from(s.classList).includes("code__pre")}function a(s){return s==null?!1:s.tagName==="CODE"}function n(s){return s.tagName==="SPAN"&&(a(s.parentElement)||a(s.parentElement.parentElement))}}function processHtmlContent(t){const e=document.querySelector("#output");return setStyles(e),e.innerHTML.replace(/var\(--md-primary-color\)/g,t).replace(/--md-primary-color:.+?;/g,"")}function exportHTML(t,e="untitled"){const a=`<html><head><meta charset="utf-8" /></head><body><div style="width: 750px; margin: auto;">${processHtmlContent(t)}</div></body></html>`;downloadFile(a,`${sanitizeTitle(e)}.html`,"text/html")}async function generatePureHTML(t){const e=new B;return e.use(markedAlert({withoutStyle:!0})),e.use(MDKatex({nonStandard:!0},"","",!1)),await e.parse(t)}async function exportPureHTML(t,e="untitled"){const o=sanitizeTitle(e),a=await generatePureHTML(t);downloadFile(a,`${o}.html`,"text/html")}function exportPDF(t,e="untitled"){const o=processHtmlContent(t),a=sanitizeTitle(e),n=window.open("","_blank");if(!n){console.error("无法打开打印窗口");return}n.document.write(`
546
- <!DOCTYPE html>
547
- <html>
548
- <head>
549
- <meta charset="utf-8">
550
- <title>${a}</title>
551
- <style>
552
- @page {
553
- @top-center {
554
- content: "${a}";
555
- font-size: 12px;
556
- color: #666;
557
- }
558
- @bottom-left {
559
- content: "微信 Markdown 编辑器";
560
- font-size: 10px;
561
- color: #999;
562
- }
563
- @bottom-right {
564
- content: "第 " counter(page) " 页,共 " counter(pages) " 页";
565
- font-size: 10px;
566
- color: #999;
567
- }
568
- }
569
-
570
- @media print {
571
- body { margin: 0; }
572
- }
573
- </style>
574
- </head>
575
- <body>
576
- <div style="width: 100%; max-width: 750px; margin: auto;">
577
- ${o}
578
- </div>
579
- </body>
580
- </html>
581
- `),n.document.close(),n.onload=()=>{n.print(),n.onafterprint=()=>{n.close()}}}function solveWeChatImage(){const e=document.getElementById("output").getElementsByTagName("img");Array.from(e).forEach(o=>{const a=o.getAttribute("width"),n=o.getAttribute("height");o.removeAttribute("width"),o.removeAttribute("height"),o.style.width=a,o.style.height=n})}async function getHljsStyles(){const t=document.querySelector("#hljs");if(!t)return"";try{return`<style>${await(await fetch(t.href)).text()}</style>`}catch(e){return console.warn("Failed to fetch highlight.js styles:",e),""}}function mergeCss(t){return juice(t,{inlinePseudoElements:!0,preserveImportant:!0})}function modifyHtmlStructure(t){const e=document.createElement("div");return e.innerHTML=t,e.querySelectorAll("li > ul, li > ol").forEach(o=>{o.parentElement.insertAdjacentElement("afterend",o)}),e.innerHTML}function createEmptyNode(){const t=document.createElement("p");return t.style.fontSize="0",t.style.lineHeight="0",t.style.margin="0",t.innerHTML="&nbsp;",t}async function processClipboardContent(t){const e=document.getElementById("output"),o=await getHljsStyles();o&&(e.innerHTML=o+e.innerHTML),e.innerHTML=modifyHtmlStructure(mergeCss(e.innerHTML)),e.innerHTML=e.innerHTML.replace(/([^-])top:(.*?)em/g,"$1transform: translateY($2em)").replace(/hsl\(var\(--foreground\)\)/g,"#3f3f3f").replace(/var\(--blockquote-background\)/g,"#f7f7f7").replace(/var\(--md-primary-color\)/g,t).replace(/--md-primary-color:.+?;/g,"").replace(/<span class="nodeLabel"([^>]*)><p[^>]*>(.*?)<\/p><\/span>/g,'<span class="nodeLabel"$1>$2</span>').replace(/<span class="edgeLabel"([^>]*)><p[^>]*>(.*?)<\/p><\/span>/g,'<span class="edgeLabel"$1>$2</span>'),solveWeChatImage();const a=createEmptyNode(),n=createEmptyNode();e.insertBefore(a,e.firstChild),e.appendChild(n),e.querySelectorAll(".nodeLabel").forEach(l=>{const i=l.parentElement,d=i.getAttribute("xmlns"),f=i.getAttribute("style"),p=document.createElement("section");p.setAttribute("xmlns",d),p.setAttribute("style",f),p.innerHTML=i.innerHTML;const g=i.parentElement;g.innerHTML="",g.appendChild(p)}),e.innerHTML=e.innerHTML.replace(/<tspan([^>]*)>/g,'<tspan$1 style="fill: #333333 !important; color: #333333 !important; stroke: none !important;">')}function legacyCopy(t){return new Promise((e,o)=>{try{const a=document.createElement("textarea");a.value=t,a.setAttribute("readonly","true"),a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();const n=document.execCommand("copy");document.body.removeChild(a),n?e():o(new Error("execCommand failed"))}catch(a){o(a)}})}async function copyPlain(t){if(window.isSecureContext&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{}await legacyCopy(t)}const useStore=defineStore("store",()=>{const t=useDark(),e=useToggle(t),o=useStorage("isMacCodeBlock",defaultStyleConfig.isMacCodeBlock),a=useToggle(o),n=useStorage("isShowLineNumber",defaultStyleConfig.isShowLineNumber),s=useToggle(n),l=useStorage("isEditOnLeft",!0),i=useToggle(l),d=useStorage("isCiteStatus",defaultStyleConfig.isCiteStatus),f=useToggle(d),p=useStorage("showAIToolbox",!0),g=useToggle(p),E=useStorage("isCountStatus",defaultStyleConfig.isCountStatus),m=useToggle(E),S=useStorage(addPrefix("use_indent"),!1),_=useToggle(S),w=useStorage(addPrefix("use_justify"),!1),u=useToggle(w),C=ref(""),x=useStorage(addPrefix("theme"),defaultStyleConfig.theme),b=useStorage("fonts",defaultStyleConfig.fontFamily),v=useStorage("size",defaultStyleConfig.fontSize),y=useStorage("color",defaultStyleConfig.primaryColor),$=useStorage("codeBlockTheme",defaultStyleConfig.codeBlockTheme),T=useStorage("legend",defaultStyleConfig.legend),Y=useStorage("previewWidth",widthOptions[0].value),te=computed(()=>Number(v.value.replace("px",""))),V=ref(null),ae=useStorage("__editor_content",DEFAULT_CONTENT),q=useStorage(addPrefix("is_open_right_slider"),!1),z=useStorage(addPrefix("is_open_post_slider"),!1),G=useStorage(addPrefix("posts"),[{id:v4(),title:"内容1",content:DEFAULT_CONTENT,history:[{datetime:new Date().toLocaleString("zh-cn"),content:DEFAULT_CONTENT}],createDatetime:new Date,updateDatetime:new Date}]),N=useStorage(addPrefix("current_post_id"),""),K=useStorage("isMobile",!1);function W(){K.value=window.innerWidth<=768}onMounted(()=>{W(),window.addEventListener("resize",W)}),onBeforeUnmount(()=>{window.removeEventListener("resize",W)}),onBeforeMount(()=>{G.value=G.value.map((A,ue)=>{const we=Date.now();return{...A,id:A.id??v4(),createDatetime:A.createDatetime??new Date(we+ue),updateDatetime:A.updateDatetime??new Date(we+ue)}}),(!N.value||!G.value.some(A=>A.id===N.value))&&(N.value=G.value[0]?.id??"")});const de=A=>G.value.findIndex(ue=>ue.id===A),Z=computed({get:()=>de(N.value),set:A=>{A>=0&&A<G.value.length&&(N.value=G.value[A].id)}}),le=A=>G.value.find(ue=>ue.id===A),ge=(A,ue=null)=>{const we={id:v4(),title:A,content:`# ${A}`,history:[{datetime:new Date().toLocaleString("zh-cn"),content:`# ${A}`}],createDatetime:new Date,updateDatetime:new Date,parentId:ue};G.value.push(we),N.value=we.id},P=(A,ue)=>{const we=le(A);we&&(we.title=ue)},H=A=>{const ue=de(A);ue!==-1&&(G.value.splice(ue,1),N.value=G.value[Math.min(ue,G.value.length-1)]?.id??"")},M=(A,ue)=>{const we=le(A);we&&(we.parentId=ue,we.updateDatetime=new Date)},F=()=>{G.value.forEach(A=>{A.collapsed=!0})},ne=()=>{G.value.forEach(A=>{A.collapsed=!1})};watch(N,()=>{const A=le(N.value);A&&V.value&&V.value.dispatch({changes:{from:0,to:V.value.state.doc.length,insert:A.content}})}),onMounted(()=>{if(ae.value!==DEFAULT_CONTENT){const A=le(N.value);A&&(A.content=ae.value),ae.value=DEFAULT_CONTENT}});const J=()=>{V.value&&formatDoc(V.value.state.doc.toString()).then(A=>{G.value[Z.value].content=A,V.value.dispatch({changes:{from:0,to:V.value.state.doc.length,insert:A}})})},ee=()=>{const A=$.value,ue=document.querySelector("#hljs");if(ue)ue.setAttribute("href",A);else{const we=document.createElement("link");we.setAttribute("type","text/css"),we.setAttribute("rel","stylesheet"),we.setAttribute("href",A),we.setAttribute("id","hljs"),document.head.appendChild(we)}},L=ref(null),R=ref(null),oe=A=>{L.value&&L.value.dispatch({changes:{from:0,to:L.value.state.doc.length,insert:A}})},fe=useStorage("__css_content",DEFAULT_CSS_CONTENT),se=useStorage(addPrefix("css_content_config"),{active:"方案1",tabs:[{title:"方案1",name:"方案1",content:fe.value||DEFAULT_CSS_CONTENT}]});onMounted(()=>{fe.value=""});const re=()=>se.value.tabs.find(A=>A.name===se.value.active),ce=A=>{se.value.active=A;const ue=se.value.tabs.find(we=>we.name===A).content;oe(ue)},j=A=>{const ue=re();ue.title=A,ue.name=A,se.value.active=A},I=A=>{se.value.tabs.push({name:A,title:A,content:DEFAULT_CSS_CONTENT}),se.value.active=A,oe(DEFAULT_CSS_CONTENT)},_e=A=>se.value.tabs.every(({name:ue})=>ue!==A),me=initRenderer({theme:customCssWithTemplate(css2json(re().content),y.value,customizeTheme(themeMap[x.value],{fontSize:te.value,color:y.value})),fonts:b.value,size:v.value,isUseIndent:S.value,isUseJustify:w.value,isMacCodeBlock:o.value,isShowLineNumber:n.value}),be=reactive({chars:0,words:0,minutes:0}),ke=ref([]),xe=()=>{ee(),me.reset({citeStatus:d.value,legend:T.value,isUseIndent:S.value,isUseJustify:w.value,countStatus:E.value,isMacCodeBlock:o.value,isShowLineNumber:n.value});const A=V.value?V.value.state.doc.toString():"",{html:ue,readingTime:we}=renderMarkdown(A,me);be.chars=A.length,be.words=we.words,be.minutes=Math.ceil(we.minutes),C.value=postProcessHtml(ue,we,me);const Ee=document.createElement("div");Ee.innerHTML=C.value;const Xe=Ee.querySelectorAll("[data-heading]");ke.value=[];let Ae=0;for(const Ie of Xe)Ie.setAttribute("id",`${Ae}`),ke.value.push({url:`#${Ae}`,title:`${Ie.textContent}`,level:Number(Ie.tagName.slice(1))}),Ae++;C.value=Ee.innerHTML},ye=()=>{if(L.value){const A=css2json(L.value.state.doc.toString()),ue=customCssWithTemplate(A,y.value,customizeTheme(themeMap[x.value],{fontSize:te.value,color:y.value}));me.setOptions({theme:ue}),xe()}};onMounted(()=>{const A=document.querySelector("#cssEditor");A.value=re().content;const ue=document.createElement("div");A.parentNode?.replaceChild(ue,A),R.value=new Compartment;const we=EditorState.create({doc:re().content,extensions:[cssSetup(),R.value.of(theme(t.value)),EditorView.updateListener.of(Ee=>{Ee.docChanged&&(ye(),re().content=Ee.state.doc.toString())})]});L.value=markRaw(new EditorView({state:we,parent:ue}))}),watch(t,()=>{L.value&&R.value&&L.value.dispatch({effects:R.value.reconfigure(theme(t.value))})});const Ce=()=>{d.value=defaultStyleConfig.isCiteStatus,o.value=defaultStyleConfig.isMacCodeBlock,n.value=defaultStyleConfig.isShowLineNumber,E.value=defaultStyleConfig.isCountStatus,x.value=defaultStyleConfig.theme,b.value=defaultStyleConfig.fontFamily,v.value=defaultStyleConfig.fontSize,y.value=defaultStyleConfig.primaryColor,$.value=defaultStyleConfig.codeBlockTheme,T.value=defaultStyleConfig.legend,se.value={active:"方案 1",tabs:[{title:"方案 1",name:"方案 1",content:fe.value||DEFAULT_CSS_CONTENT}]},L.value&&L.value.dispatch({changes:{from:0,to:L.value.state.doc.length,insert:DEFAULT_CSS_CONTENT}}),ye(),xe(),toast.success("样式已重置")},ve=A=>(...ue)=>{A(...ue),xe()},pe=(A,ue)=>{const we=themeMap[x.value],Ee=Number(A.replace("px",""));return customCssWithTemplate(css2json(re().content),ue,customizeTheme(we,{fontSize:Ee,color:ue}))},Ve=ve(A=>{me.setOptions({theme:customCssWithTemplate(css2json(re().content),y.value,customizeTheme(themeMap[A],{fontSize:te.value}))}),x.value=A}),Be=ve(A=>{me.setOptions({fonts:A}),b.value=A}),$e=ve(A=>{const ue=pe(A,y.value);me.setOptions({size:A,theme:ue}),v.value=A}),Ne=ve(A=>{const ue=pe(v.value,A);me.setOptions({theme:ue}),y.value=A}),ie=ve(A=>{$.value=A}),Q=ve(A=>{Y.value=A}),he=ve(A=>{T.value=A}),Te=ve(()=>{a()}),Ge=ve(()=>{s()}),Le=ve(()=>{f()}),De=ve(()=>{m()}),h=ve(()=>{_()}),D=ve(()=>{u()}),U=ve(()=>{g()}),Pe=()=>{const A=processHtmlContent(y.value);return document.querySelector("#output").innerHTML=C.value,A},Me=()=>{exportHTML(y.value,G.value[Z.value].title),document.querySelector("#output").innerHTML=C.value},Ue=()=>{V.value&&exportPureHTML(V.value.state.doc.toString(),G.value[Z.value].title)},ze=async()=>{const A=document.querySelector("#output-wrapper>.preview"),ue=await toPng(A,{backgroundColor:t.value?"":"#fff",skipFonts:!0,pixelRatio:Math.max(window.devicePixelRatio||1,2),style:{margin:"0"}});downloadFile(ue,`${sanitizeTitle(G.value[Z.value].title)}.png`,"image/png")},Fe=()=>{exportPDF(y.value,G.value[Z.value].title),document.querySelector("#output").innerHTML=C.value},He=()=>{V.value&&downloadMD(V.value.state.doc.toString(),G.value[Z.value].title)},qe=()=>{V.value&&(V.value.dispatch({changes:{from:0,to:V.value.state.doc.length,insert:DEFAULT_CONTENT}}),toast.success("文档已重置"))},Ke=()=>{V.value&&(V.value.dispatch({changes:{from:0,to:V.value.state.doc.length,insert:""}}),toast.success("内容已清空"))},je=async()=>{if(V.value){const A=V.value.state.selection.main,ue=V.value.state.doc.sliceString(A.from,A.to);copyPlain(ue)}},Ye=async()=>{try{const A=await navigator.clipboard.readText();V.value&&V.value.dispatch(V.value.state.replaceSelection(A))}catch(A){console.log("粘贴失败",A)}},We=()=>{V.value&&console.log("Undo should be handled by keyboard shortcuts")},Je=()=>{V.value&&console.log("Redo should be handled by keyboard shortcuts")},Oe=ref(!1);return{isDark:t,toggleDark:e,isEditOnLeft:l,toggleEditOnLeft:i,isMacCodeBlock:o,isShowLineNumber:n,isCiteStatus:d,citeStatusChanged:Le,showAIToolbox:p,aiToolboxChanged:U,isUseIndent:S,useIndentChanged:h,isUseJustify:w,useJustifyChanged:D,isCountStatus:E,countStatusChanged:De,output:C,editor:V,cssEditor:L,theme:x,fontFamily:b,fontSize:v,primaryColor:y,codeBlockTheme:$,legend:T,readingTime:be,previewWidth:Y,previewWidthChanged:Q,editorRefresh:xe,themeChanged:Ve,fontChanged:Be,sizeChanged:$e,colorChanged:Ne,codeBlockThemeChanged:ie,legendChanged:he,macCodeBlockChanged:Te,showLineNumberChanged:Ge,formatContent:J,exportEditorContent2HTML:Me,exportEditorContent2PureHTML:Ue,exportEditorContent2MD:He,exportEditorContent2PDF:Fe,downloadAsCardImage:ze,importDefaultContent:qe,clearContent:Ke,copyToClipboard:je,pasteFromClipboard:Ye,undo:We,redo:Je,isOpenConfirmDialog:Oe,resetStyleConfirm:()=>{Oe.value=!0},resetStyle:Ce,cssContentConfig:se,addCssContentTab:I,validatorTabName:_e,setCssEditorValue:oe,tabChanged:ce,renameTab:j,posts:G,currentPostId:N,currentPostIndex:Z,getPostById:le,addPost:ge,renamePost:P,delPost:H,isOpenPostSlider:z,isOpenRightSlider:q,titleList:ke,isMobile:K,updatePostParentId:M,collapseAllPosts:F,expandAllPosts:ne,editorContent2HTML:Pe}}),useDisplayStore=defineStore("display",()=>{const t=useStorage("isShowCssEditor",!1),e=useToggle(t),o=ref(!1),a=useToggle(o),n=ref(!1),s=useToggle(n),l=ref(!1),i=useToggle(l),d=ref(!1),f=ref(!1);function p(E){d.value=E??!d.value}function g(E){f.value=E??!f.value}return{isShowCssEditor:t,toggleShowCssEditor:e,isShowInsertFormDialog:o,toggleShowInsertFormDialog:a,isShowInsertMpCardDialog:n,toggleShowInsertMpCardDialog:s,isShowUploadImgDialog:l,toggleShowUploadImgDialog:i,aiDialogVisible:d,toggleAIDialog:p,aiImageDialogVisible:f,toggleAIImageDialog:g}});function getAllStoreStates(){const t=useStore(),e=useDisplayStore();return{isDark:t.isDark,isEditOnLeft:t.isEditOnLeft,isMacCodeBlock:t.isMacCodeBlock,isShowLineNumber:t.isShowLineNumber,isCiteStatus:t.isCiteStatus,showAIToolbox:t.showAIToolbox,isCountStatus:t.isCountStatus,isUseIndent:t.isUseIndent,isUseJustify:t.isUseJustify,isOpenRightSlider:t.isOpenRightSlider,isOpenPostSlider:t.isOpenPostSlider,theme:t.theme,fontFamily:t.fontFamily,fontSize:t.fontSize,primaryColor:t.primaryColor,codeBlockTheme:t.codeBlockTheme,legend:t.legend,currentPostId:t.currentPostId,currentPostIndex:t.currentPostIndex,posts:t.posts,cssContentConfig:t.cssContentConfig,titleList:t.titleList,readingTime:t.readingTime,isShowCssEditor:e.isShowCssEditor,isShowInsertFormDialog:e.isShowInsertFormDialog,isShowUploadImgDialog:e.isShowUploadImgDialog,isShowInsertMpCardDialog:e.isShowInsertMpCardDialog,aiDialogVisible:e.aiDialogVisible,aiImageDialogVisible:e.aiImageDialogVisible}}const _hoisted_1$u={class:"flex select-none items-center justify-end px-5 py-2 text-xs"},_hoisted_2$n={class:"space-x-2"},_sfc_main$1O=defineComponent({__name:"Footer",setup(t){const e=useStore(),{readingTime:o}=storeToRefs(e);return(a,n)=>(openBlock(),createElementBlock("footer",_hoisted_1$u,[createBaseVNode("div",_hoisted_2$n,[createBaseVNode("span",null,toDisplayString(unref(o).words)+" 个词 ",1),createBaseVNode("span",null,toDisplayString(unref(o).chars)+" 个字符 ",1),createBaseVNode("span",null," 阅读大约需 "+toDisplayString(unref(o).minutes)+" 分钟 ",1)])]))}}),_sfc_main$1N=defineComponent({__name:"AlertDialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Tv),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}});function cn(...t){return twMerge(clsx(t))}const _sfc_main$1M=defineComponent({__name:"AlertDialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(Av),null,{default:withCtx(()=>[createVNode(unref(kv),{class:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80"}),createVNode(unref(Ov),mergeProps(unref(s),{class:unref(cn)("fixed left-1/2 top-1/2 z-200 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$1L=defineComponent({__name:"AlertDialogFooter",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1K=defineComponent({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(O),{as:t.as,"as-child":t.asChild,class:normalizeClass(unref(cn)(unref(buttonVariants)({variant:t.variant,size:t.size}),e.class))},{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),buttonVariants=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),_sfc_main$1J=defineComponent({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Nv),mergeProps(o.value,{class:unref(cn)(unref(buttonVariants)(),e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1I=defineComponent({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Mv),mergeProps(o.value,{class:unref(cn)(unref(buttonVariants)({variant:"outline"}),"mt-2 sm:mt-0",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1H=defineComponent({__name:"AlertDialogHeader",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("flex flex-col gap-y-2 text-center sm:text-left",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1G=defineComponent({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Fv),mergeProps(o.value,{class:unref(cn)("text-sm text-muted-foreground",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1F=defineComponent({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Vv),mergeProps(o.value,{class:unref(cn)("text-lg font-semibold",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1E=defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(nu),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$1D=defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(Iv),null,{default:withCtx(()=>[createVNode(unref($u),{class:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-200 bg-black/80"}),createVNode(unref(Pu),mergeProps(unref(s),{class:unref(cn)("fixed left-1/2 top-1/2 z-200 grid w-[90vw] max-w-md sm:max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default"),createVNode(unref(Xl),{class:"data-[state=open]:bg-accent ring-offset-background data-[state=open]:text-muted-foreground focus:ring-ring absolute right-4 top-4 rounded-sm opacity-70 transition-opacity disabled:pointer-events-none hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-offset-2"},{default:withCtx(()=>[createVNode(unref(X),{class:"h-4 w-4"}),i[0]||(i[0]=createBaseVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),_sfc_main$1C=defineComponent({__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const o=t,a=e,n=reactiveOmit(o,"class"),s=useForwardPropsEmits(n,a);return(l,i)=>(openBlock(),createBlock(unref(RadioGroupRoot_default),mergeProps({"data-slot":"radio-group",class:unref(cn)("grid gap-3",o.class)},unref(s)),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1B=defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Vh),mergeProps(o.value,{class:unref(cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1A=defineComponent({__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},setup(t){const e=t,o=reactiveOmit(e,"class"),a=useForwardProps(o);return(n,s)=>(openBlock(),createBlock(unref(RadioGroupItem_default),mergeProps({"data-slot":"radio-group-item"},unref(a),{class:unref(cn)("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e.class)}),{default:withCtx(()=>[createVNode(unref(RadioGroupIndicator_default),{"data-slot":"radio-group-indicator",class:"relative flex items-center justify-center"},{default:withCtx(()=>[createVNode(unref(Circle),{class:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})]),_:1})]),_:1},16,["class"]))}}),_sfc_main$1z=defineComponent({__name:"Textarea",props:{class:{},defaultValue:{},modelValue:{}},setup(t,{emit:e}){const o=t,n=useVModel(o,"modelValue",e,{passive:!0,defaultValue:o.defaultValue});return(s,l)=>withDirectives((openBlock(),createElementBlock("textarea",{"onUpdate:modelValue":l[0]||(l[0]=i=>isRef(n)?n.value=i:null),class:normalizeClass(unref(cn)("flex min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,2)),[[vModelText,unref(n)]])}}),_hoisted_1$t={class:"min-h-[auto] md:min-h-[64px]"},_hoisted_2$m={class:"flex flex-1 flex-col justify-between"},_hoisted_3$j={class:"min-h-[40px] flex items-center w-full"},_hoisted_4$h={key:0,class:"mt-1 min-h-[20px] md:min-h-[24px] flex items-center text-[12px] text-red-500"},_hoisted_5$f={key:1,class:"mb-[-12px] md:mb-[-24px]"},_sfc_main$1y=defineComponent({__name:"FormItem",props:{label:{},required:{type:Boolean},error:{},width:{}},setup(t){const e=t;return(o,a)=>{const n=_sfc_main$1B;return openBlock(),createElementBlock("div",_hoisted_1$t,[createVNode(n,{class:"mb-4 md:mb-[24px] flex flex-col md:flex-row md:items-center"},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(["mb-1 md:mb-0 md:mr-4 min-h-[auto] md:min-h-[40px] w-full md:w-[150px] flex shrink-0 items-center justify-start md:justify-end font-bold text-sm md:text-base",{required:e.required}])},toDisplayString(e.label),3),createBaseVNode("div",_hoisted_2$m,[createBaseVNode("div",_hoisted_3$j,[renderSlot(o.$slots,"default",{},void 0,!0)]),t.error?(openBlock(),createElementBlock("p",_hoisted_4$h,toDisplayString(t.error),1)):createCommentVNode("",!0),t.error?(openBlock(),createElementBlock("div",_hoisted_5$f)):createCommentVNode("",!0)])]),_:3})])}}}),__unplugin_components_14=_export_sfc(_sfc_main$1y,[["__scopeId","data-v-e65b7ec5"]]),_sfc_main$1x=defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{}},setup(t,{expose:e,emit:o}){const a=t,s=useVModel(a,"modelValue",o,{passive:!0,defaultValue:a.defaultValue}),l=useAttrs(),i=ref();return e({focus:()=>i.value?.focus(),blur:()=>i.value?.blur(),select:()=>i.value?.select(),setSelectionRange:(d,f)=>i.value?.setSelectionRange(d,f),inputElement:i}),(d,f)=>withDirectives((openBlock(),createElementBlock("input",mergeProps({ref_key:"inputRef",ref:i,"onUpdate:modelValue":f[0]||(f[0]=p=>isRef(s)?s.value=p:null)},unref(l),{class:unref(cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a.class)}),null,16)),[[vModelDynamic,unref(s)]])}}),_sfc_main$1w=defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1v=defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Bu),mergeProps(unref(a),{class:unref(cn)("text-lg font-semibold leading-none tracking-tight",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$s={class:"inline-flex items-center space-x-2 w-20"},_hoisted_2$l={class:"inline-flex items-center space-x-2 w-20"},_hoisted_3$i={class:"inline-flex items-center space-x-2 w-20"},_hoisted_4$g={class:"inline-flex items-center space-x-2 w-20"},_hoisted_5$e={class:"inline-flex items-center space-x-2 w-20"},_sfc_main$1u=defineComponent({__name:"InsertMpCardDialog",setup(t){const e=useStore(),o=useDisplayStore(),{toggleShowInsertMpCardDialog:a}=o,n=useStorage(addPrefix("mp-profile"),{id:"",name:"",logo:"",desc:"",serviceType:"1",verify:"0"}),s=toTypedSchema(create$3({id:create$6().required("公众号 ID 不能为空"),name:create$6().required("公众号名称 不能为空"),logo:create$6().optional().url("公众号 Logo 必须是一个有效的 URL"),desc:create$6().optional(),serviceType:create$6().required(),verify:create$6().required()}));function l(d){const f=d.logo||"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/mp-logo.png";return`<section class="mp_profile_iframe_wrp custom_select_card_wrp" nodeleaf="">
582
- <mp-common-profile class="mpprofile js_uneditable custom_select_card mp_profile_iframe" ${['data-pluginname="mpprofile"',`data-id="${d.id}"`,`data-nickname="${d.name}"`,`data-headimg="${f}"`,d.desc&&`data-signature="${d.desc}"`,`data-service_type="${d.serviceType||"1"}"`,`data-verify_status="${d.verify||"0"}"`].filter(Boolean).join(" ")}></mp-common-profile>
583
- <br class="ProseMirror-trailingBreak">
584
- </section>`}function i(d){n.value=d;const f=l(d),p=toRaw(e.editor),g=p.state.selection.main;p.dispatch({changes:{from:g.from,to:g.to,insert:`
585
- ${f}
586
- `}}),toast.success("公众号名片插入成功"),a(!1)}return(d,f)=>{const p=_sfc_main$1v,g=_sfc_main$1w,E=_sfc_main$1x,m=__unplugin_components_14,S=_sfc_main$1z,_=_sfc_main$1A,w=_sfc_main$1B,u=_sfc_main$1C,C=_sfc_main$1K,x=_sfc_main$1D,b=_sfc_main$1E;return openBlock(),createBlock(b,{open:unref(o).isShowInsertMpCardDialog,"onUpdate:open":f[0]||(f[0]=v=>unref(o).isShowInsertMpCardDialog=v)},{default:withCtx(()=>[createVNode(x,null,{default:withCtx(()=>[createVNode(g,null,{default:withCtx(()=>[createVNode(p,null,{default:withCtx(()=>[...f[1]||(f[1]=[createTextVNode("插入公众号名片",-1)])]),_:1})]),_:1}),createVNode(unref(Form),{"validation-schema":unref(s),"initial-values":unref(n),onSubmit:i},{default:withCtx(()=>[createVNode(unref(Field),{name:"id"},{default:withCtx(({field:v,errorMessage:y})=>[createVNode(m,{label:"公众号 ID",required:"",error:y,width:90},{default:withCtx(()=>[createVNode(E,mergeProps(v,{modelValue:v.value,"onUpdate:modelValue":$=>v.value=$,modelModifiers:{trim:!0},placeholder:"例:MzIxNjA5ODQ0OQ=="}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"name"},{default:withCtx(({field:v,errorMessage:y})=>[createVNode(m,{label:"公众号名称",required:"",error:y,width:90},{default:withCtx(()=>[createVNode(E,mergeProps(v,{modelValue:v.value,"onUpdate:modelValue":$=>v.value=$,modelModifiers:{trim:!0},placeholder:"例:Doocs"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"logo"},{default:withCtx(({field:v,errorMessage:y})=>[createVNode(m,{label:"公众号 Logo",error:y,width:90},{default:withCtx(()=>[createVNode(E,mergeProps(v,{modelValue:v.value,"onUpdate:modelValue":$=>v.value=$,modelModifiers:{trim:!0},placeholder:"例:https://doocs.com/mp-logo.png"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"desc"},{default:withCtx(({field:v,errorMessage:y})=>[createVNode(m,{label:"公众号描述",error:y,width:90},{default:withCtx(()=>[createVNode(S,mergeProps(v,{modelValue:v.value,"onUpdate:modelValue":$=>v.value=$,modelModifiers:{trim:!0},rows:"3",placeholder:"例:GitHub 开源组织 @Doocs 旗下唯一公众号,专注分享技术领域相关知识及行业最新资讯。"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"serviceType"},{default:withCtx(({field:v,errorMessage:y})=>[createVNode(m,{label:"公众号类型",required:"",error:y,width:90},{default:withCtx(()=>[createVNode(u,mergeProps({class:"flex gap-5"},v,{"default-value":v.value}),{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$s,[createVNode(_,{id:"option-one",value:"1"}),createVNode(w,{for:"option-one"},{default:withCtx(()=>[...f[2]||(f[2]=[createTextVNode("公众号",-1)])]),_:1})]),createBaseVNode("div",_hoisted_2$l,[createVNode(_,{id:"option-two",value:"2"}),createVNode(w,{for:"option-two"},{default:withCtx(()=>[...f[3]||(f[3]=[createTextVNode("服务号",-1)])]),_:1})])]),_:1},16,["default-value"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"verify"},{default:withCtx(({field:v,errorMessage:y})=>[createVNode(m,{label:"认证",required:"",error:y,width:90},{default:withCtx(()=>[createVNode(u,mergeProps({class:"flex gap-5"},v,{"default-value":v.value}),{default:withCtx(()=>[createBaseVNode("div",_hoisted_3$i,[createVNode(_,{id:"service-type-option-one",value:"0"}),createVNode(w,{for:"service-type-option-one"},{default:withCtx(()=>[...f[4]||(f[4]=[createTextVNode("无",-1)])]),_:1})]),createBaseVNode("div",_hoisted_4$g,[createVNode(_,{id:"service-type-option-two",value:"1"}),createVNode(w,{for:"service-type-option-two"},{default:withCtx(()=>[...f[5]||(f[5]=[createTextVNode("个人",-1)])]),_:1})]),createBaseVNode("div",_hoisted_5$e,[createVNode(_,{id:"service-type-option-three",value:"2"}),createVNode(w,{for:"service-type-option-three"},{default:withCtx(()=>[...f[6]||(f[6]=[createTextVNode("企业",-1)])]),_:1})])]),_:1},16,["default-value"])]),_:2},1032,["error"])]),_:1}),createVNode(m,null,{default:withCtx(()=>[createVNode(C,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://github.com/doocs/md/blob/main/docs/mp-card.md",target:"_blank"},{default:withCtx(()=>[...f[7]||(f[7]=[createTextVNode(" 如何获取公众号 ID? ",-1)])]),_:1})]),_:1}),createVNode(m,null,{default:withCtx(()=>[createVNode(C,{type:"submit"},{default:withCtx(()=>[...f[8]||(f[8]=[createTextVNode(" 确认 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1})]),_:1},8,["open"])}}}),_sfc_main$1t=defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1s=defineComponent({__name:"NumberField",props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},formatOptions:{},locale:{},disabled:{type:Boolean},required:{type:Boolean},name:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(gy),mergeProps(unref(s),{class:unref(cn)("grid gap-1.5",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1r=defineComponent({__name:"NumberFieldContent",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("relative has-data-[slot=increment]:*:data-[slot=input]:pr-5 has-data-[slot=decrement]:*:data-[slot=input]:pl-5",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$1q=defineComponent({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Cy),mergeProps({"data-slot":"increment"},unref(a),{class:unref(cn)("absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default",{},()=>[createVNode(unref(Plus),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),_sfc_main$1p=defineComponent({__name:"NumberFieldInput",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(by),{"data-slot":"input",class:normalizeClass(unref(cn)("flex h-10 w-full rounded-md border border-input bg-background py-2 text-sm text-center ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e.class))},null,8,["class"]))}}),_sfc_main$1o=defineComponent({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(wy),mergeProps({"data-slot":"decrement"},unref(a),{class:unref(cn)("absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default",{},()=>[createVNode(unref(Minus),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),_hoisted_1$r={class:"space-x-2 flex justify-between"},_hoisted_2$k={class:"space-y-2 border rounded p-2"},_sfc_main$1n=defineComponent({__name:"InsertFormDialog",setup(t){const e=useStore(),o=useDisplayStore(),{toggleShowInsertFormDialog:a}=o,n=ref(3),s=ref(3),l=ref({});function i(){n.value=3,s.value=3,l.value={}}function d(){const p=createTable({rows:n.value,cols:s.value,data:l.value}),g=toRaw(e.editor),E=g.state.selection.main;g.dispatch({changes:{from:E.from,to:E.to,insert:`
587
- ${p}
588
- `}}),i(),a()}function f(p){p||a(!1)}return(p,g)=>{const E=_sfc_main$1v,m=_sfc_main$1w,S=_sfc_main$1B,_=_sfc_main$1o,w=_sfc_main$1p,u=_sfc_main$1q,C=_sfc_main$1r,x=_sfc_main$1s,b=_sfc_main$1x,v=_sfc_main$1K,y=_sfc_main$1t,$=_sfc_main$1D,T=_sfc_main$1E;return openBlock(),createBlock(T,{open:unref(o).isShowInsertFormDialog,"onUpdate:open":f},{default:withCtx(()=>[createVNode($,null,{default:withCtx(()=>[createVNode(m,null,{default:withCtx(()=>[createVNode(E,null,{default:withCtx(()=>[...g[3]||(g[3]=[createTextVNode("插入表格",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_1$r,[createVNode(x,{modelValue:unref(n),"onUpdate:modelValue":g[0]||(g[0]=Y=>isRef(n)?n.value=Y:null),min:1,max:100},{default:withCtx(()=>[createVNode(S,null,{default:withCtx(()=>[...g[4]||(g[4]=[createTextVNode("行数",-1)])]),_:1}),createVNode(C,null,{default:withCtx(()=>[createVNode(_),createVNode(w),createVNode(u)]),_:1})]),_:1},8,["modelValue"]),createVNode(x,{modelValue:unref(s),"onUpdate:modelValue":g[1]||(g[1]=Y=>isRef(s)?s.value=Y:null),min:1,max:100},{default:withCtx(()=>[createVNode(S,null,{default:withCtx(()=>[...g[5]||(g[5]=[createTextVNode("列数",-1)])]),_:1}),createVNode(C,null,{default:withCtx(()=>[createVNode(_),createVNode(w),createVNode(u)]),_:1})]),_:1},8,["modelValue"])]),createBaseVNode("div",_hoisted_2$k,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(n)+1,Y=>(openBlock(),createElementBlock("div",{key:Y,class:normalizeClass([{"head-style":Y===1},"space-x-2 flex"])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(s),te=>(openBlock(),createBlock(b,{key:te,modelValue:unref(l)[`k_${Y-1}_${te-1}`],"onUpdate:modelValue":V=>unref(l)[`k_${Y-1}_${te-1}`]=V,class:normalizeClass({"bg-gray-100 dark:bg-gray-900":Y===1}),placeholder:Y===1?"表头":""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"]))),128))],2))),128))]),createVNode(y,null,{default:withCtx(()=>[createVNode(v,{variant:"outline",onClick:g[2]||(g[2]=Y=>unref(a)(!1))},{default:withCtx(()=>[...g[6]||(g[6]=[createTextVNode(" 取 消 ",-1)])]),_:1}),createVNode(v,{onClick:d},{default:withCtx(()=>[...g[7]||(g[7]=[createTextVNode(" 确 定 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),_sfc_main$1m=defineComponent({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Cg),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_hoisted_1$q={class:"space-y-4 min-w-0"},_hoisted_2$j={class:"h-60 border border-gray-200 dark:border-gray-700 rounded-lg flex flex-col overflow-y-auto"},_sfc_main$1l=defineComponent({__name:"CustomUploadForm",setup(t){const e=useLocalStorage("formCustomConfig",removeLeft(`
589
- const { file, util, okCb, errCb } = CUSTOM_ARG
590
- const param = new FormData()
591
- param.append('file', file)
592
- util.axios.post('${window.location.origin}/upload', param, {
593
- headers: { 'Content-Type': 'multipart/form-data' }
594
- }).then(res => {
595
- okCb(res.url)
596
- }).catch(err => {
597
- errCb(err)
598
- })
599
- `).trim()),o=useTemplateRef("formCustomTextarea"),a=useStore(),{isDark:n}=storeToRefs(a),s=ref(null),l=new Compartment;onMounted(()=>{const d=new EditorView({parent:o.value,extensions:[javascriptSetup(),l.of(theme(n.value))],doc:e.value});s.value=d}),watch(n,d=>{s.value?.dispatch({effects:l.reconfigure(theme(d))})}),onUnmounted(()=>{s.value&&s.value.destroy()});function i(){const d=s.value.state.doc.toString();localStorage.setItem("formCustomConfig",d),e.value=d,toast.success("保存成功")}return(d,f)=>{const p=_sfc_main$1K;return openBlock(),createElementBlock("div",_hoisted_1$q,[createBaseVNode("div",_hoisted_2$j,[createBaseVNode("div",{ref_key:"formCustomTextarea",ref:o,class:"flex-1 custom-codemirror"},null,512)]),createVNode(p,{variant:"link",class:"p-0",as:"a",href:"https://github.com/doocs/md/blob/main/docs/custom-upload.md",target:"_blank"},{default:withCtx(()=>[...f[0]||(f[0]=[createTextVNode(" 参数详情? ",-1)])]),_:1}),createVNode(p,{class:"block",onClick:i},{default:withCtx(()=>[...f[1]||(f[1]=[createTextVNode(" 保存配置 ",-1)])]),_:1})])}}}),__unplugin_components_16=_export_sfc(_sfc_main$1l,[["__scopeId","data-v-e62c3060"]]),_sfc_main$1k=defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(_g),mergeProps({class:unref(cn)("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e.class)},o.value),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$1j=defineComponent({__name:"Progress",props:{modelValue:{},max:{},getValueLabel:{type:Function},asChild:{type:Boolean},as:{}},setup(t,{emit:e}){const o=t,a=e,n=useVModel(o,"modelValue",a,{passive:!0,defaultValue:0}),s=Se(o,a);return(l,i)=>(openBlock(),createBlock(unref(Ry),mergeProps(unref(s),{modelValue:unref(n),"onUpdate:modelValue":i[0]||(i[0]=d=>isRef(n)?n.value=d:null),class:"relative overflow-hidden bg-blackA9 rounded-full w-full h-4 sm:h-5",style:{transform:"translateZ(0)"}}),{default:withCtx(()=>[createVNode(unref(Ay),{class:"bg-primary rounded-full w-full h-full transition-transform duration-[660ms] ease-[cubic-bezier(0.65, 0, 0.35, 1)]",style:normalizeStyle({transform:`translateX(-${100-(Number(unref(n))||0)}%)`})},null,8,["style"])]),_:1},16,["modelValue"]))}}),_sfc_main$1i=defineComponent({__name:"Switch",props:{defaultChecked:{type:Boolean},checked:{type:Boolean},disabled:{type:Boolean},required:{type:Boolean},name:{},id:{},value:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(gg),mergeProps(unref(s),{class:unref(cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",o.class)}),{default:withCtx(()=>[createVNode(unref(bg),{class:normalizeClass(unref(cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5"))},{default:withCtx(()=>[renderSlot(l.$slots,"thumb")]),_:3},8,["class"])]),_:3},16,["class"]))}}),_sfc_main$1h=defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},dir:{},name:{},autocomplete:{},disabled:{type:Boolean},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Ky),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$1g=defineComponent({__name:"SelectGroup",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(Xy),mergeProps({class:unref(cn)("p-1 w-full",e.class)},o.value),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$p={class:"absolute left-2 h-3.5 w-3.5 flex items-center justify-center"},_sfc_main$1f=defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(qy),mergeProps(unref(a),{class:unref(cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",e.class)}),{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$p,[createVNode(unref(Yy),null,{default:withCtx(()=>[createVNode(unref(Check),{class:"h-4 w-4"})]),_:1})]),createVNode(unref(Jy),null,{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),_sfc_main$1e=defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(tg),mergeProps(unref(a),{class:unref(cn)("flex cursor-default items-center justify-center py-1",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default",{},()=>[createVNode(unref(ChevronDown),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),_sfc_main$1d=defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(eg),mergeProps(unref(a),{class:unref(cn)("flex cursor-default items-center justify-center py-1",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default",{},()=>[createVNode(unref(ChevronUp),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),_sfc_main$1c=defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Hy),mergeProps(unref(a),{class:unref(cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default"),createVNode(unref(ng),{"as-child":""},{default:withCtx(()=>[createVNode(unref(ChevronDown),{class:"h-4 w-4 shrink-0 opacity-50"})]),_:1})]),_:3},16,["class"]))}}),_sfc_main$1b=defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(ag),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$1a=defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(Wy),null,{default:withCtx(()=>[createVNode(unref(jy),mergeProps({...unref(s),...l.$attrs},{class:unref(cn)("relative z-200 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:withCtx(()=>[createVNode(unref(_sfc_main$1d)),createVNode(unref(Qy),{class:normalizeClass(unref(cn)("p-1",t.position==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"))},{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},8,["class"]),createVNode(unref(_sfc_main$1e))]),_:3},16,["class"])]),_:3}))}}),_sfc_main$19=defineComponent({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(wg),mergeProps(o.value,{class:unref(cn)("inline-flex items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e.class)}),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$o={class:"truncate"},_sfc_main$18=defineComponent({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(xg),mergeProps(unref(a),{class:unref(cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-xs",e.class)}),{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$o,[renderSlot(n.$slots,"default")])]),_:3},16,["class"]))}}),_hoisted_1$n={key:0,class:"absolute left-0 right-0 h-full w-full flex items-center justify-center bg-white dark:bg-black"},_hoisted_2$i=["src"],_hoisted_3$h={class:"flex flex-col items-start"},_hoisted_4$f={class:"flex flex-col items-start"},_sfc_main$17=defineComponent({__name:"UploadImgDialog",emits:["uploadImage"],setup(t,{emit:e}){const o=e,a=useDisplayStore(),n=toTypedSchema(create$3({repo:create$6().required("GitHub 仓库不能为空"),branch:create$6().optional(),accessToken:create$6().required("GitHub Token 不能为空")})),s=ref(localStorage.getItem("githubConfig")?JSON.parse(localStorage.getItem("githubConfig")):{repo:"",branch:"",accessToken:""});function l(j){localStorage.setItem("githubConfig",JSON.stringify(j)),s.value=j,toast.success("保存成功")}const i=toTypedSchema(create$3({accessKeyId:create$6().required("AccessKey ID 不能为空"),accessKeySecret:create$6().required("AccessKey Secret 不能为空"),bucket:create$6().required("Bucket 不能为空"),region:create$6().required("Region 不能为空"),useSSL:create$7().required(),cdnHost:create$6().optional(),path:create$6().optional()})),d=ref(localStorage.getItem("aliOSSConfig")?JSON.parse(localStorage.getItem("aliOSSConfig")):{accessKeyId:"",accessKeySecret:"",bucket:"",region:"",useSSL:!0,cdnHost:"",path:""});function f(j){localStorage.setItem("aliOSSConfig",JSON.stringify(j)),d.value=j,toast.success("保存成功")}const p=toTypedSchema(create$3({secretId:create$6().required("Secret ID 不能为空"),secretKey:create$6().required("Secret Key 不能为空"),bucket:create$6().required("Bucket 不能为空"),region:create$6().required("Region 不能为空"),cdnHost:create$6().optional(),path:create$6().optional()})),g=ref(localStorage.getItem("txCOSConfig")?JSON.parse(localStorage.getItem("txCOSConfig")):{secretId:"",secretKey:"",bucket:"",region:"",cdnHost:"",path:""});function E(j){localStorage.setItem("txCOSConfig",JSON.stringify(j)),g.value=j,toast.success("保存成功")}const m=toTypedSchema(create$3({accessKey:create$6().required("AccessKey 不能为空"),secretKey:create$6().required("SecretKey 不能为空"),bucket:create$6().required("Bucket 不能为空"),domain:create$6().required("Bucket 对应域名不能为空"),region:create$6().optional(),path:create$6().optional()})),S=ref(localStorage.getItem("qiniuConfig")?JSON.parse(localStorage.getItem("qiniuConfig")):{accessKey:"",secretKey:"",bucket:"",domain:"",region:"",path:""});function _(j){localStorage.setItem("qiniuConfig",JSON.stringify(j)),S.value=j,toast.success("保存成功")}const w=toTypedSchema(create$3({endpoint:create$6().required("Endpoint 不能为空"),port:create$6().optional(),useSSL:create$7().required(),bucket:create$6().required("Bucket 不能为空"),accessKey:create$6().required("AccessKey 不能为空"),secretKey:create$6().required("SecretKey 不能为空")})),u=ref(localStorage.getItem("minioConfig")?JSON.parse(localStorage.getItem("minioConfig")):{endpoint:"",port:"",useSSL:!0,bucket:"",accessKey:"",secretKey:""});function C(j){localStorage.setItem("minioConfig",JSON.stringify(j)),u.value=j,toast.success("保存成功")}const x=toTypedSchema(create$3({token:create$6().required("Bot Token 不能为空"),chatId:create$6().required("Chat ID 不能为空")})),b=ref(localStorage.getItem("telegramConfig")?JSON.parse(localStorage.getItem("telegramConfig")):{token:"",chatId:""});function v(j){localStorage.setItem("telegramConfig",JSON.stringify(j)),b.value=j,toast.success("保存成功")}const $=!window.location.protocol.startsWith("http"),T=computed(()=>!$&&!0),Y=computed(()=>T.value?"如:http://proxy.example.com":"可不填"),te=computed(()=>toTypedSchema(create$3({proxyOrigin:T.value?create$6().required("代理域名不能为空"):create$6().optional(),appID:create$6().required("AppID 不能为空"),appsecret:create$6().required("AppSecret 不能为空")}))),V=ref(localStorage.getItem("mpConfig")?JSON.parse(localStorage.getItem("mpConfig")):{proxyOrigin:"",appID:"",appsecret:""});function ae(j){localStorage.setItem("mpConfig",JSON.stringify(j)),V.value=j,toast.success("保存成功")}const q=toTypedSchema(create$3({accountId:create$6().required("Account ID 不能为空"),accessKey:create$6().required("AccessKey 不能为空"),secretKey:create$6().required("SecretKey 不能为空"),bucket:create$6().required("Bucket 不能为空"),domain:create$6().required("Bucket 对应域名不能为空"),path:create$6().optional()})),z=ref(localStorage.getItem("r2Config")?JSON.parse(localStorage.getItem("r2Config")):{accountId:"",accessKey:"",secretKey:"",bucket:"",domain:"",path:""});function G(j){localStorage.setItem("r2Config",JSON.stringify(j)),z.value=j,toast.success("保存成功")}const N=computed(()=>toTypedSchema(create$3({bucket:create$6().required("Bucket 不能为空"),operator:create$6().required("操作员 不能为空"),password:create$6().required("密码 不能为空"),domain:create$6().required("CDN 域名不能为空"),path:create$6().optional()}))),K=ref(localStorage.getItem("upyunConfig")?JSON.parse(localStorage.getItem("upyunConfig")):{bucket:"",operator:"",password:"",domain:"",path:""});function W(j){localStorage.setItem("upyunConfig",JSON.stringify(j)),K.value=j,toast.success("保存成功")}const de=toTypedSchema(create$3({cloudName:create$6().required("Cloud Name 不能为空"),apiKey:create$6().required("API Key 不能为空"),apiSecret:create$6().optional(),uploadPreset:create$6().when("apiSecret",{is:j=>!j||j.length===0,then:j=>j.required("未填写 apiSecret 时必须提供上传预设名"),otherwise:j=>j.optional()}),folder:create$6().optional(),domain:create$6().optional()})),Z=ref(localStorage.getItem("cloudinaryConfig")?JSON.parse(localStorage.getItem("cloudinaryConfig")):{cloudName:"",apiKey:"",apiSecret:"",uploadPreset:"",folder:"",domain:""});function le(j){localStorage.setItem("cloudinaryConfig",JSON.stringify(j)),Z.value=j,toast.success("保存成功")}const ge=[{value:"default",label:"默认"},{value:"github",label:"GitHub"},{value:"aliOSS",label:"阿里云"},{value:"txCOS",label:"腾讯云"},{value:"qiniu",label:"七牛云"},{value:"minio",label:"MinIO"},{value:"mp",label:"公众号图床"},{value:"r2",label:"Cloudflare R2"},{value:"upyun",label:"又拍云"},{value:"telegram",label:"Telegram"},{value:"cloudinary",label:"Cloudinary"},{value:"formCustom",label:"自定义代码"}],P=ref("default"),H=ref(!1),M=ref("upload");onBeforeMount(()=>{localStorage.getItem("imgHost")&&(P.value=localStorage.getItem("imgHost"));const j=localStorage.getItem("useCompression");j!==null&&(H.value=j==="true")});function F(){localStorage.setItem("imgHost",P.value),toast.success("图床已切换")}function ne(){localStorage.setItem("useCompression",H.value.toString())}function J(j){const I=checkImage(j);if(!I.ok)return toast.error(I.msg),!1;let _e=localStorage.getItem("imgHost");_e=_e||"default",localStorage.setItem("imgHost",_e);const me=localStorage.getItem(`${_e}Config`);return _e==="default"||me?!0:(toast.error(`请先配置 ${_e} 图床参数`),!1)}const ee=ref(!1),{open:L,reset:R,onChange:oe}=useFileDialog({accept:"image/*"});oe(j=>{if(j==null)return;const I=j[0];J(I)&&ce(I),R()});function fe(j){ee.value=!1,j.stopPropagation();const I=Array.from(j.dataTransfer.files)[0];J(I)&&ce(I)}const se=ref(0),re=ref("");function ce(j){se.value=0;const I=setInterval(()=>{const me=se.value+1;me>=100||(se.value=me)},100);o("uploadImage",j,(me,be)=>{clearInterval(I),se.value=100,be&&(re.value=`data:image/png;base64,${be}`),setTimeout(()=>{se.value=0,re.value=""},1e3)},!0)}return(j,I)=>{const _e=_sfc_main$1v,me=_sfc_main$1w,be=_sfc_main$18,ke=_sfc_main$19,xe=_sfc_main$1b,ye=_sfc_main$1c,Ce=_sfc_main$1f,ve=_sfc_main$1a,pe=_sfc_main$1h,Ve=_sfc_main$1B,Be=_sfc_main$1i,$e=_sfc_main$1j,Ne=_sfc_main$1k,ie=_sfc_main$1x,Q=__unplugin_components_14,he=_sfc_main$1K,Te=__unplugin_components_16,Ge=_sfc_main$1m,Le=_sfc_main$1D,De=_sfc_main$1E;return openBlock(),createBlock(De,{open:unref(a).isShowUploadImgDialog,"onUpdate:open":I[8]||(I[8]=h=>unref(a).isShowUploadImgDialog=h)},{default:withCtx(()=>[createVNode(Le,{class:"md:max-w-max max-h-[90vh] overflow-y-auto",onPointerDownOutside:I[7]||(I[7]=h=>h.preventDefault())},{default:withCtx(()=>[createVNode(me,null,{default:withCtx(()=>[createVNode(_e,null,{default:withCtx(()=>[...I[9]||(I[9]=[createTextVNode("本地上传",-1)])]),_:1})]),_:1}),createVNode(Ge,{modelValue:unref(M),"onUpdate:modelValue":I[6]||(I[6]=h=>isRef(M)?M.value=h:null),class:"w-full md:w-max"},{default:withCtx(()=>[createVNode(ke,{class:"grid w-full overflow-x-auto grid-cols-3 md:grid-cols-none md:flex md:flex-wrap gap-1"},{default:withCtx(()=>[createVNode(be,{value:"upload",class:"text-xs md:text-sm whitespace-nowrap"},{default:withCtx(()=>[...I[10]||(I[10]=[createTextVNode(" 选择上传 ",-1)])]),_:1}),(openBlock(!0),createElementBlock(Fragment,null,renderList(ge.filter(h=>h.value!=="default"),h=>(openBlock(),createBlock(be,{key:h.value,value:h.value,class:"text-xs md:text-sm whitespace-nowrap"},{default:withCtx(()=>[createTextVNode(toDisplayString(h.label),1)]),_:2},1032,["value"]))),128))]),_:1}),createVNode(Ne,{value:"upload"},{default:withCtx(()=>[createVNode(Ve,null,{default:withCtx(()=>[I[11]||(I[11]=createBaseVNode("span",{class:"my-4 block"}," 图床 ",-1)),createVNode(pe,{modelValue:unref(P),"onUpdate:modelValue":[I[0]||(I[0]=h=>isRef(P)?P.value=h:null),F]},{default:withCtx(()=>[createVNode(ye,null,{default:withCtx(()=>[createVNode(xe,{placeholder:"请选择"})]),_:1}),createVNode(ve,{class:"max-h-64 md:max-h-96"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(ge,h=>createVNode(Ce,{key:h.value,label:h.label,value:h.value},{default:withCtx(()=>[createTextVNode(toDisplayString(h.label),1)]),_:2},1032,["label","value"])),64))]),_:1})]),_:1},8,["modelValue"])]),_:1}),createVNode(Ve,{label:"UseCompression"},{default:withCtx(()=>[I[12]||(I[12]=createBaseVNode("span",{class:"my-4 block"}," 开启图片压缩 ",-1)),createVNode(Be,{checked:unref(H),"onUpdate:checked":[I[1]||(I[1]=h=>isRef(H)?H.value=h:null),ne],name:"UseCompression"},null,8,["checked"])]),_:1}),createBaseVNode("div",{class:normalizeClass(["bg-clip-padding mt-4 h-50 relative flex flex-col cursor-pointer items-center justify-evenly border-2 rounded border-dashed transition-colors hover:border-gray-700 hover:bg-gray-400/50 dark:hover:border-gray-200 dark:hover:bg-gray-500/50",{"border-gray-700 bg-gray-400/50 dark:border-gray-200 dark:bg-gray-500/50":unref(ee)}]),onClick:I[3]||(I[3]=h=>unref(L)()),onDrop:withModifiers(fe,["prevent"]),onDragover:I[4]||(I[4]=withModifiers(h=>ee.value=!0,["prevent"])),onDragleave:I[5]||(I[5]=withModifiers(h=>ee.value=!1,["prevent"]))},[createVNode($e,{modelValue:unref(se),"onUpdate:modelValue":I[2]||(I[2]=h=>isRef(se)?se.value=h:null),class:"absolute left-0 right-0 rounded-none",style:{top:"-24px",height:"2px"}},null,8,["modelValue"]),createVNode(unref(CloudUpload),{class:"size-16 md:size-20"}),I[13]||(I[13]=createBaseVNode("p",{class:"text-center text-sm md:text-base px-4"},[createTextVNode(" 将图片拖到此处,或 "),createBaseVNode("strong",null,"点击上传")],-1)),unref(re)?(openBlock(),createElementBlock("div",_hoisted_1$n,[createBaseVNode("img",{src:unref(re),class:"max-h-40 object-contain"},null,8,_hoisted_2$i)])):createCommentVNode("",!0)],34)]),_:1}),createVNode(Ne,{value:"github"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(n),"initial-values":unref(s),onSubmit:l},{default:withCtx(()=>[createVNode(unref(Field),{name:"repo"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"GitHub 仓库",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:github.com/yanglbme/resource"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"branch"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"分支",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:release,可不填,默认 master"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"accessToken"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Token",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,type:"password",placeholder:"如:cc1d0c1426d0fd0902bd2d7184b14da61b8abc46"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token",target:"_blank"},{default:withCtx(()=>[...I[14]||(I[14]=[createTextVNode(" 如何获取 GitHub Token? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[15]||(I[15]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"aliOSS"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(i),"initial-values":unref(d),onSubmit:f},{default:withCtx(()=>[createVNode(unref(Field),{name:"accessKeyId"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"AccessKey ID",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:LTAI4GdoocsmdoxUf13ylbaNHk"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"accessKeySecret"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"AccessKey Secret",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,type:"password",placeholder:"如:cc1d0c142doocs0902bd2d7md4b14da6ylbabc46"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:doocs"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"region"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket 所在区域",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:oss-cn-shenzhen"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"useSSL",type:"boolean"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"UseSSL",required:"",error:D},{default:withCtx(()=>[createVNode(Be,{checked:h.value,name:h.name,"onUpdate:checked":h.onChange,onBlur:h.onBlur},null,8,["checked","name","onUpdate:checked","onBlur"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"cdnHost"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"自定义 CDN 域名",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:https://imagecdn.alidaodao.com,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:img,可不填,默认为根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://help.aliyun.com/document_detail/31883.html",target:"_blank"},{default:withCtx(()=>[...I[16]||(I[16]=[createTextVNode(" 如何使用阿里云 OSS? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[17]||(I[17]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"txCOS"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(p),"initial-values":unref(g),onSubmit:E},{default:withCtx(()=>[createVNode(unref(Field),{name:"secretId"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"SecretId",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:AKIDnQp1w3DOOCSs8F5MDp9tdoocsmdUPonW3"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"secretKey"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"SecretKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,type:"password",placeholder:"如:ukLmdtEJ9271f3DOocsMDsCXdS3YlbW0"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:doocs-3212520134"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"region"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket 所在区域",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:ap-guangzhou"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"cdnHost"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"自定义 CDN 域名",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:https://imagecdn.alidaodao.com,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:img,可不填,默认根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://cloud.tencent.com/document/product/436/38484",target:"_blank"},{default:withCtx(()=>[...I[18]||(I[18]=[createTextVNode(" 如何使用腾讯云 COS? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[19]||(I[19]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"qiniu"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(m),"initial-values":unref(S),onSubmit:_},{default:withCtx(()=>[createVNode(unref(Field),{name:"accessKey"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"AccessKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:6DD3VaLJ_SQgOdoocsyTV_YWaDmdnL2n8EGx7kG"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"secretKey"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"SecretKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,type:"password",placeholder:"如:qgZa5qrvDOOcsmdKStD1oCjZ9nB7MDvJUs_34SIm"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:md"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"domain"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket 对应域名",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:https://images.123ylb.cn"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"region"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"存储区域",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:z2,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:img,可不填,默认为根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://developer.qiniu.com/kodo",target:"_blank"},{default:withCtx(()=>[...I[20]||(I[20]=[createTextVNode(" 如何使用七牛云 Kodo? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[21]||(I[21]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"minio"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(w),"initial-values":unref(u),onSubmit:C},{default:withCtx(()=>[createVNode(unref(Field),{name:"endpoint"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Endpoint",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:play.min.io"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"port"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Port",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,type:"number",placeholder:"如:9000,可不填,http 默认为 80,https 默认为 443"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"useSSL",type:"boolean"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"UseSSL",required:"",error:D},{default:withCtx(()=>[createVNode(Be,{checked:h.value,name:h.name,"onUpdate:checked":h.onChange,onBlur:h.onBlur},null,8,["checked","name","onUpdate:checked","onBlur"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:doocs"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"accessKey"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"AccessKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:zhangsan"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"secretKey"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"SecretKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:asdasdasd"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0",as:"a",href:"http://docs.minio.org.cn/docs/master/minio-client-complete-guide",target:"_blank"},{default:withCtx(()=>[...I[22]||(I[22]=[createTextVNode(" 如何使用 MinIO? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[23]||(I[23]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"mp"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(te),"initial-values":unref(V),onSubmit:ae},{default:withCtx(()=>[unref(T)?(openBlock(),createBlock(unref(Field),{key:0,name:"proxyOrigin"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"代理域名",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:unref(Y)}),null,16,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["error"])]),_:1})):createCommentVNode("",!0),createVNode(unref(Field),{name:"appID"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"appID",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:wx6e1234567890efa3"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"appsecret"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"appsecret",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:d9f1abcdef01234567890abcdef82397"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createBaseVNode("div",_hoisted_3$h,[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Getting_Started_Guide.html",target:"_blank"},{default:withCtx(()=>[...I[24]||(I[24]=[createTextVNode(" 如何开启公众号开发者模式并获取应用账号密钥? ",-1)])]),_:1}),createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://md-pages.doocs.org/tutorial/",target:"_blank"},{default:withCtx(()=>[...I[25]||(I[25]=[createTextVNode(" 如何在浏览器插件中使用公众号图床? ",-1)])]),_:1})])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[26]||(I[26]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"r2"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(q),"initial-values":unref(z),onSubmit:G},{default:withCtx(()=>[createVNode(unref(Field),{name:"accountId"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"AccountId",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如: 0030f123e55a57546f4c281c564e560",class:"w-full min-w-0 md:min-w-[350px]"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"accessKey"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"AccessKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如: 358090b3a12824a6b0787gae7ad0fc72"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"secretKey"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"SecretKey",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,type:"password",placeholder:"如: c1c4dbcb0b6b785ac6633422a06dff3dac055fe74fe40xj1b5c5fcf1bf128010"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:md"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"domain"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"域名",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:https://oss.example.com"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:img,可不填,默认为根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createBaseVNode("div",_hoisted_4$f,[createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://developers.cloudflare.com/r2/api/s3/api/",target:"_blank"},{default:withCtx(()=>[...I[27]||(I[27]=[createTextVNode(" 如何使用 S3 API 操作 Cloudflare R2? ",-1)])]),_:1}),createVNode(he,{variant:"link",class:"p-0 h-auto text-left whitespace-normal",as:"a",href:"https://developers.cloudflare.com/r2/buckets/cors/",target:"_blank"},{default:withCtx(()=>[...I[28]||(I[28]=[createTextVNode(" 如何设置跨域(CORS)? ",-1)])]),_:1})])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[29]||(I[29]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"upyun"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(N),"initial-values":unref(K),onSubmit:W},{default:withCtx(()=>[createVNode(unref(Field),{name:"bucket"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bucket",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如: md",class:"w-full min-w-0 md:min-w-[350px]"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"operator"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"操作员",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如: operator"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"password"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"操作员密码",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,type:"password",placeholder:"如: c1c4dbcb0b6b785ac6633422a06dff3dac055fe74fe40xj1b5c5fcf1bf128010"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"domain"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"域名",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:http://xxx.test.upcdn.net"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"path"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"存储路径",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:img,可不填,默认为根目录"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0",as:"a",href:"https://help.upyun.com/",target:"_blank"},{default:withCtx(()=>[...I[30]||(I[30]=[createTextVNode(" 如何使用 又拍云? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[31]||(I[31]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"telegram"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(x),"initial-values":unref(b),onSubmit:v},{default:withCtx(()=>[createVNode(unref(Field),{name:"token"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Bot Token",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:123456789:ABCdefGHIjkl-MNOPqrSTUvwxYZ"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"chatId"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Chat ID",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:-1001234567890"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0",as:"a",href:"https://github.com/doocs/md/blob/main/docs/telegram-usage.md",target:"_blank"},{default:withCtx(()=>[...I[32]||(I[32]=[createTextVNode(" 如何使用 Telegram? ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[33]||(I[33]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"cloudinary"},{default:withCtx(()=>[createVNode(unref(Form),{"validation-schema":unref(de),"initial-values":unref(Z),onSubmit:le},{default:withCtx(()=>[createVNode(unref(Field),{name:"cloudName"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Cloud Name",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:demo"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"apiKey"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"API Key",required:"",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:1234567890"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"apiSecret"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"API Secret",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,type:"password",placeholder:"用于签名上传,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"uploadPreset"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Upload Preset",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"unsigned 时必填,signed 时可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"folder"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"Folder",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:blog/image,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(unref(Field),{name:"domain"},{default:withCtx(({field:h,errorMessage:D})=>[createVNode(Q,{label:"自定义域名 / CDN",error:D},{default:withCtx(()=>[createVNode(ie,mergeProps(h,{modelValue:h.value,"onUpdate:modelValue":U=>h.value=U,placeholder:"如:https://cdn.example.com,可不填"}),null,16,["modelValue","onUpdate:modelValue"])]),_:2},1032,["error"])]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{variant:"link",class:"p-0",as:"a",href:"https://cloudinary.com/documentation/upload_images",target:"_blank"},{default:withCtx(()=>[...I[34]||(I[34]=[createTextVNode(" Cloudinary 使用文档 ",-1)])]),_:1})]),_:1}),createVNode(Q,null,{default:withCtx(()=>[createVNode(he,{type:"submit"},{default:withCtx(()=>[...I[35]||(I[35]=[createTextVNode(" 保存配置 ",-1)])]),_:1})]),_:1})]),_:1},8,["validation-schema","initial-values"])]),_:1}),createVNode(Ne,{value:"formCustom",class:"grid"},{default:withCtx(()=>[createVNode(Te)]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["open"])}}}),_hoisted_1$m={key:0,class:"sticky top-0 z-10 flex items-center justify-between -mx-4 px-4 py-3 border-b mb-4 bg-background"},_hoisted_2$h={class:"space-y-2"},_hoisted_3$g={class:"grid grid-cols-3 justify-items-center gap-2"},_hoisted_4$e={class:"space-y-2"},_hoisted_5$d={class:"grid grid-cols-3 justify-items-center gap-2"},_hoisted_6$b={class:"space-y-2"},_hoisted_7$8={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_8$6={class:"space-y-2"},_hoisted_9$4={class:"grid grid-cols-3 justify-items-center gap-2"},_hoisted_10$2={class:"space-y-2"},_hoisted_11$2={class:"space-y-2"},_hoisted_12$2={class:"space-y-2"},_hoisted_13$2={class:"grid grid-cols-3 justify-items-center gap-2"},_hoisted_14$2={class:"space-y-2"},_hoisted_15$2={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_16$2={class:"space-y-2"},_hoisted_17$2={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_18$2={class:"space-y-2"},_hoisted_19$1={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_20$1={class:"space-y-2"},_hoisted_21$1={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_22$1={class:"space-y-2"},_hoisted_23$1={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_24$1={class:"space-y-2"},_hoisted_25$1={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_26$1={class:"space-y-2"},_hoisted_27$1={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_28$1={class:"space-y-2"},_hoisted_29={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_30={class:"space-y-2"},_hoisted_31={class:"grid grid-cols-5 justify-items-center gap-2"},_hoisted_32={class:"space-y-2"},_sfc_main$16=defineComponent({__name:"RightSlider",setup(t){const e=useStore(),o=useDisplayStore(),a=ref(!1);watch(()=>e.isOpenRightSlider,()=>{e.isMobile&&(a.value=!0)}),watch(()=>e.isMobile,()=>{a.value=!1});const{isDark:n,primaryColor:s}=storeToRefs(e);function l(){o.toggleShowCssEditor()}const i=ref(!1),d=ref("");watch(i,()=>{i.value&&(d.value="")});const f=useTemplateRef("pickColorsContainer"),p=ref("rgb"),g=ref(["rgb","hex","hsl","hsv"]);return(E,m)=>{const S=_sfc_main$1K,_=_sfc_main$1b,w=_sfc_main$1c,u=_sfc_main$1f,C=_sfc_main$1a,x=_sfc_main$1h;return openBlock(),createElementBlock(Fragment,null,[unref(e).isMobile&&unref(e).isOpenRightSlider?(openBlock(),createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/50 z-40",onClick:m[0]||(m[0]=b=>unref(e).isOpenRightSlider=!1)})):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["overflow-hidden mobile-right-drawer",{"fixed top-0 right-0 w-full h-full z-55 bg-background border-l shadow-lg":unref(e).isMobile,animate:unref(e).isMobile&&unref(a),"border-l-2 order-2 border-gray/20 bg-white transition-width duration-300 dark:bg-[#191919]":!unref(e).isMobile,"w-100":!unref(e).isMobile&&unref(e).isOpenRightSlider,"w-0 border-l-0":!unref(e).isMobile&&!unref(e).isOpenRightSlider}]),style:normalizeStyle({transform:unref(e).isMobile?unref(e).isOpenRightSlider?"translateX(0)":"translateX(100%)":"none"})},[createBaseVNode("div",{class:normalizeClass(["space-y-4 h-full overflow-auto p-4",{"pt-0":unref(e).isMobile,"transition-transform":!unref(e).isMobile,"translate-x-0":!unref(e).isMobile&&unref(e).isOpenRightSlider,"translate-x-full":!unref(e).isMobile&&!unref(e).isOpenRightSlider}])},[unref(e).isMobile?(openBlock(),createElementBlock("div",_hoisted_1$m,[m[20]||(m[20]=createBaseVNode("h2",{class:"text-lg font-semibold"}," 样式设置 ",-1)),createVNode(S,{variant:"ghost",size:"sm",onClick:m[1]||(m[1]=b=>unref(e).isOpenRightSlider=!1)},{default:withCtx(()=>[createVNode(unref(X),{class:"h-4 w-4"})]),_:1})])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_2$h,[m[21]||(m[21]=createBaseVNode("h2",null,"主题",-1)),createBaseVNode("div",_hoisted_3$g,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(themeOptions),({label:b,value:v})=>(openBlock(),createBlock(S,{key:v,class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).theme===v}]),variant:"outline",onClick:y=>unref(e).themeChanged(v)},{default:withCtx(()=>[createTextVNode(toDisplayString(b),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_4$e,[m[22]||(m[22]=createBaseVNode("h2",null,"字体",-1)),createBaseVNode("div",_hoisted_5$d,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(fontFamilyOptions),({label:b,value:v})=>(openBlock(),createBlock(S,{key:v,variant:"outline",class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).fontFamily===v}]),onClick:y=>unref(e).fontChanged(v)},{default:withCtx(()=>[createTextVNode(toDisplayString(b),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_6$b,[m[23]||(m[23]=createBaseVNode("h2",null,"字号",-1)),createBaseVNode("div",_hoisted_7$8,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(fontSizeOptions),({value:b,desc:v})=>(openBlock(),createBlock(S,{key:b,variant:"outline",class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).fontSize===b}]),onClick:y=>unref(e).sizeChanged(b)},{default:withCtx(()=>[createTextVNode(toDisplayString(v),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_8$6,[m[24]||(m[24]=createBaseVNode("h2",null,"主题色",-1)),createBaseVNode("div",_hoisted_9$4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(colorOptions),({label:b,value:v})=>(openBlock(),createBlock(S,{key:v,class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).primaryColor===v}]),variant:"outline",onClick:y=>unref(e).colorChanged(v)},{default:withCtx(()=>[createBaseVNode("span",{class:"mr-2 inline-block h-4 w-4 rounded-full",style:normalizeStyle({background:v})},null,4),createTextVNode(" "+toDisplayString(b),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_10$2,[m[25]||(m[25]=createBaseVNode("h2",null,"自定义主题色",-1)),createBaseVNode("div",{ref_key:"pickColorsContainer",ref:f},[unref(f)?(openBlock(),createBlock(unref(Re),{key:0,value:unref(s),"onUpdate:value":m[2]||(m[2]=b=>isRef(s)?s.value=b:null),"show-alpha":"",format:unref(p),"format-options":unref(g),theme:unref(e).isDark?"dark":"light","popup-container":unref(f),onChange:unref(e).colorChanged},null,8,["value","format","format-options","theme","popup-container","onChange"])):createCommentVNode("",!0)],512)]),createBaseVNode("div",_hoisted_11$2,[m[26]||(m[26]=createBaseVNode("h2",null,"代码块主题",-1)),createBaseVNode("div",null,[createVNode(x,{modelValue:unref(e).codeBlockTheme,"onUpdate:modelValue":[m[3]||(m[3]=b=>unref(e).codeBlockTheme=b),unref(e).codeBlockThemeChanged]},{default:withCtx(()=>[createVNode(w,null,{default:withCtx(()=>[createVNode(_,{placeholder:"Select a code block theme"})]),_:1}),createVNode(C,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(codeBlockThemeOptions),({label:b,value:v})=>(openBlock(),createBlock(u,{key:b,value:v},{default:withCtx(()=>[createTextVNode(toDisplayString(b),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue","onUpdate:modelValue"])])]),createBaseVNode("div",_hoisted_12$2,[m[27]||(m[27]=createBaseVNode("h2",null,"图注格式",-1)),createBaseVNode("div",_hoisted_13$2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(legendOptions),({label:b,value:v})=>(openBlock(),createBlock(S,{key:v,class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).legend===v}]),variant:"outline",onClick:y=>unref(e).legendChanged(v)},{default:withCtx(()=>[createTextVNode(toDisplayString(b),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_14$2,[m[30]||(m[30]=createBaseVNode("h2",null,"Mac 代码块",-1)),createBaseVNode("div",_hoisted_15$2,[createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isMacCodeBlock}]),variant:"outline",onClick:m[4]||(m[4]=b=>!unref(e).isMacCodeBlock&&unref(e).macCodeBlockChanged())},{default:withCtx(()=>[...m[28]||(m[28]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isMacCodeBlock}]),variant:"outline",onClick:m[5]||(m[5]=b=>unref(e).isMacCodeBlock&&unref(e).macCodeBlockChanged())},{default:withCtx(()=>[...m[29]||(m[29]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_16$2,[m[33]||(m[33]=createBaseVNode("h2",null,"代码块行号",-1)),createBaseVNode("div",_hoisted_17$2,[createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isShowLineNumber}]),variant:"outline",onClick:m[6]||(m[6]=b=>!unref(e).isShowLineNumber&&unref(e).showLineNumberChanged())},{default:withCtx(()=>[...m[31]||(m[31]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isShowLineNumber}]),variant:"outline",onClick:m[7]||(m[7]=b=>unref(e).isShowLineNumber&&unref(e).showLineNumberChanged())},{default:withCtx(()=>[...m[32]||(m[32]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_18$2,[m[36]||(m[36]=createBaseVNode("h2",null,"微信外链转底部引用",-1)),createBaseVNode("div",_hoisted_19$1,[createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isCiteStatus}]),variant:"outline",onClick:m[8]||(m[8]=b=>!unref(e).isCiteStatus&&unref(e).citeStatusChanged())},{default:withCtx(()=>[...m[34]||(m[34]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isCiteStatus}]),variant:"outline",onClick:m[9]||(m[9]=b=>unref(e).isCiteStatus&&unref(e).citeStatusChanged())},{default:withCtx(()=>[...m[35]||(m[35]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_20$1,[m[39]||(m[39]=createBaseVNode("h2",null,"段落首行缩进",-1)),createBaseVNode("div",_hoisted_21$1,[createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isUseIndent}]),variant:"outline",onClick:m[10]||(m[10]=b=>!unref(e).isUseIndent&&unref(e).useIndentChanged())},{default:withCtx(()=>[...m[37]||(m[37]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isUseIndent}]),variant:"outline",onClick:m[11]||(m[11]=b=>unref(e).isUseIndent&&unref(e).useIndentChanged())},{default:withCtx(()=>[...m[38]||(m[38]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_22$1,[m[42]||(m[42]=createBaseVNode("h2",null,"段落两端对齐",-1)),createBaseVNode("div",_hoisted_23$1,[createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isUseJustify}]),variant:"outline",onClick:m[12]||(m[12]=b=>!unref(e).isUseJustify&&unref(e).useJustifyChanged())},{default:withCtx(()=>[...m[40]||(m[40]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isUseJustify}]),variant:"outline",onClick:m[13]||(m[13]=b=>unref(e).isUseJustify&&unref(e).useJustifyChanged())},{default:withCtx(()=>[...m[41]||(m[41]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_24$1,[m[45]||(m[45]=createBaseVNode("h2",null,"自定义 CSS 面板",-1)),createBaseVNode("div",_hoisted_25$1,[createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(o).isShowCssEditor}]),variant:"outline",onClick:m[14]||(m[14]=b=>!unref(o).isShowCssEditor&&l())},{default:withCtx(()=>[...m[43]||(m[43]=[createTextVNode(" 开启 ",-1)])]),_:1},8,["class"]),createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(o).isShowCssEditor}]),variant:"outline",onClick:m[15]||(m[15]=b=>unref(o).isShowCssEditor&&l())},{default:withCtx(()=>[...m[44]||(m[44]=[createTextVNode(" 关闭 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_26$1,[m[48]||(m[48]=createBaseVNode("h2",null,"编辑区位置",-1)),createBaseVNode("div",_hoisted_27$1,[createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).isEditOnLeft}]),variant:"outline",onClick:m[16]||(m[16]=b=>!unref(e).isEditOnLeft&&unref(e).toggleEditOnLeft())},{default:withCtx(()=>[...m[46]||(m[46]=[createTextVNode(" 左侧 ",-1)])]),_:1},8,["class"]),createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(e).isEditOnLeft}]),variant:"outline",onClick:m[17]||(m[17]=b=>unref(e).isEditOnLeft&&unref(e).toggleEditOnLeft())},{default:withCtx(()=>[...m[47]||(m[47]=[createTextVNode(" 右侧 ",-1)])]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_28$1,[m[49]||(m[49]=createBaseVNode("h2",null,"预览模式",-1)),createBaseVNode("div",_hoisted_29,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(widthOptions),({label:b,value:v})=>(openBlock(),createBlock(S,{key:v,class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(e).previewWidth===v}]),variant:"outline",onClick:y=>unref(e).previewWidthChanged(v)},{default:withCtx(()=>[createTextVNode(toDisplayString(b),1)]),_:2},1032,["class","onClick"]))),128))])]),createBaseVNode("div",_hoisted_30,[m[50]||(m[50]=createBaseVNode("h2",null,"模式",-1)),createBaseVNode("div",_hoisted_31,[createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":!unref(n)}]),variant:"outline",onClick:m[18]||(m[18]=b=>unref(e).toggleDark(!1))},{default:withCtx(()=>[createVNode(unref(Sun),{class:"h-4 w-4"})]),_:1},8,["class"]),createVNode(S,{class:normalizeClass(["w-full",{"border-black dark:border-white border-2":unref(n)}]),variant:"outline",onClick:m[19]||(m[19]=b=>unref(e).toggleDark(!0))},{default:withCtx(()=>[createVNode(unref(Moon),{class:"h-4 w-4"})]),_:1},8,["class"])])]),createBaseVNode("div",_hoisted_32,[m[52]||(m[52]=createBaseVNode("h2",null,"样式配置",-1)),createVNode(S,{variant:"destructive",onClick:unref(e).resetStyleConfirm},{default:withCtx(()=>[...m[51]||(m[51]=[createTextVNode(" 重置 ",-1)])]),_:1},8,["onClick"])])],2)],6)],64)}}}),__unplugin_components_7=_export_sfc(_sfc_main$16,[["__scopeId","data-v-a7a28677"]]),_sfc_main$15=defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Iu),mergeProps(unref(a),{class:unref(cn)("text-sm text-muted-foreground",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$l={key:0,class:"sticky top-0 z-10 flex items-center justify-between px-4 py-3 border-b mb-2 bg-background"},_sfc_main$14=defineComponent({__name:"CssEditor",setup(t){const e=useStore(),o=useDisplayStore(),a=ref(!1);watch(()=>o.isShowCssEditor,()=>{e.isMobile&&(a.value=!0)}),watch(()=>e.isMobile,()=>{a.value=!1});const n=ref(!1),s=ref(""),l=ref(["",e.cssContentConfig.active]);function i(C){s.value=C,n.value=!0}function d(){if(!s.value.trim()){toast.error("新建失败,方案名不可为空");return}if(!e.validatorTabName(s.value)){toast.error("不能与现有方案重名");return}e.renameTab(s.value),n.value=!1,toast.success("修改成功")}const f=ref(!1),p=ref("");function g(){if(!p.value.trim()){toast.error("新建失败,方案名不可为空");return}if(!e.validatorTabName(p.value)){toast.error("不能与现有方案重名");return}e.addCssContentTab(p.value),f.value=!1,e.cssContentConfig.active=p.value,l.value=[l.value[1],p.value],toast.success("新建成功")}const E=ref(!1),m=ref("");function S(C){m.value=C,E.value=!0}function _(){const C=e.cssContentConfig.tabs;if(C.length===1){toast.warning("至少保留一个方案");return}let x=e.cssContentConfig.active;x===m.value&&C.forEach((b,v)=>{if(b.name===m.value){const y=C[v+1]||C[v-1];y&&(x=y.name)}}),e.tabChanged(x),e.cssContentConfig.tabs=C.filter(b=>b.name!==m.value),toast.success("删除成功")}function w(){p.value=`方案${e.cssContentConfig.tabs.length+1}`,f.value=!0}function u(C){if(C==="add"){e.cssContentConfig.active=l.value[1],w();return}l.value=[l.value[1],C],e.tabChanged(C)}return(C,x)=>{const b=_sfc_main$1K,v=_sfc_main$18,y=_sfc_main$19,$=_sfc_main$1m,T=_sfc_main$1v,Y=_sfc_main$15,te=_sfc_main$1w,V=_sfc_main$1x,ae=_sfc_main$1t,q=_sfc_main$1D,z=_sfc_main$1E,G=_sfc_main$1F,N=_sfc_main$1G,K=_sfc_main$1H,W=_sfc_main$1I,de=_sfc_main$1J,Z=_sfc_main$1L,le=_sfc_main$1M,ge=_sfc_main$1N;return openBlock(),createElementBlock(Fragment,null,[unref(e).isMobile&&unref(o).isShowCssEditor?(openBlock(),createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/50 z-40",onClick:x[0]||(x[0]=P=>unref(o).isShowCssEditor=!1)})):createCommentVNode("",!0),createVNode(Transition,{"enter-active-class":"bounceInRight"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{class:normalizeClass(["cssEditor-wrapper h-full flex flex-col mobile-css-editor overflow-y-auto",{"fixed top-0 right-0 w-full h-full z-100 bg-background border-l shadow-lg":unref(e).isMobile,animate:unref(e).isMobile&&unref(a),"border-l-2 flex-1 order-2 border-gray/50":!unref(e).isMobile}]),style:normalizeStyle({transform:unref(e).isMobile?unref(o).isShowCssEditor?"translateX(0)":"translateX(100%)":"none"})},[unref(e).isMobile?(openBlock(),createElementBlock("div",_hoisted_1$l,[x[11]||(x[11]=createBaseVNode("h2",{class:"text-lg font-semibold"}," 自定义 CSS ",-1)),createVNode(b,{variant:"ghost",size:"sm",onClick:x[1]||(x[1]=P=>unref(o).isShowCssEditor=!1)},{default:withCtx(()=>[createVNode(unref(X),{class:"h-4 w-4"})]),_:1})])):createCommentVNode("",!0),createVNode($,{modelValue:unref(e).cssContentConfig.active,"onUpdate:modelValue":[x[2]||(x[2]=P=>unref(e).cssContentConfig.active=P),u]},{default:withCtx(()=>[createVNode(y,{class:"w-full overflow-x-auto"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(e).cssContentConfig.tabs,P=>(openBlock(),createBlock(v,{key:P.name,value:P.name,class:"flex-1"},{default:withCtx(()=>[createTextVNode(toDisplayString(P.title)+" ",1),withDirectives(createVNode(unref(PenLine),{class:"inline size-4 rounded-full p-0.5 transition-color hover:bg-gray-200 dark:hover:bg-gray-600",onClick:H=>i(P.name)},null,8,["onClick"]),[[vShow,unref(e).cssContentConfig.active===P.name]]),withDirectives(createVNode(unref(X),{class:"inline size-4 rounded-full p-0.5 transition-color hover:bg-gray-200 dark:hover:bg-gray-600",onClick:withModifiers(H=>S(P.name),["self"])},null,8,["onClick"]),[[vShow,unref(e).cssContentConfig.active===P.name]])]),_:2},1032,["value"]))),128)),createVNode(v,{value:"add"},{default:withCtx(()=>[createVNode(unref(Plus),{class:"h-5 w-5"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),x[24]||(x[24]=createBaseVNode("textarea",{id:"cssEditor",type:"textarea",placeholder:"Your custom css here."},null,-1)),createVNode(z,{open:unref(f),"onUpdate:open":x[6]||(x[6]=P=>isRef(f)?f.value=P:null)},{default:withCtx(()=>[createVNode(q,{class:"sm:max-w-[425px]"},{default:withCtx(()=>[createVNode(te,null,{default:withCtx(()=>[createVNode(T,null,{default:withCtx(()=>[...x[12]||(x[12]=[createTextVNode("新建自定义 CSS",-1)])]),_:1}),createVNode(Y,null,{default:withCtx(()=>[...x[13]||(x[13]=[createTextVNode(" 请输入方案名称 ",-1)])]),_:1})]),_:1}),createVNode(V,{modelValue:unref(p),"onUpdate:modelValue":x[3]||(x[3]=P=>isRef(p)?p.value=P:null)},null,8,["modelValue"]),createVNode(ae,null,{default:withCtx(()=>[createVNode(b,{variant:"outline",onClick:x[4]||(x[4]=P=>f.value=!1)},{default:withCtx(()=>[...x[14]||(x[14]=[createTextVNode(" 取消 ",-1)])]),_:1}),createVNode(b,{onClick:x[5]||(x[5]=P=>g())},{default:withCtx(()=>[...x[15]||(x[15]=[createTextVNode(" 保存 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(z,{open:unref(n),"onUpdate:open":x[9]||(x[9]=P=>isRef(n)?n.value=P:null)},{default:withCtx(()=>[createVNode(q,{class:"sm:max-w-[425px]"},{default:withCtx(()=>[createVNode(te,null,{default:withCtx(()=>[createVNode(T,null,{default:withCtx(()=>[...x[16]||(x[16]=[createTextVNode("编辑方案名称",-1)])]),_:1}),createVNode(Y,null,{default:withCtx(()=>[...x[17]||(x[17]=[createTextVNode(" 请输入新的方案名称 ",-1)])]),_:1})]),_:1}),createVNode(V,{modelValue:unref(s),"onUpdate:modelValue":x[7]||(x[7]=P=>isRef(s)?s.value=P:null)},null,8,["modelValue"]),createVNode(ae,null,{default:withCtx(()=>[createVNode(b,{variant:"outline",onClick:x[8]||(x[8]=P=>n.value=!1)},{default:withCtx(()=>[...x[18]||(x[18]=[createTextVNode(" 取消 ",-1)])]),_:1}),createVNode(b,{onClick:d},{default:withCtx(()=>[...x[19]||(x[19]=[createTextVNode(" 保存 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(ge,{open:unref(E),"onUpdate:open":x[10]||(x[10]=P=>isRef(E)?E.value=P:null)},{default:withCtx(()=>[createVNode(le,null,{default:withCtx(()=>[createVNode(K,null,{default:withCtx(()=>[createVNode(G,null,{default:withCtx(()=>[...x[20]||(x[20]=[createTextVNode("提示",-1)])]),_:1}),createVNode(N,null,{default:withCtx(()=>[...x[21]||(x[21]=[createTextVNode(" 此操作将删除该自定义方案,是否继续? ",-1)])]),_:1})]),_:1}),createVNode(Z,null,{default:withCtx(()=>[createVNode(W,null,{default:withCtx(()=>[...x[22]||(x[22]=[createTextVNode("取消",-1)])]),_:1}),createVNode(de,{onClick:_},{default:withCtx(()=>[...x[23]||(x[23]=[createTextVNode(" 确认 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])],6),[[vShow,unref(o).isShowCssEditor]])]),_:1})],64)}}}),__unplugin_components_6=_export_sfc(_sfc_main$14,[["__scopeId","data-v-06df6eb3"]]),_hoisted_1$k=["href"],_sfc_main$13=defineComponent({__name:"FloatingToc",setup(t){const e=useStore(),o=ref(!1);return(a,n)=>(openBlock(),createElementBlock("div",{class:"bg-background absolute left-0 top-0 border rounded-br-lg rounded-tr-lg rounded-bl-lg p-2 text-sm shadow-sm",onMouseenter:n[0]||(n[0]=()=>o.value=!0),onMouseleave:n[1]||(n[1]=()=>o.value=!1)},[createVNode(unref(List),{class:"size-6"}),createBaseVNode("ul",{class:normalizeClass(["overflow-auto transition-all",{"max-h-0 w-0":!unref(o),"max-h-100 w-60 mt-2":unref(o)}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(e).titleList,(s,l)=>(openBlock(),createElementBlock("li",{key:l,class:"line-clamp-1 py-1 leading-6 hover:bg-gray-300 dark:hover:bg-gray-600",style:normalizeStyle({paddingLeft:`${s.level-.5}em`})},[createBaseVNode("a",{href:s.url},toDisplayString(s.title),9,_hoisted_1$k)],4))),128))],2)],32))}}),_sfc_main$12=defineComponent({__name:"BackTop",props:{left:{},top:{},right:{},bottom:{},visibilityHeight:{},target:{},onClick:{type:Function}},setup(t){const e=t,o=ref(e.visibilityHeight??400),a=ref(!1),n=ref(null);function s(i){n.value?.scrollTo({top:0,left:0,behavior:"smooth"}),e.onClick?.(i)}const l=throttle(i=>{i instanceof HTMLElement?a.value=i.scrollTop>o.value:a.value=window.scrollY>o.value},200,{edges:["leading","trailing"]});return onMounted(()=>{e.target?n.value=document.getElementById(e.target):n.value=window,n.value.addEventListener("scroll",()=>{l(n.value)})}),onUnmounted(()=>{n.value.removeEventListener("scroll",()=>{l(n.value)})}),(i,d)=>{const f=_sfc_main$1K;return unref(a)?(openBlock(),createBlock(f,{key:0,variant:"outline",size:"icon",class:"absolute z-50 rounded-full",style:normalizeStyle({left:`${t.left}px`,top:`${t.top}px`,right:`${t.right}px`,bottom:`${t.bottom}px`}),onClick:s},{default:withCtx(()=>[createVNode(unref(ArrowUpFromLine))]),_:1},8,["style"])):createCommentVNode("",!0)}}}),_sfc_main$11=defineComponent({__name:"ContextMenu",props:{dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(rm),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$10=defineComponent({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},sticky:{},hideWhenDetached:{type:Boolean},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(um),null,{default:withCtx(()=>[createVNode(unref(dm),mergeProps(unref(s),{class:unref(cn)("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$$=defineComponent({__name:"ContextMenuShortcut",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref(cn)("ml-auto text-xs tracking-widest text-muted-foreground",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$_=defineComponent({__name:"ContextMenuSeparator",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(vm),mergeProps(o.value,{class:unref(cn)("-mx-1 my-1 h-px bg-border",e.class)}),null,16,["class"]))}}),_sfc_main$Z=defineComponent({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(fm),mergeProps(unref(s),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",t.inset&&"pl-8",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$Y=defineComponent({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const o=Ot(t);return(a,n)=>(openBlock(),createBlock(unref(im),normalizeProps(guardReactiveProps(unref(o))),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16))}});function useImportMarkdownContent(){const t=useStore(),{open:e,reset:o,onChange:a}=useFileDialog({accept:".md"});return a(n=>{if(n==null||n.length===0)return;const s=n[0],l=new FileReader;l.readAsText(s),l.onload=i=>{t.editor.dispatch({changes:{from:0,to:t.editor.state.doc.length,insert:""}}),requestAnimationFrame(()=>{t.editor.dispatch({changes:{from:0,to:t.editor.state.doc.length,insert:i.target.result}})}),toast.success("文档导入成功")}}),()=>{o(),e()}}const _sfc_main$X=defineComponent({__name:"EditorContextMenu",setup(t){const{exportEditorContent2HTML:e,exportEditorContent2MD:o,formatContent:a,importDefaultContent:n,copyToClipboard:s,pasteFromClipboard:l,resetStyleConfirm:i,downloadAsCardImage:d,clearContent:f}=useStore(),{toggleShowInsertFormDialog:p,toggleShowInsertMpCardDialog:g,toggleShowUploadImgDialog:E}=useDisplayStore(),m=useImportMarkdownContent();return(S,_)=>{const w=_sfc_main$Y,u=_sfc_main$Z,C=_sfc_main$_,x=_sfc_main$$,b=_sfc_main$10,v=_sfc_main$11;return openBlock(),createBlock(v,null,{default:withCtx(()=>[createVNode(w,null,{default:withCtx(()=>[renderSlot(S.$slots,"default")]),_:3}),createVNode(b,{class:"w-64"},{default:withCtx(()=>[createVNode(u,{inset:"",onClick:_[0]||(_[0]=y=>unref(E)())},{default:withCtx(()=>[..._[12]||(_[12]=[createTextVNode(" 上传图片 ",-1)])]),_:1}),createVNode(u,{inset:"",onClick:_[1]||(_[1]=y=>unref(p)())},{default:withCtx(()=>[..._[13]||(_[13]=[createTextVNode(" 插入表格 ",-1)])]),_:1}),createVNode(u,{inset:"",onClick:_[2]||(_[2]=y=>unref(g)())},{default:withCtx(()=>[..._[14]||(_[14]=[createTextVNode(" 插入公众号名片 ",-1)])]),_:1}),createVNode(u,{inset:"",onClick:_[3]||(_[3]=y=>unref(i)())},{default:withCtx(()=>[..._[15]||(_[15]=[createTextVNode(" 重置样式 ",-1)])]),_:1}),createVNode(u,{inset:"",onClick:_[4]||(_[4]=y=>unref(n)())},{default:withCtx(()=>[..._[16]||(_[16]=[createTextVNode(" 重置文档 ",-1)])]),_:1}),createVNode(u,{inset:"",onClick:_[5]||(_[5]=y=>unref(f)())},{default:withCtx(()=>[..._[17]||(_[17]=[createTextVNode(" 清空内容 ",-1)])]),_:1}),createVNode(C),createVNode(u,{inset:"",onClick:_[6]||(_[6]=y=>unref(m)())},{default:withCtx(()=>[..._[18]||(_[18]=[createTextVNode(" 导入 .md 文档 ",-1)])]),_:1}),createVNode(u,{inset:"",onClick:_[7]||(_[7]=y=>unref(o)())},{default:withCtx(()=>[..._[19]||(_[19]=[createTextVNode(" 导出 .md 文档 ",-1)])]),_:1}),createVNode(u,{inset:"",onClick:_[8]||(_[8]=y=>unref(e)())},{default:withCtx(()=>[..._[20]||(_[20]=[createTextVNode(" 导出 .html ",-1)])]),_:1}),createVNode(u,{inset:"",onClick:_[9]||(_[9]=y=>unref(d)())},{default:withCtx(()=>[..._[21]||(_[21]=[createTextVNode(" 导出 .png ",-1)])]),_:1}),createVNode(C),createVNode(u,{inset:"",onClick:_[10]||(_[10]=y=>unref(s)())},{default:withCtx(()=>[_[22]||(_[22]=createTextVNode(" 复制 ",-1)),createVNode(x,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(ctrlSign))+" + C ",1)]),_:1})]),_:1}),createVNode(u,{inset:"",onClick:unref(l)},{default:withCtx(()=>[_[23]||(_[23]=createTextVNode(" 粘贴 ",-1)),createVNode(x,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(ctrlSign))+" + V ",1)]),_:1})]),_:1},8,["onClick"]),createVNode(u,{inset:"",onClick:_[11]||(_[11]=y=>unref(a)())},{default:withCtx(()=>[_[24]||(_[24]=createTextVNode(" 格式化 ",-1)),createVNode(x,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(altSign))+" + "+toDisplayString(unref(shiftSign))+" + F ",1)]),_:1})]),_:1})]),_:1})]),_:3})}}}),_sfc_main$W=defineComponent({__name:"AlertDialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Rv),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$V=defineComponent({__name:"Separator",props:{orientation:{},decorative:{type:Boolean},asChild:{type:Boolean},as:{},class:{},label:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(ap),mergeProps(o.value,{class:unref(cn)("shrink-0 bg-border relative",e.orientation==="vertical"?"w-px h-full":"h-px w-full",e.class)}),{default:withCtx(()=>[e.label?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(cn)("text-xs text-muted-foreground bg-background absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex justify-center items-center",e.orientation==="vertical"?"w-px px-1 py-2":"h-px py-1 px-2"))},toDisplayString(e.label),3)):createCommentVNode("",!0)]),_:1},16,["class"]))}}),_sfc_main$U=defineComponent({__name:"DropdownMenu",props:{defaultOpen:{type:Boolean},open:{type:Boolean},dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(uh),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$T=defineComponent({__name:"DropdownMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(ch),null,{default:withCtx(()=>[createVNode(unref(fh),mergeProps(unref(s),{class:unref(cn)("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$S=defineComponent({__name:"DropdownMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(vh),mergeProps(unref(a),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",t.inset&&"pl-8",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$R=defineComponent({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const o=Ot(t);return(a,n)=>(openBlock(),createBlock(unref(dh),mergeProps({class:"outline-hidden"},unref(o)),{default:withCtx(()=>[renderSlot(a.$slots,"default")]),_:3},16))}}),_hoisted_1$j=["onDragstart","onDrop","onDragover","onClick"],_hoisted_2$g={class:"line-clamp-1"},_hoisted_3$f={key:0,class:"space-y-1 ml-4 mt-1 border-l-2 border-gray-300 pl-1 dark:border-gray-700"},_sfc_main$Q=defineComponent({__name:"PostItem",props:{parentId:{},sortedPosts:{},startRenamePost:{type:Function},openHistoryDialog:{type:Function},startDelPost:{type:Function},dropTargetId:{},setDropTargetId:{type:Function},dragSourceId:{},setDragSourceId:{type:Function},handleDrop:{type:Function},handleDragEnd:{type:Function},openAddPostDialog:{type:Function}},setup(t){const e=t,o=useStore(),a=ref(!1),n=ref("");watch(a,d=>{d&&(n.value="")});function s(d,f){e.setDragSourceId(d),f.dataTransfer?.setData("text/plain",d),f.dataTransfer.effectAllowed="move"}function l(d){const f=o.posts.find(p=>p.id===d);f&&(f.collapsed=!f.collapsed)}function i(d){return e.sortedPosts.some(f=>f.parentId===d)}return(d,f)=>{const p=_sfc_main$1K,g=_sfc_main$R,E=_sfc_main$S,m=_sfc_main$T,S=_sfc_main$U,_=resolveComponent("PostItem",!0);return openBlock(!0),createElementBlock(Fragment,null,renderList(e.sortedPosts.filter(w=>e.parentId==null&&w.parentId==null||w.parentId===e.parentId),w=>(openBlock(),createElementBlock("div",{key:w.id},[createBaseVNode("a",{class:normalizeClass(["w-full inline-flex cursor-pointer items-center gap-1 rounded p-2 text-sm transition-colors",["hover:text-primary-foreground hover:bg-primary",{"bg-primary text-primary-foreground shadow-sm":unref(o).currentPostId===w.id,"opacity-50":e.dragSourceId===w.id,"outline-2 outline-dashed outline-primary border-gray-200 bg-gray-400/50 dark:border-gray-200 dark:bg-gray-500/50":e.dropTargetId===w.id}]]),draggable:"true",onDragstart:u=>s(w.id,u),onDragend:f[0]||(f[0]=(...u)=>e.handleDragEnd&&e.handleDragEnd(...u)),onDrop:withModifiers(u=>e.handleDrop(w.id),["prevent"]),onDragover:withModifiers(u=>e.setDropTargetId(w.id),["stop","prevent"]),onDragleave:f[1]||(f[1]=withModifiers(u=>e.setDropTargetId(null),["prevent"])),onClick:u=>unref(o).currentPostId=w.id},[createVNode(p,{size:"xs",variant:"ghost",class:normalizeClass(["h-max p-0.5",i(w.id)?"opacity-100":"opacity-0"]),onClick:withModifiers(u=>i(w.id)&&l(w.id),["stop"])},{default:withCtx(()=>[createVNode(unref(ChevronRight),{class:normalizeClass(["size-4 transition-transform",{"rotate-90":!w.collapsed}])},null,8,["class"])]),_:2},1032,["class","onClick"]),createBaseVNode("span",_hoisted_2$g,toDisplayString(w.title),1),createVNode(S,null,{default:withCtx(()=>[createVNode(g,{"as-child":""},{default:withCtx(()=>[createVNode(p,{size:"xs",variant:"ghost",class:"ml-auto h-max p-0.5"},{default:withCtx(()=>[createVNode(unref(Ellipsis),{class:"size-4"})]),_:1})]),_:1}),createVNode(m,null,{default:withCtx(()=>[createVNode(E,{onClick:withModifiers(u=>e.openAddPostDialog(w.id),["stop"])},{default:withCtx(()=>[createVNode(unref(SquarePlus),{class:"mr-2 size-4"}),f[2]||(f[2]=createTextVNode(" 新增内容 ",-1))]),_:1},8,["onClick"]),createVNode(E,{onClick:withModifiers(u=>e.startRenamePost(w.id),["stop"])},{default:withCtx(()=>[createVNode(unref(PenLine),{class:"mr-2 size-4"}),f[3]||(f[3]=createTextVNode(" 重命名 ",-1))]),_:1},8,["onClick"]),createVNode(E,{onClick:withModifiers(u=>e.openHistoryDialog(w.id),["stop"])},{default:withCtx(()=>[createVNode(unref(History),{class:"mr-2 size-4"}),f[4]||(f[4]=createTextVNode(" 历史记录 ",-1))]),_:1},8,["onClick"]),unref(o).posts.length>1?(openBlock(),createBlock(E,{key:0,onClick:withModifiers(u=>e.startDelPost(w.id),["stop"])},{default:withCtx(()=>[createVNode(unref(Trash2),{class:"mr-2 size-4"}),f[5]||(f[5]=createTextVNode(" 删除 ",-1))]),_:1},8,["onClick"])):createCommentVNode("",!0)]),_:2},1024)]),_:2},1024)],42,_hoisted_1$j),i(w.id)&&!w.collapsed?(openBlock(),createElementBlock("div",_hoisted_3$f,[createVNode(_,{"parent-id":w.id,"sorted-posts":e.sortedPosts,"start-rename-post":e.startRenamePost,"open-history-dialog":e.openHistoryDialog,"start-del-post":e.startDelPost,"drag-source-id":e.dragSourceId,"set-drag-source-id":e.setDragSourceId,"drop-target-id":e.dropTargetId,"set-drop-target-id":e.setDropTargetId,"handle-drag-end":e.handleDragEnd,"handle-drop":e.handleDrop,"open-add-post-dialog":e.openAddPostDialog},null,8,["parent-id","sorted-posts","start-rename-post","open-history-dialog","start-del-post","drag-source-id","set-drag-source-id","drop-target-id","set-drop-target-id","handle-drag-end","handle-drop","open-add-post-dialog"])])):createCommentVNode("",!0)]))),128)}}}),_sfc_main$P=defineComponent({__name:"DropdownMenuRadioGroup",props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Ch),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$O=defineComponent({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:a,...n}=e;return n});return(a,n)=>(openBlock(),createBlock(unref(hh),mergeProps(o.value,{class:unref(cn)("-mx-1 my-1 h-px bg-muted",e.class)}),null,16,["class"]))}}),_hoisted_1$i={class:"absolute left-2 h-3.5 w-3.5 flex items-center justify-center"},_sfc_main$N=defineComponent({__name:"DropdownMenuRadioItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},emits:["select"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(wh),mergeProps(unref(s),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",o.class)}),{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$i,[createVNode(unref(gh),null,{default:withCtx(()=>[createVNode(unref(Circle),{class:"h-2 w-2 fill-current"})]),_:1})]),renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$M=defineComponent({__name:"DialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(ou),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$L=defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Hg),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$K=defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Wg),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$J=defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(qg),null,{default:withCtx(()=>[createVNode(unref(Ug),mergeProps({...unref(s),...l.$attrs},{class:unref(cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$I=defineComponent({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(jg),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_hoisted_1$h={key:0,class:"sticky top-0 z-10 flex items-center justify-between px-4 py-3 border-b mb-2 bg-background"},_hoisted_2$f={class:"space-x-4 mb-2 flex justify-center shrink-0 py-2"},_hoisted_3$e={class:"flex-1 overflow-y-auto space-y-1 px-1"},_hoisted_4$d={class:"h-[50vh] flex"},_hoisted_5$c={class:"space-y-2 w-[150px]"},_hoisted_6$a=["onClick"],_hoisted_7$7={class:"space-y-2 max-h-full flex-1 overflow-y-auto"},_hoisted_8$5={class:"whitespace-pre-wrap p-2",style:{"word-wrap":"break-word","overflow-wrap":"break-word","word-break":"break-all",hyphens:"auto"}},_sfc_main$H=defineComponent({__name:"index",setup(t){const e=useStore(),o=ref(!1);watch(()=>e.isOpenPostSlider,()=>{e.isMobile&&(o.value=!0)}),watch(()=>e.isMobile,()=>{o.value=!1});const a=ref(null),n=ref(!1),s=ref("");watch(n,G=>{G&&(s.value="",a.value=null)});function l(G){n.value=!0,nextTick(()=>{a.value=G})}function i(){if(!s.value.trim())return toast.error("内容标题不可为空");if(e.posts.some(G=>G.title===s.value.trim()))return toast.error("内容标题已存在");e.addPost(s.value.trim(),a.value),n.value=!1,toast.success("内容新增成功")}const d=ref(null),f=ref(!1),p=ref("");function g(G){d.value=G,p.value=e.getPostById(G).title,f.value=!0}function E(){if(!p.value.trim())return toast.error("内容标题不可为空");if(e.posts.some(G=>G.title===p.value.trim()&&G.id!==d.value))return toast.error("内容标题已存在");if(p.value===e.getPostById(d.value)?.title){f.value=!1;return}e.renamePost(d.value,p.value.trim()),toast.success("内容重命名成功"),f.value=!1}const m=ref(null),S=ref(!1),_=computed(()=>{const G=e.getPostById(m.value||"")?.title??"";return`此操作将删除「${G.length>20?`${G.slice(0,20)}…`:G}」,是否继续?`});function w(G){m.value=G,S.value=!0}function u(){e.delPost(m.value),S.value=!1,toast.success("内容删除成功")}const C=ref(!1),x=ref(null),b=ref(0);function v(G){x.value=G,b.value=0,C.value=!0}function y(){const G=e.getPostById(x.value);if(!G){C.value=!1;return}const N=G.history[b.value].content;G.content=N;const K=toRaw(e.editor);K.dispatch({changes:{from:0,to:K.state.doc.length,insert:N}}),toast.success("记录恢复成功"),C.value=!1}const $=useStorage(addPrefix("sort_mode"),"create-old-new"),T=computed(()=>[...e.posts].sort((G,N)=>{switch($.value){case"A-Z":return G.title.localeCompare(N.title);case"Z-A":return N.title.localeCompare(G.title);case"update-new-old":return+new Date(N.updateDatetime)-+new Date(G.updateDatetime);case"update-old-new":return+new Date(G.updateDatetime)-+new Date(N.updateDatetime);case"create-new-old":return+new Date(N.createDatetime)-+new Date(G.createDatetime);default:return+new Date(G.createDatetime)-+new Date(N.createDatetime)}})),Y=ref(!1),te=ref(null),V=ref(null);function ae(G){const N=te.value;if(!N)return;const K=W=>{if(!W)return!1;const de=e.getPostById(W);return de?de.parentId===N?!0:K(de.parentId):!1};K(G)?toast.error("不能将内容拖拽到其子内容下面"):N!==G&&e.updatePostParentId(N,G||null),te.value=null}function q(G){G.preventDefault()}function z(){te.value=null,V.value=null,Y.value=!1}return(G,N)=>{const K=_sfc_main$1K,W=_sfc_main$I,de=_sfc_main$J,Z=_sfc_main$K,le=_sfc_main$L,ge=_sfc_main$M,P=_sfc_main$1v,H=_sfc_main$15,M=_sfc_main$1w,F=_sfc_main$1x,ne=_sfc_main$1t,J=_sfc_main$1D,ee=_sfc_main$1E,L=_sfc_main$R,R=_sfc_main$N,oe=_sfc_main$O,fe=_sfc_main$P,se=_sfc_main$T,re=_sfc_main$U,ce=_sfc_main$Q,j=_sfc_main$1F,I=_sfc_main$1G,_e=_sfc_main$1H,me=_sfc_main$1I,be=_sfc_main$1J,ke=_sfc_main$1L,xe=_sfc_main$1M,ye=_sfc_main$1N,Ce=_sfc_main$V,ve=_sfc_main$W;return openBlock(),createElementBlock(Fragment,null,[unref(e).isMobile&&unref(e).isOpenPostSlider?(openBlock(),createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/50 z-40",onClick:N[0]||(N[0]=pe=>unref(e).isOpenPostSlider=!1)})):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["h-full w-full overflow-hidden mobile-drawer",{"fixed top-0 left-0 z-55 bg-background border-r shadow-lg":unref(e).isMobile,animate:unref(e).isMobile&&unref(o),"border-2 border-[#0000] border-dashed bg-gray/20 transition-colors":!unref(e).isMobile,"border-gray-700 bg-gray-400/50 dark:border-gray-200 dark:bg-gray-500/50":!unref(e).isMobile&&unref(Y)}]),style:normalizeStyle({transform:unref(e).isMobile&&unref(e).isOpenPostSlider?"translateX(0)":unref(e).isMobile&&!unref(e).isOpenPostSlider?"translateX(-100%)":void 0}),onDragover:N[6]||(N[6]=withModifiers(pe=>Y.value=!0,["prevent"])),onDragleave:N[7]||(N[7]=withModifiers(pe=>Y.value=!1,["prevent"])),onDragend:z},[createBaseVNode("nav",{class:normalizeClass(["h-full flex flex-col transition-transform overflow-hidden",{"p-2":unref(e).isMobile}]),onDragover:q,onDrop:N[5]||(N[5]=withModifiers(pe=>ae(null),["prevent"]))},[unref(e).isMobile?(openBlock(),createElementBlock("div",_hoisted_1$h,[N[13]||(N[13]=createBaseVNode("h2",{class:"text-lg font-semibold"}," 内容管理 ",-1)),createVNode(K,{variant:"ghost",size:"sm",onClick:N[1]||(N[1]=pe=>unref(e).isOpenPostSlider=!1)},{default:withCtx(()=>[createVNode(unref(X),{class:"h-4 w-4"})]),_:1})])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_2$f,[createVNode(ee,{open:unref(n),"onUpdate:open":N[3]||(N[3]=pe=>isRef(n)?n.value=pe:null)},{default:withCtx(()=>[createVNode(ge,null,{default:withCtx(()=>[createVNode(le,{"delay-duration":200},{default:withCtx(()=>[createVNode(Z,null,{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(K,{variant:"ghost",size:"xs",class:"h-max p-1"},{default:withCtx(()=>[createVNode(unref(SquarePlus),{class:"size-5"})]),_:1})]),_:1}),createVNode(de,{side:"bottom"},{default:withCtx(()=>[...N[14]||(N[14]=[createTextVNode(" 新增内容 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(J,null,{default:withCtx(()=>[createVNode(M,null,{default:withCtx(()=>[createVNode(P,null,{default:withCtx(()=>[...N[15]||(N[15]=[createTextVNode("新增内容",-1)])]),_:1}),createVNode(H,null,{default:withCtx(()=>[...N[16]||(N[16]=[createTextVNode("请输入内容名称",-1)])]),_:1})]),_:1}),createVNode(F,{modelValue:unref(s),"onUpdate:modelValue":N[2]||(N[2]=pe=>isRef(s)?s.value=pe:null),onKeyup:withKeys(i,["enter"])},null,8,["modelValue"]),createVNode(ne,null,{default:withCtx(()=>[createVNode(K,{onClick:i},{default:withCtx(()=>[...N[17]||(N[17]=[createTextVNode(" 确 定 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(re,null,{default:withCtx(()=>[createVNode(L,null,{default:withCtx(()=>[createVNode(le,{"delay-duration":200},{default:withCtx(()=>[createVNode(Z,null,{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(K,{variant:"ghost",size:"xs",class:"h-max p-1"},{default:withCtx(()=>[createVNode(unref(ArrowUpNarrowWide),{class:"size-5"})]),_:1})]),_:1}),createVNode(de,{side:"bottom"},{default:withCtx(()=>[...N[18]||(N[18]=[createTextVNode(" 排序模式 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(se,null,{default:withCtx(()=>[createVNode(fe,{modelValue:unref($),"onUpdate:modelValue":N[4]||(N[4]=pe=>isRef($)?$.value=pe:null)},{default:withCtx(()=>[createVNode(R,{value:"A-Z"},{default:withCtx(()=>[...N[19]||(N[19]=[createTextVNode(" 文件名(A-Z) ",-1)])]),_:1}),createVNode(R,{value:"Z-A"},{default:withCtx(()=>[...N[20]||(N[20]=[createTextVNode(" 文件名(Z-A) ",-1)])]),_:1}),createVNode(oe),createVNode(R,{value:"update-new-old"},{default:withCtx(()=>[...N[21]||(N[21]=[createTextVNode(" 编辑时间(新→旧) ",-1)])]),_:1}),createVNode(R,{value:"update-old-new"},{default:withCtx(()=>[...N[22]||(N[22]=[createTextVNode(" 编辑时间(旧→新) ",-1)])]),_:1}),createVNode(oe),createVNode(R,{value:"create-new-old"},{default:withCtx(()=>[...N[23]||(N[23]=[createTextVNode(" 创建时间(新→旧) ",-1)])]),_:1}),createVNode(R,{value:"create-old-new"},{default:withCtx(()=>[...N[24]||(N[24]=[createTextVNode(" 创建时间(旧→新) ",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),createVNode(le,{"delay-duration":200},{default:withCtx(()=>[createVNode(Z,null,{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(K,{variant:"ghost",size:"xs",class:"h-max p-1",onClick:unref(e).collapseAllPosts},{default:withCtx(()=>[createVNode(unref(ChevronsDownUp),{class:"size-5"})]),_:1},8,["onClick"])]),_:1}),createVNode(de,{side:"bottom"},{default:withCtx(()=>[...N[25]||(N[25]=[createTextVNode(" 全部收起 ",-1)])]),_:1})]),_:1})]),_:1}),createVNode(le,{"delay-duration":200},{default:withCtx(()=>[createVNode(Z,null,{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(K,{variant:"ghost",size:"xs",class:"h-max p-1",onClick:unref(e).expandAllPosts},{default:withCtx(()=>[createVNode(unref(ChevronsUpDown),{class:"size-5"})]),_:1},8,["onClick"])]),_:1}),createVNode(de,{side:"bottom"},{default:withCtx(()=>[...N[26]||(N[26]=[createTextVNode(" 全部展开 ",-1)])]),_:1})]),_:1})]),_:1})]),createBaseVNode("div",_hoisted_3$e,[createVNode(ce,{"parent-id":null,"sorted-posts":unref(T),"start-rename-post":g,"open-history-dialog":v,"start-del-post":w,"drop-target-id":unref(V),"set-drop-target-id":pe=>V.value=pe,"drag-source-id":unref(te),"set-drag-source-id":pe=>te.value=pe,"handle-drop":ae,"handle-drag-end":z,"open-add-post-dialog":l},null,8,["sorted-posts","drop-target-id","set-drop-target-id","drag-source-id","set-drag-source-id"])])],34)],38),createVNode(ee,{open:unref(f),"onUpdate:open":N[10]||(N[10]=pe=>isRef(f)?f.value=pe:null)},{default:withCtx(()=>[createVNode(J,{class:"sm:max-w-[425px]"},{default:withCtx(()=>[createVNode(M,null,{default:withCtx(()=>[createVNode(P,null,{default:withCtx(()=>[...N[27]||(N[27]=[createTextVNode("编辑内容名称",-1)])]),_:1}),createVNode(H,null,{default:withCtx(()=>[...N[28]||(N[28]=[createTextVNode("请输入新的内容名称",-1)])]),_:1})]),_:1}),createVNode(F,{modelValue:unref(p),"onUpdate:modelValue":N[8]||(N[8]=pe=>isRef(p)?p.value=pe:null),onKeyup:withKeys(E,["enter"])},null,8,["modelValue"]),createVNode(ne,null,{default:withCtx(()=>[createVNode(K,{variant:"outline",onClick:N[9]||(N[9]=pe=>f.value=!1)},{default:withCtx(()=>[...N[29]||(N[29]=[createTextVNode(" 取消 ",-1)])]),_:1}),createVNode(K,{onClick:E},{default:withCtx(()=>[...N[30]||(N[30]=[createTextVNode(" 保存 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(ye,{open:unref(S),"onUpdate:open":N[11]||(N[11]=pe=>isRef(S)?S.value=pe:null)},{default:withCtx(()=>[createVNode(xe,null,{default:withCtx(()=>[createVNode(_e,null,{default:withCtx(()=>[createVNode(j,null,{default:withCtx(()=>[...N[31]||(N[31]=[createTextVNode("提示",-1)])]),_:1}),createVNode(I,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(_)),1)]),_:1})]),_:1}),createVNode(ke,null,{default:withCtx(()=>[createVNode(me,null,{default:withCtx(()=>[...N[32]||(N[32]=[createTextVNode("取消",-1)])]),_:1}),createVNode(be,{onClick:u},{default:withCtx(()=>[...N[33]||(N[33]=[createTextVNode(" 确认 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(ee,{open:unref(C),"onUpdate:open":N[12]||(N[12]=pe=>isRef(C)?C.value=pe:null)},{default:withCtx(()=>[createVNode(J,{class:"sm:max-w-4xl"},{default:withCtx(()=>[createVNode(M,null,{default:withCtx(()=>[createVNode(P,null,{default:withCtx(()=>[...N[34]||(N[34]=[createTextVNode("历史记录",-1)])]),_:1}),createVNode(H,null,{default:withCtx(()=>[...N[35]||(N[35]=[createTextVNode("每隔 30 秒自动保存,最多保留 10 条",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_4$d,[createBaseVNode("ul",_hoisted_5$c,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(e).getPostById(unref(x))?.history,(pe,Ve)=>(openBlock(),createElementBlock("li",{key:pe.datetime,class:normalizeClass(["h-8 w-full inline-flex cursor-pointer items-center gap-2 rounded px-2 text-sm transition-colors",["hover:bg-primary/90 hover:text-primary-foreground",{"bg-primary text-primary-foreground shadow-lg dark:border dark:border-primary":unref(b)===Ve,"dark:bg-gray/30 dark:text-primary-foreground-dark dark:border-primary-dark":unref(b)===Ve}]]),onClick:Be=>b.value=Ve},toDisplayString(pe.datetime),11,_hoisted_6$a))),128))]),createVNode(Ce,{orientation:"vertical",class:"mx-2"}),createBaseVNode("div",_hoisted_7$7,[createBaseVNode("div",_hoisted_8$5,toDisplayString(unref(e).getPostById(unref(x))?.history[unref(b)].content??""),1)])]),createVNode(ne,null,{default:withCtx(()=>[createVNode(ye,null,{default:withCtx(()=>[createVNode(ve,null,{default:withCtx(()=>[createVNode(K,null,{default:withCtx(()=>[...N[36]||(N[36]=[createTextVNode("恢 复",-1)])]),_:1})]),_:1}),createVNode(xe,null,{default:withCtx(()=>[createVNode(_e,null,{default:withCtx(()=>[createVNode(j,null,{default:withCtx(()=>[...N[37]||(N[37]=[createTextVNode("提示",-1)])]),_:1}),createVNode(I,null,{default:withCtx(()=>[...N[38]||(N[38]=[createTextVNode(" 此操作将用该记录替换当前文章内容,是否继续? ",-1)])]),_:1})]),_:1}),createVNode(ke,null,{default:withCtx(()=>[createVNode(me,null,{default:withCtx(()=>[...N[39]||(N[39]=[createTextVNode("取消",-1)])]),_:1}),createVNode(be,{onClick:y},{default:withCtx(()=>[...N[40]||(N[40]=[createTextVNode(" 恢 复 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])],64)}}}),__unplugin_components_2=_export_sfc(_sfc_main$H,[["__scopeId","data-v-d1763e2d"]]),useAIImageConfigStore=defineStore("AIImageConfig",()=>{const t=useStorage("openai_image_type",DEFAULT_SERVICE_TYPE),e=useStorage("openai_image_size","1024x1024"),o=useStorage("openai_image_quality","standard"),a=useStorage("openai_image_style","natural"),n=customRef((d,f)=>({get(){return d(),t.value==="custom"?localStorage.getItem(`openai_image_endpoint_${t.value}`)||"":(imageServiceOptions.find(g=>g.value===t.value)??imageServiceOptions[0]).endpoint},set(p){t.value==="custom"&&localStorage.setItem(`openai_image_endpoint_${t.value}`,p),f()}})),s=ref(""),l=customRef((d,f)=>({get(){return d(),localStorage.getItem(`openai_image_key_${t.value}`)||DEFAULT_SERVICE_KEY},set(p){t.value!==DEFAULT_SERVICE_TYPE&&localStorage.setItem(`openai_image_key_${t.value}`,p),f()}}));watch(t,d=>{const f=imageServiceOptions.find(p=>p.value===d)??imageServiceOptions[0];if(d==="custom"){const p=localStorage.getItem(`openai_image_model_${d}`)||"";s.value=p}else{const p=localStorage.getItem(`openai_image_model_${d}`)||"";s.value=f.models.includes(p)?p:f.models[0],!f.models.includes(p)&&f.models[0]&&localStorage.setItem(`openai_image_model_${d}`,f.models[0])}},{immediate:!0}),watch(s,d=>{localStorage.setItem(`openai_image_model_${t.value}`,d)});function i(){t.value=DEFAULT_SERVICE_TYPE,e.value="1024x1024",o.value="standard",a.value="natural",imageServiceOptions.forEach(({value:d})=>{localStorage.removeItem(`openai_image_key_${d}`),localStorage.removeItem(`openai_image_model_${d}`),localStorage.removeItem(`openai_image_endpoint_${d}`)})}return{type:t,endpoint:n,model:s,size:e,quality:o,style:a,apiKey:l,reset:i}}),_hoisted_1$g={class:"relative"},_hoisted_2$e=["type","placeholder"],_sfc_main$G=defineComponent({__name:"PasswordInput",props:{defaultValue:{},modelValue:{},class:{},placeholder:{}},setup(t,{emit:e}){const o=t,n=useVModel(o,"modelValue",e,{passive:!0,defaultValue:o.defaultValue}),s=ref(!1);function l(){s.value=!s.value}return(i,d)=>(openBlock(),createElementBlock("div",_hoisted_1$g,[withDirectives(createBaseVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=f=>isRef(n)?n.value=f:null),type:unref(s)?"text":"password",placeholder:t.placeholder,class:normalizeClass(unref(cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 pr-10 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,10,_hoisted_2$e),[[vModelDynamic,unref(n)]]),createBaseVNode("button",{type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors","aria-label":"切换密码可见性",onClick:l},[unref(s)?(openBlock(),createBlock(unref(EyeOff),{key:1,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Eye),{key:0,class:"h-4 w-4"}))])]))}}),_hoisted_1$f={class:"space-y-4 max-w-full"},_hoisted_2$d=["readonly"],_hoisted_3$d={key:0},_hoisted_4$c={key:1},_hoisted_5$b={key:2},_hoisted_6$9={key:3,class:"flex items-start gap-2 p-3 bg-blue-50 dark:bg-blue-950/30 rounded-md text-sm"},_hoisted_7$6={key:4,class:"flex items-start gap-2 p-3 bg-orange-50 dark:bg-orange-950/30 rounded-md text-sm"},_hoisted_8$4={class:"flex flex-wrap gap-2"},_hoisted_9$3={key:5,class:"mt-1 text-xs text-gray-500"},_sfc_main$F=defineComponent({__name:"AIImageConfig",emits:["saved"],setup(t,{emit:e}){const o=e,a=useAIImageConfigStore(),{type:n,endpoint:s,model:l,apiKey:i,size:d,quality:f,style:p}=storeToRefs(a),g=ref(!1),E=ref(""),m=computed(()=>imageServiceOptions.find(b=>b.value===n.value)||imageServiceOptions[0]);watch(n,()=>{E.value=""}),watch(l,()=>{E.value=""}),watch(s,()=>{E.value=""});function S(){if(!s.value.trim()||!l.value.trim()){E.value="❌ 请检查配置项是否完整";return}if(n.value!==DEFAULT_SERVICE_TYPE&&!i.value.trim()){E.value="❌ 请输入 API Key";return}try{new URL(s.value)}catch{E.value="❌ 端点格式有误";return}E.value="✅ 配置已保存",o("saved")}function _(){a.reset(),E.value="🗑️ 当前 AI 图像配置已清除"}async function w(){E.value="",g.value=!0;const b={"Content-Type":"application/json"};i.value&&n.value!==DEFAULT_SERVICE_TYPE&&(b.Authorization=`Bearer ${i.value}`);try{const v=new URL(s.value);!v.pathname.includes("/images/")&&!v.pathname.endsWith("/images/generations")&&(v.pathname=v.pathname.replace(/\/?$/,"/images/generations"));const y={model:l.value,prompt:"test connection",size:d.value,quality:f.value,style:p.value,n:1},$=await window.fetch(v.toString(),{method:"POST",headers:b,body:JSON.stringify(y)});if($.ok)E.value="✅ 连接成功";else{const T=await $.text();E.value=`❌ 连接失败:${$.status} ${T}`}}catch(v){E.value=`❌ 连接失败:${v.message}`}finally{g.value=!1}}const u=[{label:"正方形 (1024x1024)",value:"1024x1024"},{label:"横版 (1792x1024)",value:"1792x1024"},{label:"竖版 (1024x1792)",value:"1024x1792"}],C=[{label:"标准",value:"standard"},{label:"高清",value:"hd"}],x=[{label:"自然",value:"natural"},{label:"鲜明",value:"vivid"}];return(b,v)=>(openBlock(),createElementBlock("div",_hoisted_1$f,[v[19]||(v[19]=createBaseVNode("div",{class:"text-lg font-semibold border-b pb-2"}," AI 图像生成配置 ",-1)),createBaseVNode("div",null,[createVNode(unref(_sfc_main$1B),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...v[8]||(v[8]=[createTextVNode("服务商",-1)])]),_:1}),createVNode(unref(_sfc_main$1h),{modelValue:unref(n),"onUpdate:modelValue":v[0]||(v[0]=y=>isRef(n)?n.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1c),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1b),null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(m).label),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1a),null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(imageServiceOptions),y=>(openBlock(),createBlock(unref(_sfc_main$1f),{key:y.value,value:y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(y.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),createBaseVNode("div",null,[createVNode(unref(_sfc_main$1B),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...v[9]||(v[9]=[createTextVNode("API 端点",-1)])]),_:1}),withDirectives(createBaseVNode("input",{"onUpdate:modelValue":v[1]||(v[1]=y=>isRef(s)?s.value=y:null),type:"url",class:"w-full mt-1 p-2 border rounded-md bg-background focus:ring-2 focus:ring-primary focus:border-primary transition-colors",placeholder:"https://api.openai.com/v1",readonly:unref(n)!=="custom"},null,8,_hoisted_2$d),[[vModelText,unref(s)]])]),unref(n)!=="default"?(openBlock(),createElementBlock("div",_hoisted_3$d,[createVNode(unref(_sfc_main$1B),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...v[10]||(v[10]=[createTextVNode("API Key",-1)])]),_:1}),createVNode(unref(_sfc_main$G),{modelValue:unref(i),"onUpdate:modelValue":v[2]||(v[2]=y=>isRef(i)?i.value=y:null),class:"w-full mt-1 focus:ring-2 focus:ring-primary focus:border-primary transition-colors",placeholder:"sk-..."},null,8,["modelValue"])])):createCommentVNode("",!0),createBaseVNode("div",null,[createVNode(unref(_sfc_main$1B),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...v[11]||(v[11]=[createTextVNode("模型",-1)])]),_:1}),unref(n)!=="custom"&&unref(m).models.length>0?(openBlock(),createBlock(unref(_sfc_main$1h),{key:0,modelValue:unref(l),"onUpdate:modelValue":v[3]||(v[3]=y=>isRef(l)?l.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1c),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1b),null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(l)||"请选择模型"),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1a),null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(m).models,y=>(openBlock(),createBlock(unref(_sfc_main$1f),{key:y,value:y},{default:withCtx(()=>[createTextVNode(toDisplayString(y),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])):withDirectives((openBlock(),createElementBlock("input",{key:1,"onUpdate:modelValue":v[4]||(v[4]=y=>isRef(l)?l.value=y:null),type:"text",class:"w-full mt-1 p-2 border rounded-md bg-background focus:ring-2 focus:ring-primary focus:border-primary transition-colors",placeholder:"输入模型名称,如:dall-e-3"},null,512)),[[vModelText,unref(l)]])]),createBaseVNode("div",null,[createVNode(unref(_sfc_main$1B),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...v[12]||(v[12]=[createTextVNode("图像尺寸",-1)])]),_:1}),createVNode(unref(_sfc_main$1h),{modelValue:unref(d),"onUpdate:modelValue":v[5]||(v[5]=y=>isRef(d)?d.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1c),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1b),null,{default:withCtx(()=>[createTextVNode(toDisplayString(u.find(y=>y.value===unref(d))?.label||unref(d)),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1a),null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(u,y=>createVNode(unref(_sfc_main$1f),{key:y.value,value:y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(y.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])]),unref(l).includes("dall-e")?(openBlock(),createElementBlock("div",_hoisted_4$c,[createVNode(unref(_sfc_main$1B),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...v[13]||(v[13]=[createTextVNode("图像质量",-1)])]),_:1}),createVNode(unref(_sfc_main$1h),{modelValue:unref(f),"onUpdate:modelValue":v[6]||(v[6]=y=>isRef(f)?f.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1c),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1b),null,{default:withCtx(()=>[createTextVNode(toDisplayString(C.find(y=>y.value===unref(f))?.label||unref(f)),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1a),null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(C,y=>createVNode(unref(_sfc_main$1f),{key:y.value,value:y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(y.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])])):createCommentVNode("",!0),unref(l).includes("dall-e")?(openBlock(),createElementBlock("div",_hoisted_5$b,[createVNode(unref(_sfc_main$1B),{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...v[14]||(v[14]=[createTextVNode("图像风格",-1)])]),_:1}),createVNode(unref(_sfc_main$1h),{modelValue:unref(p),"onUpdate:modelValue":v[7]||(v[7]=y=>isRef(p)?p.value=y:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1c),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1b),null,{default:withCtx(()=>[createTextVNode(toDisplayString(x.find(y=>y.value===unref(p))?.label||unref(p)),1)]),_:1})]),_:1}),createVNode(unref(_sfc_main$1a),null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(x,y=>createVNode(unref(_sfc_main$1f),{key:y.value,value:y.value},{default:withCtx(()=>[createTextVNode(toDisplayString(y.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])])):createCommentVNode("",!0),unref(n)==="default"?(openBlock(),createElementBlock("div",_hoisted_6$9,[createVNode(unref(Info),{class:"h-4 w-4 text-blue-500 mt-0.5 flex-shrink-0"}),v[15]||(v[15]=createBaseVNode("div",{class:"text-blue-700 dark:text-blue-300"},[createBaseVNode("p",{class:"font-medium"}," 默认图像服务 "),createBaseVNode("p",null,"免费使用,无需配置 API Key,支持 Kwai-Kolors/Kolors 模型。")],-1))])):unref(n)==="custom"?(openBlock(),createElementBlock("div",_hoisted_7$6,[createVNode(unref(Info),{class:"h-4 w-4 text-orange-500 mt-0.5 flex-shrink-0"}),v[16]||(v[16]=createBaseVNode("div",{class:"text-orange-700 dark:text-orange-300"},[createBaseVNode("p",{class:"font-medium"}," 自定义服务 "),createBaseVNode("p",null,"可配置任何兼容 OpenAI 图像生成 API 的服务,如自建的 API 代理或其他第三方服务。"),createBaseVNode("p",{class:"mt-1 text-xs"}," 端点格式示例:https://your-api.com/v1 ")],-1))])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_8$4,[createVNode(unref(_sfc_main$1K),{type:"button",class:"flex-1 min-w-[100px]",onClick:S},{default:withCtx(()=>[...v[17]||(v[17]=[createTextVNode(" 保存配置 ",-1)])]),_:1}),createVNode(unref(_sfc_main$1K),{variant:"outline",type:"button",class:"flex-1 min-w-[80px]",onClick:_},{default:withCtx(()=>[...v[18]||(v[18]=[createTextVNode(" 清空 ",-1)])]),_:1}),createVNode(unref(_sfc_main$1K),{size:"sm",variant:"outline",class:"flex-1 min-w-[100px]",disabled:unref(g),onClick:w},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(g)?"测试中...":"测试连接"),1)]),_:1},8,["disabled"])]),unref(E)?(openBlock(),createElementBlock("div",_hoisted_9$3,toDisplayString(unref(E)),1)):createCommentVNode("",!0)]))}}),_hoisted_1$e={class:"space-x-1 flex items-center"},_hoisted_2$c={key:0,class:"mb-4 w-full border rounded-md p-4 max-h-[60vh] overflow-y-auto flex-shrink-0"},_hoisted_3$c={key:1,class:"flex flex-col space-y-4 flex-shrink-0"},_hoisted_4$b={class:"flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded-lg min-h-[250px] sm:min-h-[300px]"},_hoisted_5$a={key:0,class:"flex flex-col items-center gap-4"},_hoisted_6$8={key:1,class:"w-full flex flex-col space-y-3"},_hoisted_7$5={key:0,class:"flex items-center justify-between p-2 bg-muted/20 rounded"},_hoisted_8$3={class:"text-sm text-muted-foreground"},_hoisted_9$2={class:"flex items-center justify-center p-2 sm:p-4"},_hoisted_10$1=["src","alt"],_hoisted_11$1={class:"px-2 sm:px-4 py-2 bg-muted/10 rounded space-y-1"},_hoisted_12$1={class:"text-xs text-muted-foreground text-center"},_hoisted_13$1={class:"text-xs text-muted-foreground break-words text-center"},_hoisted_14$1={class:"ml-1"},_hoisted_15$1={class:"text-xs text-muted-foreground text-center"},_hoisted_16$1={class:"flex flex-wrap justify-center gap-2 p-2 sm:p-4 bg-muted/20 border-t border-border rounded-b-lg"},_hoisted_17$1={key:2,class:"relative flex-shrink-0 mt-auto"},_hoisted_18$1={class:"bg-background border-border flex flex-col items-baseline gap-2 border rounded-xl px-3 py-2 pr-12 shadow-inner"},_sfc_main$E=defineComponent({__name:"AIImageGeneratorPanel",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=t,a=e,n=useStore(),{editor:s}=storeToRefs(n),l=useDisplayStore(),{toggleAIDialog:i}=l,d=ref(o.open);watch(()=>o.open,L=>{d.value=L,L&&ae()}),watch(d,L=>a("update:open",L));const f=ref(!1),p=ref(!1),g=ref(""),E=ref(""),m=ref([]),S=ref([]),_=ref([]),w=ref(null),u=ref(0),C=ref(null),x=useAIImageConfigStore(),{apiKey:b,endpoint:v,model:y,type:$,size:T,quality:Y,style:te}=storeToRefs(x);function V(L){return Date.now()-L>36e5}function ae(){const L=localStorage.getItem("ai_generated_images"),R=localStorage.getItem("ai_image_prompts"),oe=localStorage.getItem("ai_image_timestamps");if(!L)return;const fe=JSON.parse(L),se=R?JSON.parse(R):[],re=oe?JSON.parse(oe):[];if(!oe||re.length===0){console.log("🧹 检测到旧版本数据,清除所有过期图片"),m.value=[],S.value=[],_.value=[],localStorage.removeItem("ai_generated_images"),localStorage.removeItem("ai_image_prompts"),localStorage.removeItem("ai_image_timestamps");return}const ce=[];re.forEach((me,be)=>{V(me)||ce.push(be)});const j=ce.map(me=>fe[me]).filter(Boolean),I=ce.map(me=>se[me]||"").filter((me,be)=>j[be]),_e=ce.map(me=>re[me]).filter(Boolean);m.value=j,S.value=I,_.value=_e,j.length<fe.length&&(console.log(`🧹 清除了 ${fe.length-j.length} 张过期图片`),j.length>0?(localStorage.setItem("ai_generated_images",JSON.stringify(j)),localStorage.setItem("ai_image_prompts",JSON.stringify(I)),localStorage.setItem("ai_image_timestamps",JSON.stringify(_e))):(localStorage.removeItem("ai_generated_images"),localStorage.removeItem("ai_image_prompts"),localStorage.removeItem("ai_image_timestamps"))),console.log("📊 过期检查完成,有效图片数量:",j.length)}onMounted(()=>{ae();const L=m.value.length,R=S.value.length,oe=_.value.length,fe=Math.max(L,R,oe);L<fe?(console.warn("⚠️ 数据不一致,清除所有数据"),m.value=[],S.value=[],_.value=[],localStorage.removeItem("ai_generated_images"),localStorage.removeItem("ai_image_prompts"),localStorage.removeItem("ai_image_timestamps")):(R<L&&(S.value=[...S.value,...Array.from({length:L-R},()=>"")]),oe<L&&(_.value=[..._.value,...Array.from({length:L-oe},()=>Date.now())])),console.log("📊 数据加载完成,图片数量:",m.value.length,"提示词数量:",S.value.length,"时间戳数量:",_.value.length),C.value=setInterval(()=>{m.value.length>0&&ae()},3e4)}),onBeforeUnmount(()=>{C.value&&(clearInterval(C.value),C.value=null)});function q(){f.value=!1}function z(){a("update:open",!1),setTimeout(()=>{i(!0)},100)}function G(L){L.isComposing||L.keyCode===229||L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),N())}async function N(){if(!g.value.trim()||p.value)return;const L=g.value.trim();E.value=L,p.value=!0,w.value=new AbortController;const R={"Content-Type":"application/json"};b.value&&$.value!=="default"&&(R.Authorization=`Bearer ${b.value}`);try{const oe=new URL(v.value);!oe.pathname.includes("/images/")&&!oe.pathname.endsWith("/images/generations")&&(oe.pathname=oe.pathname.replace(/\/?$/,"/images/generations"));const fe={model:y.value,prompt:L,size:T.value,n:1};y.value.includes("dall-e")&&(fe.quality=Y.value,fe.style=te.value);const se=await window.fetch(oe.toString(),{method:"POST",headers:R,body:JSON.stringify(fe),signal:w.value.signal});if(!se.ok){const ce=await se.text();throw new Error(`${se.status}: ${ce}`)}const re=await se.json();if(re.data&&re.data.length>0){const ce=re.data[0].url||re.data[0].b64_json;if(ce){const j=ce.startsWith("data:")||ce.startsWith("http")?ce:`data:image/png;base64,${ce}`,I=Date.now();m.value.unshift(j),S.value.unshift(L),_.value.unshift(I),u.value=0,m.value.length>20&&(m.value=m.value.slice(0,20),S.value=S.value.slice(0,20),_.value=_.value.slice(0,20)),localStorage.setItem("ai_generated_images",JSON.stringify(m.value)),localStorage.setItem("ai_image_prompts",JSON.stringify(S.value)),localStorage.setItem("ai_image_timestamps",JSON.stringify(_.value)),g.value=""}}else throw new Error("未收到有效的图像数据")}catch(oe){oe.name==="AbortError"?console.log("图像生成请求中止"):console.error("图像生成失败:",oe)}finally{p.value=!1,w.value=null}}function K(){w.value&&(w.value.abort(),w.value=null),p.value=!1}function W(){m.value=[],S.value=[],_.value=[],u.value=0,localStorage.removeItem("ai_generated_images"),localStorage.removeItem("ai_image_prompts"),localStorage.removeItem("ai_image_timestamps")}async function de(L,R){try{const fe=await(await fetch(L)).blob(),se=window.URL.createObjectURL(fe),re=document.createElement("a");re.href=se;const ce=S.value[R]||"",j=ce?ce.substring(0,20).replace(/[^\w\s-]/g,"").replace(/\s+/g,"-"):"no-prompt";re.download=`ai-image-${R+1}-${j}.png`,document.body.appendChild(re),re.click(),document.body.removeChild(re),window.URL.revokeObjectURL(se)}catch(oe){console.error("下载图像失败:",oe)}}async function Z(L){try{await copyPlain(L),console.log("✅ 图片链接已复制到剪贴板"),typeof toast<"u"&&toast.success("图片链接已复制到剪贴板")}catch(R){console.error("❌ 复制失败:",R),typeof toast<"u"&&toast.error("复制失败,请重试")}}function le(){const L=S.value[u.value];L?(console.log("🔄 重新生成图像,使用当前图片的prompt:",L),ge(L)):console.warn("⚠️ 没有找到当前图片的prompt")}async function ge(L){if(!L.trim()||p.value)return;p.value=!0,w.value=new AbortController;const R={"Content-Type":"application/json"};b.value&&$.value!=="default"&&(R.Authorization=`Bearer ${b.value}`);try{const oe=new URL(v.value);!oe.pathname.includes("/images/")&&!oe.pathname.endsWith("/images/generations")&&(oe.pathname=oe.pathname.replace(/\/?$/,"/images/generations"));const fe={model:y.value,prompt:L.trim(),size:T.value,n:1};y.value.includes("dall-e")&&(fe.quality=Y.value,fe.style=te.value);const se=await window.fetch(oe.toString(),{method:"POST",headers:R,body:JSON.stringify(fe),signal:w.value.signal});if(!se.ok){const ce=await se.text();throw new Error(`${se.status}: ${ce}`)}const re=await se.json();if(re.data&&re.data.length>0){const ce=re.data[0].url||re.data[0].b64_json;if(ce){const j=ce.startsWith("data:")||ce.startsWith("http")?ce:`data:image/png;base64,${ce}`,I=Date.now();m.value.unshift(j),S.value.unshift(L.trim()),_.value.unshift(I),u.value=0,m.value.length>20&&(m.value=m.value.slice(0,20),S.value=S.value.slice(0,20),_.value=_.value.slice(0,20)),localStorage.setItem("ai_generated_images",JSON.stringify(m.value)),localStorage.setItem("ai_image_prompts",JSON.stringify(S.value)),localStorage.setItem("ai_image_timestamps",JSON.stringify(_.value))}}else throw new Error("未收到有效的图像数据")}catch(oe){oe.name==="AbortError"?console.log("图像生成请求中止"):console.error("图像生成失败:",oe)}finally{p.value=!1,w.value=null}}function P(){u.value>0&&u.value--}function H(){u.value<m.value.length-1&&u.value++}function M(L){if(!s.value){console.warn("编辑器未初始化");return}try{const R=S.value[u.value]||"";console.log("🔗 插入图片,使用关联的prompt:",R);const fe=`![${R.trim()?R.trim().substring(0,30).replace(/\n/g," "):"AI生成的图像"}](${L})`,se=s.value.state.selection.main.head;s.value.dispatch({changes:{from:se,insert:fe},selection:{anchor:se+fe.length}}),s.value.focus(),d.value=!1,console.log("✅ 图像已成功插入到光标位置")}catch(R){console.error("❌ 插入图像到光标位置失败:",R)}}function F(L){if(console.log("🔍 点击查看大图:",L),!L){console.error("❌ 图片URL为空");return}try{window.open(L,"_blank","width=800,height=600,scrollbars=yes,resizable=yes")||(console.error("❌ 无法打开新窗口,可能被浏览器阻止"),window.open(L,"_blank"))}catch(R){console.error("❌ 打开图片失败:",R)}}const ne=ref(Date.now());onMounted(()=>{const R=setInterval(()=>{ne.value=Date.now()},1e3);onBeforeUnmount(()=>{clearInterval(R)})});function J(L){if(!_.value[L])return"未知";const R=3600*1e3,oe=_.value[L],fe=ne.value-oe,se=R-fe;if(se<=0)return"已过期";const re=Math.floor(se/(60*1e3)),ce=Math.floor(se%(60*1e3)/1e3);return re>0?`${re}分${ce}秒`:`${ce}秒`}function ee(L){if(!_.value[L])return"text-muted-foreground";const R=3600*1e3,oe=_.value[L],fe=ne.value-oe,se=R-fe;return se<=0?"text-red-500 font-medium":se<600*1e3?"text-orange-500 font-medium":se<1800*1e3?"text-yellow-600":"text-green-600"}return(L,R)=>(openBlock(),createBlock(unref(_sfc_main$1E),{open:d.value,"onUpdate:open":R[8]||(R[8]=oe=>d.value=oe)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1D),{class:"bg-card text-card-foreground flex flex-col w-[95vw] max-h-[90vh] sm:max-h-[85vh] sm:max-w-4xl overflow-y-auto",style:{height:"auto"}},{default:withCtx(()=>[createVNode(unref(_sfc_main$1w),{class:"space-y-1 flex flex-col items-start"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$e,[createVNode(unref(_sfc_main$1v),null,{default:withCtx(()=>[...R[9]||(R[9]=[createTextVNode("AI 文生图",-1)])]),_:1}),createVNode(unref(_sfc_main$1K),{title:f.value?"AI 文生图":"配置参数","aria-label":f.value?"AI 文生图":"配置参数",variant:"ghost",size:"icon",onClick:R[0]||(R[0]=oe=>f.value=!f.value)},{default:withCtx(()=>[f.value?(openBlock(),createBlock(unref(Image),{key:0,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Settings),{key:1,class:"h-4 w-4"}))]),_:1},8,["title","aria-label"]),createVNode(unref(_sfc_main$1K),{title:"AI 对话","aria-label":"AI 对话",variant:"ghost",size:"icon",onClick:R[1]||(R[1]=oe=>z())},{default:withCtx(()=>[createVNode(unref(MessageCircle),{class:"h-4 w-4"})]),_:1}),createVNode(unref(_sfc_main$1K),{title:"清空图像","aria-label":"清空图像",variant:"ghost",size:"icon",onClick:W},{default:withCtx(()=>[createVNode(unref(Trash2),{class:"h-4 w-4"})]),_:1})]),R[10]||(R[10]=createBaseVNode("p",{class:"text-muted-foreground text-sm"}," 使用 AI 根据文字描述生成图像 ",-1))]),_:1}),f.value?(openBlock(),createElementBlock("div",_hoisted_2$c,[createVNode(_sfc_main$F,{onSaved:q})])):createCommentVNode("",!0),!f.value&&(p.value||m.value.length>0)?(openBlock(),createElementBlock("div",_hoisted_3$c,[createBaseVNode("div",_hoisted_4$b,[p.value?(openBlock(),createElementBlock("div",_hoisted_5$a,[createVNode(unref(LoaderCircle),{class:"h-8 w-8 animate-spin text-primary"}),R[12]||(R[12]=createBaseVNode("p",{class:"text-sm text-muted-foreground"}," 正在生成图像... ",-1)),createVNode(unref(_sfc_main$1K),{variant:"outline",size:"sm",onClick:K},{default:withCtx(()=>[...R[11]||(R[11]=[createTextVNode(" 取消生成 ",-1)])]),_:1})])):m.value.length>0?(openBlock(),createElementBlock("div",_hoisted_6$8,[m.value.length>1?(openBlock(),createElementBlock("div",_hoisted_7$5,[createVNode(unref(_sfc_main$1K),{variant:"outline",size:"sm",disabled:u.value<=0,onClick:P},{default:withCtx(()=>[...R[13]||(R[13]=[createTextVNode(" 上一张 ",-1)])]),_:1},8,["disabled"]),createBaseVNode("span",_hoisted_8$3,toDisplayString(u.value+1)+" / "+toDisplayString(m.value.length),1),createVNode(unref(_sfc_main$1K),{variant:"outline",size:"sm",disabled:u.value>=m.value.length-1,onClick:H},{default:withCtx(()=>[...R[14]||(R[14]=[createTextVNode(" 下一张 ",-1)])]),_:1},8,["disabled"])])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_9$2,[createBaseVNode("div",{class:"relative group cursor-pointer w-full max-w-sm",onClick:R[2]||(R[2]=oe=>F(m.value[u.value]))},[createBaseVNode("img",{src:m.value[u.value],alt:`生成的图像 ${u.value+1}`,class:"w-full h-auto max-h-[300px] sm:max-h-[350px] object-contain rounded-lg shadow-lg border border-border transition-transform hover:scale-105"},null,8,_hoisted_10$1),R[15]||(R[15]=createBaseVNode("div",{class:"absolute inset-0 bg-black/0 group-hover:bg-black/10 rounded-lg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none"},[createBaseVNode("div",{class:"bg-black/70 text-white px-3 py-1 rounded-md text-sm"}," 点击查看大图 ")],-1))])]),createBaseVNode("div",_hoisted_11$1,[createBaseVNode("p",_hoisted_12$1," 尺寸: "+toDisplayString(unref(T)),1),createBaseVNode("div",_hoisted_13$1,[R[16]||(R[16]=createBaseVNode("span",{class:"font-medium"},"提示词:",-1)),createBaseVNode("span",_hoisted_14$1,toDisplayString(S.value[u.value]||"无关联提示词"),1)]),createBaseVNode("div",_hoisted_15$1,[R[17]||(R[17]=createBaseVNode("span",{class:"font-medium"},"剩余有效期:",-1)),createBaseVNode("span",{class:normalizeClass(["ml-1",ee(u.value)])},toDisplayString(J(u.value)),3),R[18]||(R[18]=createBaseVNode("span",{class:"font-medium"},",请及时下载保存",-1))])]),createBaseVNode("div",_hoisted_16$1,[createVNode(unref(_sfc_main$1K),{variant:"outline",size:"sm",class:"flex-shrink-0 bg-background text-xs sm:text-sm",onClick:R[3]||(R[3]=oe=>M(m.value[u.value]))},{default:withCtx(()=>[createVNode(unref(Image),{class:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),R[19]||(R[19]=createTextVNode(" 插入 ",-1))]),_:1}),createVNode(unref(_sfc_main$1K),{variant:"outline",size:"sm",class:"flex-shrink-0 bg-background text-xs sm:text-sm",onClick:R[4]||(R[4]=oe=>de(m.value[u.value],u.value))},{default:withCtx(()=>[createVNode(unref(Download),{class:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),R[20]||(R[20]=createTextVNode(" 下载 ",-1))]),_:1}),createVNode(unref(_sfc_main$1K),{variant:"outline",size:"sm",class:"flex-shrink-0 bg-background text-xs sm:text-sm",onClick:R[5]||(R[5]=oe=>Z(m.value[u.value]))},{default:withCtx(()=>[createVNode(unref(Copy),{class:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),R[21]||(R[21]=createTextVNode(" 复制 ",-1))]),_:1}),createVNode(unref(_sfc_main$1K),{variant:"outline",size:"sm",class:"flex-shrink-0 bg-background text-xs sm:text-sm",onClick:le},{default:withCtx(()=>[createVNode(unref(RefreshCcw),{class:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),R[22]||(R[22]=createTextVNode(" 重新生成 ",-1))]),_:1})])])):createCommentVNode("",!0)])])):createCommentVNode("",!0),f.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_17$1,[createBaseVNode("div",_hoisted_18$1,[createVNode(unref(_sfc_main$1z),{modelValue:g.value,"onUpdate:modelValue":R[6]||(R[6]=oe=>g.value=oe),placeholder:"描述你想要生成的图像... (Enter 生成,Shift+Enter 换行)",rows:"2",class:"custom-scroll min-h-16 w-full resize-none border-none bg-transparent p-0 focus-visible:outline-hidden focus:outline-hidden focus-visible:ring-0 focus:ring-0 focus-visible:ring-offset-0 focus:ring-offset-0 focus-visible:ring-transparent focus:ring-transparent",onKeydown:G},null,8,["modelValue"]),createVNode(unref(_sfc_main$1K),{disabled:!g.value.trim()&&!p.value,size:"icon",class:normalizeClass(["absolute bottom-3 right-3 rounded-full disabled:opacity-40","bg-primary hover:bg-primary/90 text-primary-foreground"]),"aria-label":p.value?"取消":"生成",onClick:R[7]||(R[7]=oe=>p.value?K():N())},{default:withCtx(()=>[p.value?(openBlock(),createBlock(unref(LoaderCircle),{key:0,class:"h-4 w-4 animate-spin"})):(openBlock(),createBlock(unref(Image),{key:1,class:"h-4 w-4"}))]),_:1},8,["disabled","aria-label"])])]))]),_:1})]),_:1},8,["open"]))}}),AIImageGeneratorPanel=_export_sfc(_sfc_main$E,[["__scopeId","data-v-5584432f"]]),_hoisted_1$d={class:"grid grid-cols-1 lg:grid-cols-2 my-5 h-[60vh] lg:h-96 gap-4 text-center"},_hoisted_2$b={class:"flex flex-col overflow-hidden"},_hoisted_3$b={key:0,class:"space-y-2 overflow-auto"},_hoisted_4$a=["id","onUpdate:modelValue"],_hoisted_5$9=["for"],_hoisted_6$7={key:1},_hoisted_7$4={class:"flex flex-col overflow-hidden"},_hoisted_8$2={class:"relative bg-white p-2 dark:bg-gray-900"},_hoisted_9$1={class:"w-full overflow-auto border rounded-md bg-gray-50 p-2 dark:bg-gray-800"},_hoisted_10={class:"text-left text-sm text-gray-500 dark:text-gray-400"},_hoisted_11={class:"col-span-1 lg:col-span-2 flex justify-end"},_hoisted_12={class:"grid grid-cols-1 lg:grid-cols-2 my-5 h-[60vh] lg:h-96 gap-4 text-center"},_hoisted_13={class:"overflow-auto h-full flex flex-col"},_hoisted_14={class:"sticky top-0 z-10 bg-white p-2 dark:bg-gray-900"},_hoisted_15={key:0,class:"m-4 flex-1 flex flex-col items-center justify-center border-2 rounded-lg border-dashed"},_hoisted_16={for:"json-import-input",class:"flex-1 w-full flex flex-col cursor-pointer items-center justify-center rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800"},_hoisted_17={key:1,class:"mt-4 border rounded-md bg-gray-50 p-2 dark:bg-gray-800"},_hoisted_18={class:"text-left text-sm text-gray-500 dark:text-gray-400"},_hoisted_19={class:"overflow-auto h-full flex flex-col"},_hoisted_20={key:0},_hoisted_21={class:"space-y-2"},_hoisted_22=["id","onUpdate:modelValue"],_hoisted_23=["for"],_hoisted_24={key:1,class:"flex-1 flex items-center justify-center text-gray-500 dark:text-gray-400"},_hoisted_25={class:"flex-1 col-span-1 lg:col-span-2 flex justify-end"},_hoisted_26={class:"max-h-[70vh] overflow-hidden"},_hoisted_27={class:"h-full overflow-auto border rounded-md bg-gray-50 p-4 dark:bg-gray-800"},_hoisted_28={class:"break-all text-left text-sm text-gray-500 dark:text-gray-400"},_sfc_main$D=defineComponent({__name:"EditorStateDialog",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const o=t,a=e;watch(()=>o.visible,$=>{$&&d()});function n($){$||a("close")}const s=ref("import"),l=ref([{value:"import",label:"导入配置"},{value:"export",label:"导出配置"}]),i=ref({data:{},selected:{}});async function d(){try{const $=getAllStoreStates();i.value={data:$,selected:Object.keys($).reduce((T,Y)=>(T[Y]=!0,T),{})}}catch{}}const f=computed(()=>i.value.data?Object.keys(i.value.data).reduce(($,T)=>(i.value.selected[T]&&($[T]=i.value.data[T]),$),{}):{}),p=ref({data:{},selected:{}}),g=ref(null),E=computed(()=>p.value.data?Object.keys(p.value.data).reduce(($,T)=>(p.value.selected[T]&&($[T]=p.value.data[T]),$),{}):{});function m(){const $=Object.keys(i.value.data).reduce((T,Y)=>(i.value.selected[Y]&&(T[Y]=i.value.data[Y]),T),{});downloadFile(JSON.stringify($,null,2),"exported_config.json","application/json"),toast.success("配置文件导出成功"),a("close")}const S=ref(!1),_=computed(()=>s.value==="export"?f.value:s.value==="import"?E.value:{});function w($){copyPlain($),toast.success("复制成功")}const u=ref(null);function C(){u.value?.click()}function x($){const T=$.target;if(!T.files?.length)return;const Y=T.files[0],te=new FileReader;te.onload=V=>{try{const ae=V.target?.result,q=JSON.parse(ae);if(typeof q!="object"||Array.isArray(q)){toast.error("导入的文件格式不正确");return}const z=Object.keys(i.value.data).concat(Object.keys(p.value.data)),G=Object.keys(q).reduce((N,K)=>(z.includes(K)&&(N[K]=q[K]),N),{});if(Object.keys(G).length===0){toast.error("导入的文件无可应用项目配置");return}g.value=q,p.value={data:q,selected:Object.keys(q).reduce((N,K)=>(N[K]=!0,N),{})},toast.success("配置文件导入成功")}catch{toast.error("文件解析失败,请检查JSON格式")}},te.readAsText(Y),T.value=""}const b=useStore(),v=useDisplayStore();function y(){E.value&&(Object.keys(p.value.selected).forEach($=>{p.value.selected[$]&&p.value.data?.[$]!==void 0&&($ in b?b[$]=p.value.data[$]:$ in v&&(v[$]=p.value.data[$]))}),toast.success("配置应用成功,请刷新页面查看效果"),a("close"))}return($,T)=>{const Y=_sfc_main$1v,te=_sfc_main$15,V=_sfc_main$1w,ae=_sfc_main$18,q=_sfc_main$19,z=_sfc_main$1K,G=_sfc_main$1k,N=_sfc_main$1m,K=_sfc_main$1D,W=_sfc_main$1E,de=_sfc_main$1t;return openBlock(),createElementBlock(Fragment,null,[createVNode(W,{open:o.visible,"onUpdate:open":n},{default:withCtx(()=>[createVNode(K,{class:"md:max-w-2/3"},{default:withCtx(()=>[createVNode(V,null,{default:withCtx(()=>[createVNode(Y,null,{default:withCtx(()=>[...T[5]||(T[5]=[createTextVNode("导入/导出项目配置",-1)])]),_:1}),createVNode(te,null,{default:withCtx(()=>[...T[6]||(T[6]=[createTextVNode(" 导入的配置将覆盖当前项目的配置,请谨慎操作。 ",-1)])]),_:1})]),_:1}),createVNode(N,{modelValue:unref(s),"onUpdate:modelValue":T[2]||(T[2]=Z=>isRef(s)?s.value=Z:null),class:"w-full"},{default:withCtx(()=>[createVNode(q,null,{default:withCtx(()=>[createVNode(ae,{value:"import"},{default:withCtx(()=>[...T[7]||(T[7]=[createTextVNode(" 导入配置 ",-1)])]),_:1}),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(l).filter(Z=>Z.value!=="import"),Z=>(openBlock(),createBlock(ae,{key:Z.value,value:Z.value},{default:withCtx(()=>[createTextVNode(toDisplayString(Z.label),1)]),_:2},1032,["value"]))),128))]),_:1}),createVNode(G,{value:"export"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$d,[createBaseVNode("div",_hoisted_2$b,[T[9]||(T[9]=createBaseVNode("p",{class:"bg-white p-2 dark:bg-gray-900"}," 请选择需要导出的配置 ",-1)),unref(i).data?(openBlock(),createElementBlock("ul",_hoisted_3$b,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(i).data,(Z,le)=>(openBlock(),createElementBlock("li",{key:le,class:"space-x-2 flex items-center"},[withDirectives(createBaseVNode("input",{id:`export-${le}`,"onUpdate:modelValue":ge=>unref(i).selected[le]=ge,type:"checkbox",class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,_hoisted_4$a),[[vModelCheckbox,unref(i).selected[le]]]),createBaseVNode("label",{for:`export-${le}`,class:"text-sm text-gray-700 dark:text-gray-300"},toDisplayString(unref(storeLabels)[le]||le),9,_hoisted_5$9)]))),128))])):(openBlock(),createElementBlock("div",_hoisted_6$7,[...T[8]||(T[8]=[createBaseVNode("p",{class:"text-sm text-gray-500 dark:text-gray-400"}," 加载中... ",-1)])]))]),createBaseVNode("div",_hoisted_7$4,[createBaseVNode("p",_hoisted_8$2,[T[10]||(T[10]=createBaseVNode("span",null,"当前 JSON 预览",-1)),createVNode(unref(Expand),{class:"absolute right-2 top-2 cursor-pointer p-1 text-gray-500 dark:text-gray-400",onClick:T[0]||(T[0]=Z=>S.value=!0)})]),createBaseVNode("div",_hoisted_9$1,[createBaseVNode("pre",_hoisted_10,toDisplayString(JSON.stringify(unref(f),null,2)),1)])]),createBaseVNode("div",_hoisted_11,[createVNode(z,{type:"primary",disabled:Object.values(unref(i).selected).every(Z=>!Z),onClick:m},{default:withCtx(()=>[...T[11]||(T[11]=[createTextVNode(" 导出选中配置 ",-1)])]),_:1},8,["disabled"])])])]),_:1}),createVNode(G,{value:"import"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_12,[createBaseVNode("div",_hoisted_13,[createBaseVNode("p",_hoisted_14,[T[12]||(T[12]=createBaseVNode("span",null,"导入 JSON 配置文件",-1)),createVNode(unref(Expand),{class:"absolute right-2 top-2 cursor-pointer p-1 text-gray-500 dark:text-gray-400",onClick:T[1]||(T[1]=Z=>S.value=!0)})]),unref(g)?(openBlock(),createElementBlock("div",_hoisted_17,[createBaseVNode("pre",_hoisted_18,toDisplayString(JSON.stringify(unref(E),null,2)),1)])):(openBlock(),createElementBlock("div",_hoisted_15,[createBaseVNode("input",{id:"json-import-input",ref_key:"fileInputRef",ref:u,type:"file",accept:".json",class:"hidden",onChange:x},null,544),createBaseVNode("label",_hoisted_16,[createVNode(unref(CloudUpload),{class:"mb-2 size-16 text-gray-500 dark:text-gray-400"}),T[13]||(T[13]=createBaseVNode("span",{class:"text-sm text-gray-500 dark:text-gray-400"}," 点击或拖拽 JSON 文件到此处 ",-1)),T[14]||(T[14]=createBaseVNode("span",{class:"mt-1 text-xs text-gray-400 dark:text-gray-500"}," 支持格式: .json ",-1))])]))]),createBaseVNode("div",_hoisted_19,[T[15]||(T[15]=createBaseVNode("p",{class:"sticky top-0 z-10 bg-white p-2 dark:bg-gray-900"}," 选择要导入的配置项 ",-1)),unref(g)?(openBlock(),createElementBlock("div",_hoisted_20,[createBaseVNode("ul",_hoisted_21,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(p).data,(Z,le)=>(openBlock(),createElementBlock("li",{key:le,class:"space-x-2 flex items-center"},[withDirectives(createBaseVNode("input",{id:`import-${le}`,"onUpdate:modelValue":ge=>unref(p).selected[le]=ge,type:"checkbox",class:"h-4 w-4 border-gray-300 rounded text-indigo-600 focus:ring-indigo-500"},null,8,_hoisted_22),[[vModelCheckbox,unref(p).selected[le]]]),createBaseVNode("label",{for:`import-${le}`,class:"text-sm text-gray-700 dark:text-gray-300"},toDisplayString(unref(storeLabels)[le]||le),9,_hoisted_23)]))),128))])])):(openBlock(),createElementBlock("div",_hoisted_24," 请先导入JSON文件 "))]),createBaseVNode("div",_hoisted_25,[createBaseVNode("input",{id:"json-import-input",ref_key:"fileInputRef",ref:u,type:"file",accept:".json",class:"hidden",onChange:x},null,544),createVNode(z,{variant:"ghost",class:"mr-2",onClick:C},{default:withCtx(()=>[...T[16]||(T[16]=[createTextVNode(" 重新导入 ",-1)])]),_:1}),createVNode(z,{disabled:Object.values(unref(p).selected).every(Z=>!Z),onClick:y},{default:withCtx(()=>[...T[17]||(T[17]=[createTextVNode(" 应用选中配置 ",-1)])]),_:1},8,["disabled"])])])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["open"]),createVNode(W,{open:unref(S),"onUpdate:open":T[4]||(T[4]=Z=>S.value=Z)},{default:withCtx(()=>[createVNode(K,{class:"max-h-[90vh] max-w-[90vw] overflow-auto"},{default:withCtx(()=>[createVNode(V,null,{default:withCtx(()=>[createVNode(Y,null,{default:withCtx(()=>[...T[18]||(T[18]=[createTextVNode("JSON 全屏预览",-1)])]),_:1}),createVNode(te,null,{default:withCtx(()=>[...T[19]||(T[19]=[createTextVNode(" 当前配置的完整 JSON 数据 ",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_26,[createBaseVNode("div",_hoisted_27,[createBaseVNode("pre",_hoisted_28,toDisplayString(JSON.stringify(unref(_),null,2)),1)])]),createVNode(de,null,{default:withCtx(()=>[createVNode(z,{variant:"outline",onClick:T[3]||(T[3]=Z=>w(JSON.stringify(unref(_),null,2)))},{default:withCtx(()=>[...T[20]||(T[20]=[createTextVNode(" 复制 JSON 到剪贴板 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])],64)}}}),_hoisted_1$c={class:"text-center"},_hoisted_2$a={class:"grid grid-cols-2 my-5 gap-4"},_hoisted_3$a=["src","alt"],_sfc_main$C=defineComponent({__name:"FundDialog",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const o=t,a=e,n=[{name:"yanglbme",imageUrl:"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/support1.jpg",altText:"赞赏二维码 1"},{name:"yangfong",imageUrl:"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/support2.jpg",altText:"赞赏二维码 2"}];function s(l){l||a("close")}return(l,i)=>{const d=_sfc_main$1v,f=_sfc_main$1w,p=_sfc_main$1K,g=_sfc_main$1t,E=_sfc_main$1D,m=_sfc_main$1E;return openBlock(),createBlock(m,{open:o.visible,"onUpdate:open":s},{default:withCtx(()=>[createVNode(E,null,{default:withCtx(()=>[createVNode(f,null,{default:withCtx(()=>[createVNode(d,null,{default:withCtx(()=>[...i[1]||(i[1]=[createTextVNode("赞赏",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_1$c,[i[2]||(i[2]=createBaseVNode("p",null,"若觉得项目不错,可以通过以下方式支持我们~",-1)),createBaseVNode("div",_hoisted_2$a,[(openBlock(),createElementBlock(Fragment,null,renderList(n,S=>createBaseVNode("div",{key:S.name,class:"text-center"},[createBaseVNode("img",{src:S.imageUrl,alt:S.altText,class:"mx-auto",style:{width:"90%","max-width":"200px","border-radius":"10%"}},null,8,_hoisted_3$a)])),64))])]),createVNode(g,{class:"sm:justify-evenly"},{default:withCtx(()=>[createVNode(p,{onClick:i[0]||(i[0]=S=>a("close"))},{default:withCtx(()=>[...i[3]||(i[3]=[createTextVNode(" 关闭 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),_sfc_main$B=defineComponent({__name:"AboutDialog",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const o=t,a=e;function n(i){i||a("close")}const s=[{label:"GitHub 仓库",url:"https://github.com/doocs/md"},{label:"Gitee 仓库",url:"https://gitee.com/doocs/md"},{label:"GitCode 仓库",url:"https://gitcode.com/doocs/md"}];function l(i){window.open(i,"_blank")}return(i,d)=>{const f=_sfc_main$1v,p=_sfc_main$1w,g=_sfc_main$1K,E=_sfc_main$1t,m=_sfc_main$1D,S=_sfc_main$1E;return openBlock(),createBlock(S,{open:o.visible,"onUpdate:open":n},{default:withCtx(()=>[createVNode(m,null,{default:withCtx(()=>[createVNode(p,null,{default:withCtx(()=>[createVNode(f,null,{default:withCtx(()=>[...d[0]||(d[0]=[createTextVNode("关于",-1)])]),_:1})]),_:1}),d[1]||(d[1]=createBaseVNode("div",{class:"text-center"},[createBaseVNode("h3",null,"一款高度简洁的微信 Markdown 编辑器"),createBaseVNode("p",null,"扫码关注公众号 Doocs,原创技术内容第一时间推送!"),createBaseVNode("img",{class:"mx-auto my-5",src:"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png",alt:"Doocs Markdown 编辑器",style:{width:"40%"}})],-1)),createVNode(E,{class:"sm:justify-evenly flex flex-wrap gap-2"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(s,_=>createVNode(g,{key:_.url,onClick:w=>l(_.url)},{default:withCtx(()=>[createTextVNode(toDisplayString(_.label),1)]),_:2},1032,["onClick"])),64))]),_:1})]),_:1})]),_:1},8,["open"])}}}),_hoisted_1$b={class:"mt-4"},_hoisted_2$9={key:0,class:"py-4 text-center"},_hoisted_3$9={key:1,class:"max-h-[400px] flex flex-col overflow-y-auto"},_hoisted_4$9={class:"mb-2 flex items-center gap-2"},_hoisted_5$8=["src"],_hoisted_6$6=["href"],_sfc_main$A=defineComponent({__name:"PostTaskDialog",props:{post:{},open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=t,a=e,n=computed({get:()=>o.open,set:d=>a("update:open",d)}),s=ref(null),l=ref(!1);async function i(){if(o.post)try{window.$syncer?.addTask({post:{title:o.post.title,content:o.post.content,markdown:o.post.markdown,thumb:o.post.thumb,desc:o.post.desc},accounts:o.post.accounts.filter(d=>d.checked)},d=>{s.value=d},()=>{l.value=!1})}catch(d){console.error("发布失败:",d)}}return watch(()=>o.open,d=>{d&&i()}),(d,f)=>(openBlock(),createBlock(unref(_sfc_main$1E),{open:unref(n),"onUpdate:open":f[0]||(f[0]=p=>isRef(n)?n.value=p:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1D),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$1w),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$1v),null,{default:withCtx(()=>[...f[1]||(f[1]=[createTextVNode("提交发布任务",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_1$b,[unref(s)?(openBlock(),createElementBlock("div",_hoisted_3$9,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(s)?.accounts,p=>(openBlock(),createElementBlock("div",{key:p.uid+p.displayName,class:"border-b py-4 last:border-b-0"},[createBaseVNode("div",_hoisted_4$9,[p.icon?(openBlock(),createElementBlock("img",{key:0,src:p.icon,class:"object-cover h-5 w-5",alt:""},null,8,_hoisted_5$8)):createCommentVNode("",!0),createBaseVNode("span",null,toDisplayString(p.title)+" - "+toDisplayString(p.displayName||p.home),1)]),createBaseVNode("div",{class:normalizeClass(["w-full flex-1 gap-2 overflow-auto pl-7 text-sm",{"text-yellow-600":p.status==="uploading","text-red-600":p.status==="failed","text-green-600":p.status==="done"}])},[p.status==="uploading"?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(p.msg||"发布中"),1)],64)):createCommentVNode("",!0),p.status==="failed"?(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(" 同步失败, 错误内容:"+toDisplayString(p.error),1)],64)):createCommentVNode("",!0),p.status==="done"&&p.editResp?(openBlock(),createElementBlock(Fragment,{key:2},[f[2]||(f[2]=createTextVNode(" 同步成功 ",-1)),p.type!=="wordpress"&&p.editResp?(openBlock(),createElementBlock("a",{key:0,href:p.editResp.draftLink,class:"ml-2 text-blue-500 hover:underline",referrerPolicy:"no-referrer",target:"_blank"},"查看草稿",8,_hoisted_6$6)):createCommentVNode("",!0)],64)):createCommentVNode("",!0)],2)]))),128))])):(openBlock(),createElementBlock("div",_hoisted_2$9," 等待发布.. "))])]),_:1})]),_:1},8,["open"]))}}),__unplugin_components_13=_export_sfc(_sfc_main$A,[["__scopeId","data-v-4d169344"]]),_sfc_main$z=defineComponent({__name:"AlertDescription",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)("text-sm [&_p]:leading-relaxed",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$y=defineComponent({__name:"AlertTitle",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("h5",{class:normalizeClass(unref(cn)("mb-1 font-medium leading-none tracking-tight",e.class))},[renderSlot(o.$slots,"default")],2))}}),alertVariants=cva("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),_sfc_main$x=defineComponent({__name:"Alert",props:{class:{},variant:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(cn)(unref(alertVariants)({variant:t.variant}),e.class)),role:"alert"},[renderSlot(o.$slots,"default")],2))}}),_hoisted_1$a={class:"w-full flex items-center gap-4"},_hoisted_2$8={class:"w-full flex items-center gap-4"},_hoisted_3$8={class:"w-full flex items-start gap-4"},_hoisted_4$8={class:"w-full flex items-start gap-4"},_hoisted_5$7={class:"flex flex-1 flex-col gap-2"},_hoisted_6$5={class:"flex flex-row items-center gap-4"},_hoisted_7$3={class:"flex items-center gap-2 text-sm"},_hoisted_8$1=["src"],_sfc_main$w=defineComponent({__name:"PostInfo",setup(t){const e=useStore(),{output:o,editor:a}=storeToRefs(e),n=ref(!1),s=ref(!1),l=ref([]),i=ref(!1),d=ref({title:"",desc:"",thumb:"",content:"",markdown:"",accounts:[]}),f=computed(()=>s.value&&d.value.accounts.some(_=>_.checked));async function p(){s.value&&l.value.length===0&&await g();let _={thumb:"",title:"",desc:"",content:"",markdown:"",accounts:[]};const w=l.value.filter(u=>!["ipfs"].includes(u.type));try{_={thumb:document.querySelector("#output img")?.src??"",title:[1,2,3,4,5,6].map(u=>document.querySelector(`#output h${u}`)).find(u=>u)?.textContent??"",desc:document.querySelector("#output p")?.textContent?.trim()??"",content:o.value,markdown:a.value?.state.doc.toString()??"",accounts:w}}catch(u){console.log("error",u)}finally{d.value={..._}}}async function g(){return new Promise(_=>{window.$syncer?.getAccounts(w=>{l.value=w.map(u=>({...u,checked:!0})),_()})})}function E(){d.value.accounts=d.value.accounts.filter(_=>_.checked),i.value=!0,n.value=!1}function m(_){_||(n.value=!1)}function S(){if(window.$syncer!==void 0){s.value=!0;return}let _=0;const w=setInterval(async()=>{if(window.$syncer!==void 0){s.value=!0,await g(),clearInterval(w);return}_++,_>10&&clearInterval(w)},500)}return onBeforeMount(()=>{S()}),(_,w)=>{const u=_sfc_main$1K,C=_sfc_main$M,x=_sfc_main$1v,b=_sfc_main$1w,v=_sfc_main$y,y=_sfc_main$z,$=_sfc_main$x,T=_sfc_main$1B,Y=_sfc_main$1x,te=_sfc_main$1z,V=_sfc_main$1t,ae=_sfc_main$1D,q=_sfc_main$1E,z=__unplugin_components_13;return openBlock(),createElementBlock(Fragment,null,[createVNode(q,{open:unref(n),"onUpdate:open":[w[4]||(w[4]=G=>isRef(n)?n.value=G:null),m]},{default:withCtx(()=>[createVNode(C,null,{default:withCtx(()=>[unref(e).isMobile?createCommentVNode("",!0):(openBlock(),createBlock(u,{key:0,variant:"outline",onClick:p},{default:withCtx(()=>[...w[6]||(w[6]=[createTextVNode(" 发布 ",-1)])]),_:1}))]),_:1}),createVNode(ae,null,{default:withCtx(()=>[createVNode(b,null,{default:withCtx(()=>[createVNode(x,null,{default:withCtx(()=>[...w[7]||(w[7]=[createTextVNode("发布",-1)])]),_:1})]),_:1}),createVNode($,null,{default:withCtx(()=>[createVNode(unref(Info),{class:"h-4 w-4"}),createVNode(v,null,{default:withCtx(()=>[...w[8]||(w[8]=[createTextVNode("提示",-1)])]),_:1}),createVNode(y,null,{default:withCtx(()=>[...w[9]||(w[9]=[createTextVNode(" 此功能由第三方浏览器插件支持,本平台不保证安全性及同步准确度。 ",-1)])]),_:1})]),_:1}),unref(s)?createCommentVNode("",!0):(openBlock(),createBlock($,{key:0},{default:withCtx(()=>[createVNode(unref(Info),{class:"h-4 w-4"}),createVNode(v,null,{default:withCtx(()=>[...w[10]||(w[10]=[createTextVNode("未检测到插件",-1)])]),_:1}),createVNode(y,null,{default:withCtx(()=>[w[12]||(w[12]=createTextVNode(" 请安装 ",-1)),createVNode(unref(O),{as:"a",class:"text-blue-500",href:"https://www.wechatsync.com/?utm_source=syncicon#install",target:"_blank"},{default:withCtx(()=>[...w[11]||(w[11]=[createTextVNode(" 文章同步助手 ",-1)])]),_:1}),w[13]||(w[13]=createTextVNode(" 插件 ",-1))]),_:1})]),_:1})),createBaseVNode("div",_hoisted_1$a,[createVNode(T,{for:"thumb",class:"w-10 text-end"},{default:withCtx(()=>[...w[14]||(w[14]=[createTextVNode(" 封面 ",-1)])]),_:1}),createVNode(Y,{id:"thumb",modelValue:unref(d).thumb,"onUpdate:modelValue":w[0]||(w[0]=G=>unref(d).thumb=G),placeholder:"自动提取第一张图"},null,8,["modelValue"])]),createBaseVNode("div",_hoisted_2$8,[createVNode(T,{for:"title",class:"w-10 text-end"},{default:withCtx(()=>[...w[15]||(w[15]=[createTextVNode(" 标题 ",-1)])]),_:1}),createVNode(Y,{id:"title",modelValue:unref(d).title,"onUpdate:modelValue":w[1]||(w[1]=G=>unref(d).title=G),placeholder:"自动提取第一个标题"},null,8,["modelValue"])]),createBaseVNode("div",_hoisted_3$8,[createVNode(T,{for:"desc",class:"w-10 text-end"},{default:withCtx(()=>[...w[16]||(w[16]=[createTextVNode(" 描述 ",-1)])]),_:1}),createVNode(te,{id:"desc",modelValue:unref(d).desc,"onUpdate:modelValue":w[2]||(w[2]=G=>unref(d).desc=G),placeholder:"自动提取第一个段落"},null,8,["modelValue"])]),createBaseVNode("div",_hoisted_4$8,[createVNode(T,{class:"w-10 text-end"},{default:withCtx(()=>[...w[17]||(w[17]=[createTextVNode(" 账号 ",-1)])]),_:1}),createBaseVNode("div",_hoisted_5$7,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(d).accounts,G=>(openBlock(),createElementBlock("div",{key:G.uid+G.displayName,class:"flex items-center gap-2"},[createBaseVNode("label",_hoisted_6$5,[createVNode(unref(Wv),{checked:G.checked,"onUpdate:checked":N=>G.checked=N,class:"bg-background hover:bg-muted h-[25px] w-[25px] flex appearance-none items-center justify-center border border-gray-200 rounded-[4px] outline-hidden"},{default:withCtx(()=>[createVNode(unref(jv),null,{default:withCtx(()=>[G.checked?(openBlock(),createBlock(unref(Check),{key:0,class:"h-4 w-4"})):createCommentVNode("",!0)]),_:2},1024)]),_:2},1032,["checked","onUpdate:checked"]),createBaseVNode("span",_hoisted_7$3,[createBaseVNode("img",{src:G.icon,alt:"",class:"inline-block h-[20px] w-[20px]"},null,8,_hoisted_8$1),createTextVNode(" "+toDisplayString(G.title)+" - "+toDisplayString(G.displayName??G.home),1)])])]))),128))])]),createVNode(V,null,{default:withCtx(()=>[createVNode(u,{variant:"outline",onClick:w[3]||(w[3]=G=>n.value=!1)},{default:withCtx(()=>[...w[18]||(w[18]=[createTextVNode(" 取 消 ",-1)])]),_:1}),createVNode(u,{disabled:!unref(f),onClick:E},{default:withCtx(()=>[...w[19]||(w[19]=[createTextVNode(" 确 定 ",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]),createVNode(z,{open:unref(i),"onUpdate:open":w[5]||(w[5]=G=>isRef(i)?i.value=G:null),post:unref(d)},null,8,["open","post"])],64)}}}),_sfc_main$v=defineComponent({__name:"MenubarMenu",props:{value:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Gh),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$u=defineComponent({__name:"MenubarContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},side:{},sideOffset:{default:8},align:{default:"start"},alignOffset:{default:-4},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Yh),null,{default:withCtx(()=>[createVNode(unref(Xh),mergeProps(unref(a),{class:unref(cn)("z-50 min-w-48 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$t=defineComponent({__name:"MenubarTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(qh),mergeProps(unref(a),{class:unref(cn)("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-hidden hover:bg-accent focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$s=defineComponent({__name:"Menubar",props:{modelValue:{},defaultValue:{},dir:{},loop:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(Uh),mergeProps(unref(s),{class:unref(cn)("flex h-10 items-center gap-x-1 rounded-md border bg-background p-1",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$r=defineComponent({__name:"MenubarSub",props:{defaultOpen:{type:Boolean},open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(sy),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$q=defineComponent({__name:"MenubarSubContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},sideOffset:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(Yh),null,{default:withCtx(()=>[createVNode(unref(ry),mergeProps(unref(s),{class:unref(cn)("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_hoisted_1$9={class:"absolute left-2 h-3.5 w-3.5 flex items-center justify-center"},_sfc_main$p=defineComponent({__name:"MenubarCheckboxItem",props:{checked:{type:[Boolean,String]},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},emits:["select","update:checked"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(ty),mergeProps(unref(s),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",o.class)}),{default:withCtx(()=>[createBaseVNode("span",_hoisted_1$9,[createVNode(unref(ay),null,{default:withCtx(()=>[createVNode(unref(Check),{class:"h-4 w-4"})]),_:1})]),renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$o=defineComponent({__name:"MenubarSubTrigger",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(iy),mergeProps(unref(a),{class:unref(cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t.inset&&"pl-8",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default"),createVNode(unref(ChevronRight),{class:"ml-auto h-4 w-4"})]),_:3},16,["class"]))}}),_sfc_main$n=defineComponent({__name:"HelpDropdown",props:{asSub:{type:Boolean,default:!1}},emits:["openAbout","openFund"],setup(t,{emit:e}){const o=t,a=e,{asSub:n}=toRefs(o);function s(){a("openAbout")}function l(){a("openFund")}return(i,d)=>{const f=_sfc_main$o,p=_sfc_main$p,g=_sfc_main$q,E=_sfc_main$r,m=_sfc_main$t,S=_sfc_main$u,_=_sfc_main$v;return unref(n)?(openBlock(),createBlock(E,{key:0},{default:withCtx(()=>[createVNode(f,null,{default:withCtx(()=>[...d[4]||(d[4]=[createTextVNode(" 帮助 ",-1)])]),_:1}),createVNode(g,{align:"start"},{default:withCtx(()=>[createVNode(p,{onClick:d[0]||(d[0]=w=>s())},{default:withCtx(()=>[...d[5]||(d[5]=[createTextVNode(" 关于 ",-1)])]),_:1}),createVNode(p,{onClick:d[1]||(d[1]=w=>l())},{default:withCtx(()=>[...d[6]||(d[6]=[createTextVNode(" 赞赏 ",-1)])]),_:1})]),_:1})]),_:1})):(openBlock(),createBlock(_,{key:1},{default:withCtx(()=>[createVNode(m,null,{default:withCtx(()=>[...d[7]||(d[7]=[createTextVNode("帮助",-1)])]),_:1}),createVNode(S,{align:"start"},{default:withCtx(()=>[createVNode(p,{onClick:d[2]||(d[2]=w=>s())},{default:withCtx(()=>[...d[8]||(d[8]=[createBaseVNode("span",null,"关于",-1)])]),_:1}),createVNode(p,{onClick:d[3]||(d[3]=w=>l())},{default:withCtx(()=>[...d[9]||(d[9]=[createBaseVNode("span",null,"赞赏",-1)])]),_:1})]),_:1})]),_:1}))}}}),_sfc_main$m=defineComponent({__name:"HoverCard",props:{defaultOpen:{type:Boolean},open:{type:Boolean},openDelay:{},closeDelay:{}},emits:["update:open"],setup(t,{emit:e}){const n=Se(t,e);return(s,l)=>(openBlock(),createBlock(unref(Rh),normalizeProps(guardReactiveProps(unref(n))),{default:withCtx(()=>[renderSlot(s.$slots,"default")]),_:3},16))}}),_sfc_main$l=defineComponent({__name:"HoverCardContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(Oh),null,{default:withCtx(()=>[createVNode(unref(kh),mergeProps(unref(a),{class:unref(cn)("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.class)}),{default:withCtx(()=>[renderSlot(n.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),_sfc_main$k=defineComponent({__name:"HoverCardTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createBlock(unref(Ah),normalizeProps(guardReactiveProps(e)),{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},16))}}),_sfc_main$j=defineComponent({__name:"MenubarSeparator",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,o=computed(()=>{const{class:n,...s}=e;return s}),a=Ot(o);return(n,s)=>(openBlock(),createBlock(unref(ey),mergeProps({class:unref(cn)("-mx-1 my-1 h-px bg-muted",e.class)},unref(a)),null,16,["class"]))}}),_sfc_main$i=defineComponent({__name:"DropdownMenuShortcut",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref(cn)("ml-auto text-xs tracking-widest opacity-60",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$h=defineComponent({__name:"StyleOptionMenu",props:{title:{},options:{},current:{},change:{type:Function}},setup(t){const e=t;function o(a,n){switch(a){case"字体":return{fontFamily:n};case"字号":return{fontSize:n};case"主题色":return{color:n};default:return{}}}return(a,n)=>{const s=_sfc_main$o,l=_sfc_main$i,i=_sfc_main$p,d=_sfc_main$q,f=_sfc_main$r;return openBlock(),createBlock(f,null,{default:withCtx(()=>[createVNode(s,null,{default:withCtx(()=>[n[0]||(n[0]=createBaseVNode("span",{class:"mr-2 h-4 w-4"},null,-1)),createBaseVNode("span",null,toDisplayString(e.title),1)]),_:1}),createVNode(d,{class:"max-h-56 overflow-auto"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(t.options,({label:p,value:g,desc:E})=>(openBlock(),createBlock(i,{key:g,label:p,"model-value":g,class:"w-50",checked:t.current===g,onClick:m=>t.change(g)},{default:withCtx(()=>[createTextVNode(toDisplayString(p)+" ",1),createVNode(l,{style:normalizeStyle(o(t.title,g))},{default:withCtx(()=>[createTextVNode(toDisplayString(E),1)]),_:2},1032,["style"])]),_:2},1032,["label","model-value","checked","onClick"]))),128))]),_:1})]),_:1})}}}),_sfc_main$g=defineComponent({__name:"StyleDropdown",props:{asSub:{type:Boolean,default:!1}},setup(t){const e=t,{asSub:o}=toRefs(e),a=useStore(),{toggleShowCssEditor:n}=useDisplayStore(),{theme:s,fontFamily:l,fontSize:i,primaryColor:d,codeBlockTheme:f,legend:p,isMacCodeBlock:g}=storeToRefs(a),{resetStyleConfirm:E,themeChanged:m,fontChanged:S,sizeChanged:_,colorChanged:w,codeBlockThemeChanged:u,legendChanged:C,macCodeBlockChanged:x}=a,b=ref(null);function v(){b.value?.show()}function y(){n()}const $=useTemplateRef("pickColorsContainer"),T=ref("rgb"),Y=ref(["rgb","hex","hsl","hsv"]);return(te,V)=>{const ae=_sfc_main$o,q=_sfc_main$h,z=_sfc_main$j,G=_sfc_main$k,N=_sfc_main$l,K=_sfc_main$m,W=_sfc_main$p,de=_sfc_main$q,Z=_sfc_main$r,le=_sfc_main$t,ge=_sfc_main$u,P=_sfc_main$v;return unref(o)?(openBlock(),createBlock(Z,{key:0},{default:withCtx(()=>[createVNode(ae,null,{default:withCtx(()=>[...V[2]||(V[2]=[createTextVNode(" 样式 ",-1)])]),_:1}),createVNode(de,{class:"w-56"},{default:withCtx(()=>[createVNode(q,{title:"主题",options:unref(themeOptions),current:unref(s),change:unref(m)},null,8,["options","current","change"]),createVNode(z),createVNode(q,{title:"字体",options:unref(fontFamilyOptions),current:unref(l),change:unref(S)},null,8,["options","current","change"]),createVNode(q,{title:"字号",options:unref(fontSizeOptions),current:unref(i),change:unref(_)},null,8,["options","current","change"]),createVNode(q,{title:"主题色",options:unref(colorOptions),current:unref(d),change:unref(w)},null,8,["options","current","change"]),createVNode(q,{title:"代码块主题",options:unref(codeBlockThemeOptions),current:unref(f),change:unref(u)},null,8,["options","current","change"]),createVNode(q,{title:"图注格式",options:unref(legendOptions),current:unref(p),change:unref(C)},null,8,["options","current","change"]),createVNode(z),createVNode(W,{onClick:withModifiers(v,["self","prevent"])},{default:withCtx(()=>[createVNode(K,{"open-delay":100},{default:withCtx(()=>[createVNode(G,{class:"w-full flex"},{default:withCtx(()=>[...V[3]||(V[3]=[createTextVNode(" 自定义主题色 ",-1)])]),_:1}),createVNode(N,{side:"right",class:"w-min"},{default:withCtx(()=>[createBaseVNode("div",{ref_key:"pickColorsContainer",ref:$},[createVNode(unref(Re),{value:unref(d),"onUpdate:value":V[0]||(V[0]=H=>isRef(d)?d.value=H:null),"show-alpha":"",format:unref(T),"format-options":unref(Y),theme:unref(a).isDark?"dark":"light","popup-container":unref($),onChange:unref(a).colorChanged},null,8,["value","format","format-options","theme","popup-container","onChange"])],512)]),_:1})]),_:1})]),_:1}),createVNode(W,{onClick:y},{default:withCtx(()=>[...V[4]||(V[4]=[createTextVNode(" 自定义 CSS ",-1)])]),_:1}),createVNode(z),createVNode(W,{checked:unref(g),onClick:unref(x)},{default:withCtx(()=>[...V[5]||(V[5]=[createTextVNode(" Mac 代码块 ",-1)])]),_:1},8,["checked","onClick"]),createVNode(z),createVNode(W,{divided:"",onClick:unref(E)},{default:withCtx(()=>[...V[6]||(V[6]=[createTextVNode(" 重置 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})):(openBlock(),createBlock(P,{key:1},{default:withCtx(()=>[createVNode(le,null,{default:withCtx(()=>[...V[7]||(V[7]=[createTextVNode(" 样式 ",-1)])]),_:1}),createVNode(ge,{class:"w-56",align:"start"},{default:withCtx(()=>[createVNode(q,{title:"主题",options:unref(themeOptions),current:unref(s),change:unref(m)},null,8,["options","current","change"]),createVNode(z),createVNode(q,{title:"字体",options:unref(fontFamilyOptions),current:unref(l),change:unref(S)},null,8,["options","current","change"]),createVNode(q,{title:"字号",options:unref(fontSizeOptions),current:unref(i),change:unref(_)},null,8,["options","current","change"]),createVNode(q,{title:"主题色",options:unref(colorOptions),current:unref(d),change:unref(w)},null,8,["options","current","change"]),createVNode(q,{title:"代码块主题",options:unref(codeBlockThemeOptions),current:unref(f),change:unref(u)},null,8,["options","current","change"]),createVNode(q,{title:"图注格式",options:unref(legendOptions),current:unref(p),change:unref(C)},null,8,["options","current","change"]),createVNode(z),createVNode(W,{onClick:withModifiers(v,["self","prevent"])},{default:withCtx(()=>[createVNode(K,{"open-delay":100},{default:withCtx(()=>[createVNode(G,{class:"w-full flex"},{default:withCtx(()=>[...V[8]||(V[8]=[createTextVNode(" 自定义主题色 ",-1)])]),_:1}),createVNode(N,{side:"right",class:"w-min"},{default:withCtx(()=>[createBaseVNode("div",{ref_key:"pickColorsContainer",ref:$},[createVNode(unref(Re),{value:unref(d),"onUpdate:value":V[1]||(V[1]=H=>isRef(d)?d.value=H:null),"show-alpha":"",format:unref(T),"format-options":unref(Y),theme:unref(a).isDark?"dark":"light","popup-container":unref($),onChange:unref(a).colorChanged},null,8,["value","format","format-options","theme","popup-container","onChange"])],512)]),_:1})]),_:1})]),_:1}),createVNode(W,{onClick:y},{default:withCtx(()=>[...V[9]||(V[9]=[createTextVNode(" 自定义 CSS ",-1)])]),_:1}),createVNode(z),createVNode(W,{checked:unref(g),onClick:unref(x)},{default:withCtx(()=>[...V[10]||(V[10]=[createTextVNode(" Mac 代码块 ",-1)])]),_:1},8,["checked","onClick"]),createVNode(z),createVNode(W,{divided:"",onClick:unref(E)},{default:withCtx(()=>[...V[11]||(V[11]=[createTextVNode(" 重置 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1}))}}}),_sfc_main$f=defineComponent({__name:"MenubarItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const o=t,a=e,n=computed(()=>{const{class:l,...i}=o;return i}),s=Se(n,a);return(l,i)=>(openBlock(),createBlock(unref(Jh),mergeProps(unref(s),{class:unref(cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",t.inset&&"pl-8",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_sfc_main$e=defineComponent({__name:"EditDropdown",props:{asSub:{type:Boolean,default:!1}},setup(t){const e=t,{asSub:o}=toRefs(e),{toggleShowInsertFormDialog:a,toggleShowUploadImgDialog:n,toggleShowInsertMpCardDialog:s}=useDisplayStore(),{copyToClipboard:l,pasteFromClipboard:i,undo:d,redo:f}=useStore();return(p,g)=>{const E=_sfc_main$o,m=_sfc_main$f,S=_sfc_main$j,_=_sfc_main$q,w=_sfc_main$r,u=_sfc_main$t,C=_sfc_main$u,x=_sfc_main$v;return unref(o)?(openBlock(),createBlock(w,{key:0},{default:withCtx(()=>[createVNode(E,null,{default:withCtx(()=>[...g[14]||(g[14]=[createTextVNode(" 编辑 ",-1)])]),_:1}),createVNode(_,null,{default:withCtx(()=>[createVNode(m,{onClick:g[0]||(g[0]=b=>unref(d)())},{default:withCtx(()=>[createVNode(unref(Undo2),{class:"mr-2 h-4 w-4"}),g[15]||(g[15]=createTextVNode(" 撤销 ",-1))]),_:1}),createVNode(m,{onClick:g[1]||(g[1]=b=>unref(f)())},{default:withCtx(()=>[createVNode(unref(Redo2),{class:"mr-2 h-4 w-4"}),g[16]||(g[16]=createTextVNode(" 重做 ",-1))]),_:1}),createVNode(S),createVNode(m,{onClick:g[2]||(g[2]=b=>unref(n)())},{default:withCtx(()=>[createVNode(unref(CloudUpload),{class:"mr-2 h-4 w-4"}),g[17]||(g[17]=createTextVNode(" 上传图片 ",-1))]),_:1}),createVNode(m,{onClick:g[3]||(g[3]=b=>unref(a)())},{default:withCtx(()=>[createVNode(unref(Table),{class:"mr-2 h-4 w-4"}),g[18]||(g[18]=createTextVNode(" 插入表格 ",-1))]),_:1}),createVNode(m,{onClick:g[4]||(g[4]=b=>unref(s)())},{default:withCtx(()=>[createVNode(unref(ContactRound),{class:"mr-2 h-4 w-4"}),g[19]||(g[19]=createTextVNode(" 插入公众号名片 ",-1))]),_:1}),createVNode(S),createVNode(m,{onClick:g[5]||(g[5]=b=>unref(l)())},{default:withCtx(()=>[createVNode(unref(Copy),{class:"mr-2 h-4 w-4"}),g[20]||(g[20]=createTextVNode(" 复制 ",-1))]),_:1}),createVNode(m,{onClick:g[6]||(g[6]=b=>unref(i)())},{default:withCtx(()=>[createVNode(unref(ClipboardPaste),{class:"mr-2 h-4 w-4"}),g[21]||(g[21]=createTextVNode(" 粘贴 ",-1))]),_:1})]),_:1})]),_:1})):(openBlock(),createBlock(x,{key:1},{default:withCtx(()=>[createVNode(u,null,{default:withCtx(()=>[...g[22]||(g[22]=[createTextVNode(" 编辑 ",-1)])]),_:1}),createVNode(C,{align:"start"},{default:withCtx(()=>[createVNode(m,{onClick:g[7]||(g[7]=b=>unref(d)())},{default:withCtx(()=>[createVNode(unref(Undo2),{class:"mr-2 h-4 w-4"}),g[23]||(g[23]=createTextVNode(" 撤销 ",-1))]),_:1}),createVNode(m,{onClick:g[8]||(g[8]=b=>unref(f)())},{default:withCtx(()=>[createVNode(unref(Redo2),{class:"mr-2 h-4 w-4"}),g[24]||(g[24]=createTextVNode(" 重做 ",-1))]),_:1}),createVNode(S),createVNode(m,{onClick:g[9]||(g[9]=b=>unref(n)())},{default:withCtx(()=>[createVNode(unref(CloudUpload),{class:"mr-2 h-4 w-4"}),g[25]||(g[25]=createTextVNode(" 上传图片 ",-1))]),_:1}),createVNode(m,{onClick:g[10]||(g[10]=b=>unref(a)())},{default:withCtx(()=>[createVNode(unref(Table),{class:"mr-2 h-4 w-4"}),g[26]||(g[26]=createTextVNode(" 插入表格 ",-1))]),_:1}),createVNode(m,{onClick:g[11]||(g[11]=b=>unref(s)())},{default:withCtx(()=>[createVNode(unref(ContactRound),{class:"mr-2 h-4 w-4"}),g[27]||(g[27]=createTextVNode(" 插入公众号名片 ",-1))]),_:1}),createVNode(S),createVNode(m,{onClick:g[12]||(g[12]=b=>unref(l)())},{default:withCtx(()=>[createVNode(unref(Copy),{class:"mr-2 h-4 w-4"}),g[28]||(g[28]=createTextVNode(" 复制 ",-1))]),_:1}),createVNode(m,{onClick:g[13]||(g[13]=b=>unref(i)())},{default:withCtx(()=>[createVNode(unref(ClipboardPaste),{class:"mr-2 h-4 w-4"}),g[29]||(g[29]=createTextVNode(" 粘贴 ",-1))]),_:1})]),_:1})]),_:1}))}}}),_sfc_main$d=defineComponent({__name:"FileDropdown",props:{asSub:{type:Boolean,default:!1}},emits:["openEditorState"],setup(t,{emit:e}){const o=t,a=e,{asSub:n}=toRefs(o),s=useStore(),{isDark:l,isEditOnLeft:i,isOpenPostSlider:d}=storeToRefs(s),{exportEditorContent2HTML:f,exportEditorContent2PureHTML:p,exportEditorContent2MD:g,downloadAsCardImage:E,exportEditorContent2PDF:m}=s,S=useImportMarkdownContent();function _(){a("openEditorState")}return(w,u)=>{const C=_sfc_main$o,x=_sfc_main$f,b=_sfc_main$j,v=_sfc_main$p,y=_sfc_main$q,$=_sfc_main$r,T=_sfc_main$t,Y=_sfc_main$u,te=_sfc_main$v;return unref(n)?(openBlock(),createBlock($,{key:0},{default:withCtx(()=>[createVNode(C,null,{default:withCtx(()=>[...u[20]||(u[20]=[createTextVNode(" 文件 ",-1)])]),_:1}),createVNode(y,null,{default:withCtx(()=>[createVNode(x,{onClick:u[0]||(u[0]=V=>unref(S)())},{default:withCtx(()=>[createVNode(unref(Upload),{class:"mr-2 size-4"}),u[21]||(u[21]=createTextVNode(" 导入 .md ",-1))]),_:1}),createVNode(x,{onClick:u[1]||(u[1]=V=>unref(g)())},{default:withCtx(()=>[createVNode(unref(Download),{class:"mr-2 size-4"}),u[22]||(u[22]=createTextVNode(" 导出 .md ",-1))]),_:1}),createVNode(x,{onClick:u[2]||(u[2]=V=>unref(f)())},{default:withCtx(()=>[createVNode(unref(FileCode),{class:"mr-2 size-4"}),u[23]||(u[23]=createTextVNode(" 导出 .html ",-1))]),_:1}),createVNode(x,{onClick:u[3]||(u[3]=V=>unref(p)())},{default:withCtx(()=>[createVNode(unref(FileCode),{class:"mr-2 size-4"}),u[24]||(u[24]=createTextVNode(" 导出 .html(无样式) ",-1))]),_:1}),createVNode(x,{onClick:u[4]||(u[4]=V=>unref(m)())},{default:withCtx(()=>[createVNode(unref(FileText),{class:"mr-2 size-4"}),u[25]||(u[25]=createTextVNode(" 导出 .pdf ",-1))]),_:1}),createVNode(x,{onClick:u[5]||(u[5]=V=>unref(E)())},{default:withCtx(()=>[createVNode(unref(Download),{class:"mr-2 size-4"}),u[26]||(u[26]=createTextVNode(" 导出 .png ",-1))]),_:1}),createVNode(b),createVNode(x,{onClick:u[6]||(u[6]=V=>_())},{default:withCtx(()=>[createVNode(unref(FileCog),{class:"mr-2 size-4"}),u[27]||(u[27]=createTextVNode(" 导入/导出项目配置 ",-1))]),_:1}),createVNode(b),createVNode(v,{checked:unref(l),"onUpdate:checked":u[7]||(u[7]=V=>isRef(l)?l.value=V:null)},{default:withCtx(()=>[...u[28]||(u[28]=[createTextVNode(" 深色模式 ",-1)])]),_:1},8,["checked"]),createVNode(b),createVNode(v,{checked:unref(i),"onUpdate:checked":u[8]||(u[8]=V=>isRef(i)?i.value=V:null)},{default:withCtx(()=>[...u[29]||(u[29]=[createTextVNode(" 左侧编辑 ",-1)])]),_:1},8,["checked"]),createVNode(b),createVNode(v,{checked:unref(d),"onUpdate:checked":u[9]||(u[9]=V=>isRef(d)?d.value=V:null)},{default:withCtx(()=>[...u[30]||(u[30]=[createTextVNode(" 内容管理 ",-1)])]),_:1},8,["checked"])]),_:1})]),_:1})):(openBlock(),createBlock(te,{key:1},{default:withCtx(()=>[createVNode(T,null,{default:withCtx(()=>[...u[31]||(u[31]=[createTextVNode(" 文件 ",-1)])]),_:1}),createVNode(Y,{align:"start"},{default:withCtx(()=>[createVNode(x,{onClick:u[10]||(u[10]=V=>unref(S)())},{default:withCtx(()=>[createVNode(unref(Upload),{class:"mr-2 size-4"}),u[32]||(u[32]=createTextVNode(" 导入 .md ",-1))]),_:1}),createVNode(x,{onClick:u[11]||(u[11]=V=>unref(g)())},{default:withCtx(()=>[createVNode(unref(Download),{class:"mr-2 size-4"}),u[33]||(u[33]=createTextVNode(" 导出 .md ",-1))]),_:1}),createVNode(x,{onClick:u[12]||(u[12]=V=>unref(f)())},{default:withCtx(()=>[createVNode(unref(FileCode),{class:"mr-2 size-4"}),u[34]||(u[34]=createTextVNode(" 导出 .html ",-1))]),_:1}),createVNode(x,{onClick:u[13]||(u[13]=V=>unref(p)())},{default:withCtx(()=>[createVNode(unref(FileCode),{class:"mr-2 size-4"}),u[35]||(u[35]=createTextVNode(" 导出 .html(无样式) ",-1))]),_:1}),createVNode(x,{onClick:u[14]||(u[14]=V=>unref(m)())},{default:withCtx(()=>[createVNode(unref(FileText),{class:"mr-2 size-4"}),u[36]||(u[36]=createTextVNode(" 导出 .pdf ",-1))]),_:1}),createVNode(x,{onClick:u[15]||(u[15]=V=>unref(E)())},{default:withCtx(()=>[createVNode(unref(Download),{class:"mr-2 size-4"}),u[37]||(u[37]=createTextVNode(" 导出 .png ",-1))]),_:1}),createVNode(b),createVNode(x,{onClick:u[16]||(u[16]=V=>_())},{default:withCtx(()=>[createVNode(unref(FileCog),{class:"mr-2 size-4"}),u[38]||(u[38]=createTextVNode(" 导入/导出项目配置 ",-1))]),_:1}),createVNode(b),createVNode(v,{checked:unref(l),"onUpdate:checked":u[17]||(u[17]=V=>isRef(l)?l.value=V:null)},{default:withCtx(()=>[...u[39]||(u[39]=[createTextVNode(" 深色模式 ",-1)])]),_:1},8,["checked"]),createVNode(b),createVNode(v,{checked:unref(i),"onUpdate:checked":u[18]||(u[18]=V=>isRef(i)?i.value=V:null)},{default:withCtx(()=>[...u[40]||(u[40]=[createTextVNode(" 左侧编辑 ",-1)])]),_:1},8,["checked"]),createVNode(b),createVNode(v,{checked:unref(d),"onUpdate:checked":u[19]||(u[19]=V=>isRef(d)?d.value=V:null)},{default:withCtx(()=>[...u[41]||(u[41]=[createTextVNode(" 内容管理 ",-1)])]),_:1},8,["checked"])]),_:1})]),_:1}))}}}),_sfc_main$c=defineComponent({__name:"MenubarShortcut",props:{class:{}},setup(t){const e=t;return(o,a)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref(cn)("ml-auto text-xs tracking-widest text-muted-foreground",e.class))},[renderSlot(o.$slots,"default")],2))}}),_sfc_main$b=defineComponent({__name:"FormatDropdown",props:{asSub:{type:Boolean,default:!1}},setup(t){const e=t,{asSub:o}=toRefs(e),a=useStore(),{isCiteStatus:n,isCountStatus:s,editor:l}=storeToRefs(a),{citeStatusChanged:i,countStatusChanged:d,formatContent:f}=a;function p(E){const m=l.value;if(l.value)switch(E){case`${ctrlKey}-B`:formatBold(m);break;case`${ctrlKey}-I`:formatItalic(m);break;case`${ctrlKey}-D`:formatStrikethrough(m);break;case`${ctrlKey}-K`:formatLink(m);break;case`${ctrlKey}-E`:formatCode(m);break;case`${ctrlKey}-H`:applyHeading(m,1);break;case`${ctrlKey}-U`:formatUnorderedList(m);break;case`${ctrlKey}-O`:formatOrderedList(m);break;case`${ctrlKey}-1`:applyHeading(m,1);break;case`${ctrlKey}-2`:applyHeading(m,2);break;case`${ctrlKey}-3`:applyHeading(m,3);break;case`${ctrlKey}-4`:applyHeading(m,4);break;case`${ctrlKey}-5`:applyHeading(m,5);break;case`${ctrlKey}-6`:applyHeading(m,6);break}}const g=[{label:"加粗",kbd:[ctrlSign,"B"],cmd:`${ctrlKey}-B`},{label:"斜体",kbd:[ctrlSign,"I"],cmd:`${ctrlKey}-I`},{label:"删除线",kbd:[ctrlSign,"D"],cmd:`${ctrlKey}-D`},{label:"超链接",kbd:[ctrlSign,"K"],cmd:`${ctrlKey}-K`},{label:"行内代码",kbd:[ctrlSign,"E"],cmd:`${ctrlKey}-E`},{label:"标题",kbd:[ctrlSign,"H"],cmd:`${ctrlKey}-H`},{label:"无序列表",kbd:[ctrlSign,"U"],cmd:`${ctrlKey}-U`},{label:"有序列表",kbd:[ctrlSign,"O"],cmd:`${ctrlKey}-O`},{label:"格式化",kbd:[altSign,shiftSign,"F"],cmd:"formatContent"}];return(E,m)=>{const S=_sfc_main$o,_=_sfc_main$c,w=_sfc_main$p,u=_sfc_main$j,C=_sfc_main$q,x=_sfc_main$r,b=_sfc_main$t,v=_sfc_main$u,y=_sfc_main$v;return unref(o)?(openBlock(),createBlock(x,{key:0},{default:withCtx(()=>[createVNode(S,null,{default:withCtx(()=>[...m[4]||(m[4]=[createTextVNode(" 格式 ",-1)])]),_:1}),createVNode(C,{class:"w-60"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(g,({label:$,kbd:T,cmd:Y})=>createVNode(w,{key:$,onClick:te=>Y==="formatContent"?unref(f)():p(Y)},{default:withCtx(()=>[createTextVNode(toDisplayString($)+" ",1),createVNode(_,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(T,te=>(openBlock(),createElementBlock("kbd",{key:te,class:"mx-1 bg-gray-2 dark:bg-stone-9"},toDisplayString(te),1))),128))]),_:2},1024)]),_:2},1032,["onClick"])),64)),createVNode(u),createVNode(w,{checked:unref(n),onClick:m[0]||(m[0]=$=>unref(i)())},{default:withCtx(()=>[...m[5]||(m[5]=[createTextVNode(" 微信外链转底部引用 ",-1)])]),_:1},8,["checked"]),createVNode(u),createVNode(w,{checked:unref(s),onClick:m[1]||(m[1]=$=>unref(d)())},{default:withCtx(()=>[...m[6]||(m[6]=[createTextVNode(" 统计字数和阅读时间 ",-1)])]),_:1},8,["checked"])]),_:1})]),_:1})):(openBlock(),createBlock(y,{key:1},{default:withCtx(()=>[createVNode(b,null,{default:withCtx(()=>[...m[7]||(m[7]=[createTextVNode(" 格式",-1)])]),_:1}),createVNode(v,{class:"w-60",align:"start"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(g,({label:$,kbd:T,cmd:Y})=>createVNode(w,{key:$,onClick:te=>Y==="formatContent"?unref(f)():p(Y)},{default:withCtx(()=>[createTextVNode(toDisplayString($)+" ",1),createVNode(_,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(T,te=>(openBlock(),createElementBlock("kbd",{key:te,class:"mx-1 bg-gray-2 dark:bg-stone-9"},toDisplayString(te),1))),128))]),_:2},1024)]),_:2},1032,["onClick"])),64)),createVNode(u),createVNode(w,{checked:unref(n),onClick:m[2]||(m[2]=$=>unref(i)())},{default:withCtx(()=>[...m[8]||(m[8]=[createTextVNode(" 微信外链转底部引用 ",-1)])]),_:1},8,["checked"]),createVNode(u),createVNode(w,{checked:unref(s),onClick:m[3]||(m[3]=$=>unref(d)())},{default:withCtx(()=>[...m[9]||(m[9]=[createTextVNode(" 统计字数和阅读时间 ",-1)])]),_:1},8,["checked"])]),_:1})]),_:1}))}}}),_hoisted_1$8={class:"header-container h-15 flex flex-wrap items-center justify-between px-5 relative"},_hoisted_2$7={class:"space-x-2 hidden md:flex"},_hoisted_3$7={class:"md:hidden"},_hoisted_4$7={class:"space-x-2 flex flex-wrap items-center"},_hoisted_5$6={class:"bg-background space-x-1 text-background-foreground flex items-center border rounded-md"},_sfc_main$a=defineComponent({__name:"index",emits:["startCopy","endCopy"],setup(t,{emit:e}){const o=e,a=useStore(),n=useDisplayStore(),{output:s,primaryColor:l,editor:i}=storeToRefs(a),{editorRefresh:d}=a,f=ref(!1),p=ref(!1),g=ref(!1);function E(){f.value=!0}function m(){p.value=!0}function S(){g.value=!0}const _=useStorage(addPrefix("copyMode"),"txt"),{copy:w}=useClipboard({legacy:!0}),u=y=>new Promise($=>window.setTimeout($,y)),C=y=>y instanceof Error?y.message:String(y);async function x(y){if(!navigator.clipboard?.write)throw new Error("Clipboard API not available.");await u(0),await navigator.clipboard.write(y)}function b(y){const $=window.getSelection();if(!$)return!1;const T=document.createElement("div");T.innerHTML=y,T.style.position="fixed",T.style.left="-9999px",T.style.top="0",T.style.opacity="0",T.style.pointerEvents="none",T.style.setProperty("background-color","#ffffff","important"),T.style.setProperty("color","#000000","important"),document.body.appendChild(T);const Y=document.documentElement,te=Y.classList.contains("dark");let V=!1;try{te&&Y.classList.remove("dark");const ae=document.createRange();ae.selectNodeContents(T),$.removeAllRanges(),$.addRange(ae),V=document.execCommand("copy")}catch{V=!1}finally{$.removeAllRanges(),T.remove(),te&&Y.classList.add("dark")}return V}async function v(){if(_.value==="md"){const y=i.value?.state.doc.toString()||"";await w(y),toast.success("已复制 Markdown 源码到剪贴板。");return}o("startCopy"),setTimeout(()=>{nextTick(async()=>{await processClipboardContent(l.value);const y=document.getElementById("output");if(!y){toast.error("未找到复制输出区域,请刷新页面后重试。"),d(),o("endCopy");return}y.focus(),window.getSelection()?.removeAllRanges();const $=y.innerHTML;if(_.value==="txt")try{if(typeof ClipboardItem>"u")throw new TypeError("ClipboardItem is not supported in this browser.");const T=y.textContent||"",Y=new ClipboardItem({"text/html":new Blob([$],{type:"text/html"}),"text/plain":new Blob([T],{type:"text/plain"})});await x([Y])}catch(T){if(!b($)){y.innerHTML=s.value,window.getSelection()?.removeAllRanges(),d(),toast.error(`复制失败,请联系开发者。${C(T)}`),o("endCopy");return}}y.innerHTML=s.value,_.value==="html"?await w($):_.value==="html-without-style"?await w(await generatePureHTML(i.value.state.doc.toString())):_.value==="html-and-style"&&await w(a.editorContent2HTML()),toast.success(_.value==="html"?"已复制 HTML 源码,请进行下一步操作。":"已复制渲染后的内容到剪贴板,可直接到公众号后台粘贴。"),window.dispatchEvent(new CustomEvent("copyToMp",{detail:{content:s.value}})),d(),o("endCopy")})},350)}return(y,$)=>{const T=_sfc_main$d,Y=_sfc_main$e,te=_sfc_main$g,V=_sfc_main$n,ae=_sfc_main$s,q=_sfc_main$1K,z=_sfc_main$t,G=_sfc_main$u,N=_sfc_main$v,K=_sfc_main$V,W=_sfc_main$R,de=_sfc_main$N,Z=_sfc_main$P,le=_sfc_main$T,ge=_sfc_main$U,P=_sfc_main$w,H=_sfc_main$B,M=_sfc_main$C,F=_sfc_main$D,ne=AIImageGeneratorPanel;return openBlock(),createElementBlock(Fragment,null,[createBaseVNode("header",_hoisted_1$8,[createBaseVNode("div",_hoisted_2$7,[createVNode(ae,{class:"menubar border-0"},{default:withCtx(()=>[createVNode(T,{onOpenEditorState:S}),createVNode(_sfc_main$b),createVNode(Y),createVNode(te),createVNode(V,{onOpenAbout:E,onOpenFund:m})]),_:1})]),createBaseVNode("div",_hoisted_3$7,[createVNode(ae,{class:"menubar border-0 p-0"},{default:withCtx(()=>[createVNode(N,null,{default:withCtx(()=>[createVNode(z,{class:"p-0"},{default:withCtx(()=>[createVNode(q,{variant:"outline",size:"icon"},{default:withCtx(()=>[createVNode(unref(Menu),{class:"size-4"})]),_:1})]),_:1}),createVNode(G,{align:"start"},{default:withCtx(()=>[createVNode(T,{"as-sub":!0,onOpenEditorState:S}),createVNode(_sfc_main$b,{"as-sub":!0}),createVNode(Y,{"as-sub":!0}),createVNode(te,{"as-sub":!0}),createVNode(V,{"as-sub":!0,onOpenAbout:E,onOpenFund:m})]),_:1})]),_:1})]),_:1})]),createBaseVNode("div",_hoisted_4$7,[createBaseVNode("div",_hoisted_5$6,[createVNode(q,{variant:"ghost",class:"shadow-none text-sm px-2 md:px-4",onClick:v},{default:withCtx(()=>[...$[7]||($[7]=[createTextVNode(" 复制 ",-1)])]),_:1}),createVNode(K,{orientation:"vertical",class:"h-5"}),createVNode(ge,{modelValue:unref(_),"onUpdate:modelValue":$[1]||($[1]=J=>isRef(_)?_.value=J:null)},{default:withCtx(()=>[createVNode(W,{"as-child":""},{default:withCtx(()=>[createVNode(q,{variant:"ghost",class:"px-2 shadow-none"},{default:withCtx(()=>[createVNode(unref(ChevronDown),{class:"text-secondary-foreground h-4 w-4"})]),_:1})]),_:1}),createVNode(le,{align:"end","align-offset":-5,class:"w-[220px]"},{default:withCtx(()=>[createVNode(Z,{modelValue:unref(_),"onUpdate:modelValue":$[0]||($[0]=J=>isRef(_)?_.value=J:null)},{default:withCtx(()=>[createVNode(de,{value:"txt"},{default:withCtx(()=>[...$[8]||($[8]=[createTextVNode(" 公众号格式 ",-1)])]),_:1}),createVNode(de,{value:"html"},{default:withCtx(()=>[...$[9]||($[9]=[createTextVNode(" HTML 格式 ",-1)])]),_:1}),createVNode(de,{value:"html-without-style"},{default:withCtx(()=>[...$[10]||($[10]=[createBaseVNode("span",{class:"whitespace-nowrap"},"HTML 格式(无样式)",-1)])]),_:1}),createVNode(de,{value:"html-and-style"},{default:withCtx(()=>[...$[11]||($[11]=[createBaseVNode("span",{class:"whitespace-nowrap"},"HTML 格式(兼容样式)",-1)])]),_:1}),createVNode(de,{value:"md"},{default:withCtx(()=>[...$[12]||($[12]=[createTextVNode(" MD 格式 ",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["modelValue"])]),createVNode(P,{class:"hidden md:inline-flex"}),createVNode(q,{variant:"outline",size:"icon",onClick:$[2]||($[2]=J=>unref(a).isOpenRightSlider=!unref(a).isOpenRightSlider)},{default:withCtx(()=>[createVNode(unref(Settings),{class:"size-4"})]),_:1})])]),createVNode(H,{visible:unref(f),onClose:$[3]||($[3]=J=>f.value=!1)},null,8,["visible"]),createVNode(M,{visible:unref(p),onClose:$[4]||($[4]=J=>p.value=!1)},null,8,["visible"]),createVNode(F,{visible:unref(g),onClose:$[5]||($[5]=J=>g.value=!1)},null,8,["visible"]),createVNode(ne,{open:unref(n).aiImageDialogVisible,"onUpdate:open":$[6]||($[6]=J=>unref(n).aiImageDialogVisible=J)},null,8,["open"])],64)}}}),__unplugin_components_1=_export_sfc(_sfc_main$a,[["__scopeId","data-v-bb7d32ac"]]),useAIConfigStore=defineStore("AIConfig",()=>{const t=useStorage("openai_type",DEFAULT_SERVICE_TYPE),e=useStorage("openai_temperature",DEFAULT_SERVICE_TEMPERATURE),o=useStorage("openai_max_token",DEFAULT_SERVICE_MAX_TOKEN),a=ref(""),n=ref(""),s=customRef((i,d)=>({get(){return i(),localStorage.getItem(`openai_key_${t.value}`)||DEFAULT_SERVICE_KEY},set(f){t.value!==DEFAULT_SERVICE_TYPE&&localStorage.setItem(`openai_key_${t.value}`,f),d()}}));watch(t,i=>{const d=serviceOptions.find(p=>p.value===i)??serviceOptions[0];a.value=d.endpoint;const f=localStorage.getItem(`openai_model_${i}`)||"";n.value=d.models.includes(f)?f:d.models[0],localStorage.setItem(`openai_model_${i}`,n.value)},{immediate:!0}),watch(n,i=>{localStorage.setItem(`openai_model_${t.value}`,i)});function l(){t.value=DEFAULT_SERVICE_TYPE,e.value=DEFAULT_SERVICE_TEMPERATURE,o.value=DEFAULT_SERVICE_MAX_TOKEN,serviceOptions.forEach(({value:i})=>{localStorage.removeItem(`openai_key_${i}`),localStorage.removeItem(`openai_model_${i}`)})}return{type:t,endpoint:a,model:n,temperature:e,maxToken:o,apiKey:s,reset:l}}),_hoisted_1$7={class:"custom-scroll space-y-4 max-h-[calc(100dvh-10rem)] overflow-y-auto pr-1 text-xs sm:max-h-none sm:text-sm"},_hoisted_2$6={key:0},_hoisted_3$6={key:1},_hoisted_4$6={class:"mt-2 flex flex-col gap-2 sm:flex-row"},_hoisted_5$5={key:2,class:"mt-1 text-xs text-gray-500"},_sfc_main$9=defineComponent({__name:"AIConfig",emits:["saved"],setup(t,{emit:e}){const o=e,a=useAIConfigStore(),{type:n,endpoint:s,model:l,apiKey:i,temperature:d,maxToken:f}=storeToRefs(a),p=ref(!1),g=ref(""),E=computed(()=>serviceOptions.find(w=>w.value===n.value)||serviceOptions[0]);watch(n,()=>{g.value=""}),watch(l,()=>{g.value=""});function m(w=!0){w&&(g.value="✅ 配置已保存",o("saved"))}function S(){a.reset(),g.value="🗑️ 当前 AI 配置已清除"}async function _(){g.value="",p.value=!0;const w={"Content-Type":"application/json"};i.value&&n.value!==DEFAULT_SERVICE_TYPE&&(w.Authorization=`Bearer ${i.value}`);try{const u=new URL(s.value);u.pathname.endsWith("/chat/completions")||(u.pathname=u.pathname.replace(/\/?$/,"/chat/completions"));const C={model:l.value,messages:[{role:"user",content:"ping"}],temperature:0,max_tokens:1,stream:!1},x=await window.fetch(u.toString(),{method:"POST",headers:w,body:JSON.stringify(C)});if(x.ok)g.value="✅ 测试成功,/chat/completions 可用",m(!1);else{const b=await x.text();try{const{error:v}=JSON.parse(b);if(x.status===404&&(v?.code==="ModelNotOpen"||/not activated|未开通/i.test(v?.message))){g.value=`⚠️ 测试成功,但当前模型未开通:${l.value}`,m(!1);return}}catch{}g.value=`❌ 测试失败:${x.status} ${x.statusText},${b}`}}catch(u){g.value=`❌ 测试失败:${u.message}`}finally{p.value=!1}}return(w,u)=>{const C=_sfc_main$1B,x=_sfc_main$1b,b=_sfc_main$1c,v=_sfc_main$1f,y=_sfc_main$1a,$=_sfc_main$1h,T=_sfc_main$1x,Y=_sfc_main$I,te=_sfc_main$J,V=_sfc_main$K,ae=_sfc_main$L,q=_sfc_main$1K;return openBlock(),createElementBlock("div",_hoisted_1$7,[u[16]||(u[16]=createBaseVNode("div",{class:"font-medium"}," AI 配置 ",-1)),createBaseVNode("div",null,[createVNode(C,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...u[7]||(u[7]=[createTextVNode("服务类型",-1)])]),_:1}),createVNode($,{modelValue:unref(n),"onUpdate:modelValue":u[0]||(u[0]=z=>isRef(n)?n.value=z:null)},{default:withCtx(()=>[createVNode(b,{class:"w-full"},{default:withCtx(()=>[createVNode(x,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(E).label),1)]),_:1})]),_:1}),createVNode(y,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(serviceOptions),z=>(openBlock(),createBlock(v,{key:z.value,value:z.value},{default:withCtx(()=>[createTextVNode(toDisplayString(z.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),unref(n)!==unref(DEFAULT_SERVICE_TYPE)?(openBlock(),createElementBlock("div",_hoisted_2$6,[createVNode(C,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...u[8]||(u[8]=[createTextVNode("API 端点",-1)])]),_:1}),createVNode(T,{modelValue:unref(s),"onUpdate:modelValue":u[1]||(u[1]=z=>isRef(s)?s.value=z:null),placeholder:"输入 API 端点 URL",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"])])):createCommentVNode("",!0),unref(n)!==unref(DEFAULT_SERVICE_TYPE)?(openBlock(),createElementBlock("div",_hoisted_3$6,[createVNode(C,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...u[9]||(u[9]=[createTextVNode("API 密钥",-1)])]),_:1}),createVNode(unref(_sfc_main$G),{modelValue:unref(i),"onUpdate:modelValue":u[2]||(u[2]=z=>isRef(i)?i.value=z:null),placeholder:"sk-...",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"])])):createCommentVNode("",!0),createBaseVNode("div",null,[createVNode(C,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...u[10]||(u[10]=[createTextVNode("模型名称",-1)])]),_:1}),unref(E).models.length>0?(openBlock(),createBlock($,{key:0,modelValue:unref(l),"onUpdate:modelValue":u[3]||(u[3]=z=>isRef(l)?l.value=z:null)},{default:withCtx(()=>[createVNode(b,{class:"w-full"},{default:withCtx(()=>[createVNode(x,null,{default:withCtx(()=>[createTextVNode(toDisplayString(unref(l)||"请选择模型"),1)]),_:1})]),_:1}),createVNode(y,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(E).models,z=>(openBlock(),createBlock(v,{key:z,value:z},{default:withCtx(()=>[createTextVNode(toDisplayString(z),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])):(openBlock(),createBlock(T,{key:1,modelValue:unref(l),"onUpdate:modelValue":u[4]||(u[4]=z=>isRef(l)?l.value=z:null),placeholder:"输入模型名称",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"]))]),createBaseVNode("div",null,[createVNode(C,{class:"mb-1 flex items-center gap-1 text-sm font-medium"},{default:withCtx(()=>[u[12]||(u[12]=createTextVNode(" 温度 ",-1)),createVNode(ae,null,{default:withCtx(()=>[createVNode(V,null,{default:withCtx(()=>[createVNode(Y,{"as-child":""},{default:withCtx(()=>[createVNode(unref(Info),{class:"text-gray-500",size:16})]),_:1}),createVNode(te,null,{default:withCtx(()=>[...u[11]||(u[11]=[createBaseVNode("div",null,"控制输出的随机性:较低的值使输出更确定,较高的值使其更随机。",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(T,{modelValue:unref(d),"onUpdate:modelValue":u[5]||(u[5]=z=>isRef(d)?d.value=z:null),modelModifiers:{number:!0},type:"number",step:"0.1",min:"0",max:"2",placeholder:"0 ~ 2,默认 1",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"])]),createBaseVNode("div",null,[createVNode(C,{class:"mb-1 block text-sm font-medium"},{default:withCtx(()=>[...u[13]||(u[13]=[createTextVNode("最大 Token 数",-1)])]),_:1}),createVNode(T,{modelValue:unref(f),"onUpdate:modelValue":u[6]||(u[6]=z=>isRef(f)?f.value=z:null),modelModifiers:{number:!0},type:"number",min:"1",max:"32768",placeholder:"比如 1024",class:"focus:border-gray-400 focus:ring-1 focus:ring-gray-300"},null,8,["modelValue"])]),createBaseVNode("div",_hoisted_4$6,[createVNode(q,{size:"sm",onClick:m},{default:withCtx(()=>[...u[14]||(u[14]=[createTextVNode(" 保存 ",-1)])]),_:1}),createVNode(q,{size:"sm",variant:"ghost",onClick:S},{default:withCtx(()=>[...u[15]||(u[15]=[createTextVNode(" 清空 ",-1)])]),_:1}),createVNode(q,{size:"sm",variant:"outline",disabled:unref(p),onClick:_},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(p)?"测试中...":"测试连接"),1)]),_:1},8,["disabled"])]),unref(g)?(openBlock(),createElementBlock("div",_hoisted_5$5,toDisplayString(unref(g)),1)):createCommentVNode("",!0)])}}}),__unplugin_components_0=_export_sfc(_sfc_main$9,[["__scopeId","data-v-c27df4a6"]]),STORAGE_KEY="quick_commands";function hydrate(t){return{...t,buildPrompt:(e="")=>t.template.replace(/\{\{\s*sel\s*\}\}/gi,e)}}const DEFAULT_COMMANDS=[{id:"polish",label:"润色",template:`请润色以下内容:
600
-
601
- {{sel}}`},{id:"to-en",label:"翻译成英文",template:`请将以下内容翻译为英文:
602
-
603
- {{sel}}`},{id:"to-zh",label:"翻译成中文",template:`Please translate the following content into Chinese:
604
-
605
- {{sel}}`},{id:"summary",label:"总结",template:`请对以下内容进行总结:
606
-
607
- {{sel}}`}],useQuickCommands=defineStore("quickCommands",()=>{const t=ref([]);function e(){const l=t.value.map(({id:i,label:d,template:f})=>({id:i,label:d,template:f}));localStorage.setItem(STORAGE_KEY,JSON.stringify(l))}function o(){const l=localStorage.getItem(STORAGE_KEY);if(l)try{const i=JSON.parse(l);t.value=i.map(hydrate)}catch(i){console.warn("解析快捷指令失败,已恢复默认值",i),t.value=DEFAULT_COMMANDS.map(hydrate),e()}else t.value=DEFAULT_COMMANDS.map(hydrate),e()}function a(l,i){const d=crypto.randomUUID();t.value.push(hydrate({id:d,label:l,template:i}))}function n(l,i,d){const f=t.value.findIndex(p=>p.id===l);f!==-1&&(t.value[f]=hydrate({id:l,label:i,template:d}))}function s(l){t.value=t.value.filter(i=>i.id!==l)}return o(),watch(t,e,{deep:!0}),{commands:t,add:a,update:n,remove:s}}),_hoisted_1$6={class:"space-y-4 flex-1 overflow-y-auto pr-1"},_hoisted_2$5={class:"flex justify-end gap-2"},_hoisted_3$5={key:1,class:"flex items-center justify-between"},_hoisted_4$5={class:"break-all text-sm"},_hoisted_5$4={class:"flex gap-1"},_hoisted_6$4={class:"space-y-2 mt-4 border rounded-md p-3"},_sfc_main$8=defineComponent({__name:"QuickCommandManager",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=t,a=e,n=ref(o.open);watch(()=>o.open,_=>n.value=_),watch(n,_=>a("update:open",_));const s=useQuickCommands(),l=ref(""),i=ref("");function d(){!l.value.trim()||!i.value.trim()||(s.add(l.value.trim(),i.value.trim()),l.value="",i.value="")}const f=ref(null),p=ref(""),g=ref("");function E(_){f.value=_.id,p.value=_.label,g.value=_.template}function m(){f.value=null}function S(){!p.value.trim()||!g.value.trim()||(s.update(f.value,p.value.trim(),g.value.trim()),f.value=null)}return(_,w)=>(openBlock(),createBlock(unref(_sfc_main$1E),{open:n.value,"onUpdate:open":w[4]||(w[4]=u=>n.value=u)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1D),{class:"max-h-[90vh] w-[92vw] flex flex-col sm:max-w-lg"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1w),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$1v),null,{default:withCtx(()=>[...w[5]||(w[5]=[createTextVNode("管理快捷指令",-1)])]),_:1})]),_:1}),createBaseVNode("div",_hoisted_1$6,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(s).commands,u=>(openBlock(),createElementBlock("div",{key:u.id,class:"flex flex-col gap-2 border rounded-md p-3"},[f.value===u.id?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(unref(_sfc_main$1x),{modelValue:p.value,"onUpdate:modelValue":w[0]||(w[0]=C=>p.value=C),placeholder:"指令名称"},null,8,["modelValue"]),createVNode(unref(_sfc_main$1z),{modelValue:g.value,"onUpdate:modelValue":w[1]||(w[1]=C=>g.value=C),rows:"2",placeholder:"模板内容,支持 {{sel}} 占位"},null,8,["modelValue"]),createBaseVNode("div",_hoisted_2$5,[createVNode(unref(_sfc_main$1K),{size:"xs",onClick:S},{default:withCtx(()=>[...w[6]||(w[6]=[createTextVNode(" 保存 ",-1)])]),_:1}),createVNode(unref(_sfc_main$1K),{variant:"ghost",size:"xs",onClick:m},{default:withCtx(()=>[...w[7]||(w[7]=[createTextVNode(" 取消 ",-1)])]),_:1})])],64)):(openBlock(),createElementBlock("div",_hoisted_3$5,[createBaseVNode("span",_hoisted_4$5,toDisplayString(u.label),1),createBaseVNode("div",_hoisted_5$4,[createVNode(unref(_sfc_main$1K),{variant:"ghost",size:"xs",onClick:C=>E(u)},{default:withCtx(()=>[...w[8]||(w[8]=[createTextVNode(" 编辑 ",-1)])]),_:1},8,["onClick"]),createVNode(unref(_sfc_main$1K),{variant:"outline",size:"xs",onClick:C=>unref(s).remove(u.id)},{default:withCtx(()=>[...w[9]||(w[9]=[createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"])])]))]))),128))]),createBaseVNode("div",_hoisted_6$4,[createVNode(unref(_sfc_main$1x),{modelValue:l.value,"onUpdate:modelValue":w[2]||(w[2]=u=>l.value=u),placeholder:"指令名称 (如:改写为 SEO 文案)"},null,8,["modelValue"]),createVNode(unref(_sfc_main$1z),{modelValue:i.value,"onUpdate:modelValue":w[3]||(w[3]=u=>i.value=u),rows:"2",placeholder:"模板,可用 {{sel}} 占位,例如:\\n请把以下文字改写为 SEO 友好的标题:\\n\\n{{sel}}"},null,8,["modelValue"]),createVNode(unref(_sfc_main$1K),{class:"w-full",onClick:d},{default:withCtx(()=>[...w[10]||(w[10]=[createTextVNode(" 添加 ",-1)])]),_:1})])]),_:1})]),_:1},8,["open"]))}}),_hoisted_1$5={class:"space-x-1 flex items-center"},_hoisted_2$4={key:0,class:"mb-3 flex flex-wrap gap-2 overflow-x-auto pb-1"},_hoisted_3$4={key:1,class:"text-muted-foreground flex items-center gap-2 border rounded-md border-dashed px-3 py-1 text-xs"},_hoisted_4$4={key:2,class:"custom-scroll space-y-3 chat-container mb-4 flex-1 overflow-y-auto pr-2"},_hoisted_5$3={key:0,class:"text-muted-foreground mb-1 italic"},_hoisted_6$3={key:3,class:"relative mt-2"},_hoisted_7$2={class:"bg-background border-border flex flex-col items-baseline gap-2 border rounded-xl px-3 py-2 pr-12 shadow-inner"},memoryKey="ai_memory_context",_sfc_main$7=defineComponent({__name:"AIAssistantPanel",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=t,a=e,n=useStore(),{editor:s}=storeToRefs(n),l=useDisplayStore(),{toggleAIImageDialog:i}=l,d=ref(o.open);watch(()=>o.open,M=>d.value=M),watch(d,M=>{a("update:open",M),M&&le(!0)});const f=ref(""),p=ref([]),g=ref(null),E=ref(!1),m=ref(!1),S=ref(null),_=ref(null),w=ref(!1),u=ref(!1),C=ref([]),x=useAIConfigStore(),{apiKey:b,endpoint:v,model:y,temperature:$,maxToken:T,type:Y}=storeToRefs(x),te=useQuickCommands();function V(){try{const M=s.value;return M&&typeof M.getSelection=="function"&&M.getSelection()||""}catch(M){return console.warn("获取选中文本失败",M),""}}function ae(M){const F=V();f.value=M.buildPrompt(F),g.value=null,nextTick(()=>{const ne=document.querySelector('textarea[placeholder*="说些什么" ]');ne?.focus(),ne&&ne.setSelectionRange(ne.value.length,ne.value.length)})}onMounted(async()=>{const M=localStorage.getItem(memoryKey);C.value=M?JSON.parse(M):q(),await le(!0)});function q(){return[{role:"assistant",content:"你好,我是 AI 助手,有什么可以帮你的?"}]}function z(){E.value=!1,le(!0)}function G(){a("update:open",!1),setTimeout(()=>{i(!0)},100)}function N(M){if(!(M.isComposing||M.keyCode===229)){if(M.key==="Enter"&&!M.shiftKey)M.preventDefault(),H();else if(M.key==="ArrowUp"){if(M.preventDefault(),p.value.length===0)return;g.value===null?g.value=p.value.length-1:g.value>0&&g.value--,f.value=p.value[g.value]||""}else if(M.key==="ArrowDown"){if(M.preventDefault(),g.value===null)return;g.value<p.value.length-1?(g.value++,f.value=p.value[g.value]||""):(g.value=null,f.value="")}}}async function K(M,F){copyPlain(M),_.value=F,setTimeout(()=>_.value=null,1500)}function W(M){f.value=M,g.value=null,nextTick(()=>{const F=document.querySelector('textarea[placeholder*="说些什么" ]');if(F?.focus(),F){const ne=F.value.length;F.setSelectionRange(ne,ne)}})}function de(){S.value&&(S.value.abort(),S.value=null),C.value=q(),localStorage.setItem(memoryKey,JSON.stringify(C.value)),le(!0)}function Z(){S.value&&(S.value.abort(),S.value=null),m.value=!1;const M=C.value[C.value.length-1];M?.role==="assistant"&&(M.done=!0),le(!0)}async function le(M=!1){await nextTick();const F=document.querySelector(".chat-container");if(F){const ne=F.scrollTop+F.clientHeight>=F.scrollHeight-50;(M||ne)&&(F.scrollTop=F.scrollHeight,await new Promise(J=>setTimeout(J,50)))}}function ge(){w.value=!w.value}async function P(){const M=[...C.value].reverse().find(ne=>ne.role==="user");if(!M)return;const F=C.value.findIndex((ne,J,ee)=>J>0&&ee[J-1]===M&&ne.role==="assistant");F!==-1&&C.value.splice(F,1),f.value=M.content,await nextTick(),H()}async function H(){if(!f.value.trim()||m.value)return;p.value.push(f.value.trim()),g.value=null,m.value=!0;const M=f.value.trim();C.value.push({role:"user",content:M}),f.value="";const F={role:"assistant",content:"",reasoning:"",done:!1};C.value.push(F);const ne=C.value[C.value.length-1];await le(!0);const J=C.value.slice(-12).filter((re,ce,j)=>!(ce===j.length-1&&re.role==="assistant"&&!re.done)&&!(ce===0&&re.role==="assistant"));let ee;if(w.value){const re=[];for(let ce=J.length-1;ce>=0&&re.length<2;ce--){const j=J[ce];(re.length===0||j.role==="user"||j.role==="assistant")&&re.unshift(j)}ee=re}else ee=J.slice(-10);const L=w.value?[{role:"system",content:`下面是一篇 Markdown 文章全文,请严格以此为主完成后续指令:
608
-
609
- ${s.value?.state.doc.toString()}`}]:[],R=[{role:"system",content:"你是一个专业的 Markdown 编辑器助手,请用简洁中文回答。"},...L,...ee],oe={model:y.value,messages:R,temperature:$.value,max_tokens:T.value,stream:!0},fe={"Content-Type":"application/json"};b.value&&Y.value!=="default"&&(fe.Authorization=`Bearer ${b.value}`),S.value=new AbortController;const se=S.value.signal;try{const re=new URL(v.value);re.pathname.endsWith("/chat/completions")||(re.pathname=re.pathname.replace(/\/?$/,"/chat/completions"));const ce=await window.fetch(re.toString(),{method:"POST",headers:fe,body:JSON.stringify(oe),signal:se});if(!ce.ok||!ce.body)throw new Error(`响应错误:${ce.status} ${ce.statusText}`);const j=ce.body.getReader(),I=new TextDecoder("utf-8");let _e="";for(;;){const{value:me,done:be}=await j.read();if(be){const xe=C.value[C.value.length-1];xe.role==="assistant"&&(xe.done=!0,await le(!0));break}_e+=I.decode(me,{stream:!0});const ke=_e.split(`
610
- `);_e=ke.pop()||"";for(const xe of ke)if(!(!xe.trim()||xe.trim()==="data: [DONE]"))try{const Ce=JSON.parse(xe.replace(/^data: /,"")).choices?.[0]?.delta||{},ve=C.value[C.value.length-1];if(ve!==ne)return;Ce.content?ve.content+=Ce.content:Ce.reasoning_content&&(ve.reasoning=(ve.reasoning||"")+Ce.reasoning_content),await le()}catch(ye){console.error("解析失败:",ye)}}}catch(re){re.name==="AbortError"?console.log("请求中止"):(console.error("请求失败:",re),C.value[C.value.length-1].content=`❌ 请求失败: ${re.message}`),await le(!0)}finally{localStorage.setItem(memoryKey,JSON.stringify(C.value)),m.value=!1,S.value=null}}return(M,F)=>{const ne=_sfc_main$8,J=__unplugin_components_0;return openBlock(),createBlock(unref(_sfc_main$1E),{open:unref(d),"onUpdate:open":F[6]||(F[6]=ee=>isRef(d)?d.value=ee:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1D),{class:"bg-card text-card-foreground h-dvh max-h-dvh w-full flex flex-col rounded-none shadow-xl sm:max-h-[80vh] sm:max-w-2xl sm:rounded-xl"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1w),{class:"space-y-1 flex flex-col items-start"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$5,[createVNode(unref(_sfc_main$1v),null,{default:withCtx(()=>[...F[7]||(F[7]=[createTextVNode("AI 对话",-1)])]),_:1}),createVNode(unref(_sfc_main$1K),{title:unref(E)?"AI 对话":"配置参数","aria-label":unref(E)?"AI 对话":"配置参数",variant:"ghost",size:"icon",onClick:F[0]||(F[0]=ee=>E.value=!unref(E))},{default:withCtx(()=>[unref(E)?(openBlock(),createBlock(unref(MessageCircle),{key:0,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Settings),{key:1,class:"h-4 w-4"}))]),_:1},8,["title","aria-label"]),createVNode(unref(_sfc_main$1K),{title:"AI 文生图","aria-label":"AI 文生图",variant:"ghost",size:"icon",onClick:F[1]||(F[1]=ee=>G())},{default:withCtx(()=>[createVNode(unref(Image),{class:"h-4 w-4"})]),_:1}),createVNode(unref(_sfc_main$1K),{title:"清空对话内容","aria-label":"清空对话内容",variant:"ghost",size:"icon",onClick:de},{default:withCtx(()=>[createVNode(unref(Trash2),{class:"h-4 w-4"})]),_:1})]),F[8]||(F[8]=createBaseVNode("p",{class:"text-muted-foreground text-sm"}," 使用 AI 助手帮助您编写和优化内容 ",-1))]),_:1}),unref(E)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_2$4,[unref(te).commands.length?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(unref(te).commands,ee=>(openBlock(),createBlock(unref(_sfc_main$1K),{key:ee.id,variant:"secondary",size:"sm",class:"text-xs",onClick:L=>ae(ee)},{default:withCtx(()=>[createTextVNode(toDisplayString(ee.label),1)]),_:2},1032,["onClick"]))),128)):(openBlock(),createElementBlock("div",_hoisted_3$4," 还没有任何快捷指令,点击右侧添加 ")),createVNode(unref(_sfc_main$1K),{variant:"ghost",size:"icon",title:"管理指令",onClick:F[2]||(F[2]=ee=>u.value=!0)},{default:withCtx(()=>[createVNode(unref(Plus),{class:"h-4 w-4"})]),_:1}),createVNode(ne,{open:unref(u),"onUpdate:open":F[3]||(F[3]=ee=>isRef(u)?u.value=ee:null)},null,8,["open"])])),unref(E)?(openBlock(),createBlock(J,{key:1,class:"mb-4 w-full border rounded-md p-4",onSaved:z})):createCommentVNode("",!0),unref(E)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_4$4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(C),(ee,L)=>(openBlock(),createElementBlock("div",{key:L,class:normalizeClass(["relative flex",ee.role==="user"?"justify-end":"justify-start"])},[createBaseVNode("div",{class:normalizeClass(["ring-border/20 max-w-[75%] rounded-2xl px-4 py-2 text-sm leading-relaxed shadow-xs ring-1",ee.role==="user"?"bg-black text-white dark:bg-primary dark:text-primary-foreground":"bg-gray-100 text-gray-800 dark:bg-muted/60 dark:text-muted-foreground"])},[ee.reasoning?(openBlock(),createElementBlock("div",_hoisted_5$3,toDisplayString(ee.reasoning),1)):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass(["whitespace-pre-wrap",ee.content?"":"animate-pulse text-muted-foreground"])},toDisplayString(ee.content||(ee.role==="assistant"&&!ee.done?"思考中…":"")),3),createBaseVNode("div",{class:normalizeClass(["mt-1 flex",ee.role==="user"?"justify-end":"justify-start"])},[L>0&&!(ee.role==="assistant"&&L===unref(C).length-1&&!ee.done)?(openBlock(),createBlock(unref(_sfc_main$1K),{key:0,variant:"ghost",size:"icon",class:"ml-0 h-5 w-5 p-1","aria-label":"复制内容",onClick:R=>K(ee.content,L)},{default:withCtx(()=>[unref(_)===L?(openBlock(),createBlock(unref(Check),{key:0,class:"h-3 w-3 text-green-600"})):(openBlock(),createBlock(unref(Copy),{key:1,class:"text-muted-foreground h-3 w-3"}))]),_:2},1032,["onClick"])):createCommentVNode("",!0),L>0&&!(ee.role==="assistant"&&L===unref(C).length-1&&!ee.done)?(openBlock(),createBlock(unref(_sfc_main$1K),{key:1,variant:"ghost",size:"icon",class:"ml-1 h-5 w-5 p-1","aria-label":"编辑内容",onClick:R=>W(ee.content)},{default:withCtx(()=>[createVNode(unref(SquarePen),{class:"text-muted-foreground h-3 w-3"})]),_:1},8,["onClick"])):createCommentVNode("",!0),ee.role==="assistant"&&ee.done&&L===unref(C).length-1?(openBlock(),createBlock(unref(_sfc_main$1K),{key:2,variant:"ghost",size:"icon",class:"ml-1 h-5 w-5 p-1","aria-label":"重新生成",onClick:P},{default:withCtx(()=>[createVNode(unref(RefreshCcw),{class:"text-muted-foreground h-3 w-3"})]),_:1})):createCommentVNode("",!0)],2)],2)],2))),128))])),unref(E)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_6$3,[createBaseVNode("div",_hoisted_7$2,[createVNode(unref(_sfc_main$1z),{modelValue:unref(f),"onUpdate:modelValue":F[4]||(F[4]=ee=>isRef(f)?f.value=ee:null),placeholder:"说些什么… (Enter 发送,Shift+Enter 换行)",rows:"2",class:"custom-scroll min-h-16 w-full resize-none border-none bg-transparent p-0 focus-visible:outline-hidden focus:outline-hidden focus-visible:ring-0 focus:ring-0 focus-visible:ring-offset-0 focus:ring-offset-0 focus-visible:ring-transparent focus:ring-transparent",onKeydown:N},null,8,["modelValue"]),createVNode(unref(_sfc_main$1K),{size:"sm",variant:"outline",class:normalizeClass(["h-8 flex items-center gap-1 rounded-md px-3 font-medium transition-colors duration-150",[unref(w)?"bg-primary text-white border-primary dark:bg-white dark:text-black dark:border-white":"bg-background text-muted-foreground border-border hover:text-foreground hover:border-foreground dark:bg-muted dark:text-gray-400 dark:hover:text-white dark:hover:border-white/60"]]),"aria-label":"引用全文",onClick:ge},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(w)?unref(Check):unref(Copy)),{class:"h-4 w-4"})),F[9]||(F[9]=createBaseVNode("span",{class:"text-xs"},"引用全文",-1))]),_:1},8,["class"]),createVNode(unref(_sfc_main$1K),{disabled:!unref(f).trim()&&!unref(m),size:"icon",class:normalizeClass(["absolute bottom-3 right-3 rounded-full disabled:opacity-40","bg-primary hover:bg-primary/90 text-primary-foreground"]),"aria-label":unref(m)?"暂停":"发送",onClick:F[5]||(F[5]=ee=>unref(m)?Z():H())},{default:withCtx(()=>[unref(m)?(openBlock(),createBlock(unref(Pause),{key:0,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Send),{key:1,class:"h-4 w-4"}))]),_:1},8,["disabled","aria-label"])])]))]),_:1})]),_:1},8,["open"])}}}),AIAssistantPanel=_export_sfc(_sfc_main$7,[["__scopeId","data-v-4a4d9bc3"]]),_hoisted_1$4={class:"space-x-1 flex items-center"},_hoisted_2$3={key:1,class:"custom-scroll space-y-4 flex-1 overflow-y-auto px-4 pb-4 pt-3 sm:px-6"},_hoisted_3$3={class:"border-border custom-scroll bg-muted/20 text-muted-foreground max-h-32 overflow-y-auto whitespace-pre-line border rounded px-3 py-2 text-sm"},_hoisted_4$3={key:0},_hoisted_5$2={class:"custom-scroll border-border max-h-24 min-h-[40px] flex flex-wrap gap-2 overflow-y-auto border rounded px-2 py-1"},_hoisted_6$2=["onClick"],_hoisted_7$1={key:1,class:"min-h-[24px] flex items-center text-[12px] text-red-500"},_hoisted_8={key:2},_hoisted_9={key:2,class:"border-border flex justify-end gap-2 border-t px-4 py-3 sm:px-6"},_sfc_main$6=defineComponent({__name:"ToolBoxPopover",props:{open:{type:Boolean},selectedText:{},isMobile:{type:Boolean}},emits:["update:open"],setup(t,{expose:e,emit:o}){const a=t,n=o,s=ref(!1),l=ref(a.open),i=ref(""),d=ref(!1),f=ref(null),p=ref([]),g=ref(!1),E=ref("optimize"),m=ref(""),S=ref(""),_=useStore(),w=ref(null);watch(()=>a.open,K=>{l.value=K,K&&a.selectedText.trim()&&(m.value=a.selectedText,V())}),watch(l,K=>n("update:open",K));const u=useAIConfigStore(),{apiKey:C,endpoint:x,model:b,temperature:v,maxToken:y,type:$}=storeToRefs(u),T=[{value:"optimize",label:"优化文本",defaultPrompt:"请优化文本,使其更通顺易读。"},{value:"summarize",label:"文章总结",defaultPrompt:"请对文本进行摘要,输出主要观点和结论。"},{value:"spellcheck",label:"错别字纠正",defaultPrompt:"请找出并纠正文本中的错别字、标点和语法错误。"},{value:"translate-zh",label:"翻译为中文",defaultPrompt:"请将文本翻译为地道的中文。"},{value:"translate-en",label:"翻译为英文",defaultPrompt:"请将文本翻译为自然流畅的英文。"},{value:"custom",label:"自定义",defaultPrompt:""}];watch(i,async()=>{await nextTick(),w.value?.scrollTo({top:w.value.scrollHeight})}),watch(E,K=>{K!=="custom"&&(p.value=[])}),watch(()=>a.selectedText,K=>{l.value&&(m.value=K,V())});function Y(K){const W=K.target,de=W.value.trim();de&&!p.value.includes(de)&&p.value.push(de),W.value=""}function te(K){p.value.splice(K,1)}function V(){i.value="",d.value=!1,g.value=!1,S.value="",f.value?.abort(),f.value=null}async function ae(){const K=m.value.trim();if(!K||d.value)return;V(),d.value=!0,f.value=new AbortController;const W="你是一名专业的多语言文本助手,请根据用户的指令处理下列内容。在输出时,不要输出任何额外的信息,只输出处理后的文本。",de=T.find(M=>M.value===E.value),Z=[];de.defaultPrompt&&Z.push(de.defaultPrompt),p.value.length&&Z.push(`请同时满足以下要求:${p.value.join("、")}。`),Z.length||Z.push("请根据最佳实践优化文本。");const le=Z.join(" "),ge=[{role:"system",content:W},{role:"user",content:`${le}
611
-
612
- 待处理文本:
613
- ${K}`}],P={model:b.value,messages:ge,temperature:v.value,max_tokens:y.value,stream:!0},H={"Content-Type":"application/json"};C.value&&$.value!=="default"&&(H.Authorization=`Bearer ${C.value}`);try{const M=new URL(x.value);M.pathname.endsWith("/chat/completions")||(M.pathname=M.pathname.replace(/\/?$/,"/chat/completions"));const F=await window.fetch(M.toString(),{method:"POST",headers:H,body:JSON.stringify(P),signal:f.value.signal});if(!F.ok||!F.body)throw new Error(`响应错误:${F.status}`);const ne=F.body.getReader(),J=new TextDecoder("utf-8");let ee="";for(;;){const{value:L,done:R}=await ne.read();if(R)break;ee+=J.decode(L,{stream:!0});const oe=ee.split(`
614
- `);ee=oe.pop()||"";for(const fe of oe)if(!(!fe.trim()||fe.trim()==="data: [DONE]"))try{const re=JSON.parse(fe.replace(/^data: /,"")).choices?.[0]?.delta?.content;re?.trim()&&(i.value+=re,g.value=!0)}catch{}}}catch(M){M.name==="AbortError"?console.log("Request aborted by user."):(console.error("请求失败:",M),S.value=M.message||"请求失败")}finally{d.value=!1}}function q(){d.value&&f.value&&(f.value.abort(),d.value=!1)}function z(){const K=toRaw(_.editor),W=K.state.selection.main;K.dispatch(K.state.replaceSelection(i.value));const de=K.state.selection.main;K.dispatch({selection:{anchor:W.from,head:de.head}}),K.focus(),m.value=i.value,V()}function G(){l.value=!0}function N(){l.value=!1,p.value=[],E.value="optimize",V()}return e({dialogVisible:l,runAIAction:ae,replaceText:z,show:G,close:N,stopAI:q}),(K,W)=>{const de=__unplugin_components_0;return openBlock(),createBlock(unref(_sfc_main$1E),{open:unref(l),"onUpdate:open":W[3]||(W[3]=Z=>isRef(l)?l.value=Z:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1D),{class:"bg-card text-card-foreground flex flex-col w-[95vw] max-h-[90vh] sm:max-h-[85vh] sm:max-w-2xl overflow-y-auto"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1w),{class:"space-y-1 flex flex-col items-start"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$4,[createVNode(unref(_sfc_main$1v),null,{default:withCtx(()=>[...W[4]||(W[4]=[createTextVNode("AI 工具箱",-1)])]),_:1}),createVNode(unref(_sfc_main$1K),{title:unref(s)?"AI 工具箱":"配置参数","aria-label":unref(s)?"AI 工具箱":"配置参数",variant:"ghost",size:"icon",onClick:W[0]||(W[0]=Z=>s.value=!unref(s))},{default:withCtx(()=>[unref(s)?(openBlock(),createBlock(unref(WandSparkles),{key:0,class:"h-4 w-4"})):(openBlock(),createBlock(unref(Settings),{key:1,class:"h-4 w-4"}))]),_:1},8,["title","aria-label"])])]),_:1}),unref(s)?(openBlock(),createBlock(de,{key:0,class:"border-border mb-4 w-full border rounded-md p-4",onSaved:W[1]||(W[1]=()=>s.value=!1)})):(openBlock(),createElementBlock("div",_hoisted_2$3,[createBaseVNode("div",null,[W[5]||(W[5]=createBaseVNode("div",{class:"mb-1 text-sm font-semibold"}," 选择操作 ",-1)),createVNode(unref(_sfc_main$1h),{modelValue:unref(E),"onUpdate:modelValue":W[2]||(W[2]=Z=>isRef(E)?E.value=Z:null)},{default:withCtx(()=>[createVNode(unref(_sfc_main$1c),{class:"w-full"},{default:withCtx(()=>[createVNode(unref(_sfc_main$1b),{placeholder:"请选择要执行的操作"})]),_:1}),createVNode(unref(_sfc_main$1a),null,{default:withCtx(()=>[createVNode(unref(_sfc_main$1g),null,{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(T,Z=>createVNode(unref(_sfc_main$1f),{key:Z.value,value:Z.value},{default:withCtx(()=>[createTextVNode(toDisplayString(Z.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1})]),_:1},8,["modelValue"])]),createBaseVNode("div",null,[W[6]||(W[6]=createBaseVNode("div",{class:"mb-1 text-sm font-semibold"}," 原文 ",-1)),createBaseVNode("div",_hoisted_3$3,toDisplayString(unref(m)),1)]),unref(E)==="custom"?(openBlock(),createElementBlock("div",_hoisted_4$3,[W[7]||(W[7]=createBaseVNode("div",{class:"mb-1 text-sm font-semibold"}," 自定义提示词(可选) ",-1)),createBaseVNode("div",_hoisted_5$2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(p),(Z,le)=>(openBlock(),createElementBlock("div",{key:le,class:"text-muted-foreground bg-muted flex items-center gap-1 rounded-full px-2 py-1 text-sm"},[createBaseVNode("span",null,toDisplayString(Z),1),createBaseVNode("button",{class:"hover:bg-muted/60 h-4 w-4 flex items-center justify-center rounded-full",onClick:ge=>te(le)},[createVNode(unref(X),{class:"h-3 w-3"})],8,_hoisted_6$2)]))),128)),createBaseVNode("input",{class:"min-w-[100px] flex-1 bg-transparent py-1 text-sm focus:outline-hidden",placeholder:"输入提示词后按回车",onKeydown:withKeys(Y,["enter"])},null,32)])])):createCommentVNode("",!0),unref(S)?(openBlock(),createElementBlock("div",_hoisted_7$1,toDisplayString(unref(S)),1)):createCommentVNode("",!0),unref(i)?(openBlock(),createElementBlock("div",_hoisted_8,[W[8]||(W[8]=createBaseVNode("div",{class:"mb-1 text-sm font-semibold"}," 处理结果 ",-1)),createBaseVNode("div",{ref_key:"resultContainer",ref:w,class:"custom-scroll border-border bg-background max-h-40 min-h-[60px] overflow-y-auto whitespace-pre-line border rounded px-3 py-2 text-sm"},toDisplayString(unref(i)),513)])):createCommentVNode("",!0)])),unref(s)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_9,[unref(d)?(openBlock(),createBlock(unref(_sfc_main$1K),{key:0,variant:"secondary",onClick:q},{default:withCtx(()=>[createVNode(unref(Pause),{class:"mr-1 h-4 w-4"}),W[9]||(W[9]=createTextVNode(" 终止 ",-1))]),_:1})):createCommentVNode("",!0),unref(g)&&!unref(d)?(openBlock(),createBlock(unref(_sfc_main$1K),{key:1,variant:"default",onClick:z},{default:withCtx(()=>[...W[10]||(W[10]=[createTextVNode(" 接受 ",-1)])]),_:1})):createCommentVNode("",!0),unref(d)?createCommentVNode("",!0):(openBlock(),createBlock(unref(_sfc_main$1K),{key:2,variant:"outline",disabled:!unref(g)&&!!unref(i),onClick:ae},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(g)?"重试":"AI 处理"),1)]),_:1},8,["disabled"]))]))]),_:1})]),_:1},8,["open"])}}}),AIPolishPopover=_export_sfc(_sfc_main$6,[["__scopeId","data-v-7616f84b"]]),_hoisted_1$3={key:0,class:"editor-ai-toolbar absolute top-1/2 -translate-y-1/2 right-0 z-30 transition-all duration-300 ease-out"},_hoisted_2$2={key:1,class:"bg-white/95 dark:bg-gray-900/95 backdrop-blur-lg border-l border-gray-200/50 dark:border-gray-700/50 shadow-lg overflow-hidden transition-all duration-300 w-12 rounded-l-md",style:{height:"auto"}},_hoisted_3$2={class:"flex flex-col py-2 gap-2"},_hoisted_4$2={class:"flex flex-col items-center gap-1 px-1"},_hoisted_5$1={class:"flex flex-col items-center gap-1 px-1"},_hoisted_6$1={key:0,class:"mx-1.5"},_hoisted_7={key:1,class:"flex flex-col items-center gap-1 px-1"},_sfc_main$5=defineComponent({__name:"SidebarAIToolbar",props:{isMobile:{type:Boolean},showEditor:{type:Boolean}},setup(t){const e=useDisplayStore(),{aiDialogVisible:o,aiImageDialogVisible:a}=storeToRefs(e),{toggleAIDialog:n,toggleAIImageDialog:s}=e,l=useStore(),{editor:i}=storeToRefs(l),d=ref(!1),f=ref(!1);function p(){try{if(!i.value)return"";const u=i.value.state.selection.main;return i.value.state.doc.sliceString(u.from,u.to).trim()}catch{return""}}const g=computed(()=>!i.value||!d.value?!1:p().length>0),E=computed(()=>f.value?p():"");function m(){d.value=!d.value}function S(){n(!0)}function _(){s(!0)}function w(){f.value=!0}return onMounted(()=>{const u=C=>{if(!d.value)return;const x=C.target;if(!x)return;const b=document.querySelector(".editor-ai-toolbar");if(b&&b.contains(x))return;["dialog",".popover",".modal",'[role="dialog"]',"nav",".menu",".dropdown",".tooltip",".floating",".ai-assistant-panel",".ai-image-generator-panel"].some($=>x.closest($))||(console.log(`Interaction outside excluded areas, collapsing toolbar. Event type: ${C.type}`),d.value=!1)};document.addEventListener("click",u,!0),document.addEventListener("touchstart",u,!0),onUnmounted(()=>{document.removeEventListener("click",u,!0),document.removeEventListener("touchstart",u,!0)})}),(u,C)=>!t.isMobile||t.isMobile&&t.showEditor?(openBlock(),createElementBlock("div",_hoisted_1$3,[unref(d)?(openBlock(),createElementBlock("div",_hoisted_2$2,[createBaseVNode("div",_hoisted_3$2,[createBaseVNode("div",_hoisted_4$2,[createBaseVNode("button",{class:"group relative w-7 h-7 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 hover:from-blue-600 hover:to-blue-700 text-white shadow-md hover:shadow-lg transform hover:scale-105 active:scale-95 transition-all duration-200 flex items-center justify-center",title:"AI助手",onClick:S},[createVNode(unref(Bot),{class:"h-4 w-4"})]),C[3]||(C[3]=createBaseVNode("span",{class:"text-[9px] text-gray-500 dark:text-gray-400 font-medium text-center leading-tight"}," 助手 ",-1))]),C[7]||(C[7]=createBaseVNode("div",{class:"mx-1.5"},[createBaseVNode("div",{class:"h-px bg-gray-200/50 dark:bg-gray-700/50"})],-1)),createBaseVNode("div",_hoisted_5$1,[createBaseVNode("button",{class:"group relative w-7 h-7 rounded-lg bg-gradient-to-br from-purple-500 to-purple-600 hover:from-purple-600 hover:to-purple-700 text-white shadow-md hover:shadow-lg transform hover:scale-105 active:scale-95 transition-all duration-200 flex items-center justify-center",title:"AI文生图",onClick:_},[createVNode(unref(Image),{class:"h-4 w-4"})]),C[4]||(C[4]=createBaseVNode("span",{class:"text-[9px] text-gray-500 dark:text-gray-400 font-medium text-center leading-tight"}," 文生图 ",-1))]),unref(g)&&unref(d)?(openBlock(),createElementBlock("div",_hoisted_6$1,[...C[5]||(C[5]=[createBaseVNode("div",{class:"h-px bg-gray-200/50 dark:bg-gray-700/50"},null,-1)])])):createCommentVNode("",!0),unref(g)&&unref(d)?(openBlock(),createElementBlock("div",_hoisted_7,[createBaseVNode("button",{class:"group relative w-7 h-7 rounded-lg bg-gradient-to-br from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 text-white shadow-md hover:shadow-lg transform hover:scale-105 active:scale-95 transition-all duration-200 flex items-center justify-center",title:"AI工具箱",onClick:w},[createVNode(unref(WandSparkles),{class:"h-4 w-4"})]),C[6]||(C[6]=createBaseVNode("span",{class:"text-[9px] text-gray-500 dark:text-gray-400 font-medium text-center leading-tight"}," 工具箱 ",-1))])):createCommentVNode("",!0)])])):(openBlock(),createElementBlock("div",{key:0,class:"w-5 h-16 bg-gradient-to-b from-blue-500/90 to-purple-500/90 hover:from-blue-600/95 hover:to-purple-600/95 dark:from-blue-400/90 dark:to-purple-400/90 dark:hover:from-blue-500/95 dark:hover:to-purple-500/95 backdrop-blur-lg border-l border-y border-blue-300/50 dark:border-blue-600/50 cursor-pointer transition-all duration-200 flex items-center justify-center rounded-l-lg shadow-lg group",title:"展开AI工具栏",onClick:m},[createVNode(unref(Settings2),{class:"h-4 w-4 text-white drop-shadow-sm group-hover:scale-110 transition-transform duration-200"})])),createVNode(AIAssistantPanel,{open:unref(o),"onUpdate:open":C[0]||(C[0]=x=>isRef(o)?o.value=x:null)},null,8,["open"]),createVNode(AIImageGeneratorPanel,{open:unref(a),"onUpdate:open":C[1]||(C[1]=x=>isRef(a)?a.value=x:null)},null,8,["open"]),createVNode(unref(AIPolishPopover),{open:unref(f),"onUpdate:open":C[2]||(C[2]=x=>isRef(f)?f.value=x:null),"selected-text":unref(E),"is-mobile":t.isMobile},null,8,["open","selected-text","is-mobile"])])):createCommentVNode("",!0)}}),SidebarAIToolbar=_export_sfc(_sfc_main$5,[["__scopeId","data-v-f8d7954a"]]),_hoisted_1$2={key:0,class:"bg-border z-10 h-4 w-3 flex items-center justify-center border rounded-sm"},_sfc_main$4=defineComponent({__name:"ResizableHandle",props:{id:{},hitAreaMargins:{},tabindex:{},disabled:{type:Boolean},nonce:{},asChild:{type:Boolean},as:{},class:{},withHandle:{type:Boolean}},emits:["dragging"],setup(t,{emit:e}){const o=t,a=e,n=reactiveOmit(o,"class"),s=useForwardPropsEmits(n,a);return(l,i)=>(openBlock(),createBlock(unref(SplitterResizeHandle_default),mergeProps(unref(s),{class:unref(cn)("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:-translate-y-1/2 data-[orientation=vertical]:after:translate-x-0 [&[data-orientation=vertical]>div]:rotate-90",o.class)}),{default:withCtx(()=>[o.withHandle?(openBlock(),createElementBlock("div",_hoisted_1$2,[createVNode(unref(GripVertical),{class:"h-2.5 w-2.5"})])):createCommentVNode("",!0)]),_:1},16,["class"]))}}),_sfc_main$3=defineComponent({__name:"ResizablePanelGroup",props:{id:{},autoSaveId:{},direction:{},keyboardResizeBy:{},storage:{},asChild:{type:Boolean},as:{},class:{}},emits:["layout"],setup(t,{emit:e}){const o=t,a=e,n=reactiveOmit(o,"class"),s=useForwardPropsEmits(n,a);return(l,i)=>(openBlock(),createBlock(unref(SplitterGroup_default),mergeProps(unref(s),{class:unref(cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",o.class)}),{default:withCtx(()=>[renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),_hoisted_1$1={class:"flex flex-col gap-0.5"},_hoisted_2$1={class:"flex items-center gap-1"},_hoisted_3$1={class:"w-10 select-none text-center text-xs"},_hoisted_4$1={key:0,class:"flex items-center gap-1"},_sfc_main$2=defineComponent({__name:"SearchTab",props:{editorView:{}},setup(t,{expose:e}){const o=t,a=ref(!1),n=ref(null),s=ref(""),l=ref(0),i=ref(!1),d=ref(""),f=ref([]),p=computed(()=>f.value.length),g=computed(()=>te()?f.value[l.value]:null),E=StateEffect.define(),m=StateField.define({create(){return Decoration.none},update(V,ae){for(const q of ae.effects)if(q.is(E))return q.value;return V},provide:V=>EditorView.decorations.from(V)});onMounted(()=>{o.editorView.state.field(m,!1)||o.editorView.dispatch({effects:StateEffect.appendConfig.of(m)})}),watch(s,()=>{useDebounceFn(()=>{f.value=[],s.value===""?S():(l.value=0,w())},300)()}),watch([l,f],()=>{_()}),watch(a,async()=>{a.value?(_(),await nextTick(),n.value?.focus(),n.value?.select()):S()});function S(){o.editorView.dispatch({effects:E.of(Decoration.none)})}function _(){const V=[];f.value.forEach((q,z)=>{const G=q[0],N=q[1],K=o.editorView.state.doc.line(G.line+1),W=o.editorView.state.doc.line(N.line+1),de=K.from+G.ch,Z=W.from+N.ch,le=z===l.value,ge=Decoration.mark({class:le?"cm-searchMatch-selected":"cm-searchMatch"});V.push(ge.range(de,Z))});const ae=Decoration.set(V,!0);if(o.editorView.dispatch({effects:E.of(ae)}),f.value[l.value]?.[0]){const q=f.value[l.value][0],G=o.editorView.state.doc.line(q.line+1).from+q.ch;o.editorView.dispatch({selection:{anchor:G,head:G},scrollIntoView:!0})}}function w(){if(!s.value||!a.value)return;const V=o.editorView.state.doc.toString(),ae=s.value,q=[];ae&&V.split(`
615
- `).forEach((G,N)=>{let K=0,W=G.toLowerCase().indexOf(ae.toLowerCase(),K);for(;W!==-1;)q.push([{line:N,ch:W},{line:N,ch:W+ae.length}]),K=W+1,W=G.toLowerCase().indexOf(ae.toLowerCase(),K)}),f.value=q,f.value.length>0&&l.value>=f.value.length&&(l.value=f.value.length-1)}function u(){te()&&(l.value=(l.value+1)%p.value)}function C(){te()&&(l.value=(l.value-1+p.value)%p.value)}function x(){i.value=!i.value}function b(){a.value=!1}function v(V){switch(V.key){case"Enter":u(),V.preventDefault()}}function y(V){switch(V.key){case"Enter":$(),V.preventDefault()}}function $(){if(!te()||!g.value)return;const V=g.value[0],ae=g.value[1],q=o.editorView.state.doc.line(V.line+1),z=o.editorView.state.doc.line(ae.line+1),G=q.from+V.ch,N=z.from+ae.ch;o.editorView.dispatch({changes:{from:G,to:N,insert:d.value},selection:{anchor:G+d.value.length}}),w()}function T(){if(!te()||!g.value)return;const ae=[...f.value].sort((q,z)=>q[0].line!==z[0].line?z[0].line-q[0].line:z[0].ch-q[0].ch).map(q=>{const z=q[0],G=q[1],N=o.editorView.state.doc.line(z.line+1),K=o.editorView.state.doc.line(G.line+1),W=N.from+z.ch,de=K.from+G.ch;return{from:W,to:de,insert:d.value}});o.editorView.dispatch({changes:ae}),w()}function Y(V){s.value=V,a.value?nextTick(()=>{n.value?.focus(),n.value?.select()}):a.value=!0}onUnmounted(()=>{S()});function te(){return p.value>0}return e({showSearchTab:a,searchWord:s,setSearchWord:Y}),(V,ae)=>{const q=_sfc_main$1K,z=_sfc_main$1x;return openBlock(),createBlock(Transition,{name:"slide-down"},{default:withCtx(()=>[unref(a)?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["bg-background absolute right-0 top-0 z-50 min-w-[300px] w-fit flex gap-1 border rounded-lg px-2 py-1 shadow-md transition-all",unref(i)?"items-start":"items-center"])},[createVNode(q,{variant:"ghost",title:"切换替换","aria-label":"切换替换",class:"h-7 w-5 flex items-center justify-center p-0",onClick:x},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(i)?unref(ChevronDown):unref(ChevronRight)),{class:"h-3.5 w-3.5"}))]),_:1}),createBaseVNode("div",_hoisted_1$1,[createBaseVNode("div",_hoisted_2$1,[createVNode(z,{ref_key:"searchInputRef",ref:n,modelValue:unref(s),"onUpdate:modelValue":ae[0]||(ae[0]=G=>isRef(s)?s.value=G:null),placeholder:"查找",class:"h-7 w-40 text-sm",onKeydown:v},null,8,["modelValue"]),createBaseVNode("span",_hoisted_3$1,toDisplayString(unref(p)?unref(l)+1:0)+"/"+toDisplayString(unref(p)),1),createVNode(q,{variant:"ghost",size:"xs",title:"上一处","aria-label":"上一处",class:"h-6 w-6 p-0",onClick:C},{default:withCtx(()=>[createVNode(unref(ChevronUp),{class:"h-3 w-3"})]),_:1}),createVNode(q,{variant:"ghost",size:"xs",title:"下一处","aria-label":"下一处",class:"h-6 w-6 p-0",onClick:u},{default:withCtx(()=>[createVNode(unref(ChevronDown),{class:"h-3 w-3"})]),_:1}),createVNode(q,{variant:"ghost",size:"xs",title:"关闭","aria-label":"关闭",class:"h-6 w-6 p-0",onClick:b},{default:withCtx(()=>[createVNode(unref(X),{class:"h-3 w-3"})]),_:1})]),unref(i)?(openBlock(),createElementBlock("div",_hoisted_4$1,[createVNode(z,{modelValue:unref(d),"onUpdate:modelValue":ae[1]||(ae[1]=G=>isRef(d)?d.value=G:null),placeholder:"替换",class:"h-7 w-40 text-sm",onKeydown:y},null,8,["modelValue"]),createVNode(q,{variant:"ghost",size:"xs",title:"替换","aria-label":"替换",class:"h-6 w-6 p-0",onClick:$},{default:withCtx(()=>[createVNode(unref(Replace),{class:"h-3 w-3"})]),_:1}),createVNode(q,{variant:"ghost",size:"xs",title:"全部替换","aria-label":"全部替换",class:"h-6 w-6 p-0",onClick:T},{default:withCtx(()=>[createVNode(unref(ReplaceAll),{class:"h-3 w-3"})]),_:1})])):createCommentVNode("",!0)])],2)):createCommentVNode("",!0)]),_:1})}}}),SearchTab=_export_sfc(_sfc_main$2,[["__scopeId","data-v-8222ccb5"]]);function getConfig(t,e){if(t){const n=e==="github"?githubConfig:giteeConfig,{username:s,repoList:l,branch:i,accessTokenList:d}=n,f=Math.floor(Math.random()*d.length),p=d[f].replace("doocsmd",""),g=Math.floor(Math.random()*l.length),E=l[g];return{username:s,repo:E,branch:i,accessToken:p}}const o=JSON.parse(localStorage.getItem(`${e}Config`)),a=o.repo.replace(`https://${e}.com/`,"").replace(`http://${e}.com/`,"").replace(`${e}.com/`,"").split("/");return{username:a[0],repo:a[1],branch:o.branch||"master",accessToken:o.accessToken}}function getDir(){const t=new Date,e=t.getFullYear(),o=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return`${e}/${o}/${a}`}function getDateFilename(t){const e=new Date().getTime(),o=t.split(".").pop();return`${e}-${v4()}.${o}`}async function ghFileUpload(t,e){const o=localStorage.getItem("imgHost")==="default",{username:a,repo:n,branch:s,accessToken:l}=getConfig(o,"github"),i=getDir(),d=`https://api.github.com/repos/${a}/${n}/contents/${i}/`,f=getDateFilename(e),p=await service({url:d+f,method:"put",headers:{Authorization:`token ${l}`},data:{content:t,branch:s,message:`Upload by ${window.location.href}`}}),g=`raw.githubusercontent.com/${a}/${n}/${s}/`,E=`fastly.jsdelivr.net/gh/${a}/${n}@${s}/`;return p.content=p.data?.content||p.content,o?p.content.download_url.replace(g,E):p.content.download_url}async function giteeUpload(t,e){const o=localStorage.getItem("imgHost")==="default",{username:a,repo:n,branch:s,accessToken:l}=getConfig(o,"gitee"),i=getDir(),d=getDateFilename(e),f=`https://gitee.com/api/v5/repos/${a}/${n}/contents/${i}/${d}`,p=await service({url:f,method:"POST",data:{content:t,branch:s,access_token:l,message:`Upload by ${window.location.href}`}});return p.content=p.data?.content||p.content,encodeURI(p.content.download_url)}function getQiniuToken(t,e,o){const a=JSON.stringify(o),n=base64encode(utf16to8(a)),l=CryptoJS.HmacSHA1(n,e).toString(CryptoJS.enc.Base64);return`${t}:${safe64(l)}:${n}`}async function qiniuUpload(t){const{accessKey:e,secretKey:o,bucket:a,region:n,path:s,domain:l}=JSON.parse(localStorage.getItem("qiniuConfig")),i=getQiniuToken(e,o,{scope:a,deadline:Math.trunc(new Date().getTime()/1e3)+3600}),f=(s?`${s}/`:"")+getDateFilename(t.name),p=upload(t,f,i,{},{region:n});return new Promise((g,E)=>{p.subscribe({next:m=>{console.log(m)},error:m=>{E(m.message)},complete:m=>{g(`${l}/${m.key}`)}})})}async function aliOSSFileUpload(t){const e=getDateFilename(t.name),{region:o,bucket:a,accessKeyId:n,accessKeySecret:s,useSSL:l,cdnHost:i,path:d}=JSON.parse(localStorage.getItem("aliOSSConfig")),f=d?`${d}/${e}`:e,p=l===void 0||l,g=p?"https":"http",E=new OSS({region:o,bucket:a,accessKeyId:n,accessKeySecret:s,secure:p});try{return await E.put(f,t),i?`${i}/${f}`:`${g}://${a}.${o}.aliyuncs.com/${f}`}catch(m){return Promise.reject(m)}}async function txCOSFileUpload(t){const e=getDateFilename(t.name),{secretId:o,secretKey:a,bucket:n,region:s,path:l,cdnHost:i}=JSON.parse(localStorage.getItem("txCOSConfig")),d=new COS({SecretId:o,SecretKey:a});return new Promise((f,p)=>{d.putObject({Bucket:n,Region:s,Key:`${l}/${e}`,Body:t},(g,E)=>{g?p(g):f(i?l===""?`${i}/${e}`:`${i}/${l}/${e}`:`https://${E.Location}`)})})}async function minioFileUpload(t){const e=getDateFilename(t.name),{endpoint:o,port:a,useSSL:n,bucket:s,accessKey:l,secretKey:i}=JSON.parse(localStorage.getItem("minioConfig")),d=new S3Client({endpoint:`${n?"https":"http"}://${o}${a?`:${a}`:""}`,credentials:{accessKeyId:l,secretAccessKey:i},region:"auto",forcePathStyle:!0}),f=new PutObjectCommand({Bucket:s,Key:e,ContentType:t.type}),p=await getSignedUrl(d,f,{expiresIn:300});return await service(p,{method:"PUT",headers:{"Content-Type":t.type},data:t}).catch(g=>{console.log(g)}),`${n?"https":"http"}://${o}${a?`:${a}`:""}/${s}/${e}`}async function getMpToken(t,e,o){const a=localStorage.getItem(`mpToken:${t}`);if(a){const i=JSON.parse(a);if(i.expire&&i.expire>new Date().getTime())return i.access_token}const n={method:"POST",data:{grant_type:"client_credential",appid:t,secret:e}};let s="https://api.weixin.qq.com/cgi-bin/stable_token";o&&(s=`${o}/cgi-bin/stable_token`);const l=await service(s,n);if(l.access_token){const i={...l,expire:new Date().getTime()+l.expires_in*1e3};return localStorage.setItem(`mpToken:${t}`,JSON.stringify(i)),l.access_token}return""}async function mpFileUpload(t){let{appID:e,appsecret:o,proxyOrigin:a}=JSON.parse(localStorage.getItem("mpConfig"));const n=await getMpToken(e,o,a);if(!n)throw new Error("获取 access_token 失败");const s=new FormData;s.append("media",t,t.name);const l={method:"POST",data:s};let i=`https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=${n}&type=image`;const d=t.size/(1024*1024),f=t.type.toLowerCase();d<1&&(f==="image/jpeg"||f==="image/png")&&(i=`https://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token=${n}`),a&&(i=i.replace("https://api.weixin.qq.com",a));const p=await service(i,l);if(!p.url)throw new Error("上传失败,未获取到URL");let g=p.url;return a&&window.location.href.startsWith("http")&&(g=`https://wsrv.nl?url=${encodeURIComponent(g)}`),g}async function r2Upload(t){const{accountId:e,accessKey:o,secretKey:a,bucket:n,path:s,domain:l}=JSON.parse(localStorage.getItem("r2Config")),d=(s?`${s}/`:"")+getDateFilename(t.name),f=new S3Client({region:"auto",endpoint:`https://${e}.r2.cloudflarestorage.com`,credentials:{accessKeyId:o,secretAccessKey:a}}),p=await getSignedUrl(f,new PutObjectCommand({Bucket:n,Key:d,ContentType:t.type}),{expiresIn:300});return await service(p,{method:"PUT",headers:{"Content-Type":t.type},data:t}).catch(g=>{console.log(g)}),`${l}/${d}`}async function upyunUpload(t){const{bucket:e,operator:o,password:a,path:n,domain:s}=JSON.parse(localStorage.getItem("upyunConfig")),l=`${n}/${getDateFilename(t.name)}`,i=`/${e}/${l}`,d=await t.arrayBuffer(),f=new Date().toUTCString(),g=["PUT",i,f].join("&"),E=CryptoJS.MD5(a).toString(),m=CryptoJS.HmacSHA1(g,E).toString(CryptoJS.enc.Base64),S=`UPYUN ${o}:${m}`,_=`https://v0.api.upyun.com${i}`,w=await window.fetch(_,{method:"PUT",headers:{Authorization:S,"X-Date":f,"Content-Type":t.type},body:d});if(!w.ok)throw new Error(`上传失败: ${await w.text()}`);return`${s}/${l}`}async function telegramUpload(t){const{token:e,chatId:o}=JSON.parse(localStorage.getItem("telegramConfig")),a=new FormData;a.append("chat_id",o),a.append("photo",t,t.name);const n=await service({url:`https://api.telegram.org/bot${e}/sendPhoto`,method:"POST",data:a});if(!n.ok||!n.result.photo.length)throw new Error("Telegram sendPhoto 失败");const s=n.result.photo[n.result.photo.length-1].file_id,l=await service({url:`https://api.telegram.org/bot${e}/getFile?file_id=${s}`,method:"GET"});if(!l.ok)throw new Error("Telegram getFile 失败");const i=l.result.file_path;return`https://api.telegram.org/file/bot${e}/${i}`}async function cloudinaryUpload(t){const{cloudName:e,apiKey:o,apiSecret:a,uploadPreset:n,folder:s="",domain:l}=JSON.parse(localStorage.getItem("cloudinaryConfig"));if(!e||!o)throw new Error("Cloudinary 配置缺少 cloudName / apiKey");const i=Math.floor(Date.now()/1e3),d=new FormData;if(d.append("file",t),d.append("api_key",o),d.append("timestamp",`${i}`),a){const E=[];s&&E.push(`folder=${s}`),n&&E.push(`upload_preset=${n}`),E.push(`timestamp=${i}`);const m=E.sort().join("&"),S=CryptoJS.SHA1(m+a).toString();d.append("signature",S)}else if(n)d.append("upload_preset",n);else throw new Error("未配置 apiSecret 时必须提供 uploadPreset");s&&d.append("folder",s);const f=`https://api.cloudinary.com/v1_1/${e}/image/upload`,p=await service(f,{method:"POST",data:d}),g=p.secure_url||p.url;if(!g)throw new Error("Cloudinary 返回缺少 url 字段");if(l){const{pathname:E,search:m}=new URL(g);return`${l}${E}${m}`}return g}async function formCustomUpload(content,file){const str=`
616
- async (CUSTOM_ARG) => {
617
- ${localStorage.getItem("formCustomConfig")}
618
- }
619
- `;return new Promise((resolve,reject)=>{const exportObj={content,file,util:{axios:service,CryptoJS,OSS,COS,Buffer,uuidv4:v4,qiniu,tokenTools,getDir,getDateFilename},okCb:resolve,errCb:reject};eval(str)(exportObj).catch(t=>{console.error(t),reject(t)})})}function fileUpload(t,e){const o=localStorage.getItem("imgHost");switch(o||localStorage.setItem("imgHost","default"),o){case"aliOSS":return aliOSSFileUpload(e);case"minio":return minioFileUpload(e);case"txCOS":return txCOSFileUpload(e);case"qiniu":return qiniuUpload(e);case"gitee":return giteeUpload(t,e.name);case"github":return ghFileUpload(t,e.name);case"mp":return mpFileUpload(e);case"r2":return r2Upload(e);case"upyun":return upyunUpload(e);case"telegram":return telegramUpload(e);case"cloudinary":return cloudinaryUpload(e);case"formCustom":return formCustomUpload(t,e);default:return ghFileUpload(t,e.name)}}const _hoisted_1={class:"container flex flex-col"},_hoisted_2={class:"container-main flex flex-1 flex-col"},_hoisted_3={class:"container-main-section border-radius-10 relative flex flex-1 overflow-hidden border"},_hoisted_4=["innerHTML"],_hoisted_5={key:0,class:"loading-mask"},_hoisted_6={key:0,class:"fixed bottom-16 right-6 z-50 flex flex-col gap-2"},_sfc_main$1=defineComponent({__name:"CodemirrorEditor",setup(t){const e=useStore(),o=useDisplayStore(),{isDark:a,output:n,editor:s}=storeToRefs(e),{editorRefresh:l}=e,{toggleShowUploadImgDialog:i}=o,d=ref(!1),f=ref(!1);function p(){return document.querySelector(".cm-scroller")||document.querySelector(".CodeMirror-scroll")}function g(){d.value=!0,f.value=!0}function E(){d.value=!1,setTimeout(()=>{f.value=!1},800)}const m=ref(!0);function S(){m.value=!m.value}const _=useTemplateRef("previewRef"),w=ref(),u=ref(null),C=new Compartment;function x(){const P=ne=>{let J,ee;if(clearTimeout(w.value),ne==="preview"){if(J=_.value,ee=p(),!ee){console.warn("Cannot find CodeMirror scroll container");return}const se=p();se&&(se.removeEventListener("scroll",H),w.value=setTimeout(()=>{se.addEventListener("scroll",H)},300))}else{if(J=p(),ee=_.value,!J){console.warn("Cannot find CodeMirror scroll container");return}ee.removeEventListener("scroll",M,!1),w.value=setTimeout(()=>{ee.addEventListener("scroll",M,!1)},300)}if(!J||!ee)return;const L=J.scrollHeight-J.offsetHeight,R=ee.scrollHeight-ee.offsetHeight;if(L<=0||R<=0)return;const fe=J.scrollTop/L*R;ee.scrollTo(0,fe)};function H(){P("editor")}function M(){P("preview")}_.value&&_.value.addEventListener("scroll",M,!1);const F=p();F&&F.addEventListener("scroll",H)}onMounted(()=>{setTimeout(()=>{x()},300)});const b=useTemplateRef("searchTabRef"),v=ref(null);function y(P){const H=P.state.selection.main,M=P.state.doc.sliceString(H.from,H.to).trim();b.value?M?b.value.setSearchWord(M):b.value.showSearchTab=!0:v.value={selected:M}}watch(b,P=>{if(P&&v.value){const{selected:H}=v.value;H?P.setSearchWord(H):P.showSearchTab=!0,v.value=null}});function $(P){const H=u.value;P.key==="Escape"&&b.value?.showSearchTab&&(b.value.showSearchTab=!1,P.preventDefault(),H?.focus())}onMounted(()=>{document.addEventListener("keydown",$,{passive:!1,capture:!1})});function T(P){const H=checkImage(P);if(!H.ok)return toast.error(H.msg),!1;const M=localStorage.getItem("imgHost")||"default";localStorage.setItem("imgHost",M);const F=localStorage.getItem(`${M}Config`);return M==="default"||F?!0:(toast.error(`请先配置 ${M} 图床参数`),!1)}function Y(P){if(!P){toast.error("上传图片未知异常");return}setTimeout(()=>{i(!1)},1e3);const H=`![](${P})`;u.value&&u.value.dispatch(u.value.state.replaceSelection(`
620
- ${H}
621
- `)),toast.success("图片上传成功")}const te=ref(!1);async function V(P){return await imageCompression(P,{maxSizeMB:1,maxWidthOrHeight:1920,useWebWorker:!0})}async function ae(P,H,M){try{te.value=!0,localStorage.getItem("useCompression")==="true"&&(P=await V(P));const ne=await toBase64(P),J=await fileUpload(ne,P);if(H?H(J,ne):Y(J),M)return Y(J)}catch(F){toast.error(F.message)}finally{te.value=!1}}async function q({list:P}){return new Promise(H=>{const{path:M,file:F}=P.find(J=>J.path.match(/\.md$/)),ne=new FileReader;ne.readAsText(F,"UTF-8"),ne.onload=J=>{H({str:J.target.result,file:F,path:M})}})}async function z(P){const H=[];let M="";try{const F=[P];for(const ne of F){M+=`${ne.name}/`;for await(const[,J]of ne)J.kind==="file"?H.push({path:M+J.name,file:await J.getFile()}):(H.push({path:`${M+J.name}/`}),F.push(J))}}catch(F){console.error(F)}return H}async function G({md:P,list:H}){const M=[...P.str.matchAll(/!\[(.*?)\]\((.*?)\)/g)||[]].filter(J=>J),F=P.path.match(/.+?\//)[0];(await Promise.all(M.map(J=>new Promise(ee=>{let[,,L]=J;L=L.replace(/^.\//,"");const{file:R}=H.find(oe=>oe.path===`${F}${L}`)||{};ae(R,oe=>ee({matchStr:L,url:oe}))})))).forEach(J=>{P.str=P.str.replace(`](./${J.matchStr})`,`](${J.url})`).replace(`](${J.matchStr})`,`](${J.url})`)}),u.value&&u.value.dispatch({changes:{from:0,to:u.value.state.doc.length,insert:P.str}})}const N=useTemplateRef("codeMirrorWrapper");function K(){const P=N.value;P.ondragover=H=>H.preventDefault(),P.ondrop=async H=>{if(H.preventDefault(),!(H.dataTransfer==null||!Array.isArray(H.dataTransfer.items)))for(const M of H.dataTransfer.items.filter(F=>F.kind==="file"))M.getAsFileSystemHandle().then(async F=>{if(F.kind==="directory"){const ne=await z(F),J=await q({list:ne});G({md:J,list:ne})}else{const ne=await F.getFile();console.log("file",ne),T(ne)&&ae(ne)}})}}const W=ref(),de=useTemplateRef("editorRef"),Z=ref(0);function le(P){const H=EditorState.create({doc:e.posts[e.currentPostIndex].content,extensions:[markdownSetup({onSearch:y}),C.of(theme(a.value)),EditorView.updateListener.of(F=>{if(F.docChanged){const ne=F.state.doc.toString();clearTimeout(W.value),W.value=setTimeout(()=>{l();const J=e.posts[e.currentPostIndex];ne!==J.content&&(J.updateDatetime=new Date,J.content=ne)},300)}})]}),M=new EditorView({state:H,parent:P});return u.value=M,M.dom.addEventListener("paste",async F=>{if(!F.clipboardData?.items||te.value)return;const ne=[...F.clipboardData.items].map(L=>L.getAsFile()).filter(L=>L!=null&&T(L));if(ne.length===0)return;const J=setInterval(()=>{const L=Z.value+1;L>=100||(Z.value=L)},100);for(const L of ne)F.preventDefault(),await ae(L);(()=>{clearInterval(J),Z.value=100,setTimeout(()=>{Z.value=0},1e3)})()}),M}onMounted(()=>{const P=de.value;P!=null&&nextTick(()=>{const H=le(P);s.value=H,l(),K()})}),watch(a,()=>{u.value&&u.value.dispatch({effects:C.reconfigure(theme(a.value))})});const ge=ref();return onMounted(()=>{ge.value=setInterval(()=>{const P=e.posts[e.currentPostIndex];(P.history||[])[0]?.content!==P.content&&(P.history??=[],P.history.unshift({content:P.content,datetime:new Date().toLocaleString("zh-CN")}),P.history.length=Math.min(P.history.length,10))},30*1e3)}),onUnmounted(()=>{clearTimeout(ge.value),clearTimeout(w.value),clearTimeout(W.value),document.removeEventListener("keydown",$)}),(P,H)=>{const M=_sfc_main$1j,F=__unplugin_components_1,ne=__unplugin_components_2,J=_sfc_main$X,ee=_sfc_main$12,L=_sfc_main$13,R=__unplugin_components_6,oe=__unplugin_components_7,fe=_sfc_main$17,se=_sfc_main$1n,re=_sfc_main$1u,ce=_sfc_main$1F,j=_sfc_main$1G,I=_sfc_main$1H,_e=_sfc_main$1I,me=_sfc_main$1J,be=_sfc_main$1L,ke=_sfc_main$1M,xe=_sfc_main$1N,ye=_sfc_main$1O;return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(M,{modelValue:unref(Z),"onUpdate:modelValue":H[0]||(H[0]=Ce=>isRef(Z)?Z.value=Ce:null),class:"absolute left-0 right-0 rounded-none",style:{height:"2px"}},null,8,["modelValue"]),createVNode(F,{onStartCopy:g,onEndCopy:E}),createBaseVNode("main",_hoisted_2,[createBaseVNode("div",_hoisted_3,[createVNode(unref(_sfc_main$3),{direction:"horizontal"},{default:withCtx(()=>[createVNode(unref(SplitterPanel_default),{"default-size":15,"max-size":unref(e).isOpenPostSlider?30:0,"min-size":unref(e).isOpenPostSlider?10:0},{default:withCtx(()=>[createVNode(ne)]),_:1},8,["max-size","min-size"]),createVNode(unref(_sfc_main$4),{class:"hidden md:block"}),createVNode(unref(SplitterPanel_default),{class:"flex"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{ref_key:"codeMirrorWrapper",ref:N,class:normalizeClass(["codeMirror-wrapper relative flex-1",{"order-1 border-l":!unref(e).isEditOnLeft,"border-r":unref(e).isEditOnLeft}])},[unref(u)?(openBlock(),createBlock(unref(SearchTab),{key:0,ref_key:"searchTabRef",ref:b,"editor-view":unref(u)},null,8,["editor-view"])):createCommentVNode("",!0),createVNode(unref(SidebarAIToolbar),{"is-mobile":unref(e).isMobile,"show-editor":unref(m)},null,8,["is-mobile","show-editor"]),createVNode(J,null,{default:withCtx(()=>[createBaseVNode("div",{id:"editor",ref_key:"editorRef",ref:de,class:"codemirror-container"},null,512)]),_:1})],2),[[vShow,!unref(e).isMobile||unref(e).isMobile&&unref(m)]]),withDirectives(createBaseVNode("div",{class:normalizeClass(["relative flex-1 overflow-x-hidden transition-width",[unref(e).isOpenRightSlider?"w-0":"w-100"]])},[createBaseVNode("div",{id:"preview",ref_key:"previewRef",ref:_,class:"preview-wrapper w-full p-5"},[createBaseVNode("div",{id:"output-wrapper",class:normalizeClass(["w-full",{output_night:!unref(d)}])},[createBaseVNode("div",{class:normalizeClass(["preview border-x shadow-xl",[unref(e).isMobile?"w-[100%]":unref(e).previewWidth]])},[createBaseVNode("section",{id:"output",class:"w-full",innerHTML:unref(n)},null,8,_hoisted_4),unref(f)?(openBlock(),createElementBlock("div",_hoisted_5,[...H[3]||(H[3]=[createBaseVNode("div",{class:"loading-mask-box"},[createBaseVNode("div",{class:"loading__img"}),createBaseVNode("span",null,"正在生成")],-1)])])):createCommentVNode("",!0)],2)],2),createVNode(ee,{target:"preview",right:unref(e).isMobile?24:20,bottom:unref(e).isMobile?90:20},null,8,["right","bottom"])],512),createVNode(L)],2),[[vShow,!unref(e).isMobile||unref(e).isMobile&&!unref(m)]]),createVNode(R),createVNode(oe)]),_:1})]),_:1})]),unref(e).isMobile?(openBlock(),createElementBlock("div",_hoisted_6,[createBaseVNode("button",{class:"bg-primary flex items-center justify-center rounded-full p-3 text-white shadow-lg transition active:scale-95 hover:scale-105 dark:bg-gray-700 dark:text-white dark:ring-2 dark:ring-white/30","aria-label":"切换编辑/预览",onClick:S},[(openBlock(),createBlock(resolveDynamicComponent(unref(m)?unref(Eye):unref(Pen)),{class:"h-5 w-5"}))])])):createCommentVNode("",!0),createVNode(fe,{onUploadImage:ae}),createVNode(se),createVNode(re),createVNode(xe,{open:unref(e).isOpenConfirmDialog,"onUpdate:open":H[2]||(H[2]=Ce=>unref(e).isOpenConfirmDialog=Ce)},{default:withCtx(()=>[createVNode(ke,null,{default:withCtx(()=>[createVNode(I,null,{default:withCtx(()=>[createVNode(ce,null,{default:withCtx(()=>[...H[4]||(H[4]=[createTextVNode("提示",-1)])]),_:1}),createVNode(j,null,{default:withCtx(()=>[...H[5]||(H[5]=[createTextVNode(" 此操作将丢失本地自定义样式,是否继续? ",-1)])]),_:1})]),_:1}),createVNode(be,null,{default:withCtx(()=>[createVNode(_e,null,{default:withCtx(()=>[...H[6]||(H[6]=[createTextVNode("取消",-1)])]),_:1}),createVNode(me,{onClick:H[1]||(H[1]=Ce=>unref(e).resetStyle())},{default:withCtx(()=>[...H[7]||(H[7]=[createTextVNode(" 确认 ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])]),createVNode(ye)])}}}),CodemirrorEditor=_export_sfc(_sfc_main$1,[["__scopeId","data-v-f0af46bb"]]),_sfc_main=defineComponent({__name:"App",setup(t){const e=useStore();return(o,a)=>{const n=__unplugin_components_0$1;return openBlock(),createElementBlock(Fragment,null,[createVNode(n),createVNode(CodemirrorEditor),createVNode(unref(_sfc_main$1P),{"rich-colors":"",position:"top-center",theme:unref(e).isDark?"dark":"light"},null,8,["theme"])],64)}}});class MpCommonProfile extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const e=this.dataset.nickname||"",o=this.dataset.headimg||"",a=this.dataset.signature||"",n=this.dataset.service_type||"1",s=this.dataset.verify_status||"0";this.shadowRoot.innerHTML=`
622
- <style>
623
- :host {
624
- all: initial;
625
- -webkit-text-size-adjust: inherit;
626
-
627
- }
628
- </style>
629
- <style>@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.8);--weui-FG-0_5:hsla(0,0%,100%,0.6);--weui-FG-1:hsla(0,0%,100%,0.5);--weui-FG-2:hsla(0,0%,100%,0.3);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.8);--weui-GLYPH-1:hsla(0,0%,100%,0.5);--weui-GLYPH-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.8);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.5);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:rgba(95,95,95,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.1);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.6);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5);--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG:#fff;--weui-BG:#000;--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6)}}@media (prefers-color-scheme:dark){.wx-root[data-weui-mode=care]:not([data-weui-theme=light]),body[data-weui-mode=care]:not([data-weui-theme=light]){--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.85);--weui-FG-0_5:hsla(0,0%,100%,0.65);--weui-FG-1:hsla(0,0%,100%,0.55);--weui-FG-2:hsla(0,0%,100%,0.35);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.85);--weui-GLYPH-1:hsla(0,0%,100%,0.55);--weui-GLYPH-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.85);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.55);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:hsla(0,0%,96.1%,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.15);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.65);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-FG:#fff;--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-BG:#000;--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6);--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5)}}.wx-root,body,page{--weui-BTN-HEIGHT:48;--weui-BTN-HEIGHT-MEDIUM:40;--weui-BTN-HEIGHT-SMALL:32}.wx-root,body{--weui-BTN-ACTIVE-MASK:rgba(0,0,0,0.1)}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-BTN-ACTIVE-MASK:hsla(0,0%,100%,0.1)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BTN-ACTIVE-MASK:hsla(0,0%,100%,0.1)}}.wx-root,body{--weui-BTN-DEFAULT-ACTIVE-BG:#e6e6e6}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-BTN-DEFAULT-ACTIVE-BG:hsla(0,0%,100%,0.126)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BTN-DEFAULT-ACTIVE-BG:hsla(0,0%,100%,0.126)}}.wx-root,body{--weui-DIALOG-LINE-COLOR:rgba(0,0,0,0.1)}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-DIALOG-LINE-COLOR:hsla(0,0%,100%,0.1)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-DIALOG-LINE-COLOR:hsla(0,0%,100%,0.1)}}.weui-flex{display:flex}.weui-flex__item{flex:1}.wx-root,body{--weui-BG-COLOR-ACTIVE:#ececec}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-BG-COLOR-ACTIVE:#373737}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BG-COLOR-ACTIVE:#373737}}[class*=" weui-icon-"][class*=" weui-icon-"],[class*=" weui-icon-"][class^=weui-icon-],[class^=weui-icon-][class*=" weui-icon-"],[class^=weui-icon-][class^=weui-icon-]{display:inline-block;vertical-align:middle;font-size:10px;width:2.4em;height:2.4em;-webkit-mask-position:50% 50%;mask-position:50% 50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor}.weui-icon-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='1000' height='1000' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M500 916.667C269.881 916.667 83.333 730.119 83.333 500 83.333 269.881 269.881 83.333 500 83.333c230.119 0 416.667 186.548 416.667 416.667 0 230.119-186.548 416.667-416.667 416.667zm0-50c202.504 0 366.667-164.163 366.667-366.667 0-202.504-164.163-366.667-366.667-366.667-202.504 0-366.667 164.163-366.667 366.667 0 202.504 164.163 366.667 366.667 366.667z' fill-rule='evenodd' fill-opacity='.9'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='1000' height='1000' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M500 916.667C269.881 916.667 83.333 730.119 83.333 500 83.333 269.881 269.881 83.333 500 83.333c230.119 0 416.667 186.548 416.667 416.667 0 230.119-186.548 416.667-416.667 416.667zm0-50c202.504 0 366.667-164.163 366.667-366.667 0-202.504-164.163-366.667-366.667-366.667-202.504 0-366.667 164.163-366.667 366.667 0 202.504 164.163 366.667 366.667 366.667z' fill-rule='evenodd' fill-opacity='.9'/%3E%3C/svg%3E")}.weui-icon-download{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.25 12.04l-1.72-1.72-1.06 1.06 2.828 2.83a1 1 0 001.414-.001l2.828-2.828-1.06-1.061-1.73 1.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55 0 .999.446.999.996v13.008a.998.998 0 01-.996.996H4.996A.998.998 0 014 21.004V7.996A1 1 0 014.999 7h6.251z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.25 12.04l-1.72-1.72-1.06 1.06 2.828 2.83a1 1 0 001.414-.001l2.828-2.828-1.06-1.061-1.73 1.73V7h-1.5v5.04zm0-5.04V2h1.5v5h6.251c.55 0 .999.446.999.996v13.008a.998.998 0 01-.996.996H4.996A.998.998 0 014 21.004V7.996A1 1 0 014.999 7h6.251z'/%3E%3C/svg%3E")}.weui-icon-info{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.75-12v7h1.5v-7h-1.5zM12 9a1 1 0 100-2 1 1 0 000 2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.75-12v7h1.5v-7h-1.5zM12 9a1 1 0 100-2 1 1 0 000 2z'/%3E%3C/svg%3E")}.weui-icon-safe-success{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cpath d='M500.9 4.6C315.5 46.7 180.4 93.1 57.6 132c0 129.3.2 231.7.2 339.7 0 304.2 248.3 471.6 443.1 523.7C695.7 943.3 944 775.9 944 471.7c0-108 .2-210.4.2-339.7C821.4 93.1 686.3 46.7 500.9 4.6zm248.3 349.1l-299.7 295c-2.1 2-5.3 2-7.4-.1L304.4 506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3 5-2.8 7.2-1l112.2 86c2.3 1.8 6 1.7 8.1-.1l274.7-228.9c2.2-1.8 5.7-1.7 7.7.3l17 16.8c2.2 2.1 2.2 5.3.2 7.4z' fill-rule='evenodd' clip-rule='evenodd' fill='%23070202'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cpath d='M500.9 4.6C315.5 46.7 180.4 93.1 57.6 132c0 129.3.2 231.7.2 339.7 0 304.2 248.3 471.6 443.1 523.7C695.7 943.3 944 775.9 944 471.7c0-108 .2-210.4.2-339.7C821.4 93.1 686.3 46.7 500.9 4.6zm248.3 349.1l-299.7 295c-2.1 2-5.3 2-7.4-.1L304.4 506.1c-2-2.1-2.3-5.7-.6-8l18.3-24.9c1.7-2.3 5-2.8 7.2-1l112.2 86c2.3 1.8 6 1.7 8.1-.1l274.7-228.9c2.2-1.8 5.7-1.7 7.7.3l17 16.8c2.2 2.1 2.2 5.3.2 7.4z' fill-rule='evenodd' clip-rule='evenodd' fill='%23070202'/%3E%3C/svg%3E")}.weui-icon-safe-warn{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cpath d='M500.9 4.5c-185.4 42-320.4 88.4-443.2 127.3 0 129.3.2 231.7.2 339.6 0 304.1 248.2 471.4 443 523.6 194.7-52.2 443-219.5 443-523.6 0-107.9.2-210.3.2-339.6C821.3 92.9 686.2 46.5 500.9 4.5zm-26.1 271.1h52.1c5.8 0 10.3 4.7 10.1 10.4l-11.6 313.8c-.1 2.8-2.5 5.2-5.4 5.2h-38.2c-2.9 0-5.3-2.3-5.4-5.2L464.8 286c-.2-5.8 4.3-10.4 10-10.4zm26.1 448.3c-20.2 0-36.5-16.3-36.5-36.5s16.3-36.5 36.5-36.5 36.5 16.3 36.5 36.5-16.4 36.5-36.5 36.5z' fill-rule='evenodd' clip-rule='evenodd' fill='%23020202'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cpath d='M500.9 4.5c-185.4 42-320.4 88.4-443.2 127.3 0 129.3.2 231.7.2 339.6 0 304.1 248.2 471.4 443 523.6 194.7-52.2 443-219.5 443-523.6 0-107.9.2-210.3.2-339.6C821.3 92.9 686.2 46.5 500.9 4.5zm-26.1 271.1h52.1c5.8 0 10.3 4.7 10.1 10.4l-11.6 313.8c-.1 2.8-2.5 5.2-5.4 5.2h-38.2c-2.9 0-5.3-2.3-5.4-5.2L464.8 286c-.2-5.8 4.3-10.4 10-10.4zm26.1 448.3c-20.2 0-36.5-16.3-36.5-36.5s16.3-36.5 36.5-36.5 36.5 16.3 36.5 36.5-16.4 36.5-36.5 36.5z' fill-rule='evenodd' clip-rule='evenodd' fill='%23020202'/%3E%3C/svg%3E")}.weui-icon-success{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1.177-7.86l-2.765-2.767L7 12.431l3.119 3.121a1 1 0 001.414 0l5.952-5.95-1.062-1.062-5.6 5.6z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1.177-7.86l-2.765-2.767L7 12.431l3.119 3.121a1 1 0 001.414 0l5.952-5.95-1.062-1.062-5.6 5.6z'/%3E%3C/svg%3E")}.weui-icon-success-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zm-1.172-6.242l5.809-5.808.848.849-5.95 5.95a1 1 0 01-1.414 0L7 12.426l.849-.849 2.98 2.98z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zm-1.172-6.242l5.809-5.808.848.849-5.95 5.95a1 1 0 01-1.414 0L7 12.426l.849-.849 2.98 2.98z'/%3E%3C/svg%3E")}.weui-icon-success-no-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.657 18.435L3 12.778l1.414-1.414 4.95 4.95L20.678 5l1.414 1.414-12.02 12.021a1 1 0 01-1.415 0z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.657 18.435L3 12.778l1.414-1.414 4.95 4.95L20.678 5l1.414 1.414-12.02 12.021a1 1 0 01-1.415 0z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-waiting{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.75 11.38V6h-1.5v6l4.243 4.243 1.06-1.06-3.803-3.804zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.75 11.38V6h-1.5v6l4.243 4.243 1.06-1.06-3.803-3.804zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-waiting-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.6 11.503l3.891 3.891-.848.849L11.4 12V6h1.2v5.503zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.6 11.503l3.891 3.891-.848.849L11.4 12V6h1.2v5.503zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6z'/%3E%3C/svg%3E")}.weui-icon-warn{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.763-15.864l.11 7.596h1.305l.11-7.596h-1.525zm.759 10.967c.512 0 .902-.383.902-.882 0-.5-.39-.882-.902-.882a.878.878 0 00-.896.882c0 .499.396.882.896.882z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.763-15.864l.11 7.596h1.305l.11-7.596h-1.525zm.759 10.967c.512 0 .902-.383.902-.882 0-.5-.39-.882-.902-.882a.878.878 0 00-.896.882c0 .499.396.882.896.882z'/%3E%3C/svg%3E")}.weui-icon-outlined-warn{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2 2 6.477 2 12zm18.8 0a8.8 8.8 0 11-17.6 0 8.8 8.8 0 0117.6 0zm-8.14-5.569l-.089 7.06H11.43l-.088-7.06h1.318zm-1.495 9.807c0 .469.366.835.835.835a.82.82 0 00.835-.835.817.817 0 00-.835-.835.821.821 0 00-.835.835z' fill='%23000'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2 2 6.477 2 12zm18.8 0a8.8 8.8 0 11-17.6 0 8.8 8.8 0 0117.6 0zm-8.14-5.569l-.089 7.06H11.43l-.088-7.06h1.318zm-1.495 9.807c0 .469.366.835.835.835a.82.82 0 00.835-.835.817.817 0 00-.835-.835.821.821 0 00-.835.835z' fill='%23000'/%3E%3C/svg%3E")}.weui-icon-info-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zM11.4 10h1.2v7h-1.2v-7zm.6-1a1 1 0 110-2 1 1 0 010 2z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zM11.4 10h1.2v7h-1.2v-7zm.6-1a1 1 0 110-2 1 1 0 010 2z'/%3E%3C/svg%3E")}.weui-icon-cancel{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6z' fill-rule='nonzero'/%3E%3Cpath d='M12.849 12l3.11 3.111-.848.849L12 12.849l-3.111 3.11-.849-.848L11.151 12l-3.11-3.111.848-.849L12 11.151l3.111-3.11.849.848L12.849 12z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6z' fill-rule='nonzero'/%3E%3Cpath d='M12.849 12l3.11 3.111-.848.849L12 12.849l-3.111 3.11-.849-.848L11.151 12l-3.11-3.111.848-.849L12 11.151l3.111-3.11.849.848L12.849 12z'/%3E%3C/g%3E%3C/svg%3E")}.weui-icon-search{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.31 15.561l4.114 4.115-.848.848-4.123-4.123a7 7 0 11.857-.84zM16.8 11a5.8 5.8 0 10-11.6 0 5.8 5.8 0 0011.6 0z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.31 15.561l4.114 4.115-.848.848-4.123-4.123a7 7 0 11.857-.84zM16.8 11a5.8 5.8 0 10-11.6 0 5.8 5.8 0 0011.6 0z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-clear{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.06 12l3.006-3.005-1.06-1.06L12 10.938 8.995 7.934l-1.06 1.06L10.938 12l-3.005 3.005 1.06 1.06L12 13.062l3.005 3.005 1.06-1.06L13.062 12zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.06 12l3.006-3.005-1.06-1.06L12 10.938 8.995 7.934l-1.06 1.06L10.938 12l-3.005 3.005 1.06 1.06L12 13.062l3.005 3.005 1.06-1.06L13.062 12zM12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z'/%3E%3C/svg%3E")}.weui-icon-back{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm1.999-6.563L10.68 12 14 8.562 12.953 7.5 9.29 11.277a1.045 1.045 0 000 1.446l3.663 3.777L14 15.437z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm1.999-6.563L10.68 12 14 8.562 12.953 7.5 9.29 11.277a1.045 1.045 0 000 1.446l3.663 3.777L14 15.437z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-delete{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.774 6.4l.812 13.648a.8.8 0 00.798.752h7.232a.8.8 0 00.798-.752L17.226 6.4H6.774zm11.655 0l-.817 13.719A2 2 0 0115.616 22H8.384a2 2 0 01-1.996-1.881L5.571 6.4H3.5v-.7a.5.5 0 01.5-.5h16a.5.5 0 01.5.5v.7h-2.071zM14 3a.5.5 0 01.5.5v.7h-5v-.7A.5.5 0 0110 3h4zM9.5 9h1.2l.5 9H10l-.5-9zm3.8 0h1.2l-.5 9h-1.2l.5-9z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.774 6.4l.812 13.648a.8.8 0 00.798.752h7.232a.8.8 0 00.798-.752L17.226 6.4H6.774zm11.655 0l-.817 13.719A2 2 0 0115.616 22H8.384a2 2 0 01-1.996-1.881L5.571 6.4H3.5v-.7a.5.5 0 01.5-.5h16a.5.5 0 01.5.5v.7h-2.071zM14 3a.5.5 0 01.5.5v.7h-5v-.7A.5.5 0 0110 3h4zM9.5 9h1.2l.5 9H10l-.5-9zm3.8 0h1.2l-.5 9h-1.2l.5-9z'/%3E%3C/svg%3E")}.weui-icon-success-no-circle-thin{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.864 16.617l-5.303-5.303-1.061 1.06 5.657 5.657a1 1 0 001.414 0L21.238 6.364l-1.06-1.06L8.864 16.616z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.864 16.617l-5.303-5.303-1.061 1.06 5.657 5.657a1 1 0 001.414 0L21.238 6.364l-1.06-1.06L8.864 16.616z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-arrow{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.454 6.58l1.06-1.06 5.78 5.779a.996.996 0 010 1.413l-5.78 5.779-1.06-1.061 5.425-5.425-5.425-5.424z' fill='%23B2B2B2' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.454 6.58l1.06-1.06 5.78 5.779a.996.996 0 010 1.413l-5.78 5.779-1.06-1.061 5.425-5.425-5.425-5.424z' fill='%23B2B2B2' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-arrow-bold{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg height='24' width='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.157 12.711L4.5 18.368l-1.414-1.414 4.95-4.95-4.95-4.95L4.5 5.64l5.657 5.657a1 1 0 010 1.414z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg height='24' width='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.157 12.711L4.5 18.368l-1.414-1.414 4.95-4.95-4.95-4.95L4.5 5.64l5.657 5.657a1 1 0 010 1.414z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-back-arrow{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.343 12l7.071 7.071L9 20.485l-7.778-7.778a1 1 0 010-1.414L9 3.515l1.414 1.414L3.344 12z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.343 12l7.071 7.071L9 20.485l-7.778-7.778a1 1 0 010-1.414L9 3.515l1.414 1.414L3.344 12z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-back-arrow-thin{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 010-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 010-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-close{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12.25 10.693L6.057 4.5 5 5.557l6.193 6.193L5 17.943 6.057 19l6.193-6.193L18.443 19l1.057-1.057-6.193-6.193L19.5 5.557 18.443 4.5l-6.193 6.193z' fill='%23000'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12.25 10.693L6.057 4.5 5 5.557l6.193 6.193L5 17.943 6.057 19l6.193-6.193L18.443 19l1.057-1.057-6.193-6.193L19.5 5.557 18.443 4.5l-6.193 6.193z' fill='%23000'/%3E%3C/svg%3E")}.weui-icon-close-thin{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.25 10.693L6.057 4.5 5 5.557l6.193 6.193L5 17.943 6.057 19l6.193-6.193L18.443 19l1.057-1.057-6.193-6.193L19.5 5.557 18.443 4.5z' fill-rule='evenodd'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.25 10.693L6.057 4.5 5 5.557l6.193 6.193L5 17.943 6.057 19l6.193-6.193L18.443 19l1.057-1.057-6.193-6.193L19.5 5.557 18.443 4.5z' fill-rule='evenodd'/%3E%3C/svg%3E")}.weui-icon-back-circle{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zm1.999-5.363L12.953 16.5 9.29 12.723a1.045 1.045 0 010-1.446L12.953 7.5 14 8.563 10.68 12 14 15.438z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-1.2a8.8 8.8 0 100-17.6 8.8 8.8 0 000 17.6zm1.999-5.363L12.953 16.5 9.29 12.723a1.045 1.045 0 010-1.446L12.953 7.5 14 8.563 10.68 12 14 15.438z'/%3E%3C/svg%3E")}.weui-icon-success{color:var(--weui-BRAND)}.weui-icon-waiting{color:var(--weui-BLUE)}.weui-icon-warn{color:var(--weui-RED)}.weui-icon-info{color:var(--weui-BLUE)}.weui-icon-success-circle,.weui-icon-success-no-circle,.weui-icon-success-no-circle-thin{color:var(--weui-BRAND)}.weui-icon-waiting-circle{color:var(--weui-BLUE)}.weui-icon-circle{color:var(--weui-FG-2)}.weui-icon-download{color:var(--weui-BRAND)}.weui-icon-info-circle{color:var(--weui-FG-2)}.weui-icon-safe-success{color:var(--weui-BRAND)}.weui-icon-safe-warn{color:var(--weui-YELLOW)}.weui-icon-cancel{color:var(--weui-RED)}.weui-icon-search{color:var(--weui-FG-1)}.weui-icon-clear{color:var(--weui-FG-2)}.weui-icon-clear:active{color:var(--weui-FG-1)}.weui-icon-delete.weui-icon_gallery-delete{color:var(--weui-WHITE)}.weui-icon-arrow-bold.weui-icon-arrow,.weui-icon-arrow-bold.weui-icon-arrow-bold,.weui-icon-arrow-bold.weui-icon-back-arrow,.weui-icon-arrow-bold.weui-icon-back-arrow-thin,.weui-icon-arrow.weui-icon-arrow,.weui-icon-arrow.weui-icon-arrow-bold,.weui-icon-arrow.weui-icon-back-arrow,.weui-icon-arrow.weui-icon-back-arrow-thin,.weui-icon-back-arrow-thin.weui-icon-arrow,.weui-icon-back-arrow-thin.weui-icon-arrow-bold,.weui-icon-back-arrow-thin.weui-icon-back-arrow,.weui-icon-back-arrow-thin.weui-icon-back-arrow-thin,.weui-icon-back-arrow.weui-icon-arrow,.weui-icon-back-arrow.weui-icon-arrow-bold,.weui-icon-back-arrow.weui-icon-back-arrow,.weui-icon-back-arrow.weui-icon-back-arrow-thin{width:1.2em}.weui-icon-arrow,.weui-icon-arrow-bold{color:var(--weui-FG-2)}.weui-icon-back,.weui-icon-back-arrow,.weui-icon-back-arrow-thin,.weui-icon-back-circle{color:var(--weui-FG-0)}.weui-icon_msg.weui-icon_msg{width:6.4em;height:6.4em}.weui-icon_msg.weui-icon_msg.weui-icon-warn{color:var(--weui-RED)}.weui-icon_msg.weui-icon_msg.weui-icon-info-circle{color:var(--weui-BLUE)}.weui-icon_msg-primary.weui-icon_msg-primary{width:6.4em;height:6.4em}.weui-icon_msg-primary.weui-icon_msg-primary.weui-icon-warn{color:var(--weui-YELLOW)}.wx-root,body{--weui-BG-0:#ededed;--weui-BG-1:#f7f7f7;--weui-BG-2:#fff;--weui-BG-3:#f7f7f7;--weui-BG-4:#4c4c4c;--weui-BG-5:#fff;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#3fbeff;--weui-BLUE-170:#b7e6ff;--weui-BLUE-80:#0c8bcc;--weui-BLUE-90:#0e9ce6;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#5aafe4;--weui-BLUE-BG-130:#7fc0ea;--weui-BLUE-BG-90:#4095cb;--weui-BRAND-100:#07c160;--weui-BRAND-120:#38cd7f;--weui-BRAND-170:#b4ecce;--weui-BRAND-80:#059a4c;--weui-BRAND-90:#06ae56;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#3eb575;--weui-BRAND-BG-130:#69c694;--weui-BRAND-BG-90:#259c5c;--weui-FG-0:rgba(0,0,0,0.9);--weui-FG-0_5:rgba(0,0,0,0.9);--weui-FG-1:rgba(0,0,0,0.55);--weui-FG-2:rgba(0,0,0,0.3);--weui-FG-3:rgba(0,0,0,0.1);--weui-FG-4:rgba(0,0,0,0.15);--weui-GLYPH-0:rgba(0,0,0,0.9);--weui-GLYPH-1:rgba(0,0,0,0.55);--weui-GLYPH-2:rgba(0,0,0,0.3);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.8);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.5);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#91d300;--weui-GREEN-120:#a7db33;--weui-GREEN-170:#def1b3;--weui-GREEN-80:#74a800;--weui-GREEN-90:#82bd00;--weui-GREEN-BG-100:#96be40;--weui-GREEN-BG-110:#a0c452;--weui-GREEN-BG-130:#b5d179;--weui-GREEN-BG-90:#86aa39;--weui-INDIGO-100:#1485ee;--weui-INDIGO-120:#439df1;--weui-INDIGO-170:#b8daf9;--weui-INDIGO-80:#106abe;--weui-INDIGO-90:#1277d6;--weui-INDIGO-BG-100:#2b77bf;--weui-INDIGO-BG-110:#3f84c5;--weui-INDIGO-BG-130:#6ba0d2;--weui-INDIGO-BG-90:#266aab;--weui-LIGHTGREEN-100:#95ec69;--weui-LIGHTGREEN-120:#aaef87;--weui-LIGHTGREEN-170:#def9d1;--weui-LIGHTGREEN-80:#77bc54;--weui-LIGHTGREEN-90:#85d35e;--weui-LIGHTGREEN-BG-100:#72cf60;--weui-LIGHTGREEN-BG-110:#80d370;--weui-LIGHTGREEN-BG-130:#9cdd90;--weui-LIGHTGREEN-BG-90:#66b956;--weui-LINK-100:#576b95;--weui-LINK-120:#7888aa;--weui-LINK-170:#ccd2de;--weui-LINK-80:#455577;--weui-LINK-90:#4e6085;--weui-LINKFINDER-100:#002666;--weui-MATERIAL-ATTACHMENTCOLUMN:hsla(0,0%,96.1%,0.95);--weui-MATERIAL-NAVIGATIONBAR:hsla(0,0%,92.9%,0.94);--weui-MATERIAL-REGULAR:hsla(0,0%,96.9%,0.3);--weui-MATERIAL-THICK:hsla(0,0%,96.9%,0.8);--weui-MATERIAL-THIN:hsla(0,0%,100%,0.2);--weui-MATERIAL-TOOLBAR:hsla(0,0%,96.5%,0.82);--weui-ORANGE-100:#fa9d3b;--weui-ORANGE-120:#fbb062;--weui-ORANGE-170:#fde1c3;--weui-ORANGE-80:#c87d2f;--weui-ORANGE-90:#e08c34;--weui-ORANGE-BG-100:#ea7800;--weui-ORANGE-BG-110:#ec8519;--weui-ORANGE-BG-130:#f0a04d;--weui-ORANGE-BG-90:#d26b00;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.5);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#6467f0;--weui-PURPLE-120:#8385f3;--weui-PURPLE-170:#d0d1fa;--weui-PURPLE-80:#5052c0;--weui-PURPLE-90:#595cd7;--weui-PURPLE-BG-100:#6769ba;--weui-PURPLE-BG-110:#7678c1;--weui-PURPLE-BG-130:#9496ce;--weui-PURPLE-BG-90:#5c5ea7;--weui-RED-100:#fa5151;--weui-RED-120:#fb7373;--weui-RED-170:#fdcaca;--weui-RED-80:#c84040;--weui-RED-90:#e14949;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#d3625a;--weui-RED-BG-130:#dd847e;--weui-RED-BG-90:#b94840;--weui-SECONDARY-BG:rgba(0,0,0,0.05);--weui-SEPARATOR-0:rgba(0,0,0,0.1);--weui-SEPARATOR-1:rgba(0,0,0,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:rgba(0,0,0,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:rgba(0,0,0,0.2);--weui-YELLOW-100:#ffc300;--weui-YELLOW-120:#ffcf33;--weui-YELLOW-170:#ffecb2;--weui-YELLOW-80:#cc9c00;--weui-YELLOW-90:#e6af00;--weui-YELLOW-BG-100:#efb600;--weui-YELLOW-BG-110:#f0bd19;--weui-YELLOW-BG-130:#f3cc4d;--weui-YELLOW-BG-90:#d7a400;--weui-FG-HALF:rgba(0,0,0,0.9);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#fa9d3b;--weui-YELLOW:#ffc300;--weui-GREEN:#91d300;--weui-LIGHTGREEN:#95ec69;--weui-TEXTGREEN:#06ae56;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1485ee;--weui-PURPLE:#6467f0;--weui-LINK:#576b95;--weui-TAG-TEXT-ORANGE:#fa9d3b;--weui-TAG-TEXT-GREEN:#06ae56;--weui-TAG-TEXT-BLUE:#10aeff;--weui-REDORANGE:#ff6146;--weui-TAG-TEXT-BLACK:rgba(0,0,0,0.5);--weui-TAG-BACKGROUND-BLACK:rgba(0,0,0,0.05);--weui-WHITE:#fff;--weui-BG:#fff;--weui-FG:#000;--weui-FG-5:rgba(0,0,0,0.05);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.8);--weui-FG-0_5:hsla(0,0%,100%,0.6);--weui-FG-1:hsla(0,0%,100%,0.5);--weui-FG-2:hsla(0,0%,100%,0.3);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.8);--weui-GLYPH-1:hsla(0,0%,100%,0.5);--weui-GLYPH-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.8);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.5);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:rgba(95,95,95,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.1);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.6);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5);--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG:#fff;--weui-BG:#000;--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6)}}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.8);--weui-FG-0_5:hsla(0,0%,100%,0.6);--weui-FG-1:hsla(0,0%,100%,0.5);--weui-FG-2:hsla(0,0%,100%,0.3);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.8);--weui-GLYPH-1:hsla(0,0%,100%,0.5);--weui-GLYPH-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.8);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.5);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.3);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:rgba(95,95,95,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.1);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.6);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5);--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG:#fff;--weui-BG:#000;--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6)}.wx-root[data-weui-mode=care],body[data-weui-mode=care]{--weui-BG-0:#ededed;--weui-BG-1:#f7f7f7;--weui-BG-2:#fff;--weui-BG-3:#f7f7f7;--weui-BG-4:#4c4c4c;--weui-BG-5:#fff;--weui-BLUE-100:#007dbb;--weui-BLUE-120:#3fbeff;--weui-BLUE-170:#b7e6ff;--weui-BLUE-80:#0c8bcc;--weui-BLUE-90:#0e9ce6;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#5aafe4;--weui-BLUE-BG-130:#7fc0ea;--weui-BLUE-BG-90:#4095cb;--weui-BRAND-100:#018942;--weui-BRAND-120:#38cd7f;--weui-BRAND-170:#b4ecce;--weui-BRAND-80:#059a4c;--weui-BRAND-90:#06ae56;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#3eb575;--weui-BRAND-BG-130:#69c694;--weui-BRAND-BG-90:#259c5c;--weui-FG-0:#000;--weui-FG-0_5:#000;--weui-FG-1:rgba(0,0,0,0.6);--weui-FG-2:rgba(0,0,0,0.42);--weui-FG-3:rgba(0,0,0,0.1);--weui-FG-4:rgba(0,0,0,0.15);--weui-GLYPH-0:#000;--weui-GLYPH-1:rgba(0,0,0,0.6);--weui-GLYPH-2:rgba(0,0,0,0.42);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.85);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.55);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#4f8400;--weui-GREEN-120:#a7db33;--weui-GREEN-170:#def1b3;--weui-GREEN-80:#74a800;--weui-GREEN-90:#82bd00;--weui-GREEN-BG-100:#96be40;--weui-GREEN-BG-110:#a0c452;--weui-GREEN-BG-130:#b5d179;--weui-GREEN-BG-90:#86aa39;--weui-INDIGO-100:#0075e2;--weui-INDIGO-120:#439df1;--weui-INDIGO-170:#b8daf9;--weui-INDIGO-80:#106abe;--weui-INDIGO-90:#1277d6;--weui-INDIGO-BG-100:#2b77bf;--weui-INDIGO-BG-110:#3f84c5;--weui-INDIGO-BG-130:#6ba0d2;--weui-INDIGO-BG-90:#266aab;--weui-LIGHTGREEN-100:#2e8800;--weui-LIGHTGREEN-120:#aaef87;--weui-LIGHTGREEN-170:#def9d1;--weui-LIGHTGREEN-80:#77bc54;--weui-LIGHTGREEN-90:#85d35e;--weui-LIGHTGREEN-BG-100:#72cf60;--weui-LIGHTGREEN-BG-110:#80d370;--weui-LIGHTGREEN-BG-130:#9cdd90;--weui-LIGHTGREEN-BG-90:#66b956;--weui-LINK-100:#576b95;--weui-LINK-120:#7888aa;--weui-LINK-170:#ccd2de;--weui-LINK-80:#455577;--weui-LINK-90:#4e6085;--weui-LINKFINDER-100:#002666;--weui-MATERIAL-ATTACHMENTCOLUMN:hsla(0,0%,96.1%,0.95);--weui-MATERIAL-NAVIGATIONBAR:hsla(0,0%,92.9%,0.94);--weui-MATERIAL-REGULAR:hsla(0,0%,96.9%,0.3);--weui-MATERIAL-THICK:hsla(0,0%,96.9%,0.8);--weui-MATERIAL-THIN:hsla(0,0%,100%,0.2);--weui-MATERIAL-TOOLBAR:hsla(0,0%,96.5%,0.82);--weui-ORANGE-100:#e17719;--weui-ORANGE-120:#fbb062;--weui-ORANGE-170:#fde1c3;--weui-ORANGE-80:#c87d2f;--weui-ORANGE-90:#e08c34;--weui-ORANGE-BG-100:#ea7800;--weui-ORANGE-BG-110:#ec8519;--weui-ORANGE-BG-130:#f0a04d;--weui-ORANGE-BG-90:#d26b00;--weui-ORANGERED-100:#d14730;--weui-OVERLAY:rgba(0,0,0,0.5);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#6265f1;--weui-PURPLE-120:#8385f3;--weui-PURPLE-170:#d0d1fa;--weui-PURPLE-80:#5052c0;--weui-PURPLE-90:#595cd7;--weui-PURPLE-BG-100:#6769ba;--weui-PURPLE-BG-110:#7678c1;--weui-PURPLE-BG-130:#9496ce;--weui-PURPLE-BG-90:#5c5ea7;--weui-RED-100:#dc3636;--weui-RED-120:#fb7373;--weui-RED-170:#fdcaca;--weui-RED-80:#c84040;--weui-RED-90:#e14949;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#d3625a;--weui-RED-BG-130:#dd847e;--weui-RED-BG-90:#b94840;--weui-SECONDARY-BG:rgba(0,0,0,0.1);--weui-SEPARATOR-0:rgba(0,0,0,0.1);--weui-SEPARATOR-1:rgba(0,0,0,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:rgba(0,0,0,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:rgba(0,0,0,0.2);--weui-YELLOW-100:#bb8e00;--weui-YELLOW-120:#ffcf33;--weui-YELLOW-170:#ffecb2;--weui-YELLOW-80:#cc9c00;--weui-YELLOW-90:#e6af00;--weui-YELLOW-BG-100:#efb600;--weui-YELLOW-BG-110:#f0bd19;--weui-YELLOW-BG-130:#f3cc4d;--weui-YELLOW-BG-90:#d7a400;--weui-FG-HALF:#000;--weui-RED:#dc3636;--weui-ORANGERED:#d14730;--weui-ORANGE:#e17719;--weui-YELLOW:#bb8e00;--weui-GREEN:#4f8400;--weui-LIGHTGREEN:#2e8800;--weui-TEXTGREEN:#06ae56;--weui-BRAND:#018942;--weui-BLUE:#007dbb;--weui-INDIGO:#0075e2;--weui-PURPLE:#6265f1;--weui-LINK:#576b95;--weui-TAG-TEXT-ORANGE:#e17719;--weui-TAG-TEXT-GREEN:#06ae56;--weui-TAG-TEXT-BLUE:#007dbb;--weui-REDORANGE:#d14730;--weui-TAG-TEXT-BLACK:rgba(0,0,0,0.5);--weui-WHITE:#fff;--weui-BG:#fff;--weui-FG:#000;--weui-FG-5:rgba(0,0,0,0.05);--weui-TAG-BACKGROUND-ORANGE:rgba(225,119,25,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(0,125,187,0.1);--weui-TAG-BACKGROUND-BLACK:rgba(0,0,0,0.05)}@media (prefers-color-scheme:dark){.wx-root[data-weui-mode=care]:not([data-weui-theme=light]),body[data-weui-mode=care]:not([data-weui-theme=light]){--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.85);--weui-FG-0_5:hsla(0,0%,100%,0.65);--weui-FG-1:hsla(0,0%,100%,0.55);--weui-FG-2:hsla(0,0%,100%,0.35);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.85);--weui-GLYPH-1:hsla(0,0%,100%,0.55);--weui-GLYPH-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.85);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.55);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:hsla(0,0%,96.1%,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.15);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.65);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-FG:#fff;--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-BG:#000;--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6);--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5)}}.wx-root[data-weui-mode=care][data-weui-theme=dark],body[data-weui-mode=care][data-weui-theme=dark]{--weui-BG-0:#111;--weui-BG-1:#1e1e1e;--weui-BG-2:#191919;--weui-BG-3:#202020;--weui-BG-4:#404040;--weui-BG-5:#2c2c2c;--weui-BLUE-100:#10aeff;--weui-BLUE-120:#0c8bcc;--weui-BLUE-170:#04344d;--weui-BLUE-80:#3fbeff;--weui-BLUE-90:#28b6ff;--weui-BLUE-BG-100:#48a6e2;--weui-BLUE-BG-110:#4095cb;--weui-BLUE-BG-130:#32749e;--weui-BLUE-BG-90:#5aafe4;--weui-BRAND-100:#07c160;--weui-BRAND-120:#059a4c;--weui-BRAND-170:#023a1c;--weui-BRAND-80:#38cd7f;--weui-BRAND-90:#20c770;--weui-BRAND-BG-100:#2aae67;--weui-BRAND-BG-110:#259c5c;--weui-BRAND-BG-130:#1d7a48;--weui-BRAND-BG-90:#3eb575;--weui-FG-0:hsla(0,0%,100%,0.85);--weui-FG-0_5:hsla(0,0%,100%,0.65);--weui-FG-1:hsla(0,0%,100%,0.55);--weui-FG-2:hsla(0,0%,100%,0.35);--weui-FG-3:hsla(0,0%,100%,0.1);--weui-FG-4:hsla(0,0%,100%,0.15);--weui-GLYPH-0:hsla(0,0%,100%,0.85);--weui-GLYPH-1:hsla(0,0%,100%,0.55);--weui-GLYPH-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-0:hsla(0,0%,100%,0.85);--weui-GLYPH-WHITE-1:hsla(0,0%,100%,0.55);--weui-GLYPH-WHITE-2:hsla(0,0%,100%,0.35);--weui-GLYPH-WHITE-3:#fff;--weui-GREEN-100:#74a800;--weui-GREEN-120:#5c8600;--weui-GREEN-170:#233200;--weui-GREEN-80:#8fb933;--weui-GREEN-90:#82b01a;--weui-GREEN-BG-100:#789833;--weui-GREEN-BG-110:#6b882d;--weui-GREEN-BG-130:#65802b;--weui-GREEN-BG-90:#85a247;--weui-INDIGO-100:#1196ff;--weui-INDIGO-120:#0d78cc;--weui-INDIGO-170:#052d4d;--weui-INDIGO-80:#40abff;--weui-INDIGO-90:#28a0ff;--weui-INDIGO-BG-100:#0d78cc;--weui-INDIGO-BG-110:#0b6bb7;--weui-INDIGO-BG-130:#09548f;--weui-INDIGO-BG-90:#2585d1;--weui-LIGHTGREEN-100:#3eb575;--weui-LIGHTGREEN-120:#31905d;--weui-LIGHTGREEN-170:#123522;--weui-LIGHTGREEN-80:#64c390;--weui-LIGHTGREEN-90:#51bc83;--weui-LIGHTGREEN-BG-100:#31905d;--weui-LIGHTGREEN-BG-110:#2c8153;--weui-LIGHTGREEN-BG-130:#226541;--weui-LIGHTGREEN-BG-90:#31905d;--weui-LINK-100:#7d90a9;--weui-LINK-120:#647387;--weui-LINK-170:#252a32;--weui-LINK-80:#97a6ba;--weui-LINK-90:#899ab1;--weui-LINKFINDER-100:#dee9ff;--weui-MATERIAL-ATTACHMENTCOLUMN:rgba(32,32,32,0.93);--weui-MATERIAL-NAVIGATIONBAR:rgba(18,18,18,0.9);--weui-MATERIAL-REGULAR:rgba(37,37,37,0.6);--weui-MATERIAL-THICK:rgba(34,34,34,0.9);--weui-MATERIAL-THIN:hsla(0,0%,96.1%,0.4);--weui-MATERIAL-TOOLBAR:rgba(35,35,35,0.93);--weui-ORANGE-100:#c87d2f;--weui-ORANGE-120:#a06425;--weui-ORANGE-170:#3b250e;--weui-ORANGE-80:#d39758;--weui-ORANGE-90:#cd8943;--weui-ORANGE-BG-100:#bb6000;--weui-ORANGE-BG-110:#a85600;--weui-ORANGE-BG-130:#824300;--weui-ORANGE-BG-90:#c1701a;--weui-ORANGERED-100:#ff6146;--weui-OVERLAY:rgba(0,0,0,0.8);--weui-OVERLAY-WHITE:hsla(0,0%,94.9%,0.8);--weui-PURPLE-100:#8183ff;--weui-PURPLE-120:#6768cc;--weui-PURPLE-170:#26274c;--weui-PURPLE-80:#9a9bff;--weui-PURPLE-90:#8d8fff;--weui-PURPLE-BG-100:#6768cc;--weui-PURPLE-BG-110:#5c5db7;--weui-PURPLE-BG-130:#48498f;--weui-PURPLE-BG-90:#7677d1;--weui-RED-100:#fa5151;--weui-RED-120:#c84040;--weui-RED-170:#4b1818;--weui-RED-80:#fb7373;--weui-RED-90:#fa6262;--weui-RED-BG-100:#cf5148;--weui-RED-BG-110:#ba4940;--weui-RED-BG-130:#913832;--weui-RED-BG-90:#d3625a;--weui-SECONDARY-BG:hsla(0,0%,100%,0.15);--weui-SEPARATOR-0:hsla(0,0%,100%,0.05);--weui-SEPARATOR-1:hsla(0,0%,100%,0.15);--weui-STATELAYER-HOVERED:rgba(0,0,0,0.02);--weui-STATELAYER-PRESSED:hsla(0,0%,100%,0.1);--weui-STATELAYER-PRESSEDSTRENGTHENED:hsla(0,0%,100%,0.2);--weui-YELLOW-100:#cc9c00;--weui-YELLOW-120:#a37c00;--weui-YELLOW-170:#3d2f00;--weui-YELLOW-80:#d6af33;--weui-YELLOW-90:#d1a519;--weui-YELLOW-BG-100:#bf9100;--weui-YELLOW-BG-110:#ab8200;--weui-YELLOW-BG-130:#866500;--weui-YELLOW-BG-90:#c59c1a;--weui-FG-HALF:hsla(0,0%,100%,0.65);--weui-RED:#fa5151;--weui-ORANGERED:#ff6146;--weui-ORANGE:#c87d2f;--weui-YELLOW:#cc9c00;--weui-GREEN:#74a800;--weui-LIGHTGREEN:#3eb575;--weui-TEXTGREEN:#259c5c;--weui-BRAND:#07c160;--weui-BLUE:#10aeff;--weui-INDIGO:#1196ff;--weui-PURPLE:#8183ff;--weui-LINK:#7d90a9;--weui-REDORANGE:#ff6146;--weui-TAG-BACKGROUND-BLACK:hsla(0,0%,100%,0.05);--weui-FG:#fff;--weui-WHITE:hsla(0,0%,100%,0.8);--weui-FG-5:hsla(0,0%,100%,0.1);--weui-TAG-BACKGROUND-ORANGE:rgba(250,157,59,0.1);--weui-TAG-BACKGROUND-GREEN:rgba(6,174,86,0.1);--weui-TAG-TEXT-RED:rgba(250,81,81,0.6);--weui-TAG-BACKGROUND-RED:rgba(250,81,81,0.1);--weui-TAG-BACKGROUND-BLUE:rgba(16,174,255,0.1);--weui-TAG-TEXT-ORANGE:rgba(250,157,59,0.6);--weui-BG:#000;--weui-TAG-TEXT-GREEN:rgba(6,174,86,0.6);--weui-TAG-TEXT-BLUE:rgba(16,174,255,0.6);--weui-TAG-TEXT-BLACK:hsla(0,0%,100%,0.5)}.wx-root{pointer-events:auto;font-family:system-ui,-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Hiragino Sans GB,Microsoft YaHei UI,Microsoft YaHei,Arial,sans-serif}.wx-root,.wx_card_root{position:relative}.wxw_hide{display:none!important}.wx_uninteractive{pointer-events:none}.wx-root,body{--APPMSGCARD-BG:#fafafa}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--APPMSGCARD-BG:#1e1e1e}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--APPMSGCARD-BG:#1e1e1e}}.wx-root,body{--APPMSGCARD-LINE-BG:rgba(0,0,0,0.07)}.wx-root[data-weui-theme=dark],body[data-weui-theme=dark]{--APPMSGCARD-LINE-BG:hsla(0,0%,100%,0.07)}@media (prefers-color-scheme:dark){.wx-root:not([data-weui-theme=light]),body:not([data-weui-theme=light]){--APPMSGCARD-LINE-BG:hsla(0,0%,100%,0.07)}}.appmsg_card_context{position:relative;background-color:var(--APPMSGCARD-BG);border-radius:8px;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}:host(.wx_tap_highlight_active) .wx_tap_link{opacity:.5}:host(.wx_tap_highlight_active) .wx_tap_card{background-color:#f3f3f3}:host(.wx_tap_highlight_active) .wx_tap_cell{background-color:rgba(0,0,0,.05)}@media (prefers-color-scheme:dark){:host(.wx_tap_highlight_active) .wx_tap_card{background-color:#252525}:host(.wx_tap_highlight_active) .wx_tap_cell{background-color:hsla(0,0%,100%,.1)}}.wx_css_active :active{opacity:.5}.weui-flex__item{min-width:0}.weui-flex_align-center{align-items:center}[tabindex]{outline:0}.wx_hover_card:before{border-radius:8px;border:1px solid rgba(7,193,96,.3)}.wx_hover_card:before,.wx_selected_card:before{content:" ";position:absolute;top:0;left:0;right:0;bottom:0;box-sizing:border-box;pointer-events:none;z-index:9}.wx_selected_card:before{border-radius:8px;border:1.5px solid #07c160;background:rgba(7,193,96,.1)}img{pointer-events:none}.wx_profile_card{line-height:1.4;text-align:left;text-decoration:none;clear:both;position:relative}.wx_profile_card_ft{padding:8px 16px;align-items:center;position:relative;color:var(--weui-FG-2);font-size:14px}.wx_profile_card_ft:before{content:"";content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid var(--APPMSGCARD-LINE-BG);color:var(--APPMSGCARD-LINE-BG);transform-origin:0 0;transform:scaleY(.5);left:16px;right:16px}.wx_profile_msg{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;z-index:1;background:hsla(0,0%,100%,.5);font-size:14px;font-weight:400}.common-web{margin:0 auto;max-width:350px}.wx_card_disabled .wx_profile_card_bd{filter:blur(2px)}.wx_profile{padding:20px 16px}.wx_profile .weui-icon-arrow{width:1em;height:2em}.wx_profile_hd{display:flex;padding-right:10px}.wx_profile_hd .wx_profile_avatar{width:44px;height:44px!important;border-radius:100%}.wx_profile_ft{padding-left:10px}.wx_profile_bd{align-items:center}.wx_profile_bd>.weui-flex__item{padding-right:16px}.wx_profile_nickname{display:inline-block;flex-shrink:1;color:var(--weui-FG-0);font-weight:500}.wx_profile_desc{width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.wx_profile_desc,.wx_profile_tips{color:var(--weui-FG-1);font-size:14px;margin-top:4px}.wx_profile_tips{display:flex;min-height:1.4em}.wx_profile_tips:empty{display:none}.wx_profile_nickname_wrp{position:relative;display:flex;flex-direction:row;align-items:center;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;font-size:17px;line-height:1.2;font-weight:500}.wx_follow_verify{flex-shrink:0;height:14px;width:14px;margin-left:2px;background-size:cover;background-position:50%;background-repeat:no-repeat}.wx_follow_verify.show-verify-personal{display:block;background-image:url(https://res.wx.qq.com/op_res/nLnAiLrrETuU96Aym1ZDNuddJ2beY0iOs-D3h-7MPQeIIoXE5kLrgfPY_Vr_hrKamxAjISc12pBthrd7Ja4S4w)}.wx_follow_verify.show-verify-company{display:block;background-image:url(https://res.wx.qq.com/op_res/nLnAiLrrETuU96Aym1ZDNjhMga6Fe1hiYp332DlZsT_u4THJyu8XegVlG723G5FblhAwxLO31iFVMkzq62jS3w)}.wx_follow_verify.show-verify-media{display:block;background-image:url(https://res.wx.qq.com/op_res/n1-Xym4hWn0AbVImOFGmT9sRdHV1rjoe3lnMHwxRdfbguJjDQH16CE7AIfDZy1KVMHWCPJIoAC4jrMEFqmqR4A)}</style>
630
- <div role="option" tabindex="0"
631
- aria-labelledby="js_a11y_wx_profile_nickname js_a11y_comma js_a11y_wx_profile_desc js_a11y_comma0 js_a11y_wx_profile_tips js_a11y_comma1 js_a11y_wx_profile_logo"
632
- class="appmsg_card_context wx_profile_card wx-root wx_tap_card wx_card_root common-web"
633
- data-weui-theme="light">
634
- <div class="wx_profile_card_inner">
635
- <div class="wx_profile_card_bd" aria-hidden="true">
636
- <div class="wx_profile weui-flex">
637
- <div class="wx_profile_hd">
638
- <img src="${o}" alt="" class="wx_profile_avatar">
639
- </div>
640
- <div class="wx_profile_bd weui-flex weui-flex__item">
641
- <div class="weui-flex__item">
642
- <div class="wx_profile_nickname_wrp">
643
- <strong id="js_a11y_wx_profile_nickname" class="wx_profile_nickname">${e}</strong>
644
- <span class="wx_follow_verify ${s==="1"?"show-verify-personal":s==="2"?"show-verify-company":""}"></span>
645
- </div>
646
- <div id="js_a11y_wx_profile_desc" class="wx_profile_desc">${a}</div>
647
- </div>
648
- <i class="weui-icon-arrow"></i>
649
- </div>
650
- </div>
651
- </div>
652
- <div id="js_a11y_wx_profile_logo" aria-hidden="true" class="wx_profile_card_ft">
653
- ${n==="1"?"公众号":"服务号"}
654
- </div>
655
- </div>
656
- <span aria-hidden="true" id="js_a11y_comma" class="weui-a11y_ref" style="display: none;">,</span>
657
- </div>
658
- `}}function setupComponents(){customElements.define("mp-common-profile",MpCommonProfile)}initializeMermaid().catch(console.error);setupComponents();const app=createApp(_sfc_main);app.use(createPinia());app.mount("#app");const isInExtension=typeof chrome<"u"&&chrome.runtime&&chrome.runtime.id;async function getCurrentTab(){const t={active:!0,lastFocusedWindow:!0};if(typeof browser<"u"&&browser.tabs&&browser.tabs.query){const[o]=await browser.tabs.query(t);return o}const[e]=await chrome.tabs.query(t);return e}window.addEventListener("copyToMp",t=>{const e=t;isInExtension&&getCurrentTab().then(o=>{chrome.tabs.sendMessage(o.id,{type:"copyToMp",content:e.detail.content})})});