1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5627],{20609:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(15317).A)("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]])},60005:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(15317).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},75627:(e,t,r)=>{r.r(t),r.d(t,{default:()=>D});var a=r(34871),s=r(42814),n=r(55408),o=r(8589),l=r(33928),i=r(88458),d=r(21586),c=r(87045),u=r(44837),x=r(57418),m=r(15317);let p=(0,m.A)("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]),h=(0,m.A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var f=r(69919),g=r(52776);let b=(0,m.A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var v=r(27810),j=r(20609),y=r(60005),N=r(98583),k=r(49334),w=r(33817),A=r(30751),z=r(12043),R=r(93308),S=r(49199);function C(e){let{audioUrl:t,duration:r,onRemove:n,onReRecord:o,t:x}=e,m=(0,A.useRef)(null),[p,h]=(0,A.useState)(!1),[f,g]=(0,A.useState)([]);(0,A.useEffect)(()=>{let e=!1;return async function(){try{let r=new AudioContext,a=await fetch(t),s=await a.arrayBuffer(),n=(await r.decodeAudioData(s)).getChannelData(0),o=Math.floor(n.length/50),l=[];for(let e=0;e<50;e++){let t=0,r=e*o;for(let e=r;e<r+o;e++)t+=Math.abs(n[e]);l.push(t/o)}let i=Math.max(...l);e||g(i>0?l.map(e=>e/i):l),await r.close()}catch(t){e||g(Array.from({length:50},(e,t)=>.5*Math.sin(t/50*Math.PI*4)+.5))}}(),()=>{e=!0}},[t]),(0,A.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>h(!1);return e.addEventListener("ended",t),()=>e.removeEventListener("ended",t)},[]);let b=f.length>0?f:Array.from({length:50},(e,t)=>.5*Math.sin(t/50*Math.PI*4)+.5);return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"relative rounded-2xl border border-border/30 bg-muted/10 p-5 sm:p-6",children:[(0,a.jsx)("button",{type:"button",onClick:n,"aria-label":x("removeAudio"),className:"absolute -right-2.5 -top-2.5 z-10 flex size-9 items-center justify-center rounded-full border border-border/30 bg-background text-muted-foreground shadow-sm hover:bg-muted hover:text-foreground transition-all cursor-pointer",children:(0,a.jsx)(l.A,{className:"size-4","aria-hidden":"true"})}),(0,a.jsx)("audio",{ref:m,src:t,preload:"metadata"}),(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{let e=m.current;e&&(p?e.pause():e.play(),h(!p))},"aria-label":x(p?"pauseAudio":"playAudio"),className:"flex size-12 sm:size-14 shrink-0 items-center justify-center rounded-full bg-foreground text-background cursor-pointer hover:bg-foreground
1/90 transition-colors",children:p?(0,a.jsx)(i.A,{className:"size-4 sm:size-5","aria-hidden":"true"}):(0,a.jsx)(d.A,{className:"size-4 sm:size-5 ml-0.5","aria-hidden":"true"})}),(0,a.jsx)("div",{className:"flex flex-1 items-end gap-[2px] h-10",children:b.map((e,t)=>(0,a.jsx)("div",{className:"flex-1 rounded-full bg-muted-foreground/25",style:{height:"".concat(Math.max(3,36*e),"px"),minWidth:"2px"}},t))})]}),(0,a.jsxs)("div",{className:"mt-3 flex justify-between text-xs text-muted-foreground/60 px-1",children:[(0,a.jsx)("span",{children:"0.0s"}),(0,a.jsxs)("span",{children:[r.toFixed(1),"s"]})]})]}),o?(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.A,{className:"size-5 text-green-500","aria-hidden":"true"}),(0,a.jsx)("span",{className:"text-sm font-medium text-green-600",children:x("audioSampleReady")})]}),(0,a.jsxs)(s.$,{variant:"default",size:"sm",onClick:o,className:"cursor-pointer bg-green-500 hover:bg-green-600 text-white rounded-lg px-4",children:[(0,a.jsx)(u.A,{className:"mr-1.5 size-3.5"}),x("reRecord")]})]}):(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2.5 py-1",children:[(0,a.jsx)(c.A,{className:"size-6 text-green-500","aria-hidden":"true"}),(0,a.jsx)("span",{className:"text-base font-semibold text-green-600",children:x("audioSampleReady")})]})]})}function M(e){let{onFileReady:t,uploadState:r,audioUrl:s,audioDuration:n,onRemove:l,error:i,disabled:d,onUpgrade:c,t:u}=e,m=(0,A.useRef)(null),[h,f]=(0,A.useState)(!1),g=(0,A.useCallback)(e=>{(R.zu.includes(e.type)||R.DY.split(",").some(t=>e.name.toLowerCase().endsWith(t)))&&(e.size>0xa00000||t(e))},[t]);return((0,A.useCallback)(e=>{e.preventDefault(),f(!1);let t=e.dataTransfer.files[0];t&&g(t)},[g]),"ready"===r&&s)?(0,a.jsx)(C,{audioUrl:s,duration:n,onRemove:l,t:u}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"relative group",children:[(0,a.jsxs)("button",{type:"button",className:(0,o.cn)("flex w-full flex-col items-center justify-center gap-3 rounded-2xl border-2 border-dashed transition-all duration-200","h-[140px] lg:h-[160px]",d?"cursor-not-allowed opacity-60":"cursor-pointer","validating"===r&&"pointer-events-none",!d&&h?"border-foreground bg-accent/[0.02] scale-[1.005] shadow-md":"border-muted-foreground/20",!d&&!h&&"hover:border-foreground hover:bg-accent/[0.02] hover:scale-[1.005] hover:shadow-md",i&&"border-destructive/50"),onClick:()=>{var e;if(d&&c)return void c();"empty"===r&&(null==(e=m.current)||e.click())},onDragOver:e=>{e.preventDefault(),d||f(!0)},onDragLeave:()=>f(!1),onDrop:e=>{if(e.preventDefault(),f(!1),d&&c)return void c();let t=e.dataTransfer.files[0];t&&g(t)},children:["validating"===r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"relative flex size-14 items-center justify-center rounded-full border-2 border-foreground
1/60 bg-background",children:(0,a.jsx)(x.A,{className:"size-6 animate-spin text-foreground/60","aria-hidden":"true"})}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:u("validatingAudio")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground/60",children:u("validatingMoment")})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex size-14 items-center justify-center rounded-full border-2 border-foreground/60 bg-background",children:(0,a.jsx)(p,{className:"size-6 text-foreground/60","aria-hidden":"true"})}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-sm font-semibold",children:u("dragAndDropUpload")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground/60",children:u("audioFormats")})]})]}),(0,a.jsx)("input",{ref:m,type:"file",accept:R.DY,className:"hidden",onChange:e=>{var t;let r=null==(t=e.target.files)?void 0:t[0];r&&g(r)}})]}),d&&(0,a.jsx)("div",{className:"pointer-events-none absolute -bottom-10 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:(0,a.jsx)("div",{className:"whitespace-nowrap rounded-lg bg-foreground px-3 py-1.5 text-xs text-background shadow-lg",children:u("proRequiredToClone")})})]}),i&&(0,a.jsx)(k.P.p,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"mt-2 text-xs text-destructive",children:i})]})}function T(e){let{isRecording:t,onStart:r,onStop:s}=e,[n,o]=(0,A.useState)(!1),l=n||t;return(0,a.jsxs)("button",{type:"button",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onClick:t?s:r,"aria-label":t?"Stop recording":"Start recording",className:"relative flex size-28 sm:size-32 items-center justify-center cursor-pointer",children:[(0,a.jsx)(k.P.div,{className:"absolute inset-0",style:{background:"conic-gradient(from 180deg, #c084fc, #93c5fd, #818cf8, #c084fc)",filter:"blur(2px)"},animate:{borderRadius:l?["60% 40% 55% 45% / 40% 60% 45% 55%","45% 55% 40% 60% / 55% 45% 60% 40%","55% 45% 60% 40% / 45% 55% 40% 60%","40% 60% 45% 55% / 60% 40% 55% 45%","60% 40% 55% 45% / 40% 60% 45% 55%"]:"50%"},transition:l?{duration:4,repeat:1/0,ease:"easeInOut"}:{duration:.5,ease:"easeOut"}}),(0,a.jsx)(k.P.div,{className:"absolute inset-[-4px]",style:{background:"conic-gradient(from 180deg, #c084fc40, #93c5fd40, #818cf840, #c084fc40)",filter:"blur(12px)"},animate:{borderRadius:l?["60% 40% 55% 45% / 40% 60% 45% 55%","45% 55% 40% 60% / 55% 45% 60% 40%","55% 45% 60% 40% / 45% 55% 40% 60%","40% 60% 45% 55% / 60% 40% 55% 45%","60% 40% 55% 45% / 40% 60% 45% 55%"]:"50%"},transition:l?{duration:4,repeat:1/0,ease:"easeInOut"}:{duration:.5,ease:"easeOut"}}),(0,a.jsx)("div",{className:"relative z-10 flex size-[calc(100%-10px)] items-center justify-center rounded-full bg-background shadow-lg",children:t?(0,a.jsx)("div",{className:"flex size-10 items-center justify-center rounded-full border-2 border-red-500",children:(0,a.jsx)(h,{className:"size-4 fill-red-500 text-red-500","aria-hidden":"true"})}):(0,a.jsx)(f.A,{className:"size-7 sm:size-8 text-foreground/80","aria-hidden":"true"})})]})}function L(e){let{onRecordComplete:t,recordingState:r,setRecordingState:s,recordedAudioUrl:n,recordedDuration:l,onRemove:i,referenceText:d,onRefreshText:c,disabled:u,onUpgrade:x,t:m}=e,p=(0,A.useRef)(null),h=(0,A.useRef)(null),f=(0,A.useRef)([]),b=(0,A.useRef)(0),v=(0,A.useRef)(null),[j,y]=(0,A.useState)(0),[N,k]=(0,A.useState)(!1),w=(0,A.useCallback)(()=>{v.current&&(clearInterval(v.current),v.current=null),p.current&&"inactive"!==p.current.state&&p.current.stop(),h.current&&(h.current.getTracks().forEach(e=>e.stop()),h.current=null)},[]),z=async()=>{k(!1);try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});h.current=e;let r=MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":"",a=r?new MediaRecorder(e,{mimeType:r}):new MediaRecorder(e);p.current=a,f.current=[],a.ondataavailable=e=>{e.data.size>0&&f.current.push(e.data)},a.onstop=()=>{let e=new Blob(f.current,{type:a.mimeType||"audio/webm"}),r=e.type.includes("mp4")?"m4a":"webm",s=new File([e],"recording.".concat(r),{type:e.type}),n=(Date.now()-b.current)/1e3;t(s,n)},a.start(100),b.current=Date.now(),y(0),s("recording"),v.current=setInterval(()=>{let e=(Date.now()-b.current)/1e3;y(e)},100)}catch(e){k(!0)}};(0,A.useEffect)(()=>{"recording"===r&&j>=60&&w()},[j,r,w]),(0,A.useEffect)(()=>()=>{v.current&&clearInterval(v.current),h.current&&h.current.getTracks().forEac
1h(e=>e.stop())},[]);let R=j/60*100,S=j>=3;return"done"===r&&n?(0,a.jsx)(C,{audioUrl:n,duration:l,onRemove:i,onReRecord:()=>{i(),y(0)},t:m}):(0,a.jsx)("div",{className:"flex flex-col items-center",children:"idle"===r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:(0,o.cn)("relative group mb-6",u&&"[&_button]:cursor-not-allowed [&_button]:opacity-60"),children:[(0,a.jsx)(T,{isRecording:!1,onStart:()=>{if(u&&x)return void x();z()},onStop:()=>{}}),u&&(0,a.jsx)("div",{className:"pointer-events-none absolute -bottom-2 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:(0,a.jsx)("div",{className:"whitespace-nowrap rounded-lg bg-foreground px-3 py-1.5 text-xs text-background shadow-lg",children:m("proRequiredToClone")})})]}),N&&(0,a.jsx)("p",{className:"mb-4 text-xs text-destructive text-center px-4",children:m("micPermissionDenied")}),(0,a.jsx)("div",{className:"mb-5 w-full rounded-2xl border border-border/20 bg-muted/20 p-4 sm:p-5",children:(0,a.jsx)("p",{className:"text-center text-sm text-muted-foreground leading-relaxed",children:m("recordDescription")})}),(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)("p",{className:"mb-3 text-center text-sm font-semibold",children:m("readSampleTextAloud")}),(0,a.jsxs)("div",{className:"relative rounded-2xl border border-border/20 bg-background p-5 text-center shadow-sm",children:[(0,a.jsxs)("p",{className:"text-sm leading-relaxed text-foreground/80 px-6",children:[(0,a.jsx)("span",{className:"text-muted-foreground/40",children:"â "}),d,(0,a.jsx)("span",{className:"text-muted-foreground/40",children:" â"})]}),(0,a.jsx)("button",{type:"button",onClick:c,"aria-label":m("tryAnotherExample"),className:"absolute right-3 top-1/2 -translate-y-1/2 flex size-7 items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-all cursor-pointer",children:(0,a.jsx)(g.A,{className:"size-3.5","aria-hidden":"true"})})]})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(T,{isRecording:!0,onStart:()=>{},onStop:w})}),(0,a.jsx)("p",{className:(0,o.cn)("mb-3 text-base font-semibold",S?"text-green-500":"text-muted-foreground"),children:m(S?"recordingGood":"recordingStatus")}),(0,a.jsxs)("div",{className:"w-full max-w-xs",children:[(0,a.jsx)("div",{className:"h-2 rounded-full bg-muted/50 overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-foreground rounded-full transition-[width] duration-100",style:{width:"".concat(R,"%")}})}),(0,a.jsxs)("div",{className:"mt-1.5 flex justify-between text-xs text-muted-foreground",children:[(0,a.jsx)("span",{children:m("tooShort")}),(0,a.jsx)("span",{children:m("optimal")}),(0,a.jsx)("span",{children:m("tooLong")})]}),(0,a.jsx)("p",{className:"mt-2 text-center text-sm font-semibold",children:m("recordingTime",{time:j.toFixed(1)})})]})]})})}function U(e){let{t}=e,r=[{icon:b,text:t("tipClearAudio"),highlight:!1},{icon:v.A,text:t("tipOptimalLength"),highlight:!0},{icon:j.A,text:t("tipSpeakNaturally"),highlight:!1},{icon:c.A,text:t("tipSupportedFormats"),highlight:!1}];return(0,a.jsx)("div",{className:"mt-3 flex flex-col gap-2",children:r.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-3 py-2 px-3.5 rounded-lg bg-muted/30",children:[(0,a.jsx)("div",{className:(0,o.cn)("flex shrink-0 items-center justify-center p-1.5 rounded-full",e.highlight?"bg-gradient-to-br from-fuchsia-100/60 to-sky-100/60 dark:from-fuchsia-950/40 dark:to-sky-950/40":"bg-muted"),children:(0,a.jsx)(e.icon,{"aria-hidden":"true",className:(0,o.cn)("size-4",e.highlight?"text-fuchsia-400":"text-muted-foreground/70")})}),(0,a.jsx)("span",{className:(0,o.cn)("text-sm",e.highlight?"font-semibold bg-gradient-to-r from-fuchsia-400 to-sky-400 bg-clip-text text-transparent":"text-foreground/80"),children:e.text})]},t))})}function D(e){let{isGenerating:t,onGenerate:r,maxTextLength:s,disabled:l,onUpgrade:i,savedState:c,t:u}=e,[x,m]=(0,A.useState)("upload"),[p,h]=(0,A.useState)((null==c?void 0:c.text)||""),[g,b]=(0,A.useState)((null==c?void 0:c.styleInstruction)||""),[v,j]=(0,A.useState)((null==c?void 0:c.language)||"auto"),[C,T]=(0,A.useState)({}),[D,E]=(0,A.useState)("empty"),[F,P]=(0,A.useState)(null),[O,q]=(0,A.useState)(null),[I,H]=(0,A.useState)(0);(0,A.useEffect)(()=>{let e=null==c?void 0:c.referenceAudio;if(e&&!F)try{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let a=new Blob([r],{type:"audio/wav"}),s=new File([a],"restored-audio.wav",{type:"audio/wav"}),n=URL.createObjectURL(a),o=new Audio(n);o.addEventListener("loadedmetadata",()=>{P(s),q(n),H(Number.isFinite(o.duration)?o.duration:0),E("ready")}),o.addEventListener("error",()=>{P(s),q(n),H(0),E("ready")})}catch(e){}},[]);let[V,_]=(0,A.useState)("idle"),[B,W]=(0,A.useState)(null),[Y,G]=(0,A.useState)(null),[Z,$]=(0,A.useState)(0),J=(0,A.useMemo)(()=>Array.from({length:5},(e,t)=>u("recordSampleTexts.".concat(t))),[u]),[K,Q]=(0,A.useState)(0),X=J[K],ee=(0,A.useCallback)(e=>{E("validating"),P(e);let t=URL.createObjectURL(e),r=new Audio(t);r.addEventListener("loadedmetadata",()=>{H(Number.isFinite(r.duration)?r.duration:0),q(t),E("ready")}),r.addEventListener("error",()=>{q(t),H(0),E("ready")})},[]),et=(0,A.useCallback)(()=>{O&&URL.revokeObjectURL(O),P(null),q(null),H(0),E("empty")},[O]),er=(0,A.useCallback)((e,t)=>{let r=URL.createObjectURL(e);W(e),G(r),$(t),_("done")},[]),ea=(0,A.useCallback)(()=>{Y&&URL.revokeObjectURL(Y),W(null),G(null),$(0),_("idle")},[Y]),es="upload"===x?!!F:!!B,en=(0,a.jsxs)("div",{className:"flex flex-col h-full rounded-2xl border border-border/40 bg-card p-4 sm:p-6 shadow-sm",children:[(0,a.jsx)("div",{className:"flex justify-center pb-6",children:(0,a.jsx)("div",{role:"tablist",className:"relative flex items-center gap-1 auto-cols-auto rounded-full border border-border/40 bg-background p-1 shadow-sm",children:["upload","record"].map(e=>{let t=x===e,r="upload"===e?y.A:f.A,s="upload"===e?u("uploadTab"):u("recordTab");return(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":t,onClick:()=>m(e),className:(0,o.cn)("relative z-10 cursor-pointer rounded-full px-5 py-2 text-sm font-medium transition-colors duration-200",t?"text-background":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[t&&(0,a.jsx)(k.P.div,{layoutId:"clone-sub-pill",className:"absolute inset-0 rounded-full bg-foreground shadow-md",transition:{type:"spring",bounce:.2,duration:.5}}),(0,a.jsxs)("span",{className:"relative z-10 inline-flex items-center gap-1.5",children:[(0,a.jsx)(r,{className:"size-4"}),s]})]},e)})})}),(0,a.jsx)(w.N,{initial:!1,mode:"popLayout",children:"upload"===x?(0,a.jsxs)(k.P.div,{initial:{opacity:0,x:-8}
1,animate:{opacity:1,x:0},exit:{opacity:0,x:8},transition:{duration:.15},children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-foreground/90 sm:text-lg md:text-xl",children:u("uploadVoiceToClone")}),l&&i&&(0,a.jsxs)("button",{type:"button",onClick:i,className:"relative inline-flex items-center gap-1 rounded-full bg-gradient-to-r from-pink-400 via-purple-400 to-blue-400 px-3 py-1 text-xs font-bold text-white shadow-lg transition-transform hover:scale-110 cursor-pointer animate-pulse",children:[(0,a.jsx)(N.A,{className:"size-3"}),u("upgradePro")]})]}),(0,a.jsx)(M,{onFileReady:ee,uploadState:D,audioUrl:O,audioDuration:I,onRemove:et,error:C.audio,disabled:l,onUpgrade:i,t:u}),(0,a.jsx)(U,{t:u})]},"upload"):(0,a.jsxs)(k.P.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.15},children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-foreground/90 sm:text-lg md:text-xl",children:u("recordVoiceToClone")}),l&&i&&(0,a.jsxs)("button",{type:"button",onClick:i,className:"relative inline-flex items-center gap-1 rounded-full bg-gradient-to-r from-pink-400 via-purple-400 to-blue-400 px-3 py-1 text-xs font-bold text-white shadow-lg transition-transform hover:scale-110 cursor-pointer animate-pulse",children:[(0,a.jsx)(N.A,{className:"size-3"}),u("upgradePro")]})]}),(0,a.jsx)(L,{onRecordComplete:er,recordingState:V,setRecordingState:_,recordedAudioUrl:Y,recordedDuration:Z,onRemove:ea,referenceText:X,onRefreshText:()=>{let e;do e=Math.floor(Math.random()*J.length);while(e===K&&J.length>1);Q(e)},disabled:l,onUpgrade:i,t:u})]},"record")})]}),eo=(0,a.jsxs)("div",{className:"flex flex-col h-full rounded-2xl border border-border/40 bg-card p-4 sm:p-6 shadow-sm",children:[(0,a.jsx)("h3",{className:"mb-4 text-base font-semibold text-foreground/90 sm:text-lg md:text-xl",children:u("sampleTextTitle")}),(0,a.jsxs)("div",{className:"relative flex-1 flex flex-col",children:[(0,a.jsx)(n.T,{value:p,onChange:e=>h(e.target.value.slice(0,s)),placeholder:u("cloneTextPlaceholder"),"aria-label":u("sampleTextTitle"),className:(0,o.cn)("w-full flex-1 min-h-[180px]","text-sm sm:text-base leading-relaxed","rounded-xl border border-border/40 bg-background/50","resize-none outline-none p-5 pb-8","placeholder:text-muted-foreground/30","focus:border-border/80 focus:bg-background focus-visible:ring-0","shadow-none transition-all duration-200",C.text&&"border-destructive/50")}),(0,a.jsxs)("span",{className:"absolute bottom-3 right-4 text-xs font-semibold text-foreground/70",children:[p.length,"/",s]})]}),C.text&&(0,a.jsx)(k.P.p,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"mt-1 text-xs text-destructive",children:C.text}),(0,a.jsx)("div",{className:"mt-6 border-t border-border/20 pt-4",children:(0,a.jsx)(R.vr,{language:v,onLanguageChange:j,styleInstruction:g,onStyleChange:e=>b(e.slice(0,R.cx)),t:u})})]}),el=(0,a.jsxs)("div",{className:"relative group mt-4",children:[(0,a.jsx)(z.V,{label:u("createVoiceClone"),loadingLabel:u("generating"),loading:t,disabled:t||l||!es,onClick:()=>{(()=>{let e={};es||(e.audio=u("errors.referenceAudioRequired"));let t="upload"===x?I:Z;return es&&t>0&&t<3&&(e.audio="Audio must be at least ".concat(3," seconds")),es&&t>60&&(e.audio="Audio must not exceed ".concat(60," seconds")),p.trim()||(e.text=u("errors.textRequired")),p.length>s&&(e.text=u("errors.textTooLong")),T(e),0===Object.keys(e).length})()&&r({referenceAudio:"upload"===x?F:B,referenceText:"",text:p,language:v,styleInstruction:g})},icon:(0,a.jsx)(d.A,{className:"mr-1 size-4 fill-current"})}),!es&&!t&&(0,a.jsx)("div",{className:"pointer-events-none absolute -top-10 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:(0,a.jsx)("div",{className:"whitespace-nowrap rounded-lg bg-foreground px-3 py-1.5 text-xs text-background shadow-lg",children:u("uploadAudioFirst")})})]});return(0,a.jsx)(S.z,{left:en,right:eo,footer:el})}},87045:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(15317).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])}}]);
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.