1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87740],{14278:(e,t,s)=>{s.d(t,{Ke:()=>i,Nt:()=>r,R6:()=>n});var a=s(19820);let r=a.bL,n=a.R6,i=a.Ke},35694:(e,t,s)=>{s.d(t,{F:()=>l});var a=s(95155);s(12115);var r=s(53318),n=s(91337),i=s(62909);function l({children:e,current:t,max:s,error:d,htmlFor:o,className:c,labelClassName:u,counterClassName:m}){let h=t>s;return(0,a.jsxs)("div",{className:(0,n.cn)(i.m.fieldHeader,c),children:[(0,a.jsxs)(r.$,{htmlFor:o,className:(0,n.cn)("min-w-0 text-sm font-medium",u),children:[e,d?(0,a.jsx)("span",{className:i.m.fieldError,children:d}):null]}),(0,a.jsxs)("span",{className:(0,n.cn)(h?i.m.fieldCounterError:i.m.fieldCounter,m),children:[t,"/",s]})]})}},53318:(e,t,s)=>{s.d(t,{$:()=>o,L:()=>c});var a=s(95155);s(12115);var r=s(68822),n=s(79792),i=s(91459),l=s(91337),d=s(62909);function o({className:e,...t}){return(0,a.jsx)(n.J,{className:(0,l.cn)("min-w-0 text-sm font-medium",e),...t})}function c({name:e,label:t,children:s,htmlFor:n,required:u=!1,requiredLabel:m="required",hint:h,hintLabel:f="Parameter info",error:x,description:p,counter:g,headerEnd:v,disabled:j=!1,className:b,labelClassName:N,contentClassName:y}){let w=e.replace(/[^a-zA-Z0-9_-]+/g,"-"),_=`${w}-label`,C=`${w}-error`,S=`${w}-description`,k=[x?C:null,p?S:null].filter(Boolean).join(" ")||void 0,V=!!g&&g.current>g.max;return(0,a.jsxs)("div",{"data-tool-field":e,"data-invalid":x?"true":void 0,className:(0,l.cn)("space-y-2",j&&"opacity-60",b),children:[(0,a.jsxs)("div",{className:d.m.fieldHeader,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1",children:[(0,a.jsxs)(o,{id:_,htmlFor:n,className:N,children:[t,u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"ml-1 text-red-500",children:"*"}),(0,a.jsxs)("span",{className:"sr-only",children:[" (",m,")"]})]}):null]}),h?(0,a.jsx)(i.Bc,{delayDuration:150,children:(0,a.jsxs)(i.m_,{children:[(0,a.jsx)(i.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button","aria-label":f,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:(0,a.jsx)(r.A,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,a.jsx)(i.ZI,{side:"right",className:"max-w-sm text-sm leading-5",children:h})]})}):null,x?(0,a.jsx)("span",{id:C,role:"alert",className:d.m.fieldError,children:x}):null]}),v||g?(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[v,g?(0,a.jsxs)("span",{className:V?d.m.fieldCounterError:d.m.fieldCounter,children:[g.current,"/",g.max]}):null]}):null]}),null!=s?(0,a.jsx)("div",{className:y,role:n?void 0:"group","aria-labelledby":n?void 0:_,"aria-describedby":k,"aria-invalid":!!x||void 0,children:s}):null,p?(0,a.jsx)("p",{id:S,className:"text-xs leading-5 text-muted-foreground",children:p}):null]})}},55433:(e,t,s)=>{s.d(t,{M:()=>a});function a(e,t){if(!e||"object"!=typeof e)return null;for(let s of t){let t=function(e,t){if(null==e)return null;if("string"!=typeof e)return`${t.field} must be a string`;let s=e.length;return void 0!==t.min&&s>0&&s<t.min?`${t.field} must be ${t.min}-${t.max} characters`:s>t.max?`${t.field} must be ${t.max} characters or less`:null}(e[s.field],s);if(t)return t}return null}},58619:(e,t,s)=>{s.d(t,{v:()=>n});var a=s(31691),r=s(14851);let n={async submit(e,t){let s=await a.apiService.post("/api/generate/submit",{model:e,input:t},r.U.appName);if(200!==s.code&&0!==s.code)throw Error(s.message||s.detail||s.error?.message||"Submit failed");return s},async queryDetail(e){let t=await a.apiService.get(`/api/generate/detail/music?task_id=${e}`,r.U.appName);if(200!==t.code&&0!==t.code)throw Error(t.message||t.detail||t.error?.message||"Query failed");return t},async queryStatus(e){let t=await a.apiService.get(`/api/generate/status/${e}`,r.U.appName);if(200!==t.code&&0!==t.code)throw Error(t.message||t.detail||t.error?.message||"Query failed");return t}}},59838:(e,t,s)=>{s.d(t,{KI:()=>c,KW:()=>d,O5:()=>n,Pt:()=>v,Pz:()=>m,T0:()=>j,Vs:()=>f,X6:()=>i,Y3:()=>
1o,bi:()=>u,r2:()=>h});var a=s(66);function r(e,t=0){let s="number"==typeof e?e:"string"==typeof e&&""!==e.trim()?Number(e):NaN;return Number.isFinite(s)?s:t}function n(e){let t=Math.max(0,r(e,0));return Number.isInteger(t)?String(t):t.toFixed(2).replace(/\.?0+$/,"")}function i(e,t){return r(e,0)*r(t,0)}function l(e){return Math.round(1e6*r(e,0))}function d(e,t){return l(e)*l(t)/1e12}function o(e,t){return Math.ceil(d(e,t))}function c(e,t){return Math.ceil(r(e,0)/60)*r(t,0)}function u(e,t){return r(e,1)*r(t,0)}function m(e,t,s){return r(t[String(e??"").trim().toUpperCase()],s)}function h({width:e,height:t,duration:s,fps:a,scale:n,creditsPerOutputMegapixel:i}){let l=r(n,2),d=Math.ceil(r(s,5)*r(a,24));return r(e,1280)*r(t,720)*d*l*l/1e6*r(i,.1)}function f(e,t={}){let s=t.file;return s&&(0,a.E)(s)?Promise.resolve({width:s.width,height:s.height,duration:s.duration,fps:s.fps}):"u"<typeof document?Promise.resolve({}):new Promise(a=>{let r=document.createElement("video");r.preload="metadata",r.muted=!0,r.onloadedmetadata=async()=>{let n={width:r.videoWidth||void 0,height:r.videoHeight||void 0,duration:Number.isFinite(r.duration)?r.duration:void 0};r.removeAttribute("src"),r.load();let i=t.includeFps?await x(e,s):void 0;a({...n,fps:i})},r.onerror=()=>a({}),r.src=e})}async function x(e,t){if(t)try{return p(await t.arrayBuffer())}catch{return}if("u">typeof fetch)try{let t=await fetch(e);if(!t.ok)return;let s=Number(t.headers.get("content-length"));if(Number.isFinite(s)&&s>0x7800000)return;return p(await t.arrayBuffer())}catch{return}}function p(e){let t=new DataView(e),s=[],a=null,r=(e,n)=>{let i=e;for(;i+8<=n;){var l,d,o;let e=t.getUint32(i),c=g(t,i+4),u=8,m=e;if(1===e){if(i+16>n)break;l=t,d=i+8,m=0x100000000*l.getUint32(d)+l.getUint32(d+4),u=16}else 0===e&&(m=n-i);if(m<u||i+m>n)break;let h=i+u,f=i+m;if("trak"===c){let e=a,t={};a=t,r(h,f),s.push(t),a=e}else{(function(e,t,s,a,r){if(r){if("hdlr"===e&&s+12<=a){r.isVideo="vide"===g(t,s+8);return}if("mdhd"===e&&s+24<=a){let e=1===t.getUint8(s)?s+20:s+12;e+4<=a&&(r.timescale=t.getUint32(e));return}if("stts"===e&&s+8<=a){let e=s+4,n=t.getUint32(e);e+=4;let i=0,l=0;for(let s=0;s<n&&e+8<=a;s+=1){let s=t.getUint32(e),a=t.getUint32(e+4);i+=s,l+=s*a,e+=8}r.sampleCount=i,r.sampleDurationUnits=l}}})(c,t,h,f,a),("moov"===(o=c)||"mdia"===o||"minf"===o||"stbl"===o)&&r(h,f)}i=f}};for(let e of(r(0,t.byteLength),s)){if(!e.isVideo||!e.timescale||!e.sampleCount||!e.sampleDurationUnits)continue;let t=e.sampleDurationUnits/e.timescale,s=e.sampleCount/t;if(Number.isFinite(s)&&s>0)return s}}function g(e,t){return String.fromCharCode(e.getUint8(t),e.getUint8(t+1),e.getUint8(t+2),e.getUint8(t+3))}function v(e){return"u"<typeof document?Promise.resolve(void 0):new Promise(t=>{let s=document.createElement("audio");s.preload="metadata",s.onloadedmetadata=()=>{t(Number.isFinite(s.duration)?s.duration:void 0),s.src=""},s.onerror=()=>t(void 0),s.src=e})}function j(e,t){return t?.startsWith("audio/")?v(e):f(e).then(e=>e.duration)}},62705:(e,t,s)=>{s.d(t,{A:()=>l});var a=s(95155),r=s(12115),n=s(6415),i=s(91337);let l=r.forwardRef(({className:e,...t},s)=>(0,a.jsxs)(n.bL,{ref:s,className:(0,i.cn)("relative flex w-full touch-none select-none items-center",e),...t,children:[(0,a.jsx)(n.CC,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:(0,a.jsx)(n.Q6,{className:"absolute h-full bg-primary"})}),(0,a.jsx)(n.zi,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));l.displayName=n.bL.displayName},78152:(e,t,s)=>{s.d(t,{CG:()=>n,F7:()=>r,Lv:()=>i});let a={enableUtm:!0,enableReferrer:!0};function r(e){return e?e.source:function(e={}){let t,s,r={...a,...e};
1if(r.enableUtm){let e,t,s,a,r=(t=(e=new URLSearchParams(window.location.search)).get("utm_source"),s=e.get("utm_medium"),a=e.get("utm_campaign"),t?{source:t,utmSource:t,utmMedium:s||void 0,utmCampaign:a||void 0,detectionMethod:"utm"}:null);if(r)return r}let n=(s=(t=new URLSearchParams(window.location.search)).get("source")||t.get("ref"))?{source:s,detectionMethod:"query_param"}:null;if(n)return n;if(r.enableReferrer){let e=function(e){if("u"<typeof document||!document.referrer)return null;let t=document.referrer,s=new URL(t).hostname;if(e){for(let[a,r]of Object.entries(e))if(s.includes(a.toLowerCase()))return{source:r,rawReferrer:t,detectionMethod:"referrer"}}return s===window.location.hostname?null:{source:s,rawReferrer:t,detectionMethod:"referrer"}}(r.customDomainMapping);if(e)return e}return{source:"direct_visit",detectionMethod:"default"}}().source}function n(){try{if(document.referrer){let e=new URL(document.referrer);if(e.hostname===window.location.hostname)return`${e.pathname}${e.search}`}return`${window.location.pathname}${window.location.search}`}catch(e){console.error("Error detecting internal source:",e);return}}function i(){let e=new URLSearchParams(window.location.search);return{utm_source:e.get("utm_source")||void 0,utm_medium:e.get("utm_medium")||void 0,utm_campaign:e.get("utm_campaign")||void 0,registration_page:window.location.pathname}}},82941:(e,t,s)=>{s.r(t),s.d(t,{default:()=>R});var a=s(95155),r=s(76684),n=s(83414),i=s(35694),l=s(55433),d=s(62909),o=s(59838),c=s(12115),u=s(58619),m=s(31691),h=s(14851),f=s(4474),x=s(79984),p=s(79792),g=s(39540),v=s(39658),j=s(26518),b=s(90466),N=s(62705),y=s(14278),w=s(66088),_=s(66609),C=s(6296),S=s(6962),k=s(5872),V=s(81491),U=s(74350);let R=({credits_amount:e=20,locale:t="en"})=>{let[s,R]=(0,c.useState)(!1),[$,L]=(0,c.useState)(!1),[F,P]=(0,c.useState)(!1),[E,A]=(0,c.useState)("form"),[J,O]=(0,c.useState)("preview"),[M,I]=(0,c.useState)(""),[q,D]=(0,c.useState)(void 0),[z,T]=(0,c.useState)(!0),[W,B]=(0,c.useState)(!1),[K,Z]=(0,c.useState)(""),[G,H]=(0,c.useState)(""),[Q,X]=(0,c.useState)(""),[Y,ee]=(0,c.useState)("V4"),[et,es]=(0,c.useState)(""),[ea,er]=(0,c.useState)("none"),[en,ei]=(0,c.useState)([.5]),[el,ed]=(0,c.useState)([.5]),[eo,ec]=(0,c.useState)([.5]),[eu,em]=(0,c.useState)(""),[eh,ef]=(0,c.useState)("style_persona"),ex=z&&("V5"===Y||"V5_5"===Y),ep="V4"===Y?3e3:5e3,eg="V4"===Y?200:1e3,ev="V4"===Y||"V4_5ALL"===Y?80:100,[ej,eb]=(0,c.useState)(!1),[eN,ey]=(0,c.useState)(""),[ew,e_]=(0,c.useState)(!1),[eC,eS]=(0,c.useState)(),[ek,eV]=(0,c.useState)(!1),[eU,eR]=(0,c.useState)(null),[e$,eL]=(0,c.useState)(null),eF=(0,c.useRef)(null),[eP,eE]=(0,c.useState)(null);(0,c.useEffect)(()=>{L(m.apiService.isLoggedInToApp(h.U.appName))},[]),(0,c.useEffect)(()=>{"json"===E&&ey(JSON.stringify(eA(),null,2))},[E,M,q,z,W,K,G,Q,Y,et,ea,en,el,eo,eu,eh]),(0,c.useEffect)(()=>()=>{eI()},[]);let eA=()=>{let e={audio_id:M,default_param_flag:z,instrumental:W};return z&&(e.mv=Y,W||(e.prompt=K),e.style=G,e.title=Q,e.continue_at=q,et&&(e.negative_tags=et),ea&&"none"!==ea&&(e.vocal_gender=ea),.5!==en[0]&&(e.style_weight=en[0]),.5!==el[0]&&(e.weirdness_constraint=el[0]),.5!==eo[0]&&(e.audio_weight=eo[0]),ex&&eu&&(e.persona_id=eu,e.persona_model=eh)),{model:"extend-music",input:e}},eJ=e=>{let t=e?.mv,s=(0,l.M)(e,[{field:"prompt",max:"V4"===t?3e3:5e3},{field:"style",max:"V4"===t?200:1e3},{field:"title",max:"V4"===t||"V4_5ALL"===t?80:100}]);if(s)return s;if(!e?.audio_id?.trim())return"audio_id is required";if(!0===e.default_param_flag){if(!0!==e.instrumental&&!e.prompt?.trim())return"prompt is required for vocal extensions";if(!e.style?.trim())return"style is required when default_param_flag is true";if(!e.title?.trim())return"title is required when default_param_flag is true";if(void 0===e.continue_at||null===e.continue_at||""===e.continue_at)return"continue_at is required when default_param_flag is true";if("number"!=typeof e.continue_at||e.continue_at<=0)return"continue_at must be greater than 0"}return e.persona_model&&!["style_persona","voice_persona"].includes(e.persona_model)?"persona_model is invali
1d":e.persona_model&&!e.persona_id?.trim()?"persona_id is required when persona_model is provided":e.persona_id&&(!0!==e.default_param_flag||"V5"!==t&&"V5_5"!==t)?"persona_id is only available in custom mode with V5 or V5_5":null},eO=async()=>{let t;if(!$)return void R(!0);if("json"===E)try{if(t=JSON.parse(eN),"extend-music"!==t.model)return void _.oR.error("model must be extend-music");let e=eJ(t.input);if(e)return void _.oR.error(e)}catch{_.oR.error("Invalid JSON configuration");return}else{let e=eJ((t=eA()).input);if(e)return void _.oR.error(e)}try{if(e_(!0),eR(null),(await m.apiService.getUserInfo(h.U.appName)).data.credits_amount<e){P(!0),e_(!1);return}let s=await u.v.submit(t.model,t.input);s.data?.task_id&&(eL(s.data.task_id),eS(s.data.task_id),_.oR.success("Music extension started!"),eM(s.data.task_id))}catch(e){_.oR.error(e.message||"Failed to submit")}finally{e_(!1)}},eM=e=>{eV(!0);let t=async()=>{try{let t=await u.v.queryDetail(e);t.data&&(eR(t.data),"finished"===t.data.status?(eI(),_.oR.success("Music extension completed!")):"failed"===t.data.status&&(eI(),_.oR.error(t.data.error_message||"Extension failed")))}catch(e){console.error("Polling error:",e)}};t(),eF.current=setInterval(t,5e3)},eI=()=>{eF.current&&(clearInterval(eF.current),eF.current=null),eV(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V.default,{app_name:h.U.appName,onLoginSuccess:()=>{R(!1),window.location.reload()},open:s,onOpenChange:R}),(0,a.jsx)(U.lG,{open:F,onOpenChange:P,children:(0,a.jsx)(U.Cf,{className:"sm:max-w-[425px]",children:(0,a.jsxs)("div",{className:"space-y-4 py-4",children:[(0,a.jsxs)("div",{className:"text-center space-y-2",children:[(0,a.jsx)(k.A,{className:"h-12 w-12 mx-auto text-orange-500"}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Insufficient Credits"})]}),(0,a.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,a.jsx)(f.$,{variant:"outline",className:"flex-1",onClick:()=>P(!1),children:"Cancel"}),(0,a.jsx)(f.$,{className:"flex-1 bg-gradient-to-r from-orange-500 via-pink-500 to-rose-500",onClick:()=>window.open("/dashboard/billing","_blank"),children:"Recharge Now"})]})]})})}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"container mx-auto px-3 sm:px-4 py-4 sm:py-8 max-w-7xl",children:(0,a.jsxs)("div",{className:d.m.shell,children:[(0,a.jsx)(x.Zp,{className:d.m.panel,children:(0,a.jsx)(x.Wu,{className:d.m.content,children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:d.m.header,children:[(0,a.jsx)("div",{className:"text-lg font-semibold",children:"Input"}),(0,a.jsxs)("div",{className:d.m.segmented,children:[(0,a.jsx)(f.$,{size:"sm",variant:"form"===E?"default":"ghost",onClick:()=>A("form"),className:"h-8",children:"Form"}),(0,a.jsx)(f.$,{size:"sm",variant:"json"===E?"default":"ghost",onClick:()=>A("json"),className:"h-8",children:"JSON"})]})]}),"json"===E?(0,a.jsx)(g.T,{value:eN,onChange:e=>ey(e.target.value),className:"min-h-[400px] font-mono text-sm",disabled:ew||ek}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Audio Id *"}),(0,a.jsx)(v.p,{placeholder:"Enter the audio_id from a previous generation",value:M,onChange:e=>I(e.target.value),disabled:ew||ek})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Default Param Flag"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Off = inherit from source audio"})]}),(0,a.jsx)(b.d,{checked:z,onCheckedChange:T,disabled:ew||ek})]}),z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Mv *"}),(0,a.jsxs)(j.l6,{value:Y,onValueChange:e=>ee(e),disabled:ew||ek,children:[(0,a.jsx)(j.bq,{children:(0,a.jsx)(j.yv,{})}),(0,a.jsxs)(j.gC,{children:[(0,a.jsx)(j.eb,{value:"V4",children:"V4"}),(0,a.jsx)(j.eb,{value:"V4_5",children:"V4.5"}),(0,a.jsx)(j.eb,{value:"V4_5ALL",children:"V4.5 All"}),(0,a.jsx)(j.eb,{value:"V4_5PLUS",children:"V4.5 Plus"}),(0,a.jsx)(j.eb,{value:"V5",children:"V5"}),(0,a.jsx)(j.eb,{value:"V5_5",children:"V5.5"})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Instrumental"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Prompt is not sent for instrumental extensions"})]}),(0,a.jsx)(b.d,{checked:W,onCheckedChange:B,disabled:ew||ek})]}),!W&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(i.F,{current:K.length,max:ep,children:"Prompt *"}),(0,a.jsx)(g.T,{placeholder:"Describe how to extend the music...",value:K,onChange:e=>Z(e.target.value),maxLength:ep,className:"min-h-[80px] resize-y",disabled:ew||ek})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(i.F,{current:G.length,max:eg,children:"Style *"}),(0,a.jsx)(v.p,{placeholder:"e.g., pop, rock, jazz...",value:G,onChange:e=>H(e.target.value),maxLength:eg,disabled:ew||ek})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(i.F,{current:Q.length,max:ev,children:"Title *"}),(0,a.jsx)(v.p,{placeholder:"Song title...",value:Q,onChange:e=>X(e.target.value),maxLength:ev,disabled:ew||ek})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Continue At *"}),(0,a.jsx)(v.p,{type:"number",placeholder:"Time in seconds to continue from",value:q??"",onChange:e=>D(e.target.value?Number(e.target.value):void 0),disabled:ew||ek})]})]}),z&&(0,a.jsxs)(y.Nt,{open:ej,onOpenChange:eb,children:[(0,a.jsx)(y.R6,{asChild:!0,children:(0,a.jsxs)(f.$,{variant:"ghost",className:"w-full justify-between",disabled:ew||ek,children:["Advanced Options",(0,a.jsx)(w.A,{className:`h-4 w-4 transition-transform ${ej?"rotate-180":""}`})]})}),(0,a.jsxs)(y.Ke,{className:"space-y-4 pt-2",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Negative Tags"}),(0,a.jsx)(v.p,{placeholder:"Tags to avoid...",value:et,onChange:e=>es(e.target.value),disabled:ew||ek})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Vocal Gender"}),(0,a.jsxs)(j.l6,{value:ea,onValueChange:e=>er(e),disabled:ew||ek,children:[(0,a.jsx)(j.bq,{children:(0,a.jsx)(j.yv,{})}),(0,a.jsxs)(j.gC,{children:[(0,a.jsx)(j.eb,{value:"none",children:"Not specified"}),(0,a.jsx)(j.eb,{value:"m",children:"Male"}),(0,a.jsx)(j.eb,{value:"f",children:"Female"})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(p.J,{className:"text-sm font-medium",children:["Style Weight ",en[0].toFixed(2)]}
1),(0,a.jsx)(N.A,{value:en,onValueChange:ei,min:0,max:1,step:.01,disabled:ew||ek})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(p.J,{className:"text-sm font-medium",children:["Weirdness Constraint ",el[0].toFixed(2)]}),(0,a.jsx)(N.A,{value:el,onValueChange:ed,min:0,max:1,step:.01,disabled:ew||ek})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(p.J,{className:"text-sm font-medium",children:["Audio Weight ",eo[0].toFixed(2)]}),(0,a.jsx)(N.A,{value:eo,onValueChange:ec,min:0,max:1,step:.01,disabled:ew||ek})]}),ex&&(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Persona Id"}),(0,a.jsx)(v.p,{placeholder:"Optional persona ID...",value:eu,onChange:e=>em(e.target.value),disabled:ew||ek})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(p.J,{className:"text-sm font-medium",children:"Persona Type"}),(0,a.jsxs)(j.l6,{value:eh,onValueChange:e=>ef(e),disabled:ew||ek,children:[(0,a.jsx)(j.bq,{children:(0,a.jsx)(j.yv,{})}),(0,a.jsxs)(j.gC,{children:[(0,a.jsx)(j.eb,{value:"style_persona",children:"Style Persona"}),(0,a.jsx)(j.eb,{value:"voice_persona",children:"Voice Persona"})]})]})]})]})]})]})]}),(0,a.jsx)(r.Bn,{estimatedCredits:(0,o.O5)(e),onReset:()=>{A("form"),I(""),D(void 0),T(!0),B(!1),Z(""),H(""),X(""),ee("V4"),es(""),er("none"),ei([.5]),ed([.5]),ec([.5]),em(""),ef("style_persona"),ey("")},onRun:eO,disabled:ew||ek,resetDisabled:ew||ek,loading:ew||ek,loadingText:ew?"Submitting...":ek?"Processing...":"Running..."})]})})}),(0,a.jsx)(x.Zp,{className:d.m.panel,children:(0,a.jsx)(x.Wu,{className:d.m.content,children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:d.m.header,children:[(0,a.jsx)("div",{className:"text-lg font-semibold",children:"Output"}),(0,a.jsxs)("div",{className:d.m.segmented,children:[(0,a.jsx)(f.$,{size:"sm",variant:"preview"===J?"default":"ghost",onClick:()=>O("preview"),className:"h-8",children:"Preview"}),(0,a.jsx)(f.$,{size:"sm",variant:"json"===J?"default":"ghost",onClick:()=>O("json"),className:"h-8",children:"JSON"})]})]}),"json"===J?(0,a.jsx)(g.T,{value:JSON.stringify(eU||{},null,2),readOnly:!0,className:"min-h-[500px] font-mono text-sm bg-muted"}):ek&&(!eU||"not_started"===eU.status||"running"===eU.status)?(0,a.jsx)(n.EV,{active:ek,taskId:eU?.task_id||e$}):eU?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.BP,{data:eU}),(0,a.jsx)(n.V6,{message:eU.error_message}),eU.files?.map((e,t)=>(0,a.jsxs)("div",{className:"space-y-3 p-4 bg-background/50 rounded-lg",children:[e.image_url&&(0,a.jsx)("img",{src:e.image_url,alt:"Cover",className:"w-full max-w-[200px] rounded-lg"}),e.audio_url&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("audio",{controls:!0,src:e.audio_url,className:"w-full"}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(f.$,{variant:"outline",size:"sm",disabled:eP===t,onClick:async()=>{try{eE(t);let s=await fetch(`/api/download?url=${encodeURIComponent(e.audio_url)}`),a=await s.blob(),r=URL.createObjectURL(a),n=document.createElement("a");n.href=r,n.download=`extended_${eU.task_id}_${t}.mp3`,n.click(),URL.revokeObjectURL(r),_.oR.success("Downloaded!")}catch{_.oR.error("Download failed")}finally{eE(null)}},children:eP===t?(0,a.jsx)(C.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(S.A,{className:"h-4 w-4"})})})]})]},t))]}):(0,a.jsx)("div",{className:"w-full aspect-video bg-muted/30 rounded-lg border-2 border-dashed border-muted-foreground/20 flex flex-col items-center justify-center",children:(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Extended music will appear here"})})]})})})]})})})]})}},90466:(e,t,s)=>{s.d(t,{d:()=>l});var a=s(95155),r=s(12115),n=s(8678),i=s(91337);let l=r.forwardRef(({className:e,...t},s)=>(0,a.jsx)(n.bL,{className:(0,i.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:s,children:(0,a.jsx)(n.zi,{className:(0,i.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}
1));l.displayName=n.bL.displayName}}]);
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.