Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Index-5e3ebc9b.js

import{g as mt,_ as vt}from"./App-26099fac.js";import{r as b,S as at,m as te,o as n,c as l,a as e,t as d,b as f,g as ee,w as ot,v as nt,$ as ft,n as B,F as A,j as z,x as ne,K as lt,T as ae,e as L,f as V,u as T,l as F,h as P,k as E,O as K,q as se,R as it,G as Y,d as J,D as rt,a0 as ct,W as Q,V as oe,a1 as X,E as dt,J as gt,a2 as yt,a3 as wt}from"./app-43851608.js";import{_ as xt}from"./AlertModal-1a288ce3.js";import{_ as _t}from"./Dropdown-6e7c10b4.js";import{_ as bt,a as W}from"./DropdownItem-48d91d39.js";import{_ as kt}from"./FormSelectCombo-d1941422.js";import{_ as Ct}from"./FormTextArea-a182534a.js";import{_ as $t}from"./Modal-22a49fae.js";import{t as Mt}from"./index-17cd980e.js";import{d as St}from"./debounce-729b203d.js";import{P as Ot}from"./Pagination-8172d90a.js";import{_ as Tt}from"./ContactInfo-a865a1a3.js";import"./Sidebar-13bbdf6e.js";import"./Menu-7a7609fd.js";import"./ProfileModal-628e5b7c.js";import"./FormInput-4a309017.js";import"./LangToggle-8d05b0dc.js";import"./index-99011d5f.js";import"./MobileSidebar-64958b6d.js";/* empty css              */import"./use-text-value-242aa4d7.js";import"./use-tree-walker-7c9f6f67.js";import"./ChevronUpDownIcon-8859f144.js";import"./_baseGetTag-2e10a2d1.js";import"./_plugin-vue_export-helper-c27b6911.js";const Zt={key:0,class:"flex justify-center items-center w-full px-6 md:px-4"},Lt={class:"flex items-start space-x-4 bg-orange-100 rounded-lg p-2 mb-2 px-4"},Vt=z('<span class="text-red-700"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 36 36"><path fill="currentColor" d="M18 21.32a1.3 1.3 0 0 0 1.3-1.3V14a1.3 1.3 0 1 0-2.6 0v6a1.3 1.3 0 0 0 1.3 1.32Z" class="clr-i-outline clr-i-outline-path-1"></path><circle cx="17.95" cy="24.27" r="1.5" fill="currentColor" class="clr-i-outline clr-i-outline-path-2"></circle><path fill="currentColor" d="M30.33 25.54L20.59 7.6a3 3 0 0 0-5.27 0L5.57 25.54A3 3 0 0 0 8.21 30h19.48a3 3 0 0 0 2.64-4.43Zm-1.78 1.94a1 1 0 0 1-.86.49H8.21a1 1 0 0 1-.88-1.48l9.74-17.94a1 1 0 0 1 1.76 0l9.74 17.94a1 1 0 0 1-.02.99Z" class="clr-i-outline clr-i-outline-path-3"></path><path fill="none" d="M0 0h36v36H0z"></path></svg></span>',1),Nt={class:"text-sm"},It={class:"text-sm"},qt={key:1,class:"flex justify-center items-center w-full px-6 md:px-4"},Bt={class:"flex items-start space-x-4 bg-orange-100 rounded-lg p-2 mb-2 px-4"},Et=z('<span class="text-red-700"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 36 36"><path fill="currentColor" d="M18 21.32a1.3 1.3 0 0 0 1.3-1.3V14a1.3 1.3 0 1 0-2.6 0v6a1.3 1.3 0 0 0 1.3 1.32Z" class="clr-i-outline clr-i-outline-path-1"></path><circle cx="17.95" cy="24.27" r="1.5" fill="currentColor" class="clr-i-outline clr-i-outline-path-2"></circle><path fill="currentColor" d="M30.33 25.54L20.59 7.6a3 3 0 0 0-5.27 0L5.57 25.54A3 3 0 0 0 8.21 30h19.48a3 3 0 0 0 2.64-4.43Zm-1.78 1.94a1 1 0 0 1-.86.49H8.21a1 1 0 0 1-.88-1.48l9.74-17.94a1 1 0 0 1 1.76 0l9.74 17.94a1 1 0 0 1-.02.99Z" class="clr-i-outline clr-i-outline-path-3"></path><path fill="none" d="M0 0h36v36H0z"></path></svg></span>',1),jt={class:"text-sm"},Ht={class:"text-sm"},Pt=["onKeydown","placeholder","disabled"],At=["accept"],zt=z('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M6.5 8a2 2 0 1 0 4 0a2 2 0 0 0-4 0Zm14.427 1.99c-6.61-.908-12.31 4-11.927 10.51"></path><path d="M3 13.066c2.78-.385 5.275.958 6.624 3.1"></path><path d="M3 12c0-4.243 0-6.364 1.318-7.682C5.636 3 7.758 3 12 3c4.243 0 6.364 0 7.682 1.318C21 5.636 21 7.758 21 12c0 4.243 0 6.364-1.318 7.682C18.364 21 16.242 21 12 21c-4.243 0-6.364 0-7.682-1.318C3 18.364 3 16.242 3 12Z"></path></g></svg>',1),Dt=[zt],Rt=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24"},[e("g",{fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M3 10c0-3.771 0-5.657 1.172-6.828C5.343 2 7.229 2 11 2h2c3.771 0 5.657 0 6.828 1.172C21 4.343 21 6.229 21 10v4c0 3.771 0 5.657-1.172 6.828C18.657 22 16.771 22 13 22h-2c-3.771 0-5.657 0-6.828-1.172C3 19.657 3 17.771 3 14v-4Z"}),e("path",{"stroke-linecap":"round",d:"M8 10h8m-8 4h5"})])],-1),Ut=[Rt],Ft=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 1024 1024"},[e("path",{fill:"currentColor",d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8c0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8c0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1M512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168m-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92z"})],-1),Jt=[Ft],Gt=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 32 32"},[e("path",{fill:"currentColor",d:"M6.5 5.5A4.5 4.5 0 0 0 2 10v12a4.5 4.5 0 0 0 4.5 4.5h12A4.5 4.5 0 0 0 23 22v-1.5l4.2 3.15c1.153.865 2.8.042 2.8-1.4V9.75c0-1.442-1.647-2.265-2.8-1.4L23 11.5V10a4.5 4.5 0 0 0-4.5-4.5zM23 14l5-3.75v11.5L23 18zm-2-4v12a2.5 2.5 0 0 1-2.5 2.5h-12A2.5 2.5 0 0 1 4 22V10a2.5 2.5 0 0 1 2.5-2.5h12A2.5 2.5 0 0 1 21 10"})],-1),Kt=[Gt],Xt=["disabled"],Yt=e("path",{fill:"currentColor",d:"M1.724 1.053a.5.5 0 0 0-.714.545l1.403 4.85a.5.5 0 0 0 .397.354l5.69.953c.268.053.268.437 0 .49l-5.69.953a.5.5 0 0 0-.397.354l-1.403 4.85a.5.5 0 0 0 .714.545l13-6.5a.5.5 0 0 0 0-.894l-13-6.5Z"},null,-1),Wt=[Yt],Qt={key:1,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},es=z('<circle cx="12" cy="2" r="0" fill="currentColor"><animate attributeName="r" begin="0" calcMode="spline" dur="1s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="2" r="0" fill="currentColor" transform="rotate(45 12 12)"><animate attributeName="r" begin="0.125s" calcMode="spline" dur="1s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="2" r="0" fill="currentColor" transform="rotate(90 12 12)"><animate attributeName="r" begin="0.25s" calcMode="spline" dur="1s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="2" r="0" fill="currentColor" transform="rotate(135 12 12)"><animate attributeName="r" begin="0.375s" calcMode="spline" dur="1s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="2" r="0" fill="currentColor" transform="rotate(180 12 12)"><animate attributeName="r" begin="0.5s" calcMode="spline" dur="1s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="2" r="0" fill="currentColor" transform="rotate(225 12 12)"><animate attributeName="r" begin="0.625s" calcMode="spline" dur="1s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="2" r="0" fill="currentColor" transform="rotate(270 12 12)"><animate attributeName="r" begin="0.75s" calcMode="spline" dur="1s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="2" r="0" fill="currentColor" transform="rotate(315 12 12)"><animate attributeName="r" begin="0.875s" calcMode="spline" dur="1s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle>',8),ts=[es],ss={__name:"ChatForm",props:["contact","chatLimitReached"],emits:["response"],setup(t,{emit:a}){const s=t,r=b(null),o=b(null),i=b({uuid:s.contact.uuid,message:null,type:null,file:null});at(()=>{i.value.uuid=s.contact.uuid});const c=async()=>{i.value.message=o.value;const h=new FormData;h.append("message",i.value.message),h.append("type",i.value.type),h.append("uuid",i.value.uuid),i.value.file&&h.append("file",i.value.file),r.value=!0;try{const u=await ne.post("/chats",h);i.value.message=null,o.value=null,i.value.file=null,r.value=!1}catch{}},w=b(null),C=()=>{const h=w.value;h.style.height="auto",h.style.height=h.scrollHeight+"px"},x=h=>{o.value!=null&&o.value.trim()!=""&&c()},y=te(()=>{if(s.contact.last_inbound_chat){const h=new Date(s.contact.last_inbound_chat.created_at);return new Date-h<24*60*60*1e3}return!1}),v=h=>{const u=h.target.files[0],p=new FileReader;p.onload=_=>{i.value.file=u,c()},p.readAsDataURL(u)},g=()=>{switch(i.value.type){case"image":return".jpg, .png";case"document":return".txt, .pdf, .ppt, .doc, .xls, .docx, .pptx, .xlsx";case"audio":return".mp3, .ogg";case"video":return".mp4";default:return""}};return(h,u)=>(n(),l(A,null,[s.chatLimitReached?(n(),l("div",Zt,[e("div",Lt,[Vt,e("div",null,[e("div",Nt,d(h.$t("Maximum chat limit reached")),1),e("div",It,d(h.$t("You have reached the maximum chat limit for your subscription! Please upgrade to send/receive more messages")),1)])])])):f("",!0),!y.value&&!s.chatLimitReached?(n(),l("div",qt,[e("div",Bt,[Et,e("div",null,[e("div",jt,d(h.$t("24 hour limit")),1),e("div",Ht,d(h.$t("Whatsapp does not allow sending messages 24 hours after they last messaged you. However, you can send them a template message")),1)])])])):f("",!0),y.value&&!s.chatLimitReached?(n(),l("form",{key:2,onSubmit:u[7]||(u[7]=ee(p=>c(),["prevent"])),class:"flex items-center px-2 md:px-10 space-x-2"},[e("div",{class:B(["flex items-center w-full rounded-lg py-4 md:py-2 pl-2 pr-2",r.value?"bg-gray-200":"bg-white"])},[ot(e("textarea",{ref_key:"textInputRef",ref:w,onFocus:u[0]||(u[0]=p=>i.value.type="text"),onKeydown:ft(ee(x,["exact","prevent"]),["enter"]),class:B(["w-full ml-3 outline-none resize-none text-sm md:text-base",r.value?"bg-gray-200":"bg-white"]),"onUpdate:modelValue":u[1]||(u[1]=p=>o.value=p),onInput:C,type:"text",rows:"1",placeholder:h.$t("Type your message..."),disabled:r.value},`
            `,42,Pt),[[nt,o.value]]),e("input",{type:"file",class:"sr-only",accept:g(),id:"file-upload",onChange:u[2]||(u[2]=p=>v(p))},null,40,At),e("label",{onClick:u[3]||(u[3]=p=>i.value.type="image"),for:"file-upload",class:"text-slate-500 mr-2 cursor-pointer"},Dt),e("label",{onClick:u[4]||(u[4]=p=>i.value.type="document"),for:"file-upload",class:"text-slate-500 mr-1 cursor-pointer"},Ut),e("label",{onClick:u[5]||(u[5]=p=>i.value.type="audio"),for:"file-upload",class:"text-slate-500 mr-1 cursor-pointer"},Jt),e("label",{onClick:u[6]||(u[6]=p=>i.value.type="video"),for:"file-upload",class:"text-slate-500 mr-4 cursor-pointer"},Kt),e("button",{class:"flex items-center",type:"submit",disabled:o.value===null||o.value.trim()===""||r.value},[r.value?(n(),l("svg",Qt,ts)):(n(),l("svg",{key:0,class:B(o.value===null||o.value.trim()===""?"text-slate-300":"text-black"),xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 16 16"},Wt,2))],8,Xt)],2)],32)):f("",!0)],64))}},as={class:"h-20 bg-white border-b border-1 flex items-center justify-between px-4 md:px-4"},os={class:"flex items-center gap-x-4 cursor-pointer w-3/4"},ns=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"2em",height:"2em",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M19 11H7.14l3.63-4.36a1 1 0 1 0-1.54-1.28l-5 6a1.19 1.19 0 0 0-.09.15c0 .05 0 .08-.07.13A1 1 0 0 0 4 12a1 1 0 0 0 .07.36c0 .05 0 .08.07.13a1.19 1.19 0 0 0 .09.15l5 6A1 1 0 0 0 10 19a1 1 0 0 0 .64-.23a1 1 0 0 0 .13-1.41L7.14 13H19a1 1 0 0 0 0-2"})],-1),ls=["src"],is={key:1,class:"rounded-full w-10 h-10 flex items-center justify-center bg-slate-100"},rs={class:"flex items-center w-full gap-x-8"},cs={class:"w-full flex items-center text-xs"},ds={class:"flex items-center space-x-4"},us=e("button",{type:"button",class:"inline-flex w-full justify-center items-center rounded-md text-sm font-medium text-black hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"},[e("span",{class:"bg-slate-200 p-1 rounded-full cursor-pointer flex items-center justify-center"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 6.75a.75.75 0 1 1 0-1.5a.75.75 0 0 1 0 1.5Zm0 6a.75.75 0 1 1 0-1.5a.75.75 0 0 1 0 1.5Zm0 6a.75.75 0 1 1 0-1.5a.75.75 0 0 1 0 1.5Z"})])])],-1),hs={key:0,class:"flex justify-between items-center bg-white border-b border-1 py-2 px-4 md:px-4"},ps=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22"})],-1),ms=[ps],vs={class:"flex items-center gap-x-2"},fs={class:"text-[13px]"},gs={class:"mt-5 grid grid-cols-1 gap-x-6 gap-y-4"},ys={class:"mt-4 flex"},ws=["disabled"],xs={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},_s=e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"},null,-1),bs=e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})],-1),ks=[_s,bs],Cs={key:1},$s={__name:"ChatHeader",props:["contact","displayContactInfo","ticketingIsEnabled","ticket","addon"],emits:["toggleView","deleteThread","closeThread"],setup(t,{emit:a}){var N,I,j,$,q,H,D;const s=t,r=te(()=>lt().props.auth.user),o=b(!1),i=b(s.displayContactInfo),c=b(null),w=b(!1),C=b({label:(N=s.ticket)!=null&&N.user?(j=(I=s.ticket)==null?void 0:I.user)==null?void 0:j.full_name:Mt("Unassigned"),value:($=s.ticket)!=null&&$.user?(H=(q=s.ticket)==null?void 0:q.user)==null?void 0:H.id:0});at(()=>{var O;i.value=s.displayContactInfo,c.value=(O=s.ticket)==null?void 0:O.status});const x=a,y=()=>{i.value=!i.value,x("toggleView",i.value)},v=()=>{K.visit("/chats/"+s.contact.uuid,{method:"delete",onFinish:()=>{o.value=!1}})};ae({status:c});const g=ae({notes:null,contact:null}),h=ae({ai_assistant:(D=s.contact)==null?void 0:D.ai_assistance_enabled}),u=O=>{K.put("/tickets/"+s.contact.uuid+"/update",{status:O},{})},p=()=>{K.put("/tickets/"+s.contact.uuid+"/assign",{id:C.value.value},{})};function _(O,k){fetch("/team?search="+O,{headers:{Accept:"application/json"}}).then(M=>M.json()).then(M=>{k(M.rows)}).catch(M=>{console.error("Error fetching agents:",M)})}const m=()=>{g.contact=s.contact.uuid,g.post("/notes",{preserveState:!1,onSuccess:()=>{g.reset(),w.value=!1}})},S=()=>{h.ai_assistant=!h.ai_assistant,h.post("/automation/contact/"+s.contact.uuid,{preserveState:!0})};return(O,k)=>(n(),l(A,null,[e("div",as,[e("div",os,[L(T(F),{href:"/chats",class:"sm:block md:hidden"},{default:V(()=>[ns]),_:1}),e("div",{onClick:y},[t.contact.avatar?(n(),l("img",{key:0,class:"rounded-full w-14 h-14",src:t.contact.avatar},null,8,ls)):(n(),l("div",is,d(t.contact.full_name.substring(0,1)),1))]),e("div",rs,[e("div",null,[e("div",{class:"flex items-center",onClick:y},[e("span",null,d(t.contact.full_name),1)]),e("div",cs,[e("span",{onClick:y},d(t.contact.formatted_phone_number),1)])]),t.ticketingIsEnabled&&r.value.teams[0].role!="agent"?(n(),P(kt,{key:0,modelValue:C.value,"onUpdate:modelValue":[k[0]||(k[0]=M=>C.value=M),k[1]||(k[1]=M=>p())],name:"",loadOptions:_,class:B("col-span-1 md:block hidden"),placeholder:"Select Agent"},null,8,["modelValue"])):f("",!0)])]),e("div",null,[e("div",ds,[c.value==="open"&&t.ticketingIsEnabled?(n(),l("button",{key:0,onClick:k[2]||(k[2]=M=>u("closed")),class:"text-sm md:inline-flex hidden justify-center rounded-md border border-transparent bg-red-800 px-4 py-1 text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"},d(O.$t("Mark as closed")),1)):f("",!0),c.value==="closed"&&t.ticketingIsEnabled?(n(),l("button",{key:1,onClick:k[3]||(k[3]=M=>u("open")),class:"text-sm md:inline-flex hidden justify-center rounded-md border border-transparent bg-primary px-4 py-1 text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2"},d(O.$t("Mark as open")),1)):f("",!0),i.value?(n(),l("div",{key:3,onClick:y,class:"bg-slate-200 p-2 rounded-lg text-sm cursor-pointer"},[e("span",null,d(O.$t("Back")),1)])):(n(),P(_t,{key:2},{items:V(()=>[L(bt,null,{default:V(()=>[L(W,{onClick:k[4]||(k[4]=M=>{w.value=!0}),as:"button"},{default:V(()=>[E(d(O.$t("Add notes")),1)]),_:1}),c.value==="open"&&t.ticketingIsEnabled?(n(),P(W,{key:0,onClick:k[5]||(k[5]=M=>u("closed")),as:"button"},{default:V(()=>[E(d(O.$t("Mark as closed")),1)]),_:1})):f("",!0),c.value==="closed"&&t.ticketingIsEnabled?(n(),P(W,{key:1,onClick:k[6]||(k[6]=M=>u("open")),as:"button"},{default:V(()=>[E(d(O.$t("Mark as open")),1)]),_:1})):f("",!0),L(W,{onClick:k[7]||(k[7]=M=>o.value=!0),as:"button"},{default:V(()=>[E(d(O.$t("Clear chat")),1)]),_:1})]),_:1})]),default:V(()=>[us]),_:1}))])])]),t.addon==1?(n(),l("div",hs,[e("div",{class:B(["text-sm py-1 px-3 rounded-md flex items-center gap-x-2 w-[fit-content]",T(h).ai_assistant?"bg-green-50":"bg-red-50"])},[e("span",{class:B(T(h).ai_assistant?"text-green-500":"text-red-500")},ms,2),e("span",null,d(O.$t("AI Assistant")),1)],2),e("div",vs,[e("span",fs,d(O.$t("Enable/disable AI assistant")),1),e("div",{class:B(["w-12 h-6 flex items-center bg-gray-300 rounded-full p-1 cursor-pointer",{"bg-primary":T(h).ai_assistant}]),onClick:k[8]||(k[8]=M=>S())},[e("div",{class:B(["bg-white w-4 h-4 rounded-full shadow-md transform duration-300 ease-in-out",{"translate-x-6":T(h).ai_assistant}])},null,2)],2)])])):f("",!0),L($t,{label:"Add Note",isOpen:w.value},{default:V(()=>[e("div",gs,[e("form",{onSubmit:k[11]||(k[11]=ee(M=>m(),["prevent"])),class:""},[L(Ct,{modelValue:T(g).notes,"onUpdate:modelValue":k[9]||(k[9]=M=>T(g).notes=M),error:T(g).errors.note,name:"",class:B("col-span-2")},null,8,["modelValue","error"]),e("div",ys,[e("button",{type:"button",onClick:k[10]||(k[10]=ee(M=>w.value=!1,["self"])),class:"inline-flex justify-center rounded-md border border-transparent bg-slate-50 px-4 py-2 text-sm text-slate-500 hover:bg-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 mr-4"},d(O.$t("Cancel")),1),e("button",{class:B(["inline-flex justify-center rounded-md border border-transparent bg-primary px-4 py-2 text-sm text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",{"opacity-50":T(g).processing}]),disabled:T(g).processing},[T(g).processing?(n(),l("svg",xs,ks)):(n(),l("span",Cs,d(O.$t("Save")),1))],10,ws)])],32)])]),_:1},8,["isOpen"]),L(xt,{modelValue:o.value,"onUpdate:modelValue":k[12]||(k[12]=M=>o.value=M),label:O.$t("Clear chat"),description:O.$t("Are you sure you want to delete this thread? You can't undo this action"),onConfirm:v},null,8,["modelValue","label","description"])],64))}},Ms={class:"relative text-sm"},Ss={class:"cursor-pointer flex items-center space-x-1 bg-slate-50 w-[fit-content] h-[fit-content] rounded-md p-1 px-2 text-sm"},Os={class:"capitalize"},Ts={class:"text-slate-500"},Zs=e("span",null,[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor","fill-rule":"evenodd",d:"M16.53 8.97a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L12 12.44l3.47-3.47a.75.75 0 0 1 1.06 0","clip-rule":"evenodd"})])],-1),Ls={key:0,class:"absolute bg-white z-10 px-1 py-2 mt-2 shadow w-full rounded-md text-black"},Vs={__name:"TicketStatusToggle",props:{languages:Object,currentLanguage:String,status:String,rowCount:Number},setup(t){const a=t,s=b(!1),r=()=>{s.value=!s.value},o=c=>{s.value&&!c.target.closest(".status-dd")&&(s.value=!1)},i=c=>c?c.charAt(0).toUpperCase()+c.slice(1):"";return se(()=>{document.body.addEventListener("click",o)}),it(()=>{document.body.removeEventListener("click",o)}),(c,w)=>(n(),l("div",Ms,[e("div",{onClick:w[0]||(w[0]=C=>r()),class:"status-dd"},[e("div",Ss,[e("span",Os,d(c.$t(i(a.status))),1),e("span",Ts,d(a.rowCount),1),Zs])]),s.value?(n(),l("div",Ls,[e("div",null,[L(T(F),{href:"/chats?status=unassigned",class:"block px-2 py-1 cursor-pointer hover:bg-slate-100 rounded-md"},{default:V(()=>[E(d(c.$t("Unassigned")),1)]),_:1}),L(T(F),{href:"/chats?status=open",class:"block px-2 py-1 cursor-pointer hover:bg-slate-100 rounded-md"},{default:V(()=>[E(d(c.$t("Open")),1)]),_:1}),L(T(F),{href:"/chats?status=closed",class:"block px-2 py-1 cursor-pointer hover:bg-slate-100 rounded-md"},{default:V(()=>[E(d(c.$t("Closed")),1)]),_:1}),L(T(F),{href:"/chats?status=all",class:"block px-2 py-1 cursor-pointer hover:bg-slate-100 rounded-md"},{default:V(()=>[E(d(c.$t("All")),1)]),_:1})])])):f("",!0)]))}},Ns={class:"text-sm"},Is={key:0,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 16 16"},qs=e("path",{fill:"currentColor",d:"M3.5 13.5a.5.5 0 0 1-1 0V4.707L1.354 5.854a.5.5 0 1 1-.708-.708l2-1.999l.007-.007a.5.5 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L3.5 4.707zm4-9.5a.5.5 0 0 1 0-1h1a.5.5 0 0 1 0 1zm0 3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1zm0 3a.5.5 0 0 1 0-1h5a.5.5 0 0 1 0 1zM7 12.5a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 0-1h-7a.5.5 0 0 0-.5.5"},null,-1),Bs=[qs],Es={key:1,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 16 16"},js=e("path",{fill:"currentColor",d:"M3.5 2.5a.5.5 0 0 0-1 0v8.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999l.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L3.5 11.293zm3.5 1a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 6a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1z"},null,-1),Hs=[js],Ps={key:0,class:"absolute bg-white z-10 px-1 py-2 mt-2 shadow w-[7em] rounded-md text-black"},As={__name:"SortDirectionToggle",props:{direction:String,url:String},setup(t){const a=t,s=b(!1),r=()=>{s.value=!s.value},o=c=>{s.value&&!c.target.closest(".sort-dd")&&(s.value=!1)};se(()=>{document.body.addEventListener("click",o)}),it(()=>{document.body.removeEventListener("click",o)});const i=c=>{K.post(a.url,{sort:c},{preserveState:!1})};return(c,w)=>(n(),l("div",Ns,[e("span",{onClick:w[0]||(w[0]=C=>r()),class:"cursor-pointer hover:bg-slate-50 p-1 rounded-full sort-dd block"},[t.direction=="desc"?(n(),l("svg",Is,Bs)):(n(),l("svg",Es,Hs))]),s.value?(n(),l("div",Ps,[e("div",null,[e("div",{onClick:w[1]||(w[1]=C=>i("desc")),class:"block px-2 py-1 cursor-pointer hover:bg-slate-100 rounded-md"}," Newest "),e("div",{onClick:w[2]||(w[2]=C=>i("asc")),class:"block px-2 py-1 cursor-pointer hover:bg-slate-100 rounded-md"}," Oldest ")])])):f("",!0)]))}},zs={class:"px-4 py-4 border-b"},Ds={class:"flex items-center justify-between space-x-1 text-xl"},Rs={class:"flex space-x-1"},Us={class:"text-slate-500"},Fs={class:"bg-slate-50 rounded-md mt-3 flex items-center py-[2px]"},Js=e("div",{class:"pl-3 py-2"},[e("svg",{class:"text-slate-600",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[e("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m18 11l-6-6"})])],-1),Gs=["placeholder"],Ks=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10s10-4.5 10-10S17.5 2 12 2zm3.7 12.3c.4.4.4 1 0 1.4c-.4.4-1 .4-1.4 0L12 13.4l-2.3 2.3c-.4.4-1 .4-1.4 0c-.4-.4-.4-1 0-1.4l2.3-2.3l-2.3-2.3c-.4-.4-.4-1 0-1.4c.4-.4 1-.4 1.4 0l2.3 2.3l2.3-2.3c.4-.4 1-.4 1.4 0c.4.4.4 1 0 1.4L13.4 12l2.3 2.3z"})],-1),Xs=[Ks],Ys={key:1,class:"pr-2"},Ws=z('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="0 12 12;90 12 12;180 12 12;270 12 12"></animateTransform><animate attributeName="opacity" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" begin="0.2s" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="30 12 12;120 12 12;210 12 12;300 12 12"></animateTransform><animate attributeName="opacity" begin="0.2s" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle><circle cx="12" cy="3.5" r="1.5" fill="currentColor" opacity="0"><animateTransform attributeName="transform" begin="0.4s" calcMode="discrete" dur="2.4s" repeatCount="indefinite" type="rotate" values="60 12 12;150 12 12;240 12 12;330 12 12"></animateTransform><animate attributeName="opacity" begin="0.4s" dur="0.6s" keyTimes="0;0.5;1" repeatCount="indefinite" values="1;1;0"></animate></circle></svg>',1),Qs=[Ws],ea={key:0,class:"grid grid-cols-2 mt-4 items-center w-full"},ta={class:"flex ml-auto gap-x-1"},sa={class:"flex-grow overflow-y-auto h-[65vh]",ref:"scrollContainer"},aa={class:"flex space-x-2 hover:bg-gray-50 cursor-pointer py-3 px-4"},oa={class:"w-[15%]"},na=["src"],la={key:1,class:"rounded-full w-10 h-10 flex items-center justify-center bg-slate-200 capitalize"},ia={class:"w-[85%]"},ra={class:"flex justify-between"},ca={class:"truncate"},da={class:"self-center text-slate-500 text-xs"},ua={key:0,class:"flex justify-between"},ha={key:0,class:"text-slate-500 text-xs truncate self-end"},pa={key:1,class:"text-slate-500 text-xs truncate self-end"},ma={key:2,class:"text-slate-500 text-xs truncate self-end"},va={key:3,class:"text-slate-500 text-xs truncate self-end"},fa={class:"flex items-center"},ga=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.9 13.98l2.1 2.53l3.1-3.99c.2-.26.6-.26.8.01l3.51 4.68a.5.5 0 0 1-.4.8H6.02c-.42 0-.65-.48-.39-.81L8.12 14c.19-.26.57-.27.78-.02z"})],-1),ya={class:"ml-2"},wa={key:4,class:"text-slate-500 text-xs truncate self-end"},xa={class:"flex items-center"},_a=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor","fill-rule":"evenodd",d:"M14.25 2.5a.25.25 0 0 0-.25-.25H7A2.75 2.75 0 0 0 4.25 5v14A2.75 2.75 0 0 0 7 21.75h10A2.75 2.75 0 0 0 19.75 19V9.147a.25.25 0 0 0-.25-.25H15a.75.75 0 0 1-.75-.75V2.5Zm.75 9.75a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1 0-1.5h6Zm0 4a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1 0-1.5h6Z","clip-rule":"evenodd"}),e("path",{fill:"currentColor",d:"M15.75 2.824c0-.184.193-.301.336-.186c.121.098.23.212.323.342l3.013 4.197c.068.096-.006.22-.124.22H16a.25.25 0 0 1-.25-.25V2.824Z"})],-1),ba={class:"ml-2"},ka={key:5,class:"text-slate-500 text-xs truncate self-end"},Ca={class:"flex items-center"},$a=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},[e("path",{fill:"currentColor",d:"M3.5 2.5A2.5 2.5 0 0 0 1 5v6a2.5 2.5 0 0 0 2.5 2.5h5A2.5 2.5 0 0 0 11 11V5a2.5 2.5 0 0 0-2.5-2.5h-5Zm10.684 1.61L12 5.893v4.215l2.184 1.78a.5.5 0 0 0 .816-.389v-7a.5.5 0 0 0-.816-.387Z"})],-1),Ma={class:"ml-2"},Sa={key:6,class:"text-slate-500 text-xs truncate self-end"},Oa={class:"flex items-center"},Ta=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512"},[e("path",{fill:"currentColor",d:"M256 80C149.9 80 62.4 159.4 49.6 262c9.4-3.8 19.6-6 30.4-6c26.5 0 48 21.5 48 48v128c0 26.5-21.5 48-48 48c-44.2 0-80-35.8-80-80V288C0 146.6 114.6 32 256 32s256 114.6 256 256v112c0 44.2-35.8 80-80 80c-26.5 0-48-21.5-48-48V304c0-26.5 21.5-48 48-48c10.8 0 21 2.1 30.4 6C449.6 159.4 362.1 80 256 80z"})],-1),Za={class:"ml-2"},La={key:7,class:"text-slate-500 text-xs truncate self-end"},Va={class:"flex items-center"},Na=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256"},[e("path",{fill:"currentColor",d:"M168 32H88a56.06 56.06 0 0 0-56 56v80a56.06 56.06 0 0 0 56 56h48a8.07 8.07 0 0 0 2.53-.41c26.23-8.75 76.31-58.83 85.06-85.06A8.07 8.07 0 0 0 224 136V88a56.06 56.06 0 0 0-56-56Zm-32 175.42V176a40 40 0 0 1 40-40h31.42c-9.26 21.55-49.87 62.16-71.42 71.42Z"})],-1),Ia={class:"ml-2"},qa={key:8,class:"text-slate-500 text-xs truncate self-end"},Ba={class:"flex items-center"},Ea=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},[e("path",{fill:"currentColor",d:"M3 14s-1 0-1-1s1-4 6-4s6 3 6 4s-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6a3 3 0 0 0 0 6Z"})],-1),ja={class:"ml-2"},Ha={key:9,class:"text-slate-500 text-xs truncate self-end"},Pa={class:"flex items-center"},Aa=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},[e("path",{fill:"currentColor",d:"M9.156 14.544C10.899 13.01 14 9.876 14 7A6 6 0 0 0 2 7c0 2.876 3.1 6.01 4.844 7.544a1.736 1.736 0 0 0 2.312 0ZM6 7a2 2 0 1 1 4 0a2 2 0 0 1-4 0Z"})],-1),za={class:"ml-2"},Da={key:10,class:"bg-green-600 text-white rounded-md py-[1px] px-[8px] min-w-10 text-[10px] flex items-center justify-center"},Ra={class:"px-4 pb-4"},Ua={__name:"ChatTable",props:{rows:{type:Object,required:!0},filters:{type:Object},rowCount:{type:Number,required:!0},ticketingIsEnabled:{type:Boolean},status:{type:String},chatSortDirection:{type:String}},emits:["view"],setup(t,{emit:a}){const s=t,r=b(!1);b(null);const o=p=>JSON.parse(p).type,i=p=>JSON.parse(p),c=p=>({"text/plain":"TXT","application/pdf":"PDF","application/vnd.ms-powerpoint":"PPT","application/msword":"DOC","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PPTX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"})[p]||"Unknown",w=p=>{const _=JSON.parse(p).contacts;if(_.length===1){const m=_[0];return m.name.formatted_name||`${m.name.first_name} ${m.name.last_name}`}else if(_.length>1){const m=_[0].name.first_name,S=_.length-1;return`${m} and ${S} other contacts`}else return"No contacts available"},C=p=>{const _=new Date,m=new Date(p);if(m.getDate()===_.getDate()&&m.getMonth()===_.getMonth()&&m.getFullYear()===_.getFullYear())return x(m,"h:mm a");const S=new Date;return S.setDate(_.getDate()-1),m.getDate()===S.getDate()&&m.getMonth()===S.getMonth()&&m.getFullYear()===S.getFullYear()?"Yesterday":x(m,"d/m/y")},x=(p,_)=>{let m=null;return _==="h:mm a"?m={hour12:!0,hour:"numeric",minute:"numeric"}:m={day:"numeric",month:"numeric",year:"numeric"},new Intl.DateTimeFormat("en-US",m).format(p)},y=window.location.search;Y(()=>y,(p,_)=>{console.log("Query parameters changed:",p)});const v=b({search:s.filters.search}),g=St(()=>{r.value=!0,h()},1e3),h=()=>{const p=window.location.pathname;K.visit(p,{method:"get",data:v.value})},u=()=>{v.value.search=null,h()};return(p,_)=>(n(),l(A,null,[e("div",zs,[e("div",Ds,[e("div",Rs,[e("h2",null,d(p.$t("Chats")),1),e("span",Us,d(t.rowCount),1)])]),e("div",Fs,[Js,ot(e("input",{onInput:_[0]||(_[0]=(...m)=>T(g)&&T(g)(...m)),"onUpdate:modelValue":_[1]||(_[1]=m=>v.value.search=m),class:"w-full bg-slate-50 outline-none rounded-xl py-2 pl-2 mr-2 text-sm",type:"text",placeholder:p.$t("Search name or number...")},null,40,Gs),[[nt,v.value.search]]),r.value===!1&&v.value.search?(n(),l("button",{key:0,onClick:u,type:"button",class:"pr-2"},Xs)):f("",!0),r.value?(n(),l("span",Ys,Qs)):f("",!0)]),t.ticketingIsEnabled?(n(),l("div",ea,[L(Vs,{status:t.status,rowCount:t.rowCount},null,8,["status","rowCount"]),e("div",ta,[L(As,{direction:s.chatSortDirection,url:"/chats/update-sort-direction"},null,8,["direction"])])])):f("",!0)]),e("div",sa,[(n(!0),l(A,null,J(t.rows.data,(m,S)=>(n(),P(T(F),{href:"/chats/"+m.uuid+"?page="+s.rows.meta.current_page,class:B(["block border-b group-hover:pr-0",m.unread_messages>0?"bg-green-50":""]),key:S},{default:V(()=>[e("div",aa,[e("div",oa,[m.avatar?(n(),l("img",{key:0,class:"rounded-full w-10 h-10",src:m.avatar},null,8,na)):(n(),l("div",la,d(m.full_name.substring(0,1)),1))]),e("div",ia,[e("div",ra,[e("h3",ca,d(m.full_name),1),e("span",da,d(C(m.last_chat.created_at)),1)]),m.last_chat.deleted_at===null?(n(),l("div",ua,[o(m.last_chat.metadata)==="text"?(n(),l("p",ha,d(i(m.last_chat.metadata).text.body),1)):f("",!0),o(m.last_chat.metadata)==="button"?(n(),l("p",pa,d(i(m.last_chat.metadata).button.text),1)):f("",!0),o(m.last_chat.metadata)==="interactive"?(n(),l("p",ma,d(i(m.last_chat.metadata).interactive.button_reply.title),1)):f("",!0),o(m.last_chat.metadata)==="image"?(n(),l("p",va,[e("div",fa,[ga,e("span",ya,d(p.$t("Photo")),1)])])):f("",!0),o(m.last_chat.metadata)==="document"?(n(),l("p",wa,[e("div",xa,[_a,e("span",ba,d(c(m.last_chat.media.type))+" "+d(p.$t("File")),1)])])):f("",!0),o(m.last_chat.metadata)==="video"?(n(),l("p",ka,[e("div",Ca,[$a,e("span",Ma,d(p.$t("Video")),1)])])):f("",!0),o(m.last_chat.metadata)==="audio"?(n(),l("p",Sa,[e("div",Oa,[Ta,e("span",Za,d(p.$t("Audio")),1)])])):f("",!0),o(m.last_chat.metadata)==="sticker"?(n(),l("p",La,[e("div",Va,[Na,e("span",Ia,d(p.$t("Sticker")),1)])])):f("",!0),o(m.last_chat.metadata)==="contacts"?(n(),l("p",qa,[e("div",Ba,[Ea,e("span",ja,d(w(m.last_chat.metadata)),1)])])):f("",!0),o(m.last_chat.metadata)==="location"?(n(),l("p",Ha,[e("div",Pa,[Aa,e("span",za,d(p.$t("Location")),1)])])):f("",!0),m.unread_messages>0?(n(),l("span",Da,d(m.unread_messages),1)):f("",!0)])):f("",!0)])])]),_:2},1032,["href","class"]))),128))],512),e("div",Ra,[L(Ot,{class:"mt-3",pagination:t.rows.meta},null,8,["pagination"])])],64))}};(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".mapdiv[data-v-174b771e]{width:100%;height:100%}.info-window-wrapper[data-v-90174664]{display:none}.mapdiv .info-window-wrapper[data-v-90174664]{display:inline-block}.custom-marker-wrapper[data-v-2d2d343a]{display:none}.mapdiv .custom-marker-wrapper[data-v-2d2d343a]{display:inline-block}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();var Fa=Object.defineProperty,Ja=(t,a,s)=>a in t?Fa(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s,We=(t,a,s)=>(Ja(t,typeof a!="symbol"?a+"":a,s),s);const ut=Symbol("map"),ht=Symbol("api"),Ga=Symbol("marker"),Ka=Symbol("markerCluster"),ie=Symbol("CustomMarker"),Xa=Symbol("mapTilesLoaded"),pt=["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"];/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Ya(t,a,s,r){function o(i){return i instanceof s?i:new s(function(c){c(i)})}return new(s||(s=Promise))(function(i,c){function w(y){try{x(r.next(y))}catch(v){c(v)}}function C(y){try{x(r.throw(y))}catch(v){c(v)}}function x(y){y.done?i(y.value):o(y.value).then(w,C)}x((r=r.apply(t,a||[])).next())})}var Wa=function t(a,s){if(a===s)return!0;if(a&&s&&typeof a=="object"&&typeof s=="object"){if(a.constructor!==s.constructor)return!1;var r,o,i;if(Array.isArray(a)){if(r=a.length,r!=s.length)return!1;for(o=r;o--!==0;)if(!t(a[o],s[o]))return!1;return!0}if(a.constructor===RegExp)return a.source===s.source&&a.flags===s.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===s.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===s.toString();if(i=Object.keys(a),r=i.length,r!==Object.keys(s).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(s,i[o]))return!1;for(o=r;o--!==0;){var c=i[o];if(!t(a[c],s[c]))return!1}return!0}return a!==a&&s!==s};const Qe="__googleMapsScriptId";var G;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(G||(G={}));class U{constructor({apiKey:a,authReferrerPolicy:s,channel:r,client:o,id:i=Qe,language:c,libraries:w=[],mapIds:C,nonce:x,region:y,retries:v=3,url:g="https://maps.googleapis.com/maps/api/js",version:h}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=a,this.authReferrerPolicy=s,this.channel=r,this.client=o,this.id=i||Qe,this.language=c,this.libraries=w,this.mapIds=C,this.nonce=x,this.region=y,this.retries=v,this.url=g,this.version=h,U.instance){if(!Wa(this.options,U.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(U.instance.options)}`);return U.instance}U.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?G.FAILURE:this.done?G.SUCCESS:this.loading?G.LOADING:G.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let a=this.url;return a+="?callback=__googleMapsCallback",this.apiKey&&(a+=`&key=${this.apiKey}`),this.channel&&(a+=`&channel=${this.channel}`),this.client&&(a+=`&client=${this.client}`),this.libraries.length>0&&(a+=`&libraries=${this.libraries.join(",")}`),this.language&&(a+=`&language=${this.language}`),this.region&&(a+=`&region=${this.region}`),this.version&&(a+=`&v=${this.version}`),this.mapIds&&(a+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(a+=`&auth_referrer_policy=${this.authReferrerPolicy}`),a}deleteScript(){const a=document.getElementById(this.id);a&&a.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((a,s)=>{this.loadCallback(r=>{r?s(r.error):a(window.google)})})}importLibrary(a){return this.execute(),google.maps.importLibrary(a)}loadCallback(a){this.callbacks.push(a),this.execute()}setScript(){var a,s;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(i=>!r[i]&&delete r[i]),!((s=(a=window==null?void 0:window.google)===null||a===void 0?void 0:a.maps)===null||s===void 0)&&s.importLibrary||(i=>{let c,w,C,x="The Google Maps JavaScript API",y="google",v="importLibrary",g="__ib__",h=document,u=window;u=u[y]||(u[y]={});const p=u.maps||(u.maps={}),_=new Set,m=new URLSearchParams,S=()=>c||(c=new Promise((N,I)=>Ya(this,void 0,void 0,function*(){var j;yield w=h.createElement("script"),w.id=this.id,m.set("libraries",[..._]+"");for(C in i)m.set(C.replace(/[A-Z]/g,$=>"_"+$[0].toLowerCase()),i[C]);m.set("callback",y+".maps."+g),w.src=this.url+"?"+m,p[g]=N,w.onerror=()=>c=I(Error(x+" could not load.")),w.nonce=this.nonce||((j=h.querySelector("script[nonce]"))===null||j===void 0?void 0:j.nonce)||"",h.head.append(w)})));p[v]?console.warn(x+" only loads once. Ignoring:",i):p[v]=(N,...I)=>_.add(N)&&S().then(()=>p[v](N,...I))})(r);const o=this.libraries.map(i=>this.importLibrary(i));o.length||o.push(this.importLibrary("core")),Promise.all(o).then(()=>this.callback(),i=>{const c=new ErrorEvent("error",{error:i});this.loadErrorCallback(c)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(a){if(this.errors.push(a),this.errors.length<=this.retries){const s=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${s} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},s)}else this.onerrorEvent=a,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(a=>{a(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setScript())}}}function Qa(t){return class extends t.OverlayView{constructor(a){super(),We(this,"element"),We(this,"opts");const{element:s,...r}=a;this.element=s,this.opts=r,this.opts.map&&this.setMap(this.opts.map)}getPosition(){return this.opts.position?this.opts.position instanceof t.LatLng?this.opts.position:new t.LatLng(this.opts.position):null}getVisible(){if(!this.element)return!1;const a=this.element;return a.style.display!=="none"&&a.style.visibility!=="hidden"&&(a.style.opacity===""||Number(a.style.opacity)>.01)}onAdd(){if(!this.element)return;const a=this.getPanes();a&&a.overlayMouseTarget.appendChild(this.element)}draw(){if(!this.element)return;const a=this.getProjection(),s=a==null?void 0:a.fromLatLngToDivPixel(this.getPosition());if(s){this.element.style.position="absolute";const r=this.element.offsetHeight,o=this.element.offsetWidth;let i,c;switch(this.opts.anchorPoint){case"TOP_CENTER":i=s.x-o/2,c=s.y;break;case"BOTTOM_CENTER":i=s.x-o/2,c=s.y-r;break;case"LEFT_CENTER":i=s.x,c=s.y-r/2;break;case"RIGHT_CENTER":i=s.x-o,c=s.y-r/2;break;case"TOP_LEFT":i=s.x,c=s.y;break;case"TOP_RIGHT":i=s.x-o,c=s.y;break;case"BOTTOM_LEFT":i=s.x,c=s.y-r;break;case"BOTTOM_RIGHT":i=s.x-o,c=s.y-r;break;default:i=s.x-o/2,c=s.y-r/2}this.element.style.left=i+"px",this.element.style.top=c+"px",this.element.style.transform=`translateX(${this.opts.offsetX||0}px) translateY(${this.opts.offsetY||0}px)`,this.opts.zIndex&&(this.element.style.zIndex=this.opts.zIndex.toString())}}onRemove(){this.element&&this.element.remove()}setOptions(a){const{element:s,...r}=a;this.element=s,this.opts=r,this.draw()}}}let et;const tt=["bounds_changed","center_changed","click","dblclick","drag","dragend","dragstart","heading_changed","idle","maptypeid_changed","mousemove","mouseout","mouseover","projection_changed","resize","rightclick","tilesloaded","tilt_changed","zoom_changed"],eo=rt({props:{apiPromise:{type:Promise},apiKey:{type:String,default:""},version:{type:String,default:"weekly"},libraries:{type:Array,default:()=>["places"]},region:{type:String,required:!1},language:{type:String,required:!1},backgroundColor:{type:String,required:!1},center:{type:Object,default:()=>({lat:0,lng:0})},clickableIcons:{type:Boolean,required:!1,default:void 0},controlSize:{type:Number,required:!1},disableDefaultUi:{type:Boolean,required:!1,default:void 0},disableDoubleClickZoom:{type:Boolean,required:!1,default:void 0},draggable:{type:Boolean,required:!1,default:void 0},draggableCursor:{type:String,required:!1},draggingCursor:{type:String,required:!1},fullscreenControl:{type:Boolean,required:!1,default:void 0},fullscreenControlPosition:{type:String,required:!1},gestureHandling:{type:String,required:!1},heading:{type:Number,required:!1},keyboardShortcuts:{type:Boolean,required:!1,default:void 0},mapTypeControl:{type:Boolean,required:!1,default:void 0},mapTypeControlOptions:{type:Object,required:!1},mapTypeId:{type:[Number,String],required:!1},mapId:{type:String,required:!1},maxZoom:{type:Number,required:!1},minZoom:{type:Number,required:!1},noClear:{type:Boolean,required:!1,default:void 0},panControl:{type:Boolean,required:!1,default:void 0},panControlPosition:{type:String,required:!1},restriction:{type:Object,required:!1},rotateControl:{type:Boolean,required:!1,default:void 0},rotateControlPosition:{type:String,required:!1},scaleControl:{type:Boolean,required:!1,default:void 0},scaleControlStyle:{type:Number,required:!1},scrollwheel:{type:Boolean,required:!1,default:void 0},streetView:{type:Object,required:!1},streetViewControl:{type:Boolean,required:!1,default:void 0},streetViewControlPosition:{type:String,required:!1},styles:{type:Array,required:!1},tilt:{type:Number,required:!1},zoom:{type:Number,required:!1},zoomControl:{type:Boolean,required:!1,default:void 0},zoomControlPosition:{type:String,required:!1}},emits:tt,setup(t,{emit:a}){const s=b(),r=b(!1),o=b(),i=b(),c=b(!1);Q(ut,o),Q(ht,i),Q(Xa,c);const w=()=>{const v={...t};Object.keys(v).forEach(u=>{v[u]===void 0&&delete v[u]});const g=u=>{var p;return u?{position:(p=i.value)==null?void 0:p.ControlPosition[u]}:{}},h={scaleControlOptions:t.scaleControlStyle?{style:t.scaleControlStyle}:{},panControlOptions:g(t.panControlPosition),zoomControlOptions:g(t.zoomControlPosition),rotateControlOptions:g(t.rotateControlPosition),streetViewControlOptions:g(t.streetViewControlPosition),fullscreenControlOptions:g(t.fullscreenControlPosition),disableDefaultUI:t.disableDefaultUi};return{...v,...h}},C=Y([i,o],([v,g])=>{const h=v,u=g;h&&u&&(h.event.addListenerOnce(u,"tilesloaded",()=>{c.value=!0}),setTimeout(C,0))},{immediate:!0}),x=()=>{try{const{apiKey:v,region:g,version:h,language:u,libraries:p}=t;et=new U({apiKey:v,region:g,version:h,language:u,libraries:p})}catch(v){console.error(v)}},y=v=>{i.value=X(v.maps),o.value=X(new v.maps.Map(s.value,w()));const g=Qa(i.value);i.value[ie]=g,tt.forEach(u=>{var p;(p=o.value)==null||p.addListener(u,_=>a(u,_))}),r.value=!0;const h=Object.keys(t).filter(u=>!["apiPromise","apiKey","version","libraries","region","language","center","zoom"].includes(u)).map(u=>ct(t,u));Y([()=>t.center,()=>t.zoom,...h],([u,p],[_,m])=>{var S,N,I;const{center:j,zoom:$,...q}=w();(S=o.value)==null||S.setOptions(q),p!==void 0&&p!==m&&((N=o.value)==null||N.setZoom(p));const H=!_||u.lng!==_.lng||u.lat!==_.lat;u&&H&&((I=o.value)==null||I.panTo(u))})};return se(()=>{t.apiPromise&&t.apiPromise instanceof Promise?t.apiPromise.then(y):(x(),et.load().then(y))}),dt(()=>{var v;c.value=!1,o.value&&((v=i.value)==null||v.event.clearInstanceListeners(o.value))}),{mapRef:s,ready:r,map:o,api:i,mapTilesLoaded:c}}}),to=(t,a)=>{const s=t.__vccOpts||t;for(const[r,o]of a)s[r]=o;return s},so={ref:"mapRef",class:"mapdiv"};function ao(t,a,s,r,o,i){return n(),l("div",null,[e("div",so,null,512),gt(t.$slots,"default",yt(wt({ready:t.ready,map:t.map,api:t.api,mapTilesLoaded:t.mapTilesLoaded})),void 0,!0)])}const oo=to(eo,[["render",ao],["__scopeId","data-v-174b771e"]]);function no(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lo=function t(a,s){if(a===s)return!0;if(a&&s&&typeof a=="object"&&typeof s=="object"){if(a.constructor!==s.constructor)return!1;var r,o,i;if(Array.isArray(a)){if(r=a.length,r!=s.length)return!1;for(o=r;o--!==0;)if(!t(a[o],s[o]))return!1;return!0}if(a.constructor===RegExp)return a.source===s.source&&a.flags===s.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===s.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===s.toString();if(i=Object.keys(a),r=i.length,r!==Object.keys(s).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(s,i[o]))return!1;for(o=r;o--!==0;){var c=i[o];if(!t(a[c],s[c]))return!1}return!0}return a!==a&&s!==s};const io=no(lo),ro=t=>t==="Marker",co=t=>t===ie,uo=(t,a,s,r)=>{const o=b(),i=oe(ut,b()),c=oe(ht,b()),w=oe(Ka,b()),C=te(()=>!!(w.value&&c.value&&(o.value instanceof c.value.Marker||o.value instanceof c.value[ie])));return Y([i,s],(x,[y,v])=>{var g,h,u;const p=!io(s.value,v)||i.value!==y;!i.value||!c.value||!p||(o.value?(o.value.setOptions(s.value),C.value&&((g=w.value)==null||g.removeMarker(o.value),(h=w.value)==null||h.addMarker(o.value))):(ro(t)?o.value=X(new c.value[t](s.value)):co(t)?o.value=X(new c.value[t](s.value)):o.value=X(new c.value[t]({...s.value,map:i.value})),C.value?(u=w.value)==null||u.addMarker(o.value):o.value.setMap(i.value),a.forEach(_=>{var m;(m=o.value)==null||m.addListener(_,S=>r(_,S))})))},{immediate:!0}),dt(()=>{var x,y;o.value&&((x=c.value)==null||x.event.clearInstanceListeners(o.value),C.value?(y=w.value)==null||y.removeMarker(o.value):o.value.setMap(null))}),o},st=["animation_changed","click","dblclick","rightclick","dragstart","dragend","drag","mouseover","mousedown","mouseout","mouseup","draggable_changed","clickable_changed","contextmenu","cursor_changed","flat_changed","rightclick","zindex_changed","icon_changed","position_changed","shape_changed","title_changed","visible_changed"],ho=rt({name:"Marker",props:{options:{type:Object,required:!0}},emits:st,setup(t,{emit:a,expose:s,slots:r}){const o=ct(t,"options"),i=uo("Marker",st,o,a);return Q(Ga,i),s({marker:i}),()=>{var c;return(c=r.default)==null?void 0:c.call(r)}}});pt.concat(["bounds_changed"]);pt.concat(["center_changed","radius_changed"]);var le;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})(le||(le={}));Object.values(le);const po={key:0,class:"max-w-[300px]"},mo={class:"normal-case whitespace-pre-wrap"},vo={key:0,class:"mr-auto text-sm text-[#00a5f4] flex flex-col relative max-w-[25em]"},fo={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},go=e("path",{fill:"currentColor",d:"M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"},null,-1),yo=[go],wo={key:1,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},xo=e("g",{fill:"none"},[e("path",{fill:"currentColor",d:"M20 16v4c-2.758 0-5.07-.495-7-1.325c-3.841-1.652-6.176-4.63-7.5-7.675C4.4 8.472 4 5.898 4 4h4l1 4l-3.5 3c1.324 3.045 3.659 6.023 7.5 7.675L16 15l4 1z"}),e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 18.675c1.93.83 4.242 1.325 7 1.325v-4l-4-1l-3 3.675zm0 0C9.159 17.023 6.824 14.045 5.5 11m0 0C4.4 8.472 4 5.898 4 4h4l1 4l-3.5 3z"})],-1),_o=[xo],bo=["src"],ko=["src"],Co={key:1,class:"max-w-[300px]"},$o={class:"normal-case whitespace-pre-wrap"},Mo={key:2,class:"max-w-[300px]"},So={class:"normal-case whitespace-pre-wrap"},Oo={key:3},To=["src"],Zo={key:1,class:"text-slate-500 flex justify-center items-center space-x-4"},Lo=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("g",{fill:"none"},[e("path",{d:"M24 0v24H0V0h24ZM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018Zm.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022Zm-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01l-.184-.092Z"}),e("path",{fill:"currentColor",d:"m13.299 3.148l8.634 14.954a1.5 1.5 0 0 1-1.299 2.25H3.366a1.5 1.5 0 0 1-1.299-2.25l8.634-14.954c.577-1 2.02-1 2.598 0ZM12 4.898L4.232 18.352h15.536L12 4.898ZM12 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2Zm0-7a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1Z"})])],-1),Vo={key:2,class:"max-w-[300px]"},No={key:3,class:"mr-auto text-sm text-[#00a5f4] flex flex-col relative max-w-[25em]"},Io={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},qo=e("path",{fill:"currentColor",d:"M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"},null,-1),Bo=[qo],Eo={key:1,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},jo=e("g",{fill:"none"},[e("path",{fill:"currentColor",d:"M20 16v4c-2.758 0-5.07-.495-7-1.325c-3.841-1.652-6.176-4.63-7.5-7.675C4.4 8.472 4 5.898 4 4h4l1 4l-3.5 3c1.324 3.045 3.659 6.023 7.5 7.675L16 15l4 1z"}),e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 18.675c1.93.83 4.242 1.325 7 1.325v-4l-4-1l-3 3.675zm0 0C9.159 17.023 6.824 14.045 5.5 11m0 0C4.4 8.472 4 5.898 4 4h4l1 4l-3.5 3z"})],-1),Ho=[jo],Po=["src"],Ao=["src"],zo={key:4},Do={class:"relative w-[300px]"},Ro={class:"flex space-x-2 w-full h-1/3 bg-white opacity-90 pt-2"},Uo={key:0,xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 1024 1024"},Fo=e("path",{fill:"red",d:"m531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7c-3.8-21.3-19.5-29.6-32.9-30.2c-15.8-.7-29.9 8.3-33.4 21.4c-6.6 24-.7 56.8 10.1 98.6c-13.6 32.4-35.3 79.5-51.2 107.5c-29.6 15.3-69.3 38.9-75.2 68.7c-1.2 5.5.2 12.5 3.5 18.8c3.7 7 9.6 12.4 16.5 15c3 1.1 6.6 2 10.8 2c17.6 0 46.1-14.2 84.1-79.4c5.8-1.9 11.8-3.9 17.6-5.9c27.2-9.2 55.4-18.8 80.9-23.1c28.2 15.1 60.3 24.8 82.1 24.8c21.6 0 30.1-12.8 33.3-20.5c5.6-13.5 2.9-30.5-6.2-39.6c-13.2-13-45.3-16.4-95.3-10.2c-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7c6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4c-4.9-19.9-5.6-48.1-2.7-51.4c.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2c-21.6 4.9-41.3 13-58.9 20.2c-4.2 1.7-8.3 3.4-12.3 5c13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6c40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"},null,-1),Jo=[Fo],Go={key:1,xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 32 32"},Ko=z('<defs><linearGradient id="vscodeIconsFileTypeExcel0" x1="4.494" x2="13.832" y1="-2092.086" y2="-2075.914" gradientTransform="translate(0 2100)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#18884f"></stop><stop offset=".5" stop-color="#117e43"></stop><stop offset="1" stop-color="#0b6631"></stop></linearGradient></defs><path fill="#185c37" d="M19.581 15.35L8.512 13.4v14.409A1.192 1.192 0 0 0 9.705 29h19.1A1.192 1.192 0 0 0 30 27.809V22.5Z"></path><path fill="#21a366" d="M19.581 3H9.705a1.192 1.192 0 0 0-1.193 1.191V9.5L19.581 16l5.861 1.95L30 16V9.5Z"></path><path fill="#107c41" d="M8.512 9.5h11.069V16H8.512Z"></path><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2Z" opacity=".1"></path><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"></path><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"></path><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"></path><path fill="url(#vscodeIconsFileTypeExcel0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"></path><path fill="#fff" d="m5.7 19.873l2.511-3.884l-2.3-3.862h1.847L9.013 14.6c.116.234.2.408.238.524h.017c.082-.188.169-.369.26-.546l1.342-2.447h1.7l-2.359 3.84l2.419 3.905h-1.809l-1.45-2.711A2.355 2.355 0 0 1 9.2 16.8h-.024a1.688 1.688 0 0 1-.168.351l-1.493 2.722Z"></path><path fill="#33c481" d="M28.806 3h-9.225v6.5H30V4.191A1.192 1.192 0 0 0 28.806 3Z"></path><path fill="#107c41" d="M19.581 16H30v6.5H19.581Z"></path>',12),Xo=[Ko],Yo={key:2,xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 32 32"},Wo=z('<defs><linearGradient id="vscodeIconsFileTypeWord0" x1="4.494" x2="13.832" y1="-1712.086" y2="-1695.914" gradientTransform="translate(0 1720)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2368c4"></stop><stop offset=".5" stop-color="#1a5dbe"></stop><stop offset="1" stop-color="#1146ac"></stop></linearGradient></defs><path fill="#41a5ee" d="M28.806 3H9.705a1.192 1.192 0 0 0-1.193 1.191V9.5l11.069 3.25L30 9.5V4.191A1.192 1.192 0 0 0 28.806 3Z"></path><path fill="#2b7cd3" d="M30 9.5H8.512V16l11.069 1.95L30 16Z"></path><path fill="#185abd" d="M8.512 16v6.5l10.418 1.3L30 22.5V16Z"></path><path fill="#103f91" d="M9.705 29h19.1A1.192 1.192 0 0 0 30 27.809V22.5H8.512v5.309A1.192 1.192 0 0 0 9.705 29Z"></path><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2Z" opacity=".1"></path><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"></path><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"></path><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"></path><path fill="url(#vscodeIconsFileTypeWord0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"></path><path fill="#fff" d="M6.9 17.988c.023.184.039.344.046.481h.028c.01-.13.032-.287.065-.47s.062-.338.089-.465l1.255-5.407h1.624l1.3 5.326a7.761 7.761 0 0 1 .162 1h.022a7.6 7.6 0 0 1 .135-.975l1.039-5.358h1.477l-1.824 7.748h-1.727l-1.237-5.126q-.054-.222-.122-.578t-.084-.52h-.021q-.021.189-.084.561c-.042.249-.075.432-.1.552L7.78 19.871H6.024L4.19 12.127h1.5l1.131 5.418a4.469 4.469 0 0 1 .079.443Z"></path>',11),Qo=[Wo],e1={key:3,xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 32 32"},t1=z('<defs><linearGradient id="vscodeIconsFileTypePowerpoint0" x1="4.494" x2="13.832" y1="-1748.086" y2="-1731.914" gradientTransform="translate(0 1756)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ca4c28"></stop><stop offset=".5" stop-color="#c5401e"></stop><stop offset="1" stop-color="#b62f14"></stop></linearGradient></defs><path fill="#ed6c47" d="M18.93 17.3L16.977 3h-.146A12.9 12.9 0 0 0 3.953 15.854V16Z"></path><path fill="#ff8f6b" d="M17.123 3h-.146v13l6.511 2.6L30 16v-.146A12.9 12.9 0 0 0 17.123 3Z"></path><path fill="#d35230" d="M30 16v.143A12.905 12.905 0 0 1 17.12 29h-.287a12.907 12.907 0 0 1-12.88-12.857V16Z"></path><path d="M17.628 9.389V23.26a1.2 1.2 0 0 1-.742 1.1a1.16 1.16 0 0 1-.45.091H7.027a10.08 10.08 0 0 1-.521-.65a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85a8.82 8.82 0 0 1 .456-.65h9.93a1.2 1.2 0 0 1 1.192 1.189Z" opacity=".1"></path><path d="M16.977 10.04v13.871a1.15 1.15 0 0 1-.091.448a1.2 1.2 0 0 1-1.1.741H7.62q-.309-.314-.593-.65a10.08 10.08 0 0 1-.521-.65a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.735a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"></path><path d="M16.977 10.04v12.571a1.2 1.2 0 0 1-1.192 1.189H6.506a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.735a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"></path><path d="M16.326 10.04v12.571a1.2 1.2 0 0 1-1.192 1.189H6.506a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.084a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"></path><path fill="url(#vscodeIconsFileTypePowerpoint0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"></path><path fill="#fff" d="M9.293 12.028a3.287 3.287 0 0 1 2.174.636a2.27 2.27 0 0 1 .756 1.841a2.555 2.555 0 0 1-.373 1.376a2.49 2.49 0 0 1-1.059.935a3.607 3.607 0 0 1-1.591.334H7.687v2.8H6.141v-7.922ZM7.686 15.94h1.331a1.735 1.735 0 0 0 1.177-.351a1.3 1.3 0 0 0 .4-1.025q0-1.309-1.525-1.31H7.686v2.686Z"></path>',10),s1=[t1],a1={class:"overflow-ellipsis overflow-hidden line-clamp-2 w-[200px]"},o1={class:"flex items-center text-slate-500 text-[11px]"},n1=e("span",null,[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"},[e("circle",{cx:"12.1",cy:"12.1",r:"1",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})])],-1),l1=["href","download"],i1={key:0,xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 24 24"},r1=e("path",{fill:"currentColor",d:"M4.025 11.975q0 2.825 1.725 5t4.4 2.825q.375.1.6.425t.225.725q0 .4-.275.663t-.625.187q-3.5-.7-5.775-3.437t-2.275-6.388q0-3.65 2.288-6.387T10.1 2.15q.35-.075.625.188T11 3q0 .4-.225.725t-.6.425q-2.7.65-4.425 2.825t-1.725 5Zm8.95 1.15l1.85-1.85q.3-.3.725-.3t.725.3q.3.3.288.725t-.313.725L12.675 16.3q-.3.3-.7.3t-.7-.3L7.65 12.65q-.3-.3-.288-.713t.313-.712q.3-.3.713-.3t.712.3l1.875 1.9V8q0-.425.288-.713T11.975 7q.425 0 .713.288t.287.712v5.125Zm3.05 5.75q.375-.225.813-.2t.762.35q.3.3.25.713t-.4.637q-.8.5-1.675.863t-1.8.562q-.4.075-.7-.175t-.3-.675q0-.425.263-.75t.687-.45q.55-.15 1.075-.375t1.025-.5ZM13.975 4.2q-.425-.125-.7-.45T13 3q0-.425.288-.675t.687-.175q.95.2 1.838.562T17.5 3.6q.35.225.375.625t-.25.7q-.3.325-.738.35t-.812-.2q-.5-.275-1.025-.5T13.975 4.2Zm5.75 9.75q.125-.425.463-.7t.762-.275q.425 0 .688.325t.162.725q-.2.95-.575 1.812t-.9 1.663q-.225.35-.625.35t-.675-.275q-.3-.3-.337-.725t.187-.8q.275-.5.488-1.012t.362-1.088Zm-.85-6.075q-.225-.375-.188-.788t.338-.712q.275-.275.675-.263t.625.338q.55.8.925 1.688t.575 1.837q.075.4-.187.7t-.688.3q-.425 0-.762-.287t-.463-.713q-.15-.55-.363-1.075t-.487-1.025Z"},null,-1),c1=[r1],d1={key:1,xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 24 24"},u1=z('<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="2 4" stroke-dashoffset="6" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21"><animate attributeName="stroke-dashoffset" dur="0.6s" repeatCount="indefinite" values="6;0"></animate></path><path stroke-dasharray="30" stroke-dashoffset="30" d="M12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.1s" dur="0.3s" values="30;0"></animate></path><path stroke-dasharray="10" stroke-dashoffset="10" d="M12 8v7.5"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.5s" dur="0.2s" values="10;0"></animate></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 15.5l3.5 -3.5M12 15.5l-3.5 -3.5"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.7s" dur="0.2s" values="6;0"></animate></path></g>',1),h1=[u1],p1={key:0,class:"mr-auto text-sm text-[#00a5f4] flex flex-col relative max-w-[25em]"},m1={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},v1=e("path",{fill:"currentColor",d:"M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"},null,-1),f1=[v1],g1={key:1,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},y1=e("g",{fill:"none"},[e("path",{fill:"currentColor",d:"M20 16v4c-2.758 0-5.07-.495-7-1.325c-3.841-1.652-6.176-4.63-7.5-7.675C4.4 8.472 4 5.898 4 4h4l1 4l-3.5 3c1.324 3.045 3.659 6.023 7.5 7.675L16 15l4 1z"}),e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 18.675c1.93.83 4.242 1.325 7 1.325v-4l-4-1l-3 3.675zm0 0C9.159 17.023 6.824 14.045 5.5 11m0 0C4.4 8.472 4 5.898 4 4h4l1 4l-3.5 3z"})],-1),w1=[y1],x1=["src"],_1=["src"],b1={key:5},k1={key:6},C1=["src"],$1={key:1,class:"text-slate-500 flex justify-center items-center space-x-4"},M1=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("g",{fill:"none"},[e("path",{d:"M24 0v24H0V0h24ZM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018Zm.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022Zm-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01l-.184-.092Z"}),e("path",{fill:"currentColor",d:"m13.299 3.148l8.634 14.954a1.5 1.5 0 0 1-1.299 2.25H3.366a1.5 1.5 0 0 1-1.299-2.25l8.634-14.954c.577-1 2.02-1 2.598 0ZM12 4.898L4.232 18.352h15.536L12 4.898ZM12 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2Zm0-7a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1Z"})])],-1),S1={key:7},O1={class:"flex space-x-3 w-[300px] items-center"},T1=e("div",{class:"rounded-full p-3 bg-slate-200"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 512 512"},[e("path",{fill:"currentColor",d:"M332.64 64.58C313.18 43.57 286 32 256 32c-30.16 0-57.43 11.5-76.8 32.38c-19.58 21.11-29.12 49.8-26.88 80.78C156.76 206.28 203.27 256 256 256s99.16-49.71 103.67-110.82c2.27-30.7-7.33-59.33-27.03-80.6ZM432 480H80a31 31 0 0 1-24.2-11.13c-6.5-7.77-9.12-18.38-7.18-29.11C57.06 392.94 83.4 353.61 124.8 326c36.78-24.51 83.37-38 131.2-38s94.42 13.5 131.2 38c41.4 27.6 67.74 66.93 76.18 113.75c1.94 10.73-.68 21.34-7.18 29.11A31 31 0 0 1 432 480Z"})])],-1),Z1={key:8},L1={key:0,controls:""},V1=["src"],N1={key:1,class:"text-slate-500 flex justify-center items-center space-x-4"},I1=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("g",{fill:"none"},[e("path",{d:"M24 0v24H0V0h24ZM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018Zm.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022Zm-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01l-.184-.092Z"}),e("path",{fill:"currentColor",d:"m13.299 3.148l8.634 14.954a1.5 1.5 0 0 1-1.299 2.25H3.366a1.5 1.5 0 0 1-1.299-2.25l8.634-14.954c.577-1 2.02-1 2.598 0ZM12 4.898L4.232 18.352h15.536L12 4.898ZM12 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2Zm0-7a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1Z"})])],-1),q1={key:9},B1={key:0,controls:"",width:"300",class:"max-h-[350px]"},E1=["src"],j1={key:1,class:"text-slate-500 flex justify-center items-center space-x-4"},H1=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e("g",{fill:"none"},[e("path",{d:"M24 0v24H0V0h24ZM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018Zm.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022Zm-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01l-.184-.092Z"}),e("path",{fill:"currentColor",d:"m13.299 3.148l8.634 14.954a1.5 1.5 0 0 1-1.299 2.25H3.366a1.5 1.5 0 0 1-1.299-2.25l8.634-14.954c.577-1 2.02-1 2.598 0ZM12 4.898L4.232 18.352h15.536L12 4.898ZM12 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2Zm0-7a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1Z"})])],-1),P1={key:2,class:"max-w-[300px]"},A1={key:3,class:"mr-auto text-sm text-[#00a5f4] flex flex-col relative max-w-[25em]"},z1={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},D1=e("path",{fill:"currentColor",d:"M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1Z"},null,-1),R1=[D1],U1={key:1,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24"},F1=e("g",{fill:"none"},[e("path",{fill:"currentColor",d:"M20 16v4c-2.758 0-5.07-.495-7-1.325c-3.841-1.652-6.176-4.63-7.5-7.675C4.4 8.472 4 5.898 4 4h4l1 4l-3.5 3c1.324 3.045 3.659 6.023 7.5 7.675L16 15l4 1z"}),e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 18.675c1.93.83 4.242 1.325 7 1.325v-4l-4-1l-3 3.675zm0 0C9.159 17.023 6.824 14.045 5.5 11m0 0C4.4 8.472 4 5.898 4 4h4l1 4l-3.5 3z"})],-1),J1=[F1],G1=["src"],K1=["src"],X1={class:"flex items-center justify-between mt-2 space-x-4"},Y1={key:0,class:"text-gray-500 text-xs text-right leading-none"},W1={class:"text-gray-500 text-xs text-right leading-none"},Q1={key:10,class:"cursor-pointer text-center border-t mt-2 pt-2"},en={__name:"ChatBubble",props:{content:Object,type:String},setup(t){const a=t,s=b(!1),r=()=>{s.value=!0,setTimeout(()=>{s.value=!1},2e3)},o=x=>({"text/plain":"TXT","application/pdf":"PDF","application/powerpoint":"PPT","application/vnd.ms-powerpoint":"PPT","application/msword":"DOC","application/vnd.ms-excel":"XLS","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PPTX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"})[x]||"Unknown",i=x=>{if(x===0)return"0 Bytes";const y=1024,v=["Bytes","KB","MB","GB","TB"],g=parseInt(Math.floor(Math.log(x)/Math.log(y)));return Math.round(x/Math.pow(y,g)*100)/100+" "+v[g]},c=x=>{const y=JSON.parse(x).contacts;if(y.length===1){const v=y[0];return v.name.formatted_name||`${v.name.first_name} ${v.name.last_name}`}else if(y.length>1){const v=y[0].name.first_name,g=y.length-1;return`${v} and ${g} other contacts`}else return"No contacts available"},w=x=>{const y=JSON.parse(x);return{lat:y.location.latitude,lng:y.location.longitude}},C=x=>{const v=te(()=>lt().props.config).value.find(g=>g.key===x);return v?v.value:""};return(x,y)=>{var v,g,h,u,p,_,m,S,N,I,j,$,q,H,D,O,k,M,re,ce,de,ue,he,pe,me,ve,fe,ge,ye,we,xe,_e,be,ke,Ce,$e,Me,Se,Oe,Te,Ze,Le,Ve,Ne,Ie,qe,Be,Ee,je,He,Pe,Ae,ze,De,Re,Ue,Fe,Je,Ge,Ke,Xe,Ye;return n(),l("div",{class:B(["rounded-lg my-1 p-2 text-sm flex flex-col relative",a.type==="outbound"?"ml-auto rounded-tr-none bg-[#d8fad4] speech-bubble-right":"mr-auto rounded-tl-none bg-white speech-bubble-left"])},[e("div",null,[JSON.parse(t.content.metadata).type==="text"?(n(),l("div",po,[e("p",mo,d(JSON.parse(t.content.metadata).text.body),1),(v=JSON.parse(t.content.metadata))!=null&&v.buttons?(n(),l("div",vo,[(n(!0),l(A,null,J((g=JSON.parse(t.content.metadata))==null?void 0:g.buttons,(Z,R)=>(n(),l("div",{key:R,class:"flex justify-center items-center space-x-2 rounded-lg bg-white h-10 my-[0.1em]"},[e("span",null,[Z.type==="COPY_CODE"?(n(),l("svg",fo,yo)):Z.type==="PHONE_NUMBER"?(n(),l("svg",wo,_o)):Z.type==="URL"?(n(),l("img",{key:2,src:"/images/icons/link.png",class:"h-4"},null,8,bo)):(n(),l("img",{key:3,src:"/images/icons/reply.png",class:"h-4"},null,8,ko))]),e("span",null,d(Z.text),1)]))),128))])):f("",!0)])):f("",!0),JSON.parse(t.content.metadata).type==="button"?(n(),l("div",Co,[e("p",$o,d(JSON.parse(t.content.metadata).button.text),1)])):f("",!0),JSON.parse(t.content.metadata).type==="interactive"?(n(),l("div",Mo,[e("p",So,d(JSON.parse(t.content.metadata).interactive.button_reply.title),1)])):JSON.parse(t.content.metadata).type==="image"?(n(),l("div",Oo,[t.content.media!=null?(n(),l("img",{key:0,src:((u=(h=t.content)==null?void 0:h.media)==null?void 0:u.location)=="local"?"/media/"+((_=(p=t.content)==null?void 0:p.media)==null?void 0:_.path):(S=(m=t.content)==null?void 0:m.media)==null?void 0:S.path,alt:"Image",class:"mb-2 max-w-[300px]"},null,8,To)):(n(),l("div",Zo,[Lo,E(" "+d(x.$t("Content not available")),1)])),(N=JSON.parse(t.content.metadata).image)!=null&&N.caption?(n(),l("div",Vo,d((I=JSON.parse(t.content.metadata).image)==null?void 0:I.caption),1)):f("",!0),(j=JSON.parse(t.content.metadata))!=null&&j.buttons?(n(),l("div",No,[(n(!0),l(A,null,J(($=JSON.parse(t.content.metadata))==null?void 0:$.buttons,(Z,R)=>(n(),l("div",{key:R,class:"flex justify-center items-center space-x-2 rounded-lg bg-white h-10 my-[0.1em]"},[e("span",null,[Z.type==="COPY_CODE"?(n(),l("svg",Io,Bo)):Z.type==="PHONE_NUMBER"?(n(),l("svg",Eo,Ho)):Z.type==="URL"?(n(),l("img",{key:2,src:"/images/icons/link.png",class:"h-4"},null,8,Po)):(n(),l("img",{key:3,src:"/images/icons/reply.png",class:"h-4"},null,8,Ao))]),e("span",null,d(Z.text),1)]))),128))])):f("",!0)])):JSON.parse(t.content.metadata).type==="document"?(n(),l("div",zo,[e("div",Do,[e("div",Ro,[e("div",null,[o((H=(q=t.content)==null?void 0:q.media)==null?void 0:H.type)==="PDF"?(n(),l("svg",Uo,Jo)):f("",!0),o((O=(D=t.content)==null?void 0:D.media)==null?void 0:O.type)==="XLSX"||o((M=(k=t.content)==null?void 0:k.media)==null?void 0:M.type)==="XLS"?(n(),l("svg",Go,Xo)):f("",!0),o((ce=(re=t.content)==null?void 0:re.media)==null?void 0:ce.type)==="DOC"||o((ue=(de=t.content)==null?void 0:de.media)==null?void 0:ue.type)==="DOCX"?(n(),l("svg",Yo,Qo)):f("",!0),o((pe=(he=t.content)==null?void 0:he.media)==null?void 0:pe.type)==="PPT"||o((ve=(me=t.content)==null?void 0:me.media)==null?void 0:ve.type)==="PPTX"?(n(),l("svg",e1,s1)):f("",!0)]),e("div",null,[e("div",null,[e("p",a1,d((ge=(fe=t.content)==null?void 0:fe.media)==null?void 0:ge.name),1)]),e("div",o1,[e("span",null,d(o((we=(ye=t.content)==null?void 0:ye.media)==null?void 0:we.type)),1),n1,e("span",null,d(i((_e=(xe=t.content)==null?void 0:xe.media)==null?void 0:_e.size)),1)])]),e("a",{href:"/media/"+((ke=(be=t.content)==null?void 0:be.media)==null?void 0:ke.path),download:($e=(Ce=t.content)==null?void 0:Ce.media)==null?void 0:$e.name,onClick:r,class:"flex justify-end w-full"},[s.value?(n(),l("svg",d1,h1)):(n(),l("svg",i1,c1))],8,l1)])]),(Me=JSON.parse(t.content.metadata))!=null&&Me.buttons?(n(),l("div",p1,[(n(!0),l(A,null,J((Se=JSON.parse(t.content.metadata))==null?void 0:Se.buttons,(Z,R)=>(n(),l("div",{key:R,class:"flex justify-center items-center space-x-2 rounded-lg bg-white h-10 my-[0.1em]"},[e("span",null,[Z.type==="COPY_CODE"?(n(),l("svg",m1,f1)):Z.type==="PHONE_NUMBER"?(n(),l("svg",g1,w1)):Z.type==="URL"?(n(),l("img",{key:2,src:"/images/icons/link.png",class:"h-4"},null,8,x1)):(n(),l("img",{key:3,src:"/images/icons/reply.png",class:"h-4"},null,8,_1))]),e("span",null,d(Z.text),1)]))),128))])):f("",!0)])):JSON.parse(t.content.metadata).type==="location"?(n(),l("div",b1,[L(T(oo),{"api-key":C("google_maps_api_key"),style:{width:"300px",height:"200px"},center:w(t.content.metadata),zoom:15},{default:V(()=>[L(T(ho),{options:{position:w(t.content.metadata)}},null,8,["options"])]),_:1},8,["api-key","center"])])):JSON.parse(t.content.metadata).type==="sticker"?(n(),l("div",k1,[t.content.media!=null?(n(),l("img",{key:0,src:((Te=(Oe=t.content)==null?void 0:Oe.media)==null?void 0:Te.location)=="local"?"/media/"+((Le=(Ze=t.content)==null?void 0:Ze.media)==null?void 0:Le.path):(Ne=(Ve=t.content)==null?void 0:Ve.media)==null?void 0:Ne.path,alt:"Image",class:"mb-2 max-w-[100px]"},null,8,C1)):(n(),l("div",$1,[M1,E(" "+d(x.$t("Content not available")),1)]))])):JSON.parse(t.content.metadata).type==="contacts"?(n(),l("div",S1,[e("div",O1,[T1,e("div",null,d(c(t.content.metadata)),1)])])):JSON.parse(t.content.metadata).type==="audio"?(n(),l("div",Z1,[t.content.media!=null?(n(),l("audio",L1,[e("source",{src:((qe=(Ie=t.content)==null?void 0:Ie.media)==null?void 0:qe.location)=="local"?"/media/"+((Ee=(Be=t.content)==null?void 0:Be.media)==null?void 0:Ee.path):(He=(je=t.content)==null?void 0:je.media)==null?void 0:He.path},null,8,V1),E(" "+d(x.$t("Your browser does not support the audio element")),1)])):(n(),l("div",N1,[I1,E(" "+d(x.$t("Content not available")),1)]))])):JSON.parse(t.content.metadata).type==="video"?(n(),l("div",q1,[t.content.media!=null?(n(),l("video",B1,[e("source",{src:((Ae=(Pe=t.content)==null?void 0:Pe.media)==null?void 0:Ae.location)=="local"?"/media/"+((De=(ze=t.content)==null?void 0:ze.media)==null?void 0:De.path):(Ue=(Re=t.content)==null?void 0:Re.media)==null?void 0:Ue.path,type:"video/mp4"},null,8,E1),E(" "+d(x.$t("Your browser does not support the video element")),1)])):(n(),l("div",j1,[H1,E(" "+d(x.$t("Content not available")),1)])),(Fe=JSON.parse(t.content.metadata).video)!=null&&Fe.caption?(n(),l("div",P1,d((Je=JSON.parse(t.content.metadata).video)==null?void 0:Je.caption),1)):f("",!0),(Ge=JSON.parse(t.content.metadata))!=null&&Ge.buttons?(n(),l("div",A1,[(n(!0),l(A,null,J((Ke=JSON.parse(t.content.metadata))==null?void 0:Ke.buttons,(Z,R)=>(n(),l("div",{key:R,class:"flex justify-center items-center space-x-2 rounded-lg bg-white h-10 my-[0.1em]"},[e("span",null,[Z.type==="COPY_CODE"?(n(),l("svg",z1,R1)):Z.type==="PHONE_NUMBER"?(n(),l("svg",U1,J1)):Z.type==="URL"?(n(),l("img",{key:2,src:"/images/icons/link.png",class:"h-4"},null,8,G1)):(n(),l("img",{key:3,src:"/images/icons/reply.png",class:"h-4"},null,8,K1))]),e("span",null,d(Z.text),1)]))),128))])):f("",!0)])):f("",!0),e("div",X1,[a.type==="outbound"&&t.content.user?(n(),l("span",Y1,"Sent By: "+d(((Xe=t.content.user)==null?void 0:Xe.first_name)+" "+((Ye=t.content.user)==null?void 0:Ye.last_name)),1)):f("",!0),e("p",W1,d(t.content.created_at),1)]),JSON.parse(t.content.metadata).type==="contacts"?(n(),l("div",Q1,d(x.$t("View")),1)):f("",!0)])],2)}}},tn={key:0,class:"py-4 md:py-4 relative px-6 md:px-10"},sn={key:1,class:"py-2"},an={class:"text-center font-light text-sm border-b border-t py-2 border-dashed border-black"},on={class:"text-xs"},nn={key:2,class:"py-2 bg-orange-100 my-2 rounded-lg p-2 w-[fit-content] ml-auto"},ln={class:"text-right font-light text-sm"},rn={class:"flex items-center justify-between mt-2 space-x-4"},cn={class:"text-gray-500 text-xs text-right leading-none"},dn={__name:"ChatThread",props:{rows:{type:Object,required:!0}},setup(t){return(a,s)=>t.rows.length>0?(n(),l("div",tn,[(n(!0),l(A,null,J(t.rows,(r,o)=>(n(),l("div",{class:B(["flex flex-grow flex-col",r[0].type==="ticket"?"justify-center":"justify-end"])},[r[0].type==="chat"?(n(),P(en,{key:o,content:r[0].value,type:r[0].value.type},null,8,["content","type"])):f("",!0),r[0].type==="ticket"?(n(),l("div",sn,[e("div",an,[e("div",null,d(r[0].value.description),1),e("div",on,d(r[0].value.created_at),1)])])):f("",!0),r[0].type==="notes"?(n(),l("div",nn,[e("div",ln,[e("div",null,d(r[0].value.content),1),e("div",rn,[e("p",cn,d(r[0].value.created_at),1)])])])):f("",!0)],2))),256))])):f("",!0)}},un={class:"md:flex md:flex-grow md:overflow-hidden"},hn={key:2,class:"w-full py-4"},pn=["onClick"],Hn={__name:"Index",props:["rows","rowCount","pusherSettings","organizationId","isChatLimitReached","toggleNavBar","state","demoNumber","settings","status","chatThread","addon","contact","ticket","chat_sort_direction","filters"],setup(t){var I,j;const a=t,s=b(a.rows);b(a.rowCount),b(null);const r=b(null),o=b(!1),i=b(!1),c=b(!1),w=b(a.isChatLimitReached),C=b(null);b(!1);const x=b(a.settings.metadata),y=b(x.value?JSON.parse(x.value):null),v=b(((j=(I=y.value)==null?void 0:I.tickets)==null?void 0:j.active)??!1),g=b(a.chatThread),h=b(a.contact);Y(()=>a.rows,$=>{s.value=$});function u($){i.value=$}const p=()=>{const $=r.value;$&&$.scrollTo({top:$.scrollHeight,behavior:"smooth"})},_=()=>{C.value.click(),h.value=null},m=()=>{g.value=[],ne.delete("/chats/"+h.value.uuid)},S=$=>{const q=$[0].value.wam_id;!g.value.some(D=>D[0].value.wam_id===q)&&$[0].value.deleted_at==null&&(g.value.push($),setTimeout(p,100))},N=async $=>{h.value&&h.value.id==$[0].value.contact_id&&S($);const q=await ne.get("/chats");q&&(s.value=q.data.result)};return se(()=>{mt(a.pusherSettings.pusher_app_key,a.pusherSettings.pusher_app_cluster).channel("chats.ch"+a.organizationId).listen("NewChatEvent",q=>{N(q.chat)}),p()}),($,q)=>(n(),P(vt,null,{default:V(H=>[e("div",un,[e("div",{class:B(["md:w-[30%] md:flex flex-col h-full bg-white border-r border-l",h.value?"hidden":""])},[L(Ua,{rows:s.value,filters:a.filters,rowCount:a.rowCount,ticketingIsEnabled:v.value,status:a==null?void 0:a.status,chatSortDirection:a.chat_sort_direction},null,8,["rows","filters","rowCount","ticketingIsEnabled","status","chatSortDirection"])],2),e("div",{class:B(["min-w-0 bg-cover flex flex-col chat-bg",h.value?"h-screen md:w-[70%]":"md:h-screen md:w-[70%]"])},[h.value?(n(),P($s,{key:0,ticketingIsEnabled:v.value,contact:h.value,displayContactInfo:i.value,ticket:t.ticket,addon:t.addon,onToggleView:u,onDeleteThread:m,onCloseThread:_},null,8,["ticketingIsEnabled","contact","displayContactInfo","ticket","addon"])):f("",!0),h.value?(n(),l("div",{key:1,class:"flex-1 overflow-y-auto",ref_key:"scrollContainer2",ref:r},[!i.value&&!o.value?(n(),P(dn,{key:0,rows:g.value},null,8,["rows"])):f("",!0),i.value?(n(),P(Tt,{key:1,class:"bg-white h-full",contact:h.value},null,8,["contact"])):f("",!0)],512)):f("",!0),h.value&&!i.value&&!c.value?(n(),l("div",hn,[L(ss,{contact:h.value,chatLimitReached:w.value,onResponse:S},null,8,["contact","chatLimitReached"])])):f("",!0)],2)]),e("button",{class:"hidden",ref_key:"toggleNavbarBtn",ref:C,onClick:H.toggleNavBar},null,8,pn)]),_:1}))}};export{Hn as default};