1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4598],{10583:(e,t,r)=>{"use strict";r.d(t,{default:()=>w});var s=r(46998),a=r(71333),o=r(77334),n=r(77195),i=r(82976),l=r(21921),c=r(66721),d=r(31762);let u=o.createContext(null);function m(){let e=o.useContext(u);if(!e)throw Error("useCarousel must be used within a <Carousel />");return e}let x=o.forwardRef((e,t)=>{let{orientation:r="horizontal",opts:a,setApi:i,plugins:l,className:d,children:m,...x}=e,[h,g]=(0,n.A)({...a,axis:"horizontal"===r?"x":"y"},l),[p,v]=o.useState(!1),[f,b]=o.useState(!1),w=o.useCallback(e=>{e&&(v(e.canScrollPrev()),b(e.canScrollNext()))},[]),j=o.useCallback(()=>{null==g||g.scrollPrev()},[g]),y=o.useCallback(()=>{null==g||g.scrollNext()},[g]),N=o.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),j()):"ArrowRight"===e.key&&(e.preventDefault(),y())},[j,y]);return o.useEffect(()=>{g&&i&&i(g)},[g,i]),o.useEffect(()=>{if(g)return w(g),g.on("reInit",w),g.on("select",w),()=>{null==g||g.off("select",w)}},[g,w]),(0,s.jsx)(u.Provider,{value:{carouselRef:h,api:g,opts:a,orientation:r||((null==a?void 0:a.axis)==="y"?"vertical":"horizontal"),scrollPrev:j,scrollNext:y,canScrollPrev:p,canScrollNext:f},children:(0,s.jsx)("div",{ref:t,onKeyDownCapture:N,className:(0,c.cn)("relative",d),role:"region","aria-roledescription":"carousel",...x,children:m})})});x.displayName="Carousel";let h=o.forwardRef((e,t)=>{let{className:r,...a}=e,{carouselRef:o,orientation:n}=m();return(0,s.jsx)("div",{ref:o,className:"overflow-hidden",children:(0,s.jsx)("div",{ref:t,className:(0,c.cn)("flex","horizontal"===n?"-ml-4":"-mt-4 flex-col",r),...a})})});h.displayName="CarouselContent";let g=o.forwardRef((e,t)=>{let{className:r,...a}=e,{orientation:o}=m();return(0,s.jsx)("div",{ref:t,role:"group","aria-roledescription":"slide",className:(0,c.cn)("min-w-0 shrink-0 grow-0 basis-full","horizontal"===o?"pl-4":"pt-4",r),...a})});g.displayName="CarouselItem",o.forwardRef((e,t)=>{let{className:r,variant:a="outline",size:o="icon",...n}=e,{orientation:l,scrollPrev:u,canScrollPrev:x}=m();return(0,s.jsxs)(d.$,{ref:t,variant:a,size:o,className:(0,c.cn)("absolute h-8 w-8 rounded-full","horizontal"===l?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",r),disabled:!x,onClick:u,...n,children:[(0,s.jsx)(i.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Previous slide"})]})}).displayName="CarouselPrevious",o.forwardRef((e,t)=>{let{className:r,variant:a="outline",size:o="icon",...n}=e,{orientation:i,scrollNext:u,canScrollNext:x}=m();return(0,s.jsxs)(d.$,{ref:t,variant:a,size:o,className:(0,c.cn)("absolute h-8 w-8 rounded-full","horizontal"===i?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",r),disabled:!x,onClick:u,...n,children:[(0,s.jsx)(l.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Next slide"})]})}).displayName="CarouselNext";var p=r(53414),v=r(14312),f=r(76983),b=r(84109);function w(e){var t;let{section:r}=e;if(r.disabled)return null;let n=(0,o.useRef)((0,p.A)({startDelay:500,speed:.7}));return(0,s.jsxs)("section",{id:r.name,className:"py-16",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[r.label&&(0,s.jsxs)("div",{className:"flex items-center gap-1 text-sm font-semibold text-primary",children:[r.icon&&(0,s.jsx)(f.default,{name:r.icon,className:"h-6 w-auto border-primary"}),r.label]}),(0,s.jsx)("h2",{className:"text-center text-3xl font-semibold lg:text-4xl",children:r.title}),(0,s.jsx)("p",{className:"text-center text-muted-foreground lg:text-lg",children:r.description})]}),(0,s.jsx)("div",{className:"lg:container",children:(0,s.jsx)("div",{className:"mt-16 space-y-4",children:(0,s.jsx)(x,{opts:{loop:!0},plugins:[n.current],onMouseLeave:()=>n.current.play(),className:"relative before:absolute before:bottom-0 before:left-0 before:top-0 before:z-10 before:w-36 before:bg-linear-to-r before:from-background before:to-transparent after:absolute after:bottom-0 after:right-0 after:top-0 after:z-10 after:w-36 after:bg-linear-to-l after:from-background after:to-transparent",children:(0,s.jsx)(h,{children:null==(t=r.items)?void 0:t.map((e,t)=>{var r,o;return(0,s.jsx)(g,{className:"basis-auto",children:(0,s.jsxs)(v.Zp,{className:"max-w-96 select-none p-6",children:[(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsxs)("div",{className:"mb-4 flex gap-4",children:[(0,s.jsx)(a.Avatar,{className:"size-14 rounded-full ring-1 ring-input",children:(0,s.jsx)(a.AvatarImage,{src:null==(r=e.image)?void 0:r.src,alt:(null==(o=e.image)?void 0:o.alt)||e.title})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium",children:e.title}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.label})]})]}),(0,s.jsx)("div",{className:"flex gap-1",children:Array.from({length:5}).map((e,t)=>(0,s.jsx)(b.A,{className:"size-5 fill-amber-500 text-amber-500"},t))})]}),(0,s.jsx)("q",{className:"leading-7 text-muted-foreground",children:e.description})]})},t)})})})})})]})}},14312:(e,t,r)=>{"use strict";r.d(t,{BT:()=>l,Wu:()=>d,X9:()=>c,ZB:()=>i,Zp:()=>o,aR:()=>n});var s=r(46998);r(77334);var a=r(66721);function o(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...r})}function n(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...r})}function i(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",t),...r})}function l(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",t),...r})}function c(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"card-action",className:(0,a.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...r})}function d(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",t),...r})}},17909:(e,t,r)=>{"use strict";r.d(t,{default:()=>l});var s=r(46998),a=r(77334),o=r(59691),n=r(38696),i=r.n(n);function l(e){let{banner:t}=e,[r,n]=(0,a.useState)(!0),l=(null==t?void 0:t.href)||"";return(null==t?void 0:t.text)&&r?(0,s.jsx)("div",{className:"relative bg-gradient-to-r from-blue-600 to-purple-600 text-white py-3 px-4 text-center",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-center gap-3 sm:gap-4",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:t.text}),(0,s.jsx)(i(),{href:l,target:"_blank",className:"inline-flex items-center rounded-full bg-yellow-500 px-4 sm:px-5 py-1.5 text-sm font-semibold text-black shadow-sm transition-colors hover:bg-yellow-400",children:t.cta}),(0,s.jsx)("button",{onClick:()=>n(!1),className:"absolute right-4 top-1/2 transform -translate-y-1/2 text-white/80 hover:text-white transition-colors","aria-label":"Close banner",children:(0,s.jsx)(o.A,{className:"h-4 w-4"})})]})}):null}},18261:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var s=r(46998),a=r(77334),o=r(31762),n=r(66721),i=r(22078),l=r(40274);let c=e=>{let t=e.toLowerCase();return[".mp4",".mov",".avi",".webm",".mkv",".flv",".wmv"].some(e=>t.includes(e))||e.includes("video")},d=e=>{let t={fast:{name:"Basic Mode",description:"No audio",icon:"M13 10V3L4 14h7v7l9-11h-7z",color:"green"},quality:{name:"Fast Mode",description:"Google veo3 fast",icon:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z",color:"blue"},ultra:{name:"Premium Mode",description:"Google veo3 standard",icon:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.196-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",color:"amber"}};return t[e]||t.fast},u=(e,t)=>
1"fast"===e?"1080p"===t?12:4:"quality"===e?"1080p"===t?16:12:"ultra"===e?"1080p"===t?36:32:4;function m(e){let{dashboard:t}=e,r=t.generate_section.default_image,m=t.generate_section.default_video,[x,h]=(0,a.useState)(""),[g,p]=(0,a.useState)("540p"),[v,f]=(0,a.useState)("fast"),[b,w]=(0,a.useState)("16:9"),[j,y]=(0,a.useState)(r),[N,k]=(0,a.useState)(m),[_,A]=(0,a.useState)(!1),[C,L]=(0,a.useState)(!1),[z,E]=(0,a.useState)("text-to-video"),[M,S]=(0,a.useState)(!1),[P,B]=(0,a.useState)(!1),[D,R]=(0,a.useState)(!1),[W,T]=(0,a.useState)(!1),{user:F,setShowSignModal:I,setShowPricingModal:O}=(0,i.U)(),[V,H]=(0,a.useState)(0),[$,q]=(0,a.useState)(""),[G,U]=(0,a.useState)([]),[X,J]=(0,a.useState)([]),[Z,Q]=(0,a.useState)(!1),[K,Y]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!1),er=(0,a.useRef)(null),es=(0,a.useRef)(null),[ea,eo]=(0,a.useState)(new Set),[en,ei]=(0,a.useState)([]),[el,ec]=(0,a.useState)(0),[ed,eu]=(0,a.useState)(1),[em]=(0,a.useState)(8),[ex,eh]=(0,a.useState)(!1),[eg,ep]=(0,a.useState)(null),ev=(0,a.useRef)(!1),ef=async e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;G.length>0&&U([]);let r=t[0];await eb([r]),e.target.value=""},eb=async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image",s=e.some(e=>e.type.startsWith("video/"));for(let r of e){console.log("File type:",r.type,"File name:",r.name);let e=r.name.toLowerCase().split(".").pop(),s=r.type.startsWith("video/"),a=["mp4","mov","avi","wmv","flv","webm"].includes(e||""),o=r.type.startsWith("image/"),n=["jpg","jpeg","png","webp"].includes(e||""),i=s||a&&!o,c=o||n&&!s;if(!i&&!c){console.log("File type not recognized:",r.type,"Extension:",e),l.oR.error(t.generate_section.file_format_error);return}let d=i?0x1000000:6291456;if(r.size>d){let e=i?16:6,r=i?t.generate_section.video_file_type||"è§é¢":t.generate_section.image_file_type||"å¾ç",s=t.generate_section.file_size_error.replace("{fileType}",r).replace("{maxSize}",e.toString());l.oR.error(s);return}}"video"===r||s?Q(!0):Y(!0);try{let t=e.map(async e=>{var t;let r=new FormData;r.append("file",e);let s=await fetch("/api/upload-image",{method:"POST",body:r}),a=await s.json();if(0===a.code&&(null==(t=a.data)?void 0:t.url)){let t=e.name.toLowerCase().split(".").pop(),r=e.type.startsWith("video/"),s=["mp4","mov","avi","wmv","flv","webm"].includes(t||""),o=e.type.startsWith("image/");return["jpg","jpeg","png","webp"].includes(t||""),{url:a.data.url,type:r||s&&!o?"video":"image"}}if(601===a.code)throw I(!0),Error("LOGIN_REQUIRED");throw Error(a.message||"ä¸ä¼ 失败")}),r=await Promise.all(t),s=r.filter(e=>"image"===e.type).map(e=>e.url),a=r.filter(e=>"video"===e.type).map(e=>e.url);s.length>0&&U(e=>[...e,...s]),a.length>0&&J(e=>[...e,...a])}catch(r){if(r instanceof Error&&"LOGIN_REQUIRED"===r.message)return;console.error("Upload error:",r);let e=r instanceof Error?r.message:t.generate_section.upload_failed;l.oR.error(e)}finally{"video"===r||s?Q(!1):Y(!1)}},ew=async e=>{e.preventDefault(),e.stopPropagation(),et(!1);let t=Array.from(e.dataTransfer.files);if(t.length>0){let e=t.filter(e=>e.type.startsWith("image/"));if(e.length>0){G.length>0&&U([]);let t=e[0];await eb([t],"image")}}},ej=async(e,t)=>{console.log("Checking task status:",e),eo(t=>new Set(t).add(e));try{let r=await fetch("/api/task-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})}),s=await r.json();if(0===s.code&&s.data)if("COMPLETED"===s.data.status&&s.data.result){let r=s.data.result[0].fileUrl;if(r)try{let s=await fetch("/api/works",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input_text:(null==t?void 0:t.prompt)||"Video Generation",output_url:r,input_images:(null==t?void 0:t.inputImages)||[],content_type:"video"})}),a=await s.json();0===a.code?(console.log("Background task completed and saved:",e),eC()):console.error("Failed to save background task result:",a.message)}catch(e){console.error("Failed to save background task result:",e)}}else"FAILED"===s.data.status?console.log("Background task failed:",e):console.log("Task still pending/running:",e,s.data.status)}
1catch(e){console.error("Background task check error:",e)}finally{eo(t=>{let r=new Set(t);return r.delete(e),r})}},ey=async e=>{let r=0;H(0),q(t.generate_section.progress_starting);let s=0,a=0,o=Date.now();for(;r<20;)try{let c=await fetch("/api/task-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})}),d=await c.json();if(0===d.code&&d.data){var n,i;let e=Date.now(),r=e-o;if("RUNNING"===d.data.status)r>2e3&&(a=8*Math.random()+2,s=Math.min(s+a,85),H(Math.round(s)),o=e,s<25?q(t.generate_section.progress_analyzing):s<50?q(t.generate_section.progress_enhancing):s<75?q(t.generate_section.progress_optimizing):q(t.generate_section.progress_finalizing),console.log("Simulated progress: ".concat(Math.round(s),"%")));else if("COMPLETED"===d.data.status&&d.data.result){let e=d.data.result[0].fileUrl;if(e){H(100),q("");try{let t=await fetch("/api/works",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input_text:x||"Video Generation",output_url:e,input_images:G,content_type:"video"})}),r=await t.json();0===r.code&&(null==(n=r.data)?void 0:n.output_url)?k(r.data.output_url):(console.error("Failed to save result:",r.message),k(e))}catch(t){console.error("Failed to save generated result:",t),k(e)}finally{A(!1),eC()}return}}else if("FAILED"===d.data.status){A(!1),H(0),q(""),l.oR.error((null==(i=d.data)?void 0:i.error)||t.generate_section.error_processing_failed);return}else"PENDING"===d.data.status&&r>3e3&&(a=3*Math.random()+1,s=Math.min(s+a,15),H(Math.round(s)),o=e,q(t.generate_section.progress_waiting))}await new Promise(e=>setTimeout(e,15e3)),r++}catch(e){console.error("Polling error:",e),await new Promise(e=>setTimeout(e,15e3)),r++}A(!1),H(0),q("")},eN=async()=>{if(!F)return void I(!0);if(!x||""===x.trim())return void l.oR.error(t.generate_section.prompt_required_error);if("image-to-video"===z&&(!G||0===G.length))return void l.oR.error(t.error_messages.no_uploaded_images);let e=u(v,g);if((F.credits||0)<e){l.oR.error("Insufficient credits. Need ".concat(e," credits for ").concat(g," ").concat("text-to-video"===z?"text-to-video":"image-to-video"," generation.")),setTimeout(()=>{let e=document.getElementById("pricing");e&&e.scrollIntoView({behavior:"smooth"})},1e3);return}A(!0),H(0),q(t.generate_section.progress_starting),console.log("generateVideo",x,z,g,b,G,v);try{let e="",r={prompt:x,generate_type:z,resolution:g,inputImages:G};"fast"===v?e="/api/generate/handle":(e="/api/generate/handle-veo-p",r.aspectRatio=b,r.veoModel=v);let s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),a=await s.json();if(0===a.code&&a.data&&a.data.length>0){let e=a.data[0].taskId;e&&ey(e)}else 601===a.code?(I(!0),A(!1),H(0),q("")):602===a.code?(l.oR.info(t.error_messages.no_credits),setTimeout(()=>{O(!0)},1e3),A(!1),H(0),q("")):603===a.code?(l.oR.error(t.error_messages.sensitive_content),A(!1),H(0),q("")):-1===a.code&&(l.oR.error(a.message||"An error occurred during generation"),A(!1),H(0),q(""))}catch(e){console.error("Failed to generate image:",e),A(!1),H(0),q("")}},ek=async()=>{if(F)try{var e;let t=await fetch("/api/generation-tasks?status=pending"),r=await t.json();if(0===r.code&&(null==(e=r.data)?void 0:e.tasks)){let e=r.data.tasks;console.log("Found ".concat(e.length," pending tasks, starting background polling")),e.forEach(e=>{e.task_id&&!ea.has(e.task_id)&&ej(e.task_id,e.task_params)})}}catch(e){console.error("Failed to check pending tasks:",e)}},e_=()=>{N&&(0,n._)(N)},eA=()=>{L(!C)},eC=async e=>{let t=null!=e?e:ed;eh(!0);try{let e=await fetch("/api/works?page=".concat(t,"&pageSize=").concat(em)),r=await e.json();0===r.code&&r.data?(ei(r.data.works||[]),ec(r.data.total||0)):601===r.code?I(!0):console.error("Failed to load images")}catch(e){console.error("Failed to load images:",e)}finally{eh(!1)}};(0,a.useEffect)(()=>{let e=e=>{let t=e.target;M&&!t.closest(".dropdown-container")&&S(!1),P&&!t.closest(".resolution-dropdown")&&B(!1),D&&!t.closest(".aspect-ratio-dropdown")&&R(!1),W&&!t.closest(".model-dropdown")&&T(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[M,P,D,W]),(0,a.useEffect)(()=>{let e=es.current;if(e){e.style.height="auto";let t=Math.max(e.scrollHeight,100);e.style.height="".concat(t,"px")}},[x]),(0,a.useEffect)(()=>{F&&!ev.current&&(ev.current=!0,eC(),ek())},[F]),(0,a.useEffect)(()=>{"fast"===v?p("540p"):p("720p")},[v]);let eL=e=>{eu(e),eC(e)},ez=async(e,r)=>{if(r.stopPropagation(),confirm(t.previous_images.delete_confirmation))try{let r=await fetch("/api/works",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({workUid:e})}),s=await r.json();if(0===s.code){l.oR.success(t.previous_images.delete_success);let r=el-1,s=Math.ceil(r/em);ed>s&&s>0?(eu(s),eC(s)):(ei(t=>t.filter(t=>t.uid!==e)),ec(r))}else 601===s.code?I(!0):l.oR.error(t.previous_images.delete_error)}catch(e){console.error("Failed to delete image:",e)}};return(0,s.jsxs)("div",{id:"dashboard",className:"min-h-screen bg-black py-8 px-4",children:[(0,s.jsxs)("div",{className:"container mx-auto max-w-7xl",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-5 ga
1p-4",children:[(0,s.jsxs)("div",{className:"bg-[#1E1E1E] rounded-lg p-6 shadow-md lg:col-span-2",children:[(0,s.jsxs)("div",{className:"mb-6 model-dropdown",children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-3 text-white/80",children:t.model_selection.label}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{type:"button",className:"w-full bg-[#2A2A2A] hover:bg-[#3A3A3A] text-white rounded-lg p-4 text-left flex items-center justify-between transition-all cursor-pointer",onClick:()=>T(!W),children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 text-primary",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"w-6 h-6 ".concat("green"===d(v).color?"text-green-400":"blue"===d(v).color?"text-blue-400":"text-amber-400"),children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:d(v).icon})})}),(0,s.jsx)("span",{children:d(v).name}),(0,s.jsx)("span",{className:"text-sm ml-2 text-gray-400",children:d(v).description})]}),(0,s.jsx)("div",{className:"w-5 h-5 transition-transform duration-200 ".concat(W?"rotate-180":""),children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),W&&(0,s.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-[#2A2A2A] rounded-lg border border-gray-600/60 shadow-lg z-10 overflow-hidden",children:[(0,s.jsxs)("button",{type:"button",className:"w-full p-4 text-left flex items-center hover:bg-[#3A3A3A] transition-all cursor-pointer ".concat("fast"===v?"bg-[#3A3A3A]":""),onClick:()=>{f("fast"),T(!1)},children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 text-green-400",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-white",children:t.model_selection.basic_mode.name}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:t.model_selection.basic_mode.description})]})]}),(0,s.jsxs)("button",{type:"button",className:"w-full p-4 text-left flex items-center hover:bg-[#3A3A3A] transition-all cursor-pointer ".concat("quality"===v?"bg-[#3A3A3A]":""),onClick:()=>{f("quality"),T(!1)},children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 text-blue-400",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-white",children:t.model_selection.fast_mode.name}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:t.model_selection.fast_mode.description})]})]}),(0,s.jsxs)("button",{type:"button",className:"w-full p-4 text-left flex items-center hover:bg-[#3A3A3A] transition-all cursor-pointer ".concat("ultra"===v?"bg-[#3A3A3A]":""),onClick:()=>{f("ultra"),T(!1)},children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 text-amber-400",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.196-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-white",children:t.model_selection.premium_mode.n
1ame}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:t.model_selection.premium_mode.description})]})]})]})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-3 text-white/80",children:t.generation_type.label}),(0,s.jsxs)("div",{className:"relative dropdown-container",children:[(0,s.jsxs)("button",{type:"button",className:"w-full bg-[#2A2A2A] hover:bg-[#3A3A3A] text-white rounded-lg p-4 text-left flex items-center justify-between transition-all cursor-pointer",onClick:()=>S(!M),children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 text-primary",children:"text-to-video"===z?(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})}):(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"text-primary",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),(0,s.jsx)("span",{children:"text-to-video"===z?t.generation_type.text_to_video.name:t.generation_type.image_to_video.name})]}),(0,s.jsx)("div",{className:"w-5 h-5 transition-transform duration-200 ".concat(M?"rotate-180":""),children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),M&&(0,s.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-[#2A2A2A] rounded-lg border border-gray-600/60 shadow-lg z-10 overflow-hidden",children:[(0,s.jsxs)("button",{type:"button",className:"w-full p-4 text-left flex items-center hover:bg-[#3A3A3A] transition-all cursor-pointer ".concat("text-to-video"===z?"bg-[#3A3A3A]":""),onClick:()=>{E("text-to-video"),S(!1),U([])},children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 text-primary",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-white",children:t.generation_type.text_to_video.name}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:t.generation_type.text_to_video.description})]})]}),(0,s.jsxs)("button",{type:"button",className:"w-full p-4 text-left flex items-center hover:bg-[#3A3A3A] transition-all cursor-pointer ".concat("image-to-video"===z?"bg-[#3A3A3A]":""),onClick:()=>{E("image-to-video"),S(!1)},children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 text-primary",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-white",children:t.generation_type.image_to_video.name}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:t.generation_type.image_to_video.description})]})]})]})]})]}),"image-to-video"===z&&(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-3 text-white/80",children:"image-to-video"===z?t.reference_image.required_label:t.generate_section.image_label}),G.length>0&&(0,s.jsx)("div",{className:"mb-4",children:G.map((e,t)=>(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsxs)("div",{className:"relative w-full aspect-[4/3] rounded-xl overflow-hidden bg-gradient-to-br from-black/50 to-black shadow-lg ring-2 ring-white/10 group-hover:ring-primary/30 transition-all duration-300",children:[(0,s.jsx)("img",{src:e,alt:"Uploaded image ".concat(t+1),className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/20 via-trans
1parent to-transparent"})]}),(0,s.jsx)("button",{type:"button",className:"absolute -top-2 -right-2 h-6 w-6 bg-red-500 hover:bg-red-600 text-white rounded-full shadow-lg flex items-center justify-center z-10 border-0 cursor-pointer text-xs",onClick:e=>{e.stopPropagation(),e.preventDefault(),U(e=>e.filter((e,r)=>r!==t))},children:"â"})]},"image-".concat(t)))}),0===G.length&&(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsx)("input",{type:"file",accept:"image/jpeg,image/png,image/webp",onChange:ef,className:"hidden",disabled:K,ref:er,multiple:!0}),(0,s.jsxs)("div",{className:"relative border-2 border-dashed rounded-xl p-4 text-center transition-all duration-300 cursor-pointer ".concat(K?"border-primary/60 bg-gradient-to-br from-primary/10 to-primary/5 shadow-lg shadow-primary/20":ee?"border-primary/70 bg-gradient-to-br from-primary/15 to-primary/10 shadow-xl shadow-primary/25 scale-[1.02]":"border-gray-600/60 bg-gradient-to-br from-[#2A2A2A]/80 to-[#1E1E1E]/50 hover:border-primary/40 hover:bg-gradient-to-br hover:from-[#2A2A2A] hover:to-[#1E1E1E] hover:shadow-lg hover:shadow-black/30"),onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),et(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),et(!1)},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:ew,onClick:()=>{!K&&er.current&&er.current.click()},children:[(0,s.jsx)("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-r from-primary/5 via-transparent to-primary/5 transition-opacity duration-500 ".concat(ee?"opacity-100":"opacity-0 group-hover:opacity-100")}),K?(0,s.jsxs)("div",{className:"relative z-10 flex flex-col items-center space-y-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-3 border-primary/30 border-t-primary"}),(0,s.jsx)("div",{className:"absolute inset-0 rounded-full bg-primary/10 animate-pulse"})]}),(0,s.jsx)("p",{className:"text-white text-xs font-medium bg-gradient-to-r from-white to-white/80 bg-clip-text",children:t.generate_section.image_uploading})]}):(0,s.jsxs)("div",{className:"relative z-10 flex flex-col items-center space-y-3",children:[(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center shadow-lg shadow-primary/10 group-hover:shadow-primary/20 transition-all duration-300 group-hover:scale-105 ".concat(ee?"scale-110 shadow-primary/30":""),children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-primary transition-colors duration-300 ".concat(ee?"text-primary":"group-hover:text-primary/80"),children:[(0,s.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,s.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,s.jsx)("path",{d:"M21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})})}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("p",{className:"text-white text-xs font-semibold bg-gradient-to-r from-white to-white/90 bg-clip-text mb-1",children:ee?t.reference_image.drop_text:t.reference_image.click_text}),(0,s.jsx)("p",{className:"text-gray-400 text-xs font-medium bg-gradient-to-r from-gray-400 to-gray-500 bg-clip-text",children:t.generate_section.image_format_text}),(0,s.jsx)("p",{className:"text-gray-500 text-xs mt-1",children:t.generate_section.image_max_text.replace("{maxImages}","1")})]})]})]})]})]}),(0,s.jsxs)("div",{className:"mb-2",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-white/80",children:t.prompt_section.label}),(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{type:"button",className:"px-3 py-1 text-xs bg-[#2A2A2A] hover:bg-[#3A3A3A] text-white rounded-md transition-all cursor-pointer",onClick:()=>h(""),children:t.prompt_section.clear_button}),(0,s.jsxs)("button",{type:"button",className:"px-3 py-1 text-xs bg-[#2A2A2A] hover:bg-[#3A3A3A] text-white rounded-md transition-all cursor-pointer flex items-center",onClick:()=>{let e=["A robot with red glowing eyes typing on a keyboard in a dark cyberpunk room","A girl is dancing in a beautiful garden with flowers blooming","A majestic eagle soaring over snow-capped mountains","A bustling city street at night with neon lights reflecting on wet pavement"];h(e[Math.floor(Math.random()*e.length)])},children:[(0,s.jsx)("div",{className:"w-3 h-3 mr-1",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),t.prompt_section.random_button]})]})]}),(0,s.jsx)("textarea",{ref:es,value:x,onChange:e=>h(e.target.value),placeholder:"Describe your video, e.g., An astronaut playing music in space with dreamy lighting and background ambience",className:"w-full p-4 bg-[#2A2A2A] border border-gray-600/60 rounded-lg text-white placeholder-gray-400 focus:border-primary/60 focus:ring-2 focus:ring-primary/20 resize-none transition-all duration-200 min-h-[100px] overflow-hidden",disabled:_,maxLength:2e3,style:{height:"100px"}}),(0,s.jsxs)("div",{className:"text-right text-xs text-gray-500 mt-1",children:[x.length,"/2000"]})]}),(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"relative resolution-dropdown",children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2 text-white/80",children:t.resolution.label}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{type:"button",className:"w-full bg-[#2A2A2A] hover:bg-[#3A3A3A] text-white rounded-full p-3 text-left flex items-center justify-between transition-all cursor-pointer",onClick:()=>B(!P),children:[(0,s.jsx)("span",{children:"fast"===v?"540p"===g?"540P":"1080P":"720p"===g?"720P":"1080P"}),(0,s.jsx)("div",{className:"w-4 h-4 transition-transform duration-200 ".concat(P?"rotate-180":""),children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),P&&(0,s.jsx)("div",{className:"absolute top-full left-0 right-0 mt-1 bg-[#2A2A2A] rounded-2xl shadow-lg z-10 overflow-hidden",children:"fast"===v?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"w-full p-3 text-left hover:bg-orange-400/20 transition-all cursor-pointer ".concat("540p"===g?"bg-orange-400/20 text-orange-400":"text-gray-300"),onClick:()=>
1{p("540p"),B(!1)},children:"540P"}),(0,s.jsx)("button",{type:"button",className:"w-full p-3 text-left hover:bg-orange-400/20 transition-all cursor-pointer ".concat("1080p"===g?"bg-orange-400/20 text-orange-400":"text-gray-300"),onClick:()=>{p("1080p"),B(!1)},children:"1080P"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"w-full p-3 text-left hover:bg-orange-400/20 transition-all cursor-pointer ".concat("720p"===g?"bg-orange-400/20 text-orange-400":"text-gray-300"),onClick:()=>{p("720p"),B(!1)},children:"720P"}),(0,s.jsx)("button",{type:"button",className:"w-full p-3 text-left hover:bg-orange-400/20 transition-all cursor-pointer ".concat("1080p"===g?"bg-orange-400/20 text-orange-400":"text-gray-300"),onClick:()=>{p("1080p"),B(!1),"16:9"!==b&&w("16:9")},children:"1080P"})]})})]})]}),"fast"!==v&&(0,s.jsxs)("div",{className:"relative aspect-ratio-dropdown",children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2 text-white/80",children:t.aspect_ratio.label}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{type:"button",className:"w-full bg-[#2A2A2A] hover:bg-[#3A3A3A] text-white rounded-full p-3 text-left flex items-center justify-between transition-all cursor-pointer",onClick:()=>R(!D),children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 text-primary flex items-center justify-center",children:"16:9"===b?(0,s.jsx)("div",{className:"w-5 h-3 border-2 border-current rounded-sm flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-3 h-1 bg-current rounded-xs"})}):(0,s.jsx)("div",{className:"w-3 h-5 border-2 border-current rounded-sm flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-1 h-3 bg-current rounded-xs"})})}),(0,s.jsx)("div",{children:(0,s.jsx)("span",{className:"font-medium",children:b})})]}),(0,s.jsx)("div",{className:"w-4 h-4 transition-transform duration-200 ".concat(D?"rotate-180":""),children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),D&&(0,s.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-1 bg-[#2A2A2A] rounded-2xl shadow-lg z-10 overflow-hidden",children:[(0,s.jsxs)("button",{type:"button",className:"w-full p-3 text-left hover:bg-orange-400/20 transition-all cursor-pointer flex items-center ".concat("16:9"===b?"bg-orange-400/20 text-orange-400":"text-gray-300"),onClick:()=>{w("16:9"),R(!1)},children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-5 h-3 border-2 rounded-sm flex items-center justify-center ".concat("16:9"===b?"border-orange-400":"border-gray-400"),children:(0,s.jsx)("div",{className:"w-3 h-1 rounded-xs ".concat("16:9"===b?"bg-orange-400":"bg-gray-400")})})}),(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"font-medium",children:"16:9"})})]}),(0,s.jsxs)("button",{type:"button",className:"w-full p-3 text-left transition-all cursor-pointer flex items-center ".concat("1080p"===g?"bg-gray-600/20 text-gray-500 cursor-not-allowed":"9:16"===b?"bg-orange-400/20 text-orange-400 hover:bg-orange-400/20":"text-gray-300 hover:bg-orange-400/20"),onClick:()=>{"1080p"!==g&&(w("9:16"),R(!1))},disabled:"1080p"===g,children:[(0,s.jsx)("div",{className:"w-6 h-6 mr-3 flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-3 h-5 border-2 rounded-sm flex items-center justify-center ".concat("9:16"===b?"border-orange-400":"border-gray-400"),children:(0,s.jsx)("div",{className:"w-1 h-3 rounded-xs ".concat("9:16"===b?"bg-orange-400":"bg-gray-400")})})}),(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"font-medium",children:"1080p"===g?"9:16 not support in 1080p":"9:16"})})]})]})]})]})]})}),_&&(0,s.jsxs)("div",{className:"mb-6 p-5 bg-gradient-to-br from-[#2A2A2A] to-[#1E1E1E] rounded-lg border border-white/10 shadow-lg animate-in slide-in-from-top-2 fade-in duration-500",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-emerald-400 rounded-full animate-pulse shadow-lg shadow-emerald-400/50"}),(0,s.jsx)("span",{className:"text-sm font-medium text-white/90",children:t.generate_section.progress_t
1itle})]})}),(0,s.jsx)("div",{className:"relative mb-4",children:(0,s.jsxs)("div",{className:"w-full bg-[#1A1A1A] rounded-lg h-8 overflow-hidden shadow-inner border border-white/10 relative",children:[(0,s.jsxs)("div",{className:"h-full bg-gradient-to-r from-emerald-400 via-teal-400 to-cyan-400 rounded-lg transition-all duration-1000 ease-out relative overflow-hidden shadow-lg shadow-emerald-500/30",style:{width:"".concat(V,"%")},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-30",children:(0,s.jsx)("div",{className:"w-full h-full bg-repeating-linear-gradient animate-[diagonal-move_1s_linear_infinite]",style:{backgroundImage:"repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255,255,255,0.3) 8px, rgba(255,255,255,0.3) 16px)",backgroundSize:"22px 22px"}})}),(0,s.jsx)("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-transparent via-white/60 to-transparent rounded-t-lg"})]}),(0,s.jsx)("div",{className:"absolute left-3 top-0 h-full flex items-center z-20",children:(0,s.jsxs)("span",{className:"text-sm font-bold text-white drop-shadow-lg",children:[Math.round(V),"%"]})}),(0,s.jsx)("div",{className:"absolute inset-0 rounded-lg border border-emerald-500/20 pointer-events-none"})]})}),(0,s.jsxs)("div",{className:"flex items-center justify-center space-x-3 text-xs text-white/80",children:[(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-emerald-400 rounded-full animate-bounce shadow-lg shadow-emerald-400/50",style:{animationDelay:"0ms"}}),(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-teal-400 rounded-full animate-bounce shadow-lg shadow-teal-400/50",style:{animationDelay:"150ms"}}),(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-cyan-400 rounded-full animate-bounce shadow-lg shadow-cyan-400/50",style:{animationDelay:"300ms"}})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-4 h-4 border-2 border-emerald-400 border-t-transparent rounded-full animate-spin shadow-lg shadow-emerald-400/30"}),(0,s.jsx)("span",{className:"font-medium tracking-wide",children:$||t.generate_section.progress_waiting})]})]})]}),(0,s.jsx)(o.$,{className:"w-full bg-primary hover:bg-primary/80 text-primary-foreground rounded-lg py-4 h-16 transition-colors cursor-pointer text-lg font-medium flex items-center justify-center",onClick:eN,disabled:_||!x.trim()||"image-to-video"===z&&0===G.length,children:_?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),V>0?"".concat(Math.round(V),"%..."):t.generate_section.generating_text]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"mr-2",children:"\uD83D\uDE80"}),t.generate_section.generate_button]})}),(0,s.jsx)("div",{className:"text-center mt-4 flex items-center justify-center space-x-2",children:(0,s.jsx)("span",{className:"text-sm text-gray-400",children:t.credits.required_text.replace("{credits}",u(v,g).toString())})})]}),(0,s.jsxs)("div",{className:"bg-[#1E1E1E] rounded-lg p-6 shadow-md lg:col-span-3",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-5",children:(0,s.jsx)("h2",{className:"text-xl font-semibold text-white",children:t.output_section.title})}),N?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"bg-black rounded-xl overflow-hidden flex items-center justify-center",children:(0,s.jsx)("video",{src:N,className:"w-full h-auto max-h-[600px] cursor-pointer hover:opacity-90 transition-opacity",controls:!0,muted:!0,onClick:eA})}),(0,s.jsxs)("div",{className:"flex justify-end mt-4 space-x-4",children:[(0,s.jsxs)(o.$,{variant:"outline",size:"sm",className:"text-sm h-11 bg-[#2A2A2A] text-white border-0 hover:bg-[#3A3A3A] rounded-full px-6 cursor-pointer flex items-center",onClick:()=>{y(null),k(null)},children:[(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),t.output_section.clear_button]}),(0,s.jsxs)(o.$,{variant:"outline",size:"sm",className:"text-sm h-11 bg-[#2A2A2A] text-white border-0 hover:bg-[#3A3A3A] rounded-full px-6 cursor-pointer flex items-center",onClick:eA,children:[(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}),t.output_section.preview_button]}),(0,s.jsxs)(o.$,{variant:"outline",size:"sm",className:"text-sm h-11 bg-[#2A2A2A] text-white border-0 hover:bg-[#3A3A3A] rounded-full px-6 cursor-pointer flex items-center",onClick:e_,children:[(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,s.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,s.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),t.output_section.download_button]})]})]}):(0,s.jsx)("div",{className:"bg-[#2A2A2A] rounded-xl overflow-hidden min-h-[400px] flex items-center justify-center",children:(0,s.jsx)("p",{className:"text-gray-500",children:t.output_section.empty_state})})]})]}),(0,s.jsxs)("div",{className:"bg-[#1E1E1E] rounded-xl p-6 shadow-md mt-8",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold mb-4 text-white",children:t.previous_images.title}),ex?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-primary"}),(0,s.jsx)("p",{className:"mt-2 text-gray-500",children:t.previous_images.loading_text})]}):en.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:en.map(e=>(0,s.jsxs)("div",{className:"relative group cursor-pointer overflow-hidden rounded-lg aspect-square bg-[#2A2A2A]",onClick:()=>{ep(e),L(!0)},children:[c(e.output_url)?(0,s.jsxs)("div",{className:"relative w-full h-full",children:[(0,s.jsx)("video",{src:e.output_url,className:"w-full h-full object-cover transition-transform group-hover:scale-105",muted:!0,preload:"metadata",poster:"",onLoadedMetadata:e=>{e.target.currentTime=.1}}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20 group-hover:bg-black/40 transition-all",children:(0,s.jsx)("div",{className:"w-12 h-12 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center group-hover:bg-white/30 transition-all",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"white",className:"ml-1",children:(0,s.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})})})})]}):(0,s.jsx)("img",{src:e.output_url,alt:e.input_text,className:"w-full h-full object-cover transition-transform group-hover:scale-105"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-opacity-0 group-hover:bg-opacity-30 transition-all flex items-end justify-start p-3",children:(0,s.jsx)("div",{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity text-xs truncate max-w-full",children:e.input_text.length>50?"".concat(e.input_text.substring(0,50),"..."):e.input_text})}),(0,s.jsx)("button",{className:"absolute top-2 right-2 w-8 h-8 rounded-full bg-black/70 hover:bg-red-500/90 text-white opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10 cursor-pointer",onClick:t=>ez(e.uid,t),title:t.previous_images.delete_button_title,children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M3 6h18"}),(0,s.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,s.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,s.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})})]},e.uid))}),el>em&&(0,s.jsxs)("div",{className:"flex justify-center mt-6 space-x-2",children:[(0,s.jsx)(o.$,{variant:"outline",size:"sm",className:"h-10 px-4 bg-[#2A2A2A] text-white border-0 hover:bg-[#3A3A3A] rounded-full disabled:opacity-50 cursor-pointer",onClick:()=>eL(ed-1),disabled:1===ed,children:t.previous_images.pagination.previous}),(0,s.jsxs)("div",{className:"flex items-center px-4 text-white",children:[ed," / ",Math.ceil(el/em)]}),(0,s.jsx)(o.$,{variant:"outline",size:"sm",className:"h-10 px-4 bg-[#2A2A2A] text-white border-0 hover:bg-[#3A3A3A] rounded-full disabled:opacity-50 cursor-pointer",onClick:()=>eL(ed+1),disabled:ed>=Math.ceil(el/em),children:t.previous_images.pagination.next})]})]}):(0,s.jsx)("div",{className:"text-center py-12 text-gray-500",children:(null==F?void 0:F.id)?t.previous_images.empty_state.no_images:t.previous_images.empty_state.please_login})]})]}),C&&(eg?(0,s.jsx)("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:()=>{L(!1),ep(null)},children:(0,s.jsxs)("div",{className:"relative max-h-[90vh] w-full",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"absolute top-4 right-0 z-10 flex space-x-2",children:[(0,s.jsx)(o.$,{variant:"outline",size:"icon",className:"h-10 w-10 rounded-full bg-[#2A2A2A] border-0 text-white hover:bg-[#3A3A3A] cursor-pointer",onClick:()=>eg&&(0,n._)(eg.output_url),children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,s.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,s.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),(0,s.jsx)(o.$,{variant:"outline",size:"icon",className:"h-10 w-10 rounded-full bg-[#2A2A2A] border-0 text-white hover:bg-red-500 cursor-pointer",onClick:e=>{e.stopPropagation(),eg&&(ez(eg.uid,e),L(!1),ep(null))},children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M3 6h18"}),(0,s.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,s.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,s.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}),(0,s.jsx)(o.$,{variant:"outline",size:"icon",className:"h-10 w-10 rounded-full bg-black/50 border-0 text-white hover:bg-black/70 cursor-pointer",onClick:()=>{L(!1),ep(null)},children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),c(eg.output_url)?(0,s.jsx)("video",{src:eg.output_url,className:"max-h-[90vh] max-w-full object-contain mx-auto
1shadow-2xl rounded-lg",controls:!0,muted:!0,autoPlay:!0}):(0,s.jsx)("img",{src:eg.output_url,className:"max-h-[90vh] max-w-full object-contain mx-auto shadow-2xl rounded-lg",alt:eg.input_text}),(0,s.jsx)("div",{className:"mt-4 bg-[#1E1E1E] p-4 rounded-lg max-w-2xl mx-auto",children:(0,s.jsx)("p",{className:"text-white text-sm",children:eg.input_text})})]})}):N&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:eA,children:(0,s.jsxs)("div",{className:"relative max-h-[90vh] w-full",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"absolute top-4 right-0 z-10 flex space-x-2",children:[(0,s.jsx)(o.$,{variant:"outline",size:"icon",className:"h-10 w-10 rounded-full bg-[#2A2A2A] border-0 text-white hover:bg-[#3A3A3A] cursor-pointer",onClick:e_,children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,s.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,s.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),(0,s.jsx)(o.$,{variant:"outline",size:"icon",className:"h-10 w-10 rounded-full bg-black/50 border-0 text-white hover:bg-black/70 cursor-pointer",onClick:eA,children:(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,s.jsx)("div",{className:"flex items-center justify-center ".concat("16:9"===b?"aspect-video":"aspect-[9/16]"),children:(0,s.jsx)("video",{src:N,className:"w-full h-full object-contain mx-auto shadow-2xl rounded-lg",controls:!0,muted:!0,autoPlay:!0})})]})}))]})}},25061:(e,t,r)=>{Promise.resolve().then(r.bind(r,61683)),Promise.resolve().then(r.t.bind(r,38696,23)),Promise.resolve().then(r.t.bind(r,79089,23)),Promise.resolve().then(r.bind(r,17909)),Promise.resolve().then(r.bind(r,18261)),Promise.resolve().then(r.bind(r,95693)),Promise.resolve().then(r.bind(r,10583)),Promise.resolve().then(r.bind(r,76983)),Promise.resolve().then(r.bind(r,71333)),Promise.resolve().then(r.bind(r,92429))},71333:(e,t,r)=>{"use strict";r.d(t,{Avatar:()=>n,AvatarImage:()=>i,q:()=>l});var s=r(46998);r(77334);var a=r(93933),o=r(66721);function n(e){let{className:t,...r}=e;return(0,s.jsx)(a.bL,{"data-slot":"avatar",className:(0,o.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...r})}function i(e){let{className:t,...r}=e;return(0,s.jsx)(a._V,{"data-slot":"avatar-image",className:(0,o.cn)("aspect-square size-full",t),...r})}function l(e){let{className:t,...r}=e;return(0,s.jsx)(a.H4,{"data-slot":"avatar-fallback",className:(0,o.cn)("bg-muted flex size-full items-center justify-center rounded-full",t),...r})}},76983:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(46998);let a={Ri:r(1227)};function o(e){let{name:t,className:r,onClick:o}=e,n=function(e){let t=a[e.slice(0,2)];return t&&t[e]||null}(t);return n?(0,s.jsx)(n,{className:"".concat(r," cursor-pointer"),onClick:o,style:{cursor:o?"pointer":"default"}}):null}},92429:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var s=r(46998),a=r(77334);function o(e){let{beforeImage:t,afterImage:r,alt:o="Image comparison",className:n=""}=e,[i,l]=(0,a.useState)(50),[c,d]=(0,a.useState)(!1),u=(0,a.useRef)(null),m=(0,a.useCallback)(e=>{if(!u.current)return;let t=u.current.getBoundingClientRect();l(Math.max(0,Math.min(100,(e-t.left)/t.width*100)))},[]),x=(0,a.useCallback)(e=>{c&&m(e.clientX)},[c,m]),h=(0,a.useCallback)(()=>{d(!1)},[]),g=(0,a.useCallback)(e=>{c&&0!==e.touches.length&&(e.preventDefault(),m(e.touches[0].clientX))},[c,m]);return(0,a.useEffect)(()=>(document.addEventListener("mousemove",x),document.addEventListener("mouseup",h),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("touchend",h),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",h)}),[x,h,g]),(0,s.jsxs)("div",{ref:u,className:"relative w-full h-96 overflow-hidden rounded-md cursor-col-resize select-none ".concat(n),style:{aspectRatio:"16/9"},onClick:e=>{c||m(e.clientX)},children:[(0,s.jsx)("div",{className:"absolute inset-0",children:(0,s.jsx)("img",{src:r,alt:"".concat(o," - after"),className:"w-full h-full object-cover",draggable:!1})}),(0,s.jsx)("div",{className:"absolute inset-0 overflow-hidden",style:{clipPath:"pol
1ygon(0 0, ".concat(i,"% 0, ").concat(i,"% 100%, 0 100%)")},children:(0,s.jsx)("img",{src:t,alt:"".concat(o," - before"),className:"w-full h-full object-cover",draggable:!1})}),(0,s.jsx)("div",{className:"absolute top-0 bottom-0 w-0.5 bg-white shadow-lg z-10 pointer-events-none",style:{left:"".concat(i,"%"),transform:"translateX(-50%)",opacity:c?1:.8,transition:c?"none":"opacity 0.2s ease"}}),(0,s.jsxs)("div",{className:"absolute top-1/2 z-20 w-8 h-8 rounded-full shadow-lg flex items-center justify-center cursor-grab active:cursor-grabbing group ".concat(c?"scale-110":"hover:scale-105"),style:{left:"".concat(i,"%"),transform:"translate(-50%, -50%)",background:"rgba(255, 255, 255, 0.95)",border:"1px solid rgba(0, 0, 0, 0.1)",transition:c?"none":"all 0.2s ease"},onMouseDown:e=>{e.preventDefault(),d(!0),m(e.clientX)},onTouchStart:e=>{e.preventDefault(),d(!0),e.touches.length>0&&m(e.touches[0].clientX)},children:[(0,s.jsxs)("div",{className:"flex items-center justify-center space-x-0.5",children:[(0,s.jsx)("svg",{width:"5",height:"8",viewBox:"0 0 5 8",className:"text-gray-700 group-hover:text-gray-900 transition-colors duration-200",fill:"currentColor",children:(0,s.jsx)("path",{d:"M0 0l5 4-5 4V0z"})}),(0,s.jsx)("svg",{width:"5",height:"8",viewBox:"0 0 5 8",className:"text-gray-700 group-hover:text-gray-900 transition-colors duration-200 rotate-180",fill:"currentColor",children:(0,s.jsx)("path",{d:"M0 0l5 4-5 4V0z"})})]}),c&&(0,s.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/10 animate-pulse pointer-events-none"})]}),(0,s.jsx)("div",{className:"absolute top-4 left-4 bg-black/75 text-white px-2 py-1 rounded text-sm font-medium pointer-events-none transition-all duration-300 ".concat(i<20?"opacity-0 scale-95":"opacity-100 scale-100"),children:"Before"}),(0,s.jsx)("div",{className:"absolute top-4 right-4 bg-black/75 text-white px-2 py-1 rounded text-sm font-medium pointer-events-none transition-all duration-300 ".concat(i>80?"opacity-0 scale-95":"opacity-100 scale-100"),children:"After"})]})}}},e=>{e.O(0,[1062,8046,2499,608,8696,274,4632,4157,5472,2701,5693,4832,4210,7358],()=>e(e.s=25061)),_N_E=e.O()}]);
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.