1import{_ as A}from"./N5iPNdrG.js";import{_ as M}from"./CYr54o8O.js";import{n as P,af as S,W as n,q as i,X as _,Z as t,a7 as v,Q as j,ab as L,_ as l,ae as w,a0 as z,Y as y,ac as h,a8 as E,a4 as F,a9 as H,j as p}from"./Dgj_Qgju.js";import{u as J,a as N}from"./CnGqzpe9.js";import"./CWSgHu2s.js";import"./Bwk3HUG7.js";const Q={class:"max-w-7xl mx-auto"},U={class:"bg-white shadow-md rounded-lg overflow-hidden"},W={class:"overflow-x-auto"},X={class:"min-w-full divide-y divide-gray-200"},Y={class:"bg-white divide-y divide-gray-200"},Z={key:0},G={key:1},K={key:2},O=["onClick"],R={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},q={class:"px-6 py-4 whitespace-nowrap"},tt={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 font-medium"},et={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},st={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},at={key:1},ot={class:"px-6 py-4 whitespace-nowrap"},lt={key:0,class:"mt-6 text-center"},nt=["disabled"],it={key:0,class:"text-sm"},rt={class:"divide-y divide-gray-200"},dt={class:"py-3 sm:grid sm:grid-cols-3 sm:gap-4"},ut={class:"mt-1 text-gray-900 sm:mt-0 sm:col-span-2"},ct={class:"py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:items-center"},pt={class:"mt-1 text-gray-900 sm:mt-0 sm:col-span-2"},mt={class:"py-3 sm:grid sm:grid-cols-3 sm:gap-4"},xt={class:"mt-1 text-gray-900 sm:mt-0 sm:col-span-2"},gt={class:"py-3 sm:grid sm:grid-cols-3 sm:gap-4"},vt={class:"mt-1 text-gray-900 sm:mt-0 sm:col-span-2"},yt={key:0,class:"py-3 sm:grid sm:grid-cols-3 sm:gap-4"},ft={class:"mt-1 text-gray-900 sm:mt-0 sm:col-span-2"},_t={class:"py-3 sm:grid sm:grid-cols-3 sm:gap-4"},wt={class:"mt-1 text-gray-900 sm:mt-0 sm:col-span-2"},ht={class:"py-3 sm:grid sm:grid-cols-3 sm:gap-4"},bt={class:"mt-1 text-gray-900 sm:mt-0 sm:col-span-2"},kt={class:"p-3 bg-gray-50 border rounded-md whitespace-pre-wrap"},Ct={class:"mt-5 pt-4 border-t border-gray-200 text-right"},Mt={__name:"inquiries",setup(It){J({title:"åãåãã管ç"});const m=p(null),d=p([]),x=p(null),c=p(!1),f=p(null),a=p(null),b=async(s=!1)=>{if(!c.value){c.value=!0,f.value=null;try{const e={pageSize:20};s&&x.value&&(e.lastVisibleId=x.value);const{data:r,error:u}=await N("/api/admin/inquiries",{params:e});if(u.value)throw u.value;const g=r.value?.inquiries,o=r.value?.lastVisibleId;s?d.value.push(...g||[]):d.value=g||[],x.value=o}catch(e){f.value=e,m.value?.show("åãåããã®èªã¿è¾¼ã¿ã«å¤±æãã¾ããã","error")}finally{c.value=!1}}};P(()=>{b()});const D=()=>{b(!0)},V=s=>{a.value={...s}},$=async s=>{try{await N(`/api/admin/inquiries/${s.id}/status`,{method:"PATCH",body:{status:s.status}});const e=d.value.findIndex(r=>
1r.id===s.id);e!==-1&&(d.value[e].status=s.status),m.value?.show("ã¹ãã¼ã¿ã¹ãæ´æ°ãã¾ããã","success")}catch{m.value?.show("ã¹ãã¼ã¿ã¹ã®æ´æ°ã«å¤±æãã¾ããã","error");const r=d.value.find(u=>u.id===s.id);r&&(a.value.status=r.status)}},k=s=>{if(!s)return"N/A";const e=s._seconds?new Date(s._seconds*1e3):s.toDate?s.toDate():new Date(s);return isNaN(e.getTime())?"Invalid Date":e.toLocaleString("ja-JP",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})},B=s=>({new:"æ°è¦","in-progress":"対å¿ä¸",resolved:"解決æ¸ã¿",spam:"ã¹ãã "})[s]||s,T=s=>({new:"bg-blue-100 text-blue-800","in-progress":"bg-yellow-100 text-yellow-800",resolved:"bg-green-100 text-green-800",spam:"bg-red-100 text-red-800"})[s]||"bg-gray-100 text-gray-800",C=s=>({low:"ä½",medium:"ä¸",high:"é«"})[s]||s,I=s=>({low:"bg-gray-100 text-gray-800",medium:"bg-yellow-100 text-yellow-800",high:"bg-red-100 text-red-800"})[s]||"bg-gray-100 text-gray-800";return(s,e)=>{const r=A,u=M,g=S("PartsModal");return n(),i("div",Q,[_(r,{ref_key:"toast",ref:m},null,512),e[19]||(e[19]=t("h1",{class:"text-3xl font-bold mb-6"},"åãåãã管ç",-1)),t("div",U,[t("div",W,[t("table",X,[e[9]||(e[9]=t("thead",{class:"bg-gray-50"},[t("tr",null,[t("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"æ¥æ"),t("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"ã¹ãã¼ã¿ã¹"),t("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"è¦ä»¶"),t("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"ã¡ã¼ã«ã¢ãã¬ã¹"),t("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"ä¼å¡"),t("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"éè¦åº¦"),t("th",{scope:"col",class:"relative px-6 py-3"},[t("span",{class:"sr-only"},"詳細")])])],-1)),t("tbody",Y,[c.value&&d.value.length===0?(n(),i("tr",Z,[...e[5]||(e[5]=[t("td",{colspan:"7",class:"px-6 py-4 text-center text-gray-500"},"èªã¿è¾¼ã¿ä¸...",-1)])])):f.value?(n(),i("tr",G,[...e[6]||(e[6]=[t("td",{colspan:"7",class:"px-6 py-4 text-center text-red-500"},"èªã¿è¾¼ã¿ã«å¤±æãã¾ããã",-1)])])):d.value.length===0?(n(),i("tr",K,[...e[7]||(e[7]=[t("td",{colspan:"7",class:"px-6 py-4 text-center text-gray-500"},"åãåããã¯ããã¾ããã",-1)])])):v("",!0),(n(!0),i(j,null,L(d.value,o=>(n(),i("tr",{key:o.id,class:"hover:bg-gray-50 cursor-pointer",onClick:Nt=>V(o)},[t("td",R,l(k(o.createdAt)),1),t("td",q,[t("span",{class:w([T(o.status),"px-2 inline-flex text-xs leading-5 font-semibold rounded-full"])},l(B(o.status)),3)]),t("td",tt,l(o.subject),1),t("td",et,l(o.email),1),t("td",st,[o.uid?(n(),z(u,{key:0,to:`/admin/user/${o.uid}`,class:"text-orange-600 hover:text-orange-900 hover:underline",onClick:e[0]||(e[0]=E(()=>{},["stop"]))},{default:y(()=>[h(l(o.userName||"ä¼å¡"),1)]),_:2},1032,["to"])):(n(),i("span",at,"ã²ã¹ã"))]),t("td",ot,[t("span",{class:w([I(o.priority),"px-2 inline-flex text-xs leading-5 font-semibold rounded-full"])},l(C(o.priority)),3)]),e[8]||(e[8]=t("td",{class:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},[t("button",{class:"text-orange-600 hover:text-orange-900"},"詳細")],-1))],8,O))),128))])])])]),x.value?(n(),i("div",lt,[t("button",{onClick:D,disabled:c.value,class:"button-secondary"},l(c.value?"èªã¿è¾¼ã¿ä¸...":"ããã«èªã¿è¾¼ã"),9,nt)])):v("",!0),_(g,{show:!!a.value,onClose:e[4]||(e[4]=o=>a.value=null)},{title:y(()=>[...e[10]||(e[10]=[h("åãåãã詳細",-1)])]),default:y(()=>[a.value?(n(),i("div",it,[t("dl",rt,[t("div",dt,[e[11]||(e[11]=t("dt",{class:"font-medium text-gray-500"},"æ¥æ",-1)),t("dd",ut,l(k(a.value.createdAt)),1)]),t("div",ct,[e[13]||(e[13]=t("dt",{class:"font-medium text-gray-500"},"ã¹ãã¼ã¿ã¹",-1)),t("dd",pt,[F(t("select",{"onUpdate:modelValue":e[1]||(e[1]=o=>a.value.status=o),onChange:e[2]||(e[2]=o=>$(a.value)),class:"input-sm"},[...e[12]||(e[12]=[t("option",{value:"new"},"æ°è¦",-1),t("option",{value:"in-progress"}
1,"対å¿ä¸",-1),t("option",{value:"resolved"},"解決æ¸ã¿",-1),t("option",{value:"spam"},"ã¹ãã ",-1)])],544),[[H,a.value.status]])])]),t("div",mt,[e[14]||(e[14]=t("dt",{class:"font-medium text-gray-500"},"è¦ä»¶",-1)),t("dd",xt,l(a.value.subject),1)]),t("div",gt,[e[15]||(e[15]=t("dt",{class:"font-medium text-gray-500"},"ã¡ã¼ã«ã¢ãã¬ã¹",-1)),t("dd",vt,l(a.value.email),1)]),a.value.uid?(n(),i("div",yt,[e[16]||(e[16]=t("dt",{class:"font-medium text-gray-500"},"ä¼å¡",-1)),t("dd",ft,[_(u,{to:`/admin/user/${a.value.uid}`,class:"text-orange-600 hover:text-orange-900 hover:underline"},{default:y(()=>[h(l(a.value.userName||"ä¼å¡æ
å ±ãè¦ã")+" (ID: "+l(a.value.uid)+") ",1)]),_:1},8,["to"])])])):v("",!0),t("div",_t,[e[17]||(e[17]=t("dt",{class:"font-medium text-gray-500"},"éè¦åº¦",-1)),t("dd",wt,[t("span",{class:w([I(a.value.priority),"px-2 inline-flex text-xs leading-5 font-semibold rounded-full"])},l(C(a.value.priority)),3)])]),t("div",ht,[e[18]||(e[18]=t("dt",{class:"font-medium text-gray-500"},"å
容",-1)),t("dd",bt,[t("div",kt,l(a.value.message),1)])])]),t("div",Ct,[t("button",{onClick:e[3]||(e[3]=o=>a.value=null),type:"button",class:"button-secondary"}," éãã ")])])):v("",!0)]),_:1},8,["show"])])}}};export{Mt 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.