1import{b1 as U,H as j,b as v,r as f,U as O,bc as D,N as E,o as i,l as h,f as s,g as F,n as p,k as z,e as l,x as S,t as _,F as R,i as H,j as B,P as I,b7 as X,_ as q}from"./JPKKIjon.js";import{u as J}from"./BRb1YIsW.js";const K={class:"relative"},Q={class:"inline-block"},W={key:0,class:"w-3.5 h-3.5 opacity-80",fill:"currentColor",viewBox:"0 0 20 20"},Y={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Z={class:"bg-white rounded-xl shadow-2xl border border-gray-200 w-72 overflow-hidden flex flex-col max-h-[450px]"},ee={class:"px-4 py-3 border-b border-gray-100 bg-gray-50 flex items-center justify-between"},te={class:"flex-1 overflow-y-auto p-2 custom-scrollbar min-h-[120px]"},oe={key:0,class:"text-center py-10 text-xs text-gray-400"},se={key:1,class:"space-y-1"},ae=["onClick"],ne={key:0,class:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20"},re={class:"min-w-0 flex-1"},ie={class:"flex items-center gap-1.5 min-w-0"},le={class:"text-[11px] font-bold text-gray-900 truncate"},ce=["src"],de={class:"flex items-center justify-between mt-0.5"},ue={class:"text-[9px] text-gray-500 font-medium truncate"},pe={key:1,class:"text-[8px] bg-gray-100 text-gray-500 px-1 rounded font-bold uppercase"},_e={class:"p-3 bg-gray-50 border-t border-gray-100 flex flex-col gap-2"},ge=["disabled"],ve=U({__name:"BatchAudioSelectionMenu",props:{voices:{},currentText:{}},setup(C){const g=C,{startBatch:y}=J(),{isUserLogged:T,openLoginModal:M,openSubscribeModal:V,userProfile:A}=j(),x=v(()=>(A.value?.account_level||0)>0),a=f([]),c=f({});f("");const u=f(!1);function L(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:g.currentText===X?`https://cdn.soundranks.com/sampleAudioTTS/${e.voice_service}-${e.voice_speaker_id}.mp3`:"":""}function m(e){return!!L(e)}const d=v(()=>g.voices.map(e=>e?.voice?e.voice:e).filter(e=>e&&(e.voice_id||e.id)&&e.voice_name)),w=v(()=>d.value.filter(e=>!m(e))),b=v(()=>a.value.length>=25);function $(){const e=w.value;a.value=e.slice(0,25).map(t=>t.voice_id||t.id),c.value={}}O(()=>d.value,()=>{a.value=a.value.filter(e=>d.value.some(t=>(t.voice_id||t.id)===e))},{deep:!0});function G(e){const t=e.voice_id||e.id,n=a.value.indexOf(t),r=m(e);n>-1?(a.value.splice(n,1),delete c.value[t]):b.value||(a.value.push(t),r&&(c.value[t]=!0))}function P(e){if(!x.value){T.value?V({title:"Batch Generation (Pro)",description:"Upgrade to PRO to generate multiple voices simultaneously and unlock batch auditioning."}):M({title:"Batch Generation (Pro)",description:"Sign in and upgrade to PRO to generate multiple voices simultaneously."});return}const t=w.value;if(t.length>0&&t.length<7){const n=t.map(r=>({...r,sample_text:g.currentText,regenerate:!1,createSnippet:!1,directory:"sampleGeneratedTTS",fileName:`${r.voice_service}-${r.voice_speaker_id}-{{voice_tts_uuid}}.mp3`}));y(n);return}$(),u.value=!u.value}function N(){if(a.value.length===0)return;const e=[];a.value.forEach(t=>{const n=d.value.find(r=>(r.voice_id||r.id)===t);n&&e.push({...n,sample_text:g.currentText,regenerate:!!c.value[t],createSnippet:!1,directory:"sampleGeneratedTTS",fileName:`${n.voice_service}-${n.voice_speaker_id}-{{voice_tts_uuid}}.mp3`})}),u.value=!1,y(e)}function k(e){if(!e?.voice_language_codes)return null;const t=Array.isArray(e.voice_language_codes)?e.voice_language_codes:[e.voice_language_code],n=t.find(o=>o&&o.toLowerCase().includes("us"))||t[0];if(!n)return null;const r=n.split("-");return r.length>1?r[1].toUpperCase():null}return(e,t)=>{const n=D("VDropdown"),r=I;return i(),E(r,null,{fallback:h(()=>[...t[6]||(t[6]=[s("div",{class:"relative inline-block"},[s("button",{class:"flex items-center gap-1.5 px-3 py-2 text-xs font-bold transition-colors shadow-sm whitespace-nowrap text-gray-600 bg-gray-200 hover:bg-gray-300 rounded-lg cursor-not-allowed opacity-80",title:"Loading..."},[s("svg",{class:"w-3.5 h-3.5 opacity-80",fill:"currentColor",viewBox:"0 0 20 20"},[s("path",{"fill-rule":"evenodd",d:"M10 2a5 5 0 00-5 5v2a2 2 0 00-2 2v5a2 2 0 002 2h10a2 2 0 002-2v-5a2 2 0 00-2-2H9V7a1 1 0 012 0v2h2V7a3 3 0 00-3-3z","clip-rule":"evenodd"})]),S(" Batch Generate ")])],-1)])]),default:h(()=>[s("div",K,[F(n,{shown:u.value,"onUpdate:shown":t[0]||(t[0]=o=>u.value=o),triggers:[],"auto-hide":!0,distance:10,flip:!1,placement:"bottom-end"},{popper:h(()=>[s("div",Z,[s("div",ee,[t[4]||(t[4]=s("h3",{class:"text-xs font-bold text-gray-900 uppercase tracking-wider"},"Select Voices",-1)),s("span",{class:p(["text-[10px] font-bold",b.value?"text-red-500":"text-purple-600"])},_(a.value.length)+"/25 ",3)]),s("div",te,[d.value.length===0?(i(),l("div",oe," No voices available. ")):(i(),l("div",se,[(i(!0),l(R,null,H(d.value,o=>(i(),l("div",{key:o.voice_id||o.id,onClick:fe=>G(o),class:p(["group flex items-center gap-3 p-2 rounded-lg transition-colors cursor-pointer hover:bg-gray-50",a.value.includes(o.voice_id||o.id)?"bg-purple-50 border border-purple-100":"border border-transparent"])},[s("div",{class:p(["w-4 h-4 rounded border flex items-center justify-center transition-colors shrink-0",[a.value.includes(o.voice_id||o.id)?"bg-purple-600 border-purple-600 text-white":"bg-white border-gray-300",!a.value.includes(o.voice_id||o.id)&&b.value?"opacity-50":""]])},[a.value.includes(o.voice_id||o.id)?(i(),l("svg",ne,[...t[5]||(t[5]=[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)])])):B("",!0)],2),s("div",re,[s("div",ie,[s("p",le,_(o.voice_name),1),k(o)?(i(),l("img",{key:0,src:`https://flagsapi.com/${k(o)}/flat/16.png`,class:"h-3 shrink-0"},null,8,ce)):B("",!0)]),s("div",de,[s("p",ue,_(o.voice_service),1),m(o)?(i(),l("span",{key:0,class:p(["text-[8px] bg-green-100 text-green-700 px-1 rounded font-bold uppercase transition-colors",c.value[o.voice_id||o.id]?"bg-amber-100 text-amber-700":""])},_(c.value[o.voice_id||o.id]?"Regenerate":"Generated"),3)):(i(),l("span",pe,"Pending"))])])],10,ae))),128))]))]),s("div",_e,[s("button",{onClick:N,disabled:a.value.length===0,class:"w-full py-2 px-4 bg-purple-600 hover:bg-purple-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"}," Start Selected ("+_(a.value.length)+") ",9,ge)])])]),default:h(()=>[s("div",Q,[s("button",{onClick:z(P,["stop","prevent"]),class:p(["flex items-center gap-1.5 px-3 py-2 text-xs font-bold transition-colors shadow-sm whitespace-nowrap",x.value?"text-white bg-purple-600 hover:bg-purple-700 rounded-lg":"text-gray-600 bg-gray-200 hover:bg-gray-300 rounded-lg"]),title:"Batch Generate Audio"},[x.value?(i(),l("svg",Y,[...t[2]||(t[2]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"},null,-1)])])):(i(),l("svg",W,[...t[1]||(t[1]=[s("path",{"fill-rule":"evenodd",d:"M10 2a5 5 0 00-5 5v2a2 2 0 00-2 2v5a2 2 0 002 2h10a2 2 0 002-2v-5a2 2 0 00-2-2H9V7a1 1 0 012 0v2h2V7a3 3 0 00-3-3z","clip-rule":"evenodd"},null,-1)])])),t[3]||(t[3]=S(" Batch Generate ",-1))],2)])]),_:1},8,["shown"])])]),_:1})}}}),me=Object.assign(q(ve,[["__scopeId","data-v-dccfeaf3"]]),{__name:"SharedBatchAudioSelectionMenu"});export{me 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.