1import{r as e}from"./QTnfLwEv.js";import{$n as t,Kt as n,On as r,_ as i,b as a,bt as o,k as s,mt as c,o as l,rr as u,wn as d,y as f}from"./r30AjZCt.js";import{Br as p,Gr as m,Kr as h,Mn as g,On as _,f as v,jn as y,v as b}from"./ijNuuYqt.js";import{_ as x}from"./CCVd5f4P.js";import{t as S}from"./wNAUAMYn.js";import{t as C}from"./BkSSlITQ2.js";var w=e(_(),1),T={class:`flex-auto`},E=[`onClick`],D={class:`text-12 leading-3 mr-[10px]`},O={class:`text-12 leading-3 whitespace-nowrap text-ellipsis overflow-hidden`},k=[`onClick`],A=Object.assign(s({__name:`MessageCard`,props:{dataMessages:{},isProfilePage:{type:Boolean},isRemovable:{type:Boolean}},async setup(e){let s,_,{t:A}=C(),j=x(),M=S(),N=j.currentRoute.value.params.language||`ja`,P=e,F=d([]);if(M.user&&!P.dataMessages?.length){let{data:e}=([s,_]=n(()=>g()),s=await s,_(),s);P.isProfilePage?F.value=e.value?e.value.data.filter(e=>e.message_key===h):[]:F.value=e.value?e.value.data.filter(e=>e.message_key!==h):[]}let I=(e,t)=>{switch(e){case m.ADD_TOUR:case m.UPDATE_TOUR:j.push(`/${N}/tour/detail/${t}`);break;case m.DELETE_TOUR:j.push(`/${N}/my-tour/public`);break;case m.UPDATE_USER:j.push(`/${N}/me/profile`);break;default:break}},L=(e,t)=>{switch(e){case m.ADD_TOUR:return`${t} ${v(`top_page_message_tour_added`)}`;case m.CREATE_TOUR:return`${t} ${v(`top_page_message_tour_added`)}`;case m.UPDATE_TOUR:return`${t} ${v(`top_page_message_tour_updated`)}`;case m.UPDATE_TOUR_CONTENT:return`${t} ${v(`top_page_message_tour_updated`)}`;case m.DELETE_TOUR:return`${t} ${v(`top_page_message_tour_deleted`)}`;case m.UPDATE_USER:return v(`top_page_message_user_updated`);default:break}},R=async e=>{try{(await y(e)).success&&(F.value=F.value.filter(t=>t.id!==e),b(`success`,v(`all_update_success`)))}catch{b(`error`,v(`all_delete_failed`))}};return(n,s)=>(c(),a(`div`,{class:t([`message-card`,e.isRemovable&&`styledMessageCard`])},[(c(!0),a(l,null,o(e.dataMessages||r(F),n=>(c(),a(`div`,{key:n.id,class:t([`flex items-center justify-between w-full overflow-hidden mt-[17px] hover:text-primary px-2 gap-2`,n.message_type])},[i(`div`,T,[i(`button`,{class:`messageTile block`,onClick:()=>I(n.message_key,n?.message_data?.id)},[i(`span`,D,u(r(w.default)(n.created_at).format(r(p).DATE_JAPAN)),1),i(`span`,O,u(L(n.message_key,n.message_data?.name)),1)],8,E)]),e.isRemovable?(c(),a(`button`,{key:0,class:`icon-close`,onClick:()=>R(n.id)},[...s[0]||=[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`},[i(`path`,{d:`M0 0h24v24H0z`,fill:`none`}),i(`path`,{d:`M18 6L6 18M6 6l12 12`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`})],-1)]],8,k)):f(``,!0)],2))),128))],2))}}),{__name:`CommonMessageCard`});export{A as t};
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.