PageSourceSearch

https://app.aeroidx.com/build/assets/Index-0vwim12q.js

js aeroidx.com collected 2026-10-07 02:48:42 UTC 71,058 bytes, 3 lines download raw bytes

1import{A as De}from"./AuthenticatedLayout-BJfSs0SQ.js";import{_ as Pe,r as Re,a as ue,h as He,u as je}from"./app-CIT4hbzU.js";import{k as t,l as o,n as e,d as Ne,u as Ae,q as B,g as O,_ as ve,e as M,o as pe,w as Le,j as he,y as E,B as R,F as V,t as F,v as D,D as _e,H as Ce,J as K,Y as be,z as ie,A as oe,U as we,T as Te,I as Y,C as p,p as ke,N as Be,Z as Ve,a as ae,S as Oe}from"./_plugin-vue_export-helper-D-DLBFXG.js";import{r as ze,u as qe}from"./useMessageFormatter-D8l4_cTn.js";import{r as Ue}from"./MagnifyingGlassIcon-BKvPNg_F.js";import{r as Ge}from"./HomeIcon-DmyPztzM.js";import{_ as Ke}from"./Modal-CFNr_Hq7.js";import{_ as Fe}from"./AiApiKeyModal-DL0GVc6o.js";import{_ as We}from"./Settings-DdWWHAM1.js";import{u as Ze}from"./useAIProvider-BeFPmoEa.js";import"./ToastMessage-DSYX9ovi.js";/* empty css                                                     */import"./useTheme-CQu7LMDX.js";import"./useJennaRestrictedSettingsNav-BIi3IGix.js";import"./index-P0QL1Peh.js";import"./index-Dh0--Pjx.js";/* empty css                                                                            */import"./marked.esm-DKjyhwJX.js";import"./PrimaryButton-BpP44si3.js";function Ye(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"})])}function Xe(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})])}function Qe(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0Z"})])}function Je(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})])}function $e(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.
1125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function et(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.362 5.214A8.252 8.252 0 0 1 12 21 8.25 8.25 0 0 1 6.038 7.047 8.287 8.287 0 0 0 9 9.601a8.983 8.983 0 0 1 3.361-6.867 8.21 8.21 0 0 0 3 2.48Z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 18a3.75 3.75 0 0 0 .495-7.468 5.99 5.99 0 0 0-1.925 3.547 5.975 5.975 0 0 1-2.133-1.001A3.75 3.75 0 0 0 12 18Z"})])}function tt(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})])}function at(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})])}function ot(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})])}function rt(a,d){return t(),o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"})])}const le=50,Me=30,nt=100,st=.008,lt=1,it=.015,dt=4,ct=.004,ut=1.2,vt=.008,pt=1.5,ht=.004,gt=.05,ft=.008,mt=.1,yt=.004,xt=.5,kt=.008,bt=2,wt="0%",_t="5%",Ct="15%",$t="25%",Mt=1.1,St=1.2,It=1.3,At=Ne({__name:"SiriOrb",props:{size:{default:"192px"},class:{},colors:{},animationDuration:{default:20}},setup(a){const d=a,g={bg:"oklch(95% 0.02 264.695)",c1:"oklch(75% 0.15 350)",c2:"oklch(80% 0.12 200)",c3:"oklch(78% 0.14 280)"},v=O(()=>({...g,...d.colors})),i=O(()=>Number.parseInt(d.size.replace("px",""),10)),f=O(()=>i.value<le?Math.max(i.value*st,lt):Math.max(i.value*it,dt)),I=O(()=>i.value<le?Math.max(i.value*ct,ut):Math.max(i.value*vt,pt)),c=O(()=>i.value<le?Math.max(i.value*ht,gt):Math.max(i.value*ft,mt)),A=O(()=>i.value<le?Math.max(i.value*yt,xt):Math.max(i.value*kt,bt)),w=O(()=>{const C=i.value;return C<Me?wt:C<le?_t:C<nt?Ct:$t}),m=O(()=>{const C=i.value;return C<Me?Mt:C<le?Math.max(I.value*St,It):I.value}),T=O(()=>({width:d.size,height:d.size,"--bg":v.value.bg,"--c1":v.value.c1,"--c2":v.value.c2,"--c3":v.value.c3,"--animation-duration":`${d.animationDuration}s`,"--blur-amount":`${f.value}px`,"--contrast-amount":m.value,"--dot-size":`${c.value}px`,"--shadow-spread":`${A.value}px`,"--mask-radius":w.value}));return(C,H)=>(t(),o("div",{class:B(["siri-orb",d.class]),style:Ae(T.value)},null,6))}}),Lt=ve(At,[["__scopeId","data-v-bcb778a7"]]),Tt={key:0,class:"text-[11px] font-bold tracking-widest uppercase text-gray-400 dark:text-gray-500 pl-2"},Et={class:"flex items-center gap-1"},Dt=["title"],Pt={key:0,class:"px-3 pb-3"},Rt={class:"relative group"},Ht={key:1,class:"flex justify-center py-3"},jt={class:"flex-1 overflow-y-auto ai-sidebar-scroll px-2 pt-2 space-y-4 pb-10"},Nt={key:0,class:"flex items-center justify-center py-10 text-gray-400"},Bt={key:1},Vt={key:0,class:"flex justify-center py-4"},Ot={key:1,class:"text-center py-10 px-4"},zt={key:0,class:"px-2 pt-2 pb-1 text-xs font-bold tracking-widest uppercase text-gray-400 dark:text-gray-600"},qt=["onClick","onMouseenter"],Ut=["onKeydown","onBlur"],Gt={class:"flex-1 text-[12.5px] font-medium truncate text-left leading-tight"},Kt=["onClick"],Ft=["onClick"],Wt={key:3,class:"text-center py-10 px-4"},Zt={class:"text-[11px] font-medium text-gray-400 dark:text-gray-600"},Yt={class:"border-t border-gray-200 dark:border-[hsla(220,20%,35%,.2)] px-2 py-2 flex-shrink-0"},Xt=["title"],Qt={key:0,class:"text-[12.5px] font-medium"},Jt={class:"text-[13px] font-semibold text-gray-900 dark:text-white leading-snug line-clamp-2 mb-2"},ea={class:"flex items-center justify-between pt-2 border-t border-gray-100 dark:border-[hsla(220,20%,40%,.2)]"},ta={class:"text-xs font-bold text-gray-400 dark:text-gray-500"},Se="ai-coach-sidebar-collapsed",aa={__name:"Sidebar",props:{conversations:{type:Array,default:()=>[]},currentId:{type:[String,Number,null],default:null},loading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},showingSettings:{type:Boolean,default:!1},initialCollapsed:{type:Boolean,default:!1}},emits:["select","delete","new","rename","settings"],setup(a,{emit:d}){const g=a,v=d,i=M(g.initialCollapsed),f=M("");pe(()=>{const r=localStorage.getItem(Se);r!==null&&(i.value=r==="true")}),Le(i,r=>{localStorage.setItem(Se,String(r))});const I=()=>{i.value=!i.value,i.value&&(f.value="")},c=M(null),A=M(""),w=M(null),m=(r,n)=>
1{n.stopPropagation(),c.value=r.id,A.value=r.title,Y(()=>{var h;(h=w.value)==null||h.select()})},T=r=>{A.value.trim()&&v("rename",r,A.value.trim()),c.value=null},C=()=>{c.value=null},H=M(null),j=M({top:0,left:0}),$=M(!1);let x=null;const s=O(()=>g.conversations.find(r=>r.id===H.value)??null),_=(r,n)=>{if(!i.value)return;clearTimeout(x),H.value=n;const h=r.currentTarget.getBoundingClientRect();j.value={top:h.top+h.height/2,left:h.right+8}},S=()=>{x=setTimeout(()=>{$.value||(H.value=null)},80)},L=()=>{clearTimeout(x),$.value=!0},y=()=>{$.value=!1,H.value=null};he(()=>clearTimeout(x));const u=O(()=>{const r=f.value.toLowerCase(),n=r?g.conversations.filter(z=>{var G;return(G=z.title)==null?void 0:G.toLowerCase().includes(r)}):g.conversations,h=new Date,P=new Date(h.getFullYear(),h.getMonth(),h.getDate()),N=new Date(P-864e5),X=new Date(P-7*864e5),W=[{label:"Today",items:[]},{label:"Yesterday",items:[]},{label:"This Week",items:[]},{label:"Earlier",items:[]}];return n.forEach(z=>{const G=new Date(z.updated_at);G>=P?W[0].items.push(z):G>=N?W[1].items.push(z):G>=X?W[2].items.push(z):W[3].items.push(z)}),W.filter(z=>z.items.length>0)});return(r,n)=>(t(),o(V,null,[e("div",{class:B(["flex flex-col h-full bg-gray-50 dark:bg-[#13151a] transition-all duration-300 relative border-r border-gray-200 dark:border-[hsla(220,20%,35%,.2)]",[i.value?"w-14":"w-64"]])},[e("div",{class:B(["px-3 py-3 flex items-center",i.value?"justify-center":"justify-between"])},[i.value?E("",!0):(t(),o("span",Tt,"Chats")),e("div",Et,[i.value?E("",!0):(t(),o("button",{key:0,onClick:n[0]||(n[0]=h=>r.$emit("new")),class:"btn-primary flex items-center justify-center w-7 h-7 rounded-full text-white transition-all active:scale-95",title:"New chat"},[...n[8]||(n[8]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2.5"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})],-1)])])),e("button",{onClick:I,class:"p-1.5 rounded-lg text-gray-400 hover:text-gray-700 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-white/5 transition-colors",title:i.value?"Expand":"Collapse"},[(t(),o("svg",{class:B(["w-4 h-4 transition-transform duration-300",{"rotate-180":i.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[9]||(n[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 19l-7-7 7-7"},null,-1)])],2))],8,Dt)])],2),i.value?(t(),o("div",Ht,[e("button",{onClick:n[2]||(n[2]=h=>r.$emit("new")),class:"btn-primary flex items-center justify-center w-7 h-7 rounded-full text-white transition-all active:scale-95",title:"New chat"},[...n[11]||(n[11]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2.5"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})],-1)])])])):(t(),o("div",Pt,[e("div",Rt,[n[10]||(n[10]=e("svg",{class:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400 group-focus-within:text-purple-500 transition-colors pointer-events-none z-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),R(Pe,{modelValue:f.value,"onUpdate:modelValue":n[1]||(n[1]=h=>f.value=h),type:"text",placeholder:"Search...",class:"w-full !pl-8 !pr-3 !py-1.5 !text-[12px] !h-8 !bg-[#EEEEEE] focus:!bg-[#F6F6F6] dark:!bg-gray-500/60 !border-none focus:!ring-1 focus:!ring-violet-500/40 !text-gray-900 dark:!text-white !placeholder-gray-500 dark:!placeholder-gray-400 transition-all !font-medium !rounded-lg selection:bg-violet-500/20"},null,8,["modelValue"])])])),n[18]||(n[18]=e("div",{class:"mx-3 border-t border-gray-200 dark:border-[hsla(220,20%,35%,.2)]"},null,-1)),e("div",jt,[a.loading&&a.conversations.length===0?(t(),o("div",Nt,[...n[12]||(n[12]=[e("div",{class:"w-4 h-4 border-2 border-purple-500/20 border-t-purple-500 rounded-full animate-spin"},null,-1)])])):a.error&&a.conversations.length===0?(t(),o("div",Bt,[i.value?(t(),o("div",Vt,[...n[13]||(n[13]=[e("div",{class:"w-1.5 h-1.5 rounded-full bg-red-400"},null,-1)])])):(t(),o("div",Ot,[...n[14]||(n[14]=[e("p",{class:"text-[11px] font-medium text-red-400 dark:text-red-500"},"Could not load history",-1)])]))])):u.value.length>0?(t(!0),o(V,{key:2},F(u.value,h=>(t(),o("div",{key:h.label,class:"space-y-0.5"},[i.value?E("",!0):(t(),o("div",zt,D(h.label),1)),(t(!0),o(V,null,F(h.items,P=>(t(),o("button",{key:P.id,onClick:N=>r.$emit("select",P.id),onMouseenter:N=>_(N,P.id),onMouseleave:n[5]||(n[5]=N=>S()),class:B(["w-full relative group flex items-center gap-2 px-2 py-2 rounded-lg transition-colors duration-150",[String(a.currentId)===String(P.id)?"bg-gray-200/70 dark:bg-[hsla(220,20%,40%,.2)] text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-white/5 hover:text-gray-900 dark:hover:text-gray-200"]])},[i.value?(t(),o("div",{key:0,class:B(["w-1.5 h-1.5 rounded-full mx-auto flex-shrink-0",String(a.currentId)===String(P.id)?"bg-purple-500":"bg-gray-300 dark:bg-gray-700"])},null,2)):(t(),o(V,{key:1},[c.value===P.id?_e((t(),o("input",{key:0,ref_for:!0,ref_key:"editInputRef",ref:w,"onUpdate:modelValue":n[3]||(n[3]=N=>A.value=N),onKeydown:[be(K(N=>
1T(P.id),["prevent"]),["enter"]),be(K(C,["prevent"]),["escape"])],onBlur:N=>T(P.id),onClick:n[4]||(n[4]=K(()=>{},["stop"])),class:"flex-1 text-[12.5px] font-medium bg-transparent border-none outline-none focus:ring-1 focus:ring-violet-500/40 rounded px-1 text-gray-900 dark:text-white min-w-0"},null,40,Ut)),[[Ce,A.value]]):(t(),o(V,{key:1},[e("span",Gt,D(P.title),1),e("button",{onClick:K(N=>m(P,N),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 rounded text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 transition-all flex-shrink-0",title:"Rename"},[...n[15]||(n[15]=[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)])],8,Kt),e("button",{onClick:K(N=>r.$emit("delete",P.id),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 rounded text-gray-400 hover:text-red-500 transition-all flex-shrink-0",title:"Delete"},[...n[16]||(n[16]=[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Ft)],64))],64))],42,qt))),128))]))),128)):(t(),o("div",Wt,[e("p",Zt,D(i.value?"":"No history found"),1)]))]),e("div",Yt,[e("button",{onClick:n[6]||(n[6]=h=>r.$emit("settings")),class:B(["w-full flex items-center gap-2.5 px-2 py-2 rounded-lg transition-colors duration-150 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-white/5 hover:text-gray-900 dark:hover:text-gray-200",a.showingSettings?"bg-gray-200/70 dark:bg-[hsla(220,20%,40%,.2)] !text-gray-900 dark:!text-white":""]),title:i.value?"Settings":void 0},[(t(),o("svg",{class:B(["w-4 h-4 flex-shrink-0",i.value?"mx-auto":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"1.8"},[...n[17]||(n[17]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)),i.value?E("",!0):(t(),o("span",Qt,"Settings"))],10,Xt)])],2),(t(),ie(Te,{to:"body"},[R(we,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 translate-x-2 scale-95","enter-to-class":"opacity-100 translate-x-0 scale-100","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 translate-x-0 scale-100","leave-to-class":"opacity-0 translate-x-1 scale-95"},{default:oe(()=>[i.value&&H.value&&s.value?(t(),o("div",{key:0,style:Ae({position:"fixed",top:j.value.top+"px",left:j.value.left+"px",transform:"translateY(-50%)",zIndex:9999}),class:"bg-white dark:bg-[#1C1E23] border border-gray-200 dark:border-[hsla(220,20%,40%,.2)] rounded-xl shadow-lg px-4 py-3 min-w-[180px] max-w-[260px] pointer-events-auto select-none",onMouseenter:L,onMouseleave:y},[e("p",Jt,D(s.value.title),1),e("div",ea,[e("span",ta,D(s.value.message_count??0)+" messages ",1),e("button",{onClick:n[7]||(n[7]=K(h=>{r.$emit("delete",s.value.id),H.value=null},["stop"])),class:"text-xs font-bold text-gray-400 hover:text-red-500 transition-colors"}," Delete ")])],36)):E("",!0)]),_:1})]))],64))}},oa=ve(aa,[["__scopeId","data-v-4dcb34ad"]]),ra={analyze_hot_leads:[{label:"View Hot Leads",url:"/leads?sort_by=engagement_score&sort_direction=desc",icon:"fire"}],get_uncontacted_leads:[{label:"View Leads",url:"/leads",icon:"users"}],get_daily_leads:[{label:"Today's Leads",url:"/leads?filter=today",icon:"users"}],get_recent_leads:[{label:"Recently Active",url:"/leads?filter=recently_active",icon:"users"}],get_property_viewers:[{label:"Property Viewers",url:"/leads?sort_by=saved_properties_count&sort_direction=desc&min_saved_properties=1",icon:"eye"}],get_lead_performance:[{label:"Top Engaged Leads",url:"/leads?sort_by=engagement_score&sort_direction=desc",icon:"trending"},{label:"Open Dashboard",url:"/dashboard",icon:"home"}],get_property_savers:[{label:"Property Savers",url:"/leads?min_saved_properties=1&sort_by=saved_properties_count&sort_direction=desc",icon:"bookmark"}],compare_periods:[{label:"Open Dashboard",url:"/dashboard",icon:"home"}],get_today_summary:[{label:"Open Dashboard",url:"/dashboard",icon:"home"},{label:"Today's Leads",url:"/leads?filter=today",icon:"users"}],get_weekly_stats:[{label:"Open Dashboard",url:"/dashboard",icon:"home"},{label:"Recently Active",url:"/leads?filter=recently_active",icon:"trending"}],get_daily_suggestion:[{label:"Open Dashboard",url:"/dashboard",icon:"home"}],create_saved_search:[{label:"Edit Search",url:a=>a!=null&&a.saved_search_id?`/markets/${a.saved_search_id}/edit`:null,icon:"search"},{label:"View Lead",url:a=>a!=null&&a.lead_id?`/leads/${a.lead_id}`:null,icon:"users"}
1,{label:"View Markets",url:"/markets",icon:"search"},{label:"View Leads",url:"/leads",icon:"users"}],get_saved_searches:[{label:"View Markets",url:"/markets",icon:"search"}],get_leads_with_saved_searches:[{label:"Search-Active Leads",url:"/leads?min_saved_searches=1&sort_by=saved_searches_count&sort_direction=desc",icon:"users"},{label:"View Markets",url:"/markets",icon:"search"}],ghl_get_recent_contacts:[{label:"Recently Active",url:"/leads?filter=recently_active",icon:"users"},{label:"GHL Integration",url:"/integrations",icon:"link"}],ghl_get_hot_leads:[{label:"Hot Leads",url:"/leads?sort_by=engagement_score&sort_direction=desc",icon:"fire"},{label:"GHL Integration",url:"/integrations",icon:"link"}],ghl_get_contacts_by_tag:[{label:"View Leads",url:"/leads",icon:"users"},{label:"GHL Integration",url:"/integrations",icon:"link"}],ghl_add_tag_to_contact:[{label:"View Leads",url:"/leads",icon:"users"}],ghl_remove_tag_from_contacts:[{label:"View Leads",url:"/leads",icon:"users"}],ghl_get_contact_notes:[{label:"View Leads",url:"/leads",icon:"users"}],ghl_create_contact_note:[{label:"View Leads",url:"/leads",icon:"users"}],ghl_get_opportunities:[{label:"GHL Pipeline",url:"/integrations",icon:"link"}],ghl_get_important_opportunities:[{label:"GHL Pipeline",url:"/integrations",icon:"link"},{label:"Hot Leads",url:"/leads?sort_by=engagement_score&sort_direction=desc",icon:"fire"}],ghl_create_opportunity:[{label:"GHL Pipeline",url:"/integrations",icon:"link"},{label:"View Leads",url:"/leads",icon:"users"}],ghl_get_appointments:[{label:"GHL Calendar",url:"/integrations",icon:"calendar"}],ghl_create_appointment:[{label:"GHL Calendar",url:"/integrations",icon:"calendar"},{label:"View Leads",url:"/leads",icon:"users"}],ghl_get_tasks:[{label:"GHL Tasks",url:"/integrations",icon:"check"}],ghl_get_connection_status:[{label:"Manage Integrations",url:"/integrations",icon:"link"}],generate_aeroidx_integration_prompt:[{label:"Website Setup",url:"/website/setup",icon:"cog"},{label:"MLS Setup",url:"/website/mls",icon:"cog"}]};function Ie(a=[],d={}){const g=new Set,v=[];for(const i of a){const f=ra[i]??[],I=d[i]??{};for(const c of f){const A=typeof c.url=="function"?c.url(I):c.url;A&&(g.has(A)||(g.add(A),v.push({label:c.label,url:A,icon:c.icon})))}}return v}const na={class:"w-full max-w-3xl mx-auto px-4 sm:px-6 py-6 md:py-10 space-y-6 md:space-y-10"},sa=["onMouseenter"],la={key:0,class:"flex items-center gap-3 py-2 mb-2"},ia={key:1,class:"flex items-center gap-3 py-2"},da={key:2,class:"flex flex-col items-end gap-2"},ca={class:"flex items-end gap-3 max-w-[92%] sm:max-w-[80%]"},ua={class:"px-5 py-3 rounded-2xl bg-white/80 dark:bg-[hsla(220,20%,20%,.15)] text-slate-900 dark:text-white text-[14px] leading-relaxed border border-gray-200 dark:border-[hsla(220,20%,40%,.2)] backdrop-blur-sm shadow-sm"},va={key:0,class:"text-xs font-bold text-gray-400 dark:text-gray-600 pr-2"},pa={key:3,class:"flex flex-col items-start gap-4"},ha={class:"flex items-start gap-5 w-full"},ga={class:"flex-1 min-w-0"},fa={class:"flex items-center gap-2 mb-2"},ma={key:0,class:"text-xs font-bold text-gray-400 dark:text-gray-600"},ya={key:0,class:"relative p-5 rounded-xl bg-amber-50/70 dark:bg-amber-500/5 border border-amber-200 dark:border-amber-500/15"},xa={class:"flex items-start gap-3.5"},ka={class:"w-9 h-9 rounded-lg bg-amber-100 dark:bg-amber-500/10 flex items-center justify-center shrink-0"},ba={class:"flex-1 min-w-0"},wa={class:"text-sm font-bold text-gray-900 dark:text-gray-100 tracking-tight"},_a={class:"text-[13px] text-gray-600 dark:text-gray-400 mt-1 leading-relaxed"},Ca={class:"flex flex-wrap gap-2 mt-4"},$a=["onClick"],Ma=["onClick"],Sa={key:1,class:"relative p-5 rounded-xl bg-red-50 dark:bg-red-500/5 border border-red-100 dark:border-red-500/10 text-red-600 dark:text-red-400 text-[13px] leading-relaxed"},Ia=["innerHTML"],Aa={key:2,class:"relative group/content max-w-full"},La={key:0,class:"text-gray-800 dark:text-gray-200 text-[15px] leading-relaxed whitespace-pre-wrap cursor-blink inline-block"},Ta=["innerHTML"],Ea={key:2,class:"flex flex-wrap gap-2 mt-4"},Da=["href"],Pa={key:3,class:"flex items-center gap-4 mt-4 transition-opacity duration-200 md:opacity-0 md:group-hover/content:opacity-100"},Ra=["onClick"],Ha=["onClick"],ja={__name:"Messages",props:{messages:{type:Array,default:()=>[]},user:{type:Object,required:!0}},emits:["retry","open-ai-settings","switch-provider"],setup(a,{expose:d,emit:g}){const v={fire:et,users:rt,home:Ge,search:Ue,link:at,cog:$e,eye:Re,trending:Ye,bookmark:Qe,plus:ot,calendar:ze,check:Je},i=a,{formatMessage:f}=qe(),I={claude:"Claude (Anthropic)",chatgpt:"ChatGPT (OpenAI)"},c=y=>I[y]||y,A=y=>{const u=c(y.provider);return y.keySource==="user_account"?`Your ${u} API key was rejected. it may be invalid, revoked, or disabled. Re-enter it in the AI settings${y.alternativeProvider?`, or switch to ${c(y.alternativeProvider)}`:""}.`:`The AI Coach couldn't authenticate with ${u}. Add your own API key in the AI settings${y.alternativeProvider?`, or switch to ${c(y.alternativeProvider)}`:""}.`},w=M(null),m=M(null),T=M(null);let C=null;const H=(y,u)=>{var r;if((r=navigator.clipboard)!=null&&r.writeText)navigator.clipboard.writeText(y).catch(()=>{});else{const n=document.createElement("textarea");n.value=y,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}C&&clearTimeout(C),T.value=u,C=setTimeout(()=>{T.value=null},1500)},j=M(-1),$=M(0);let x=null;const s=(y,u)=>{x&&(clearInterval(x),x=null);const r=y.content.length,n=Math.min(Math.max(r*5,500),2e3),h=16,P=Math.ceil(r/(n/h)
1);j.value=u,$.value=0,x=setInterval(()=>{$.value=Math.min($.value+P,r),$.value>=r&&(clearInterval(x),x=null,setTimeout(()=>{j.value===u&&(j.value=-1)},300))},h)};Le(()=>i.messages.length,(y,u)=>{if(y<=(u??0))return;const r=i.messages[y-1];(r==null?void 0:r.role)==="assistant"&&!r.isError&&r.isNew&&s(r,y-1)}),he(()=>{x&&clearInterval(x),C&&clearTimeout(C),j.value=-1,$.value=0,T.value=null});const _=y=>new Date(y).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0});return d({scrollToBottom:()=>{setTimeout(()=>{w.value&&w.value.scrollTo({top:w.value.scrollHeight,behavior:"smooth"})},60)},scrollToMessage:y=>{setTimeout(()=>{var r;const u=(r=w.value)==null?void 0:r.querySelectorAll(".ai-message-item");u!=null&&u[y]&&u[y].scrollIntoView({behavior:"smooth",block:"start"})},100)}}),(y,u)=>(t(),o("div",{ref_key:"containerRef",ref:w,class:"h-full overflow-y-auto ai-messages-scroll scroll-smooth"},[e("div",na,[R(Ve,{name:"msg-slide",tag:"div",class:"space-y-12"},{default:oe(()=>[(t(!0),o(V,null,F(a.messages,(r,n)=>(t(),o("div",{key:n,class:"ai-message-item group",onMouseenter:h=>m.value=n,onMouseleave:u[0]||(u[0]=h=>m.value=null)},[r.isContextStart?(t(),o("div",la,[...u[1]||(u[1]=[e("div",{class:"flex-1 h-px bg-gray-200 dark:bg-[hsla(220,20%,40%,.2)]"},null,-1),e("span",{class:"text-sm font-bold text-gray-400 dark:text-gray-600 whitespace-nowrap"},"AI context starts here",-1),e("div",{class:"flex-1 h-px bg-gray-200 dark:bg-[hsla(220,20%,40%,.2)]"},null,-1)])])):E("",!0),r.role==="system"?(t(),o("div",ia,[...u[2]||(u[2]=[e("div",{class:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-gray-100/50 dark:bg-[hsla(220,20%,20%,.15)] border border-gray-200 dark:border-[hsla(220,20%,40%,.2)]"},[e("div",{class:"dot-bounce w-1 h-1 bg-purple-500 rounded-full",style:{"animation-delay":"-0.3s"}}),e("div",{class:"dot-bounce w-1 h-1 bg-purple-500 rounded-full",style:{"animation-delay":"-0.15s"}}),e("div",{class:"dot-bounce w-1 h-1 bg-purple-500 rounded-full"})],-1)])])):r.role==="user"?(t(),o("div",da,[e("div",ca,[e("div",ua,D(r.content),1)]),r.timestamp?(t(),o("span",va,D(_(r.timestamp)),1)):E("",!0)])):r.role==="assistant"?(t(),o("div",pa,[e("div",ha,[e("div",ga,[e("div",fa,[u[3]||(u[3]=e("div",{class:"w-5 h-5 rounded-md bg-purple-600 flex items-center justify-center p-1"},[e("img",{src:"/img/arrowidx_icon_white.png",alt:"AI",class:"w-full h-full object-contain"})],-1)),u[4]||(u[4]=e("span",{class:"text-sm font-bold text-gray-900 dark:text-gray-100"},"Assistant",-1)),r.timestamp?(t(),o("span",ma,D(_(r.timestamp)),1)):E("",!0)]),r.invalidApiKey?(t(),o("div",ya,[e("div",xa,[e("div",ka,[R(p(tt),{class:"w-4 h-4 text-amber-600 dark:text-amber-400"})]),e("div",ba,[e("h4",wa,D(c(r.provider))+" API key issue ",1),e("p",_a,D(A(r)),1),e("div",Ca,[e("button",{onClick:h=>y.$emit("open-ai-settings",r.provider),class:"inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg text-[12px] font-semibold bg-gray-900 hover:bg-black text-white dark:bg-gray-100 dark:hover:bg-white dark:text-gray-900 transition-colors shadow-sm"},[R(p($e),{class:"w-3.5 h-3.5 shrink-0"}),u[5]||(u[5]=ke(" Open AI settings ",-1))],8,$a),r.alternativeProvider?(t(),o("button",{key:0,onClick:h=>y.$emit("switch-provider",{provider:r.alternativeProvider,index:n}),class:"inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg text-[12px] font-semibold bg-white dark:bg-transparent text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 hover:border-purple-400 hover:text-purple-700 dark:hover:text-purple-300 transition-colors"},[R(p(Xe),{class:"w-3.5 h-3.5 shrink-0"}),ke(" Switch to "+D(c(r.alternativeProvider)),1)],8,Ma)):E("",!0)])])])])):r.isError?(t(),o("div",Sa,[e("div",{innerHTML:p(f)(r.content)},null,8,Ia)])):(t(),o("div",Aa,[j.value===n?(t(),o("div",La,D(r.content.slice(0,$.value)),1)):(t(),o("div",{key:1,class:"text-gray-800 dark:text-gray-200 text-[15px] leading-relaxed ai-prose",innerHTML:p(f)(r.content)},null,8,Ta)),!r.isError&&j.value!==n&&p(Ie)(r.toolsExecuted,r.toolContext).length?(t(),o("div",Ea,[(t(!0),o(V,null,F(p(Ie)(r.toolsExecuted,r.toolContext),h=>(t(),o("a",{key:h.url,href:h.url,class:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[11px] font-semibold bg-purple-50 dark:bg-purple-500/10 text-purple-700 dark:text-purple-300 border border-purple-200 dark:border-purple-500/30 hover:bg-purple-100 dar
1k:hover:bg-purple-500/20 transition-colors"},[v[h.icon]?(t(),ie(Be(v[h.icon]),{key:0,class:"w-3 h-3 shrink-0"})):E("",!0),ke(" "+D(h.label)+" ",1),u[6]||(u[6]=e("svg",{class:"w-2.5 h-2.5 opacity-60 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M9 5l7 7-7 7"})],-1))],8,Da))),128))])):E("",!0),!r.isError&&j.value!==n?(t(),o("div",Pa,[e("button",{onClick:h=>H(r.content,n),class:B(["text-xs font-bold transition-colors",T.value===n?"text-purple-500":"text-gray-400 dark:text-gray-500 hover:text-purple-500"])},D(T.value===n?"Copied!":"Copy"),11,Ra),e("button",{onClick:h=>y.$emit("retry",n),class:"text-xs font-bold text-gray-400 dark:text-gray-500 hover:text-purple-500 transition-colors"}," Retry ",8,Ha)])):E("",!0)]))])])])):E("",!0)],40,sa))),128))]),_:1})])],512))}},Na=ve(ja,[["__scopeId","data-v-ea78a54e"]]),Ba={class:"w-full px-4 sm:px-6 pb-4 sm:pb-5 pt-2"},Va={class:"max-w-3xl mx-auto"},Oa=["value","disabled"],za={class:"flex items-center gap-2 px-3 pb-3 pt-1"},qa={key:0,class:"flex items-center gap-0.5 p-0.5 rounded-lg bg-gray-100 dark:bg-[hsla(220,20%,40%,.1)]"},Ua=["onClick"],Ga={key:1,class:"w-px h-4 bg-gray-200 dark:bg-[hsla(220,20%,40%,.2)]"},Ka=["disabled"],Fa={key:0},Wa={key:4,class:"flex items-center gap-1.5 text-xs font-medium text-purple-500 dark:text-purple-400"},Za={key:0},Ya={key:5,class:"text-xs font-medium text-red-400"},Xa=["disabled","aria-label"],Qa={key:0,"aria-hidden":"true",class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2.5"},Ja={key:1,"aria-hidden":"true",class:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"},eo={__name:"InputBar",props:{modelValue:{type:String,default:""},loading:{type:Boolean,default:!1},enhancing:{type:Boolean,default:!1},enhanceError:{type:Boolean,default:!1},isMobile:{type:Boolean,default:!1},availableProviders:{type:Object,default:()=>({})},currentProvider:{type:String,default:"claude"},isAdmin:{type:Boolean,default:!1}},emits:["update:modelValue","send","enhance","provider-change","configure-ai"],setup(a,{emit:d}){const g=a,v=d,i=M(null),f=M(!1),I=()=>{f.value||g.loading||g.enhancing||!g.modelValue.trim()||(f.value=!0,v("send"),setTimeout(()=>{f.value=!1},300))},c=w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),I())},A=()=>{const w=i.value;if(!w)return;w.style.height="auto";const m=Math.min(w.scrollHeight,160);w.style.height=(m<40?40:m)+"px"};return pe(()=>A()),(w,m)=>(t(),o("div",Ba,[e("div",Va,[e("div",{class:B(["flex flex-col w-full rounded-2xl bg-white dark:bg-[#1C1E23] border border-gray-200 dark:border-[hsla(220,20%,40%,.2)] focus-within:border-violet-500/40 dark:focus-within:border-violet-500/30 transition-all duration-200",{"opacity-60 pointer-events-none":a.loading&&!a.modelValue}])},[e("textarea",{ref_key:"textareaRef",ref:i,value:a.modelValue,onInput:m[0]||(m[0]=T=>{w.$emit("update:modelValue",T.target.value),A()}),onKeydown:c,placeholder:"Ask a question...",disabled:a.loading||a.enhancing,class:B(["w-full resize-none bg-transparent text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 text-[14px] leading-relaxed px-4 pt-4 pb-2 focus:outline-none border-none focus:ring-0 selection:bg-violet-500/20 selection:text-violet-700 dark:selection:text-violet-300 transition-opacity",{"opacity-40 cursor-not-allowed":a.loading||a.enhancing}]),rows:"1"},null,42,Oa),e("div",za,[Object.keys(a.availableProviders).length>1?(t(),o("div",qa,[(t(!0),o(V,null,F(a.availableProviders,(T,C)=>(t(),o("button",{key:C,onClick:H=>w.$emit("provider-change",C),class:B(["px-2.5 py-1 rounded-md text-xs font-bold transition-all duration-150",a.currentProvider===C?"bg-white dark:bg-[hsla(220,20%,50%,.2)] text-purple-600 dark:text-purple-400 shadow-sm":"text-gray-400 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"])},D(C==="claude"?"Claude":"GPT-4"),11,Ua))),128))])):E("",!0),Object.keys(a.availableProviders).length>1?(t(),o("div",Ga)):E("",!0),a.enhancing?E("",!0):(t(),o("button",{key:2,onClick:m[1]||(m[1]=T=>w.$emit("enhance")),disabled:!a.modelValue.trim()||a.modelValue.trim().length>200,class:B(["flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-bold transition-colors disabled:opacity-30 disabled:cursor-not-allowed",a.modelValue.trim().length>
10&&a.modelValue.trim().length<=200?"text-purple-600 dark:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-500/10":"text-gray-400 dark:text-gray-500"])},[m[3]||(m[3]=e("svg",{class:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor"},[e("path",{d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})],-1)),a.isMobile?E("",!0):(t(),o("span",Fa,"Improve"))],10,Ka)),!a.enhancing&&a.modelValue.trim().length>150?(t(),o("span",{key:3,class:B(["text-xs font-bold tabular-nums transition-colors",a.modelValue.trim().length>200?"text-red-400":"text-gray-400 dark:text-gray-500"])},D(a.modelValue.trim().length)+"/200 ",3)):E("",!0),a.enhancing?(t(),o("div",Wa,[m[4]||(m[4]=e("div",{class:"w-2.5 h-2.5 border border-purple-400/40 border-t-purple-500 rounded-full animate-spin"},null,-1)),a.isMobile?E("",!0):(t(),o("span",Za,"Improving..."))])):E("",!0),a.enhanceError?(t(),o("span",Ya,"Could not improve")):E("",!0),m[7]||(m[7]=e("div",{class:"flex-1"},null,-1)),a.isAdmin?(t(),o("button",{key:6,onClick:m[2]||(m[2]=T=>w.$emit("configure-ai")),class:"p-1.5 rounded-lg text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-[hsla(220,20%,40%,.1)] transition-colors",title:"Configure AI"},[...m[5]||(m[5]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"})],-1)])])):E("",!0),e("button",{onClick:I,disabled:a.loading||a.enhancing||f.value||!a.modelValue.trim(),"aria-label":a.loading?"Sending message":"Send message",class:"btn-primary flex items-center justify-center w-8 h-8 rounded-xl text-white transition-all active:scale-95 disabled:opacity-30"},[a.loading?(t(),o("div",Ja)):(t(),o("svg",Qa,[...m[6]||(m[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"},null,-1)])]))],8,Xa)])],2),m[8]||(m[8]=e("p",{class:"text-center text-xs text-gray-400 dark:text-gray-500 mt-2"}," Enter to send  ·  Shift+Enter for new line ",-1))])]))}},to=ve(eo,[["__scopeId","data-v-ebf2e2f8"]]),ao={key:0,class:"fixed bottom-0 left-0 right-0 z-[101] md:hidden flex flex-col bg-white dark:bg-[#13151a] border-t border-gray-200 dark:border-[hsla(220,20%,40%,.2)] rounded-t-2xl",style:{"max-height":"82vh"}},oo={class:"px-4 pb-3 flex-shrink-0"},ro={class:"relative group"},no={class:"px-3 pb-2 flex-shrink-0"},so={class:"flex-1 overflow-y-auto px-3 pt-2 pb-10",style:{"-webkit-overflow-scrolling":"touch","scrollbar-width":"none"}},lo={key:0,class:"flex items-center justify-center py-12"},io={key:1,class:"text-center py-12"},co={key:2,class:"text-center py-12"},uo={key:3,class:"text-center py-12"},vo={key:4,class:"space-y-4 mt-1"},po={class:"px-2 pt-2 pb-1 text-xs font-bold tracking-widest uppercase text-gray-400 dark:text-gray-600"},ho=["onClick"],go=["onKeydown","onBlur"],fo={class:"flex-1 text-[13px] font-medium truncate leading-tight"},mo=["onClick"],yo=["onClick"],xo={__name:"MobileDrawer",props:{show:{type:Boolean,default:!1},conversations:{type:Array,default:()=>[]},currentId:{type:[String,Number,null],default:null},loading:{type:Boolean,default:!1},error:{type:Boolean,default:!1}},emits:["close","select","delete","new","rename","settings"],setup(a,{emit:d}){const g=a,v=d,i=M(""),f=O(()=>{const x=i.value.toLowerCase(),s=x?g.conversations.filter(r=>{var n;return(n=r.title)==null?void 0:n.toLowerCase().includes(x)}):g.conversations,_=new Date,S=new Date(_.getFullYear(),_.getMonth(),_.getDate()),L=new Date(S-864e5),y=new Date(S-7*864e5),u=[{label:"Today",items:[]},{label:"Yesterday",items:[]},{label:"This Week",items:[]},{label:"Earlier",items:[]}];
1return s.forEach(r=>{const n=new Date(r.updated_at);n>=S?u[0].items.push(r):n>=L?u[1].items.push(r):n>=y?u[2].items.push(r):u[3].items.push(r)}),u.filter(r=>r.items.length>0)}),I=x=>{v("select",x),v("close"),i.value=""},c=()=>{v("new"),v("close"),i.value=""},A=()=>{v("close"),i.value=""},w=M(null),m=M(""),T=M(null),C=(x,s)=>{s.stopPropagation(),w.value=x.id,m.value=x.title,Y(()=>{var _;return(_=T.value)==null?void 0:_.select()})},H=x=>{m.value.trim()&&v("rename",x,m.value.trim()),w.value=null},j=()=>{w.value=null},$=x=>{x.key==="Escape"&&g.show&&A()};return pe(()=>document.addEventListener("keydown",$)),he(()=>document.removeEventListener("keydown",$)),(x,s)=>(t(),ie(Te,{to:"body"},[R(we,{"enter-active-class":"transition-opacity duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:oe(()=>[a.show?(t(),o("div",{key:0,onClick:A,class:"fixed inset-0 bg-black/50 z-[100] md:hidden"})):E("",!0)]),_:1}),R(we,{"enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-y-full","enter-to-class":"translate-y-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-y-0","leave-to-class":"translate-y-full"},{default:oe(()=>[a.show?(t(),o("div",ao,[s[14]||(s[14]=e("div",{class:"flex justify-center pt-3 pb-1 flex-shrink-0"},[e("div",{class:"w-10 h-1 bg-gray-200 dark:bg-white/10 rounded-full"})],-1)),e("div",{class:"flex items-center justify-between px-5 py-3 flex-shrink-0"},[s[5]||(s[5]=e("span",{class:"text-[11px] font-bold tracking-widest uppercase text-gray-400 dark:text-gray-500"},"Chats",-1)),e("button",{onClick:c,class:"btn-primary flex items-center justify-center w-7 h-7 rounded-full text-white transition-all active:scale-95"},[...s[4]||(s[4]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2.5"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})],-1)])])]),e("div",oo,[e("div",ro,[s[6]||(s[6]=e("svg",{class:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400 group-focus-within:text-violet-500 transition-colors pointer-events-none",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),_e(e("input",{"onUpdate:modelValue":s[0]||(s[0]=_=>i.value=_),type:"text",placeholder:"Search...",class:"w-full pl-9 pr-4 py-2 text-[13px] rounded-lg bg-[#EEEEEE] focus:bg-[#F6F6F6] dark:bg-gray-500/60 border-none focus:ring-1 focus:ring-violet-500/40 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 font-medium transition-all"},null,512),[[Ce,i.value]])])]),s[15]||(s[15]=e("div",{class:"mx-4 border-t border-gray-200 dark:border-[hsla(220,20%,35%,.2)] flex-shrink-0"},null,-1)),e("div",no,[e("button",{onClick:s[1]||(s[1]=_=>{x.$emit("settings"),x.$emit("close")}),class:"w-full flex items-center gap-2.5 px-3 py-2.5 rounded-lg transition-colors text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-white/5 hover:text-gray-900 dark:hover:text-gray-200"},[...s[7]||(s[7]=[e("svg",{class:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"1.8"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1),e("span",{class:"text-[13px] font-medium"},"Settings",-1)])])]),e("div",so,[a.loading&&a.conversations.length===0?(t(),o("div",lo,[...s[8]||(s[8]=[e("div",{class:"w-5 h-5 border-2 border-purple-500/20 border-t-purple-500 rounded-full animate-spin"},null,-1)])])):a.error&&a.conversations.length===0?(t(),o("div",io,[...s[9]||(s[9]=[e("p",{class:"text-[12px] font-medium text-red-400 dark:text-red-500"},"Could not load history",-1)])])):a.conversations.length===0?(t(),o("div",co,[...s[10]||(s[10]=[e("p",{class:"text-[12px] font-medium text-gray-400 dark:text-gray-600"},"No chats yet",-1)])])):f.value.length===0?(t(),o("div",uo,[...s[11]||(s[11]=[e("p",{class:"text-[12px] font-medium text-gray-400 dark:text-gray-600"},"No results found",-1)])])):(t(),o("div",vo,[(t(!0),o(V,null,F(f.value,_=>
1(t(),o("div",{key:_.label,class:"space-y-0.5"},[e("div",po,D(_.label),1),(t(!0),o(V,null,F(_.items,S=>(t(),o("div",{key:S.id,onClick:L=>w.value!==S.id&&I(S.id),class:B(["w-full flex items-center gap-2 px-3 py-2.5 rounded-lg transition-colors duration-150 cursor-pointer",String(a.currentId)===String(S.id)?"bg-gray-200/70 dark:bg-[hsla(220,20%,40%,.2)] text-gray-900 dark:text-white":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-white/5 hover:text-gray-900 dark:hover:text-gray-200 active:bg-gray-100 dark:active:bg-white/5"])},[w.value===S.id?_e((t(),o("input",{key:0,ref_for:!0,ref_key:"editInputRef",ref:T,"onUpdate:modelValue":s[2]||(s[2]=L=>m.value=L),onKeydown:[be(K(L=>H(S.id),["prevent"]),["enter"]),be(K(j,["prevent"]),["escape"])],onBlur:L=>H(S.id),onClick:s[3]||(s[3]=K(()=>{},["stop"])),class:"flex-1 text-[13px] font-medium bg-transparent border-none outline-none focus:ring-1 focus:ring-violet-500/40 rounded px-1 text-gray-900 dark:text-white min-w-0"},null,40,go)),[[Ce,m.value]]):(t(),o(V,{key:1},[e("span",fo,D(S.title),1),e("button",{onClick:K(L=>C(S,L),["stop"]),class:"p-1 rounded text-gray-300 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-300 transition-colors flex-shrink-0",title:"Rename"},[...s[12]||(s[12]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)])],8,mo),e("button",{onClick:K(L=>x.$emit("delete",S.id),["stop"]),class:"p-1 rounded text-gray-300 dark:text-gray-600 hover:text-red-500 active:text-red-500 transition-colors flex-shrink-0"},[...s[13]||(s[13]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,yo)],64))],10,ho))),128))]))),128))]))])])):E("",!0)]),_:1})]))}},ko={class:"p-5 sm:p-7"},bo={class:"flex items-center justify-end gap-2"},wo=["disabled"],_o=["disabled"],Co={key:0,class:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24"},$o={__name:"DeleteModal",props:{show:{type:Boolean,required:!0},loading:{type:Boolean,default:!1}},emits:["close","confirm"],setup(a){return(d,g)=>(t(),ie(Ke,{show:a.show,onClose:g[2]||(g[2]=v=>d.$emit("close")),"max-width":"sm","rounded-class":"rounded-2xl","show-close-button":!1},{default:oe(()=>[e("div",ko,[g[4]||(g[4]=e("div",{class:"mb-6"},[e("h3",{class:"text-base font-semibold text-gray-900 dark:text-white"}," Delete Chat "),e("p",{class:"text-sm text-gray-500 dark:text-gray-400 mt-1 leading-relaxed"}," This will permanently delete this conversation. This action cannot be undone. ")],-1)),e("div",bo,[e("button",{onClick:g[0]||(g[0]=v=>d.$emit("close")),disabled:a.loading,class:"inline-flex items-center px-4 py-2 text-xs font-semibold uppercase tracking-widest text-gray-600 dark:text-gray-300 border border-gray-300 dark:border-[hsla(220,20%,40%,.3)] rounded-full hover:bg-gray-50 dark:hover:bg-white/5 transition duration-150 ease-in-out disabled:opacity-25"}," Cancel ",8,wo),e("button",{onClick:g[1]||(g[1]=v=>d.$emit("confirm")),disabled:a.loading,class:"inline-flex items-center gap-2 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white bg-red-600 hover:bg-red-700 rounded-full transition-colors disabled:opacity-70"},[a.loading?(t(),o("svg",Co,[...g[3]||(g[3]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):E("",!0),ke(" "+D(a.loading?"Deleting...":"Delete"),1)],8,_o)])])]),_:1},8,["show"]))}},Ee=[{id:"daily_leads",title:"Daily Leads",query:"How many leads signed up yesterday?",action:"daily_leads",category:"AeroIDX",iconPaths:["M18 20V10","M12 20V4","M6 20v-6"]},{id:"hot_leads",title:"Hottest Leads",query:"Who are my hottest leads right now?",action:"hot_leads",category:"AeroIDX",iconPaths:["M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z"]},{id:"property_activity",title:"Property Activity",query:"Show me recent property viewing activity",action:"property_activity",category:"idx",iconPaths:["M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z","M9 22V12h6v10"]},{id:"today_focus",title:"Today's Focus",query:"What should I focus on today?",action:"today_focus",category:"AeroIDX",iconPaths:["M12 22a10 10 0 100-20 10 10 0 000 20z","M12 18a6 6 0 100-12 6 6 0 000 12z","M12 14a2 2 0 100-4 2 2 0 000 4z"]},{id:"weekly_summary",title:"Weekly Summary",query:"Give me my weekly performance summary",action:"weekly_summary",category:"AeroIDX",iconPaths:["M23 6l-9.5 9.5-5-5L1 18","M17 6h6v6"]},{id:"uncontacted",title:"Follow-up Needed",query:"Which leads need immediate follow-up?",action:"uncontacted",category:"AeroIDX",iconPaths:["M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 
111.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"]},{id:"lead_nurture",title:"Lead Nurture Tips",query:"Give me a follow-up strategy for leads that have gone cold",action:"lead_nurture",category:"AeroIDX",iconPaths:["M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"]},{id:"create_saved_search",title:"Create Saved Search",query:"Help me create a saved search for buyers looking for homes under $500k with at least 3 bedrooms",action:"create_saved_search",category:"AeroIDX",iconPaths:["M21 21l-4.35-4.35","M17 11A6 6 0 105 11a6 6 0 0012 0z"]},{id:"platform_tip",title:"Platform Tips",query:"What are the most useful features in Aero IDX I should be using to grow my business?",action:"platform_tip",category:"idx",iconPaths:["M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3M6.343 6.343l-.707-.707M6.343 17.657l-.707.707M12 21v-1M17.657 17.657l.707.707M17.657 6.343l.707-.707"]},{id:"ghl_recent_contacts",title:"CRM Contacts",query:"Show me recent contacts from my CRM",action:"ghl_recent_contacts",category:"ghl",iconPaths:["M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2","M9 7a4 4 0 100 8 4 4 0 000-8z","M23 21v-2a4 4 0 00-3-3.87","M16 3.13a4 4 0 010 7.75"]},{id:"ghl_hot_leads",title:"CRM Hot Leads",query:"Who are my hottest leads in my CRM?",action:"ghl_hot_leads",category:"ghl",iconPaths:["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"]},{id:"ghl_open_opportunities",title:"Opportunities",query:"Show me my open opportunities in my CRM",action:"ghl_open_opportunities",category:"ghl",iconPaths:["M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2z","M16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2"]},{id:"ghl_today_appointments",title:"Appointments",query:"What appointments do I have today in my CRM?",action:"ghl_today_appointments",category:"ghl",iconPaths:["M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"]},{id:"ghl_pending_tasks",title:"Pending Tasks",query:"What tasks are pending in my CRM?",action:"ghl_pending_tasks",category:"ghl",iconPaths:["M9 11l3 3L22 4","M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"]},{id:"ghl_connection_check",title:"CRM Status",query:"Is my CRM connection working?",action:"ghl_connection_check",category:"ghl",iconPaths:["M5 12.55a11 11 0 0114.08 0","M1.42 9a16 16 0 0121.16 0","M8.53 16.11a6 6 0 016.95 0","M12 20h.01"]}],Mo=[{id:"leads",title:"Lead Insights",description:"Understand your pipeline at a glance",examples:["Who are my hottest leads?","Which leads need follow-up?","Daily lead count"],action:"hot_leads",iconPaths:["M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z"]},{id:"nurture",title:"Lead Nurturing",description:"Get scripts, strategies, and follow-up plans",examples:["Re-engage cold leads","Follow-up sequences","Personalized outreach tips"],action:"lead_nurture",iconPaths:["M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"]},{id:"searches",title:"Saved Searches",description:"Create property alerts using natural language",examples:["Homes under $500k, 3+ beds","Condos near downtown","New listings this week"],action:"create_saved_search",iconPaths:["M21 21l-4.35-4.35","M17 11A6 6 0 105 11a6 6 0 0012 0z"]},{id:"platform",title:"Platform Help",description:"Navigate features and get the most out of AeroIDX",examples:["How to use IDX widgets","Set up your website","What features should I use?"],action:"platform_tip",iconPaths:["M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3M6.343 6.343l-.707-.707M6.343 17.657l-.707.707M12 21v-1M17.657 17.657l.707.707M17.657 6.343l.707-.707"]}],So=["onClick","disabled"],Io={key:0,class:"w-3.5 h-3.5 text-purple-500 dark:text-purple-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ao=["d"],Lo={class:"text-[11px] font-semibold text-gray-700 dark:text-gray-300"},To={__name:"QuickActions",props:{loading:{type:Boolean,default:!1},isMobile:{type:Boolean,default:!1},limit:{type:Number,default:null}},emits:["select"],setup(a){const d=a,g=O(()=>{const v=[...Ee].sort(()=>Math.random()-.5),i=d.limit??(d.isMobile?6:8);return v.slice(0,i)});return(v,i)=>(t(),o("div",{class:B(["flex flex-wrap items-center justify-center gap-2 w-full max-w-xl",a.limit?"flex-nowrap overflow-hidden":""])},[(t(!0),o(V,null,F(g.value,f=>{var I;return t(),o("button",{key:f.id,onClick:c=>v.$emit("select",f.action),disabled:a.loading,class:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl border border-gray-200 dark:border-white/5 bg-gray-50/50 dark:bg-white/5 hover:border-purple-500/30 hover:bg-white dark:hover:bg-white/10 transition-all duration-200 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-500/50 focus-visible:ring-offset-1"},[(I=f.iconPaths)!=null&&I.length?(t(),o("svg",Io,[(t(!0),o(V,null,F(f.iconPaths,(c,A)=>(t(),o("path",{key:A,d:c}
1,null,8,Ao))),128))])):E("",!0),e("span",Lo,D(f.title),1)],8,So)}),128))],2))}},Eo={class:"grid grid-cols-2 gap-2 w-full max-w-xl"},Do=["onClick","disabled"],Po={class:"flex items-center gap-2 mb-1.5"},Ro={class:"w-5 h-5 rounded-md bg-purple-100 dark:bg-purple-500/10 flex items-center justify-center flex-shrink-0"},Ho={class:"w-3 h-3 text-purple-500 dark:text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},jo=["d"],No={class:"text-[11px] font-bold text-gray-800 dark:text-gray-200 leading-tight"},Bo={class:"text-xs text-gray-500 dark:text-gray-500 leading-snug"},Vo={__name:"UseCaseGrid",props:{loading:{type:Boolean,default:!1}},emits:["select"],setup(a){return(d,g)=>(t(),o("div",Eo,[(t(!0),o(V,null,F(p(Mo),v=>(t(),o("button",{key:v.id,onClick:i=>d.$emit("select",v.action),disabled:a.loading,class:"group text-left p-3 rounded-xl border border-gray-200 dark:border-white/5 bg-gray-50/50 dark:bg-white/[0.03] hover:border-purple-400/40 hover:bg-white dark:hover:bg-white/[0.06] transition-all duration-200 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-500/50"},[e("div",Po,[e("div",Ro,[(t(),o("svg",Ho,[(t(!0),o(V,null,F(v.iconPaths,(i,f)=>(t(),o("path",{key:f,d:i},null,8,jo))),128))]))]),e("span",No,D(v.title),1)]),e("p",Bo,D(v.description),1)],8,Do))),128))]))}},te=M([]);function Oo(a){const d=M(null),g=M(!1),v=M(!1),i=M(!1),f=M(null),I=M(!1),c=()=>{var $;return{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":($=document.querySelector('meta[name="csrf-token"]'))==null?void 0:$.getAttribute("content")}};return{conversationHistory:te,currentConversationId:d,loadingHistory:g,historyError:v,showDeleteModal:i,conversationToDelete:f,deleting:I,loadConversationHistory:async({silent:$=!1}={})=>{var x;try{$||(g.value=!0),v.value=!1;const s=await ae.get(`${a}/ai-coach/conversations`,{headers:c()});(x=s.data)!=null&&x.success&&(te.value=s.data.data.conversations||[])}catch(s){console.error("Failed to load conversation history:",s),$||(v.value=!0)}finally{g.value=!1}},addConversationToHistory:$=>{te.value.some(s=>String(s.id)===String($.id))||te.value.unshift($)},deleteConversation:$=>{f.value=$,i.value=!0},confirmDeleteConversation:async $=>{var x;if(!(!f.value||I.value)){I.value=!0;try{(x=(await ae.delete(`${a}/ai-coach/conversations/${f.value}`,{headers:c()})).data)!=null&&x.success&&(te.value=te.value.filter(_=>_.id!==f.value),$&&$(f.value))}catch(s){console.error("Failed to delete conversation:",s)}finally{I.value=!1,i.value=!1,f.value=null}}},cancelDeleteConversation:()=>{i.value=!1,f.value=null},selectConversation:$=>{$!==d.value&&ue.get(`/ai-coach/${$}`)},renameConversation:async($,x)=>{var _;const s=x.trim();if(!s)return!1;try{if((_=(await ae.put(`${a}/ai-coach/conversations/${$}/title`,{title:s},{headers:c()})).data)!=null&&_.success){const L=te.value.find(y=>String(y.id)===String($));return L&&(L.title=s),!0}}catch(S){console.error("Failed to rename conversation:",S)}return!1}}}function zo(a,d,g,v,i,f=null){const I=M(""),c=M([]),A=M(!1),w=M(!1),m=M(!1),T=M(!!f),C=()=>{var s;return{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":(s=document.querySelector('meta[name="csrf-token"]'))==null?void 0:s.getAttribute("content")}};return{userInput:I,conversation:c,loading:A,enhancingPrompt:w,enhanceError:m,hasStartedConversation:T,askAI:async(s=null,_,S)=>{var y,u,r,n,h,P,N,X,W,z,G,ge,Q,re,q,J,ne,fe,Z,ee,de,me,ye,xe,se;if(!s&&!I.value.trim()||A.value)return;if(!v.value)return{error:"NO_API_KEY"};T.value=!0,c.value=c.value.filter(b=>!(b.role==="system"&&b.content==="AI is thinking..."));const L=s&&((y=i.find(b=>b.action===s))==null?void 0:y.query)||I.value;c.value.push({role:"user",content:L,timestamp:new Date().toISOString(),isNew:!0}),await Y(),_&&_(),A.value=!0;try{c.value.push({role:"system",content:"AI is thinking...",timestamp:new Date().toISOString(),isNew:!0}),await Y(),_&&_();const b={message:L,conversation_history:c.value.filter(k=>k.role!=="system").slice(-10).map(k=>({role:k.role,content:k.content})),use_claude_tools:!0,...d.value&&{conversation_id:d.value},...s&&{quick_action:s}},l=await ae.post(`${a}/ai-coach`,b,{headers:C()});if(c.value.pop(),(u=l.data)!=null&&u.success&&((n=(r=l.data)==null?void 0:r.data)!=null&&n.ai_response)){const k=c.value.length;return c.value.push({role:"assistant",content:l.data.data.ai_response,timestamp:new Date().toISOString(),usage:l.data.data.usage,toolsExecuted:l.data.data.tools_executed||[],toolContext:l.data.data.tool_context||{},dataSources:l.data.data.data_sources||[],isNew:!0}),await Y(),S&&S(k),l.data.data.conversation_id&&!d.value?(d.value=l.data.data.conversation_id,ue.visit(`/ai-coach/${l.data.data.conversation_id}`,{preserveState:!0,preserveScroll:!0,replace:!0}),{success:!0,newConversation:!0}
1):{success:!0}}else if((h=l.data)!=null&&h.fallback_response){const k=c.value.length;c.value.push({role:"assistant",content:l.data.fallback_response,timestamp:new Date().toISOString(),isError:!0,isNew:!0,...l.data.invalid_api_key&&{invalidApiKey:!0,provider:l.data.provider,keySource:l.data.key_source,alternativeProvider:l.data.alternative_provider}}),await Y(),S&&S(k);const U=(P=l.data.data)==null?void 0:P.conversation_id;return U&&!d.value?(d.value=U,ue.visit(`/ai-coach/${U}`,{preserveState:!0,preserveScroll:!0,replace:!0}),{success:!1,newConversation:!0}):{success:!1}}else throw new Error(((N=l.data)==null?void 0:N.message)||"No response received")}catch(b){c.value=c.value.filter(ce=>!(ce.role==="system"&&ce.content==="AI is thinking..."));let l="I apologize, but I'm having trouble processing your request right now. ";((X=b.response)==null?void 0:X.status)===401?l+="Please refresh the page and try again.":((W=b.response)==null?void 0:W.status)===429||(ge=(G=(z=b.response)==null?void 0:z.data)==null?void 0:G.message)!=null&&ge.toLowerCase().includes("token")||(q=(re=(Q=b.response)==null?void 0:Q.data)==null?void 0:re.message)!=null&&q.toLowerCase().includes("rate limit")?l=`🚫 Daily Query Limit Reached
2
3You've used all your AI coaching queries for today. Your limit will reset tomorrow at midnight.`:((J=b.response)==null?void 0:J.status)===503?l+="AI coaching is temporarily unavailable.":(fe=(ne=b.response)==null?void 0:ne.data)!=null&&fe.fallback_response?l=b.response.data.fallback_response:(ee=(Z=b.response)==null?void 0:Z.data)!=null&&ee.message?l=b.response.data.message:l+="Please try again or contact support if the issue persists.";const k=c.value.length;c.value.push({role:"assistant",content:l,timestamp:new Date().toISOString(),isError:!0,isNew:!0,...((me=(de=b.response)==null?void 0:de.data)==null?void 0:me.invalid_api_key)&&{invalidApiKey:!0,provider:b.response.data.provider,keySource:b.response.data.key_source,alternativeProvider:b.response.data.alternative_provider}}),await Y(),S&&S(k);const U=(se=(xe=(ye=b.response)==null?void 0:ye.data)==null?void 0:xe.data)==null?void 0:se.conversation_id;return U&&!d.value?(d.value=U,ue.visit(`/ai-coach/${U}`,{preserveState:!0,preserveScroll:!0,replace:!0}),{success:!1,error:l,newConversation:!0}):{success:!1,error:l}}finally{A.value=!1,I.value=""}},enhancePrompt:async()=>{var s,_,S;if(!(!I.value.trim()||w.value)){w.value=!0;try{const L=await ae.post(`${a}/ai-coach/enhance`,{message:I.value},{headers:C()});(s=L.data)!=null&&s.success&&((S=(_=L.data)==null?void 0:_.data)!=null&&S.ai_response)&&(I.value=L.data.data.ai_response.trim().replace(/^["']|["']$/g,""))}catch(L){console.error("Failed to enhance prompt:",L),m.value=!0,setTimeout(()=>{m.value=!1},3e3)}finally{w.value=!1}}},loadConversation:async(s,_)=>{var S;try{A.value=!0;const L=await ae.get(`${a}/ai-coach/conversations/${s}`,{headers:C()});if((S=L.data)!=null&&S.success){const{messages:y}=L.data.data,u=10,r=y.length>u?y.length-u:0;c.value=y.map((n,h)=>({role:n.role,content:n.content,timestamp:n.created_at,usage:n.usage,toolsExecuted:n.toolsExecuted||[],toolContext:n.toolContext||{},dataSources:n.dataSources||[],isNew:!1,isContextStart:h===r&&r>0})),d.value=s,T.value=!0,await Y(),_&&_()}}catch(L){console.error("Failed to load conversation:",L)}finally{A.value=!1}},resetChat:()=>{c.value=[],d.value=null,T.value=!1,I.value=""}}}const qo={class:"flex overflow-hidden relative dark:bg-[#0a0a0c] h-full"},Uo={class:"hidden md:flex h-full"},Go={class:"flex-1 flex flex-col overflow-hidden min-w-0 relative z-10"},Ko={class:"flex-shrink-0 flex items-center justify-between gap-3 px-6 py-3 border-b border-gray-200 dark:border-[hsla(220,20%,40%,.2)] bg-white/80 dark:bg-[hsla(220,20%,20%,.15)] backdrop-blur-md"},Fo={class:"flex items-center gap-4"},Wo={class:"min-w-0 flex items-center gap-3"},Zo={class:"text-[13px] font-bold text-gray-900 dark:text-white truncate tracking-tight"},Yo={class:"flex items-center gap-3"},Xo={class:"flex-1 overflow-hidden relative"},Qo={key:0,class:"h-full flex flex-col items-center justify-center px-6 max-w-3xl mx-auto w-full gap-6"},Jo={class:"flex flex-col items-center text-center gap-1.5"},er={class:"opacity-60"},tr={class:"w-full max-w-xl"},ar={__name:"AICoach",props:{user:{type:Object,required:!0},initialCollapsed:{type:Boolean,default:!1},conversationId:{type:[String,Number,null],required:!1,default:null},conversation:{type:Object,required:!1,default:null}},setup(a){const d=a,g=window.baseUrl||"",v=O(()=>{var b;return((b=d.user)==null?void 0:b.owner_id)===null}),{currentProvider:i,availableProviders:f,hasApiKey:I,showApiKeyModal:c,checkApiKeyStatus:A,handleApiKeySaved:w,handleProviderChange:m}=Ze(g,v),{conversationHistory:T,currentConversationId:C,loadingHistory:H,historyError:j,showDeleteModal:$,deleting:x,loadConversationHistory:s,deleteConversation:_,confirmDeleteConversation:S,cancelDeleteConversation:L,selectConversation:y,renameConversation:u}=Oo(g),{userInput:r,conversation:n,loading:h,enhancingPrompt:P,enhanceError:N,hasStartedConversation:X,askAI:W,enhancePrompt:z,loadConversation:G,resetChat:ge}=zo(g,C,i,I,Ee,d.conversationId),Q=M(!1),re=M(!1),q=M(!1),J=M(null);let ne=null;const fe=O(()=>{var l,k;if(!C.value)return null;const b=String(C.value);return((l=T.value.find(U=>String(U.id)===b))==null?void 0:l.title)||((k=d.conversation)==null?void 0:k.title)||"Conversation"}),Z=()=>{q.value=!1,ge(),ue.visit(route("ai-coach.index"),{preserveState:!0,preserveScroll:!0,replace:!0})},ee=async(b=null)=>{const l=!C.value,k=await W(b,()=>{var U;return(U=J.value)==null?void 0:U.scrollToBottom()},U=>{var ce;return(ce=J.value)==null?void 0:ce.scrollToMessage(U)});if((k==null?void 0:k.error)==="NO_API_KEY"){c.value=!0;return}(k!=null&&k.success||k!=null&&k.newConversation)&&l&&s({silent:!0})},de=b=>{for(let l=b-1;l>=0;l--)if(n.value[l].role==="user"){r.value=n.value[l].content,n.value=n.value.slice(0,l),ee();return}},me=async({provider:b,index:l})=>{var k;try{await ae.post(`${g}/settings/ai-provider`,{provider:b},{headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":(k=document.querySelector('meta[name="csrf-token"]'))==null?void 0:k.getAttribute("content")}}),f.value={...f.value,[b]:!0}
3,m(b),de(l)}catch{c.value=!0}},ye=()=>{T.value=[],Z()},xe=()=>{S(b=>{String(C.value)===String(b)&&Z()})},se=()=>{clearTimeout(ne),ne=setTimeout(()=>{Q.value=window.innerWidth<768},100)};return pe(()=>{A(),se(),window.addEventListener("resize",se),s(),d.conversationId&&(C.value=d.conversationId,d.conversation&&G(d.conversationId,()=>{var b;return(b=J.value)==null?void 0:b.scrollToBottom()}))}),he(()=>{window.removeEventListener("resize",se),clearTimeout(ne)}),(b,l)=>(t(),o("div",qo,[e("div",Uo,[R(oa,{"initial-collapsed":a.initialCollapsed,conversations:p(T),"current-id":p(C),loading:p(H),error:p(j),"showing-settings":q.value,onSelect:l[0]||(l[0]=k=>{q.value=!1,p(y)(k)}),onDelete:p(_),onNew:Z,onRename:p(u),onSettings:l[1]||(l[1]=k=>q.value=!q.value)},null,8,["initial-collapsed","conversations","current-id","loading","error","showing-settings","onDelete","onRename"])]),e("div",Go,[e("header",Ko,[e("div",Fo,[e("button",{onClick:l[2]||(l[2]=k=>re.value=!0),class:"md:hidden p-2 rounded-lg text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-all"},[...l[12]||(l[12]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("div",Wo,[e("h1",Zo,D(q.value?"Settings":fe.value||"AI Coach"),1)])]),e("div",Yo,[q.value?(t(),o("button",{key:0,onClick:l[3]||(l[3]=k=>q.value=!1),class:"text-[10px] font-bold text-gray-400 hover:text-purple-600 dark:text-gray-500 dark:hover:text-purple-400 transition-colors"}," Done ")):p(X)?(t(),o("button",{key:1,onClick:Z,class:"text-[10px] font-bold text-gray-400 hover:text-purple-600 dark:text-gray-500 dark:hover:text-purple-400 transition-colors"}," New chat ")):E("",!0)])]),q.value?(t(),ie(We,{key:0,user:d.user,"is-admin":v.value,"current-provider":p(i),"available-providers":p(f),onConfigureAi:l[4]||(l[4]=k=>c.value=!0),onAllDeleted:ye},null,8,["user","is-admin","current-provider","available-providers"])):(t(),o(V,{key:1},[e("div",Xo,[R(we,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100"},{default:oe(()=>[p(X)?(t(),ie(Na,{key:1,ref_key:"messagesRef",ref:J,messages:p(n),user:d.user,onRetry:de,onOpenAiSettings:l[5]||(l[5]=k=>c.value=!0),onSwitchProvider:me},null,8,["messages","user"])):(t(),o("div",Qo,[e("div",Jo,[e("div",er,[R(Lt,{palette:"oceanDepths",size:"56px"})]),l[13]||(l[13]=e("h2",{class:"text-lg font-bold text-gray-800 dark:text-white tracking-tight"}," AI Coach ",-1)),l[14]||(l[14]=e("p",{class:"text-sm text-gray-400 dark:text-gray-500 max-w-xs leading-relaxed"}," Your real estate assistant — ask anything or pick a category. ",-1))]),R(Vo,{loading:p(h),onSelect:ee},null,8,["loading"]),e("div",tr,[l[15]||(l[15]=e("p",{class:"text-xs font-bold text-gray-400 dark:text-gray-600 uppercase tracking-widest text-center mb-2"}," Or try ",-1)),R(To,{loading:p(h),"is-mobile":Q.value,limit:Q.value?3:4,onSelect:ee},null,8,["loading","is-mobile","limit"])])]))]),_:1})]),R(to,{modelValue:p(r),"onUpdate:modelValue":l[6]||(l[6]=k=>Oe(r)?r.value=k:null),loading:p(h),enhancing:p(P),"enhance-error":p(N),"is-mobile":Q.value,"available-providers":p(f),"current-provider":p(i),"is-admin":v.value,onSend:ee,onEnhance:p(z),onProviderChange:p(m),onConfigureAi:l[7]||(l[7]=k=>c.value=!0)},null,8,["modelValue","loading","enhancing","enhance-error","is-mobile","available-providers","current-provider","is-admin","onEnhance","onProviderChange"])],64))]),R(xo,{show:re.value,conversations:p(T),"current-id":p(C),loading:p(H),error:p(j),onClose:l[8]||(l[8]=k=>re.value=!1),onSelect:l[9]||(l[9]=k=>{q.value=!1,p(y)(k)}),onDelete:p(_),onNew:Z,onRename:p(u),onSettings:l[10]||(l[10]=k=>q.value=!0)},null,8,["show","conversations","current-id","loading","error","onDelete","onRename"]),R($o,{show:p($),loading:p(x),onClose:p(L),onConfirm:xe},null,8,["show","loading","onClose"]),R(Fe,{show:p(c),"initial-provider":p(i),"can-configure":v.value,onClose:l[11]||(l[11]=k=>c.value=!1),onSaved:p(w),onProviderChanged:p(m)},null,8,["show","initial-provider","can-configure","onSaved","onProviderChanged"])]))}},or=ve(ar,[["__scopeId","data-v-2ab2111c"]]),rr={class:"overflow-hidden relative h-[calc(100dvh-var(--app-header-h,4rem))]"},Cr={__name:"Index",props:{user:{type:Object,required:!0},conversationId:{type:[String,Number,null],required:!1,default:null},conversation:{type:Object,required:!1,default:null}},setup(a){const{isServerGated:d}=je();return pe(()=>{document.documentElement.style.overflow="hidden"}),he(()=>{document.documentElement.style.overflow=""}),(g,v)=>(t(),o(V,null,[R(p(He),{title:"AI Business Coach"}),R(De,null,{default:oe(()=>[e("div",rr,[R(or,{user:a.user,"initial-collapsed":!0,"conversation-id":a.conversationId,conversation:a.conversation,class:B({"opacity-30 pointer-events-none select-none":p(d)})},null,8,["user","conversation-id","conversation","class"])])]),_:1})],64))}};export{Cr 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.