1import{b1 as L,b2 as N,r as w,b as k,V as j,U as B,bc as D,d as z,e as a,o as n,g as C,l as h,f as s,x as S,n as f,t as p,F as I,i as E,j as v,h as U,T as F,b7 as H,_ as O}from"./NFnIG1Q0.js";const P={class:"relative"},G={class:"bg-white rounded-xl shadow-2xl border border-gray-200 w-72 overflow-hidden flex flex-col max-h-[450px]"},R={class:"px-4 py-3 border-b border-gray-100 bg-gray-50 flex items-center justify-between"},X={class:"flex-1 overflow-y-auto p-2 custom-scrollbar min-h-[120px]"},q={key:0,class:"text-center py-10 text-xs text-gray-400"},J={key:1,class:"space-y-1"},K=["onClick"],Q={key:0,class:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20"},W={class:"min-w-0 flex-1"},Y={class:"flex items-center gap-1.5 min-w-0"},Z={class:"text-[11px] font-bold text-gray-900 truncate"},ee=["src"],te={class:"flex items-center justify-between mt-0.5"},oe={class:"text-[9px] text-gray-500 font-medium truncate"},se={key:0,class:"text-[8px] bg-green-100 text-green-700 px-1 rounded font-bold uppercase"},ie={key:1,class:"text-[8px] bg-gray-200 text-gray-600 px-1 rounded font-bold uppercase"},ae={class:"p-3 bg-gray-50 border-t border-gray-100"},ne=["disabled"],re={key:0,class:"absolute bottom-full right-0 mb-2 w-64 p-2 bg-amber-50 border border-amber-200 rounded-lg shadow-lg z-[60]"},le={class:"text-[10px] font-medium text-amber-800 leading-tight"},de=L({__name:"AIChatSelectionMenu",props:{voices:{},currentText:{}},setup(A){const x=A,{openSidebar:T,loadCompareVoices:V}=N(),i=w([]),d=w("");function b(e){return e?e.voice_tts_uuid?`https://cdn.soundranks.com/sampleGeneratedTTS/${e.voice_service}-${e.voice_speaker_id}-${e.voice_tts_uuid}.mp3`:e.voice_audio_url?e.voice_audio_url:e.audio_url?e.audio_url:x.currentText===H?`https://cdn.soundranks.com/sampleAudioTTS/${e.voice_service}-${e.voice_speaker_id}.mp3`:"":""}function u(e){return!!b(e)}const c=k(()=>x.voices.map(e=>e?.voice?e.voice:e).filter(e=>e&&(e.voice_id||e.id)&&e.voice_name));j(()=>{m()}),B(()=>c.value,()=>{i.value=i.value.filter(e=>c.value.some(o=>(o.voice_id||o.id)===e))},{deep:!0});function m(){i.value=c.value.filter(e=>u(e)).slice(0,25).map(e=>e.voice_id||e.id)}const _=k(()=>i.value.length>=25);function M(e){if(!u(e))return;const o=e.voice_id||e.id,r=i.value.indexOf(o);r>-1?i.value.splice(r,1):_.value||i.value.push(o)}function $(){if(i.value.length===0)return;const e=[];let o=0;if(i.value.forEach(r=>{const l=c.value.find(g=>(g.voice_id||g.id)===r);if(!l)return;let t=b(l);t?e.push({type:"voice",data:l,audioUrl:t}):o++}),e.length===0){d.value="None of the selected voices have generated audio yet. Please generate audio first.",setTimeout(()=>d.value="",4e3);return}o>0&&(d.value=`Added ${e.length} of ${i.value.length} voices to chat. ${o} skipped (no generated audio).`,setTimeout(()=>d.value="",4e3)),V(e,o),T()}function y(e){if(!e?.voice_language_codes)return null;const o=Array.isArray(e.voice_language_codes)?e.voice_language_codes:[e.voice_language_code],r=o.find(t=>t&&t.toLowerCase().includes("us"))||o[0];if(!r)return null;const l=r.split("-");return l.length>1?l[1].toUpperCase():null}return(e,o)=>{const r=D("VDropdown"),l=z("close-popper");return n(),a("div",P,[C(r,{triggers:["click"],"auto-hide":!0,distance:10,flip:!1,placement:"bottom-end",onShow:m},{popper:h(()=>[s("div",G,[s("div",R,[o[0]||(o[0]=s("h3",{class:"text-xs font-bold text-gray-900 uppercase tracking-wider"},"Select Voices for Chat",-1)),s("span",{class:f(["text-[10px] font-bold",_.value?"text-red-500":"text-indigo-600"])},p(i.value.length)+"/25 ",3)]),s("div",X,[c.value.length===0?(n(),a("div",q," No voices available to select. ")):(n(),a("div",J,[(n(!0),a(I,null,E(c.value,t=>(n(),a("div",{key:t.voice_id||t.id,onClick:g=>M(t),class:f(["group flex items-center gap-3 p-2 rounded-lg transition-colors",[i.value.includes(t.voice_id||t.id)?"bg-indigo-50 border border-indigo-100":"border border-transparent",u(t)?"cursor-pointer hover:bg-gray-50":"opacity-60 cursor-not-allowed bg-gray-50/50"]])},[s("div",{class:f(["w-4 h-4 rounded border flex items-center justify-center transition-colors shrink-0",[i.value.includes(t.voice_id||t.id)?"bg-indigo-600 border-indigo-600 text-white":"bg-white border-gray-300",u(t)?"":"hidden",!i.value.includes(t.voice_id||t.id)&&_.value?"opacity-50":""]])},[i.value.includes(t.voice_id||t.id)?(n(),a("svg",Q,[...o[1]||(o[1]=[s("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):v("",!0)],2),s("div",W,[s("div",Y,[s("p",Z,p(t.voice_name),1),y(t)?(n(),a("img",{key:0,src:`https://flagsapi.com/${y(t)}/flat/16.png`,class:"h-3 shrink-0"},null,8,ee)):v("",!0)]),s("div",te,[s("p",oe,p(t.voice_service),1),u(t)?(n(),a("span",se,"Ready")):(n(),a("span",ie,"No Audio"))])])],10,K))),128))]))]),s("div",ae,[U((n(),a("button",{onClick:$,disabled:i.value.length===0,class:"w-full py-2 px-4 bg-indigo-600 hover:bg-indigo-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white text-xs font-bold rounded-lg transition-all shadow-md flex items-center justify-center gap-2"}
1,[...o[2]||(o[2]=[s("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{d:"M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z"}),s("path",{d:"M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h2a2 2 0 002-2V9a2 2 0 00-2-2h-1z"})],-1),S(" Chat in Casting Studio ",-1)])],8,ne)),[[l]])])])]),default:h(()=>[o[3]||(o[3]=s("button",{class:"flex items-center gap-1.5 px-3 py-2 text-xs font-bold text-white bg-indigo-600 rounded-lg hover:bg-indigo-700 transition-colors shadow-sm whitespace-nowrap",title:"Select voices for AI Chat"},[s("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})]),S(" Compare voices with Chat ")],-1))]),_:1}),C(F,{name:"fade"},{default:h(()=>[d.value?(n(),a("div",re,[s("p",le,p(d.value),1)])):v("",!0)]),_:1})])}}}),ue=Object.assign(O(de,[["__scopeId","data-v-9f6c32c8"]]),{__name:"SharedAIChatSelectionMenu"});export{ue as _};
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.