aidol 2.15.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +23 -16
- package/dist/client.js.map +1 -1
- package/dist/components/group/ChemistryRelationCard.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -23
- package/dist/index.js.map +1 -1
- package/dist/repositories/CompanionRelationshipRepository.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),v=require("react-i18next"),j=require("next/image"),V=require("react"),X=require("./relationship-B3AClL0U.js"),$t=require("react-markdown"),ta=require("remark-breaks"),aa=require("remark-gfm"),Q=require("framer-motion"),dl=require("react-dom"),bl=require("next/link");function Zl(a){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(l,n,s.get?s:{enumerable:!0,get:()=>a[n]})}}return l.default=a,Object.freeze(l)}const p=Zl(V);function da(a){var l,n,s="";if(typeof a=="string"||typeof a=="number")s+=a;else if(typeof a=="object")if(Array.isArray(a)){var m=a.length;for(l=0;l<m;l++)a[l]&&(n=da(a[l]))&&(s&&(s+=" "),s+=n)}else for(n in a)a[n]&&(s&&(s+=" "),s+=n);return s}function T(){for(var a,l,n=0,s="",m=arguments.length;n<m;n++)(a=arguments[n])&&(l=da(a))&&(s&&(s+=" "),s+=l);return s}const $=a=>l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())};function pl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const ba=p.forwardRef(pl);function zl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"}))}const Nl=p.forwardRef(zl);function cl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const ul=p.forwardRef(cl);function Wl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))}const vl=p.forwardRef(Wl);function Ol({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"}))}const il=p.forwardRef(Ol);function ql({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Vl=p.forwardRef(ql);function yl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const ol=p.forwardRef(yl);function Tl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"}))}const Gl=p.forwardRef(Tl);function Ml({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"}))}const Ll=p.forwardRef(Ml);function Ul({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5"}))}const kl=p.forwardRef(Ul);function jl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const Za=p.forwardRef(jl);function Sl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const Vt=p.forwardRef(Sl);function Jl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const Tt=p.forwardRef(Jl);function Yl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Xl=p.forwardRef(Yl);function Kl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))}const Gt=p.forwardRef(Kl);function xl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))}const dt=p.forwardRef(xl);function Fl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const pa=p.forwardRef(Fl),fl={default:"size-profile",profile:"size-full"};function bt({url:a,alt:l,variant:n="default"}){return t.jsx("div",{className:T("bg-base-200 relative overflow-hidden",n==="default"&&"rounded-lg",fl[n]),children:a?t.jsx(j,{src:a,alt:l,fill:!0,draggable:!1,className:"size-full object-cover"}):t.jsx("div",{className:"flex size-full items-center justify-center",children:t.jsx(dt,{className:"text-base-content/50 size-1/2"})})})}function w({companion:a,variant:l="grade",onClick:n,overlayText:s,disabled:m,className:r}){const{t:d}=v.useTranslation(),z=a.aidolId!==null&&l==="grade",N=n&&!z&&!m,q=l==="position"?"opacity-30":z?"opacity-20":"opacity-60",u=l==="position"?a.position?d(`aidol:position.${a.position}`):d("aidol:position.unassigned"):d("companion.grade",{grade:a.grade});return t.jsxs("div",{className:T("border-base-300 relative isolate overflow-hidden rounded-lg border",!r&&"h-card max-w-card w-full",N&&"cursor-pointer",r),onClick:N?n:void 0,role:N?"button":void 0,tabIndex:N?0:void 0,onKeyDown:N?$(n):void 0,children:[t.jsx("div",{className:"absolute inset-0",children:t.jsx(bt,{url:a.profilePictureUrl,alt:a.name??"",variant:"profile"})}),(z||m)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute inset-0 z-20 bg-white/50 backdrop-blur-xs"}),(z||s)&&t.jsx("div",{className:"absolute top-4 left-4 z-20",children:t.jsx("span",{className:"text-body-s w-fit rounded-lg bg-black px-2 py-1 text-white",children:z?d("companion.signed"):s})})]}),t.jsx("div",{className:T("absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-black to-transparent",q)}),t.jsxs("div",{className:"absolute inset-x-4 bottom-4 z-10 flex flex-col gap-2",children:[t.jsx("span",{className:"text-title-s text-white",children:a.name}),t.jsx("span",{className:"text-body-s w-fit rounded-lg bg-black px-2 py-1 text-white",children:u})]})]})}function hl({companions:a,onCompanionClick:l}){const{t:n}=v.useTranslation();return t.jsxs("div",{className:"mt-8",children:[t.jsx("h2",{className:"text-title-l mb-4 font-semibold",children:n("aidol:aidol.members")}),a&&a.length>0?t.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:a.map(s=>t.jsx(w,{companion:s,onClick:()=>l(s.id)},s.id))}):t.jsx("p",{className:"text-base-content/50 text-center",children:n("aidol:aidol.noMembers")})]})}function Rl({aidol:a}){return t.jsxs("div",{className:"flex flex-col items-center gap-4 py-8 text-center",children:[t.jsx("div",{className:"bg-base-200 relative size-32 overflow-hidden rounded-full",children:a.profileImageUrl?t.jsx(j,{src:a.profileImageUrl,alt:a.name??"Group",fill:!0,className:"object-cover"}):t.jsx("div",{className:"from-primary/20 to-secondary/20 flex size-full items-center justify-center bg-gradient-to-br",children:t.jsx(Gt,{className:"text-base-content/50 size-16"})})}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-display-s text-base-content font-bold",children:a.name}),a.concept&&t.jsx("p",{className:"text-body-l text-base-content/70 mt-2",children:a.concept})]})]})}function Cl(){const{t:a}=v.useTranslation(),[l,n]=V.useState(()=>typeof window>"u"?!0:localStorage.getItem("chatTooltipVisited")!=="true"),[s,m]=V.useState(!1),[r,d]=V.useState(!1);V.useEffect(()=>{l&&(m(!0),d(!0))},[l]);const b=()=>{d(!1),setTimeout(()=>{m(!1),n(!1),localStorage.setItem("chatTooltipVisited","true")},200)},z=()=>{l||(m(!0),setTimeout(()=>d(!0),10))},N=()=>{l||(d(!1),setTimeout(()=>m(!1),200))};return t.jsxs("div",{className:"relative",onMouseEnter:z,onMouseLeave:N,children:[t.jsx("button",{type:"button",className:"relative z-50 flex size-10 items-center justify-center",children:t.jsx(il,{className:"text-base-content/20 size-6"})}),s&&t.jsxs(t.Fragment,{children:[l&&t.jsx("div",{className:T("fixed inset-0 z-40 transition-opacity duration-200",r?"opacity-100":"opacity-0"),onClick:b}),t.jsxs("div",{className:T("absolute top-full right-0 z-50 mt-2 w-fit transition-opacity duration-200",r?"opacity-100":"opacity-0"),children:[t.jsx("div",{className:"border-b-neutral absolute -top-2 right-3 size-0 border-x-8 border-b-8 border-x-transparent"}),t.jsx("div",{className:"bg-neutral text-neutral-content text-label-m rounded-lg px-4 py-3 whitespace-nowrap",children:a("aidol:myGroup.chatComingSoon")})]})]})]})}function yt({fromName:a,toName:l,fromLabel:n,toLabel:s,relationshipType:m,description:r,onClose:d,onClick:b}){const{t:z}=v.useTranslation("aidol");return t.jsxs("div",{className:T("bg-base-200 border-base-400 flex flex-col gap-2 rounded-lg border p-4",b&&"cursor-pointer"),onClick:b,role:b?"button":void 0,tabIndex:b?0:void 0,onKeyDown:b?$(b):void 0,children:[m&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:m}),d&&t.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),d()},"aria-label":z("common.close"),className:"cursor-pointer",children:t.jsx(pa,{className:"text-base-content size-6"})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-body-s text-base-content",children:a}),t.jsx(Nl,{className:"text-base-content size-6"}),t.jsx("span",{className:"text-body-s text-base-content",children:l})]}),!m&&n&&s&&t.jsxs("span",{className:"text-label-m text-neutral",children:[n," — ",s]}),r&&t.jsx("span",{className:"text-label-m text-neutral",children:r})]})}function za({companion:a}){const{t:l}=v.useTranslation("aidol"),{name:n,profilePictureUrl:s,grade:m,mbti:r,position:d,biography:b}=a;return t.jsxs("div",{className:"bg-base-200 flex flex-col gap-4 rounded-lg p-4",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"border-base-300 relative size-[70px] shrink-0 overflow-hidden rounded-lg border",children:s?t.jsx(j,{src:s,alt:n??"",fill:!0,draggable:!1,className:"object-cover"}):t.jsx("div",{className:"flex size-full items-center justify-center",children:t.jsx(dt,{className:"text-neutral size-1/2"})})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-title-s text-base-content",children:n??""}),(m||r||d)&&t.jsxs("div",{className:"flex gap-1",children:[m&&t.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:l("companion.grade",{grade:m})}),r&&t.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:r}),d&&t.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:l(`position.${d}`)})]})]})]}),b&&t.jsx("div",{className:"bg-base-100 rounded-lg p-2",children:t.jsx("p",{className:"text-body-s text-base-content",children:b})})]})}function wl({companions:a,relationships:l,selectedMember:n,onSelectMember:s,onBack:m}){const{t:r}=v.useTranslation("aidol"),d=a.filter(N=>N.id!==n.id),b=N=>l.find(q=>q.fromCompanionId===n.id&&q.toCompanionId===N),z=N=>r(N?`position.${N}`:"position.unassigned");return t.jsxs("div",{className:"bg-base-100 max-w-mobile min-w-mobile mx-auto flex min-h-dvh flex-col",children:[t.jsxs("header",{className:"h-header bg-base-100 flex shrink-0 items-center gap-2 px-6 py-4",children:[t.jsx("button",{type:"button",onClick:m,"aria-label":"Back",children:t.jsx(ba,{className:"text-base-content size-6"})}),t.jsx("h1",{className:"text-headline-s text-base-content",children:r("chemistry.header")})]}),t.jsxs("div",{className:"flex flex-col px-4",children:[t.jsx("div",{className:"scrollbar-hide mt-6 flex gap-3 overflow-x-auto p-1",children:a.map(N=>t.jsxs("div",{role:"button",tabIndex:0,"aria-label":N.name??"",className:"flex shrink-0 flex-col items-center gap-3",onClick:()=>s(N.id),onKeyDown:$(()=>s(N.id)),children:[t.jsx("div",{className:T("relative size-17.5 overflow-hidden rounded-lg",N.id===n.id?"ring-primary ring-2":"border-base-300 border"),children:N.profilePictureUrl?t.jsx(j,{src:N.profilePictureUrl,alt:N.name??"",fill:!0,draggable:!1,className:"object-cover"}):t.jsx("div",{className:"bg-base-200 flex size-full items-center justify-center",children:t.jsx(dt,{className:"text-neutral size-8"})})}),t.jsx("span",{className:"text-label-l text-base-content text-center",children:N.name??""})]},N.id))}),t.jsx("div",{className:"mt-14",children:t.jsx(za,{companion:n})}),t.jsxs("div",{className:"mt-8 flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-title-s text-base-content",children:r("chemistry.sectionTitle")}),t.jsx("span",{className:"text-body-s text-neutral",children:r("chemistry.sectionSubtitle")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[d.map(N=>{const q=b(N.id);if(!q)return null;const u=X.INTIMACY_TO_RELATIONSHIP_TYPE[q.intimacy??0];return t.jsx(yt,{fromName:n.name??"",toName:N.name??"",relationshipType:q.nickname??void 0,description:u&&r(`aidol:chemistry.add.types.${u}`)},`custom-${N.id}`)}).filter(Boolean),d.map(N=>t.jsx(yt,{fromName:n.name??"",toName:N.name??"",fromLabel:z(n.position),toLabel:z(N.position)},`position-${N.id}`))]})]})]})]})}function Na({imageUrl:a,title:l,onClick:n}){return t.jsxs("div",{className:T("relative isolate h-[230px] w-full max-w-[345px] overflow-hidden rounded-lg",n&&"cursor-pointer"),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:n?$(n):void 0,children:[t.jsx(j,{src:a,alt:l,fill:!0,className:"object-cover"}),t.jsx("div",{className:"absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-black/50 to-transparent"}),t.jsx("div",{className:"absolute inset-x-4 bottom-4 z-10",children:t.jsx("span",{className:"text-headline-m text-neutral-content line-clamp-2",children:l})})]})}function Al({avatarUrl:a,groupName:l,memberCount:n,highlightImageUrl:s,highlightTitle:m,onClick:r}){const{t:d}=v.useTranslation("aidol");return t.jsxs("div",{className:T("flex flex-col gap-4",r&&"cursor-pointer"),onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:r?$(r):void 0,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"border-base-300 bg-base-200 relative size-12 shrink-0 overflow-hidden rounded-lg border",children:a?t.jsx(j,{src:a,alt:l,fill:!0,className:"object-cover"}):t.jsx("div",{className:"flex size-full items-center justify-center",children:t.jsx(Gt,{className:"text-neutral size-6"})})}),t.jsx("p",{className:"text-title-s text-base-content",children:n!=null?`${l} · ${d("groupList.memberCount",{count:n})}`:l})]}),s&&m?t.jsx(Na,{imageUrl:s,title:m}):null]})}function Dl({groups:a,selectedGroupId:l,onSelect:n,onClose:s}){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-40",onClick:s}),t.jsx("div",{className:"bg-base-100 border-base-400 absolute top-15 left-6 z-50 w-49.5 overflow-hidden rounded-lg border shadow-md",children:a.map((m,r)=>t.jsxs("button",{type:"button",onClick:()=>n(m),className:T("flex w-full items-center gap-2.5 p-2",{"border-base-400 border-b":r!==a.length-1,"bg-base-400":l===m.id,"hover:bg-base-200":l!==m.id}),children:[t.jsx("div",{className:"border-base-300 bg-base-200 size-10 shrink-0 overflow-hidden rounded-lg border",children:m.profileImageUrl&&t.jsx(j,{src:m.profileImageUrl,alt:m.name??"",width:40,height:40,className:"size-full object-cover"})}),t.jsx("span",{className:"text-body-s text-base-content truncate",children:m.name})]},m.id))})]})}function Ql({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const ca=p.forwardRef(Ql);function El({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{d:"m11.645 20.91-.007-.003-.022-.012a15.247 15.247 0 0 1-.383-.218 25.18 25.18 0 0 1-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0 1 12 5.052 5.5 5.5 0 0 1 16.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 0 1-4.244 3.17 15.247 15.247 0 0 1-.383.219l-.022.012-.007.004-.003.001a.752.752 0 0 1-.704 0l-.003-.001Z"}))}const gl=p.forwardRef(El);function Il({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{fillRule:"evenodd",d:"M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z",clipRule:"evenodd"}))}const Pl=p.forwardRef(Il);function Bl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{fillRule:"evenodd",d:"M18.685 19.097A9.723 9.723 0 0 0 21.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 0 0 3.065 7.097A9.716 9.716 0 0 0 12 21.75a9.716 9.716 0 0 0 6.685-2.653Zm-12.54-1.285A7.486 7.486 0 0 1 12 15a7.486 7.486 0 0 1 5.855 2.812A8.224 8.224 0 0 1 12 20.25a8.224 8.224 0 0 1-5.855-2.438ZM15.75 9a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z",clipRule:"evenodd"}))}const Hl=p.forwardRef(Bl);function _l(){const{t:a}=v.useTranslation("aidol");return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex flex-col items-start gap-1",children:[t.jsx(ca,{className:"text-primary size-6 shrink-0"}),t.jsx("h3",{className:"text-title-s text-base-content",children:a("groupList.infoBanner.title")})]}),t.jsx("p",{className:"text-body-s text-neutral",children:a("groupList.infoBanner.description")})]})}const $l=a=>{const l=new Date(a);if(isNaN(l.getTime()))return"-";const n=l.getFullYear(),s=String(l.getMonth()+1).padStart(2,"0"),m=String(l.getDate()).padStart(2,"0");return`${n}.${s}.${m}`},tn=a=>{const l=new Date(a);if(isNaN(l.getTime()))return 0;const s=new Date().getTime()-l.getTime();return Math.max(0,Math.floor(s/(1e3*60*60*24)))};function an({name:a,profileImageUrl:l,createdAt:n,onChemistryClick:s,onFollowClick:m}){const{t:r}=v.useTranslation("aidol");return t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsxs("div",{className:"flex items-center gap-5",children:[t.jsx("div",{className:"border-base-300 bg-base-200 relative size-20 shrink-0 overflow-hidden rounded-lg border",children:l?t.jsx(j,{src:l,alt:a,fill:!0,className:"object-cover"}):t.jsx("div",{className:"from-primary/20 to-secondary/20 flex size-full items-center justify-center bg-gradient-to-br",children:t.jsx(Gt,{className:"text-neutral size-10"})})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-label-l text-base-content",children:a}),t.jsxs("p",{className:"text-label-l text-base-content",children:[$l(n)," (D+",tn(n),")"]})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("button",{className:"btn btn-primary text-label-l w-full rounded-lg shadow-[0_0_4px_rgba(0,0,0,0.1)]",onClick:s,children:r("group.chemistryButton")}),m?t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{className:"btn bg-base-300 text-base-content text-label-l flex-1 rounded-lg",onClick:m,children:r("group.followButton")}),t.jsxs("button",{className:"btn bg-base-300 text-label-l disabled:bg-base-300 disabled:text-base-content/40 flex-1 rounded-lg",disabled:!0,children:[r("share"),t.jsx(Vt,{className:"size-5"})]})]}):t.jsxs("button",{className:"btn bg-base-300 text-label-l disabled:bg-base-300 disabled:text-base-content/40 w-full rounded-lg",disabled:!0,children:[r("share"),t.jsx(Vt,{className:"size-5"})]})]})]})}const Mt=({sensitivity:a=1.5}={})=>{const l=V.useRef(null),[n,s]=V.useState(!1),[m,r]=V.useState(!1),[d,b]=V.useState(0),[z,N]=V.useState(0);return{scrollRef:l,isDragging:n,hasDragged:m,handleMouseDown:W=>{l.current&&(s(!0),r(!1),b(W.pageX-l.current.offsetLeft),N(l.current.scrollLeft))},handleMouseMove:W=>{if(!n||!l.current)return;W.preventDefault(),r(!0);const x=(W.pageX-l.current.offsetLeft-d)*a;l.current.scrollLeft=z-x},handleMouseUp:()=>{s(!1)}}};function ln({items:a,onItemClick:l}){const{scrollRef:n,isDragging:s,handleMouseDown:m,handleMouseMove:r,handleMouseUp:d}=Mt();return t.jsx("div",{ref:n,className:T("scrollbar-hide -mx-6 overflow-x-auto select-none",s?"cursor-grabbing":"cursor-grab"),onMouseDown:m,onMouseMove:r,onMouseUp:d,onMouseLeave:d,children:t.jsx("div",{className:"flex gap-3.5 px-6",children:a.map(b=>t.jsx("button",{type:"button",onClick:()=>l(b),className:"bg-base-300 relative h-81.5 w-70 shrink-0 cursor-pointer overflow-hidden rounded-lg",children:t.jsx(j,{src:b.thumbnailUrl,alt:b.title,fill:!0,draggable:!1,className:"pointer-events-none object-cover"})},b.id))})})}function nn({title:a,subtitle:l,children:n}){return t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-title-s text-base-content break-keep",children:a}),l&&t.jsx("p",{className:"text-body-s text-neutral break-keep",children:l})]}),n]})}function g({value:a,onChange:l,placeholder:n,maxLength:s,disabled:m=!1,onKeyDown:r}){const d=V.useRef(null);return V.useLayoutEffect(()=>{const b=d.current;b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)},[a]),t.jsx("textarea",{ref:d,value:a,onChange:b=>l(b.target.value),onKeyDown:r,placeholder:n,maxLength:s,disabled:m,className:"textarea border-base-400 bg-base-200 min-h-0 w-full resize-none overflow-hidden rounded-lg px-4 py-3",rows:1})}function ua({onSubmit:a}){const{t:l}=v.useTranslation("aidol"),[n,s]=V.useState(""),m=async r=>{r?.preventDefault(),n.trim()&&(s(""),await a(n))};return t.jsxs("form",{onSubmit:m,className:"bg-base-100 border-base-400 flex items-end gap-2 border-t px-4 pt-2 pb-6",children:[t.jsx("div",{className:"flex-1",children:t.jsx(g,{value:n,onChange:s,placeholder:l("chat.placeholder"),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),m())}})}),t.jsx("button",{type:"submit",className:"btn btn-square btn-primary mb-1 rounded-lg",children:t.jsx(vl,{className:"size-3",strokeWidth:"2.5"})})]})}function E(){return t.jsx("div",{className:"flex flex-1 items-center justify-center",children:t.jsx("span",{className:"loading loading-spinner loading-lg text-primary"})})}function sn({isRetrying:a,onRetry:l}){const{t:n}=v.useTranslation("aidol");return t.jsxs("div",{className:"border-base-400 bg-base-200 flex max-w-50 flex-col gap-2 rounded-lg border p-2",children:[t.jsx("span",{className:"text-body-s text-base-content",children:n(a?"chat.typing":"chat.thinkingLong")}),t.jsx("button",{className:"bg-base-300 text-label-l text-base-content flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg p-1.5 shadow-sm",onClick:l,disabled:a,children:a?t.jsx("span",{className:"loading loading-spinner loading-sm text-primary"}):n("chat.reload")})]})}const la=(a,l)=>{const n=new Date(a),s=n.getHours(),m=s<12?l("chat.time.am"):l("chat.time.pm");return l("chat.time.format",{period:m,hour:String(s%12||12),minute:String(n.getMinutes()).padStart(2,"0")})},ot=(a,l)=>a.senderType===l.senderType,en=(a,l)=>ot(a,l)&&new Date(a.createdAt).getMinutes()===new Date(l.createdAt).getMinutes();function mn({message:a,prev:l,next:n,companionName:s,companionImageUrl:m,onResend:r,onRetryGenerate:d}){const{t:b}=v.useTranslation("aidol"),z=!l||!ot(l,a),N=!n||!ot(a,n),q=!l||!en(l,a),u=z&&l?"mb-4":"mb-2";if(a.senderType===X.SenderType.USER){const W=()=>a.status===X.MessageStatus.ERROR?t.jsxs("button",{className:"bg-error text-error-content flex cursor-pointer items-center gap-1 rounded-lg p-2",onClick:()=>r?.(a),children:[t.jsx(ul,{className:"size-4"}),t.jsx("span",{className:"text-label-s",children:b("chat.resend")})]}):a.status===X.MessageStatus.SENDING?t.jsx(kl,{className:"text-base-400 size-4 rotate-180"}):q?t.jsx("span",{className:"text-label-s text-base-content/50",children:la(a.createdAt,b)}):null;return t.jsx("div",{className:T("flex items-end gap-2 self-end",u),children:t.jsx("div",{className:"flex flex-col gap-2",children:t.jsxs("div",{className:"flex flex-row-reverse items-end gap-1",children:[t.jsx("div",{className:"text-body-s bg-base-300 w-fit max-w-[200px] rounded-lg p-2",children:t.jsx($t,{remarkPlugins:[aa,ta],className:"prose prose-sm text-base-content max-w-none",children:a.content})}),W()]})})})}const i=a.status===X.MessageStatus.ERROR||a.status===X.MessageStatus.SENDING;return t.jsxs("div",{className:T("flex items-end gap-2",u),children:[t.jsx("div",{className:"w-10 shrink-0 self-start",children:N&&t.jsx(j,{src:m??"",alt:s,width:40,height:40,className:"rounded-lg object-cover"})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[N&&t.jsx("span",{className:"text-body-s text-base-content",children:s}),i?t.jsx(sn,{isRetrying:a.status===X.MessageStatus.SENDING,onRetry:()=>d?.(a)}):t.jsxs("div",{className:"flex items-end gap-1",children:[t.jsx("div",{className:"text-body-s bg-secondary w-fit max-w-50 rounded-lg p-2",children:t.jsx($t,{remarkPlugins:[aa,ta],className:"prose prose-sm text-secondary-content max-w-none",children:a.content})}),q&&t.jsx("span",{className:"text-label-s text-base-content/50",children:la(a.createdAt,b)})]})]})]})}function rn({newestMessage:a,companionName:l,companionImageUrl:n}){const{t:s}=v.useTranslation("aidol"),m=!a||a.senderType!==X.SenderType.COMPANION;return t.jsxs("div",{className:T("flex items-end gap-2",m&&"mt-2"),children:[t.jsx("div",{className:"w-10 shrink-0 self-start",children:m&&t.jsx(j,{src:n??"",alt:l,width:40,height:40,className:"rounded-lg object-cover"})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[m&&t.jsx("span",{className:"text-body-s text-base-content",children:l}),t.jsx("div",{className:"text-body-s bg-base-400 text-base-content w-fit rounded-lg p-2",children:s("chat.typing")})]})]})}const dn=3,bn=a=>a.flatMap(l=>{if(l.senderType!==X.SenderType.COMPANION)return[l];if(l.status===X.MessageStatus.ERROR||l.status===X.MessageStatus.SENDING)return[l];const n=l.content.split(`
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),v=require("react-i18next"),j=require("next/image"),V=require("react"),X=require("./relationship-B3AClL0U.js"),$t=require("react-markdown"),ta=require("remark-breaks"),aa=require("remark-gfm"),Q=require("framer-motion"),dl=require("react-dom"),bl=require("next/link");function Zl(a){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(l,n,s.get?s:{enumerable:!0,get:()=>a[n]})}}return l.default=a,Object.freeze(l)}const p=Zl(V);function da(a){var l,n,s="";if(typeof a=="string"||typeof a=="number")s+=a;else if(typeof a=="object")if(Array.isArray(a)){var m=a.length;for(l=0;l<m;l++)a[l]&&(n=da(a[l]))&&(s&&(s+=" "),s+=n)}else for(n in a)a[n]&&(s&&(s+=" "),s+=n);return s}function T(){for(var a,l,n=0,s="",m=arguments.length;n<m;n++)(a=arguments[n])&&(l=da(a))&&(s&&(s+=" "),s+=l);return s}const $=a=>l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())};function pl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const ba=p.forwardRef(pl);function zl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"}))}const Nl=p.forwardRef(zl);function cl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const ul=p.forwardRef(cl);function Wl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))}const vl=p.forwardRef(Wl);function Ol({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"}))}const il=p.forwardRef(Ol);function ql({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Vl=p.forwardRef(ql);function yl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const ol=p.forwardRef(yl);function Tl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"}))}const Gl=p.forwardRef(Tl);function Ml({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"}))}const Ll=p.forwardRef(Ml);function Ul({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5"}))}const kl=p.forwardRef(Ul);function jl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const Za=p.forwardRef(jl);function Sl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const Vt=p.forwardRef(Sl);function Jl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const Tt=p.forwardRef(Jl);function Yl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Xl=p.forwardRef(Yl);function Kl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))}const Gt=p.forwardRef(Kl);function xl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))}const dt=p.forwardRef(xl);function Fl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const pa=p.forwardRef(Fl),fl={default:"size-profile",profile:"size-full"};function bt({url:a,alt:l,variant:n="default"}){return t.jsx("div",{className:T("bg-base-200 relative overflow-hidden",n==="default"&&"rounded-lg",fl[n]),children:a?t.jsx(j,{src:a,alt:l,fill:!0,draggable:!1,className:"size-full object-cover"}):t.jsx("div",{className:"flex size-full items-center justify-center",children:t.jsx(dt,{className:"text-base-content/50 size-1/2"})})})}function w({companion:a,variant:l="grade",onClick:n,overlayText:s,disabled:m,className:r}){const{t:d}=v.useTranslation(),z=a.aidolId!==null&&l==="grade",N=n&&!z&&!m,q=l==="position"?"opacity-30":z?"opacity-20":"opacity-60",u=l==="position"?a.position?d(`aidol:position.${a.position}`):d("aidol:position.unassigned"):d("companion.grade",{grade:a.grade});return t.jsxs("div",{className:T("border-base-300 relative isolate overflow-hidden rounded-lg border",!r&&"h-card max-w-card w-full",N&&"cursor-pointer",r),onClick:N?n:void 0,role:N?"button":void 0,tabIndex:N?0:void 0,onKeyDown:N?$(n):void 0,children:[t.jsx("div",{className:"absolute inset-0",children:t.jsx(bt,{url:a.profilePictureUrl,alt:a.name??"",variant:"profile"})}),(z||m)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute inset-0 z-20 bg-white/50 backdrop-blur-xs"}),(z||s)&&t.jsx("div",{className:"absolute top-4 left-4 z-20",children:t.jsx("span",{className:"text-body-s w-fit rounded-lg bg-black px-2 py-1 text-white",children:z?d("companion.signed"):s})})]}),t.jsx("div",{className:T("absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-black to-transparent",q)}),t.jsxs("div",{className:"absolute inset-x-4 bottom-4 z-10 flex flex-col gap-2",children:[t.jsx("span",{className:"text-title-s text-white",children:a.name}),t.jsx("span",{className:"text-body-s w-fit rounded-lg bg-black px-2 py-1 text-white",children:u})]})]})}function hl({companions:a,onCompanionClick:l}){const{t:n}=v.useTranslation();return t.jsxs("div",{className:"mt-8",children:[t.jsx("h2",{className:"text-title-l mb-4 font-semibold",children:n("aidol:aidol.members")}),a&&a.length>0?t.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:a.map(s=>t.jsx(w,{companion:s,onClick:()=>l(s.id)},s.id))}):t.jsx("p",{className:"text-base-content/50 text-center",children:n("aidol:aidol.noMembers")})]})}function Rl({aidol:a}){return t.jsxs("div",{className:"flex flex-col items-center gap-4 py-8 text-center",children:[t.jsx("div",{className:"bg-base-200 relative size-32 overflow-hidden rounded-full",children:a.profileImageUrl?t.jsx(j,{src:a.profileImageUrl,alt:a.name??"Group",fill:!0,className:"object-cover"}):t.jsx("div",{className:"from-primary/20 to-secondary/20 flex size-full items-center justify-center bg-gradient-to-br",children:t.jsx(Gt,{className:"text-base-content/50 size-16"})})}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-display-s text-base-content font-bold",children:a.name}),a.concept&&t.jsx("p",{className:"text-body-l text-base-content/70 mt-2",children:a.concept})]})]})}function Cl(){const{t:a}=v.useTranslation(),[l,n]=V.useState(()=>typeof window>"u"?!0:localStorage.getItem("chatTooltipVisited")!=="true"),[s,m]=V.useState(!1),[r,d]=V.useState(!1);V.useEffect(()=>{l&&(m(!0),d(!0))},[l]);const b=()=>{d(!1),setTimeout(()=>{m(!1),n(!1),localStorage.setItem("chatTooltipVisited","true")},200)},z=()=>{l||(m(!0),setTimeout(()=>d(!0),10))},N=()=>{l||(d(!1),setTimeout(()=>m(!1),200))};return t.jsxs("div",{className:"relative",onMouseEnter:z,onMouseLeave:N,children:[t.jsx("button",{type:"button",className:"relative z-50 flex size-10 items-center justify-center",children:t.jsx(il,{className:"text-base-content/20 size-6"})}),s&&t.jsxs(t.Fragment,{children:[l&&t.jsx("div",{className:T("fixed inset-0 z-40 transition-opacity duration-200",r?"opacity-100":"opacity-0"),onClick:b}),t.jsxs("div",{className:T("absolute top-full right-0 z-50 mt-2 w-fit transition-opacity duration-200",r?"opacity-100":"opacity-0"),children:[t.jsx("div",{className:"border-b-neutral absolute -top-2 right-3 size-0 border-x-8 border-b-8 border-x-transparent"}),t.jsx("div",{className:"bg-neutral text-neutral-content text-label-m rounded-lg px-4 py-3 whitespace-nowrap",children:a("aidol:myGroup.chatComingSoon")})]})]})]})}function yt({fromName:a,toName:l,fromLabel:n,toLabel:s,relationshipType:m,description:r,onClose:d,onClick:b}){const{t:z}=v.useTranslation("aidol");return t.jsxs("div",{className:T("bg-base-200 border-base-400 relative flex flex-col gap-2 rounded-lg border p-4",b&&"cursor-pointer"),onClick:b,role:b?"button":void 0,tabIndex:b?0:void 0,onKeyDown:b?$(b):void 0,children:[d&&t.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),d()},"aria-label":z("common.close"),className:"absolute top-4 right-4 cursor-pointer",children:t.jsx(pa,{className:"text-base-content size-6"})}),m&&t.jsx("span",{className:T("text-label-l bg-base-content text-base-100 self-start rounded-lg px-2 py-1",d&&"mr-8"),children:m}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-body-s text-base-content",children:a}),t.jsx(Nl,{className:"text-base-content size-6"}),t.jsx("span",{className:"text-body-s text-base-content",children:l})]}),!m&&n&&s&&t.jsxs("span",{className:"text-label-m text-neutral",children:[n," — ",s]}),r&&t.jsx("span",{className:"text-label-m text-neutral",children:r})]})}function za({companion:a}){const{t:l}=v.useTranslation("aidol"),{name:n,profilePictureUrl:s,grade:m,mbti:r,position:d,biography:b}=a;return t.jsxs("div",{className:"bg-base-200 flex flex-col gap-4 rounded-lg p-4",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"border-base-300 relative size-[70px] shrink-0 overflow-hidden rounded-lg border",children:s?t.jsx(j,{src:s,alt:n??"",fill:!0,draggable:!1,className:"object-cover"}):t.jsx("div",{className:"flex size-full items-center justify-center",children:t.jsx(dt,{className:"text-neutral size-1/2"})})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-title-s text-base-content",children:n??""}),(m||r||d)&&t.jsxs("div",{className:"flex gap-1",children:[m&&t.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:l("companion.grade",{grade:m})}),r&&t.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:r}),d&&t.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:l(`position.${d}`)})]})]})]}),b&&t.jsx("div",{className:"bg-base-100 rounded-lg p-2",children:t.jsx("p",{className:"text-body-s text-base-content",children:b})})]})}function wl({companions:a,relationships:l,selectedMember:n,onSelectMember:s,onBack:m}){const{t:r}=v.useTranslation("aidol"),d=a.filter(N=>N.id!==n.id),b=N=>l.find(q=>q.fromCompanionId===n.id&&q.toCompanionId===N),z=N=>r(N?`position.${N}`:"position.unassigned");return t.jsxs("div",{className:"bg-base-100 max-w-mobile min-w-mobile mx-auto flex min-h-dvh flex-col",children:[t.jsxs("header",{className:"h-header bg-base-100 flex shrink-0 items-center gap-2 px-6 py-4",children:[t.jsx("button",{type:"button",onClick:m,"aria-label":"Back",children:t.jsx(ba,{className:"text-base-content size-6"})}),t.jsx("h1",{className:"text-headline-s text-base-content",children:r("chemistry.header")})]}),t.jsxs("div",{className:"flex flex-col px-4",children:[t.jsx("div",{className:"scrollbar-hide mt-6 flex gap-3 overflow-x-auto p-1",children:a.map(N=>t.jsxs("div",{role:"button",tabIndex:0,"aria-label":N.name??"",className:"flex shrink-0 flex-col items-center gap-3",onClick:()=>s(N.id),onKeyDown:$(()=>s(N.id)),children:[t.jsx("div",{className:T("relative size-17.5 overflow-hidden rounded-lg",N.id===n.id?"ring-primary ring-2":"border-base-300 border"),children:N.profilePictureUrl?t.jsx(j,{src:N.profilePictureUrl,alt:N.name??"",fill:!0,draggable:!1,className:"object-cover"}):t.jsx("div",{className:"bg-base-200 flex size-full items-center justify-center",children:t.jsx(dt,{className:"text-neutral size-8"})})}),t.jsx("span",{className:"text-label-l text-base-content text-center",children:N.name??""})]},N.id))}),t.jsx("div",{className:"mt-14",children:t.jsx(za,{companion:n})}),t.jsxs("div",{className:"mt-8 flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"text-title-s text-base-content",children:r("chemistry.sectionTitle")}),t.jsx("span",{className:"text-body-s text-neutral",children:r("chemistry.sectionSubtitle")})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[d.map(N=>{const q=b(N.id);if(!q)return null;const u=X.INTIMACY_TO_RELATIONSHIP_TYPE[q.intimacy??0];return t.jsx(yt,{fromName:n.name??"",toName:N.name??"",relationshipType:q.nickname??void 0,description:u&&r(`aidol:chemistry.add.types.${u}`)},`custom-${N.id}`)}).filter(Boolean),d.map(N=>t.jsx(yt,{fromName:n.name??"",toName:N.name??"",fromLabel:z(n.position),toLabel:z(N.position)},`position-${N.id}`))]})]})]})]})}function Na({imageUrl:a,title:l,onClick:n}){return t.jsxs("div",{className:T("relative isolate h-[230px] w-full max-w-[345px] overflow-hidden rounded-lg",n&&"cursor-pointer"),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:n?$(n):void 0,children:[t.jsx(j,{src:a,alt:l,fill:!0,className:"object-cover"}),t.jsx("div",{className:"absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-black/50 to-transparent"}),t.jsx("div",{className:"absolute inset-x-4 bottom-4 z-10",children:t.jsx("span",{className:"text-headline-m text-neutral-content line-clamp-2",children:l})})]})}function Al({avatarUrl:a,groupName:l,memberCount:n,highlightImageUrl:s,highlightTitle:m,onClick:r}){const{t:d}=v.useTranslation("aidol");return t.jsxs("div",{className:T("flex flex-col gap-4",r&&"cursor-pointer"),onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:r?$(r):void 0,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"border-base-300 bg-base-200 relative size-12 shrink-0 overflow-hidden rounded-lg border",children:a?t.jsx(j,{src:a,alt:l,fill:!0,className:"object-cover"}):t.jsx("div",{className:"flex size-full items-center justify-center",children:t.jsx(Gt,{className:"text-neutral size-6"})})}),t.jsx("p",{className:"text-title-s text-base-content",children:n!=null?`${l} · ${d("groupList.memberCount",{count:n})}`:l})]}),s&&m?t.jsx(Na,{imageUrl:s,title:m}):null]})}function Dl({groups:a,selectedGroupId:l,onSelect:n,onClose:s}){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-40",onClick:s}),t.jsx("div",{className:"bg-base-100 border-base-400 absolute top-15 left-6 z-50 w-49.5 overflow-hidden rounded-lg border shadow-md",children:a.map((m,r)=>t.jsxs("button",{type:"button",onClick:()=>n(m),className:T("flex w-full items-center gap-2.5 p-2",{"border-base-400 border-b":r!==a.length-1,"bg-base-400":l===m.id,"hover:bg-base-200":l!==m.id}),children:[t.jsx("div",{className:"border-base-300 bg-base-200 size-10 shrink-0 overflow-hidden rounded-lg border",children:m.profileImageUrl&&t.jsx(j,{src:m.profileImageUrl,alt:m.name??"",width:40,height:40,className:"size-full object-cover"})}),t.jsx("span",{className:"text-body-s text-base-content truncate",children:m.name})]},m.id))})]})}function Ql({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const ca=p.forwardRef(Ql);function El({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{d:"m11.645 20.91-.007-.003-.022-.012a15.247 15.247 0 0 1-.383-.218 25.18 25.18 0 0 1-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0 1 12 5.052 5.5 5.5 0 0 1 16.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 0 1-4.244 3.17 15.247 15.247 0 0 1-.383.219l-.022.012-.007.004-.003.001a.752.752 0 0 1-.704 0l-.003-.001Z"}))}const gl=p.forwardRef(El);function Il({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{fillRule:"evenodd",d:"M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z",clipRule:"evenodd"}))}const Pl=p.forwardRef(Il);function Bl({title:a,titleId:l,...n},s){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},n),a?p.createElement("title",{id:l},a):null,p.createElement("path",{fillRule:"evenodd",d:"M18.685 19.097A9.723 9.723 0 0 0 21.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 0 0 3.065 7.097A9.716 9.716 0 0 0 12 21.75a9.716 9.716 0 0 0 6.685-2.653Zm-12.54-1.285A7.486 7.486 0 0 1 12 15a7.486 7.486 0 0 1 5.855 2.812A8.224 8.224 0 0 1 12 20.25a8.224 8.224 0 0 1-5.855-2.438ZM15.75 9a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z",clipRule:"evenodd"}))}const Hl=p.forwardRef(Bl);function _l(){const{t:a}=v.useTranslation("aidol");return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex flex-col items-start gap-1",children:[t.jsx(ca,{className:"text-primary size-6 shrink-0"}),t.jsx("h3",{className:"text-title-s text-base-content",children:a("groupList.infoBanner.title")})]}),t.jsx("p",{className:"text-body-s text-neutral",children:a("groupList.infoBanner.description")})]})}const $l=a=>{const l=new Date(a);if(isNaN(l.getTime()))return"-";const n=l.getFullYear(),s=String(l.getMonth()+1).padStart(2,"0"),m=String(l.getDate()).padStart(2,"0");return`${n}.${s}.${m}`},tn=a=>{const l=new Date(a);if(isNaN(l.getTime()))return 0;const s=new Date().getTime()-l.getTime();return Math.max(0,Math.floor(s/(1e3*60*60*24)))};function an({name:a,profileImageUrl:l,createdAt:n,onChemistryClick:s,onFollowClick:m}){const{t:r}=v.useTranslation("aidol");return t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsxs("div",{className:"flex items-center gap-5",children:[t.jsx("div",{className:"border-base-300 bg-base-200 relative size-20 shrink-0 overflow-hidden rounded-lg border",children:l?t.jsx(j,{src:l,alt:a,fill:!0,className:"object-cover"}):t.jsx("div",{className:"from-primary/20 to-secondary/20 flex size-full items-center justify-center bg-gradient-to-br",children:t.jsx(Gt,{className:"text-neutral size-10"})})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-label-l text-base-content",children:a}),t.jsxs("p",{className:"text-label-l text-base-content",children:[$l(n)," (D+",tn(n),")"]})]})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("button",{className:"btn btn-primary text-label-l w-full rounded-lg shadow-[0_0_4px_rgba(0,0,0,0.1)]",onClick:s,children:r("group.chemistryButton")}),m?t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{className:"btn bg-base-300 text-base-content text-label-l flex-1 rounded-lg",onClick:m,children:r("group.followButton")}),t.jsxs("button",{className:"btn bg-base-300 text-label-l disabled:bg-base-300 disabled:text-base-content/40 flex-1 rounded-lg",disabled:!0,children:[r("share"),t.jsx(Vt,{className:"size-5"})]})]}):t.jsxs("button",{className:"btn bg-base-300 text-label-l disabled:bg-base-300 disabled:text-base-content/40 w-full rounded-lg",disabled:!0,children:[r("share"),t.jsx(Vt,{className:"size-5"})]})]})]})}const Mt=({sensitivity:a=1.5}={})=>{const l=V.useRef(null),[n,s]=V.useState(!1),[m,r]=V.useState(!1),[d,b]=V.useState(0),[z,N]=V.useState(0);return{scrollRef:l,isDragging:n,hasDragged:m,handleMouseDown:W=>{l.current&&(s(!0),r(!1),b(W.pageX-l.current.offsetLeft),N(l.current.scrollLeft))},handleMouseMove:W=>{if(!n||!l.current)return;W.preventDefault(),r(!0);const x=(W.pageX-l.current.offsetLeft-d)*a;l.current.scrollLeft=z-x},handleMouseUp:()=>{s(!1)}}};function ln({items:a,onItemClick:l}){const{scrollRef:n,isDragging:s,handleMouseDown:m,handleMouseMove:r,handleMouseUp:d}=Mt();return t.jsx("div",{ref:n,className:T("scrollbar-hide -mx-6 overflow-x-auto select-none",s?"cursor-grabbing":"cursor-grab"),onMouseDown:m,onMouseMove:r,onMouseUp:d,onMouseLeave:d,children:t.jsx("div",{className:"flex gap-3.5 px-6",children:a.map(b=>t.jsx("button",{type:"button",onClick:()=>l(b),className:"bg-base-300 relative h-81.5 w-70 shrink-0 cursor-pointer overflow-hidden rounded-lg",children:t.jsx(j,{src:b.thumbnailUrl,alt:b.title,fill:!0,draggable:!1,className:"pointer-events-none object-cover"})},b.id))})})}function nn({title:a,subtitle:l,children:n}){return t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-title-s text-base-content break-keep",children:a}),l&&t.jsx("p",{className:"text-body-s text-neutral break-keep",children:l})]}),n]})}function g({value:a,onChange:l,placeholder:n,maxLength:s,disabled:m=!1,onKeyDown:r}){const d=V.useRef(null);return V.useLayoutEffect(()=>{const b=d.current;b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)},[a]),t.jsx("textarea",{ref:d,value:a,onChange:b=>l(b.target.value),onKeyDown:r,placeholder:n,maxLength:s,disabled:m,className:"textarea border-base-400 bg-base-200 min-h-0 w-full resize-none overflow-hidden rounded-lg px-4 py-3",rows:1})}function ua({onSubmit:a}){const{t:l}=v.useTranslation("aidol"),[n,s]=V.useState(""),m=async r=>{r?.preventDefault(),n.trim()&&(s(""),await a(n))};return t.jsxs("form",{onSubmit:m,className:"bg-base-100 border-base-400 flex items-end gap-2 border-t px-4 pt-2 pb-6",children:[t.jsx("div",{className:"flex-1",children:t.jsx(g,{value:n,onChange:s,placeholder:l("chat.placeholder"),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),m())}})}),t.jsx("button",{type:"submit",className:"btn btn-square btn-primary mb-1 rounded-lg",children:t.jsx(vl,{className:"size-3",strokeWidth:"2.5"})})]})}function E(){return t.jsx("div",{className:"flex flex-1 items-center justify-center",children:t.jsx("span",{className:"loading loading-spinner loading-lg text-primary"})})}function sn({isRetrying:a,onRetry:l}){const{t:n}=v.useTranslation("aidol");return t.jsxs("div",{className:"border-base-400 bg-base-200 flex max-w-50 flex-col gap-2 rounded-lg border p-2",children:[t.jsx("span",{className:"text-body-s text-base-content",children:n(a?"chat.typing":"chat.thinkingLong")}),t.jsx("button",{className:"bg-base-300 text-label-l text-base-content flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg p-1.5 shadow-sm",onClick:l,disabled:a,children:a?t.jsx("span",{className:"loading loading-spinner loading-sm text-primary"}):n("chat.reload")})]})}const la=(a,l)=>{const n=new Date(a),s=n.getHours(),m=s<12?l("chat.time.am"):l("chat.time.pm");return l("chat.time.format",{period:m,hour:String(s%12||12),minute:String(n.getMinutes()).padStart(2,"0")})},ot=(a,l)=>a.senderType===l.senderType,en=(a,l)=>ot(a,l)&&new Date(a.createdAt).getMinutes()===new Date(l.createdAt).getMinutes();function mn({message:a,prev:l,next:n,companionName:s,companionImageUrl:m,onResend:r,onRetryGenerate:d}){const{t:b}=v.useTranslation("aidol"),z=!l||!ot(l,a),N=!n||!ot(a,n),q=!l||!en(l,a),u=z&&l?"mb-4":"mb-2";if(a.senderType===X.SenderType.USER){const W=()=>a.status===X.MessageStatus.ERROR?t.jsxs("button",{className:"bg-error text-error-content flex cursor-pointer items-center gap-1 rounded-lg p-2",onClick:()=>r?.(a),children:[t.jsx(ul,{className:"size-4"}),t.jsx("span",{className:"text-label-s",children:b("chat.resend")})]}):a.status===X.MessageStatus.SENDING?t.jsx(kl,{className:"text-base-400 size-4 rotate-180"}):q?t.jsx("span",{className:"text-label-s text-base-content/50",children:la(a.createdAt,b)}):null;return t.jsx("div",{className:T("flex items-end gap-2 self-end",u),children:t.jsx("div",{className:"flex flex-col gap-2",children:t.jsxs("div",{className:"flex flex-row-reverse items-end gap-1",children:[t.jsx("div",{className:"text-body-s bg-base-300 w-fit max-w-[200px] rounded-lg p-2",children:t.jsx($t,{remarkPlugins:[aa,ta],className:"prose prose-sm text-base-content max-w-none",children:a.content})}),W()]})})})}const i=a.status===X.MessageStatus.ERROR||a.status===X.MessageStatus.SENDING;return t.jsxs("div",{className:T("flex items-end gap-2",u),children:[t.jsx("div",{className:"w-10 shrink-0 self-start",children:N&&t.jsx(j,{src:m??"",alt:s,width:40,height:40,className:"rounded-lg object-cover"})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[N&&t.jsx("span",{className:"text-body-s text-base-content",children:s}),i?t.jsx(sn,{isRetrying:a.status===X.MessageStatus.SENDING,onRetry:()=>d?.(a)}):t.jsxs("div",{className:"flex items-end gap-1",children:[t.jsx("div",{className:"text-body-s bg-secondary w-fit max-w-50 rounded-lg p-2",children:t.jsx($t,{remarkPlugins:[aa,ta],className:"prose prose-sm text-secondary-content max-w-none",children:a.content})}),q&&t.jsx("span",{className:"text-label-s text-base-content/50",children:la(a.createdAt,b)})]})]})]})}function rn({newestMessage:a,companionName:l,companionImageUrl:n}){const{t:s}=v.useTranslation("aidol"),m=!a||a.senderType!==X.SenderType.COMPANION;return t.jsxs("div",{className:T("flex items-end gap-2",m&&"mt-2"),children:[t.jsx("div",{className:"w-10 shrink-0 self-start",children:m&&t.jsx(j,{src:n??"",alt:l,width:40,height:40,className:"rounded-lg object-cover"})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[m&&t.jsx("span",{className:"text-body-s text-base-content",children:l}),t.jsx("div",{className:"text-body-s bg-base-400 text-base-content w-fit rounded-lg p-2",children:s("chat.typing")})]})]})}const dn=3,bn=a=>a.flatMap(l=>{if(l.senderType!==X.SenderType.COMPANION)return[l];if(l.status===X.MessageStatus.ERROR||l.status===X.MessageStatus.SENDING)return[l];const n=l.content.split(`
|
|
2
2
|
|
|
3
3
|
`);return n.length<=1?[l]:(n.length<=dn?n:[...n.slice(0,2),n.slice(2).join(" ")]).reverse().map((m,r)=>({...l,id:`${l.id}_${r}`,content:m}))});function Wa({messages:a,companionName:l,companionImageUrl:n,isTyping:s=!1,onResend:m,onRetryGenerate:r,onLoadMore:d,hasMore:b=!1,isLoadingMore:z=!1}){const N=V.useRef(null),q=V.useRef(null),u=V.useMemo(()=>a?bn(a):void 0,[a]);return V.useEffect(()=>{const i=q.current,W=N.current;if(!i||!W||!d)return;const M=new IntersectionObserver(([x])=>{x.isIntersecting&&b&&!z&&d()},{root:W,rootMargin:"200px"});return M.observe(i),()=>M.disconnect()},[d,b,z]),u?t.jsxs("div",{ref:N,className:"bg-base-100 flex min-h-0 w-full flex-1 flex-col-reverse overflow-y-auto p-6",children:[t.jsx("div",{className:"mt-auto"}),s&&t.jsx(rn,{newestMessage:u[0],companionName:l,companionImageUrl:n}),u.map((i,W)=>t.jsx(mn,{message:i,prev:u[W-1],next:u[W+1],companionName:l,companionImageUrl:n,onResend:m,onRetryGenerate:r},i.id)),b&&t.jsx("div",{ref:q,className:"flex justify-center py-4",children:z&&t.jsx(E,{})})]}):t.jsxs("div",{className:"flex flex-1 items-center justify-center",children:[t.jsx(E,{}),";"]})}function Zn({messages:a,companionName:l,companionImageUrl:n,onSendMessage:s}){return t.jsxs("div",{className:"bg-base-100 text-base-content flex h-full flex-col",children:[t.jsx("div",{className:"flex-1 overflow-y-auto",children:t.jsx(Wa,{messages:a,companionName:l,companionImageUrl:n})}),t.jsx(ua,{onSubmit:s})]})}function pn({onClick:a,isLoading:l}){const{t:n}=v.useTranslation();return t.jsx("button",{onClick:a,disabled:l,className:"btn btn-neutral text-label-l text-neutral-content h-16 min-w-48",children:l?t.jsx("span",{className:"loading loading-spinner loading-sm"}):t.jsxs(t.Fragment,{children:[t.jsx(Za,{className:"size-5"}),n("aidol:companion.addMember")]})})}function Lt({isOpen:a,onClose:l,children:n,action:s,position:m="center"}){const{t:r}=v.useTranslation(),d=V.useRef(null);V.useEffect(()=>{const z=d.current;z&&(a?(z.showModal(),z.querySelector(".modal-box")?.focus()):z.close())},[a]);const b=z=>{z.target===d.current&&l()};return t.jsx("dialog",{ref:d,className:T("modal bg-black/80",m==="bottom"&&"modal-bottom"),onClick:b,onClose:l,children:t.jsx("div",{...m!=="bottom"?{tabIndex:-1}:{},className:T("modal-box bg-base-200",m==="bottom"?"max-w-mobile mx-auto w-full overflow-hidden rounded-t-2xl rounded-b-none":"scrollbar-hide relative flex max-h-170 min-h-90 w-88.25 flex-col gap-6 overflow-hidden rounded-lg p-6 outline-none"),children:m==="bottom"?n:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"scrollbar-hide flex-1 overflow-y-auto pb-20",children:n}),t.jsxs("div",{className:"absolute inset-x-6 bottom-6 flex shrink-0 gap-4",children:[t.jsx("button",{type:"button",onClick:l,className:"btn btn-lg bg-base-300 text-label-l text-base-content rounded-lg p-4",children:r("aidol:common.close")}),s&&t.jsx("button",{type:"button",onClick:s.onClick,className:T("btn btn-lg text-label-l flex-1 rounded-lg",s.variant==="neutral"?"btn-neutral":"btn-primary"),children:s.label})]})]})})})}const et=["vocal","dance","rap","visual","stamina","charm"];function zn({stats:a}){const{t:l}=v.useTranslation(),n=260,s=n/2,m=70,r=100,d=(u,i)=>{const W=Math.PI*2*u/6-Math.PI/3,M=i/100*m;return{x:s+M*Math.cos(W),y:s+M*Math.sin(W)}},b=u=>{const i=Math.PI*2*u/6-Math.PI/3;return{x:s+r*Math.cos(i),y:s+r*Math.sin(i)}},z=et.map((u,i)=>d(i,a[u])),N=z.map(u=>`${u.x},${u.y}`).join(" "),q=[20,40,60,80,100];return t.jsx("div",{className:"flex items-center justify-center",children:t.jsxs("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,children:[q.map(u=>{const W=et.map((M,x)=>d(x,u)).map(M=>`${M.x},${M.y}`).join(" ");return t.jsx("polygon",{points:W,fill:"none",stroke:"currentColor",strokeWidth:"1",className:"text-base-300"},u)}),et.map((u,i)=>{const W=d(i,100);return t.jsx("line",{x1:s,y1:s,x2:W.x,y2:W.y,stroke:"currentColor",strokeWidth:"1",className:"text-base-300"},i)}),t.jsx("polygon",{points:N,fill:"currentColor",fillOpacity:"0.3",stroke:"currentColor",strokeWidth:"2",className:"text-secondary"}),z.map((u,i)=>t.jsx("circle",{cx:u.x,cy:u.y,r:"3",fill:"currentColor",className:"text-secondary"},i)),et.map((u,i)=>{const W=b(i);return t.jsxs("g",{children:[t.jsx("text",{x:W.x,y:W.y-8,textAnchor:"middle",dominantBaseline:"middle",className:"text-label-l fill-base-content font-medium",children:l(`aidol:casting.abilities.${u}`)}),t.jsx("text",{x:W.x,y:W.y+10,textAnchor:"middle",dominantBaseline:"middle",className:"text-label-l fill-secondary font-medium",children:a[u]})]},u)})]})})}function va({companion:a,showBiography:l=!0,showStats:n=!0}){const{t:s}=v.useTranslation(),{name:m,profilePictureUrl:r,grade:d,mbti:b,biography:z,stats:N}=a;return t.jsxs("div",{className:"flex flex-col items-center gap-6",children:[t.jsx(bt,{url:r??null,alt:m??""}),t.jsxs("div",{className:"flex flex-col gap-2 self-start",children:[t.jsx("h2",{className:"text-title-s text-base-content font-semibold",children:m??""}),(d||b)&&t.jsxs("div",{className:"flex gap-2",children:[d&&t.jsx("span",{className:"text-label-l rounded-lg bg-black px-2 py-1 text-white",children:s("aidol:companion.grade",{grade:d})}),b&&t.jsx("span",{className:"text-label-l rounded-lg bg-black px-2 py-1 text-white",children:b})]})]}),l&&z&&t.jsx("p",{className:"text-body-s text-base-content self-start",children:z}),n&&N&&t.jsx(zn,{stats:N})]})}const Oa=V.forwardRef(({placeholder:a,maxLength:l=500,charCount:n,...s},m)=>{const{t:r}=v.useTranslation();return t.jsxs("div",{className:"w-full",children:[t.jsx("textarea",{ref:m,placeholder:a??r("aidol:companion.promptPlaceholder"),maxLength:l,className:"textarea bg-base-100 text-base-content placeholder:text-base-content/50 focus:border-primary h-32 w-full resize-none focus:outline-hidden",...s}),t.jsxs("div",{className:"text-label-s text-base-content/50 mt-1 text-right",children:[n??0,"/",l]})]})});Oa.displayName="PromptInput";function tt({title:a,logo:l,onDropdownClick:n,onBackClick:s,onCloseClick:m,children:r}){const d=()=>l?t.jsx(j,{src:"/images/logo.svg",alt:"alola",width:91,height:27}):n?t.jsxs("button",{type:"button",onClick:n,className:"text-headline-s text-base-content flex cursor-pointer items-center gap-2",children:[t.jsx("span",{children:a}),t.jsx(Gl,{className:"size-6"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[s&&t.jsx("button",{type:"button",onClick:s,className:"text-base-content flex cursor-pointer items-center justify-center","aria-label":"뒤로 가기",children:t.jsx(ba,{className:"size-6"})}),m&&t.jsx("button",{type:"button",onClick:m,className:"text-base-content flex cursor-pointer items-center justify-center","aria-label":"닫기",children:t.jsx(pa,{className:"size-6"})}),a&&t.jsx("h1",{className:"text-headline-s text-base-content",children:a})]});return t.jsxs("header",{className:"h-header bg-base-100 flex shrink-0 items-center justify-between px-6 py-7",children:[d(),r&&t.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}function ia({progress:a}){const l=Math.min(100,Math.max(0,a));return t.jsx("div",{className:"bg-primary/20 h-3 w-full overflow-hidden rounded-full",children:t.jsx("div",{className:"bg-primary h-full rounded-full transition-all duration-500 ease-out",style:{width:`${l}%`}})})}function Nn({step:a,totalSteps:l,children:n,bottomButton:s}){const{t:m}=v.useTranslation(),r=a/l*100;return t.jsxs("div",{className:"flex min-h-dvh flex-col",children:[t.jsx(tt,{title:m("aidol:companionCreate.title")}),t.jsx("div",{className:"px-6 py-4",children:t.jsx(ia,{progress:r})}),t.jsx("div",{className:"flex flex-1 flex-col gap-6 p-6",children:n}),t.jsx("div",{className:"sticky bottom-0 p-6",children:s})]})}const cn=/[!@#$%^&*()+=[\]{}|\\;:'",.<>?/`~_]/g;function un({value:a,onChange:l,maxLength:n=10}){const{t:s}=v.useTranslation();return t.jsx(g,{value:a,onChange:m=>l(m.replace(cn,"").slice(0,n)),placeholder:s("aidol:companionCreate.complete.namePlaceholder")})}const qa=V.forwardRef(({options:a,...l},n)=>{const{t:s}=v.useTranslation();return t.jsxs("fieldset",{className:"fieldset w-full",children:[t.jsx("label",{className:"label",children:s("aidol:creation.concept")}),t.jsxs("select",{ref:n,className:"select bg-base-100 text-base-content w-full",...l,children:[t.jsx("option",{value:"",children:s("aidol:creation.selectConcept")}),a.map(m=>t.jsx("option",{value:m.value,children:m.label},m.value))]})]})});qa.displayName="ConceptSelector";function Wn({value:a,onChange:l}){const{t:n}=v.useTranslation(),s=[{gender:"FEMALE",label:n("aidol:companionCreate.gender.FEMALE")},{gender:"MALE",label:n("aidol:companionCreate.gender.MALE")}];return t.jsx("div",{className:"flex gap-4",children:s.map(({gender:m,label:r})=>t.jsx("button",{type:"button",onClick:()=>l(m),className:T("text-label-l flex-1 cursor-pointer rounded-lg border px-6 py-3 transition-colors",a===m?"border-primary text-primary bg-primary/20":"border-base-400 text-base-content bg-base-100"),children:r},m))})}function vn({onGenerate:a,isGenerating:l,disabled:n}){const{t:s}=v.useTranslation(),[m,r]=V.useState(""),d=()=>{m.trim()&&a(m)},b=z=>{z.key==="Enter"&&m.trim()&&!l&&!n&&(z.preventDefault(),d())};return t.jsxs("fieldset",{className:"fieldset w-full",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(g,{value:m,onChange:r,onKeyDown:b,placeholder:s("aidol:creation.emblemPromptPlaceholder"),maxLength:200,disabled:n||l}),t.jsx("button",{type:"button",onClick:d,disabled:n||l||!m.trim(),className:"btn btn-secondary","data-testid":"emblem-generate-button",children:l?t.jsx("span",{className:"loading loading-spinner loading-sm"}):s("aidol:creation.generate")})]}),l&&t.jsx("div",{className:"mt-2",children:t.jsx("progress",{className:"progress w-full"})})]})}const Va=V.forwardRef(({error:a,...l},n)=>{const{t:s}=v.useTranslation();return t.jsxs("fieldset",{className:"fieldset w-full",children:[t.jsx("label",{className:"label",children:s("aidol:creation.groupName")}),t.jsx("input",{ref:n,type:"text",placeholder:s("aidol:creation.groupNamePlaceholder"),className:T("input bg-base-100 text-base-content placeholder:text-base-content/50 w-full",a&&"input-error"),...l}),a&&t.jsx("span",{className:"text-label-m text-error",children:a})]})});Va.displayName="GroupNameInput";function ya({label:a,leftLabel:l,rightLabel:n,value:s,onChange:m}){return t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-label-l text-neutral mb-4",children:a}),t.jsxs("div",{className:"flex flex-col px-6",children:[t.jsx("input",{type:"range",min:1,max:10,step:1,value:s,onChange:r=>m(Number(r.target.value)),className:"range range-primary range-sm mb-2"}),t.jsxs("div",{className:"text-primary text-label-m mx-2 flex justify-between",children:[t.jsxs("div",{className:"flex w-0 flex-col items-center gap-1.5",children:[t.jsx("div",{className:"bg-primary h-2 w-px"}),t.jsx("span",{className:"whitespace-nowrap",children:l})]}),t.jsxs("div",{className:"flex w-0 flex-col items-center gap-1.5",children:[t.jsx("div",{className:"bg-primary h-2 w-px"}),t.jsx("span",{className:"whitespace-nowrap",children:n})]})]})]})]})}function On({values:a,onChange:l}){const{t:n}=v.useTranslation(),s=[{key:"energy",label:n("aidol:companionCreate.personality.energy"),leftLabel:n("aidol:companionCreate.personality.energyLeft"),rightLabel:n("aidol:companionCreate.personality.energyRight")},{key:"perception",label:n("aidol:companionCreate.personality.perception"),leftLabel:n("aidol:companionCreate.personality.perceptionLeft"),rightLabel:n("aidol:companionCreate.personality.perceptionRight")},{key:"judgment",label:n("aidol:companionCreate.personality.judgment"),leftLabel:n("aidol:companionCreate.personality.judgmentLeft"),rightLabel:n("aidol:companionCreate.personality.judgmentRight")},{key:"lifestyle",label:n("aidol:companionCreate.personality.lifestyle"),leftLabel:n("aidol:companionCreate.personality.lifestyleLeft"),rightLabel:n("aidol:companionCreate.personality.lifestyleRight")}];return t.jsx("div",{className:"flex flex-col gap-6",children:s.map(({key:m,label:r,leftLabel:d,rightLabel:b})=>t.jsx(ya,{label:r,leftLabel:d,rightLabel:b,value:a[m],onChange:z=>l({...a,[m]:z})},m))})}const oa=V.forwardRef(({error:a,...l},n)=>{const{t:s}=v.useTranslation();return t.jsxs("fieldset",{className:"fieldset w-full",children:[t.jsx("label",{className:"label",children:s("aidol:creation.memberName")}),t.jsx("input",{ref:n,type:"text",placeholder:s("aidol:creation.memberNamePlaceholder"),className:T("input bg-base-100 text-base-content placeholder:text-base-content/50 w-full",a&&"input-error"),...l}),a&&t.jsx("span",{className:"text-label-m text-error",children:a})]})});oa.displayName="MemberNameInput";function qn({value:a,onChange:l,options:n}){const{t:s}=v.useTranslation();return t.jsxs("fieldset",{className:"fieldset w-full",children:[t.jsx("label",{className:"label",children:s("aidol:creation.personality")}),t.jsx("div",{className:"space-y-2",children:n.map(m=>t.jsxs("label",{className:T("flex cursor-pointer items-start gap-3 rounded-lg border p-4 transition-colors",a===m.value?"border-primary bg-primary/10":"border-base-300 hover:border-base-content/30"),children:[t.jsx("input",{type:"radio",name:"personality",value:m.value,checked:a===m.value,onChange:r=>l(r.target.value),className:"radio-primary radio mt-0.5"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-base-content font-medium",children:m.label}),m.description&&t.jsx("div",{className:"text-body-s text-base-content/70 mt-1",children:m.description})]})]},m.value))})]})}const it=200;function Vn({prompt:a,onPromptChange:l,onGenerate:n,isGenerating:s,imageUrl:m,hasGenerated:r}){const{t:d}=v.useTranslation();return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{children:[t.jsx("textarea",{value:a,onChange:b=>{l(b.target.value);const z=b.target;z.style.height="auto",z.style.height=`${z.scrollHeight}px`},placeholder:d("aidol:companionCreate.image.promptPlaceholder"),maxLength:it,className:"textarea border-base-400 bg-base-200 min-h-0 w-full resize-none overflow-hidden rounded-lg px-4 py-3",rows:1}),t.jsxs("div",{className:T("text-label-s mt-1 text-right",a.length>=it?"text-error":"text-base-content/50"),children:[a.length,"/",it]})]}),t.jsxs("button",{type:"button",onClick:n,disabled:s||!a.trim(),className:T("btn btn-lg text-label-l w-full rounded-lg",r?"bg-base-300 text-base-content":"btn-primary"),children:[s&&t.jsx("span",{className:"loading loading-spinner"}),d(r?"aidol:companionCreate.image.regenerate":"aidol:companionCreate.image.generate")]}),m?t.jsx("div",{className:"relative aspect-square w-full overflow-hidden rounded-lg",children:t.jsx(j,{src:m,alt:"Generated profile",fill:!0,className:"object-cover"})}):t.jsxs("div",{className:"border-base-300 bg-base-100 flex aspect-square w-full flex-col items-center justify-center gap-4 rounded-lg border",children:[t.jsx(Tt,{className:"text-neutral size-6"}),t.jsx("p",{className:"text-body-m text-neutral text-center whitespace-pre-line",children:d("aidol:companionCreate.image.placeholder")})]})]})}function Ta({step:a,title:l,children:n}){const s=a.toString().padStart(2,"0");return t.jsxs("div",{className:"bg-base-200 flex w-full flex-col gap-6 rounded-lg p-6",children:[t.jsx("span",{className:"text-title-s text-primary",children:s}),t.jsx("h3",{className:"text-title-s text-base-content",children:l}),t.jsx("div",{className:"flex flex-col gap-4",children:n})]})}function yn({currentStep:a,totalSteps:l,labels:n}){return t.jsx("ul",{className:"steps w-full",children:Array.from({length:l},(s,m)=>{const r=m+1,d=r<a,b=r===a;return t.jsx("li",{className:T("step",(d||b)&&"step-primary"),children:n?.[m]??""},r)})})}const B={initial:{y:40,opacity:0},animate:{y:0,opacity:1,transition:{duration:.8,ease:"easeInOut"}}},on={animate:{transition:{staggerChildren:.15}}};function Tn({onGetStarted:a,isLoading:l,logoUrl:n="/images/logo.svg",videoUrl:s}){const{t:m}=v.useTranslation();return t.jsx("section",{className:"bg-base-100 flex min-h-screen w-full flex-col items-center px-6 pt-12 pb-8",children:t.jsxs(Q.motion.div,{variants:on,initial:"initial",animate:"animate",className:"flex w-full flex-col items-center text-center",children:[t.jsx(Q.motion.div,{variants:B,className:"mb-6",children:t.jsx(j,{src:n,alt:"AIdol",width:92,height:28,priority:!0})}),t.jsxs(Q.motion.h1,{variants:B,className:"text-display-s mb-3",children:[m("aidol:landing.hero.title.line1"),t.jsx("br",{}),m("aidol:landing.hero.title.line2")]}),t.jsxs(Q.motion.div,{variants:B,className:"text-headline-s text-base-content mb-8 flex flex-col",children:[t.jsx("p",{className:"text-neutral",children:m("aidol:landing.hero.line1")}),t.jsx("p",{className:"text-neutral",children:m("aidol:landing.hero.line2")}),t.jsx("p",{children:m("aidol:landing.hero.line3")}),t.jsx("p",{children:m("aidol:landing.hero.line4")})]}),t.jsx(Q.motion.div,{variants:B,className:"bg-base-200 relative mb-6 aspect-[345/368] w-full overflow-hidden rounded-lg",children:s&&t.jsx("video",{src:s,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"size-full object-cover"})}),t.jsx(Q.motion.div,{variants:B,className:"w-full",children:t.jsx("button",{onClick:a,disabled:l,className:"btn btn-primary btn-lg text-label-l w-full rounded-lg",children:l?t.jsx("span",{className:"loading loading-spinner loading-sm"}):m("aidol:landing.hero.cta")})})]})})}function Gn({onNewMember:a}){const{t:l}=v.useTranslation();return t.jsxs("div",{className:"bg-base-200 col-span-2 flex flex-col items-center justify-center gap-4 rounded-lg p-4",children:[t.jsxs("div",{className:"text-body-s text-base-content flex flex-col items-start text-center",children:[t.jsx("p",{children:l("aidol:casting.newMember.prompt")}),t.jsx("p",{children:l("aidol:casting.newMember.subPrompt")})]}),t.jsxs("button",{type:"button",className:"btn btn-primary gap-2.5 rounded-lg",onClick:a,children:[l("aidol:casting.addMember"),t.jsx(Za,{className:"size-4"})]})]})}function Mn({companions:a,onCompanionClick:l,onNewMember:n}){return t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[a.map(s=>t.jsx(w,{companion:s,onClick:()=>l(s)},s.id)),t.jsx(Gn,{onNewMember:n})]})}function Ln(){const{t:a}=v.useTranslation();return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex flex-col items-start gap-1",children:[t.jsx(ca,{className:"text-primary size-6 shrink-0"}),t.jsx("h3",{className:"text-title-s text-base-content",children:a("aidol:casting.infoBanner.title")})]}),t.jsx("p",{className:"text-body-s text-base-content/60",children:a("aidol:casting.infoBanner.description")})]})}const Un=["mixed","boy","girl"];function kn({activeTab:a,onTabChange:l}){const{t:n}=v.useTranslation("aidol");return t.jsx("div",{role:"tablist",className:"flex gap-2",children:Un.map(s=>t.jsx("button",{type:"button",role:"tab","aria-selected":a===s,className:T("bg-base-200 text-label-l rounded-lg border p-2",a===s?"border-base-content text-base-content":"border-base-400 text-base-400"),onClick:()=>l(s),children:n(`casting.tabs.${s}`)},s))})}var qt={exports:{}},H={},na;function jn(){if(na)return H;na=1;var a=V,l=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,m=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function d(b,z,N){var q,u={},i=null,W=null;N!==void 0&&(i=""+N),z.key!==void 0&&(i=""+z.key),z.ref!==void 0&&(W=z.ref);for(q in z)s.call(z,q)&&!r.hasOwnProperty(q)&&(u[q]=z[q]);if(b&&b.defaultProps)for(q in z=b.defaultProps,z)u[q]===void 0&&(u[q]=z[q]);return{$$typeof:l,type:b,key:i,ref:W,props:u,_owner:m.current}}return H.Fragment=n,H.jsx=d,H.jsxs=d,H}var mt={},sa;function Sn(){return sa||(sa=1,process.env.NODE_ENV!=="production"&&(function(){var a=V,l=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),b=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),i=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),M=Symbol.iterator,x="@@iterator";function F(e){if(e===null||typeof e!="object")return null;var Z=M&&e[M]||e[x];return typeof Z=="function"?Z:null}var f=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var Z=arguments.length,c=new Array(Z>1?Z-1:0),O=1;O<Z;O++)c[O-1]=arguments[O];Zt("error",e,c)}}function Zt(e,Z,c){{var O=f.ReactDebugCurrentFrame,G=O.getStackAddendum();G!==""&&(Z+="%s",c=c.concat([G]));var L=c.map(function(o){return String(o)});L.unshift("Warning: "+Z),Function.prototype.apply.call(console[e],console,L)}}var Ua=!1,ka=!1,ja=!1,Sa=!1,Ja=!1,Ut;Ut=Symbol.for("react.module.reference");function Ya(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===r||Ja||e===m||e===N||e===q||Sa||e===W||Ua||ka||ja||typeof e=="object"&&e!==null&&(e.$$typeof===i||e.$$typeof===u||e.$$typeof===d||e.$$typeof===b||e.$$typeof===z||e.$$typeof===Ut||e.getModuleId!==void 0))}function Xa(e,Z,c){var O=e.displayName;if(O)return O;var G=Z.displayName||Z.name||"";return G!==""?c+"("+G+")":c}function kt(e){return e.displayName||"Context"}function h(e){if(e==null)return null;if(typeof e.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case s:return"Fragment";case n:return"Portal";case r:return"Profiler";case m:return"StrictMode";case N:return"Suspense";case q:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var Z=e;return kt(Z)+".Consumer";case d:var c=e;return kt(c._context)+".Provider";case z:return Xa(e,e.render,"ForwardRef");case u:var O=e.displayName||null;return O!==null?O:h(e.type)||"Memo";case i:{var G=e,L=G._payload,o=G._init;try{return h(o(L))}catch{return null}}}return null}var R=Object.assign,I=0,jt,St,Jt,Yt,Xt,Kt,xt;function Ft(){}Ft.__reactDisabledLog=!0;function Ka(){{if(I===0){jt=console.log,St=console.info,Jt=console.warn,Yt=console.error,Xt=console.group,Kt=console.groupCollapsed,xt=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ft,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function xa(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},e,{value:jt}),info:R({},e,{value:St}),warn:R({},e,{value:Jt}),error:R({},e,{value:Yt}),group:R({},e,{value:Xt}),groupCollapsed:R({},e,{value:Kt}),groupEnd:R({},e,{value:xt})})}I<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pt=f.ReactCurrentDispatcher,zt;function at(e,Z,c){{if(zt===void 0)try{throw Error()}catch(G){var O=G.stack.trim().match(/\n( *(at )?)/);zt=O&&O[1]||""}return`
|
|
4
4
|
`+zt+e}}var Nt=!1,lt;{var Fa=typeof WeakMap=="function"?WeakMap:Map;lt=new Fa}function ft(e,Z){if(!e||Nt)return"";{var c=lt.get(e);if(c!==void 0)return c}var O;Nt=!0;var G=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var L;L=pt.current,pt.current=null,Ka();try{if(Z){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(Y){O=Y}Reflect.construct(e,[],o)}else{try{o.call()}catch(Y){O=Y}e.call(o.prototype)}}else{try{throw Error()}catch(Y){O=Y}e()}}catch(Y){if(Y&&O&&typeof Y.stack=="string"){for(var y=Y.stack.split(`
|