1import{a as r,j as e}from"./vendor-react-CXj4JBvb.js";import{n as ps,d as hs,l as f,B as v,K as Je,N as Oe,O as Ve,Q as Ye,aA as Ke,I as re,C as Pe,e as Ae,H as fs,k as b,F as X,a1 as W,aE as le,y as gs,M as He,f as js,at as k,G as ce,_ as Ns,X as bs,ar as ys,bp as ie,S as ws,b7 as vs,V as ks}from"./index-BkOR2_0T.js";import{T as Me}from"./textarea-HSnv1SXu.js";import{S as V,a as Y,b as K,c as H,d as h}from"./select-D1sIFkHZ.js";import{P as Ss,i as Cs}from"./chatSendKey-BhNCLL5Y.js";import{P as Ts}from"./plus-CxcOt1dA.js";import{T as $}from"./tag-DFxj5Kq7.js";import{C as Es}from"./circle-check-big-BvXGxHoH.js";import{P as Ls}from"./phone-CrCKPg34.js";import{M as q}from"./map-pin-D5pQqo3_.js";import{F as S}from"./file-text-DrfbOuv6.js";import{F as Ds}from"./flag-BdqkhI0l.js";import{L as Xe}from"./languages-Ba7a-bdx.js";import{I as Rs,Y as Fs,T as Is}from"./youtube-dx4VXqph.js";import{C as Ue}from"./coins-1yoVsCuf.js";import{C as $s}from"./calendar-myAM3v8s.js";import"./vendor-radix-Dx4wDGbI.js";import"./i18n-ja-DnFpCw-h.js";import"./vendor-motion-BZzGwvlf.js";import"./chevron-up-CghiCZdK.js";const Ps=[["path",{d:"M18 11c-1.5 0-2.5.5-3 2",key:"1fod00"}],["path",{d:"M4 6a2 2 0 0 0-2 2v4a5 5 0 0 0 5 5 8 8 0 0 1 5 2 8 8 0 0 1 5-2 5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3a8 8 0 0 0-5 2 8 8 0 0 0-5-2z",key:"d70hit"}],["path",{d:"M6 11c1.5 0 2.5.5 3 2",key:"136fht"}]],As=ps("venetian-mask",Ps),_e=["all","æªå¯¾å¿","対å¿ä¸","å®äº"],ze=["Saito","Goto","Ichikawa","Akimoto","Kushihashi"],Ms=/(https?:\/\/[^\s]+)/g;function Us(t){return t.split(Ms).map((i,x)=>/^https?:\/\//.test(i)?e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"underline break-all hover:opacity-80",children:i},x):i)}const Be={account:"ã¢ã«ã¦ã³ãã»ãã°ã¤ã³",project:"æ¡ä»¶ã«ã¤ãã¦",payment:"å ±é
¬ã»æ¯æã",withdrawal:"åºéã«ã¤ãã¦",applicant:"å¿åã»ãããã³ã°",invoice:"è«æ±ã»ãæ¯æã",post:"æç¨¿ã»ã¬ãã¼ã",bug:"ä¸å
·åã»ã¨ã©ã¼",howto:"ä½¿ãæ¹",other:"ãã®ä»"},_s=["account","project","payment","withdrawal","bug","howto","other"],zs=["account","project","applicant","invoice","post","bug","howto","other"],Bs=[{key:"all",label:"ãã¹ã¦"},{key:"influencer",label:"IF"},{key:"company",label:"äºæ¥è
"}];function oe(t){return t==="company"}const de=Object.fromEntries(ws.map(t=>[t,vs(t)])),Gs={male:"ç·æ§",female:"女æ§",other:"ãã®ä»"},Js={ja:"æ¥æ¬èª",en:"è±èª",ko:"éå½èª",zh:"ä¸å½èª",th:"ã¿ã¤èª",id:"ã¤ã³ããã·ã¢èª"};function Ge(t){return t==="æªå¯¾å¿"?"bg-amber-100 text-amber-700":t==="対å¿ä¸"?"bg-blue-100 text-blue-700":"bg-emerald-100 text-emerald-700"}function Os(t){return t==null?"â":t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}function Vs(t){if(!t)return"";const m=new Date(t),i=Date.now()-m.getTime();return i<6e4?"ä»":i<36e5?`${Math.floor(i/6e4)}åå`:i<864e5?`${Math.floor(i/36e5)}æéå`:m.toLocaleDateString("ja-JP",{month:"short",day:"numeric"})}async function Ys(t){const{uploadURL:m,objectPath:i}=await f.post("/storage/uploads/request-url",{name:t.name,size:t.size,contentType:t.type}),x=await fetch(m,{method:"PUT",body:t,headers:{"Content-Type":t.type}});if(!x.ok)throw new Error(`Upload failed (${x.status})`);const a=t.type.startsWith("image/")?"image":"pdf";return{fileUrl:i,fileType:a,fileName:t.name}}function Ks({msg:t}){if(!t.fileUrl)return null;const m=X(t.fileUrl);return t.fileType==="image"?e.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",children:e.jsx("img",{src:m,alt:t.fileName||"image",className:"max-w-[220px] rounded-lg mt-1 border border-border/30"})}):e.jsxs("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 mt-1 bg-white/10 rounded-lg px-2 py-1.5 hover:bg-white/20 transition-colors",children:[e.jsx(S,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-xs truncate",children:t.fileName||"file.pdf"}),e.jsx(k,{className:"h-3 w-3 shrink-0 opacity-70"})]})}function Hs({inf:t}){const m=[{icon:Rs,label:"Instagram",url:t.instagramUrl,followers:t.instagramFollowers},{icon:He,label:"TikTok",url:t.tiktokUrl,followers:t.tiktokFollowers},{icon:Fs,label:"YouTube",url:t.youtubeUrl,followers:t.youtubeSubscribers},{icon:Is,label:"X/Twitter",url:t.twitterUrl,followers:t.twitterFollowers},{icon:ce,label:"RED",url:t.redUrl,followers:t.redFollowers}].filter(i=>i.url||i.followers!=null);return m.length===0?null:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map((i,x)=>{const a=i.icon,c=e.jsxs(e.Fragment,{children:[e.jsx(a,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:i.label}),e.jsx("span",{className:"font-semibold",children:Os(i.followers)}
1),i.url&&e.jsx(k,{className:"h-2.5 w-2.5 opacity-60"})]});return i.url?e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[11px] bg-muted hover:bg-muted/70 rounded px-2 py-1 transition-colors",children:c},x):e.jsx("span",{className:"inline-flex items-center gap-1 text-[11px] bg-muted rounded px-2 py-1",children:c},x)})})}function p({icon:t,label:m,value:i}){return i==null||i===""?null:e.jsxs("div",{className:"flex gap-2 text-sm",children:[e.jsxs("div",{className:"w-28 shrink-0 flex items-center gap-1 text-muted-foreground",children:[t&&e.jsx(t,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"text-xs",children:m})]}),e.jsx("div",{className:"flex-1 min-w-0 text-foreground break-words whitespace-pre-wrap",children:i})]})}function Xs({projectId:t,onClose:m}){const[i,x]=r.useState(!1),[a,c]=r.useState(null);r.useEffect(()=>{if(t==null){c(null);return}x(!0),c(null),f.get(`/admin/projects/${t}`).then(T=>c(T)).catch(()=>c(null)).finally(()=>x(!1))},[t]);const C=a?[a.targetSnsInstagram&&"Instagram",a.targetSnsTiktok&&"TikTok",a.targetSnsYoutube&&"YouTube",a.targetSnsTwitter&&"X/Twitter",a.targetSnsRed&&"RED"].filter(Boolean):[];return e.jsx(Je,{open:t!=null,onOpenChange:T=>{T||m()},children:e.jsx(Oe,{className:"max-w-lg max-h-[85vh] overflow-y-auto z-[80]",children:i?e.jsx("div",{className:"py-10 flex justify-center",children:e.jsx(b,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):a?e.jsxs(e.Fragment,{children:[e.jsxs(Ve,{children:[e.jsx(Ye,{className:"text-base pr-6",children:a.projectNameJp||a.projectNameEn||"æ¡ä»¶è©³ç´°"}),e.jsx(Ke,{className:"text-xs",children:a.projectNameEn&&a.projectNameJp&&a.projectNameEn!==a.projectNameJp?a.projectNameEn:`æ¡ä»¶ID: ${a.id}`})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[a.projectStatus&&e.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded bg-muted font-medium",children:a.projectStatus}),a.approveStatus&&e.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded bg-muted font-medium",children:a.approveStatus}),a.projectType&&e.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded bg-muted font-medium",children:a.projectType}),e.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded bg-muted font-medium",children:de[a.serviceRegion]||a.serviceRegion}),a.usesRankingFlow&&e.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded bg-[#FFF4EF] text-[#ED4701] font-medium",children:"ã©ã³ãã³ã°æ¡ä»¶"})]}),e.jsxs("div",{className:"space-y-2 mt-1",children:[e.jsx(p,{icon:W,label:"åºè",value:a.storeNameJp||a.storeNameEn}),e.jsx(p,{icon:q,label:"使",value:a.storeAddress}),e.jsx(p,{icon:q,label:"ã¨ãªã¢",value:a.areaJp||a.area||a.prefecture}),e.jsx(p,{icon:$,label:"ã«ãã´ãª",value:[a.projectCategory,a.projectCategorySub1,a.projectCategorySub2].filter(Boolean).join(" / ")}),e.jsx(p,{icon:Ue,label:"å ±é
¬",value:a.rewards}),e.jsx(p,{icon:Ue,label:"éå¸¸ä¾¡æ ¼",value:a.regularPrice}),e.jsx(p,{icon:ks,label:"åé人æ°",value:a.capacity}),e.jsx(p,{icon:Xe,label:"対象è¨èª",value:a.targetLang}),e.jsx(p,{icon:$,label:"対象SNS",value:C.length?C.join("ã"):null}),e.jsx(p,{icon:$s,label:"æä¾ã¡ãã¥ã¼",value:a.provideMenuJp||a.provideMenuEn}),e.jsx(p,{icon:S,label:"æ¡ä»¶å
容",value:a.projectDescriptionJp||a.projectDescriptionEn}),e.jsx(p,{icon:S,label:"å¿åæ¡ä»¶",value:a.projectRequirements})]}),e.jsxs("a",{href:`/admin/projects?id=${a.id}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-[#ED4701] hover:underline mt-1",children:[e.jsx(k,{className:"h-3 w-3"}),"æ¡ä»¶ç®¡çãã¼ã¸ã§éã"]})]}):e.jsx("div",{className:"py-10 text-center text-sm text-muted-foreground",children:"æ¡ä»¶æ
å ±ãåå¾ã§ãã¾ããã§ãã"})})})}function ft(){const{toast:t}=hs(),[m,i]=r.useState([]),[x,a]=r.useState(!0),[c,C]=r.useState(null),[T,Q]=r.useState(null),[P,We]=r.useState(()=>{const s=new URLSearchParams(window.location.search).get("status");return _e.includes(s||"")?s:"all"}),[E,qe]=r.useState("all"),[A,Qe]=r.useState("all"),[Z,Ze]=r.useState(""),[me,xe]=r.useState(!1),[M,L]=r.useState(null),[U,_]=r.useState([]),[es,ue]=r.useState(!1),[z,pe]=r.useState(!1),[he,fe]=r.useState(!1),[D,ge]=r.useState(""),[R,je]=r.useState("original"),[Ne,B]=r.useState(new Map),[ss,be]=r.useState(!1),[N,ee]=r.useState(null),ye=r.useRef(null),we=r.useRef(null),[ts,G]=r.useState(!1),[F,ve]=r.useState("influencer"),[ke,J]=r.useState([]),[y,I]=r.useState(null),[se,Se]=r.useState(""),[Ce,O]=r.useState("other"),[te,Te]=r.useState(""),[Ee,Le]=r.useState(!1),[as,ns]=r.useState([]),ae=F==="company"?"äºæ¥è
":"ã¤ã³ãã«ã¨ã³ãµã¼",ne=async s=>{try{const n=await f.get(`/admin/influencers-list?search=${encodeURIComponent(s)}`);J((n.influencers||[]).slice(0,20).map(l=>({email:l.email,name:l.name})))}catch{}},De=(s,n=as)=>{const l=s.trim().toLowerCase(),u=l?n.filter($e=>($e.name||"").toLowerCase().includes(l)||$e.email.toLowerCase().includes(l)):n;J(u.slice(0,20))},rs=async(s="")=>{try{const l=((await f.get("/admin/companies-list")).companies||[]).map(u=>({email:u.email,name:u.name}));ns(l),De(s,l)}catch{}},ls=s=>{ve(s),I(null),O("other"),J([]),s==="company"?rs():ne("")},is=()=>{G(!0),ve("influencer"),I(null),O("other"),ne("")},os=async()=>
1{if(!y||!se.trim()||!te.trim()){t({title:`${ae}ã»ä»¶åã»ã¡ãã»ã¼ã¸ãå
¥åãã¦ãã ãã`,variant:"destructive"});return}Le(!0);try{const s=await f.post("/admin/support",{userType:F,influencerEmail:y.email,title:se.trim(),category:Ce,message:te.trim()});t({title:"ã¡ãã»ã¼ã¸ãéä¿¡ãã¾ãã",description:`${ae}ã«ã¡ã¼ã«éç¥ãã¾ãã`}),G(!1),I(null),Se(""),Te(""),O("other"),J([]),w(),s.ticketId&&C(s.ticketId)}catch(s){t({title:"ã¨ã©ã¼",description:s.message,variant:"destructive"})}finally{Le(!1)}},w=()=>{a(!0);const s=new URLSearchParams;P!=="all"&&s.set("status",P),A!=="all"&&s.set("userType",A),E!=="all"&&s.set("assignee",E),Z.trim()&&s.set("search",Z.trim()),f.get(`/admin/support?${s.toString()}`).then(n=>i(n.tickets||[])).finally(()=>a(!1))};r.useEffect(()=>{w()},[P,E,A]);const cs=s=>{ue(!0),L(null),_([]),je("original"),B(new Map),f.get(`/admin/support/${s}`).then(n=>{_(n.messages||[]),L({ticket:n.ticket,influencer:n.influencer,company:n.company,project:n.project}),i(l=>l.map(u=>u.id===s?{...u,unreadAdmin:!1}:u)),ie()}).catch(()=>_([])).finally(()=>ue(!1))};r.useEffect(()=>{c!==null&&cs(c)},[c]),r.useEffect(()=>{ye.current?.scrollIntoView({behavior:"smooth"})},[U]),r.useEffect(()=>{if(c!==null){if(R==="original"){B(new Map);return}be(!0),f.post(`/admin/support/${c}/translate`,{targetLang:R}).then(s=>{const n=new Map;for(const l of s.translations||[])n.set(l.id,l.translatedText);B(n)}).catch(()=>B(new Map)).finally(()=>be(!1))}},[R,U.length]);const ds=s=>R!=="original"&&Ne.has(s.id)?Ne.get(s.id):s.message,ms=s=>{const n=s.target.files?.[0];if(n){if(n.size>10*1024*1024){t({title:"ã¨ã©ã¼",description:"ãã¡ã¤ã«ãµã¤ãºã¯10MB以å
ã«ãã¦ãã ãã",variant:"destructive"});return}if(!n.type.startsWith("image/")&&n.type!=="application/pdf"){t({title:"ã¨ã©ã¼",description:"ç»åã¾ãã¯PDFãã¡ã¤ã«ã®ã¿éä¿¡ã§ãã¾ã",variant:"destructive"});return}ee(n),s.target.value=""}},Re=async()=>{if(!(!D.trim()&&!N||c===null)){pe(!0);try{let s={};N&&(s=await Ys(N));const n=await f.post(`/admin/support/${c}`,{message:D.trim()||void 0,...s});_(l=>[...l,n.message]),ge(""),ee(null),L(l=>l&&{...l,ticket:{...l.ticket,status:l.ticket.status==="æªå¯¾å¿"?"対å¿ä¸":l.ticket.status}}),w(),ie()}catch(s){t({title:"éä¿¡ã¨ã©ã¼",description:s.message,variant:"destructive"})}finally{pe(!1)}}},xs=async()=>{if(c!==null&&window.confirm("ãã®ãã±ãããå®äºã«ãã¾ããï¼å®äºå¾ã¯ã©ã¡ããéä¿¡ã§ããªããªãã¾ãã")){fe(!0);try{await f.post(`/admin/support/${c}/close`,{}),L(s=>s&&{...s,ticket:{...s.ticket,status:"å®äº"}}),w(),ie(),t({title:"å®äºãã¾ãã"})}catch(s){t({title:"ã¨ã©ã¼",description:s.message,variant:"destructive"})}finally{fe(!1)}}},us=async s=>{if(c===null)return;const n=s==="none"?null:s;xe(!0);try{await f.post(`/admin/support/${c}/assignee`,{assignee:n}),L(l=>l&&{...l,ticket:{...l.ticket,assignee:n}}),i(l=>l.map(u=>u.id===c?{...u,assignee:n}:u)),E!=="all"&&w()}catch(l){t({title:"ã¨ã©ã¼",description:l.message,variant:"destructive"})}finally{xe(!1)}},g=M?.ticket,o=M?.influencer,d=M?.company,j=M?.project,Fe=g?.status==="å®äº",Ie=oe(g?.userType);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"ã«ã¹ã¿ãã¼ãµãã¼ã"}),e.jsxs(v,{size:"sm",className:"gap-1.5",onClick:is,children:[e.jsx(Ts,{className:"h-4 w-4"})," æ°è¦ã¡ãã»ã¼ã¸"]})]}),e.jsx(Je,{open:ts,onOpenChange:s=>{s||G(!1)},children:e.jsxs(Oe,{className:"max-w-lg",children:[e.jsxs(Ve,{children:[e.jsx(Ye,{children:"ãµãã¼ãããæ°è¦ã¡ãã»ã¼ã¸ãéã"}),e.jsx(Ke,{children:"鏿ããç¸æã«ãµãã¼ããã£ããã起票ãã¾ãï¼ã¡ã¼ã«éç¥ããï¼ã"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium",children:"éä¿¡å
"}),e.jsx("div",{className:"flex gap-1",children:["influencer","company"].map(s=>e.jsx("button",{type:"button",onClick:()=>ls(s),className:`flex-1 rounded py-1 text-xs font-medium transition-colors ${F===s?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/70"}`,children:s==="company"?"äºæ¥è
":"ã¤ã³ãã«ã¨ã³ãµã¼"},s))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium",children:ae}),y?e.jsxs("div",{className:"flex items-center justify-between rounded-md border px-2.5 py-1.5 text-sm",children:[e.jsxs("span",{children:[y.name||y.email,e.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:y.email})]}),e.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:()=>I(null),children:"夿´"})]}):e.jsxs(e.Fragment,{children:[e.jsx(re,{placeholder:"ååã»ã¡ã¼ã«ã§æ¤ç´¢...",className:"h-9",onChange:s=>F==="company"?De(s.target.value):ne(s.target.value)}),e.jsx("div",{className:"max-h-40 overflow-y-auto rounded-md border divide-y",children:ke.length===0?e.jsx("p",{className:"text-xs text-muted-foreground px-2 py-2",children:"該å½ãªã"}):ke.map(s=>e.jsxs("button",{type:"button",onClick:()=>I(s),className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted/50",children:[s.name||s.email,e.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:s.email})]},s.email))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium",children:"ä»¶å"}),e.jsx(re,{value:se,onChange:s=>Se(s.target.value),className:"h-9",placeholder:"ä»¶å"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium",children:"ã«ãã´ãª"}),e.jsxs(V,{value:Ce,onValueChange:O,children:[e.jsx(Y,{className:"h-9",children:e.jsx(K,{})}),e.jsx(H,{children:(F==="company"?zs:_s).map(s=>e.jsx(h,{value:s,children:Be[s]},s))})]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium",children:"ã¡ãã»ã¼ã¸"}),e.jsx(Me,{value:te,onChange:s=>Te(s.target.value),rows:4,placeholder:"ã¡ãã»ã¼ã¸ãå
¥å..."})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(v,{variant:"outline",onClick:()=>G(!1),children:"ãã£ã³ã»ã«"}),e.jsx(v,{onClick:os,disabled:Ee,children:Ee?"éä¿¡ä¸...":"éä¿¡ãã"})]})]})}),e.jsxs("div",{className:"flex gap-4 h-[calc(100vh-160px)] min-h-[500px]",children:[e.jsxs(Pe,{className:"border-border/40 w-80 shrink-0 flex flex-col overflow-hidden",children:[e.jsxs(Ae,{className:"pb-2 px-3 pt-3 shrink-0 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 border border-border/40 rounded-md px-2",children:[e.jsx(fs,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),e.jsx(re,{value:Z,onChange:s=>Ze(s.target.value),onKeyDown:s=>{s.key==="Enter"&&w()},placeholder:"ã¿ã¤ãã«ã»IDã»ã¡ã¼ã«æ¤ç´¢...",className:"h-7 text-xs border-0 p-0 focus-visible:ring-0 bg-transparent"})]}),e.jsx("div",{className:"flex gap-1",children:Bs.map(s=>e.jsx("button",{type:"button",onClick:()=>Qe(s.key),className:`flex-1 text-xs py-1 rounded font-medium transition-colors ${A===s.key?"bg-foreground text-background":"bg-muted text-muted-foreground hover:bg-muted/70"}`,children:s.label},s.key))}),e.jsx("div",{className:"flex gap-1",children:_e.map(s=>e.jsx("button",{onClick:()=>We(s),className:`flex-1 text-[11px] py-1 rounded font-medium transition-colors ${P===s?"bg-[#ED4701] text-white":"bg-muted text-muted-foreground hover:bg-muted/70"}`,children:s==="all"?"ãã¹ã¦":s},s))}),e.jsxs(V,{value:E,onValueChange:qe,children:[e.jsx(Y,{className:"h-7 text-xs",children:e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx($,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsx(K,{})]})}
1),e.jsxs(H,{className:"z-[70]",children:[e.jsx(h,{value:"all",children:"æ
å½è
ï¼ãã¹ã¦"}),e.jsx(h,{value:"unassigned",children:"æªå²ãå½ã¦"}),ze.map(s=>e.jsx(h,{value:s,children:s},s))]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto divide-y divide-border/30",children:x?e.jsx("div",{className:"p-4 flex justify-center",children:e.jsx(b,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):m.length===0?e.jsx("p",{className:"text-xs text-muted-foreground text-center p-4",children:"該å½ãªã"}):m.map(s=>{const n=s.id===c;return e.jsxs("div",{onClick:()=>C(s.id),className:`px-3 py-3 cursor-pointer hover:bg-muted/40 transition-colors flex items-center gap-2 ${n?"bg-muted/60":""}`,children:[e.jsxs("div",{className:"relative h-8 w-8 shrink-0",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-secondary flex items-center justify-center overflow-hidden",children:s.influencerProfilePic?e.jsx("img",{src:X(s.influencerProfilePic),alt:"",className:"h-full w-full object-cover"}):oe(s.userType)?e.jsx(W,{className:"h-3.5 w-3.5 text-muted-foreground"}):e.jsx(le,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s.unreadAdmin&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3 w-3 rounded-full bg-[#ED4701] border-2 border-background"})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1 justify-between",children:[e.jsx("p",{className:`text-xs truncate ${s.unreadAdmin?"font-bold":"font-semibold"}`,children:s.title}),e.jsx("span",{className:`text-[10px] px-1 rounded font-medium shrink-0 ${Ge(s.status)}`,children:s.status})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mt-0.5",children:[oe(s.userType)&&e.jsx("span",{className:"shrink-0 rounded bg-muted px-1 text-xs font-medium text-muted-foreground",children:"äºæ¥è
"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground truncate",children:[s.influencerName," · ",s.ticketCode]}),s.lastMsgDate&&e.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:Vs(s.lastMsgDate)})]}),s.assignee&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 mt-1 text-[10px] px-1.5 py-0.5 rounded bg-violet-100 text-violet-700 font-medium",children:[e.jsx($,{className:"h-2.5 w-2.5"}),s.assignee]})]}),n&&e.jsx(gs,{className:"h-3 w-3 text-muted-foreground shrink-0"})]},s.id)})})]}),e.jsx(Pe,{className:"border-border/40 flex-1 flex flex-col overflow-hidden min-w-0",children:c===null?e.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(He,{className:"h-10 w-10 mx-auto opacity-20"}),e.jsx("p",{className:"text-sm",children:"ãã±ããã鏿ãã¦ãã ãã"})]})}):es?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(b,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs(e.Fragment,{children:[e.jsxs(Ae,{className:"pb-3 shrink-0 border-b border-border/40 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(js,{className:"text-sm truncate",children:g?.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground font-mono",children:g?.ticketCode}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:Be[g?.category]||g?.category}),e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${Ge(g?.status||"")}`,children:g?.status})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(V,{value:g?.assignee||"none",onValueChange:us,disabled:me,children:[e.jsx(Y,{className:"w-32 h-8 text-xs",children:e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[me?e.jsx(b,{className:"h-3 w-3 animate-spin shrink-0"}):e.jsx($,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsx(K,{})]})}
1),e.jsxs(H,{className:"z-[70]",children:[e.jsx(h,{value:"none",children:"æ
å½è
ãªã"}),ze.map(s=>e.jsx(h,{value:s,children:s},s))]})]}),!Ie&&e.jsxs(e.Fragment,{children:[e.jsxs(V,{value:R,onValueChange:je,children:[e.jsx(Y,{className:"w-28 h-8 text-xs",children:e.jsx(K,{})}),e.jsxs(H,{className:"z-[70]",children:[e.jsx(h,{value:"original",children:"åæ"}),e.jsx(h,{value:"jp",children:"æ¥æ¬èª"}),e.jsx(h,{value:"en",children:"English"}),e.jsx(h,{value:"zh",children:"䏿"}),e.jsx(h,{value:"ko",children:"íêµì´"})]})]}),ss&&e.jsx(b,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),!Fe&&e.jsxs(v,{onClick:xs,disabled:he,size:"sm",variant:"outline",className:"gap-1 h-8 text-xs border-emerald-500 text-emerald-700 hover:bg-emerald-50",children:[he?e.jsx(b,{className:"h-3 w-3 animate-spin"}):e.jsx(Es,{className:"h-3 w-3"}),"å®äºã«ãã"]})]})]}),d&&e.jsxs("div",{className:"bg-muted/30 rounded-lg p-2.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-secondary flex items-center justify-center overflow-hidden shrink-0",children:d.logo?e.jsx("img",{src:X(d.logo),alt:"",className:"h-full w-full object-cover"}):e.jsx(W,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"text-sm font-semibold truncate",children:d.name}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-secondary text-secondary-foreground font-medium shrink-0",children:"äºæ¥è
"}),d.userStatus&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-secondary text-secondary-foreground font-medium shrink-0",children:d.userStatus})]}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:d.email})]}),d.id!=null&&e.jsxs("a",{href:`/admin/users?id=${d.id}`,target:"_blank",rel:"noopener noreferrer",className:"ml-auto inline-flex items-center gap-1 text-xs text-primary hover:underline shrink-0",children:[e.jsx(k,{className:"h-3 w-3"}),"äºæ¥è
æ
å ±"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 text-xs text-muted-foreground",children:[d.storeName&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-card rounded px-2 py-1 border border-border/40",children:[e.jsx(W,{className:"h-3 w-3"}),"åºèï¼",d.storeName]}),d.representativeName&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-card rounded px-2 py-1 border border-border/40",children:[e.jsx(le,{className:"h-3 w-3"}),"æ
å½ï¼",d.representativeName]}),d.phone&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-card rounded px-2 py-1 border border-border/40",children:[e.jsx(Ls,{className:"h-3 w-3"}),d.phone]}),d.address&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-card rounded px-2 py-1 border border-border/40",children:[e.jsx(q,{className:"h-3 w-3"}),d.address]}),d.serviceRegion&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-card rounded px-2 py-1 border border-border/40",children:[e.jsx(ce,{className:"h-3 w-3"}),"å°åï¼",de[d.serviceRegion]||d.serviceRegion]}),d.hpUrl&&e.jsxs("a",{href:d.hpUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 bg-card rounded px-2 py-1 border border-border/40 hover:underline",children:[e.jsx(k,{className:"h-3 w-3"}),"HP"]})]}),j&&e.jsxs("button",{type:"button",onClick:()=>Q(j.id),className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[e.jsx(S,{className:"h-3 w-3"}),"é¢é£æ¡ä»¶: ",j.projectNameJp||j.projectNameEn]})]}),o&&e.jsxs("div",{className:"bg-muted/30 rounded-lg p-2.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-secondary flex items-center justify-center overflow-hidden shrink-0",children:o.profilePic?e.jsx("img",{src:X(o.profilePic),alt:"",className:"h-full w-full object-cover"}):e.jsx(le,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"text-sm font-semibold truncate",children:o.name}),o.userStatus&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-secondary text-secondary-foreground font-medium shrink-0",children:o.userStatus})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:o.email})]}),o.id!=null&&e.jsxs("a",{href:`/admin/users?id=${o.id}`,target:"_blank",rel:"noopener noreferrer",className:"ml-auto inline-flex items-center gap-1 text-[11px] text-[#ED4701] hover:underline shrink-0",children:[e.jsx(k,{className:"h-3 w-3"}),"ãããã£ã¼ã«"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 text-[11px] text-muted-foreground",children:[o.nationality&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-white rounded px-2 py-1 border border-border/40",children:[e.jsx(Ds,{className:"h-3 w-3"}),"å½ç±ï¼",o.nationality]}),o.residence&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-white rounded px-2 py-1 border border-border/40",children:[e.jsx(q,{className:"h-3 w-3"}),"å±
ä½å°ï¼",o.residence]}),o.gender&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-white rounded px-2 py-1 border border-border/40",children:[e.jsx(As,{className:"h-3 w-3"}),Gs[o.gender]||o.gender]}),o.serviceRegion&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-white rounded px-2 py-1 border border-border/40",children:[e.jsx(ce,{className:"h-3 w-3"}),"å°åï¼",de[o.serviceRegion]||o.serviceRegion]}),o.primarySnsLanguage&&e.jsxs("span",{className:"inline-flex items-center gap-1 bg-white rounded px-2 py-1 border border-border/40",children:[e.jsx(Xe,{className:"h-3 w-3"}),"主è¦SNSè¨èªï¼",Js[o.primarySnsLanguage]||o.primarySnsLanguage]})]}),e.jsx(Hs,{inf:o}),j&&e.jsxs("button",{type:"button",onClick:()=>Q(j.id),className:"inline-flex items-center gap-1 text-[11px] text-[#ED4701] hover:underline",children:[e.jsx(S,{className:"h-3 w-3"}),"é¢é£æ¡ä»¶: ",j.projectNameJp||j.projectNameEn]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-3 min-h-0",children:[U.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"ã¡ãã»ã¼ã¸ãããã¾ãã"}):U.map(s=>{const n=s.senderType==="admin",l=ds(s);return e.jsxs("div",{className:`flex gap-2 ${n?"flex-row-reverse":""}`,children:[e.jsx("div",{className:`h-7 w-7 rounded-full flex items-center justify-center shrink-0 text-[10px] font-bold ${n?"bg-[#ED4701] text-white":"bg-secondary text-secondary-foreground"}`,children:n?"管ç":Ie?"äºæ¥":"IF"}),e.jsxs("div",{className:`min-w-0 max-w-[75%] flex flex-col space-y-1 ${n?"items-end":""}`,children:[l&&e.jsx("div",{className:`min-w-0 rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap wrap-anywhere ${n?"bg-[#ED4701] text-white rounded-tr-sm":"bg-muted rounded-tl-sm"}`,children:Us(l)}),s.fileUrl&&e.jsx("div",{className:`rounded-2xl px-3 py-2 text-sm ${n?"bg-[#ED4701] text-white rounded-tr-sm":"bg-muted rounded-tl-sm"}`,children:e.jsx(Ks,{msg:s})}),e.jsx("p",{className:`text-[10px] text-muted-foreground ${n?"text-right":""}
1`,children:new Date(s.createdAt).toLocaleString("ja-JP",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]},s.id)}),e.jsx("div",{ref:ye})]}),e.jsx("div",{className:"pt-3 border-t border-border/40 shrink-0 px-4 pb-4",children:Fe?e.jsxs("div",{className:"flex items-center justify-center gap-2 py-3 text-muted-foreground bg-muted/40 rounded-lg",children:[e.jsx(Ns,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"ãã®ãã±ããã¯å®äºæ¸ã¿ã§ã"})]}):e.jsxs(e.Fragment,{children:[N&&e.jsxs("div",{className:"mb-2 inline-flex items-center gap-1.5 bg-muted rounded-lg px-2 py-1.5 max-w-[220px]",children:[e.jsx(S,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-xs truncate",children:N.name}),e.jsx("button",{onClick:()=>ee(null),className:"ml-1 text-muted-foreground hover:text-foreground shrink-0",children:e.jsx(bs,{className:"h-3 w-3"})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:we,type:"file",accept:"image/*,application/pdf",className:"hidden",onChange:ms}),e.jsx(v,{variant:"ghost",size:"sm",className:"self-end h-9 w-9 p-0 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>we.current?.click(),disabled:z,title:"ãã¡ã¤ã«æ·»ä»",children:e.jsx(Ss,{className:"h-4 w-4"})}),e.jsx(Me,{value:D,onChange:s=>ge(s.target.value),onKeyDown:s=>{Cs(s,"shift-enter")&&(s.preventDefault(),!z&&(D.trim()||N)&&Re())},placeholder:"ã¡ãã»ã¼ã¸ãå
¥å...ï¼Shift+Enterã§éä¿¡ï¼",className:"text-sm resize-none min-h-[60px] max-h-[120px]",rows:2}),e.jsxs(v,{onClick:Re,disabled:z||!D.trim()&&!N,size:"sm",className:"self-end gap-1",children:[z?e.jsx(b,{className:"h-4 w-4 animate-spin"}):e.jsx(ys,{className:"h-4 w-4"}),"éä¿¡"]})]})]})})]})})]}),e.jsx(Xs,{projectId:T,onClose:()=>Q(null)})]})}export{ft as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.