1import{a as e,aa as t,a_ as s,a8 as i,q as a,b as n,d as o,e as l,a3 as r,t as c,n as d,w as h,$ as p,F as u,l as m,g,f as y,v as w,r as f,i as S,aT as v,aP as b,aQ as k,k as j,a0 as C,aR as P,aS as x,aY as I,D as M,u as T,cu as R,cy as E,aW as U,aV as V,cz as _,cA as z,bm as D,aL as L}from"./index-BuBTVXcP.js";import{G as O}from"./GenericPopup-CnPv8Mvt.js";import{E as A}from"./Expertise-C3qisp0A.js";import{c as B,a as F}from"./expertise-CKOPeNSi.js";import{_ as N}from"./attachment-documents-zNNf1QID.js";const $=new i.Renderer,H={name:"ProjectDetailView",components:{InputField:s,Expertise:A},props:{project:{type:Object,required:!0},isOwner:{type:Boolean,default:!1},businessId:{type:String,required:!0}},emits:["update:project","regenerate-persona"],data:()=>({form:{title:"",description:"",status:"Open",budget:"",timeline:"",location:"",skills:[],persona:""},titleStyle:"font-size: 28px; font-weight: bold; color: #333; margin-bottom: 8px;",descriptionStyle:"font-size: 16px; line-height: 1.6; color: #555;",detailStyle:"font-size: 16px; color: #555;",formStyle:"margin-bottom: 0; padding: 0;",showSkillSelector:!1,expertiseSearch:"",searchResults:[],allExpertises:[],isLoading:!1,newExpertiseType:"skill"}),computed:{isAdmin(){const e=a.state.currentUser;return e&&(!0===e.isAdmin||e.roles&&e.roles.includes("admin"))},canEditPersona(){return this.isOwner||this.isAdmin}},watch:{project:{immediate:!0,handler(e){this.mapProjectToForm(e)}}},methods:{renderPersona:e=>i(e||"",{renderer:$}),mapProjectToForm(e){this.form={title:e.title||"",description:e.description||"",status:e.status||"Open",budget:e.budget||"",timeline:e.timeline||"",location:e.location||"",skills:e.skills?[...e.skills]:[],persona:e.persona||""}},updateProject(e,t){this.form[e]=t;const s={id:this.project.id,businessId:this.businessId,[e]:t};this.$emit("update:project",s)},updateProjectDebounced:t(function(e,t){this.updateProject(e,t)},1500),async removeSkill(e){const t=[...this.project.skills];t.splice(e,1);const s={id:this.project.id,businessId:this.businessId,skills:t};this.$emit("update:project",s)},async fetchAllExpertises(){try{this.isLoading=!0,this.allExpertises=await F()}catch(e){}finally{this.isLoading=!1}},searchExpertises(){if(!this.expertiseSearch.trim())return void(this.searchResults=[]);const e=this.expertiseSearch.toLowerCase();this.searchResults=this.allExpertises.filter(t=>t.label.toLowerCase().includes(e)||t.name.toLowerCase().includes(e))},getExpertiseType:e=>e.startsWith("role.")?"Role":e.startsWith("skills.")?"Skill":"Other",getExpertiseTypeClass:e=>e.startsWith("role.")?"type-role":e.startsWith("skills.")?"type-skill":"type-other",formatExpertiseName:e=>"skills."+e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""),async selectExpertise(e){try{if(this.project.skills.some(t=>t.id===e.id||t.label===e.label))return this.showSkillSelector=!1,void(this.expertiseSearch="");const t=[...this.project.skills,e],s={id:this.project.id,businessId:this.businessId,skills:t};this.$emit("update:project",s),this.showSkillSelector=!1,this.expertiseSearch="",this.searchResults=[]}catch(t){}},async createNewSkill(){try{this.isLoading=!0;const e=this.formatExpertiseName(this.expertiseSearch),t={label:this.expertiseSearch,name:e},s=await B(t);s&&(await this.selectExpertise(s),this.allExpertises.push(s))}catch(e){}finally{this.isLoading=!1}}},mounted(){this.fetchAllExpertises()}},W={class:"project-details-container"},q={class:"project-header"},G={class:"project-title"},Y={key:1,class:"project-title-text"},J={class:"project-status"},Q={key:1,class:"status-selector"},K={class:"project-section"},X={class:"project-persona"},Z=["innerHTML"],ee={class:"project-section"},te={class:"project-description"},se={key:1,class:"project-description-text"},ie={class:"project-details-grid"},ae={class:"project-detail"},ne={key:1,class:"detail-value"},oe={class:"project-detail"},le={key:1,class:"detail-value"},re={class:"project-detail"},ce={key:1,class:"detail-value"},de={class:"project-section"},he={class:"section-header"},pe={class:"project-skills"},ue={key:0,class:"no-skills"},me={key:0,class:"expertise-selector-modal"},ge={class:"expertise-selector-content"},ye={class:"expertise-selector-header"},we={class:"expertise-search"},fe={key:0,class:"expertise-results"},Se=["onClick"],ve={class:"expertise-result-label"},be={key:1,class:"expertise-create"},ke={class:"expertise-type-selector"},je=["disabled"],Ce={key:2,class:"expertise-loading"};const Pe={key:1,class:"chat-header"},xe={key:2,class:"chat-content"},Ie={key:3,class:"chat-footer"},Me={key:0,class:"mobile-suggestions"},Te={class:"suggestions-scroll"},Re=["onClick"],Ee={class:"attachment-section"},Ue={key:0,class:"chat-file-previews"},Ve=["onClick"],_e={class:"input-section"},ze={class:"prompt-input"},De=["disabled"],Le={key:0,loading:"lazy",src:I,class:"send-icon",alt:""},Oe={key:1,class:"streaming-indicator"},Ae={key:1,class:"project-details-view"},Be={class:"details-header"};const Fe=e({name:"ProjectPersonaChat",components:{UserMessage:k,AssistantMessage:b,FilePreview:v,GenericPopup:O,ProjectDetailVie
1w:e(H,[["render",function(e,t,s,i,a,v){const b=f("InputField"),k=f("Expertise");return S(),n("div",W,[o("div",q,[o("div",G,[s.isOwner?(S(),r(b,{key:0,"onUpdate:modelValue":t[0]||(t[0]=e=>v.updateProjectDebounced("title",e)),modelValue:s.project.title,placeholder:"Project Title",inputStyle:a.titleStyle,formStyle:a.formStyle,id:"projectTitle",enableHoverEffect:!0},null,8,["modelValue","inputStyle","formStyle"])):(S(),n("div",Y,c(s.project.title),1))])]),o("div",J,[s.isOwner?(S(),n("div",Q,[t[15]||(t[15]=o("label",{for:"projectStatus",class:"section-title"},"Status:",-1)),h(o("select",{id:"projectStatus","onUpdate:modelValue":t[1]||(t[1]=e=>a.form.status=e),onChange:t[2]||(t[2]=e=>v.updateProjectDebounced("status",a.form.status))},[...t[14]||(t[14]=[o("option",{value:"Open"},"Open",-1),o("option",{value:"In Progress"},"In Progress",-1),o("option",{value:"Completed"},"Completed",-1)])],544),[[p,a.form.status]])])):(S(),n("div",{key:0,class:d(["status-label","status-"+s.project.status.toLowerCase()])},c(s.project.status),3))]),o("div",K,[t[16]||(t[16]=o("h3",{class:"section-title"},"Project Persona",-1)),o("div",X,[v.canEditPersona?(S(),r(b,{key:0,"onUpdate:modelValue":t[3]||(t[3]=e=>v.updateProjectDebounced("persona",e)),modelValue:a.form.persona,placeholder:"Project Persona (Markdown supported)",inputStyle:a.descriptionStyle,formStyle:a.formStyle,id:"projectPersona",type:"textarea",enableHoverEffect:!0},null,8,["modelValue","inputStyle","formStyle"])):(S(),n("div",{key:1,class:"persona-content",innerHTML:v.renderPersona(s.project.persona)},null,8,Z))])]),o("div",ee,[t[17]||(t[17]=o("h3",{class:"section-title"},"Description",-1)),o("div",te,[s.isOwner?(S(),r(b,{key:0,"onUpdate:modelValue":t[4]||(t[4]=e=>v.updateProjectDebounced("description",e)),modelValue:a.form.description,placeholder:"Project Description",inputStyle:a.descriptionStyle,formStyle:a.formStyle,id:"projectDescription",type:"textarea",enableHoverEffect:!0},null,8,["modelValue","inputStyle","formStyle"])):(S(),n("div",se,c(s.project.description),1))])]),o("div",ie,[o("div",ae,[t[18]||(t[18]=o("h3",{class:"detail-title"},"Budget",-1)),s.isOwner?(S(),r(b,{key:0,"onUpdate:modelValue":t[5]||(t[5]=e=>v.updateProjectDebounced("budget",e)),modelValue:a.form.budget,placeholder:"e.g. $5,000 - $10,000",inputStyle:a.detailStyle,formStyle:a.formStyle,id:"projectBudget",enableHoverEffect:!0},null,8,["modelValue","inputStyle","formStyle"])):(S(),n("div",ne,c(s.project.budget||"Not specified"),1))]),o("div",oe,[t[19]||(t[19]=o("h3",{class:"detail-title"},"Timeline",-1)),s.isOwner?(S(),r(b,{key:0,"onUpdate:modelValue":t[6]||(t[6]=e=>v.updateProjectDebounced("timeline",e)),modelValue:a.form.timeline,placeholder:"e.g. 3 months",inputStyle:a.detailStyle,formStyle:a.formStyle,id:"projectTimeline",enableHoverEffect:!0},null,8,["modelValue","inputStyle","formStyle"])):(S(),n("div",le,c(s.project.timeline||"Not specified"),1))]),o("div",re,[t[20]||(t[20]=o("h3",{class:"detail-title"},"Location",-1)),s.isOwner?(S(),r(b,{key:0,"onUpdate:modelValue":t[7]||(t[7]=e=>v.updateProjectDebounced("location",e)),modelValue:a.form.location,placeholder:"e.g. Remote, New York, etc.",inputStyle:a.detailStyle,formStyle:a.formStyle,id:"projectLocation",enableHoverEffect:!0},null,8,["modelValue","inputStyle","formStyle"])):(S(),n("div",ce,c(s.project.location||"Not specified"),1))])]),o("div",de,[o("div",he,[t[21]||(t[21]=o("h3",{class:"section-title"},"Skills Needed",-1)),s.isOwner?(S(),n("button",{key:0,class:"add-skill-button",onClick:t[8]||(t[8]=e=>a.showSkillSelector=!0)}," Add Skill ")):l("",!0)]),o("div",pe,[(S(!0),n(u,null,m(s.project.skills,(e,t)=>(S(),r(k,{key:t,expertise:e.label||e,isOwner:s.isOwner,"onRemove:expertise":e=>v.removeSkill(t)},null,8,["expertise","isOwner","onRemove:expertise"]))),128)),s.project.skills&&0!==s.project.skills.length?l("",!0):(S(),n("div",ue," No skills specified for this project "))])]),a.showSkillSelector?(S(),n("div",me,[o("div",ge,[o("div",ye,[t[22]||(t[22]=o("h3",null,"Add Skill",-1)),o("button",{class:"close-button",onClick:t[9]||(t[9]=e=>a.showSkillSelector=!1)},"Ã")]),o("div",we,[h(o("input",{type:"text","onUpdate:modelValue":t[10]||(t[10]=e=>a.expertiseSearch=e),onInput:t[11]||(t[11]=(...e)=>v.searchExpertises&&v.searchExpertises(...e)),placeholder:"Search for skills or roles...",class:"expertise-search-input"},null,544),[[g,a.expertiseSearch]])]),a.searchResults.length>0?(S(),n("div",fe,[(S(!0),n(u,null,m(a.searchResults,(e,t)=>(S(),n("div",{key:t,class:"expertise-result-item",onClick:t=>v.selectExpertise(e)},[o("span",ve,c(e.label),1),o("span",{class:d(["expertise-result-type",v.getExpertiseTypeClass(e.name)])},c(v.getExpertiseType(e.name)),3)],8,Se))),128))])):l("",!0),a.expertiseSearch&&!a.isLoading?(S(),n("div",be,[t[24]||(t[24]=o("p",null,"No matching expertise found. Create a new one?",-1)),o("div",ke,[o("label",null,[h(o("input",{type:"radio","onUpdate:modelValue":t[12]||(t[12]=e=>a.newExpertiseType=e),value:"skill",name:"expertiseType"},null,512),[[w,a.newExpertiseType]]),t[23]||(t[23]=y(" Skill ",-1))])]),o("button",{class:"create-expertise-button",onClick:t[13]||(t[13]=(...e)=>v.createNewSkill&&v.createNewSkill(...e)),disabled:!a.expertiseSearch||!a.newExpertiseType},' Create "'+c(a.expertiseSearch)+'" as skill ',9,je)])):l("",!0),a.isLoading?(S(),n("div",Ce,"Loading...")):l("",!0)])])):l("",!0)])}],["__scopeId","data-v-2d1ae22a"]])},data(){var e,t;return{projectId:this.$route.params.projectId,businessId:this.$route.params.businessId||null,agenticChatId:null,chat:null,messages:[],newMessage:"",assistantTyping:!1,initialLoading:!0,nonPersistentStore:a,suggestions:[],isMobile:window.innerWidth<=768,chatId:this.$route.params.chat_id,showDropdown:!1,showAttachmentOptions:!1,attachmentOptionsHeight:"0px",renameLoading:!1,isEditing:!1,newName:"",showRenamePopup:!1,filePreviews:[],files:[],typewriteRunning:!1,typewriteBuffer:"",currentUser:null==(t=null==(e=a)?void 0:e.state)?void 0:t.currentUser,mobileProfileVisible:!1,debouncedRequestSuggestions:null,project:null,showProjectDetails:!0,isOwner:!1,activeStreamingMessages:new Set,waitingForResponse:!1,streamTimeouts:new Map,streamingMessages:new Map,streamingContent:new Map,hasHadStreamingMessages:!1,currentRunId:null,activeRuns:new Set}},computed:{hasAgenticChatSystem:()=>!0,shouldShowProjectDetails(){return this.showProjectDetails&&this.project&&this.project.persona}},methods:{async loadAgenticChat(){var e,t,s,i;try{this.businessId||(this.businessId=(null==(t=null==(e=a.state.currentUser)?void 0:e.business)?void 0:t.id)||null),this.isOwner=!((null==(i=null==(s=a.state.currentUser)?void 0:s.business)?void 0:i.id)!=this.businessId),this.project=await _(this.projectId,this.businessId);const n=await z(this.projectId);this.agenticChatId=n.id,this.chat=await D(this.agenticChatId);const o=await V(this.agenticChatId);this.messages=o.messages||[]}catch(n){}finally{this.initialLoading=!1}},async loadMessages(e=!1,t=!1){try{let e=[],t=!1;const s=await V(this.agenticChatId),{messages:i,loading:a}=s;e=i,t=a;const n=this.shouldUseTypewriterEffect(e),o=n&&(null==e?void 0:e.length)>0?e[e.length-1]:null;let l="",r=null;
1n&&!this.typewriteRunning&&o&&"assistant"===o.type&&(l=o.content,r=o.id,e[e.length-1].content=""),this.messages=e,this.chat.agenticChatSystemId&&r&&this.typewriterEffect(r,l)}catch(s){}finally{this.initialLoading=!1}},typewriterEffect(e,t){if(this.typewriteRunning)return;this.typewriteRunning=!0,this.typewriteBuffer="";const s=this.messages.findIndex(t=>t.id===e);if(-1===s)return;let i=0;const a=()=>{i<t.length?(this.typewriteBuffer+=t.charAt(i),this.messages[s].content=this.typewriteBuffer,i++,setTimeout(a,10)):(this.typewriteRunning=!1,this.typewriteBuffer=""),this.scrollToBottom()};a()},async handleSubmit(){if(this.assistantTyping||this.activeStreamingMessages.size>0)return;if(""===this.newMessage.trim()&&0===this.files.length)return;const e=this.newMessage;this.newMessage="",this.suggestions=[],this.messages.push({type:"user",content:e,files:this.filePreviews,userId:a.state.currentUser.id});try{const t={content:e,type:"user",files:this.filePreviews};this.hasAgenticChatSystem&&(this.assistantTyping=!0,this.waitingForResponse=!0),this.showAttachmentOptions=!1,this.scrollToBottom(),this.hasAgenticChatSystem&&await U(this.agenticChatId,t),this.scrollToBottom(),this.filePreviews=[],this.files=[]}catch(t){this.assistantTyping=!1,this.waitingForResponse=!1}},handleAcceptClick(){this.newName.trim()&&(this.renameLoading=!0,this.showRenamePopup=!1,this.newName="",this.renameLoading=!1)},handleCancelClick(){this.showRenamePopup=!1,this.newName=""},closeDropdown(){this.showDropdown=!1},useSuggestion(e){this.newMessage=e},handleShowFormMode(){alert("Form mode is available in your main onboarding chat. This is a project-specific chat focused on persona building.")},toggleMobileView(){this.mobileProfileVisible=!this.mobileProfileVisible},async handleProjectUpdate(e){try{await R(e)&&(this.project={...this.project,...e}),this.agenticChatId&&await E(this.agenticChatId,[{type:"text",value:"Project updated: ".concat(JSON.stringify(e))}])}catch(t){}},async regeneratePersona(){try{this.newMessage="Please regenerate the project persona based on the latest project information.",await this.handleSubmit()}catch(e){}},scrollToBottom(){this.$nextTick(()=>{const e=this.$el.querySelector(".chat-content");e&&(e.scrollTop=e.scrollHeight)})},handleChatUpdate(e){const t=this;if(e){if(this.activeRuns.size>0||this.streamingMessages.size>0)return;t.loadMessages(!1).then(()=>{this.hasAgenticChatSystem&&this.agenticChatId&&!a.state.isMockingUser?T.socket.emit("agentic-chat-read",this.agenticChatId):!this.hasAgenticChatSystem&&this.chatId&&T.socket.emit("chat-read",this.chatId),t.scrollToBottom()})}},updateBusinessProjectBySocket(e){e&&e.id&&this.project&&this.project.id===e.id&&(this.project={...this.project,...e})},handleChatRunStart(e){var t;null==(t=window.log)||t.call(window,"ProjectPersonaChat - Chat Run Started",{runId:null==e?void 0:e.run_id,projectId:this.projectId,agenticChatId:this.agenticChatId}),e&&e.run_id&&(this.currentRunId=e.run_id,this.activeRuns.add(e.run_id),this.assistantTyping=!0,this.waitingForResponse=!0)},handleChatRunComplete(e){var t;null==(t=window.log)||t.call(window,"ProjectPersonaChat - Chat Run Completed",{runId:null==e?void 0:e.run_id,projectId:this.projectId,agenticChatId:this.agenticChatId,hadStreamingMessages:this.hasHadStreamingMessages}),e&&e.run_id&&(this.activeRuns.delete(e.run_id),this.currentRunId===e.run_id&&
1(this.currentRunId=null),this.assistantTyping=!1,this.waitingForResponse=!1,this.finalizeStreamingMessages(),this.cleanupStreamingState(),this.$nextTick(()=>{this.loadMessages(!1,!0),this.$forceUpdate(),this.scrollToBottom()}))},handleMessageStream(e){var t;if(!e||!e.platform_message_id||!e.content)return;const{platform_message_id:s,content:i,chatId:a,agenticChatSystemId:n}=e;null==(t=window.log)||t.call(window,"ProjectPersonaChat - Message Stream Received",{platformMessageId:s,contentLength:i.length,chatId:a,agenticChatSystemId:n,currentAgenticChatId:this.agenticChatId});if(!(n===this.agenticChatId))return;this.hasHadStreamingMessages=!0;const o=!this.activeStreamingMessages.has(s);o&&this.activeStreamingMessages.add(s),this.streamTimeouts.has(s)&&clearTimeout(this.streamTimeouts.get(s));const l=setTimeout(()=>{this.handleStreamEnd(s)},2e3);this.streamTimeouts.set(s,l),this.streamingMessages.set(s,{content:i,chatId:a,agenticChatSystemId:n});const r=this.messages.findIndex(e=>e.platform_message_id===s);if(r>=0)this.streamingContent.set(r,i),this.$forceUpdate(),this.$nextTick(()=>{this.scrollToBottom()});else{const e={id:"streaming_".concat(s),platform_message_id:s,type:"assistant",content:"",isStreamingPlaceholder:!0,timestamp:(new Date).toISOString()};this.messages.push(e),this.streamingContent.set(this.messages.length-1,i),this.scrollToBottom()}const c=i&&i.trim().length>0;c&&this.waitingForResponse&&(this.waitingForResponse=!1),c&&o&&(this.assistantTyping=!1)},handleStreamEnd(e){var t;null==(t=window.log)||t.call(window,"ProjectPersonaChat - Stream End Detected",{platformMessageId:e,activeStreams:this.activeStreamingMessages.size,activeRuns:this.activeRuns.size}),this.activeStreamingMessages.delete(e),this.streamTimeouts.delete(e),0===this.activeStreamingMessages.size&&this.activeRuns.size>0&&(this.assistantTyping=!0),0===this.activeStreamingMessages.size&&0===this.activeRuns.size&&this.finalizeStreamingMessages()},finalizeStreamingMessages(){var e;null==(e=window.log)||e.call(window,"ProjectPersonaChat - Finalizing Streaming Messages",{streamingContentSize:this.streamingContent.size,messagesWithPlaceholders:this.messages.filter(e=>e.isStreamingPlaceholder).length}),this.messages.forEach((e,t)=>{e.isStreamingPlaceholder&&this.streamingContent.has(t)&&(e.content=this.streamingContent.get(t),e.isStreamingPlaceholder=!1,delete e.platform_message_id)}),this.$forceUpdate()},cleanupStreamingState(){var e;null==(e=window.log)||e.call(window,"ProjectPersonaChat - Cleaning Up Streaming State",{streamingMessagesCount:this.streamingMessages.size,streamingContentCount:this.streamingContent.size,activeStreamingCount:this.activeStreamingMessages.size,activeRunsCount:this.activeRuns.size}),this.streamingMessages.clear(),this.streamingContent.clear(),this.activeStreamingMessages.clear();for(const t of this.streamTimeouts.values())clearTimeout(t);this.streamTimeouts.clear(),this.currentRunId=null,this.activeRuns.clear(),this.waitingForResponse=!1},shouldUseTypewriterEffect:e=>!e.some(e=>"user"===e.type)},async mounted(){await this.loadAgenticChat(),this.scrollToBottom(),T.socket.on("sunny-update",this.handleChatUpdate),this.agenticChatId&&!a.state.isMockingUser&&T.socket.emit("agentic-chat-read",this.agenticChatId),T.socket.on("business-project-update",this.updateBusinessProjectBySocket),T.socket.on("message-stream",this.handleMessageStream),T.socket.on("chat_run_start",this.handleChatRunStart),T.socket.on("chat_run_complete",this.handleChatRunComplete),window.addEventListener("resize",()=>{this.isMobile=window.innerWidth<=768})},beforeUnmount(){T.socket.off("sunny-update",this.handleChatUpdate),T.socket.off("business-project-update"),T.socket.off("message-stream",this.handleMessageStream),T.socket.off("chat_run_start",this.handleChatRunStart),T.socket.off("chat_run_complete",this.handleChatRunComplete),window.removeEventListener("resize",()=>{this.isMobile=window.innerWidth<=768}),this.cleanupStreamingState()}},[["render",function(e,t,s,i,a,p){var y,w;const v=f("UserMessage"),b=f("AssistantMessage"),k=f("FilePreview"),I=f("GenericPopup"),T=f("ProjectDetailVie
1w");return S(),n("div",{class:"main-container",onClick:t[10]||(t[10]=(...e)=>p.closeDropdown&&p.closeDropdown(...e))},[a.isMobile&&a.mobileProfileVisible?l("",!0):(S(),n("div",{key:0,class:d(["chat-container",{"chat-with-details":a.showProjectDetails&&(null==(y=a.project)?void 0:y.persona)}])},[a.initialLoading?(S(),r(L,{key:0,size:70,width:7,indeterminate:"",color:"primary",class:"loading-indicator"})):l("",!0),a.initialLoading?l("",!0):(S(),n("div",Pe,[...t[11]||(t[11]=[o("div",{class:"chat-title"},"Persona Builder",-1),o("a",{href:"https://meetings.hubspot.com/katie841/customer-discovery-calls?uuid=210b544c-52a4-46a1-a90c-b246fadf6b3f",target:"_blank",class:"book-call-button"}," Book a Call ",-1)])])),a.initialLoading?l("",!0):(S(),n("div",xe,[(S(!0),n(u,null,m(a.messages,(e,t)=>(S(),n(u,{key:t},["user"!==e.type||!p.hasAgenticChatSystem&&a.nonPersistentStore.state.currentUser.id!==e.userId?"user"===e.type&&a.nonPersistentStore.state.currentUser.id!==e.userId?(S(),r(v,{key:1,align:"left",message:e,class:"message-row"},null,8,["message"])):(S(),r(b,{key:2,message:e,chat:a.chat,class:"message-row",loading:!1,isStreaming:e.isStreamingPlaceholder&&a.streamingContent.has(t),streamingContent:a.streamingContent.get(t)||"",hideTools:["update_user"],onShowFormMode:p.handleShowFormMode},null,8,["message","chat","isStreaming","streamingContent","onShowFormMode"])):(S(),r(v,{key:0,align:"right",message:e,class:"message-row"},null,8,["message"]))],64))),128)),a.assistantTyping?(S(),r(b,{key:0,loading:a.assistantTyping,isStreaming:!1,streamingContent:"",class:"message-row"},null,8,["loading"])):l("",!0)])),a.initialLoading?l("",!0):(S(),n("footer",Ie,[a.suggestions.length>0?(S(),n("div",Me,[o("div",Te,[(S(!0),n(u,null,m(a.suggestions,(e,t)=>(S(),n("button",{key:t,class:"suggestion-item",onClick:t=>p.useSuggestion(e)},c(e),9,Re))),128))])])):l("",!0),o("form",{class:"attachment-bar",onSubmit:t[6]||(t[6]=M((...e)=>p.handleSubmit&&p.handleSubmit(...e),["prevent"]))},[o("div",{class:d(["attachment-options",{closed:!a.showAttachmentOptions}]),style:C({height:a.attachmentOptionsHeight})},[o("div",Ee,[o("button",{type:"button",class:"attachment-button",onClick:t[0]||(t[0]=(...t)=>e.triggerPhotoUpload&&e.triggerPhotoUpload(...t)),tabindex:"0"},[...t[12]||(t[12]=[o("img",{loading:"lazy",src:P,class:"attachment-icon",alt:"Upload photos"},null,-1),o("span",{class:"label-small-regular"},"Photos",-1)])]),o("button",{type:"button",class:"attachment-button",onClick:t[1]||(t[1]=(...t)=>e.triggerDocumentUpload&&e.triggerDocumentUpload(...t)),tabindex:"0"},[...t[13]||(t[13]=[o("img",{loading:"lazy",src:N,class:"attachment-icon",alt:"Upload document"},null,-1),o("span",{class:"label-small-regular"},"Document",-1)])]),o("button",{type:"button",class:"attachment-button",onClick:t[2]||(t[2]=(...t)=>e.handleCameraCapture&&e.handleCameraCapture(...t)),tabindex:"0"},[...t[14]||(t[14]=[o("img",{loading:"lazy",src:x,class:"attachment-icon-camera",alt:"Take photo with camera"},null,-1),o("span",{class:"label-small-regular"},"Camera",-1)])])])],6),o("input",{type:"file",ref:"photoInput",accept:"image/*",onChange:t[3]||(t[3]=t=>e.handleFileChange("photos")),style:{display:"none"},multiple:""},null,544),o("input",{type:"file",ref:"documentInput",onChange:t[4]||(t[4]=t=>e.handleFileChange("documents")),style:{display:"none"},multiple:""},null,544),a.filePreviews.length?(S(),n("div",Ue,[(S(!0),n(u,null,m(a.filePreviews,(t,s)=>(S(),n("div",{key:s,class:"chat-file-preview"},[j(k,{file:t},null,8,["file"]),o("button",{type:"button",onClick:t=>e.removeFile(s)},"Remove",8,Ve)]))),128))])):l("",!0),o("div",_e,[o("div",ze,[t[15]||(t[15]=o("label",{for:"promptInput",class:"visually-hidden"},null,-1)),h(o("input",{type:"text",id:"promptInput",class:"label-large-regular",placeholder:"Enter your message","onUpdate:modelValue":t[5]||(t[5]=e=>a.newMessage=e),autocomplete:"off"},null,512),[[g,a.newMessage]])]),o("button",{type:"submit",class:d(["send-button",{disabled:a.assistantTyping||a.activeStreamingMessages.size>0}]),disabled:a.assistantTyping||a.activeStreamingMessages.size>0||""===a.newMessage.trim()&&0===a.files.length,"aria-label":"Send message"},[a.assistantTyping||0!==a.activeStreamingMessages.size?(S(),n("div",Oe,[...t[16]||(t[16]=[o("div",{class:"dot"},null,-1),o("div",{class:"dot"},null,-1),o("div",{class:"dot"},null,-1)])])):(S(),n("img",Le))],10,De)])],32)])),j(I,{show:a.showRenamePopup,modelValue:a.newName,"onUpdate:modelValue":t[7]||(t[7]=e=>a.newName=e),inputPlaceholder:"Enter new chat name",inputLabel:"Chat Name",inputId:"newChatName",loading:a.renameLoading,cancelButtonText:"Cancel",acceptButtonText:"Accept",onAccept:p.handleAcceptClick,onCancel:p.handleCancelClick}
1,null,8,["show","modelValue","loading","onAccept","onCancel"])],2)),p.shouldShowProjectDetails?(S(),n("div",Ae,[o("div",Be,[t[17]||(t[17]=o("div",{class:"details-title"},"Project Details",-1)),a.isMobile?(S(),n("button",{key:0,class:"toggle-view-button",onClick:t[8]||(t[8]=(...e)=>p.toggleMobileView&&p.toggleMobileView(...e))}," Back to Chat ")):l("",!0)]),j(T,{project:a.project,isOwner:a.isOwner,businessId:String(a.businessId),"onUpdate:project":p.handleProjectUpdate,onRegeneratePersona:p.regeneratePersona},null,8,["project","isOwner","businessId","onUpdate:project","onRegeneratePersona"])])):l("",!0),a.isMobile&&a.showProjectDetails&&(null==(w=a.project)?void 0:w.persona)&&!a.mobileProfileVisible?(S(),n("button",{key:2,class:"mobile-toggle-button",onClick:t[9]||(t[9]=(...e)=>p.toggleMobileView&&p.toggleMobileView(...e))}," View Project Details ")):l("",!0)])}],["__scopeId","data-v-f388759f"]]);export{Fe 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.