1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43056,e=>{"use strict";var t=e.i(88310),o=e.i(95572),r=e.i(152514),i=e.i(614124),a=e.i(1631),s=e.i(508537),n=e.i(227112),d=e.i(936379);function l(e){let l=(0,o.c)(44),{mode:c,model:u,capability:m,onSubmit:p,disabled:x,i18n:f,initialFirstFrame:g,defaultPrompt:h,onVideoAuthRequired:b,requiredReferenceType:v}=e;switch(c){case"text-to-video":{let e;return l[0]!==m||l[1]!==h||l[2]!==x||l[3]!==f||l[4]!==u||l[5]!==p?(e=(0,t.jsx)(s.SceneFormTextToVideo,{model:u,capability:m,onSubmit:p,disabled:x,i18n:f,defaultPrompt:h}),l[0]=m,l[1]=h,l[2]=x,l[3]=f,l[4]=u,l[5]=p,l[6]=e):e=l[6],e}case"image-to-video":{let e;return l[7]!==m||l[8]!==h||l[9]!==x||l[10]!==f||l[11]!==g||l[12]!==u||l[13]!==p?(e=(0,t.jsx)(r.SceneFormImageToVideo,{model:u,capability:m,onSubmit:p,disabled:x,i18n:f,initialFirstFrame:g,defaultPrompt:h}),l[7]=m,l[8]=h,l[9]=x,l[10]=f,l[11]=g,l[12]=u,l[13]=p,l[14]=e):e=l[14],e}case"reference-to-video":{let e;return l[15]!==m||l[16]!==x||l[17]!==f||l[18]!==u||l[19]!==p||l[20]!==b||l[21]!==v?(e=(0,t.jsx)(a.SceneFormReferenceToVideo,{model:u,capability:m,onSubmit:p,disabled:x,i18n:f,onVideoAuthRequired:b,requiredReferenceType:v}),l[15]=m,l[16]=x,l[17]=f,l[18]=u,l[19]=p,l[20]=b,l[21]=v,l[22]=e):e=l[22],e}case"motion-control":{let e;return l[23]!==m||l[24]!==x||l[25]!==f||l[26]!==u||l[27]!==p||l[28]!==b?(e=(0,t.jsx)(i.SceneFormMotionControl,{model:u,capability:m,onSubmit:p,disabled:x,i18n:f,onVideoAuthRequired:b}),l[23]=m,l[24]=x,l[25]=f,l[26]=u,l[27]=p,l[28]=b,l[29]=e):e=l[29],e}case"video-edit":{let e;return l[30]!==m||l[31]!==x||l[32]!==f||l[33]!==u||l[34]!==p||l[35]!==b?(e=(0,t.jsx)(n.SceneFormVideoEdit,{model:u,capability:m,onSubmit:p,disabled:x,i18n:f,onVideoAuthRequired:b}),l[30]=m,l[31]=x,l[32]=f,l[33]=u,l[34]=p,l[35]=b,l[36]=e):e=l[36],e}case"video-upscale":{let e;return l[37]!==m||l[38]!==x||l[39]!==f||l[40]!==u||l[41]!==p||l[42]!==b?(e=(0,t.jsx)(d.SceneFormVideoUpscale,{model:u,capability:m,onSubmit:p,disabled:x,i18n:f,onVideoAuthRequired:b}),l[37]=m,l[38]=x,l[39]=f,l[40]=u,l[41]=p,l[42]=b,l[43]=e):e=l[43],e}default:return null}}e.s(["DynamicVideoForm",()=>l])},936379,e=>{"use strict";var t=e.i(88310),o=e.i(95572),r=e.i(956371),i=e.i(95939);function a(e){let a,d,l,c,u,m,p,x,f,g,h,b,v,j,y,N,_,S,w,k,R,I=(0,o.c)(74),{capability:M,onSubmit:P,disabled:C,i18n:V,onVideoAuthRequired:A}=e,D=M.supports.videoUpscale;I[0]!==D?.factors?(a=D?.factors??["2","4"],I[0]=D?.factors,I[1]=a):a=I[1];let q=a,F=D?.sourceVideo.minDurationSec,T=D?.sourceVideo.maxDurationSec,[$,B]=(0,r.useState)(""),[L,U]=(0,r.useState)(),[z,O]=(0,r.useState)(!1),[W,E]=(0,r.useState)(!1),[K,G]=(0,r.useState)(D?.defaultFactor??"2");I[2]!==D?.defaultFactor?(d=()=>{G(D?.defaultFactor??"2")},I[2]=D?.defaultFactor,I[3]=d):d=I[3];let H=D?.defaultFactor;I[4]!==H?(l=[H],I[4]=H,I[5]=l):l=I[5],(0,r.useEffect)(d,l),I[6]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{let t=e.find(n);B(t?.url||""),U(t?.duration),O(!!t?.verified),E(e.some(s))},I[6]=c):c=I[6];let Q=c,X="number"==typeof L&&L>0,J=X&&(null==F||L>=F)&&(null==T||L<=T);e:{if(!$||!J){u=null;break e}u=Math.ceil((M.credits.creditPerSecond?.[K]??M.credits.base)*L)}let Y=u,Z=!!$&&z&&J&&!W;I[7]!==Z||I[8]!==Y||I[9]!==K||I[10]!==P||I[11]!==$?(m=()=>{Z&&null!=Y&&P({scene:"video-upscale",upscaleSourceVideo:$,upscaleFactor:K},Y)},I[7]=Z,I[8]=Y,I[9]=K,I[10]=P,I[11]=$,I[12]=m):m=I[12];let ee=m,et=V?.source_video||"Source Video";I[13]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)("span",{className:"text-red-500",children:"*"}),I[13]=p):p=I[13],I[14]!==et?(x=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[et," ",p]}),I[14]=et,I[15]=x):x=I[15];let eo=D?.sourceVideo.maxSizeMB??50;I[16]!==A||I[17]!==eo?(f=(0,t.jsx)(i.VideoUploader,{maxVideos:1,maxSizeMB:eo,onChange:Q,onBeforeSelect:A}),I[16]=A,I[17]=eo,I[18]=f):f=I[18];let er=String(D?.sourceVideo.maxSizeMB??50),ei=V?.source_video_hint||"mp4 / mov · up to {size}MB";if(I[19]!==T||I[20]!==F||I[21]!==er||I[22]!==ei){if(g=ei.replace("{size}",er),null!=F&&null!=T)g=g.replace("{min}",String(F)).replace("{max}",String(T));else{let e;I[24]===Symbol.for("react.memo_cache_sentinel")?(e=/\s*[·ã»]?\s*\{min\}[â\-]\{max\}s?/g,I[24]=e):e=I[24],g=g.replace(e,"")}I[19]=T,I[20]=F,I[21]=er,I[22]=ei,I[23]=g}else g=I[23];let ea=g;I[25]!==ea?(h=(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:ea}),I[25]=ea,I[26]=h):h=I[26],I[27]!==V?.source_not_verified||I[28]!==z||I[29]!==$?(b=!!$&&!z&&(0,t.jsx)("div",{className:"text-[11px] text-red-400",children:V?.source_not_verified||"Source video could not be verified. Please re-export as standard mp4/mov."}),I[27]=V?.source_not_verified,I[28]=z,I[29]=$,I[30]=b):b=I[30],I[31]!==J||I[32]!==X||I[33]!==V?.duration_out_of_range||I[34]!==T||I[35]!==F||I[36]!==z||I[37]!==$?(v=!!$&&z&&X&&!J&&null!=F&&null!=T&&(0,t.jsx)("div",{className:"text-[11px] text-amber-400",children:(V?.duration_out_of_range||"Duration must be between {min}s and {max}s").replace("{min}",String(F)).replace("{max}",String(T))}),I[31]=J,I[32]=X,I[33]=V?.duration_out_of_range,I[34]=T,I[35]=F,I[36]=z,I[37]=$,I[38]=v):v=I[38],I[39]!==x||I[40]!==f||I[41]!==
1h||I[42]!==b||I[43]!==v?(j=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[x,f,h,b,v]}),I[39]=x,I[40]=f,I[41]=h,I[42]=b,I[43]=v,I[44]=j):j=I[44];let es=V?.upscale_factor||"Upscale Factor";if(I[45]!==es?(y=(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:es}),I[45]=es,I[46]=y):y=I[46],I[47]!==C||I[48]!==K||I[49]!==q){let e;I[51]!==C||I[52]!==K?(e=e=>(0,t.jsxs)("button",{onClick:()=>G(e),disabled:C,className:`flex-1 px-3 py-2 text-xs rounded border transition-all ${K===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground/20"} ${C?"cursor-not-allowed opacity-50":""}`,children:[e,"x"]},e),I[51]=C,I[52]=K,I[53]=e):e=I[53],N=q.map(e),I[47]=C,I[48]=K,I[49]=q,I[50]=N}else N=I[50];I[54]!==N?(_=(0,t.jsx)("div",{className:"flex gap-2",children:N}),I[54]=N,I[55]=_):_=I[55],I[56]!==y||I[57]!==_?(S=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[y,_]}),I[56]=y,I[57]=_,I[58]=S):S=I[58];let en=C||!Z,ed=`w-full rounded-lg px-6 py-2.5 sm:py-3 text-sm sm:text-base font-[550] transition-all focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:ring-offset-2 ${C||!Z?"cursor-not-allowed bg-muted text-muted-foreground":"bg-foreground text-background shadow-lg hover:bg-foreground
1/90 hover:shadow-xl"}`;return I[59]!==Y||I[60]!==C||I[61]!==V?.generate||I[62]!==V?.generate_placeholder||I[63]!==V?.generating?(w=C?V?.generating||"Generating...":null==Y?V?.generate_placeholder||"Upscale Video":(V?.generate||"Upscale Video ({credits} credits)").replace("{credits}",String(Y)),I[59]=Y,I[60]=C,I[61]=V?.generate,I[62]=V?.generate_placeholder,I[63]=V?.generating,I[64]=w):w=I[64],I[65]!==ee||I[66]!==en||I[67]!==ed||I[68]!==w?(k=(0,t.jsx)("div",{className:"pt-1",children:(0,t.jsx)("button",{onClick:ee,disabled:en,className:ed,children:w})}),I[65]=ee,I[66]=en,I[67]=ed,I[68]=w,I[69]=k):k=I[69],I[70]!==j||I[71]!==S||I[72]!==k?(R=(0,t.jsxs)(t.Fragment,{children:[j,S,k]}),I[70]=j,I[71]=S,I[72]=k,I[73]=R):R=I[73],R}function s(e){return"uploading"===e.status}function n(e){return"uploaded"===e.status&&e.url}e.s(["SceneFormVideoUpscale",()=>a])},508537,e=>{"use strict";var t=e.i(88310),o=e.i(95572),r=e.i(956371),i=e.i(930768),a=e.i(708439);function s(e){let r,i=(0,o.c)(3),{type:a}=e;if("16:9"===a||"landscape"===a){let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"2",y:"5",width:"16",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[0]=e):e=i[0],e}if("9:16"===a||"portrait"===a){let e;return i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"5",y:"2",width:"10",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[1]=e):e=i[1],e}return i[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[2]=r):r=i[2],r}function n(e){let n,d,l,c,u,m,p,x,f,g,h,b,v,j,y,N,_,S,w,k=(0,o.c)(82),{capability:R,onSubmit:I,disabled:M,i18n:P,defaultPrompt:C}=e,[V,A]=(0,r.useState)(C||""),[D,q]=(0,r.useState)(R.defaults.aspectRatio||""),[F,T]=(0,r.useState)(R.defaults.duration||""),[$,B]=(0,r.useState)(R.defaults.resolution||""),[L,U]=(0,r.useState)(R.defaults.qualityTier||"");k[0]!==R.defaults.aspectRatio||k[1]!==R.defaults.duration||k[2]!==R.defaults.qualityTier||k[3]!==R.defaults.resolution?(n=()=>{q(R.defaults.aspectRatio||""),T(R.defaults.duration||""),B(R.defaults.resolution||""),U(R.defaults.qualityTier||"")},k[0]=R.defaults.aspectRatio,k[1]=R.defaults.duration,k[2]=R.defaults.qualityTier,k[3]=R.defaults.resolution,k[4]=n):n=k[4],k[5]!==R?(d=[R],k[5]=R,k[6]=d):d=k[6],(0,r.useEffect)(n,d),k[7]!==R||k[8]!==F||k[9]!==L||k[10]!==$?(l=(0,i.calculateCredits)(R,{duration:F,resolution:$,qualityTier:L}),k[7]=R,k[8]=F,k[9]=L,k[10]=$,k[11]=l):l=k[11];let z=l;k[12]!==R.model?(c=(0,a.getPromptLimit)({model:R.model,mediaType:"video",scene:"text-to-video"}),k[12]=R.model,k[13]=c):c=k[13];let O=c,W=V.length>O;k[14]!==W||k[15]!==V?(u=V.trim().length>0&&!W,k[14]=W,k[15]=V,k[16]=u):u=k[16];let E=u;k[17]!==D||k[18]!==E||k[19]!==z||k[20]!==F||k[21]!==I||k[22]!==V||k[23]!==L||k[24]!==$?(m=()=>{E&&(I({scene:"text-to-video",prompt:V.trim(),aspectRatio:D||void 0,duration:F||void 0,resolution:$||void 0,qualityTier:L||void 0},z),A(""))},k[17]=D,k[18]=E,k[19]=z,k[20]=F,k[21]=I,k[22]=V,k[23]=L,k[24]=$,k[25]=m):m=k[25];let K=m,G=P?.prompt||"Prompt";k[26]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)("span",{className:"text-red-500",children:"*"}),k[26]=p):p=k[26],k[27]!==G?(x=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[G," ",p]}),k[27]=G,k[28]=x):x=k[28],k[29]===Symbol.for("react.memo_cache_sentinel")?(f=e=>A(e.target.value),k[29]=f):f=k[29];let H=P?.prompt_placeholder||"Describe your video scene...";k[30]!==M||k[31]!==O||k[32]!==V||k[33]!==H?(g=(0,t.jsx)("textarea",{value:V,onChange:f,placeholder:H,className:"min-h-[160px] sm:min-h-[200px] w-full resize-none rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-border focus:outline-none",maxLength:O,disabled:M}),k[30]=M,k[31]=O,k[32]=V,k[33]=H,k[34]=g):g=k[34];let Q=`text-right text-xs ${W?"text-red-500 font-semibold":"text-muted-foreground"}`,X=P?.characters||"characters";if(k[35]!==O||k[36]!==V.length||k[37]!==Q||k[38]!==X?(h=(0,t.jsxs)("div",{className:Q,children:[V.length,"/",O," ",X]}),k[35]=O,k[36]=V.length,k[37]=Q,k[38]=X,k[39]=h):h=k[39],k[40]!==g||k[41]!==h||k[42]!==x?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[x,g,h]}),k[40]=g,k[41]=h,k[42]=x,k[43]=b):b=k[43],k[44]!==R.defaults.fixedDuration||k[45]!==R.options.duration||k[46]!==M||k[47]!==F||k[48]!==P?.video_length){let e;v=!Array.isArray(R.options.duration)&&R.options.duration?(e=R.options.duration,(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[P?.video_length||"Duration",": ",F||e.default,"s"]}),(0,t.jsx)("input",{type:"range",min:e.min,max:e.max,step:e.step,value:parseInt(F)||e.default,onCh
1ange:e=>T(e.target.value),disabled:M,className:"w-full accent-foreground"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e.min,"s"]}),(0,t.jsxs)("span",{children:[e.max,"s"]})]})]})):Array.isArray(R.options.duration)&&R.options.duration.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:P?.video_length||"Duration"}),(0,t.jsx)("div",{className:"flex gap-2",children:R.options.duration.map(e=>(0,t.jsxs)("button",{onClick:()=>T(e),disabled:M,className:`px-3 py-1.5 text-xs rounded-md border transition-all ${F===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground/20"} ${M?"cursor-not-allowed opacity-50":""}`,children:[e,"s"]},e))})]}):R.defaults.fixedDuration?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:P?.video_length||"Duration"}),(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)("span",{className:"px-3 py-1.5 text-xs rounded-md border border-border bg-background/60 text-muted-foreground cursor-default",children:R.defaults.fixedDuration})})]}):null,k[44]=R.defaults.fixedDuration,k[45]=R.options.duration,k[46]=M,k[47]=F,k[48]=P?.video_length,k[49]=v}else v=k[49];k[50]!==R.options.qualityTier||k[51]!==M||k[52]!==P?.quality||k[53]!==L?(j=R.options.qualityTier&&R.options.qualityTier.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:P?.quality||"Quality"}),(0,t.jsx)("div",{className:"flex gap-2",children:R.options.qualityTier.map(e=>(0,t.jsx)("button",{onClick:()=>U(e),disabled:M,className:`px-3 py-1.5 text-xs rounded-md border transition-all capitalize ${L===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground
1/20"} ${M?"cursor-not-allowed opacity-50":""}`,children:"std"===e?"Std (720p)":"pro"===e?"Pro (1080p)":"fast"===e?"Fast (1080p)":"quality"===e?"Quality (4K)":e},e))})]}),k[50]=R.options.qualityTier,k[51]=M,k[52]=P?.quality,k[53]=L,k[54]=j):j=k[54],k[55]!==R.options.resolution||k[56]!==M||k[57]!==P?.resolution||k[58]!==$?(y=R.options.resolution&&R.options.resolution.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:P?.resolution||"Resolution"}),(0,t.jsx)("div",{className:"flex gap-2",children:R.options.resolution.map(e=>(0,t.jsx)("button",{onClick:()=>B(e),disabled:M,className:`px-3 py-1.5 text-xs rounded-md border transition-all ${$===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground/20"} ${M?"cursor-not-allowed opacity-50":""}`,children:e},e))})]}),k[55]=R.options.resolution,k[56]=M,k[57]=P?.resolution,k[58]=$,k[59]=y):y=k[59],k[60]!==D||k[61]!==R.options.aspectRatio||k[62]!==M||k[63]!==P?.aspect_ratio?(N=R.options.aspectRatio&&R.options.aspectRatio.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:P?.aspect_ratio||"Aspect Ratio"}),(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:R.options.aspectRatio.map(e=>{let o=R.options.aspectRatio.length>3;return(0,t.jsxs)("button",{onClick:()=>q(e),disabled:M,className:`flex ${o?"flex-col items-center gap-1 px-2 py-2":"items-center gap-2 px-3 py-2"} rounded-lg transition-all ${D===e?"bg-muted border border-foreground
1/20 text-foreground":"bg-background/60 border border-border/50 text-muted-foreground hover:border-border"} ${M?"cursor-not-allowed opacity-50":""}`,children:[(0,t.jsx)(s,{type:e}),(0,t.jsx)("span",{className:"text-xs font-medium",children:e})]},e)})})]}),k[60]=D,k[61]=R.options.aspectRatio,k[62]=M,k[63]=P?.aspect_ratio,k[64]=N):N=k[64];let J=M||!E,Y=`w-full rounded-lg px-6 py-2.5 sm:py-3 text-sm sm:text-base font-[550] transition-all focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:ring-offset-2 ${M||!E?"cursor-not-allowed bg-muted text-muted-foreground":"bg-primary text-primary-foreground shadow-lg hover:opacity-95 hover:shadow-xl"}`;return k[65]!==z||k[66]!==M||k[67]!==P?.generate||k[68]!==P?.generating?(_=M?P?.generating||"Generating...":(P?.generate||"Generate Video ({credits} credits)").replace("{credits}",String(z)),k[65]=z,k[66]=M,k[67]=P?.generate,k[68]=P?.generating,k[69]=_):_=k[69],k[70]!==K||k[71]!==J||k[72]!==Y||k[73]!==_?(S=(0,t.jsx)("div",{className:"pt-1",children:(0,t.jsx)("button",{onClick:K,disabled:J,className:Y,children:_})}),k[70]=K,k[71]=J,k[72]=Y,k[73]=_,k[74]=S):S=k[74],k[75]!==b||k[76]!==v||k[77]!==j||k[78]!==y||k[79]!==N||k[80]!==S?(w=(0,t.jsxs)(t.Fragment,{children:[b,v,j,y,N,S]}),k[75]=b,k[76]=v,k[77]=j,k[78]=y,k[79]=N,k[80]=S,k[81]=w):w=k[81],w}e.s(["SceneFormTextToVideo",()=>n])},152514,e=>{"use strict";var t=e.i(88310),o=e.i(95572),r=e.i(956371),i=e.i(930768),a=e.i(708439),s=e.i(561444);function n(e){let r,i=(0,o.c)(3),{type:a}=e;if("16:9"===a||"landscape"===a){let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"2",y:"5",width:"16",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[0]=e):e=i[0],e}if("9:16"===a||"portrait"===a){let e;return i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"5",y:"2",width:"10",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[1]=e):e=i[1],e}return i[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[2]=r):r=i[2],r}function d(e){let d,l,c,u,m,p,x,f,g,h,b,v,j,y,N,_,S,w,k,R,I,M,P,C,V=(0,o.c)(101),{capability:A,onSubmit:D,disabled:q,i18n:F,initialFirstFrame:T,defaultPrompt:$}=e,[B,L]=(0,r.useState)($||""),[U,z]=(0,r.useState)(T||"");V[0]!==T?(d=()=>{T&&z(T)},l=[T],V[0]=T,V[1]=d,V[2]=l):(d=V[1],l=V[2]),(0,r.useEffect)(d,l);let[O,W]=(0,r.useState)(""),[E,K]=(0,r.useState)(A.defaults.aspectRatio||""),[G,H]=(0,r.useState)(A.defaults.duration||""),[Q,X]=(0,r.useState)(A.defaults.resolution||""),[J,Y]=(0,r.useState)(A.defaults.qualityTier||""),Z=A.supports.endFrame;V[3]!==A.defaults.aspectRatio||V[4]!==A.defaults.duration||V[5]!==A.defaults.qualityTier||V[6]!==A.defaults.resolution||V[7]!==A.supports.endFrame?(c=()=>{K(A.defaults.aspectRatio||""),H(A.defaults.duration||""),X(A.defaults.resolution||""),Y(A.defaults.qualityTier||""),A.supports.endFrame||W("")},V[3]=A.defaults.aspectRatio,V[4]=A.defaults.duration,V[5]=A.defaults.qualityTier,V[6]=A.defaults.resolution,V[7]=A.supports.endFrame,V[8]=c):c=V[8],V[9]!==A?(u=[A],V[9]=A,V[10]=u):u=V[10],(0,r.useEffect)(c,u),V[11]!==A||V[12]!==G||V[13]!==J||V[14]!==Q?(m=(0,i.calculateCredits)(A,{duration:G,resolution:Q,qualityTier:J}),V[11]=A,V[12]=G,V[13]=J,V[14]=Q,V[15]=m):m=V[15];let ee=m;V[16]===Symbol.for("react.memo_cache_sentinel")?(p=e=>{z(e[0]?.url||"")},V[16]=p):p=V[16];let et=p;V[17]===Symbol.for("react.memo_cache_sentinel")?(x=e=>{W(e[0]?.url||"")},V[17]=x):x=V[17];let eo=x;V[18]!==A.model?(f=(0,a.getPromptLimit)({model:A.model,mediaType:"video",scene:"image-to-video"}),V[18]=A.model,V[19]=f):f=V[19];let er=f,ei=B.length>er;V[20]!==U||V[21]!==ei||V[22]!==B?(g=!!U&&B.trim().length>0&&!ei,V[20]=U,V[21]=ei,V[22]=B,V[23]=g):g=V[23];let ea=g;V[24]!==E||V[25]!==ea||V[26]!==ee||V[27]!==G||V[28]!==U||V[29]!==O||V[30]!==D||V[31]!==B||V[32]!==J||V[33]!==Q?(h=()=>
1{ea&&(D({scene:"image-to-video",prompt:B.trim()||void 0,firstFrame:U,lastFrame:O||void 0,aspectRatio:E||void 0,duration:G||void 0,resolution:Q||void 0,qualityTier:J||void 0},ee),L(""),z(""),W(""))},V[24]=E,V[25]=ea,V[26]=ee,V[27]=G,V[28]=U,V[29]=O,V[30]=D,V[31]=B,V[32]=J,V[33]=Q,V[34]=h):h=V[34];let es=h;V[35]!==q||V[36]!==U||V[37]!==F?.first_frame||V[38]!==F?.image_source||V[39]!==F?.last_frame||V[40]!==F?.optional||V[41]!==O||V[42]!==Z?(b=!q&&(Z?(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[F?.first_frame||"First Frame"," ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)(s.ImageUploader,{defaultPreviews:U?[U]:[],onChange:et,maxImages:1,maxSizeMB:10,imageClassName:"h-[90px] w-40",emptyHint:""})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[F?.last_frame||"Last Frame"," ",(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:["(",F?.optional||"Optional",")"]})]}),(0,t.jsx)(s.ImageUploader,{defaultPreviews:O?[O]:[],onChange:eo,maxImages:1,maxSizeMB:10,imageClassName:"h-[90px] w-40",emptyHint:""})]})]}):(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[F?.image_source||"Image Source"," ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)(s.ImageUploader,{defaultPreviews:U?[U]:[],onChange:et,maxImages:1,maxSizeMB:10,imageClassName:"h-[90px] w-full",emptyHint:""})]})),V[35]=q,V[36]=U,V[37]=F?.first_frame,V[38]=F?.image_source,V[39]=F?.last_frame,V[40]=F?.optional,V[41]=O,V[42]=Z,V[43]=b):b=V[43];let en=F?.prompt||"Prompt";V[44]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("span",{className:"text-red-500",children:"*"}),V[44]=v):v=V[44],V[45]!==en?(j=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[en," ",v]}),V[45]=en,V[46]=j):j=V[46],V[47]===Symbol.for("react.memo_cache_sentinel")?(y=e=>L(e.target.value),V[47]=y):y=V[47];let ed=F?.prompt_placeholder||"Describe how you want the image to come alive...";V[48]!==q||V[49]!==er||V[50]!==B||V[51]!==ed?(N=(0,t.jsx)("textarea",{value:B,onChange:y,placeholder:ed,className:"min-h-[80px] sm:min-h-[100px] w-full resize-none rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-border focus:outline-none",maxLength:er,disabled:q}),V[48]=q,V[49]=er,V[50]=B,V[51]=ed,V[52]=N):N=V[52];let el=`text-right text-xs ${ei?"text-red-500 font-semibold":"text-muted-foreground"}`,ec=F?.characters||"characters";if(V[53]!==er||V[54]!==B.length||V[55]!==el||V[56]!==ec?(_=(0,t.jsxs)("div",{className:el,children:[B.length,"/",er," ",ec]}),V[53]=er,V[54]=B.length,V[55]=el,V[56]=ec,V[57]=_):_=V[57],V[58]!==j||V[59]!==N||V[60]!==_?(S=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[j,N,_]}),V[58]=j,V[59]=N,V[60]=_,V[61]=S):S=V[61],V[62]!==A.defaults.fixedDuration||V[63]!==A.options.duration||V[64]!==q||V[65]!==G||V[66]!==F?.video_length){let e;w=!Array.isArray(A.options.duration)&&A.options.duration?(e=A.options.duration,(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[F?.video_length||"Duration",": ",G||e.default,"s"]}),(0,t.jsx)("input",{type:"range",min:e.min,max:e.max,step:e.step,value:parseInt(G)||e.default,onChange:e=>H(e.target.value),disabled:q,className:"w-full accent-foreground"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e.min,"s"]}),(0,t.jsxs)("span",{children:[e.max,"s"]})]})]})):Array.isArray(A.options.duration)&&A.options.duration.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:F?.video_length||"Duration"}),(0,t.jsx)("div",{className:"flex gap-2",children:A.options.duration.map(e=>(0,t.jsxs)("button",{onClick:()=>H(e),disabled:q,className:`px-3 py-1.5 text-xs rounded-md border transition-all ${G===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground
1/20"} ${q?"cursor-not-allowed opacity-50":""}`,children:[e,"s"]},e))})]}):A.defaults.fixedDuration?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:F?.video_length||"Duration"}),(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)("span",{className:"px-3 py-1.5 text-xs rounded-md border border-border bg-background/60 text-muted-foreground cursor-default",children:A.defaults.fixedDuration})})]}):null,V[62]=A.defaults.fixedDuration,V[63]=A.options.duration,V[64]=q,V[65]=G,V[66]=F?.video_length,V[67]=w}else w=V[67];V[68]!==A.options.qualityTier||V[69]!==q||V[70]!==F?.quality||V[71]!==J?(k=A.options.qualityTier&&A.options.qualityTier.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:F?.quality||"Quality"}),(0,t.jsx)("div",{className:"flex gap-2",children:A.options.qualityTier.map(e=>(0,t.jsx)("button",{onClick:()=>Y(e),disabled:q,className:`px-3 py-1.5 text-xs rounded-md border transition-all capitalize ${J===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground
1/20"} ${q?"cursor-not-allowed opacity-50":""}`,children:"std"===e?"Std (720p)":"pro"===e?"Pro (1080p)":"fast"===e?"Fast (1080p)":"quality"===e?"Quality (4K)":e},e))})]}),V[68]=A.options.qualityTier,V[69]=q,V[70]=F?.quality,V[71]=J,V[72]=k):k=V[72],V[73]!==A.options.resolution||V[74]!==q||V[75]!==F?.resolution||V[76]!==Q?(R=A.options.resolution&&A.options.resolution.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:F?.resolution||"Resolution"}),(0,t.jsx)("div",{className:"flex gap-2",children:A.options.resolution.map(e=>(0,t.jsx)("button",{onClick:()=>X(e),disabled:q,className:`px-3 py-1.5 text-xs rounded-md border transition-all ${Q===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground/20"} ${q?"cursor-not-allowed opacity-50":""}`,children:e},e))})]}),V[73]=A.options.resolution,V[74]=q,V[75]=F?.resolution,V[76]=Q,V[77]=R):R=V[77],V[78]!==E||V[79]!==A.options.aspectRatio||V[80]!==q||V[81]!==F?.aspect_ratio?(I=A.options.aspectRatio&&A.options.aspectRatio.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:F?.aspect_ratio||"Aspect Ratio"}),(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:A.options.aspectRatio.map(e=>{let o=A.options.aspectRatio.length>3;return(0,t.jsxs)("button",{onClick:()=>K(e),disabled:q,className:`flex ${o?"flex-col items-center gap-1 px-2 py-2":"items-center gap-2 px-3 py-2"} rounded-lg transition-all ${E===e?"bg-muted border border-foreground
1/20 text-foreground":"bg-background/60 border border-border/50 text-muted-foreground hover:border-border"} ${q?"cursor-not-allowed opacity-50":""}`,children:[(0,t.jsx)(n,{type:e}),(0,t.jsx)("span",{className:"text-xs font-medium",children:e})]},e)})})]}),V[78]=E,V[79]=A.options.aspectRatio,V[80]=q,V[81]=F?.aspect_ratio,V[82]=I):I=V[82];let eu=q||!ea,em=`w-full rounded-lg px-6 py-2.5 sm:py-3 text-sm sm:text-base font-[550] transition-all focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:ring-offset-2 ${q||!ea?"cursor-not-allowed bg-muted text-muted-foreground":"bg-primary text-primary-foreground shadow-lg hover:opacity-95 hover:shadow-xl"}`;return V[83]!==ee||V[84]!==q||V[85]!==F?.generate||V[86]!==F?.generating?(M=q?F?.generating||"Generating...":(F?.generate||"Generate Video ({credits} credits)").replace("{credits}",String(ee)),V[83]=ee,V[84]=q,V[85]=F?.generate,V[86]=F?.generating,V[87]=M):M=V[87],V[88]!==es||V[89]!==eu||V[90]!==em||V[91]!==M?(P=(0,t.jsx)("div",{className:"pt-1",children:(0,t.jsx)("button",{onClick:es,disabled:eu,className:em,children:M})}),V[88]=es,V[89]=eu,V[90]=em,V[91]=M,V[92]=P):P=V[92],V[93]!==b||V[94]!==S||V[95]!==w||V[96]!==k||V[97]!==R||V[98]!==I||V[99]!==P?(C=(0,t.jsxs)(t.Fragment,{children:[b,S,w,k,R,I,P]}),V[93]=b,V[94]=S,V[95]=w,V[96]=k,V[97]=R,V[98]=I,V[99]=P,V[100]=C):C=V[100],C}e.s(["SceneFormImageToVideo",()=>d])},227112,e=>{"use strict";var t=e.i(88310),o=e.i(95572),r=e.i(956371),i=e.i(561444),a=e.i(95939),s=e.i(708439);function n(e){let r,i=(0,o.c)(3),{type:a}=e;if("16:9"===a||"landscape"===a){let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"2",y:"5",width:"16",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[0]=e):e=i[0],e}if("9:16"===a||"portrait"===a){let e;return i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"5",y:"2",width:"10",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[1]=e):e=i[1],e}return i[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[2]=r):r=i[2],r}function d(e){let d,f,g,h,b,v,j,y,N,_,S,w,k,R,I,M,P,C,V,A,D,q,F,T,$,B,L,U,z,O,W,E,K,G,H,Q,X,J,Y,Z,ee,et,eo,er,ei,ea,es,en,ed,el,ec,eu,em,ep,ex,ef,eg,eh=(0,o.c)(195),{capability:eb,onSubmit:ev,disabled:ej,i18n:ey,onVideoAuthRequired:eN}=e,e_=eb.supports.videoEdit,eS=e_?.referenceImages.max??3;eh[0]!==e_?.outputDurations?(d=e_?.outputDurations??[2,3,4,5,6,7,8,9,10],eh[0]=e_?.outputDurations,eh[1]=d):d=eh[1];let ew=d;eh[2]!==eb.options||eh[3]!==e_?.aspectRatios?(f=e_?.aspectRatios??eb.options.aspectRatio??["16:9"],eh[2]=eb.options,eh[3]=e_?.aspectRatios,eh[4]=f):f=eh[4];let ek=f;eh[5]!==eb.options||eh[6]!==e_?.resolutions?(g=e_?.resolutions??eb.options.resolution??["720p","1080p"],eh[5]=eb.options,eh[6]=e_?.resolutions,eh[7]=g):g=eh[7];let eR=g;eh[8]!==e_?.audioSettings?(h=e_?.audioSettings??["auto","origin"],eh[8]=e_?.audioSettings,eh[9]=h):h=eh[9];let eI=h,eM=e_?.negativePromptMaxLength??500,[eP,eC]=(0,r.useState)(""),[eV,eA]=(0,r.useState)(),[eD,eq]=(0,r.useState)(!1),[eF,eT]=(0,r.useState)(!1);eh[10]===Symbol.for("react.memo_cache_sentinel")?(b=[],eh[10]=b):b=eh[10];let[e$,eB]=(0,r.useState)(b),[eL,eU]=(0,r.useState)(!1),[ez,eO]=(0,r.useState)(""),[eW,eE]=(0,r.useState)("");eh[11]!==ew?(v=ew.includes(5)?5:ew[0],eh[11]=ew,eh[12]=v):v=eh[12];let[eK,eG]=(0,r.useState)(v),[eH,eQ]=(0,r.useState)(eI[0]||"auto"),[eX,eJ]=(0,r.useState)(eb.defaults.resolution||eR[0]),[eY,eZ]=(0,r.useState)(eb.defaults.aspectRatio||ek[0]),[e0,e1]=(0,r.useState)(!1);eh[13]!==ek[0]||eh[14]!==eb.defaults.aspectRatio||eh[15]!==eb.defaults.resolution||eh[16]!==eR[0]?(j=()=>{eJ(eb.defaults.resolution||eR[0]),eZ(eb.defaults.aspectRatio||ek[0])},eh[13]=ek[0],eh[14]=eb.defaults.aspectRatio,eh[15]=eb.defaults.resolution,eh[16]=eR[0],eh[17]=j):j=eh[17],eh[18]!==ek||eh[19]!==eb||eh[20]!==eR?(y=[eb,eR,ek],eh[18]=ek,eh[19]=eb,eh[20]=eR,eh[21]=y):y=eh[21],(0,r.useEffect)(j,y),eh[22]===Symbol.for("react.memo_cache_sentinel")?(N=e=>{let t=e.find(x);eC(t?.url||""),eA(t?.duration),eq(!!t?.verified),eT(e.some(p))},eh[22]=N):N=eh[22];let e2=N;e:{if("number"!=typeof eV){_=10;break e}_=Math.max(2,Math.min(10,Math.floor(eV)))}let e5=_;eh[23]!==e5?(S=()=>{eG(e=>Math.min(e,e5))},w=[e5],eh[23]=e5,eh[24]=S,eh[25]=w):(S=eh[24],w=eh[25]),(0,r.useEffect)(S,w);let e6="number"==typeof eV&&eV<2;eh[26]===Symbol.for("react.memo_cache_sentinel")?(k=e=>
1{eB(e.filter(m).map(u)),eU(e.some(c))},eh[26]=k):k=eh[26];let e3=k;t:{if(!eP||!eD||"number"!=typeof eV||e6){R=null;break t}R=Math.ceil((eb.credits.creditPerSecond?.[eX]??eb.credits.base)*eK)}let e4=R,e7=eF||eL;eh[27]!==eb.model?(I=(0,s.getPromptLimit)({model:eb.model,mediaType:"video",scene:"video-edit"}),eh[27]=eb.model,eh[28]=I):I=eh[28];let e8=I,e9=ez.length>e8;eh[29]!==e4||eh[30]!==e9||eh[31]!==e7||eh[32]!==eM||eh[33]!==eW||eh[34]!==ez||eh[35]!==e$||eh[36]!==eS||eh[37]!==e6||eh[38]!==eD||eh[39]!==eP?(M=!!eP&&eD&&!e6&&null!=e4&&ez.trim().length>0&&!e9&&eW.length<=eM&&e$.length<=eS&&!e7,eh[29]=e4,eh[30]=e9,eh[31]=e7,eh[32]=eM,eh[33]=eW,eh[34]=ez,eh[35]=e$,eh[36]=eS,eh[37]=e6,eh[38]=eD,eh[39]=eP,eh[40]=M):M=eh[40];let te=M;eh[41]!==eY||eh[42]!==eH||eh[43]!==te||eh[44]!==e4||eh[45]!==eW||eh[46]!==ev||eh[47]!==eK||eh[48]!==ez||eh[49]!==e$||eh[50]!==eX||eh[51]!==eP?(P=()=>{te&&null!=e4&&ev({scene:"video-edit",prompt:ez.trim(),sourceVideo:eP,editReferenceImages:e$.length?e$:void 0,editOutputDuration:eK,editAudioSetting:eH,editNegativePrompt:eW.trim()||void 0,resolution:eX,aspectRatio:eY},e4)},eh[41]=eY,eh[42]=eH,eh[43]=te,eh[44]=e4,eh[45]=eW,eh[46]=ev,eh[47]=eK,eh[48]=ez,eh[49]=e$,eh[50]=eX,eh[51]=eP,eh[52]=P):P=eh[52];let tt=P,to=ey?.source_video||"Source Video";eh[53]===Symbol.for("react.memo_cache_sentinel")?(C=(0,t.jsx)("span",{className:"text-red-500",children:"*"}),eh[53]=C):C=eh[53],eh[54]!==to?(V=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[to," ",C]}),eh[54]=to,eh[55]=V):V=eh[55];let tr=e_?.sourceVideo.maxSizeMB??100;eh[56]!==eN||eh[57]!==tr?(A=(0,t.jsx)(a.VideoUploader,{maxVideos:1,maxSizeMB:tr,onChange:e2,onBeforeSelect:eN}),eh[56]=eN,eh[57]=tr,eh[58]=A):A=eh[58];let ti=ey?.source_video_hint||"Upload the video you want to edit (mp4 / mov, up to 100MB)";eh[59]!==ti?(D=(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:ti}),eh[59]=ti,eh[60]=D):D=eh[60],eh[61]!==ey?.source_not_verified||eh[62]!==eD||eh[63]!==eP?(q=!!eP&&!eD&&(0,t.jsx)("div",{className:"text-[11px] text-red-400",children:ey?.source_not_verified||"Source video could not be verified. Please re-export as a standard mp4/mov."}),eh[61]=ey?.source_not_verified,eh[62]=eD,eh[63]=eP,eh[64]=q):q=eh[64],eh[65]!==V||eh[66]!==A||eh[67]!==D||eh[68]!==q?(F=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[V,A,D,q]}),eh[65]=V,eh[66]=A,eh[67]=D,eh[68]=q,eh[69]=F):F=eh[69];let ta=ey?.prompt||"Prompt";eh[70]===Symbol.for("react.memo_cache_sentinel")?(T=(0,t.jsx)("span",{className:"text-red-500",children:"*"}),eh[70]=T):T=eh[70],eh[71]!==ta?($=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[ta," ",T]}),eh[71]=ta,eh[72]=$):$=eh[72],eh[73]===Symbol.for("react.memo_cache_sentinel")?(B=e=>eO(e.target.value),eh[73]=B):B=eh[73];let ts=ey?.edit_prompt_placeholder||"Describe how you want to edit the video (style, object, color)...";eh[74]!==ej||eh[75]!==e8||eh[76]!==ez||eh[77]!==ts?(L=(0,t.jsx)("textarea",{value:ez,onChange:B,placeholder:ts,className:"min-h-[80px] w-full resize-none border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-border focus:outline-none",maxLength:e8,disabled:ej}),eh[74]=ej,eh[75]=e8,eh[76]=ez,eh[77]=ts,eh[78]=L):L=eh[78];let tn=`text-right text-xs ${e9?"text-red-500 font-semibold":"text-muted-foreground"}`,td=ey?.characters||"characters";eh[79]!==e8||eh[80]!==ez.length||eh[81]!==tn||eh[82]!==td?(U=(0,t.jsxs)("div",{className:tn,children:[ez.length,"/",e8," ",td]}),eh[79]=e8,eh[80]=ez.length,eh[81]=tn,eh[82]=td,eh[83]=U):U=eh[83],eh[84]!==$||eh[85]!==L||eh[86]!==U?(z=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[$,L,U]}),eh[84]=$,eh[85]=L,eh[86]=U,eh[87]=z):z=eh[87];let tl=ey?.edit_reference_images||"Reference Images",tc=ey?.optional||"Optional";eh[88]!==eS||eh[89]!==tc?(O=(0,t.jsxs)("span",{className:"text-muted-foreground text-xs font-normal",children:["(",tc,", 0â",eS,")"]}),eh[88]=eS,eh[89]=tc,eh[90]=O):O=eh[90],eh[91]!==tl||eh[92]!==O?(W=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[tl," ",O]}),eh[91]=tl,eh[92]=O,eh[93]=W):W=eh[93];let tu=e_?.referenceImages.maxSizeMB??30;eh[94]!==eS||eh[95]!==tu?(E=(0,t.jsx)(i.ImageUploader,{allowMultiple:!0,maxImages:eS,maxSizeMB:tu,variant:"reference",accept:"image/*,.heic,.heif",onChange:e3}),eh[94]=eS,eh[95]=tu,eh[96]=E):E=eh[96],eh[97]!==W||eh[98]!==E?(K=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[W,E]}),eh[97]=W,eh[98]=E,eh[99]=K):K=eh[99];let tm=ey?.output_duration||"Output Duration";eh[100]!==eK||eh[101]!==tm?(G=(0,t.jsxs)("span",{children:[tm,": ",eK,"s"]}),eh[100]=eK,eh[101]=tm,eh[102]=G):G=eh[102],eh[103]!==e5||eh[104]!==ey?.capped_by_source||eh[105]!==eV||eh[106]!==e6?(H="number"==typeof eV&&e5<10&&!e6&&(0,t.jsx)("span",{className:"text-xs font-normal text-muted-foreground",children:(ey?.capped_by_source||"max {max}s (source length)").replace("{max}",String(e5))}),eh[103]=e5,eh[104]=ey?.capped_by_source,eh[105]=eV,eh[106]=e6,eh[107]=H):H=eh[107],eh[108]!==G||eh[109]!==H?(Q=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground flex justify-between items-baseline",children:[G,H]}
1),eh[108]=G,eh[109]=H,eh[110]=Q):Q=eh[110];let tp=Math.min(eK,e5);eh[111]===Symbol.for("react.memo_cache_sentinel")?(X=e=>eG(parseInt(e.target.value,10)),eh[111]=X):X=eh[111];let tx=ej||e6;eh[112]!==e5||eh[113]!==tp||eh[114]!==tx?(J=(0,t.jsx)("input",{type:"range",min:2,max:e5,step:1,value:tp,onChange:X,disabled:tx,className:"w-full accent-foreground"}),eh[112]=e5,eh[113]=tp,eh[114]=tx,eh[115]=J):J=eh[115],eh[116]===Symbol.for("react.memo_cache_sentinel")?(Y=(0,t.jsxs)("span",{children:[2,"s"]}),eh[116]=Y):Y=eh[116],eh[117]!==e5?(Z=(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[Y,(0,t.jsxs)("span",{children:[e5,"s"]})]}),eh[117]=e5,eh[118]=Z):Z=eh[118],eh[119]!==ey?.source_too_short||eh[120]!==e6?(ee=e6&&(0,t.jsx)("div",{className:"text-[11px] text-red-400",children:(ey?.source_too_short||"Source video is too short (min {min}s)").replace("{min}",String(2))}),eh[119]=ey?.source_too_short,eh[120]=e6,eh[121]=ee):ee=eh[121],eh[122]!==Q||eh[123]!==J||eh[124]!==Z||eh[125]!==ee?(et=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[Q,J,Z,ee]}),eh[122]=Q,eh[123]=J,eh[124]=Z,eh[125]=ee,eh[126]=et):et=eh[126];let tf=ey?.audio||"Audio";if(eh[127]!==tf?(eo=(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:tf}),eh[127]=tf,eh[128]=eo):eo=eh[128],eh[129]!==eH||eh[130]!==eI||eh[131]!==ej||eh[132]!==ey?.audio_auto||eh[133]!==ey?.audio_origin){let e;eh[135]!==eH||eh[136]!==ej||eh[137]!==ey?.audio_auto||eh[138]!==ey?.audio_origin?(e=e=>(0,t.jsx)("button",{onClick:()=>eQ(e),disabled:ej,className:`flex-1 px-3 py-2 text-xs rounded border transition-all ${eH===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground
1/20"} ${ej?"cursor-not-allowed opacity-50":""}`,children:"auto"===e?ey?.audio_auto||"Auto (regenerate)":ey?.audio_origin||"Original"},e),eh[135]=eH,eh[136]=ej,eh[137]=ey?.audio_auto,eh[138]=ey?.audio_origin,eh[139]=e):e=eh[139],er=eI.map(e),eh[129]=eH,eh[130]=eI,eh[131]=ej,eh[132]=ey?.audio_auto,eh[133]=ey?.audio_origin,eh[134]=er}else er=eh[134];eh[140]!==er?(ei=(0,t.jsx)("div",{className:"flex gap-2",children:er}),eh[140]=er,eh[141]=ei):ei=eh[141],eh[142]!==eo||eh[143]!==ei?(ea=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[eo,ei]}),eh[142]=eo,eh[143]=ei,eh[144]=ea):ea=eh[144],eh[145]!==ej||eh[146]!==ey?.resolution||eh[147]!==eX||eh[148]!==eR?(es=eR.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:ey?.resolution||"Resolution"}),(0,t.jsx)("div",{className:"flex gap-2",children:eR.map(e=>(0,t.jsx)("button",{onClick:()=>eJ(e),disabled:ej,className:`px-3 py-1.5 text-xs rounded border transition-all ${eX===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground
1/20"} ${ej?"cursor-not-allowed opacity-50":""}`,children:e},e))})]}),eh[145]=ej,eh[146]=ey?.resolution,eh[147]=eX,eh[148]=eR,eh[149]=es):es=eh[149],eh[150]!==eY||eh[151]!==ek||eh[152]!==ej||eh[153]!==ey?.aspect_ratio?(en=ek.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:ey?.aspect_ratio||"Aspect Ratio"}),(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:ek.map(e=>(0,t.jsxs)("button",{onClick:()=>eZ(e),disabled:ej,className:`flex flex-col items-center gap-1 px-3 py-2 rounded-lg transition-all ${eY===e?"bg-muted border border-foreground/20 text-foreground":"bg-background/60 border border-border/50 text-muted-foreground hover:border-border"} ${ej?"cursor-not-allowed opacity-50":""}`,children:[(0,t.jsx)(n,{type:e}),(0,t.jsx)("span",{className:"text-xs font-medium",children:e})]},e))})]}),eh[150]=eY,eh[151]=ek,eh[152]=ej,eh[153]=ey?.aspect_ratio,eh[154]=en):en=eh[154],eh[155]===Symbol.for("react.memo_cache_sentinel")?(ed=()=>e1(l),eh[155]=ed):ed=eh[155];let tg=e0?"â":"+";eh[156]!==tg?(el=(0,t.jsx)("span",{children:tg}),eh[156]=tg,eh[157]=el):el=eh[157];let th=ey?.advanced||"Advanced";eh[158]!==th?(ec=(0,t.jsx)("span",{children:th}),eh[158]=th,eh[159]=ec):ec=eh[159],eh[160]!==el||eh[161]!==ec?(eu=(0,t.jsxs)("button",{type:"button",onClick:ed,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors w-fit",children:[el,ec]}),eh[160]=el,eh[161]=ec,eh[162]=eu):eu=eh[162],eh[163]!==ej||eh[164]!==ey?.negative_prompt||eh[165]!==ey?.negative_prompt_placeholder||eh[166]!==ey?.optional||eh[167]!==eM||eh[168]!==eW||eh[169]!==e0?(em=e0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1 pl-3 border-l border-border/60",children:[(0,t.jsxs)("label",{className:"text-xs font-medium text-foreground",children:[ey?.negative_prompt||"Negative Prompt"," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-normal",children:["(",ey?.optional||"Optional",")"]})]}),(0,t.jsx)("textarea",{value:eW,onChange:e=>eE(e.target.value),placeholder:ey?.negative_prompt_placeholder||"Things you do NOT want in the output...",className:"min-h-[60
1px] w-full resize-none border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-border focus:outline-none",maxLength:eM,disabled:ej}),(0,t.jsxs)("div",{className:"text-right text-xs text-muted-foreground",children:[eW.length,"/",eM]})]}),eh[163]=ej,eh[164]=ey?.negative_prompt,eh[165]=ey?.negative_prompt_placeholder,eh[166]=ey?.optional,eh[167]=eM,eh[168]=eW,eh[169]=e0,eh[170]=em):em=eh[170],eh[171]!==eu||eh[172]!==em?(ep=(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[eu,em]}),eh[171]=eu,eh[172]=em,eh[173]=ep):ep=eh[173];let tb=ej||!te,tv=`w-full rounded-lg px-6 py-2.5 sm:py-3 text-sm sm:text-base font-[550] transition-all focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:ring-offset-2 ${ej||!te?"cursor-not-allowed bg-muted text-muted-foreground":"bg-foreground text-background shadow-lg hover:bg-foreground/90 hover:shadow-xl"}`;return eh[174]!==e4||eh[175]!==ej||eh[176]!==ey?.generate||eh[177]!==ey?.generate_placeholder||eh[178]!==ey?.generating?(ex=ej?ey?.generating||"Generating...":null==e4?ey?.generate_placeholder||"Edit Video":(ey?.generate||"Edit Video ({credits} credits)").replace("{credits}",String(e4)),eh[174]=e4,eh[175]=ej,eh[176]=ey?.generate,eh[177]=ey?.generate_placeholder,eh[178]=ey?.generating,eh[179]=ex):ex=eh[179],eh[180]!==tt||eh[181]!==tb||eh[182]!==tv||eh[183]!==ex?(ef=(0,t.jsx)("div",{className:"pt-1",children:(0,t.jsx)("button",{onClick:tt,disabled:tb,className:tv,children:ex})}),eh[180]=tt,eh[181]=tb,eh[182]=tv,eh[183]=ex,eh[184]=ef):ef=eh[184],eh[185]!==F||eh[186]!==z||eh[187]!==K||eh[188]!==et||eh[189]!==ea||eh[190]!==es||eh[191]!==en||eh[192]!==ep||eh[193]!==ef?(eg=(0,t.jsxs)(t.Fragment,{children:[F,z,K,et,ea,es,en,ep,ef]}),eh[185]=F,eh[186]=z,eh[187]=K,eh[188]=et,eh[189]=ea,eh[190]=es,eh[191]=en,eh[192]=ep,eh[193]=ef,eh[194]=eg):eg=eh[194],eg}function l(e){return!e}function c(e){return"uploading"===e.status}function u(e){return e.url}function m(e){return"uploaded"===e.status&&e.url}function p(e){return"uploading"===e.status}function x(e){return"uploaded"===e.status&&e.url}e.s(["SceneFormVideoEdit",()=>d])},1631,e=>{"use strict";var t=e.i(88310),o=e.i(95572),r=e.i(956371),i=e.i(623099),a=e.i(561444),s=e.i(812162),n=e.i(266337),d=e.i(994772),l=e.i(779342),c=e.i(523889),u=e.i(526683);let m="audio/mpeg,audio/wav,audio/mp3,audio/mp4,audio/ogg,audio/x-m4a,audio/x-wav";async function p(e){return{url:(await (0,c.directUpload)("audio",e)).url}}function x({maxAudios:e=3,maxSizeMB:o=15,className:i,disabled:a,onChange:c,emptyHint:x}){let[f,g]=(0,r.useState)([]),[h,b]=(0,r.useState)(!1),v=(0,r.useRef)(null),j=(0,r.useRef)(c),y=(0,r.useRef)(!1);(0,r.useEffect)(()=>{j.current=c},[c]),(0,r.useEffect)(()=>{if(!y.current){y.current=!0;return}j.current?.(f)},[f]),(0,r.useEffect)(()=>()=>{f.forEach(e=>{e.preview?.startsWith("blob:")&&URL.revokeObjectURL(e.preview)})},[]);let N=1024*o*1024,_=(0,r.useCallback)(async t=>{if(a)return;let r=Array.from(t);if(0===r.length)return;let i=e-f.length;if(i<=0)return void l.toast.error(`Up to ${e} audios`);let s=[];for(let e of r.slice(0,i)){if(!e.type.startsWith("audio/")){l.toast.error(`${e.name}: not audio`);continue}if(e.size>N){l.toast.error(`${e.name}: exceeds ${o}MB`);continue}s.push(e)}if(0===s.length)return;let n=await Promise.all(s.map(async e=>{let t=await new Promise(t=>{let o=URL.createObjectURL(e),r=document.createElement("audio");r.preload="metadata",r.onloadedmetadata=()=>{let e=r.duration;URL.revokeObjectURL(o),t(Number.isFinite(e)?e:void 0)},r.onerror=()=>{URL.revokeObjectURL(o),t(void 0)},r.src=o});return{id:`${Date.now()}-${Math.random()}`,filename:e.name,size:e.size,mime:e.type,duration:t,status:"uploading",preview:URL.createObjectURL(e)}}));g(e=>[...e,...n]),await Promise.all(s.map(async(e,t)=>{let o=n[t];try{let{url:t}=await p(e);g(e=>e.map(e=>e.id===o.id?{...e,url:t,status:"uploaded"}:e))}catch(t){let e=/no auth|sign in/i.test(t?.message||"");l.toast.error(e?"Please sign in to upload":t?.message||"Upload failed"),g(e=>e.map(e=>e.id===o.id?{...e,status:"error"}:e))}}))},[f.length,e,N,o,a]),S=()=>v.current?.click(),w=e=>{e.target.files&&_(e.target.files),e.target.value=""},k=e=>{e.preventDefault(),b(!1),e.dataTransfer.files.length&&_(e.dataTransfer.files)},R=f.length<e;return 0===f.length?(0,t.jsxs)("div",{className:(0,u.cn)("flex flex-col gap-2",i
1),children:[(0,t.jsx)("input",{ref:v,type:"file",multiple:!0,accept:m,className:"hidden",onChange:w,disabled:a}),(0,t.jsxs)("button",{type:"button",onClick:S,onDragOver:e=>{e.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:k,disabled:a,className:(0,u.cn)("flex flex-col items-center justify-center gap-1 w-full h-[90px] rounded-lg border border-dashed transition-all",h?"border-border bg-muted":"border-border bg-muted/30 hover:border-foreground/20 hover:bg-muted/50",a&&"cursor-not-allowed opacity-50"),children:[(0,t.jsx)(s.IconUpload,{size:20,className:"text-muted-foreground"}),(0,t.jsx)("div",{className:"text-xs text-foreground",children:x||`Drag or upload audios (0/${e})`}),(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:["mp3 / wav / m4a · up to ",o,"MB"]})]})]}):(0,t.jsxs)("div",{className:(0,u.cn)("flex flex-col gap-2",i),children:[(0,t.jsx)("input",{ref:v,type:"file",multiple:!0,accept:m,className:"hidden",onChange:w,disabled:a}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[f.map((e,o)=>(0,t.jsxs)("div",{className:"relative group h-[90px] rounded-lg overflow-hidden bg-muted border border-border flex flex-col items-center justify-center",children:[(0,t.jsx)(d.Music,{size:24,className:"text-muted-foreground"}),(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground px-2 truncate max-w-full mt-1",children:e.filename}),"uploading"===e.status&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 text-white text-xs",children:"Uploadingâ¦"}),"error"===e.status&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-red-900/60 text-white text-xs",children:"Failed"}),(0,t.jsxs)("span",{className:"absolute bottom-1 left-1 px-1.5 py-0.5 text-[10px] rounded bg-black/60 text-white",children:["@Audio",o+1,"number"==typeof e.duration?` \xb7 ${e.duration.toFixed(1)}s`:""]}),(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void g(e=>{let o=e.find(e=>e.id===t);return o?.preview?.startsWith("blob:")&&URL.revokeObjectURL(o.preview),e.filter(e=>e.id!==t)})},className:"absolute top-1 right-1 w-5 h-5 rounded-full bg-black/60 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"remove",children:(0,t.jsx)(n.IconX,{size:12})})]},e.id)),R&&(0,t.jsxs)("button",{type:"button",onClick:S,onDragOver:e=>{e.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:k,disabled:a,className:(0,u.cn)("flex flex-col items-center justify-center gap-1 h-[90px] rounded-lg border border-dashed transition-all",h?"border-border bg-muted":"border-border bg-muted/30 hover:border-foreground
1/20",a&&"cursor-not-allowed opacity-50"),children:[(0,t.jsx)(s.IconUpload,{size:18,className:"text-muted-foreground"}),(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:[f.length,"/",e]})]})]})]})}var f=e.i(95939),g=e.i(930768),h=e.i(708439);function b(e){let r,i=(0,o.c)(3),{type:a}=e;if("16:9"===a||"landscape"===a){let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"2",y:"5",width:"16",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[0]=e):e=i[0],e}if("9:16"===a||"portrait"===a){let e;return i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"5",y:"2",width:"10",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[1]=e):e=i[1],e}return i[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:"shrink-0",children:(0,t.jsx)("rect",{x:"3",y:"3",width:"14",height:"14",rx:"2",stroke:"currentColor",strokeWidth:"1.5"})}),i[2]=r):r=i[2],r}function v(e){let s,n,d,l,c,u,m,p,v,V,A,D,q,F,T,$,B,L,U,z,O,W,E,K,G,H,Q,X,J,Y=(0,o.c)(137),{capability:Z,onSubmit:ee,disabled:et,i18n:eo,onVideoAuthRequired:er,requiredReferenceType:ei}=e,ea=(0,i.useLocale)(),es=ei&&"image"!==ei?void 0:Z.supports.referenceImages,en=ei&&"video"!==ei?void 0:Z.supports.referenceVideos,ed=ei&&"audio"!==ei?void 0:Z.supports.referenceAudios,el="audio"===ei,ec=el?void 0:ed,eu=es?.min??1,em=es?.max??3,[ep,ex]=(0,r.useState)("");Y[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],Y[0]=s):s=Y[0];let[ef,eg]=(0,r.useState)(s);Y[1]===Symbol.for("react.memo_cache_sentinel")?(n=[],Y[1]=n):n=Y[1];let[eh,eb]=(0,r.useState)(n);Y[2]===Symbol.for("react.memo_cache_sentinel")?(d=[],Y[2]=d):d=Y[2];let[ev,ej]=(0,r.useState)(d);Y[3]===Symbol.for("react.memo_cache_sentinel")?(l=[],Y[3]=l):l=Y[3];let[ey,eN]=(0,r.useState)(l),[e_,eS]=(0,r.useState)(!1),[ew,ek]=(0,r.useState)(!1),[eR,eI]=(0,r.useState)(!1),[eM,eP]=(0,r.useState)(!1),[eC,eV]=(0,r.useState)(Z.defaults.aspectRatio||""),[eA,eD]=(0,r.useState)(Z.defaults.duration||""),[eq,eF]=(0,r.useState)(Z.defaults.resolution||""),[eT,e$]=(0,r.useState)(Z.defaults.qualityTier||"");Y[4]!==Z.defaults.aspectRatio||Y[5]!==Z.defaults.duration||Y[6]!==Z.defaults.qualityTier||Y[7]!==Z.defaults.resolution||Y[8]!==Z.options.aspectRatio||Y[9]!==Z.options.qualityTier||Y[10]!==Z.options.resolution||Y[11]!==ed||Y[12]!==es||Y[13]!==en?(c=()=>{eV(e=>(Z.options.aspectRatio||[]).includes(e)?e:Z.defaults.aspectRatio||""),eD(Z.defaults.duration||""),eF(e=>(Z.options.resolution||[]).includes(e)?e:Z.defaults.resolution||""),e$(e=>(Z.options.qualityTier||[]).includes(e)?e:Z.defaults.qualityTier||""),es||(eg([]),eS(!1)),en||(eb([]),ej([]),ek(!1)),ed||(eN([]),eI(!1)),en||ed||eP(!1)},Y[4]=Z.defaults.aspectRatio,Y[5]=Z.defaults.duration,Y[6]=Z.defaults.qualityTier,Y[7]=Z.defaults.resolution,Y[8]=Z.options.aspectRatio,Y[9]=Z.options.qualityTier,Y[10]=Z.options.resolution,Y[11]=ed,Y[12]=es,Y[13]=en,Y[14]=c):c=Y[14],Y[15]!==Z||Y[16]!==ed||Y[17]!==es||Y[18]!==en?(u=[Z,es,en,ed],Y[15]=Z,Y[16]=ed,Y[17]=es,Y[18]=en,Y[19]=u):u=Y[19],(0,r.useEffect)(c,u);let eB=Z.options.duration&&!Array.isArray(Z.options.duration)?Z.options.duration:null;if(Y[20]!==Z||Y[21]!==eA||Y[22]!==eT||Y[23]!==ev||Y[24]!==eq){let e=ev.reduce(C,0);m=(0,g.calculateCredits)(Z,{duration:eA,resolution:eq,qualityTier:eT,referenceVideoTotalDuration:e>0?e:void 0}),Y[20]=Z,Y[21]=eA,Y[22]=eT,Y[23]=ev,Y[24]=eq,Y[25]=m}else m=Y[25];let eL=m;Y[26]===Symbol.for("react.memo_cache_sentinel")?(p=e=>{eg(e.filter(P).map(M)),eS(e.some(I))},Y[26]=p):p=Y[26];let eU=p;Y[27]===Symbol.for("react.memo_cache_sentinel")?(v=e=>{let t=e.filter(R);
1eb(t.map(k)),ej(t.map(w)),ek(e.some(S))},Y[27]=v):v=Y[27];let ez=v;Y[28]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{eN(e.filter(_).map(N)),eI(e.some(y))},Y[28]=V):V=Y[28];let eO=V,eW=ef.length>0||eh.length>0||ey.length>0,eE=!es||ef.length>=eu,eK=!el||ey.length>0,eG=e_||ew||eR;Y[29]!==Z.model?(A=(0,h.getPromptLimit)({model:Z.model,mediaType:"video",scene:"reference-to-video"}),Y[29]=Z.model,Y[30]=A):A=Y[30];let eH=A,eQ=ep.length>eH;Y[31]!==eW||Y[32]!==eK||Y[33]!==eE||Y[34]!==eQ||Y[35]!==eG||Y[36]!==ep?(D=eW&&eE&&eK&&!eG&&ep.trim().length>0&&!eQ,Y[31]=eW,Y[32]=eK,Y[33]=eE,Y[34]=eQ,Y[35]=eG,Y[36]=ep,Y[37]=D):D=Y[37];let eX=D;Y[38]!==eC||Y[39]!==eX||Y[40]!==eL||Y[41]!==eA||Y[42]!==ee||Y[43]!==ep||Y[44]!==eT||Y[45]!==ey||Y[46]!==ef||Y[47]!==ev||Y[48]!==eh||Y[49]!==eq?(q=()=>{if(!eX)return;let e=ev.reduce(j,0);ee({scene:"reference-to-video",prompt:ep.trim()||void 0,referenceImages:ef.length?ef:void 0,referenceVideos:eh.length?eh:void 0,referenceAudios:ey.length?ey:void 0,aspectRatio:eC||void 0,duration:eA||void 0,resolution:eq||void 0,qualityTier:eT||void 0,advancedOptions:{...ev.length?{referenceVideoDurations:ev,referenceVideoTotalDuration:e}:{}}},eL),ex(""),eg([]),eb([]),ej([]),eN([])},Y[38]=eC,Y[39]=eX,Y[40]=eL,Y[41]=eA,Y[42]=ee,Y[43]=ep,Y[44]=eT,Y[45]=ey,Y[46]=ef,Y[47]=ev,Y[48]=eh,Y[49]=eq,Y[50]=q):q=Y[50];let eJ=q;if(Y[51]!==et||Y[52]!==eo?.reference_images||Y[53]!==es||Y[54]!==em||Y[55]!==eu?(F=es&&!et&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[eo?.reference_images||"Reference Images"," ",(0,t.jsx)("span",{className:"text-red-500",children:"*"}),(0,t.jsx)("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:eu===em?`(${em})`:`(${eu}â${em})`})]}),(0,t.jsx)(a.ImageUploader,{allowMultiple:em>1,maxImages:em,maxSizeMB:10,variant:"reference",onChange:eU})]}),Y[51]=et,Y[52]=eo?.reference_images,Y[53]=es,Y[54]=em,Y[55]=eu,Y[56]=F):F=Y[56],Y[57]!==et||Y[58]!==eo?.reference_audios||Y[59]!==el||Y[60]!==ed?(T=el&&ed&&!et&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[eo?.reference_audios||"Audio File"," ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)(x,{maxAudios:1,maxSizeMB:15,onChange:eO})]}),Y[57]=et,Y[58]=eo?.reference_audios,Y[59]=el,Y[60]=ed,Y[61]=T):T=Y[61],Y[62]!==ec||Y[63]!==et||Y[64]!==eo?.add_video_audio_reference||Y[65]!==eo?.optional||Y[66]!==eo?.reference_audios||Y[67]!==eo?.reference_videos||Y[68]!==er||Y[69]!==en||Y[70]!==ey||Y[71]!==eh||Y[72]!==eM){let e,o,r;$=(en||ec)&&!et&&(e=eh.length>0||ey.length>0,o=eM||e,r=eh.length+ey.length,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>eP(!o),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors w-fit",children:[(0,t.jsx)("span",{children:o?"â":"+"}),(0,t.jsx)("span",{children:eo?.add_video_audio_reference||"Add reference videos / audios"}),r>0&&(0,t.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] rounded bg-muted text-foreground",children:r})]}),o&&(0,t.jsxs)("div",{className:"flex flex-col gap-3 pl-3 border-l border-border/60",children:[en&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-xs font-medium text-foreground",children:[eo?.reference_videos||"Reference Videos"," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-normal",children:["(",eo?.optional||"Optional",")"]})]}),(0,t.jsx)(f.VideoUploader,{maxVideos:en.max,maxSizeMB:50,onChange:ez,onBeforeSelect:er})]}),ec&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-xs font-medium text-foreground",children:[eo?.reference_audios||"Reference Audios"," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-normal",children:["(",eo?.optional||"Optional",")"]})]}),(0,t.jsx)(x,{maxAudios:ec.max,maxSizeMB:15,onChange:eO})]})]})]})),Y[62]=ec,Y[63]=et,Y[64]=eo?.add_video_audio_reference,Y[65]=eo?.optional,Y[66]=eo?.reference_audios,Y[67]=eo?.reference_videos,Y[68]=er,Y[69]=en,Y[70]=ey,Y[71]=eh,Y[72]=eM,Y[73]=$}else $=Y[73];let eY=eo?.prompt||"Prompt";Y[74]===Symbol.for("react.memo_cache_sentinel")?(B=(0,t.jsx)("span",{className:"text-red-500",children:"*"}),Y[74]=B):B=Y[74],Y[75]!==eY?(L=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[eY," ",B]}),Y[75]=eY,Y[76]=L):L=Y[76],Y[77]===Symbol.for("react.memo_cache_sentinel")?(U=e=>ex(e.target.value),Y[77]=U):U=Y[77];let eZ=eo?.reference_prompt_placeholder||"Describe the scene you want to generate using the reference images...";Y[78]!==et||Y[79]!==eH||Y[80]!==ep||Y[81]!==eZ?(z=(0,t.jsx)("textarea",{value:ep,onChange:U,placeholder:eZ,className:"min-h-[80px] sm:min-h-[100px] w-full resize-none border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-border focus:outline-none",maxLength:eH,disabled:et}),Y[78]=et,Y[79]=eH,Y[80]=ep,Y[81]=eZ,Y[82]=z):z=Y[82];let e0=`text-right text-xs ${eQ?"text-red-500 font-semibold":"text-muted-foreground"}`,e1=eo?.characters||"characters";if(Y[83]!==eH||Y[84]!==ep.length||Y[85]!==e0||Y[86]!==e1?(O=(0,t.jsxs)("div",{className:e0,children:[ep.length,"/",eH," ",e1]}),Y[83]=eH,Y[84]=ep.length,Y[85]=e0,Y[86]=e1,Y[87]=O):O=Y[87],Y[88]!==L||Y[89]!==z||Y[90]!==O?(W=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[L,z,O]}),Y[88]=L,Y[89]=z,Y[90]=O,Y[91]=W):W=Y[91],Y[92]!==Z.defaults.fixedDuration||Y[93]!==Z.options.duration||Y[94]!==et||Y[95]!==eA||Y[96]!==eB||Y[97]!==eo?.video_length?(E=eB?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[eo?.video_length||"Duration",": ",eA,"s"]}
1),(0,t.jsx)("input",{type:"range",min:eB.min,max:eB.max,step:eB.step,value:parseInt(eA)||eB.default,onChange:e=>eD(e.target.value),disabled:et,className:"w-full accent-foreground"}),(0,t.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[eB.min,"s"]}),(0,t.jsxs)("span",{children:[eB.max,"s"]})]})]}):Array.isArray(Z.options.duration)&&Z.options.duration.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:eo?.video_length||"Duration"}),(0,t.jsx)("div",{className:"flex gap-2",children:Z.options.duration.map(e=>(0,t.jsxs)("button",{onClick:()=>eD(e),disabled:et,className:`px-3 py-1.5 text-xs rounded border transition-all ${eA===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground/20"} ${et?"cursor-not-allowed opacity-50":""}`,children:[e,"s"]},e))})]}):Z.defaults.fixedDuration?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:eo?.video_length||"Duration"}),(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)("span",{className:"px-3 py-1.5 text-xs rounded border border-border bg-background/60 text-muted-foreground cursor-default",children:Z.defaults.fixedDuration})})]}):null,Y[92]=Z.defaults.fixedDuration,Y[93]=Z.options.duration,Y[94]=et,Y[95]=eA,Y[96]=eB,Y[97]=eo?.video_length,Y[98]=E):E=Y[98],Y[99]!==Z.model||Y[100]!==Z.options.qualityTier||Y[101]!==et||Y[102]!==eo?.quality||Y[103]!==eo?.quality_help||Y[104]!==ea||Y[105]!==eT?(K=Z.options.qualityTier&&Z.options.qualityTier.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground flex items-center gap-1.5",children:[eo?.quality||"Quality","veo3"===Z.model&&(0,t.jsx)("a",{href:`/${ea}/blog/veo-3-1-vs-fast-vs-light`,target:"_blank",rel:"noopener noreferrer",title:eo?.quality_help||"Learn more about quality tiers",className:"inline-flex items-center justify-center w-4 h-4 rounded-full border border-border text-muted-foreground text-[10px] leading-none hover:border-foreground
1/30 hover:text-foreground transition-colors",children:"?"})]}),(0,t.jsx)("div",{className:"flex gap-2",children:Z.options.qualityTier.map(e=>(0,t.jsx)("button",{onClick:()=>e$(e),disabled:et,className:`px-3 py-1.5 text-xs rounded border transition-all capitalize ${eT===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground/20"} ${et?"cursor-not-allowed opacity-50":""}`,children:"std"===e?"Std (720p)":"pro"===e?"Pro (1080p)":"lite"===e?"Lite (720p)":"fast"===e?"Fast (1080p)":"quality"===e?"Quality (1080p)":e},e))})]}),Y[99]=Z.model,Y[100]=Z.options.qualityTier,Y[101]=et,Y[102]=eo?.quality,Y[103]=eo?.quality_help,Y[104]=ea,Y[105]=eT,Y[106]=K):K=Y[106],Y[107]!==Z.options.resolution||Y[108]!==et||Y[109]!==eo?.resolution||Y[110]!==eq?(G=Z.options.resolution&&Z.options.resolution.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:eo?.resolution||"Resolution"}),(0,t.jsx)("div",{className:"flex gap-2",children:Z.options.resolution.map(e=>(0,t.jsx)("button",{onClick:()=>eF(e),disabled:et,className:`px-3 py-1.5 text-xs rounded border transition-all ${eq===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground
1/20"} ${et?"cursor-not-allowed opacity-50":""}`,children:e},e))})]}),Y[107]=Z.options.resolution,Y[108]=et,Y[109]=eo?.resolution,Y[110]=eq,Y[111]=G):G=Y[111],Y[112]!==eC||Y[113]!==Z.options.aspectRatio||Y[114]!==et||Y[115]!==eo?.aspect_ratio){let e;H=Z.options.aspectRatio&&Z.options.aspectRatio.length>0&&(e=Z.options.aspectRatio.length>5,(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:eo?.aspect_ratio||"Aspect Ratio"}),(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:Z.options.aspectRatio.map(o=>(0,t.jsxs)("button",{onClick:()=>eV(o),disabled:et,className:`flex ${e?"flex-col items-center gap-1 px-2 py-2":"items-center gap-2 px-3 py-2"} rounded-lg transition-all ${eC===o?"bg-muted border border-foreground/20 text-foreground":"bg-background/60 border border-border/50 text-muted-foreground hover:border-border"} ${et?"cursor-not-allowed opacity-50":""}`,children:[(0,t.jsx)(b,{type:o}),(0,t.jsx)("span",{className:"text-xs font-medium",children:o})]},o))})]})),Y[112]=eC,Y[113]=Z.options.aspectRatio,Y[114]=et,Y[115]=eo?.aspect_ratio,Y[116]=H}else H=Y[116];let e2=et||!eX,e5=`w-full rounded-lg px-6 py-2.5 sm:py-3 text-sm sm:text-base font-[550] transition-all focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:ring-offset-2 ${et||!eX?"cursor-not-allowed bg-muted text-muted-foreground":"bg-foreground text-background shadow-lg hover:bg-foreground
1/90 hover:shadow-xl"}`;return Y[117]!==eL||Y[118]!==et||Y[119]!==eo?.generate||Y[120]!==eo?.generating?(Q=et?eo?.generating||"Generating...":(eo?.generate||"Generate Video ({credits} credits)").replace("{credits}",String(eL)),Y[117]=eL,Y[118]=et,Y[119]=eo?.generate,Y[120]=eo?.generating,Y[121]=Q):Q=Y[121],Y[122]!==eJ||Y[123]!==e2||Y[124]!==e5||Y[125]!==Q?(X=(0,t.jsx)("div",{className:"pt-1",children:(0,t.jsx)("button",{onClick:eJ,disabled:e2,className:e5,children:Q})}),Y[122]=eJ,Y[123]=e2,Y[124]=e5,Y[125]=Q,Y[126]=X):X=Y[126],Y[127]!==F||Y[128]!==T||Y[129]!==$||Y[130]!==W||Y[131]!==E||Y[132]!==K||Y[133]!==G||Y[134]!==H||Y[135]!==X?(J=(0,t.jsxs)(t.Fragment,{children:[F,T,$,W,E,K,G,H,X]}),Y[127]=F,Y[128]=T,Y[129]=$,Y[130]=W,Y[131]=E,Y[132]=K,Y[133]=G,Y[134]=H,Y[135]=X,Y[136]=J):J=Y[136],J}function j(e,t){return e+(Number.isFinite(t)?t:0)}function y(e){return"uploading"===e.status}function N(e){return e.url}function _(e){return"uploaded"===e.status&&e.url}function S(e){return"uploading"===e.status}function w(e){return e.duration??0}function k(e){return e.url}function R(e){return"uploaded"===e.status&&e.url&&e.verified}function I(e){return"uploading"===e.status}function M(e){return e.url}function P(e){return"uploaded"===e.status&&e.url}function C(e,t){return e+(Number.isFinite(t)?t:0)}e.s(["SceneFormReferenceToVideo",()=>v],1631)},930768,e=>{"use strict";let t=[{model:"bytedance/seedance-2-fast",provider:"kie",label:"Seedance 2 Fast",description:"Faster generation with multimodal reference support",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-bytedance.webp",tags:["With Audio","Multi-Image"],scenes:["text-to-video","image-to-video","reference-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1,referenceImages:{min:0,max:9},referenceVideos:{max:3,minPerVideoSec:2,maxPerVideoSec:15,maxDurationSec:15},referenceAudios:{max:3,maxDurationSec:15}},options:{duration:{min:4,max:15,step:1,default:5},aspectRatio:["16:9","4:3","1:1","3:4","9:16","21:9"],resolution:["480p","720p"]},defaults:{duration:"5",aspectRatio:"16:9",resolution:"480p"},promptMaxLength:2e4,credits:{base:40,creditMode:"per-second",creditPerSecond:{"480p":8,"720p":16},withVideoCreditPerSecond:{"480p":5,"720p":10}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"bytedance/seedance-2-mini",provider:"kie",label:"Seedance 2 Mini",description:"Cheapest Seedance 2 tier for high-volume generation",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-bytedance.webp",tags:["With Audio","Multi-Image"],scenes:["text-to-video","image-to-video","reference-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1,referenceImages:{min:0,max:9},referenceVideos:{max:3,minPerVideoSec:2,maxPerVideoSec:15,maxDurationSec:15},referenceAudios:{max:3,maxDurationSec:15}},options:{duration:{min:4,max:15,step:1,default:5},aspectRatio:["16:9","4:3","1:1","3:4","9:16","21:9"],resolution:["480p","720p"]},defaults:{duration:"5",aspectRatio:"16:9",resolution:"480p"},promptMaxLength:2e4,credits:{base:20,creditMode:"per-second",creditPerSecond:{"480p":4,"720p":8},withVideoCreditPerSecond:{"480p":3,"720p":5}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"bytedance/seedance-2",provider:"kie",label:"Seedance 2",description:"Multimodal input with powerful reference capabilities",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-bytedance.webp",tags:["With Audio","Multi-Image"],scenes:["text-to-video","image-to-video","reference-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1,referenceImages:{min:0,max:9},referenceVideos:{max:3,minPerVideoSec:2,maxPerVideoSec:15,maxDurationSec:15},referenceAudios:{max:3,maxDurationSec:15}},options:{duration:{min:4,max:15,step:1,default:5},aspectRatio:["16:9","4:3","1:1","3:4","9:16","21:9"],resolution:["480p","720p"]},defaults:{duration:"5",aspectRatio:"16:9",resolution:"480p"},promptMaxLength:2e4,credits:{base:50,creditMode:"per-second",creditPerSecond:{"480p":10,"720p":20},withVideoCreditPerSecond:{"480p":6,"720p":12}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"bytedance/seedance-2-5",provider:"kie",label:"Seedance 2.5",description:"Flagship Seedance with up to 30s duration and 1080p output",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-bytedance.webp",tags:["With Audio","Multi-Image"],scenes:["text-to-vi
1deo","image-to-video","reference-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1,referenceImages:{min:0,max:30},referenceVideos:{max:10,minPerVideoSec:2,maxPerVideoSec:30,maxDurationSec:30},referenceAudios:{max:10,maxDurationSec:30}},options:{duration:{min:4,max:30,step:1,default:5},aspectRatio:["16:9","4:3","1:1","3:4","9:16","21:9"],resolution:["480p","720p","1080p"]},defaults:{duration:"5",aspectRatio:"16:9",resolution:"480p"},promptMaxLength:3e4,credits:{base:75,creditMode:"per-second",creditPerSecond:{"480p":15,"720p":30,"1080p":75},withVideoCreditPerSecond:{"480p":10,"720p":20,"1080p":45}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"minimax-h3/text-to-video",provider:"kie",label:"MiniMax H3",description:"Hailuo 03: 2K multimodal video with native stereo audio",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-minimax.webp",tags:["With Audio","2K"],scenes:["text-to-video"],supports:{prompt:!0,maxImages:0,endFrame:!1,video:!1,audio:!1},options:{duration:{min:4,max:15,step:1,default:6},aspectRatio:["16:9","4:3","1:1","3:4","9:16","21:9"],resolution:["768P","2K"]},defaults:{duration:"6",aspectRatio:"16:9",resolution:"768P"},promptMaxLength:7e3,credits:{base:48,creditMode:"per-second",creditPerSecond:{"768P":8,"2K":12}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"minimax-h3/image-to-video",provider:"kie",label:"MiniMax H3",description:"Hailuo 03: 2K multimodal video with native stereo audio",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-minimax.webp",tags:["With Audio","2K"],scenes:["image-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1},options:{duration:{min:4,max:15,step:1,default:6},resolution:["768P","2K"]},defaults:{duration:"6",resolution:"768P"},promptMaxLength:7e3,credits:{base:48,creditMode:"per-second",creditPerSecond:{"768P":8,"2K":12}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"minimax-h3/reference-to-video",provider:"kie",label:"MiniMax H3",description:"Hailuo 03: 2K multimodal video with native stereo audio",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-minimax.webp",tags:["With Audio","2K"],scenes:["reference-to-video"],supports:{prompt:!0,maxImages:0,endFrame:!1,video:!1,audio:!1,referenceImages:{min:0,max:5},referenceVideos:{max:3,minPerVideoSec:2,maxPerVideoSec:15,maxDurationSec:15},referenceAudios:{max:3,maxDurationSec:15}},options:{duration:{min:4,max:15,step:1,default:6},aspectRatio:["16:9","4:3","1:1","3:4","9:16","21:9"],resolution:["768P","2K"]},defaults:{duration:"6",aspectRatio:"16:9",resolution:"768P"},promptMaxLength:7e3,credits:{base:48,creditMode:"per-second",creditPerSecond:{"768P":8,"2K":12},withVideoCreditPerSecond:{"768P":8,"2K":12}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"veo3_lite",provider:"kie",label:"Veo 3.1 Lite",icon:"https://www.google.com/favicon.ico",description:"Fastest & cheapest â ideal for drafts and quick iteration",tags:[],scenes:["text-to-video","image-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1},options:{aspectRatio:["16:9","9:16"],resolution:["720p","1080p","4k"]},defaults:{aspectRatio:"16:9",resolution:"720p",fixedDuration:"8s"},credits:{base:15,creditMap:{"720p":15,"1080p":20,"4k":75}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"veo3_fast",provider:"kie",label:"Veo 3.1 Fast",icon:"https://www.google.com/favicon.ico",description:"Best balance of speed, quality & cost â recommended for most use cases",tags:[],scenes:["text-to-video","image-to-video","reference-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1,referenceImages:{min:1,max:3}},options:{aspectRatio:["16:9","9:16"],resolution:["720p","1080p","4k"]},defaults:{aspectRatio:"16:9",resolution:"720p",fixedDuration:"8s"},credits:{base:30,creditMap:{"720p":30,"1080p":40,"4k":90}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"veo3",provider:"kie",label:"Veo 3.1 Quality",icon:"https://www.google.com/favicon.ico",description:"Maximum visual fidelity â for cinematic content and client deliverables",tags:[],scenes:["text-to-vi
1deo","image-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1},options:{aspectRatio:["16:9","9:16"],resolution:["720p","1080p","4k"]},defaults:{aspectRatio:"16:9",resolution:"720p",fixedDuration:"8s"},credits:{base:225,creditMap:{"720p":225,"1080p":230,"4k":285}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"google/gemini-omni-flash-1-1",provider:"kie",label:"Gemini Omni 1.1 Flash",description:"Google's multimodal video model with frame control and 4K output",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-google.png",tags:["Multi-Image"],scenes:["text-to-video","image-to-video","reference-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1,referenceImages:{min:1,max:7}},options:{duration:["4","6","8","10"],aspectRatio:["16:9","9:16"],resolution:["360p","720p","1080p","4k"]},defaults:{duration:"4",aspectRatio:"16:9",resolution:"720p"},promptMaxLength:2e4,credits:{base:45,creditMap:{"4:360p":45,"6:360p":60,"8:360p":75,"10:360p":90,"4:720p":45,"6:720p":60,"8:720p":75,"10:720p":90,"4:1080p":45,"6:1080p":60,"8:1080p":75,"10:1080p":90,"4:4k":105,"6:4k":120,"8:4k":135,"10:4k":150}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"grok-imagine-video-1-5-preview",provider:"kie",label:"Grok Video 1.5",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-xai.webp",description:"xAI's top-ranked image-to-video model with native audio",tags:["With Audio"],scenes:["text-to-video","image-to-video"],supports:{prompt:!0,maxImages:1,endFrame:!1,video:!1,audio:!1},options:{duration:{min:1,max:15,step:1,default:8},aspectRatio:["16:9","9:16","1:1","2:3","3:2"],resolution:["480p","720p","1080p"]},defaults:{duration:"8",aspectRatio:"16:9",resolution:"480p"},sceneOverrides:{"image-to-video":{options:{aspectRatio:[]}}},promptMaxLength:4096,credits:{base:24,creditMode:"per-second",creditPerSecond:{"480p":3,"720p":5,"1080p":8}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"grok-imagine/text-to-video",provider:"kie",label:"Grok Imagine",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-xai.webp",description:"xAI's multimodal model with 10s 720p video and native audio",tags:["With Audio"],scenes:["text-to-video"],supports:{prompt:!0,maxImages:0,endFrame:!1,video:!1,audio:!1},options:{duration:{min:6,max:30,step:1,default:6},aspectRatio:["16:9","9:16","1:1","2:3","3:2"],resolution:["480p","720p"]},defaults:{duration:"6",aspectRatio:"16:9",resolution:"480p"},promptMaxLength:5e3,credits:{base:10,creditMode:"per-second",creditPerSecond:{"480p":1.6,"720p":3}},visibleInBasic:!1,visibleInAdvanced:!1},{model:"grok-imagine/image-to-video",provider:"kie",label:"Grok Imagine",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-xai.webp",description:"xAI's multimodal model with 10s 720p video and native audio",tags:["With Audio"],scenes:["image-to-video"],supports:{prompt:!0,maxImages:1,endFrame:!1,video:!1,audio:!1},options:{duration:{min:6,max:30,step:1,default:6},aspectRatio:["16:9","9:16","1:1","2:3","3:2"],resolution:["480p","720p"]},defaults:{duration:"6",aspectRatio:"16:9",resolution:"480p"},promptMaxLength:5e3,credits:{base:10,creditMode:"per-second",creditPerSecond:{"480p":1.6,"720p":3}},visibleInBasic:!1,visibleInAdvanced:!1},{model:"kling-3.0/video",provider:"kie",label:"Kling 3.0",description:"Multi-shot cinematic storytelling with up to 15s and audio",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-kling.png",tags:["With Audio","Multi-Image"],scenes:["text-to-video","image-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1},options:{duration:{min:3,max:15,step:1,default:5},aspectRatio:["16:9","9:16","1:1"],qualityTier:["std","pro"]},defaults:{duration:"5",aspectRatio:"16:9",qualityTier:"std"},credits:{base:35,creditMode:"per-second",creditPerSecond:{std:7,pro:10}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"kling-3.0/motion-control",provider:"kie",label:"Kling 3.0 Motion Control",description:"Animate a portrait image with a motion reference video",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-kling.png",tags:["Character","Motion"],scenes:["motion-control"],supports:{prompt:!0,maxImages:0,endFrame:!1,video:!1,audio:!1,motionControl:{referenceImage:{required:!0,maxSizeMB:10,minShortEdgePx:340,aspectRange:[.4,2.5]},sourceVideo:{required:!0,maxSizeMB:100,minDurationSec:3,maxDurationSec:30,minShortEdgePx:340,aspectRange:[.4,2.5]},orientations:["video","image"],backgrounds:["input_video","input_image"]}},options:{qualityTier:["std","pro"]},defaults:{qualityTier:"std"},promptMaxLength:2500,credits:{base:80,creditMode:"per-second",creditPerSecond:{std:20,pro:27}},visibleInBasic:!0,visibleInAdvanced:!0}
1,{model:"kling-3.0-omni/text-to-video",provider:"kie",label:"Kling O3",description:"Kling 3.0 Omni: native audio, consistent characters, up to 15s",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-kling.png",tags:["With Audio","Multi-Image"],scenes:["text-to-video"],supports:{prompt:!0,maxImages:0,endFrame:!1,video:!1,audio:!1},options:{duration:{min:3,max:15,step:1,default:5},aspectRatio:["16:9","9:16","1:1"],resolution:["720p","1080p"]},defaults:{duration:"5",aspectRatio:"16:9",resolution:"720p"},promptMaxLength:3072,credits:{base:45,creditMode:"per-second",creditPerSecond:{"720p":9,"1080p":11}},visibleInBasic:!1,visibleInAdvanced:!1},{model:"kling-3.0-omni/image-to-video",provider:"kie",label:"Kling O3",description:"Kling 3.0 Omni: native audio, consistent characters, up to 15s",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-kling.png",tags:["With Audio","Multi-Image"],scenes:["image-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1},options:{duration:{min:3,max:15,step:1,default:5},resolution:["720p","1080p"]},defaults:{duration:"5",resolution:"720p"},promptMaxLength:3072,credits:{base:45,creditMode:"per-second",creditPerSecond:{"720p":9,"1080p":11}},visibleInBasic:!1,visibleInAdvanced:!1},{model:"kling-3.0-omni/reference-to-video",provider:"kie",label:"Kling O3",description:"Kling 3.0 Omni: native audio, consistent characters, up to 15s",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-kling.png",tags:["With Audio","Multi-Image"],scenes:["reference-to-video"],supports:{prompt:!0,maxImages:0,endFrame:!1,video:!1,audio:!1,referenceImages:{min:1,max:7}},options:{duration:{min:3,max:15,step:1,default:5},aspectRatio:["16:9","9:16","1:1"],resolution:["720p","1080p"]},defaults:{duration:"5",aspectRatio:"16:9",resolution:"720p"},promptMaxLength:3072,credits:{base:45,creditMode:"per-second",creditPerSecond:{"720p":9,"1080p":11}},visibleInBasic:!1,visibleInAdvanced:!1},{model:"wan/2-7-videoedit",provider:"kie",label:"Wan 2.7 Video Edit",description:"Edit existing videos with prompt-driven AI: style transfer, object replacement, color grade",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-wan.png",tags:["Video Edit"],scenes:["video-edit"],supports:{prompt:!0,maxImages:0,endFrame:!1,video:!1,audio:!1,videoEdit:{sourceVideo:{required:!0,maxSizeMB:100},referenceImages:{max:3,maxSizeMB:30,allowedExtensions:["jpg","jpeg","png","webp"]},outputDurations:[2,3,4,5,6,7,8,9,10],aspectRatios:["16:9","9:16","1:1","4:3","3:4"],resolutions:["720p","1080p"],audioSettings:["auto","origin"],negativePromptMaxLength:500}},options:{resolution:["720p","1080p"],aspectRatio:["16:9","9:16","1:1","4:3","3:4"]},defaults:{resolution:"720p",aspectRatio:"16:9"},promptMaxLength:5e3,credits:{base:70,creditMode:"per-second",creditPerSecond:{"720p":16,"1080p":24}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"topaz/video-upscale",provider:"kie",label:"Topaz Video Upscale",description:"Upscale video resolution 2Ã or 4Ã with AI",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-topaz.png",tags:["Video Enhance"],scenes:["video-upscale"],supports:{prompt:!1,maxImages:0,endFrame:!1,video:!1,audio:!1,videoUpscale:{sourceVideo:{required:!0,maxSizeMB:10},factors:["2","4"],defaultFactor:"2"}},options:{},defaults:{},credits:{base:8,creditMode:"per-second",creditPerSecond:{2:8,4:14}},visibleInBasic:!0,visibleInAdvanced:!0},{model:"wan/3-0-video",provider:"kie",label:"Wan 3.0",description:"Alibaba's all-in-one video model: 30s storytelling with any-input references",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-wan.png",tags:["With Audio","Multi-Image"],scenes:["text-to-video","image-to-video","reference-to-video"],supports:{prompt:!0,maxImages:2,endFrame:!0,video:!1,audio:!1,referenceImages:{min:0,max:10},referenceVideos:{max:5,minPerVideoSec:1,maxPerVideoSec:15,maxDurationSec:15,maxCombinedDurationSec:30},referenceAudios:{max:5,maxDurationSec:15}},options:{duration:{min:2,max:30,step:1,default:5},aspectRatio:["16:9","4:3","1:1","3:4","9:16"],resolution:["480P","720P","1080P"]},defaults:{duration:"5",aspectRatio:"16:9",resolution:"480P"},promptMaxLength:2e4,credits:{base:40,creditMode:"per-second",creditPerSecond:{"480P":8,"720P":16,"1080P":32},withVideoCreditPerSecond:{"480P":8,"720P":16,"1080P":32}},visibleInBasic:!1,visibleInAdvanced:!1}
1,{model:"wan/2-6-text-to-video",provider:"kie",label:"Wan 2.6",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-wan.png",description:"Alibaba open-source model with up to 15s 1080p video",tags:[],scenes:["text-to-video"],supports:{prompt:!0,maxImages:0,endFrame:!1,video:!1,audio:!1},options:{duration:["5","10","15"],resolution:["720p","1080p"]},defaults:{duration:"5",resolution:"1080p"},credits:{base:70,creditMap:{"5:720p":70,"10:720p":140,"15:720p":210,"5:1080p":105,"10:1080p":210,"15:1080p":315}},visibleInBasic:!1,visibleInAdvanced:!0},{model:"wan/2-6-image-to-video",provider:"kie",label:"Wan 2.6",icon:"https://pub-12d6b0ff47b646409f269c815f786611.r2.dev/apps/public/logo-wan.png",description:"Alibaba open-source model with up to 15s 1080p video",tags:[],scenes:["image-to-video"],supports:{prompt:!0,maxImages:1,endFrame:!1,video:!1,audio:!1},options:{duration:["5","10","15"],resolution:["720p","1080p"]},defaults:{duration:"5",resolution:"1080p"},credits:{base:70,creditMap:{"5:720p":70,"10:720p":140,"15:720p":210,"5:1080p":105,"10:1080p":210,"15:1080p":315}},visibleInBasic:!1,visibleInAdvanced:!0}];function o(e){return t.filter(t=>t.scenes.includes(e))}function r(e){return t.find(t=>t.model===e)}function i(e){return t.find(t=>t.scenes.includes(e)&&t.visibleInBasic)}function a(e,t){let o=r(e);if(!o)return;let i=o.sceneOverrides?.[t];return i?{...o,options:{...o.options,...i.options||{}},defaults:{...o.defaults,...i.defaults||{}},supports:{...o.supports,...i.supports||{}},promptMaxLength:i.promptMaxLength??o.promptMaxLength}:o}function s(e,t){if(!t)return e.credits.base;if("per-second"===e.credits.creditMode&&e.credits.creditPerSecond){let o="number"==typeof t.referenceVideoTotalDuration&&t.referenceVideoTotalDuration>0,r=o&&e.credits.withVideoCreditPerSecond||e.credits.creditPerSecond;return Math.ceil((r[t.resolution||""]??r[t.qualityTier||""]??r[e.defaults.resolution||""]??r[e.defaults.qualityTier||""]??Object.values(r)[0]??0)*(parseInt(t.duration||e.defaults.duration||"8",10)+(o?Math.max(0,t.referenceVideoTotalDuration):0)))}let o=e.credits.creditMap;if(!o)return e.credits.base;let{duration:r,resolution:i,qualityTier:a}=t,s=[];for(let e of(r&&i&&s.push(`${r}:${i}`),r&&a&&s.push(`${r}:${a}`),i&&s.push(i),a&&s.push(a),s))if(void 0!==o[e])return o[e];return e.credits.base}e.s(["calculateCredits",()=>s,"getDefaultModelForScene",()=>i,"getEffectiveModelDefinition",()=>a,"getModelDefinition",()=>r,"getModelsForScene",()=>o])},708439,e=>{"use strict";var t=e.i(930768);let o={"google/nano-banana":5e3,"google/nano-banana-edit":5e3,"nano-banana":5e3,"gemini-nano-banana":5e3,"nano-banana-2":2e4,"nano-banana-2-lite":2e4,"nano-banana-pro":1e4,"gemini-nano-banana-pro":1e4,"gpt-image-2-text-to-image":2e4,"gpt-image-2-image-to-image":2e4,"gpt-image-2-5-flare-text-to-image":2e4,"gpt-image-2-5-flare-image-to-image":2e4,"gpt-image-2-5-sunburst-text-to-image":2e4,"gpt-image-2-5-sunburst-image-to-image":2e4,"grok-imagine-image-2-0/text-to-image":2e4,"grok-imagine-image-2-0/image-edit":2e4,"z-image":1e4,"seedream/5-lite-image-to-image":3e3},r={"seedream/5-lite-image-to-image":3};function i(e){return"gpt-image-2"===e?"gpt-image-2-text-to-image":"gpt-image-2-5"===e?"gpt-image-2-5-flare-text-to-image":"gpt-image-2-5-sunburst"===e?"gpt-image-2-5-sunburst-text-to-image":"grok-imagine-image-2"===e?"grok-imagine-image-2-0/text-to-image":e}function a({mediaType:e,model:r,scene:a}){let s=i(r);if("video"===e){let e=(0,t.getEffectiveModelDefinition)(s,a)||(0,t.getModelDefinition)(s);return e?.promptMaxLength??1e4}return"image"===e?o[s]??1e4:1e4}function s({mediaType:e,model:t}){let o=i(t);return"image"===e?r[o]??1:0}e.s(["getPromptLimit",()=>a,"getPromptMinLength",()=>s])},95939,e=>{"use strict";var t=e.i(88310),o=e.i(956371),r=e.i(812162),i=e.i(266337),a=e.i(779342),s=e.i(523889),n=e.i(526683);let d="video/mp4,video/quicktime";async function l(e){let t=await (0,s.directUpload)("video",e);return{url:t.url,durationSec:t.durationSec,verified:t.verified,unverifiedReason:t.unverifiedReason}}function c({maxVideos:e=3,maxSizeMB:s=50,className:c,disabled:u,onChange:m,emptyHint:p,onBeforeSelect:x}){let[f,g]=(0,o.useState)([]),[h,b]=(0,o.useState)(!1),v=(0,o.useRef)(null),j=(0,o.useRef)(m),y=(0,o.useRef)(!1);(0,o.useEffect)(()=>{j.current=m},[m]),(0,o.useEffect)(()=>
1{if(!y.current){y.current=!0;return}j.current?.(f)},[f]),(0,o.useEffect)(()=>()=>{f.forEach(e=>{e.preview?.startsWith("blob:")&&URL.revokeObjectURL(e.preview)})},[]);let N=1024*s*1024,_=(0,o.useCallback)(async t=>{if(u)return;let o=Array.from(t);if(0===o.length)return;let r=e-f.length;if(r<=0)return void a.toast.error(`Up to ${e} videos`);let i=[];for(let e of o.slice(0,r)){if(!e.type.startsWith("video/")){a.toast.error(`${e.name}: not a video`);continue}if(e.size>N){a.toast.error(`${e.name}: exceeds ${s}MB`);continue}i.push(e)}if(0===i.length)return;let n=await Promise.all(i.map(async e=>{let t=await new Promise(t=>{let o=URL.createObjectURL(e),r=document.createElement("video");r.preload="metadata",r.onloadedmetadata=()=>{let e=r.duration;URL.revokeObjectURL(o),t(Number.isFinite(e)?e:void 0)},r.onerror=()=>{URL.revokeObjectURL(o),t(void 0)},r.src=o});return{id:`${Date.now()}-${Math.random()}`,filename:e.name,size:e.size,mime:e.type,duration:t,status:"uploading",preview:URL.createObjectURL(e)}}));g(e=>[...e,...n]),await Promise.all(i.map(async(e,t)=>{let o=n[t];try{let{url:t,durationSec:r,verified:i,unverifiedReason:s}=await l(e);i||(a.toast.warning("Video duration could not be verified server-side; using client estimate. Some strict features (e.g. R2V reference videos) may reject this upload."),console.warn("[VideoUploader] unverified upload:",s)),g(e=>e.map(e=>e.id===o.id?{...e,url:t,duration:r??e.duration,verified:i,status:"uploaded"}:e))}catch(t){let e=/no auth|sign in/i.test(t?.message||"");a.toast.error(e?"Please sign in to upload":t?.message||"Upload failed"),g(e=>e.map(e=>e.id===o.id?{...e,status:"error"}:e))}}))},[f.length,e,N,s,u]),S=()=>{(!x||x())&&v.current?.click()},w=e=>{e.target.files&&_(e.target.files),e.target.value=""},k=e=>{e.preventDefault(),b(!1),(!x||x())&&e.dataTransfer.files.length&&_(e.dataTransfer.files)},R=f.length<e;return 0===f.length?(0,t.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-2",c),children:[(0,t.jsx)("input",{ref:v,type:"file",multiple:!0,accept:d,className:"hidden",onChange:w,disabled:u}),(0,t.jsxs)("button",{type:"button",onClick:S,onDragOver:e=>{e.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:k,disabled:u,className:(0,n.cn)("flex flex-col items-center justify-center gap-1 w-full h-[90px] rounded-lg border border-dashed transition-all",h?"border-border bg-muted":"border-border bg-muted/30 hover:border-foreground
1/20 hover:bg-muted/50",u&&"cursor-not-allowed opacity-50"),children:[(0,t.jsx)(r.IconUpload,{size:20,className:"text-muted-foreground"}),(0,t.jsx)("div",{className:"text-xs text-foreground",children:p||`Drag or upload videos (0/${e})`}),(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:["mp4 / mov · up to ",s,"MB"]})]})]}):(0,t.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-2",c),children:[(0,t.jsx)("input",{ref:v,type:"file",multiple:!0,accept:d,className:"hidden",onChange:w,disabled:u}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[f.map((e,o)=>(0,t.jsxs)("div",{className:"relative group h-[90px] rounded-lg overflow-hidden bg-muted border border-border",children:[e.preview?(0,t.jsx)("video",{src:e.preview,className:"w-full h-full object-cover",controls:!0,preload:"metadata"}):(0,t.jsx)("div",{className:"w-full h-full"}),"uploading"===e.status&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 text-white text-xs",children:"Uploadingâ¦"}),"error"===e.status&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-red-900/60 text-white text-xs",children:"Failed"}),(0,t.jsxs)("span",{className:"absolute bottom-1 left-1 px-1.5 py-0.5 text-[10px] rounded bg-black/60 text-white",children:["@Video",o+1,"number"==typeof e.duration?` \xb7 ${e.duration.toFixed(1)}s`:""]}),(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void g(e=>{let o=e.find(e=>e.id===t);return o?.preview?.startsWith("blob:")&&URL.revokeObjectURL(o.preview),e.filter(e=>e.id!==t)})},className:"absolute top-1 right-1 w-5 h-5 rounded-full bg-black/60 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"remove",children:(0,t.jsx)(i.IconX,{size:12})})]},e.id)),R&&(0,t.jsxs)("button",{type:"button",onClick:S,onDragOver:e=>{e.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:k,disabled:u,className:(0,n.cn)("flex flex-col items-center justify-center gap-1 h-[90px] rounded-lg border border-dashed transition-all",h?"border-border bg-muted":"border-border bg-muted/30 hover:border-foreground
1/20",u&&"cursor-not-allowed opacity-50"),children:[(0,t.jsx)(r.IconUpload,{size:18,className:"text-muted-foreground"}),(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:[f.length,"/",e]})]})]})]})}e.s(["VideoUploader",()=>c])},614124,e=>{"use strict";var t=e.i(88310),o=e.i(95572),r=e.i(956371),i=e.i(623099),a=e.i(561444),s=e.i(95939),n=e.i(708439);function d(e){let d,p,x,f,g,h,b,v,j,y,N,_,S,w,k,R,I,M,P,C,V,A,D,q,F,T,$,B,L,U,z=(0,o.c)(105),{capability:O,onSubmit:W,disabled:E,i18n:K,onVideoAuthRequired:G}=e,H=(0,i.useLocale)(),Q=O.supports.motionControl,[X,J]=(0,r.useState)(""),[Y,Z]=(0,r.useState)(""),[ee,et]=(0,r.useState)(!1),[eo,er]=(0,r.useState)(""),[ei,ea]=(0,r.useState)(),[es,en]=(0,r.useState)(!1),[ed,el]=(0,r.useState)(O.defaults.qualityTier||"std"),[ec,eu]=(0,r.useState)(Q?.orientations?.[0]||"video");z[0]!==O.defaults.qualityTier?(d=()=>{el(O.defaults.qualityTier||"std")},z[0]=O.defaults.qualityTier,z[1]=d):d=z[1],z[2]!==O?(p=[O],z[2]=O,z[3]=p):p=z[3],(0,r.useEffect)(d,p),z[4]===Symbol.for("react.memo_cache_sentinel")?(x=e=>{let t=e.find(m);Z(t?.url||""),et(e.some(u))},z[4]=x):x=z[4];let em=x;z[5]===Symbol.for("react.memo_cache_sentinel")?(f=e=>{let t=e.find(c);er(t?.url||""),ea(t?.duration),en(e.some(l))},z[5]=f):f=z[5];let ep=f,ex=Q?.sourceVideo.minDurationSec??3,ef=Q?.sourceVideo.maxDurationSec??30,eg="number"==typeof ei?Math.floor(ei):void 0,eh="number"==typeof eg&&eg>=ex&&eg<=ef;e:{if(!eo||!eh||null==eg){g=null;break e}g=(O.credits.creditPerSecond?.[ed]??O.credits.base)*eg}let eb=g;z[6]!==O.model?(h=(0,n.getPromptLimit)({model:O.model,mediaType:"video",scene:"motion-control"}),z[6]=O.model,z[7]=h):h=z[7];let ev=h,ej=X.length>ev,ey=!!Y&&!!eo&&eh&&!(ee||es)&&!ej;z[8]!==ey||z[9]!==eb||z[10]!==ei||z[11]!==eo||z[12]!==W||z[13]!==ec||z[14]!==X||z[15]!==ed||z[16]!==Y?(b=()=>{ey&&null!=eb&&W({scene:"motion-control",prompt:X.trim()||void 0,motionReferenceImage:Y,motionSourceVideo:eo,motionSourceDuration:ei,motionOrientation:ec,motionBackground:"input_video",qualityTier:ed},eb)},z[8]=ey,z[9]=eb,z[10]=ei,z[11]=eo,z[12]=W,z[13]=ec,z[14]=X,z[15]=ed,z[16]=Y,z[17]=b):b=z[17];let eN=b,e_=K?.reference_image||"Reference Image";z[18]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("span",{className:"text-red-500",children:"*"}),z[18]=v):v=z[18],z[19]!==e_?(j=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[e_," ",v]}),z[19]=e_,z[20]=j):j=z[20];let eS=Q?.referenceImage.maxSizeMB??10;z[21]!==eS?(y=(0,t.jsx)(a.ImageUploader,{maxImages:1,maxSizeMB:eS,variant:"reference",onChange:em}),z[21]=eS,z[22]=y):y=z[22];let ew=K?.reference_image_hint||"Clear portrait with head, shoulders & torso visible";z[23]!==ew?(N=(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:ew}),z[23]=ew,z[24]=N):N=z[24],z[25]!==j||z[26]!==y||z[27]!==N?(_=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[j,y,N]}),z[25]=j,z[26]=y,z[27]=N,z[28]=_):_=z[28];let ek=K?.motion_source_video||"Motion Source Video";z[29]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)("span",{className:"text-red-500",children:"*"}),z[29]=S):S=z[29],z[30]!==ek?(w=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[ek," ",S]}),z[30]=ek,z[31]=w):w=z[31];let eR=Q?.sourceVideo.maxSizeMB??100;z[32]!==G||z[33]!==eR?(k=(0,t.jsx)(s.VideoUploader,{maxVideos:1,maxSizeMB:eR,onChange:ep,onBeforeSelect:G}),z[32]=G,z[33]=eR,z[34]=k):k=z[34];let eI=K?.motion_source_hint||"Duration {min}-{max}s; clear subject visible";z[35]!==ef||z[36]!==ex||z[37]!==eI?(R=eI.replace("{min}",String(ex)).replace("{max}",String(ef)),z[35]=ef,z[36]=ex,z[37]=eI,z[38]=R):R=z[38],z[39]!==R?(I=(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:R}),z[39]=R,z[40]=I):I=z[40],z[41]!==eh||z[42]!==K?.duration_out_of_range||z[43]!==ef||z[44]!==ex||z[45]!==eo?(M=!!eo&&!eh&&(0,t.jsx)("div",{className:"text-[11px] text-red-400",children:(K?.duration_out_of_range||"Video duration must be between {min}s and {max}s").replace("{min}",String(ex)).replace("{max}",String(ef))}),z[41]=eh,z[42]=K?.duration_out_of_range,z[43]=ef,z[44]=ex,z[45]=eo,z[46]=M):M=z[46],z[47]!==w||z[48]!==k||z[49]!==I||z[50]!==M?(P=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[w,
1k,I,M]}),z[47]=w,z[48]=k,z[49]=I,z[50]=M,z[51]=P):P=z[51];let eM=K?.prompt||"Prompt",eP=K?.optional||"Optional";z[52]!==eP?(C=(0,t.jsxs)("span",{className:"text-muted-foreground text-xs font-normal",children:["(",eP,")"]}),z[52]=eP,z[53]=C):C=z[53],z[54]!==eM||z[55]!==C?(V=(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground",children:[eM," ",C]}),z[54]=eM,z[55]=C,z[56]=V):V=z[56],z[57]===Symbol.for("react.memo_cache_sentinel")?(A=e=>J(e.target.value),z[57]=A):A=z[57];let eC=K?.motion_prompt_placeholder||"Optional: describe the animation style or adjustment...";z[58]!==E||z[59]!==ev||z[60]!==X||z[61]!==eC?(D=(0,t.jsx)("textarea",{value:X,onChange:A,placeholder:eC,className:"min-h-[60px] w-full resize-none border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-border focus:outline-none",maxLength:ev,disabled:E}),z[58]=E,z[59]=ev,z[60]=X,z[61]=eC,z[62]=D):D=z[62];let eV=`text-right text-xs ${ej?"text-red-500 font-semibold":"text-muted-foreground"}`,eA=K?.characters||"characters";z[63]!==ev||z[64]!==X.length||z[65]!==eV||z[66]!==eA?(q=(0,t.jsxs)("div",{className:eV,children:[X.length,"/",ev," ",eA]}),z[63]=ev,z[64]=X.length,z[65]=eV,z[66]=eA,z[67]=q):q=z[67],z[68]!==V||z[69]!==D||z[70]!==q?(F=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[V,D,q]}),z[68]=V,z[69]=D,z[70]=q,z[71]=F):F=z[71],z[72]!==O.model||z[73]!==O.options.qualityTier||z[74]!==E||z[75]!==K?.quality||z[76]!==K?.quality_help||z[77]!==H||z[78]!==ed?(T=O.options.qualityTier&&O.options.qualityTier.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-foreground flex items-center gap-1.5",children:[K?.quality||"Quality","veo3"===O.model&&(0,t.jsx)("a",{href:`/${H}/blog/veo-3-1-vs-fast-vs-light`,target:"_blank",rel:"noopener noreferrer",title:K?.quality_help||"Learn more about quality tiers",className:"inline-flex items-center justify-center w-4 h-4 rounded-full border border-border text-muted-foreground text-[10px] leading-none hover:border-foreground
1/30 hover:text-foreground transition-colors",children:"?"})]}),(0,t.jsx)("div",{className:"flex gap-2",children:O.options.qualityTier.map(e=>(0,t.jsx)("button",{onClick:()=>el(e),disabled:E,className:`px-3 py-1.5 text-xs rounded border transition-all ${ed===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground/20"} ${E?"cursor-not-allowed opacity-50":""}`,children:"std"===e?"720p":"pro"===e?"1080p":e},e))})]}),z[72]=O.model,z[73]=O.options.qualityTier,z[74]=E,z[75]=K?.quality,z[76]=K?.quality_help,z[77]=H,z[78]=ed,z[79]=T):T=z[79],z[80]!==E||z[81]!==K?.character_orientation||z[82]!==K?.orientation_image||z[83]!==K?.orientation_video||z[84]!==Q||z[85]!==ec?($=Q?.orientations&&Q.orientations.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-foreground",children:K?.character_orientation||"Character Orientation"}),(0,t.jsx)("div",{className:"flex gap-2",children:Q.orientations.map(e=>(0,t.jsx)("button",{onClick:()=>eu(e),disabled:E,className:`flex-1 px-3 py-2 text-xs rounded border transition-all ${ec===e?"border-foreground bg-foreground text-background":"border-border text-muted-foreground hover:border-foreground
1/20"} ${E?"cursor-not-allowed opacity-50":""}`,children:"video"===e?K?.orientation_video||"Video (recommended)":K?.orientation_image||"Image"},e))})]}),z[80]=E,z[81]=K?.character_orientation,z[82]=K?.orientation_image,z[83]=K?.orientation_video,z[84]=Q,z[85]=ec,z[86]=$):$=z[86];let eD=E||!ey,eq=`w-full rounded-lg px-6 py-2.5 sm:py-3 text-sm sm:text-base font-[550] transition-all focus-visible:ring-2 focus-visible:ring-white/50 focus-visible:ring-offset-2 ${E||!ey?"cursor-not-allowed bg-muted text-muted-foreground":"bg-foreground text-background shadow-lg hover:bg-foreground/90 hover:shadow-xl"}`;return z[87]!==eb||z[88]!==E||z[89]!==K?.generate||z[90]!==K?.generate_placeholder||z[91]!==K?.generating?(B=E?K?.generating||"Generating...":null==eb?K?.generate_placeholder||"Generate Motion Video":(K?.generate||"Generate Motion Video ({credits} credits)").replace("{credits}",String(eb)),z[87]=eb,z[88]=E,z[89]=K?.generate,z[90]=K?.generate_placeholder,z[91]=K?.generating,z[92]=B):B=z[92],z[93]!==eN||z[94]!==eD||z[95]!==eq||z[96]!==B?(L=(0,t.jsx)("div",{className:"pt-1",children:(0,t.jsx)("button",{onClick:eN,disabled:eD,className:eq,children:B})}),z[93]=eN,z[94]=eD,z[95]=eq,z[96]=B,z[97]=L):L=z[97],z[98]!==_||z[99]!==P||z[100]!==F||z[101]!==T||z[102]!==$||z[103]!==L?(U=(0,t.jsxs)(t.Fragment,{children:[_,P,F,T,$,L]}),z[98]=_,z[99]=P,z[100]=F,z[101]=T,z[102]=$,z[103]=L,z[104]=U):U=z[104],U}function l(e){return"uploading"===e.status}function c(e){return"uploaded"===e.status&&e.url}function u(e){return"uploading"===e.status}function m(e){return"uploaded"===e.status&&e.url}e.s(["SceneFormMotionControl",()=>d])}]);
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.