1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5168],{6221:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/settings",function(){return a(10353)}])},40259:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 2 * @license lucide-react v0.341.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */let s=(0,a(81992).Z)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},49433:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 7 * @license lucide-react v0.341.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */let s=(0,a(81992).Z)("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]])},78718:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 12 * @license lucide-react v0.341.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */let s=(0,a(81992).Z)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},7165:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 17 * @license lucide-react v0.341.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */let s=(0,a(81992).Z)("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]])},27649:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 22 * @license lucide-react v0.341.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */let s=(0,a(81992).Z)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},26795:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 27 * @license lucide-react v0.341.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */let s=(0,a(81992).Z)("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]])},80766:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 32 * @license lucide-react v0.341.0 - ISC 33 * 34 * This source code is licensed under the ISC license. 35 * See the LICENSE file in the root directory of this source tree. 36 */let s=(0,a(81992).Z)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},31406:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 37 * @license lucide-react v0.341.0 - ISC 38 * 39 * This source code is licensed under the ISC license. 40 * See the LICENSE file in the root directory of this source tree. 41 */let s=(0,a(81992).Z)("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]])},65842:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});/** 42 * @license lucide-react v0.341.0 - ISC 43 * 44 * This source code is licensed under the ISC license. 45 * See the LICENSE file in the root directory of this source tree. 46 */let s=(0,a(81992).Z)("Video",[["path",{d:"m22 8-6 4 6 4V8Z",key:"50v9me"}],["rect",{width:"14",height:"12",x:"2",y:"6",rx:"2",ry:"2",key:"1rqjg6"}]])},81732:function(e,t,a){"use strict";var s=a(15311);a(20132);var r=a(5724);t.Z=e=>{let{title:t,usedQueries:a,limit:i,colorClass:l,userInfo:n,type:c}=e,{t:o}=(0,r.Z)("app"),d=(()=>
46{if(i<=0)return 0;let e=a/i*100;return isNaN(e)?0:Math.min(Math.max(e,0),100)})();return n?.vipLevel==="3"&&["GPT4o","ClaudeHaiku","ClaudeSonnet","ClaudeOpus"].includes(c)?(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-[var(--app-gray-darkest)]",children:t}),(0,s.jsx)("span",{className:"text-lg text-[var(--app-gray-darker)]",children:"â"})]}):i<=0?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-[var(--app-gray-darkest)]",children:t}),(0,s.jsx)("span",{className:"font-medium text-[var(--app-text-h1)]",children:"0%"})]}),(0,s.jsx)("div",{className:"h-2 overflow-hidden rounded-full bg-[var(--app-gray-light)]",children:(0,s.jsx)("div",{className:`h-full rounded-full transition-all duration-500 ${l(0)}`,style:{width:"0%"}})}),(0,s.jsxs)("div",{className:"flex justify-between text-sm text-[var(--app-gray-darker)]",children:[(0,s.jsxs)("span",{children:["0 ",o("setting.usage.stats.used")]}),(0,s.jsxs)("span",{children:["0 ",o("setting.usage.stats.limit")]})]})]}):(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-[var(--app-gray-darkest)]",children:t}),(0,s.jsxs)("span",{className:"font-medium text-[var(--app-text-h1)]",children:[d.toFixed(1),"%"]})]}),(0,s.jsx)("div",{className:"h-2 overflow-hidden rounded-full bg-[var(--app-gray-light)]",children:(0,s.jsx)("div",{className:`h-full rounded-full transition-all duration-500 ${l(d)}`,style:{width:`${d}%`}})}),(0,s.jsxs)("div",{className:"flex justify-between text-sm text-[var(--app-gray-darker)]",children:[(0,s.jsxs)("span",{children:[(a||0).toLocaleString()," ",o("setting.usage.stats.used")]}),(0,s.jsxs)("span",{children:[(i||0).toLocaleString()," ",o("setting.usage.stats.limit")]})]})]})}},92843:function(e,t,a){"use strict";a.d(t,{dp:function(){return s},fC:function(){return i},rB:function(){return r}});let s=(e,t)=>e?Math.ceil(e/86400):t?30:1,r=(e,t)=>{let a=new Date;a=new Date(e?new Date().getTime()+1e3*e:t?a.setDate(new Date().getDate()+30):a.setDate(new Date().getDate()+1));let s=e=>String(e).padStart(2,"0"),r=a.getFullYear(),i=s(a.getMonth()+1),l=s(a.getDate()),n=s(a.getHours()),c=s(a.getMinutes()),o=s(a.getSeconds());return`${r}-${i}-${l} ${n}:${c}:${o}`},i=(e,t)=>"media"===t?e>=90?"bg-red-500":e>=75?"bg-indigo-500":"bg-indigo-400":["GPT4o","GPTo1Mini","GPTO1"].includes(t)?e>=90?"bg-red-500":e>=75?"bg-purple-500":"bg-purple-400":["ClaudeHaiku","ClaudeSonnet","ClaudeOpus"].includes(t)?e>=90?"bg-red-500":e>=75?"bg-blue-500":"bg-cyan-400":e>=90?"bg-red-500":e>=75?"bg-slate-500":"bg-slate-400"},39912:function(e,t,a){"use strict";a.d(t,{$N:function(){return u},Be:function(){return g},Vq:function(){return c},cN:function(){return m},cZ:function(){return p},fK:function(){return x}});var s=a(15311),r=a(20132),i=a(64466),l=a(56157),n=a(48147);let c=i.fC;i.xz;let o=i.h_;i.x8;let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/10 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r})});d.displayName=i.aV.displayName;let p=r.forwardRef((e,t)=>{let{className:a,children:r,...c}=e;return(0,s.jsxs)(o,{children:[(0,s.jsx)(d,{}),(0,s.jsxs)(i.VY,{ref:t,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...c,children:[r,(0,s.jsxs)(i.x8,{className:"focus:ring-none focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 roun
46ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-offset-2 disabled:pointer-events-none",children:[(0,s.jsx)(l.Pxu,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});p.displayName=i.VY.displayName;let x=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};x.displayName="DialogHeader";let m=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};m.displayName="DialogFooter";let u=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.Dx,{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",a),...r})});u.displayName=i.Dx.displayName;let g=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.dk,{ref:t,className:(0,n.cn)("text-muted-foreground text-sm",a),...r})});g.displayName=i.dk.displayName},80775:function(e,t,a){"use strict";a.d(t,{Z:function(){return R}});var s=a(15311),r=a(20132),i=a(6381),l=a.n(i),n=a(74034),c=a.n(n),o=a(5724),d=a(68102),p=a(76033),x=a(5762),m=a(96404),u=a(49163),g=a(2496),h=a(53138),f=a(62037),v=a(48039),y=a(22248),j=a(87324),b=a(69330),N=a(16661),w=a(86909),k=a(32923),C=a(35905),Z=a(20793),S=a(13473);let D=r.forwardRef((e,t)=>{let{items:a,isCompact:i,onSelect:n,selectedKey:c,hideEndContent:o,sectionClasses:d={},itemClasses:p={},iconClassName:x,classNames:m,className:g,...f}=e,v={...d,base:(0,u.cn)(d?.base,"w-full",{"p-0 max-w-[44px]":i}),group:(0,u.cn)(d?.group,{"flex flex-col gap-1":i}),heading:(0,u.cn)(d?.heading,{hidden:i})},y={...p,base:(0,u.cn)(p?.base,{"w-11 h-11 gap-0 p-0":i})},j=r.useCallback(e=>{let t=!!e.anchorId,a={...e};return t&&delete a.href,(0,r.createElement)(C.R,{...a,key:e.key,as:t?void 0:l(),endContent:i||o?null:e.endContent??null,startContent:null,textValue:e.title,title:null},(0,s.jsx)(h.e,{content:(0,s.jsx)("div",{className:"flex w-fit max-w-60 flex-col items-start gap-2 px-2 py-4",children:(0,s.jsx)("span",{className:"font-semibold text-default-700",children:e.title})}),placement:"right",children:(0,s.jsxs)("div",{className:(0,u.cn)("flex items-center",{"w-full justify-start gap-2":!i,"w-full justify-center":i}),children:[e.icon?(0,s.jsx)("span",{className:"inline-flex h-6 w-6 items-center justify-center text-default-700 group-data-[selected=true]:text-default-800",children:(0,s.jsx)(b.JO,{icon:e.icon,className:"h-auto w-full"})}):e.startContent??null,!i&&(0,s.jsx)("span",{className:"line-clamp-1 min-w-0 flex-1 text-small font-medium text-default-700 group-data-[selected=true]:text-default-800",children:e.title})]})}))},[i,o,x]);return(0,s.jsx)(Z.X,{ref:t,hideSelectedIcon:!0,as:"nav",className:(0,u.cn)("list-none",g),classNames:{...m,list:(0,u.cn)("items-center",m?.list)},color:"default",itemClasses:{...y,base:(0,u.cn)("min-h-11 rounded-large h-[44px] data-[selected=true]:bg-default-200",y?.base),title:(0,u.cn)("text-small font-medium text-default-700 group-data-[selected=true]:text-default-800",y?.title)},items:a,selectedKeys:[c],selectionMode:"single",variant:"flat",onSelectionChange:e=>{let t=Array.from(e)[0];n?.(t)},...f,children:e=>e.items&&e.items?.length>0?(0,s.jsx)(S.y,{classNames:v,showDivider:i,title:e.title,children:e.items.map(j)},e.key):j(e)},i?"compact":"default")});D.displayName="Sidebar";var M=a(92544),I=a(71281),L=a(64582),E=a(94288),P=a(3821);let O=[{label:"English",value:"en"},{label:"Fran\xe7ais",value:"fr"},{label:"Deutsch",value:"de"},{label:"Ð ÑÑÑкий",value:"ru"},{label:"æ¥æ¬èª",value:"ja"},{label:"Ø§ÙØ¹Ø±Ø¨ÙØ©",value:"ar"}],B=e=>e?"3"===String(e.vipLevel)?"â":Math.max(Number(e.mediaCreditsRemain||0)+Number(e.userBuyCreditsRemain||0),0).toLocaleString():"0";var R=(0,p.Pi)(e=>{let{activeKey:t,children:a}=e,{userStore:i}=(0,P.o)(),n=(0,r.useRef)(i),{t:p}=(0,o.Z)("app"),{t:C}=(0,o.Z)("common"),Z=(0,x.useRouter)(),S=(0,w.ac)("(max-width: 768px)"),[R,T]=(0,r.useState)(()=>S),[z,A]=(0,r.useState)(!1),F=(0,r.useRef)(!1);(0,r.useEffect)(()=>{T(S)},[S]),(0,r.useEffect)(()=>{!F.current&&(F.current=!0,n.current.user||n.current.userLoading||n.current.loadUserInfo().catch(()=>{}))},[]);let V=(0,r.useCallback)(async e=>{await (0,d.Z)(e)},[]),_=(0,r.useCallback)(()=>{T(e=>!e)},[]),J=[{key:"settings",href:"/user/settings",icon:"solar:settings-bold-duotone",title:p("setting.settings.title")},{key:"billing",href:"/user/billing",icon:"solar:card-bold-duotone",title:p("setting.sidebar.planBilling")}],q=i.user,$=B(q),K=O.find(e=>e.value===Z.locale)?.label||"English";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex h-screen w-full bg-[#F6EFE9] text-gray-900",children:[(0,s.jsx)("div",{className:(0,u.cn)("relative z-[1] w-64 shrink-0 transition-all duration-300",{"w-[72px]":R}),children:(0,s.jsxs)("div",{className:(0,u.cn)("relative flex h-full w-full flex-col border-r border-gray-200 bg-white p-4 transition-all duration-300",{"items-center px-2 py-4":R}),children:[(0,s.jsxs)("div",{className:"flex w-full flex-col",children:[(0,s.jsx)("div",{className:(0,u.cn)("flex items-center gap-3",{"justify-center":R,"justify-between":!R}),children:R?(0,s.jsx)(m.A,{isIconOnly:!0,"aria-label":"Expand sidebar",className:"flex h-10 w-10 min-w-0 text-gray-500",size:"sm",variant:"light",onPress:_,children:(0,s.jsx)(b.JO,{className:"text-gray-500",height:24,icon:"solar:round-alt-arrow-right-line-duotone",width:24})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l(),{href:"/",className:"flex items-center",children:(0,s.jsx)(c(),{className:"h-8 w-8 rounded-xl",src:"/images/logos/logo.jpg",alt:"YesChat",width:50,height:50,unoptimized:!0})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"truncate text-small font-bold uppercase text-[#0584c7]",children:"YesChat"}),(0,s.jsx)("p",{className:"truncate text-[11px] text-gray-500",children:p("setting.sidebar.accountCenter")})]})]}),(0,s.jsx)(m.A,{isIconOnly:!0,"aria-label":"Collapse sidebar",className:"flex h-10 w-10 min-w-0 text-gray-500",size:"sm",variant:"light",onPress:_,children:(0,s.jsx)(b.JO,{className:"text-gray-500",icon:"solar:round-alt-arrow-left-line-duotone",width:24})})]})}),(0,s.jsx)(g.q,{y:6}),(0,s.jsx)(M.Z,{isCollapsed:R}),(0,s.jsx)(g.q,{y:6})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,s.jsx)(D,{selectedKey:t,iconClassName:"text-gray-500 group-data-[selected=true]:!text-[#0584c7]",isCompact:R,itemClasses:{base:"rounded-xl border border-transparent px-3 text-gray-600 data-[hover=true]:bg-gray-50 data-[selected=true]:!border-[#0584c7]/20 data-[selected=true]:!bg-[#0584c7]/10",title:"text-gray-600 group-data-[selected=true]:!text-[#0584c7]"},items:J})}),(0,s.jsxs)("div",{className:(0,u.cn)("mt-4 flex w-full flex-col gap-2",{"items-center":R}),children:[(0,s.jsx)(h.e,{content:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 text-black",children:[(0,s.jsx)("span",{className:"line-clamp-1",children:C("credits")}),(0,s.jsx)("span",{className:"text-right font-semibold",children:$})]}),delay:200,isDisabled:!R,placement:"right",children:(0,s.jsx)(m.A,{fullWidth:!0,className:(0,u.cn)("justify-start rounded-xl text-gray-600 data-[hover=true]:bg-gray-50 data-[hover=true]:text-[#0584c7]",{"h-11 w-11 min-w-0 justify-center px-0":R}),isIconOnly:R,startContent:R?null:(0,s.jsx)(b.JO,{icon:"ic:outline-auto-awesome",width:22,className:"text-[#0584c7]"}),variant:"light",children:R?(0,s.jsx)(b.JO,{icon:"ic:outline-auto-awesome",width:22,className:"text-[#0584c7]"}):(0,s.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"line-clamp-1",children:C("credits")}),(0,s.jsx)("span",{className:"text-right font-semibold text-gray-900",children:$})]})})}),!q?.vipFlag&&(0,s.jsx)(h.e,{content:(0,s.jsx)("span",{className:"text-black",children:"Upgrade Now"}),delay:200,isDisabled:!R,placement:"right",children:(0,s.jsx)(m.A,{fullWidth:!0,className:(0,u.cn)("bg-gradient-to-r from-[#0584c7] to-[#1262d9] text-white shadow-sm transition hover:from-[#0584c7] hover:to-[#0584c7]",{"h-11 w-11 min-w-0 justify-center px-0":R}),isIconOnly:R,startContent:R?null:(0,s.jsx)(b.JO,{icon:"solar:crown-star-bold",width:20}),onPress:()=>Z.push("/pricing"),children:R?(0,s.jsx)(b.JO,{icon:"solar:crown-star-bold",width:20}):"Upgrade Now"})}),(0,s.jsx)(h.e,{content:(0,s.jsx)("span",{className:"text-black",children:p("sidebar.feedback.title")}),delay:200,isDisabled:!R,placement:"right",children:(0,s.jsx)(m.A,{fullWidth:!0,className:(0,u.cn)("justify-start rounded-xl text-gray-600 data-[hover=true]:bg-gray-50 data-[hover=true]:text-[#0584c7]",{"h-11 w-11 min-w-0 justify-center px-0":R}),isIconOnly:R,startContent:R?null:(0,s.jsx)(b.JO,{className:"text-gray-500",icon:"solar:chat-square-like-line-duotone",width:22}),variant:"light",onPress:()=>A(!0),children:R?(0,s.jsx)(b.JO,{className:"text-gray-500",icon:"solar:chat-square-like-line-duotone",width:22}):p("sidebar.feedback.title")})}),(0,s.jsx)(h.e,{content:(0,s.jsx)("span",{className:"text-black",children:p("setting.sidebar.language")}),delay:200,isDisabled:!R,placement:"right",children:(0,s.jsxs)(f.F,{placement:"right",children:[(0,s.jsx)(v.S,{children:(0,s.jsx)(m.A,{fullWidth:!0,className:(0,u.cn)("justify-start rounded-xl text-gray-600 data-[hover=true]:bg-gray-50 data-[hover=true]:text-[#0584c7]",{"h-11 w-11 min-w-0 justify-center px-0":R}),isIconOnly:R,startContent:R?null:(0,s.jsx)(b.JO,{className:"text-gray-500",icon:"material-symbols-light:language",width:22}),variant:"light",children:R?(0,s.jsx)(b.JO,{className:"text-gray-500",icon:"material-symbols-light:language",width:22}):(0,s.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,s.jsx)("span",{className:"truncate",children:K}),(0,s.jsx)(b.JO,{className:"ml-auto flex-none text-gray-400",icon:"solar:alt-arrow-right-linear",width:18})]})})}),(0,s.jsx)(y.a,{"aria-label":p("setting.sidebar.language"),className:"max-h-[400px] overflow-y-auto text-gray-700",onAction:e=>V(String(e)),children:O.map(e=>(0,s.jsx)(j.W,{className:"gap-2",startContent:Z.locale===e.value?(0,s.jsx)(b.JO,{className:"text-[#0584c7]",icon:"solar:check-circle-bold",width:20}):null,children:e.label},e.value))})]})})]})]})}),(0,s.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto bg-[#F6EFE9]",children:(0,s.jsx)("div",{className:"mx-auto min-h-screen px-6 py-8 md:px-10 md:py-10 lg:px-12 lg:py-12",children:i.userLoading&&!q?(0,s.jsx)("div",{className:"flex min-h-[calc(100vh-64px)] items-center justify-center",children:(0,s.jsx)(N.Z,{color:"#0584c7",size:46})}):q||0!==r.Children.count(a)?a:(0,s.jsx)("div",{className:"flex min-h-[calc(100vh-64px)] items-center justify-center",children:(0,s.jsxs)("div",{className:"w-full max-w-xl rounded-[32px] border border-gray-200 bg-white p-8 text-center shadow-sm",children:[(0,s.jsx)("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-[20px] bg-[#0584c7]/10 text-[#0584c7]",children:(0,s.jsx)(b.JO,{icon:"solar:user-circle-bold-duotone",width:32})}),(0,s.jsx)("h2",{className:"mt-6 text-2xl font-semibold text-gray-900",children:p("setting.sidebar.signInTitle")}),(0,s.jsx)("p",{className:"mx-auto mt-3 max-w-md text-sm leading-6 text-gray-600",children:p("setting.sidebar.signInDescription")}),(0,s.jsx)(m.A,{className:"mt-6 bg-[#0584c7] px-6 text-white hover:bg-[#0584c7]",radius:"full",onPress:()=>i.setOpenLoginPopup(!0,{type:"SignIn"}),children:p("setting.auth.toLoginBtn")})]})})})})]}),(0,s.jsx)(E.SignInPopup,{}),i.openGoogleOneTapLogin?(0,s.jsx)(L.Z,{children:(0,s.jsx)(I.Z,{loginSuccessCallback:()=>{}})}):null,(0,s.jsx)(k.vA,{showRightSnapButton:!1,language:Z.locale,isOpen:z,onOpenChange:A,user:q,openLoginPopup:()=>{i.setOpenLoginPopup(!0)}})]})})},10353:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSG:function(){return X},default:function(){return Q}});var s=a(15311),r=a(20132),i=a(33326),l=a.n(i),n=a(5762),c=a(5724),o=a(66887),d=a(76033),p=a(16661),x=a(3821),m=a(85655),u=a(27060),g=a(6381),h=a.n(g),f=a(96367),v=a(85909),y=a(9183),j=a(93131),b=e=>{let{userInfo:t}=e,{t:a}=(0,c.Z)("app"),r=(0,n.useRouter)(),{userStore:i}=(0,x.o)();return(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,s.jsxs)("h2",{className:"flex items-center gap-2 text-lg font-semibold",children:[(0,s.jsx)(j.Z,{className:"h-5 w-5 text-[var(--app-color-primary)]"}),a("setting.subscription.title")]}),(0,s.jsx)("button",{onClick:()=>r.push("/user/billing"),className:"text-sm font-medium text-[var(--app-color-primary)] hover:text-[var(--app-color-primary-dark)]",children:a("setting.subscription.editBilling")})]}),t.vipFlag?1===t.isSubscribe?(0,s.jsxs)("div",{className:"rounded-lg bg-gradient-to-r from-[var(--app-color-primary)] to-[var(--app-color-primary-dark)] p-4 text-[var(--app-color-inverse)]",children:[(0,s.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-xl font-bold",children:[i.getUserPlan()," Plan"]}),(0,s.jsx)("span",{className:"rounded-full bg-[rgba(var(--app-color-rgb),0.2)] px-3 py-1 text-sm",children:a("setting.subscription.active.title")})]}),(0,s.jsxs)("p",{className:"text-[var(--app-color-inverse)]/10 text-sm",children:[a("setting.subscription.active.nextRenewal"),":"," ",t.expireTimestamp?new Date(t.expireTimestamp).toLocaleStr
46ing():t.expireTime]})]}):(0,s.jsxs)("div",{className:"rounded-lg bg-[var(--app-gray-lighter)] p-4",children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,s.jsx)(y.Z,{className:"h-5 w-5 text-[var(--app-gray-medium)]"}),(0,s.jsx)("span",{className:"text-lg font-medium text-[var(--app-gray-darker)]",children:a("setting.subscription.cancelled.title")})]}),(0,s.jsx)("p",{className:"mb-4 text-sm text-[var(--app-gray-darker)]",children:a("setting.subscription.cancelled.content",{renewalDate:t.expireTimestamp?new Date(t.expireTimestamp).toLocaleString():t.expireTime})})]}):(0,s.jsxs)("div",{className:"rounded-lg bg-[var(--app-gray-lighter)] p-4",children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,s.jsx)(y.Z,{className:"h-5 w-5 text-[var(--app-gray-medium)]"}),(0,s.jsx)("span",{className:"text-lg font-medium text-[var(--app-gray-darker)]",children:a("setting.subscription.noActive.title")})]}),(0,s.jsx)("p",{className:"mb-4 text-sm text-[var(--app-gray-darker)]",children:a("setting.subscription.noActive.content")}),(0,s.jsx)("button",{onClick:()=>r.push("/pricing"),className:"rounded-lg bg-[var(--app-color-primary)] px-4 py-2 text-[var(--app-color-inverse)] hover:bg-[var(--app-color-primary-dark)]",children:a("setting.subscription.noActive.upgrade")})]})]})},N=a(81992);/** 47 * @license lucide-react v0.341.0 - ISC 48 * 49 * This source code is licensed under the ISC license. 50 * See the LICENSE file in the root directory of this source tree. 51 */let w=(0,N.Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var k=a(67925),C=a(87621),Z=a(92410),S=()=>{let{t:e}=(0,c.Z)("app"),[t,a]=(0,r.useState)(!1),[i,l]=(0,r.useState)(!1),o=(0,n.useRouter)(),{userStore:d}=(0,x.o)(),u=async()=>{if(!i){l(!0);try{let t=await (0,k.Z)({url:"https://api.yeschat.ai/api/v1/user/cancelAccount",method:"post"});200===t.code?(C.ZP.success(e("setting.dangerZone.successTips"),2),(0,m.sA)(),(0,m.ui)(null),(0,Z.googleLogout)(),o.push("/")):401===t.code&&d.loadUserInfo(),a(!1)}catch(e){console.log(e)}l(!1)}};return(0,s.jsxs)("div",{className:"rounded-xl bg-[var(--app-color-inverse)] p-6 shadow-sm",children:[(0,s.jsxs)("h2",{className:"mb-4 flex items-center gap-2 text-lg font-semibold text-[var(--app-state-danger)]",children:[(0,s.jsx)(w,{className:"h-5 w-5"}),e("setting.dangerZone.title")]}),t?(0,s.jsxs)("div",{className:"border-[var(--app-state-danger)]/20 bg-[var(--app-state-danger)]/5 rounded-lg border p-4",children:[(0,s.jsx)("p",{className:"mb-4 font-medium text-[var(--app-state-danger-dark)]",children:e("setting.dangerZone.tip")}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("button",{onClick:()=>{a(!1)},disabled:i,className:"rounded-lg bg-[var(--app-gray-lighter)] px-4 py-2 text-[var(--app-gray-darker)] transition-colors hover:bg-[var(--app-gray-light)]",children:e("setting.common.cancel")}),i?(0,s.jsxs)("button",{className:"bg-[var(--app-color-primary)]/[.06] flex place-content-center items-center gap-2 rounded-lg px-4 py-3 font-medium text-[var(--app-color-primary)] shadow-sm",children:[(0,s.jsx)(p.Z,{}),e("setting.common.loading")]}):(0,s.jsx)("button",{onClick:u,className:"rounded-lg bg-[var(--app-state-danger)] px-4 py-2 text-[var(--app-color-inverse)] transition-colors hover:bg-[var(--app-state-danger-dark)]",children:e("setting.common.confirm")})]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-4 text-[var(--app-gray-darker)]",children:e("setting.dangerZone.content")}),(0,s.jsx)("button",{onClick:()=>a(!0),className:"border-[var(--app-state-danger)]/20 hover:bg-[var(--app-state-danger)]/5 rounded-lg border px-4 py-2 text-[var(--app-state-danger)] transition-colors",children:e("setting.dangerZone.deleteAccount")})]})]})};/** 52 * @license lucide-react v0.341.0 - ISC 53 * 54 * This source code is licensed under the ISC license. 55 * See the LICENSE file in the root directory of this source tree. 56 */let D=(0,N.Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);var M=a(40326),I=a(81756),L=a(55392);function E(e){let{currentPage:t,totalPages:a,onPageChange:r}=e;return(0,s.jsx)("div",{className:"mt-3 flex w-full items-center justify-between border-[var(--app-gray-darkest)] px-3 py-2",children:(0,s.jsx)("div",{className:"flex flex-1 flex-wrap items-center justify-center",children:(0,s.jsx)("div",{children:(0,s.jsxs)("nav",{className:"isolate inline-flex -space-x-px rounded-md","aria-label":"Pagination",children:[t-1>=1&&(0,s.jsx)("span",{onClick:e=>r(t-1),className:"hover:bg-[var(--app-color-primary)]/15 relative inline-flex transform cursor-pointer items-center rounded-md px-2 py-2 text-[var(--app-gray-base)] duration-500 focus:z-20 focus:outline-offset-0",children:(0,s.jsx)(I.Z,{className:"h-5 w-5","aria-hidden":"true"})}),(()=>{let e=[];for(let i=1;i<=a;i++)1===i||i===a||i>=t-2&&i<=t+2?e.push((0,s.jsx)("span",{onClick:e=>r(i),className:`relative inline-flex cursor-pointer items-center rounded-md px-4 py-2 text-sm font-semibold ${t===i?"bg-[var(--app-color-primary)] text-[var(--app-color-inverse)]":"hover:bg-[var(--app-color-primary)]/15 text-[var(--app-gray-medium)]"}`,children:i},i)):i===t-3?e.push((0,s.jsx)("span",{onClick:e=>r(t-5>=1?t-5:1),className:"relative inline-flex cursor-pointer items-center px-4 py-2 text-sm font-semibold text-[var(--app-gray-medium)]",children:"..."},i)):i===t+3&&e.push((0,s.jsx)("span",{onClick:e=>r(t+5<=a?t+5:a),className:"relative inline-flex cursor-pointer items-center px-4 py-2 text-sm font-semibold text-[var(--app-gray-medium)]",children:"..."},i));return e})(),t+1<=a&&(0,s.jsx)("span",{onClick:e=>r(t+1),className:"hover:bg-[var(--app-color-primary)]/15 relative inline-flex transform cursor-pointer items-center rounded-md px-2 py-2 text-[var(--app-gray-base)] duration-500 focus:z-20 focus:outline-offset-0",children:(0,s.jsx)(L.Z,{className:"h-5 w-5","aria-hidden":"true"})})]})})})})}var P=e=>{let{userInfo:t}=e,{t:a}=(0,c.Z)("app"),{t:i}=(0,c.Z)("invitingFriends"),[l,n]=(0,r.useState)([]),[o,d]=(0,r.useState)(!1),[p,x]=(0,r.useState)(1),[m,u]=(0,r.useState)(1),g=(0,r.useRef)(!1),f=(0,r.useCallback)(e=>{g.current||(g.current=!0,d(!0),(0,k.Z)({url:`https://api.yeschat.ai/api/v1/shareRecord/pageShareRecord?pageSize=10&pageNum=${e}`,method:"get"}).then(e=>{n(e.data.records),u(e.data.pages)}).catch(()=>{n([])}).finally(()=>{g.current=!1,d(!1)}))},[]),v=(0,r.useCallback)(e=>{x(e)},[]);return(0,r.useEffect)(()=>{t?f(p):n([])},[p,f,t]),(0,s.jsxs)("div",{className:"rounded-xl bg-[var(--app-color-inverse)] p-6 shadow-sm",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,s.jsxs)("h2",{className:"flex items-center gap-2 text-lg font-semibold",children:[(0,s.jsx)(D,{className:"h-5 w-5 text-[var(--app-color-primary)]"}),i("settingShare.title"),o&&(0,s.jsx)(M.Z,{color:"var(--app-color-primary)",size:6}
56)]}),(0,s.jsx)(h(),{href:"/inviting-friends",className:"flex items-center gap-1 text-sm font-medium text-[var(--app-color-primary)] hover:text-[var(--app-color-primary-dark)]",children:i("settingShare.btn")})]}),l.length>0?(0,s.jsxs)("div",{className:"divide-y divide-[var(--app-gray-light)]",children:[(0,s.jsxs)("div",{className:"grid grid-cols-3 py-2 text-sm font-medium text-[var(--app-gray-darkest)]",children:[(0,s.jsx)("div",{children:i("settingShare.time")}),(0,s.jsx)("div",{children:i("settingShare.invitees")}),(0,s.jsx)("div",{children:i("settingShare.interests")})]}),l.map((e,t)=>(0,s.jsxs)("div",{className:"grid grid-cols-3 py-3 text-sm",children:[(0,s.jsx)("div",{className:"text-[var(--app-gray-darker)]",children:e.createTime}),(0,s.jsx)("div",{className:"text-[var(--app-text-h1)]",children:e.shareUserEmail}),(0,s.jsx)("div",{className:"text-[var(--app-gray-darker)]",children:e.awardCount})]},t))]}):(0,s.jsx)("div",{className:"py-8 text-center text-[var(--app-gray-draker)]",children:a("setting.invitation")}),l.length>0&&(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(E,{currentPage:p,totalPages:m,onPageChange:v})})]})},O=a(74590),B=a(17550),R=a(39912);function T(e){let{isPayproMessageOpen:t,setIsPayproMessageOpen:a,supportEmail:r}=e,{t:i}=(0,c.Z)("app");return(0,s.jsx)(R.Vq,{open:t,onOpenChange:a,children:(0,s.jsx)(R.cZ,{children:(0,s.jsx)(R.fK,{children:(0,s.jsx)(R.Be,{children:(0,s.jsxs)("div",{className:"flex w-full flex-col items-center gap-6",children:[(0,s.jsx)("div",{className:"w-full py-6 text-base text-[var(--app-gray-darker)]",children:i("setting.payproMessage.title",{email:r})}),(0,s.jsx)("button",{onClick:()=>a(!1),className:"rounded-full bg-[var(--app-color-primary-light)] px-6 py-2 text-[var(--app-color-inverse)] hover:bg-[var(--app-color-primary)]",children:i("setting.payproMessage.btn")})]})})})})})}function z(e){let{isOpen:t,onClose:a,userInfo:i}=e,{t:l}=(0,c.Z)("app"),[n,o]=(0,r.useState)(!1),{userStore:d}=(0,x.o)(),[p,m]=(0,r.useState)(!1);if(!t)return null;let u=async()=>{if("paypro"!==i.paymentMethod){m(!0);return}if(!n){o(!0);try{let e=await (0,k.Z)({url:"/api/v1/user/reset-count",method:"get"});200===e.code?(C.ZP.success(l("setting.usage.reset.success")),await d.loadUserInfo(),a()):C.ZP.error(e.msg)}catch(e){console.error("Failed to reset count:",e)}finally{o(!1)}}};return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:[(0,s.jsx)("div",{className:"m-4 w-full max-w-lg rounded-xl bg-white p-6",children:(0,s.jsxs)("div",{className:"flex items-start gap-4",children:[(0,s.jsx)("div",{className:"flex-shrink-0",children:(0,s.jsx)(y.Z,{className:"h-6 w-6 text-yellow-500"})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"mb-2 text-lg font-semibold text-gray-900",children:l("setting.usage.reset.title")}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"text-gray-600",children:l("setting.usage.reset.description")}),(0,s.jsx)("div",{className:"rounded-lg border border-yellow-100 bg-yellow-50 p-4 text-sm text-yellow-800",children:l("setting.usage.reset.note")}),(0,s.jsx)("div",{className:"rounded-lg border border-blue-100 bg-blue-50 p-4 text-sm text-blue-800",children:l("setting.usage.reset.tip")})]}),(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-3",children:[(0,s.jsx)("button",{onClick:a,disabled:n,className:"rounded-lg bg-gray-100 px-4 py-2 text-gray-700 hover:bg-gray-200",children:l("setting.common.cancel")}),n?(0,s.jsxs)("button",{className:"flex place-content-center items-center gap-2 rounded-lg bg-[#1165a4]/[.06] px-4 py-3 font-medium text-[#1165a4] shadow-sm",children:[(0,s.jsxs)("svg",{className:"-ml-1 mr-3 w-5 animate-spin text-[#1165a4]",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("setting.common.loading")]}):(0,s.jsx)("button",{onClick:u,className:"rounded-lg bg-sky-600 px-4 py-2 text-white hover:bg-sky-700",children:l("setting.common.confirm")})]})]})]})}),(0,s.jsx)(T,{isPayproMessageOpen:p,setIsPayproMessageOpen:m,supportEmail:"[email protected]"})]})}var A=a(81732),F=a(28324);/** 57 * @license lucide-react v0.341.0 - ISC 58 * 59 * This source code is licensed under the ISC license. 60 * See the LICENSE file in the root directory of this source tree. 61 */let V=(0,N.Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var _=a(92843),J=e=>{let{userInfo:t}=e,{t:a}=(0,c.Z)("app"),r=(e,t)=>0===t?0:e,i={used:r(t.mediaCreditsLimit-t.mediaCreditsRemain,t.mediaCreditsLimit),limit:t.mediaCreditsLimit},l={used:r(t.userBuyCreditsTotal-t.userBuyCreditsRemain,t.mediaCreditsLimit),limit:t.userBuyCreditsTotal},n=e=>e>=90?"bg-red-500":e>=70?"bg-yellow-500":"bg-[var(--app-color-primary)]",o=e=>{let{title:r,credits:i,endDate:l,isInfiniteLimit:c=!1}=e;return(0,s.jsxs)("div",{className:"rounded-lg border border-[var(--app-gray-light)] bg-[var(--app-color-inverse)] p-6",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:r}),(0,s.jsx)(B.Z,{className:"h-5 w-5 text-[var(--app-color-primary)]"})]}),(0,s.jsx)(A.Z,{title:a("setting.usage.credits"),usedQueries:i.used,limit:i.limit,colorClass:n,userInfo:t,type:"MediaCredits"}),l&&(0,s.jsxs)("div",{className:"mt-4 flex items-center rounded-lg bg-[var(--app-gray-lighter)] p-3 text-xs text-[var(--app-gray-darkest)]",children:[(0,s.jsx)(F.Z,{className:"mr-2 h-4 w-4 text-[var(--app-color-primary)]"}),(0,s.jsxs)("span",{children:[a("setting.usage.period.ends")," ",(0,_.rB)(t.mediaCreditsRedisKeyExpire,t.vipFlag),(0,s.jsxs)("span",{className:"ml-2 font-medium text-[var(--app-color-primary)]",children:["( ",a("setting.usage.daysLeft")," ",(0,_.dp)(t.mediaCreditsRedisKeyExpire,t.vipFlag),")"]})]})]}),c&&(0,s.jsx)(h(),{href:"/ad-credits",className:"mt-4 inline-block rounded-lg bg-[var(--app-color-primary)] px-4 py-2 text-white transition-colors hover:bg-[var(--app-color-primary-light)]",children:a("setting.usage.free.cta")})]})};return(0,s.jsxs)("div",{className:"mx-auto",children:[(0,s.jsxs)("div",{className:"grid gap-6 md:grid-cols-2",children:[(0,s.jsx)(o,{title:a("setting.usage.subscription"),credits:i,endDate:t.vipFlag}),t.userBuyCreditsRemain>0?(0,s.jsx)(o,{title:a("setting.usage.purchased"),credits:l,isInfiniteLimit:!0}):(0,s.jsx)(()=>(0,s.jsxs)("div",{className:"rounded-lg border border-[var(--app-gray-light)] bg-[var(--app-color-inverse)] p-6",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:a("setting.usage.purchased")}),(0,s.jsx)(B.Z,{className:"h-5 w-5 text-gray-300"})]}),(0,s.jsxs)("div",{className:"py-4 text-center",children:[(0,s.jsx)("h4",{className:"mb-2 font-medium text-[var(--app-text-h1)]",children:a("setting.usage.free.title")}),(0,s.jsx)("p",{className:"mb-4 text-sm text-[var(--app-gray-darkest)]",children:a("setting.usage.free.content")}),(0,s.jsx)(h(),{href:"/ad-credits",className:"rounded-lg bg-[var(--app-color-primary)] px-4 py-2 text-white transition-colors hover:bg-[var(--app-color-primary-light)]",children:a("setting.usage.free.cta")})]})]}),{})]}),(0,s.jsxs)("div",{className:"mt-6 flex items-start gap-2 rounded-lg bg-[var(--app-gray-lighter)] p-4 text-sm text-[var(--app-gray-darkest)]",children:[(0,s.jsx)(V,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),(0,s.jsx)("p",{children:a("setting.usage.tip")})]})]})},q=e=>{var t;let{userInfo:a}=e,{t:i}=(0,c.Z)("app"),[l,n]=(0,r.useState)(!1),o=[{type:"GPT4o",title:"GPT-4o",used:(t=a.gpt4DailyLimit-a.gpt4RemainCount,0===a.gpt4DailyLimit?0:t),limit:a.gpt4DailyLimit}].filter(e=>!!a.vipFlag||["GPT4o","ClaudeHaiku"].includes(e.type));return(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,s.jsxs)("h2",{className:"flex items-center gap-2 text-lg font-semibold",children:[(0,s.jsx)(O.Z,{className:"h-5 w-5 text-[var(--app-color-primary)]"}),i("setting.usage.title")]}),(0,s.jsx)("p",{className:"text-sm text-[var(--app-gray-darker)]",children:i("setting.usage.hour")})]}),(0,s.jsx)("div",{className:"rounded-lg border border-[var(--app-gray-light)] bg-[var(--app-color-inverse)] p-6",children:o.map((e,t)=>(0,s.jsx)("div",{className:t>0?"mt-8":"",children:(0,s.jsx)(A.Z,{title:e.title,usedQueries:e.used,limit:e.limit,colorClass:t=>(0,_.fC)(t,e.type),userInfo:a,type:e.type})},e.type))})]}),(0,s.jsxs)("div",{className:"mb-8 last:mb-0",children:[(0,s.jsx)("div",{className:"mb-4 flex items-center justify-between",children:(0,s.jsxs)("h2",{className:"flex items-center gap-2 text-lg font-semibold",children:[(0,s.jsx)(B.Z,{className:"h-5 w-5 text-[var(--app-color-primary)]"}),i("setting.usage.credits")]})}),(0,s.jsx)(J,{userInfo:a})]}),(0,s.jsx)(z,{userInfo:a,isOpen:l,onClose:()=>n(!1)})]})};let $=(0,d.Pi)(e=>{let{}=e,{userStore:t}=(0,x.o)(),{t:a}=(0,c.Z)("app");return t.user?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("section",{className:"group/sidebar-wrapper h-full overflow-y-auto bg-[var(--app-gray-lightest)]",children:(0,s.jsxs)("div",{className:"relative mx-auto flex max-w-5xl flex-1 flex-col gap-4 p-4 lg:p-8",children:[(0,s.jsxs)("div",{className:"divide-y divide-[var(--app-gray-light)] rounded-xl bg-[var(--app-color-inverse)] shadow-sm",children:[(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsx)("div",{className:"mb-4 flex items-center justify-between",children:(0,s.jsxs)("h2",{className:"flex items-center gap-2 text-lg font-semibold",children:[(0,s.jsx)(v.Z,{className:"h-5 w-5 text-[var(--app-color-primary)]"}),a("setting.profile.title")]})}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm text-[var(--app-gray-darker)]",children:a("setting.profile.emailAddress")}),(0,s.jsx)("p",{className:"text-[var(--app-gray-ultra)]",children:t.user.email})]})})]}),(0,s.jsx)(b,{userInfo:t.user}),(0,s.jsx)(q,{userInfo:t.user})]}),(0,s.jsx)(P,{userInfo:t.user}),(0,s.jsx)(S,{})]})})}):t.userLoading?(0,s.jsx)("div",{className:"bg-[var(--app-gray-extreme)]/50 fixed left-0 top-0 flex h-full w-full items-center justify-center",children:(0,s.jsx)(p.Z,{color:"var(--app-color-primary)",size:50})}):(0,s.jsx)("div",{className:"flex w-full items-center justify-center px-6 py-20 md:h-[400px]",children:(0,s.jsxs)(h(),{href:"/",className:"bg-[var(--app-color-primary)]/10 group mx-auto flex w-auto cursor-pointer items-center justify-center gap-2 rounded-full px-10 py-3 text-base font-medium text-[var(--app-color-primary)] transition duration-500 hover:bg-[var(--app-color-primary)] hover:text-[var(--app-color-inverse)]",children:[(0,s.jsx)(f.k,{icon:"login_ico",className:"w-4 fill-[var(--app-color-primary)] transition duration-500 group-hover:fill-[var(--app-color-inverse)]"}),a("toLoginBtn")]})})});var K=()=>(0,s.jsx)(u.Z,{selectedKey:"setting",children:(0,s.jsx)($,{})}),H=a(6621),W=a(43276),U=a(80775);let G=(0,d.Pi)(()=>{let{userStore:e}=(0,x.o)(),{t}=(0,c.Z)("app"),a=e.user;return a?(0,s.jsx)(U.Z,{activeKey:"settings",children:(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-3xl font-bold tracking-tight text-[var(--app-gray-ultra)]",children:t("setting.settings.title")}),(0,s.jsx)("p",{className:"mt-2 text-[var(--app-gray-darker)]",children:t("setting.settings.subtitle")})]}),(0,s.jsxs)("div",{className:"rounded-[28px] border border-[var(--app-gray-light)] bg-[var(--app-color-inverse)] p-6 shadow-sm md:p-8",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,s.jsx)("div",{className:"bg-[var(--app-color-primary)]/10 flex h-11 w-11 items-center justify-center rounded-2xl text-[var(--app-color-primary)]",children:(0,s.jsx)(v.Z,{size:20})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-[var(--app-gray-ultra)]",children:t("setting.profile.title")}),(0,s.jsx)("p",{className:"text-sm text-[var(--app-gray-darker)]",children:t("setting.settings.subtitle")})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-[var(--app-gray-light)] bg-[var(--app-gray-lighter)] p-4",children:[(0,s.jsxs)("div",{className:"mb-2 inline-flex items-center gap-2 text-sm font-medium text-[var(--app-gray-darkest)]",children:[(0,s.jsx)(H.Z,{size:16,className:"text-[var(--app-color-primary)]"}),t("setting.profile.emailAddress")]}),(0,s.jsx)("p",{className:"break-all text-sm text-[var(--app-gray-ultra)]",children:a.email})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-[var(--app-gray-light)] bg-[var(--app-gray-lighter)] p-4",children:[(0,s.jsxs)("div",{className:"mb-2 inline-flex items-center gap-2 text-sm font-medium text-[var(--app-gray-darkest)]",children:[(0,s.jsx)(W.Z,{size:16,className:"text-[var(--app-color-primary)]"}),t("setting.profile.password")]}),(0,s.jsx)("p",{className:"text-sm text-[var(--app-gray-ultra)]",children:"â¢â¢â¢â¢â¢â¢â¢â¢"}),(0,s.jsx)("button",{type:"button",onClick:()=>e.setOpenLoginPopup(!0,{type:"ForgotPassword",email:a.email,loginModalType:"resetPassword"}),className:"mt-4 text-sm font-medium text-[var(--app-color-primary)] transition-colors hover:text-[var(--app-color-primary-dark)]",children:t("setting.profile.resetPasswordBtn")})]})]})]}),(0,s.jsx)(P,{userInfo:a}),(0,s.jsx)(S,{})]})}):(0,s.jsx)(U.Z,{activeKey:"settings"})}),Y=(0,d.Pi)(()=>{let{userStore:e}=(0,x.o)(),t=(0,r.useRef)(e),a=e.user,i=(0,r.useRef)(!1),[l,n]=(0,r.useState)(!1),[c,o]=(0,r.useState)(!1),[d,u]=(0,r.useState)(!1),g=a&&"adyen"===a.paymentMethod;return((0,r.useEffect)(()=>
61{if(i.current)return;i.current=!0;let e=!1,a=!!(0,m.cD)();if(o(a),n(!0),!a){u(!0);return}return t.current.user||t.current.userLoading?u(!0):t.current.loadUserInfo().catch(()=>{}).finally(()=>{e||u(!0)}),()=>{e=!0}},[]),l&&(!c||d&&!e.userLoading||a))?g?(0,s.jsx)(G,{}):(0,s.jsx)(K,{}):(0,s.jsx)("div",{className:"fixed left-0 top-0 flex h-full w-full items-center justify-center bg-white/5 backdrop-blur-sm",children:(0,s.jsx)(p.Z,{color:"var(--app-color-primary)",size:50})})});var X=!0,Q=e=>{let{}=e,t=(0,n.useRouter)(),{t:a}=(0,c.Z)("common");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l(),{children:[(0,s.jsx)("title",{children:"Settings"}),(0,s.jsx)("meta",{name:"robots",content:"noindex"}),(0,o.t)(t,"/user/settings")]}),(0,s.jsx)("div",{className:"relative h-full w-full",children:(0,s.jsx)("main",{className:"h-full",children:(0,s.jsx)(Y,{})})})]})}},66304:function(e,t,a){"use strict";let s,r,i;a.d(t,{X3:function(){return g}});let l=(e,t)=>t.some(t=>e instanceof t),n=new WeakMap,c=new WeakMap,o=new WeakMap,d=new WeakMap,p=new WeakMap,x={get(e,t,a){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||o.get(e);if("store"===t)return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return m(e[t])},set:(e,t,a)=>(e[t]=a,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function m(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("success",r),e.removeEventListener("error",i)},r=()=>{t(m(e.result)),s()},i=()=>{a(e.error),s()};e.addEventListener("success",r),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&n.set(t,e)}).catch(()=>{}),p.set(t,e),t}(e);if(d.has(e))return d.get(e);let a="function"==typeof(t=e)?t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(u(this),e),m(n.get(this))}:function(...e){return m(t.apply(u(this),e))}:function(e,...a){let s=t.call(u(this),e,...a);return o.set(s,e.sort?e.sort():[e]),m(s)}:(t instanceof IDBTransaction&&function(e){if(c.has(e))return;let t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",i),e.removeEventListener("abort",i)},r=()=>{t(),s()},i=()=>{a(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",r),e.addEventListener("error",i),e.addEventListener("abort",i)});c.set(e,t)}(t),l(t,s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,x):t;return a!==e&&(d.set(e,a),p.set(a,e)),a}let u=e=>p.get(e);function g(e,t,{blocked:a,upgrade:s,blocking:r,terminated:i}={}){let l=indexedDB.open(e,t),n=m(l);return s&&l.addEventListener("upgradeneeded",e=>{s(m(l.result),e.oldVersion,e.newVersion,m(l.transaction),e)}),a&&l.addEventListener("blocked",e=>a(e.oldVersion,e.newVersion,e)),n.then(e=>{i&&e.addEventListener("close",()=>i()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),n}let h=["get","getKey","getAll","getAllKeys","count"],f=["put","add","delete","clear"],v=new Map;function y(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(v.get(t))return v.get(t);let a=t.replace(/FromIndex$/,""),s=t!==a,r=f.includes(a);if(!(a in(s?IDBIndex:IDBObjectStore).prototype)||!(r||h.includes(a)))return;let i=async function(e,...t){let i=this.transaction(e,r?"readwrite":"readonly"),l=i.store;return s&&(l=l.index(t.shift())),(await Promise.all([l[a](...t),r&&i.done]))[0]};return v.set(t,i),i}x={...i=x,get:(e,t,a)=>y(e,t)||i.get(e,t,a),has:(e,t)=>!!y(e,t)||i.has(e,t)}},81756:function(e,t,a){"use strict";var s=a(20132);let r=s.forwardRef(function(e,t){let{title:a,titleId:r,...i}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},i),a?s.createElement("title",{id:r},a):null,s.createElement("path",{fillRule:"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))});t.Z=r},55392:function(e,t,a){"use strict";var s=a(20132);let r=s.forwardRef(function(e,t){let{title:a,titleId:r,...i}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},i),a?s.createElement("title",{id:r},a):null,s.createElement("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))});t.Z=r}},function(e){e.O(0,[2251,4407,6342,7409,1888,4225,8494,4549,7721,7621,8771,3078,8896,8191,4466,6456,7305,2256,8919,7801,6367,4951,4288,1135,7060,2888,9774,179],function(){return e(e.s=6221)}),_N_E=e.O()}]);
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.