PageSourceSearch

https://emochi.com/_next/static/immutable/chunks/27a-lp-xgni2z.js

js emochi.com collected 2026-10-04 17:27:44 UTC 92,374 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="e5797f20-8653-0f61-c92f-8d5ee0ac1c7b")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77031,e=>{"use strict";var t=e.i(417420),l=e.i(901629);let r=Date.parse("2026-03-16T00:00:00Z"),s=new Set(["vanillav2","greenapple","cookie","grape","whitetruffle","blackberryv2"]),n=e=>(e??"").trim().toLowerCase().replace(/[^a-z0-9]/g,""),i=()=>{let e=(0,l.storageWithUserId)().getString(t.StorageKey.CHAT_MODEL_NEW_BADGE_DISMISSED);if(!e)return{};try{let t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}},a=e=>[n(e.title),n(e.name)].find(e=>s.has(e));e.s(["dismissModelNewBadge",0,e=>{let r=a(e);if(!r)return;let s=i();!s[r]&&(s[r]=Date.now(),(0,l.storageWithUserId)().set(t.StorageKey.CHAT_MODEL_NEW_BADGE_DISMISSED,JSON.stringify(s)))},"shouldShowModelNewBadge",0,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=a(e);return!!l&&!(t<r)&&!(t>=r+1296e6)&&!i()[l]}])},758664,e=>{"use strict";var t,l=e.i(528139),r=e.i(295980),s=e.i(672347),n=e.i(390935),i=e.i(635861),a=e.i(690067),o=e.i(924123);e.i(208419);var d=e.i(116972),c=e.i(823416),u=e.i(901629),x=e.i(417420);function m(){return(m=Object.assign.bind()).apply(null,arguments)}let h=e=>s.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},e),t||(t=s.createElement("path",{fill:"#fff",d:"M6 4.667 10.667 0 12 1.333 7.333 6 12 10.667 10.667 12 6 7.333 1.333 12 0 10.667 4.667 6 0 1.333 1.333 0z"})));var p=e.i(121552),g=e.i(217211);let f=s.default.memo(e=>{let{onSendMsg:t,messageInputText:r}=e;return(0,l.jsx)(p.default,{style:{paddingLeft:7,paddingTop:12,paddingBottom:12,paddingRight:12,display:"inline-flex"},onPress:()=>{t?.()},disabled:r.trim()?.length===0,children:(0,l.jsx)(n.FlChatDetailIconSend,{size:24,fill:r?.length===0?g.Theme.subTitleColor2:g.Theme.brandColor,"data-testid":"send_button"})})});var b=e.i(298074),v=e.i(841015);let y=s.default.memo(e=>{let{disableLinearGradient:t=!1,hideCloseIcon:r=!0,limitTextStyle:i={},onTextChange:a,onClosePress:o,disableMaxLength:c=!1}
2=e,[u,x]=(0,s.useState)(e.value||""),m=(0,s.useRef)(null),p=(0,s.useRef)(null),g=(0,s.useRef)(!1);(0,s.useEffect)(()=>{x(e.value||"")},[e.value]);let y=(0,s.useMemo)(()=>c||e.maxLength&&-1===e.maxLength?void 0:e.maxLength,[e.maxLength,c]),w=(0,d.useEvent)(()=>{e.setImageUrl?.(void 0)}),j=(0,d.useEvent)(()=>{0!==u.length&&(g.current=!0,e.onSend?.(u,e.imageUrl),e.setImageUrl?.(void 0),x(""))}),C=(0,d.useEvent)(()=>{g.current||e.onBlur?.(u)}),N=(0,d.useEvent)(e=>{let t=e.target.value;x(t),a?.(t)}),S=(0,d.useEvent)(e=>{e.stopPropagation()});(0,b.useWatch)([y],()=>{y&&u.length>y&&x(u.slice(0,y))});let F=(0,d.useEvent)(()=>{let e=m.current;if(!e)return;let t=e.selectionStart,l=e.selectionEnd,r=u.slice(0,t)+"**"+u.slice(l);x(r),a?.(r),setTimeout(()=>{e.focus(),e.setSelectionRange(t+1,t+1)},0)});return(0,l.jsxs)("div",{className:"flex items-center justify-center bg-transparent relative",children:[!t&&(0,l.jsx)("div",{className:"absolute bottom-0 left-0 right-0 w-full pointer-events-none",style:{height:"calc(100% + 100px)",background:"linear-gradient(to bottom, rgba(1,1,1,0) 0%, rgba(1,1,1,0.8) 50%, rgba(1,1,1,1) 100%)",zIndex:0}}),(0,l.jsx)("div",{ref:p,onClick:S,className:`w-full flex flex-row items-center justify-center mx-3 relative z-10 ${e.isStick?"pb-1.5":""}`,children:(0,l.jsx)("div",{style:e.style,className:"rounded-xl overflow-hidden w-full max-w-[1146px] mx-auto",children:(0,l.jsxs)("div",{className:"w-full rounded-xl overflow-hidden flex flex-col bg-[#1A1A1A]",children:[(0,l.jsxs)("div",{className:"flex flex-row w-full overflow-hidden",children:[e.imageUrl&&(0,l.jsxs)("button",{type:"button",className:"relative m-3 rounded-md overflow-hidden",onClick:w,children:[(0,l.jsx)(v.FlowImage,{source:{uri:e.imageUrl},style:{width:50,height:50}}),(0,l.jsx)("div",{className:"absolute p-1 bg-[#0000009E] w-3 h-3 right-0.5 top-0.5 rounded-xl flex items-center justify-center",children:(0,l.jsx)(h,{width:4,height:4,fill:"#9d9da1"})})]}),(0,l.jsx)("div",{className:"flex flex-row items-start pt-[9px] flex-1",children:(0,l.jsx)("textarea",{ref:m,placeholder:e.placeholder,value:u,onChange:N,onBlur:C,autoFocus:!0,maxLength:y,style:{minHeight:22,...e.inputStyle},className:"scrollbar-emochi flex-1 text-lg text-white text-left max-h-[70px] mb-3 mt-2 px-3 py-0 bg-transparent border-0 outline-none resize-none font-medium placeholder-white/40"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"bg-[rgba(255,255,255,0.03)] h-[1px] mx-3"}),(0,l.jsxs)("div",{className:"w-full flex flex-row items-center pt-[5px]",children:[e.maxLength&&-1!==e.maxLength?(0,l.jsx)("div",{className:"flex-1 ml-3",children:e.renderLimit?e.renderLimit({currentLength:u.length,maxLength:e.maxLength,isOverLimit:u.length>e.maxLength}):(0,l.jsx)("span",{style:u.length>e.maxLength?i:void 0,className:"text-[14px] font-normal text-white",children:`${u.length??0}/${e.maxLength}`})}):(0,l.jsx)("div",{className:"flex-1"}),(0,l.jsxs)("div",{className:"flex flex-row items-center",children:[!e.hideAsterisk&&(0,l.jsx)("button",{type:"button",className:"px-[7px] py-[9px] hover:opacity-80 transition-opacity",onClick:F,children:(0,l.jsx)(n.FlChatStarIcon,{size:20,fill:"white"})}),!r&&(0,l.jsx)("button",{type:"button",className:"w-6 h-6 flex items-center justify-center hover:opacity-80 transition-opacity",onClick:o,children:(0,l.jsx)(h,{width:13,height:13,fill:"#FFFFFF99"})}),(0,l.jsx)(f,{messageInputText:u,onSendMsg:j})]})]})]})]})})})]})});y.displayName="MessageSendInput";var w=e.i(545490),j=e.i(543754);let C={[j.UserVipLevel.FREE]:{label:"Free",textClassName:"text-white/60"},[j.UserVipLevel.PLUS]:{label:"Plus",crownImage:"/images/subscribe/card/crown-plus.png",textClassName:"bg-[linear-gradient(90deg,#A5B7D3_10%,#CCDBF0_70%,#F8FDFE_100%)] bg-clip-text text-transparent"},[j.UserVipLevel.ULTRA]:{label:"Ultra",crownImage:"/images/subscribe/card/crown-ultra.png",textClassName:"bg-[linear-gradient(90deg,#CD9440_0%,#FFEA8C_100%)] bg-clip-text text-transparent"},[j.UserVipLevel.MAX]:{label:"MAX",crownImage:"/images/subscribe/card/crown-max.png",textClassName:"bg-[linear-gradient(135deg,#66FEF4_0%,#FFFFD6_30%,#FFC0AD_70.19%,#E694FF_100%)] bg-clip-text text-transparent"},[j.UserVipLevel.LITE]:{label:"Lite",crownImage:"/images/subscribe/card/crown-lite.png",textClassName:"bg-[linear-gradient(90deg,#BDFE09_0%,#FEFC00_70%,#FFFE99_100%)] bg-clip-text text-transparent"}},N=e=>{let{userVipLevel:t,currentLength:r,maxLength:s,isOverLimit:n}=e,i=C[t]??C[j.UserVipLevel.FREE];return(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-1 text-[12px] font-semibold leading-4",children:[i.crownImage&&(0,l.jsx)(w.NextImage,{src:i.crownImage,alt:"",width:16,height:16,className:"size-4 shrink-0"}),(0,l.jsx)("span",{className:i.textClassName,children:i.label}),(0,l.jsx)("span",{className:n?"text-red-500":"text-white/40",children:`${r} / ${s}`})]})};var S=e.i(845492),F=e.i(850883),M=e.i(814614),T=e.i(334863),k=e.i(454679),E=e.i(972164),L=e.i(719429),A=e.i(175458),I=e.i(81195),P=e.i(200588),[R,B]=(0,P.createContext)({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1}),D=e=>e.children(B()),_=e.i(220840),O=e.i(152075),U=e.i(291484),V=(0,s.forwardRef)((e,t)=>{let l=B(),r=(0,O.mergeProps)(l.getErrorTextProps(),e);
2return l?.invalid?(0,U.jsx)(_.ark.span,{...r,ref:t}):null});V.displayName="FieldErrorText";var W=(0,s.forwardRef)((e,t)=>{let l=(0,O.mergeProps)(B()?.getHelperTextProps(),e);return(0,U.jsx)(_.ark.span,{...l,ref:t})});W.displayName="FieldHelperText";var H=(0,s.forwardRef)((e,t)=>{let l=(0,O.mergeProps)(B()?.getInputProps(),e);return(0,U.jsx)(_.ark.input,{...l,ref:t})});H.displayName="FieldInput";var z=e.i(622096),$=e=>{let{value:t,children:l}=e,r=B();return(0,U.jsx)(R,{value:(0,s.useMemo)(()=>{if(!r)throw Error("Field.Item must be used within Field.Root");let e=`field::${r.ids.control}::item::${t}`,l=`${e}::label`,s=()=>({...r.getInputProps(),id:e});return{...r,ids:{...r.ids,control:e,label:l},getLabelProps:()=>({...r.getLabelProps(),id:l,htmlFor:e}),getInputProps:()=>({...s(),...z.parts.input.attrs}),getSelectProps:()=>({...s(),...z.parts.select.attrs}),getTextareaProps:()=>({...s(),...z.parts.textarea.attrs})}},[r,t]),children:l})};$.displayName="FieldItem";var G=(0,s.forwardRef)((e,t)=>{let l=(0,O.mergeProps)(B()?.getLabelProps(),e);return(0,U.jsx)(_.ark.label,{...l,ref:t})});G.displayName="FieldLabel";var q=(0,s.forwardRef)((e,t)=>{let{fallback:l,...r}=e,s=B();if(!s.required)return l;let n=(0,O.mergeProps)(s.getRequiredIndicatorProps(),r);return(0,U.jsx)(_.ark.span,{...n,ref:t,children:r.children??"*"})});q.displayName="FieldRequiredIndicator";var K=e.i(674389),Y=e.i(830723),X=e.i(272801),[J,Q]=(0,P.createContext)({name:"FieldsetContext",hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),Z="u">typeof window?s.useLayoutEffect:s.useEffect,ee=e.i(824420),et=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Q(),l=(0,X.useEnvironmentContext)(),{ids:r,target:n,disabled:i=!!t?.disabled,invalid:a=!1,readOnly:o=!1,required:d=!1}=e,[c,u]=(0,s.useState)(!1),[x,m]=(0,s.useState)(!1),h=(0,s.useId)(),p=e.id??h,g=(0,s.useRef)(null),f=r?.control??`field::${p}`,b=r?.errorText??`field::${p}::error-text`,v=r?.helperText??`field::${p}
2::helper-text`,y=r?.label??`field::${p}::label`;Z(()=>{let e=g.current;if(!e)return;let t=()=>{let e=l.getRootNode();u(!!e.getElementById(b)),m(!!e.getElementById(v))};t();let r=new(l.getWindow()).MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0}),()=>r.disconnect()},[l,b,v]);let w=(0,s.useMemo)(()=>{let e=[];return c&&a&&e.push(b),x&&e.push(v),e.join(" ")||void 0},[a,b,v,c,x]),j=(0,s.useMemo)(()=>()=>({...z.parts.root.attrs,id:f,ref:g,role:"group","data-disabled":(0,ee.dataAttr)(i),"data-invalid":(0,ee.dataAttr)(a),"data-readonly":(0,ee.dataAttr)(o)}),[i,a,o,f]),C=n?`field::${p}::item::${n}`:void 0,N=(0,s.useMemo)(()=>()=>({...z.parts.label.attrs,id:y,"data-disabled":(0,ee.dataAttr)(i),"data-invalid":(0,ee.dataAttr)(a),"data-readonly":(0,ee.dataAttr)(o),"data-required":(0,ee.dataAttr)(d),htmlFor:C??p}),[i,a,o,d,p,y,C]),S=(0,s.useMemo)(()=>()=>({"aria-describedby":w,"aria-invalid":(0,ee.ariaAttr)(a),"data-invalid":(0,ee.dataAttr)(a),"data-required":(0,ee.dataAttr)(d),"data-readonly":(0,ee.dataAttr)(o),id:p,required:d,disabled:i,readOnly:o}),[w,a,d,o,p,i]),F=(0,s.useMemo)(()=>()=>({...S(),...z.parts.input.attrs}),[S]),M=(0,s.useMemo)(()=>()=>({...S(),...z.parts.textarea.attrs}),[S]),T=(0,s.useMemo)(()=>()=>({...S(),...z.parts.select.attrs}),[S]),k=(0,s.useMemo)(()=>()=>({id:v,...z.parts.helperText.attrs,"data-disabled":(0,ee.dataAttr)(i)}),[i,v]),E=(0,s.useMemo)(()=>()=>({id:b,...z.parts.errorText.attrs,"aria-live":"polite"}),[b]);return{ariaDescribedby:w,ids:{root:f,control:p,label:y,errorText:b,helperText:v},refs:{rootRef:g},disabled:i,invalid:a,readOnly:o,required:d,getLabelProps:N,getRootProps:j,getInputProps:F,getTextareaProps:M,getSelectProps:T,getHelperTextProps:k,getErrorTextProps:E,getRequiredIndicatorProps:(0,s.useMemo)(()=>()=>({"aria-hidden":!0,...z.parts.requiredIndicator.attrs}),[])}},el=(0,K.createSplitProps)(),er=(0,s.forwardRef)((e,t)=>{let[l,r]=el(e,["id","ids","disabled","invalid","readOnly","required","target"]),s=et(l),n=(0,O.mergeProps)(s.getRootProps(),r);return(0,U.jsx)(R,{value:s,children:(0,U.jsx)(_.ark.div,{...n,ref:(0,Y.composeRefs)(t,s.refs.rootRef)})})});er.displayName="FieldRoot";var es=(0,K.createSplitProps)(),en=(0,s.forwardRef)((e,t)=>{let[{value:l},r]=es(e,["value"]),s=(0,O.mergeProps)(l.getRootProps(),r);return(0,U.jsx)(R,{value:l,children:(0,U.jsx)(_.ark.div,{...s,ref:t})})});en.displayName="FieldRootProvider";var ei=(0,s.forwardRef)((e,t)=>{let l=(0,O.mergeProps)(B()?.getSelectProps(),e);return(0,U.jsx)(_.ark.select,{...l,ref:t})});ei.displayName="FieldSelect";var ea=e.i(78488),eo=e.i(503787),ed=(0,s.forwardRef)((e,t)=>{let{autoresize:l,...r}=e,n=(0,s.useRef)(null),i=(0,O.mergeProps)(B()?.getTextareaProps(),{style:{resize:l?"none":void 0}},r);return(0,s.useEffect)(()=>{if(l)return(e=>{if(!e)return;let t=(0,ea.getComputedStyle)(e),l=(0,eo.getWindow)(e),r=(0,eo.getDocument)(e),s=()=>{requestAnimationFrame(()=>{let l;e.style.height="auto",l="content-box"===t.boxSizing?e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),"none"!==t.maxHeight&&l>parseFloat(t.maxHeight)?("hidden"===t.overflowY&&(e.style.overflowY="scroll"),l=parseFloat(t.maxHeight)):"hidden"!==t.overflowY&&(e.style.overflowY="hidden"),e.style.height=`${l}px`})};e.addEventListener("input",s),e.form?.addEventListener("reset",s);let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"value");n&&Object.defineProperty(e,"value",{...n,set(t){let r=n.get?.call(this);n.set?.call(this,t),s(),r!==t&&queueMicrotask(()=>{e.dispatchEvent(new l.InputEvent("input",{bubbles:!0}))})}});let i=new l.ResizeObserver(()=>{requestAnimationFrame(()=>s())});i.observe(e);let a=new l.MutationObserver(()=>s());return a.observe(e,{attributes:!0,attributeFilter:["rows","placeholder"]}),r.fonts?.addEventListener("loadingdone",s),()=>{e.removeEventListener("input",s),e.form?.removeEventListener("reset",s),r.fonts?.removeEventListener("loadingdone",s),i.disconnect(),a.disconnect()}})(n.current)},[l]),(0,U.jsx)(_.ark.textarea,{...i,ref:(0,Y.composeRefs)(t,n)})});ed.displayName="FieldTextarea";var ec=(0,I.__exportAll)({Context:()=>D,ErrorText:()=>V,HelperText:()=>W,Input:()=>H,Item:()=>$,Label:()=>G,RequiredIndicator:()=>q,Root:()=>er,RootProvider:()=>en,Select:()=>ei,Textarea:()=>ed});let{withContext:eu,PropsProvider:ex}=(0,e.i(939045).createRecipeContext)({key:"textarea"}),em=eu(ec.Textarea);var eh=e.i(535815),ep=e.i(357675);let eg=e=>{let{options:t,selectedValue:s,onSelect:n}=e;return(0,l.jsx)("div",{className:"flex h-12 w-full flex-row overflow-hidden rounded-full p-1",style:{backgroundColor:g.Theme.bgColor2},children:t.map(e=>(0,l.jsx)("button",{type:"button",className:"flex flex-1 items-center justify-center rounded-full px-2",style:{backgroundColor:e.name===s?g.Theme.bgColor3:"transparent"},onClick:()=>n(e.name),children:(0,l.jsx)(r.Text,{className:"text-center text-[14px] font-semibold leading-[18px] text-nowrap",color:e.name===s?g.Theme.web.text.primary:g.Theme.subTitleColor3,children:e.text})},e.name))})},ef=e=>{let{onClick:t}=e;return(0,l.jsx)("button",{type:"button","aria-label":"info placeholder",className:"group flex h-4 w-4 cursor-pointer items-center justify-center rounded-full border border-white/15 transition-all duration-200 hover:border-white/60 hover:bg-white/10",style:{boxShadow:"0 0.667px 0.667px 0 rgba(0, 0, 0, 0.12)"},onClick:t,children:(0,l.jsx)("span",{className:"text-[10px] font-medium leading-none text-white/35 transition-colors duration-200 group-hover:text-white/60",children:"?"})})},eb=e=>
2{let{title:t,description:s,onInfoClick:n}=e;return(0,l.jsxs)("div",{className:"flex w-full flex-col gap-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)(r.Text,{className:"text-[14px] font-semibold leading-5",color:g.Theme.web.text.primary,children:t}),(0,l.jsx)(ef,{onClick:n})]}),(0,l.jsx)(r.Text,{className:"text-[12px] leading-4",color:g.Theme.subTitleColor2,children:s})]})},ev=e=>{let{content:t,acknowledgeLabel:s,onClose:i}=e;return(0,l.jsxs)("div",{className:"absolute inset-0 z-20 flex flex-col rounded-[24px] border border-white/[0.05]",style:{boxShadow:"inset 0 1px 0 rgba(255,255,255,0.02)",backgroundColor:g.Theme.web.bg.primary},children:[(0,l.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col px-6 pt-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-12",children:[(0,l.jsx)(r.Text,{className:"min-w-0 flex-1 text-[18px] font-semibold leading-6 text-white",children:t.title}),(0,l.jsx)("button",{type:"button",onClick:i,className:"flex h-8 w-8 items-center justify-center text-white/60 transition-colors hover:text-white","aria-label":"close info",children:(0,l.jsx)(n.FlNavbarIconClose,{size:20,fill:"currentColor"})})]}),(0,l.jsx)("div",{className:"mt-4 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pb-4",children:t.blocks.map((e,t)=>"paragraph"===e.type?(0,l.jsx)(r.Text,{className:"text-[14px] leading-5",color:"primary"===e.tone?g.Theme.web.text.primary:g.Theme.subTitleColor2,children:e.text},`paragraph-${t}`):"labeled"===e.type?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.Text,{className:"text-[14px] font-semibold leading-[18px]",color:g.Theme.web.text.primary,children:e.label}),(0,l.jsx)(r.Text,{className:"text-[14px] leading-5",color:g.Theme.subTitleColor2,children:e.text})]},`labeled-${t}`):(0,l.jsxs)("div",{className:"flex flex-col",children:[e.label&&(0,l.jsx)(r.Text,{className:"mb-1 text-[14px] leading-5",color:g.Theme.subTitleColor2,children:e.label}),(0,l.jsx)("ol",{className:"list-decimal pl-[22px] text-[14px] leading-5 text-web-text-primary",children:e.items.map((e,r)=>(0,l.jsx)("li",{children:e},`ordered-${t}-${r}`))})]},`ordered-${t}`))})]}),(0,l.jsx)("div",{className:"flex items-center justify-center p-6",children:(0,l.jsx)("button",{type:"button",onClick:i,className:"flex h-12 w-full items-center justify-center rounded-full border border-white/10 px-6 transition-colors hover:bg-white/10",children:(0,l.jsx)(r.Text,{className:"text-[16px] font-semibold leading-6 text-white",children:s})})})]})},ey=e=>{let{isOpen:t,onClose:a,onConfirm:o,onPressReset:d,modelInfo:c,replyLengthType:u,currentTemperature:x,modelPersona:m,replyLengthDatas:h,temperatureDatas:p,setReplyLengthType:f,setCurrentTemperature:b,setModelPersona:v,customInstructionLimit:y,userVipLevel:w,showProIcon:j}=e,{t:C}
2=(0,i.useLanguageContext)(),[S,F]=(0,s.useState)(null),M={responseLength:{title:C("Response Length"),blocks:[{type:"paragraph",text:C("This choose controls how long each Bot reply is.")},{type:"labeled",label:C("Short:"),text:C("Great for one-liners, banter, and command-style prompts--like your character dropping short lines in a chat.")},{type:"labeled",label:C("Medium:"),text:C("Best for regular scene dialogue--the. The character talks in a few sentences each time, with some reactions and feelings.")},{type:"labeled",label:C("Long:"),text:C("Ideal for long scenes, inner monologues, and world-building--each reply feels like a mini story chapter.")},{type:"paragraph",text:C("Excessively long response lengths may shorten the bot's memory.")}]},creativity:{title:C("Creativity"),blocks:[{type:"paragraph",text:C("Choose between stable character behavior or wild plot twists.")},{type:"labeled",label:C("Stable:"),text:C("The character sticks closely to its setting--less out-of-character, more stable plots; good for the main story and long-term arcs.")},{type:"labeled",label:C("Balance:"),text:C("Balances character consistency with some surprises; great for everyday chatting and light role play.")},{type:"labeled",label:C("Creative:"),text:C("The character becomes more imaginative and dramatic--expect plot twists, iconic scenes, and unexpected turns; perfect for high-drama stories.")}]},customInstruction:{title:C("Custom Instruction"),blocks:[{type:"paragraph",text:C('Here you can define the bot\'s overall "talking style" and "personality."')},{type:"paragraph",text:C("For example: gentle and comforting, cool and tsundere, funny and sarcastic, serious mentor, sweet lover, etc.")},{type:"ordered",label:C("You can:"),items:[C("Choose whether it talks more casually or more formally;"),C("Decide if it should be more logical and calm, or more emotional and clingy;"),C("Let it use more emojis and dramatic expressions, or keep it simple and restrained.")]},{type:"paragraph",text:C("After you set this up, the model will try to stay in this style during the whole chat, making the experience more consistent and immersive.")}]}},T=y>0;return(0,l.jsx)(L.Dialog.Root,{lazyMount:!0,open:t,onOpenChange:()=>a(),closeOnInteractOutside:!1,placement:"center",children:(0,l.jsxs)(eh.Portal,{children:[(0,l.jsx)(L.Dialog.Backdrop,{style:{backgroundColor:"rgba(0, 0, 0, 0.6)"}}),(0,l.jsx)(L.Dialog.Positioner,{children:(0,l.jsxs)(L.Dialog.Content,{className:"!flex !flex-col !gap-0 !h-[480px] w-[540px] max-w-[calc(100vw-32px)] overflow-hidden rounded-[24px] !p-0",style:{backgroundColor:g.Theme.web.bg.primary},children:[(0,l.jsxs)(L.Dialog.Header,{padding:0,margin:0,className:"!m-0 flex h-[72px] shrink-0 flex-row items-center justify-between !p-6",children:[(0,l.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[(0,l.jsx)(r.Text,{className:"text-[18px] font-extrabold leading-6 text-white",children:`${c.title} ${C("Settings")}`}),(0,l.jsx)(ep.EmochiProIcon,{})]}),(0,l.jsx)("button",{type:"button",onClick:d,className:"flex h-6 w-6 items-center justify-center",children:(0,l.jsx)(n.FlIconModelReset,{size:24,fill:"#fff"})})]}),(0,l.jsx)(L.Dialog.Body,{padding:0,margin:0,className:"scrollbar-emochi !m-0 !flex-1 !min-h-0 overflow-y-auto !px-6 !py-0",children:(0,l.jsxs)(A.Box,{className:"flex flex-col gap-6",children:[(0,l.jsxs)(A.Box,{className:"flex flex-col gap-3",children:[(0,l.jsx)(eb,{title:C("Response length"),description:C("Control how short or long replies are"),onInfoCl
2ick:()=>F("responseLength")}),(0,l.jsx)(eg,{options:h,selectedValue:u,onSelect:e=>f(e)})]}),(0,l.jsxs)(A.Box,{className:"flex flex-col gap-3",children:[(0,l.jsx)(eb,{title:C("Creativity"),description:C("Balance between stable and creative"),onInfoClick:()=>F("creativity")}),(0,l.jsx)(eg,{options:p,selectedValue:x,onSelect:e=>b(e)})]}),(0,l.jsxs)(A.Box,{className:"flex flex-col gap-3",children:[(0,l.jsx)(eb,{title:C("Custom instruction"),description:C("Customize the style of model response"),onInfoClick:()=>F("customInstruction")}),(0,l.jsxs)("div",{className:"overflow-hidden rounded-xl border border-white/10",children:[(0,l.jsx)(em,{className:"scrollbar-emochi !h-[92px] !min-h-[92px] resize-none !rounded-none !border-0 !bg-transparent !px-4 !pt-3 !pb-0 text-[16px] leading-6",style:{color:g.Theme.web.text.primary},placeholder:C("Prompt text"),value:m,_placeholder:{color:g.Theme.subTitleColor3},_focusVisible:{outline:"none",borderColor:"transparent",boxShadow:"none"},onChange:e=>{v(e.target.value)},maxLength:y||void 0}),T&&(0,l.jsx)("div",{className:"flex h-7 items-center justify-start px-4 pb-3",children:(0,l.jsx)(N,{userVipLevel:w,currentLength:m.length,maxLength:y,isOverLimit:m.length>y})})]})]})]})}),(0,l.jsxs)(L.Dialog.Footer,{padding:0,margin:0,className:"!m-0 flex shrink-0 items-center justify-end gap-3 border-t !px-6 !py-6",style:{borderColor:g.Theme.lineColorLight,borderTopWidth:"0.5px"},children:[(0,l.jsx)("button",{type:"button",onClick:a,className:"flex h-10 min-w-[80px] items-center justify-center rounded-full px-4",style:{borderWidth:1.5,borderStyle:"solid",borderColor:g.Theme.buttonBorderColor2},children:(0,l.jsx)(r.Text,{className:"text-[14px] font-semibold leading-5 text-white",children:C("Cancel")})}),(0,l.jsxs)("button",{type:"button",onClick:()=>o(m,u,x),className:"flex h-10 min-w-[80px] items-center justify-center gap-1 rounded-full bg-[#FEFC00] px-4",children:[j&&(0,l.jsx)(ep.EmochiProIcon,{width:20,height:20,color:"#010101",className:"shrink-0"}),(0,l.jsx)(r.Text,{className:"text-[14px] font-semibold leading-5 text-[#010101]",children:C("Confirm & Chat")})]})]}),S&&(0,l.jsx)(ev,{content:M[S],acknowledgeLabel:C("I Know"),onClose:()=>F(null)})]})})]})})};var ew=e.i(228607),ej=e.i(498749),eC=e.i(643525);let eN=(e,t,l)=>Math.max(t,Math.min(l,e));function eS(e){let{value:t,points:r,unlockAll:n=!1,step:i,onChange:a,rightAdornment:o,onLockedInteract:d}
2=e,c=(0,s.useRef)(null),[u,x]=(0,s.useState)(!1),m=(0,s.useMemo)(()=>n?r:r.filter(e=>!e.locked),[r,n]),h=r[0].value,p=r[r.length-1].value,g=m[m.length-1].value,f=(g-h)/100||1,b=i??f,v=!n&&r.some(e=>e.locked),y=(0,s.useCallback)(e=>r.length<=1?0:e/(r.length-1),[r.length]),w=(0,s.useCallback)(e=>{if(e<=h)return 0;if(e>=p)return 1;let t=r.findIndex(t=>t.value>=e);if(t<=0)return 0;let l=r[t-1],s=Math.max(r[t].value-l.value,1e-6),n=eN((e-l.value)/s,0,1);return y(t-1)+n*(y(t)-y(t-1))},[p,h,y,r]),j=(0,s.useCallback)(e=>{let t=eN(e,0,1)*(r.length-1),l=Math.floor(t),s=Math.min(Math.ceil(t),r.length-1),n=r[l],i=r[s];return n.value+(i.value-n.value)*(t-l)},[r]),C=(0,s.useCallback)(e=>{let t=Math.round((eN(e,h,g)-h)/b)*b+h;return eN(t,h,g)},[h,g,b]),N=(0,s.useCallback)(e=>{let t=c.current;if(!t)return null;let{left:l,width:r}=t.getBoundingClientRect(),s=r-40;return s<=0?null:eN((e-l-20)/s,0,1)},[]),S=(0,s.useCallback)(e=>a?.(C(j(e))),[a,j,C]),F=(0,s.useCallback)(e=>v&&j(e)>g+1e-6,[v,j,g]),M=e=>{u&&(e.currentTarget.releasePointerCapture(e.pointerId),x(!1))},T={left:`calc(20px + ${w(eN(t,h,g))} * (100% - 40px))`,transform:`translateX(-${u?4:2}px)`,width:u?8:4};return(0,l.jsxs)("div",{className:"w-full",children:[(0,l.jsxs)("div",{className:"relative flex items-center rounded-md border border-white/[0.03] bg-[#111]",style:{height:28},children:[(0,l.jsxs)("div",{ref:c,role:"slider","aria-valuemin":h,"aria-valuemax":p,"aria-valuenow":t,tabIndex:0,onPointerDown:e=>{let t=N(e.clientX);if(null!==t){if(F(t))return void d?.();e.currentTarget.setPointerCapture(e.pointerId),x(!0),S(t)}},onPointerMove:e=>{if(!u)return;let t=N(e.clientX);null!==t&&S(t)},onPointerUp:M,onPointerCancel:M,className:"relative h-full flex-1 cursor-pointer touch-none",style:{paddingInline:20},children:[v?(0,l.jsx)("div",{className:"pointer-events-none absolute top-0 bottom-0 rounded-r-md bg-[#FEFC00]/[0.06]",style:{left:`calc(20px + ${w(g)} * (100% - 40px))`,right:0}}):null,(0,l.jsx)("div",{className:"pointer-events-none absolute top-1/2 -translate-y-1/2",style:{left:20,right:20,height:4},children:r.map((e,t)=>{let r=!!e.locked&&!n,s=1===t;return(0,l.jsx)("button",{type:"button","aria-label":e.label,"aria-disabled":r,onClick:t=>{t.stopPropagation(),r?d?.():a?.(e.value)},className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${100*y(t)}%`,width:4,height:4,backgroundColor:s?"#FFFFFF":"#5C5C5C",opacity:r?.3:.4,pointerEvents:r?"none":"auto"}},`tick-${e.key}`)})}),(0,l.jsx)("div",{className:"pointer-events-none absolute rounded-[2px] bg-[#FEFC00] transition-[width,transform] duration-100",style:{...T,top:-2,bottom:-2}}),(0,l.jsx)("div",{className:"pointer-events-none absolute left-0 right-0 h-3",style:{top:"calc(100% + 4px)"},children:(0,l.jsx)("div",{className:"relative h-full",style:{marginLeft:20,marginRight:20},children:r.map((e,t)=>(0,l.jsx)("span",{className:"absolute top-0 -translate-x-1/2 whitespace-nowrap text-center text-[10px] leading-3 text-white/40",style:{left:`${100*y(t)}%`},children:e.label},`label-${e.key}`))})})]}),o?(0,l.jsx)("div",{className:"flex shrink-0 items-center pr-1.5",children:o}):null]}),(0,l.jsx)("div",{className:"h-3 w-full","aria-hidden":!0})]})}let eF=(e,t,l)=>{let r=(e??[]).filter(e=>e.enabled);if(r.length<2)return null;let s=r.map((e,t)=>({key:e.key,label:((e,t)=>{switch(e){case"short":return t("Short");case"medium":return t("Medium");case"long":return t("Long");case"extended":return t("Extended");case"rational":return t("Stable");case"balanced":return t("Balanced");case"creative":return t("Creative");case"wild":return t("Wild");default:return e.charAt(0).toUpperCase()+e.slice(1)}})(e.key,l),value:e.value,locked:t===r.length-1}));return{default:(r.find(e=>e.key===t)??r[0]).value,points:s}},eM=()=>{try{let e=(0,u.storageWithUserId)().getString(x.StorageKey.CHAT_MODEL_SETTINGS),t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}},eT=(e,t)=>e.reduce((e,l)=>Math.abs(l.value-t)<Math.abs(e.value-t)?l:e),ek={contentStyle:{padding:0,paddingBottom:0,backgroundColor:"transparent"},props:{uniqueId:"MODEL_SLIDER_SETTINGS_MODAL"}},eE=e=>{let{onClick:t}=e;return(0,l.jsx)("button",{type:"button","aria-label":"info",onClick:t,className:"grid h-4 w-4 place-items-center rounded-full border border-white/15 text-[10px] font-medium leading-none text-white/35 shadow-[0_0.667px_0.667px_0_rgba(0,0,0,0.12)]",children:"?"})},eL=()=>(0,l.jsxs)("div",{className:"flex h-5 items-center gap-1 rounded-full bg-[#FEFC0014] px-2",children:[(0,l.jsx)(ep.EmochiProIcon,{width:12,height:12}),(0,l.jsx)("span",{className:"text-[10px] font-bold leading-3 text-[#FEFC00]",children:"MAX"})]}),eA=e=>
2{let{title:t,description:r,onInfoClick:s,children:n}=e;return(0,l.jsxs)("section",{className:"flex flex-col rounded-2xl bg-white/[0.03] p-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)("h3",{className:"text-[16px] font-semibold leading-6 text-white",children:t}),(0,l.jsx)(eE,{onClick:s})]}),(0,l.jsx)("p",{className:"mt-1 text-[14px] leading-5 text-white/60",children:r}),(0,l.jsx)("div",{className:"mt-3",children:n})]})},eI=e=>{let{modelInfo:t}=e,{t:r}=(0,i.useLanguageContext)(),{isDesktop:a}=(0,E.useDesktop)(),o=(0,M.useWallet)(M.selectUserLevel),m=o===j.UserVipLevel.MAX,h=j.USER_INSTRUCTION_LENGTH[o]??0,p=(0,j.isSupportEditModelMoreSettingWithUserLevel)(o),g=(0,s.useMemo)(()=>eF(t.settingsConfig?.replyLengthOptions,"medium",r),[t.settingsConfig?.replyLengthOptions,r]),f=(0,s.useMemo)(()=>eF(t.settingsConfig?.temperatureOptions,"balanced",r),[t.settingsConfig?.temperatureOptions,r]),b=(0,s.useMemo)(()=>{let e=eM().find(e=>e.model===t.name),l=p&&e?.modelPersona?h>0?e.modelPersona.slice(0,h):e.modelPersona:"";return{replyLength:(p?e?.customReplyLength:void 0)??g?.default??0,creativity:(p?e?.customTemperature:void 0)??f?.default??0,persona:l}},[t.name,p,h]),[v,y]=(0,s.useState)(b.replyLength),[w,C]=(0,s.useState)(b.creativity),[N,A]=(0,s.useState)(b.persona),[I,P]=(0,s.useState)(null),[R,B]=(0,s.useState)(!1),D=(0,d.useEvent)(()=>{e.close?.(),e.closeModal?.(),eC.modalApi.dismiss()}),_=(0,d.useEvent)(()=>{D(),(0,ew.openSubscribePricingModal)({plan:"ultra",source:F.SUBSCRIBE_SOURCE.CHAT_FAST_MODEL})}),O=(0,d.useEvent)(async function(l){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w,i=arguments.length>3?arguments[3]:void 0;if(!p)return _();let a=h>0?l.slice(0,h):l;try{var d,m;let l,h=await c.api.wallet.updateModelSetting.request({body:{model:t.name,customReplyLength:Math.round(s),customTemperature:n,modelPersona:a}}),p=Array.isArray(h)?h:(d=eM(),m={model:t.name,customReplyLength:Math.round(s),customTemperature:n,modelPersona:a},l=d.findIndex(e=>e.model===m.model),-1===l?[...d,m]:d.map((e,t)=>t===l?{...e,...m}:e));y(s),C(n),A(a),(0,u.storageWithUserId)().set(x.StorageKey.CHAT_MODEL_SETTINGS,JSON.stringify(p)),(0,ej.getClientQueryClient)().setQueriesData({predicate:e=>e.queryKey.some(e=>"string"==typeof e&&"modelSettings"===e)&&e.queryKey.some(e=>"string"==typeof e&&"wallet"===e)},p),(0,k.recordEvent)("model_config_confirm",{model_name:t.name,membership:o,response_length:g?eT(g.points,s).key:"",creativity:f?eT(f.points,n).key:"",custom_instruction:a,result:"success"}),(0,T.showGlobalToast)(r("Setting success")),i?.(),"chat"===e.from&&e.onConfirm?.(t),D()}catch{(0,k.recordEvent)("model_config_confirm",{model_name:t.name,membership:o,result:"fail"})}}),U=(0,d.useEvent)(()=>{if(!p)return _();g&&f&&S.FlowAlert.alert(r("Reset the following options to default"),r("Confirm"),{leftButtonText:r("Cancel"),onConfirmClick:()=>O("",g.default,f.default,()=>(0,T.showGlobalToast)(r("Restored to default settings.")))})}),V=(0,d.useEvent)(()=>{if((0,k.recordEvent)("modle_setting_custom_insruction_click",{model_name:t.name,member_ship:o}),!p)return _();B(!0)}),W=!!g&&!!f;if((0,s.useEffect)(()=>{W||D()},[W,D]),!g||!f)return null;let H=(0,l.jsxs)("div",{className:a?"relative flex w-[540px] max-w-[calc(100vw-32px)] flex-col gap-4 overflow-hidden rounded-[24px] bg-bgColor2 p-6":"relative flex flex-col gap-4 roun
2ded-t-[24px] bg-bgColor2 p-5 pb-6",children:[(0,l.jsxs)("header",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h2",{className:"text-[18px] font-extrabold leading-6 text-white",children:`${t.title} ${r("settings")}`}),!m&&(0,l.jsx)(ep.EmochiProIcon,{width:20,height:20})]}),(0,l.jsx)("button",{type:"button",onClick:U,"aria-label":r("Reset"),className:"grid h-6 w-6 place-items-center",children:(0,l.jsx)(n.FlIconModelReset,{size:24,fill:"#fff"})})]}),(0,l.jsx)(eA,{title:r("Response Length"),description:r("Control how short or long replies are"),onInfoClick:()=>P("responseLength"),children:(0,l.jsx)(eS,{value:v,points:g.points,unlockAll:m,step:1,onChange:y,onLockedInteract:_,rightAdornment:m?null:(0,l.jsx)(eL,{})})}),(0,l.jsx)(eA,{title:r("Creativity"),description:r("Balance between stable and creative"),onInfoClick:()=>P("creativity"),children:(0,l.jsx)(eS,{value:w,points:f.points,unlockAll:m,onChange:C,onLockedInteract:_,rightAdornment:m?null:(0,l.jsx)(eL,{})})}),(0,l.jsxs)("div",{role:"button",tabIndex:0,onClick:V,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),V())},className:"flex cursor-pointer items-center rounded-2xl bg-white/[0.03] p-4 text-left",children:[(0,l.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)("span",{className:"text-[16px] font-semibold leading-6 text-white",children:r("Custom instruction")}),(0,l.jsx)(eE,{onClick:e=>{e.stopPropagation(),P("customInstruction")}})]}),(0,l.jsx)("span",{className:"mt-0.5 text-[14px] leading-5 text-white/60",children:r("Customize the style of model responses.")})]}),(0,l.jsx)(n.FlIconEdit,{size:24,fill:"#fff"})]}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)("button",{type:"button",onClick:D,className:"h-12 min-w-[96px] rounded-full border border-white/10 px-6 text-[16px] font-semibold leading-6 text-white",children:r("Cancel")}),(0,l.jsxs)("button",{type:"button",onClick:()=>O(N),className:"flex h-12 flex-1 items-center justify-center gap-1 rounded-full bg-[#FEFC00] px-6",children:[!m&&(0,l.jsx)(ep.EmochiProIcon,{width:20,height:20,color:"#010101"}),(0,l.jsx)("span",{className:"text-[16px] font-semibold leading-6 text-[#010101]",children:"settings"===e.from?r("Confirm"):r("Confirm & Chat")})]})]}),I&&(0,l.jsx)(eB,{sectionKey:I,onClose:()=>P(null)}),R&&(0,l.jsx)(eP,{initialValue:N,maxLength:h,userVipLevel:o,onCancel:()=>B(!1),onSave:e=>{A(e),B(!1)}})]});return a?(0,l.jsx)(L.Dialog.Root,{lazyMount:!0,open:!0,placement:"center",closeOnInteractOutside:!1,onOpenChange:()=>D(),children:(0,l.jsxs)(eh.Portal,{children:[(0,l.jsx)(L.Dialog.Backdrop,{
2className:"bg-black/60"}),(0,l.jsx)(L.Dialog.Positioner,{children:(0,l.jsx)(L.Dialog.Content,{className:"!flex !flex-col !p-0",style:{backgroundColor:"transparent",boxShadow:"none"},children:H})})]})}):H},eP=e=>{let{initialValue:t,maxLength:r,userVipLevel:a,onCancel:o,onSave:d}=e,{t:c}=(0,i.useLanguageContext)(),[u,x]=(0,s.useState)(t),m=r>0,h=m&&u.length>r,p=()=>{if(u===t)return o();S.FlowAlert.alert(c("Leave without submitting?Your content will not be saved.Are you sure?"),c("Submit"),{leftButtonText:c("Sure"),onConfirmClick:()=>d(u),onCancelClick:o})};return(0,l.jsxs)("div",{className:"absolute inset-0 z-30 flex flex-col rounded-[24px] bg-bgColor2 p-6",role:"dialog","aria-label":c("Custom instruction"),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"text-[18px] font-semibold leading-6 text-white",children:c("Custom instruction")}),(0,l.jsx)("button",{type:"button",onClick:p,"aria-label":c("Cancel"),className:"grid h-8 w-8 place-items-center text-white/60",children:(0,l.jsx)(n.FlNavbarIconClose,{size:20,fill:"currentColor"})})]}),(0,l.jsx)("textarea",{autoFocus:!0,value:u,maxLength:m?r:void 0,onChange:e=>x(e.target.value),placeholder:c("Your instructions will guide every response. Overly complex instructions may reduce response quality."),className:"mt-4 min-h-[200px] flex-1 resize-none rounded-2xl border border-white/10 bg-transparent p-4 text-[15px] leading-[22px] text-white placeholder:text-white/40 focus:border-white/30 focus:outline-none"}),(0,l.jsx)("div",{className:"mt-2 flex items-center justify-between gap-3 pt-2",children:m&&(0,l.jsx)(N,{userVipLevel:a,currentLength:u.length,maxLength:r,isOverLimit:h})}),(0,l.jsxs)("div",{className:"mt-4 flex gap-3",children:[(0,l.jsx)("button",{type:"button",onClick:p,className:"h-12 flex-1 rounded-full border border-white/10 text-[16px] font-semibold leading-6 text-white",children:c("Cancel")}),(0,l.jsx)("button",{type:"button",onClick:()=>d(u),disabled:h,className:"h-12 flex-1 rounded-full bg-[#FEFC00] text-[16px] font-semibold leading-6 text-[#010101] disabled:opacity-50",children:c("Save")})]})]})},eR={responseLength:{title:e=>e("Response Length"),body:e=>e("Slide left for shorter, more concise replies; slide right for longer, more detailed replies. The MAX stop is exclusive to MAX members.")},creativity:{title:e=>e("Creativity"),body:e=>e("Stable keeps the bot consistent; Creative encourages plot twists and surprises. Wild is exclusive to MAX members.")},customInstruction:{title:e=>e("Custom Instruction"),body:e=>e("Define the bot’s overall talking style and personality. Limits scale with your subscription.")}},eB=e=>{let{sectionKey:t,onClose:r}=e,{t:s}=(0,i.useLanguageContext)(),a=eR[t];return(0,l.jsxs)("div",{className:"absolute inset-0 z-40 flex flex-col rounded-[24px] bg-bgColor2 p-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"text-[18px] font-semibold leading-6 text-white",children:a.title(s)}),(0,l.jsx)("button",{type:"button",onClick:r,"aria-label":s("Cancel"),className:"grid h-8 w-8 place-items-center text-white/60",children:(0,l.jsx)(n.FlNavbarIconClose,{size:20,fill:"currentColor"})})]}),(0,l.jsx)("p",{className:"mt-4 flex-1 overflow-y-auto text-[14px] leading-5 text-white/80",children:a.body(s)}),(0,l.jsx)("button",{type:"button",onClick:r,className:"mt-4 h-12 w-full rounded-full border border-white/10 text-[16px] font-semibold leading-6 text-white",children:s("I Know")})]})},eD=e=>{let{modelName:t,defaultReplyLength:l,defaultTemperature:r}=e;try{let e=(0,u.storageWithUserId)().getString(x.StorageKey.CHAT_MODEL_SETTINGS);if(!e)return{replyLength:l,temperature:r,modelPersona:""};let s=JSON.parse(e).find(e=>e.model===t);return{replyLength:s?.replyLength??l,temperature:s?.temperature??r,modelPersona:s?.modelPersona??""}}catch{return{replyLength:l,temperature:r,modelPersona:""}}}
2,e_="MODEL_MORE_SETTING_MODAL",eO=e=>{let{onClick:t}=e;return(0,l.jsx)("button",{type:"button","aria-label":"info",className:"flex h-4 w-4 items-center justify-center rounded-full border border-white/15",style:{boxShadow:"0 0.667px 0.667px 0 rgba(0, 0, 0, 0.12)"},onClick:t,children:(0,l.jsx)("span",{className:"text-[10px] font-medium leading-none text-white/35",children:"?"})})},eU=e=>{let{title:t,blocks:s,onClose:n,bottomHeight:i,acknowledgeText:a}=e;return(0,l.jsx)("div",{className:"absolute inset-0 z-20 flex items-end bg-black/80",children:(0,l.jsx)("div",{className:"w-full rounded-t-[24px] p-4 pb-3",style:{paddingBottom:Math.max(i,12),backgroundColor:g.Theme.web.bg.primary},children:(0,l.jsxs)("div",{className:"flex h-[564px] max-h-[70vh] flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-12",children:[(0,l.jsx)(r.Text,{className:"min-w-0 flex-1 text-[18px] font-semibold leading-6 text-white",children:t}),(0,l.jsx)("button",{type:"button",onClick:n,className:"flex h-8 w-8 items-center justify-center text-white/60","aria-label":"close",children:(0,l.jsx)("span",{className:"text-[28px] leading-none",children:"×"})})]}),(0,l.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:(0,l.jsx)("div",{className:"flex flex-col gap-4",children:s.map((e,t)=>"paragraph"===e.type?(0,l.jsx)(r.Text,{className:"text-[12px] font-normal leading-4 text-white/60",children:e.text},`paragraph-${t}`):"labeled"===e.type?(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(r.Text,{className:"text-[14px] font-semibold leading-5 text-white",children:e.label}),(0,l.jsx)(r.Text,{className:"text-[12px] font-normal leading-4 text-white/60",children:e.text})]},`labeled-${t}`):(0,l.jsxs)("div",{className:"flex flex-col",children:[e.label&&(0,l.jsx)(r.Text,{className:"mb-1 text-[12px] font-normal leading-4 text-white/60",children:e.label}),(0,l.jsx)("ol",{className:"list-decimal pl-[18px] text-[12px] font-normal leading-4 text-white",children:e.items.map((e,r)=>(0,l.jsx)("li",{children:e},`ordered-${t}-${r}`))})]},`ordered-${t}`))})}),(0,l.jsx)("button",{type:"button",onClick:n,className:"flex h-12 w-full items-center justify-center rounded-full border border-white/10 px-6",children:(0,l.jsx)(r.Text,{className:"text-[16px] font-semibold leading-6 text-white",children:a})})]})})})},eV=e=>{let{t}=(0,i.useLanguageContext)(),a=(0,s.useMemo)(()=>[{name:"SHORT",text:t("Short")},{name:"MEDIUM",text:t("Medium")},{name:"LONG",text:t("Long")}],[t]),m=(0,s.useMemo)(()=>[{name:"RATIONAL",text:t("Rational")},{name:"BALANCED",text:t("Balanced")},{name:"CREATIVE",text:t("Creative")}],[t]),h=(0,o.useSafeAreaBottomHeight)()||12,{isDesktop:p}=(0,E.useDesktop)(),g=(0,o.useSafePageHeight)(),f=(0,M.useWallet)(M.selectUserLevel),b=f===j.UserVipLevel.FREE||f===j.UserVipLevel.LITE,v=(0,j.isSupportEditModelMoreSettingWithUserLevel)(f),w=j.USER_INSTRUCTION_LENGTH[f]??0,C=e.modelInfo.replyLength??"MEDIUM",L=e.modelInfo.temperature??"BALANCED",A=e=>w>0?e.slice(0,w):e,I=eD({modelName:e.modelInfo.name,defaultReplyLength:C,defaultTemperature:L}),P=(0,s.useRef)(""),[R,B]=(0,s.useState)(!0),[D,_]=(0,s.useState)(I.replyLength),[O,U]=(0,s.useState)(I.temperature),[V,W]=(0,s.useState)(I.modelPersona),[H,z]=(0,s.useState)(!1),$=(0,s.useMemo)(()=>a.findIndex(e=>e.name===D),[D,a]),G=(0,s.useMemo)(()=>m.findIndex(e=>e.name===O),[O,m]),[q,K]=(0,s.useState)(null),Y=Math.max($,0),X=Math.max(G,0),[J,Q]=(0,s.useState)(!1);(0,s.useLayoutEffect)(()=>{Q(!1);let t=eD({modelName:e.modelInfo.name,defaultReplyLength:C,defaultTemperature:L}),l=w>0?t.modelPersona.slice(0,w):t.modelPersona;_(t.replyLength),U(t.temperature),W(l),P.current=l;let r=requestAnimationFrame(()=>{Q(!0)});return()=>{cancelAnimationFrame(r)}},[e.modelInfo.name,C,L,w]);let Z=(0,d.useEvent)(()=>{B(!1),e.close?.(),eC.modalApi.dismiss(),(0,ew.openSubscribePricingModal)({plan:"ultra",source:F.SUBSCRIBE_SOURCE.CHAT_FAST_MODEL})}),ee=(0,d.useEvent)(()=>{B(!1),e.close?.()}),et=(0,d.useEvent)(async(t,l,r,s)=>{try{let n;if(!v)return void Z();let i=l??D,a=r??O,o=A(t),d=await c.api.wallet.updateModelSetting.request({body:{model:e.modelInfo.name,replyLength:i,temperature:a,modelPersona:o}}),m=Array.isArray(d)?d:(e=>{let{modelName:t,replyLength:l,temperature:r,modelPersona:s}=e,n=(()=>{try{let e=(0,u.storageWithUserId)().getString(x.StorageKey.CHAT_MODEL_SETTINGS);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}})(),i=n.findIndex(e=>e.model===t),a={...n[i]??{model:t},model:t,replyLength:l,temperature:r,modelPersona:s};return -1===i?[...n,a]:n.map((e,t)=>t===i?a:e)})({modelName:e.modelInfo.name,replyLength:i,temperature:a,modelPersona:o});_(i),U(a),W(o),P.current=o,n=(0,ej.getClientQueryClient)(),(0,u.storageWithUserId)().set(x.StorageKey.CHAT_MODEL_SETTINGS,JSON.stringify(m)),n.setQueriesData({predicate:e=>e.queryKey.some(e=>"string"==typeof e&&"modelSettings"===e)&&e.queryKey.some(e=>"string"==typeof e&&"wallet"===e)},m),p?ee():e.closeModal?.(),s?.(),"chat"===e.from&&e.onConfirm?.(e.modelInfo)}catch{}}),el=(0,d.useEvent)(e=>{W(A(e))}),er=(0,d.useEvent)(()=>{z(!1),V!==P.current&&S.FlowAlert.alert(t("Leave without submitting?Your content will not be saved.Are you sure?"),t("Submit"),{leftButtonText:t("Sure"),onConfirmClick:()=>{en(V)},onCancelClick:()=>{W(P.current)}})}),es=(0,d.useEvent)(()=>{((0,k.recordEvent)("modle_setting_custom_insruction_click",{model_name:e.modelInfo.name,member_ship:f}),v)?z(!0):Z()}),en=(0,d.useEvent)(e=>{P.current=A(e),z(!1)}),ei=(0,d.useEvent)(()=>{(p&&ee(),v)?S.FlowAlert.alert(t("Reset the following options to default"),t("Confirm"),{leftButtonText:t("Cancel"),onConfirmClick:()=>{_(C),U(L),W(""),et("",C,L,()=>{(0,T.showGlobalToast)(t("Restored to default settings."))})}}):Z()}),ea=(0,d.useEvent)(t=>{((0,k.recordEvent)("modle_setting_length_click",{model_name:e.modelInfo.name,reply_length:t,member_ship:f}),v)?_(t):Z()}),eo=(0,d.useEvent)(t=>{((0,k.recordEvent)("modle_setting_temperature_click",{model_name:e.modelInfo.name,temperature:t,member_ship:f}),v)?U(t):Z()}),ed=(0,d.useEvent)(()=>{V!==P.current?S.FlowAlert.alert(t("Leave without submitting?Your content will not be saved.Are you sure?"),t("Submit"),{leftButtonText:t("Sure"),onConfirmClick:()=>{et(V)},onCancelClick:()=>{e.closeModal?.()}}):e.closeModal?.()}),ec={responseLength:{title:t("Response Length"),blocks:[{type:"paragraph",text:t("This choose controls how long each Bot reply is.")},{type:"labeled",label:t("Short:"),text:t("Great for one-liners, banter, and command-style prompts--like your character dropping short lines in a chat.")},{type:"labeled",label:t("Medium:"),text:t("Best for regular scene dialogue--the. The character talks 
2in a few sentences each time, with some reactions and feelings.")},{type:"labeled",label:t("Long:"),text:t("Ideal for long scenes, inner monologues, and world-building--each reply feels like a mini story chapter.")},{type:"paragraph",text:t("Excessively long response lengths may shorten the bot's memory.")}]},creativity:{title:t("Creativity"),blocks:[{type:"paragraph",text:t("Choose between stable character behavior or wild plot twists.")},{type:"labeled",label:t("Stable:"),text:t("The character sticks closely to its setting--less out-of-character, more stable plots; good for the main story and long-term arcs.")},{type:"labeled",label:t("Balance:"),text:t("Balances character consistency with some surprises; great for everyday chatting and light role play.")},{type:"labeled",label:t("Creative:"),text:t("The character becomes more imaginative and dramatic--expect plot twists, iconic scenes, and unexpected turns; perfect for high-drama stories.")}]},customInstruction:{title:t("Custom Instruction"),blocks:[{type:"paragraph",text:t('Here you can define the bot\'s overall "talking style" and "personality."')},{type:"paragraph",text:t("For example: gentle and comforting, cool and tsundere, funny and sarcastic, serious mentor, sweet lover, etc.")},{type:"ordered",label:t("You can:"),items:[t("Choose whether it talks more casually or more formally;"),t("Decide if it should be more logical and calm, or more emotional and clingy;"),t("Let it use more emojis and dramatic expressions, or keep it simple and restrained.")]},{type:"paragraph",text:t("After you set this up, the model will try to stay in this style during the whole chat, making the experience more consistent and immersive.")}]}};return p?(0,l.jsx)(ey,{isOpen:R,onClose:ee,onConfirm:(e,t,l)=>et(e,t,l),onPressReset:ei,modelInfo:e.modelInfo,replyLengthType:D,currentTemperature:O,modelPersona:V,replyLengthDatas:a,temperatureDatas:m,setModelPersona:W,customInstructionLimit:w,userVipLevel:f,setReplyLengthType:_,setCurrentTemperature:U,showProIcon:b}):(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("div",{style:{opacity:+!H,height:H?g-h:"auto",paddingBottom:h},className:"rounded-t-[24px] bg-bgColor2 px-5 pt-5",children:[(0,l.jsxs)("div",{className:"mb-4 flex flex-row items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[(0,l.jsx)(r.Text,{className:"text-[18px] font-semibold leading-6 text-white",children:`${e.modelInfo.title} ${t("Settings")}`}),(0,l.jsx)(ep.EmochiProIcon,{})]}),(0,l.jsx)("button",{type:"button",onClick:ei,className:"flex h-6 w-6 items-center justify-center transition-opacity hover:opacity-80",children:(0,l.jsx)(n.FlIconModelReset,{size:24,fill:"#fff"})})]}),(0,l.jsxs)("div",{className:"mb-5 flex flex-col gap-3 rounded-2xl bg-bgColor3 p-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)(r.Text,{style:{lineHeight:"24px"},className:"text-[16px] font-semibold text-white",children:t("Response length")}),(0,l.jsx)(eO,{onClick:()=>K("responseLength")})]}),(0,l.jsx)(r.Text,{style:{lineHeight:"20px"},className:"text-[14px] font-normal text-[#FFFFFF99]",children:t("Control how short or long replies are")}),(0,l.jsx)("div",{className:"flex h-11 flex-row rounded-full bg-bgColor p-1",children:(0,l.jsxs)("div",{className:"relative flex w-full flex-row",children:[(0,l.jsx)("div",{className:"absolute h-9 rounded-full border border-[#FEFC00] bg-transparent",style:{width:"calc((100% - 8px) / 3)",left:`calc(${Y} * 100% / 3)`,transition:J?"left 200ms ease-in-out":"none"}}),a.map(e=>(0,l.jsx)("button",{type:"button",className:"flex flex-1 items-center justify-center transition-opacity hover:opacity-90",onClick:()=>{ea(e.name)},children:(0,l.jsx)(r.Text,{className:e.name===D?"h-9 text-center text-[14px] font-semibold leading-9 text-[#FEFC00]":"h-9 text-center text-[14px] font-normal leading-9 text-[#FFFFFF66]",children:e.text})},e.name))]})})]}),(0,l.jsxs)("div",{className:"mb-5 flex flex-col gap-3 rounded-2xl bg-bgColor3 p-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)(r.Text,{style:{lineHeight:"24px"},className:"text-[16px] font-semibold text-white",children:t("Creativity")}),(0,l.jsx)(eO,{onClick:()=>K("creativity")})]}),(0,l.jsx)(r.Text,{style:{lineHeight:"20px"},className:"text-[14px] font-normal text-[#FFFFFF99]",children:t("Balance between stable and creative")}),(0,l.jsx)("div",{className:"flex h-11 flex-row rounded-full bg-bgColor p-1",children:(0,l.jsxs)("div",{className:"relative flex w-full flex-row",children:[(0,l.jsx)("div",{className:"absolute h-9 rounded-full border border-[#FEFC00] bg-transparent",style:{width:"calc((100% - 8px) / 3)",left:`calc(${X} * 100% / 3)`,transition:J?"left 200ms ease-in-out":"none"}}),m.map(e=>(0,l.jsx)("button",{type:"button",className:"flex flex-1 items-center justify-center transition-opacity hover:opacity-90",onClick:()=>{eo(e.name)}
2,children:(0,l.jsx)(r.Text,{className:e.name===O?"h-9 text-center text-[14px] font-semibold leading-9 text-[#FEFC00]":"h-9 text-center text-[14px] font-normal leading-9 text-[#FFFFFF66]",children:e.text})},e.name))]})})]}),(0,l.jsxs)("div",{className:"mb-5 flex flex-row items-center rounded-2xl bg-bgColor3 p-4",children:[(0,l.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)(r.Text,{style:{lineHeight:"24px"},className:"text-[16px] font-semibold text-white",children:t("Custom Instruction")}),(0,l.jsx)(eO,{onClick:()=>K("customInstruction")})]}),(0,l.jsx)(r.Text,{style:{lineHeight:"20px"},className:"mt-0.5 text-[14px] font-normal text-[#FFFFFF99]",children:t("Customize the style of model responses.")})]}),(0,l.jsx)("button",{type:"button",onClick:es,className:"flex h-6 w-6 items-center justify-center transition-opacity hover:opacity-80",children:(0,l.jsx)(n.FlIconEdit,{size:24,fill:"#fff"})})]}),(0,l.jsxs)("div",{className:"flex flex-row gap-3 pb-2",children:[(0,l.jsx)("button",{type:"button",onClick:ed,className:"flex h-12 items-center justify-center rounded-full border border-white/10 bg-transparent px-6",style:{..."settings"===e.from?{flex:1}:{minWidth:96}},children:(0,l.jsx)(r.Text,{className:"text-[16px] font-semibold leading-6 text-white",children:t("Cancel")})}),(0,l.jsxs)("button",{type:"button",onClick:()=>et(V),className:"flex h-12 flex-1 items-center justify-center gap-1 rounded-full bg-[#FEFC00] px-6",children:[b&&(0,l.jsx)(ep.EmochiProIcon,{width:20,height:20,color:"#010101",className:"shrink-0"}),(0,l.jsx)(r.Text,{className:"text-[16px] font-semibold leading-6 text-[#010101]",children:"settings"===e.from?t("Confirm"):t("Confirm & Chat")})]})]})]}),q&&(0,l.jsx)(eU,{title:ec[q].title,blocks:ec[q].blocks,onClose:()=>K(null),bottomHeight:h,acknowledgeText:t("I Know")}),H&&(0,l.jsx)("div",{className:"absolute inset-0 flex items-end justify-center bg-black/80",onClick:er,children:(0,l.jsx)("div",{className:"w-full max-w-full px-3",onClick:e=>e.stopPropagation(),children:(0,l.jsx)(y,{hideAsterisk:!0,isStick:!1,value:V,placeholder:t("Your instructions will guide every response. Overly complex instructions may reduce response quality."),onSend:en,onTextChange:el,onClosePress:er,maxLength:w,renderLimit:e=>{let{currentLength:t,maxLength:r,isOverLimit:s}=e;return(0,l.jsx)(N,{userVipLevel:f,currentLength:t,maxLength:r,isOverLimit:s})},disableLinearGradient:!0,style:{borderRadius:24},inputStyle:{height:308,maxHeight:308,color:"white",fontSize:15,lineHeight:"22px",fontWeight:400},hideCloseIcon:!1,limitTextStyle:{color:"red"}})})})]})};e.s(["showModelMoreSetting",0,e=>{if("t1"===e.countryTier){var t;return void(t={modelInfo:e.modelInfo,from:e.from,onConfirm:e.onConfirm,closeModal:e.closeModal,promptId:e.promptId},(window.innerWidth>1023?a.showFlowModal:a.showFlowBottomModalWithAnimation)(eI,{...t,...ek}))}window.innerWidth>1023?(0,a.showFlowModal)(eV,{...e,contentStyle:{padding:0,paddingBottom:0,backgroundColor:"transparent"},props:{uniqueId:e_}}):(0,a.showFlowBottomModalWithAnimation)(eV,{...e,contentStyle:{padding:0,paddingBottom:0,backgroundColor:"transparent"},props:{uniqueId:e_}})}],758664)},760478,431282,e=>{"use strict";e.i(215605),e.i(510137),e.i(138538);var t=e.i(672347),l=e.i(493206),r=e.i(313420),s=e.i(878913);let n=e=>"string"==typeof e?e:e&&"object"==typeof e&&"uri"in e?e.uri??"":"";function i(e,t,l){let s=l?.find(t=>t.name===e),i=s?n(s.assets?.iconGrey)||n(s.assets?.iconSmall)||n(s.assets?.icon):"";if(i)return i;let a=n(t[e]);return a||n(r.SmallModelIcon[e])}e.s(["resolveSelectedModelIconSrc",0,i,"useSelectedModelIconSrc",0,function(e){let r=(0,s.useSelectedChatModel)(e),{modelGreyIcon:n,remoteModelsV2:a}=(0,l.useModelsConfig)();return(0,t.useMemo)(()=>i(r.name,n,a),[r.name,n,a])}],431282),e.i(120208),e.i(391394),e.i(263387),e.s([],760478)},215605,655102,263387,138538,326432,419031,510137,e=>{"use strict";var t=e.i(528139),l=e.i(14324),r=e.i(672347),s=e.i(146145);e.i(208419);var n=e.i(116972),i=e.i(823416),a=e.i(590803),o=e.i(334863),d=e.i(390341),c=e.i(92339),u=e.i(814614),x=e.i(77031),m=e.i(136975),h=e.i(893806),p=e.i(160147),g=e.i(749966);e.i(473575);var f=e.i(730304),b=e.i(758664),v=e.i(901629),y=e.i(417420),w=e.i(211601),j=e.i(925247),C=e.i(768639),N=e.i(850883),S=e.i(388070),F=e.i(228607),M=e.i(120208),T=e.i(878913);let k=["free","premium","flagship","will-be-discontinued"],E=["premium","free","flagship","will-be-discontinued"],L=["premium","flagship","free","will-be-discontinued"],A=["flagship","premium","free","will-be-discontinued"],I=["free","premium","flagship","will-be-discontinued"];var P=e.i(409945),R=e.i(391394);let B=new Set(["flagship"]);e.s(["isHighTierModel",0,function(e){var t;if(!e)return!1;let{models:l}
2=(0,R.getModelsSettingsSnapshot)();return!!(t=l.find(t=>t.name===e)?.display?.chatSelector?.groupId)&&B.has(t.toLowerCase())}],655102),e.s([],263387),e.i(365010);var D=e.i(270060),_=e.i(724302),O=e.i(635861);let U=new Set;function V(e){let{promptId:t,source:l,onAfterSelect:P,onBeforeBlockNavigate:R,redirectAfterSubscribe:B}=e,V=(0,s.usePathname)(),W=(0,u.useWallet)(u.selectUserLevel),{status:H}=(0,p.useAuth)(),z=H===g.AuthStatus.AUTHENTICATED,{recordEvent:$}=(0,h.useRecordEvent)(),{t:G}=(0,O.useLanguageContext)(),q=(0,T.useSelectedChatModelName)(t),{serverDefaultSections:K,iconSrcByName:Y}=(0,M.useModelsSettings)(),{data:X}=(0,C.useSubscriptionProducts)(),J=(0,r.useMemo)(()=>(0,j.deriveCountryTierFromProducts)(X),[X]),{endTime:Q,isFreeExpired:Z,remainingTries:ee,grantModelRemainingTries:et,experiment:el}=(0,d.useShowFreeModel)({promptId:t}),er=(0,r.useMemo)(()=>(!!S.isWeb||"test"===el)&&!Z()&&ee>0,[el,Z,ee]),es=4===W&&w.liteQuota.get()&&et<=0,en=(0,r.useMemo)(()=>{let e,t,l;return t=new Map((e=function(e){let{vipLevel:t,isFreeChat10Trial:l,liteQuotaExhausted:r}=e;return t===u.UserVipLevel.MAX?A:t===u.UserVipLevel.LITE?r?I:L:t===u.UserVipLevel.PLUS||t===u.UserVipLevel.ULTRA?L:l?E:k}({vipLevel:W,isFreeChat10Trial:0===W&&er,liteQuotaExhausted:es})).map((e,t)=>[e,t])),l=e.length,K.map((e,r)=>({section:e,rank:t.get(e.groupId??"")??l,original:r})).sort((e,t)=>e.rank-t.rank||e.original-t.original).map(e=>{let{section:t}=e;return t})},[K,W,er,es]),{isSuperBot:ei}=(0,D.useIsSuperBot)(t),ea=(0,r.useMemo)(()=>{if(!ei)return U;let e=(0,_.getBestMatchModelNames)(t);return e.length?new Set(e):U},[ei,t,en]),eo=(0,r.useMemo)(()=>(function(e){let{tier:t,vipLevel:l,liteQuotaExhausted:r}=e;return"t3"===t?l===u.UserVipLevel.FREE?[{target:"premium",plan:"lite",requiredVipLevel:4}]:l===u.UserVipLevel.LITE&&r?[{target:"premium",plan:"plus",requiredVipLevel:1}]:[]:"t2"===t?l===u.UserVipLevel.FREE?[{target:"premium",plan:"plus",requiredVipLevel:1}]:[]:l===u.UserVipLevel.FREE?[{target:"premium",plan:"plus",requiredVipLevel:1},{target:"flagship",plan:"max",requiredVipLevel:3}]:l===u.UserVipLevel.PLUS||l===u.UserVipLevel.ULTRA?[{target:"flagship",plan:"max",requiredVipLevel:3}]:[]})({tier:J,vipLevel:W,liteQuotaExhausted:es}).reduce((e,t)=>(e[t.target]=t,e),{}),[es,W,J]),{handleSelectModel:ed,openSubscribeModal:ec,openBuyMochiModal:eu}=(0,c.useModelSwitch)({promptId:t,source:"chat_fast_model",redirectAfterSubscribe:B??V??void 0,onBeforeBlock:(e,t)=>(R?.(),queueMicrotask(()=>{"subscribe"===e?ec({requiredVipLevel:t}):0===W||4===W?ec():eu()}),!0)}),[ex,em]=(0,r.useState)(!1),eh=(0,n.useEvent)(()=>em(!0)),ep=(0,n.useEvent)(()=>em(!1)),[eg,ef]=(0,r.useState)(!1),eb=(0,n.useEvent)(()=>ef(e=>!e)),ev=(0,r.useRef)(!1),ey=Object.keys(eo).length>0;(0,r.useEffect)(()=>{!ev.current&&(ev.current=!0,$(m.ANALYTICS_EVENT_NAME.MODEL_SETTING_OPEN,{...l&&{source:l}}),ey&&$(m.ANALYTICS_EVENT_NAME.CHAT_MODAL_SETTING_SUBCRIPTION_IMPRESSION,{}))},[ey,$,l]);let{data:ew}=i.api.wallet.modelSettings.useQuery(void 0,{enabled:z,staleTime:12e4});(0,r.useEffect)(()=>{ew&&(0,v.storageWithUserId)().set(y.StorageKey.CHAT_MODEL_SETTINGS,JSON.stringify(ew))},[ew]);let ej=(0,n.useEvent)(e=>{a.default.getModel(t).name===e.name||((0,x.dismissModelNewBadge)(e),a.default.change(t,e),(0,o.showGlobalToast)(G("Switched to {{model}} Model",{model:e.title}))),P?.()}),eC=(0,n.useEvent)(e=>{ed(e)||ej(e)}),eN=(0,n.useEvent)((e,l)=>z?((0,b.showModelMoreSetting)({modelInfo:e,from:"chat",promptId:t,countryTier:J,closeModal:l?.onDismiss,onConfirm:e=>{ed(e)||ej(e)}}),!0):((0,f.showSigninModal)({source:"model_settings_click"}),!1)),eS=(0,n.useEvent)(e=>{R?.(),em(!1),(0,F.openSubscribePricingModal)({plan:e.plan,source:N.SUBSCRIBE_SOURCE.CHAT_MODAL_SETTING_SUBCRIPTION})}),eF=(0,n.useEvent)(()=>{R?.(),em(!1),ec({requiredVipLevel:W>0?2:1})});return{vipLevel:W,countryTier:J,selectedModelName:q,displaySections:en,guideByGroup:eo,iconSrcByName:Y,bestMatchModelNames:ea,trial:{isTrial:er,endTime:Q,remainingTries:ee,grantModelRemainingTries:et},isDiscontinuedExpanded:eg,toggleDiscontinued:eb,releaseNotes:{isOpen:ex,open:eh,close:ep},handleSelectModel:eC,handleOpenMoreSettings:eN,handleSubscribeGuideClick:eS,handleSubscribeFromReleaseNotes:eF}}e.s(["useModelSettingsController",0,V],138538);var W=e.i(545490),H=e.i(251270);let z={src:e.i(643655).default,width:354,height:84,blurWidth:8,blurHeight:2,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAYAAABllJ3tAAAATUlEQVR42gFCAL3/AAMDBv8GBQr/FBUW/yMaHv8gFxr/FhEX/wYFCv8DAgb/AAUECv8TFB//U1g4/4JSK/+CUC7/d1hc/xoVJP8EBAn/jVEWJVTh878AAAAASUVORK5CYII="};function $(e){let{onClick:l,className:r}=e,s=(0,H.t)("A New Generation Begins");return(0,t.jsxs)("div",{className:["relative h-[84px] min-h-[64px] curs
2or-pointer overflow-hidden rounded-xl bg-[#040306]",r??""].filter(Boolean).join(" "),onClick:l,children:[(0,t.jsx)(W.NextImage,{src:z,alt:s,fill:!0,priority:!0,style:{objectFit:"cover"}}),(0,t.jsx)("div",{className:"relative mt-3 flex h-full justify-center",children:(0,t.jsxs)("p",{className:"text-[15px] font-bold text-white",style:{textShadow:"0px 1px 4px rgba(0, 0, 0, 0.9)"},children:[s," ","→"]})})]})}var G=e.i(295980),q=e.i(217211),K=e.i(390935),Y=e.i(357675);let X={lite:"LITE",plus:"PLUS",ultra:"ULTRA",max:"MAX"},J=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("stop",{stopColor:"#66FEF4"}),(0,t.jsx)("stop",{offset:"0.3",stopColor:"#FFFFD6"}),(0,t.jsx)("stop",{offset:"0.7019",stopColor:"#FFC0AD"}),(0,t.jsx)("stop",{offset:"1",stopColor:"#E694FF"})]});function Q(e){let{isMax:l}=e,r="subscription-guide-pill-glyph-gradient";return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3 shrink-0","aria-hidden":"true",children:[l&&(0,t.jsx)("defs",{children:(0,t.jsx)("linearGradient",{id:r,x1:"0.41",y1:"1.236",x2:"9.38",y2:"11.496",gradientUnits:"userSpaceOnUse",children:J})}),(0,t.jsx)("path",{d:"M5.58797 1.236C6.20581 1.23625 6.59572 2.01711 7.37606 3.5778L8.08797 5.00065C9.25561 3.63839 9.83931 2.95669 10.3087 3.10026C10.3613 3.11636 10.4122 3.1385 10.46 3.16569C10.8864 3.40847 10.7926 4.30072 10.6046 6.08463L10.5294 6.79557C10.3749 8.26051 10.2974 8.99296 9.79109 9.49479C9.28457 9.99666 8.60065 10.0626 7.23348 10.194C6.66151 10.249 6.0849 10.2868 5.58407 10.2868C5.08395 10.2868 4.50867 10.2489 3.93758 10.194C2.56956 10.0626 1.88567 9.99712 1.37899 9.49479C0.872293 8.99242 0.79523 8.25924 0.641685 6.79264L0.567467 6.08463C0.380337 4.29726 0.287001 3.40353 0.715904 3.16178C0.762384 3.13558 0.811417 3.11407 0.862388 3.0983C1.33281 2.95295 1.91829 3.63602 3.08797 5.00065L3.79892 3.5778C4.57944 2.01676 4.96995 1.236 5.58797 1.236ZM5.95028 5.77702C5.80664 5.46924 5.36833 5.46924 5.22469 5.77702L5.01277 6.23209C4.97304 6.3172 4.90453 6.38573 4.81942 6.42545L4.36434 6.63737C4.05656 6.78101 4.05656 7.21931 4.36434 7.36295L4.81942 7.57487C4.90452 7.61458 4.97304 7.68314 5.01277 7.76823L5.22469 8.2233C5.36833 8.53109 5.80664 8.53109 5.95028 8.2233L6.16219 7.76823C6.20191 7.68314 6.27049 7.61461 6.35555 7.57487L6.81063 7.36295C7.11841 7.21931 7.11841 6.78101 6.81063 6.63737L6.35555 6.42545C6.27049 6.38571 6.2019 6.31717 6.16219 6.23209L5.95028 5.77702Z",fill:l?`url(#${r})`:"#FEFC00"})]})}function Z(e){let{guide:l,onClick:r}=e,s="max"===l.plan;return(0,t.jsxs)("button",{type:"button",onClick:()=>r(l),"aria-label":(0,H.t)("Subscribe to {{plan}}",{plan:X[l.plan]}),className:"flex h-6 shrink-0 items-center gap-[3px] rounded-full border border-white/10 px-[6px] py-[4px]",children:[(0,t.jsx)(Q,{isMax:s}),(0,t.jsx)("span",{className:s?"whitespace-nowrap bg-clip-text text-[12px] font-semibold leading-[18px] text-transparent":"whitespace-nowrap text-[12px] font-semibold leading-[18px] text-[#FEFC00]",style:s?{backgroundImage:"linear-gradient(144.25deg, #66FEF4 0%, #FFFFD6 30%, #FFC0AD 70.19%, #E694FF 100%)"}:void 0,children:(0,H.t)("FREE")}),(0,t.jsxs)("svg",{width:"5",height:"8",viewBox:"0 0 5 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"shrink-0 opacity-50","aria-hidden":"true",children:[s&&(0,t.jsx)("defs",{children:(0,t.jsx)("linearGradient",{id:"subscription-guide-pill-chevron-gradient",x1:"0",y1:"0",x2:"5",y2:"8",gradientUnits:"userSpaceOnUse",children:J})}),(0,t.jsx)("path",{d:"M1 1.25L3.75 4L1 6.75",stroke:s?"url(#subscription-guide-pill-chevron-gradient)":"#FEFC00",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})]})}let ee=e.i(216314).TimerView;function et(e){let{endTime:l,remainingTries:r}=e;return(0,t.jsx)(ee,{endTime:l,customerTimer:(0,t.jsxs)("span",{className:"flex-1 text-[11px] leading-[18px] text-[#FEFC00]",children:[(0,H.t)("{{times}} Free Chats",{times:String(r)})," ",(0,H.t)("with premium models!")]}),style:{width:"100%"}})}let el={premium:()=>(0,H.t)("Premium"),flagship:()=>(0,H.t)("Flagship"),free:()=>(0,H.t)("Free"),beta:()=>(0,H.t)("Beta"),"will-be-discontinued":()=>(0,H.t)("Will be discontinued")};function er(e){let{section:l,variant:r,guide:s,trialTimer:n,isDiscontinuedExpanded:i,onToggleDiscontinued:a,onGuideClick:o}=e,d=l.groupId?.toLowerCase(),c=l.title||el[d??"premium"]?.()||(0,H.t)("Recommended");return"will-be-discontinued"===d?(0,t.jsxs)("div",{className:"flex w-full cursor-pointer select-none items-center gap-1 pb-2 pt-0",onClick:a,children:[(0,t.jsx)(G.Text,{className:"text-[14px] font-semibold leading-5 text-white/60",children:c}),(0,t.jsx)(Y.ChevronUpSmallIcon,{size:16,fill:"rgba(255,255,255,0.6)",className:`transition-transform duration-200 ${i?"rotate-0":"rotate-180"}`})]}):s?(0,t.jsxs)("div",{className:"flex w-full flex-col gap-[9px] pb-3",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-3",children:[(0,t.jsx)(G.Text,{className:"desktop"===r?"text-[14px] font-semibold leading-5 text-white/60":"text-[14px] font-semibold leading-5 text-white",children:c}),o&&(0,t.jsx)(Z,{guide:s,onClick:o})]}),n&&(0,t.jsx)(et,{endTime:n.endTime,remainingTries:n.remainingTries})]}):"desktop"===r?(0,t.jsxs)("div",{className:"flex flex-row items-center justify-between pb-3 pt-0",children:[(0,t.jsx)(G.Text,{className:"text-[12px] font-normal text-white/60",children:c}),l.tips&&(0,t.jsx)("div",{className:"flex flex-row items-center gap-1.5",children:(0,t.jsx)("div",{className:"rounded-full bg-[#FEFC001A] px-2 py-0.5",children:(0,t.jsx)(G.Text,{className:"text-[10px] font-semibold",style:{color:q.Theme.brandColor},children:l.tips})})})]}):(0,t.jsxs)("div",{className:"flex flex-row items-center pb-3 pt-[18px]",children:[(0,t.jsx)(G.Text,{className:"text-lg font-semibold text-white",children:c}),l.tips&&(0,t.jsxs)("div",{className:"flex flex-row items-center",children:[(0,t.jsx)(K.FlIconSparks,{size:20,fill:q.Theme.brandColor}),(0,t.jsx)(G.Text,{className:"text-base font-semibold text-[#FEFC00]",children:l.tips})]})]})}function es(e){let{sections:l,selectedModelName:s,headerVariant:n,guideByGroup:i,trial:a,isDiscontinuedExpanded:o,onToggleDiscontinued:d,onSelectModel:c,onOpenMoreSettings:u,onGuideClick:x,iconSrcByName:m,bestMatchModelNames:h,renderItem:p}=e,[g,f]=(0,r.useState)(()=>Date.now()),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{behavior:l="smooth",block:s="start"}
2=t,n=(0,r.useRef)(null),i=(0,r.useRef)(e);return(0,r.useEffect)(()=>{let t=i.current;if(i.current=e,t||!e)return;let r=n.current;if(!r)return;let a=window.requestAnimationFrame(()=>{let e=function(e){let t=e?.parentElement??null;for(;t;){let{overflowY:e}=window.getComputedStyle(t);if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(r);if(e){let t=r.getBoundingClientRect(),l=e.getBoundingClientRect();if(t.top>=l.top&&t.bottom<=l.bottom)return}r.scrollIntoView({behavior:l,block:s})});return()=>window.cancelAnimationFrame(a)},[e,l,s]),n}(o),v=(0,r.useMemo)(()=>l.some(e=>e.data.some(e=>(0,P.isPendingOfflineModel)(e,g))),[g,l]);return(0,r.useEffect)(()=>{if(!v)return;let e=window.setInterval(()=>{f(Date.now())},6e4);return()=>window.clearInterval(e)},[v]),(0,t.jsx)(t.Fragment,{children:l.map((e,l)=>{let r=e.groupId?.toLowerCase(),f="will-be-discontinued"===r,v=r?i[r]:void 0,y="premium"===r&&a.isTrial&&!!v,w=!!(e.title||e.tips||f||v),j=f&&!o?[]:e.data.filter(e=>!(0,P.isModelDeactivated)(e,g));return(0,t.jsxs)("div",{ref:f?b:void 0,className:"flex flex-col",style:{marginTop:18*(0!==l)},children:[w&&(0,t.jsx)(er,{section:e,variant:n,guide:v,trialTimer:y?{endTime:a.endTime,remainingTries:a.remainingTries}:void 0,isDiscontinuedExpanded:o,onToggleDiscontinued:d,onGuideClick:x}),(0,t.jsx)("div",{className:"flex flex-col gap-[6px]",children:j.map((e,t)=>p({model:e,index:t,isSelected:e.name===s,isBestMatch:h?.has(String(e.name))??!1,variant:f?"discontinued":"default",iconSrc:m.get(e.name),onPress:()=>c(e),onSettingPress:e.canSetting?()=>u(e):void 0}))})]},`${r??e.title??"section"}-${l}`)})})}var en=e.i(909421),ei=e.i(535815);let ea=e.i(933710).ModelReleaseNotes,eo="400px";function ed(e){let{size:l=28}=e;return(0,t.jsx)("span",{className:"inline-flex rounded-full",style:{backdropFilter:"blur(5px)",WebkitBackdropFilter:"blur(5px)"},children:(0,t.jsxs)("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M24 12C24 18.624 18.624 24 12 24C5.376 24 0 18.624 0 12C0 5.376 5.376 0 12 0C18.624 0 24 5.364 24 12Z",fill:"white",fillOpacity:"0.6"}),(0,t.jsx)("path",{d:"M14.4238 8.27051C14.7843 7.91002 15.369 7.91002 15.7295 8.27051C16.09 8.63099 16.09 9.21569 15.7295 9.57617L13.3057 12L15.7295 14.4238C16.09 14.7843 16.09 15.369 15.7295 15.7295C15.369 16.09 14.7843 16.09 14.4238 15.7295L12 13.3057L9.57617 15.7295C9.21569 16.09 8.63099 16.09 8.27051 15.7295C7.91002 15.369 7.91002 14.7843 8.27051 14.4238L10.6943 12L8.27051 9.57617C7.91002 9.21569 7.91002 8.63099 8.27051 8.27051C8.63099 7.91002 9.21569 7.91002 9.57617 8.27051L12 10.6943L14.4238 8.27051Z",fill:"black"})]})})}function ec(){return(0,t.jsx)("svg",{width:"7",height:"12",viewBox:"0 0 7 12",fill:"none",children:(0,t.jsx)("path",{d:"M6 1L1 6L6 11",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function eu(e){let{isOpen:l,onClose:s,onSubscribe:n}=e,[i,a]=(0,r.useState)(l),[o,d]=(0,r.useState)(!1),c=(0,r.useRef)(null),u=(0,r.useRef)(null);return((0,r.useEffect)(()=>(null!==c.current&&(cancelAnimationFrame(c.current),c.current=null),null!==u.current&&(clearTimeout(u.current),u.current=null),l?(a(!0),c.current=requestAnimationFrame(()=>{c.current=null,d(!0)})):(d(!1),u.current=setTimeout(()=>{u.current=null,a(!1)},300)),()=>{null!==c.current&&(cancelAnimationFrame(c.current),c.current=null),null!==u.current&&(clearTimeout(u.current),u.current=null)}),[l]),l||i)?(0,t.jsxs)("div",{"aria-hidden":!l,className:"absolute inset-0 flex min-h-0 flex-col bg-black transition-transform duration-300 ease-out",style:{transform:o?"translateX(0%)":"translateX(100%)",pointerEvents:l&&o?"auto":"none"},children:[(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":(0,H.t)("Back"),className:"absolute left-4 top-4 z-20 flex h-6 w-6 items-center justify-center rounded-full transition-opacity hover:opacity-80",style:{backgroundColor:"rgba(255, 255, 255, 0.2)"},children:(0,t.jsx)(ec,{})}
2),(0,t.jsx)(ea,{className:"relative flex h-full w-full touch-pan-y flex-col bg-[#111]",onSubscribeMobile:n,swipeConfig:{onSwipeRight:s}})]}):null}function ex(e){let{isOpen:l,onClose:r,onSubscribe:s,variant:n}=e;return"slide-over"===n?(0,t.jsx)(eu,{isOpen:l,onClose:r,onSubscribe:s}):(0,t.jsx)(en.Drawer.Root,{open:l,placement:"drawer-right"===n?"end":"bottom",closeOnInteractOutside:!0,onOpenChange:e=>{e.open||r()},children:(0,t.jsxs)(ei.Portal,{children:[(0,t.jsx)(en.Drawer.Backdrop,{style:"drawer-right"===n?{backgroundColor:"transparent",zIndex:1600}:{backgroundColor:"rgba(0, 0, 0, 0.72)",zIndex:1600}}),(0,t.jsx)(en.Drawer.Positioner,{style:{zIndex:1601},children:(0,t.jsxs)(en.Drawer.Content,{roundedTop:"slide-bottom"===n?"18px":void 0,className:"relative flex flex-col",style:"drawer-right"===n?{width:eo,maxWidth:eo,height:"100vh",padding:0,backgroundColor:"#000",boxShadow:"none"}:{width:"100%",maxWidth:"100%",maxHeight:"90vh",backgroundColor:"#000",padding:0,boxShadow:"none"},children:[(0,t.jsx)("button",{type:"button","aria-label":(0,H.t)("Close"),onClick:r,className:"absolute right-[16px] top-[16px] z-[10] flex items-center justify-center transition-opacity hover:opacity-80",children:(0,t.jsx)(ed,{size:28})}),(0,t.jsx)(en.Drawer.Body,{className:"flex-1 overflow-hidden",style:{padding:0},children:(0,t.jsx)(ea,{onSubscribeMobile:s,onSubscribeWeb:s})})]})})]})})}var em=e.i(513347),eh=e.i(900810),ep=e.i(574531),eg=e.i(420851);let ef=[{x:67,y:-7,textAnchor:"middle"},{x:139,y:51,textAnchor:"start"},{x:113,y:136,textAnchor:"start"},{x:21,y:136,textAnchor:"end"},{x:-5,y:51,textAnchor:"end"}],eb=(e,t)=>{let l=Math.PI/180*(-90+72*t);return{x:67+Math.cos(l)*e,y:68+Math.sin(l)*e}},ev=e=>{let{src:l}=e,[s,n]=(0,r.useState)(!1),[i,a]=(0,r.useState)(!1),o=(0,r.useRef)(null);return((0,r.useEffect)(()=>{a(!1),n(!1);let e=requestAnimationFrame(()=>{o.current=requestAnimationFrame(()=>n(!0))});return o.current=e,()=>{null!==o.current&&cancelAnimationFrame(o.current)}},[l]),i)?null:(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",style:{transform:s?"scale(1)":"scale(0)",opacity:+!!s,transition:s?"transform 500ms ease, opacity 500ms ease":"none"},children:(0,t.jsx)("img",{src:l,alt:"","aria-hidden":"true",className:"max-h-full max-w-full object-contain",onError:()=>a(!0)})})},ey=e=>{let l,{className:s,overlaySrc:n,labels:i,values:a,maxValue:o=100,modelName:d,colors:c}=e,{t:u}=(0,H.useTranslation)(),x=(0,r.useId)(),m=`radar-grad-${x.replace(/:/g,"")}`,h={stroke:(l=c?.length===3?c:(0,ep.getModelRadarColors)(d))[0]??"rgba(171, 255, 45, 0.9)",fillInner:l[1]??"rgba(171, 255, 45, 0.05)",fillOuter:l[2]??"rgba(171, 255, 45, 0.28)"},p=i??[u("Reasoning"),u("Creativity"),u("Consistency"),u("Memory"),u("Detail")],g=!!n,f=g||a?.length!==5?void 0:a.map(e=>e<=1?e*o:e),[b,v]=(0,r.useState)(!1),y=(0,r.useRef)(null);return(0,r.useEffect)(()=>{v(!1);let e=requestAnimationFrame(()=>{y.current=requestAnimationFrame(()=>v(!0))});return y.current=e,()=>{null!==y.current&&cancelAnimationFrame(y.current)}},[d]),(0,t.jsxs)("div",{className:(0,eg.cn)("relative h-full w-full -translate-x-[20px]",s),children:[(0,t.jsxs)("svg",{className:"h-full w-full",viewBox:"0 0 132 126",preserveAspectRatio:"xMidYMid meet",overflow:"visible","aria-hidden":"true",children:[[1,.8,.6,.4,.2].map(e=>{let l;return(0,t.jsx)("polygon",{points:(l=67*e,[,,,,,].fill(null).map((e,t)=>{let r=eb(l,t);return`${r.x},${r.y}`}).join(" ")),fill:"none",stroke:"rgba(255,255,255,0.06)",strokeWidth:1},e)}),[,,,,,].fill(null).map((e,l)=>{let r=eb(67,l);return(0,t.jsx)("line",{x1:67,y1:68,x2:r.x,y2:r.y,stroke:"rgba(255,255,255,0.06)",strokeWidth:1},l)}),p.slice(0,5).map((e,l)=>(0,t.jsx)("text",{x:ef[l]?.x,y:ef[l]?.y,fill:"rgba(255,255,255,0.6)",textAnchor:ef[l]?.textAnchor,style:{fontSize:10,fontWeight:400},children:e},e)),(0,t.jsx)("defs",{children:(0,t.jsxs)("radialGradient",{id:m,cx:67,cy:68,r:67,gradientUnits:"userSpaceOnUse",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:h.fillInner}),(0,t.jsx)("stop",{offset:"100%",stopColor:h.fillOuter})]})}),f&&(0,t.jsxs)("g",{style:{transformOrigin:"67px 68px",transform:b?"scale(1)":"scale(0)",opacity:+!!b,transition:b?"transform 500ms ease, opacity 500ms ease":"none"},children:[(0,t.jsx)("polygon",{points:f.map((e,t)=>{let l=eb(67*Math.max(0,Math.min(e/o,1)),t);return`${l.x},${l.y}`}).join(" "),fill:`url(#${m})`,stroke:h.stroke,strokeWidth:1.5,strokeOpacity:.9}),f.map((e,l)=>{let r=eb(67*Math.max(0,Math.min(e/o,1)),l);return(0,t.jsx)("circle",{cx:r.x,cy:r.y,r:2,fill:h.stroke},l)})]})]}),g&&(0,t.jsx)(ev,{src:n},d)]})};e.s(["ModelRadarChart",0,ey],326432);var ew=e.i(313420);function ej(e){let{model:t,index:l,userLevel:s,isTrial:n,iconSrc:i,remainingTrialTries:a,grantModelRemainingTries:o}=e,d=n&&0===l&&ep.trialModelList.includes(t.name),{showPrice:c}=(0,r.useMemo)(()=>(function(e){let{model:t,userLevel:l,remainingTrialTries:r=0,grantModelRemainingTries:s=0}=e,n=0===t.cost||t.level<=1,i=2===t.level,a=t.level>=3;if(n)return{showPrice:!1,showSubscribeEntry:!1};if(i){if(1===l||2===l||3===l)return{showPrice:!1,showSubscribeEntry:!1};if(4===l){let e=s>0;return{showPrice:!e,showSubscribeEntry:!e}}return{showPrice:r<=0,showSubscribeEntry:!0}}return a?3===l?{showPrice:s<=0,showSubscribeEntry:!1}:{showPrice:!0,showSubscribeEntry:!1}:{showPrice:t.cost>0,showSubscribeEntry:!1}})({model:t,userLevel:s,remainingTrialTries:a,grantModelRemainingTries:o}),[o,t,a,s]);return{showPrice:c,showNewBadge:(0,r.useMemo)(()=>(0,x.shouldShowModelNewBadge)(t),[t]),showMostPopular:d,resolvedIconSrc:(0,r.useMemo)(()=>((e,t)=>{if(t)return t;let l=ew.SmallModelIcon[e.name];return"string"==typeof l?l:l&&"object"==typeof l?l.uri??l.default?.src??ew.SmallModelIcon.EMOCHI_VANILLA:ew.SmallModelIcon.EMOCHI_VANILLA})(t,i),[t,i])}}function eC(e,t){let[l,s]=(0,r.useState)(()=>Date.now()),n=(0,P.isPendingOfflineModel)(e,l);return(0,r.useEffect)(()=>
2{if(!n)return;let e=window.setInterval(()=>{s(Date.now())},6e4);return()=>window.clearInterval(e)},[n]),(0,r.useMemo)(()=>{let r=(0,P.getModelDeactivationRemainingMs)(e,l);return{isPendingOffline:n,remainingMs:r,label:(0,P.formatDeactivationCountdown)(r,t)}},[n,e,l,t])}e.s(["useModelDeactivationCountdown",0,eC],419031);let eN=e=>(window.addEventListener("scroll",e,{capture:!0,passive:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})),eS=e=>()=>{};function eF(e){let{anchorRef:l,description:s,model:n,visible:i}=e,a=(0,r.useRef)(null),[o,d]=(0,r.useState)(null),c=(0,r.useSyncExternalStore)(i?eN:eS,()=>window.scrollY,()=>0),u=(0,r.useCallback)(()=>{let e=l.current;if(!e)return;let t=e.getBoundingClientRect(),r=window.innerWidth,s=window.innerHeight,n=a.current?.offsetHeight??290;d({left:t.right+12+300+12<=r?t.right+12:Math.max(12,t.left-300-12),top:Math.min(Math.max(t.top+t.height/2-n/2,12),Math.max(12,s-n-12))})},[l]);return((0,r.useEffect)(()=>{i?u():d(null)},[i,c,s,u]),(0,r.useEffect)(()=>{if(!i)return;let e=a.current;if(!e||"u"<typeof ResizeObserver)return;let t=new ResizeObserver(()=>u());return t.observe(e),()=>t.disconnect()},[i,u]),i)?(0,eh.createPortal)((0,t.jsx)("div",{ref:a,className:"pointer-events-none fixed z-[9999]",style:{left:o?.left??0,top:o?.top??0,width:300,minWidth:300,maxWidth:300,boxSizing:"border-box",visibility:o?"visible":"hidden"},children:(0,t.jsxs)("div",{className:"w-full overflow-hidden rounded-[24px] bg-[#1A1A1A] p-6 shadow-[0_20px_60px_rgba(0,0,0,0.4)]",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-[6px]",children:[(0,t.jsx)("span",{className:"text-2xl font-bold leading-6 text-[#F1F1F1]",children:n.title}),(0,t.jsx)("span",{className:"text-base font-normal leading-4 text-white/60",children:s})]}),(0,t.jsx)("div",{className:"mt-4 flex h-[170px] w-full items-center justify-center",children:(0,t.jsx)("div",{className:"h-[126px] w-[132px] shrink-0",children:(0,t.jsx)(ey,{values:n.radarData??(0,ep.getModelRadarData)(String(n.name),n.title),overlaySrc:n.radarChartSrc,modelName:String(n.name),colors:n.colors})})})]})}),document.body):null}function eM(e){let{model:l,index:s,isSelected:n,isBestMatch:i,userLevel:a,isTrial:o,iconSrc:d,remainingTrialTries:c,grantModelRemainingTries:u,variant:x,onPress:m,onSettingPress:h}=e,p=(0,r.useRef)(null),[g,f]=(0,r.useState)(!1),{t:b}=(0,O.useLanguageContext)(),{showPrice:v,showNewBadge:y,showMostPopular:w,resolvedIconSrc:j}=ej({model:l,index:s,userLevel:a,isTrial:o,iconSrc:d,remainingTrialTries:c,grantModelRemainingTries:u}),C=eC(l,b),N="discontinued"===x&&C.isPendingOffline,S=l.detailDesc??l.desc,F=!!(S||l.radarChartSrc);return(0,t.jsxs)("div",{ref:p,className:"group relative",onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[(0,t.jsxs)("div",{onClick:m,className:"relative cursor-pointer overflow-hidden rounded-full px-4 py-3 transition-all duration-200 active:opacity-80",style:{borderWidth:1.5,borderColor:n?"#F
2FFFFF":"rgba(255,255,255,0.1)",boxShadow:n?"0 0 0 1px rgba(255,255,255,0.08)":"none"},children:[(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 rounded-full bg-white/10 opacity-0 transition-opacity duration-200 group-hover:opacity-100"}),(0,t.jsxs)("div",{className:"relative flex items-center gap-3",children:[(0,t.jsx)(em.Image,{src:j,width:"32px",height:"32px",className:"h-8 w-8 shrink-0",alt:"model-icon"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-[15px] font-semibold leading-5 text-white",children:l.title}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[i&&(0,t.jsx)("div",{className:"flex h-5 items-center justify-center rounded-[12px] border-[0.4px] border-solid px-1",style:{borderColor:q.Theme.brandColor},children:(0,t.jsx)("span",{className:"text-[10px] font-normal leading-[12px] tracking-[0.04px]",style:{color:q.Theme.brandColor},children:b("Best Match")})}),w&&(0,t.jsx)("div",{className:"flex h-5 items-center justify-center rounded-full bg-[#FEFC001A] px-2",children:(0,t.jsx)("span",{className:"text-[10px] font-semibold leading-[14px]",style:{color:q.Theme.brandColor},children:b("Most Popular")})}),v&&(0,t.jsxs)("div",{className:"flex h-5 items-center justify-center rounded-full bg-white/10 px-1.5",children:[(0,t.jsx)(em.Image,{src:"/images/icon_coin.png",width:"10px",height:"10px",className:"mr-0.5 h-2.5 w-2.5",alt:"coin-icon"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold leading-[14px] text-white",children:l.cost})]}),y&&(0,t.jsx)(Y.ModelNewBadge,{label:"NEW"}),N&&(0,t.jsx)("div",{className:"flex h-5 items-center justify-center rounded-full bg-[#FEFC001A] px-2",children:(0,t.jsx)("span",{className:"text-[10px] font-semibold leading-[14px]",style:{color:q.Theme.brandColor},children:b("Will be discontinued")})})]})]}),(0,t.jsx)("span",{className:"mt-1 block truncate text-[12px] font-normal leading-4 text-white/60",children:l.descShort??l.desc}),N&&C.label&&(0,t.jsx)("span",{className:"mt-1 block truncate text-[12px] font-semibold leading-4",style:{color:q.Theme.brandColor},children:C.label})]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center",children:l.canSetting&&h&&(0,t.jsx)("div",{onClick:e=>{e.stopPropagation(),h()},className:"group/setting flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-white/40 transition-colors duration-200 hover:bg-white/10 hover:text-white",children:(0,t.jsx)(K.FlChatIconModelSetting,{size:16,fill:"currentColor"})})})]})]}),F&&(0,t.jsx)(eF,{anchorRef:p,description:S,model:l,visible:g})]})}e.s(["DesktopModelSettingsPanel",0,function(e){let{promptId:r,source:s}=e,n=V({promptId:r,source:s});return(0,t.jsxs)("div",{className:"flex h-full flex-1 flex-col bg-transparent",children:[(0,t.jsx)(l.ScrollArea.Root,{className:"min-h-0 flex-1",maxW:"lg",children:(0,t.jsx)(l.ScrollArea.Viewport,{children:(0,t.jsxs)(l.ScrollArea.Content,{spaceY:"4",textStyle:"sm",style:{minWidth:0,width:"100%"},children:[(0,t.jsx)("div",{className:"mx-[18px]",children:(0,t.jsx)($,{onClick:n.releaseNotes.open})}),(0,t.jsx)("div",{className:"flex min-h-0 flex-col",style:{padding:"0 18px 18px"},children:(0,t.jsx)(es,{sections:n.displaySections,selectedModelName:n.selectedModelName,headerVariant:"desktop",guideByGroup:n.guideByGroup,trial:n.trial,isDiscontinuedExpanded:n.isDiscontinuedExpanded,onToggleDiscontinued:n.toggleDiscontinued,onSelectModel:n.handleSelectModel,onOpenMoreSettings:n.handleOpenMoreSettings,onGuideClick:n.handleSubscribeGuideClick,iconSrcByName:n.iconSrcByName,bestMatchModelNames:n.bestMatchModelNames,renderItem:e=>{let{model:l,index:r,isSelected:s,isBestMatch:i,onPress:a,onSettingPress:o,iconSrc:d,variant:c}=e;return(0,t.jsx)(eM,{model:l,index:r,isSelected:s,isBestMatch:i,userLevel:n.vipLevel,isTrial:n.trial.isTrial,iconSrc:d,remainingTrialTries:n.trial.remainingTries,grantModelRemainingTries:n.trial.grantModelRemainingTries,onPress:a,onSettingPress:o,variant:c},l.name)}})})]})})}),(0,t.jsx)(ex,{variant:"drawer-right",isOpen:n.releaseNotes.isOpen,onClose:n.releaseNotes.close,onSubscribe:n.handleSubscribeFromReleaseNotes})]})}],215605);var eT=e.i(690067),ek=e.i(121552);let eE={src:e.i(551799).default,width:60,height:60,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAABE0lEQVR42gEIAff+AAAAAAAEAwMAZ1JSB+C8uUzbuLVMYE1NBwMDAwAAAAAAABsVFgFsVVQJ5ry4VP/j3eL/4t3i5Li2VGxUVAkbFRUBAMujojf40tGS+dfh5uzP5f/jy+z/4Lzm5fPJzpDHnp42AP7P0bP42Ob+xrHk/5at6v+MpOf/mqLs/9nH6/78ydKyAO2uuWbrzubxm731/3PE8v9zxfP/hb/3/83J8fHhocFjAIxidBfoxOPCo8z6/4Xa
2/v+H3f7/p939/9bP9MF0WoAWAEk2SwfRruadwMP477LQ+c6z0/nPucr777Kv7p05M0sGABYRGAGFbaIxmYTHTG9snx9ubZ8fjoXJS3RonzEQDhYB3UqbFkDsbUIAAAAASUVORK5CYII="};function eL(e){let{model:l,index:r,isSelected:s,isBestMatch:n,userLevel:i,isTrial:a,iconSrc:o,remainingTrialTries:d,grantModelRemainingTries:c,variant:u,onPress:x,onSettingPress:m}=e,{t:h}=(0,O.useLanguageContext)(),{showPrice:p,showNewBadge:g,showMostPopular:f,resolvedIconSrc:b}=ej({model:l,index:r,userLevel:i,isTrial:a,iconSrc:o,remainingTrialTries:d,grantModelRemainingTries:c}),v=eC(l,h),y="discontinued"===u&&v.isPendingOffline,w=0===l.cost;return(0,t.jsxs)("div",{onClick:x,className:`cursor-pointer overflow-hidden rounded-xl p-3 transition-opacity active:opacity-80 ${0!==r?"mt-[9px]":""} ${1===l.level?"border border-[#FFFFFF0F]":""}`,style:{backgroundColor:w?"transparent":"#1A1A1A"},children:[(0,t.jsxs)("div",{className:"mb-1.5 flex flex-row items-center gap-1.5",children:[(0,t.jsx)(W.NextImage,{src:b,alt:"model-icon",width:28,height:28,className:"h-7 w-7"}),(0,t.jsx)(G.Text,{className:"text-lg font-medium text-white",children:l.title}),n&&(0,t.jsx)("div",{className:"flex h-[17px] items-center justify-center rounded-lg px-2",style:{backgroundColor:q.Theme.brandColor},children:(0,t.jsx)(G.Text,{className:"text-[10px] font-medium leading-[16px] text-black",children:h("Best Match")})}),f&&(0,t.jsx)("div",{className:"flex h-[17px] items-center justify-center rounded-lg bg-[#FEFC001A] px-2",children:(0,t.jsx)(G.Text,{className:"text-[10px] font-medium leading-[16px] text-[#FEFC00]",children:h("Most Popular")})}),p&&(0,t.jsxs)("div",{className:"ml-[3px] flex h-5 flex-row items-center justify-center overflow-hidden rounded-xl bg-[#FFFFFF0F] px-1.5",children:[(0,t.jsx)(W.NextImage,{src:eE,alt:"coin-icon",width:12,height:12,className:"mr-[3px] h-3 w-3"}),(0,t.jsx)(G.Text,{className:"text-center text-sm font-semibold leading-[16px] text-white",children:l.cost})]}),g&&(0,t.jsx)(Y.ModelNewBadge,{label:"NEW"}),y&&(0,t.jsx)("div",{className:"flex h-[17px] items-center justify-center rounded-lg bg-[#FEFC001A] px-2",children:(0,t.jsx)(G.Text,{className:"text-[10px] font-medium leading-[16px] text-[#FEFC00]",children:h("Will be discontinued")})}),(0,t.jsxs)("div",{className:"flex flex-1 flex-row justify-end gap-[18px]",children:[l.canSetting&&(0,t.jsx)(ek.default,{onPress:e=>{e?.stopPropagation?.(),m?.()},children:(0,t.jsx)(K.FlChatIconModelSetting,{size:20,fill:"#FFFFFF99"})}),s?(0,t.jsx)(K.FlIconRadioCheckedNew,{size:20,fill:q.Theme.brandColor}):(0,t.jsx)(K.FlIconRadioUncheckNew,{size:20,stroke:"#FFFFFF0F"})]})]}),(0,t.jsx)(G.Text,{className:"text-base font-normal text-[#999]",children:l.descShort??l.desc}),y&&v.label&&(0,t.jsx)(G.Text,{className:"mt-1 text-sm font-semibold text-[#FEFC00]",children:v.label})]})}let eA=e=>{let{promptId:l,source:s}=e,[n,i]=(0,r.useState)(1),a=V({promptId:l,source:s,onAfterSelect:e.closeModal,onBeforeBlockNavigate:e.closeModal}),o=(0,r.useCallback)(e=>{a.handleOpenMoreSettings(e,{onDismiss:()=>i(1)})&&i(0)},[a]),{paddingTop:d,...c}=e.mainContentStyle??{};return(0,t.jsx)("div",{className:"mx-auto flex w-full flex-col overflow-hidden rounded-t-[20px] rounded-tr-[20px] bg-[#111111]",style:{...c,height:"80vh",maxHeight:"100%",opacity:n},children:(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex h-full min-h-0 flex-col transition-transform duration-300 ease-out",style:{transform:a.releaseNotes.isOpen?"translateX(-12%)":"translateX(0%)",opacity:+!a.releaseNotes.isOpen,pointerEvents:a.releaseNotes.isOpen?"none":"auto"},children:[(0,t.jsxs)("div",{className:"flex h-14 items-center gap-[18px] px-4",children:[(0,t.jsx)("button",{type:"button",className:"flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full bg-white/5 p-2",onClick:()=>e.closeModal?.(),"aria-label":(0,H.t)("Close"),children:(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3.56 3.56L12.44 12.44M3.56 12.44L12.44 3.56",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round"})})}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 items-center justify-center",children:(0,t.jsx)(G.Text,{className:"text-[18px] font-extrabold leading-6 text-white",children:(0,H.t)("Model Setting")})}),(0,t.jsx)("div",{className:"size-8 shrink-0 opacity-0","aria-hidden":"true"})]}),(0,t.jsxs)("div",{className:"scrollbar-hide flex-1 overflow-y-auto px-[18px]",style:{paddingBottom:12},children:[(0,t.jsx)("div",{className:"mt-[18px]",children:(0,t.jsx)($,{onClick:a.releaseNotes.open})}),(0,t.jsx)(es,{sections:a.displaySections,selectedModelName:a.selectedModelName,headerVariant:"mobile",guideByGroup:a.guideByGroup,trial:a.trial,isDiscontinuedExpanded:a.isDiscontinuedExpanded,onToggleDiscontinued:a.toggleDiscontinued,onSelectModel:a.handleSelectModel,onOpenMoreSettings:o,onGuideClick:a.handleSubscribeGuideClick,iconSrcByName:a.iconSrcByName,bestMatchModelNames:a.bestMatchModelNames,renderItem:e=>{let{model:l,index:r,isSelected:s,isBestMatch:n,onPress:i,onSettingPress:o,iconSrc:d,variant:c}=e;return(0,t.jsx)(eL,{model:l,index:r,isSelected:s,isBestMatch:n,userLevel:a.vipLevel,isTrial:a.trial.isTrial,iconSrc:d,remainingTrialTries:a.trial.remainingTries,grantModelRemainingTries:a.trial.grantModelRemainingTries,variant:c,onPress:i,onSettingPress:o},l.name)}})]})]}),(0,t.jsx)(ex,{variant:"slide-over",isOpen:a.releaseNotes.isOpen,onClose:a.releaseNotes.close,onSubscribe:a.handleSubscribeFromReleaseNotes})]})})};e.s(["showModelSetting",0,e=>{(0,eT.showFlowBottomModalWithAnimation)(eA,{...e,contentStyle:{padding:0,paddingBottom:0,backgroundColor:"transparent",maxHeight:"90%"}
2,props:{uniqueId:"MODEL_SETTING_MODAL"},useDropdownHandle:!0,animated:!0,backGuard:!0,historyKey:"emochiModelSettingsSheet"})}],510137)},493206,e=>{"use strict";var t=e.i(672347),l=e.i(574531),r=e.i(313420),s=e.i(120208);let n=(e,t,l)=>{let r=e?.reduce((e,t)=>{let r=l(t);return r&&(e[t.name]=r),e},{})??{};return{...t,...r}};e.s(["useModelsConfig",0,()=>{let{models:e,isLoading:i,refetch:a}=(0,s.useModelsSettings)(),o=(0,t.useMemo)(()=>{let t=(0,l.initModelLevelsNew)();if(!e.length)return t;let r=e.filter(e=>e.display?.settingsPage?.enabled),s=new Map(r.map(e=>[e.name,e])),n=new Set;return[...t.map(e=>{let t=s.get(e.name);return t?(n.add(t.name),{...e,chatPoint:t.display?.settingsPage?.chatPoint,cost:t.cost,desc:t.desc,level:t.level,llmTranslation:t.llmTranslation,name:t.name,playType:t.playType,title:t.title,vipLevel:t.vipLevel,vipFree:t.vipFree,onlyCost:t.onlyCost,order:t.display?.settingsPage?.order,canSetting:t.canSetting,isThinking:t.isThinking,nativeI18n:t.nativeI18n,backgroundColor:t.backgroundColor??void 0}):e}),...r.filter(e=>!n.has(e.name)).map(e=>({chatPoint:e.display?.settingsPage?.chatPoint,cost:e.cost,desc:e.desc,level:e.level,llmTranslation:e.llmTranslation,name:e.name,playType:e.playType,title:e.title,vipLevel:e.vipLevel,vipFree:e.vipFree,onlyCost:e.onlyCost,order:e.display?.settingsPage?.order,canSetting:e.canSetting,isThinking:e.isThinking,nativeI18n:e.nativeI18n,backgroundColor:e.backgroundColor??void 0}))].sort((e,t)=>("order"in e&&"number"==typeof e.order?e.order:-1/0)-("order"in t&&"number"==typeof t.order?t.order:-1/0))},[e]),d=(0,t.useMemo)(()=>(0,l.getChatSettingModelLevelsWithV2)(e),[e]),c=(0,t.useMemo)(()=>n(e,r.ModelChart,e=>e.assets?.radarChart),[e]),u=(0,t.useMemo)(()=>n(e,r.ModelVideo,e=>"video"===e.playType?e.assets?.video??"":void 0),[e]),x=(0,t.useMemo)(()=>n(e,r.ModelHeaderDesktopImg,e=>e.assets?.headerImageDesktop??void 0),[e]),m=(0,t.useMemo)(()=>n(e,r.ModelHeaderBgImg,e=>e.assets?.headerBgImage??void 0),[e]),h=(0,t.useMemo)(()=>n(e,r.ModelHeaderImg,e=>e.assets?.headerImage??void 0),[e]),p=(0,t.useMemo)(()=>n(e,r.ModelIcon,e=>e.assets?.icon),[e]),g=(0,t.useMemo)(()=>n(e,r.ModelIconWhite,e=>e.assets?.iconWhite),[e]);return{settingsPageModels:o,chatSelectorModels:d,radarCharts:c,modelVideo:u,modelHeaderDesktopImg:x,modelHeaderBgImg:m,modelHeaderImg:h,modelIcon:p,modelIconWhite:g,modelGreyIcon:(0,t.useMemo)(()=>n(e,r.GreyModelIcon,e=>e.assets?.iconGrey),[e]),smallModelIcon:(0,t.useMemo)(()=>n(e,r.SmallModelIcon,e=>e.assets?.iconSmall),[e]),refetch:a,isLoading:i,remoteModelsV2:e}}])}]);
3
4//# debugId=e5797f20-8653-0f61-c92f-8d5ee0ac1c7b

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.