@alifd/chat 0.3.60-beta.6 → 0.3.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/ai-loading/main.js +1 -1
- package/dist/docs/balloon/main.js +1 -1
- package/dist/docs/button/main.js +1 -1
- package/dist/docs/card/main.js +1 -1
- package/dist/docs/card-loading/main.js +1 -1
- package/dist/docs/checkbox/main.js +1 -1
- package/dist/docs/checkbox-group/main.js +1 -1
- package/dist/docs/code-view/main.js +1 -1
- package/dist/docs/collapse/main.js +1 -1
- package/dist/docs/date-picker/main.js +1 -1
- package/dist/docs/document/main.js +1 -1
- package/dist/docs/drawer/main.js +1 -1
- package/dist/docs/error-notice/main.js +1 -1
- package/dist/docs/feedback/main.js +1 -1
- package/dist/docs/flip/main.js +1 -1
- package/dist/docs/float-button/main.js +1 -1
- package/dist/docs/form/main.js +1 -1
- package/dist/docs/html-render/main.js +1 -1
- package/dist/docs/icon/main.js +1 -1
- package/dist/docs/image-preview/main.js +1 -1
- package/dist/docs/img/main.js +1 -1
- package/dist/docs/input/main.js +1 -1
- package/dist/docs/list/main.js +1 -1
- package/dist/docs/loading/main.js +1 -1
- package/dist/docs/markdown/main.js +1 -1
- package/dist/docs/mermaid-view/main.js +1 -1
- package/dist/docs/message/main.js +1 -1
- package/dist/docs/origin/main.js +1 -1
- package/dist/docs/person-picker/main.js +1 -1
- package/dist/docs/radio/main.js +1 -1
- package/dist/docs/radio-group/main.js +1 -1
- package/dist/docs/recommend/main.js +1 -1
- package/dist/docs/reference/main.js +1 -1
- package/dist/docs/rich-text-input/main.js +1 -1
- package/dist/docs/select/main.js +1 -1
- package/dist/docs/step/main.js +1 -1
- package/dist/docs/stop-generate/main.js +1 -1
- package/dist/docs/table/main.js +1 -1
- package/dist/docs/tag/main.js +1 -1
- package/dist/docs/text/main.js +1 -1
- package/dist/docs/time-picker/main.js +1 -1
- package/dist/docs/tool-status/main.js +1 -1
- package/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -133,4 +133,4 @@ ${t.map(e=>{let{variableName:t,uniqueLocalName:n}=e;return` reactHotLoader.regi
|
|
|
133
133
|
\`\`\`
|
|
134
134
|
${l}
|
|
135
135
|
\`\`\`
|
|
136
|
-
如何解决这个问题?如果你能提供修复方案,请保持简洁。`;i&&i(e)}},children:"使用对话修复"})})]})})}):(0,e3.jsx)("div",{className:"ct-mermaid-view-content",children:(0,e3.jsx)("div",{ref:a,className:"ct-mermaid-view-chart"})}),d&&(0,e3.jsx)("div",{className:"ct-mermaid-view-loading",children:(0,e3.jsx)(E4,{size:"medium"})})]})});jc.displayName="MermaidView";let ju=p8.config(jc),jd=[{emotionVersion:"75",emotionId:"emotion_180001",dynamicEmotionId:"",showType:1,skinList:[],name:"[魔法棒]",names:{en_US:"[Magic Wand]",ja_JP:"[魔棒]",vi_VN:"[đũa ph\xe9p]",zh_CN:"[魔法棒]",zh_HK:"[魔法棒]",zh_TW:"[魔法棒]"},url:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",staticURL:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",fallbacks:[]}],jp="",jm=["img","code","pre","link-reference","link-reference-group"],jh=AG((0,e5.forwardRef)(e=>{let{className:t,onReady:n,content:o,needCodeHeader:i=!0,theme:a="light",enableSourcePos:s=!1,sendTextMessage:l,...u}=e,[d,p]=(0,e5.useState)([]);function m(e,t){let n;if(!e)return[];let o=[...jm,...t||[]],i=/\[[^\]]*\]\([^)]*\)/g,a=o.length>0?RegExp(`<(${o.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=i.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,e5.useEffect)(()=>{Y7(),je().then(e=>{p(()=>[...jd,...e])}),null==n||n()},[n]);let h=(0,e5.useRef)(null),[f,_]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?jp:o),[g,y]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?m(o,u.whitelistTags):[]),[b,E]=(0,e5.useState)(0),S=(0,e5.useRef)(null),T=()=>{S.current&&(clearTimeout(S.current),S.current=null)};(0,e5.useEffect)(()=>{if(T(),!(null==u?void 0:u.typewriterEffect)){_(o),y([]);return}let e=m(o,u.whitelistTags);if(b>=e.length)_(o),E(e.length),y([]);else{let t=e.slice(0,b),n=e.slice(b);_(t.join("")),y(n)}},[o,null==u?void 0:u.typewriterEffect,null==u?void 0:u.whitelistTags]),(0,e5.useEffect)(()=>{if(!(null==u?void 0:u.typewriterEffect)||0===g.length)return void T();let e=Math.max(Math.floor(g.length/10),2),t=()=>{y(t=>{if(0===t.length)return t;let n=t.slice(0,e),o=t.slice(e);return _(e=>e+n.join("")),E(t=>t+e),o})};return T(),t(),S.current=setTimeout(()=>{let e=()=>{t(),S.current=setTimeout(e,50)};e()},50),T},[g.length,null==u?void 0:u.typewriterEffect]);let C=(0,e5.useMemo)(()=>{jp=f;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 f.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,o)=>{let i="",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&&(i=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let m=[];i&&m.push(`font-size: var(--${i})`),a?m.push(`color: var(--${a})`):s&&m.push(`color: ${s}`);let h=m.join("; "),f=e[i]||"span";return`<${f} style="${h}" class="markdownFont">${o}</${f}>`})},[f]),k=(0,e5.useMemo)(()=>jt(C,{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}}),emotionList:d}),[C,d]),x=(0,e5.useMemo)(()=>{let e=new Fp({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==jr?void 0:jr.getLanguage(t)))try{return null==jr?void 0:jr.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}}),e.linkify.add("dtmd:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),k=(k=(k=k.replace(///g,"/")).replace(/'/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!i)return{html:e.render(k),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,o)=>{let i=e[o],a=i.info.trim()||"plaintext",s=i.content,l=`code-block-${n++}`,u=!0,d=i.map;d&&(k.split("\n")[d[1]-1].trim().endsWith("```")||(u=!1));let p="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,isComplete:u}),`<div data-code-block-id="${l}" data-block-type="${p}"></div>`},{html:e.render(k),codeBlocks:t}},[k,i,s]),w=(null==u?void 0:u.generating)?"ct-markdown generating":"ct-markdown";return(0,e3.jsxs)("div",{ref:h,className:uj()(w,`ct-hljs-${a}`,t),children:[(()=>{if(!i||0===x.codeBlocks.length)return(0,e3.jsx)(Lr,{...u,children:x.html});let e=x.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let o of e)if(o.includes("data-code-block-id")){let e=x.codeBlocks[n];e&&("mermaid"===e.language?t.push((0,e3.jsxs)("div",{children:[e.isComplete&&(0,e3.jsx)(ju,{code:e.code,showCopyButton:!1,theme:a,sendTextMessage:l}),(0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)]},e.id)):t.push((0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else o.trim()&&t.push((0,e3.jsx)(Lr,{...u,children:o},`html-${t.length}`));return(0,e3.jsx)(e3.Fragment,{children:t})})(),(()=>{let{generating:e}=u||{};return!e||x.html?null:(0,e3.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),jf=p8.config(jh),j_=AG((0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jg=p8.config(j_),jy=AG((0,e5.forwardRef)((e,t)=>{let{className:n,text:o}=e;return(0,e3.jsx)("div",{className:uj()("ct-origin",n),children:(0,e3.jsx)("div",{className:"origin-tip-inner",children:o})})}),{displayName:"Origin"}),jb=p8.config(jy),jv=AG((0,e5.forwardRef)((e,t)=>{let{className:n,indicator:o,shape:i="default",size:a="large",...s}=e,l={...s,size:a};if(!o&&i&&"default"!==i){let e=`load-container ${i}`;l.indicator=(0,e3.jsx)("div",{className:e,children:(0,e3.jsx)("div",{className:"loader"})})}return(0,e3.jsx)(E4,{...l,ref:t,className:uj()(`ct-loading ${a} ${i}`,n)})}),{displayName:"Loading"}),jE=p8.config(jv),jS=AG((0,e5.forwardRef)((e,t)=>{let{className:n,headerStyle:o,children:i,footer:a,footerClassName:s,placement:l,...u}=e;return(0,e3.jsxs)(vB,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...o},className:uj()(`ct-drawer ${l}`,n),children:[i,a&&a.length&&(0,e3.jsx)("div",{className:uj()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jT=p8.config(jS),jC=AG((0,e5.forwardRef)((e,t)=>{let{className:n,shape:o="dot",showStatus:i=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,e3.jsxs)("div",{children:["查看更多",(0,e3.jsx)(h2,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...m}=e,[h,f]=(0,e5.useState)([]),[_,g]=(0,e5.useState)(l);return((0,e5.useEffect)(()=>{f(s.map((e,t)=>_&&u<t+1?null:(0,e3.jsx)(TK.Item,{title:e.title,content:e.content,status:i?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,e3.jsx)("div",{className:uj()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...m,ref:t,children:(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(TK,{current:a,shape:o,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:h}),_&&s.length>u&&(0,e3.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,e3.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jk=p8.config(jC);var jx=((eC={}).Generating="generating",eC.Stopped="stopped",eC);let jw="停止生成",jN=AG((0,e5.forwardRef)((e,t)=>{let{className:n,show:o=!0,status:i=jx.Generating,stopText:a=jw,stopIcon:s,stoppedText:l,onStop:u}=e;return o?(0,e3.jsxs)("div",{className:uj()("ct-stop-generate",n),children:[i===jx.Generating&&(0,e3.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,e3.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jw]}),i===jx.Stopped&&(0,e3.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jD=p8.config(jN),jO=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:m,expanded:h}=e,[f,_]=(0,e5.useState)(h||o);(0,e5.useEffect)(()=>{void 0!==h&&h!==f&&_(h)},[h]);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=f?"expand":"";return(0,e3.jsxs)("div",{className:uj()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===i)return null;if("detail"===u){if(!1===i)return null;let e=(null==i?void 0:i.icon)||"close",t=(null==i?void 0:i.title)||"引用信息";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,children:[(0,e3.jsx)("div",{className:"reference-text",children:t}),(0,e3.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:AX(e,"xs")})]})}let e=(null==i?void 0:i.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e.stopPropagation(),p)?p(!f):_(!f)},children:[(0,e3.jsxs)("div",{className:"reference-name",children:[AX(e),(0,e3.jsx)("div",{className:"reference-title",children:null==i?void 0:i.title})]}),(0,e3.jsx)("div",{className:"reference-operate",onClick:e=>{(e.stopPropagation(),s)?s(!f):_(!f)},children:(0,e3.jsx)(AJ,{type:f?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(f||"simple"!==u)?(0,e3.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==m||m(f)},children:[f&&"simple"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.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,e3.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,e3.jsxs)("div",{className:"reference-title",children:[(0,e3.jsxs)("div",{className:"reference-name",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,e3.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jM=p8.config(jO),jA=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsxs)("div",{children:["相关问题",(0,e3.jsx)(h2,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,e5.useState)(o),m=void 0!==a?a:d;return(0,e3.jsxs)("div",{className:uj()("ct-recommend",n),ref:t,children:[(0,e3.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!m),null==l||l(!m)},children:i}),(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,e3.jsx)("div",{className:"recommend-container",children:(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,e3.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t)}))})})]})}),jR=p8.config(jA),jI=(0,e5.forwardRef)((e,t)=>{let{className:n,header:o,footer:i,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:m,querySugList:h,onQuerySugClick:f}=e,[_,g]=(0,e5.useState)(!1),y=m&&_&&h&&h.length>0;return(0,e3.jsxs)("div",{ref:t,className:uj()("ct-rich-text-input",n),children:[(0,e3.jsx)("div",{className:"header",children:o}),(0,e3.jsxs)("div",{className:uj()("input-container",{focus:_}),children:[(0,e3.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,e3.jsx)("div",{className:"input-footer",children:i}),(0,e3.jsx)(hk.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:uj()("query-sug",a),children:(0,e3.jsx)("div",{className:"query-sug-list",children:null==h?void 0:h.map((e,t)=>(0,e3.jsx)("div",{className:"query-sug-item",onClick:()=>{null==f||f(e,t)},children:e.label},e.value))})})})]})]})}),jL=(0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()(n,"ct-ai-loading"),ref:t,children:(0,e3.jsxs)("div",{className:uj()("loading-container","short-container"),children:[(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jP=p8.config(jL),jF=()=>(0,e3.jsx)("div",{className:"radio-item-icon",children:(0,e3.jsx)("div",{className:"radio-item-circle"})}),jY=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-radio",{"ct-radio-disabled":o},a),style:s,...l,children:t.map(e=>(0,e3.jsx)("div",{className:uj()("radio-item",{active:e.value===n,disabled:o||e.disabled}),onClick:()=>{var t;return t=e.value,void(!o&&!e.disabled&&i&&i(t))},onKeyDown:t=>{var n;return n=e.value,void(!o&&!e.disabled&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),i&&i(n)))},role:"radio",tabIndex:o||e.disabled?-1:0,"aria-checked":e.value===n,"aria-disabled":o||e.disabled,children:(0,e3.jsxs)("div",{className:"radio-item-content",children:[(0,e3.jsx)("div",{className:"radio-item-icon-column",children:(0,e3.jsx)(jF,{})}),(0,e3.jsx)("div",{className:"radio-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"radio-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"radio-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"radio-item-text-column",children:[(0,e3.jsx)("div",{className:"radio-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"radio-item-desc",children:e.description})]})]})},e.value))}):null}),{displayName:"Radio"}),jj=p8.config(jY),jB=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||"");e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=!!t,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-radio-group ct-radio-group-list ${i?"ct-radio-group-disabled":""}`,children:[(0,e3.jsx)(jj,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"RadioGroup"}),jU=p8.config(jB),jz=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-checkbox",{"ct-checkbox-disabled":o},a),style:s,...l,children:t.map(e=>{let t=(n||[]).indexOf(e.value)>-1;return(0,e3.jsx)("div",{className:uj()("checkbox-item",{active:t,disabled:o||e.disabled}),onClick:()=>((e,t)=>{if(o||t.disabled)return;let a=n||[],s=a.indexOf(e)>-1?a.filter(t=>t!==e):[...a,e];i&&i(s)})(e.value,e),children:(0,e3.jsxs)("div",{className:"checkbox-item-content",children:[(0,e3.jsx)("div",{className:"checkbox-item-checkbox-column",children:(0,e3.jsx)(f7,{className:"checkbox-item-checkbox",checked:t,disabled:o||e.disabled})}),(0,e3.jsx)("div",{className:"checkbox-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"checkbox-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"checkbox-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"checkbox-item-text-column",children:[(0,e3.jsx)("div",{className:"checkbox-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"checkbox-item-desc",children:e.description})]})]})},e.value)})}):null}),{displayName:"Checkbox"}),jV=p8.config(jz),jH=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||[]);e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=t.length>0,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-checkbox-group ct-checkbox-group-list ${i?"ct-checkbox-group-disabled":""}`,children:[(0,e3.jsx)(jV,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t.length>0&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jG=p8.config(jH),jW=RF(e=>{let{className:t,dataSource:n,mode:o="single",buttonCols:i=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,e5.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/i)},(e,t)=>{let a=t*i,p=Math.min(a+i,(null==n?void 0:n.length)||0),m=null==n?void 0:n.slice(a,p);return(null==m?void 0:m.length)?(0,e3.jsx)("div",{className:"select-row-container",children:m&&m.length?m.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,m="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?m="selected":"object"==typeof u&&"value"in u&&u.value===n&&(m="selected");let h=p;return u&&"single"===o&&"normal"===m&&(h=!0),(0,e3.jsx)(_A,{onClick:()=>((e,t)=>{if("multiple"===o)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"===o){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,m),type:"normal",disabled:h,className:`select-item ${m} row${i}`,size:s,children:a},`select_${t}`)}):null},`row_${t}`):null});return(0,e3.jsx)("div",{className:uj()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),jK=RF((0,e5.forwardRef)((e,t)=>{let{className:n,size:o="medium",mode:i="single",onChange:a,...s}=e;return(0,e3.jsx)(gU,{...s,className:uj()("ct-select",n),size:o,ref:t,mode:i,onChange:a})})),jq=AG((0,e5.forwardRef)((e,t)=>{let{className:n,display:o="select",buttonCols:i=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":o)?(0,e3.jsx)(jW,{className:n,dataSource:a,mode:s,buttonCols:i,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,e3.jsx)(jK,{...u,className:uj()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:uj()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),j$=p8.config(jq),jQ=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,e3.jsxs)("div",{children:[(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,e5.useRef)(null),m=(0,e5.useRef)(null),[h,f]=(0,e5.useState)(o),[_,g]=(0,e5.useState)(o),y=void 0!==s?s:h,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 o=e.getBoundingClientRect().height,i=e.getBoundingClientRect().width,a=(null==(n=m.current)?void 0:n.getBoundingClientRect().width)||i;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 o=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",o)};e.addEventListener("transitionend",o)}else{e.style.height=`${o}px`,e.style.width=`${i}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,e5.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,e3.jsxs)("div",{className:uj()("ct-flip",n),ref:t,children:[(0,e3.jsx)("div",{className:"flip-header-container",ref:m,children:a||(0,e3.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&f(e)},children:[i,(0,e3.jsx)("span",{className:"flip-header-icon",children:(0,e3.jsx)(AJ,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,e3.jsx)("div",{className:"flip-content",ref:p,style:{height:o?"auto":0,width:o?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),jJ=p8.config(jQ),jX=(0,e5.forwardRef)((e,t)=>{let{useText:n="使用",name:o,className:i,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:m,disabled:h=!1}=e,f=a?"selected":"";return f=d?`${f} full-width`:`${f}`,f=l?`${f} enable-click`:`${f}`,(0,e3.jsxs)("div",{className:uj()(`ct-tool-status ${f} ${s} ${h?"disabled":""}`,i),ref:t,onClick:t=>{h||(t.stopPropagation(),null==l||l(e))},children:[(0,e3.jsx)(AJ,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,e3.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,e3.jsxs)("div",{className:"content-container",children:[(0,e3.jsx)("div",{className:"content-use-tips",children:n}),m&&(0,e3.jsx)("div",{className:"content-group",children:m}),o&&(0,e3.jsx)("div",{className:"content-name",children:o}),p&&(0,e3.jsx)("div",{className:"content-detail",children:p})]})]})}),jZ=p8.config(jX),j1=AG((0,e5.forwardRef)(e=>{let{className:t,children:n,...o}=e;return(0,e3.jsx)(yJ,{...o,className:uj()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:yJ.Panel}),j0=p8.config(j1),j2=(0,e5.forwardRef)((e,t)=>{let{className:n,size:o="small",hasBorder:i=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,e5.useState)(!1);return(0,e3.jsxs)("div",{className:"ct-table-container",children:[a?(0,e3.jsxs)("div",{className:"ct-table-header",children:[a&&(0,e3.jsx)("div",{className:"ct-table-title",children:a}),s?(0,e3.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,e3.jsx)(AJ,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,e3.jsx)(ko,{...l,ref:t,className:uj()("ct-table",{[`ct-table-${o}`]:o,"ct-table-no-border":!i},n),size:o})]})});j2.displayName="Table";let j3=p8.config(j2),j5=(0,e5.forwardRef)((e,t)=>{let{className:n,text:o,...i}=e;return(0,e3.jsxs)("div",{...i,className:uj()("ct-error-notice",n),ref:t,children:[(0,e3.jsx)("div",{className:"ct-error-notice-icon",children:(0,e3.jsx)(h2,{size:16,type:"prompt"})}),(0,e3.jsx)("span",{className:"ct-error-notice-text",children:o})]})});j5.displayName="ErrorNotice";let j4=p8.config(j5),j6=(0,e5.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,e3.jsx)("div",{...o,className:uj()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,e3.jsx)("div",{className:"ct-empty-line"},t))})});j6.displayName="Empty";let j9=p8.config(j6),j8=(0,e5.forwardRef)((e,t)=>{let{className:n,title:o="",content:i,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:m=!0,showDownloadButton:h=!0,contentHeight:f=128,..._}=e,g=f-25,y=(0,e5.useRef)(null),[b,E]=(0,e5.useState)(0),[S,T]=(0,e5.useState)(!1),[C,k]=(0,e5.useState)(()=>f>128?128:f),x=e=>{let t=Array.from(e.children);return 0===t.length?e:x(t[t.length-1])},w=(0,e5.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=x(e);if(!n)return;let o=n.getBoundingClientRect(),i=o.top-t.top,s=a?i+o.height:i+o.height+20;if(f>128&&C<f){let e=C-25;if(s>e)return void k(Math.min(f,C+(s-e)))}if(!(s+b<g&&i+b>0))return void E(-i)},[b,f,C,a]),N=Rv(w,200);(0,e5.useEffect)(()=>{w()},[a]),(0,e5.useEffect)(()=>{if("string"==typeof i)return void N();if(!y.current)return;let e=new MutationObserver(()=>{N()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[i,N]);let D=e=>{o&&p&&s&&(e.stopPropagation(),null==s||s())},O=e=>{e.stopPropagation()};return(0,e3.jsxs)("div",{..._,className:uj()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:D,children:[o?(0,e3.jsxs)("div",{className:"ct-document-header",children:[(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)(AJ,{type:"document",className:"ct-document-header-icon"}),(0,e3.jsx)("span",{className:uj()("ct-document-header-title"),children:o})]}),(0,e3.jsxs)("div",{className:uj()("ct-document-header-actions"),children:[(0,e3.jsxs)("div",{className:uj()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:D,children:[(0,e3.jsx)(AJ,{type:"preview",className:"ct-document-header-preview-icon"}),(0,e3.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!m||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,e3.jsx)(AJ,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!h||!d&&!u}),onClick:d?O:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,e3.jsx)(AJ,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,e3.jsx)("div",{className:"ct-document-header",children:(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,e3.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),i?(0,e3.jsxs)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,e3.jsx)("div",{className:"ct-document-mask"}),(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:O,children:i})})]}):(0,e3.jsx)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),children:(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)(j9,{})})})]})});j8.displayName="Document";let j7=p8.config(j8),Be="0.3.60-beta.6",Bt=e=>{let{globalExpandCode:t}=e,[n,o]=(0,e5.useState)(!1),[i,a]=(0,e5.useState)(t);(0,e5.useEffect)(()=>{o(!0)},[]),(0,e5.useEffect)(()=>{a(t)},[t]);let s=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),l=(0,iZ.kebabCase)(e.demoKey),d=`${l}-container`;return(0,e3.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,e3.jsxs)("div",{id:`${l}-desc`,className:"demo-item-desc markdown",children:[(0,e3.jsx)(i1,{id:d,title:s["@demo"],component:"h3"}),(0,e3.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,e3.jsx)(ob,{remarkPlugins:[iA],children:s["@remarks"]})})]}),(0,e3.jsxs)(uR,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${l}-mount`),require:e=>{let t={"@alifd/chat":e2,"@alifd/next":e$,"react-dom":e6,"styled-components":eQ,react:e4(),classnames:uj()},n=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return n&&u(64615)(`./${n[2]}/style`),t[e]}},noInline:!0,children:[(0,e3.jsx)("div",{id:`${l}-mount`,className:"next-demo-mount",children:n?(0,e3.jsx)(uL,{}):null}),n?(0,e3.jsx)(uF,{}):null,(0,e3.jsx)("div",{id:`${l}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,e3.jsx)("div",{id:`${l}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,e3.jsxs)(fl.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,e3.jsx)("span",{id:`${l}-icon-hide`,onClick:()=>{a(!i)},children:(0,e3.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,e3.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,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),"小提示:",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,e3.jsx)("div",{id:`${l}-body`,className:"next-demo-body",style:{display:i?"block":"none"},children:(0,e3.jsx)("div",{id:`${l}-live-editor`,children:(0,e3.jsx)("div",{id:`${l}-live-body`,className:"react-live-body",children:(0,e3.jsx)(uI,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Bn=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:o,onToggleLiveDemo:i,data:a=[]}=e,[s,l]=(0,e5.useState)(n),[u,d]=(0,e5.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,e3.jsxs)("div",{className:"demo-index",children:[(0,e3.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof i&&i(!u)},children:[(0,e3.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,e3.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,e3.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,e3.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,e3.jsx)(fl.Tooltip,{trigger:(0,e3.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 o&&o(!s)},children:[(0,e3.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,e3.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,e3.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,e3.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,e3.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,e3.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,e3.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};e6.render((0,e3.jsx)(()=>{var e;let[t,n]=(0,e5.useState)(!0),[o,i]=(0,e5.useState)(!1),a={basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { AiLoading } from "@alifd/chat";\nimport "@alifd/chat/es/ai-loading/style";\nReactDOM.render(\n <div className="origin-basic-demo">\n <div className="demo-mobile-wrap">\n <AiLoading />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"ai-loading 加载动画组件的基本用法。\n- Basic usage of `ai-loading`"},{tag:"@demo",content:"基本使用"},{tag:"@en",content:"Basic"},{tag:"@order",content:"1"}]}}},s=[{tag:"@component",content:"AI-Loading"},{tag:"@en",content:"AI-Loading"},{tag:"@type",content:"通用 - AI-Loading"},{tag:"@when",content:"AI-Loading"}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),l={id:"demo-list",title:"代码演示"},u=Object.keys(a).sort((e,t)=>{var n,o,i,s;return parseInt((null==(o=a[e].docInfo.tags)||null==(n=o.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=a[t].docInfo.tags)||null==(i=s.find(e=>"@order"===e.tag))?void 0:i.content)||"0")}),d=[...s["@when"]?[{id:"何时使用",title:"何时使用"}]:[],l,...u.map(e=>{let t=(0,iZ.kebabCase)(e);return{id:`${t}-container`,title:a[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,e3.jsxs)("div",{className:"demo-wrapper",children:[(0,e3.jsx)("div",{className:"demo-title markdown",children:(0,e3.jsx)("h1",{children:s["@en"]})}),(0,e3.jsx)(Bn,{defaultExpandCode:o,defaultLiveDemo:t,onToggleLiveDemo:n,onToggleExpandCode:i,data:d}),(0,e3.jsx)("div",{className:"demo-head",children:(0,e3.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,e3.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,e3.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,e3.jsx)("p",{children:i2(s["@remarks"])}),(e=s["@when"])?(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(i1,{id:"何时使用",title:"何时使用"}),(0,e3.jsx)("ul",{children:(0,e3.jsx)("li",{children:i2(e)})})]}):null,(0,e3.jsx)(i1,{...l})]}),u.map((e,n)=>(0,e5.createElement)(Bt,{disabled:!t,globalExpandCode:o,...a[e],demoKey:e,key:n})),(0,e3.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,e3.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,e3.jsx)(i1,{id:"API",title:"API"}),[].map(e=>(0,e5.createElement)(i0,{...e,key:e.title})),s["@others"]?(0,e3.jsx)(ob,{remarkPlugins:[iA],rehypePlugins:[iq,[ij,{behavior:"append",content:()=>[iX("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:s["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();
|
|
136
|
+
如何解决这个问题?如果你能提供修复方案,请保持简洁。`;i&&i(e)}},children:"使用对话修复"})})]})})}):(0,e3.jsx)("div",{className:"ct-mermaid-view-content",children:(0,e3.jsx)("div",{ref:a,className:"ct-mermaid-view-chart"})}),d&&(0,e3.jsx)("div",{className:"ct-mermaid-view-loading",children:(0,e3.jsx)(E4,{size:"medium"})})]})});jc.displayName="MermaidView";let ju=p8.config(jc),jd=[{emotionVersion:"75",emotionId:"emotion_180001",dynamicEmotionId:"",showType:1,skinList:[],name:"[魔法棒]",names:{en_US:"[Magic Wand]",ja_JP:"[魔棒]",vi_VN:"[đũa ph\xe9p]",zh_CN:"[魔法棒]",zh_HK:"[魔法棒]",zh_TW:"[魔法棒]"},url:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",staticURL:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",fallbacks:[]}],jp="",jm=["img","code","pre","link-reference","link-reference-group"],jh=AG((0,e5.forwardRef)(e=>{let{className:t,onReady:n,content:o,needCodeHeader:i=!0,theme:a="light",enableSourcePos:s=!1,sendTextMessage:l,...u}=e,[d,p]=(0,e5.useState)([]);function m(e,t){let n;if(!e)return[];let o=[...jm,...t||[]],i=/\[[^\]]*\]\([^)]*\)/g,a=o.length>0?RegExp(`<(${o.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=i.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,e5.useEffect)(()=>{Y7(),je().then(e=>{p(()=>[...jd,...e])}),null==n||n()},[n]);let h=(0,e5.useRef)(null),[f,_]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?jp:o),[g,y]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?m(o,u.whitelistTags):[]),[b,E]=(0,e5.useState)(0),S=(0,e5.useRef)(null),T=()=>{S.current&&(clearTimeout(S.current),S.current=null)};(0,e5.useEffect)(()=>{if(T(),!(null==u?void 0:u.typewriterEffect)){_(o),y([]);return}let e=m(o,u.whitelistTags);if(b>=e.length)_(o),E(e.length),y([]);else{let t=e.slice(0,b),n=e.slice(b);_(t.join("")),y(n)}},[o,null==u?void 0:u.typewriterEffect,null==u?void 0:u.whitelistTags]),(0,e5.useEffect)(()=>{if(!(null==u?void 0:u.typewriterEffect)||0===g.length)return void T();let e=Math.max(Math.floor(g.length/10),2),t=()=>{y(t=>{if(0===t.length)return t;let n=t.slice(0,e),o=t.slice(e);return _(e=>e+n.join("")),E(t=>t+e),o})};return T(),t(),S.current=setTimeout(()=>{let e=()=>{t(),S.current=setTimeout(e,50)};e()},50),T},[g.length,null==u?void 0:u.typewriterEffect]);let C=(0,e5.useMemo)(()=>{jp=f;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 f.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,o)=>{let i="",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&&(i=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let m=[];i&&m.push(`font-size: var(--${i})`),a?m.push(`color: var(--${a})`):s&&m.push(`color: ${s}`);let h=m.join("; "),f=e[i]||"span";return`<${f} style="${h}" class="markdownFont">${o}</${f}>`})},[f]),k=(0,e5.useMemo)(()=>jt(C,{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}}),emotionList:d}),[C,d]),x=(0,e5.useMemo)(()=>{let e=new Fp({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==jr?void 0:jr.getLanguage(t)))try{return null==jr?void 0:jr.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}}),e.linkify.add("dtmd:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),k=(k=(k=k.replace(///g,"/")).replace(/'/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!i)return{html:e.render(k),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,o)=>{let i=e[o],a=i.info.trim()||"plaintext",s=i.content,l=`code-block-${n++}`,u=!0,d=i.map;d&&(k.split("\n")[d[1]-1].trim().endsWith("```")||(u=!1));let p="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,isComplete:u}),`<div data-code-block-id="${l}" data-block-type="${p}"></div>`},{html:e.render(k),codeBlocks:t}},[k,i,s]),w=(null==u?void 0:u.generating)?"ct-markdown generating":"ct-markdown";return(0,e3.jsxs)("div",{ref:h,className:uj()(w,`ct-hljs-${a}`,t),children:[(()=>{if(!i||0===x.codeBlocks.length)return(0,e3.jsx)(Lr,{...u,children:x.html});let e=x.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let o of e)if(o.includes("data-code-block-id")){let e=x.codeBlocks[n];e&&("mermaid"===e.language?t.push((0,e3.jsxs)("div",{children:[e.isComplete&&(0,e3.jsx)(ju,{code:e.code,showCopyButton:!1,theme:a,sendTextMessage:l}),(0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)]},e.id)):t.push((0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else o.trim()&&t.push((0,e3.jsx)(Lr,{...u,children:o},`html-${t.length}`));return(0,e3.jsx)(e3.Fragment,{children:t})})(),(()=>{let{generating:e}=u||{};return!e||x.html?null:(0,e3.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),jf=p8.config(jh),j_=AG((0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jg=p8.config(j_),jy=AG((0,e5.forwardRef)((e,t)=>{let{className:n,text:o}=e;return(0,e3.jsx)("div",{className:uj()("ct-origin",n),children:(0,e3.jsx)("div",{className:"origin-tip-inner",children:o})})}),{displayName:"Origin"}),jb=p8.config(jy),jv=AG((0,e5.forwardRef)((e,t)=>{let{className:n,indicator:o,shape:i="default",size:a="large",...s}=e,l={...s,size:a};if(!o&&i&&"default"!==i){let e=`load-container ${i}`;l.indicator=(0,e3.jsx)("div",{className:e,children:(0,e3.jsx)("div",{className:"loader"})})}return(0,e3.jsx)(E4,{...l,ref:t,className:uj()(`ct-loading ${a} ${i}`,n)})}),{displayName:"Loading"}),jE=p8.config(jv),jS=AG((0,e5.forwardRef)((e,t)=>{let{className:n,headerStyle:o,children:i,footer:a,footerClassName:s,placement:l,...u}=e;return(0,e3.jsxs)(vB,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...o},className:uj()(`ct-drawer ${l}`,n),children:[i,a&&a.length&&(0,e3.jsx)("div",{className:uj()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jT=p8.config(jS),jC=AG((0,e5.forwardRef)((e,t)=>{let{className:n,shape:o="dot",showStatus:i=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,e3.jsxs)("div",{children:["查看更多",(0,e3.jsx)(h2,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...m}=e,[h,f]=(0,e5.useState)([]),[_,g]=(0,e5.useState)(l);return((0,e5.useEffect)(()=>{f(s.map((e,t)=>_&&u<t+1?null:(0,e3.jsx)(TK.Item,{title:e.title,content:e.content,status:i?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,e3.jsx)("div",{className:uj()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...m,ref:t,children:(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(TK,{current:a,shape:o,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:h}),_&&s.length>u&&(0,e3.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,e3.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jk=p8.config(jC);var jx=((eC={}).Generating="generating",eC.Stopped="stopped",eC);let jw="停止生成",jN=AG((0,e5.forwardRef)((e,t)=>{let{className:n,show:o=!0,status:i=jx.Generating,stopText:a=jw,stopIcon:s,stoppedText:l,onStop:u}=e;return o?(0,e3.jsxs)("div",{className:uj()("ct-stop-generate",n),children:[i===jx.Generating&&(0,e3.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,e3.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jw]}),i===jx.Stopped&&(0,e3.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jD=p8.config(jN),jO=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:m,expanded:h}=e,[f,_]=(0,e5.useState)(h||o);(0,e5.useEffect)(()=>{void 0!==h&&h!==f&&_(h)},[h]);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=f?"expand":"";return(0,e3.jsxs)("div",{className:uj()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===i)return null;if("detail"===u){if(!1===i)return null;let e=(null==i?void 0:i.icon)||"close",t=(null==i?void 0:i.title)||"引用信息";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,children:[(0,e3.jsx)("div",{className:"reference-text",children:t}),(0,e3.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:AX(e,"xs")})]})}let e=(null==i?void 0:i.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e.stopPropagation(),p)?p(!f):_(!f)},children:[(0,e3.jsxs)("div",{className:"reference-name",children:[AX(e),(0,e3.jsx)("div",{className:"reference-title",children:null==i?void 0:i.title})]}),(0,e3.jsx)("div",{className:"reference-operate",onClick:e=>{(e.stopPropagation(),s)?s(!f):_(!f)},children:(0,e3.jsx)(AJ,{type:f?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(f||"simple"!==u)?(0,e3.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==m||m(f)},children:[f&&"simple"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.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,e3.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,e3.jsxs)("div",{className:"reference-title",children:[(0,e3.jsxs)("div",{className:"reference-name",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,e3.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jM=p8.config(jO),jA=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsxs)("div",{children:["相关问题",(0,e3.jsx)(h2,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,e5.useState)(o),m=void 0!==a?a:d;return(0,e3.jsxs)("div",{className:uj()("ct-recommend",n),ref:t,children:[(0,e3.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!m),null==l||l(!m)},children:i}),(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,e3.jsx)("div",{className:"recommend-container",children:(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,e3.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t)}))})})]})}),jR=p8.config(jA),jI=(0,e5.forwardRef)((e,t)=>{let{className:n,header:o,footer:i,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:m,querySugList:h,onQuerySugClick:f}=e,[_,g]=(0,e5.useState)(!1),y=m&&_&&h&&h.length>0;return(0,e3.jsxs)("div",{ref:t,className:uj()("ct-rich-text-input",n),children:[(0,e3.jsx)("div",{className:"header",children:o}),(0,e3.jsxs)("div",{className:uj()("input-container",{focus:_}),children:[(0,e3.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,e3.jsx)("div",{className:"input-footer",children:i}),(0,e3.jsx)(hk.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:uj()("query-sug",a),children:(0,e3.jsx)("div",{className:"query-sug-list",children:null==h?void 0:h.map((e,t)=>(0,e3.jsx)("div",{className:"query-sug-item",onClick:()=>{null==f||f(e,t)},children:e.label},e.value))})})})]})]})}),jL=(0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()(n,"ct-ai-loading"),ref:t,children:(0,e3.jsxs)("div",{className:uj()("loading-container","short-container"),children:[(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jP=p8.config(jL),jF=()=>(0,e3.jsx)("div",{className:"radio-item-icon",children:(0,e3.jsx)("div",{className:"radio-item-circle"})}),jY=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-radio",{"ct-radio-disabled":o},a),style:s,...l,children:t.map(e=>(0,e3.jsx)("div",{className:uj()("radio-item",{active:e.value===n,disabled:o||e.disabled}),onClick:()=>{var t;return t=e.value,void(!o&&!e.disabled&&i&&i(t))},onKeyDown:t=>{var n;return n=e.value,void(!o&&!e.disabled&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),i&&i(n)))},role:"radio",tabIndex:o||e.disabled?-1:0,"aria-checked":e.value===n,"aria-disabled":o||e.disabled,children:(0,e3.jsxs)("div",{className:"radio-item-content",children:[(0,e3.jsx)("div",{className:"radio-item-icon-column",children:(0,e3.jsx)(jF,{})}),(0,e3.jsx)("div",{className:"radio-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"radio-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"radio-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"radio-item-text-column",children:[(0,e3.jsx)("div",{className:"radio-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"radio-item-desc",children:e.description})]})]})},e.value))}):null}),{displayName:"Radio"}),jj=p8.config(jY),jB=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||"");e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=!!t,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-radio-group ct-radio-group-list ${i?"ct-radio-group-disabled":""}`,children:[(0,e3.jsx)(jj,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"RadioGroup"}),jU=p8.config(jB),jz=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-checkbox",{"ct-checkbox-disabled":o},a),style:s,...l,children:t.map(e=>{let t=(n||[]).indexOf(e.value)>-1;return(0,e3.jsx)("div",{className:uj()("checkbox-item",{active:t,disabled:o||e.disabled}),onClick:()=>((e,t)=>{if(o||t.disabled)return;let a=n||[],s=a.indexOf(e)>-1?a.filter(t=>t!==e):[...a,e];i&&i(s)})(e.value,e),children:(0,e3.jsxs)("div",{className:"checkbox-item-content",children:[(0,e3.jsx)("div",{className:"checkbox-item-checkbox-column",children:(0,e3.jsx)(f7,{className:"checkbox-item-checkbox",checked:t,disabled:o||e.disabled})}),(0,e3.jsx)("div",{className:"checkbox-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"checkbox-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"checkbox-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"checkbox-item-text-column",children:[(0,e3.jsx)("div",{className:"checkbox-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"checkbox-item-desc",children:e.description})]})]})},e.value)})}):null}),{displayName:"Checkbox"}),jV=p8.config(jz),jH=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||[]);e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=t.length>0,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-checkbox-group ct-checkbox-group-list ${i?"ct-checkbox-group-disabled":""}`,children:[(0,e3.jsx)(jV,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t.length>0&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jG=p8.config(jH),jW=RF(e=>{let{className:t,dataSource:n,mode:o="single",buttonCols:i=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,e5.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/i)},(e,t)=>{let a=t*i,p=Math.min(a+i,(null==n?void 0:n.length)||0),m=null==n?void 0:n.slice(a,p);return(null==m?void 0:m.length)?(0,e3.jsx)("div",{className:"select-row-container",children:m&&m.length?m.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,m="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?m="selected":"object"==typeof u&&"value"in u&&u.value===n&&(m="selected");let h=p;return u&&"single"===o&&"normal"===m&&(h=!0),(0,e3.jsx)(_A,{onClick:()=>((e,t)=>{if("multiple"===o)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"===o){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,m),type:"normal",disabled:h,className:`select-item ${m} row${i}`,size:s,children:a},`select_${t}`)}):null},`row_${t}`):null});return(0,e3.jsx)("div",{className:uj()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),jK=RF((0,e5.forwardRef)((e,t)=>{let{className:n,size:o="medium",mode:i="single",onChange:a,...s}=e;return(0,e3.jsx)(gU,{...s,className:uj()("ct-select",n),size:o,ref:t,mode:i,onChange:a})})),jq=AG((0,e5.forwardRef)((e,t)=>{let{className:n,display:o="select",buttonCols:i=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":o)?(0,e3.jsx)(jW,{className:n,dataSource:a,mode:s,buttonCols:i,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,e3.jsx)(jK,{...u,className:uj()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:uj()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),j$=p8.config(jq),jQ=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,e3.jsxs)("div",{children:[(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,e5.useRef)(null),m=(0,e5.useRef)(null),[h,f]=(0,e5.useState)(o),[_,g]=(0,e5.useState)(o),y=void 0!==s?s:h,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 o=e.getBoundingClientRect().height,i=e.getBoundingClientRect().width,a=(null==(n=m.current)?void 0:n.getBoundingClientRect().width)||i;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 o=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",o)};e.addEventListener("transitionend",o)}else{e.style.height=`${o}px`,e.style.width=`${i}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,e5.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,e3.jsxs)("div",{className:uj()("ct-flip",n),ref:t,children:[(0,e3.jsx)("div",{className:"flip-header-container",ref:m,children:a||(0,e3.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&f(e)},children:[i,(0,e3.jsx)("span",{className:"flip-header-icon",children:(0,e3.jsx)(AJ,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,e3.jsx)("div",{className:"flip-content",ref:p,style:{height:o?"auto":0,width:o?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),jJ=p8.config(jQ),jX=(0,e5.forwardRef)((e,t)=>{let{useText:n="使用",name:o,className:i,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:m,disabled:h=!1}=e,f=a?"selected":"";return f=d?`${f} full-width`:`${f}`,f=l?`${f} enable-click`:`${f}`,(0,e3.jsxs)("div",{className:uj()(`ct-tool-status ${f} ${s} ${h?"disabled":""}`,i),ref:t,onClick:t=>{h||(t.stopPropagation(),null==l||l(e))},children:[(0,e3.jsx)(AJ,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,e3.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,e3.jsxs)("div",{className:"content-container",children:[(0,e3.jsx)("div",{className:"content-use-tips",children:n}),m&&(0,e3.jsx)("div",{className:"content-group",children:m}),o&&(0,e3.jsx)("div",{className:"content-name",children:o}),p&&(0,e3.jsx)("div",{className:"content-detail",children:p})]})]})}),jZ=p8.config(jX),j1=AG((0,e5.forwardRef)(e=>{let{className:t,children:n,...o}=e;return(0,e3.jsx)(yJ,{...o,className:uj()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:yJ.Panel}),j0=p8.config(j1),j2=(0,e5.forwardRef)((e,t)=>{let{className:n,size:o="small",hasBorder:i=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,e5.useState)(!1);return(0,e3.jsxs)("div",{className:"ct-table-container",children:[a?(0,e3.jsxs)("div",{className:"ct-table-header",children:[a&&(0,e3.jsx)("div",{className:"ct-table-title",children:a}),s?(0,e3.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,e3.jsx)(AJ,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,e3.jsx)(ko,{...l,ref:t,className:uj()("ct-table",{[`ct-table-${o}`]:o,"ct-table-no-border":!i},n),size:o})]})});j2.displayName="Table";let j3=p8.config(j2),j5=(0,e5.forwardRef)((e,t)=>{let{className:n,text:o,...i}=e;return(0,e3.jsxs)("div",{...i,className:uj()("ct-error-notice",n),ref:t,children:[(0,e3.jsx)("div",{className:"ct-error-notice-icon",children:(0,e3.jsx)(h2,{size:16,type:"prompt"})}),(0,e3.jsx)("span",{className:"ct-error-notice-text",children:o})]})});j5.displayName="ErrorNotice";let j4=p8.config(j5),j6=(0,e5.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,e3.jsx)("div",{...o,className:uj()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,e3.jsx)("div",{className:"ct-empty-line"},t))})});j6.displayName="Empty";let j9=p8.config(j6),j8=(0,e5.forwardRef)((e,t)=>{let{className:n,title:o="",content:i,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:m=!0,showDownloadButton:h=!0,contentHeight:f=128,..._}=e,g=f-25,y=(0,e5.useRef)(null),[b,E]=(0,e5.useState)(0),[S,T]=(0,e5.useState)(!1),[C,k]=(0,e5.useState)(()=>f>128?128:f),x=e=>{let t=Array.from(e.children);return 0===t.length?e:x(t[t.length-1])},w=(0,e5.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=x(e);if(!n)return;let o=n.getBoundingClientRect(),i=o.top-t.top,s=a?i+o.height:i+o.height+20;if(f>128&&C<f){let e=C-25;if(s>e)return void k(Math.min(f,C+(s-e)))}if(!(s+b<g&&i+b>0))return void E(-i)},[b,f,C,a]),N=Rv(w,200);(0,e5.useEffect)(()=>{w()},[a]),(0,e5.useEffect)(()=>{if("string"==typeof i)return void N();if(!y.current)return;let e=new MutationObserver(()=>{N()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[i,N]);let D=e=>{o&&p&&s&&(e.stopPropagation(),null==s||s())},O=e=>{e.stopPropagation()};return(0,e3.jsxs)("div",{..._,className:uj()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:D,children:[o?(0,e3.jsxs)("div",{className:"ct-document-header",children:[(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)(AJ,{type:"document",className:"ct-document-header-icon"}),(0,e3.jsx)("span",{className:uj()("ct-document-header-title"),children:o})]}),(0,e3.jsxs)("div",{className:uj()("ct-document-header-actions"),children:[(0,e3.jsxs)("div",{className:uj()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:D,children:[(0,e3.jsx)(AJ,{type:"preview",className:"ct-document-header-preview-icon"}),(0,e3.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!m||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,e3.jsx)(AJ,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!h||!d&&!u}),onClick:d?O:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,e3.jsx)(AJ,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,e3.jsx)("div",{className:"ct-document-header",children:(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,e3.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),i?(0,e3.jsxs)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,e3.jsx)("div",{className:"ct-document-mask"}),(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:O,children:i})})]}):(0,e3.jsx)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),children:(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)(j9,{})})})]})});j8.displayName="Document";let j7=p8.config(j8),Be="0.3.60",Bt=e=>{let{globalExpandCode:t}=e,[n,o]=(0,e5.useState)(!1),[i,a]=(0,e5.useState)(t);(0,e5.useEffect)(()=>{o(!0)},[]),(0,e5.useEffect)(()=>{a(t)},[t]);let s=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),l=(0,iZ.kebabCase)(e.demoKey),d=`${l}-container`;return(0,e3.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,e3.jsxs)("div",{id:`${l}-desc`,className:"demo-item-desc markdown",children:[(0,e3.jsx)(i1,{id:d,title:s["@demo"],component:"h3"}),(0,e3.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,e3.jsx)(ob,{remarkPlugins:[iA],children:s["@remarks"]})})]}),(0,e3.jsxs)(uR,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${l}-mount`),require:e=>{let t={"@alifd/chat":e2,"@alifd/next":e$,"react-dom":e6,"styled-components":eQ,react:e4(),classnames:uj()},n=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return n&&u(64615)(`./${n[2]}/style`),t[e]}},noInline:!0,children:[(0,e3.jsx)("div",{id:`${l}-mount`,className:"next-demo-mount",children:n?(0,e3.jsx)(uL,{}):null}),n?(0,e3.jsx)(uF,{}):null,(0,e3.jsx)("div",{id:`${l}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,e3.jsx)("div",{id:`${l}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,e3.jsxs)(fl.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,e3.jsx)("span",{id:`${l}-icon-hide`,onClick:()=>{a(!i)},children:(0,e3.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,e3.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,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),"小提示:",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,e3.jsx)("div",{id:`${l}-body`,className:"next-demo-body",style:{display:i?"block":"none"},children:(0,e3.jsx)("div",{id:`${l}-live-editor`,children:(0,e3.jsx)("div",{id:`${l}-live-body`,className:"react-live-body",children:(0,e3.jsx)(uI,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Bn=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:o,onToggleLiveDemo:i,data:a=[]}=e,[s,l]=(0,e5.useState)(n),[u,d]=(0,e5.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,e3.jsxs)("div",{className:"demo-index",children:[(0,e3.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof i&&i(!u)},children:[(0,e3.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,e3.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,e3.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,e3.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,e3.jsx)(fl.Tooltip,{trigger:(0,e3.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 o&&o(!s)},children:[(0,e3.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,e3.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,e3.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,e3.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,e3.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,e3.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,e3.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};e6.render((0,e3.jsx)(()=>{var e;let[t,n]=(0,e5.useState)(!0),[o,i]=(0,e5.useState)(!1),a={basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { AiLoading } from "@alifd/chat";\nimport "@alifd/chat/es/ai-loading/style";\nReactDOM.render(\n <div className="origin-basic-demo">\n <div className="demo-mobile-wrap">\n <AiLoading />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"ai-loading 加载动画组件的基本用法。\n- Basic usage of `ai-loading`"},{tag:"@demo",content:"基本使用"},{tag:"@en",content:"Basic"},{tag:"@order",content:"1"}]}}},s=[{tag:"@component",content:"AI-Loading"},{tag:"@en",content:"AI-Loading"},{tag:"@type",content:"通用 - AI-Loading"},{tag:"@when",content:"AI-Loading"}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),l={id:"demo-list",title:"代码演示"},u=Object.keys(a).sort((e,t)=>{var n,o,i,s;return parseInt((null==(o=a[e].docInfo.tags)||null==(n=o.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=a[t].docInfo.tags)||null==(i=s.find(e=>"@order"===e.tag))?void 0:i.content)||"0")}),d=[...s["@when"]?[{id:"何时使用",title:"何时使用"}]:[],l,...u.map(e=>{let t=(0,iZ.kebabCase)(e);return{id:`${t}-container`,title:a[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,e3.jsxs)("div",{className:"demo-wrapper",children:[(0,e3.jsx)("div",{className:"demo-title markdown",children:(0,e3.jsx)("h1",{children:s["@en"]})}),(0,e3.jsx)(Bn,{defaultExpandCode:o,defaultLiveDemo:t,onToggleLiveDemo:n,onToggleExpandCode:i,data:d}),(0,e3.jsx)("div",{className:"demo-head",children:(0,e3.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,e3.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,e3.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,e3.jsx)("p",{children:i2(s["@remarks"])}),(e=s["@when"])?(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(i1,{id:"何时使用",title:"何时使用"}),(0,e3.jsx)("ul",{children:(0,e3.jsx)("li",{children:i2(e)})})]}):null,(0,e3.jsx)(i1,{...l})]}),u.map((e,n)=>(0,e5.createElement)(Bt,{disabled:!t,globalExpandCode:o,...a[e],demoKey:e,key:n})),(0,e3.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,e3.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,e3.jsx)(i1,{id:"API",title:"API"}),[].map(e=>(0,e5.createElement)(i0,{...e,key:e.title})),s["@others"]?(0,e3.jsx)(ob,{remarkPlugins:[iA],rehypePlugins:[iq,[ij,{behavior:"append",content:()=>[iX("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:s["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();
|
|
@@ -133,4 +133,4 @@ ${t.map(e=>{let{variableName:t,uniqueLocalName:n}=e;return` reactHotLoader.regi
|
|
|
133
133
|
\`\`\`
|
|
134
134
|
${l}
|
|
135
135
|
\`\`\`
|
|
136
|
-
如何解决这个问题?如果你能提供修复方案,请保持简洁。`;i&&i(e)}},children:"使用对话修复"})})]})})}):(0,e3.jsx)("div",{className:"ct-mermaid-view-content",children:(0,e3.jsx)("div",{ref:a,className:"ct-mermaid-view-chart"})}),d&&(0,e3.jsx)("div",{className:"ct-mermaid-view-loading",children:(0,e3.jsx)(E4,{size:"medium"})})]})});jc.displayName="MermaidView";let ju=p8.config(jc),jd=[{emotionVersion:"75",emotionId:"emotion_180001",dynamicEmotionId:"",showType:1,skinList:[],name:"[魔法棒]",names:{en_US:"[Magic Wand]",ja_JP:"[魔棒]",vi_VN:"[đũa ph\xe9p]",zh_CN:"[魔法棒]",zh_HK:"[魔法棒]",zh_TW:"[魔法棒]"},url:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",staticURL:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",fallbacks:[]}],jp="",jm=["img","code","pre","link-reference","link-reference-group"],jh=AG((0,e5.forwardRef)(e=>{let{className:t,onReady:n,content:o,needCodeHeader:i=!0,theme:a="light",enableSourcePos:s=!1,sendTextMessage:l,...u}=e,[d,p]=(0,e5.useState)([]);function m(e,t){let n;if(!e)return[];let o=[...jm,...t||[]],i=/\[[^\]]*\]\([^)]*\)/g,a=o.length>0?RegExp(`<(${o.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=i.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,e5.useEffect)(()=>{Y7(),je().then(e=>{p(()=>[...jd,...e])}),null==n||n()},[n]);let h=(0,e5.useRef)(null),[f,_]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?jp:o),[g,y]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?m(o,u.whitelistTags):[]),[b,E]=(0,e5.useState)(0),S=(0,e5.useRef)(null),T=()=>{S.current&&(clearTimeout(S.current),S.current=null)};(0,e5.useEffect)(()=>{if(T(),!(null==u?void 0:u.typewriterEffect)){_(o),y([]);return}let e=m(o,u.whitelistTags);if(b>=e.length)_(o),E(e.length),y([]);else{let t=e.slice(0,b),n=e.slice(b);_(t.join("")),y(n)}},[o,null==u?void 0:u.typewriterEffect,null==u?void 0:u.whitelistTags]),(0,e5.useEffect)(()=>{if(!(null==u?void 0:u.typewriterEffect)||0===g.length)return void T();let e=Math.max(Math.floor(g.length/10),2),t=()=>{y(t=>{if(0===t.length)return t;let n=t.slice(0,e),o=t.slice(e);return _(e=>e+n.join("")),E(t=>t+e),o})};return T(),t(),S.current=setTimeout(()=>{let e=()=>{t(),S.current=setTimeout(e,50)};e()},50),T},[g.length,null==u?void 0:u.typewriterEffect]);let C=(0,e5.useMemo)(()=>{jp=f;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 f.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,o)=>{let i="",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&&(i=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let m=[];i&&m.push(`font-size: var(--${i})`),a?m.push(`color: var(--${a})`):s&&m.push(`color: ${s}`);let h=m.join("; "),f=e[i]||"span";return`<${f} style="${h}" class="markdownFont">${o}</${f}>`})},[f]),k=(0,e5.useMemo)(()=>jt(C,{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}}),emotionList:d}),[C,d]),x=(0,e5.useMemo)(()=>{let e=new Fp({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==jr?void 0:jr.getLanguage(t)))try{return null==jr?void 0:jr.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}}),e.linkify.add("dtmd:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),k=(k=(k=k.replace(///g,"/")).replace(/'/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!i)return{html:e.render(k),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,o)=>{let i=e[o],a=i.info.trim()||"plaintext",s=i.content,l=`code-block-${n++}`,u=!0,d=i.map;d&&(k.split("\n")[d[1]-1].trim().endsWith("```")||(u=!1));let p="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,isComplete:u}),`<div data-code-block-id="${l}" data-block-type="${p}"></div>`},{html:e.render(k),codeBlocks:t}},[k,i,s]),w=(null==u?void 0:u.generating)?"ct-markdown generating":"ct-markdown";return(0,e3.jsxs)("div",{ref:h,className:uj()(w,`ct-hljs-${a}`,t),children:[(()=>{if(!i||0===x.codeBlocks.length)return(0,e3.jsx)(Lr,{...u,children:x.html});let e=x.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let o of e)if(o.includes("data-code-block-id")){let e=x.codeBlocks[n];e&&("mermaid"===e.language?t.push((0,e3.jsxs)("div",{children:[e.isComplete&&(0,e3.jsx)(ju,{code:e.code,showCopyButton:!1,theme:a,sendTextMessage:l}),(0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)]},e.id)):t.push((0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else o.trim()&&t.push((0,e3.jsx)(Lr,{...u,children:o},`html-${t.length}`));return(0,e3.jsx)(e3.Fragment,{children:t})})(),(()=>{let{generating:e}=u||{};return!e||x.html?null:(0,e3.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),jf=p8.config(jh),j_=AG((0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jg=p8.config(j_),jy=AG((0,e5.forwardRef)((e,t)=>{let{className:n,text:o}=e;return(0,e3.jsx)("div",{className:uj()("ct-origin",n),children:(0,e3.jsx)("div",{className:"origin-tip-inner",children:o})})}),{displayName:"Origin"}),jb=p8.config(jy),jv=AG((0,e5.forwardRef)((e,t)=>{let{className:n,indicator:o,shape:i="default",size:a="large",...s}=e,l={...s,size:a};if(!o&&i&&"default"!==i){let e=`load-container ${i}`;l.indicator=(0,e3.jsx)("div",{className:e,children:(0,e3.jsx)("div",{className:"loader"})})}return(0,e3.jsx)(E4,{...l,ref:t,className:uj()(`ct-loading ${a} ${i}`,n)})}),{displayName:"Loading"}),jE=p8.config(jv),jS=AG((0,e5.forwardRef)((e,t)=>{let{className:n,headerStyle:o,children:i,footer:a,footerClassName:s,placement:l,...u}=e;return(0,e3.jsxs)(vB,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...o},className:uj()(`ct-drawer ${l}`,n),children:[i,a&&a.length&&(0,e3.jsx)("div",{className:uj()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jT=p8.config(jS),jC=AG((0,e5.forwardRef)((e,t)=>{let{className:n,shape:o="dot",showStatus:i=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,e3.jsxs)("div",{children:["查看更多",(0,e3.jsx)(h2,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...m}=e,[h,f]=(0,e5.useState)([]),[_,g]=(0,e5.useState)(l);return((0,e5.useEffect)(()=>{f(s.map((e,t)=>_&&u<t+1?null:(0,e3.jsx)(TK.Item,{title:e.title,content:e.content,status:i?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,e3.jsx)("div",{className:uj()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...m,ref:t,children:(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(TK,{current:a,shape:o,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:h}),_&&s.length>u&&(0,e3.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,e3.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jk=p8.config(jC);var jx=((eC={}).Generating="generating",eC.Stopped="stopped",eC);let jw="停止生成",jN=AG((0,e5.forwardRef)((e,t)=>{let{className:n,show:o=!0,status:i=jx.Generating,stopText:a=jw,stopIcon:s,stoppedText:l,onStop:u}=e;return o?(0,e3.jsxs)("div",{className:uj()("ct-stop-generate",n),children:[i===jx.Generating&&(0,e3.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,e3.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jw]}),i===jx.Stopped&&(0,e3.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jD=p8.config(jN),jO=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:m,expanded:h}=e,[f,_]=(0,e5.useState)(h||o);(0,e5.useEffect)(()=>{void 0!==h&&h!==f&&_(h)},[h]);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=f?"expand":"";return(0,e3.jsxs)("div",{className:uj()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===i)return null;if("detail"===u){if(!1===i)return null;let e=(null==i?void 0:i.icon)||"close",t=(null==i?void 0:i.title)||"引用信息";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,children:[(0,e3.jsx)("div",{className:"reference-text",children:t}),(0,e3.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:AX(e,"xs")})]})}let e=(null==i?void 0:i.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e.stopPropagation(),p)?p(!f):_(!f)},children:[(0,e3.jsxs)("div",{className:"reference-name",children:[AX(e),(0,e3.jsx)("div",{className:"reference-title",children:null==i?void 0:i.title})]}),(0,e3.jsx)("div",{className:"reference-operate",onClick:e=>{(e.stopPropagation(),s)?s(!f):_(!f)},children:(0,e3.jsx)(AJ,{type:f?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(f||"simple"!==u)?(0,e3.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==m||m(f)},children:[f&&"simple"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.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,e3.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,e3.jsxs)("div",{className:"reference-title",children:[(0,e3.jsxs)("div",{className:"reference-name",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,e3.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jM=p8.config(jO),jA=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsxs)("div",{children:["相关问题",(0,e3.jsx)(h2,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,e5.useState)(o),m=void 0!==a?a:d;return(0,e3.jsxs)("div",{className:uj()("ct-recommend",n),ref:t,children:[(0,e3.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!m),null==l||l(!m)},children:i}),(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,e3.jsx)("div",{className:"recommend-container",children:(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,e3.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t)}))})})]})}),jR=p8.config(jA),jI=(0,e5.forwardRef)((e,t)=>{let{className:n,header:o,footer:i,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:m,querySugList:h,onQuerySugClick:f}=e,[_,g]=(0,e5.useState)(!1),y=m&&_&&h&&h.length>0;return(0,e3.jsxs)("div",{ref:t,className:uj()("ct-rich-text-input",n),children:[(0,e3.jsx)("div",{className:"header",children:o}),(0,e3.jsxs)("div",{className:uj()("input-container",{focus:_}),children:[(0,e3.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,e3.jsx)("div",{className:"input-footer",children:i}),(0,e3.jsx)(hk.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:uj()("query-sug",a),children:(0,e3.jsx)("div",{className:"query-sug-list",children:null==h?void 0:h.map((e,t)=>(0,e3.jsx)("div",{className:"query-sug-item",onClick:()=>{null==f||f(e,t)},children:e.label},e.value))})})})]})]})}),jL=(0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()(n,"ct-ai-loading"),ref:t,children:(0,e3.jsxs)("div",{className:uj()("loading-container","short-container"),children:[(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jP=p8.config(jL),jF=()=>(0,e3.jsx)("div",{className:"radio-item-icon",children:(0,e3.jsx)("div",{className:"radio-item-circle"})}),jY=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-radio",{"ct-radio-disabled":o},a),style:s,...l,children:t.map(e=>(0,e3.jsx)("div",{className:uj()("radio-item",{active:e.value===n,disabled:o||e.disabled}),onClick:()=>{var t;return t=e.value,void(!o&&!e.disabled&&i&&i(t))},onKeyDown:t=>{var n;return n=e.value,void(!o&&!e.disabled&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),i&&i(n)))},role:"radio",tabIndex:o||e.disabled?-1:0,"aria-checked":e.value===n,"aria-disabled":o||e.disabled,children:(0,e3.jsxs)("div",{className:"radio-item-content",children:[(0,e3.jsx)("div",{className:"radio-item-icon-column",children:(0,e3.jsx)(jF,{})}),(0,e3.jsx)("div",{className:"radio-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"radio-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"radio-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"radio-item-text-column",children:[(0,e3.jsx)("div",{className:"radio-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"radio-item-desc",children:e.description})]})]})},e.value))}):null}),{displayName:"Radio"}),jj=p8.config(jY),jB=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||"");e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=!!t,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-radio-group ct-radio-group-list ${i?"ct-radio-group-disabled":""}`,children:[(0,e3.jsx)(jj,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"RadioGroup"}),jU=p8.config(jB),jz=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-checkbox",{"ct-checkbox-disabled":o},a),style:s,...l,children:t.map(e=>{let t=(n||[]).indexOf(e.value)>-1;return(0,e3.jsx)("div",{className:uj()("checkbox-item",{active:t,disabled:o||e.disabled}),onClick:()=>((e,t)=>{if(o||t.disabled)return;let a=n||[],s=a.indexOf(e)>-1?a.filter(t=>t!==e):[...a,e];i&&i(s)})(e.value,e),children:(0,e3.jsxs)("div",{className:"checkbox-item-content",children:[(0,e3.jsx)("div",{className:"checkbox-item-checkbox-column",children:(0,e3.jsx)(f7,{className:"checkbox-item-checkbox",checked:t,disabled:o||e.disabled})}),(0,e3.jsx)("div",{className:"checkbox-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"checkbox-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"checkbox-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"checkbox-item-text-column",children:[(0,e3.jsx)("div",{className:"checkbox-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"checkbox-item-desc",children:e.description})]})]})},e.value)})}):null}),{displayName:"Checkbox"}),jV=p8.config(jz),jH=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||[]);e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=t.length>0,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-checkbox-group ct-checkbox-group-list ${i?"ct-checkbox-group-disabled":""}`,children:[(0,e3.jsx)(jV,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t.length>0&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jG=p8.config(jH),jW=RF(e=>{let{className:t,dataSource:n,mode:o="single",buttonCols:i=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,e5.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/i)},(e,t)=>{let a=t*i,p=Math.min(a+i,(null==n?void 0:n.length)||0),m=null==n?void 0:n.slice(a,p);return(null==m?void 0:m.length)?(0,e3.jsx)("div",{className:"select-row-container",children:m&&m.length?m.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,m="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?m="selected":"object"==typeof u&&"value"in u&&u.value===n&&(m="selected");let h=p;return u&&"single"===o&&"normal"===m&&(h=!0),(0,e3.jsx)(_A,{onClick:()=>((e,t)=>{if("multiple"===o)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"===o){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,m),type:"normal",disabled:h,className:`select-item ${m} row${i}`,size:s,children:a},`select_${t}`)}):null},`row_${t}`):null});return(0,e3.jsx)("div",{className:uj()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),jK=RF((0,e5.forwardRef)((e,t)=>{let{className:n,size:o="medium",mode:i="single",onChange:a,...s}=e;return(0,e3.jsx)(gU,{...s,className:uj()("ct-select",n),size:o,ref:t,mode:i,onChange:a})})),jq=AG((0,e5.forwardRef)((e,t)=>{let{className:n,display:o="select",buttonCols:i=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":o)?(0,e3.jsx)(jW,{className:n,dataSource:a,mode:s,buttonCols:i,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,e3.jsx)(jK,{...u,className:uj()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:uj()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),j$=p8.config(jq),jQ=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,e3.jsxs)("div",{children:[(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,e5.useRef)(null),m=(0,e5.useRef)(null),[h,f]=(0,e5.useState)(o),[_,g]=(0,e5.useState)(o),y=void 0!==s?s:h,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 o=e.getBoundingClientRect().height,i=e.getBoundingClientRect().width,a=(null==(n=m.current)?void 0:n.getBoundingClientRect().width)||i;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 o=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",o)};e.addEventListener("transitionend",o)}else{e.style.height=`${o}px`,e.style.width=`${i}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,e5.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,e3.jsxs)("div",{className:uj()("ct-flip",n),ref:t,children:[(0,e3.jsx)("div",{className:"flip-header-container",ref:m,children:a||(0,e3.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&f(e)},children:[i,(0,e3.jsx)("span",{className:"flip-header-icon",children:(0,e3.jsx)(AJ,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,e3.jsx)("div",{className:"flip-content",ref:p,style:{height:o?"auto":0,width:o?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),jJ=p8.config(jQ),jX=(0,e5.forwardRef)((e,t)=>{let{useText:n="使用",name:o,className:i,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:m,disabled:h=!1}=e,f=a?"selected":"";return f=d?`${f} full-width`:`${f}`,f=l?`${f} enable-click`:`${f}`,(0,e3.jsxs)("div",{className:uj()(`ct-tool-status ${f} ${s} ${h?"disabled":""}`,i),ref:t,onClick:t=>{h||(t.stopPropagation(),null==l||l(e))},children:[(0,e3.jsx)(AJ,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,e3.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,e3.jsxs)("div",{className:"content-container",children:[(0,e3.jsx)("div",{className:"content-use-tips",children:n}),m&&(0,e3.jsx)("div",{className:"content-group",children:m}),o&&(0,e3.jsx)("div",{className:"content-name",children:o}),p&&(0,e3.jsx)("div",{className:"content-detail",children:p})]})]})}),jZ=p8.config(jX),j1=AG((0,e5.forwardRef)(e=>{let{className:t,children:n,...o}=e;return(0,e3.jsx)(yJ,{...o,className:uj()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:yJ.Panel}),j0=p8.config(j1),j2=(0,e5.forwardRef)((e,t)=>{let{className:n,size:o="small",hasBorder:i=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,e5.useState)(!1);return(0,e3.jsxs)("div",{className:"ct-table-container",children:[a?(0,e3.jsxs)("div",{className:"ct-table-header",children:[a&&(0,e3.jsx)("div",{className:"ct-table-title",children:a}),s?(0,e3.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,e3.jsx)(AJ,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,e3.jsx)(ko,{...l,ref:t,className:uj()("ct-table",{[`ct-table-${o}`]:o,"ct-table-no-border":!i},n),size:o})]})});j2.displayName="Table";let j3=p8.config(j2),j5=(0,e5.forwardRef)((e,t)=>{let{className:n,text:o,...i}=e;return(0,e3.jsxs)("div",{...i,className:uj()("ct-error-notice",n),ref:t,children:[(0,e3.jsx)("div",{className:"ct-error-notice-icon",children:(0,e3.jsx)(h2,{size:16,type:"prompt"})}),(0,e3.jsx)("span",{className:"ct-error-notice-text",children:o})]})});j5.displayName="ErrorNotice";let j4=p8.config(j5),j6=(0,e5.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,e3.jsx)("div",{...o,className:uj()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,e3.jsx)("div",{className:"ct-empty-line"},t))})});j6.displayName="Empty";let j9=p8.config(j6),j8=(0,e5.forwardRef)((e,t)=>{let{className:n,title:o="",content:i,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:m=!0,showDownloadButton:h=!0,contentHeight:f=128,..._}=e,g=f-25,y=(0,e5.useRef)(null),[b,E]=(0,e5.useState)(0),[S,T]=(0,e5.useState)(!1),[C,k]=(0,e5.useState)(()=>f>128?128:f),x=e=>{let t=Array.from(e.children);return 0===t.length?e:x(t[t.length-1])},w=(0,e5.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=x(e);if(!n)return;let o=n.getBoundingClientRect(),i=o.top-t.top,s=a?i+o.height:i+o.height+20;if(f>128&&C<f){let e=C-25;if(s>e)return void k(Math.min(f,C+(s-e)))}if(!(s+b<g&&i+b>0))return void E(-i)},[b,f,C,a]),N=Rv(w,200);(0,e5.useEffect)(()=>{w()},[a]),(0,e5.useEffect)(()=>{if("string"==typeof i)return void N();if(!y.current)return;let e=new MutationObserver(()=>{N()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[i,N]);let D=e=>{o&&p&&s&&(e.stopPropagation(),null==s||s())},O=e=>{e.stopPropagation()};return(0,e3.jsxs)("div",{..._,className:uj()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:D,children:[o?(0,e3.jsxs)("div",{className:"ct-document-header",children:[(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)(AJ,{type:"document",className:"ct-document-header-icon"}),(0,e3.jsx)("span",{className:uj()("ct-document-header-title"),children:o})]}),(0,e3.jsxs)("div",{className:uj()("ct-document-header-actions"),children:[(0,e3.jsxs)("div",{className:uj()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:D,children:[(0,e3.jsx)(AJ,{type:"preview",className:"ct-document-header-preview-icon"}),(0,e3.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!m||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,e3.jsx)(AJ,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!h||!d&&!u}),onClick:d?O:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,e3.jsx)(AJ,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,e3.jsx)("div",{className:"ct-document-header",children:(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,e3.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),i?(0,e3.jsxs)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,e3.jsx)("div",{className:"ct-document-mask"}),(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:O,children:i})})]}):(0,e3.jsx)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),children:(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)(j9,{})})})]})});j8.displayName="Document";let j7=p8.config(j8),Be="0.3.60-beta.6",Bt=e=>{let{globalExpandCode:t}=e,[n,o]=(0,e5.useState)(!1),[i,a]=(0,e5.useState)(t);(0,e5.useEffect)(()=>{o(!0)},[]),(0,e5.useEffect)(()=>{a(t)},[t]);let s=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),l=(0,iZ.kebabCase)(e.demoKey),d=`${l}-container`;return(0,e3.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,e3.jsxs)("div",{id:`${l}-desc`,className:"demo-item-desc markdown",children:[(0,e3.jsx)(i1,{id:d,title:s["@demo"],component:"h3"}),(0,e3.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,e3.jsx)(ob,{remarkPlugins:[iA],children:s["@remarks"]})})]}),(0,e3.jsxs)(uR,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${l}-mount`),require:e=>{let t={"@alifd/chat":e2,"@alifd/next":e$,"react-dom":e6,"styled-components":eQ,react:e4(),classnames:uj()},n=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return n&&u(64615)(`./${n[2]}/style`),t[e]}},noInline:!0,children:[(0,e3.jsx)("div",{id:`${l}-mount`,className:"next-demo-mount",children:n?(0,e3.jsx)(uL,{}):null}),n?(0,e3.jsx)(uF,{}):null,(0,e3.jsx)("div",{id:`${l}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,e3.jsx)("div",{id:`${l}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,e3.jsxs)(fl.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,e3.jsx)("span",{id:`${l}-icon-hide`,onClick:()=>{a(!i)},children:(0,e3.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,e3.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,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),"小提示:",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,e3.jsx)("div",{id:`${l}-body`,className:"next-demo-body",style:{display:i?"block":"none"},children:(0,e3.jsx)("div",{id:`${l}-live-editor`,children:(0,e3.jsx)("div",{id:`${l}-live-body`,className:"react-live-body",children:(0,e3.jsx)(uI,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Bn=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:o,onToggleLiveDemo:i,data:a=[]}=e,[s,l]=(0,e5.useState)(n),[u,d]=(0,e5.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,e3.jsxs)("div",{className:"demo-index",children:[(0,e3.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof i&&i(!u)},children:[(0,e3.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,e3.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,e3.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,e3.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,e3.jsx)(fl.Tooltip,{trigger:(0,e3.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 o&&o(!s)},children:[(0,e3.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,e3.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,e3.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,e3.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,e3.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,e3.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,e3.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};e6.render((0,e3.jsx)(()=>{var e;let[t,n]=(0,e5.useState)(!0),[o,i]=(0,e5.useState)(!1),a={basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Button, Balloon } from "@alifd/chat";\nimport "@alifd/chat/es/button/style";\nimport "@alifd/chat/es/balloon/style";\nconst Demo = () => (\n <div className="balloon-container">\n <Balloon\n v2\n triggerType="click"\n title="Balloon Title"\n trigger={\n <Button type="secondary" size="medium">\n Default\n </Button>\n }\n align="br"\n >\n First performed around 1600, Hamlet tells the story of a prince whose duty\n to revenge his father\'s death entangles him in philosophical problems he\n can\'t solve.\n </Balloon>\n <Balloon\n v2\n type="primary"\n triggerType="click"\n title="Balloon Title"\n trigger={\n <Button type="primary" size="medium">\n Primary\n </Button>\n }\n align="br"\n closable={false}\n >\n First performed around 1600, Hamlet tells the story of a prince whose duty\n to revenge his father\'s death entangles him in philosophical problems he\n can\'t solve.\n </Balloon>\n </div>\n);\nReactDOM.render(<Demo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"常见气泡使用类型\n- Common types of Balloon."},{tag:"@demo",content:"类型"},{tag:"@en",content:"Style Type"},{tag:"@order",content:"0"}]}}},s=[{tag:"@component",content:"气泡提示"},{tag:"@en",content:"Balloon"},{tag:"@type",content:"反馈 - Feedback"},{tag:"@when",content:"当用户与被说明对象(文字,图片,输入框等)发生交互行为的 action 开始时,即刻跟随动作出现一种辅助或帮助的提示信息。其中 Balloon.Tooltip 是简化版本,主要用于 hover 时显示简单文案。 - Balloon is used when you hope to show auxiliary or help message during users' interacting with the illustrated object (text, picture, input box, etc.). Particularly, Balloon.Tooltip is a simplified Balloon for displaying tip when hovered. If you want the content to be clickable, use `<Balloon.Tootip delay={100} />`"}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),l={id:"demo-list",title:"代码演示"},u=Object.keys(a).sort((e,t)=>{var n,o,i,s;return parseInt((null==(o=a[e].docInfo.tags)||null==(n=o.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=a[t].docInfo.tags)||null==(i=s.find(e=>"@order"===e.tag))?void 0:i.content)||"0")}),d=[...s["@when"]?[{id:"何时使用",title:"何时使用"}]:[],l,...u.map(e=>{let t=(0,iZ.kebabCase)(e);return{id:`${t}-container`,title:a[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,e3.jsxs)("div",{className:"demo-wrapper",children:[(0,e3.jsx)("div",{className:"demo-title markdown",children:(0,e3.jsx)("h1",{children:s["@en"]})}),(0,e3.jsx)(Bn,{defaultExpandCode:o,defaultLiveDemo:t,onToggleLiveDemo:n,onToggleExpandCode:i,data:d}),(0,e3.jsx)("div",{className:"demo-head",children:(0,e3.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,e3.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,e3.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,e3.jsx)("p",{children:i2(s["@remarks"])}),(e=s["@when"])?(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(i1,{id:"何时使用",title:"何时使用"}),(0,e3.jsx)("ul",{children:(0,e3.jsx)("li",{children:i2(e)})})]}):null,(0,e3.jsx)(i1,{...l})]}),u.map((e,n)=>(0,e5.createElement)(Bt,{disabled:!t,globalExpandCode:o,...a[e],demoKey:e,key:n})),(0,e3.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,e3.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,e3.jsx)(i1,{id:"API",title:"API"}),[].map(e=>(0,e5.createElement)(i0,{...e,key:e.title})),s["@others"]?(0,e3.jsx)(ob,{remarkPlugins:[iA],rehypePlugins:[iq,[ij,{behavior:"append",content:()=>[iX("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:s["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();
|
|
136
|
+
如何解决这个问题?如果你能提供修复方案,请保持简洁。`;i&&i(e)}},children:"使用对话修复"})})]})})}):(0,e3.jsx)("div",{className:"ct-mermaid-view-content",children:(0,e3.jsx)("div",{ref:a,className:"ct-mermaid-view-chart"})}),d&&(0,e3.jsx)("div",{className:"ct-mermaid-view-loading",children:(0,e3.jsx)(E4,{size:"medium"})})]})});jc.displayName="MermaidView";let ju=p8.config(jc),jd=[{emotionVersion:"75",emotionId:"emotion_180001",dynamicEmotionId:"",showType:1,skinList:[],name:"[魔法棒]",names:{en_US:"[Magic Wand]",ja_JP:"[魔棒]",vi_VN:"[đũa ph\xe9p]",zh_CN:"[魔法棒]",zh_HK:"[魔法棒]",zh_TW:"[魔法棒]"},url:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",staticURL:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",fallbacks:[]}],jp="",jm=["img","code","pre","link-reference","link-reference-group"],jh=AG((0,e5.forwardRef)(e=>{let{className:t,onReady:n,content:o,needCodeHeader:i=!0,theme:a="light",enableSourcePos:s=!1,sendTextMessage:l,...u}=e,[d,p]=(0,e5.useState)([]);function m(e,t){let n;if(!e)return[];let o=[...jm,...t||[]],i=/\[[^\]]*\]\([^)]*\)/g,a=o.length>0?RegExp(`<(${o.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=i.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,e5.useEffect)(()=>{Y7(),je().then(e=>{p(()=>[...jd,...e])}),null==n||n()},[n]);let h=(0,e5.useRef)(null),[f,_]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?jp:o),[g,y]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?m(o,u.whitelistTags):[]),[b,E]=(0,e5.useState)(0),S=(0,e5.useRef)(null),T=()=>{S.current&&(clearTimeout(S.current),S.current=null)};(0,e5.useEffect)(()=>{if(T(),!(null==u?void 0:u.typewriterEffect)){_(o),y([]);return}let e=m(o,u.whitelistTags);if(b>=e.length)_(o),E(e.length),y([]);else{let t=e.slice(0,b),n=e.slice(b);_(t.join("")),y(n)}},[o,null==u?void 0:u.typewriterEffect,null==u?void 0:u.whitelistTags]),(0,e5.useEffect)(()=>{if(!(null==u?void 0:u.typewriterEffect)||0===g.length)return void T();let e=Math.max(Math.floor(g.length/10),2),t=()=>{y(t=>{if(0===t.length)return t;let n=t.slice(0,e),o=t.slice(e);return _(e=>e+n.join("")),E(t=>t+e),o})};return T(),t(),S.current=setTimeout(()=>{let e=()=>{t(),S.current=setTimeout(e,50)};e()},50),T},[g.length,null==u?void 0:u.typewriterEffect]);let C=(0,e5.useMemo)(()=>{jp=f;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 f.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,o)=>{let i="",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&&(i=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let m=[];i&&m.push(`font-size: var(--${i})`),a?m.push(`color: var(--${a})`):s&&m.push(`color: ${s}`);let h=m.join("; "),f=e[i]||"span";return`<${f} style="${h}" class="markdownFont">${o}</${f}>`})},[f]),k=(0,e5.useMemo)(()=>jt(C,{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}}),emotionList:d}),[C,d]),x=(0,e5.useMemo)(()=>{let e=new Fp({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==jr?void 0:jr.getLanguage(t)))try{return null==jr?void 0:jr.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}}),e.linkify.add("dtmd:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),k=(k=(k=k.replace(///g,"/")).replace(/'/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!i)return{html:e.render(k),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,o)=>{let i=e[o],a=i.info.trim()||"plaintext",s=i.content,l=`code-block-${n++}`,u=!0,d=i.map;d&&(k.split("\n")[d[1]-1].trim().endsWith("```")||(u=!1));let p="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,isComplete:u}),`<div data-code-block-id="${l}" data-block-type="${p}"></div>`},{html:e.render(k),codeBlocks:t}},[k,i,s]),w=(null==u?void 0:u.generating)?"ct-markdown generating":"ct-markdown";return(0,e3.jsxs)("div",{ref:h,className:uj()(w,`ct-hljs-${a}`,t),children:[(()=>{if(!i||0===x.codeBlocks.length)return(0,e3.jsx)(Lr,{...u,children:x.html});let e=x.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let o of e)if(o.includes("data-code-block-id")){let e=x.codeBlocks[n];e&&("mermaid"===e.language?t.push((0,e3.jsxs)("div",{children:[e.isComplete&&(0,e3.jsx)(ju,{code:e.code,showCopyButton:!1,theme:a,sendTextMessage:l}),(0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)]},e.id)):t.push((0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else o.trim()&&t.push((0,e3.jsx)(Lr,{...u,children:o},`html-${t.length}`));return(0,e3.jsx)(e3.Fragment,{children:t})})(),(()=>{let{generating:e}=u||{};return!e||x.html?null:(0,e3.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),jf=p8.config(jh),j_=AG((0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jg=p8.config(j_),jy=AG((0,e5.forwardRef)((e,t)=>{let{className:n,text:o}=e;return(0,e3.jsx)("div",{className:uj()("ct-origin",n),children:(0,e3.jsx)("div",{className:"origin-tip-inner",children:o})})}),{displayName:"Origin"}),jb=p8.config(jy),jv=AG((0,e5.forwardRef)((e,t)=>{let{className:n,indicator:o,shape:i="default",size:a="large",...s}=e,l={...s,size:a};if(!o&&i&&"default"!==i){let e=`load-container ${i}`;l.indicator=(0,e3.jsx)("div",{className:e,children:(0,e3.jsx)("div",{className:"loader"})})}return(0,e3.jsx)(E4,{...l,ref:t,className:uj()(`ct-loading ${a} ${i}`,n)})}),{displayName:"Loading"}),jE=p8.config(jv),jS=AG((0,e5.forwardRef)((e,t)=>{let{className:n,headerStyle:o,children:i,footer:a,footerClassName:s,placement:l,...u}=e;return(0,e3.jsxs)(vB,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...o},className:uj()(`ct-drawer ${l}`,n),children:[i,a&&a.length&&(0,e3.jsx)("div",{className:uj()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jT=p8.config(jS),jC=AG((0,e5.forwardRef)((e,t)=>{let{className:n,shape:o="dot",showStatus:i=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,e3.jsxs)("div",{children:["查看更多",(0,e3.jsx)(h2,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...m}=e,[h,f]=(0,e5.useState)([]),[_,g]=(0,e5.useState)(l);return((0,e5.useEffect)(()=>{f(s.map((e,t)=>_&&u<t+1?null:(0,e3.jsx)(TK.Item,{title:e.title,content:e.content,status:i?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,e3.jsx)("div",{className:uj()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...m,ref:t,children:(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(TK,{current:a,shape:o,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:h}),_&&s.length>u&&(0,e3.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,e3.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jk=p8.config(jC);var jx=((eC={}).Generating="generating",eC.Stopped="stopped",eC);let jw="停止生成",jN=AG((0,e5.forwardRef)((e,t)=>{let{className:n,show:o=!0,status:i=jx.Generating,stopText:a=jw,stopIcon:s,stoppedText:l,onStop:u}=e;return o?(0,e3.jsxs)("div",{className:uj()("ct-stop-generate",n),children:[i===jx.Generating&&(0,e3.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,e3.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jw]}),i===jx.Stopped&&(0,e3.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jD=p8.config(jN),jO=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:m,expanded:h}=e,[f,_]=(0,e5.useState)(h||o);(0,e5.useEffect)(()=>{void 0!==h&&h!==f&&_(h)},[h]);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=f?"expand":"";return(0,e3.jsxs)("div",{className:uj()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===i)return null;if("detail"===u){if(!1===i)return null;let e=(null==i?void 0:i.icon)||"close",t=(null==i?void 0:i.title)||"引用信息";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,children:[(0,e3.jsx)("div",{className:"reference-text",children:t}),(0,e3.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:AX(e,"xs")})]})}let e=(null==i?void 0:i.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e.stopPropagation(),p)?p(!f):_(!f)},children:[(0,e3.jsxs)("div",{className:"reference-name",children:[AX(e),(0,e3.jsx)("div",{className:"reference-title",children:null==i?void 0:i.title})]}),(0,e3.jsx)("div",{className:"reference-operate",onClick:e=>{(e.stopPropagation(),s)?s(!f):_(!f)},children:(0,e3.jsx)(AJ,{type:f?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(f||"simple"!==u)?(0,e3.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==m||m(f)},children:[f&&"simple"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.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,e3.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,e3.jsxs)("div",{className:"reference-title",children:[(0,e3.jsxs)("div",{className:"reference-name",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,e3.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jM=p8.config(jO),jA=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsxs)("div",{children:["相关问题",(0,e3.jsx)(h2,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,e5.useState)(o),m=void 0!==a?a:d;return(0,e3.jsxs)("div",{className:uj()("ct-recommend",n),ref:t,children:[(0,e3.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!m),null==l||l(!m)},children:i}),(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,e3.jsx)("div",{className:"recommend-container",children:(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,e3.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t)}))})})]})}),jR=p8.config(jA),jI=(0,e5.forwardRef)((e,t)=>{let{className:n,header:o,footer:i,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:m,querySugList:h,onQuerySugClick:f}=e,[_,g]=(0,e5.useState)(!1),y=m&&_&&h&&h.length>0;return(0,e3.jsxs)("div",{ref:t,className:uj()("ct-rich-text-input",n),children:[(0,e3.jsx)("div",{className:"header",children:o}),(0,e3.jsxs)("div",{className:uj()("input-container",{focus:_}),children:[(0,e3.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,e3.jsx)("div",{className:"input-footer",children:i}),(0,e3.jsx)(hk.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:uj()("query-sug",a),children:(0,e3.jsx)("div",{className:"query-sug-list",children:null==h?void 0:h.map((e,t)=>(0,e3.jsx)("div",{className:"query-sug-item",onClick:()=>{null==f||f(e,t)},children:e.label},e.value))})})})]})]})}),jL=(0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()(n,"ct-ai-loading"),ref:t,children:(0,e3.jsxs)("div",{className:uj()("loading-container","short-container"),children:[(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jP=p8.config(jL),jF=()=>(0,e3.jsx)("div",{className:"radio-item-icon",children:(0,e3.jsx)("div",{className:"radio-item-circle"})}),jY=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-radio",{"ct-radio-disabled":o},a),style:s,...l,children:t.map(e=>(0,e3.jsx)("div",{className:uj()("radio-item",{active:e.value===n,disabled:o||e.disabled}),onClick:()=>{var t;return t=e.value,void(!o&&!e.disabled&&i&&i(t))},onKeyDown:t=>{var n;return n=e.value,void(!o&&!e.disabled&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),i&&i(n)))},role:"radio",tabIndex:o||e.disabled?-1:0,"aria-checked":e.value===n,"aria-disabled":o||e.disabled,children:(0,e3.jsxs)("div",{className:"radio-item-content",children:[(0,e3.jsx)("div",{className:"radio-item-icon-column",children:(0,e3.jsx)(jF,{})}),(0,e3.jsx)("div",{className:"radio-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"radio-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"radio-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"radio-item-text-column",children:[(0,e3.jsx)("div",{className:"radio-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"radio-item-desc",children:e.description})]})]})},e.value))}):null}),{displayName:"Radio"}),jj=p8.config(jY),jB=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||"");e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=!!t,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-radio-group ct-radio-group-list ${i?"ct-radio-group-disabled":""}`,children:[(0,e3.jsx)(jj,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"RadioGroup"}),jU=p8.config(jB),jz=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-checkbox",{"ct-checkbox-disabled":o},a),style:s,...l,children:t.map(e=>{let t=(n||[]).indexOf(e.value)>-1;return(0,e3.jsx)("div",{className:uj()("checkbox-item",{active:t,disabled:o||e.disabled}),onClick:()=>((e,t)=>{if(o||t.disabled)return;let a=n||[],s=a.indexOf(e)>-1?a.filter(t=>t!==e):[...a,e];i&&i(s)})(e.value,e),children:(0,e3.jsxs)("div",{className:"checkbox-item-content",children:[(0,e3.jsx)("div",{className:"checkbox-item-checkbox-column",children:(0,e3.jsx)(f7,{className:"checkbox-item-checkbox",checked:t,disabled:o||e.disabled})}),(0,e3.jsx)("div",{className:"checkbox-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"checkbox-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"checkbox-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"checkbox-item-text-column",children:[(0,e3.jsx)("div",{className:"checkbox-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"checkbox-item-desc",children:e.description})]})]})},e.value)})}):null}),{displayName:"Checkbox"}),jV=p8.config(jz),jH=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||[]);e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=t.length>0,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-checkbox-group ct-checkbox-group-list ${i?"ct-checkbox-group-disabled":""}`,children:[(0,e3.jsx)(jV,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t.length>0&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jG=p8.config(jH),jW=RF(e=>{let{className:t,dataSource:n,mode:o="single",buttonCols:i=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,e5.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/i)},(e,t)=>{let a=t*i,p=Math.min(a+i,(null==n?void 0:n.length)||0),m=null==n?void 0:n.slice(a,p);return(null==m?void 0:m.length)?(0,e3.jsx)("div",{className:"select-row-container",children:m&&m.length?m.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,m="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?m="selected":"object"==typeof u&&"value"in u&&u.value===n&&(m="selected");let h=p;return u&&"single"===o&&"normal"===m&&(h=!0),(0,e3.jsx)(_A,{onClick:()=>((e,t)=>{if("multiple"===o)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"===o){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,m),type:"normal",disabled:h,className:`select-item ${m} row${i}`,size:s,children:a},`select_${t}`)}):null},`row_${t}`):null});return(0,e3.jsx)("div",{className:uj()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),jK=RF((0,e5.forwardRef)((e,t)=>{let{className:n,size:o="medium",mode:i="single",onChange:a,...s}=e;return(0,e3.jsx)(gU,{...s,className:uj()("ct-select",n),size:o,ref:t,mode:i,onChange:a})})),jq=AG((0,e5.forwardRef)((e,t)=>{let{className:n,display:o="select",buttonCols:i=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":o)?(0,e3.jsx)(jW,{className:n,dataSource:a,mode:s,buttonCols:i,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,e3.jsx)(jK,{...u,className:uj()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:uj()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),j$=p8.config(jq),jQ=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,e3.jsxs)("div",{children:[(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,e5.useRef)(null),m=(0,e5.useRef)(null),[h,f]=(0,e5.useState)(o),[_,g]=(0,e5.useState)(o),y=void 0!==s?s:h,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 o=e.getBoundingClientRect().height,i=e.getBoundingClientRect().width,a=(null==(n=m.current)?void 0:n.getBoundingClientRect().width)||i;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 o=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",o)};e.addEventListener("transitionend",o)}else{e.style.height=`${o}px`,e.style.width=`${i}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,e5.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,e3.jsxs)("div",{className:uj()("ct-flip",n),ref:t,children:[(0,e3.jsx)("div",{className:"flip-header-container",ref:m,children:a||(0,e3.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&f(e)},children:[i,(0,e3.jsx)("span",{className:"flip-header-icon",children:(0,e3.jsx)(AJ,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,e3.jsx)("div",{className:"flip-content",ref:p,style:{height:o?"auto":0,width:o?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),jJ=p8.config(jQ),jX=(0,e5.forwardRef)((e,t)=>{let{useText:n="使用",name:o,className:i,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:m,disabled:h=!1}=e,f=a?"selected":"";return f=d?`${f} full-width`:`${f}`,f=l?`${f} enable-click`:`${f}`,(0,e3.jsxs)("div",{className:uj()(`ct-tool-status ${f} ${s} ${h?"disabled":""}`,i),ref:t,onClick:t=>{h||(t.stopPropagation(),null==l||l(e))},children:[(0,e3.jsx)(AJ,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,e3.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,e3.jsxs)("div",{className:"content-container",children:[(0,e3.jsx)("div",{className:"content-use-tips",children:n}),m&&(0,e3.jsx)("div",{className:"content-group",children:m}),o&&(0,e3.jsx)("div",{className:"content-name",children:o}),p&&(0,e3.jsx)("div",{className:"content-detail",children:p})]})]})}),jZ=p8.config(jX),j1=AG((0,e5.forwardRef)(e=>{let{className:t,children:n,...o}=e;return(0,e3.jsx)(yJ,{...o,className:uj()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:yJ.Panel}),j0=p8.config(j1),j2=(0,e5.forwardRef)((e,t)=>{let{className:n,size:o="small",hasBorder:i=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,e5.useState)(!1);return(0,e3.jsxs)("div",{className:"ct-table-container",children:[a?(0,e3.jsxs)("div",{className:"ct-table-header",children:[a&&(0,e3.jsx)("div",{className:"ct-table-title",children:a}),s?(0,e3.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,e3.jsx)(AJ,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,e3.jsx)(ko,{...l,ref:t,className:uj()("ct-table",{[`ct-table-${o}`]:o,"ct-table-no-border":!i},n),size:o})]})});j2.displayName="Table";let j3=p8.config(j2),j5=(0,e5.forwardRef)((e,t)=>{let{className:n,text:o,...i}=e;return(0,e3.jsxs)("div",{...i,className:uj()("ct-error-notice",n),ref:t,children:[(0,e3.jsx)("div",{className:"ct-error-notice-icon",children:(0,e3.jsx)(h2,{size:16,type:"prompt"})}),(0,e3.jsx)("span",{className:"ct-error-notice-text",children:o})]})});j5.displayName="ErrorNotice";let j4=p8.config(j5),j6=(0,e5.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,e3.jsx)("div",{...o,className:uj()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,e3.jsx)("div",{className:"ct-empty-line"},t))})});j6.displayName="Empty";let j9=p8.config(j6),j8=(0,e5.forwardRef)((e,t)=>{let{className:n,title:o="",content:i,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:m=!0,showDownloadButton:h=!0,contentHeight:f=128,..._}=e,g=f-25,y=(0,e5.useRef)(null),[b,E]=(0,e5.useState)(0),[S,T]=(0,e5.useState)(!1),[C,k]=(0,e5.useState)(()=>f>128?128:f),x=e=>{let t=Array.from(e.children);return 0===t.length?e:x(t[t.length-1])},w=(0,e5.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=x(e);if(!n)return;let o=n.getBoundingClientRect(),i=o.top-t.top,s=a?i+o.height:i+o.height+20;if(f>128&&C<f){let e=C-25;if(s>e)return void k(Math.min(f,C+(s-e)))}if(!(s+b<g&&i+b>0))return void E(-i)},[b,f,C,a]),N=Rv(w,200);(0,e5.useEffect)(()=>{w()},[a]),(0,e5.useEffect)(()=>{if("string"==typeof i)return void N();if(!y.current)return;let e=new MutationObserver(()=>{N()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[i,N]);let D=e=>{o&&p&&s&&(e.stopPropagation(),null==s||s())},O=e=>{e.stopPropagation()};return(0,e3.jsxs)("div",{..._,className:uj()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:D,children:[o?(0,e3.jsxs)("div",{className:"ct-document-header",children:[(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)(AJ,{type:"document",className:"ct-document-header-icon"}),(0,e3.jsx)("span",{className:uj()("ct-document-header-title"),children:o})]}),(0,e3.jsxs)("div",{className:uj()("ct-document-header-actions"),children:[(0,e3.jsxs)("div",{className:uj()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:D,children:[(0,e3.jsx)(AJ,{type:"preview",className:"ct-document-header-preview-icon"}),(0,e3.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!m||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,e3.jsx)(AJ,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!h||!d&&!u}),onClick:d?O:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,e3.jsx)(AJ,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,e3.jsx)("div",{className:"ct-document-header",children:(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,e3.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),i?(0,e3.jsxs)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,e3.jsx)("div",{className:"ct-document-mask"}),(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:O,children:i})})]}):(0,e3.jsx)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),children:(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)(j9,{})})})]})});j8.displayName="Document";let j7=p8.config(j8),Be="0.3.60",Bt=e=>{let{globalExpandCode:t}=e,[n,o]=(0,e5.useState)(!1),[i,a]=(0,e5.useState)(t);(0,e5.useEffect)(()=>{o(!0)},[]),(0,e5.useEffect)(()=>{a(t)},[t]);let s=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),l=(0,iZ.kebabCase)(e.demoKey),d=`${l}-container`;return(0,e3.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,e3.jsxs)("div",{id:`${l}-desc`,className:"demo-item-desc markdown",children:[(0,e3.jsx)(i1,{id:d,title:s["@demo"],component:"h3"}),(0,e3.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,e3.jsx)(ob,{remarkPlugins:[iA],children:s["@remarks"]})})]}),(0,e3.jsxs)(uR,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${l}-mount`),require:e=>{let t={"@alifd/chat":e2,"@alifd/next":e$,"react-dom":e6,"styled-components":eQ,react:e4(),classnames:uj()},n=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return n&&u(64615)(`./${n[2]}/style`),t[e]}},noInline:!0,children:[(0,e3.jsx)("div",{id:`${l}-mount`,className:"next-demo-mount",children:n?(0,e3.jsx)(uL,{}):null}),n?(0,e3.jsx)(uF,{}):null,(0,e3.jsx)("div",{id:`${l}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,e3.jsx)("div",{id:`${l}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,e3.jsxs)(fl.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,e3.jsx)("span",{id:`${l}-icon-hide`,onClick:()=>{a(!i)},children:(0,e3.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,e3.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,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),"小提示:",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,e3.jsx)("div",{id:`${l}-body`,className:"next-demo-body",style:{display:i?"block":"none"},children:(0,e3.jsx)("div",{id:`${l}-live-editor`,children:(0,e3.jsx)("div",{id:`${l}-live-body`,className:"react-live-body",children:(0,e3.jsx)(uI,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Bn=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:o,onToggleLiveDemo:i,data:a=[]}=e,[s,l]=(0,e5.useState)(n),[u,d]=(0,e5.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,e3.jsxs)("div",{className:"demo-index",children:[(0,e3.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof i&&i(!u)},children:[(0,e3.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,e3.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,e3.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,e3.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,e3.jsx)(fl.Tooltip,{trigger:(0,e3.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 o&&o(!s)},children:[(0,e3.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,e3.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,e3.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,e3.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,e3.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,e3.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,e3.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};e6.render((0,e3.jsx)(()=>{var e;let[t,n]=(0,e5.useState)(!0),[o,i]=(0,e5.useState)(!1),a={basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Button, Balloon } from "@alifd/chat";\nimport "@alifd/chat/es/button/style";\nimport "@alifd/chat/es/balloon/style";\nconst Demo = () => (\n <div className="balloon-container">\n <Balloon\n v2\n triggerType="click"\n title="Balloon Title"\n trigger={\n <Button type="secondary" size="medium">\n Default\n </Button>\n }\n align="br"\n >\n First performed around 1600, Hamlet tells the story of a prince whose duty\n to revenge his father\'s death entangles him in philosophical problems he\n can\'t solve.\n </Balloon>\n <Balloon\n v2\n type="primary"\n triggerType="click"\n title="Balloon Title"\n trigger={\n <Button type="primary" size="medium">\n Primary\n </Button>\n }\n align="br"\n closable={false}\n >\n First performed around 1600, Hamlet tells the story of a prince whose duty\n to revenge his father\'s death entangles him in philosophical problems he\n can\'t solve.\n </Balloon>\n </div>\n);\nReactDOM.render(<Demo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"常见气泡使用类型\n- Common types of Balloon."},{tag:"@demo",content:"类型"},{tag:"@en",content:"Style Type"},{tag:"@order",content:"0"}]}}},s=[{tag:"@component",content:"气泡提示"},{tag:"@en",content:"Balloon"},{tag:"@type",content:"反馈 - Feedback"},{tag:"@when",content:"当用户与被说明对象(文字,图片,输入框等)发生交互行为的 action 开始时,即刻跟随动作出现一种辅助或帮助的提示信息。其中 Balloon.Tooltip 是简化版本,主要用于 hover 时显示简单文案。 - Balloon is used when you hope to show auxiliary or help message during users' interacting with the illustrated object (text, picture, input box, etc.). Particularly, Balloon.Tooltip is a simplified Balloon for displaying tip when hovered. If you want the content to be clickable, use `<Balloon.Tootip delay={100} />`"}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),l={id:"demo-list",title:"代码演示"},u=Object.keys(a).sort((e,t)=>{var n,o,i,s;return parseInt((null==(o=a[e].docInfo.tags)||null==(n=o.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=a[t].docInfo.tags)||null==(i=s.find(e=>"@order"===e.tag))?void 0:i.content)||"0")}),d=[...s["@when"]?[{id:"何时使用",title:"何时使用"}]:[],l,...u.map(e=>{let t=(0,iZ.kebabCase)(e);return{id:`${t}-container`,title:a[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,e3.jsxs)("div",{className:"demo-wrapper",children:[(0,e3.jsx)("div",{className:"demo-title markdown",children:(0,e3.jsx)("h1",{children:s["@en"]})}),(0,e3.jsx)(Bn,{defaultExpandCode:o,defaultLiveDemo:t,onToggleLiveDemo:n,onToggleExpandCode:i,data:d}),(0,e3.jsx)("div",{className:"demo-head",children:(0,e3.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,e3.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,e3.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,e3.jsx)("p",{children:i2(s["@remarks"])}),(e=s["@when"])?(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(i1,{id:"何时使用",title:"何时使用"}),(0,e3.jsx)("ul",{children:(0,e3.jsx)("li",{children:i2(e)})})]}):null,(0,e3.jsx)(i1,{...l})]}),u.map((e,n)=>(0,e5.createElement)(Bt,{disabled:!t,globalExpandCode:o,...a[e],demoKey:e,key:n})),(0,e3.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,e3.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,e3.jsx)(i1,{id:"API",title:"API"}),[].map(e=>(0,e5.createElement)(i0,{...e,key:e.title})),s["@others"]?(0,e3.jsx)(ob,{remarkPlugins:[iA],rehypePlugins:[iq,[ij,{behavior:"append",content:()=>[iX("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:s["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();
|