PageSourceSearch

https://www.hintchat.ai/_next/static/chunks/9995-33ffc583a2f02366.js

js hintchat.ai collected 2026-10-05 14:35:42 UTC 32,381 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9995],{11665:(e,t,o)=>{"use strict";o.d(t,{A:()=>r});var n=o(36697),l=o(95155);let r=(0,n.A)((0,l.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert")},22642:(e,t,o)=>{"use strict";o.d(t,{A:()=>u,AuthProvider:()=>d});var n=o(95155),l=o(12115),r=o(37647),a=o(20063),i=o(70542),s=o(32866);let c=(0,l.createContext)(void 0);function d(e){let{children:t}=e,o=(0,i.jL)(),[d,u]=(0,l.useState)({user:null,isAuthenticated:!1,isLoading:!0,loginModalOpen:!1}),x=(0,a.useRouter)();(0,l.useEffect)(()=>{(async()=>{let e=r.u.getUser(),t=r.u.isAuthenticated();console.log(t,r.u.isGoogleLogin()),!t&&r.u.isGoogleLogin()&&(e=await r.u.getGoogleUserInfo())&&(t=!0),console.log(e,t),u({user:e,isAuthenticated:t,isLoading:!1,loginModalOpen:!1})})()},[]),(0,l.useEffect)(()=>{o((0,s.Zc)(r.u.getUserSelectGender()))},[o]);let h=async(e,t)=>{u(e=>({...e,isLoading:!0}));try{let o=await r.u.login({userNo:e,password:t});u({user:o,isAuthenticated:!0,isLoading:!1,loginModalOpen:!1})}catch(e){throw u(e=>({...e,isLoading:!1})),e}},p=async e=>(u(t=>({...t,isLoading:e})),Promise.resolve()),g=async e=>{u(e=>({...e,isLoading:!0}));try{let t=await r.u.googleLogin(e);u({user:t,isAuthenticated:!0,isLoading:!1,loginModalOpen:!1})}catch(e){throw u(e=>({...e,isLoading:!1})),e}},f=async e=>{u(e=>({...e,isLoading:!0}));try{let t=await r.u.sendEmail(e);console.log(t),u({...d,isLoading:!1})}catch(e){throw console.error("Error sending reset email:",e),u(e=>({...e,isLoading:!1})),e}},m=async()=>await r.u.getUserSelectAge(),A=async e=>{await r.u.saveUserSelectAge(e)},b=async()=>await r.u.getUserSelectGender(),v=async e=>{r.u.saveUserSelectGender(e),o((0,s.Zc)(e))};return(0,n.jsx)(c.Provider,{value:{...d,login:h,logout:()=>{r.u.logout(),o((0,s.g$)()),u({user:null,isAuthenticated:!1,isLoading:!1,loginModalOpen:!1}),x.push("/")},handleGoogleLogin:g,googleLoading:p,sendEmail:f,getUserSelectAge:m,setUserSelectAge:A,getSelectGender:b,setSelectGender:v},children:t})}function u(){let e=(0,l.useContext)(c);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}},49692:(e,t,o)=>{"use strict";o.d(t,{A:()=>r});var n=o(36697),l=o(95155);let r=(0,n.A)((0,l.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight")},62196:(e,t,o)=>{"use strict";o.d(t,{u:()=>l});var n=o(12115);function l(e){let t=(0,n.useRef)(!1);(0,n.useEffect)(()=>{t.current||(t.current=!0,e())},[e])}},69995:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>eu});var n=o(95155);o(86174);var l=o(12115),r=o(52853),a=o(41983),i=o(4474),s=o(36697);let c=(0,s.A)((0,n.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var d=o(1213),u=o(20063),x=o(62196),h=o(70542),p=o(82153),g=o(75183),f=o(10286),m=o(33539),A=o(18638),b=o(47790),v=o(33567),y=o(25635),j=o(22642),I=o(86120),k=o(70690),C=o(13742),S=o(60234),w=o(8469);let E=e=>{let{character:t,onSettingsClick:o}=e,{t:l}=(0,S.Y)(),{base:a}=(0,v.A)().palette;return(0,n.jsxs)(r.A,{sx:{mt:1,py:3,display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[(0,n.jsx)(r.A,{sx:{width:110,height:110,borderRadius:"999px",background:a.buttonGradient,p:"2px",flexShrink:0},children:(0,n.jsx)(I.A,{src:(null==t?void 0:t.characterThumb)||"",sx:{width:"100%",height:"100%"}})}),(0,n.jsx)(y.A,{variant:"h3",sx:{fontFamily:"Aileron, Aileron",fontWeight:"bold",fontSize:24,color:a.white,fontStyle:"normal",textTransform:"none",textAlign:"center"},children:(null==t?void 0:t.characterName)||""}),(0,n.jsxs)(y.A,{variant:"h6",sx:{fontFamily:"Aileron, Aileron",fontWeight:300,fontSize:14,color:a.textTag,lineHeight:"20px",fontStyle:"normal",textTransform:"none",textAlign:"center",mt:-1},children:["@",(null==t?void 0:t.userName)||""]}),(0,n.jsxs)(r.A,{sx:{width:"100%",background:a.purpleQuinary,borderRadius:"15px",p:"8px"},children:[(0,n.jsxs)(k.A,{fullWidth:!0,variant:"contained",startIcon:(0,n.jsx)(w.A,{name:"donghua",size:28,color:"#C1ACEE"}),endIcon:(0,n.jsx)(C.A,{sx:{color:"#C1ACEE"}}),onClick:o,sx:{display:"none",backgroundColor:a.purpleLight,border:"1px solid ".concat(a.borderPurple),color:a.textTag,
1justifyContent:"space-between",padding:"8px 20px",borderRadius:"20px",textTransform:"none",textAlign:"left","&:hover":{backgroundColor:a.purpleLightHover}},children:[(0,n.jsx)(y.A,{variant:"body2",sx:{color:"#C1ACEE",fontWeight:400,fontSize:"16px"},children:l("character.recommendedSettings")}),(0,n.jsx)(y.A,{variant:"body2",sx:{flex:1}})]}),(0,n.jsxs)(r.A,{sx:{width:"100%",margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"center",my:.5},children:[(0,n.jsx)(r.A,{sx:{flex:1,height:"1px",background:a.rolelGradient,transform:"rotate(180deg)"}}),(0,n.jsx)(y.A,{variant:"body2",sx:{fontSize:16,color:"#C1ACEE",padding:"8px 6px"},children:l("character.intro")}),(0,n.jsx)(r.A,{sx:{flex:1,height:"1px",background:a.rolelGradient}})]}),(0,n.jsx)(y.A,{variant:"body1",sx:{fontFamily:"Aileron, Aileron",fontWeight:300,fontSize:14,color:a.textTag,lineHeight:"20px",fontStyle:"normal",textTransform:"none",pb:1,px:"17px"},children:t.introduction})]}),(0,n.jsx)(y.A,{variant:"body2",sx:{fontFamily:"Aileron, Aileron",fontWeight:400,fontSize:12,color:a.textGray4,fontStyle:"normal",textTransform:"none",textAlign:"center"},children:l("character.disclaimer")})]})};var M=o(22822),z=o(28548),L=o(14522),T=o(11665);let F=(0,s.A)((0,n.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var R=o(49692),D=o(62391),W=o(57639),_=o(97866),G=o(70954),O=o(46304);let P=e=>{var t,o;let{isAI:a,message:i,contentExtra:s}=e,[c,u]=(0,l.useTransition)(),x=(0,d.wA)(),{streamingMsg:h,currentAiChatId:p}=(0,d.d4)(e=>e.chat),[g,f]=(0,l.useState)(""),m=(0,l.useRef)(null),A=(0,l.useRef)(0),y=p===i.chatId,j=null!=(t=null==i?void 0:i.relationId)?t:"_"+(null==i?void 0:i.storylineId),I=null!=(o=null==i?void 0:i.chatId)?o:"",{base:k}=(0,v.A)().palette;return(0,l.useEffect)(()=>{if(!I||!y){A.current=0;return}if(0!==h.length&&!m.current)return m.current=setInterval(()=>{let e=A.current;if(e>=h.length){clearInterval(m.current),m.current=null,x((0,b.l8)({convId:j,chatId:I,isStreaming:!1}));return}let t=h.slice(0,e+1).join("");u(()=>{f(t)}),A.current+=1},50),()=>{clearInterval(m.current),m.current=null}},[I,y,h]),(0,n.jsx)(r.A,{sx:{minWidth:a?"200px":"100px",minHeight:"auto",px:2,py:1.5,borderRadius:"32px",backgroundColor:a?k.purpleQuaternary:k.purpleSeptenary,color:"#fff",borderTopRightRadius:a?"32px":"0",borderTopLeftRadius:a?"0":"32px",position:"relative",wordBreak:"break-word","& p":{margin:"8px 0"},"& code":{backgroundColor:"#2a1047",padding:"2px 6px",borderRadius:4},"& pre":{margin:"8px 0"}},children:(0,n.jsx)(W.oz,{remarkPlugins:[_.A],components:{p:e=>{let{children:t,...o}=e;return(0,n.jsx)("p",{style:{color:k.white,fontSize:"16px",fontWeight:400,lineHeight:1.6,margin:"6px 0"},...o,children:t})},em:e=>{let{children:t,...o}=e,l=(null==t?void 0:t.toString())||"";return l.trim().startsWith("*")||l.trim().endsWith("*")?(0,n.jsx)("span",{style:{display:"block",fontFamily:"Aileron, Aileron",fontWeight:"normal",fontSize:"16px",fontStyle:"italic",color:"#949494",lineHeight:"24px",transform:"none"},...o,children:t}):(0,n.jsx)("span",{style:{display:"block",fontFamily:"Aileron, Aileron",fontWeight:400,fontSize:"16px",fontStyle:"italic",color:"#949494",lineHeight:"24px",transform:"none"},...o,children:t})},code(e){let{node:t,inline:o,className:l,children:r,...a}=e,i=/language-(\w+)/.exec(l||"");return!o&&i?(0,n.jsx)(G.A,{style:O.A,language:i[1],PreTag:"div",...a,children:String(r).replace(/\n$/,"")}):(0,n.jsx)("code",{className:l,...a,children:r})},img:e=>{let{node:t,...o}=e;return(0,n.jsx)("img",{...o,style:{maxWidth:"100%",maxHeight:"400px",objectFit:"contain",borderRadius:"8px",display:"block"},alt:o.alt||"image"})}},children:y?"".concat(g,"|"):(null==s?void 0:s.content)||i.content})})};function H(e){let{contentExtra:t,onScore:o}=e,[a,i]=(0,l.useState)(0),[s,c]=(0,l.useState)(0),{base:d}=(0,v.A)().palette;return(0,l.useEffect)(()=>{i((null==t?void 0:t.score)||0)},[t]),(0,n.jsx)(r.A,{sx:{display:"flex",gap:1,height:"28px"},onMouseLeave:()=>c(0),children:[1,2,3,4,5].map(e=>(0,n.jsx)(D.P.div,{className:"notranslate",style:{cursor:"pointer"},onClick:()=>{i(e),o(e)},onMouseEnter:()=>c(e),animate:{scale:s>=e||a>=e?1:1.05},transition:{type:"spring",stiffness:400,damping:10},children:s>=e||a>=e?(0,n.jsx)(r.A,{children:(0,n.jsx)(w.A,{name:"iconfontshoucang1",size:19,color:d.buttonYellow})}):(0,n.jsx)(r.A,{children:(0,n.jsx)(w.A,{name:"a-shoucangweishoucang2",size:19,color:d.buttonYellow})})},e))})}var B=o(15752),N=o(51827),U=o(95983),Y=o(84444),X=o(61574);let q=e=>{let{message:t,user:o,character:i,onAction:s,isLast:c,isSend:u}=e,{t:x}=(0,S.Y)(),f=(0,p.useToast)(),A=h.M_.dispatch,j=(0,v.A)(),{base:C}=j.palette,[E,W]=(0,l.useReducer)(Y.i,Y.u),{streamingMsg:_,currentAiChatId:G}=(0,d.d4)(e=>e.chat),[O,q]=(0,l.useState)(null),{isMemoryEnabled:V}=(0,d.d4)(e=>e.chat),[Q,$]=(0,l.useState)(!1),[K,Z]=(0,l.useState)(!1),[J,ee]=(0,l.useState)([]),[et,eo]=(0,l.useState)(0),[en,el]=(0,l.useState)(0),er="user"!==t.sendType,[ea,ei]=(0,l.useState)(""),es=()=>
1{if(ea){if(J[et]){let e=[...J];e[et].content=ea,g.G.update(m.A.EDIT_CHAT_RECORD,{chatId:(null==t?void 0:t.chatId)||"",textId:e[et].textId||(null==t?void 0:t.textId)||"",content:ea}).then(o=>{console.log(o),A((0,b.Ux)({chatId:t.chatId,textId:e[et].textId||(null==t?void 0:t.textId)||"",content:ea}))},e=>{console.log(e)})}$(!1)}};(0,l.useEffect)(()=>{var e;let o=(0,B.hC)(null!=(e=null==t?void 0:t.contentExtra)?e:""),n=0;0===o.length?ee([(0,B.W8)(t)]):(ee(o),n=o.length-1),el(o.length),eo(n)},[t]);let ec=()=>{q(null),Z(!1)},ed=e=>{if("copy"===e)return void eh();if("edit"===e){var o;ei((null==(o=J[et])?void 0:o.content)||(null==t?void 0:t.content)||""),$(!0);return}return"showMore"===e?void Z(!0):"hideMore"===e?void Z(!1):void(null==s||s(t.chatId,e,t),ec())},eu=[{icon:(0,n.jsx)(w.A,{name:"copy",size:12,color:"#fff"}),label:x("common.copy"),onClick:()=>ed("copy")},{icon:(0,n.jsx)(w.A,{name:"bianji3",size:14,color:"#fff"}),label:x("common.edit"),onClick:()=>ed("edit")},...er?[]:[{icon:(0,n.jsx)(w.A,{name:"shanchu",size:14,color:"#fff"}),label:x("common.delete"),onClick:()=>ed("delete")}]],ex=()=>{null==s||s(t.chatId||"","send",t)},eh=()=>{(null==t?void 0:t.content)&&(navigator.clipboard.writeText((null==t?void 0:t.content)||""),f.success(x("chat.copyToClipboard")))},ep=(e,o)=>0===o.negativeFeedback.length&&0===o.positiveFeedback.length?void f.error("Please select at least one feedback type"):J[et]?void g.G.update(m.A.TEXT_FEED_MORE_CONTENT,{chatId:(null==t?void 0:t.chatId)||"",textId:J[et].textId||(null==t?void 0:t.textId)||"",custom:[o.additionalDetails],forward:o.positiveFeedback,negative:o.negativeFeedback}).then(e=>{console.log(e),f.success("Feedback submitted successfully")},e=>{console.log(e)}):void f.error("Select a message first");return(0,n.jsxs)(D.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},style:{display:"flex",flexDirection:er?"row":"row-reverse",alignItems:"flex-start",marginBottom:"24px",gap:"12px"},children:[V&&"first_welcome"!==t.type&&(0,n.jsx)(r.A,{sx:{display:"flex",alignItems:"center",flexShrink:0,minHeight:56},children:(0,n.jsx)(M.A,{checked:t.isSelected||!1,onChange:()=>null==s?void 0:s(t.chatId,"toggleSelect",t),sx:{p:.5,"& .MuiSvgIcon-root":{fontSize:20,color:t.isSelected?"#FFC000":"rgba(255,255,255,0.3)"},"&.Mui-checked":{color:"#FFC000"}},icon:(0,n.jsx)(r.A,{sx:{width:20,height:20,borderRadius:"50%",border:"2px solid rgba(255,255,255,0.3)",bgcolor:"transparent"}}),checkedIcon:(0,n.jsx)(r.A,{sx:{width:20,height:20,borderRadius:"50%",bgcolor:"#FFC107",display:"flex",alignItems:"center",justifyContent:"center",color:"#000",fontSize:20},children:(0,n.jsx)(w.A,{name:"ok-full",color:C.black,size:"16"})})})}),(0,n.jsx)(r.A,{sx:{width:56,height:56,borderRadius:"999px",background:C.buttonGradient,p:"2px",flexShrink:0},children:(0,n.jsx)(I.A,{src:er?(null==i?void 0:i.characterThumb)||"":(null==o?void 0:o.userAvatar)||"",sx:{width:"100%",height:"100%"}})}),(0,n.jsxs)(r.A,{sx:{width:"70%",maxWidth:"585px",display:"flex",flexDirection:"column",alignItems:er?"flex-start":"flex-end"},children:[er&&(0,n.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,n.jsx)(y.A,{variant:"subtitle1",sx:{color:C.textTag,fontSize:"16px",fontWeight:400},children:(null==i?void 0:i.characterName)||""}),t.modelId&&(0,n.jsx)(a.A,{size:"small",onClick:()=>ed("showSelectModel"),sx:{color:C.white},children:(0,n.jsx)(z.A,{label:t.modelName,icon:(0,n.jsx)(w.A,{name:"icon-taikong8",color:C.textTag}),size:"small",sx:{backgroundColor:C.purpleLight,color:C.textTag,fontSize:"12px"}})}),!1]}),(0,n.jsxs)(r.A,{onMouseEnter:()=>ed("showMore"),onMouseLeave:()=>ed("hideMore"),sx:{position:"relative",display:"inline-block",flexDirection:er?"row":"row-reverse"},children:[Q?(0,n.jsxs)(r.A,{sx:{minWidth:er?"500px":"auto",minHeight:"auto",p:2,borderRadius:"32px",backgroundColor:er?C.purpleQuaternary:C.purpleSeptenary,color:C.white,borderTopRightRadius:er?"32px":"0",borderTopLeftRadius:er?"0":"32px",position:"relative",wordBreak:"break-word","& p":{margin:"4px 0"},"& code":{backgroundColor:"#2a1047",padding:"2px 6px",borderRadius:4},"& pre":{margin:"8px 0"}},children:[(0,n.jsx)(r.A,{children:(0,n.jsx)(L.A,{multiline:!0,minRows:4,maxRows:8,value:ea,onChange:e=>{ei(e.target.value)},onKeyDown:e=>{let{key:t,shiftKey:o,altKey:n}=e;"Escape"===t?$(!1):o&&"Enter"===t||"Enter"===t&&es()},fullWidth:!0,variant:"standard",InputProps:{disableUnderline:!0,sx:{backgroundColor:"transparent !important",border:"none !important",outline:"none !important","&:focus, &:hover, &:active, &.Mui-focused":{outline:"none !important",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent !important"},color:"#fff",fontSize:"16px",fontWeight:300,p:0}},sx:{backgroundColor:"transparent",border:"none","& .MuiInputBase-root":{backgroundColor:"transparent !important",border:"none !important",outline:"none !important"}}})}),(0,n.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",gap:1,minHeight:30,flexWrap:"wrap"},children:[(0,n.jsxs)(y.A,{component:"div",variant:"body2",sx:{flex:1,minWidth:0,m:0,fontSize:12,lineHeight:1.45,fontWeight:400,color:C.textGray4,display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:.25,rowGap:.25},children:[(0,n.jsx)("span",{children:"escape to "}),(0,n.jsx)(r.A,{component:"span",sx:{color:C.textTag,fontWeight:500},children:"cancel"}),(0,n.jsx)("span",{children:"|enter to "}),(0,n.jsx)(r.A,{component:"span",sx:{color:C.textTag,fontWeight:500},children:"save"}),(0,n.jsx)("span",{children:"|option/shift+Enter for "}),(0,n.jsx)(r.A,{component:"span",sx:{color:C.textTag,fontWeight:500},children:"linebreak"})]}),(0,n.jsxs)(r.A,{sx:{display:"flex",width:"140px",alignItems:"center",gap:1},children:[(0,n.jsx)(k.A,{variant:"contained",disableElevation:!0,onClick:()=>{$(!1)},sx:(0,U.BP)(j,{bgcolor:C.purpleLight,color:C.textTag,height:28,fontSize:14,fontWeight:500,px:1,lineHeight:1.2,borderRadius:"8px"}),children:"Cancel"}),(0,n.jsx)(k.A,{variant:"contained",disableElevation:!0,onClick:es,sx:{...(0,U.DG)(j),py:.5,px:1,fontSize:14,fontWeight:500,lineHeight:1.2,borderRadius:"8px"},children:"Save"})]})]})]}):(0,n.jsx)(P,{isAI:er,message:t,contentExtra:J[et]}),(0,n.jsx)(r.A,{sx:{position:"absolute",right:er?-80:"auto",left:er?"auto":"-55px",top:"-6px",transition:"opacity 0.2s",flexDirection:"column",justifyContent:"flex-start",width:80,padding:1},children:(K||!!O)&&!Q&&(0,n.jsxs)(r.A,{children:[(0,n.jsx)(r.A,{sx:{flex:3},children:(0,n.jsx)(a.A,{size:"small",onClick:e=>{e.stopPropagation(),q(e.currentTarget)},sx:{top:8,color:C.purpleLighter,backgroundColor:C.blackfilter,borderRadius:"50%",marginRight:5*!er,transform:"rotate(90deg)","&:hover":{backgroundColor:"#303135"}},children:(0,n.jsx)(T.A,{sx:{fontSize:"29px"}})})}),er&&!1]})})]}),!t.isError&&c&&er&&!u&&"first_welcome"!==t.type&&(0,n.jsxs)(r.A,{sx:{display:Q?"none":"flex",alignItems:"center",justifyContent:"center",gap:1,py:1},children:[en<=1&&(0,n.jsx)(r.A,{sx:{display:"flex",alignItems:"center",gap:0},children:(0,n.jsx)(a.A,{size:"small",onClick:ex,disabled:!1,sx:{color:"#C1ACEE"},children:(0,n.jsx)(w.A,{name:"genghuan",color:C.textTag,size:"16"})})}),en>1&&(0,n.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",gap:0},children:[(0,n.jsx)(a.A,{size:"small",onClick:()=>{et>0&&eo(et-1)},disabled:0===et,sx:{color:C.buttonYellow},children:(0,n.jsx)(F,{})}),(0,n.jsxs)(y.A,{variant:"body2",sx:{color:C.buttonYellow},children:[et+1," / ",en]}),(0,n.jsx)(a.A,{size:"small",onClick:()=>{(G||!u)&&(et<en-1?eo(et+1):et===en-1&&ex())},disabled:u,sx:{color:C.buttonYellow},children:(0,n.jsx)(R.A,{})})]}),(0,n.jsx)(H,{contentExtra:J[et],onScore:e=>{if(J[et]){let o=[...J];o[et].score=e,g.G.update(m.A.TEXT_FEED_SCORE,{chatId:(null==t?void 0:t.chatId)||"",textId:o[et].textId||(null==t?void 0:t.textId)||"",score:e}).then(e=>{console.log(e),A((0,b.tx)({chatId:t.chatId,contentExtras:[...o]}))},e=>{console.log(e)})}}}),(0,n.jsx)(k.A,{variant:"contained",size:"small",onClick:()=>void((e,t)=>{console.log(t),W({type:"OPEN_MODAL",payload:{modal:e,props:{onCallback:ep,...t}}})})("feedback",{onCallback:ep}),sx:(0,U.AG)(j),children:x("chat.feedback")})]})]}
1),(0,n.jsx)(N.d,{anchorEl:O,open:!!O,onClose:ec,items:eu,minWidth:160}),(0,n.jsx)(X.A,{state:E,dispatch:W})]})};var V=o(36021),Q=o(92431);let $=e=>{var t,o;let{onAction:a}=e,{user:s}=(0,j.A)(),c=h.M_.dispatch,u=(0,p.useToast)(),{base:x}=(0,v.A)().palette,{t:g}=(0,S.Y)(),{conversations:f,currentConvId:m,streamingMsg:A,isInitialConv:I,isMemoryEnabled:k,selectAllStatus:C,errorMessage:M}=(0,d.d4)(e=>e.chat),z=f[m],L=null!=(t=null==z?void 0:z.characterInfo)?t:{},T=null!=(o=null==z?void 0:z.messages)?o:[],[F,R]=(0,l.useState)([]),[D,W]=(0,l.useState)(!1),_=(0,l.useRef)(null),[G,O]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!k){R([]),c((0,b.PG)(!1));return}let e=[...T];e.map(e=>({...e,isSelected:!1})),R(e),c((0,b.aj)(0)),c((0,b.$$)(T.filter(e=>"first_welcome"!==e.type).length)),setTimeout(()=>W(!0),500)},[k]),(0,l.useEffect)(()=>{k&&(R(e=>e.map(e=>({...e,isSelected:C}))),C?null==a||a("selectMessages",{},[...F]):null==a||a("selectMessages",{},[]))},[C]),(0,l.useEffect)(()=>{var e;k||null==(e=_.current)||e.scrollIntoView({behavior:"smooth"})},[T,A]),(0,l.useEffect)(()=>{var e;k&&D&&(W(!1),null==(e=_.current)||e.scrollIntoView({behavior:"smooth"}))},[D]);let P=(e,t,o)=>{switch(t){case"copy":var n;(0,Q.lW)((null==(n=T.find(t=>t.chatId===e))?void 0:n.content)||"");break;case"toggleSelect":(e=>{e&&R(t=>{let o=t.map(t=>t.userChatId===e?{...t,isSelected:!t.isSelected}:t);return queueMicrotask(()=>{let e=o.filter(e=>e.isSelected&&"first_welcome"!==e.type);c((0,b.aj)(e.length)),null==a||a("selectMessages",{},[...e])}),o})})((null==o?void 0:o.userChatId)||"");break;case"send":B(o);break;case"showSelectModel":null==a||a(t,o);break;case"delete":H((null==o?void 0:o.userChatId)||"")}},H=async e=>{if(e)try{await c((0,b.zq)(e)).unwrap(),u.success("Message deleted successfully")}catch(e){u.error(e.message||"Message delete failed"),console.log(e)}},B=e=>{if(!e||G)return;let t=T.find(t=>t.chatId===e.userChatId);t&&(O(!0),(async()=>{try{e.isError&&e.chatId.startsWith("1-")?await c((0,b.Xk)({characterId:L.characterId||"",chatId:t.chatId,textId:e.textId||"",relationId:e.relationId,storylineId:e.storylineId,content:t.content})):await c((0,b.Oy)({characterId:L.characterId||"",chatId:e.chatId,textId:e.textId||"",relationId:e.relationId,storylineId:e.storylineId,content:t.content}))}finally{setTimeout(()=>{O(!1)},3e3)}})())};return(0,l.useEffect)(()=>{M&&(u.error(M),c((0,b.g)("")))},[M]),(0,n.jsxs)(r.A,{sx:{flexGrow:1,overflowY:"auto",p:2},children:[I&&(0,n.jsx)(r.A,{sx:{height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(i.A,{size:32})}),!I&&(!m||0===T.length)&&(0,n.jsxs)(r.A,{sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[(0,n.jsx)(w.A,{name:"404",color:x.greenWarning,size:134}),(0,n.jsx)(y.A,{variant:"body1",sx:{color:"#fff",fontSize:24,fontStyle:"italic"},children:"It's empty here!"})]}),(0,n.jsxs)(r.A,{sx:{maxWidth:"860px",margin:"0 auto"},children:[!I&&m&&T.length>0&&(0,n.jsx)(E,{character:L,onSettingsClick:()=>{}}),!I&&(()=>{let e=k?F:T;return e.map((t,o)=>{let l;return(0,n.jsxs)(r.A,{children:[(l=t.gmtCreate,(0,n.jsx)(r.A,{sx:{display:"flex",justifyContent:"center",my:2},children:(0,n.jsx)(y.A,{variant:"body2",sx:{fontFamily:"Aileron, Aileron",fontWeight:400,fontSize:14,color:"#949494",fontStyle:"normal",textTransform:"none"},children:(0,V.XX)(l,g)})})),(0,n.jsx)(q,{message:t,user:null!=s?s:void 0,character:L,isLast:o===e.length-1,isSend:G,onAction:P})]},"".concat(t.userChatId,"-").concat(t.chatId,"-").concat(o))})})()]}),(0,n.jsx)(r.A,{ref:_})]})};var K=o(78470),Z=o(51389),J=o(86384),ee=o(54354);let et={root:e=>({maxWidth:"100%",margin:"0 auto",width:"100%",backgroundColor:"transparent",p:2,borderRadius:"12px"}),quickBar:{display:"flex",overflowX:"auto",gap:2,mb:"15px",pl:1,"&::-webkit-scrollbar":{height:"4px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#6A1B9A",borderRadius:"2px"}},quickButton:e=>({height:27,backgroundColor:"#490173",fontFamily:"Aileron, Aileron",fontWeight:600,fontSize:16,lineHeight:27,color:"#BAA8DF",fontStyle:"normal",textTransform:"none",px:"12px",borderRadius:"9px",whiteSpace:"nowrap","&:hover":{backgroundColor:"#7B1FA2"}}),inputContainer:{height:45,padding:"6px 2px 6px 6px",display:"flex",alignItems:"center",backgroundColor:"#000",borderRadius:999,border:"1px solid transparent",background:"linear-gradient(#000, #000) padding-box, linear-gradient(160deg, #28044C, #923AED, #810FA2, #D78137) border-box",overflow:"hidden"},textFieldInputProps:{disableUnderline:!0,sx:{color:"#fff",fontSize:"20px",p:1.5,"& .MuiInputBase-input::placeholder":{fontSize:16,color:"rgba(136, 136, 138, 1)"}}},iconButton:{color:"#FFD700",mr:1,position:"relative"},memoryHeader:{p:3,display:"flex",alignItems:"center",gap:1,position:"relative"},checkbox:{"& .MuiSvgIcon-root":{fontSize:20}},uncheckedIcon:{width:20,height:20,borderRadius:"50%",border:"2px s
1olid rgba(255,255,255,0.3)",bgcolor:"transparent"},checkedIcon:{width:20,height:20,borderRadius:"50%",bgcolor:"#FFC107",display:"flex",alignItems:"center",justifyContent:"center",color:"#000",fontSize:20},selectText:{fontWeight:400,fontSize:16,color:"#FFFFFF"},closeButton:{position:"absolute",top:16,right:16,color:"#fff"},memoryFooter:{p:3,display:"flex",gap:3,justifyContent:"center"}},eo=e=>{let{onQuickAction:t,onExtend:o}=e,i=(0,v.A)(),{base:s}=i.palette,{t:c}=(0,S.Y)(),u=(0,p.useToast)(),{errorMessage:x}=(0,d.d4)(e=>e.chat),[g,f]=(0,l.useState)(""),[m,A]=(0,l.useState)(!1),j=h.M_.dispatch,[I,C]=(0,l.useReducer)(Y.i,Y.u),[E,z]=(0,l.useState)(null),[T,F]=(0,l.useState)(null),{conversations:R,currentConvId:D,textId:W,chatId:_,isMemoryEnabled:G,selectCount:O,selectAllCount:P,selectAllStatus:H}=(0,d.d4)(e=>e.chat),B=R[D],q=e=>{z(e.currentTarget)},V=()=>{z(null)},Q=e=>{f(e.target.value),m||""===e.target.value.trim()?m&&""===e.target.value.trim()&&A(!1):A(!0)},$=()=>{g.trim()&&((async()=>{j((0,b.Xk)({characterId:B.characterId,chatId:_,textId:W,relationId:B.relationId,storylineId:B.storylineId,content:g}))})(),A(!1),f(""))};(0,l.useEffect)(()=>{x&&(u.error(x),j((0,b.g)("")))},[x]);let eo=e=>{"Enter"===e.key&&$()},en=()=>{j((0,b.fL)(!1)),j((0,b.PG)(!1)),j((0,b.M6)(!1))};return(0,l.useEffect)(()=>{if(!G)return},[O,P]),(0,J.Wo)(ee.d5.SELECTED_MODEL,B.characterId,e=>{var t;F((null==(t=e.model)?void 0:t.userModelInfo)||null)}),(0,l.useEffect)(()=>{var e;if(G)return;let t=(0,J.O3)(ee.d5.SELECTED_MODEL,B.characterId);F((null==t||null==(e=t.model)?void 0:e.userModelInfo)||null)},[B.characterId]),(0,n.jsxs)(r.A,{sx:et.root(G),children:[G?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(r.A,{sx:et.memoryHeader,children:[(0,n.jsx)(M.A,{checked:H,onChange:()=>{j((0,b.PG)(!H))},sx:et.checkbox,icon:(0,n.jsx)(r.A,{sx:et.uncheckedIcon}),checkedIcon:(0,n.jsx)(r.A,{sx:et.checkedIcon,children:(0,n.jsx)(w.A,{name:"ok-full",color:s.black,size:"16"})})}),(0,n.jsxs)(r.A,{sx:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(y.A,{sx:et.selectText,children:"Select All"}),(0,n.jsxs)(y.A,{component:"span",sx:{color:s.textTag,fontSize:14,fontWeight:400,ml:.5},children:["(",O," / ",P,")"]})]}),(0,n.jsx)(a.A,{onClick:en,sx:{...et.closeButton,mt:1.2},children:(0,n.jsx)(Z.A,{sx:{fontSize:20}})})]}),(0,n.jsxs)(r.A,{sx:et.memoryFooter,children:[(0,n.jsx)(k.A,{variant:"contained",disableElevation:!0,onClick:en,sx:{...(0,U.m4)(i),width:277},children:"Cancel"}),(0,n.jsx)(k.A,{variant:"contained",disableElevation:!0,onClick:()=>{null==t||t("saveMemory")},disabled:0===O,sx:{...(0,U.DG)(i),width:461},children:"Save Memory"})]})]}):(e=>{var l,i,d;let u=[{icon:(0,n.jsx)(w.A,{name:"icon-taikong8",size:20,color:e.palette.base.purpleLighter}),label:(null==T?void 0:T.modelFullName)||"Deepseek-V3",onClick:()=>{null==o||o(),null==t||t("deepseek"),V()}}];return(0,n.jsxs)(r.A,{children:[(0,n.jsx)(r.A,{sx:et.quickBar,children:(0,n.jsx)(k.A,{variant:"contained",startIcon:(0,n.jsx)(w.A,{name:"icon-taikong8",size:24,color:null==(l=e.palette.base)?void 0:l.textTag}),endIcon:void 0,onClick:()=>null==t?void 0:t("deepseek"),sx:et.quickButton(0),children:(null==T?void 0:T.modelFullName)||"Select Model"},"deepseek")}),(0,n.jsxs)(r.A,{sx:{...et.inputContainer,"&:focus-within":{background:"linear-gradient(#000, #000) padding-box, ".concat(s.buttonYellow," border-box"),border:"1px solid transparent"}},children:[(0,n.jsx)(r.A,{sx:{width:49,height:37,borderRadius:"19px",backgroundColor:null==(i=e.palette.base)?void 0:i.bgPannel,display:"none",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(w.A,{name:"a-tupian1-01",size:18,color:null==(d=e.palette.base)?void 0:d.buttonYellow})}),(0,n.jsx)(L.A,{fullWidth:!0,variant:"standard",placeholder:c("chat.placeholder"),value:g,onChange:Q,onKeyPress:eo,InputProps:et.textFieldInputProps,sx:{flex:1,flexGrow:1,"& .MuiInputBase-root":{p:1,borderRadius:0,bgcolor:"transparent"},"& .MuiInputBase-input":{fontSize:13,color:"#fff",px:"17px","&::placeholder":{color:s.textGray4,opacity:1}}}}),m?(0,n.jsx)(a.A,{onClick:$,sx:et.iconButton,children:(0,n.jsx)(w.A,{name:"fasong",size:28,color:"#FFC000"})}):(0,n.jsx)(K.A,{title:"",children:(0,n.jsx)(a.A,{onClick:q,sx:et.iconButton,children:(0,n.jsx)(w.A,{name:"zengjiatianjiajiahao",size:28,color:"#FFC000"})})}
1),(0,n.jsx)(N.d,{anchorEl:E,open:!!E,onClose:V,items:u,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}})]})]})})(i),(0,n.jsx)(X.A,{state:I,dispatch:C})]})};var en=o(46728),el=o(37567),er=o(8498),ea=o(49074),ei=o(4857),es=o(73715),ec=o(61083);let ed=()=>{let e=h.M_.dispatch,t=(0,p.useToast)(),o=(0,u.useParams)(),i=null==o.id?"":o.id,{sidebar2Open:s,rightPanelOpen:v,isMobile:y,sidebarOpen:j}=(0,d.d4)(e=>e.ui),{conversations:I,currentConvId:k,isLoadingMore:C,newChatOfSaveMemory:S}=(0,d.d4)(e=>e.chat),[E,M]=(0,l.useState)(!1),[z,L]=(0,l.useState)(!1),[T,F]=(0,l.useState)(!1),[R,D]=(0,l.useState)(!1),[W,_]=(0,l.useState)({}),[G,O]=(0,l.useState)(!1),[P,H]=(0,l.useState)(i),[N,U]=(0,l.useReducer)(Y.i,Y.u),[q,V]=(0,l.useState)([]),[Q,K,Z]=(0,J.Mj)(ee.d5.SELECTED_MODEL,{},{expireSeconds:604800,characterId:P,fetchRemote:async()=>await es.m.getCharacterModelConfig(P)}),[et,ed]=(0,l.useState)({}),eu=async()=>{let e=await ec.D.getUserInfo();ed(e),console.log("userInfo=",e)},ex=(e,t)=>{U({type:"CLOSE_MODAL"}),"success"===e&&t&&g.G.update(m.A.USER_COLLECTIONS_MODEL,{modelId:t.modelId,collectStatus:+(0===t.collectStatus)})},eh=async(e,t)=>{let o=await (0,B.h6)(e,i,I[k].storylineId||"",Q);o&&Z(o),0==t?M(!0):L(!0)},ep=async(e,t)=>{try{let o=await g.G.update(m.A.SET_USER_MODEL_CONFIG,{modelWordCount:e,temperature:t});return o.success&&ed({...et,modelWordCount:e,temperature:t}),o}catch(e){return console.error("Failed to update user model config:",e),null}},eg=(e,t)=>{console.log(t),U({type:"OPEN_MODAL",payload:{modal:e,props:{onCallback:(e,t)=>{console.log("onCallback:",e,t)},...t}}})},ef=(e,t)=>{switch(console.log("弹窗 --- 事件回传:",e,t),e){case"success":if((null==t?void 0:t.formData.name)&&(null==t?void 0:t.formData.name.trim())!==""||(t.formData.name="You can give a title to this memory"),0===q.length){null==t||t.callback("You can select at least one message");return}em(t);break;case"cancel":U({type:"CLOSE_MODAL"})}},em=async o=>{try{let n=await f.J.saveMemory(q,{characterId:i,memoryName:null==o?void 0:o.formData.name,visibility:null==o?void 0:o.formData.access,memoryContents:[]});if(n.success){if(t.success("Memory saved successfully"),U({type:"CLOSE_MODAL"}),e((0,b.fL)(!1)),S)try{e((0,b.Xo)(!0)),await e((0,b.CK)()),e((0,b.M6)(!1)),t.success("New chat created successfully")}catch(e){console.error("Failed to create new chat",e)}finally{e((0,b.Xo)(!1))}}else null==o||o.callback(n.msg)}catch(e){null==o||o.callback((null==e?void 0:e.message)||"Failed to save memory")}finally{e((0,b.M6)(!1))}},eA=async()=>{await eh((null==Q?void 0:Q.modelId)||"",0)};return(0,l.useEffect)(()=>{let t=()=>{e((0,A.RE)(window.innerWidth<768))};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),(0,x.u)(()=>{if(console.log("characterId:",i,P),P&&P===i)return}),(0,l.useEffect)(()=>{eu()},[]),(0,n.jsxs)(r.A,{sx:{flexGrow:1,display:"flex",flexDirection:"column"},children:[y&&!j&&(0,n.jsx)(a.A,{onClick:()=>e((0,A.vW)()),sx:{position:"absolute",top:16,left:16,color:"#FFD700",zIndex:10},children:(0,n.jsx)(c,{})}),!s&&(0,n.jsx)(r.A,{sx:{position:"fixed",top:"16px",left:"".concat(70,"px")},children:(0,n.jsx)(a.A,{sx:{transform:"rotate(180deg)"},onClick:()=>e((0,A.Rt)(!s)),children:(0,n.jsx)(w.A,{name:"icon_shuangjiantou-zuo",color:"#c1acee"})})}),k&&!v&&!C&&(0,n.jsx)(r.A,{sx:{position:"fixed",top:"16px",right:"16px"},children:(0,n.jsx)(a.A,{onClick:()=>e((0,A.N8)(!v)),children:(0,n.jsx)(w.A,{name:"icon_shuangjiantou-zuo",color:"#c1acee"})})}),(0,n.jsx)($,{onAction:(e,t,o)=>{switch(console.log("Show modal:",e,t),e){case"chatSetting":eh((null==Q?void 0:Q.modelId)||"",1);break;case"viewMemories":F(!0);break;case"saveMemory":D(!0);break;case"startChat":O(!0);break;case"showSelectModel":M(!0);break;case"selectMessages":V(o||[])}}}),k&&!C&&(0,n.jsx)(eo,{onQuickAction:(e,t)=>{console.log("action:",e,t),"deepseek"===e?eA():"saveMemory"===e&&eg("memorySave",{onCallback:ef,params:{action:e,name:"",access:2}})}}),(0,n.jsx)(en.A,{open:E,onClose:()=>M(!1),onSave:(o,n)=>{e((0,A.xH)(o)),(async()=>{let e=I[k];if(!e)return(null==n?void 0:n.callback)?null==n||n.callback("Conversation does not exist"):t.error("Conversation does not exist");try{console.log("model:",o);let l=await g.G.update(m.A.SET_USER_MODEL,{modelId:o.modelId,characterId:e.characterId,maxLength:o.maxLength.toString()});l.success?(await ep(o.maxLength,et.temperature||0),Z(o),t.success("Model selection successful"),M(!1)):(null==n?void 0:n.callback)?null==n||n.callback(l.msg):t.error(l.msg)}catch(e){console.error("设置模型失败:",e),(null==n?void 0:n.callback)?null==n||n.callback("Model selection failed"):t.error("Model selection failed");return}})()},onDetail:e=>{eg("modelDetailModal",{onCallback:ex,data:e})}}),(0,n.jsx)(ei.A,{open:G,onClose:()=>O(!1),onSave:e=>{console.log("创建新聊天:",e)}}),(0,n.jsx)(ea.A,{open:R,onClose:()=>D(!1),onCallback:(e,t)=>{console.log("确认加载回忆,摘要内容:",e,t),D(!1)},initialState:{messageCount:6,characterCount:2423,maxLength:500}}),(0,n.jsx)(er.A,{open:T,onClose:()=>F(!1),onCallback:()=>{console.log("确认加载回忆"),F(!1)}}),(0,n.jsx)(el.A,{open:z,onClose:()=>L(!1),onSave:(e,t)=>
1{"save"===e?_(t):"showModel"===e&&eh(t.modelId,0),console.log("action:",e,t)},initialSettings:W,userInfo:et}),(0,n.jsx)(X.A,{state:N,dispatch:U})]})},eu=()=>{let e=(0,u.useRouter)(),{isAuthenticated:t,isLoading:o}=(0,j.A)();return((0,l.useEffect)(()=>{!o&&(t||e.replace("/"))},[t,o,e]),o||!t)?(0,n.jsx)(r.A,{sx:{width:"100vh",height:"100vh",flexDirection:"column",alignItems:"center",justifyContent:"center",display:"flex",flexGrow:1},children:(0,n.jsx)(i.A,{})}):(0,n.jsx)(ed,{})}},86174:()=>{}}]);

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.