1import{r as i,j as s}from"./index-CJQpyVoF.js";import{b as J,u as z,c as q,d as G}from"./useUrlParam-CZ4aw4md.js";import{i as Q,b as U,r as V,M}from"./ModelParamsTable-BE9To3Fs.js";import{d as W}from"./dayjs.min-MSV7X6E-.js";import{a as X}from"./arrow_back-CzKZiVjr.js";import{a as D}from"./utils-DBy4YQWF.js";import{i as ee}from"./index-DTg4VWz5.js";import{u as se}from"./useTranslation-CZJVCIH1.js";import{v as P}from"./v4-CtRu48qb.js";import{R as te}from"./CloseOutlined-D5mcFo44.js";import{T as re}from"./index-34CVpSRX.js";import{T as ne}from"./index-C-_ceSoJ.js";import{S as oe}from"./AppEntry-yGjZDq3c.js";import"./inviteCode-D9rgtvJs.js";import"./index-CW5BC8-r.js";import"./lodash-DQpAQgZ8.js";import"./input_error_msg-00mgFdkQ.js";import"./icon_form_select-BmwEbWUU.js";import"./input-remove-icon-CMiTsaIm.js";import"./index-CS8YAtyi.js";import"./context-DKhv_b6t.js";import"./Compact-BviLumD4.js";import"./compact-item-5orumCwJ.js";import"./ContextIsolator-hwtSycux.js";import"./SearchOutlined-D1PhykWn.js";import"./reactNode-CvZomqk2.js";import"./button-COlcySkY.js";import"./index-Cb4CfQq0.js";import"./index-BQyCNz27.js";import"./index-DnoH8i83.js";import"./motion-BwoXtl0z.js";import"./Overflow-Dh_HYkSz.js";import"./PurePanel-CKKM5xpM.js";import"./useLocale-Dmo9Agcu.js";import"./CheckOutlined-DczzTUs8.js";import"./DownOutlined-Bedvisqk.js";import"./index-U-K3gcoz.js";import"./UpOutlined-COHBlDPP.js";import"./Table-B8VxV0Ub.js";import"./styleChecker-Qlp7tQr6.js";import"./addEventListener-B4p1orND.js";import"./conductUtil-BjxLXQtP.js";import"./index-D8n5n2bd.js";import"./index-TUPY4PN5.js";import"./index-Bzc9CXj1.js";import"./RightOutlined-DlN6rwzX.js";import"./EllipsisOutlined-DtZ6Tilt.js";import"./collapse-BbEVqHco.js";import"./zoom-DpNIHBsI.js";import"./index-ad3S-Ulj.js";import"./index-BSH15dlR.js";import"./useBreakpoint-Bpehexoc.js";import"./useForceUpdate-DvJ9yelE.js";import"./responsiveObserver-DyJXlrPc.js";import"./Pagination-C67t5xY0.js";import"./LeftOutlined-C7JmM6ZX.js";import"./CaretDownOutlined-Dv3U9ShB.js";import"./knowledge-B6Xt4n06.js";import"./index-3BAZhl4m.js";import"./sparkutils-CzrLAKyB.js";import"./base64-Cs2W2fcZ.js";import"./index-CiW30IE2.js";import"./compressor.esm-C46f8uP2.js";import"./AntdIcon-BKgxT62r.js";import"./utils-BAxb0YWC.js";import"./PlusOutlined-ByZyTB3m.js";import"./tslib.es6-BO7bUXQ_.js";import"./userAuth-Bzc-YaEz.js";const ce="/assets/default-model-detail-Bek-ztrR.png",ie="_modelDetailTabs_1m4j3_1",ae={modelDetailTabs:ie},le="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%3e%3cg%3e%3cg%3e%3cpath%20d='M1.6666666269302368,10.000000626930238C1.6666666269302368,5.397627026930237,5.397627026930237,1.6666666269302368,10.000000626930238,1.6666666269302368C14.602373626930238,1.6666666269302368,18.333334626930238,5.397627026930237,18.333334626930238,10.000000626930238C18.333334626930238,14.602373626930238,14.602373626930238,18.333334626930238,10.000000626930238,18.333334626930238C5.397627026930237,18.333334626930238,1.6666666269302368,14.602373626930238,1.6666666269302368,10.000000626930238ZM10.833333626930237,7.500000126930237C10.833333626930237,7.500000126930237,10.833333626930237,5.833333626930237,10.833333626930237,5.833333626930237C10.833333626930237,5.833333626930237,9.166667126930236,5.833333626930237,9.166667126930236,5.833333626930237C9.166667126930236,5.833333626930237,9.166667126930236,7.500000126930237,9.166667126930236,7.500000126930237C9.166667126930236,7.500000126930237,10.833333626930237,7.500000126930237,10.833333626930237,7.500000126930237ZM9.166667126930236,8.333333626930237C9.166667126930236,8.333333626930237,9.166667126930236,14.166666626930237,9.166667126930236,14.166666626930237C9.166667126930236,14.166666626930237,10.833333626930237,14.166666626930237,10.833333626930237,14.166666626930237C10.833333626930237,14.166666626930237,10.833333626930237,8.333333626930237,10.833333626930237,8.333333626930237C10.833333626930237,8.333333626930237,9.166667126930236,8.333333626930237,9.166667126930236,8.333333626930237Z'%20fill-rule='evenodd'%20fill='%236356EA'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";function me(){const{t:a}=se(),{state:p}=J(),{id:v}=z(),A=q(),[S]=G(),u=S.get("llmSource"),I=S.get("modelIcon"),[e,b]=i.useState({}),[_,$]=i.useState(!1),l=p==null?void 0:p.model,N=(p==null?void 0:p.bottomTexts)||[],[xe,pe]=i.useState(null),[w,g]=i.useState([]),[de,fe]=i.useState({}),[F,j]=i.useState(""),[O,d]=i.useState(!1),[H,L]=i.useState("details");i.useEffect(()=>{u==="2"?Q(v).then(r=>{var o,c,x,f;b(r);const n=(f=(x=(c=(o=r==null?void 0:r.config)==null?void 0:o.serviceBlock)==null?void 0:c["@@serviceId@@"])==null?void 0:x[0])==null?void 0:f.fields;g(n==null?void 0:n.map(m=>{var h,E,T,k;
1return{...m,id:P(),min:(E=(h=m==null?void 0:m.constraintContent)==null?void 0:h[0])==null?void 0:E.name,max:(k=(T=m==null?void 0:m.constraintContent)==null?void 0:T[1])==null?void 0:k.name}}))}):U({modelId:v,llmSource:u}).then(r=>{var n,o;b({...r,content:D(r.content)?JSON.parse(r.content):{},updateTime:(n=W(r==null?void 0:r.updateTime))==null?void 0:n.format("YYYY-MM-DD HH:mm:ss")}),(r==null?void 0:r.llmSource)===0&&g((o=JSON.parse(r==null?void 0:r.config))==null?void 0:o.map(c=>{var x,f,m,h;return{...c,id:P(),min:(f=(x=c==null?void 0:c.constraintContent)==null?void 0:x[0])==null?void 0:f.name,max:(h=(m=c==null?void 0:c.constraintContent)==null?void 0:m[1])==null?void 0:h.name}}))})},[]),i.useEffect(()=>{if((e==null?void 0:e.llmSource)===1&&(e!=null&&e.intro)){if(e.intro==="default"){j(""),d(!1);return}d(!0),fetch(e.intro).then(t=>{if(!t.ok)throw new Error("Failed to fetch markdown");return t.text()}).then(t=>{j(t),d(!1)}).catch(t=>{console.error("Error fetching markdown:",t),j(""),d(!1)})}else j(""),d(!1)},[e==null?void 0:e.llmSource,e==null?void 0:e.intro]);function y(t=[]){const r=[];function n(o){o.forEach(c=>{var x;r.push(c.name),(x=c.children)!=null&&x.length&&n(c.children)})}return n(t),r}const Y=t=>{const r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${r}-${n}-${o}`},K=i.useMemo(()=>{const t=[];return["modelCategory"].forEach(r=>{let n=[];l&&l.categoryTree?n=l.categoryTree:n=e==null?void 0:e.categoryTree;const o=n==null?void 0:n.find(c=>c.key===r);o&&t.push(...y(o.children))}),t.filter((r,n,o)=>o.indexOf(r)===n)},[e]),R=i.useMemo(()=>{const t=[];return["modelScenario"].forEach(r=>{let n=[];l&&l.categoryTree?n=l.categoryTree:n=e==null?void 0:e.categoryTree;const o=n==null?void 0:n.find(c=>c.key===r);o&&t.push(...y(o.children))}),t.filter((r,n,o)=>o.indexOf(r)===n)},[e]),C=t=>/^[a-zA-Z0-9_-]+$/.test(t),Z=(t="")=>t.length<=8?t.replace(/./g,"*"):`${t.slice(0,4)}******${t.slice(-4)}`,B=t=>{if(!t)return null;try{const o=new DOMParser().parseFromString(t,"text/html").querySelector("a[href]");return o?{url:o.getAttribute("href")||"",text:o.textContent||o.getAttribute("href")||""}:null}catch(r){console.error("Error parsing HTML:",r);const n=t.match(/<a[^>]+href=["']([^"']+)["'][^>]*>([^<]+)<\/a>/i);return n?{url:n[1],text:n[2]||n[1]}:null}};return s.jsxs("div",{className:"w-full h-full overflow-hidden flex flex-col pb-6",children:[s.jsxs("div",{className:"flex items-center w-[85%] mx-auto pt-[30px] pb-[24px]",children:[s.jsxs("div",{className:"flex items-center cursor-pointer gap-1 mr-4 shrink-0",onClick:()=>A(-1),children:[s.jsx("img",{src:X,className:"w-[18px] h-[18px]",alt:""}),s.jsx("span",{className:"font-medium",children:a("model.back")})]}),e.shelfStatus===1&&!_&&s.jsxs("div",{className:"flex items-center h-[20px] justify-between gap-3 px-3 py-1.5 rounded-[10px] bg-[#FEEDEC] text-[#F74E43] text-sm flex-1",children:[s.jsxs("span",{className:"flex-1 text-center",children:["模åå°äº",Y(new Date(e.shelfOffTime)),"忢æå¡ï¼è¯·å°½å¿«åæ¢æ¨¡å"]}),s.jsx(te,{className:"cursor-pointer shrink-0",onClick:()=>$(!0)})]})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsxs("div",{className:"w-full mx-auto bg-[#FFFFFF] rounded-2xl p-6",style:{width:"85%",minHeight:"100%"},children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{className:"flex items-start gap-[26px]",children:[(e==null?void 0:e.llmSource)===0&&s.jsx("span",{className:"w-[72px] h-[72px] flex items-center justify-center rounded-lg",style:{background:e.color?e.color:`url(${e.address+e.icon}) no-repeat center / cover`},children:e.color&&s.jsx("img",{src:e.address+e.icon,className:"w-[48px] h-[48px]",alt:""})}),(e==null?void 0:e.llmSource)!==0&&s.jsx("div",{className:"w-[72px] h-[72px] flex justify-center items-center rounded-lg flex-shrink-0 border border-[#E2E8FF]",children:s.jsx("img",{src:e.icon||I,alt:"",className:"w-[72px] h-[72px]"})}),s.jsxs("div",{className:"flex flex-col justify-between h-[72px]",children:[s.jsxs("div",{className:"flex items-center space-x-2 mt-3",children:[s.jsx("span",{className:"font-semibold text-gray-900 truncate",children:e==null?void 0:e.name}),(e==null?void 0:e.shelfStatus)!==void 0&&s.jsx("span",{className:"shrink-0 px-2 py-0.5 text-xs text-white rounded-full whitespace-nowrap",style:{backgroundColor:e.shelfStatus===1?"#F74E43":e.shelfStatus===2?"#7F7F7F":"transparent"},children:e.shelfStatus===1?a("model.upcomingOffShelf"):e.shelfStatus===2?a("model.offShelf"):""})]}),(e==null?void 0:e.llmSource)===1&&s.jsxs(re,{title:a("common.remaining")+`ï¼${l==null?void 0:l.remainingTokens} tokens`,placement:"right",children:[" ",s.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[s.jsx("img",{src:V,alt:"",className:"w-5 h-5"}),s.jsxs("span",{className:"text-sm text-[#6356EA]",children:[" ",l==null?void 0:l.remainingTokens," tokens"]})]})]}),s.jsxs("p",{className:"text-sm text-gray-500 flex flex-wrap gap-x-2 gap-2 ",children:[K.filter(t=>t!=="å
¶ä»").map(t=>s.jsx("span",{className:"px-1.5 py-0.5 text-xs rounded-sm bg-[#E4EAFF] opacity-60 text-[#000000]",children:t},t)),R.filter(t=>t!=="å
¶ä»").map(t=>s.jsx("span",{className:"px-1.5 py-0.5 text-xs rounded-sm bg-[#E8E8EA] opacity-60",style:{color:"#000000"},children:t},t))]})]})]}),e.updateTime&&s.jsx("div",{className:"flex items-center gap-2.5 text-desc",children:s.jsxs("div",{children:[a("model.updatedAt")," ",e==null?void 0:e.updateTime]})})]}),s.jsx("div",{className:"text-desc mt-3 text-sm",children:e==null?void 0:e.desc}),u!="2"&&s.jsx("div",{className:"text-desc mt-3 text-sm",children:N==null?void 0:N.join("     ")}),(e==null?void 0:e.llmSource)===0&&s.jsx("div",{className:"mt-4 p-4 rounded-[10px] border border-[#F2F5FE] box-border mt-10",children:s.jsx("div",{className:"flex flex-col gap-2",children:s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-['PingFang_SC'] text-sm font-normal text-[#7F7F7F]",children:"Modelï¼"}),s.jsx("span",{className:"font-['PingFang_SC'] text-sm font-normal text-[#333333]",children:e==null?void 0:e.domain})]}),s.jsxs("p",{children:[s.jsxs("span",{className:"font-['PingFang_SC'] text-sm font-normal text-[#7F7F7F]",children:[a("model.interfaceAddress"),"ï¼"]}),s.jsx("span",{className:"font-['PingFang_SC'] text-sm font-normal text-[#333333]",children:e==null?void 0:e.url})]}),s.jsxs("p",{children:[s.jsxs("span",{className:"font-['PingFang_SC'] text-sm font-normal text-[#7F7F7F]",children:[a("model.apiKey"),"ï¼"]}),s.jsx("span",{className:"font-['PingFang_SC'] text-sm font-normal text-[#333333]",children:Z(e==null?void 0:e.apiKey)})]})]})})})}),(e==null?void 0:e.llmSource)===0&&s.jsxs("div",{className:"flex flex-col gap-2 mt-5",children:[s.jsx("div",{className:"w-full flex items-center justify-between",children:s.jsxs("div",{className:"font-bold",children:[a("model.modelParameters"),"ï¼"]})}),s.jsx("div",{children:s.jsx(M,{modelParams:w,setModelParams:g,checkNameConventions:C,detail:!0})})]}),u==="2"&&s.jsxs("div",{className:"flex flex-col gap-2 mt-5",children:[s.jsx("div",{className:"w-full flex items-center justify-between",children:s.jsxs("div",{className:"font-bold",children:[a("model.modelParameters"),"ï¼"]})}),s.jsx("div",{children:s.jsx(M,{modelParams:w,setModelParams:g,checkNameConventions:C,detail:!0})})]}),(e==null?void 0:e.llmSource)===1&&(e==null?void 0:e.disclaimer)&&s.jsx("div",{className:"mt-6 p-4 rounded-[10px] bg-[#E9EDFF] border border-[#6356EA] box-border",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("img",{src:le,className:"w-[16px] h-[16px] mt-1",alt:""}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"font-medium text-[#222529] mb-1",children:a("model.disclaimer")}),s.jsx("div",{className:"text-sm text-[#222529] leading-5",children:(()=>{const t=B(e.disclaimer);return t?s.jsxs(s.Fragment,{children:[a("model.disclaimerText")," ",s.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-[#6356EA] hover:underline",children:t.text})]}):null})()})]})]})}),(e==null?void 0:e.llmSource)===1&&s.jsx("div",{className:"mt-1",children:s.jsx(ne,{activeKey:H,onChange:L,className:ae.modelDetailTabs,items:[{key:"details",label:a("model.modelIntroduction"),children:s.jsx("div",{children:(e==null?void 0:e.intro)==="default"?s.jsx("div",{className:"flex justify-center items-center",style:{marginTop:"-20px"},children:s.jsx("img",{src:ce,alt:"é»è®¤æ¨¡å详æ
",className:"max-w-full h-auto"})}):O?s.jsx("div",{className:"flex justify-center items-center py-8",children:s.jsx(oe,{})}):F?s.jsx(ee,{content:F,isSending:!1}):null})}]})})]})})]})}const ks=i.memo(me);export{ks as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.