import{s as f,m as v,h as g,c as r,a as i,b as t,u as d,t as a,F as w,r as y,w as k,d as S,v as j,g as M,o as n,n as Y,O as C,q as z}from"./app-13978987.js";import{_ as B}from"./UserLayout-6a50516d.js";import{_ as D}from"./PageHeader-8c638686.js";import{h as O}from"./moment-a9aaa855.js";import"./dropdown-45d66330.js";const V={class:"container flex-grow p-4 sm:pr-4"},F={class:"h-fit space-y-6"},I={class:"h-full"},N={class:"relative mx-auto rounded-primary bg-white shadow dark:bg-slate-800 2xl:w-8/12"},T={class:"flex items-center justify-between rounded-t-primary border-b border-b-slate-200 p-4 dark:border-b-slate-600"},$={class:"flex items-center justify-start gap-x-3"},q={id:"chat-btn-show-sidebar",class:"text-slate-500 hover:text-slate-700 focus:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300 dark:focus:text-slate-300 xl:hidden"},A={class:"avatar avatar-circle avatar-indicator avatar-indicator-online"},E=["src"],L={class:"whitespace-nowrap text-sm font-medium text-slate-700 dark:text-slate-100"},U={class:"whitespace-normal text-sm font-normal text-slate-500 dark:text-slate-400"},G={class:"relative max-h-[calc(100vh-18rem)] overflow-auto px-4 pb-28 md:max-h-[calc(100vh-17rem)]","data-simplebar":""},H={class:"space-y-3"},J={class:"flex gap-x-3 group-[.pr]:flex-row-reverse"},K={class:"avatar avatar-circle avatar-sm shrink-0"},P=["src"],Q={class:"flex max-w-sm flex-col items-start gap-y-2 group-[.pr]:items-end"},R={class:"rounded-primary rounded-tl-none bg-slate-100 p-2 text-sm text-slate-600 group-[.pr]:rounded-tl-primary group-[.pr]:rounded-tr-none group-[.pr]:bg-primary-500 group-[.pr]:text-slate-100 dark:bg-slate-700 dark:text-slate-300"},W={class:"text-xs font-normal text-slate-400"},X=t("div",{id:"chat-scroll-view"},null,-1),Z={class:"absolute bottom-[-0.5px] left-0 right-0 z-10 rounded-b-primary bg-white py-4 dark:bg-slate-800"},tt={class:"flex items-center justify-end gap-x-4 px-4"},st=["disabled"],et={class:"hidden md:inline-block"},at={key:1,class:"text-center font-bold text-red-500"},ot=t("div",{id:"chat-overlay",class:"absolute inset-0 z-10 hidden h-full w-full bg-black bg-opacity-0 transition-colors duration-300 ease-in-out xl:hidden"},null,-1),rt=M({layout:B}),ut=Object.assign(rt,{__name:"Show",props:["buttons","support"],setup(s){const c=s,{uiAvatar:u}=f(),o=v({message:"",status:c.support.status}),x=()=>{C.patch(route("user.supports.update",c.support.id),{message:o.value.message},{onSuccess:()=>{o.value.message="",z.success("Submitted successfully")}})};return(l,m)=>{var h,_,b;const p=g("Icon");return n(),r("main",V,[i(D,{title:"Support",buttons:s.buttons},null,8,["buttons"]),t("div",F,[t("div",I,[t("div",N,[t("div",T,[t("div",$,[t("button",q,[i(p,{icon:"fe:menu",height:"1.5rem",width:"1.5rem"})]),t("div",A,[t("img",{class:"avatar-img",src:d(u)((h=s.support.user)==null?void 0:h.name,(_=s.support.user)==null?void 0:_.avatar),alt:"profile-img"},null,8,E)]),t("div",null,[t("h6",L,a((b=s.support.user)==null?void 0:b.name),1),t("p",U,a(l.trans("Subject :"))+" "+a(s.support.subject??""),1)])])]),t("div",G,[t("ul",H,[(n(!0),r(w,null,y(s.support.conversations,e=>(n(),r("li",{class:Y(["group mt-5",e.is_admin===0?"pr":""]),key:e.id},[t("div",J,[t("div",K,[t("img",{class:"avatar-img",src:d(u)(e.user.name,e.user.avatar),alt:"profile-img"},null,8,P)]),t("div",Q,[t("p",R,a(e.comment),1),t("span",W,a(d(O)(e.created_at).format("D MMM, YYYY")),1)])])],2))),128))]),X]),t("div",Z,[s.support.status===1?(n(),r("form",{key:0,onSubmit:k(x,["prevent"]),class:"mx-4 flex h-[4.5rem] items-center rounded-primary border border-slate-200 shadow dark:border-slate-600"},[S(t("input",{"onUpdate:modelValue":m[0]||(m[0]=e=>o.value.message=e),class:"h-full w-full border-transparent bg-transparent px-4 text-sm text-slate-700 placeholder:text-slate-500 focus:border-transparent focus:ring-0 dark:text-slate-300 dark:placeholder:text-slate-400",type:"text",placeholder:"Type your message here"},null,512),[[j,o.value.message]]),t("div",tt,[t("button",{type:"submit",disabled:o.value.processing,class:"btn btn-sm btn-primary"},[i(p,{icon:"fe:send",height:"1.5rem",width:"1.5rem"}),t("span",et,a(l.trans("Send")),1)],8,st)])],32)):(n(),r("div",at,a(l.trans("You can't not send reply")),1))])]),ot])])])}}});export{ut as default};
