@alifd/chat 0.3.52-beta.4 → 0.3.52

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.
Files changed (44) hide show
  1. package/dist/docs/ai-loading/main.js +1 -1
  2. package/dist/docs/balloon/main.js +1 -1
  3. package/dist/docs/button/main.js +1 -1
  4. package/dist/docs/card/main.js +1 -1
  5. package/dist/docs/card-loading/main.js +1 -1
  6. package/dist/docs/checkbox/main.js +1 -1
  7. package/dist/docs/checkbox-group/main.js +1 -1
  8. package/dist/docs/code-view/main.js +1 -1
  9. package/dist/docs/collapse/main.js +1 -1
  10. package/dist/docs/date-picker/main.js +1 -1
  11. package/dist/docs/document/main.js +1 -1
  12. package/dist/docs/drawer/main.js +1 -1
  13. package/dist/docs/error-notice/main.js +1 -1
  14. package/dist/docs/feedback/main.js +1 -1
  15. package/dist/docs/flip/main.js +1 -1
  16. package/dist/docs/float-button/main.js +1 -1
  17. package/dist/docs/form/main.js +1 -1
  18. package/dist/docs/html-render/main.js +1 -1
  19. package/dist/docs/icon/main.js +1 -1
  20. package/dist/docs/image-preview/main.js +1 -1
  21. package/dist/docs/img/main.js +1 -1
  22. package/dist/docs/input/main.js +1 -1
  23. package/dist/docs/list/main.js +1 -1
  24. package/dist/docs/loading/main.js +1 -1
  25. package/dist/docs/markdown/main.js +1 -1
  26. package/dist/docs/mermaid-view/main.js +1 -1
  27. package/dist/docs/message/main.js +1 -1
  28. package/dist/docs/origin/main.js +1 -1
  29. package/dist/docs/person-picker/main.js +1 -1
  30. package/dist/docs/radio-group/main.js +1 -1
  31. package/dist/docs/recommend/main.js +1 -1
  32. package/dist/docs/reference/main.js +1 -1
  33. package/dist/docs/rich-text-input/main.js +1 -1
  34. package/dist/docs/select/main.js +1 -1
  35. package/dist/docs/step/main.js +1 -1
  36. package/dist/docs/stop-generate/main.js +1 -1
  37. package/dist/docs/table/main.js +1 -1
  38. package/dist/docs/tag/main.js +1 -1
  39. package/dist/docs/text/main.js +1 -1
  40. package/dist/docs/time-picker/main.js +1 -1
  41. package/dist/docs/tool-status/main.js +1 -1
  42. package/es/index.js +1 -1
  43. package/lib/index.js +1 -1
  44. package/package.json +1 -1
@@ -280,4 +280,4 @@ ${e.themeCSS}`),void 0!==e.fontFamily&&(n+=`
280
280
  :root { --mermaid-font-family: ${e.fontFamily}}`),void 0!==e.altFontFamily&&(n+=`
