aidol 2.17.0 → 2.18.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 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"),$t=require("remark-breaks"),ta=require("remark-gfm"),Q=require("framer-motion"),rl=require("react-dom"),dl=require("next/link");function bl(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=bl(V);function ra(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=ra(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=ra(a))&&(s&&(s+=" "),s+=l);return s}const $=a=>l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())};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:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const da=p.forwardRef(Zl);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:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"}))}const zl=p.forwardRef(pl);function Nl({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 cl=p.forwardRef(Nl);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:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))}const Wl=p.forwardRef(ul);function vl({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 Ol=p.forwardRef(vl);function il({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 ql=p.forwardRef(il);function Vl({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 yl=p.forwardRef(Vl);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.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"}))}const Tl=p.forwardRef(ol);function Gl({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 Ml=p.forwardRef(Gl);function Ll({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 Ul=p.forwardRef(Ll);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:"M12 4.5v15m7.5-7.5h-15"}))}const ba=p.forwardRef(kl);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:"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 Sl=p.forwardRef(jl);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 ot=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 Tt=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 Za=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,i=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",i)}),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(Tt,{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({onClick:a}){const{t:l}=v.useTranslation(),[n,s]=V.useState(()=>typeof window>"u"?!0:localStorage.getItem("chatTooltipVisited")!=="true"),[m,r]=V.useState(!1),[d,b]=V.useState(!1);V.useEffect(()=>{n&&(r(!0),b(!0))},[n]);const z=()=>{b(!1),setTimeout(()=>{r(!1),s(!1),localStorage.setItem("chatTooltipVisited","true")},200)},N=()=>{n||(r(!0),setTimeout(()=>b(!0),10))},i=()=>{n||(b(!1),setTimeout(()=>r(!1),200))};return t.jsxs("div",{className:"relative",onMouseEnter:N,onMouseLeave:i,children:[t.jsx("button",{type:"button",className:"relative z-50 flex size-10 cursor-pointer items-center justify-center",onClick:a,children:t.jsx(Ol,{className:"text-base-content size-6"})}),m&&t.jsxs(t.Fragment,{children:[n&&t.jsx("div",{className:T("fixed inset-0 z-40 transition-opacity duration-200",d?"opacity-100":"opacity-0"),onClick:z}),t.jsxs("div",{className:T("absolute top-full right-0 z-50 mt-2 w-fit transition-opacity duration-200",d?"opacity-100":"opacity-0"),children:[t.jsx("div",{className:"border-b-primary absolute -top-2 right-3 size-0 border-x-8 border-b-8 border-x-transparent"}),t.jsx("div",{className:"bg-primary text-primary-content text-label-m rounded-lg px-2 py-1 font-bold whitespace-nowrap",children:l("aidol:myGroup.chatNotification")})]})]})]})}function Vt({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(Za,{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(zl,{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 pa({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(i=>i.fromCompanionId===n.id&&i.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(da,{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(pa,{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 i=b(N.id);if(!i)return null;const u=X.INTIMACY_TO_RELATIONSHIP_TYPE[i.intimacy??0];return t.jsx(Vt,{fromName:n.name??"",toName:N.name??"",relationshipType:i.nickname??void 0,description:u&&r(`aidol:chemistry.add.types.${u}`)},`custom-${N.id}`)}).filter(Boolean),d.map(N=>t.jsx(Vt,{fromName:n.name??"",toName:N.name??"",fromLabel:z(n.position),toLabel:z(N.position)},`position-${N.id}`))]})]})]})]})}function za({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(Tt,{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(za,{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 Na=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(Na,{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(Tt,{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 bg-base-300 text-label-l h-auto min-h-0 w-full rounded-lg py-3 shadow-[0_0_4px_rgba(0,0,0,0.1)]",onClick:s,children:r("group.chemistryButton")}),m&&t.jsx("div",{className:"flex gap-2",children:t.jsx("button",{className:"btn bg-base-100 border-base-400 text-base-content text-label-l h-auto min-h-0 w-full rounded-lg border py-3",onClick:m,children:r("group.followButton")})})]})]})}const Gt=({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}=Gt();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 ca({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(Wl,{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 aa=(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")})},yt=(a,l)=>a.senderType===l.senderType,en=(a,l)=>yt(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||!yt(l,a),N=!n||!yt(a,n),i=!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(cl,{className:"size-4"}),t.jsx("span",{className:"text-label-s",children:b("chat.resend")})]}):a.status===X.MessageStatus.SENDING?t.jsx(Ul,{className:"text-base-400 size-4 rotate-180"}):i?t.jsx("span",{className:"text-label-s text-base-content/50",children:aa(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:[ta,$t],className:"prose prose-sm text-base-content max-w-none",children:a.content})}),W()]})})})}const q=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}),q?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:[ta,$t],className:"prose prose-sm text-secondary-content max-w-none",children:a.content})}),i&&t.jsx("span",{className:"text-label-s text-base-content/50",children:aa(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-D3J5X8WP.js"),_t=require("react-markdown"),$t=require("remark-breaks"),ta=require("remark-gfm"),Q=require("framer-motion"),rl=require("react-dom"),dl=require("next/link");function bl(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=bl(V);function ra(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=ra(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=ra(a))&&(s&&(s+=" "),s+=l);return s}const $=a=>l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a())};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:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const da=p.forwardRef(Zl);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:"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"}))}const zl=p.forwardRef(pl);function Nl({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 cl=p.forwardRef(Nl);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:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))}const Wl=p.forwardRef(ul);function vl({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 Ol=p.forwardRef(vl);function il({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 ql=p.forwardRef(il);function Vl({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 yl=p.forwardRef(Vl);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.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"}))}const Tl=p.forwardRef(ol);function Gl({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 Ml=p.forwardRef(Gl);function Ll({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 Ul=p.forwardRef(Ll);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:"M12 4.5v15m7.5-7.5h-15"}))}const ba=p.forwardRef(kl);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:"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 Sl=p.forwardRef(jl);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 ot=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 Tt=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 Za=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,i=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",i)}),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(Tt,{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({onClick:a}){const{t:l}=v.useTranslation(),[n,s]=V.useState(()=>typeof window>"u"?!0:localStorage.getItem("chatTooltipVisited")!=="true"),[m,r]=V.useState(!1),[d,b]=V.useState(!1);V.useEffect(()=>{n&&(r(!0),b(!0))},[n]);const z=()=>{b(!1),setTimeout(()=>{r(!1),s(!1),localStorage.setItem("chatTooltipVisited","true")},200)},N=()=>{n||(r(!0),setTimeout(()=>b(!0),10))},i=()=>{n||(b(!1),setTimeout(()=>r(!1),200))};return t.jsxs("div",{className:"relative",onMouseEnter:N,onMouseLeave:i,children:[t.jsx("button",{type:"button",className:"relative z-50 flex size-10 cursor-pointer items-center justify-center",onClick:a,children:t.jsx(Ol,{className:"text-base-content size-6"})}),m&&t.jsxs(t.Fragment,{children:[n&&t.jsx("div",{className:T("fixed inset-0 z-40 transition-opacity duration-200",d?"opacity-100":"opacity-0"),onClick:z}),t.jsxs("div",{className:T("absolute top-full right-0 z-50 mt-2 w-fit transition-opacity duration-200",d?"opacity-100":"opacity-0"),children:[t.jsx("div",{className:"border-b-primary absolute -top-2 right-3 size-0 border-x-8 border-b-8 border-x-transparent"}),t.jsx("div",{className:"bg-primary text-primary-content text-label-m rounded-lg px-2 py-1 font-bold whitespace-nowrap",children:l("aidol:myGroup.chatNotification")})]})]})]})}function Vt({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(Za,{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(zl,{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 pa({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(i=>i.fromCompanionId===n.id&&i.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(da,{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(pa,{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 i=b(N.id);if(!i)return null;const u=X.INTIMACY_TO_RELATIONSHIP_TYPE[i.intimacy??0];return t.jsx(Vt,{fromName:n.name??"",toName:N.name??"",relationshipType:i.nickname??void 0,description:u&&r(`aidol:chemistry.add.types.${u}`)},`custom-${N.id}`)}).filter(Boolean),d.map(N=>t.jsx(Vt,{fromName:n.name??"",toName:N.name??"",fromLabel:z(n.position),toLabel:z(N.position)},`position-${N.id}`))]})]})]})]})}function za({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(Tt,{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(za,{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 Na=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(Na,{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(Tt,{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 bg-base-300 text-label-l h-auto min-h-0 w-full rounded-lg py-3 shadow-[0_0_4px_rgba(0,0,0,0.1)]",onClick:s,children:r("group.chemistryButton")}),m&&t.jsx("div",{className:"flex gap-2",children:t.jsx("button",{className:"btn bg-base-100 border-base-400 text-base-content text-label-l h-auto min-h-0 w-full rounded-lg border py-3",onClick:m,children:r("group.followButton")})})]})]})}const Gt=({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}=Gt();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 ca({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(Wl,{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 aa=(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")})},yt=(a,l)=>a.senderType===l.senderType,en=(a,l)=>yt(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||!yt(l,a),N=!n||!yt(a,n),i=!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(cl,{className:"size-4"}),t.jsx("span",{className:"text-label-s",children:b("chat.resend")})]}):a.status===X.MessageStatus.SENDING?t.jsx(Ul,{className:"text-base-400 size-4 rotate-180"}):i?t.jsx("span",{className:"text-label-s text-base-content/50",children:aa(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:[ta,$t],className:"prose prose-sm text-base-content max-w-none",children:a.content})}),W()]})})})}const q=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}),q?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:[ta,$t],className:"prose prose-sm text-secondary-content max-w-none",children:a.content})}),i&&t.jsx("span",{className:"text-label-s text-base-content/50",children:aa(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 ua({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),i=V.useRef(null),u=V.useMemo(()=>a?bn(a):void 0,[a]);return V.useEffect(()=>{const q=i.current,W=N.current;if(!q||!W||!d)return;const M=new IntersectionObserver(([x])=>{x.isIntersecting&&b&&!z&&d()},{root:W,rootMargin:"200px"});return M.observe(q),()=>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((q,W)=>t.jsx(mn,{message:q,prev:u[W-1],next:u[W+1],companionName:l,companionImageUrl:n,onResend:m,onRetryGenerate:r},q.id)),b&&t.jsx("div",{ref:i,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(ua,{messages:a,companionName:l,companionImageUrl:n})}),t.jsx(ca,{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(ba,{className:"size-5"}),n("aidol:companion.addMember")]})})}function Mt({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,q)=>{const W=Math.PI*2*u/6-Math.PI/3,M=q/100*m;return{x:s+M*Math.cos(W),y:s+M*Math.sin(W)}},b=u=>{const q=Math.PI*2*u/6-Math.PI/3;return{x:s+r*Math.cos(q),y:s+r*Math.sin(q)}},z=et.map((u,q)=>d(q,a[u])),N=z.map(u=>`${u.x},${u.y}`).join(" "),i=[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:[i.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,q)=>{const W=d(q,100);return t.jsx("line",{x1:s,y1:s,x2:W.x,y2:W.y,stroke:"currentColor",strokeWidth:"1",className:"text-base-300"},q)}),t.jsx("polygon",{points:N,fill:"currentColor",fillOpacity:"0.3",stroke:"currentColor",strokeWidth:"2",className:"text-secondary"}),z.map((u,q)=>t.jsx("circle",{cx:u.x,cy:u.y,r:"3",fill:"currentColor",className:"text-secondary"},q)),et.map((u,q)=>{const W=b(q);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 Wa({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 va=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]})]})});va.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(Tl,{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(da,{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(Za,{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 Oa({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(Oa,{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 ia=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))]})]})});ia.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 qa=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})]})});qa.displayName="GroupNameInput";function Va({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(Va,{label:r,leftLabel:d,rightLabel:b,value:a[m],onChange:z=>l({...a,[m]:z})},m))})}const ya=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})]})});ya.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(ot,{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 oa({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(ba,{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(Na,{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={},la;function jn(){if(la)return H;la=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 i,u={},q=null,W=null;N!==void 0&&(q=""+N),z.key!==void 0&&(q=""+z.key),z.ref!==void 0&&(W=z.ref);for(i in z)s.call(z,i)&&!r.hasOwnProperty(i)&&(u[i]=z[i]);if(b&&b.defaultProps)for(i in z=b.defaultProps,z)u[i]===void 0&&(u[i]=z[i]);return{$$typeof:l,type:b,key:q,ref:W,props:u,_owner:m.current}}return H.Fragment=n,H.jsx=d,H.jsxs=d,H}var mt={},na;function Sn(){return na||(na=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"),i=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),q=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 La=!1,Ua=!1,ka=!1,ja=!1,Sa=!1,Lt;Lt=Symbol.for("react.module.reference");function Ja(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===r||Sa||e===m||e===N||e===i||ja||e===W||La||Ua||ka||typeof e=="object"&&e!==null&&(e.$$typeof===q||e.$$typeof===u||e.$$typeof===d||e.$$typeof===b||e.$$typeof===z||e.$$typeof===Lt||e.getModuleId!==void 0))}function Ya(e,Z,c){var O=e.displayName;if(O)return O;var G=Z.displayName||Z.name||"";return G!==""?c+"("+G+")":c}function Ut(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 i:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var Z=e;return Ut(Z)+".Consumer";case d:var c=e;return Ut(c._context)+".Provider";case z:return Ya(e,e.render,"ForwardRef");case u:var O=e.displayName||null;return O!==null?O:h(e.type)||"Memo";case q:{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,kt,jt,St,Jt,Yt,Xt,Kt;function xt(){}xt.__reactDisabledLog=!0;function Xa(){{if(I===0){kt=console.log,jt=console.info,St=console.warn,Jt=console.error,Yt=console.group,Xt=console.groupCollapsed,Kt=console.groupEnd;var e={configurable:!0,enumerable:!0,value:xt,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function Ka(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},e,{value:kt}),info:R({},e,{value:jt}),warn:R({},e,{value:St}),error:R({},e,{value:Jt}),group:R({},e,{value:Yt}),groupCollapsed:R({},e,{value:Xt}),groupEnd:R({},e,{value:Kt})})}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 xa=typeof WeakMap=="function"?WeakMap:Map;lt=new xa}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,Xa();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(`
package/dist/client.js CHANGED
@@ -4,7 +4,7 @@ import { useTranslation as i, Trans as ll } from "react-i18next";
4
4
  import S from "next/image";
5
5
  import * as z from "react";
6
6
  import pa, { useState as Y, useEffect as I, useRef as A, useLayoutEffect as nl, useMemo as za, forwardRef as pt, useCallback as el } from "react";
7
- import { I as sl, S as Mt, M as w, P as ml, R as Na } from "./relationship-BP7mIOjL.mjs";
7
+ import { I as sl, S as Mt, M as w, P as ml, R as Na } from "./relationship-CYLROqFx.mjs";
8
8
  import aa from "react-markdown";
9
9
  import la from "remark-breaks";
10
10
  import na from "remark-gfm";
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@aioia/core"),t=require("./relationship-B3AClL0U.js"),l=require("zod");class b extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="aidols"}getDataSchema(){return t.aidolSchema}async createAIdol(e){const a=this.apiService.buildUrl(this.resource),n=await this.apiService.request(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.aidolCreateResponseSchema.parse(n.data)}async getMy(e){const a=this.apiService.buildUrl(`me/${this.resource}`),n=await this.apiService.request(a,e);return{data:t.aidolSchema.array().parse(n.data)}}async generateImage(e,a){const n=this.apiService.buildUrl(`${this.resource}/images`),o=await this.apiService.request(n,{...a,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this.validateResponse(o,t.imageGenerationResponseSchema)}}const y=l.z.object({content:l.z.string(),createdAt:l.z.string()}),T=l.z.object({id:l.z.string(),companionId:l.z.string(),lastMessage:y.nullable()}),c=l.z.object({messageId:l.z.string(),content:l.z.string()});class S extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="chatrooms"}getDataSchema(){return t.chatroomSchema}async getMessages(e,a,n){const o=new URLSearchParams;a?.limit!==void 0&&o.set("limit",a.limit.toString()),a?.offset!==void 0&&o.set("offset",a.offset.toString());const r=o.toString(),h=this.apiService.buildUrl(`${this.resource}/${e}/messages${r?`?${r}`:""}`),u=await this.apiService.request(h,n);return this.validateResponse(u,l.z.array(t.messageSchema))}async sendMessage(e,a,n){const o=this.apiService.buildUrl(`${this.resource}/${e}/messages`),r=await this.apiService.request(o,{...n,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:a,senderType:"USER"})});return this.validateResponse(r,t.messageSchema)}async generateResponse(e,a,n){const o=this.apiService.buildUrl(`${this.resource}/${e}/companions/${a}/response`),r=await this.apiService.request(o,{...n,method:"POST",headers:{"Content-Type":"application/json"}});return this.validateResponse(r,c)}async generateInitialResponse(e,a,n){const o=this.apiService.buildUrl(`${this.resource}/${e}/companions/${a}/initial-response`),r=await this.apiService.request(o,{...n,method:"POST",headers:{"Content-Type":"application/json"}});return this.validateResponse(r,c)}async getMyChatrooms(e){const a=this.apiService.buildUrl(`me/${this.resource}`),n=await this.apiService.request(a,e);return T.array().parse(n.data)}}const d=25;class P extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="companion-relationships"}getDataSchema(){return t.companionRelationshipSchema}async getByFromCompanionId(e){return this.getList({pagination:{pageSize:d},filters:[{field:"fromCompanionId",operator:"eq",value:e}]})}async deleteOne(e){const a=`${this.apiService.buildUrl(this.resource)}/${e.id}`;return await this.apiService.request(a,{method:"DELETE"}),{data:{}}}}class f extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="companions"}getDataSchema(){return t.companionSchema}async getByAidolId(e){return this.getList({pagination:{pageSize:d},filters:[{field:"aidolId",operator:"eq",value:e},{field:"status",operator:"eq",value:"PUBLISHED"}]})}async generateImage(e,a){const n=e.prompt.trim();if(!n)throw new Error("promptEmpty");if(n.length>200)throw new Error("promptTooLong");const o=this.apiService.buildUrl(`${this.resource}/images`),r=await this.apiService.request(o,{...a,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this.validateResponse(r,t.imageGenerationResponseSchema)}}class R extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="aidol-highlights"}getDataSchema(){return t.aidolHighlightSchema}async getByAidolId(e){return this.getList({filters:[{field:"aidolId",operator:"eq",value:e}]})}async getMessages(e,a){const n=this.apiService.buildUrl(`${this.resource}/${e}/messages`),o=await this.apiService.request(n,a);return{data:t.highlightMessageSchema.array().parse(o)}}}class C{constructor(e){this.apiService=e,this.resource="leads"}async create(e){const a=this.apiService.buildUrl(this.resource),n=await this.apiService.request(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return l.z.object({data:t.leadResponseSchema}).parse(n).data}}const p="aidol_chatroom_ids",k=l.z.record(l.z.string(),l.z.string()),m=()=>{if(typeof window>"u")return{};const i=localStorage.getItem(p);if(!i)return{};try{const e=JSON.parse(i),a=k.safeParse(e);return a.success?a.data:(console.warn("[LocalChatroomIdsRepository] Invalid data, resetting"),{})}catch(e){if(e instanceof SyntaxError)return console.warn("[LocalChatroomIdsRepository] Failed to parse, resetting"),{};throw e}},g=i=>{if(typeof window>"u")throw new Error("LocalChatroomIdsRepository write operations can only be called on the client side.");localStorage.setItem(p,JSON.stringify(i))},A={getAll(){return m()},getChatroomId(i){return m()[i]??null},setChatroomId(i,e){const a=m();a[i]=e,g(a)},removeChatroomId(i){const e=m();delete e[i],g(e)}};function M(i,e,a){if(!i)return a;const o=i.charAt(i.length-1).charCodeAt(0);if(o<44032||o>55203)return a;const r=(o-44032)%28;return e==="으로"&&a==="로"?r===0||r===8?"로":"으로":r===0?a:e}const v={load:{group:"Failed to load group info"}},N={close:"Close",save:"Save",saved:"Saved successfully.",deleted:"Deleted successfully.",error:{save:"Failed to save",load:"Failed to load data"}},w={home:"Home",explore:"Explore",myGroup:"My Group"},I={header:"Position Assignment",title:"Assign positions to each member!",subtitle:"Tap to assign a position",unassigned:"Unassigned",MAIN_VOCAL:"Main Vocal",SUB_VOCAL:"Sub Vocal",MAIN_DANCER:"Main Dancer",SUB_DANCER:"Sub Dancer",MAIN_RAPPER:"Main Rapper",SUB_RAPPER:"Sub Rapper",assignedTo:"{{position}}({{name}})",assign:"Assign",confirm:"Plan Group",needMore:"Assign positions to {{count}} more members",error:{load:"Failed to load members",update:"Failed to assign position"}},E={title:"Debut Member Casting",infoBanner:{title:"Cast your trainees",description:"The idol characters (face, voice, video) in this content are original virtual characters created by AI and are not based on any real person, including idols and celebrities."},tabs:{boy:"Boy Group",girl:"Girl Group",mixed:"Mixed Group"},newMember:{prompt:"Can't find a trainee you like?",subPrompt:"Try casting a new member"},addMember:"New Member",abilities:{title:"Abilities",vocal:"Vocal",dance:"Dance",rap:"Rap",visual:"Visual",stamina:"Stamina",charm:"Charm"},castButton:"Cast",castComplete:{title:"Casting Complete!",description:"The trainee has joined the group",viewBoard:"View Casting Board"},error:{cast:"Failed to cast"}},G="Share",L="URL copied!",$={header:"Final Debut Lineup",title:"My Casted Trainees!",subtitle:"Tap to remove",browse:"Browse Trainees",confirm:"Confirm Debut!",needMore:"Cast {{count}} more to create a group!",delete:"Remove",deleted:"Removed successfully.",empty:{title:`Final Debut Lineup
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@aioia/core"),t=require("./relationship-D3J5X8WP.js"),l=require("zod");class b extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="aidols"}getDataSchema(){return t.aidolSchema}async createAIdol(e){const a=this.apiService.buildUrl(this.resource),n=await this.apiService.request(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.aidolCreateResponseSchema.parse(n.data)}async getMy(e){const a=this.apiService.buildUrl(`me/${this.resource}`),n=await this.apiService.request(a,e);return{data:t.aidolSchema.array().parse(n.data)}}async generateImage(e,a){const n=this.apiService.buildUrl(`${this.resource}/images`),o=await this.apiService.request(n,{...a,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this.validateResponse(o,t.imageGenerationResponseSchema)}}const y=l.z.object({content:l.z.string(),createdAt:l.z.string()}),T=l.z.object({id:l.z.string(),companionId:l.z.string(),lastMessage:y.nullable()}),c=l.z.object({messageId:l.z.string(),content:l.z.string()});class S extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="chatrooms"}getDataSchema(){return t.chatroomSchema}async getMessages(e,a,n){const o=new URLSearchParams;a?.limit!==void 0&&o.set("limit",a.limit.toString()),a?.offset!==void 0&&o.set("offset",a.offset.toString());const r=o.toString(),h=this.apiService.buildUrl(`${this.resource}/${e}/messages${r?`?${r}`:""}`),u=await this.apiService.request(h,n);return this.validateResponse(u,l.z.array(t.messageSchema))}async sendMessage(e,a,n){const o=this.apiService.buildUrl(`${this.resource}/${e}/messages`),r=await this.apiService.request(o,{...n,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:a,senderType:"USER"})});return this.validateResponse(r,t.messageSchema)}async generateResponse(e,a,n){const o=this.apiService.buildUrl(`${this.resource}/${e}/companions/${a}/response`),r=await this.apiService.request(o,{...n,method:"POST",headers:{"Content-Type":"application/json"}});return this.validateResponse(r,c)}async generateInitialResponse(e,a,n){const o=this.apiService.buildUrl(`${this.resource}/${e}/companions/${a}/initial-response`),r=await this.apiService.request(o,{...n,method:"POST",headers:{"Content-Type":"application/json"}});return this.validateResponse(r,c)}async getMyChatrooms(e){const a=this.apiService.buildUrl(`me/${this.resource}`),n=await this.apiService.request(a,e);return T.array().parse(n.data)}}const d=25;class P extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="companion-relationships"}getDataSchema(){return t.companionRelationshipSchema}async getByFromCompanionId(e){return this.getList({pagination:{pageSize:d},filters:[{field:"fromCompanionId",operator:"eq",value:e}]})}async deleteOne(e){const a=`${this.apiService.buildUrl(this.resource)}/${e.id}`;return await this.apiService.request(a,{method:"DELETE"}),{data:{}}}}class f extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="companions"}getDataSchema(){return t.companionSchema}async getByAidolId(e){return this.getList({pagination:{pageSize:d},filters:[{field:"aidolId",operator:"eq",value:e},{field:"status",operator:"eq",value:"PUBLISHED"}]})}async generateImage(e,a){const n=e.prompt.trim();if(!n)throw new Error("promptEmpty");if(n.length>200)throw new Error("promptTooLong");const o=this.apiService.buildUrl(`${this.resource}/images`),r=await this.apiService.request(o,{...a,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this.validateResponse(r,t.imageGenerationResponseSchema)}}class R extends s.BaseCrudRepository{constructor(){super(...arguments),this.resource="aidol-highlights"}getDataSchema(){return t.aidolHighlightSchema}async getByAidolId(e){return this.getList({filters:[{field:"aidolId",operator:"eq",value:e}]})}async getMessages(e,a){const n=this.apiService.buildUrl(`${this.resource}/${e}/messages`),o=await this.apiService.request(n,a);return{data:t.highlightMessageSchema.array().parse(o)}}}class C{constructor(e){this.apiService=e,this.resource="leads"}async create(e){const a=this.apiService.buildUrl(this.resource),n=await this.apiService.request(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return l.z.object({data:t.leadResponseSchema}).parse(n).data}}const p="aidol_chatroom_ids",k=l.z.record(l.z.string(),l.z.string()),m=()=>{if(typeof window>"u")return{};const i=localStorage.getItem(p);if(!i)return{};try{const e=JSON.parse(i),a=k.safeParse(e);return a.success?a.data:(console.warn("[LocalChatroomIdsRepository] Invalid data, resetting"),{})}catch(e){if(e instanceof SyntaxError)return console.warn("[LocalChatroomIdsRepository] Failed to parse, resetting"),{};throw e}},g=i=>{if(typeof window>"u")throw new Error("LocalChatroomIdsRepository write operations can only be called on the client side.");localStorage.setItem(p,JSON.stringify(i))},A={getAll(){return m()},getChatroomId(i){return m()[i]??null},setChatroomId(i,e){const a=m();a[i]=e,g(a)},removeChatroomId(i){const e=m();delete e[i],g(e)}};function M(i,e,a){if(!i)return a;const o=i.charAt(i.length-1).charCodeAt(0);if(o<44032||o>55203)return a;const r=(o-44032)%28;return e==="으로"&&a==="로"?r===0||r===8?"로":"으로":r===0?a:e}const v={load:{group:"Failed to load group info"}},N={close:"Close",save:"Save",saved:"Saved successfully.",deleted:"Deleted successfully.",error:{save:"Failed to save",load:"Failed to load data"}},w={home:"Home",explore:"Explore",myGroup:"My Group"},I={header:"Position Assignment",title:"Assign positions to each member!",subtitle:"Tap to assign a position",unassigned:"Unassigned",MAIN_VOCAL:"Main Vocal",SUB_VOCAL:"Sub Vocal",MAIN_DANCER:"Main Dancer",SUB_DANCER:"Sub Dancer",MAIN_RAPPER:"Main Rapper",SUB_RAPPER:"Sub Rapper",assignedTo:"{{position}}({{name}})",assign:"Assign",confirm:"Plan Group",needMore:"Assign positions to {{count}} more members",error:{load:"Failed to load members",update:"Failed to assign position"}},E={title:"Debut Member Casting",infoBanner:{title:"Cast your trainees",description:"The idol characters (face, voice, video) in this content are original virtual characters created by AI and are not based on any real person, including idols and celebrities."},tabs:{boy:"Boy Group",girl:"Girl Group",mixed:"Mixed Group"},newMember:{prompt:"Can't find a trainee you like?",subPrompt:"Try casting a new member"},addMember:"New Member",abilities:{title:"Abilities",vocal:"Vocal",dance:"Dance",rap:"Rap",visual:"Visual",stamina:"Stamina",charm:"Charm"},castButton:"Cast",castComplete:{title:"Casting Complete!",description:"The trainee has joined the group",viewBoard:"View Casting Board"},error:{cast:"Failed to cast"}},G="Share",L="URL copied!",$={header:"Final Debut Lineup",title:"My Casted Trainees!",subtitle:"Tap to remove",browse:"Browse Trainees",confirm:"Confirm Debut!",needMore:"Cast {{count}} more to create a group!",delete:"Remove",deleted:"Removed successfully.",empty:{title:`Final Debut Lineup
2
2
  is Empty`,description:"Cast your trainees!"},error:{load:"Failed to load members.",delete:"Failed to remove."}},B={title:"Trainee Casting Complete",subtitle:"Added to the casting candidate list",remainingSlots:"Remaining Casting Slots",findNext:"Find Next Trainee",viewBoard:"View Casting Board",error:{load:"Failed to load slot information"}},H={promptPlaceholder:"How does your idol talk? Describe their vibe...",addMember:"Add Member",signed:"Signed 🥺",grade:"Grade {{grade}}",tab:{profile:"Profile",stats:"Stats"},activity:{RESTING:"Resting",PRACTICING:"Practicing",SHORT_BREAK:"Short break",RESTING_AT_HOME:"Resting at home"}},D={notFound:"Group not found",members:"Members",noMembers:"No members yet"},x={groupName:"Group Name",groupNamePlaceholder:"e.g. DREAMERS, STARLIGHT",memberName:"Member Name",memberNamePlaceholder:"e.g. Luna, Kai",concept:"Concept",selectConcept:"Select a concept",personality:"Personality",concepts:{cute:"Cute",cool:"Cool",elegant:"Elegant",powerful:"Powerful"},personalities:{cheerful:{label:"Cheerful",description:"Always bright and positive"},cool:{label:"Cool",description:"Calm and collected"},tsundere:{label:"Tsundere",description:"Cold outside, warm inside"},gentle:{label:"Gentle",description:"Kind and caring"}},step1:"Group",step2:"Members",step3:"Done",step1Title:"Create Your Group",step2Title:"Add Members",groupNameRequired:"Please enter a group name",memberNameRequired:"Please enter a member name",memberRequired:"Please add at least one member",emblem:"Emblem",emblemPromptPlaceholder:"Describe your group's emblem...",emblemRequired:"Please generate an emblem image",generate:"Generate",next:"Next",back:"Back",create:"Create",completeTitle:"Your Idol is Ready!",completeDescription:"Start chatting with your dream idol now",viewProfile:"View Profile"},_={greeting1:"Hello!",greeting2:"We are {{name}}!",greeting3:"Nice to meet you",createAnother:"Create Another Group",share:"Share Profile",banner:"Curious about this group's next move?",error:{load:"Failed to load group info"}},F={header:"Enter Email",previewTitle:`Dorm stories, practice tales
3
3
  We'll send you real reviews from members!`,previewMessage:"Shouldn't you talk to your hyung more respectfully?",title:"Stay Updated",description:"Get the latest news and updates about this group via email.",emailLabel:"Email",emailPlaceholder:"example@email.com",submit:"Get Updates",submitting:"Subscribing...",success:"Successfully subscribed!",error:"Failed to subscribe. Please try again."},K={header:"Group Planning",step1Title:"Name your group",step2Title:"Create your group emblem",namePlaceholder:"e.g.) Dreamers, Starlight",promptPlaceholder:"e.g.)",generate:"Generate Image",regenerate:"Regenerate Image",emptyImage:`Generated profile
4
4
  image will
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BaseCrudRepository as l } from "@aioia/core";
2
- import { a as m, b as T, i as p, c as f, m as c, d as P, e as S, f as k, h as C, l as R } from "./relationship-BP7mIOjL.mjs";
3
- import { I as Zn, R as ei, S as ai, g as ti, j as ni } from "./relationship-BP7mIOjL.mjs";
2
+ import { a as m, b as T, i as p, c as f, m as c, d as P, e as S, f as k, h as C, l as R } from "./relationship-CYLROqFx.mjs";
3
+ import { I as Zn, R as ei, S as ai, g as ti, j as ni } from "./relationship-CYLROqFx.mjs";
4
4
  import { z as r } from "zod";
5
5
  class Kn extends l {
6
6
  constructor() {
@@ -0,0 +1,137 @@
1
+ import { z as n } from "zod";
2
+ const i = n.enum(["DRAFT", "PUBLISHED"]), g = n.object({
3
+ id: n.string(),
4
+ name: n.string().nullable(),
5
+ email: n.string().nullable().optional(),
6
+ greeting: n.string().nullable().optional(),
7
+ concept: n.string().nullable().optional(),
8
+ profileImageUrl: n.string().nullable(),
9
+ status: i,
10
+ createdAt: n.string(),
11
+ updatedAt: n.string()
12
+ }), m = n.object({
13
+ id: n.string()
14
+ });
15
+ n.object({
16
+ prompt: n.string().max(200)
17
+ });
18
+ const o = n.object({
19
+ imageUrl: n.string(),
20
+ width: n.number(),
21
+ height: n.number(),
22
+ format: n.string()
23
+ }), u = n.object({
24
+ data: o
25
+ }), d = n.object({
26
+ id: n.string(),
27
+ companionId: n.string(),
28
+ name: n.string(),
29
+ language: n.string(),
30
+ createdAt: n.string(),
31
+ updatedAt: n.string()
32
+ });
33
+ var e = /* @__PURE__ */ ((t) => (t.USER = "USER", t.COMPANION = "COMPANION", t))(e || {}), s = /* @__PURE__ */ ((t) => (t.SENDING = "SENDING", t.SENT = "SENT", t.ERROR = "ERROR", t))(s || {});
34
+ const p = n.object({
35
+ id: n.string(),
36
+ senderType: n.nativeEnum(e),
37
+ content: n.string(),
38
+ createdAt: n.string(),
39
+ companionId: n.string().optional(),
40
+ anonymousId: n.string().optional()
41
+ }), b = (t) => t.senderType === "USER", A = (t) => t.senderType === "COMPANION", I = [
42
+ "MAIN_VOCAL",
43
+ "SUB_VOCAL",
44
+ "MAIN_DANCER",
45
+ "SUB_DANCER",
46
+ "MAIN_RAPPER",
47
+ "SUB_RAPPER"
48
+ ], r = n.object({
49
+ vocal: n.number(),
50
+ dance: n.number(),
51
+ rap: n.number(),
52
+ visual: n.number(),
53
+ stamina: n.number(),
54
+ charm: n.number()
55
+ }), S = n.object({
56
+ id: n.string(),
57
+ aidolId: n.string().nullable().optional(),
58
+ name: n.string().nullable().optional(),
59
+ biography: n.string().nullable().optional(),
60
+ profilePictureUrl: n.string().nullable().optional(),
61
+ grade: n.enum(["A", "B", "C", "F"]).nullable().optional(),
62
+ position: n.enum([
63
+ "MAIN_VOCAL",
64
+ "SUB_VOCAL",
65
+ "MAIN_DANCER",
66
+ "SUB_DANCER",
67
+ "MAIN_RAPPER",
68
+ "SUB_RAPPER"
69
+ ]).nullable().optional(),
70
+ mbti: n.string().nullable().optional(),
71
+ gender: n.enum(["MALE", "FEMALE"]).nullable().optional(),
72
+ status: n.enum(["DRAFT", "PUBLISHED"]),
73
+ stats: r.optional(),
74
+ createdAt: n.string(),
75
+ updatedAt: n.string()
76
+ }), h = n.object({
77
+ id: n.string(),
78
+ fromCompanionId: n.string().nullable().optional(),
79
+ toCompanionId: n.string().nullable().optional(),
80
+ intimacy: n.number().nullable().optional(),
81
+ nickname: n.string().nullable().optional(),
82
+ createdAt: n.string(),
83
+ updatedAt: n.string()
84
+ }), R = n.object({
85
+ id: n.string(),
86
+ highlightId: n.string(),
87
+ companionId: n.string().nullable(),
88
+ sequence: n.number(),
89
+ content: n.string(),
90
+ createdAt: n.string(),
91
+ updatedAt: n.string()
92
+ }), E = n.object({
93
+ id: n.string(),
94
+ aidolId: n.string().nullable().optional(),
95
+ title: n.string(),
96
+ thumbnailUrl: n.string(),
97
+ subtitle: n.string(),
98
+ isPremium: n.boolean(),
99
+ createdAt: n.string(),
100
+ updatedAt: n.string()
101
+ }), N = n.object({
102
+ email: n.string()
103
+ }), l = {
104
+ awkward: 15,
105
+ polite: 30,
106
+ friendly: 45,
107
+ tikitaka: 60,
108
+ trust: 70,
109
+ emotional: 80,
110
+ bestFriend: 90,
111
+ inseparable: 100
112
+ }, P = Object.fromEntries(
113
+ Object.entries(l).map(([t, a]) => [
114
+ a,
115
+ t
116
+ ])
117
+ );
118
+ export {
119
+ P as I,
120
+ s as M,
121
+ I as P,
122
+ l as R,
123
+ e as S,
124
+ g as a,
125
+ m as b,
126
+ d as c,
127
+ h as d,
128
+ S as e,
129
+ E as f,
130
+ A as g,
131
+ R as h,
132
+ u as i,
133
+ b as j,
134
+ N as l,
135
+ p as m
136
+ };
137
+ //# sourceMappingURL=relationship-CYLROqFx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship-CYLROqFx.mjs","sources":["../src/schemas/aidol.ts","../src/schemas/chatroom.ts","../src/schemas/companion.ts","../src/schemas/companion-relationship.ts","../src/schemas/highlight.ts","../src/schemas/lead.ts","../src/constants/relationship.ts"],"sourcesContent":["/**\n * AIdol (group) schemas\n * Matches backend aidol/schemas/aidol.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nimport type { Companion } from \"./companion\";\n\n/**\n * AIdol schema (public fields only, excludes anonymous_id)\n * Matches backend AIdolPublic (aidol/schemas/aidol.py)\n */\nexport const aidolStatusSchema = z.enum([\"DRAFT\", \"PUBLISHED\"]);\nexport type AIdolStatus = z.infer<typeof aidolStatusSchema>;\n\nexport const aidolSchema = z.object({\n id: z.string(),\n name: z.string().nullable(),\n email: z.string().nullable().optional(),\n greeting: z.string().nullable().optional(),\n concept: z.string().nullable().optional(),\n profileImageUrl: z.string().nullable(),\n status: aidolStatusSchema,\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdol extends BaseRecord {\n id: string;\n name: string | null;\n email?: string | null;\n greeting?: string | null;\n concept?: string | null;\n profileImageUrl: string | null;\n status: AIdolStatus;\n createdAt: string;\n updatedAt: string;\n companions?: Companion[];\n}\n\n/**\n * Schema for AIdol creation response (backend returns only id)\n */\nexport const aidolCreateResponseSchema = z.object({\n id: z.string(),\n});\n\nexport type AIdolCreateResponse = z.infer<typeof aidolCreateResponseSchema>;\n\n/**\n * Schema for creating an AIdol group\n */\nexport interface AIdolCreate {\n name: string;\n concept?: string | null;\n profileImageUrl: string;\n}\n\n/**\n * Schema for updating an AIdol group\n */\nexport interface AIdolUpdate {\n name?: string;\n concept?: string | null;\n profileImageUrl?: string | null;\n status?: AIdolStatus;\n}\n\n// ---------------------------------------------------------------------------\n// Image Generation\n// ---------------------------------------------------------------------------\n\n/**\n * Request schema for image generation\n */\nexport const imageGenerationRequestSchema = z.object({\n prompt: z.string().max(200),\n});\n\nexport type ImageGenerationRequest = z.infer<\n typeof imageGenerationRequestSchema\n>;\n\n/**\n * Image generation result data\n */\nexport const imageGenerationDataSchema = z.object({\n imageUrl: z.string(),\n width: z.number(),\n height: z.number(),\n format: z.string(),\n});\n\nexport type ImageGenerationData = z.infer<typeof imageGenerationDataSchema>;\n\n/**\n * Response schema for image generation\n */\nexport const imageGenerationResponseSchema = z.object({\n data: imageGenerationDataSchema,\n});\n\nexport type ImageGenerationResponse = z.infer<\n typeof imageGenerationResponseSchema\n>;\n","/**\n * Chatroom schemas\n * Matches backend aidol/schemas/chatroom.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n// =============================================================================\n// Chatroom Schemas\n// =============================================================================\n\nexport const chatroomSchema = z.object({\n id: z.string(),\n companionId: z.string(),\n name: z.string(),\n language: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface Chatroom extends BaseRecord {\n id: string;\n companionId: string;\n name: string;\n language: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ChatroomCreate {\n companionId: string;\n name: string;\n language?: string;\n}\n\n// =============================================================================\n// Message Schemas\n// =============================================================================\n\nexport enum SenderType {\n USER = \"USER\",\n COMPANION = \"COMPANION\",\n}\n\nexport enum MessageStatus {\n SENDING = \"SENDING\",\n SENT = \"SENT\",\n ERROR = \"ERROR\",\n}\n\nexport const messageSchema = z.object({\n id: z.string(),\n senderType: z.nativeEnum(SenderType),\n content: z.string(),\n createdAt: z.string(),\n companionId: z.string().optional(),\n anonymousId: z.string().optional(),\n});\n\nexport interface Message extends BaseRecord {\n id: string;\n senderType: SenderType;\n content: string;\n createdAt: string;\n companionId?: string;\n anonymousId?: string;\n status?: MessageStatus;\n}\n\n/**\n * Type guard to check if message is from user\n */\nexport const isUser = (message: Message): boolean => {\n return message.senderType === SenderType.USER;\n};\n\n/**\n * Type guard to check if message is from companion\n */\nexport const isCompanion = (message: Message): boolean => {\n return message.senderType === SenderType.COMPANION;\n};\n","/**\n * Companion (member) schemas\n * Matches backend aidol/schemas/companion.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nexport const POSITIONS = [\n \"MAIN_VOCAL\",\n \"SUB_VOCAL\",\n \"MAIN_DANCER\",\n \"SUB_DANCER\",\n \"MAIN_RAPPER\",\n \"SUB_RAPPER\",\n] as const;\n\nexport type Position = (typeof POSITIONS)[number];\n\nexport type Gender = \"MALE\" | \"FEMALE\";\n\nexport type Grade = \"A\" | \"B\" | \"C\" | \"F\";\n\nexport type Status = \"DRAFT\" | \"PUBLISHED\";\n\nexport interface CompanionStats {\n vocal: number;\n dance: number;\n rap: number;\n visual: number;\n stamina: number;\n charm: number;\n}\n\nconst companionStatsSchema = z.object({\n vocal: z.number(),\n dance: z.number(),\n rap: z.number(),\n visual: z.number(),\n stamina: z.number(),\n charm: z.number(),\n});\n\n/**\n * Companion schema (public fields only, excludes system_prompt)\n */\nexport const companionSchema = z.object({\n id: z.string(),\n aidolId: z.string().nullable().optional(),\n name: z.string().nullable().optional(),\n biography: z.string().nullable().optional(),\n profilePictureUrl: z.string().nullable().optional(),\n grade: z.enum([\"A\", \"B\", \"C\", \"F\"]).nullable().optional(),\n position: z\n .enum([\n \"MAIN_VOCAL\",\n \"SUB_VOCAL\",\n \"MAIN_DANCER\",\n \"SUB_DANCER\",\n \"MAIN_RAPPER\",\n \"SUB_RAPPER\",\n ])\n .nullable()\n .optional(),\n mbti: z.string().nullable().optional(),\n gender: z.enum([\"MALE\", \"FEMALE\"]).nullable().optional(),\n status: z.enum([\"DRAFT\", \"PUBLISHED\"]),\n stats: companionStatsSchema.optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface Companion extends BaseRecord {\n id: string;\n aidolId?: string | null;\n name?: string | null;\n biography?: string | null;\n profilePictureUrl?: string | null;\n grade?: Grade | null;\n position?: Position | null;\n mbti?: string | null;\n gender?: Gender | null;\n status: Status;\n stats?: CompanionStats;\n createdAt: string;\n updatedAt: string;\n}\n\n/**\n * Schema for creating a Companion\n * Includes systemPrompt for creation (excluded from response)\n */\nexport interface CompanionCreate {\n aidolId?: string | null;\n name: string;\n biography?: string | null;\n profilePictureUrl?: string | null;\n systemPrompt?: string | null;\n}\n\n/**\n * Schema for updating a Companion\n */\nexport interface CompanionUpdate {\n aidolId?: string | null;\n name?: string;\n biography?: string | null;\n profilePictureUrl?: string | null;\n systemPrompt?: string | null;\n position?: Position | null;\n gender?: Gender | null;\n status?: Status;\n mbtiEnergy?: number;\n mbtiPerception?: number;\n mbtiJudgment?: number;\n mbtiLifestyle?: number;\n}\n","/**\n * Companion Relationship schemas\n * Matches backend aidol/schemas/companion_relationship.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n/**\n * CompanionRelationship schema\n * Matches backend CompanionRelationship (aidol/schemas/companion_relationship.py)\n */\nexport const companionRelationshipSchema = z.object({\n id: z.string(),\n fromCompanionId: z.string().nullable().optional(),\n toCompanionId: z.string().nullable().optional(),\n intimacy: z.number().nullable().optional(),\n nickname: z.string().nullable().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface CompanionRelationship extends BaseRecord {\n id: string;\n fromCompanionId?: string | null;\n toCompanionId?: string | null;\n intimacy?: number | null;\n nickname?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CompanionRelationshipCreate {\n fromCompanionId: string;\n toCompanionId: string;\n intimacy?: number;\n nickname?: string;\n}\n","/**\n * AIdol Highlight schemas\n * Matches backend aidol/schemas/highlight.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// HighlightMessage\n// ---------------------------------------------------------------------------\n\nexport interface HighlightMessage {\n id: string;\n highlightId: string;\n companionId: string | null;\n sequence: number;\n content: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport const highlightMessageSchema = z.object({\n id: z.string(),\n highlightId: z.string(),\n companionId: z.string().nullable(),\n sequence: z.number(),\n content: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n}) satisfies z.ZodType<HighlightMessage>;\n\n// ---------------------------------------------------------------------------\n// AIdolHighlight\n// ---------------------------------------------------------------------------\n\nexport const aidolHighlightSchema = z.object({\n id: z.string(),\n aidolId: z.string().nullable().optional(),\n title: z.string(),\n thumbnailUrl: z.string(),\n subtitle: z.string(),\n isPremium: z.boolean(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdolHighlight extends BaseRecord {\n id: string;\n aidolId?: string | null;\n title: string;\n thumbnailUrl: string;\n subtitle: string;\n isPremium: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\n// 내그룹의 하이라이트 섹션 표현이 달라서 따로 정의\nexport interface MyGroupHighlightSection {\n title: string;\n subtitle: string;\n items: AIdolHighlight[];\n}\n","/**\n * Lead schemas\n * Matches backend aidol/schemas/aidol_lead.py definitions\n */\n\nimport { z } from \"zod\";\n\n/**\n * Lead request schema\n */\nexport interface LeadRequest {\n aidolId: string;\n email: string;\n}\n\n/**\n * Lead response schema\n */\nexport const leadResponseSchema = z.object({\n email: z.string(),\n});\n\nexport type LeadResponse = z.infer<typeof leadResponseSchema>;\n","/** 관계 유형 → 친밀도 매핑 */\nexport const RELATIONSHIP_TYPE_TO_INTIMACY = {\n awkward: 15,\n polite: 30,\n friendly: 45,\n tikitaka: 60,\n trust: 70,\n emotional: 80,\n bestFriend: 90,\n inseparable: 100,\n} as const;\n\n/** 관계 유형 타입 (위 객체에서 자동 추론) */\nexport type RelationshipType = keyof typeof RELATIONSHIP_TYPE_TO_INTIMACY;\n\n/** 친밀도 → 관계 유형 매핑 (위 객체에서 파생) */\nexport const INTIMACY_TO_RELATIONSHIP_TYPE = Object.fromEntries(\n Object.entries(RELATIONSHIP_TYPE_TO_INTIMACY).map(([type, intimacy]) => [\n intimacy,\n type,\n ]),\n) as Record<number, RelationshipType>;\n"],"names":["aidolStatusSchema","z","aidolSchema","aidolCreateResponseSchema","imageGenerationDataSchema","imageGenerationResponseSchema","chatroomSchema","SenderType","MessageStatus","messageSchema","isUser","message","isCompanion","POSITIONS","companionStatsSchema","companionSchema","companionRelationshipSchema","highlightMessageSchema","aidolHighlightSchema","leadResponseSchema","RELATIONSHIP_TYPE_TO_INTIMACY","INTIMACY_TO_RELATIONSHIP_TYPE","type","intimacy"],"mappings":";AAcO,MAAMA,IAAoBC,EAAE,KAAK,CAAC,SAAS,WAAW,CAAC,GAGjDC,IAAcD,EAAE,OAAO;AAAA,EAClC,IAAIA,EAAE,OAAA;AAAA,EACN,MAAMA,EAAE,OAAA,EAAS,SAAA;AAAA,EACjB,OAAOA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC7B,UAAUA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAChC,SAASA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC/B,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC5B,QAAQD;AAAA,EACR,WAAWC,EAAE,OAAA;AAAA,EACb,WAAWA,EAAE,OAAA;AACf,CAAC,GAkBYE,IAA4BF,EAAE,OAAO;AAAA,EAChD,IAAIA,EAAE,OAAA;AACR,CAAC;AA8B2CA,EAAE,OAAO;AAAA,EACnD,QAAQA,EAAE,OAAA,EAAS,IAAI,GAAG;AAC5B,CAAC;AASM,MAAMG,IAA4BH,EAAE,OAAO;AAAA,EAChD,UAAUA,EAAE,OAAA;AAAA,EACZ,OAAOA,EAAE,OAAA;AAAA,EACT,QAAQA,EAAE,OAAA;AAAA,EACV,QAAQA,EAAE,OAAA;AACZ,CAAC,GAOYI,IAAgCJ,EAAE,OAAO;AAAA,EACpD,MAAMG;AAC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AAAA,EACb,WAAWA,EAAE,OAAA;AACf,CAAC,GAMYiB,IAAuBjB,EAAE,OAAO;AAAA,EAC3C,IAAIA,EAAE,OAAA;AAAA,EACN,SAASA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC/B,OAAOA,EAAE,OAAA;AAAA,EACT,cAAcA,EAAE,OAAA;AAAA,EAChB,UAAUA,EAAE,OAAA;AAAA,EACZ,WAAWA,EAAE,QAAA;AAAA,EACb,WAAWA,EAAE,OAAA;AAAA,EACb,WAAWA,EAAE,OAAA;AACf,CAAC,GC3BYkB,IAAqBlB,EAAE,OAAO;AAAA,EACzC,OAAOA,EAAE,OAAA;AACX,CAAC,GCnBYmB,IAAgC;AAAA,EAC3C,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AACf,GAMaC,IAAgC,OAAO;AAAA,EAClD,OAAO,QAAQD,CAA6B,EAAE,IAAI,CAAC,CAACE,GAAMC,CAAQ,MAAM;AAAA,IACtEA;AAAA,IACAD;AAAA,EAAA,CACD;AACH;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const n=require("zod"),s=n.z.enum(["DRAFT","PUBLISHED"]),r=n.z.object({id:n.z.string(),name:n.z.string().nullable(),email:n.z.string().nullable().optional(),greeting:n.z.string().nullable().optional(),concept:n.z.string().nullable().optional(),profileImageUrl:n.z.string().nullable(),status:s,createdAt:n.z.string(),updatedAt:n.z.string()}),l=n.z.object({id:n.z.string()});n.z.object({prompt:n.z.string().max(200)});const c=n.z.object({imageUrl:n.z.string(),width:n.z.number(),height:n.z.number(),format:n.z.string()}),z=n.z.object({data:c}),m=n.z.object({id:n.z.string(),companionId:n.z.string(),name:n.z.string(),language:n.z.string(),createdAt:n.z.string(),updatedAt:n.z.string()});var e=(t=>(t.USER="USER",t.COMPANION="COMPANION",t))(e||{}),i=(t=>(t.SENDING="SENDING",t.SENT="SENT",t.ERROR="ERROR",t))(i||{});const g=n.z.object({id:n.z.string(),senderType:n.z.nativeEnum(e),content:n.z.string(),createdAt:n.z.string(),companionId:n.z.string().optional(),anonymousId:n.z.string().optional()}),d=t=>t.senderType==="USER",p=t=>t.senderType==="COMPANION",u=["MAIN_VOCAL","SUB_VOCAL","MAIN_DANCER","SUB_DANCER","MAIN_RAPPER","SUB_RAPPER"],b=n.z.object({vocal:n.z.number(),dance:n.z.number(),rap:n.z.number(),visual:n.z.number(),stamina:n.z.number(),charm:n.z.number()}),A=n.z.object({id:n.z.string(),aidolId:n.z.string().nullable().optional(),name:n.z.string().nullable().optional(),biography:n.z.string().nullable().optional(),profilePictureUrl:n.z.string().nullable().optional(),grade:n.z.enum(["A","B","C","F"]).nullable().optional(),position:n.z.enum(["MAIN_VOCAL","SUB_VOCAL","MAIN_DANCER","SUB_DANCER","MAIN_RAPPER","SUB_RAPPER"]).nullable().optional(),mbti:n.z.string().nullable().optional(),gender:n.z.enum(["MALE","FEMALE"]).nullable().optional(),status:n.z.enum(["DRAFT","PUBLISHED"]),stats:b.optional(),createdAt:n.z.string(),updatedAt:n.z.string()}),S=n.z.object({id:n.z.string(),fromCompanionId:n.z.string().nullable().optional(),toCompanionId:n.z.string().nullable().optional(),intimacy:n.z.number().nullable().optional(),nickname:n.z.string().nullable().optional(),createdAt:n.z.string(),updatedAt:n.z.string()}),h=n.z.object({id:n.z.string(),highlightId:n.z.string(),companionId:n.z.string().nullable(),sequence:n.z.number(),content:n.z.string(),createdAt:n.z.string(),updatedAt:n.z.string()}),I=n.z.object({id:n.z.string(),aidolId:n.z.string().nullable().optional(),title:n.z.string(),thumbnailUrl:n.z.string(),subtitle:n.z.string(),isPremium:n.z.boolean(),createdAt:n.z.string(),updatedAt:n.z.string()}),R=n.z.object({email:n.z.string()}),a={awkward:15,polite:30,friendly:45,tikitaka:60,trust:70,emotional:80,bestFriend:90,inseparable:100},E=Object.fromEntries(Object.entries(a).map(([t,o])=>[o,t]));exports.INTIMACY_TO_RELATIONSHIP_TYPE=E;exports.MessageStatus=i;exports.POSITIONS=u;exports.RELATIONSHIP_TYPE_TO_INTIMACY=a;exports.SenderType=e;exports.aidolCreateResponseSchema=l;exports.aidolHighlightSchema=I;exports.aidolSchema=r;exports.chatroomSchema=m;exports.companionRelationshipSchema=S;exports.companionSchema=A;exports.highlightMessageSchema=h;exports.imageGenerationResponseSchema=z;exports.isCompanion=p;exports.isUser=d;exports.leadResponseSchema=R;exports.messageSchema=g;
2
+ //# sourceMappingURL=relationship-D3J5X8WP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship-D3J5X8WP.js","sources":["../src/schemas/aidol.ts","../src/schemas/chatroom.ts","../src/schemas/companion.ts","../src/schemas/companion-relationship.ts","../src/schemas/highlight.ts","../src/schemas/lead.ts","../src/constants/relationship.ts"],"sourcesContent":["/**\n * AIdol (group) schemas\n * Matches backend aidol/schemas/aidol.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nimport type { Companion } from \"./companion\";\n\n/**\n * AIdol schema (public fields only, excludes anonymous_id)\n * Matches backend AIdolPublic (aidol/schemas/aidol.py)\n */\nexport const aidolStatusSchema = z.enum([\"DRAFT\", \"PUBLISHED\"]);\nexport type AIdolStatus = z.infer<typeof aidolStatusSchema>;\n\nexport const aidolSchema = z.object({\n id: z.string(),\n name: z.string().nullable(),\n email: z.string().nullable().optional(),\n greeting: z.string().nullable().optional(),\n concept: z.string().nullable().optional(),\n profileImageUrl: z.string().nullable(),\n status: aidolStatusSchema,\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdol extends BaseRecord {\n id: string;\n name: string | null;\n email?: string | null;\n greeting?: string | null;\n concept?: string | null;\n profileImageUrl: string | null;\n status: AIdolStatus;\n createdAt: string;\n updatedAt: string;\n companions?: Companion[];\n}\n\n/**\n * Schema for AIdol creation response (backend returns only id)\n */\nexport const aidolCreateResponseSchema = z.object({\n id: z.string(),\n});\n\nexport type AIdolCreateResponse = z.infer<typeof aidolCreateResponseSchema>;\n\n/**\n * Schema for creating an AIdol group\n */\nexport interface AIdolCreate {\n name: string;\n concept?: string | null;\n profileImageUrl: string;\n}\n\n/**\n * Schema for updating an AIdol group\n */\nexport interface AIdolUpdate {\n name?: string;\n concept?: string | null;\n profileImageUrl?: string | null;\n status?: AIdolStatus;\n}\n\n// ---------------------------------------------------------------------------\n// Image Generation\n// ---------------------------------------------------------------------------\n\n/**\n * Request schema for image generation\n */\nexport const imageGenerationRequestSchema = z.object({\n prompt: z.string().max(200),\n});\n\nexport type ImageGenerationRequest = z.infer<\n typeof imageGenerationRequestSchema\n>;\n\n/**\n * Image generation result data\n */\nexport const imageGenerationDataSchema = z.object({\n imageUrl: z.string(),\n width: z.number(),\n height: z.number(),\n format: z.string(),\n});\n\nexport type ImageGenerationData = z.infer<typeof imageGenerationDataSchema>;\n\n/**\n * Response schema for image generation\n */\nexport const imageGenerationResponseSchema = z.object({\n data: imageGenerationDataSchema,\n});\n\nexport type ImageGenerationResponse = z.infer<\n typeof imageGenerationResponseSchema\n>;\n","/**\n * Chatroom schemas\n * Matches backend aidol/schemas/chatroom.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n// =============================================================================\n// Chatroom Schemas\n// =============================================================================\n\nexport const chatroomSchema = z.object({\n id: z.string(),\n companionId: z.string(),\n name: z.string(),\n language: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface Chatroom extends BaseRecord {\n id: string;\n companionId: string;\n name: string;\n language: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ChatroomCreate {\n companionId: string;\n name: string;\n language?: string;\n}\n\n// =============================================================================\n// Message Schemas\n// =============================================================================\n\nexport enum SenderType {\n USER = \"USER\",\n COMPANION = \"COMPANION\",\n}\n\nexport enum MessageStatus {\n SENDING = \"SENDING\",\n SENT = \"SENT\",\n ERROR = \"ERROR\",\n}\n\nexport const messageSchema = z.object({\n id: z.string(),\n senderType: z.nativeEnum(SenderType),\n content: z.string(),\n createdAt: z.string(),\n companionId: z.string().optional(),\n anonymousId: z.string().optional(),\n});\n\nexport interface Message extends BaseRecord {\n id: string;\n senderType: SenderType;\n content: string;\n createdAt: string;\n companionId?: string;\n anonymousId?: string;\n status?: MessageStatus;\n}\n\n/**\n * Type guard to check if message is from user\n */\nexport const isUser = (message: Message): boolean => {\n return message.senderType === SenderType.USER;\n};\n\n/**\n * Type guard to check if message is from companion\n */\nexport const isCompanion = (message: Message): boolean => {\n return message.senderType === SenderType.COMPANION;\n};\n","/**\n * Companion (member) schemas\n * Matches backend aidol/schemas/companion.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nexport const POSITIONS = [\n \"MAIN_VOCAL\",\n \"SUB_VOCAL\",\n \"MAIN_DANCER\",\n \"SUB_DANCER\",\n \"MAIN_RAPPER\",\n \"SUB_RAPPER\",\n] as const;\n\nexport type Position = (typeof POSITIONS)[number];\n\nexport type Gender = \"MALE\" | \"FEMALE\";\n\nexport type Grade = \"A\" | \"B\" | \"C\" | \"F\";\n\nexport type Status = \"DRAFT\" | \"PUBLISHED\";\n\nexport interface CompanionStats {\n vocal: number;\n dance: number;\n rap: number;\n visual: number;\n stamina: number;\n charm: number;\n}\n\nconst companionStatsSchema = z.object({\n vocal: z.number(),\n dance: z.number(),\n rap: z.number(),\n visual: z.number(),\n stamina: z.number(),\n charm: z.number(),\n});\n\n/**\n * Companion schema (public fields only, excludes system_prompt)\n */\nexport const companionSchema = z.object({\n id: z.string(),\n aidolId: z.string().nullable().optional(),\n name: z.string().nullable().optional(),\n biography: z.string().nullable().optional(),\n profilePictureUrl: z.string().nullable().optional(),\n grade: z.enum([\"A\", \"B\", \"C\", \"F\"]).nullable().optional(),\n position: z\n .enum([\n \"MAIN_VOCAL\",\n \"SUB_VOCAL\",\n \"MAIN_DANCER\",\n \"SUB_DANCER\",\n \"MAIN_RAPPER\",\n \"SUB_RAPPER\",\n ])\n .nullable()\n .optional(),\n mbti: z.string().nullable().optional(),\n gender: z.enum([\"MALE\", \"FEMALE\"]).nullable().optional(),\n status: z.enum([\"DRAFT\", \"PUBLISHED\"]),\n stats: companionStatsSchema.optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface Companion extends BaseRecord {\n id: string;\n aidolId?: string | null;\n name?: string | null;\n biography?: string | null;\n profilePictureUrl?: string | null;\n grade?: Grade | null;\n position?: Position | null;\n mbti?: string | null;\n gender?: Gender | null;\n status: Status;\n stats?: CompanionStats;\n createdAt: string;\n updatedAt: string;\n}\n\n/**\n * Schema for creating a Companion\n * Includes systemPrompt for creation (excluded from response)\n */\nexport interface CompanionCreate {\n aidolId?: string | null;\n name: string;\n biography?: string | null;\n profilePictureUrl?: string | null;\n systemPrompt?: string | null;\n}\n\n/**\n * Schema for updating a Companion\n */\nexport interface CompanionUpdate {\n aidolId?: string | null;\n name?: string;\n biography?: string | null;\n profilePictureUrl?: string | null;\n systemPrompt?: string | null;\n position?: Position | null;\n gender?: Gender | null;\n status?: Status;\n mbtiEnergy?: number;\n mbtiPerception?: number;\n mbtiJudgment?: number;\n mbtiLifestyle?: number;\n}\n","/**\n * Companion Relationship schemas\n * Matches backend aidol/schemas/companion_relationship.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n/**\n * CompanionRelationship schema\n * Matches backend CompanionRelationship (aidol/schemas/companion_relationship.py)\n */\nexport const companionRelationshipSchema = z.object({\n id: z.string(),\n fromCompanionId: z.string().nullable().optional(),\n toCompanionId: z.string().nullable().optional(),\n intimacy: z.number().nullable().optional(),\n nickname: z.string().nullable().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface CompanionRelationship extends BaseRecord {\n id: string;\n fromCompanionId?: string | null;\n toCompanionId?: string | null;\n intimacy?: number | null;\n nickname?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CompanionRelationshipCreate {\n fromCompanionId: string;\n toCompanionId: string;\n intimacy?: number;\n nickname?: string;\n}\n","/**\n * AIdol Highlight schemas\n * Matches backend aidol/schemas/highlight.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// HighlightMessage\n// ---------------------------------------------------------------------------\n\nexport interface HighlightMessage {\n id: string;\n highlightId: string;\n companionId: string | null;\n sequence: number;\n content: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport const highlightMessageSchema = z.object({\n id: z.string(),\n highlightId: z.string(),\n companionId: z.string().nullable(),\n sequence: z.number(),\n content: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n}) satisfies z.ZodType<HighlightMessage>;\n\n// ---------------------------------------------------------------------------\n// AIdolHighlight\n// ---------------------------------------------------------------------------\n\nexport const aidolHighlightSchema = z.object({\n id: z.string(),\n aidolId: z.string().nullable().optional(),\n title: z.string(),\n thumbnailUrl: z.string(),\n subtitle: z.string(),\n isPremium: z.boolean(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdolHighlight extends BaseRecord {\n id: string;\n aidolId?: string | null;\n title: string;\n thumbnailUrl: string;\n subtitle: string;\n isPremium: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\n// 내그룹의 하이라이트 섹션 표현이 달라서 따로 정의\nexport interface MyGroupHighlightSection {\n title: string;\n subtitle: string;\n items: AIdolHighlight[];\n}\n","/**\n * Lead schemas\n * Matches backend aidol/schemas/aidol_lead.py definitions\n */\n\nimport { z } from \"zod\";\n\n/**\n * Lead request schema\n */\nexport interface LeadRequest {\n aidolId: string;\n email: string;\n}\n\n/**\n * Lead response schema\n */\nexport const leadResponseSchema = z.object({\n email: z.string(),\n});\n\nexport type LeadResponse = z.infer<typeof leadResponseSchema>;\n","/** 관계 유형 → 친밀도 매핑 */\nexport const RELATIONSHIP_TYPE_TO_INTIMACY = {\n awkward: 15,\n polite: 30,\n friendly: 45,\n tikitaka: 60,\n trust: 70,\n emotional: 80,\n bestFriend: 90,\n inseparable: 100,\n} as const;\n\n/** 관계 유형 타입 (위 객체에서 자동 추론) */\nexport type RelationshipType = keyof typeof RELATIONSHIP_TYPE_TO_INTIMACY;\n\n/** 친밀도 → 관계 유형 매핑 (위 객체에서 파생) */\nexport const INTIMACY_TO_RELATIONSHIP_TYPE = Object.fromEntries(\n Object.entries(RELATIONSHIP_TYPE_TO_INTIMACY).map(([type, intimacy]) => [\n intimacy,\n type,\n ]),\n) as Record<number, RelationshipType>;\n"],"names":["aidolStatusSchema","z","aidolSchema","aidolCreateResponseSchema","imageGenerationDataSchema","imageGenerationResponseSchema","chatroomSchema","SenderType","MessageStatus","messageSchema","isUser","message","isCompanion","POSITIONS","companionStatsSchema","companionSchema","companionRelationshipSchema","highlightMessageSchema","aidolHighlightSchema","leadResponseSchema","RELATIONSHIP_TYPE_TO_INTIMACY","INTIMACY_TO_RELATIONSHIP_TYPE","type","intimacy"],"mappings":"oCAcaA,EAAoBC,EAAAA,EAAE,KAAK,CAAC,QAAS,WAAW,CAAC,EAGjDC,EAAcD,EAAAA,EAAE,OAAO,CAClC,GAAIA,EAAAA,EAAE,OAAA,EACN,KAAMA,EAAAA,EAAE,OAAA,EAAS,SAAA,EACjB,MAAOA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA,EAC7B,SAAUA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA,EAChC,QAASA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA,EAC/B,gBAAiBA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAC5B,OAAQD,EACR,UAAWC,EAAAA,EAAE,OAAA,EACb,UAAWA,EAAAA,EAAE,OAAA,CACf,CAAC,EAkBYE,EAA4BF,EAAAA,EAAE,OAAO,CAChD,GAAIA,EAAAA,EAAE,OAAA,CACR,CAAC,EA8B2CA,EAAAA,EA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,EAAAA,EAAE,OAAA,EACb,UAAWA,EAAAA,EAAE,OAAA,CACf,CAAC,ECEYgB,EAAyBhB,EAAAA,EAAE,OAAO,CAC7C,GAAIA,EAAAA,EAAE,OAAA,EACN,YAAaA,EAAAA,EAAE,OAAA,EACf,YAAaA,EAAAA,EAAE,OAAA,EAAS,SAAA,EACxB,SAAUA,EAAAA,EAAE,OAAA,EACZ,QAASA,EAAAA,EAAE,OAAA,EACX,UAAWA,EAAAA,EAAE,OAAA,EACb,UAAWA,EAAAA,EAAE,OAAA,CACf,CAAC,EAMYiB,EAAuBjB,EAAAA,EAAE,OAAO,CAC3C,GAAIA,EAAAA,EAAE,OAAA,EACN,QAASA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA,EAC/B,MAAOA,EAAAA,EAAE,OAAA,EACT,aAAcA,EAAAA,EAAE,OAAA,EAChB,SAAUA,EAAAA,EAAE,OAAA,EACZ,UAAWA,EAAAA,EAAE,QAAA,EACb,UAAWA,EAAAA,EAAE,OAAA,EACb,UAAWA,EAAAA,EAAE,OAAA,CACf,CAAC,EC3BYkB,EAAqBlB,EAAAA,EAAE,OAAO,CACzC,MAAOA,EAAAA,EAAE,OAAA,CACX,CAAC,ECnBYmB,EAAgC,CAC3C,QAAS,GACT,OAAQ,GACR,SAAU,GACV,SAAU,GACV,MAAO,GACP,UAAW,GACX,WAAY,GACZ,YAAa,GACf,EAMaC,EAAgC,OAAO,YAClD,OAAO,QAAQD,CAA6B,EAAE,IAAI,CAAC,CAACE,EAAMC,CAAQ,IAAM,CACtEA,EACAD,CAAA,CACD,CACH"}
@@ -25,16 +25,6 @@ export declare class ChatroomRepository extends BaseCrudRepository<Chatroom> {
25
25
  companionId: z.ZodString;
26
26
  name: z.ZodString;
27
27
  language: z.ZodString;
28
- lastMessage: z.ZodNullable<z.ZodObject<{
29
- content: z.ZodString;
30
- createdAt: z.ZodString;
31
- }, "strip", z.ZodTypeAny, {
32
- createdAt: string;
33
- content: string;
34
- }, {
35
- createdAt: string;
36
- content: string;
37
- }>>;
38
28
  createdAt: z.ZodString;
39
29
  updatedAt: z.ZodString;
40
30
  }, "strip", z.ZodTypeAny, {
@@ -44,10 +34,6 @@ export declare class ChatroomRepository extends BaseCrudRepository<Chatroom> {
44
34
  updatedAt: string;
45
35
  companionId: string;
46
36
  language: string;
47
- lastMessage: {
48
- createdAt: string;
49
- content: string;
50
- } | null;
51
37
  }, {
52
38
  id: string;
53
39
  name: string;
@@ -55,10 +41,6 @@ export declare class ChatroomRepository extends BaseCrudRepository<Chatroom> {
55
41
  updatedAt: string;
56
42
  companionId: string;
57
43
  language: string;
58
- lastMessage: {
59
- createdAt: string;
60
- content: string;
61
- } | null;
62
44
  }>;
63
45
  /**
64
46
  * Get messages from a chatroom
@@ -1 +1 @@
1
- {"version":3,"file":"ChatroomRepository.d.ts","sourceRoot":"","sources":["../../src/repositories/ChatroomRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAgBpB,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC3C;AAUD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,kBAAkB,CAAC,QAAQ,CAAC;IAClE,QAAQ,CAAC,QAAQ,eAAe;IAEhC,SAAS,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIvB;;;OAGG;IACG,WAAW,CACf,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAC7C,YAAY,CAAC,EAAE,WAAW,GACzB,OAAO,CAAC,OAAO,EAAE,CAAC;IAkBrB;;;;;;;;;OASG;IACG,WAAW,CACf,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,WAAW,GACzB,OAAO,CAAC,OAAO,CAAC;IAenB;;;OAGG;IACG,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,WAAW,GACzB,OAAO,CAAC,gBAAgB,CAAC;IAc5B;;;;;;OAMG;IACG,uBAAuB,CAC3B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,WAAW,GACzB,OAAO,CAAC,gBAAgB,CAAC;IAc5B;;;OAGG;IACG,cAAc,CAAC,YAAY,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAO5E"}
1
+ {"version":3,"file":"ChatroomRepository.d.ts","sourceRoot":"","sources":["../../src/repositories/ChatroomRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAgBpB,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAC3C;AAUD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,kBAAkB,CAAC,QAAQ,CAAC;IAClE,QAAQ,CAAC,QAAQ,eAAe;IAEhC,SAAS,CAAC,aAAa;;;;;;;;;;;;;;;;;;;;;;IAIvB;;;OAGG;IACG,WAAW,CACf,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAC7C,YAAY,CAAC,EAAE,WAAW,GACzB,OAAO,CAAC,OAAO,EAAE,CAAC;IAkBrB;;;;;;;;;OASG;IACG,WAAW,CACf,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,WAAW,GACzB,OAAO,CAAC,OAAO,CAAC;IAenB;;;OAGG;IACG,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,WAAW,GACzB,OAAO,CAAC,gBAAgB,CAAC;IAc5B;;;;;;OAMG;IACG,uBAAuB,CAC3B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,WAAW,GACzB,OAAO,CAAC,gBAAgB,CAAC;IAc5B;;;OAGG;IACG,cAAc,CAAC,YAAY,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAO5E"}
@@ -5,16 +5,6 @@ export declare const chatroomSchema: z.ZodObject<{
5
5
  companionId: z.ZodString;
6
6
  name: z.ZodString;
7
7
  language: z.ZodString;
8
- lastMessage: z.ZodNullable<z.ZodObject<{
9
- content: z.ZodString;
10
- createdAt: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- createdAt: string;
13
- content: string;
14
- }, {
15
- createdAt: string;
16
- content: string;
17
- }>>;
18
8
  createdAt: z.ZodString;
19
9
  updatedAt: z.ZodString;
20
10
  }, "strip", z.ZodTypeAny, {
@@ -24,10 +14,6 @@ export declare const chatroomSchema: z.ZodObject<{
24
14
  updatedAt: string;
25
15
  companionId: string;
26
16
  language: string;
27
- lastMessage: {
28
- createdAt: string;
29
- content: string;
30
- } | null;
31
17
  }, {
32
18
  id: string;
33
19
  name: string;
@@ -35,20 +21,12 @@ export declare const chatroomSchema: z.ZodObject<{
35
21
  updatedAt: string;
36
22
  companionId: string;
37
23
  language: string;
38
- lastMessage: {
39
- createdAt: string;
40
- content: string;
41
- } | null;
42
24
  }>;
43
25
  export interface Chatroom extends BaseRecord {
44
26
  id: string;
45
27
  companionId: string;
46
28
  name: string;
47
29
  language: string;
48
- lastMessage: {
49
- content: string;
50
- createdAt: string;
51
- } | null;
52
30
  createdAt: string;
53
31
  updatedAt: string;
54
32
  }
@@ -76,15 +54,15 @@ export declare const messageSchema: z.ZodObject<{
76
54
  }, "strip", z.ZodTypeAny, {
77
55
  id: string;
78
56
  createdAt: string;
79
- content: string;
80
57
  senderType: SenderType;
58
+ content: string;
81
59
  companionId?: string | undefined;
82
60
  anonymousId?: string | undefined;
83
61
  }, {
84
62
  id: string;
85
63
  createdAt: string;
86
- content: string;
87
64
  senderType: SenderType;
65
+ content: string;
88
66
  companionId?: string | undefined;
89
67
  anonymousId?: string | undefined;
90
68
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"chatroom.d.ts","sourceRoot":"","sources":["../../src/schemas/chatroom.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAazB,CAAC;AAEH,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,E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AAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAOzB,CAAC;AAEH,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,SAAS,cAAc;CACxB;AAED,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;EAOxB,CAAC;AAEH,MAAM,WAAW,OAAQ,SAAQ,UAAU;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,GAAI,SAAS,OAAO,KAAG,OAEzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,OAAO,KAAG,OAE9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aidol",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "React components for AIdol - Create and chat with your own AI idol group",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -1,2 +0,0 @@
1
- "use strict";const n=require("zod"),s=n.z.enum(["DRAFT","PUBLISHED"]),r=n.z.object({id:n.z.string(),name:n.z.string().nullable(),email:n.z.string().nullable().optional(),greeting:n.z.string().nullable().optional(),concept:n.z.string().nullable().optional(),profileImageUrl:n.z.string().nullable(),status:s,createdAt:n.z.string(),updatedAt:n.z.string()}),l=n.z.object({id:n.z.string()});n.z.object({prompt:n.z.string().max(200)});const c=n.z.object({imageUrl:n.z.string(),width:n.z.number(),height:n.z.number(),format:n.z.string()}),z=n.z.object({data:c}),m=n.z.object({id:n.z.string(),companionId:n.z.string(),name:n.z.string(),language:n.z.string(),lastMessage:n.z.object({content:n.z.string(),createdAt:n.z.string()}).nullable(),createdAt:n.z.string(),updatedAt:n.z.string()});var e=(t=>(t.USER="USER",t.COMPANION="COMPANION",t))(e||{}),a=(t=>(t.SENDING="SENDING",t.SENT="SENT",t.ERROR="ERROR",t))(a||{});const g=n.z.object({id:n.z.string(),senderType:n.z.nativeEnum(e),content:n.z.string(),createdAt:n.z.string(),companionId:n.z.string().optional(),anonymousId:n.z.string().optional()}),d=t=>t.senderType==="USER",p=t=>t.senderType==="COMPANION",u=["MAIN_VOCAL","SUB_VOCAL","MAIN_DANCER","SUB_DANCER","MAIN_RAPPER","SUB_RAPPER"],b=n.z.object({vocal:n.z.number(),dance:n.z.number(),rap:n.z.number(),visual:n.z.number(),stamina:n.z.number(),charm:n.z.number()}),A=n.z.object({id:n.z.string(),aidolId:n.z.string().nullable().optional(),name:n.z.string().nullable().optional(),biography:n.z.string().nullable().optional(),profilePictureUrl:n.z.string().nullable().optional(),grade:n.z.enum(["A","B","C","F"]).nullable().optional(),position:n.z.enum(["MAIN_VOCAL","SUB_VOCAL","MAIN_DANCER","SUB_DANCER","MAIN_RAPPER","SUB_RAPPER"]).nullable().optional(),mbti:n.z.string().nullable().optional(),gender:n.z.enum(["MALE","FEMALE"]).nullable().optional(),status:n.z.enum(["DRAFT","PUBLISHED"]),stats:b.optional(),createdAt:n.z.string(),updatedAt:n.z.string()}),S=n.z.object({id:n.z.string(),fromCompanionId:n.z.string().nullable().optional(),toCompanionId:n.z.string().nullable().optional(),intimacy:n.z.number().nullable().optional(),nickname:n.z.string().nullable().optional(),createdAt:n.z.string(),updatedAt:n.z.string()}),h=n.z.object({id:n.z.string(),highlightId:n.z.string(),companionId:n.z.string().nullable(),sequence:n.z.number(),content:n.z.string(),createdAt:n.z.string(),updatedAt:n.z.string()}),I=n.z.object({id:n.z.string(),aidolId:n.z.string().nullable().optional(),title:n.z.string(),thumbnailUrl:n.z.string(),subtitle:n.z.string(),isPremium:n.z.boolean(),createdAt:n.z.string(),updatedAt:n.z.string()}),R=n.z.object({email:n.z.string()}),i={awkward:15,polite:30,friendly:45,tikitaka:60,trust:70,emotional:80,bestFriend:90,inseparable:100},E=Object.fromEntries(Object.entries(i).map(([t,o])=>[o,t]));exports.INTIMACY_TO_RELATIONSHIP_TYPE=E;exports.MessageStatus=a;exports.POSITIONS=u;exports.RELATIONSHIP_TYPE_TO_INTIMACY=i;exports.SenderType=e;exports.aidolCreateResponseSchema=l;exports.aidolHighlightSchema=I;exports.aidolSchema=r;exports.chatroomSchema=m;exports.companionRelationshipSchema=S;exports.companionSchema=A;exports.highlightMessageSchema=h;exports.imageGenerationResponseSchema=z;exports.isCompanion=p;exports.isUser=d;exports.leadResponseSchema=R;exports.messageSchema=g;
2
- //# sourceMappingURL=relationship-B3AClL0U.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"relationship-B3AClL0U.js","sources":["../src/schemas/aidol.ts","../src/schemas/chatroom.ts","../src/schemas/companion.ts","../src/schemas/companion-relationship.ts","../src/schemas/highlight.ts","../src/schemas/lead.ts","../src/constants/relationship.ts"],"sourcesContent":["/**\n * AIdol (group) schemas\n * Matches backend aidol/schemas/aidol.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nimport type { Companion } from \"./companion\";\n\n/**\n * AIdol schema (public fields only, excludes anonymous_id)\n * Matches backend AIdolPublic (aidol/schemas/aidol.py)\n */\nexport const aidolStatusSchema = z.enum([\"DRAFT\", \"PUBLISHED\"]);\nexport type AIdolStatus = z.infer<typeof aidolStatusSchema>;\n\nexport const aidolSchema = z.object({\n id: z.string(),\n name: z.string().nullable(),\n email: z.string().nullable().optional(),\n greeting: z.string().nullable().optional(),\n concept: z.string().nullable().optional(),\n profileImageUrl: z.string().nullable(),\n status: aidolStatusSchema,\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdol extends BaseRecord {\n id: string;\n name: string | null;\n email?: string | null;\n greeting?: string | null;\n concept?: string | null;\n profileImageUrl: string | null;\n status: AIdolStatus;\n createdAt: string;\n updatedAt: string;\n companions?: Companion[];\n}\n\n/**\n * Schema for AIdol creation response (backend returns only id)\n */\nexport const aidolCreateResponseSchema = z.object({\n id: z.string(),\n});\n\nexport type AIdolCreateResponse = z.infer<typeof aidolCreateResponseSchema>;\n\n/**\n * Schema for creating an AIdol group\n */\nexport interface AIdolCreate {\n name: string;\n concept?: string | null;\n profileImageUrl: string;\n}\n\n/**\n * Schema for updating an AIdol group\n */\nexport interface AIdolUpdate {\n name?: string;\n concept?: string | null;\n profileImageUrl?: string | null;\n status?: AIdolStatus;\n}\n\n// ---------------------------------------------------------------------------\n// Image Generation\n// ---------------------------------------------------------------------------\n\n/**\n * Request schema for image generation\n */\nexport const imageGenerationRequestSchema = z.object({\n prompt: z.string().max(200),\n});\n\nexport type ImageGenerationRequest = z.infer<\n typeof imageGenerationRequestSchema\n>;\n\n/**\n * Image generation result data\n */\nexport const imageGenerationDataSchema = z.object({\n imageUrl: z.string(),\n width: z.number(),\n height: z.number(),\n format: z.string(),\n});\n\nexport type ImageGenerationData = z.infer<typeof imageGenerationDataSchema>;\n\n/**\n * Response schema for image generation\n */\nexport const imageGenerationResponseSchema = z.object({\n data: imageGenerationDataSchema,\n});\n\nexport type ImageGenerationResponse = z.infer<\n typeof imageGenerationResponseSchema\n>;\n","/**\n * Chatroom schemas\n * Matches backend aidol/schemas/chatroom.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n// =============================================================================\n// Chatroom Schemas\n// =============================================================================\n\nexport const chatroomSchema = z.object({\n id: z.string(),\n companionId: z.string(),\n name: z.string(),\n language: z.string(),\n lastMessage: z\n .object({\n content: z.string(),\n createdAt: z.string(),\n })\n .nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface Chatroom extends BaseRecord {\n id: string;\n companionId: string;\n name: string;\n language: string;\n lastMessage: {\n content: string;\n createdAt: string;\n } | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ChatroomCreate {\n companionId: string;\n name: string;\n language?: string;\n}\n\n// =============================================================================\n// Message Schemas\n// =============================================================================\n\nexport enum SenderType {\n USER = \"USER\",\n COMPANION = \"COMPANION\",\n}\n\nexport enum MessageStatus {\n SENDING = \"SENDING\",\n SENT = \"SENT\",\n ERROR = \"ERROR\",\n}\n\nexport const messageSchema = z.object({\n id: z.string(),\n senderType: z.nativeEnum(SenderType),\n content: z.string(),\n createdAt: z.string(),\n companionId: z.string().optional(),\n anonymousId: z.string().optional(),\n});\n\nexport interface Message extends BaseRecord {\n id: string;\n senderType: SenderType;\n content: string;\n createdAt: string;\n companionId?: string;\n anonymousId?: string;\n status?: MessageStatus;\n}\n\n/**\n * Type guard to check if message is from user\n */\nexport const isUser = (message: Message): boolean => {\n return message.senderType === SenderType.USER;\n};\n\n/**\n * Type guard to check if message is from companion\n */\nexport const isCompanion = (message: Message): boolean => {\n return message.senderType === SenderType.COMPANION;\n};\n","/**\n * Companion (member) schemas\n * Matches backend aidol/schemas/companion.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nexport const POSITIONS = [\n \"MAIN_VOCAL\",\n \"SUB_VOCAL\",\n \"MAIN_DANCER\",\n \"SUB_DANCER\",\n \"MAIN_RAPPER\",\n \"SUB_RAPPER\",\n] as const;\n\nexport type Position = (typeof POSITIONS)[number];\n\nexport type Gender = \"MALE\" | \"FEMALE\";\n\nexport type Grade = \"A\" | \"B\" | \"C\" | \"F\";\n\nexport type Status = \"DRAFT\" | \"PUBLISHED\";\n\nexport interface CompanionStats {\n vocal: number;\n dance: number;\n rap: number;\n visual: number;\n stamina: number;\n charm: number;\n}\n\nconst companionStatsSchema = z.object({\n vocal: z.number(),\n dance: z.number(),\n rap: z.number(),\n visual: z.number(),\n stamina: z.number(),\n charm: z.number(),\n});\n\n/**\n * Companion schema (public fields only, excludes system_prompt)\n */\nexport const companionSchema = z.object({\n id: z.string(),\n aidolId: z.string().nullable().optional(),\n name: z.string().nullable().optional(),\n biography: z.string().nullable().optional(),\n profilePictureUrl: z.string().nullable().optional(),\n grade: z.enum([\"A\", \"B\", \"C\", \"F\"]).nullable().optional(),\n position: z\n .enum([\n \"MAIN_VOCAL\",\n \"SUB_VOCAL\",\n \"MAIN_DANCER\",\n \"SUB_DANCER\",\n \"MAIN_RAPPER\",\n \"SUB_RAPPER\",\n ])\n .nullable()\n .optional(),\n mbti: z.string().nullable().optional(),\n gender: z.enum([\"MALE\", \"FEMALE\"]).nullable().optional(),\n status: z.enum([\"DRAFT\", \"PUBLISHED\"]),\n stats: companionStatsSchema.optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface Companion extends BaseRecord {\n id: string;\n aidolId?: string | null;\n name?: string | null;\n biography?: string | null;\n profilePictureUrl?: string | null;\n grade?: Grade | null;\n position?: Position | null;\n mbti?: string | null;\n gender?: Gender | null;\n status: Status;\n stats?: CompanionStats;\n createdAt: string;\n updatedAt: string;\n}\n\n/**\n * Schema for creating a Companion\n * Includes systemPrompt for creation (excluded from response)\n */\nexport interface CompanionCreate {\n aidolId?: string | null;\n name: string;\n biography?: string | null;\n profilePictureUrl?: string | null;\n systemPrompt?: string | null;\n}\n\n/**\n * Schema for updating a Companion\n */\nexport interface CompanionUpdate {\n aidolId?: string | null;\n name?: string;\n biography?: string | null;\n profilePictureUrl?: string | null;\n systemPrompt?: string | null;\n position?: Position | null;\n gender?: Gender | null;\n status?: Status;\n mbtiEnergy?: number;\n mbtiPerception?: number;\n mbtiJudgment?: number;\n mbtiLifestyle?: number;\n}\n","/**\n * Companion Relationship schemas\n * Matches backend aidol/schemas/companion_relationship.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n/**\n * CompanionRelationship schema\n * Matches backend CompanionRelationship (aidol/schemas/companion_relationship.py)\n */\nexport const companionRelationshipSchema = z.object({\n id: z.string(),\n fromCompanionId: z.string().nullable().optional(),\n toCompanionId: z.string().nullable().optional(),\n intimacy: z.number().nullable().optional(),\n nickname: z.string().nullable().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface CompanionRelationship extends BaseRecord {\n id: string;\n fromCompanionId?: string | null;\n toCompanionId?: string | null;\n intimacy?: number | null;\n nickname?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CompanionRelationshipCreate {\n fromCompanionId: string;\n toCompanionId: string;\n intimacy?: number;\n nickname?: string;\n}\n","/**\n * AIdol Highlight schemas\n * Matches backend aidol/schemas/highlight.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// HighlightMessage\n// ---------------------------------------------------------------------------\n\nexport interface HighlightMessage {\n id: string;\n highlightId: string;\n companionId: string | null;\n sequence: number;\n content: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport const highlightMessageSchema = z.object({\n id: z.string(),\n highlightId: z.string(),\n companionId: z.string().nullable(),\n sequence: z.number(),\n content: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n}) satisfies z.ZodType<HighlightMessage>;\n\n// ---------------------------------------------------------------------------\n// AIdolHighlight\n// ---------------------------------------------------------------------------\n\nexport const aidolHighlightSchema = z.object({\n id: z.string(),\n aidolId: z.string().nullable().optional(),\n title: z.string(),\n thumbnailUrl: z.string(),\n subtitle: z.string(),\n isPremium: z.boolean(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdolHighlight extends BaseRecord {\n id: string;\n aidolId?: string | null;\n title: string;\n thumbnailUrl: string;\n subtitle: string;\n isPremium: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\n// 내그룹의 하이라이트 섹션 표현이 달라서 따로 정의\nexport interface MyGroupHighlightSection {\n title: string;\n subtitle: string;\n items: AIdolHighlight[];\n}\n","/**\n * Lead schemas\n * Matches backend aidol/schemas/aidol_lead.py definitions\n */\n\nimport { z } from \"zod\";\n\n/**\n * Lead request schema\n */\nexport interface LeadRequest {\n aidolId: string;\n email: string;\n}\n\n/**\n * Lead response schema\n */\nexport const leadResponseSchema = z.object({\n email: z.string(),\n});\n\nexport type LeadResponse = z.infer<typeof leadResponseSchema>;\n","/** 관계 유형 → 친밀도 매핑 */\nexport const RELATIONSHIP_TYPE_TO_INTIMACY = {\n awkward: 15,\n polite: 30,\n friendly: 45,\n tikitaka: 60,\n trust: 70,\n emotional: 80,\n bestFriend: 90,\n inseparable: 100,\n} as const;\n\n/** 관계 유형 타입 (위 객체에서 자동 추론) */\nexport type RelationshipType = keyof typeof RELATIONSHIP_TYPE_TO_INTIMACY;\n\n/** 친밀도 → 관계 유형 매핑 (위 객체에서 파생) */\nexport const INTIMACY_TO_RELATIONSHIP_TYPE = Object.fromEntries(\n Object.entries(RELATIONSHIP_TYPE_TO_INTIMACY).map(([type, intimacy]) => [\n intimacy,\n type,\n ]),\n) as Record<number, RelationshipType>;\n"],"names":["aidolStatusSchema","z","aidolSchema","aidolCreateResponseSchema","imageGenerationDataSchema","imageGenerationResponseSchema","chatroomSchema","SenderType","MessageStatus","messageSchema","isUser","message","isCompanion","POSITIONS","companionStatsSchema","companionSchema","companionRelationshipSchema","highlightMessageSchema","aidolHighlightSchema","leadResponseSchema","RELATIONSHIP_TYPE_TO_INTIMACY","INTIMACY_TO_RELATIONSHIP_TYPE","type","intim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AAA,EAChB,SAAUA,EAAAA,EAAE,OAAA,EACZ,UAAWA,EAAAA,EAAE,QAAA,EACb,UAAWA,EAAAA,EAAE,OAAA,EACb,UAAWA,EAAAA,EAAE,OAAA,CACf,CAAC,EC3BYkB,EAAqBlB,EAAAA,EAAE,OAAO,CACzC,MAAOA,EAAAA,EAAE,OAAA,CACX,CAAC,ECnBYmB,EAAgC,CAC3C,QAAS,GACT,OAAQ,GACR,SAAU,GACV,SAAU,GACV,MAAO,GACP,UAAW,GACX,WAAY,GACZ,YAAa,GACf,EAMaC,EAAgC,OAAO,YAClD,OAAO,QAAQD,CAA6B,EAAE,IAAI,CAAC,CAACE,EAAMC,CAAQ,IAAM,CACtEA,EACAD,CAAA,CACD,CACH"}
@@ -1,141 +0,0 @@
1
- import { z as t } from "zod";
2
- const i = t.enum(["DRAFT", "PUBLISHED"]), g = t.object({
3
- id: t.string(),
4
- name: t.string().nullable(),
5
- email: t.string().nullable().optional(),
6
- greeting: t.string().nullable().optional(),
7
- concept: t.string().nullable().optional(),
8
- profileImageUrl: t.string().nullable(),
9
- status: i,
10
- createdAt: t.string(),
11
- updatedAt: t.string()
12
- }), m = t.object({
13
- id: t.string()
14
- });
15
- t.object({
16
- prompt: t.string().max(200)
17
- });
18
- const o = t.object({
19
- imageUrl: t.string(),
20
- width: t.number(),
21
- height: t.number(),
22
- format: t.string()
23
- }), u = t.object({
24
- data: o
25
- }), d = t.object({
26
- id: t.string(),
27
- companionId: t.string(),
28
- name: t.string(),
29
- language: t.string(),
30
- lastMessage: t.object({
31
- content: t.string(),
32
- createdAt: t.string()
33
- }).nullable(),
34
- createdAt: t.string(),
35
- updatedAt: t.string()
36
- });
37
- var e = /* @__PURE__ */ ((n) => (n.USER = "USER", n.COMPANION = "COMPANION", n))(e || {}), s = /* @__PURE__ */ ((n) => (n.SENDING = "SENDING", n.SENT = "SENT", n.ERROR = "ERROR", n))(s || {});
38
- const b = t.object({
39
- id: t.string(),
40
- senderType: t.nativeEnum(e),
41
- content: t.string(),
42
- createdAt: t.string(),
43
- companionId: t.string().optional(),
44
- anonymousId: t.string().optional()
45
- }), p = (n) => n.senderType === "USER", A = (n) => n.senderType === "COMPANION", I = [
46
- "MAIN_VOCAL",
47
- "SUB_VOCAL",
48
- "MAIN_DANCER",
49
- "SUB_DANCER",
50
- "MAIN_RAPPER",
51
- "SUB_RAPPER"
52
- ], r = t.object({
53
- vocal: t.number(),
54
- dance: t.number(),
55
- rap: t.number(),
56
- visual: t.number(),
57
- stamina: t.number(),
58
- charm: t.number()
59
- }), S = t.object({
60
- id: t.string(),
61
- aidolId: t.string().nullable().optional(),
62
- name: t.string().nullable().optional(),
63
- biography: t.string().nullable().optional(),
64
- profilePictureUrl: t.string().nullable().optional(),
65
- grade: t.enum(["A", "B", "C", "F"]).nullable().optional(),
66
- position: t.enum([
67
- "MAIN_VOCAL",
68
- "SUB_VOCAL",
69
- "MAIN_DANCER",
70
- "SUB_DANCER",
71
- "MAIN_RAPPER",
72
- "SUB_RAPPER"
73
- ]).nullable().optional(),
74
- mbti: t.string().nullable().optional(),
75
- gender: t.enum(["MALE", "FEMALE"]).nullable().optional(),
76
- status: t.enum(["DRAFT", "PUBLISHED"]),
77
- stats: r.optional(),
78
- createdAt: t.string(),
79
- updatedAt: t.string()
80
- }), h = t.object({
81
- id: t.string(),
82
- fromCompanionId: t.string().nullable().optional(),
83
- toCompanionId: t.string().nullable().optional(),
84
- intimacy: t.number().nullable().optional(),
85
- nickname: t.string().nullable().optional(),
86
- createdAt: t.string(),
87
- updatedAt: t.string()
88
- }), R = t.object({
89
- id: t.string(),
90
- highlightId: t.string(),
91
- companionId: t.string().nullable(),
92
- sequence: t.number(),
93
- content: t.string(),
94
- createdAt: t.string(),
95
- updatedAt: t.string()
96
- }), E = t.object({
97
- id: t.string(),
98
- aidolId: t.string().nullable().optional(),
99
- title: t.string(),
100
- thumbnailUrl: t.string(),
101
- subtitle: t.string(),
102
- isPremium: t.boolean(),
103
- createdAt: t.string(),
104
- updatedAt: t.string()
105
- }), N = t.object({
106
- email: t.string()
107
- }), l = {
108
- awkward: 15,
109
- polite: 30,
110
- friendly: 45,
111
- tikitaka: 60,
112
- trust: 70,
113
- emotional: 80,
114
- bestFriend: 90,
115
- inseparable: 100
116
- }, P = Object.fromEntries(
117
- Object.entries(l).map(([n, a]) => [
118
- a,
119
- n
120
- ])
121
- );
122
- export {
123
- P as I,
124
- s as M,
125
- I as P,
126
- l as R,
127
- e as S,
128
- g as a,
129
- m as b,
130
- d as c,
131
- h as d,
132
- S as e,
133
- E as f,
134
- A as g,
135
- R as h,
136
- u as i,
137
- p as j,
138
- N as l,
139
- b as m
140
- };
141
- //# sourceMappingURL=relationship-BP7mIOjL.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"relationship-BP7mIOjL.mjs","sources":["../src/schemas/aidol.ts","../src/schemas/chatroom.ts","../src/schemas/companion.ts","../src/schemas/companion-relationship.ts","../src/schemas/highlight.ts","../src/schemas/lead.ts","../src/constants/relationship.ts"],"sourcesContent":["/**\n * AIdol (group) schemas\n * Matches backend aidol/schemas/aidol.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nimport type { Companion } from \"./companion\";\n\n/**\n * AIdol schema (public fields only, excludes anonymous_id)\n * Matches backend AIdolPublic (aidol/schemas/aidol.py)\n */\nexport const aidolStatusSchema = z.enum([\"DRAFT\", \"PUBLISHED\"]);\nexport type AIdolStatus = z.infer<typeof aidolStatusSchema>;\n\nexport const aidolSchema = z.object({\n id: z.string(),\n name: z.string().nullable(),\n email: z.string().nullable().optional(),\n greeting: z.string().nullable().optional(),\n concept: z.string().nullable().optional(),\n profileImageUrl: z.string().nullable(),\n status: aidolStatusSchema,\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdol extends BaseRecord {\n id: string;\n name: string | null;\n email?: string | null;\n greeting?: string | null;\n concept?: string | null;\n profileImageUrl: string | null;\n status: AIdolStatus;\n createdAt: string;\n updatedAt: string;\n companions?: Companion[];\n}\n\n/**\n * Schema for AIdol creation response (backend returns only id)\n */\nexport const aidolCreateResponseSchema = z.object({\n id: z.string(),\n});\n\nexport type AIdolCreateResponse = z.infer<typeof aidolCreateResponseSchema>;\n\n/**\n * Schema for creating an AIdol group\n */\nexport interface AIdolCreate {\n name: string;\n concept?: string | null;\n profileImageUrl: string;\n}\n\n/**\n * Schema for updating an AIdol group\n */\nexport interface AIdolUpdate {\n name?: string;\n concept?: string | null;\n profileImageUrl?: string | null;\n status?: AIdolStatus;\n}\n\n// ---------------------------------------------------------------------------\n// Image Generation\n// ---------------------------------------------------------------------------\n\n/**\n * Request schema for image generation\n */\nexport const imageGenerationRequestSchema = z.object({\n prompt: z.string().max(200),\n});\n\nexport type ImageGenerationRequest = z.infer<\n typeof imageGenerationRequestSchema\n>;\n\n/**\n * Image generation result data\n */\nexport const imageGenerationDataSchema = z.object({\n imageUrl: z.string(),\n width: z.number(),\n height: z.number(),\n format: z.string(),\n});\n\nexport type ImageGenerationData = z.infer<typeof imageGenerationDataSchema>;\n\n/**\n * Response schema for image generation\n */\nexport const imageGenerationResponseSchema = z.object({\n data: imageGenerationDataSchema,\n});\n\nexport type ImageGenerationResponse = z.infer<\n typeof imageGenerationResponseSchema\n>;\n","/**\n * Chatroom schemas\n * Matches backend aidol/schemas/chatroom.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n// =============================================================================\n// Chatroom Schemas\n// =============================================================================\n\nexport const chatroomSchema = z.object({\n id: z.string(),\n companionId: z.string(),\n name: z.string(),\n language: z.string(),\n lastMessage: z\n .object({\n content: z.string(),\n createdAt: z.string(),\n })\n .nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface Chatroom extends BaseRecord {\n id: string;\n companionId: string;\n name: string;\n language: string;\n lastMessage: {\n content: string;\n createdAt: string;\n } | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ChatroomCreate {\n companionId: string;\n name: string;\n language?: string;\n}\n\n// =============================================================================\n// Message Schemas\n// =============================================================================\n\nexport enum SenderType {\n USER = \"USER\",\n COMPANION = \"COMPANION\",\n}\n\nexport enum MessageStatus {\n SENDING = \"SENDING\",\n SENT = \"SENT\",\n ERROR = \"ERROR\",\n}\n\nexport const messageSchema = z.object({\n id: z.string(),\n senderType: z.nativeEnum(SenderType),\n content: z.string(),\n createdAt: z.string(),\n companionId: z.string().optional(),\n anonymousId: z.string().optional(),\n});\n\nexport interface Message extends BaseRecord {\n id: string;\n senderType: SenderType;\n content: string;\n createdAt: string;\n companionId?: string;\n anonymousId?: string;\n status?: MessageStatus;\n}\n\n/**\n * Type guard to check if message is from user\n */\nexport const isUser = (message: Message): boolean => {\n return message.senderType === SenderType.USER;\n};\n\n/**\n * Type guard to check if message is from companion\n */\nexport const isCompanion = (message: Message): boolean => {\n return message.senderType === SenderType.COMPANION;\n};\n","/**\n * Companion (member) schemas\n * Matches backend aidol/schemas/companion.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nexport const POSITIONS = [\n \"MAIN_VOCAL\",\n \"SUB_VOCAL\",\n \"MAIN_DANCER\",\n \"SUB_DANCER\",\n \"MAIN_RAPPER\",\n \"SUB_RAPPER\",\n] as const;\n\nexport type Position = (typeof POSITIONS)[number];\n\nexport type Gender = \"MALE\" | \"FEMALE\";\n\nexport type Grade = \"A\" | \"B\" | \"C\" | \"F\";\n\nexport type Status = \"DRAFT\" | \"PUBLISHED\";\n\nexport interface CompanionStats {\n vocal: number;\n dance: number;\n rap: number;\n visual: number;\n stamina: number;\n charm: number;\n}\n\nconst companionStatsSchema = z.object({\n vocal: z.number(),\n dance: z.number(),\n rap: z.number(),\n visual: z.number(),\n stamina: z.number(),\n charm: z.number(),\n});\n\n/**\n * Companion schema (public fields only, excludes system_prompt)\n */\nexport const companionSchema = z.object({\n id: z.string(),\n aidolId: z.string().nullable().optional(),\n name: z.string().nullable().optional(),\n biography: z.string().nullable().optional(),\n profilePictureUrl: z.string().nullable().optional(),\n grade: z.enum([\"A\", \"B\", \"C\", \"F\"]).nullable().optional(),\n position: z\n .enum([\n \"MAIN_VOCAL\",\n \"SUB_VOCAL\",\n \"MAIN_DANCER\",\n \"SUB_DANCER\",\n \"MAIN_RAPPER\",\n \"SUB_RAPPER\",\n ])\n .nullable()\n .optional(),\n mbti: z.string().nullable().optional(),\n gender: z.enum([\"MALE\", \"FEMALE\"]).nullable().optional(),\n status: z.enum([\"DRAFT\", \"PUBLISHED\"]),\n stats: companionStatsSchema.optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface Companion extends BaseRecord {\n id: string;\n aidolId?: string | null;\n name?: string | null;\n biography?: string | null;\n profilePictureUrl?: string | null;\n grade?: Grade | null;\n position?: Position | null;\n mbti?: string | null;\n gender?: Gender | null;\n status: Status;\n stats?: CompanionStats;\n createdAt: string;\n updatedAt: string;\n}\n\n/**\n * Schema for creating a Companion\n * Includes systemPrompt for creation (excluded from response)\n */\nexport interface CompanionCreate {\n aidolId?: string | null;\n name: string;\n biography?: string | null;\n profilePictureUrl?: string | null;\n systemPrompt?: string | null;\n}\n\n/**\n * Schema for updating a Companion\n */\nexport interface CompanionUpdate {\n aidolId?: string | null;\n name?: string;\n biography?: string | null;\n profilePictureUrl?: string | null;\n systemPrompt?: string | null;\n position?: Position | null;\n gender?: Gender | null;\n status?: Status;\n mbtiEnergy?: number;\n mbtiPerception?: number;\n mbtiJudgment?: number;\n mbtiLifestyle?: number;\n}\n","/**\n * Companion Relationship schemas\n * Matches backend aidol/schemas/companion_relationship.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n/**\n * CompanionRelationship schema\n * Matches backend CompanionRelationship (aidol/schemas/companion_relationship.py)\n */\nexport const companionRelationshipSchema = z.object({\n id: z.string(),\n fromCompanionId: z.string().nullable().optional(),\n toCompanionId: z.string().nullable().optional(),\n intimacy: z.number().nullable().optional(),\n nickname: z.string().nullable().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface CompanionRelationship extends BaseRecord {\n id: string;\n fromCompanionId?: string | null;\n toCompanionId?: string | null;\n intimacy?: number | null;\n nickname?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CompanionRelationshipCreate {\n fromCompanionId: string;\n toCompanionId: string;\n intimacy?: number;\n nickname?: string;\n}\n","/**\n * AIdol Highlight schemas\n * Matches backend aidol/schemas/highlight.py definitions\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// HighlightMessage\n// ---------------------------------------------------------------------------\n\nexport interface HighlightMessage {\n id: string;\n highlightId: string;\n companionId: string | null;\n sequence: number;\n content: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport const highlightMessageSchema = z.object({\n id: z.string(),\n highlightId: z.string(),\n companionId: z.string().nullable(),\n sequence: z.number(),\n content: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n}) satisfies z.ZodType<HighlightMessage>;\n\n// ---------------------------------------------------------------------------\n// AIdolHighlight\n// ---------------------------------------------------------------------------\n\nexport const aidolHighlightSchema = z.object({\n id: z.string(),\n aidolId: z.string().nullable().optional(),\n title: z.string(),\n thumbnailUrl: z.string(),\n subtitle: z.string(),\n isPremium: z.boolean(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdolHighlight extends BaseRecord {\n id: string;\n aidolId?: string | null;\n title: string;\n thumbnailUrl: string;\n subtitle: string;\n isPremium: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\n// 내그룹의 하이라이트 섹션 표현이 달라서 따로 정의\nexport interface MyGroupHighlightSection {\n title: string;\n subtitle: string;\n items: AIdolHighlight[];\n}\n","/**\n * Lead schemas\n * Matches backend aidol/schemas/aidol_lead.py definitions\n */\n\nimport { z } from \"zod\";\n\n/**\n * Lead request schema\n */\nexport interface LeadRequest {\n aidolId: string;\n email: string;\n}\n\n/**\n * Lead response schema\n */\nexport const leadResponseSchema = z.object({\n email: z.string(),\n});\n\nexport type LeadResponse = z.infer<typeof leadResponseSchema>;\n","/** 관계 유형 → 친밀도 매핑 */\nexport const RELATIONSHIP_TYPE_TO_INTIMACY = {\n awkward: 15,\n polite: 30,\n friendly: 45,\n tikitaka: 60,\n trust: 70,\n emotional: 80,\n bestFriend: 90,\n inseparable: 100,\n} as const;\n\n/** 관계 유형 타입 (위 객체에서 자동 추론) */\nexport type RelationshipType = keyof typeof RELATIONSHIP_TYPE_TO_INTIMACY;\n\n/** 친밀도 → 관계 유형 매핑 (위 객체에서 파생) */\nexport const INTIMACY_TO_RELATIONSHIP_TYPE = Object.fromEntries(\n Object.entries(RELATIONSHIP_TYPE_TO_INTIMACY).map(([type, intimacy]) => [\n intimacy,\n type,\n ]),\n) as Record<number, RelationshipType>;\n"],"names":["aidolStatusSchema","z","aidolSchema","aidolCreateResponseSchema","imageGenerationDataSchema","imageGenerationResponseSchema","chatroomSchema","SenderType","MessageStatus","messageSchema","isUser","message","isCompanion","POSITIONS","companionStatsSchema","companionSchema","companionRelationshipSchema","highlightMessageSchema","aidolHighlightSchema","leadResponseSchema","RELATIONSHIP_TYPE_TO_INTIMACY","INTIMACY_TO_RELATIONSHIP_TYPE","type","intimacy"],"mappings":";AAcO,MAAMA,IAAoBC,EAAE,KAAK,CAAC,SAAS,WAAW,CAAC,GAGjDC,IAAcD,EAAE,OAAO;AAAA,EAClC,IAAIA,EAAE,OAAA;AAAA,EACN,MAAMA,EAAE,OAAA,EAAS,SAAA;AAAA,EACjB,OAAOA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC7B,UAAUA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAChC,SAASA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC/B,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC5B,QAAQD;AAAA,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