281
281
  :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){let i=e.htmlLabels??e.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(e=>{(0,F8.Z)(e.styles)||i.forEach(t=>{n+=Y0(e.id,t,e.styles)}),(0,F8.Z)(e.textStyles)||(n+=Y0(e.id,"tspan",(e?.textStyles||[]).map(e=>e.replace("color","fill"))))})}return n},"createCssStyles"),Y3=(0,FR.eW)((e,t,n,i)=>{let o=Y2(e,n),a=(0,FA.Ee)(t,o,e.themeVariables);return FG(function(e){var t,n;return n=function e(t,n,i,o,a,s,l,u,d){for(var p,h,f,m,_,g,y=0,b=0,E=l,S=0,T=0,C=0,x=1,k=1,w=1,N=0,D="",O=a,M=s,A=o,R=D;k;)switch(C=N,N=F0()){case 40:if(108!=C&&58==Fz(R,E-1)){-1!=(_=R+=FU(F5(N),"&","&\f"),g=FY(y?u[y-1]:0),_.indexOf("&\f",g))&&(w=-1);break}case 34:case 39:case 91:R+=F5(N);break;case 9:case 10:case 13:case 32:R+=function(e){for(;FJ=F2();)if(FJ<33)F0();else break;return F3(e)>2||F3(FJ)>3?"":" "}(C);break;case 92:R+=function(e,t){for(var n;--t&&F0()&&!(FJ<48)&&!(FJ>102)&&(!(FJ>57)||!(FJ<65))&&(!(FJ>70)||!(FJ<97)););return n=FQ+(t<6&&32==F2()&&32==F0()),FH(FX,e,n)}(FQ-1,7);continue;case 47:switch(F2()){case 42:case 47:FW((p=function(e,t){for(;F0();)if(e+FJ===57)break;else if(e+FJ===84&&47===F2())break;return"/*"+FH(FX,t,FQ-1)+"*"+Fj(47===e?e:F0())}(F0(),FQ),h=n,f=i,m=d,F1(p,h,f,FP,Fj(FJ),FH(p,2,-2),0,m)),d),(5==F3(C||1)||5==F3(F2()||1))&&FV(R)&&" "!==FH(R,-1,void 0)&&(R+=" ");break;default:R+="/"}break;case 123*x:u[y++]=FV(R)*w;case 125*x:case 59:case 0:switch(N){case 0:case 125:k=0;case 59+b:-1==w&&(R=FU(R,/\f/g,"")),T>0&&(FV(R)-E||0===x&&47===C)&&FW(T>32?F6(R+";",o,i,E-1,d):F6(FU(R," ","")+";",o,i,E-2,d),d);break;case 59:R+=";";default:if(FW(A=F4(R,n,i,y,b,a,u,D,O=[],M=[],E,s),s),123===N)if(0===b)e(R,n,A,A,O,s,E,u,M);else{switch(S){case 99:if(110===Fz(R,3))break;case 108:if(97===Fz(R,2))break;default:b=0;case 100:case 109:case 115:}b?e(t,A,A,o&&FW(F4(t,A,A,0,0,a,u,D,a,O=[],E,M),M),a,M,E,u,o?O:M):e(R,A,A,A,[""],M,0,u,M)}}y=b=T=0,x=w=1,D=R="",E=l;break;case 58:E=1+FV(R),T=C;default:if(x<1){if(123==N)--x;else if(125==N&&0==x++&&125==(FJ=FQ>0?Fz(FX,--FQ):0,FK--,10===FJ&&(FK=1,F$--),FJ))continue}switch(R+=Fj(N),N*x){case 38:w=b>0?1:(R+="\f",-1);break;case 44:u[y++]=(FV(R)-1)*w,w=1;break;case 64:45===F2()&&(R+=F5(F0())),S=F2(),b=E=FV(D=R+=function(e){for(;!F3(F2());)F0();return FH(FX,e,FQ)}(FQ)),N++;break;case 45:45===C&&2==FV(R)&&(x=0)}}return s}("",null,null,null,[""],(t=e,F$=FK=1,FZ=FV(FX=t),FQ=0,e=[]),0,[0],e),FX="",n}(`${i}{${a}}`),Fq)},"createUserStyles"),Y5=(0,FR.eW)((e="",t,n)=>{let i=e;return n||t||(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=(i=(0,FM.SH)(i)).replace(/<br>/g,"<br/>")},"cleanUpSvgCode"),Y4=(0,FR.eW)((e="",t)=>{let n=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":"100%",i=YZ(`<body style="margin:0">${e}</body>`);return`<iframe style="width:100%;height:${n};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="allow-top-navigation-by-user-activation allow-popups">
282
282
  The "iframe" tag is not supported by your browser.
283
- </iframe>`},"putIntoIFrame"),Y6=(0,FR.eW)((e,t,n,i,o)=>{let a=e.append("div");a.attr("id",n),i&&a.attr("style",i);let s=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return o&&s.attr("xmlns:xlink",o),s.append("g"),e},"appendDivSvgG");function Y9(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}(0,FR.eW)(Y9,"sandboxedIframe");var Y8=(0,FR.eW)((e,t,n,i)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),Y7=(0,FR.eW)(async function(e,t,n){let i,o;YF();let a=YX(t);t=a.code;let s=(0,FA.iE)();FR.cM.debug(s),t.length>(s?.maxTextSize??5e4)&&(t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");let l="#"+e,u="i"+e,d="#"+u,p="d"+e,h="#"+p,f=(0,FR.eW)(()=>{let e=_?d:h,t=(0,FI.Ys)(e).node();t&&"remove"in t&&t.remove()},"removeTempElements"),m=(0,FI.Ys)("body"),_="sandbox"===s.securityLevel,g="loose"===s.securityLevel,y=s.fontFamily;if(void 0!==n){if(n&&(n.innerHTML=""),_){let e=Y9((0,FI.Ys)(n),u);(m=(0,FI.Ys)(e.nodes()[0].contentDocument.body)).node().style.margin=0}else m=(0,FI.Ys)(n);Y6(m,e,p,`font-family: ${y}`,"http://www.w3.org/1999/xlink")}else{if(Y8(document,e,p,u),_){let e=Y9((0,FI.Ys)("body"),u);(m=(0,FI.Ys)(e.nodes()[0].contentDocument.body)).node().style.margin=0}else m=(0,FI.Ys)("body");Y6(m,e,p)}try{i=await YU.fromText(t,{title:a.title})}catch(e){if(s.suppressErrorRendering)throw f(),e;i=await YU.fromText("error"),o=e}let b=m.select(h).node(),E=i.type,S=b.firstChild,T=S.firstChild,C=Y3(s,E,i.renderer.getClasses?.(t,i),l),x=document.createElement("style");x.innerHTML=C,S.insertBefore(x,T);try{await i.renderer.draw(t,e,Fk.X.version,i)}catch(n){throw s.suppressErrorRendering?f():B5.draw(t,e,Fk.X.version),n}let k=m.select(`${h} svg`);jn(E,k,i.db.getAccTitle?.(),i.db.getAccDescription?.()),m.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let w=m.select(h).node().innerHTML;if(FR.cM.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),w=Y5(w,_,(0,FA.ku)(s.arrowMarkerAbsolute)),_?w=Y4(w,m.select(h+" svg").node()):g||(w=F9.Z.sanitize(w,{ADD_TAGS:YQ,ADD_ATTR:YJ,HTML_INTEGRATION_POINTS:{foreignobject:!0}})),YH(),o)throw o;return f(),{diagramType:E,svg:w,bindFunctions:i.db.bindFunctions}},"render");function je(e={}){let t=(0,FA.Yc)({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),(0,FA.dY)(t),t?.theme&&t.theme in FA._j?t.themeVariables=FA._j[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=FA._j.default.getThemeVariables(t.themeVariables));let n="object"==typeof t?(0,FA.Yn)(t):(0,FA.ZD)();(0,FR.Ub)(n.logLevel),YF()}(0,FR.eW)(je,"initialize");var jt=(0,FR.eW)((e,t={})=>{let{code:n}=YK(e);return YU.fromText(n,t)},"getDiagramFromText");function jn(e,t,n,i){YY(t,e),Yj(t,n,i,t.attr("id"))}(0,FR.eW)(jn,"addA11yInfo");var jr=Object.freeze({render:Y7,parse:Y1,getDiagramFromText:jt,initialize:je,getConfig:FA.iE,setConfig:FA.v6,getSiteConfig:FA.ZD,updateSiteConfig:FA.Tb,reset:(0,FR.eW)(()=>{(0,FA.mc)()},"reset"),globalReset:(0,FR.eW)(()=>{(0,FA.mc)(FA.u_)},"globalReset"),defaultConfig:FA.u_});(0,FR.Ub)((0,FA.iE)().logLevel),(0,FA.mc)((0,FA.iE)());var ji=(0,FR.eW)((e,t,n)=>{FR.cM.warn(e),(0,FM.bZ)(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),jo=(0,FR.eW)(async function(e={querySelector:".mermaid"}){try{await ja(e)}catch(t){if((0,FM.bZ)(t)&&FR.cM.error(t.str),jy.parseError&&jy.parseError(t),!e.suppressErrors)throw FR.cM.error("Use the suppressErrors option to suppress these errors"),t}},"run"),ja=(0,FR.eW)(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:".mermaid"}){let i,o,a=jr.getConfig();if(FR.cM.debug(`${!e?"No ":""}Callback function found`),n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error("Nodes and querySelector are both undefined");FR.cM.debug(`Found ${i.length} diagrams`),a?.startOnLoad!==void 0&&(FR.cM.debug("Start On Load: "+a?.startOnLoad),jr.updateSiteConfig({startOnLoad:a?.startOnLoad}));let s=new FM.w8.InitIDGenerator(a.deterministicIds,a.deterministicIDSeed),l=[];for(let t of Array.from(i)){if(FR.cM.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");let n=`mermaid-${s.next()}`;o=t.innerHTML,o=(0,FL.Z)(FM.w8.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");let i=FM.w8.detectInit(o);i&&FR.cM.debug("Detected early reinit: ",i);try{let{svg:i,bindFunctions:a}=await j_(n,o,t);t.innerHTML=i,e&&await e(n),a&&a(t)}catch(e){ji(e,l,jy.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),js=(0,FR.eW)(function(e){jr.initialize(e)},"initialize"),jl=(0,FR.eW)(async function(e,t,n){FR.cM.warn("mermaid.init is deprecated. Please use run instead."),e&&js(e);let i={postRenderCallback:n,querySelector:".mermaid"};"string"==typeof t?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await jo(i)},"init"),jc=(0,FR.eW)(async(e,{lazyLoad:t=!0}={})=>{YF(),(0,FA.KO)(...e),!1===t&&await YB()},"registerExternalDiagrams"),ju=(0,FR.eW)(function(){if(jy.startOnLoad){let{startOnLoad:e}=jr.getConfig();e&&jy.run().catch(e=>FR.cM.error("Mermaid failed to initialize",e))}},"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",ju,!1);var jd=(0,FR.eW)(function(e){jy.parseError=e},"setParseErrorHandler"),jp=[],jh=!1,jf=(0,FR.eW)(async()=>{if(!jh){for(jh=!0;jp.length>0;){let e=jp.shift();if(e)try{await e()}catch(e){FR.cM.error("Error executing queue",e)}}jh=!1}},"executeQueue"),jm=(0,FR.eW)(async(e,t)=>new Promise((n,i)=>{let o=(0,FR.eW)(()=>new Promise((o,a)=>{jr.parse(e,t).then(e=>{o(e),n(e)},e=>{FR.cM.error("Error parsing",e),jy.parseError?.(e),a(e),i(e)})}),"performCall");jp.push(o),jf().catch(i)}),"parse"),j_=(0,FR.eW)((e,t,n)=>new Promise((i,o)=>{let a=(0,FR.eW)(()=>new Promise((a,s)=>{jr.render(e,t,n).then(e=>{a(e),i(e)},e=>{FR.cM.error("Error parsing",e),jy.parseError?.(e),s(e),o(e)})}),"performCall");jp.push(a),jf().catch(o)}),"render"),jg=(0,FR.eW)(()=>Object.keys(FA.Bf).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),jy={startOnLoad:!0,mermaidAPI:jr,parse:jm,render:j_,init:jl,run:jo,registerExternalDiagrams:jc,registerLayoutLoaders:FD.jM,initialize:js,parseError:void 0,contentLoaded:ju,setParseErrorHandler:jd,detectType:FA.Vg,registerIconPacks:FO.ef,getRegisteredDiagramsMetadata:jg};let jb=(0,G.forwardRef)((e,t)=>{let{className:n,code:i,showCopyButton:o=!0,theme:a="light"}=e,s=(0,G.useRef)(null),[l,u]=(0,G.useState)(!1),[d,p]=(0,G.useState)(null),[h,f]=(0,G.useState)(!1);(0,G.useEffect)(()=>{jy.initialize({startOnLoad:!1,theme:"dark"===a?"dark":"default",securityLevel:"loose",fontFamily:"inherit"})},[a]),(0,G.useEffect)(()=>{i&&s.current&&(async()=>{try{p(null);let e=`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,t=s.current;t.innerHTML="";let{svg:n}=await jy.render(e,i);t.innerHTML=n,f(!0)}catch(e){p(e instanceof Error?e.message:"渲染失败")}})()},[i,h]);let m=()=>{i&&(MR(i),u(!0),setTimeout(()=>{u(!1)},3e3))};return(0,W.jsx)("div",{className:cP()("ct-mermaid-view",`ct-hljs-${a}`,n),ref:t,children:(0,W.jsxs)("div",{className:"ct-mermaid-view-wrapper",children:[(0,W.jsxs)("div",{className:"ct-mermaid-view-header",children:[(0,W.jsx)("div",{className:"ct-mermaid-view-title",children:"Mermaid"}),!1!==o&&(0,W.jsx)("div",{className:"ct-mermaid-view-copy",onClick:m,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),m())},role:"button",tabIndex:0,title:l?"已复制":"复制代码",children:(0,W.jsx)(Mp,{size:16,type:l?"icon-check":"fuzhi3"})})]}),(0,W.jsx)("div",{className:"ct-mermaid-view-container",children:d?(0,W.jsxs)("div",{className:"ct-mermaid-view-error",children:[(0,W.jsxs)("div",{className:"error-message",children:[(0,W.jsx)(Mp,{type:"icon-warning",size:16}),(0,W.jsxs)("span",{children:["图表渲染失败: ",d]})]}),(0,W.jsxs)("details",{className:"error-details",children:[(0,W.jsx)("summary",{children:"查看原始代码"}),(0,W.jsx)("pre",{className:"error-code",children:(0,W.jsx)("code",{children:i})})]})]}):(0,W.jsx)("div",{ref:s,className:"ct-mermaid-view-content"})})]})})});jb.displayName="MermaidView";let jv=dq.config(jb),jE="",jS=["img","code","pre","link-reference"],jT=Ma((0,G.forwardRef)(e=>{let{className:t,onReady:n,content:i,needCodeHeader:o=!0,theme:a="light",enableSourcePos:s=!1,...l}=e;function u(e,t){let n;if(!e)return[];let i=[...jS,...t||[]],o=/\[[^\]]*\]\([^)]*\)/g,a=i.length>0?RegExp(`<(${i.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=o.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});if(a)for(a.lastIndex=0;null!==(n=a.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});for(let t of(u.sort((e,t)=>e.start-t.start),u))t.start>l&&s.push(...e.substring(l,t.start).split("")),s.push(t.content),l=t.end;return l<e.length&&s.push(...e.substring(l).split("")),s}(0,G.useEffect)(()=>{Fv(),null==n||n()},[n]);let d=(0,G.useRef)(null),[p,h]=(0,G.useState)(()=>(null==l?void 0:l.typewriterEffect)?jE:i),[f,m]=(0,G.useState)(()=>(null==l?void 0:l.typewriterEffect)?u(i,l.whitelistTags):[]),[_,g]=(0,G.useState)(0),y=(0,G.useRef)(null),b=()=>{y.current&&(clearTimeout(y.current),y.current=null)};(0,G.useEffect)(()=>{if(b(),!(null==l?void 0:l.typewriterEffect)){h(i),m([]);return}let e=u(i,l.whitelistTags);if(_>=e.length)h(i),g(e.length),m([]);else{let t=e.slice(0,_),n=e.slice(_);h(t.join("")),m(n)}},[i,null==l?void 0:l.typewriterEffect,null==l?void 0:l.whitelistTags]),(0,G.useEffect)(()=>{if(!(null==l?void 0:l.typewriterEffect)||0===f.length)return void b();let e=Math.max(Math.floor(f.length/10),2),t=()=>{m(t=>{if(0===t.length)return t;let n=t.slice(0,e),i=t.slice(e);return h(e=>e+n.join("")),g(t=>t+e),i})};return b(),t(),y.current=setTimeout(()=>{let e=()=>{t(),y.current=setTimeout(e,50)};e()},50),b},[f.length,null==l?void 0:l.typewriterEffect]);let E=(0,G.useMemo)(()=>{jE=p;let e={common_hypertitle_text_style__font_size:"h1",common_largetitle_text_style__font_size:"h1",common_h1_text_style__font_size:"h1",common_h2_text_style__font_size:"h2",common_h3_text_style__font_size:"h3",common_h4_text_style__font_size:"h4",common_h5_text_style__font_size:"h5",common_body_text_style__font_size:"span",common_footnote_text_style__font_size:"span"};return p.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,i)=>{let o="",a="",s="",l=n.match(/sizeToken=([\w_]+)/),u=n.match(/colorTokenV2=([\w_]+)/),d=n.match(/color=([\w_]+)/),p=n.match(/color=(?:"|')?(#[0-9a-fA-F]{3,8})(?:"|')?/);l&&(o=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let h=[];o&&h.push(`font-size: var(--${o})`),a?h.push(`color: var(--${a})`):s&&h.push(`color: ${s}`);let f=h.join("; "),m=e[o]||"span";return`<${m} style="${f}" class="markdownFont">${i}</${m}>`})},[p]),S=(0,G.useMemo)(()=>FE(E,{genFrame:(e,t)=>({htmlTag:"img",selfClose:!0,attr:{draggable:"false",style:"vertical-align: text-center; display: inline-block; pointer-events: none;",class:"emoji",title:`[${e}]`,src:t.url||t.staticURL||"",alt:e}})}),[E]),T=(0,G.useMemo)(()=>{let e=new IM({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==FT?void 0:FT.getLanguage(t)))try{return null==FT?void 0:FT.highlight(t,e,!0).value}catch(e){}return""}});if(s&&e.use(e=>{e.core.ruler.push("add_source_pos",e=>{e.tokens.forEach(e=>{if(e.map){let[t,n]=e.map;e.attrSet("data-source-start-line",String(t)),e.attrSet("data-source-end-line",String(n))}})})}),e.linkify.add("dingtalk:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),S=(S=(S=S.replace(/&#x2F;/g,"/")).replace(/&#39;/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!o)return{html:e.render(S),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,i)=>{let o=e[i],a=o.info.trim()||"plaintext",s=o.content,l=`code-block-${n++}`,u="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,type:u}),`<div data-code-block-id="${l}" data-block-type="${u}"></div>`},{html:e.render(S),codeBlocks:t}},[S,o,s]),C=(null==l?void 0:l.generating)?"ct-markdown generating":"ct-markdown";return(0,W.jsxs)("div",{ref:d,className:cP()(C,`ct-hljs-${a}`,t),children:[(()=>{if(!o||0===T.codeBlocks.length)return(0,W.jsx)(Rb,{...l,children:T.html});let e=T.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let i of e)if(i.includes("data-code-block-id")){let e=T.codeBlocks[n];e&&("mermaid"===e.type?t.push((0,W.jsx)(jv,{code:e.code,showCopyButton:!0,theme:a},e.id)):t.push((0,W.jsx)(Fx,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else i.trim()&&t.push((0,W.jsx)(Rb,{...l,children:i},`html-${t.length}`));return(0,W.jsx)(W.Fragment,{children:t})})(),(()=>{let{generating:e}=l||{};return!e||T.html?null:(0,W.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),jC=dq.config(jT),jx=Ma((0,G.forwardRef)((e,t)=>{let{className:n}=e;return(0,W.jsx)("div",{className:cP()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jk=dq.config(jx),jw=Ma((0,G.forwardRef)((e,t)=>{let{className:n,text:i}=e;return(0,W.jsx)("div",{className:cP()("ct-origin",n),children:(0,W.jsx)("div",{className:"origin-tip-inner",children:i})})}),{displayName:"Origin"}),jN=dq.config(jw),jD=Ma((0,G.forwardRef)((e,t)=>{let{className:n,indicator:i,shape:o="default",size:a="large",...s}=e,l={...s,size:a};if(!i&&o&&"default"!==o){let e=`load-container ${o}`;l.indicator=(0,W.jsx)("div",{className:e,children:(0,W.jsx)("div",{className:"loader"})})}return(0,W.jsx)(vj,{...l,ref:t,className:cP()(`ct-loading ${a} ${o}`,n)})}),{displayName:"Loading"}),jO=dq.config(jD),jM=Ma((0,G.forwardRef)((e,t)=>{let{className:n,headerStyle:i,children:o,footer:a,footerClassName:s,placement:l,...u}=e;return(0,W.jsxs)(bC,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...i},className:cP()(`ct-drawer ${l}`,n),children:[o,a&&a.length&&(0,W.jsx)("div",{className:cP()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jA=dq.config(jM),jR=Ma((0,G.forwardRef)((e,t)=>{let{className:n,shape:i="dot",showStatus:o=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,W.jsxs)("div",{children:["查看更多",(0,W.jsx)(hj,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...h}=e,[f,m]=(0,G.useState)([]),[_,g]=(0,G.useState)(l);return((0,G.useEffect)(()=>{m(s.map((e,t)=>_&&u<t+1?null:(0,W.jsx)(SN.Item,{title:e.title,content:e.content,status:o?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,W.jsx)("div",{className:cP()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...h,ref:t,children:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(SN,{current:a,shape:i,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:f}),_&&s.length>u&&(0,W.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,W.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jL=dq.config(jR);var jI=function(e){return e.Generating="generating",e.Stopped="stopped",e}({});let jP="停止生成",jF=Ma((0,G.forwardRef)((e,t)=>{let{className:n,show:i=!0,status:o=jI.Generating,stopText:a=jP,stopIcon:s,stoppedText:l,onStop:u}=e;return i?(0,W.jsxs)("div",{className:cP()("ct-stop-generate",n),children:[o===jI.Generating&&(0,W.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,W.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jP]}),o===jI.Stopped&&(0,W.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jB=dq.config(jF),jY=(0,G.forwardRef)((e,t)=>{let{className:n,defaultExpanded:i=!1,header:o,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:h,expanded:f}=e,[m,_]=(0,G.useState)(f||i);(0,G.useEffect)(()=>{void 0!==f&&f!==m&&_(f)},[f]);let g=(e,t,n)=>{if(n.stopPropagation(),l){null==l||l(e,t);return}(null==e?void 0:e.url)&&window.open(null==e?void 0:e.url,"_blank")},y=m?"expand":"";return(0,W.jsxs)("div",{className:cP()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===o)return null;if("detail"===u)return(()=>{if(!1===o)return null;let e=(null==o?void 0:o.icon)||"close",t=(null==o?void 0:o.title)||"引用信息";return(0,W.jsxs)("div",{className:`reference-header ${u}`,children:[(0,W.jsx)("div",{className:"reference-text",children:t}),(0,W.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:Mh(e,"xs")})]})})();let e=(null==o?void 0:o.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,W.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e=>{if(e.stopPropagation(),p)return p(!m);_(!m)})(e)},children:[(0,W.jsxs)("div",{className:"reference-name",children:[Mh(e),(0,W.jsx)("div",{className:"reference-title",children:null==o?void 0:o.title})]}),(0,W.jsx)("div",{className:"reference-operate",onClick:e=>{(e=>{if(e.stopPropagation(),s)return s(!m);_(!m)})(e)},children:(0,W.jsx)(Mp,{type:m?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(m||"simple"!==u)?(0,W.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==h||h(m)},children:[m&&"simple"===u&&a.map((e,t)=>(0,W.jsxs)("div",{className:"reference-item",children:[(0,W.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&Mh(null==e?void 0:e.sourceIcon),(0,W.jsx)("div",{className:"reference-text",onClick:n=>g(e,t,n),children:null==e?void 0:e.name}),(null==e?void 0:e.modifyTime)&&!1]},t)),"detail"===u&&a.map((e,t)=>(0,W.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,W.jsxs)("div",{className:"reference-title",children:[(0,W.jsxs)("div",{className:"reference-name",children:[(0,W.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&Mh(null==e?void 0:e.sourceIcon),(0,W.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,W.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jj=dq.config(jY),jU=(0,G.forwardRef)((e,t)=>{let{className:n,defaultExpanded:i=!1,header:o=(0,W.jsxs)("div",{children:["相关问题",(0,W.jsx)(hj,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,G.useState)(i),h=void 0!==a?a:d;return(0,W.jsxs)("div",{className:cP()("ct-recommend",n),ref:t,children:[(0,W.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!h),null==l||l(!h)},children:o}),(0,W.jsx)(hc.CSSTransition,{in:h,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,W.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,W.jsx)("div",{className:"recommend-container",children:((e,t)=>(0,W.jsx)(hc.CSSTransition,{in:h,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,W.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t))(e,t)}))})})]})}),jz=dq.config(jU),jH=(0,G.forwardRef)((e,t)=>{let{className:n,header:i,footer:o,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:h,querySugList:f,onQuerySugClick:m}=e,[_,g]=(0,G.useState)(!1),y=h&&_&&f&&f.length>0;return(0,W.jsxs)("div",{ref:t,className:cP()("ct-rich-text-input",n),children:[(0,W.jsx)("div",{className:"header",children:i}),(0,W.jsxs)("div",{className:cP()("input-container",{focus:_}),children:[(0,W.jsx)("div",{className:"rich-text-input",contentEditable:!0,onFocus:e=>{g(!0),null==u||u(e)},onBlur:e=>{g(!1),null==d||d(e)},onChange:e=>{null==l||l(e.target.innerText)}}),(0,W.jsx)("div",{className:"input-footer",children:o}),(0,W.jsx)(hc.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,W.jsx)("div",{className:cP()("query-sug",a),children:(0,W.jsx)("div",{className:"query-sug-list",children:null==f?void 0:f.map((e,t)=>(0,W.jsx)("div",{className:"query-sug-item",onClick:()=>{null==m||m(e,t)},children:e.label},e.value))})})})]})]})}),jV=(0,G.forwardRef)((e,t)=>{let{className:n}=e;return(0,W.jsx)("div",{className:cP()(n,"ct-ai-loading"),ref:t,children:(0,W.jsxs)("div",{className:cP()("loading-container","short-container"),children:[(0,W.jsx)("div",{className:cP()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,W.jsx)("div",{className:cP()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,W.jsx)("div",{className:cP()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jW=dq.config(jV),jG=()=>(0,W.jsx)("svg",{viewBox:"0 0 1024 1024",className:"radio-item-icon",children:(0,W.jsx)("path",{d:"M562.005333 512l-181.034666 181.034667a42.666667 42.666667 0 1 0 60.330666 60.330666l211.2-211.2a42.666667 42.666667 0 0 0 0-60.330666l-211.2-211.2a42.666667 42.666667 0 1 0-60.330666 60.330666L562.005333 512z"})}),jq=Ma(M8((0,G.forwardRef)(e=>e.options&&0!==e.options.length?(0,W.jsx)("div",{className:"ct-radio-group",children:e.options.map(t=>(0,W.jsxs)("div",{className:cP()("radio-item",{active:t.value===e.value,disabled:e.disabled||t.disabled}),onClick:()=>{var n;return n=t.value,void(e.onChange&&e.onChange(n))},children:[(0,W.jsxs)("div",{className:"radio-item-title-container",children:[(0,W.jsx)("div",{className:"radio-item-title",children:t.label}),(0,W.jsx)(jG,{})]}),t.description&&(0,W.jsx)("div",{className:"radio-item-desc",children:t.description})]},t.value))}):null),{labelLayout:"vertical",coverStyle:!1,enableHoverState:!1,enableDisabledState:!1}),{displayName:"RadioGroup"}),j$=dq.config(jq),jK=Ma(M8((0,G.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,G.useState)(e.value||[]);return(0,W.jsx)("div",{className:cP()("ct-checkbox",{"ct-checkbox-disabled":e.disabled}),children:e.options.map(i=>(0,W.jsxs)("div",{className:cP()("checkbox-item",{active:t.indexOf(i.value)>-1}),onClick:()=>(i=>{if(e.disabled)return;let o=t.indexOf(i)>-1?t.filter(e=>e!==i):[...t,i];n(o),e.onChange&&e.onChange(o)})(i.value),children:[(0,W.jsx)(fq,{className:"checkbox-item-checkbox",checked:t.indexOf(i.value)>-1,disabled:e.disabled}),(0,W.jsxs)("div",{className:"checkbox-item-content-container",children:[(0,W.jsx)("div",{className:"checkbox-item-title",children:i.label}),i.description&&(0,W.jsx)("div",{className:"checkbox-item-desc",children:i.description})]})]},i.value))})}),{labelLayout:"vertical",coverStyle:!1,enableHoverState:!1,enableDisabledState:!1}),{displayName:"Checkbox"}),jZ=dq.config(jK),jQ=Ma((0,G.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,G.useState)(e.value||[]);return(0,W.jsxs)("div",{className:"ct-checkbox-group",children:[(0,W.jsx)(jZ,{options:e.options,value:t,onChange:e=>{n(e)}}),(0,W.jsx)(My,{type:"primary",className:"confirm-button",size:"medium",disabled:0===t.length,onClick:()=>{e.onChange&&e.onChange(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jJ=dq.config(jQ),jX=M8(e=>{let{className:t,dataSource:n,mode:i="single",buttonCols:o=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,G.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/o)},(e,t)=>{let a=t*o,p=Math.min(a+o,(null==n?void 0:n.length)||0),h=null==n?void 0:n.slice(a,p);return(null==h?void 0:h.length)?(0,W.jsx)("div",{className:"select-row-container",children:(e=>e&&e.length?e.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,h="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?h="selected":"object"==typeof u&&"value"in u&&u.value===n&&(h="selected");let f=p;return u&&"single"===i&&"normal"===h&&(f=!0),(0,W.jsx)(m_,{onClick:()=>((e,t)=>{if("multiple"===i)if(Array.isArray(u)){let n="normal"===t?[...u,null==e?void 0:e.value]:u.filter(t=>t!==(null==e?void 0:e.value));d(n),null==l||l(n,"itemClick")}else{let t=[null==e?void 0:e.value];d(t),null==l||l(t,"itemClick")}if("single"===i){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,h),type:"normal",disabled:f,className:`select-item ${h} row${o}`,size:s,children:a},`select_${t}`)}):null)(h)},`row_${t}`):null});return(0,W.jsx)("div",{className:cP()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),j1=M8((0,G.forwardRef)((e,t)=>{let{className:n,size:i="medium",mode:o="single",onChange:a,...s}=e;return(0,W.jsx)(_k,{...s,className:cP()("ct-select",n),size:i,ref:t,mode:o,onChange:a})})),j0=Ma((0,G.forwardRef)((e,t)=>{let{className:n,display:i="select",buttonCols:o=2,dataSource:a,mode:s="single",onChange:l,...u}=e;return"button"===((null==a?void 0:a.length)&&(null==a?void 0:a.length)>6?"select":i)?(0,W.jsx)(jX,{className:n,dataSource:a,mode:s,buttonCols:o,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,W.jsx)(j1,{...u,className:cP()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:cP()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),j2=dq.config(j0),j3=(0,G.forwardRef)((e,t)=>{let{className:n,defaultExpanded:i=!1,header:o=(0,W.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,G.useRef)(null),h=(0,G.useRef)(null),[f,m]=(0,G.useState)(i),[_,g]=(0,G.useState)(i),y=void 0!==s?s:f,b=(e,t)=>{var n;if(!u)return void(t?(e.style.height="auto",e.style.width="auto",g(!0)):(e.style.height="0",g(!1)));let i=e.getBoundingClientRect().height,o=e.getBoundingClientRect().width,a=(null==(n=h.current)?void 0:n.getBoundingClientRect().width)||o;if(t){e.style.height="0",e.style.width=`${a}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),e.style.height="auto";let t=e.getBoundingClientRect().height,n=e.getBoundingClientRect().width;e.style.height="0",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height=`${t}px`,e.style.width=`${n}px`});let i=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",i)};e.addEventListener("transitionend",i)}else{e.style.height=`${i}px`,e.style.width=`${o}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height="0",e.style.width=`${a}px`});let t=()=>{g(!1),e.removeEventListener("transitionend",t)};e.addEventListener("transitionend",t)}};return(0,G.useEffect)(()=>{let e=p.current;e&&(y?(g(!0),u?Promise.resolve().then(()=>{b(e,!0)}):(e.style.height="auto",e.style.width="auto")):u?b(e,!1):(e.style.height="0",g(!1)))},[y,u]),(0,W.jsxs)("div",{className:cP()("ct-flip",n),ref:t,children:[(0,W.jsx)("div",{className:"flip-header-container",ref:h,children:a||(0,W.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&m(e)},children:[o,(0,W.jsx)("span",{className:"flip-header-icon",children:(0,W.jsx)(Mp,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,W.jsx)("div",{className:"flip-content",ref:p,style:{height:i?"auto":0,width:i?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),j5=dq.config(j3),j4=(0,G.forwardRef)((e,t)=>{let{useText:n="使用",name:i,className:o,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:h,disabled:f=!1}=e,m=a?"selected":"";return m=d?`${m} full-width`:`${m}`,m=l?`${m} enable-click`:`${m}`,(0,W.jsxs)("div",{className:cP()(`ct-tool-status ${m} ${s} ${f?"disabled":""}`,o),ref:t,onClick:t=>{f||(t.stopPropagation(),null==l||l(e))},children:[(0,W.jsx)(Mp,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,W.jsx)("div",{className:"next-btn-text next-btn-primary",onClick:t=>{var n;t.stopPropagation(),null==u||null==(n=u.onAuthClick)||n.call(u,e)},children:null==u?void 0:u.content}),(0,W.jsxs)("div",{className:"content-container",children:[(0,W.jsx)("div",{className:"content-use-tips",children:n}),h&&(0,W.jsx)("div",{className:"content-group",children:h}),i&&(0,W.jsx)("div",{className:"content-name",children:i}),p&&(0,W.jsx)("div",{className:"content-detail",children:p})]})]})}),j6=dq.config(j4),j9=Ma((0,G.forwardRef)(e=>{let{className:t,children:n,...i}=e;return(0,W.jsx)(gP,{...i,className:cP()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:gP.Panel}),j8=dq.config(j9),j7=(0,G.forwardRef)((e,t)=>{let{className:n,size:i="small",hasBorder:o=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,G.useState)(!1);return(0,W.jsxs)("div",{className:"ct-table-container",children:[a?(0,W.jsxs)("div",{className:"ct-table-header",children:[a&&(0,W.jsx)("div",{className:"ct-table-title",children:a}),s?(0,W.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,W.jsx)(Mp,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,W.jsx)(TZ,{...l,ref:t,className:cP()("ct-table",{[`ct-table-${i}`]:i,"ct-table-no-border":!o},n),size:i})]})});j7.displayName="Table";let Ue=dq.config(j7),Ut=(0,G.forwardRef)((e,t)=>{let{className:n,text:i,...o}=e;return(0,W.jsxs)("div",{...o,className:cP()("ct-error-notice",n),ref:t,children:[(0,W.jsx)("div",{className:"ct-error-notice-icon",children:(0,W.jsx)(hj,{size:16,type:"prompt"})}),(0,W.jsx)("span",{className:"ct-error-notice-text",children:i})]})});Ut.displayName="ErrorNotice";let Un=dq.config(Ut),Ur=(0,G.forwardRef)((e,t)=>{let{className:n,...i}=e;return(0,W.jsx)("div",{...i,className:cP()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,W.jsx)("div",{className:"ct-empty-line"},t))})});Ur.displayName="Empty";let Ui=dq.config(Ur),Uo=(0,G.forwardRef)((e,t)=>{let{className:n,title:i="",content:o,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:h=!0,showDownloadButton:f=!0,contentHeight:m=128,..._}=e,g=m-25,y=(0,G.useRef)(null),[b,E]=(0,G.useState)(0),[S,T]=(0,G.useState)(!1),[C,x]=(0,G.useState)(()=>m>128?128:m),k=e=>{let t=Array.from(e.children);return 0===t.length?e:k(t[t.length-1])},w=MW((0,G.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=k(e);if(!n)return;let i=n.getBoundingClientRect(),o=i.top-t.top,a=o+i.height;if(m>128&&C<m){let e=C-25;if(a>e)return void x(Math.min(m,C+(a-e)))}if(!(a+b<g&&o+b>0))return void E(-o)},[b,m,C]),200);(0,G.useEffect)(()=>{w()},[]),(0,G.useEffect)(()=>{if("string"==typeof o)return void w();if(!y.current)return;let e=new MutationObserver(()=>{w()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[o,w]);let N=e=>{i&&p&&s&&(e.stopPropagation(),null==s||s())},D=e=>{e.stopPropagation()};return(0,W.jsxs)("div",{..._,className:cP()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:N,children:[i?(0,W.jsxs)("div",{className:"ct-document-header",children:[(0,W.jsxs)("div",{className:"ct-document-header-left",children:[(0,W.jsx)(Mp,{type:"document",className:"ct-document-header-icon"}),(0,W.jsx)("span",{className:cP()("ct-document-header-title"),children:i})]}),(0,W.jsxs)("div",{className:cP()("ct-document-header-actions"),children:[(0,W.jsxs)("div",{className:cP()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:N,children:[(0,W.jsx)(Mp,{type:"preview",className:"ct-document-header-preview-icon"}),(0,W.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,W.jsx)("div",{className:cP()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!h||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,W.jsx)(Mp,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,W.jsx)("div",{className:cP()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!f||!d&&!u}),onClick:d?D:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,W.jsx)(Mp,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,W.jsx)("div",{className:"ct-document-header",children:(0,W.jsxs)("div",{className:"ct-document-header-left",children:[(0,W.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,W.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),o?(0,W.jsxs)("div",{className:cP()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,W.jsx)("div",{className:"ct-document-mask"}),(0,W.jsx)("div",{className:"ct-document-content-inner",children:(0,W.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:D,children:o})})]}):(0,W.jsx)("div",{className:cP()("ct-document-content",{"ct-document-content-generating":a}),children:(0,W.jsx)("div",{className:"ct-document-content-inner",children:(0,W.jsx)(Ui,{})})})]})});Uo.displayName="Document";let Ua=dq.config(Uo),Us="0.3.52-beta.4",Ul=e=>{let{globalExpandCode:t}=e,[i,o]=(0,G.useState)(!1),[a,s]=(0,G.useState)(t);(0,G.useEffect)(()=>{o(!0)},[]),(0,G.useEffect)(()=>{s(t)},[t]);let l=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),u=(0,iQ.kebabCase)(e.demoKey),d=`${u}-container`;return(0,W.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,W.jsxs)("div",{id:`${u}-desc`,className:"demo-item-desc markdown",children:[(0,W.jsx)(iJ,{id:d,title:l["@demo"],component:"h3"}),(0,W.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,W.jsx)(rg,{remarkPlugins:[iO],children:l["@remarks"]})})]}),(0,W.jsxs)(cO,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${u}-mount`),require:e=>{let t={"@alifd/chat":V,"@alifd/next":F,"react-dom":$,"styled-components":B,react:q(),classnames:cP()},i=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return i&&n(58187)(`./${i[2]}/style`),t[e]}},noInline:!0,children:[(0,W.jsx)("div",{id:`${u}-mount`,className:"next-demo-mount",children:i?(0,W.jsx)(cA,{}):null}),i?(0,W.jsx)(cL,{}):null,(0,W.jsx)("div",{id:`${u}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,W.jsx)("div",{id:`${u}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,W.jsxs)(h2.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,W.jsx)("span",{id:`${u}-icon-hide`,onClick:()=>{s(!a)},children:(0,W.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,W.jsx)("path",{transform:"translate(10.457453, 10.101961) rotate(90.000000) translate(-10.457453, -10.101961)",d:"M14.4307124,13.5667899 L15.1349452,14.276759 L10.7473676,18.6288871 L6.42783259,14.2738791 L7.13782502,13.5696698 L10.7530744,17.2147744 L14.4307124,13.5667899 Z M4.79130753,8.067524 L16.3824174,11.1733525 L16.1235984,12.1392784 L4.53248848,9.03344983 L4.79130753,8.067524 Z M10.8154102,1.57503552 L15.1349452,5.93004351 L14.4249528,6.63425282 L10.809949,2.98914817 L7.13206544,6.6371327 L6.42783259,5.92716363 L10.8154102,1.57503552 Z"})})}),children:["收起代码",(0,W.jsx)("br",{}),(0,W.jsx)("br",{}),"小提示:",(0,W.jsx)("br",{}),(0,W.jsx)("br",{}),(0,W.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,W.jsx)("br",{}),(0,W.jsx)("br",{}),(0,W.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,W.jsx)("div",{id:`${u}-body`,className:"next-demo-body",style:{display:a?"block":"none"},children:(0,W.jsx)("div",{id:`${u}-live-editor`,children:(0,W.jsx)("div",{id:`${u}-live-body`,className:"react-live-body",children:(0,W.jsx)(cM,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Uc=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:i,onToggleLiveDemo:o,data:a=[]}=e,[s,l]=(0,G.useState)(n),[u,d]=(0,G.useState)(t),p={viewBox:"0 0 16 16",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","aria-haspopup":"true","aria-expanded":"false",style:{width:20,height:20,padding:2}};return(0,W.jsxs)("div",{className:"demo-index",children:[(0,W.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,W.jsx)(h2.Tooltip,{trigger:(0,W.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof o&&o(!u)},children:[(0,W.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,W.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})}),(0,W.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,W.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})})]}),children:"使用预览模式"}),(0,W.jsx)(h2.Tooltip,{trigger:(0,W.jsxs)("span",{id:"expand-all",role:"img","aria-label":"code",className:"code-box-expand-trigger","aria-haspopup":"true","aria-expanded":"false",onClick:()=>{l(!s),"function"==typeof i&&i(!s)},children:[(0,W.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,W.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})}),(0,W.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,W.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})})]}),children:"展开所有代码"})]}),(0,W.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,W.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,W.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};$.render((0,W.jsx)(()=>{let[e,t]=(0,G.useState)(!0),[n,i]=(0,G.useState)(!1),o={"ai-news-overview":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown, Message } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst aiNewsOverviewContent = `基于我收集到的信息,以下是近1个月AI方向上的重要新闻和进展。\n# 近1个月AI方向重要新闻概览\n\n---\n\n## 一、国家战略层面重大进展\n\n### 《关于深入实施"人工智能+"行动的意见》正式发布\n\n8月26日,国务院印发了《关于深入实施"人工智能+"行动的意见》,明确了实施"人工智能+"行动的总体要求、发展目标和重点方向。这份文件是中国AI发展的重要"路线图",具有里程碑意义。\n\n**主要内容包括:**\n\n- **阶段性目标**:\n - **到2027年:** 新一代智能终端、智能体等应用普及率超70%\n - **到2030年:** 应用普及率超90%,智能经济成为重要增长极\n - **到2035年:** 全面步入智能经济和智能社会发展新阶段\n\n- **三大重点行动**:\n - "人工智能+"科学技术\n - "人工智能+"产业发展\n - "人工智能+"消费提质\n\n---\n\n## 二、国际AI大会成果\n\n### 2025世界人工智能大会成果丰硕\n\n............\n`;\nconst MarkdownAiNewsDemo = () => {\n const getCurrentTheme = () => {\n const darkThemes = [\n "@alife/theme-132027",\n "@alife/theme-130507",\n "@alife/theme-132134",\n ];\n const styleSheets = Array.from(document.styleSheets);\n const isDark = styleSheets.some((sheet) => {\n try {\n const href = sheet.href || "";\n return darkThemes.some((theme) => href.includes(theme));\n } catch (error) {\n return false;\n }\n });\n return isDark ? "dark" : "light";\n };\n return (\n <div style={{ padding: "20px", maxWidth: "1000px", margin: "0 auto" }}>\n <div className="demo-mobile-wrap">\n <Markdown\n content={aiNewsOverviewContent}\n theme={getCurrentTheme()}\n onReady={() => Message.notice("AI新闻概览Markdown已准备就绪")}\n />\n </div>\n </div>\n );\n};\nReactDOM.render(<MarkdownAiNewsDemo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 在渲染复杂文档结构方面的能力,包括标题层级、列表、引用等。"},{tag:"@demo",content:"AI新闻概览"},{tag:"@en",content:"AI News Overview"},{tag:"@order",content:"2"}]}},basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown, Message } from "@alifd/chat";\nimport copy from "copy-to-clipboard";\nimport "@alifd/chat/es/markdown/style";\nimport "@alifd/chat/es/html-render/style";\nimport "@alifd/chat/es/code-view/style";\nconst content = `## Markdown 基础语法\n\n这是一个段落文本,展示 **加粗**、*斜体* 和 [链接](https://www.example.com) 的用法。\n\n### 列表展示\n- 产品特点\n - 简单易用\n - 功能强大\n- 技术支持\n - 在线文档\n - 技术社区\n\n### 引用文本\n> Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档。\n\n### 代码展示\n\\`\\`\\`javascript\n// 一个简单的函数示例\nfunction greeting(name) {\n return \\`Hello, \\${name}!\\`;\n}\n\\`\\`\\`\n\n### 表格展示\n\n#### 基础表格\n| 功能特性 | 支持状态 | 说明 |\n| :- | :-: | -: |\n| 基础语法 | ✅ 支持 | 标题、段落、列表等 |\n| 代码高亮 | ✅ 支持 | 支持多种编程语言 |\n| 表格渲染 | ✅ 支持 | 支持对齐和样式 |\n| 图片预览 | ✅ 支持 | 点击放大查看 |\n| 链接处理 | ✅ 支持 | 自动识别和图标显示 |\n\n#### 复杂表格示例\n| 项目 | 进度 | 负责人 | 截止日期 | 状态 |\n| :- | :-: | :-: | -: | :-: |\n| 需求分析 | 100% | 张三 | 2025-01-15 | <font color=common_green1_color>已完成</font> |\n| UI设计 | 80% | 李四 | 2025-01-20 | <font color=common_blue1_color>进行中</font> |\n| 后端开发 | 60% | 王五 | 2025-01-25 | <font color=common_orange1_color>开发中</font> |\n| 前端开发 | 40% | 赵六 | 2025-01-30 | <font color=common_yellow1_color>待开始</font> |\n| 测试验收 | 0% | 钱七 | 2025-02-05 | <font color=common_gray1_color>未开始</font> |\n\n### 链接图标功能演示\n\n#### 普通链接示例\n点击 [百度搜索](https://www.baidu.com) 或 [GitHub](https://github.com) 访问外部网站,这些链接会显示链接图标。\n\n#### 自动链接示例\n直接输入网址 https://www.baidu.com 或 https://github.com,会自动识别为链接并显示链接图标。\n\n#### 复制功能链接\n点击 [复制 "Hello World"](copy://Hello%20World) 将文本复制到剪贴板。\n\n点击 [复制代码片段](copy://function%20test()%20%7B%0A%20%20console.log(\'Hello%20World!\');%0A%20%20return%20true;%0A%7D) 复制 JavaScript 代码。\n\n点击 [复制配置信息](copy://服务器地址:192.168.1.100%0A端口:8080%0A用户名:admin) 复制服务器配置。\n\n#### 消息功能链接\n点击 [发送问候消息](message://你好!欢迎使用我们的Markdown编辑器) 发送问候消息。\n\n点击 [发送提醒通知](message://提醒:您的会议将在10分钟后开始,请做好准备) 发送会议提醒。\n\n点击 [发送状态更新](message://任务状态已更新为:已完成) 发送任务状态更新。\n\n### 图标功能说明\n- \uD83D\uDD17 **普通链接**:显示链接图标,帮助用户识别外部链接\n- \uD83D\uDD17 **自动链接**:直接输入的网址会自动识别并显示链接图标\n- \uD83D\uDCCB **复制链接**:显示复制图标,表示点击后会复制内容到剪贴板\n- \uD83D\uDCAC **消息链接**:显示消息图标,表示点击后会发送消息\n\n**注意**:这些特殊的链接格式(copy:// 和 message://)是由 HTMLRenderer 组件处理的,Markdown 组件会将这些链接传递给底层的 HTML 渲染器。自动链接功能由 MarkdownIt 的 linkify 插件提供支持。\n`;\nconst MarkdownDemo = () => {\n const getCurrentTheme = () => {\n const darkThemes = [\n "@alife/theme-132027",\n "@alife/theme-130507",\n "@alife/theme-132134",\n ];\n const styleSheets = Array.from(document.styleSheets);\n const isDark = styleSheets.some((sheet) => {\n try {\n const href = sheet.href || "";\n return darkThemes.some((theme) => href.includes(theme));\n } catch (error) {\n return false;\n }\n });\n return isDark ? "dark" : "light";\n };\n const sendTextMessage = (message) => {\n Message.success(`消息已发送: ${message}`);\n };\n const copyText = (text) => {\n return () => {\n copy(text);\n };\n };\n const handleOpenLink = (url) => {\n window.open(url, "_blank");\n };\n return (\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n theme={getCurrentTheme()}\n onReady={() => Message.notice("Markdown 已准备就绪")}\n sendTextMessage={sendTextMessage}\n copyText={copyText}\n handleOpenLink={handleOpenLink}\n enableSourcePos\n />\n </div>\n );\n};\nReactDOM.render(<MarkdownDemo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 基础语法,包括标题、段落、强调和链接等。"},{tag:"@demo",content:"基础语法"},{tag:"@en",content:"Basic Syntax"},{tag:"@order",content:"1"}]}},generating:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst content = `# AI 生成内容示例\n\n## 排序算法说明\n\n1. **冒泡排序**(Bubble Sort)\n - 通过重复遍历要排序的数列\n - 比较每对相邻元素并交换位置\n\n2. **快速排序**(Quick Sort)\n - 选择基准值分割数据\n - 递归排序子序列`;\nReactDOM.render(\n <div>\n <h5>生成中状态:</h5>\n <div className="demo-mobile-wrap">\n <Markdown generating content={content} />\n </div>\n\n <h5 style={{ marginTop: 20 }}>已完成状态:</h5>\n <div className="demo-mobile-wrap">\n <Markdown generating={false} content={content} />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 内容生成过程中的状态。"},{tag:"@demo",content:"生成态"},{tag:"@en",content:"Generating State"},{tag:"@order",content:"4"}]}},interactive:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 交互功能展示\n\n### 链接类型\n1. [普通链接](https://www.example.com)\n2. [复制文本](copy://这是要复制的文本内容)\n3. [发送消息](dtmd://dingtalkclient/sendMessage?content=测试消息)\n\n### 代码复制\n\\`\\`\\`javascript\nconst greeting = "Hello, World!";\nconsole.log(greeting);\n\\`\\`\\`\n\n### 生成状态\n正在生成的内容会显示动画效果...`;\nReactDOM.render(\n <div>\n <h4>普通状态:</h4>\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n handleOpenLink={(url) => {\n Message.notice(`点击了链接: ${url}`);\n }}\n copyText={(text) => {\n Message.notice(`复制了文本: ${text}`);\n }}\n />\n </div>\n\n <h4 style={{ marginTop: 20 }}>生成状态:</h4>\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n generating\n handleOpenLink={(url) => {\n Message.notice(`点击了链接: ${url}`);\n }}\n copyText={(text) => {\n Message.notice(`复制了文本: ${text}`);\n }}\n />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 组件的交互功能,包括链接处理、文本复制和生成状态等。"},{tag:"@demo",content:"交互功能"},{tag:"@en",content:"Interactive Features"},{tag:"@order",content:"4"}]}},mermaid:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nimport "@alifd/chat/es/mermaid-view/style";\nconst content = `## Mermaid 图表展示\n所有支持的图表请查看 [Mermaid 官方文档](https://mermaid.js.org/syntax/classDiagram.html)。\n\n### 类图示例\n\\`\\`\\`mermaid\n---\ntitle: Animal example\n---\nclassDiagram\n note "From Duck till Zebra"\n Animal <|-- Duck\n note for Duck "can fly\\ncan swim\\ncan dive\\ncan help in debugging"\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }\n\\`\\`\\`\n\n### 流程图示例\n\\`\\`\\`mermaid\ngraph TD\n A[开始] --\x3e B{是否登录?}\n B --\x3e|是| C[显示主页]\n B --\x3e|否| D[跳转登录页]\n D --\x3e E[用户登录]\n E --\x3e F{登录成功?}\n F --\x3e|是| C\n F --\x3e|否| G[显示错误信息]\n G --\x3e D\n C --\x3e H[结束]\n\\`\\`\\`\n\n### 甘特图示例\n\\`\\`\\`mermaid\ngantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1, 20d\n section Another\n Task in Another :2014-01-12, 12d\n another task :24d\n\\`\\`\\`\n\n### 时间线示例\n\\`\\`\\`mermaid\ntimeline\n title History of Social Media Platform\n 2002 : LinkedIn\n 2004 : Facebook\n : Google\n 2005 : YouTube\n 2006 : Twitter\n\\`\\`\\`\n\n## Mermaid 论文逻辑图\n\n\\`\\`\\`mermaid\ngraph TB\n A[动机: 序列建模的局限] --\x3e B[提出Transformer]\n B --\x3e C1[架构: Encoder-Decoder]\n B --\x3e C2[核心机制: Multi-Head Attention, Positional Encoding]\n B --\x3e C3[优势: 并行度高, 路径短, 复杂度低]\n C1 --\x3e D1[Encoder: 自注意力 + 前馈网络 \xd76层]\n C1 --\x3e D2[Decoder: Masked 自注意力 + 编码器-解码器注意力 + 前馈 \xd76层]\n C2 --\x3e D3[Scaled Dot-Product Attention: 缩放点积]\n C2 --\x3e D4[Multi-Head Attention: 多头并行子空间表示]\n C2 --\x3e D5[Positional Encoding: 正弦/余弦函数注位置信息]\n C3 --\x3e D6[可解释性: 注意力权重揭示语义/句法]\n B --\x3e E[实验]\n E --\x3e E1[机器翻译: 英德28.4 BLEU, 英法41.8 BLEU]\n E --\x3e E2[句法分析: WSJ上优于大多数模型]\n B --\x3e F[结论与展望]\n F --\x3e F1[首次纯注意力实现序列建模]\n F --\x3e F2[启发BERT等后续模型]\n F --\x3e F3[拓展至多模态任务]\n\\`\\`\\`\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown content={content} />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中 Mermaid 图表的使用方法,包括流程图、时序图等。"},{tag:"@demo",content:"Mermaid 图表"},{tag:"@en",content:"Mermaid Diagrams"},{tag:"@order",content:"5"}]}},"rich-text":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 文本样式展示\n\n### 颜色文本\n<font color=common_red1_color>错误提示文本</font>\n<font color=common_green1_color>成功提示文本</font>\n<font color=common_blue1_color>链接文本颜色</font>\n\n### 标题样式\n<font sizeToken=common_h3_text_style__font_size colorTokenV2=common_blue1_color>自定义大小和颜色的标题</font>\n\n### 组合样式示例\n普通文本和 <font color=common_red1_color>**重要提示**</font> 的组合使用\n\n### 应用场景\n- <font color=common_green1_color>✓ 已完成的任务</font>\n- <font color=common_blue1_color>○ 进行中的任务</font>\n- <font color=common_red1_color>\xd7 未完成的任务</font>\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown content={content} />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中的富文本样式,包括文本颜色、字体大小等特性。"},{tag:"@demo",content:"富文本样式"},{tag:"@en",content:"Rich Text Styles"},{tag:"@order",content:"2"}]}},"tables-images":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 数据展示\n\n### 项目进度表\n| 项目阶段 | 开始时间 | 状态 | 负责人 |\n| :- | :-: | -: | :-: |\n| 需求分析 | 2025-06-01 | <font color=common_green1_color>已完成</font> | 张三 |\n| 设计阶段 | 2025-06-10 | <font color=common_blue1_color>进行中</font> | 李四 |\n| 开发阶段 | 2025-06-20 | <font color=common_grey1_color>未开始</font> | 王五 |\n\n### 图片展示\n产品预览图:\n![产品预览](https://img.alicdn.com/imgextra/i1/O1CN01OvFLW11mWeIU13AMp_!!6000000004962-0-tps-1002-1238.jpg)\n\n### 组合展示\n| 功能模块 | 效果预览 | 状态 |\n| :- | :-: | -: |\n| 首页布局 | ![布局](https://img.alicdn.com/imgextra/i4/O1CN01dTkCbh2ABAQjD7Qgm_!!6000000008164-2-tps-219-48.png) | <font color=common_green1_color>已完成</font> |\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n imagePreview\n handleImageClick={(url) => {\n Message.notice(`点击了图片: ${url}`);\n }}\n />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中表格和图片的使用方法,包括表格对齐和图片预览功能。"},{tag:"@demo",content:"表格与图片"},{tag:"@en",content:"Tables and Images"},{tag:"@order",content:"3"}]}}},a=[{tag:"@remarks",content:"Markdown 组件用于解析和渲染 Markdown 文本内容。 - Markdown component used to parse and render Markdown text content."},{tag:"@component",content:"Markdown"},{tag:"@en",content:"Markdown"},{tag:"@type",content:"通用 - General"},{tag:"@when",content:"需要解析和渲染 Markdown 文本内容时使用。 - Use when you need to parse and render Markdown text content."}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),s={id:"demo-list",title:"代码演示"},l=Object.keys(o).sort((e,t)=>{var n,i,a,s;return parseInt((null==(i=o[e].docInfo.tags)||null==(n=i.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=o[t].docInfo.tags)||null==(a=s.find(e=>"@order"===e.tag))?void 0:a.content)||"0")}),u=[...a["@when"]?[{id:"何时使用",title:"何时使用"}]:[],s,...l.map(e=>{let t=(0,iQ.kebabCase)(e);return{id:`${t}-container`,title:o[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,W.jsxs)("div",{className:"demo-wrapper",children:[(0,W.jsx)("div",{className:"demo-title markdown",children:(0,W.jsx)("h1",{children:a["@en"]})}),(0,W.jsx)(Uc,{defaultExpandCode:n,defaultLiveDemo:e,onToggleLiveDemo:t,onToggleExpandCode:i,data:u}),(0,W.jsx)("div",{className:"demo-head",children:(0,W.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,W.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,W.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,W.jsx)("p",{children:i1(a["@remarks"])}),(e=>e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(iJ,{id:"何时使用",title:"何时使用"}),(0,W.jsx)("ul",{children:(0,W.jsx)("li",{children:i1(e)})})]}):null)(a["@when"]),(0,W.jsx)(iJ,{...s})]}),l.map((t,i)=>(0,G.createElement)(Ul,{disabled:!e,globalExpandCode:n,...o[t],demoKey:t,key:i})),(0,W.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,W.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,W.jsx)(iJ,{id:"API",title:"API"}),[{title:"Markdown",order:null,summary:"",apiMode:!0,properties:[{name:"content",title:"Markdown 文本",enTitle:"Data object",required:!0,type:"string",skip:!1,params:[]},{name:"imagePreview",title:"是否启用图片预览",enTitle:"Enable image zoom",required:!1,type:"boolean",skip:!1,params:[]},{name:"copyText",title:"复制文本的函数",enTitle:"Function to copy text",required:!1,type:"(text: string, i18n?: (key: string) => string) => void",skip:!1,params:[]},{name:"generating",title:"是否在生成中",required:!1,type:"boolean",skip:!1,params:[]},{name:"copyLabel",title:"复制文案",required:!1,type:"string",skip:!1,params:[]},{name:"typewriterEffect",title:"是否启用打字机效果",required:!1,type:"boolean",skip:!1,params:[]},{name:"theme",title:"主题模式",enTitle:"Theme mode",required:!1,type:"'light' | 'dark'",skip:!1,params:[]},{name:"needCodeHeader",title:"是不是需要头部的代码复制区域",enTitle:"Tags that will not be put into typewriter queue",required:!1,type:"boolean",skip:!1,params:[]},{name:"enableSourcePos",title:"是否在生成的HTML中注入原始位置信息",enTitle:"Whether to inject source position information into generated HTML",required:!1,type:"boolean",skip:!1,params:[]}]}].map(e=>(0,G.createElement)(iX,{...e,key:e.title})),a["@others"]?(0,W.jsx)(rg,{remarkPlugins:[iO],rehypePlugins:[iG,[iF,{behavior:"append",content:()=>[iZ("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:a["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();
283
+ </iframe>`},"putIntoIFrame"),Y6=(0,FR.eW)((e,t,n,i,o)=>{let a=e.append("div");a.attr("id",n),i&&a.attr("style",i);let s=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return o&&s.attr("xmlns:xlink",o),s.append("g"),e},"appendDivSvgG");function Y9(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}(0,FR.eW)(Y9,"sandboxedIframe");var Y8=(0,FR.eW)((e,t,n,i)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),Y7=(0,FR.eW)(async function(e,t,n){let i,o;YF();let a=YX(t);t=a.code;let s=(0,FA.iE)();FR.cM.debug(s),t.length>(s?.maxTextSize??5e4)&&(t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");let l="#"+e,u="i"+e,d="#"+u,p="d"+e,h="#"+p,f=(0,FR.eW)(()=>{let e=_?d:h,t=(0,FI.Ys)(e).node();t&&"remove"in t&&t.remove()},"removeTempElements"),m=(0,FI.Ys)("body"),_="sandbox"===s.securityLevel,g="loose"===s.securityLevel,y=s.fontFamily;if(void 0!==n){if(n&&(n.innerHTML=""),_){let e=Y9((0,FI.Ys)(n),u);(m=(0,FI.Ys)(e.nodes()[0].contentDocument.body)).node().style.margin=0}else m=(0,FI.Ys)(n);Y6(m,e,p,`font-family: ${y}`,"http://www.w3.org/1999/xlink")}else{if(Y8(document,e,p,u),_){let e=Y9((0,FI.Ys)("body"),u);(m=(0,FI.Ys)(e.nodes()[0].contentDocument.body)).node().style.margin=0}else m=(0,FI.Ys)("body");Y6(m,e,p)}try{i=await YU.fromText(t,{title:a.title})}catch(e){if(s.suppressErrorRendering)throw f(),e;i=await YU.fromText("error"),o=e}let b=m.select(h).node(),E=i.type,S=b.firstChild,T=S.firstChild,C=Y3(s,E,i.renderer.getClasses?.(t,i),l),x=document.createElement("style");x.innerHTML=C,S.insertBefore(x,T);try{await i.renderer.draw(t,e,Fk.X.version,i)}catch(n){throw s.suppressErrorRendering?f():B5.draw(t,e,Fk.X.version),n}let k=m.select(`${h} svg`);jn(E,k,i.db.getAccTitle?.(),i.db.getAccDescription?.()),m.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let w=m.select(h).node().innerHTML;if(FR.cM.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),w=Y5(w,_,(0,FA.ku)(s.arrowMarkerAbsolute)),_?w=Y4(w,m.select(h+" svg").node()):g||(w=F9.Z.sanitize(w,{ADD_TAGS:YQ,ADD_ATTR:YJ,HTML_INTEGRATION_POINTS:{foreignobject:!0}})),YH(),o)throw o;return f(),{diagramType:E,svg:w,bindFunctions:i.db.bindFunctions}},"render");function je(e={}){let t=(0,FA.Yc)({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),(0,FA.dY)(t),t?.theme&&t.theme in FA._j?t.themeVariables=FA._j[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=FA._j.default.getThemeVariables(t.themeVariables));let n="object"==typeof t?(0,FA.Yn)(t):(0,FA.ZD)();(0,FR.Ub)(n.logLevel),YF()}(0,FR.eW)(je,"initialize");var jt=(0,FR.eW)((e,t={})=>{let{code:n}=YK(e);return YU.fromText(n,t)},"getDiagramFromText");function jn(e,t,n,i){YY(t,e),Yj(t,n,i,t.attr("id"))}(0,FR.eW)(jn,"addA11yInfo");var jr=Object.freeze({render:Y7,parse:Y1,getDiagramFromText:jt,initialize:je,getConfig:FA.iE,setConfig:FA.v6,getSiteConfig:FA.ZD,updateSiteConfig:FA.Tb,reset:(0,FR.eW)(()=>{(0,FA.mc)()},"reset"),globalReset:(0,FR.eW)(()=>{(0,FA.mc)(FA.u_)},"globalReset"),defaultConfig:FA.u_});(0,FR.Ub)((0,FA.iE)().logLevel),(0,FA.mc)((0,FA.iE)());var ji=(0,FR.eW)((e,t,n)=>{FR.cM.warn(e),(0,FM.bZ)(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),jo=(0,FR.eW)(async function(e={querySelector:".mermaid"}){try{await ja(e)}catch(t){if((0,FM.bZ)(t)&&FR.cM.error(t.str),jy.parseError&&jy.parseError(t),!e.suppressErrors)throw FR.cM.error("Use the suppressErrors option to suppress these errors"),t}},"run"),ja=(0,FR.eW)(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:".mermaid"}){let i,o,a=jr.getConfig();if(FR.cM.debug(`${!e?"No ":""}Callback function found`),n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error("Nodes and querySelector are both undefined");FR.cM.debug(`Found ${i.length} diagrams`),a?.startOnLoad!==void 0&&(FR.cM.debug("Start On Load: "+a?.startOnLoad),jr.updateSiteConfig({startOnLoad:a?.startOnLoad}));let s=new FM.w8.InitIDGenerator(a.deterministicIds,a.deterministicIDSeed),l=[];for(let t of Array.from(i)){if(FR.cM.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");let n=`mermaid-${s.next()}`;o=t.innerHTML,o=(0,FL.Z)(FM.w8.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");let i=FM.w8.detectInit(o);i&&FR.cM.debug("Detected early reinit: ",i);try{let{svg:i,bindFunctions:a}=await j_(n,o,t);t.innerHTML=i,e&&await e(n),a&&a(t)}catch(e){ji(e,l,jy.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),js=(0,FR.eW)(function(e){jr.initialize(e)},"initialize"),jl=(0,FR.eW)(async function(e,t,n){FR.cM.warn("mermaid.init is deprecated. Please use run instead."),e&&js(e);let i={postRenderCallback:n,querySelector:".mermaid"};"string"==typeof t?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await jo(i)},"init"),jc=(0,FR.eW)(async(e,{lazyLoad:t=!0}={})=>{YF(),(0,FA.KO)(...e),!1===t&&await YB()},"registerExternalDiagrams"),ju=(0,FR.eW)(function(){if(jy.startOnLoad){let{startOnLoad:e}=jr.getConfig();e&&jy.run().catch(e=>FR.cM.error("Mermaid failed to initialize",e))}},"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",ju,!1);var jd=(0,FR.eW)(function(e){jy.parseError=e},"setParseErrorHandler"),jp=[],jh=!1,jf=(0,FR.eW)(async()=>{if(!jh){for(jh=!0;jp.length>0;){let e=jp.shift();if(e)try{await e()}catch(e){FR.cM.error("Error executing queue",e)}}jh=!1}},"executeQueue"),jm=(0,FR.eW)(async(e,t)=>new Promise((n,i)=>{let o=(0,FR.eW)(()=>new Promise((o,a)=>{jr.parse(e,t).then(e=>{o(e),n(e)},e=>{FR.cM.error("Error parsing",e),jy.parseError?.(e),a(e),i(e)})}),"performCall");jp.push(o),jf().catch(i)}),"parse"),j_=(0,FR.eW)((e,t,n)=>new Promise((i,o)=>{let a=(0,FR.eW)(()=>new Promise((a,s)=>{jr.render(e,t,n).then(e=>{a(e),i(e)},e=>{FR.cM.error("Error parsing",e),jy.parseError?.(e),s(e),o(e)})}),"performCall");jp.push(a),jf().catch(o)}),"render"),jg=(0,FR.eW)(()=>Object.keys(FA.Bf).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),jy={startOnLoad:!0,mermaidAPI:jr,parse:jm,render:j_,init:jl,run:jo,registerExternalDiagrams:jc,registerLayoutLoaders:FD.jM,initialize:js,parseError:void 0,contentLoaded:ju,setParseErrorHandler:jd,detectType:FA.Vg,registerIconPacks:FO.ef,getRegisteredDiagramsMetadata:jg};let jb=(0,G.forwardRef)((e,t)=>{let{className:n,code:i,showCopyButton:o=!0,theme:a="light"}=e,s=(0,G.useRef)(null),[l,u]=(0,G.useState)(!1),[d,p]=(0,G.useState)(null),[h,f]=(0,G.useState)(!1);(0,G.useEffect)(()=>{jy.initialize({startOnLoad:!1,theme:"dark"===a?"dark":"default",securityLevel:"loose",fontFamily:"inherit"})},[a]),(0,G.useEffect)(()=>{i&&s.current&&(async()=>{try{p(null);let e=`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,t=s.current;t.innerHTML="";let{svg:n}=await jy.render(e,i);t.innerHTML=n,f(!0)}catch(e){p(e instanceof Error?e.message:"渲染失败")}})()},[i,h]);let m=()=>{i&&(MR(i),u(!0),setTimeout(()=>{u(!1)},3e3))};return(0,W.jsx)("div",{className:cP()("ct-mermaid-view",`ct-hljs-${a}`,n),ref:t,children:(0,W.jsxs)("div",{className:"ct-mermaid-view-wrapper",children:[(0,W.jsxs)("div",{className:"ct-mermaid-view-header",children:[(0,W.jsx)("div",{className:"ct-mermaid-view-title",children:"Mermaid"}),!1!==o&&(0,W.jsx)("div",{className:"ct-mermaid-view-copy",onClick:m,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),m())},role:"button",tabIndex:0,title:l?"已复制":"复制代码",children:(0,W.jsx)(Mp,{size:16,type:l?"icon-check":"fuzhi3"})})]}),(0,W.jsx)("div",{className:"ct-mermaid-view-container",children:d?(0,W.jsxs)("div",{className:"ct-mermaid-view-error",children:[(0,W.jsxs)("div",{className:"error-message",children:[(0,W.jsx)(Mp,{type:"icon-warning",size:16}),(0,W.jsxs)("span",{children:["图表渲染失败: ",d]})]}),(0,W.jsxs)("details",{className:"error-details",children:[(0,W.jsx)("summary",{children:"查看原始代码"}),(0,W.jsx)("pre",{className:"error-code",children:(0,W.jsx)("code",{children:i})})]})]}):(0,W.jsx)("div",{ref:s,className:"ct-mermaid-view-content"})})]})})});jb.displayName="MermaidView";let jv=dq.config(jb),jE="",jS=["img","code","pre","link-reference"],jT=Ma((0,G.forwardRef)(e=>{let{className:t,onReady:n,content:i,needCodeHeader:o=!0,theme:a="light",enableSourcePos:s=!1,...l}=e;function u(e,t){let n;if(!e)return[];let i=[...jS,...t||[]],o=/\[[^\]]*\]\([^)]*\)/g,a=i.length>0?RegExp(`<(${i.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=o.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});if(a)for(a.lastIndex=0;null!==(n=a.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});for(let t of(u.sort((e,t)=>e.start-t.start),u))t.start>l&&s.push(...e.substring(l,t.start).split("")),s.push(t.content),l=t.end;return l<e.length&&s.push(...e.substring(l).split("")),s}(0,G.useEffect)(()=>{Fv(),null==n||n()},[n]);let d=(0,G.useRef)(null),[p,h]=(0,G.useState)(()=>(null==l?void 0:l.typewriterEffect)?jE:i),[f,m]=(0,G.useState)(()=>(null==l?void 0:l.typewriterEffect)?u(i,l.whitelistTags):[]),[_,g]=(0,G.useState)(0),y=(0,G.useRef)(null),b=()=>{y.current&&(clearTimeout(y.current),y.current=null)};(0,G.useEffect)(()=>{if(b(),!(null==l?void 0:l.typewriterEffect)){h(i),m([]);return}let e=u(i,l.whitelistTags);if(_>=e.length)h(i),g(e.length),m([]);else{let t=e.slice(0,_),n=e.slice(_);h(t.join("")),m(n)}},[i,null==l?void 0:l.typewriterEffect,null==l?void 0:l.whitelistTags]),(0,G.useEffect)(()=>{if(!(null==l?void 0:l.typewriterEffect)||0===f.length)return void b();let e=Math.max(Math.floor(f.length/10),2),t=()=>{m(t=>{if(0===t.length)return t;let n=t.slice(0,e),i=t.slice(e);return h(e=>e+n.join("")),g(t=>t+e),i})};return b(),t(),y.current=setTimeout(()=>{let e=()=>{t(),y.current=setTimeout(e,50)};e()},50),b},[f.length,null==l?void 0:l.typewriterEffect]);let E=(0,G.useMemo)(()=>{jE=p;let e={common_hypertitle_text_style__font_size:"h1",common_largetitle_text_style__font_size:"h1",common_h1_text_style__font_size:"h1",common_h2_text_style__font_size:"h2",common_h3_text_style__font_size:"h3",common_h4_text_style__font_size:"h4",common_h5_text_style__font_size:"h5",common_body_text_style__font_size:"span",common_footnote_text_style__font_size:"span"};return p.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,i)=>{let o="",a="",s="",l=n.match(/sizeToken=([\w_]+)/),u=n.match(/colorTokenV2=([\w_]+)/),d=n.match(/color=([\w_]+)/),p=n.match(/color=(?:"|')?(#[0-9a-fA-F]{3,8})(?:"|')?/);l&&(o=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let h=[];o&&h.push(`font-size: var(--${o})`),a?h.push(`color: var(--${a})`):s&&h.push(`color: ${s}`);let f=h.join("; "),m=e[o]||"span";return`<${m} style="${f}" class="markdownFont">${i}</${m}>`})},[p]),S=(0,G.useMemo)(()=>FE(E,{genFrame:(e,t)=>({htmlTag:"img",selfClose:!0,attr:{draggable:"false",style:"vertical-align: text-center; display: inline-block; pointer-events: none;",class:"emoji",title:`[${e}]`,src:t.url||t.staticURL||"",alt:e}})}),[E]),T=(0,G.useMemo)(()=>{let e=new IM({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==FT?void 0:FT.getLanguage(t)))try{return null==FT?void 0:FT.highlight(t,e,!0).value}catch(e){}return""}});if(s&&e.use(e=>{e.core.ruler.push("add_source_pos",e=>{e.tokens.forEach(e=>{if(e.map){let[t,n]=e.map;e.attrSet("data-source-start-line",String(t)),e.attrSet("data-source-end-line",String(n))}})})}),e.linkify.add("dingtalk:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),S=(S=(S=S.replace(/&#x2F;/g,"/")).replace(/&#39;/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!o)return{html:e.render(S),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,i)=>{let o=e[i],a=o.info.trim()||"plaintext",s=o.content,l=`code-block-${n++}`,u="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,type:u}),`<div data-code-block-id="${l}" data-block-type="${u}"></div>`},{html:e.render(S),codeBlocks:t}},[S,o,s]),C=(null==l?void 0:l.generating)?"ct-markdown generating":"ct-markdown";return(0,W.jsxs)("div",{ref:d,className:cP()(C,`ct-hljs-${a}`,t),children:[(()=>{if(!o||0===T.codeBlocks.length)return(0,W.jsx)(Rb,{...l,children:T.html});let e=T.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let i of e)if(i.includes("data-code-block-id")){let e=T.codeBlocks[n];e&&("mermaid"===e.type?t.push((0,W.jsx)(jv,{code:e.code,showCopyButton:!0,theme:a},e.id)):t.push((0,W.jsx)(Fx,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else i.trim()&&t.push((0,W.jsx)(Rb,{...l,children:i},`html-${t.length}`));return(0,W.jsx)(W.Fragment,{children:t})})(),(()=>{let{generating:e}=l||{};return!e||T.html?null:(0,W.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),jC=dq.config(jT),jx=Ma((0,G.forwardRef)((e,t)=>{let{className:n}=e;return(0,W.jsx)("div",{className:cP()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jk=dq.config(jx),jw=Ma((0,G.forwardRef)((e,t)=>{let{className:n,text:i}=e;return(0,W.jsx)("div",{className:cP()("ct-origin",n),children:(0,W.jsx)("div",{className:"origin-tip-inner",children:i})})}),{displayName:"Origin"}),jN=dq.config(jw),jD=Ma((0,G.forwardRef)((e,t)=>{let{className:n,indicator:i,shape:o="default",size:a="large",...s}=e,l={...s,size:a};if(!i&&o&&"default"!==o){let e=`load-container ${o}`;l.indicator=(0,W.jsx)("div",{className:e,children:(0,W.jsx)("div",{className:"loader"})})}return(0,W.jsx)(vj,{...l,ref:t,className:cP()(`ct-loading ${a} ${o}`,n)})}),{displayName:"Loading"}),jO=dq.config(jD),jM=Ma((0,G.forwardRef)((e,t)=>{let{className:n,headerStyle:i,children:o,footer:a,footerClassName:s,placement:l,...u}=e;return(0,W.jsxs)(bC,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...i},className:cP()(`ct-drawer ${l}`,n),children:[o,a&&a.length&&(0,W.jsx)("div",{className:cP()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jA=dq.config(jM),jR=Ma((0,G.forwardRef)((e,t)=>{let{className:n,shape:i="dot",showStatus:o=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,W.jsxs)("div",{children:["查看更多",(0,W.jsx)(hj,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...h}=e,[f,m]=(0,G.useState)([]),[_,g]=(0,G.useState)(l);return((0,G.useEffect)(()=>{m(s.map((e,t)=>_&&u<t+1?null:(0,W.jsx)(SN.Item,{title:e.title,content:e.content,status:o?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,W.jsx)("div",{className:cP()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...h,ref:t,children:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(SN,{current:a,shape:i,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:f}),_&&s.length>u&&(0,W.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,W.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jL=dq.config(jR);var jI=function(e){return e.Generating="generating",e.Stopped="stopped",e}({});let jP="停止生成",jF=Ma((0,G.forwardRef)((e,t)=>{let{className:n,show:i=!0,status:o=jI.Generating,stopText:a=jP,stopIcon:s,stoppedText:l,onStop:u}=e;return i?(0,W.jsxs)("div",{className:cP()("ct-stop-generate",n),children:[o===jI.Generating&&(0,W.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,W.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jP]}),o===jI.Stopped&&(0,W.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jB=dq.config(jF),jY=(0,G.forwardRef)((e,t)=>{let{className:n,defaultExpanded:i=!1,header:o,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:h,expanded:f}=e,[m,_]=(0,G.useState)(f||i);(0,G.useEffect)(()=>{void 0!==f&&f!==m&&_(f)},[f]);let g=(e,t,n)=>{if(n.stopPropagation(),l){null==l||l(e,t);return}(null==e?void 0:e.url)&&window.open(null==e?void 0:e.url,"_blank")},y=m?"expand":"";return(0,W.jsxs)("div",{className:cP()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===o)return null;if("detail"===u)return(()=>{if(!1===o)return null;let e=(null==o?void 0:o.icon)||"close",t=(null==o?void 0:o.title)||"引用信息";return(0,W.jsxs)("div",{className:`reference-header ${u}`,children:[(0,W.jsx)("div",{className:"reference-text",children:t}),(0,W.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:Mh(e,"xs")})]})})();let e=(null==o?void 0:o.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,W.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e=>{if(e.stopPropagation(),p)return p(!m);_(!m)})(e)},children:[(0,W.jsxs)("div",{className:"reference-name",children:[Mh(e),(0,W.jsx)("div",{className:"reference-title",children:null==o?void 0:o.title})]}),(0,W.jsx)("div",{className:"reference-operate",onClick:e=>{(e=>{if(e.stopPropagation(),s)return s(!m);_(!m)})(e)},children:(0,W.jsx)(Mp,{type:m?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(m||"simple"!==u)?(0,W.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==h||h(m)},children:[m&&"simple"===u&&a.map((e,t)=>(0,W.jsxs)("div",{className:"reference-item",children:[(0,W.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&Mh(null==e?void 0:e.sourceIcon),(0,W.jsx)("div",{className:"reference-text",onClick:n=>g(e,t,n),children:null==e?void 0:e.name}),(null==e?void 0:e.modifyTime)&&!1]},t)),"detail"===u&&a.map((e,t)=>(0,W.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,W.jsxs)("div",{className:"reference-title",children:[(0,W.jsxs)("div",{className:"reference-name",children:[(0,W.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&Mh(null==e?void 0:e.sourceIcon),(0,W.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,W.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jj=dq.config(jY),jU=(0,G.forwardRef)((e,t)=>{let{className:n,defaultExpanded:i=!1,header:o=(0,W.jsxs)("div",{children:["相关问题",(0,W.jsx)(hj,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,G.useState)(i),h=void 0!==a?a:d;return(0,W.jsxs)("div",{className:cP()("ct-recommend",n),ref:t,children:[(0,W.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!h),null==l||l(!h)},children:o}),(0,W.jsx)(hc.CSSTransition,{in:h,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,W.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,W.jsx)("div",{className:"recommend-container",children:((e,t)=>(0,W.jsx)(hc.CSSTransition,{in:h,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,W.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t))(e,t)}))})})]})}),jz=dq.config(jU),jH=(0,G.forwardRef)((e,t)=>{let{className:n,header:i,footer:o,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:h,querySugList:f,onQuerySugClick:m}=e,[_,g]=(0,G.useState)(!1),y=h&&_&&f&&f.length>0;return(0,W.jsxs)("div",{ref:t,className:cP()("ct-rich-text-input",n),children:[(0,W.jsx)("div",{className:"header",children:i}),(0,W.jsxs)("div",{className:cP()("input-container",{focus:_}),children:[(0,W.jsx)("div",{className:"rich-text-input",contentEditable:!0,onFocus:e=>{g(!0),null==u||u(e)},onBlur:e=>{g(!1),null==d||d(e)},onChange:e=>{null==l||l(e.target.innerText)}}),(0,W.jsx)("div",{className:"input-footer",children:o}),(0,W.jsx)(hc.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,W.jsx)("div",{className:cP()("query-sug",a),children:(0,W.jsx)("div",{className:"query-sug-list",children:null==f?void 0:f.map((e,t)=>(0,W.jsx)("div",{className:"query-sug-item",onClick:()=>{null==m||m(e,t)},children:e.label},e.value))})})})]})]})}),jV=(0,G.forwardRef)((e,t)=>{let{className:n}=e;return(0,W.jsx)("div",{className:cP()(n,"ct-ai-loading"),ref:t,children:(0,W.jsxs)("div",{className:cP()("loading-container","short-container"),children:[(0,W.jsx)("div",{className:cP()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,W.jsx)("div",{className:cP()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,W.jsx)("div",{className:cP()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jW=dq.config(jV),jG=()=>(0,W.jsx)("svg",{viewBox:"0 0 1024 1024",className:"radio-item-icon",children:(0,W.jsx)("path",{d:"M562.005333 512l-181.034666 181.034667a42.666667 42.666667 0 1 0 60.330666 60.330666l211.2-211.2a42.666667 42.666667 0 0 0 0-60.330666l-211.2-211.2a42.666667 42.666667 0 1 0-60.330666 60.330666L562.005333 512z"})}),jq=Ma(M8((0,G.forwardRef)(e=>e.options&&0!==e.options.length?(0,W.jsx)("div",{className:"ct-radio-group",children:e.options.map(t=>(0,W.jsxs)("div",{className:cP()("radio-item",{active:t.value===e.value,disabled:e.disabled||t.disabled}),onClick:()=>{var n;return n=t.value,void(e.onChange&&e.onChange(n))},children:[(0,W.jsxs)("div",{className:"radio-item-title-container",children:[(0,W.jsx)("div",{className:"radio-item-title",children:t.label}),(0,W.jsx)(jG,{})]}),t.description&&(0,W.jsx)("div",{className:"radio-item-desc",children:t.description})]},t.value))}):null),{labelLayout:"vertical",coverStyle:!1,enableHoverState:!1,enableDisabledState:!1}),{displayName:"RadioGroup"}),j$=dq.config(jq),jK=Ma(M8((0,G.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,G.useState)(e.value||[]);return(0,W.jsx)("div",{className:cP()("ct-checkbox",{"ct-checkbox-disabled":e.disabled}),children:e.options.map(i=>(0,W.jsxs)("div",{className:cP()("checkbox-item",{active:t.indexOf(i.value)>-1}),onClick:()=>(i=>{if(e.disabled)return;let o=t.indexOf(i)>-1?t.filter(e=>e!==i):[...t,i];n(o),e.onChange&&e.onChange(o)})(i.value),children:[(0,W.jsx)(fq,{className:"checkbox-item-checkbox",checked:t.indexOf(i.value)>-1,disabled:e.disabled}),(0,W.jsxs)("div",{className:"checkbox-item-content-container",children:[(0,W.jsx)("div",{className:"checkbox-item-title",children:i.label}),i.description&&(0,W.jsx)("div",{className:"checkbox-item-desc",children:i.description})]})]},i.value))})}),{labelLayout:"vertical",coverStyle:!1,enableHoverState:!1,enableDisabledState:!1}),{displayName:"Checkbox"}),jZ=dq.config(jK),jQ=Ma((0,G.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,G.useState)(e.value||[]);return(0,W.jsxs)("div",{className:"ct-checkbox-group",children:[(0,W.jsx)(jZ,{options:e.options,value:t,onChange:e=>{n(e)}}),(0,W.jsx)(My,{type:"primary",className:"confirm-button",size:"medium",disabled:0===t.length,onClick:()=>{e.onChange&&e.onChange(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jJ=dq.config(jQ),jX=M8(e=>{let{className:t,dataSource:n,mode:i="single",buttonCols:o=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,G.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/o)},(e,t)=>{let a=t*o,p=Math.min(a+o,(null==n?void 0:n.length)||0),h=null==n?void 0:n.slice(a,p);return(null==h?void 0:h.length)?(0,W.jsx)("div",{className:"select-row-container",children:(e=>e&&e.length?e.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,h="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?h="selected":"object"==typeof u&&"value"in u&&u.value===n&&(h="selected");let f=p;return u&&"single"===i&&"normal"===h&&(f=!0),(0,W.jsx)(m_,{onClick:()=>((e,t)=>{if("multiple"===i)if(Array.isArray(u)){let n="normal"===t?[...u,null==e?void 0:e.value]:u.filter(t=>t!==(null==e?void 0:e.value));d(n),null==l||l(n,"itemClick")}else{let t=[null==e?void 0:e.value];d(t),null==l||l(t,"itemClick")}if("single"===i){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,h),type:"normal",disabled:f,className:`select-item ${h} row${o}`,size:s,children:a},`select_${t}`)}):null)(h)},`row_${t}`):null});return(0,W.jsx)("div",{className:cP()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),j1=M8((0,G.forwardRef)((e,t)=>{let{className:n,size:i="medium",mode:o="single",onChange:a,...s}=e;return(0,W.jsx)(_k,{...s,className:cP()("ct-select",n),size:i,ref:t,mode:o,onChange:a})})),j0=Ma((0,G.forwardRef)((e,t)=>{let{className:n,display:i="select",buttonCols:o=2,dataSource:a,mode:s="single",onChange:l,...u}=e;return"button"===((null==a?void 0:a.length)&&(null==a?void 0:a.length)>6?"select":i)?(0,W.jsx)(jX,{className:n,dataSource:a,mode:s,buttonCols:o,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,W.jsx)(j1,{...u,className:cP()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:cP()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),j2=dq.config(j0),j3=(0,G.forwardRef)((e,t)=>{let{className:n,defaultExpanded:i=!1,header:o=(0,W.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"}),(0,W.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,G.useRef)(null),h=(0,G.useRef)(null),[f,m]=(0,G.useState)(i),[_,g]=(0,G.useState)(i),y=void 0!==s?s:f,b=(e,t)=>{var n;if(!u)return void(t?(e.style.height="auto",e.style.width="auto",g(!0)):(e.style.height="0",g(!1)));let i=e.getBoundingClientRect().height,o=e.getBoundingClientRect().width,a=(null==(n=h.current)?void 0:n.getBoundingClientRect().width)||o;if(t){e.style.height="0",e.style.width=`${a}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),e.style.height="auto";let t=e.getBoundingClientRect().height,n=e.getBoundingClientRect().width;e.style.height="0",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height=`${t}px`,e.style.width=`${n}px`});let i=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",i)};e.addEventListener("transitionend",i)}else{e.style.height=`${i}px`,e.style.width=`${o}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height="0",e.style.width=`${a}px`});let t=()=>{g(!1),e.removeEventListener("transitionend",t)};e.addEventListener("transitionend",t)}};return(0,G.useEffect)(()=>{let e=p.current;e&&(y?(g(!0),u?Promise.resolve().then(()=>{b(e,!0)}):(e.style.height="auto",e.style.width="auto")):u?b(e,!1):(e.style.height="0",g(!1)))},[y,u]),(0,W.jsxs)("div",{className:cP()("ct-flip",n),ref:t,children:[(0,W.jsx)("div",{className:"flip-header-container",ref:h,children:a||(0,W.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&m(e)},children:[o,(0,W.jsx)("span",{className:"flip-header-icon",children:(0,W.jsx)(Mp,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,W.jsx)("div",{className:"flip-content",ref:p,style:{height:i?"auto":0,width:i?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),j5=dq.config(j3),j4=(0,G.forwardRef)((e,t)=>{let{useText:n="使用",name:i,className:o,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:h,disabled:f=!1}=e,m=a?"selected":"";return m=d?`${m} full-width`:`${m}`,m=l?`${m} enable-click`:`${m}`,(0,W.jsxs)("div",{className:cP()(`ct-tool-status ${m} ${s} ${f?"disabled":""}`,o),ref:t,onClick:t=>{f||(t.stopPropagation(),null==l||l(e))},children:[(0,W.jsx)(Mp,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,W.jsx)("div",{className:"next-btn-text next-btn-primary",onClick:t=>{var n;t.stopPropagation(),null==u||null==(n=u.onAuthClick)||n.call(u,e)},children:null==u?void 0:u.content}),(0,W.jsxs)("div",{className:"content-container",children:[(0,W.jsx)("div",{className:"content-use-tips",children:n}),h&&(0,W.jsx)("div",{className:"content-group",children:h}),i&&(0,W.jsx)("div",{className:"content-name",children:i}),p&&(0,W.jsx)("div",{className:"content-detail",children:p})]})]})}),j6=dq.config(j4),j9=Ma((0,G.forwardRef)(e=>{let{className:t,children:n,...i}=e;return(0,W.jsx)(gP,{...i,className:cP()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:gP.Panel}),j8=dq.config(j9),j7=(0,G.forwardRef)((e,t)=>{let{className:n,size:i="small",hasBorder:o=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,G.useState)(!1);return(0,W.jsxs)("div",{className:"ct-table-container",children:[a?(0,W.jsxs)("div",{className:"ct-table-header",children:[a&&(0,W.jsx)("div",{className:"ct-table-title",children:a}),s?(0,W.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,W.jsx)(Mp,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,W.jsx)(TZ,{...l,ref:t,className:cP()("ct-table",{[`ct-table-${i}`]:i,"ct-table-no-border":!o},n),size:i})]})});j7.displayName="Table";let Ue=dq.config(j7),Ut=(0,G.forwardRef)((e,t)=>{let{className:n,text:i,...o}=e;return(0,W.jsxs)("div",{...o,className:cP()("ct-error-notice",n),ref:t,children:[(0,W.jsx)("div",{className:"ct-error-notice-icon",children:(0,W.jsx)(hj,{size:16,type:"prompt"})}),(0,W.jsx)("span",{className:"ct-error-notice-text",children:i})]})});Ut.displayName="ErrorNotice";let Un=dq.config(Ut),Ur=(0,G.forwardRef)((e,t)=>{let{className:n,...i}=e;return(0,W.jsx)("div",{...i,className:cP()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,W.jsx)("div",{className:"ct-empty-line"},t))})});Ur.displayName="Empty";let Ui=dq.config(Ur),Uo=(0,G.forwardRef)((e,t)=>{let{className:n,title:i="",content:o,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:h=!0,showDownloadButton:f=!0,contentHeight:m=128,..._}=e,g=m-25,y=(0,G.useRef)(null),[b,E]=(0,G.useState)(0),[S,T]=(0,G.useState)(!1),[C,x]=(0,G.useState)(()=>m>128?128:m),k=e=>{let t=Array.from(e.children);return 0===t.length?e:k(t[t.length-1])},w=MW((0,G.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=k(e);if(!n)return;let i=n.getBoundingClientRect(),o=i.top-t.top,a=o+i.height;if(m>128&&C<m){let e=C-25;if(a>e)return void x(Math.min(m,C+(a-e)))}if(!(a+b<g&&o+b>0))return void E(-o)},[b,m,C]),200);(0,G.useEffect)(()=>{w()},[]),(0,G.useEffect)(()=>{if("string"==typeof o)return void w();if(!y.current)return;let e=new MutationObserver(()=>{w()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[o,w]);let N=e=>{i&&p&&s&&(e.stopPropagation(),null==s||s())},D=e=>{e.stopPropagation()};return(0,W.jsxs)("div",{..._,className:cP()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:N,children:[i?(0,W.jsxs)("div",{className:"ct-document-header",children:[(0,W.jsxs)("div",{className:"ct-document-header-left",children:[(0,W.jsx)(Mp,{type:"document",className:"ct-document-header-icon"}),(0,W.jsx)("span",{className:cP()("ct-document-header-title"),children:i})]}),(0,W.jsxs)("div",{className:cP()("ct-document-header-actions"),children:[(0,W.jsxs)("div",{className:cP()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:N,children:[(0,W.jsx)(Mp,{type:"preview",className:"ct-document-header-preview-icon"}),(0,W.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,W.jsx)("div",{className:cP()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!h||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,W.jsx)(Mp,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,W.jsx)("div",{className:cP()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!f||!d&&!u}),onClick:d?D:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,W.jsx)(Mp,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,W.jsx)("div",{className:"ct-document-header",children:(0,W.jsxs)("div",{className:"ct-document-header-left",children:[(0,W.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,W.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),o?(0,W.jsxs)("div",{className:cP()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,W.jsx)("div",{className:"ct-document-mask"}),(0,W.jsx)("div",{className:"ct-document-content-inner",children:(0,W.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:D,children:o})})]}):(0,W.jsx)("div",{className:cP()("ct-document-content",{"ct-document-content-generating":a}),children:(0,W.jsx)("div",{className:"ct-document-content-inner",children:(0,W.jsx)(Ui,{})})})]})});Uo.displayName="Document";let Ua=dq.config(Uo),Us="0.3.52",Ul=e=>{let{globalExpandCode:t}=e,[i,o]=(0,G.useState)(!1),[a,s]=(0,G.useState)(t);(0,G.useEffect)(()=>{o(!0)},[]),(0,G.useEffect)(()=>{s(t)},[t]);let l=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),u=(0,iQ.kebabCase)(e.demoKey),d=`${u}-container`;return(0,W.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,W.jsxs)("div",{id:`${u}-desc`,className:"demo-item-desc markdown",children:[(0,W.jsx)(iJ,{id:d,title:l["@demo"],component:"h3"}),(0,W.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,W.jsx)(rg,{remarkPlugins:[iO],children:l["@remarks"]})})]}),(0,W.jsxs)(cO,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${u}-mount`),require:e=>{let t={"@alifd/chat":V,"@alifd/next":F,"react-dom":$,"styled-components":B,react:q(),classnames:cP()},i=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return i&&n(58187)(`./${i[2]}/style`),t[e]}},noInline:!0,children:[(0,W.jsx)("div",{id:`${u}-mount`,className:"next-demo-mount",children:i?(0,W.jsx)(cA,{}):null}),i?(0,W.jsx)(cL,{}):null,(0,W.jsx)("div",{id:`${u}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,W.jsx)("div",{id:`${u}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,W.jsxs)(h2.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,W.jsx)("span",{id:`${u}-icon-hide`,onClick:()=>{s(!a)},children:(0,W.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,W.jsx)("path",{transform:"translate(10.457453, 10.101961) rotate(90.000000) translate(-10.457453, -10.101961)",d:"M14.4307124,13.5667899 L15.1349452,14.276759 L10.7473676,18.6288871 L6.42783259,14.2738791 L7.13782502,13.5696698 L10.7530744,17.2147744 L14.4307124,13.5667899 Z M4.79130753,8.067524 L16.3824174,11.1733525 L16.1235984,12.1392784 L4.53248848,9.03344983 L4.79130753,8.067524 Z M10.8154102,1.57503552 L15.1349452,5.93004351 L14.4249528,6.63425282 L10.809949,2.98914817 L7.13206544,6.6371327 L6.42783259,5.92716363 L10.8154102,1.57503552 Z"})})}),children:["收起代码",(0,W.jsx)("br",{}),(0,W.jsx)("br",{}),"小提示:",(0,W.jsx)("br",{}),(0,W.jsx)("br",{}),(0,W.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,W.jsx)("br",{}),(0,W.jsx)("br",{}),(0,W.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,W.jsx)("div",{id:`${u}-body`,className:"next-demo-body",style:{display:a?"block":"none"},children:(0,W.jsx)("div",{id:`${u}-live-editor`,children:(0,W.jsx)("div",{id:`${u}-live-body`,className:"react-live-body",children:(0,W.jsx)(cM,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Uc=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:i,onToggleLiveDemo:o,data:a=[]}=e,[s,l]=(0,G.useState)(n),[u,d]=(0,G.useState)(t),p={viewBox:"0 0 16 16",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","aria-haspopup":"true","aria-expanded":"false",style:{width:20,height:20,padding:2}};return(0,W.jsxs)("div",{className:"demo-index",children:[(0,W.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,W.jsx)(h2.Tooltip,{trigger:(0,W.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof o&&o(!u)},children:[(0,W.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,W.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})}),(0,W.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,W.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})})]}),children:"使用预览模式"}),(0,W.jsx)(h2.Tooltip,{trigger:(0,W.jsxs)("span",{id:"expand-all",role:"img","aria-label":"code",className:"code-box-expand-trigger","aria-haspopup":"true","aria-expanded":"false",onClick:()=>{l(!s),"function"==typeof i&&i(!s)},children:[(0,W.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,W.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})}),(0,W.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,W.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})})]}),children:"展开所有代码"})]}),(0,W.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,W.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,W.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};$.render((0,W.jsx)(()=>{let[e,t]=(0,G.useState)(!0),[n,i]=(0,G.useState)(!1),o={"ai-news-overview":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown, Message } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst aiNewsOverviewContent = `基于我收集到的信息,以下是近1个月AI方向上的重要新闻和进展。\n# 近1个月AI方向重要新闻概览\n\n---\n\n## 一、国家战略层面重大进展\n\n### 《关于深入实施"人工智能+"行动的意见》正式发布\n\n8月26日,国务院印发了《关于深入实施"人工智能+"行动的意见》,明确了实施"人工智能+"行动的总体要求、发展目标和重点方向。这份文件是中国AI发展的重要"路线图",具有里程碑意义。\n\n**主要内容包括:**\n\n- **阶段性目标**:\n - **到2027年:** 新一代智能终端、智能体等应用普及率超70%\n - **到2030年:** 应用普及率超90%,智能经济成为重要增长极\n - **到2035年:** 全面步入智能经济和智能社会发展新阶段\n\n- **三大重点行动**:\n - "人工智能+"科学技术\n - "人工智能+"产业发展\n - "人工智能+"消费提质\n\n---\n\n## 二、国际AI大会成果\n\n### 2025世界人工智能大会成果丰硕\n\n............\n`;\nconst MarkdownAiNewsDemo = () => {\n const getCurrentTheme = () => {\n const darkThemes = [\n "@alife/theme-132027",\n "@alife/theme-130507",\n "@alife/theme-132134",\n ];\n const styleSheets = Array.from(document.styleSheets);\n const isDark = styleSheets.some((sheet) => {\n try {\n const href = sheet.href || "";\n return darkThemes.some((theme) => href.includes(theme));\n } catch (error) {\n return false;\n }\n });\n return isDark ? "dark" : "light";\n };\n return (\n <div style={{ padding: "20px", maxWidth: "1000px", margin: "0 auto" }}>\n <div className="demo-mobile-wrap">\n <Markdown\n content={aiNewsOverviewContent}\n theme={getCurrentTheme()}\n onReady={() => Message.notice("AI新闻概览Markdown已准备就绪")}\n />\n </div>\n </div>\n );\n};\nReactDOM.render(<MarkdownAiNewsDemo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 在渲染复杂文档结构方面的能力,包括标题层级、列表、引用等。"},{tag:"@demo",content:"AI新闻概览"},{tag:"@en",content:"AI News Overview"},{tag:"@order",content:"2"}]}},basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown, Message } from "@alifd/chat";\nimport copy from "copy-to-clipboard";\nimport "@alifd/chat/es/markdown/style";\nimport "@alifd/chat/es/html-render/style";\nimport "@alifd/chat/es/code-view/style";\nconst content = `## Markdown 基础语法\n\n这是一个段落文本,展示 **加粗**、*斜体* 和 [链接](https://www.example.com) 的用法。\n\n### 列表展示\n- 产品特点\n - 简单易用\n - 功能强大\n- 技术支持\n - 在线文档\n - 技术社区\n\n### 引用文本\n> Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档。\n\n### 代码展示\n\\`\\`\\`javascript\n// 一个简单的函数示例\nfunction greeting(name) {\n return \\`Hello, \\${name}!\\`;\n}\n\\`\\`\\`\n\n### 表格展示\n\n#### 基础表格\n| 功能特性 | 支持状态 | 说明 |\n| :- | :-: | -: |\n| 基础语法 | ✅ 支持 | 标题、段落、列表等 |\n| 代码高亮 | ✅ 支持 | 支持多种编程语言 |\n| 表格渲染 | ✅ 支持 | 支持对齐和样式 |\n| 图片预览 | ✅ 支持 | 点击放大查看 |\n| 链接处理 | ✅ 支持 | 自动识别和图标显示 |\n\n#### 复杂表格示例\n| 项目 | 进度 | 负责人 | 截止日期 | 状态 |\n| :- | :-: | :-: | -: | :-: |\n| 需求分析 | 100% | 张三 | 2025-01-15 | <font color=common_green1_color>已完成</font> |\n| UI设计 | 80% | 李四 | 2025-01-20 | <font color=common_blue1_color>进行中</font> |\n| 后端开发 | 60% | 王五 | 2025-01-25 | <font color=common_orange1_color>开发中</font> |\n| 前端开发 | 40% | 赵六 | 2025-01-30 | <font color=common_yellow1_color>待开始</font> |\n| 测试验收 | 0% | 钱七 | 2025-02-05 | <font color=common_gray1_color>未开始</font> |\n\n### 链接图标功能演示\n\n#### 普通链接示例\n点击 [百度搜索](https://www.baidu.com) 或 [GitHub](https://github.com) 访问外部网站,这些链接会显示链接图标。\n\n#### 自动链接示例\n直接输入网址 https://www.baidu.com 或 https://github.com,会自动识别为链接并显示链接图标。\n\n#### 复制功能链接\n点击 [复制 "Hello World"](copy://Hello%20World) 将文本复制到剪贴板。\n\n点击 [复制代码片段](copy://function%20test()%20%7B%0A%20%20console.log(\'Hello%20World!\');%0A%20%20return%20true;%0A%7D) 复制 JavaScript 代码。\n\n点击 [复制配置信息](copy://服务器地址:192.168.1.100%0A端口:8080%0A用户名:admin) 复制服务器配置。\n\n#### 消息功能链接\n点击 [发送问候消息](message://你好!欢迎使用我们的Markdown编辑器) 发送问候消息。\n\n点击 [发送提醒通知](message://提醒:您的会议将在10分钟后开始,请做好准备) 发送会议提醒。\n\n点击 [发送状态更新](message://任务状态已更新为:已完成) 发送任务状态更新。\n\n### 图标功能说明\n- \uD83D\uDD17 **普通链接**:显示链接图标,帮助用户识别外部链接\n- \uD83D\uDD17 **自动链接**:直接输入的网址会自动识别并显示链接图标\n- \uD83D\uDCCB **复制链接**:显示复制图标,表示点击后会复制内容到剪贴板\n- \uD83D\uDCAC **消息链接**:显示消息图标,表示点击后会发送消息\n\n**注意**:这些特殊的链接格式(copy:// 和 message://)是由 HTMLRenderer 组件处理的,Markdown 组件会将这些链接传递给底层的 HTML 渲染器。自动链接功能由 MarkdownIt 的 linkify 插件提供支持。\n`;\nconst MarkdownDemo = () => {\n const getCurrentTheme = () => {\n const darkThemes = [\n "@alife/theme-132027",\n "@alife/theme-130507",\n "@alife/theme-132134",\n ];\n const styleSheets = Array.from(document.styleSheets);\n const isDark = styleSheets.some((sheet) => {\n try {\n const href = sheet.href || "";\n return darkThemes.some((theme) => href.includes(theme));\n } catch (error) {\n return false;\n }\n });\n return isDark ? "dark" : "light";\n };\n const sendTextMessage = (message) => {\n Message.success(`消息已发送: ${message}`);\n };\n const copyText = (text) => {\n return () => {\n copy(text);\n };\n };\n const handleOpenLink = (url) => {\n window.open(url, "_blank");\n };\n return (\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n theme={getCurrentTheme()}\n onReady={() => Message.notice("Markdown 已准备就绪")}\n sendTextMessage={sendTextMessage}\n copyText={copyText}\n handleOpenLink={handleOpenLink}\n enableSourcePos\n />\n </div>\n );\n};\nReactDOM.render(<MarkdownDemo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 基础语法,包括标题、段落、强调和链接等。"},{tag:"@demo",content:"基础语法"},{tag:"@en",content:"Basic Syntax"},{tag:"@order",content:"1"}]}},generating:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst content = `# AI 生成内容示例\n\n## 排序算法说明\n\n1. **冒泡排序**(Bubble Sort)\n - 通过重复遍历要排序的数列\n - 比较每对相邻元素并交换位置\n\n2. **快速排序**(Quick Sort)\n - 选择基准值分割数据\n - 递归排序子序列`;\nReactDOM.render(\n <div>\n <h5>生成中状态:</h5>\n <div className="demo-mobile-wrap">\n <Markdown generating content={content} />\n </div>\n\n <h5 style={{ marginTop: 20 }}>已完成状态:</h5>\n <div className="demo-mobile-wrap">\n <Markdown generating={false} content={content} />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 内容生成过程中的状态。"},{tag:"@demo",content:"生成态"},{tag:"@en",content:"Generating State"},{tag:"@order",content:"4"}]}},interactive:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 交互功能展示\n\n### 链接类型\n1. [普通链接](https://www.example.com)\n2. [复制文本](copy://这是要复制的文本内容)\n3. [发送消息](dtmd://dingtalkclient/sendMessage?content=测试消息)\n\n### 代码复制\n\\`\\`\\`javascript\nconst greeting = "Hello, World!";\nconsole.log(greeting);\n\\`\\`\\`\n\n### 生成状态\n正在生成的内容会显示动画效果...`;\nReactDOM.render(\n <div>\n <h4>普通状态:</h4>\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n handleOpenLink={(url) => {\n Message.notice(`点击了链接: ${url}`);\n }}\n copyText={(text) => {\n Message.notice(`复制了文本: ${text}`);\n }}\n />\n </div>\n\n <h4 style={{ marginTop: 20 }}>生成状态:</h4>\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n generating\n handleOpenLink={(url) => {\n Message.notice(`点击了链接: ${url}`);\n }}\n copyText={(text) => {\n Message.notice(`复制了文本: ${text}`);\n }}\n />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 组件的交互功能,包括链接处理、文本复制和生成状态等。"},{tag:"@demo",content:"交互功能"},{tag:"@en",content:"Interactive Features"},{tag:"@order",content:"4"}]}},mermaid:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nimport "@alifd/chat/es/mermaid-view/style";\nconst content = `## Mermaid 图表展示\n所有支持的图表请查看 [Mermaid 官方文档](https://mermaid.js.org/syntax/classDiagram.html)。\n\n### 类图示例\n\\`\\`\\`mermaid\n---\ntitle: Animal example\n---\nclassDiagram\n note "From Duck till Zebra"\n Animal <|-- Duck\n note for Duck "can fly\\ncan swim\\ncan dive\\ncan help in debugging"\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }\n\\`\\`\\`\n\n### 流程图示例\n\\`\\`\\`mermaid\ngraph TD\n A[开始] --\x3e B{是否登录?}\n B --\x3e|是| C[显示主页]\n B --\x3e|否| D[跳转登录页]\n D --\x3e E[用户登录]\n E --\x3e F{登录成功?}\n F --\x3e|是| C\n F --\x3e|否| G[显示错误信息]\n G --\x3e D\n C --\x3e H[结束]\n\\`\\`\\`\n\n### 甘特图示例\n\\`\\`\\`mermaid\ngantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1, 20d\n section Another\n Task in Another :2014-01-12, 12d\n another task :24d\n\\`\\`\\`\n\n### 时间线示例\n\\`\\`\\`mermaid\ntimeline\n title History of Social Media Platform\n 2002 : LinkedIn\n 2004 : Facebook\n : Google\n 2005 : YouTube\n 2006 : Twitter\n\\`\\`\\`\n\n## Mermaid 论文逻辑图\n\n\\`\\`\\`mermaid\ngraph TB\n A[动机: 序列建模的局限] --\x3e B[提出Transformer]\n B --\x3e C1[架构: Encoder-Decoder]\n B --\x3e C2[核心机制: Multi-Head Attention, Positional Encoding]\n B --\x3e C3[优势: 并行度高, 路径短, 复杂度低]\n C1 --\x3e D1[Encoder: 自注意力 + 前馈网络 \xd76层]\n C1 --\x3e D2[Decoder: Masked 自注意力 + 编码器-解码器注意力 + 前馈 \xd76层]\n C2 --\x3e D3[Scaled Dot-Product Attention: 缩放点积]\n C2 --\x3e D4[Multi-Head Attention: 多头并行子空间表示]\n C2 --\x3e D5[Positional Encoding: 正弦/余弦函数注位置信息]\n C3 --\x3e D6[可解释性: 注意力权重揭示语义/句法]\n B --\x3e E[实验]\n E --\x3e E1[机器翻译: 英德28.4 BLEU, 英法41.8 BLEU]\n E --\x3e E2[句法分析: WSJ上优于大多数模型]\n B --\x3e F[结论与展望]\n F --\x3e F1[首次纯注意力实现序列建模]\n F --\x3e F2[启发BERT等后续模型]\n F --\x3e F3[拓展至多模态任务]\n\\`\\`\\`\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown content={content} />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中 Mermaid 图表的使用方法,包括流程图、时序图等。"},{tag:"@demo",content:"Mermaid 图表"},{tag:"@en",content:"Mermaid Diagrams"},{tag:"@order",content:"5"}]}},"rich-text":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 文本样式展示\n\n### 颜色文本\n<font color=common_red1_color>错误提示文本</font>\n<font color=common_green1_color>成功提示文本</font>\n<font color=common_blue1_color>链接文本颜色</font>\n\n### 标题样式\n<font sizeToken=common_h3_text_style__font_size colorTokenV2=common_blue1_color>自定义大小和颜色的标题</font>\n\n### 组合样式示例\n普通文本和 <font color=common_red1_color>**重要提示**</font> 的组合使用\n\n### 应用场景\n- <font color=common_green1_color>✓ 已完成的任务</font>\n- <font color=common_blue1_color>○ 进行中的任务</font>\n- <font color=common_red1_color>\xd7 未完成的任务</font>\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown content={content} />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中的富文本样式,包括文本颜色、字体大小等特性。"},{tag:"@demo",content:"富文本样式"},{tag:"@en",content:"Rich Text Styles"},{tag:"@order",content:"2"}]}},"tables-images":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 数据展示\n\n### 项目进度表\n| 项目阶段 | 开始时间 | 状态 | 负责人 |\n| :- | :-: | -: | :-: |\n| 需求分析 | 2025-06-01 | <font color=common_green1_color>已完成</font> | 张三 |\n| 设计阶段 | 2025-06-10 | <font color=common_blue1_color>进行中</font> | 李四 |\n| 开发阶段 | 2025-06-20 | <font color=common_grey1_color>未开始</font> | 王五 |\n\n### 图片展示\n产品预览图:\n![产品预览](https://img.alicdn.com/imgextra/i1/O1CN01OvFLW11mWeIU13AMp_!!6000000004962-0-tps-1002-1238.jpg)\n\n### 组合展示\n| 功能模块 | 效果预览 | 状态 |\n| :- | :-: | -: |\n| 首页布局 | ![布局](https://img.alicdn.com/imgextra/i4/O1CN01dTkCbh2ABAQjD7Qgm_!!6000000008164-2-tps-219-48.png) | <font color=common_green1_color>已完成</font> |\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n imagePreview\n handleImageClick={(url) => {\n Message.notice(`点击了图片: ${url}`);\n }}\n />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中表格和图片的使用方法,包括表格对齐和图片预览功能。"},{tag:"@demo",content:"表格与图片"},{tag:"@en",content:"Tables and Images"},{tag:"@order",content:"3"}]}}},a=[{tag:"@remarks",content:"Markdown 组件用于解析和渲染 Markdown 文本内容。 - Markdown component used to parse and render Markdown text content."},{tag:"@component",content:"Markdown"},{tag:"@en",content:"Markdown"},{tag:"@type",content:"通用 - General"},{tag:"@when",content:"需要解析和渲染 Markdown 文本内容时使用。 - Use when you need to parse and render Markdown text content."}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),s={id:"demo-list",title:"代码演示"},l=Object.keys(o).sort((e,t)=>{var n,i,a,s;return parseInt((null==(i=o[e].docInfo.tags)||null==(n=i.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=o[t].docInfo.tags)||null==(a=s.find(e=>"@order"===e.tag))?void 0:a.content)||"0")}),u=[...a["@when"]?[{id:"何时使用",title:"何时使用"}]:[],s,...l.map(e=>{let t=(0,iQ.kebabCase)(e);return{id:`${t}-container`,title:o[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,W.jsxs)("div",{className:"demo-wrapper",children:[(0,W.jsx)("div",{className:"demo-title markdown",children:(0,W.jsx)("h1",{children:a["@en"]})}),(0,W.jsx)(Uc,{defaultExpandCode:n,defaultLiveDemo:e,onToggleLiveDemo:t,onToggleExpandCode:i,data:u}),(0,W.jsx)("div",{className:"demo-head",children:(0,W.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,W.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,W.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,W.jsx)("p",{children:i1(a["@remarks"])}),(e=>e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(iJ,{id:"何时使用",title:"何时使用"}),(0,W.jsx)("ul",{children:(0,W.jsx)("li",{children:i1(e)})})]}):null)(a["@when"]),(0,W.jsx)(iJ,{...s})]}),l.map((t,i)=>(0,G.createElement)(Ul,{disabled:!e,globalExpandCode:n,...o[t],demoKey:t,key:i})),(0,W.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,W.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,W.jsx)(iJ,{id:"API",title:"API"}),[{title:"Markdown",order:null,summary:"",apiMode:!0,properties:[{name:"content",title:"Markdown 文本",enTitle:"Data object",required:!0,type:"string",skip:!1,params:[]},{name:"imagePreview",title:"是否启用图片预览",enTitle:"Enable image zoom",required:!1,type:"boolean",skip:!1,params:[]},{name:"copyText",title:"复制文本的函数",enTitle:"Function to copy text",required:!1,type:"(text: string, i18n?: (key: string) => string) => void",skip:!1,params:[]},{name:"generating",title:"是否在生成中",required:!1,type:"boolean",skip:!1,params:[]},{name:"copyLabel",title:"复制文案",required:!1,type:"string",skip:!1,params:[]},{name:"typewriterEffect",title:"是否启用打字机效果",required:!1,type:"boolean",skip:!1,params:[]},{name:"theme",title:"主题模式",enTitle:"Theme mode",required:!1,type:"'light' | 'dark'",skip:!1,params:[]},{name:"needCodeHeader",title:"是不是需要头部的代码复制区域",enTitle:"Tags that will not be put into typewriter queue",required:!1,type:"boolean",skip:!1,params:[]},{name:"enableSourcePos",title:"是否在生成的HTML中注入原始位置信息",enTitle:"Whether to inject source position information into generated HTML",required:!1,type:"boolean",skip:!1,params:[]}]}].map(e=>(0,G.createElement)(iX,{...e,key:e.title})),a["@others"]?(0,W.jsx)(rg,{remarkPlugins:[iO],rehypePlugins:[iG,[iF,{behavior:"append",content:()=>[iZ("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:a["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();