PageSourceSearch

https://automatic1111.net/_next/static/chunks/4378-4bbf2019b3b16878.js

js automatic1111.net collected 2026-10-01 05:24:00 UTC 136,116 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3430,4378,7785],{5616:(e,t,a)=>{a.d(t,{AN:()=>r,MK:()=>l,OO:()=>o,f9:()=>i,mq:()=>n,rO:()=>s,xh:()=>d});let s="/api/generate-image/result",r=2e3,i=1,n=0xa00000,o=3e5,l=["image/jpeg","image/png","image/webp"],d=["1:1","4:3","3:4","16:9","9:16"]},8805:(e,t,a)=>{a.d(t,{u:()=>n});var s=a(72659),r=a(66766),i=a(55036);let n={ui:{theme:{defaultTheme:"amber",enableSwitch:!0},mode:{defaultMode:"dark",enableSwitch:!0}},metadata:{images:r.K.seo.images,social:"social"in r.K?r.K.social:void 0},features:{enableUpgradeCard:!0,enableUpdateAvatar:!0,enableAffonsoAffiliate:!1,enablePromotekitAffiliate:!1,enableDatafastRevenueTrack:!1,enableCrispChat:!!i.env.NEXT_PUBLIC_CRISP_WEBSITE_ID,enableTurnstileCaptcha:!1,enableChineseLocale:!0},routes:{defaultLoginRedirect:"/prompts"},analytics:{enableVercelAnalytics:!1,enableSpeedInsights:!1},auth:{enableGoogleLogin:!0,enableGoogleOneTap:!0,enableGithubLogin:!1,enableCredentialLogin:!1},i18n:{defaultLocale:r.K.i18n.defaultLocale,locales:Object.fromEntries(Object.entries(r.K.i18n.locales).map(([e,t])=>[e,{flag:t.flag,name:t.name,nativeName:t.nativeName||t.name}]))},blog:{enable:!1,paginationSize:6,relatedPostsSize:3},docs:{enable:!1},mail:{provider:"resend",fromEmail:`${r.K.brand.name} <${r.K.brand.contact.email}>`,supportEmail:r.K.brand.contact.supportEmail},newsletter:{enable:!1,provider:"resend",autoSubscribeAfterSignUp:!0},storage:{enable:!0,provider:"s3"},payment:{provider:"stripe"},price:{plans:{free:{id:"free",disabled:!0,prices:[],isFree:!0,isLifetime:!1,credits:{enable:!0,amount:90,expireDays:30}},basic:{id:"basic",prices:[{type:s.Y.SUBSCRIPTION,priceId:"price_1SlmG6KGgGX1jxhFef1h0Ofr",amount:490,currency:"USD",interval:s.c.WEEK,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1SZLGXKGgGX1jxhFEaB8SNQQ",amount:490,currency:"USD",interval:s.c.WEEK,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1SbhrxKGgGX1jxhFBeP5gxaR",amount:490,currency:"USD",interval:s.c.WEEK,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1TwginKGgGX1jxhFNs23Dl14",amount:990,currency:"USD",interval:s.c.MONTH},{type:s.Y.SUBSCRIPTION,priceId:"price_1SZKOeKGgGX1jxhFLpqGUqUW",amount:990,currency:"USD",interval:s.c.MONTH,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1Sbhs6KGgGX1jxhFPqpMkiDe",amount:990,currency:"USD",interval:s.c.MONTH,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1TwgipKGgGX1jxhFG27tGG07",amount:5880,currency:"USD",interval:s.c.YEAR},{type:s.Y.SUBSCRIPTION,priceId:"price_1SZKOeKGgGX1jxhF0rAYw9BT",amount:5880,currency:"USD",interval:s.c.YEAR,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1SbhsDKGgGX1jxhF3h367sao",amount:5880,currency:"USD",interval:s.c.YEAR,disabled:!0}],isFree:!1,isLifetime:!1,credits:{enable:!0,amount:400,expireDays:30,weekly:{amount:120,expireDays:7},yearly:{amount:4800,expireDays:365}}},pro:{id:"pro",prices:[{type:s.Y.SUBSCRIPTION,priceId:"price_1SlmH0KGgGX1jxhF56iincmM",amount:990,currency:"USD",interval:s.c.WEEK,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1SZLGXKGgGX1jxhFmILou3Il",amount:990,currency:"USD",interval:s.c.WEEK,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1SbhsJKGgGX1jxhFKDG6QemB",amount:990,currency:"USD",interval:s.c.WEEK,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1TwgirKGgGX1jxhFWgOUVLMj",amount:1990,currency:"USD",interval:s.c.MONTH},{type:s.Y.SUBSCRIPTION,priceId:"price_1SZKOeKGgGX1jxhFS2Qq7BgM",amount:1990,currency:"USD",interval:s.c.MONTH,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1SbhsRKGgGX1jxhFB6pZxPVY",amount:1990,currency:"USD",interval:s.c.MONTH,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1TwgisKGgGX1jxhF9IJhhw1X",amount:11880,currency:"USD",interval:s.c.YEAR},{type:s.Y.SUBSCRIPTION,priceId:"price_1SZKOfKGgGX1jxhFVRTo65gw",amount:11880,currency:"USD",interval:s.c.YEAR,disabled:!0},{type:s.Y.SUBSCRIPTION,priceId:"price_1SbhsXKGgGX1jxhFxkkbRrRB",amount:11880,currency:"USD",interval:s.c.YEAR,disabled:!0}],isFree:!1,isLifetime:!1,credits:{enable:!0,amount:1600,expireDays:30,weekly:{amount:480,expireDays:7},yearly:{amount:19200,expireDays:365}}},business:{id:"business",enableTiers:!0,prices:[{type:s.Y.SUBSCRIPTION,priceId:i.env.NEXT_PUBLIC_STRIPE_PRICE_PRO_1X_MONTHLY||"price_1TwgivKGgGX1jxhFxIHQA2h4",amount:3990,currency:"USD",interval:s.c.MONTH,tier:1},{type:s.Y.SUBSCRIPTION,priceId:i.env.NEXT_PUBLIC_STRIPE_PRICE_PRO_1X_YEARLY||"price_1TwgivKGgGX1jxhFY2DS0pt4",amount:23940,currency:"USD",interval:s.c.YEAR,tier:1},{type:s.Y.SUBSCRIPTION,priceId:"price_1TwgiyKGgGX1jxhFGm7QZ3sD",amount:7980,currency:"USD",interval:s.c.MONTH,tier:2},{type:s.Y.SUBSCRIPTION,priceId:"price_1TwgizKGgGX1jxhFm5CsLaHW",amount:47880,currency:"USD",interval:s.c.YEAR,tier:2},{type:s.Y.SUBSCRIPTION,priceId:"price_1Twgj2KGgGX1jxhFaFuwe8ES",amount:11970,currency:"USD",interval:s.c.MONTH,tier:3},{type:s.Y.SUBSCRIPTION,priceId:"price_1Twgj3KGgGX1jxhFeWLOr2TI",amount:71820,currency:"USD",interval:s.c.YEAR,tier:3},{type:s.Y.SUBSCRIPTION,priceId:"price_1Twgj5KGgGX1jxhF3FvFtTHQ",amount:15960,currency:"USD",interval:s.c.MONTH,tier:4},{type:s.Y.SUBSCRIPTION,priceId:"price_1Twgj6KGgGX1jxhFiXrDJebs",amount:95760,currency:"USD",interval:s.c.YEAR,tier:4},{type:s.Y.SUBSCRIPTION,priceId:"price_1Twgj9KGgGX1jxhFOEW53XUz",amount:19950,currency:"USD",interval:s.c.MONTH,tier:5},{type:s.Y.SUBSCRIPTION,priceId:"price_1Twgj9KGgGX1jxhFdJx4CbPq",amount:119700,currency:"USD",interval:s.c.YEAR,tier:5}],isFree:!1,isLifetime:!1,popular:!0,credits:{enable:!0,amount:4800,expireDays:30,yearly:{amount:57600,expireDays:365}},tiers:{1:{multiplier:1,bonusPercentage:0,baseCredits:4800},2:{multiplier:2,bonusPercentage:10,baseCredits:9600},3:{multiplier:3,bonusPercentage:15,baseCredits:14400},4:{multiplier:4,bonusPercentage:20,baseCredits:19200},5:{multiplier:5,bonusPercentage:25,baseCredits:24e3}}},lifetime:{id:"lifetime",disabled:!0,prices:[{type:s.Y.ONE_TIME,priceId:"price_1TwgjDKGgGX1jxhFGovGidxK",amount:19900,currency:"USD",allowPromotionCode:!0}],isFree:!1,isLifetime:!0,credits:{enable:!0,amount:1e3,expireDays:30}}}},credits:{enableCredits:!0,enablePackagesForFreePlan:!1,registerGiftCredits:{enable:!0,amount:20,expireDays:30},packages:{basic:{id:"basic",popular:!1,amount:240,expireDays:365,price:{priceId:"price_1TwgjFKGgGX1jxhFNTGmrm8X",amount:990,currency:"USD",allowPromotionCode:!0}},standard:{id:"standard",popular:!0,amount:960,expireDays:365,price:{priceId:"price_1TwgjIKGgGX1jxhFh4RGsN4U",amount:1990,currency:"USD",allowPromotionCode:!0}},premium:{id:"premium",popular:!1,amount:2880,expireDays:365,price:{priceId:"price_1TwgjKKGgGX1jxhFFrlbBRil",amount:3990,currency:"USD",allowPromotionCode:!0}}}}}},11449:(e,t,a)=>{a.r(t),a.d(t,{BrandVisuals:()=>u});var s=a(55763),r=a(30813),i=a.n(r),n=a(55165),o=a(38456),l=a(1694),d=a(41514),c=a.n(d);let m=[{id:1,src:(0,o.rG)("/images/brand-visuals/shot-1.webp"),alt:"Product Look 1"},{id:2,src:(0,o.rG)("/images/brand-visuals/shot-2.webp"),alt:"Product Look 2"},{id:3,src:(0,o.rG)("/images/brand-visuals/shot-3.webp"),alt:"Product Look 3"},{id:4,src:(0,o.rG)("/images/brand-visuals/shot-4.webp"),alt:"Product Look 4"},{id:5,src:(0,o.rG)("/images/brand-visuals/shot-5.webp"),alt:"Product Look 5"},{id:6,src:(0,o.rG)("/images/brand-visuals/shot-6.webp"),alt:"Product Look 6"}];function u({title:e="Brand-Ready Visuals From One Reference Face",description:t="Blend up to ten reference shots, lock identity, and let Automatic1111 image generator deliver matching outfits, lighting, and props in minutes.",cta:a="Try Automatic1111"}){return(0,s.jsxs)("section",{className:"jsx-1f4d7d5e41d89966 relative w-full overflow-hidden py-16 md:py-24",children:[(0,s.jsxs)("div",{className:"jsx-1f4d7d5e41d89966 container relative z-10 mx-auto px-4",children:[(0,s.jsxs)("div",{className:"jsx-1f4d7d5e41d89966 text-center mb-12 md:mb-16",children:[(0,s.jsx)("h2",{className:"jsx-1f4d7d5e41d89966 text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4 md:mb-6",children:e}),(0,s.jsx)("p",{className:"jsx-1f4d7d5e41d89966 text-muted-foreground text-base md:text-lg max-w-3xl mx-auto leading-relaxed",children:t})]}),(0,s.jsxs)("div",{className:"jsx-1f4d7d5e41d89966 flex justify-center items-center gap-4 md:gap-8 mb-8",children:[(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 relative group",children:(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 w-24 h-24 md:w-32 md:h-32 rounded-2xl overflow-hidden border-2 border-border shadow-xl bg-muted/50 backdrop-blur",children:(0,s.jsx)(l.default,{src:(0,o.rG)("/images/brand-visuals/face-ref.webp"),alt:"Face Reference",width:128,height:128,className:"w-full h-full object-cover",loading:"lazy",decoding:"async",fetchPriority:"low",sizes:"128px"})})}),(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 relative group",children:(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 w-24 h-24 md:w-32 md:h-32 rounded-2xl overflow-hidden border-2 border-border shadow-xl bg-muted/50 backdrop-blur",children:(0,s.jsx)(l.default,{src:(0,o.rG)("/images/brand-visuals/product-ref.webp"),alt:"Product Reference",width:128,height:128,className:"w-full h-full object-cover",loading:"lazy",decoding:"async",fetchPriority:"low",sizes:"128px"})})})]}),(0,s.jsxs)("div",{className:"jsx-1f4d7d5e41d89966 relative flex flex-col items-center mb-8 md:mb-12",children:[(0,s.jsxs)("svg",{viewBox:"0 0 400 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"jsx-1f4d7d5e41d89966 w-full max-w-md h-16 md:h-24",children:[(0,s.jsx)("path",{d:"M100 0 Q100 40 200 60",stroke:"url
1(#gradient1)",strokeWidth:"2",fill:"none",className:"jsx-1f4d7d5e41d89966"}),(0,s.jsx)("path",{d:"M300 0 Q300 40 200 60",stroke:"url(#gradient2)",strokeWidth:"2",fill:"none",className:"jsx-1f4d7d5e41d89966"}),(0,s.jsxs)("defs",{className:"jsx-1f4d7d5e41d89966",children:[(0,s.jsxs)("linearGradient",{id:"gradient1",x1:"0%",y1:"0%",x2:"100%",y2:"100%",className:"jsx-1f4d7d5e41d89966",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#8B5CF6",stopOpacity:"0.5",className:"jsx-1f4d7d5e41d89966"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#06B6D4",stopOpacity:"0.8",className:"jsx-1f4d7d5e41d89966"})]}),(0,s.jsxs)("linearGradient",{id:"gradient2",x1:"100%",y1:"0%",x2:"0%",y2:"100%",className:"jsx-1f4d7d5e41d89966",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#8B5CF6",stopOpacity:"0.5",className:"jsx-1f4d7d5e41d89966"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#06B6D4",stopOpacity:"0.8",className:"jsx-1f4d7d5e41d89966"})]})]})]}),(0,s.jsx)(c(),{href:"/generate",children:(0,s.jsx)(n.$,{size:"lg",className:"px-8 py-3 rounded-xl shadow-lg transition-all duration-300 hover:scale-105",children:a})})]}),(0,s.jsxs)("div",{className:"jsx-1f4d7d5e41d89966 relative overflow-hidden",children:[(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 absolute left-0 top-0 bottom-0 w-16 md:w-32 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none"}),(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 absolute right-0 top-0 bottom-0 w-16 md:w-32 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none"}),(0,s.jsxs)("div",{className:"jsx-1f4d7d5e41d89966 flex animate-scroll-left",children:[m.map(e=>(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 flex-shrink-0 w-48 md:w-64 lg:w-72 mx-2 md:mx-3",children:(0,s.jsxs)("div",{className:"jsx-1f4d7d5e41d89966 relative aspect-[3/4] rounded-2xl overflow-hidden border border-border shadow-2xl group",children:[(0,s.jsx)(l.default,{src:e.src,alt:e.alt,fill:!0,className:"object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy",decoding:"async",fetchPriority:"low",sizes:"(max-width: 768px) 60vw, 18vw"}),(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})},`first-${e.id}`)),m.map(e=>(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 flex-shrink-0 w-48 md:w-64 lg:w-72 mx-2 md:mx-3",children:(0,s.jsxs)("div",{className:"jsx-1f4d7d5e41d89966 relative aspect-[3/4] rounded-2xl overflow-hidden border border-border shadow-2xl group",children:[(0,s.jsx)(l.default,{src:e.src,alt:e.alt,fill:!0,className:"object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy",decoding:"async",fetchPriority:"low",sizes:"(max-width: 768px) 60vw, 18vw"}),(0,s.jsx)("div",{className:"jsx-1f4d7d5e41d89966 absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})},`second-${e.id}`))]})]})]}),(0,s.jsx)(i(),{id:"1f4d7d5e41d89966",children:"@-webkit-keyframes scroll-left{0%{-webkit-transform:translatex(0);transform:translatex(0)}100%{-webkit-transform:translatex(-50%);transform:translatex(-50%)}}@-moz-keyframes scroll-left{0%{-moz-transform:translatex(0);transform:translatex(0)}100%{-moz-transform:translatex(-50%);transform:translatex(-50%)}}@-o-keyframes scroll-left{0%{-o-transform:translatex(0);transform:translatex(0)}100%{-o-transform:translatex(-50%);transform:translatex(-50%)}}@keyframes scroll-left{0%{-webkit-transform:translatex(0);-moz-transform:translatex(0);-o-transform:translatex(0);transform:translatex(0)}100%{-webkit-transform:translatex(-50%);-moz-transform:translatex(-50%);-o-transform:translatex(-50%);transform:translatex(-50%)}}.animate-scroll-left.jsx-1f4d7d5e41d89966{-webkit-animation:scroll-left 30s linear infinite;-moz-animation:scroll-left 30s linear infinite;-o-animation:scroll-left 30s linear infinite;animation:scroll-left 30s linear infinite}.animate-scroll-left.jsx-1f4d7d5e41d89966:hover{-webkit-animation-play-state:paused;-moz-animation-play-state:paused;
1-o-animation-play-state:paused;animation-play-state:paused}"})]})}},13139:(e,t,a)=>{a.d(t,{P:()=>i});var s=a(12194),r=a(67571);function i(e,t,a){let i=(0,r.useRef)({userId:e,open:a});i.current={userId:e,open:a};let n=(0,r.useRef)(!0),o=(0,r.useRef)(null),l=(0,r.useRef)(new Set);return(0,r.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),{startedTask:(0,r.useCallback)(e=>{o.current=e},[]),completedTask:(0,r.useCallback)(async(e,a)=>{if(o.current!==e||l.current.has(e)||!a)return;l.current.add(e);let r=i.current.userId;if(!r)return;let d=await t().catch(()=>null);!(!n.current||r!==i.current.userId||(0,s.Np)())&&(0,s.aZ)({status:d,signedIn:!0,taskId:e,startedTaskId:o.current,alreadyPrompted:!1,resultAvailable:a})&&i.current.open()},[t])}}},17748:(e,t,a)=>{a.d(t,{DT:()=>o,Xn:()=>i,YZ:()=>n});var s=a(8805),r=a(78728);let i=s.u.i18n.defaultLocale,n=Object.keys(s.u.i18n.locales),o=(0,r.A)({locales:n,defaultLocale:i,localeDetection:!1,localeCookie:{name:"NEXT_LOCALE",maxAge:31536e3},localePrefix:"as-needed"})},18172:(e,t,a)=>{a.d(t,{AM:()=>n,Wv:()=>o,hl:()=>l});var s=a(55763);a(67571);var r=a(94152),i=a(40538);function n({...e}){return(0,s.jsx)(r.bL,{"data-slot":"popover",...e})}function o({...e}){return(0,s.jsx)(r.l9,{"data-slot":"popover-trigger",...e})}function l({className:e,align:t="center",sideOffset:a=4,...n}){return(0,s.jsx)(r.ZL,{children:(0,s.jsx)(r.UC,{"data-slot":"popover-content",align:t,sideOffset:a,className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}},24485:(e,t,a)=>{a.d(t,{F:()=>r});var s=a(67571);function r(){return{track:(0,s.useCallback)((e,t)=>{if(window.umami)try{window.umami.track(e,t)}catch(e){console.error("[Umami Track Error]",e)}},[]),identify:(0,s.useCallback)(e=>{if(window.umami)try{window.umami.identify(e)}catch(e){console.error("[Umami Identify Error]",e)}},[])}}},26908:(e,t,a)=>{a.d(t,{Bg:()=>c,t2:()=>d});var s=a(5616),r=a(76601);let i=new Set(s.MK);function n(e){return new Promise((t,a)=>{let s=new FileReader;s.onerror=()=>a(Error("Could not read reference image.")),s.onload=()=>{if("string"!=typeof s.result){a(Error("Could not read reference image."));return}t(s.result)},s.readAsDataURL(e)})}async function o(e){let t;if("string"!=typeof e){let t=e.type.toLowerCase().split(";")[0];if(!i.has(t))throw Error("Free supports JPEG, PNG, and WebP reference images.");if(0===e.size||e.size>s.mq)throw Error("Reference image must be no larger than 10MB.");return n(e)}if(e.startsWith("data:"))return e;try{t=await fetch(e,{credentials:"omit"})}catch{throw Error("Could not load reference image. Please try uploading it again.")}if(!t.ok)throw Error("Could not load reference image. Please try uploading it again.");let a=await t.blob(),r=a.type.toLowerCase().split(";")[0];if(!i.has(r))throw Error("Free supports JPEG, PNG, and WebP reference images.");if(0===a.size||a.size>s.mq)throw Error("Reference image must be no larger than 10MB.");return n(a)}async function l(e,t={}){let a,{skipCompress:s=!1,...i}=t;if("string"==typeof e&&!e.startsWith("data:"))return{url:e,key:""};a=s&&"string"==typeof e?e:(await (0,r.w4)(e,i)).dataUrl;let n=await fetch("/api/upload-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({base64:a})}),o=await n.json();if(!n.ok||!o.success||!o.data?.url||!o.data.key)throw Error(o.error||"Failed to upload image");return{url:o.data.url,key:o.data.key}}async function d(e,t={}){return await Promise.all(e.map(async e=>!function(e){if(e.startsWith("data:"))return!0;try{let t=new URL(e);["automatic1111.net","r2.cloudflarestorage.com","imagedelivery.net"].some(e=>t.hostname.includes(e))}catch{return!0}return!1}(e)?e:(await l(e,t)).url))}async function c(e){if(e.length>s.f9)throw Error("Free supports one reference image at a time.");let t=[];for(let a of e){let e=await o(a),s=await fetch("/api/upload-image?purpose=free-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({base64:e})}),r=await s.json();if(!s.ok||!r.success||"string"!=typeof r.data?.url||"string"!=typeof r.data?.referenceToken)throw Error(r.error||"Failed to upload reference image");t.push({url:r.data.url,referenceToken:r.data.referenceToken})}return t}},30455:(e,t,a)=>{a.d(t,{W:()=>o});var s=a(67571);let r="image_generator_draft",i="image_generator_pending",n="image_generator_login_source";
1function o(){let[e,t]=(0,s.useState)(!1),a=(0,s.useRef)(null),o=(0,s.useCallback)(()=>{try{let e=localStorage.getItem(r);if(!e)return null;let t=JSON.parse(e);if(Date.now()-t.timestamp>864e5)return localStorage.removeItem(r),null;return t}catch(e){return console.error("[GeneratorStorage] Failed to load data:",e),null}},[]),l=(0,s.useCallback)(e=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{try{if(!e.prompt&&0===e.uploadedImages.length){localStorage.removeItem(r);return}let t={...e,timestamp:Date.now()};localStorage.setItem(r,JSON.stringify(t))}catch(e){console.error("[GeneratorStorage] Failed to save data:",e)}},500)},[]),d=(0,s.useCallback)(()=>{try{localStorage.removeItem(r)}catch(e){console.error("[GeneratorStorage] Failed to clear data:",e)}},[]),c=(0,s.useCallback)(e=>{try{if(e){let e=Date.now()+3e5;localStorage.setItem(i,String(e))}else localStorage.removeItem(i)}catch(e){console.error("[GeneratorStorage] Failed to set pending flag:",e)}},[]),m=(0,s.useCallback)(()=>{try{let e=localStorage.getItem(i);if(!e)return!1;localStorage.removeItem(i);let t=Number.parseInt(e,10);if(Date.now()>t)return!1;return!0}catch(e){return console.error("[GeneratorStorage] Failed to check pending flag:",e),!1}},[]),u=(0,s.useCallback)(e=>{try{let t={source:e,expiry:Date.now()+3e5};localStorage.setItem(n,JSON.stringify(t))}catch(e){console.error("[GeneratorStorage] Failed to set login source:",e)}},[]),h=(0,s.useCallback)(()=>{try{let e=localStorage.getItem(n);if(!e)return null;localStorage.removeItem(n);let t=JSON.parse(e);if(Date.now()>t.expiry)return null;return t.source}catch(e){return console.error("[GeneratorStorage] Failed to get login source:",e),null}},[]),p=(0,s.useCallback)(()=>{t(!0)},[]);return(0,s.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),{loadData:o,saveData:l,clearData:d,setPendingGenerate:c,consumePendingGenerate:m,setLoginSource:u,consumeLoginSource:h,isInitialized:e,markInitialized:p}}},33970:(e,t,a)=>{a.d(t,{Avatar:()=>n,AvatarFallback:()=>l,AvatarImage:()=>o});var s=a(55763);a(67571);var r=a(63498),i=a(40538);function n({className:e,...t}){return(0,s.jsx)(r.bL,{"data-slot":"avatar",className:(0,i.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function o({className:e,...t}){return(0,s.jsx)(r._V,{"data-slot":"avatar-image",className:(0,i.cn)("aspect-square size-full",e),loading:"lazy",...t})}function l({className:e,...t}){return(0,s.jsx)(r.H4,{"data-slot":"avatar-fallback",className:(0,i.cn)("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}},34387:(e,t,a)=>{a.d(t,{o:()=>s});let s={userSignup:e=>({name:"user_signup",data:{method:e}}),userLogin:e=>({name:"user_login",data:{method:e}}),userLogout:()=>({name:"user_logout"}),viewPricing:e=>({name:"view_pricing",data:e?{source:e}:void 0}),clickSubscribe:(e,t)=>({name:"click_subscribe",data:{plan:e,interval:t}}),clickBuyCredits:(e,t)=>({name:"click_buy_credits",data:{package:e,amount:t}}),paymentSessionCreated:(e,t)=>({name:"payment_session_created",data:{type:e,sessionId:t}}),paymentCompleted:e=>({name:"payment_completed",data:e}),paymentFailed:e=>({name:"payment_failed",data:{reason:e}}),openImageGenerator:()=>({name:"open_image_generator"}),submitImageGeneration:e=>({name:"submit_image_generation",data:e}),imageGenerationSuccess:(e,t)=>({name:"image_generation_success",data:{requestId:e,duration:t}}),imageGenerationFailed:(e,t)=>({name:"image_generation_failed",data:{requestId:e,error:t}}),downloadImage:e=>({name:"download_image",data:{requestId:e}}),viewCreditsBalance:e=>({name:"view_credits_balance",data:{balance:e}}),insufficientCredits:(e,t)=>({name:"insufficient_credits",data:{required:e,balance:t,deficit:e-t}}),creditsPurchased:(e,t)=>({name:"credits_purchased",data:{amount:e,package:t}}),viewDashboard:()=>({name:"view_dashboard"}),viewImageDetail:e=>({name:"view_image_detail",data:{taskId:e}}),viewMyImages:()=>({name:"view_my_images"}),viewSettings:e=>({name:"view_settings",data:{section:e}}),returnVisit:e=>({name:"return_visit",data:{daysSinceLastVisit:e}})}},34871:(e,t,a)=>{a.d(t,{S:()=>u});var s=a(55763),r=a(55165),i=a(6917),n=a(15638),o=a(13343),l=a(83943),d=a(75393),c=a(61116),m=a(1694);function u({open:e,onOpenChange:t,onExampleSelect:a,examples:u}){let h=(0,c.c3)("promptModal"),{isDesktop:p}=(0,o.U)(),g=u[0]||{id:1,image:"https://automatic1111.net/media/nanobanana2/showcase/optimized/ai-gen-27.webp",prompt:"Three anime schoolgirls on castle balcony at sunset, warm orange sky, peaceful river view",title:"Castle Sunset Scene"},f=()=>{a({prompt:g.prompt,title:g.title}),t(!1)};return p?(0,s.jsx)(i.lG,{open:e,onOpenChange:t,children:(0,s.jsxs)(i.Cf,{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto overscroll-contain sm:max-w-[600px]",children:[(0,s.jsxs)(i.c7,{children:[(0,s.jsxs)(i.L3,{className:"flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"w-5 h-5 text-blue-500"}),h("title")]}),(0,s.jsx)(i.rr,{children:h("description")})]}),(0,s.jsxs)("div",{className:"space-y-4 p-4",children:[(0,s.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 rounded-lg p-4 border border-blue-200 dark:border-blue-800",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(d.A,{className:"w-5 h-5 text-blue-600 dar
1k:text-blue-400 mt-0.5"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:h("suggestionTitle")}),(0,s.jsx)("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:h.raw("suggestions").map((e,t)=>(0,s.jsxs)("li",{children:["• ",e]},t))})]})]})}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"font-medium text-sm",children:h("examplePrompts")}),(0,s.jsxs)("div",{className:"relative border-2 border-primary/30 hover:border-primary/60 rounded-lg p-4 cursor-pointer transition-colors bg-slate-50 dark:bg-slate-800",onClick:f,children:[(0,s.jsxs)("div",{className:"mb-3 relative",children:[(0,s.jsx)("div",{className:"aspect-video rounded-lg overflow-hidden border",children:(0,s.jsx)(m.default,{src:g.image,alt:g.title,width:600,height:338,className:"w-full h-full object-cover",unoptimized:!0})}),(0,s.jsx)("div",{className:"absolute bottom-2 left-2 bg-primary/90 text-primary-foreground text-xs px-3 py-1.5 rounded-md shadow-lg",children:g.title})]}),(0,s.jsx)("div",{className:"text-center",children:(0,s.jsxs)("div",{className:"text-xs text-muted-foreground bg-white dark:bg-slate-700 p-3 rounded border",children:['"',g.prompt,'"']})})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$,{variant:"outline",className:"flex-1",onClick:()=>t(!1),children:h("selfInput")}),(0,s.jsxs)(r.$,{className:"flex-1",onClick:f,children:[(0,s.jsx)(d.A,{className:"w-4 h-4 mr-2"}),h("useExample")]})]})]})]})}):(0,s.jsx)(n._s,{open:e,onOpenChange:t,children:(0,s.jsxs)(n.zj,{className:"max-h-[85vh] w-full",children:[(0,s.jsxs)(n.BE,{className:"text-left flex-shrink-0",children:[(0,s.jsxs)(n.gk,{className:"flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"w-5 h-5 text-blue-500 flex-shrink-0"}),(0,s.jsx)("span",{className:"break-words",children:h("title")})]}),(0,s.jsx)(n.I6,{className:"break-words",children:h("description")})]}),(0,s.jsxs)("div",{className:"px-4 space-y-4 overflow-y-auto flex-1 min-h-0 overflow-x-hidden",children:[(0,s.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 rounded-lg p-3 border border-blue-200 dark:border-blue-800",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(d.A,{className:"w-4 h-4 text-blue-600 dark:text-blue-400 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-sm text-blue-900 dark:text-blue-100 mb-1",children:h("suggestionTitle")}),(0,s.jsx)("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-0.5",children:h.raw("suggestions").map((e,t)=>(0,s.jsxs)("li",{children:["• ",e]},t))})]})]})}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"font-medium text-sm",children:h("examplePrompts")}),(0,s.jsx)("div",{className:"border-2 border-primary/30 rounded-lg p-3 cursor-pointer transition-colors bg-slate-50 dark:bg-slate-800",onClick:f,children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"font-medium text-sm mb-1",children:g.title}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground line-clamp-2",children:['"',g.prompt,'"']})]})})]})]}),(0,s.jsxs)(n.tb,{className:"pt-3 flex-shrink-0",children:[(0,s.jsxs)(r.$,{className:"w-full",onClick:f,children:[(0,s.jsx)(d.A,{className:"w-4 h-4 mr-2"}),h("useExample")]}),(0,s.jsx)(n.cp,{asChild:!0,children:(0,s.jsx)(r.$,{variant:"outline",className:"w-full",children:h("selfInput")})})]})]})})}a(67571)},36828:(e,t,a)=>{a.d(t,{K$:()=>o,TO:()=>d,gh:()=>c,j_:()=>i});var s=a(35753),r=a(5616);class i extends Error{constructor(e,t){super(e),this.name="FreeImageClientError",this.code=t}}async function n(e){let t=await e.json().catch(()=>null);if(!t)throw new i("The image service returned an invalid response.");return t}async function o({prompt:e,aspectRatio:t,freeReferenceTokens:a=[]}){let r=await (0,s.th)("/api/generate-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedModel:"free",prompt:e,aspectRatio:t,freeReferenceTokens:a})}),o=await n(r);if(!r.ok||!o.success)throw new i(o.error||"Failed to generate image.",o.code);return o}async function l(e){let t=await (0,s.th)(`/api/generate-image/status?taskId=${encodeURIComponent(e)}`),a=await n(t);if(!t.ok||!a.success)throw new i(a.error||"Image generation failed.",a.code);return a}
1async function d({taskId:e,signal:t,timeoutMs:a=r.OO}){let s=Date.now();for(;Date.now()-s<=a;){await function(e,t){return new Promise((e,a)=>{if(t?.aborted){a(new DOMException("The operation was aborted.","AbortError"));return}let s=window.setTimeout(e,5e3);t?.addEventListener("abort",()=>{window.clearTimeout(s),a(new DOMException("The operation was aborted.","AbortError"))},{once:!0})})}(0,t);let a=await l(e);if(a.data?.status==="completed"&&a.data.images.length>0)return a;if(a.data?.status==="failed")throw new i(a.error||"Image generation failed.",a.code)}throw new i("Image generation timed out. Please try again.","TIMEOUT")}async function c(e,t){let a=await (0,s.th)(t||`${r.rO}?taskId=${encodeURIComponent(e)}`);if(!a.ok){let e=await a.json().catch(()=>null);throw new i(e?.error||"Could not load the generated image.",e?.code)}let n=a.headers.get("content-type")?.split(";")[0];if("image/jpeg"!==n&&"image/png"!==n&&"image/webp"!==n)throw new i("The image service returned an unsupported format.");return a.blob()}},40538:(e,t,a)=>{a.d(t,{cn:()=>i});var s=a(8690),r=a(39282);function i(...e){return(0,r.QP)((0,s.$)(e))}},42302:(e,t,a)=>{a.r(t),a.d(t,{default:()=>x});var s=a(55763),r=a(24915),i=a(87998),n=a(55165),o=a(47337);let l={0:"Create a hyper-realistic, ultra-sharp, full-color large-format image featuring a massive group of celebrities from different eras standing together in a grand, elaborately decorated ballroom. The photograph should have the quality and detail of a high-end fashion editorial or a Vanity Fair Hollywood issue cover. Include diverse lighting setups that highlight each individual while maintaining overall scene coherence. Every face should be instantly recognizable with perfect skin texture, authentic expressions, and accurate period-appropriate styling.",1:"2000s Mirror Selfie aesthetic: Subject wearing low-rise jeans with butterfly clips and frosted lip gloss. Accessories include chunky plastic jewelry and a flip phone. Photography style features direct flash, mirror reflection, bathroom setting with Y2K decor. Background shows typical 2000s bathroom tiles and personal items scattered on counter.",2:"Create a glamorous photoshoot in the style of Victoria's Secret backstage moments. Feature a stunning model with flawless hair and makeup being attended by a makeup artist adding final touches. The model wears an elaborate crystal-encrusted corset with angel wings visible in the background. Lighting should be warm and flattering with strategic rim lighting highlighting hair and skin.",3:"Create a portrait of a beautiful young woman with 
1natural features captured with a 1990s camera using direct front flash. The subject has effortlessly styled hair and minimal makeup with a genuine smile. Dark background with visible magazine posters and typical 90s bedroom decor. Include film grain, slight vignetting, and the imperfect charm of amateur photography.",4:"Professional headshot of a tech executive in navy blue suit against dark gray studio background. Shot with Sony A7III 85mm f/1.4 lens with three-point lighting setup including key light at 45 degrees, fill light opposite, and hair light from behind. The subject has confident but approachable expression, perfect for LinkedIn or company website.",5:"Cinematic, emotional portrait shot on Kodak Portra 400 film. Golden Hour lighting streaming through coffee shop window creating warm, nostalgic atmosphere. Subject in contemplative pose with natural expression, caught in a moment of genuine emotion. Include characteristic film grain, soft focus on background, and the distinctive color rendering of Portra film.",6:"A Where's Waldo style image showing hundreds of Star Wars characters gathered on Tatooine. Include characters from all eras - original trilogy, prequels, sequels, and animated series. Each character should be recognizable with accurate costumes and proportions. The scene should be incredibly dense and detailed.",7:"Generate a series showing the same person aging from childhood through 80 years old in holiday photo style. Each image should maintain consistent facial features while showing natural aging progression. Include peri
1od-appropriate clothing and hairstyles for each decade.",8:"Recursive image of an orange tabby cat sitting in an office chair holding an iPad. The iPad screen shows the same image of the cat holding an iPad, which shows the same image again, creating an infinite recursive loop. Each level of recursion should be clearly visible with decreasing size but maintained detail.",9:"Create a photo of Miyamoto Musashi in prayer pose drawn on a glass whiteboard using slightly faded green dry-erase marker. The drawing should have the characteristic look of whiteboard art - slight smudging, variable line thickness, and the translucent quality of marker on glass.",10:"Based on this 2D floor plan, generate a professional interior design presentation board. Include multiple perspective renderings showing different angles of the space, a refined 3D floor plan view, material and finish swatches, furniture selections, and lighting plan.",11:"Transform this portrait into a cute 3D Pop Mart style blind box character. Use C4D rendering aesthetic with smooth plastic-like skin, oversized head proportions, and simplified cute features. Include pastel color palette, soft ambient lighting, and the collectible figure aesthetic.","showcase-01":"Create a hyper-realistic, ultra-sharp, full-color large-format image featuring a massive group of celebrities from different eras standing together in a grand, elaborately decorated ballroom. The photograph should have the quality and detail of a high-end fashion editorial or a Vanity Fair Hollywood issue cover. Include diverse lighting setups that highlight each individual while maintaining overall scene coherence. Every face should be instantly recognizable with perfect skin texture, authentic expressions, and accurate period-appropriate styling. The composition should feel like an impossible gathering captured by Annie Leibovitz, with rich colors, dramatic shadows, and the kind of attention to fabric, jewelry, and environmental detail that would make this suitable for gallery exhibition.","showcase-02":"2000s Mirror Selfie aesthetic: Subject wearing low-rise jeans with butterfly clips and frosted lip gloss. Accessories include chunky plastic jewelry and a flip phone. Photography style features direct flash, mirror reflection, bathroom setting with Y2K decor. Background shows typical 2000s bathroom tiles and personal items scattered on counter.","showcase-03":"Create a glamorous photoshoot in the style of Victoria's Secret backstage moments. Feature a stunning model with flawless hair and makeup being attended by a makeup artist adding final touches. The model wears an elaborate crystal-encrusted corset with angel wings visible in the background. Lighting should be warm and flattering with strategic rim lighting highlighting hair and skin. Include backstage elements like makeup stations, mirrors with bulb lighting, and the excitement of a major fashion show. The image should capture that perfect moment of anticipation before walking the runway.","showcase-04":"Create a portrait of a beautiful young woman with 
1natural features captured with a 1990s camera using direct front flash. The subject has effortlessly styled hair and minimal makeup with a genuine smile. Dark background with visible magazine posters and typical 90s bedroom decor. The flash creates that characteristic flat lighting with slight red-eye and the slightly washed-out color palette typical of disposable cameras from that era. Include film grain, slight vignetting, and the imperfect charm of amateur photography.","showcase-05":"Professional headshot of a tech executive in navy blue suit against dark gray studio background. Shot with Sony A7III 85mm f/1.4 lens with three-point lighting setup including key light at 45 degrees, fill light opposite, and hair light from behind. The subject has confident but approachable expression, perfect for LinkedIn or company website. Subtle rim lighting separates subject from background. Color grade should be clean and professional with natural skin tones.","showcase-06":"Cinematic, emotional portrait shot on Kodak Portra 400 film. Golden Hour lighting streaming through coffee shop window creating warm, nostalgic atmosphere. Subject in contemplative pose with natural expression, caught in a moment of genuine emotion. Include characteristic film grain, soft focus on background, and the distinctive color rendering of Portra film. Warm tones should dominate with subtle greens in shadows.","showcase-07":"A Where's Waldo style image showing hundreds of Star Wars characters gathered on Tatooine. Include characters from all eras - original trilogy, prequels, sequels, and animated series. Each character should be recognizable with accurate costumes and proportions. The scene should be incredibly dense and detailed, with characters in various poses and interactions. Include iconic locations like the Cantina, moisture farms, and Jabba's Palace in the background. The challenge should be finding specific rare characters hidden among the crowd.","showcase-08":"Generate a series showing the same person aging from childhood through 80 years old in holiday photo style. Each image should maintain consistent facial features while showing natural aging progression. Include peri
1od-appropriate clothing and hairstyles for each decade. Background should suggest different eras through furniture, decorations, and photo quality. The sequence should feel like looking through a family photo album spanning eight decades.","showcase-09":"Recursive image of an orange tabby cat sitting in an office chair holding an iPad. The iPad screen shows the same image of the cat holding an iPad, which shows the same image again, creating an infinite recursive loop. Each level of recursion should be clearly visible with decreasing size but maintained detail. The cat should have a slightly confused or amused expression. Office environment with modern desk setup visible in background.","showcase-10":"Photorealistic visualization of coordinates 35.6586\xb0 N, 139.7454\xb0 E at 19:00 local time. This location should show the iconic Tokyo cityscape at dusk, with the transition from day to night creating a magical atmosphere. Include recognizable landmarks, the glow of city lights beginning to illuminate, and the characteristic urban density of Tokyo. The image should feel like standing at that exact location at that precise moment.","showcase-11":"How engineers see the Golden Gate Bridge: A detailed technical visualization showing the bridge's structural elements, force vectors, load distribution, stress points, and engineering annotations. Include cross-sections of cables, tower foundations, and deck structure. Overlay technical diagrams, measurements, and physics equations. The image should blend photorealistic rendering with technical illustration style, revealing the hidden engineering marvel beneath the iconic landmark.","showcase-12":"Create a photo of Miyamoto Musashi in prayer pose drawn on a glass whiteboard using slightly faded green dry-erase marker. The drawing should have the characteristic look of whiteboard art - slight smudging, variable line thickness, and the translucent quality of marker on glass. Include realistic reflections on the glass surface and typical office environment visible through the board. The artistic style should blend traditional Japanese ink painting techniques with the casual medium of whiteboard sketching.","showcase-13":"Create a hyper-realistic fashion photography image combining a garment flatlay with a professional model. The clothing should drape naturally on the model's body with accurate fabric physics - maintaining original texture, pattern alignment, and material properties. Lighting should integrate seamlessly between the original garment photo and the model shot. Include subtle shadows, fabric creases, and the way light interacts with different materials. The result should be indistinguishable from an actual photoshoot.","showcase-14":"E-commerce product photography: Cleanly extract product and place on pure white background with soft studio lighting. Include subtle shadow beneath product for grounding. Lighting should reveal product texture and form without harsh highlights or deep shadows. Color accuracy is paramount - the product should appear exactly as it would in person. Multiple angles might be suggested through subtle reflection.","showcase-15":"Convert this whiteboard sketch into a professional corporate flowchart in McKinsey-style presentation quality. Use clean grid alignment, consistent spacing, and sans-serif fonts. Include proper hierarchy with executive summary boxes, decision diamonds, and process rectangles. Color scheme should be professional blues and grays with accent colors for key points. Add subtle shadows and gradients for depth while maintaining corporate clarity.","showcase-16":"Transform this wireframe sketch into a high-fidelity UI design mockup for a mobile app. Apply iOS 18 or Material Design 3 aesthetics with proper spacing, typography hierarchy, and interactive element styling. Include realistic content, proper iconography, and platform-appropriate navigation patterns. The design should feel production-ready with attention to accessibility, touch targets, and visual consistency.","showcase-17":"Put this entire text verbatim into a photo of a glossy magazine article on a desk. The magazine should be open to a beautifully designed spread with the text flowing naturally around high-quality photographs. Include pull quotes, drop caps, and professional typography design. The physical magazine should show realistic paper texture, slight page curl, and ambient lighting suggesting a cozy reading environment.","showcase-18":"Zoom out and expand this image to 16:9 aspect ratio with seamless scenery extension. Maintain consistent lighting direction, color temperature, and atmospheric conditions. Extended areas should include contextually appropriate elements that enhance the composition without distracting from the original subject. Texture matching should be pixel-perfect at boundaries.","showcase-19":"Remove all tourists and people from the background while maintaining architectural and environmental integrity. Intelligently fill removed areas with consistent textures, patterns, and lighting. The result should look like the location at opening time before any visitors arrived. Preserve all original shadows and reflections that don't belong to removed people.","showcase-20":"Based on this 2D floor plan, generate a professional interior design presentation board. Include multiple perspective renderings showing different angles of the space, a refined 3D floor plan view, material and finish swatches, furniture selections, and lighting plan. The presentation should be suitable for client review with annotations explaining design decisions.","showcase-21":"Design a viral YouTube thumbnail with an excited and surprised expression, dynamic pointing gesture toward the side, bold arrow graphics, and attention-grabbing text overlay. Use high contrast colors, dramatic lighting on face, and the slightly exaggerated style typical of successful YouTube thumbnails. Include subtle glow effects and ensure the image reads well at small sizes.","showcase-22":"Professional promotional poster featuring a steaming cup of cappuccino with elegant gold typography overlay announcing a limited-time offer. Include realistic steam wisps, rich coffee colors, and luxurious atmosphere. The badge design should feel premium with metallic effects. Typography should be sophisticated yet readable with clear hierarchy between headline and details.","showcase-23":"Transform this portrait into a cute 3D Pop Mart style blind box character. Use C4D rendering aesthetic with smooth plastic-like skin, oversized head proportions, and simplified cute features. Include pastel color palette, soft ambient lighting, and the collectible figure aesthetic. The character should maintain recognizable features while achieving the distinctive blind box toy style.","showcase-24":"Turn this pet photo into a funny hand-drawn WeChat sticker style image with exaggerated expression and messy handwritten Chinese text. The style should be intentionally crude and charming, like a quickly sketched meme. Include wobbly lines, imperfect coloring, and the DIY aesthetic that makes these stickers so shareable.","showcase-25":"创建 9 张令人惊艳的时尚摄影作品,风格仿佛出自获奖时尚杂志大片。使用此参考图像作为品牌风格,但在系列图中添加细微差别和多样性,能够传达出专业的设计感。请逐张生成九张图像。",12:"Create 9 stunning fashion photography images in the style of award-winning fashion magazine spreads. Use this reference image as the brand style, but add subtle variations and diversity across the series to convey a professional design sense. Generate nine images one by one."};var d=a(38456),c=a(41514),m=a.n(c),u=a(67571),h=a(3020),p=a(96429);let g={[`${d.WL}/images/examples/example-05.webp`]:{fallback:`${d.WL}/images/examples/example-05-960w.webp`,srcSet:`${d.WL}/images/examples/example-05-640w.webp 640w, ${d.WL}/images/examples/example-05-960w.webp 960w, ${d.WL}/images/examples/example-05.webp 1400w`},[`${d.WL}/images/showcase/showcase-13.webp`]:{fallback:`${d.WL}/images/showcase/showcase-13-960w.webp`,srcSet:`${d.WL}/images/showcase/showcase-13-640w.webp 640w, ${d.WL}/images/showcase/showcase-13-960w.webp 960w, ${d.WL}/images/showcase/showcase-13.webp 1400w`}},f=e=>{if(e)return g[(0,d.rG)(e)]||g[e]};function x({showcase:e}){if(e.disabled)return null;let t=e.mode||"video",a="video"===t?e.videos:e.images,[o,l]=(0,u.useState)(!1),[d,c]=(0,u.useState)(!1),p=(0,u.useRef)(null);(0,u.useEffect)(()=>{let e=p.current;if(!e)return;let t=new IntersectionObserver(e=>
1{e.forEach(e=>{e.isIntersecting&&l(!0)})},{rootMargin:"200px 0px 200px 0px",threshold:.15});return t.observe(e),()=>t.disconnect()},[]),(0,u.useEffect)(()=>{if(!o)return;let e=window.setTimeout(()=>c(!0),200);return()=>window.clearTimeout(e)},[o]);let g=a?.slice(0,4)??[],f=d?a:g;return(0,s.jsx)("section",{id:e.name,ref:p,className:"pt-16 pb-24 bg-gradient-to-b from-background to-muted/20",children:(0,s.jsxs)("div",{className:"container",children:[(0,s.jsxs)("div",{className:"text-center mb-12",children:[e.label&&(0,s.jsx)(r.A,{direction:"up",children:(0,s.jsx)(i.E,{className:"text-xs font-medium mb-4",children:e.label})}),e.title&&(0,s.jsx)(r.A,{direction:"up",delay:.1,children:(0,s.jsx)("h2",{className:"text-4xl font-semibold lg:text-5xl",children:e.title})}),e.description&&(0,s.jsx)(r.A,{direction:"up",delay:.2,children:(0,s.jsx)("p",{className:"mt-4 text-muted-foreground lg:text-lg",children:e.description})})]}),(0,s.jsx)("div",{className:"columns-1 gap-6 sm:columns-2 lg:columns-3",children:f?.map((e,a)=>s.jsx(w,{item:e,index:a,mode:t,fetchPriority:d?"auto":"low"},a))}),!e.hideExploreButton&&(0,s.jsx)(r.A,{direction:"up",delay:.3,children:(0,s.jsx)("div",{className:"flex justify-center mt-12",children:(0,s.jsx)(n.$,{asChild:!0,size:"lg",variant:"outline",className:"group",children:(0,s.jsxs)(m(),{href:"/gallery",prefetch:!1,children:["Explore More Prompts",(0,s.jsx)(h.D8V,{className:"ml-2 w-4 h-4 transition-transform group-hover:translate-x-1"})]})})})})]})})}let b=(e,t)=>{if(t)return t;let a=e.lastIndexOf(".");if(-1===a)return;let s=`${e.slice(0,a)}-poster.webp`;if(!/\.(webm|mp4|mov|mkv)$/i.test(s))return s};function w({item:e,index:t,mode:a,fetchPriority:i}){let[d,c]=(0,u.useState)(!1),[m,g]=(0,u.useState)(!1),[x,w]=(0,u.useState)(!1),v=l[String(t)]||"",y=async e=>{if(e.stopPropagation(),v)try{await navigator.clipboard.writeText(v),p.o.success("Prompt copied to clipboard")}catch(e){console.error("Failed to copy:",e),p.o.error("Failed to copy")}},j="video"===a?b(e.src,e.poster):e.thumbnail||e.src||e.before,N=f(j),k=N?.fallback??j,I=N?.srcSet;return(0,u.useEffect)(()=>{let e=window.matchMedia("(prefers-reduced-data: reduce)"),t=!!e&&e.matches,a="undefined"!=typeof navigator?navigator.connection??navigator.mozConnection??navigator.webkitConnection:void 0,s=!!a?.saveData,r=a?.effectiveType,i=void 0!==r&&["slow-2g","2g","3g"].includes(r);g(t||s||i),w(window.matchMedia("(pointer: coarse)").matches)},[]),(0,s.jsx)(r.A,{direction:"up",delay:.05+.01*t,children:(0,s.jsxs)("article",{className:"relative mb-6 break-inside-avoid overflow-hidden rounded-2xl bg-black/60 ring-1 ring-white/5 shadow-lg transition duration-300 hover:-translate-y-1 hover:shadow-2xl",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:["video"===a?"video"===a&&!m&&(x||d)?(0,s.jsx)(o.Y,{src:e.src,poster:j,className:"h-full w-full object-cover",loop:!0,muted:!0,playsInline:!0,autoPlay:!0,playOnHover:!0,rootMargin:"0px 0px -35% 0px",threshold:.8}):j?(0,s.jsx)("img",{src:k,alt:e.title??"Showcase video placeholder",className:"h-full w-full object-cover",loading:"lazy",decoding:"async",sizes:"(max-width: 768px) 100vw, 50vw",srcSet:I}):(0,s.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-muted/70",children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"Preview"})}):(0,s.jsx)("img",{src:k,alt:e.title??"Showcase image",className:"w-full h-auto object-cover",loading:"lazy",decoding:"async",sizes:"(max-width: 768px) 100vw, 50vw",fetchPriority:i,srcSet:I}),(0,s.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-b from-transparent via-black/10 to-black/40"}),e.title&&(0,s.jsx)("div",{className:"pointer-events-none absolute left-3 top-3 z-20 rounded-full bg-black/60 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-white/90 backdrop-blur",children:e.title}),"image"===a&&v&&(0,s.jsx)("div",{className:`absolute bottom-0 left-0 right-0 z-20 bg-gradient-to-t from-black/90 via-black/70 to-transparent transition-all duration-300 ${d?"opacity-100 translate-y-0":"opacity-0 translate-y-3"}`,children:(0,s.jsxs)("div",{className:"p-4 pt-10",children:[(0,s.jsx)("p",{className:"mb-3 line-clamp-2 text-sm text-white/90",children:v}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(n.$,{variant:"outline",size:"sm",onClick:y,className:"border-white/20 bg-white/10 text-white hover:bg-white/20 hover:text-white",children:[(0,s.jsx)(h.NGz,{className:"mr-1.5 h-4 w-4"}),"Copy"]}),(0,s.jsxs)(n.$,{size:"sm",onClick:t=>{if(t.stopPropagation(),!v)return;let a=e.src||e.thumbnail||"",s=new URLSearchParams({prompt:v});if(a){let e=a;a.startsWith("/")&&(e=`${window.location.origin}${a}`),s.set("image",e)}{let{pathname:e,search:t}=window.location;window.location.hash&&window.history.replaceState(null,"",`${e}${t}`),window.location.hash=`image-generator?${s.toString()}`,requestAnimationFrame(()=>{let e=document.getElementById("image-generator");e?.scrollIntoView({behavior:"smooth",block:"start"})})}},className:"border-0 bg-primary text-primary-foreground hover:bg-primary/90",children:[(0,s.jsx)(h.M5s,{className:"mr-1.5 h-4 w-4"}),"Generate"]})]})]})})]})})}},46074:(e,t,a)=>{a.r(t),a.d(t,{default:()=>b});var s=a(55763),r=a(33970),i=a(67571),n=a(47872),o=a(40538);
1a(55165);let l=i.createContext(null);function d(){let e=i.useContext(l);if(!e)throw Error("useCarousel must be used within a <Carousel />");return e}function c({orientation:e="horizontal",opts:t,setApi:a,plugins:r,className:d,children:c,...m}){let[u,h]=(0,n.A)({...t,axis:"horizontal"===e?"x":"y"},r),[p,g]=i.useState(!1),[f,x]=i.useState(!1),b=i.useCallback(e=>{e&&(g(e.canScrollPrev()),x(e.canScrollNext()))},[]),w=i.useCallback(()=>{h?.scrollPrev()},[h]),v=i.useCallback(()=>{h?.scrollNext()},[h]),y=i.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),w()):"ArrowRight"===e.key&&(e.preventDefault(),v())},[w,v]);return i.useEffect(()=>{h&&a&&a(h)},[h,a]),i.useEffect(()=>{if(h)return b(h),h.on("reInit",b),h.on("select",b),()=>{h?.off("select",b)}},[h,b]),(0,s.jsx)(l.Provider,{value:{carouselRef:u,api:h,opts:t,orientation:e||(t?.axis==="y"?"vertical":"horizontal"),scrollPrev:w,scrollNext:v,canScrollPrev:p,canScrollNext:f},children:(0,s.jsx)("div",{onKeyDownCapture:y,className:(0,o.cn)("relative",d),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...m,children:c})})}function m({className:e,...t}){let{carouselRef:a,orientation:r}=d();return(0,s.jsx)("div",{ref:a,className:"overflow-hidden","data-slot":"carousel-content",children:(0,s.jsx)("div",{className:(0,o.cn)("flex","horizontal"===r?"-ml-4":"-mt-4 flex-col",e),...t})})}function u({className:e,...t}){let{orientation:a}=d();return(0,s.jsx)("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:(0,o.cn)("min-w-0 shrink-0 grow-0 basis-full","horizontal"===a?"pl-4":"pt-4",e),...t})}var h=a(24915),p=a(83438),g=a(86295),f=a(4129),x=a(5014);function b({section:e}){if(e.disabled)return null;let t=(0,i.useRef)((0,f.A)({startDelay:1e3,speed:1.5,stopOnInteraction:!1}));return(0,s.jsxs)("section",{id:e.name,className:"py-16",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[e.label&&(0,s.jsx)(h.A,{direction:"up",children:(0,s.jsxs)("div",{className:"flex items-center gap-1 text-sm font-semibold text-primary",children:[e.icon&&(0,s.jsx)(p.A,{name:e.icon,className:"h-6 w-auto border-primary"}),e.label]})}),(0,s.jsx)(h.A,{direction:"up",delay:.05,children:(0,s.jsx)("h2",{className:"text-center text-3xl font-semibold lg:text-4xl",children:e.title})}),(0,s.jsx)(h.A,{direction:"up",delay:.1,children:(0,s.jsx)("p",{className:"text-center text-muted-foreground lg:text-lg",children:e.description})})]}),(0,s.jsx)("div",{className:"container",children:(0,s.jsx)(h.A,{direction:"up",delay:.15,children:(0,s.jsx)("div",{className:"mt-16 space-y-4",children:(0,s.jsx)(c,{opts:{loop:!0},plugins:[t.current],className:"relative before:absolute before:bottom-0 before:left-0 before:top-0 before:z-10 before:w-36 before:bg-gradient-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-gradient-to-l after:from-background after:to-transparent",children:(0,s.jsx)(m,{children:e.items?.map((e,t)=>s.jsx(u,{className:"basis-[min(22rem,calc(100vw-3rem))] sm:basis-auto",children:s.jsxs(g.Zp,{className:"w-full max-w-[min(24rem,calc(100vw-3rem))] select-none p-6 sm:max-w-96",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsxs("div",{className:"mb-4 flex gap-4",children:[s.jsx(r.Avatar,{className:"size-14 rounded-full ring-1 ring-input",children:s.jsx(r.AvatarImage,{src:e.image?.src,alt:e.image?.alt||e.title})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:e.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e.label})]})]}),s.jsx("div",{className:"flex gap-1",children:Array.from({length:5}).map((e,t)=>s.jsx(x.A,{className:"size-5 fill-amber-500 text-amber-500"},t))})]}),s.jsx("q",{className:"leading-7 text-muted-foreground",children:e.description})]})},t))})})})})})]})}},47070:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});var s=a(55763),r=a(45124),i=a(61116);function n({section:e}={}){let t=(0,i.c3)("HomePage.stats"),a=e?.items??[{value:t("items.item-1.value"),title:t("items.item-1.title")},{value:t("items.item-2.value"),title:t("items.item-2.title")},{value:t("items.item-3.value"),title:t("items.item-3.title")}];return(0,s.jsx)("section",{id:"stats",className:"px-4 py-16",children:(0,s.jsxs)("div",{className:"mx-auto max-w-5xl px-6 space-y-8 md:space-y-16",children:[(0,s.jsx)(r.V,{title:e?.title??t("title"),subtitle:e?.subtitle??t("subtitle"),subtitleAs:"h2",description:e?.description??t("description"),descriptionAs:"p"}),(0,s.jsx)("div",{className:"grid gap-12 divide-y-0 *:text-center md:grid-cols-3 md:gap-2 md:divide-x",children:a.map(e=>(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"text-5xl font-bold text-foreground",children:e.value}),(0,s.jsx)("p",{children:e.title})]},e.title))})]})})}},57158:(e,t,a)=>{a.d(t,{default:()=>n});var s=a(55763),r=a(40538),i=a(67571);let n=function({children:e,fallback:t=(0,s.jsx)("div",{className:"h-80 w-full rounded-3xl bg-muted/30 animate-pulse"}),className:a,rootMargin:n,threshold:o=.1,once:l=!0,forwardedRef:d,minHeight:c}){let m=(0,i.useRef)(null),u=d??m,[h,p]=(0,i.useState)(!1),[g,f]=(0,i.useState)(null),[x,b]=(0,i.useState)(n??"100px 0px 100px 0px");(0,i.useEffect)(()=>
1{if(n){b(n);return}b(window.innerWidth<768?"50px 0px 50px 0px":"100px 0px 100px 0px")},[n]);let w=(0,i.useRef)(null),v=(0,i.useCallback)(()=>{if(w.current&&h){let e=w.current.offsetHeight;e>0&&f(e)}},[h]);(0,i.useEffect)(()=>{let e=u.current;if(!e)return;let t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(p(!0),l&&t.disconnect()):l||p(!1)})},{rootMargin:x,threshold:o});return t.observe(e),()=>t.disconnect()},[l,x,u,o]),(0,i.useEffect)(()=>{if(!h||!w.current)return;let e=new ResizeObserver(()=>{v()});return e.observe(w.current),v(),()=>e.disconnect()},[h,v]);let y={};return c&&(y.minHeight="number"==typeof c?`${c}px`:c),g&&h&&(y.minHeight=`${g}px`),(0,s.jsx)("div",{ref:u,className:(0,r.cn)("w-full",a),style:y,children:h?(0,s.jsx)("div",{ref:w,children:"function"==typeof e?e():e}):t})}},64842:(e,t,a)=>{a.d(t,{$_:()=>i,VG:()=>o,lx:()=>l,zM:()=>n});var s=a(17748);let r="https://automatic1111.net";function i(){return r}function n(e,t){var a;if(!((a=t)&&a!==s.DT.defaultLocale&&"default"!==a))return e;try{let a=new URL(e),s=a.searchParams.get("callbackURL");if(s&&!s.match(RegExp(`^/${t}(/|$)`))){let e=s.startsWith("/")?`/${t}${s}`:`/${t}/${s}`;a.searchParams.set("callbackURL",e)}return a.toString()}catch(t){return e}}function o(e){return e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("/")?`${r}${e}`:`${r}/${e}`}function l(e){return`https://dashboard.stripe.com/customers/${e}`}},66766:(e,t,a)=>{a.d(t,{K:()=>s});let s={version:"1.0.0",lastUpdated:"2026-07-24",brand:{name:"Automatic1111",shortName:"Automatic1111",tagline:{en:"AI Image & Video Generator"},description:{en:"Automatic1111 is an AI image and video generator for creating, editing, enhancing, and downloading visual content online."},domain:{production:"https://automatic1111.net",development:"http://localhost:3000"},contact:{email:"[email protected]",supportEmail:"[email protected]"},legal:{companyName:"Automatic1111",updatedDates:{privacyPolicy:"2026-07-24",termsOfService:"2026-07-24",co
1okiePolicy:"2026-07-24"}}},i18n:{defaultLocale:"en",locales:{en:{code:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",name:"English",nativeName:"English",hreflang:"en",locale:"en_US",htmlLang:"en"}}},seo:{siteName:"Automatic1111",siteNameAlternates:["Automatic1111"],twitterCard:"summary_large_image",images:{ogImage:"/og.png",logoLight:"/logo.png",logoDark:"/logo.png",favicon:"/favicon.ico",appleTouch:"/apple-touch-icon.png",favicon32:"/favicon-32x32.png"},altTexts:{logo:{en:"Automatic1111 AI image and video generator logo"},ogImage:{en:"Automatic1111 AI image and video generator"},heroVideo:{en:"Automatic1111 AI video generation showcase"},showcaseVideo:{en:"Automatic1111 AI image and video examples"},featureImage:{en:"Automatic1111 AI image generation workspace"}}},pwa:{name:"Automatic1111",shortName:"Automatic1111",themeColor:"#ffffff",backgroundColor:"#ffffff",display:"standalone"},structuredData:{organization:{description:{en:"Automatic1111 provides browser-based AI tools for generating, editing, enhancing, and downloading images and videos."},rating:null},software:{name:"Automatic1111 AI Image & Video Generator",category:"MultimediaApplication",operatingSystem:"Web Browser",description:{en:"Automatic1111 is an AI image and video generator that helps creators turn prompts and reference media into polished visual content online."},pricing:{currency:"USD",lowPrice:"0",highPrice:"99.90",offerCount:"4"}},website:{description:{en:"Automatic1111 - AI Image & Video Generator"},searchActionTarget:null},video:{name:{en:"Automatic1111 AI image and video generator demo"},description:{en:"See Automatic1111 create AI-powered image and video content from prompts and reference media."},uploadDate:"2026-07-24T00:00:00.000Z",duration:"PT1M30S",contentUrl:"https://automatic1111.net/media/videoproject/wavespeed-videos/waver-1.0/cover.webm"}},translations:{en:{Metadata:{name:"Automatic1111",title:"Automatic1111 - Free AI Image & Video Generator Online",description:"Create, edit, enhance, and download images and videos with automatic1111. Turn prompts and reference media into polished visual content online.",keywords:""},AboutPage:{authorBio:"AI Image & Video Generator",introduction:"Automatic1111 helps creators turn prompts and reference media into polished images and videos with an accessible browser-based workflow.",metaDescription:"Learn about Automatic1111, an AI image and video generator for creators, designers, and teams.",description:"Automatic1111 is an AI image and video generator for creating, editing, enhancing, and downloading visual content online.",authorName:"Automatic1111"},Marketing:{footer:{tagline:"Create images and videos from ideas in seconds"}}}},changelog:{latestVersion:{version:"1.0.0",date:"2026-07-24",title:"Automatic1111 Brand and SEO Refresh",_description:"Latest version information for automatic changelog generation",_usedIn:"Will be used to generate content/changelog/ MDX files",_requirements:{version:"Semantic versioning (e.g., 1.2.0, 2.0.1)",date:"YYYY-MM-DD format, must be <= today",title:"Short description of main feature (50-80 chars)"},features:[{title:"Unified creative workspace",description:"Create and refine AI-powered images and videos in one browser-based workspace."}],improvements:[{title:"Search-ready site metadata",description:"Updated canonical URLs, social cards, structured data, and media descriptions for automatic1111."}],fixes:[{title:"English-only public indexing",description:"Restricted public sitemap and hreflang output to the supported English experience."}],_examples:{goodEntries:[{features:"✅ 'AI Voice Cloning' - 'Generate videos with your own voice using 30-second sample'",improvements:"✅ 'Faster Export' - 'Reduced export time by 60% for 1080p videos'",fixes:"✅ 'Fixed Audio Sync' - 'Resolved audio desync issues in Chrome browser'"}],badEntries:[{features:"❌ 'New Feature' - 'Added new functionality'",improvements:"❌ 'Various improvements' - 'Made things better'",fixes:"❌ 'Bug fixes' - 'Fixed some issues'"}]},_writingGuide:{features:"New capabilities users didn't have before",improvements:"Made existing features better/faster",fixes:"Resolved bugs or issues",titleLength:"3-6 words, action-focused",descriptionLength:"80-120 characters, specific benefit"},_tips:["Focus on USER benefits, not technical details","Use numbers (60% faster, 10 new templates)","Be specific (not 'improved performance', but 'faster exports')","Version 1.0.0 = major release, 1.1.0 = new features, 1.1.1 = fixes"],_futureImplementation:"This will automatically generate MDX files in content/changelog/ directory"}}}},67536:(e,t,a)=>{a.r(t),a.d(t,{ImageGenerator:()=>ev});var s=a(55763),r=a(86425),i=a(13139),n=a(89745),o=a(5744),l=a(42781),d=a(36828),c=a(92491),m=a(15917),u=a(76643),h=a(55165),p=a(40538),g=a(42749),f=a(61116);function x({onClick:e,className:t}){let a=(0,f.c3)("imageGenerator");return(0,s.jsxs)(h.$,{variant:"outline",size:"sm",onClick:e,className:(0,p.cn)("gap-2 text-primary border-primary hover:bg-primary/10 animate-pulse",t),children:[(0,s.jsx)(g.A,{className:"w-4 h-4"}),a("accelerateButton.text")]})}var b=a(54936),w=a(51736),v=a(19080),y=a(75393),j=a(67571);let N="fake_progress_start_time";function k({isActive:e,duration:t=60,onComplete:a,result:r,onLoginClick:i,onPaymentClick:n,showAccelerateButton:o=!1,onAccelerateClick:l,className:d}
1){let c=(0,f.c3)("imageGenerator"),[m,u]=(0,j.useState)(0),[g,x]=(0,j.useState)(t),k=(0,j.useRef)(null),I=(0,j.useRef)(null),S=(0,j.useRef)(a);(0,j.useEffect)(()=>{S.current=a},[a]);let C=(0,j.useCallback)(()=>{try{let e=sessionStorage.getItem(N);if(e){let a=JSON.parse(e);if(Date.now()-a.startTime<(t+5)*1e3)return a.startTime;sessionStorage.removeItem(N)}}catch{}return null},[t]),T=(0,j.useCallback)(e=>{try{sessionStorage.setItem(N,JSON.stringify({startTime:e}))}catch{}},[]),A=(0,j.useCallback)(()=>{try{sessionStorage.removeItem(N)}catch{}},[]);return((0,j.useEffect)(()=>{if(!e){u(0),x(t),k.current=null,A(),I.current&&cancelAnimationFrame(I.current);return}let a=C();a?k.current=a:(k.current=Date.now(),T(k.current));let s=()=>{if(!k.current)return;let e=(Date.now()-k.current)/1e3;if(x(Math.max(0,Math.ceil(t-e))),u(Math.min(e/t*100,100)),e>=t){A(),S.current?.();return}I.current=requestAnimationFrame(s)};return I.current=requestAnimationFrame(s),()=>{I.current&&cancelAnimationFrame(I.current)}},[e,t,C,T,A]),e||r)?r?(0,s.jsx)("div",{className:(0,p.cn)("space-y-4",d),children:(0,s.jsx)("div",{className:"flex flex-col items-center justify-center p-6 sm:p-8 rounded-xl bg-muted/50 border border-border",children:"login"===r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.A,{className:"w-12 h-12 text-primary mb-4"}),(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-2",children:c("fakeProgress.loginRequired")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground text-center mb-4",children:c("fakeProgress.loginDescription")}),(0,s.jsxs)(h.$,{onClick:i,className:"gap-2",children:[(0,s.jsx)(b.A,{className:"w-4 h-4"}),c("fakeProgress.loginButton")]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.A,{className:"w-12 h-12 text-primary mb-4"}),(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-2",children:c("fakeProgress.paymentRequired")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground text-center mb-4",children:c("fakeProgress.paymentDescription")}),(0,s.jsxs)(h.$,{onClick:n,className:"gap-2",children:[(0,s.jsx)(w.A,{className:"w-4 h-4"}),c("fakeProgress.paymentButton")]})]})})}):(0,s.jsx)("div",{className:(0,p.cn)("space-y-4",d),children:(0,s.jsxs)("div",{className:"relative flex flex-col items-center justify-center p-6 sm:p-8 rounded-xl bg-muted/30 border border-border/50",children:[(0,s.jsx)("div",{className:"relative mb-4",children:(0,s.jsx)("div",{className:"w-16 h-16 sm:w-20 sm:h-20 rounded-full bg-orange-500/20 flex items-center justify-center",children:(0,s.jsx)(v.A,{className:"w-8 h-8 sm:w-10 sm:h-10 text-orange-400"})})}),(0,s.jsx)("h3",{className:"text-lg sm:text-xl font-semibold text-foreground mb-2",children:c("fakeProgress.preparingTitle")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:c("fakeProgress.preparingSubtitle")}),(0,s.jsxs)("p",{className:"text-3xl sm:text-4xl font-bold text-orange-500 mb-2",children:[g,"s"]}),o&&(0,s.jsxs)(h.$,{onClick:l,variant:"default",size:"lg",className:"mb-4 gap-2 bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-600 hover:to-amber-600 text-white shadow-lg",children:[(0,s.jsx)(y.A,{className:"w-5 h-5"}),c("fakeProgress.skipWait")]}),(0,s.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground mb-4 text-center",children:c("fakeProgress.freeUserHint")}),(0,s.jsx)("div",{className:"w-full max-w-sm",children:(0,s.jsx)("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-gradient-to-r from-orange-500 to-amber-500 rounded-full transition-all duration-300 ease-out",style:{width:`${m}%`}})})})]})}):null}var I=a(95794),S=a(6185),C=a(21361),T=a(30455),A=a(53708),P=a(80232),E=a(91119),G=a(30296),R=a(72008),$=a(79881),_=a(5014);function z({className:e,onOpenPricing:t}){let a=(0,f.c3)("UserGuidanceCard"),r=(0,P.tx)(),i=(0,C.i)(),{leftCredits:n}=(0,S.I)(),{data:o}=(0,A.n_)(i?.id),{setLoginSource:l}=(0,T.W)(),d=()=>{l("direct")},c=(()=>{if(!i)return"not_logged_in";let e=n||0;return o?.status==="active"?"subscribed":e<8?"credits_insufficient":"not_subscribed"})();return(0,s.jsx)("div",{className:(0,p.cn)("w-full max-w-full min-w-0 p-3 sm:p-4 roun
1ded-lg sm:rounded-xl border-2 transition-all duration-300","bg-gradient-to-r from-background to-muted/30","hover:shadow-md",(()=>{switch(c){case"not_logged_in":return"border-amber-200/60 dark:border-amber-800/40";case"credits_insufficient":return"border-red-200/60 dark:border-red-800/40";case"not_subscribed":return"border-violet-200/60 dark:border-violet-800/40";case"subscribed":return"border-emerald-200/60 dark:border-emerald-800/40"}})(),e),children:(()=>{switch(c){case"not_logged_in":return(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,s.jsx)("div",{className:(0,p.cn)("flex-shrink-0 w-8 sm:w-10 h-8 sm:h-10 rounded-full flex items-center justify-center","bg-gradient-to-br from-amber-400 to-orange-500"),children:(0,s.jsx)(G.A,{className:"w-4 sm:w-5 h-4 sm:h-5 text-white"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-xs sm:text-sm font-medium text-foreground truncate",children:a("notLoggedIn.title")}),(0,s.jsx)("p",{className:"text-[10px] sm:text-xs text-muted-foreground truncate",children:a("notLoggedIn.description")})]})]}),(0,s.jsxs)(h.$,{size:"sm",className:"flex-shrink-0 w-full sm:w-auto h-8 sm:h-9 text-xs sm:text-sm",onClick:()=>{d(),r.push(E.BV.Login)},children:[a("notLoggedIn.action"),(0,s.jsx)(R.A,{className:"w-3 h-3 ml-1"})]})]});case"credits_insufficient":return(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,s.jsx)("div",{className:(0,p.cn)("flex-shrink-0 w-8 sm:w-10 h-8 sm:h-10 rounded-full flex items-center justify-center","bg-gradient-to-br from-red-400 to-rose-500"),children:(0,s.jsx)(g.A,{className:"w-4 sm:w-5 h-4 sm:h-5 text-white"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-xs sm:text-sm font-medium text-foreground truncate",children:a("creditsInsufficient.title")}),(0,s.jsx)("p",{className:"text-[10px] sm:text-xs text-muted-foreground truncate",children:a("creditsInsufficient.description",{credits:n||0})})]})]}),(0,s.jsxs)(h.$,{size:"sm",variant:"destructive",className:"flex-shrink-0 w-full sm:w-auto h-8 sm:h-9 text-xs sm:text-sm",onClick:t,children:[a("creditsInsufficient.action"),(0,s.jsx)(R.A,{className:"w-3 h-3 ml-1"})]})]});case"not_subscribed":return(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,s.jsx)("div",{className:(0,p.cn)("flex-shrink-0 w-8 sm:w-10 h-8 sm:h-10 rounded-full flex items-center justify-center","bg-gradient-to-br from-violet-400 to-purple-500"),children:(0,s.jsx)($.A,{className:"w-4 sm:w-5 h-4 sm:h-5 text-white"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-xs sm:text-sm font-medium text-foreground truncate",children:a("notSubscribed.title")}),(0,s.jsx)("p",{className:"text-[10px] sm:text-xs text-muted-foreground truncate",children:a("notSubscribed.description")})]})]}),(0,s.jsxs)(h.$,{size:"sm",className:"flex-shrink-0 w-full sm:w-auto h-8 sm:h-9 text-xs sm:text-sm bg-gradient-to-r from-violet-500 to-purple-600 hover:from-violet-600 hover:to-purple-700",onClick:t,children:[a("notSubscribed.action"),(0,s.jsx)(R.A,{className:"w-3 h-3 ml-1"})]})]});case"subscribed":return(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,s.jsx)("div",{className:(0,p.cn)("flex-shrink-0 w-8 sm:w-10 h-8 sm:h-10 rounded-full flex items-center justify-center","bg-gradient-to-br from-emerald-400 to-teal-500"),children:(0,s.jsx)(_.A,{className:"w-4 sm:w-5 h-4 sm:h-5 text-white"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-xs sm:text-sm font-medium text-foreground truncate",children:a("subscribed.title")}),(0,s.jsx)("p",{className:"text-[10px] sm:text-xs text-muted-foreground truncate",children:a("subscribed.description")})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0 w-full sm:w-auto",children:[(0,s.jsxs)(h.$,{size:"sm",variant:"outline",onClick:t,className:"flex-1 sm:flex-none h-8 sm:h-9 text-xs sm:text-sm",children:[(0,s.jsx)(y.A,{className:"w-3 h-3 mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:a("subscribed.buyCredits")}),(0,s.jsx)("span",{className:"sm:hidden",children:"Credits"})]}),(0,s.jsx)(P.XO,{href:"/ai/image-upscaler",className:"flex-1 sm:flex-none",children:(0,s.jsxs)(h.$,{size:"sm",variant:"secondary",className:"w-full h-8 sm:h-9 text-xs sm:text-sm",children:[(0,s.jsx)("span",{className:"hidden sm:inline",children:a("subscribed.tryTool")}),(0,s.jsx)("span",{className:"sm:hidden",children:"Tools"}),(0,s.jsx)(R.A,{className:"w-3 h-3 ml-1"})]})})]})]})}})()})}var L=a(74821),U=a(9569),F=a(94999),D=a(34871),O=a(86295),M=a(18172),B=a(80993),K=a(63652),W=a(96363),q=a(88302),Y=a(9500),X=a(5616),V=a(64842),H=a(14652),J=a(9146),Z=a(97726),Q=a(81223),ee=a(30878),et=a(96815),ea=a(45939),es=a(56693),er=a(43991),ei=a(58731),en=a(14740),eo=a(25424),el=a(59526),ed=a(79597),ec=a(79182),em=a(1694),eu=a(41514),eh=a.n(eu),ep=a(96429),eg=a(38456),ef=a(
176601),ex=a(26908);let eb={[`${eg.WL}/images/examples/example-05.webp`]:{fallback:`${eg.WL}/images/examples/example-05-960w.webp`,srcSet:`${eg.WL}/images/examples/example-05-640w.webp 640w, ${eg.WL}/images/examples/example-05-960w.webp 960w, ${eg.WL}/images/examples/example-05.webp 1400w`},[`${eg.WL}/images/showcase/showcase-13.webp`]:{fallback:`${eg.WL}/images/showcase/showcase-13-960w.webp`,srcSet:`${eg.WL}/images/showcase/showcase-13-640w.webp 640w, ${eg.WL}/images/showcase/showcase-13-960w.webp 960w, ${eg.WL}/images/showcase/showcase-13.webp 1400w`}},ew=e=>{if(e)return eb[(0,eg.rG)(e)]||eb[e]};function ev({title:e,description:t,showHeader:g=!0,defaultModel:b="z-image",allowFreeModel:w=!1}={}){var v;let N=(0,f.c3)("imageGenerator"),G=(0,P.tx)(),R=(0,f.c3)("Common"),_=(0,f.c3)("PricingModal"),eu=(...e)=>{},eb=(...e)=>{},ey=(...e)=>{},ej=(0,C.i)(),{leftCredits:eN,refreshCredits:ek,setCredits:eI}=(0,S.I)(),eS=(0,Y.T)(),{data:eC}=(0,A.n_)(ej?.id),{data:eT=!1}=(0,A.Ph)(ej?.id),{data:eA=!1}=(0,A.VM)(ej?.id),{loadData:eP,saveData:eE,clearData:eG,setPendingGenerate:eR,consumePendingGenerate:e$,setLoginSource:e_,consumeLoginSource:ez,isInitialized:eL,markInitialized:eU}=(0,T.W)(),[eF,eD]=(0,j.useState)(!1),[eO,eM]=(0,j.useState)(c.P),[eB,eK]=(0,j.useState)([]),[eW,eq]=(0,j.useState)([]),[eY,eX]=(0,j.useState)(""),eV=eY.toLowerCase().includes("timeout"),[eH,eJ]=(0,j.use
1State)(!1),[eZ,eQ]=(0,j.useState)(!0),[e0,e1]=(0,j.useState)(!1),[e5,e2]=(0,j.useState)(!1),[e4,e3]=(0,j.useState)("default"),[e6,e9]=(0,j.useState)(0),[e8,e7]=(0,j.useState)(!1),[te,tt]=(0,j.useState)(!1),[ta,ts]=(0,j.useState)(null),[tr,ti]=(0,j.useState)(!1),[tn,to]=(0,j.useState)(!1),[tl,td]=(0,j.useState)(null),[tc,tm]=(0,j.useState)(!1),[tu,th]=(0,j.useState)(0),tp=(0,j.useRef)(null),tg=(0,j.useRef)(!1);(0,j.useEffect)(()=>{if(!tg.current){tg.current=!0;try{let e=sessionStorage.getItem("fake_progress_start_time");if(e){let t=JSON.parse(e),a=(Date.now()-t.startTime)/1e3;a<60&&(eu("[FakeLoading] 恢复进行中的倒计时,已过:",a,"秒"),to(!0),tm(!0),e3("wait"),e2(!0))}}catch{}}},[]);let tf=w&&"free"===b?"free":b,[tx,tb]=(0,j.useState)(tf),tw=eF||0!==eW.length?N("resultTitle"):N("exampleTitle"),[tv,ty]=(0,j.useState)("auto"),[tj,tN]=(0,j.useState)(null),[tk,tI]=(0,j.useState)("1K"),tS="z-image"===tx,tC="free"===tx,tT=(0,f.c3)("BonusCredits"),{status:tA,refresh:tP,error:tE,isLoading:tG}=(0,n.J)(),tR=tA?.enabled===!0,t$=tC&&tR,[t_,tz]=(0,j.useState)(!1),{startedTask:tL,completedTask:tU}=(0,i.P)(ej?.id,tP,()=>tz(!0)),tF=(0,q.Xe)(tx),tD=(0,q.fw)(tx),tO=(0,q.xP)(tx),tM="auto"===tv?tj||"auto":tv,tB=tD.includes(tM)?tM:tD[0]||"auto",tK=(0,q.Ng)({selectedModel:tx,aspectRatio:tB}),tW=tK.includes(tk)?tk:tK[0]||"1K",tq=eB.length>tO,tY=(0,q.V2)({selectedModel:"lite",quality:tk}).totalCredits,tX=(0,q.V2)({selectedModel:"pro",quality:tk}).totalCredits,tV=(0,q.V2)({selectedModel:"nano-banana",quality:tk}).totalCredits,tH=(0,q.V2)({selectedModel:"flux-klein",quality:"1K"}).totalCredits,tJ=(0,q.V2)({selectedModel:"z-image",quality:"1K"}).totalCredits,tZ=t$?l.qH:(0,q.V2)({selectedModel:tx,quality:tW}).totalCredits,tQ=(0,j.useRef)([]),t0=(0,j.useCallback)(()=>{for(let e of tQ.current)URL.revokeObjectURL(e);tQ.current=[]},[]);(0,j.useEffect)(()=>t0,[t0]);let t1=eC?.status==="active",t5=eC?.status==="active"||eT||eA;(0,j.useEffect)(()=>{tD.includes(tv)||ty(tD[0]||"auto")},[tv,tD]),(0,j.useEffect)(()=>{tK.includes(tk)||tI(tK[0])},[tk,tK]),(0,j.useEffect)(()=>{tS&&0!==eB.length&&(eK([]),tN(null),ep.o.info("Z-Image is text-to-image only, so reference images were removed."))},[tS,eB.length]),(0,j.useEffect)(()=>{tS||eK(e=>e.length>tO?e.slice(0,tO):e)},[tO,tS]);let t2=X.AN,t4=e=>e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:1});(0,j.useEffect)(()=>{let e=()=>{let e=new URLSearchParams(window.location.hash.split("?")[1]||""),t=e.get("image"),a=e.get("prompt"),s="free"===e.get("model")&&w;if(a||s){if(eu("\uD83D\uDCE5 Loading from URL:",{imageUrl:t||"none",promptText:(a||"").substring(0,50)+"..."}),s&&(tb("free"),tN(null),ty("1:1")),t){let e=aL(t);eu("[ImageGenerator] 来自 URL 参数的图片:",e),eK([{id:`showcase_${Date.now()}`,url:e,name:"Showcase Image"}]),s||tb("lite")}eM(a||c.P),eq([]),eX(""),window.history.replaceState(null,"","#image-generator")}};if(!eL){let t=new URLSearchParams(window.location.hash.split("?")[1]||"");if(t.get("prompt")||"free"===t.get("model")&&w)e();else{let e=eP();e&&(eu("\uD83D\uDCE5 Restoring from localStorage:",{prompt:e.prompt?.substring(0,50)+"...",imagesCount:e.uploadedImages?.length||0}),"string"==typeof e.prompt&&eM(e.prompt),e.uploadedImages?.length&&eK(e.uploadedImages),e.aspectRatio&&ty(e.aspectRatio),e.quality&&tI(e.quality),"boolean"==typeof e.isPublic&&eQ(e.isPublic),e.generationModel&&tb(e.generationModel))}eU()}return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[eL,eP,eU,w]),(0,j.useEffect)(()=>{if(!eL)return;let e=()=>{eE({prompt:eO,uploadedImages:eB,aspectRatio:tv,quality:tW,isPublic:eZ,generationModel:tx})};if("requestIdleCallback"in window){let t=requestIdleCallback(e,{timeout:1e3});return()=>cancelIdleCallback(t)}let t=setTimeout(e,100);return()=>clearTimeout(t)},[eL,eO,eB,tv,tk,eZ,tx,eE]);let[t3,t6]=(0,j.useState)(null),t9=(0,j.useRef)(null),t8=(0,j.useRef)(null),t7=(0,j.useRef)(null),ae=(0,j.useRef)(null),at=(0,j.useRef)(!1),aa=(0,j.useCallback)((e=!1)=>{t9.current&&(clearTimeout(t9.current),t9.current=null),t6(null),null!==t8.current&&(ep.o.dismiss(t8.current),t8.current=null),e&&ep.o.info(N("autoGenerateCancelled"))},[N]);(0,j.useEffect)(()=>()=>{t9.current&&(clearTimeout(t9.current),t9.current=null),null!==t8.current&&(ep.o.dismiss(t8.current),t8.current=null)},[]),(0,j.useEffect)(()=>
1{if(!ej||!eL||tC||at.current)return;let e=ez(),t=e$();if("generate"===e&&t)at.current=!0,to(!1),td(null);else{if(eC?.status!=="active"){at.current=!0,eu("[LoginFlow] Non-generate login detected, user not subscribed, showing pricing modal");let e=setTimeout(()=>{aq("login")},500);return()=>clearTimeout(e)}return}if(!eO.trim()){eu("[AutoGenerate] No prompt, skipping auto generate");return}if((eN||0)<tZ){eu("[AutoGenerate] Insufficient credits, showing pricing modal"),aq("credits");return}eu("[AutoGenerate] Starting countdown..."),t6(3),t8.current=ep.o.loading(N("autoGenerateCountdown",{seconds:3}),{duration:Number.POSITIVE_INFINITY,action:{label:N("cancel"),onClick:()=>aa(!0)}})},[ej,eL,ez,e$,eO,eN,eC,N,tZ,tC,aa]),(0,j.useEffect)(()=>{if(null!==t3){if(t3<=0){ep.o.dismiss(t8.current),t8.current=null,t9.current=null,t6(null),eu("[AutoGenerate] Countdown finished, triggering generate"),a0();return}return t9.current=setTimeout(()=>{let e=t3-1;t6(e),t8.current&&e>0&&ep.o.loading(N("autoGenerateCountdown",{seconds:e}),{id:t8.current,duration:Number.POSITIVE_INFINITY,action:{label:N("cancel"),onClick:()=>aa(!0)}})},1e3),()=>{t9.current&&clearTimeout(t9.current)}}},[t3,N,aa]);let[as,ar]=(0,j.useState)(!1),[ai,an]=(0,j.useState)(!1),[ao,al]=(0,j.useState)(!1),[ad,ac]=(0,j.useState)(!1),[am,au]=(0,j.useState)(0),[ah,ap]=(0,j.useState)(!0),ag=(0,j.useRef)(null),af=(0,j.useRef)(null),ax=(0,j.useRef)(null),ab=(0,j.useRef)(null),[aw,av]=(0,j.useState)(!0),ay=(0,j.useRef)(new Set),aj=(0,j.useRef)(null),aN=(0,j.useRef)(null),ak=(0,j.useRef)(null),aI=(0,j.useRef)(null),aS=(0,j.useId)(),aC=(0,j.useId)(),aT=(0,j.useId)(),aA=(0,j.useId)(),aP=(0,j.useId)(),aE="https://automatic1111.net/media/nanobanana2/showcase/original",aG=[{id:1,label:N("templateFuturisticCity"),title:N("templateFuturisticCity"),image:`${aE}/ai-gen-1.webp`,prompt:"A futuristic city at sunset with flying cars and neon lights, cyberpunk style, ultra detailed, 8k resolution"},{id:2,label:N("templateCuteAnimal"),title:N("templateCuteAnimal"),image:`${aE}/ai-gen-2.webp`,prompt:"A cute fluffy cat with big eyes sitting on a cloud, dreamy pastel colors, kawaii style, soft lighting"},{id:3,label:N("templateFantasyLandscape"),title:N("templateFantasyLandscape"),image:`${aE}/ai-gen-3.webp`,prompt:"An enchanted forest with glowing mushrooms and fireflies, magical atmosphere, fantasy art, vibrant colors"},{id:4,label:N("templatePortraitArt"),title:N("templatePortraitArt"),image:`${aE}/ai-gen-27.webp`,prompt:"Professional portrait of a person with dramatic lighting, cinematic style, high detail, shallow depth of field"},{id:5,label:N("templateAbstractArt"),title:N("templateAbstractArt"),image:`${aE}/ai-gen-28.webp`,prompt:"Abstract geometric shapes with gradient colors, modern minimalist design, vibrant and energetic composition"}],aR=[{id:2,image:(0,eg.rG)("/images/examples/example-05.webp"),prompt:'Create a comprehensive character concept sheet in 9:16 portrait orientation. The character is Supergirl with blonde hair, blue suit with red cape and gold belt. Center: full-body standing pose with confident expression as visual anchor. Surrounding elements in vertical layout: (1) Expression Sheet showing 3-4 head close-ups - Shy/Reserved, Surprised, Applying Lipstick with focused expression; (2) Clothing Layers showing Kryptonian Battle Suit Top, Armored Skirt, Metallized Belt, Durable Kryptonian Fabric cape with Heavy Drape Weave Texture; (3) Intimate Apparel showing Kryptonian Performance Underlayers sports bra and briefs in brand colors; (4) Material Swatches for Bulletproof Weave Detail, S Shield Metallic Texture, Boot Sole Tread; (5) Beauty & Lifestyle items including "Krypton Red" Lipstick #520, Personal Journal, Daily Supplements, Energy Snack protein bar, Compact Hand Sanitizer; (6) Daily Essentials Bag shown open with contents scattered. Style: high-quality 2D illustration with clean linework on beige parchment background. Add handwritten annotations. English annotations only. 4K HD output.',title:"Character Concept Sheet - Supergirl"},{id:3,image:(0,eg.rG)("/images/showcase/showcase-13.webp"),inputImage:(0,eg.rG)("/images/showcase/showcase-13-input.webp"),prompt:"Create 9 stunning fashion photography images in the style of award-winning fashion magazine spreads. Use this reference image as the brand style, but add subtle variations and diversity across the series to convey a professional design sense. Generate nine images one by one.",title:"Fashion Magazine Series"},{id:4,image:(0,eg.rG)("/images/examples/example-06.webp"),prompt:"Create a 9-image Instagram feed for this product in the same aesthetic. Use different locations, angles, and compositions, incorporating people, animals, nature, and various environments while maintaining a cohesive visual style.",title:"Instagram Product Feed"}],a$=aR.filter(e=>!("hidden"in e&&e.hidden)),a_=a$.length>0?a$:aR;(0,j.useEffect)(()=>{am>=a_.length&&au(0)},[a_.length,am]);let az=async()=>
1{if(eO)try{await navigator.clipboard.writeText(eO),eJ(!0),setTimeout(()=>eJ(!1),2e3),ep.o.success("Copied to clipboard")}catch(e){ey("Failed to copy:",e),ep.o.error("Failed to copy")}},aL=e=>{if(!e)return e;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:"))return eu("[ImageGenerator] 已是绝对 URL/数据源,直接使用:",e),e;let t=window.location.origin;try{if(t){let a=new URL(e,t).toString();return eu("[ImageGenerator] 规范化相对路径为绝对 URL (origin):",{original:e,normalized:a}),a}let a=(0,V.VG)(e);return eu("[ImageGenerator] 规范化相对路径为绝对 URL (base):",{original:e,normalized:a}),a}catch(t){eb("Failed to normalize image url, fallback to origin:",e,t);try{let t=new URL(e,window.location.origin).toString();return eu("[ImageGenerator] 规范化相对路径为绝对 URL (origin):",{original:e,normalized:t}),t}catch{return eb("[ImageGenerator] 规范化失败,返回原始 URL:",e),e}}};(0,j.useEffect)(()=>{let e=ax.current;if(!e||"undefined"==typeof IntersectionObserver)return;let t=new IntersectionObserver(e=>{e.forEach(e=>av(e.isIntersecting))},{rootMargin:"200px 0px",threshold:.1});return t.observe(e),()=>t.disconnect()},[]),(0,j.useEffect)(()=>{if(!eS||!aw||0===a_.length)return;let e=e=>{!(!e||ay.current.has(e))&&(new window.Image().src=e,ay.current.add(e))},t=e=>{if(!e?.srcSet)return e?.fallback;let t=(window.innerWidth||0)*(window.devicePixelRatio||1),a=e.srcSet.split(",").map(e=>{let[t,a]=e.trim().split(" ");return{url:t,width:a?.endsWith("w")?Number(a.replace("w","")):Number.NaN}}).filter(e=>e.url&&Number.isFinite(e.width)).sort((e,t)=>e.width-t.width),s=a.find(e=>e.width>=t);return s?.url??a.at(-1)?.url??e?.fallback},a=a=>{e(t(ew(a.image))??a.image)},s=a_[am];s&&a(s);let r=window.setTimeout(()=>{a_.forEach(e=>{e!==s&&a(e)})},1500);return()=>window.clearTimeout(r)},[a_,am,aw,eS]),(0,j.useEffect)(()=>(eS&&aw&&ah&&0===eW.length&&a_.length>0&&(ag.current=setInterval(()=>{au(e=>(e+1)%a_.length)},2e3)),()=>{ag.current&&clearInterval(ag.current)}),[eS,aw,ah,eW.length,a_.length]),(0,j.useEffect)(()=>()=>{af.current&&clearInterval(af.current)},[]),(0,j.useEffect)(()=>{let e;if(!eF){tt(!1);return}let t=setTimeout(()=>{tt(!0),e=setInterval(()=>{tt(e=>!e)},5e3)},3e5);return()=>{clearTimeout(t),e&&clearInterval(e)}},[eF]);let aU=async e=>{let t=e.target.files;if(!t||0===t.length)return;let a=tC?X.f9:tO,s=tC&&1===eB.length,r=s?1:a-eB.length;if(r<=0){ep.o.error(`${tF.displayName} supports up to ${a} input images.`);return}if(tC&&t.length>r){ep.o.error("Free supports one reference image at a time."),e.currentTarget.value="";return}let i=Array.from(t).slice(0,r);if(tC&&i.some(e=>!X.MK.includes(e.type))){ep.o.error("Free supports JPEG, PNG, and WebP reference images."),e.currentTarget.value="";return}if(tC&&i.some(e=>0===e.size||e.size>X.mq)){ep.o.error("Reference image must be no larger than 10 MiB."),e.currentTarget.value="";return}let n=i.map(async(e,t)=>{try{let a=await (0,ef.w4)(e,{maxWidth:2048,maxHeight:2048,quality:.8,mimeType:"image/jpeg"});return eu(`[ImageUpload] Compressed ${e.name}: ${a.originalSize} -> ${a.compressedSize} bytes, dimensions: ${a.width}x${a.height}`),{id:`${Date.now()}_${t}`,url:a.dataUrl,name:e.name,width:a.width,height:a.height}}catch(a){return ey(`[ImageUpload] Failed to compress ${e.name}:`,a),new Promise(a=>{let s=new FileReader;s.onloadend=()=>{a({id:`${Date.now()}_${t}`,url:s.result,name:e.name})},s.readAsDataURL(e)})}}),o=await Promise.all(n),l=o[0],d=l?.width&&l?.height?{width:l.width,height:l.height}:null;if(eK(e=>{let t=o.map(({id:e,url:t,name:a})=>({id:e,url:t,name:a}));return s?t:[...e,...t]}),eY&&eX(""),(0===eB.length||s)&&d){let e=(0,q.YX)({width:d.width,height:d.height,allowedRatios:tD});tN(e),eu(`[ImageUpload] Auto-detected aspect ratio: ${e} (from ${d.width}x${d.height})`)}},aF=e=>{eK(t=>t.filter(t=>t.id!==e)),eY&&eX("")},aD=e=>{eu("[ImageGenerator] 使用示例图片:",e);let t=e.inputImage||e.image;eK([{id:`example_${e.id}_${Date.now()}`,url:aL(t),name:e.title}]),tb("lite"),eM(e.prompt),eq([]),eX(""),requestAnimationFrame(()=>{setTimeout(()=>{if(aI.current){let e=aI.current,t=e.getBoundingClientRect(),a=(window.scrollY||document.documentElement.scrollTop)+t.to
1p-100;window.scrollTo({top:Math.max(0,a),behavior:"smooth"}),setTimeout(()=>{e.focus()},300)}},50)})},aO=()=>{ab.current&&ab.current.scrollIntoView({behavior:"smooth",block:"start"})},aM=(e,t)=>{eK([{id:`generated_${Date.now()}_${t}`,url:e,name:`Generated Image ${t+1}`}]),tb("lite"),eq([]),ep.o.success(N("useAsInputSuccess")||"Image set as input successfully")},aB=async e=>{if((e.headers.get("content-type")||"").includes("application/json"))return e.json();let t=await e.text();throw Error(t?.slice(0,200)||"Unexpected response")},aK=async e=>{if("number"==typeof e&&Number.isFinite(e)){let t=Math.max(0,Math.trunc(e));return eI(t),t}let t=await ek();return t?.credits??0},aW=e=>{!tC&&(t7.current&&clearTimeout(t7.current),e<tZ&&(eu("[LoginFlow] Scheduling delayed pricing modal, remaining credits:",e),t7.current=setTimeout(()=>{aq("credits")},5e3)))},aq=(e="default")=>{e3(e),e2(!0)};(0,j.useEffect)(()=>{(!eY||eF||t5)&&ae.current&&(clearTimeout(ae.current),ae.current=null)},[eY,eF,t5]);let aY=async(e,t,a)=>{let s=e.map(e=>e.url||"").filter(e=>!!e),r=s;if("ephemeral"===t){let e=[];try{for(let t of s){let s=await (0,d.gh)(a||"",t);e.push(URL.createObjectURL(s))}}catch(t){for(let t of e)URL.revokeObjectURL(t);throw t}r=e}
1t0(),"ephemeral"===t&&(tQ.current=r),eq(r)},aX=(e,t)=>{af.current&&clearInterval(af.current);let a=Date.now(),s=0;af.current=setInterval(async()=>{s++;let r=Date.now()-a;if(r>3e5){eb(`[Polling] Timeout after ${s} attempts (${Math.round(r/1e3)}s)`),af.current&&clearInterval(af.current),eX("Generation timeout. Please check your images in the gallery."),ep.o.error("Generation timeout. Please check your images in the gallery."),aZ(!1),eD(!1);return}try{let a=`/api/generate-image/status?taskId=${encodeURIComponent(e)}&kieTaskId=${encodeURIComponent(t)}`,i=await fetch(a),n=await aB(i);if(s%10==0&&eu(`[Polling] #${s} - status: ${n.data?.status}, elapsed: ${Math.round(r/1e3)}s`),!i.ok||!n.success)throw"number"==typeof n.data?.remainingCredits&&Number.isFinite(n.data.remainingCredits)&&eI(n.data.remainingCredits),Error(n.error||"Status check failed");let o=n.data?.images||[];if(o.length>0){eu(`[Polling] Success after ${s} attempts (${Math.round(r/1e3)}s)`),await aY(o,n.data?.resultStorage);let e=await aK(n.data?.remainingCredits);e7(!0),e9(e=>e+1),eG(),ep.o.success(N("generationSuccess")),af.current&&clearInterval(af.current),aZ(!0),eD(!1),aW(e)}}catch(t){ey("Status polling error:",t),af.current&&clearInterval(af.current);let e=t instanceof Error?t.message:"Status check failed";eX(e),ep.o.error(e),aZ(!1),eD(!1)}},5e3)},aV=async e=>{if(eu("[FakeLoading] Completed, result type:",e),to(!1),"login"===e){td(e),G.push(E.BV.Login);return}if("payment"===e){e2(!1);let e=await ek(),t=e?.credits??eN??0,a=t>=tZ;eu("[FakeLoading] 等待结束,检查积分:",{currentCredits:t,requiredCredits:tZ,hasEnoughCredits:a}),a?(eu("[FakeLoading] 积分充足,开始真实生成"),eD(!0),aJ(),td(null),tm(!1),eX(""),eq([]),await a1()):(eu("[FakeLoading] 积分不足,显示定价弹窗"),td(null),tm(!1),aq("insufficient"));return}td(e)},aH=()=>{to(!1),td(null),tm(!1)},aJ=()=>{th(0),tp.current&&clearInterval(tp.current);let e=0;tp.current=setInterval(()=>{let t=Math.max(.3,.03*(95-e));th(Math.round(e=Math.min(95,e+t)))},500)},aZ=e=>{tp.current&&(clearInterval(tp.current),tp.current=null),e?(th(100),setTimeout(()=>th(0),1e3)):th(0)},aQ=()=>{aq("wait")},a0=async()=>{if(aa(!1),eF||tn){eu("[ImageGenerator] 已在生成中,忽略重复请求");return}aH();let e=eN??0;if(eu("[ImageGenerator] 状态检查:",{user:!!ej,paid:t5,credits:e,required:tZ}),!eO.trim()){ar(!0);return}if(!ej&&!tC){eu("[ImageGenerator] 未登录用户,打开注册/登录弹窗"),eR(!0),e_("generate"),an(!0);return}if(tq){ep.o.error(`${tF.displayName} supports up to ${tO} input images.`);return}if(tC&&(tE||tG)){ep.o.error(tT("walletUnavailable"));return}if(t$&&("available"!==tA.status||tA.availableCredits<l.qH)){tz(!0);return}tC||e>=tZ?(eu("[ImageGenerator] 积分充足,正常生成"),tm(!1),eD(!0),aJ(),eX(""),t0(),eq([]),aO(),await a1()):(eu("[ImageGenerator] 积分不足,显示付费弹窗"),aq("insufficient"))};(0,j.useEffect)(()=>{let e=ak.current;if(!e)return;let t=()=>{if(eY&&!eF&&t5){tb("pro"),eX(""),setTimeout(()=>void a0(),0);return}a0()};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},[eY,a0,eF,t5]);let a1=async()=>{let e=!1;try{let t,a,s;if(eB.length>0){eu("[ImageGenerator] 开始上传图片到 R2...",eB.length,"张");try{let e=eB.map(e=>aL(e.url));if(tC)a=(await (0,ex.Bg)(e)).map(e=>e.referenceToken);else{let a="flux-klein"===tx?await Promise.all(e.map(async e=>(await (0,ef.w4)(e,{maxWidth:512,maxHeight:512,quality:.85,mimeType:"image/jpeg"})).dataUrl)):e;t=await (0,ex.t2)(a,{skipCompress:!0})}eu("[ImageGenerator] 图片上传完成:",t)}catch(t){ey("[ImageGenerator] 图片上传失败:",t);let e=t instanceof Error?t.message:"Failed to upload images";eX(e),ep.o.error(e),aZ(!1),eD(!1);return}}eu("[ImageGenerator] 准备发起生成请求",{promptPreview:eO.trim().slice(0,80),images:t||[],aspectRatio:tB,aspectRatioSource:"auto"===tv&&tj?"detected":"auto"===tv?"kie-auto":"manual",quality:tW,isPublic:eZ});let r={prompt:eO.trim(),aspectRatio:tB,quality:tW,isPublic:eZ,uploadedImages:t,freeReferenceTokens:a,selectedModel:tx},i=null;if(tC?s=await (0,d.K$)({prompt:r.prompt,aspectRatio:tB,freeReferenceTokens:a}):(i=await fetch("/api/generate-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),s=await aB(i)),!tC&&"number"==typeof s.data?.remainingCredits&&Number.isFinite(s.data.remainingCredits)&&eI(s.data.remainingCredits),i&&!i.ok||!s.success)throw Error(s.error||"Failed to generate image");if(t$&&tL(s.data?.taskId??null),s.data?.images&&s.data.images.length>0){if(await aY(s.data.images,s.data.resultStorage,s.data.taskId),tC)(0,o.r)(),t$&&s.data.taskId&&tU(s.data.taskId,!0);else{let e=await aK(s.data.remainingCredits);aW(e)}e7(!0),e9(e=>e+1),eG(),ep.o.success(N("generationSuccess")),aZ(!0),eD(!1),e=!0;return}let n=s.data?.kieTaskId,l=s.data?.remoteTaskId??s.data?.taskId??n,c=s.data?.taskId;if(tC){if(!c)throw Error("Invalid response from server");let t=await (0,d.TO)({taskId:c}),a=t.data?.images||[];if(0===a.length)throw Error("Image generation completed without a result.");await aY(a,t.data?.resultStorage,c),e7(!0),e9(e=>e+1),eG(),ep.o.success(N("generationSuccess")),aZ(!0),eD(!1),e=!0,(0,o.r)(),t$&&tU(c,!0);return}if(eu("[ImageGenerator] 轮询参数检查",{status:i?.status,taskId:c,remoteTaskId:l,kieTaskId:n}),i?.status===202&&c)aX(c,l||c);else throw Error("Invalid response from server")}catch(t){tC&&((0,o.r)(),t instanceof d.j_&&["INSUFFICIENT_BONUS_CREDITS","IP_LIMITED","BINDING_CONFLICT"].includes(t.code??"")&&tz(!0)),ey("Error generating image:",t);let e=t instanceof Error?t.message:"Failed to generate image";eX(e),ep.o.error(e)}finally{af.current||e||(aZ(!1),eD(!1))}},a5=async(e,t=0)=>{if(null===ta){if(!(tC||t1||eT||eA)){ti(!0);return}ts(t);try{let s=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5),r=`ai-generated-${t}-${s}.png`,{downloadImage:i}=await a.e(3125).then(a.bind(a,53125));await i(e,r),ep.o.success("Download started")}catch(e){ey("Download failed:",e),ep.o.error("Download failed")}finally{ts(null)}}},a2=e=>"auto"===e?`${N("auto")}${tj?` (${tj})`:""}`:({"1:1":N("square"),"16:9":N("wide"),"9:16":N("tall"),"4:3":N("standard"),"3:2":N("photo")})[e]??e;return(0,s.jsxs)("section",{className:"relative py-6 sm:py-12 lg:py-16 bg-background",children:[(0,s.jsx)(r.jp,{open:t_,onOpenChange:tz,showTrigger:!1}),(0,s.jsxs)("div",{className:"container px-3 sm:px-4 lg:px-8",children:[g&&(0,s.jsxs)("div",{className:"text-center mb-4 sm:mb-6 lg:mb-8 max-w-3xl mx-auto",children:[(e||N("title"))&&(0,s.jsx)("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-bold lg:text-5xl text-foreground mb-2 sm:mb-4",children:e||N("title")}),(t||N("description"))&&(0,s.jsx)("p",{className:"text-muted-foreground text-sm sm:text-base lg:text-lg",children:t||N("description")})]}),(0,s.jsx)("div",{className:"w-full mx-auto px-2 sm:px-0 max-w-[min(960px,100%)] sm:max-w-none",children:(0,s.jsx)(O.Zp,{className:"border-2 border-primary/20 shadow-xl bg-white dark:bg-[#1a1a1a] transition-all duration-300 hover:shadow-2xl hover:border-primary/40",children:(0,s.jsx)(O.Wu,{className:"p-4 sm:p-6",children:(0,s.jsxs)("div",{className:"grid lg:grid-cols-2 gap-4 sm:gap-6 lg:gap-8",children:[(0,s.jsxs)("div",{className:"space-y-4 sm:sp
1ace-y-6 w-full max-w-full min-w-0",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs sm:text-sm font-medium mb-1.5 sm:mb-2",htmlFor:aS,children:N("promptLabel")}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(W.T,{ref:aI,id:aS,value:eO,maxLength:t2,onChange:e=>{let t=e.target.value;t.length<=t2&&(eM(t),eY&&eX(""))},placeholder:N("promptPlaceholder"),className:"min-h-[100px] sm:min-h-[120px] resize-none bg-[#fafafa] dark:bg-[#2a2a2a] border-2 border-black/15 dark:border-white/15 hover:border-black/25 dark:hover:border-white/25 focus:border-primary/50 transition-colors pb-10 sm:pb-12 text-sm sm:text-base",disabled:eF}),(0,s.jsxs)("div",{className:"absolute bottom-1.5 sm:bottom-2 left-1.5 sm:left-2 right-1.5 sm:right-2 flex items-center justify-between gap-1 sm:gap-2 pointer-events-none",children:[(0,s.jsx)("div",{className:"pointer-events-auto",children:(0,s.jsxs)(M.AM,{open:ad,onOpenChange:ac,children:[(0,s.jsx)(M.Wv,{asChild:!0,children:(0,s.jsxs)(h.$,{variant:"ghost",size:"sm",className:"gap-1 sm:gap-1.5 h-6 sm:h-7 text-[10px] sm:text-xs hover:bg-muted/80 px-1.5 sm:px-2",disabled:eF,children:[(0,s.jsx)(y.A,{className:"w-3 sm:w-3.5 h-3 sm:h-3.5"}),(0,s.jsx)("span",{children:N("templates")}),(0,s.jsx)(H.A,{className:"w-2.5 sm:w-3 h-2.5 sm:h-3"})]})}),(0,s.jsx)(M.hl,{align:"start",className:"w-[calc(100vw-2rem)] sm:w-80 p-2 sm:p-3",sideOffset:5,children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("h4",{className:"text-xs sm:text-sm font-medium",children:N("promptTemplates")}),(0,s.jsx)("button",{type:"button",onClick:()=>{0!==a_.length&&au(e=>(e+1)%a_.length)},className:"p-1 rounded-md hover:bg-muted transition-colors",title:"Refresh",children:(0,s.jsx)(J.A,{className:"w-3.5 sm:w-4 h-3.5 sm:h-4 text-muted-foreground"})})]}),(0,s.jsx)("div",{className:"space-y-1 max-h-56 sm:max-h-64 overflow-y-auto",children:aG.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>{eM(e.prompt),ac(!1)},className:"w-full text-left px-2 sm:px-3 py-1.5 sm:py-2 rounded-md hover:bg-muted transition-colors text-xs sm:text-sm",children:e.label},e.id))})]})})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-0.5 sm:gap-1.5 pointer-events-auto",children:[(0,s.jsxs)("span",{className:(0,p.cn)("text-[10px] sm:text-xs font-medium tabular-nums",eO.length>=.9*t2?"text-amber-500":eO.length>=t2?"text-destructive":"text-muted-foreground"),children:[eO.length,"/",t2]}),(0,s.jsx)("button",{type:"button",onClick:az,disabled:!eO||eF,className:"p-1 sm:p-1.5 rounded-md hover:bg-muted/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:R("copy"),children:eH?(0,s.jsx)(Z.A,{className:"w-3 sm:w-3.5 h-3 sm:h-3.5 text-green-500"}):(0,s.jsx)(Q.A,{className:"w-3 sm:w-3.5 h-3 sm:h-3.5"})}),(0,s.jsx)("button",{type:"button",onClick:()=>{eM("")},disabled:!eO||eF,className:"p-1 sm:p-1.5 rounded-md hover:bg-muted/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:R("clear"),children:(0,s.jsx)(ee.A,{className:"w-3 sm:w-3.5 h-3 sm:h-3.5"})})]})]})]})]}),tS&&(0,s.jsx)("div",{className:"mb-3 rounded-lg border border-sky-200 bg-sky-50 px-3 py-2 text-sky-900 text-xs sm:px-4 sm:py-3 sm:text-sm dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-100",children:"Z-Image currently supports text-to-image only. Reference images and resolution selection are disabled for this model."}),(0,s.jsxs)("div",{className:(0,p.cn)(tS&&"hidden"),children:[(0,s.jsxs)("label",{className:"block text-xs sm:text-sm font-medium mb-1.5 sm:mb-2",htmlFor:aC,children:[N("uploadImages")," ",N("optional")]}),tC&&(0,s.jsx)("p",{className:"mb-1.5 text-xs text-muted-foreground",children:N("basicReferenceHint")}),eB.length>0?(0,s.jsxs)("div",{className:"space-y-2 sm:space-y-3",children:[eB.length>1&&(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsxs)(h.$,{variant:"outline",size:"sm",onClick:()=>{eK([]),eq([]),tN(null),eY&&eX("")},className:"text-destructive text-xs sm:text-sm h-7 sm:h-8",children:[(0,s.jsx)(et.A,{className:"w-3.5 sm:w-4 h-3.5 sm:h-4 mr-1"}),N("removeAll")]})}),(0,s.jsx)("div",{className:(0,p.cn)("grid gap-1.5 sm:gap-2",1===eB.length?"grid-cols-1 max-w-[160px] sm:max-w-[192px] mx-auto":1===(v=eB.length)?"grid-cols-1":2===v||v<=4?"grid-cols-2":v<=6?"grid-cols-3":"grid-cols-4"),children:eB.map(e=>(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsx)(em.default,{src:e.url,alt:e.name,width:100,height:100,className:"rounded-lg object-cover w-full aspect-square"}),(0,s.jsx)("button",{type:"button",onClick:()=>aF(e.id),className:"absolute top-1 sm:top-2 right-1 sm:right-2 p-1 sm:p-1.5 bg-destructive text-destructive-foreground rounded-full opacity-100 sm:opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(ee.A,{className:"w-3 sm:w-4 h-3 sm:h-4"})})]},e.id))}),(tC||eB.length<tO)&&(0,s.jsxs)(h.$,{variant:"outline",onClick:()=>aN.current?.click(),className:"w-full text-xs sm:text-sm h-8 sm:h-10",children:[(0,s.jsx)(ea.A,{className:"w-3.5 sm:w-4 h-3.5 sm:h-4 mr-1.5 sm:mr-2"}),tC?"Replace reference image":N("addMoreFiles")]})]}):(0,s.jsxs)("div",{className:"border-2 border-dashed border-black/15 dark:border-white/15 rounded-lg p-4 sm:p-8 text-center cursor-pointer hover:border-black/25 dark:hover:border-white/25 transition-colors bg-[#fafafa] dark:bg-[#2a2a2a]",onClick:()=>aj.current?.click(),children:[(0,s.jsx)(ea.A,{className:"w-8 sm:w-12 h-8 sm:h-12 mx-auto text-muted-foreground
1/50 mb-2 sm:mb-3"}),(0,s.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:N("uploadPrompt")})]}),(0,s.jsx)("input",{ref:aj,type:"file",accept:tC?X.MK.join(","):"image/*",multiple:!tC,onChange:aU,id:aC,className:"hidden","aria-label":"Upload images for AI generation"}),(0,s.jsx)("input",{ref:aN,type:"file",accept:tC?X.MK.join(","):"image/*",multiple:!tC,onChange:aU,id:aT,className:"hidden","aria-label":"Upload additional images"})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"block text-xs sm:text-sm font-medium mb-1.5 sm:mb-2",children:N("selectModel")}),(0,s.jsx)("div",{className:"border-2 rounded-lg border-primary bg-primary/5 p-3 transition-all",children:(0,s.jsxs)(B.l6,{value:tx,onValueChange:e=>{if("free"===e){if(eB.length>X.f9){ep.o.error("Free supports one reference image. Remove extra images before switching.");return}tN(null),ty("1:1"),tI("1K")}tb(e)},disabled:eF,children:[(0,s.jsx)(B.bq,{className:"w-full text-[12px] sm:text-sm h-auto py-1.5",size:"sm",children:(0,s.jsx)(B.yv,{})}),(0,s.jsxs)(B.gC,{children:[w&&(0,s.jsx)(B.eb,{value:"free",textValue:tR?`Automatic1111 Basic ${l.qH} ${tT("label")}`:"Free 0 credits",children:(0,s.jsxs)("span",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:tR?"Automatic1111 Basic":"Free"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:tR?`${l.qH} ${tT("label")}`:"0 credits"})]})}),(0,s.jsx)(B.eb,{value:"z-image",textValue:`Z-Image ${t4(tJ)} credits`,children:(0,s.jsxs)("span",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:"Z-Image"}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[t4(tJ)," credits"]})]})}),(0,s.jsx)(B.eb,{value:"lite",textValue:`GPT Image 2 ${t4(tY)} credits`,children:(0,s.jsxs)("span",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:"GPT Image 2"}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[t4(tY)," credits"]})]})}),(0,s.jsx)(B.eb,{value:"nano-banana",textValue:`Nano Banana 2 ${t4(tV)} credits`,children:(0,s.jsxs)("span",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:"Nano Banana 2"}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[t4(tV)," credits"]})]})}),(0,s.jsx)(B.eb,{value:"pro",textValue:`Nano Banana Pro ${t4(tX)} credits`,children:(0,s.jsxs)("span",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:"Nano Banana Pro"}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[t4(tX)," credits"]})]})}),(0,s.jsx)(B.eb,{value:"flux-klein",textValue:`FLUX.2 Klein 4B ${t4(tH)} credits`,children:(0,s.jsxs)("span",{className:"flex w-full items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:"FLUX.2 Klein 4B"}),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[t4(tH)," credits"]})]})})]})]})})]}),(0,s.jsxs)("div",{className:(0,p.cn)("grid grid-cols-1 gap-2 sm:grid-cols-2 sm:gap-3",(tS||tC)&&"sm:grid-cols-1"),children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[10px] sm:text-xs font-medium text-muted-foreground mb-1.5 sm:mb-2 truncate",htmlFor:aA,children:N("aspectRatio")}),(0,s.jsx)("select",{id:aA,value:tv,onChange:e=>ty(e.target.value),disabled:eF,className:"w-full px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm rounded-md border-2 border-black/15 dark:border-white/15 bg-[#fafafa] dark:bg-[#2a2a2a]",children:tD.map(e=>(0,s.jsx)("option",{value:e,children:a2(e)},e))})]}),(0,s.jsxs)("div",{className:(0,p.cn)((tS||tC)&&"hidden"),children:[(0,s.jsx)("label",{className:"block text-[10px] sm:text-xs font-medium text-muted-foreground mb-1.5 sm:mb-2 truncate",htmlFor:aP,children:N("quality")}),(0,s.jsx)("select",{id:aP,value:tk,onChange:e=>
1tI(e.target.value),disabled:eF,className:"w-full px-2 sm:px-3 py-1.5 sm:py-2 text-xs sm:text-sm rounded-md border-2 border-black/15 dark:border-white/15 bg-[#fafafa] dark:bg-[#2a2a2a]",children:tK.map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]})]}),eY&&(0,s.jsxs)("div",{className:"flex items-start gap-1.5 sm:gap-2 p-2.5 sm:p-4 bg-red-50 dark:bg-red-950 text-red-700 dark:text-red-300 border-2 border-red-200 dark:border-red-800 rounded-md shadow-lg",children:[(0,s.jsx)(es.A,{className:"h-4 sm:h-5 w-4 sm:w-5 flex-shrink-0 mt-0.5 text-red-500"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("p",{className:"text-xs sm:text-sm font-medium",children:eY}),eV&&(0,s.jsx)(h.$,{asChild:!0,variant:"outline",size:"sm",className:"mt-2",children:(0,s.jsxs)(eh(),{href:"/my-images",children:[(0,s.jsx)(er.A,{className:"w-4 h-4 mr-2"}),N("goToGallery")]})})]})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3",children:[!tC&&(0,s.jsx)(F.E,{isPublic:eZ,onPublicChange:eQ,copyProtection:e0,onCopyProtectionChange:e1,disabled:eF}),(0,s.jsxs)("button",{type:"button",onClick:()=>{t0(),eM(""),eK([]),eq([]),eX(""),tb(tf),ty("free"===tf?"1:1":"auto"),eG()},disabled:!eO&&0===eB.length&&0===eW.length,className:(0,p.cn)("flex items-center justify-center gap-1.5 sm:gap-2 px-2 sm:px-3 py-1.5 sm:py-2 rounded-lg font-medium text-xs sm:text-sm transition-all duration-200","border-2 border-black/20 dark:border-white/20 bg-[#fafafa] dark:bg-[#2a2a2a] hover:bg-black/5 dark:hover:bg-white/5","disabled:opacity-50 disabled:cursor-not-allowed","w-full sm:w-auto"),title:N("resetAll"),children:[(0,s.jsx)(ei.A,{className:"w-3.5 sm:w-4 h-3.5 sm:h-4"}),(0,s.jsx)("span",{children:N("reset")})]})]}),t$&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border/50 bg-muted/30 px-3 py-2 text-xs sm:text-sm",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:tT("title")}),(0,s.jsxs)("span",{className:"font-semibold text-primary",children:[tG?"…":tE?"—":`${t4(tA?.availableCredits??0)}/${tA?.creditLimit??10}`," \xb7 ",tT("basicCost"),": ",l.qH]})]}),ej&&!tC&&(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border/50 bg-muted/30 px-3 sm:px-4 py-1.5 sm:py-2",children:[(0,s.jsx)("span",{className:"text-xs sm:text-sm text-muted-foreground",children:N("availableCredits")}),(0,s.jsx)("span",{className:"font-semibold text-primary text-sm sm:text-base",children:t4(eN||0)})]}),(0,s.jsx)(h.$,{ref:ak,disabled:eF,className:(0,p.cn)("w-full transition-all duration-300 text-sm sm:text-base h-10 sm:h-11 notranslate",eY&&!eF&&(t5?"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white shadow-lg":"bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-600 hover:to-amber-600 text-white shadow-lg")),size:"lg",translate:"no",children:eF?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(en.A,{className:"mr-1.5 sm:mr-2 h-4 sm:h-5 w-4 sm:w-5 animate-spin"}),N("generating")," ",tu,"%"]}):eY?t5&&!tC?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y.A,{className:"mr-1.5 sm:mr-2 h-4 sm:h-5 w-4 sm:w-5"}),"Use Stable Model • Retry"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(J.A,{className:"mr-1.5 sm:mr-2 h-4 sm:h-5 w-4 sm:w-5"}),ej?tC?t$?`${N("generate")} \xb7 ${l.qH} ${tT("label")}`:"Try again \xb7 0 credits":`${N("tryAgain")} • ${tZ} ${N("credits")}`:tC?`${N("tryAgain")} \xb7 ${N("free")}`:N("tryAgain")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo.A,{className:"mr-1.5 sm:mr-2 h-4 sm:h-5 w-4 sm:w-5"}),ej?tC?tR?`${N("generate")} \xb7 ${l.qH} ${tT("label")}`:"Generate free \xb7 0 credits":`${N("generate")} • ${tZ} ${N("credits")}`:tC?`${N("generate")} \xb7 ${N("free")}`:N("generate")]})}),!tC&&(0,s.jsx)(z,{className:"mt-4",onOpenPricing:()=>aq("default")})]}),(0,s.jsxs)("div",{ref:ab,className:"space-y-2 sm:space-y-3 w-full max-w-full min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[(0,s.jsx)(y.A,{className:"w-4 sm:w-5 h-4 sm:h-5 text-primary"}),(0,s.jsx)("h3",{className:"text-base sm:text-lg font-semibold text-foreground",children:tw})]}),eW.length>0?(0,s.jsx)("div",{children:eW.map((e,t)=>(0,s.jsxs)("div",{className:"relative group",onContextMenu:e=>e.preventDefault(),onDragStart:e=>e.preventDefault(),children:[e.startsWith("blob:")?(0,s.jsx)("img",{src:e,alt:`Generated ${t+1}`,className:"w-full rounded-lg select-none pointer-events-none",draggable:!1,onContextMenu:e=>e.preventDefault()}):(0,s.jsx)(em.default,{src:e,alt:`Generated ${t+1}`,width:1024,height:1024,className:"w-full rounded-lg select-none pointer-events-none",draggable:!1,onContextMenu:e=>e.preventDefault()}),(0,s.jsx)(K.R,{model:tx,show:!t5&&!tC}),(0,s.jsxs)(h.$,{size:"sm",variant:"secondary",onClick:()=>aM(e,t),className:"absolute top-2 sm:top-4 left-2 sm:left-4 text-[10px] sm:text-xs h-6 sm:h-8 px-2 sm:px-3 bg-white/90 dark:bg-gray-800/90 backdrop-blur-sm hover:bg-white dark:hover:bg-gray-700 shadow-md",children:[(0,s.jsx)(ea.A,{className:"w-3 sm:w-4 h-3 sm:h-4 mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:N("useAsInput")}),(0,s.jsx)("span",{className:"sm:hidden",children:"Use"})]}),(0,s.jsxs)(h.$,{size:"sm",onClick:()=>a5(e,t),disabled:null!==ta,className:"absolute bottom-2 sm:bottom-4 right-2 sm:right-4 text-[10px] sm:text-xs h-6 sm:h-8 px-2 sm:px-3 bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-600 hover:to-amber-600 text-white shadow-md",children:[ta===t?(0,s.jsx)(en.A,{className:"w-3 sm:w-4 h-3 sm:h-4 mr-1 animate-spin"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(el.A,{className:"w-3 sm:w-4 h-3 sm:h-4 mr-0.5"}),(0,s.jsx)($.A,{className:"w-2.5 sm:w-3 h-2.5 sm:h-3 text-amber-100 mr-1"})]}),(0,s.jsx)("span",{className:"hidden sm:inline",children:ta===t?"Downloading...":N("download")}),(0,s.jsx)("span",{className:"sm:hidden",children:ta===t?"...":"Save"})]})]},t))}):(0,s.jsx)("div",{className:"relative rounded-lg overflow-hidden bg-background/20 min-h-[350px] sm:min-h-[500px] flex flex-col items-center justify-center p-2 sm:p-4",onMouseEnter:()=>ap(!1),onMouseLeave:()=>ap(!0),children:eY&&!eF?(0,s.jsxs)("div",{className:"w-full flex flex-col items-center justify-center text-center space-y-4 sm:sp
1ace-y-6 p-4 sm:p-6",children:[(0,s.jsx)("div",{className:"w-16 h-16 sm:w-20 sm:h-20 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,s.jsx)(es.A,{className:"w-8 h-8 sm:w-10 sm:h-10 text-red-500"})}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h4",{className:"text-base sm:text-lg font-semibold text-foreground",children:N("generationFailed")}),(0,s.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground leading-relaxed",children:eY}),!t5&&(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-xs sm:text-sm font-semibold text-amber-600 dark:text-amber-400",children:_("reliabilityHeadline")}),(0,s.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:_("reliabilitySubhead")})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:flex-row sm:items-center sm:justify-center",children:[eV&&(0,s.jsx)(h.$,{asChild:!0,variant:"outline",children:(0,s.jsxs)(eh(),{href:"/my-images",children:[(0,s.jsx)(er.A,{className:"w-4 h-4 mr-2"}),N("goToGallery")]})}),t5?(0,s.jsx)(h.$,{className:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white shadow-lg",onClick:()=>{tb("pro"),eX(""),setTimeout(()=>a0(),0)},children:"Use Stable Model • Retry"}):(0,s.jsxs)(h.$,{onClick:()=>{ae.current&&(clearTimeout(ae.current),ae.current=null),aq("failure")},className:"bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-600 hover:to-amber-600 text-white shadow-lg",children:[(0,s.jsx)(y.A,{className:"w-4 h-4 mr-2"}),N("upgradeForBetterResults")]})]}),!t5&&(0,s.jsx)("div",{className:"w-full text-left",children:(0,s.jsxs)("div",{className:"mt-2 rounded-xl border border-border/60 bg-background/40 p-3 sm:p-4",children:[(0,s.jsx)("h5",{className:"text-sm sm:text-base font-semibold text-foreground",children:_("title")}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(U.PricingTable,{showCreditsOption:!0,forceMobileLayout:!0})})]})})]}):tn||tl?(0,s.jsx)(k,{isActive:tn,duration:60,onComplete:()=>{ej?aV("payment"):aV("login")},result:tl,onLoginClick:()=>{G.push(E.BV.Login)},onPaymentClick:()=>{aq("credits")},showAccelerateButton:tc&&tn,onAccelerateClick:aQ}):eF?(0,s.jsx)("div",{className:"w-full space-y-3 sm:space-y-4",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center p-6 sm:p-8 rounded-xl bg-muted/30 border border-border/50",children:[(0,s.jsx)("div",{className:"relative mb-4",children:(0,s.jsx)("div",{className:"w-16 h-16 sm:w-20 sm:h-20 rounded-full bg-primary/20 flex items-center justify-center",children:(0,s.jsx)(en.A,{className:"h-8 w-8 sm:h-10 sm:w-10 animate-spin text-primary"})})}),(0,s.jsxs)("p",{className:"text-3xl sm:text-4xl font-bold text-primary mb-2",children:[tu,"%"]}),te?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-3 mb-4",children:[(0,s.jsx)("p",{className:"text-muted-foreground text-center text-xs sm:text-sm",children:N("generationTakingLong")}),(0,s.jsx)(h.$,{asChild:!0,variant:"outline",size:"sm",children:(0,s.jsxs)(eh(),{href:"/my-images",children:[(0,s.jsx)(er.A,{className:"w-4 h-4 mr-2"}),N("goToGallery")]})})]}):(0,s.jsx)("p",{className:"text-muted-foreground text-center text-sm sm:text-base mb-4",children:N("generatingText")}),(0,s.jsx)("div",{className:"w-full max-w-sm",children:(0,s.jsx)("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-gradient-to-r from-primary to-primary/80 rounded-full transition-all duration-300 ease-out",style:{width:`${tu}%`}})})}),tC&&(0,s.jsxs)("div",{className:"mt-4 flex w-full max-w-sm items-start gap-2.5 rounded-xl border border-primary/15 bg-primary/[0.04] px-3 py-2.5 text-left",children:[(0,s.jsx)(es.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-foreground",children:"Keep this tab open"}),(0,s.jsx)("p",{className:"mt-1 text-[11px] leading-4 text-muted-foreground",children:"Your free result is temporary and will appear here when it is ready."})]})]}),tc&&!t5&&(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(x,{onClick:aQ})})]})}
1):(0,s.jsxs)("div",{className:"w-full max-w-2xl",ref:ax,children:[(0,s.jsx)("div",{className:"mb-2 sm:mb-4 min-h-[240px] sm:min-h-[320px] lg:min-h-[360px]",children:(()=>{let e=a_[am];if(!e)return null;let t=ew(e.image),a=t?.fallback??e.image;return(0,s.jsxs)("button",{type:"button",onClick:()=>aD(e),"aria-label":`${N("useThisExample")} \xb7 ${e.title}`,className:"relative w-full h-full rounded-lg overflow-hidden focus-visible:outline focus-visible:ring focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background cursor-pointer",children:[(0,s.jsxs)("picture",{children:[t?.srcSet&&(0,s.jsx)("source",{srcSet:t.srcSet,sizes:"(max-width: 768px) 100vw, 640px"}),(0,s.jsx)("img",{src:a,alt:e.title,width:1536,height:2752,className:"w-full h-auto",loading:"lazy",decoding:"async",sizes:"(max-width: 768px) 100vw, 640px"})]}),(0,s.jsx)("span",{className:"absolute bottom-2 sm:bottom-3 left-2 sm:left-3 bg-black/70 text-white text-xs sm:text-sm px-2 sm:px-3 py-1 sm:py-1.5 rounded",children:e.title})]})})()}),(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2 sm:mb-4",children:[(0,s.jsx)(h.$,{variant:"secondary",size:"icon",onClick:()=>au(e=>(e-1+a_.length)%a_.length),className:"bg-background border-2 border-primary/30 shadow-xl hover:bg-background/90 hover:border-primary/50 transition-all hover:scale-110 h-8 w-8 sm:h-10 sm:w-10","aria-label":N("previousExample"),children:(0,s.jsx)(ed.A,{className:"w-4 sm:w-6 h-4 sm:h-6 text-foreground"})}),(0,s.jsx)("div",{className:"flex gap-1.5 sm:gap-2",children:a_.map((e,t)=>{let a=t===am;return(0,s.jsx)("button",{type:"button",onClick:()=>au(t),className:"flex items-center justify-center w-6 h-6 sm:w-8 sm:h-8 rounded-full hover:bg-muted/50 transition-colors","aria-label":N("selectExample",{index:t+1}),"aria-pressed":a,children:(0,s.jsx)("span",{className:`rounded-full transition-all duration-200 ${a?"w-4 sm:w-6 h-1.5 sm:h-2 bg-primary":"w-1.5 sm:w-2 h-1.5 sm:h-2 bg-muted-foreground/50"}`})},t)})}),(0,s.jsx)(h.$,{variant:"secondary",size:"icon",onClick:()=>au(e=>(e+1)%a_.length),className:"bg-background border-2 border-primary/30 shadow-xl hover:bg-background/90 hover:border-primary/50 transition-all hover:scale-110 h-8 w-8 sm:h-10 sm:w-10","aria-label":N("nextExample"),children:(0,s.jsx)(ec.A,{className:"w-4 sm:w-6 h-4 sm:h-6 text-foreground"})})]}),(0,s.jsxs)(h.$,{onClick:()=>aD(a_[am]),className:"w-full transition-all text-sm sm:text-base h-9 sm:h-11",size:"lg",children:[(0,s.jsx)(y.A,{className:"w-3.5 sm:w-4 h-3.5 sm:h-4 mr-1.5 sm:mr-2"}),N("useThisExample")]})]})}),e8&&(eC?.status==="active"||eT)&&(0,s.jsx)(I.l,{},e6)]})]})})})})]}),(0,s.jsx)(D.S,{open:as,onOpenChange:ar,onExampleSelect:e=>{let t=a_.find(t=>t.prompt===e.prompt);t&&aD(t),ar(!1)},examples:a_}),(0,s.jsx)(m.F,{open:ai,onOpenChange:an,callbackUrl:`${window.location.pathname}${window.location.search}`}),(0,s.jsx)(u.I,{open:ao,onOpenChange:al,currentCredits:eN||0,requiredCredits:tZ}),(0,s.jsx)(L.e,{open:e5,onOpenChange:e=>{e2(e),e||e3("default")},context:e4,requiredCredits:tZ}),(0,s.jsx)(L.e,{open:tr,onOpenChange:ti,context:"download"})]})}},72659:(e,t,a)=>{a.d(t,{Y:()=>r,c:()=>s});var s=function(e){return e.WEEK="week",e.MONTH="month",e.YEAR="year",e}({}),r=function(e){return e.SUBSCRIPTION="subscription",e.ONE_TIME="one_time",e}({})},75118:(e,t,a)=>{a.d(t,{y:()=>c});var s=a(8805),r=a(29204),i=a(4302),n=a(64842);let o=function(e){let t=0,a=null,s=null,r=()=>{t++,a=null,s=null},i=e=>new Response(e.body.slice(0),{status:e.status,statusText:e.statusText,headers:e.headers}),n=async(o,l)=>{let d=new URL(o instanceof Request?o.url:String(o),e()),c=d.pathname.endsWith("/api/auth/get-session"),m=(l?.method??(o instanceof Request?o.method:"GET")).toUpperCase(),u=d.pathname.includes("/api/auth/")&&!c&&"GET"!==m&&"HEAD"!==m;if(!c){u&&r();try{return await fetch(o,l)}finally{u&&r()}}if(a&&Date.now()-a.ts<1e3)return i(a);let h=t;if(!s){let e=(async()=>{let e=await fetch(o,l),s={ts:Date.now(),status:e.status,statusText:e.statusText,headers:Array.from(e.headers.entries()),body:await e.arrayBuffer()};return h===t&&e.ok&&(a=s),s})();s=e,e.finally(()=>{s===e&&(s=null)}
1).catch(()=>{})}let p=await s;return h!==t?n(o,l):i(p)};return{fetch:n,clear:r}}(n.$_);o.clear;let l="__automatic1111_authClient__",d=globalThis;d[l]||(d[l]=(0,i.M)({baseURL:(0,n.$_)(),fetchOptions:{retry:0,customFetchImpl:async(e,t)=>{try{return await o.fetch(e,t)}catch{return Response.error()}}},plugins:[(0,r.px)(),(0,r.Zn)(),...s.u.auth.enableGoogleOneTap?[(0,r.ll)({clientId:"59140360588-9i84uvrovu1o3urr73n0qgce1h6u8ev3.apps.googleusercontent.com",autoSelect:!1,cancelOnTapOutside:!1,context:"signin",promptOptions:{baseDelay:1e3,maxAttempts:1,fedCM:!1}})]:[]]}));let c=d[l]},76601:(e,t,a)=>{async function s(e,t={}){let a,{maxWidth:n=2048,maxHeight:o=2048,quality:l=.8,mimeType:d="image/jpeg"}=t,c=0;"string"==typeof e?(a=e,e.startsWith("data:")&&(c=Math.round(3*e.length/4))):(c=e.size,a=await i(e));try{return await r(a,c,{maxWidth:n,maxHeight:o,quality:l,mimeType:d})}catch(s){if("string"!=typeof e||!/^https?:\/\//i.test(e))throw s;let t=await fetch(`/api/proxy-download?url=${encodeURIComponent(e)}`);if(!t.ok)throw s;let a=await t.blob();return r(await i(a),a.size,{maxWidth:n,maxHeight:o,quality:l,mimeType:d})}}function r(e,t,a){let{maxWidth:s,maxHeight:r,quality:i,mimeType:n}=a;return new Promise((a,o)=>{let l=new Image;l.crossOrigin="anonymous",l.onload=()=>{try{let{width:e,height:d}=l;if(e>s||d>r){let t=Math.min(s/e,r/d);e=Math.round(e*t),d=Math.round(d*t)}let c=document.createElement("canvas");c.width=e,c.height=d;let m=c.getContext("2d");if(!m){o(Error("Failed to get canvas context"));return}m.drawImage(l,0,0,e,d),c.toBlob(s=>{if(!s){o(Error("Failed to compress image"));return}let r=c.toDataURL(n,i);a({blob:s,dataUrl:r,width:e,height:d,originalSize:t,compressedSize:s.size})},n,i)}catch(e){o(e)}},l.onerror=()=>{o(Error("Failed to load image"))},l.src=e})}function i(e){return new Promise((t,a)=>{let s=new FileReader;s.onloadend=()=>{t(s.result)},s.onerror=a,s.readAsDataURL(e)})}a.d(t,{w4:()=>s})},80232:(e,t,a)=>{a.d(t,{XO:()=>i,iN:()=>l,tx:()=>d});var s=a(25355),r=a(17748);let{Link:i,getPathname:n,redirect:o,usePathname:l,useRouter:d}=(0,s.A)(r.DT)},80993:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>p,gC:()=>h,l6:()=>d,s3:()=>c,yv:()=>m});var s=a(55763);a(67571);var r=a(84794),i=a(14652),n=a(97726),o=a(61629),l=a(40538);function d({...e}){return(0,s.jsx)(r.bL,{"data-slot":"select",...e})}function c({...e}){return(0,s.jsx)(r.YJ,{"data-slot":"select-group",...e})}function m({...e}){return(0,s.jsx)(r.WT,{"data-slot":"select-value",...e})}function u({className:e,size:t="default",children:a,"aria-label":n="Select an option",...o}){return(0,s.jsxs)(r.l9,{"data-slot":"select-trigger","data-size":t,"aria-label":n,className:(0,l.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full min-w-0 items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm text-left shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[a,(0,s.jsx)(r.In,{asChild:!0,children:(0,s.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function h({className:e,children:t,position:a="popper",...i}){return(0,s.jsx)(r.ZL,{children:(0,s.jsxs)(r.UC,{"data-slot":"select-content",className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...i,children:[(0,s.jsx)(g,{}),(0,s.jsx)(r.LM,{className:(0,l.cn)("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,s.jsx)(f,{})]})})}function p({className:e,children:t,...a}){return(0,s.jsxs)(r.q7,{"data-slot":"select-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[(0,s.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(r.VF,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(r.p4,{children:t})]})}function g({className:e,...t}){return(0,s.jsx)(r.PP,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,s.jsx)(o.A,{className:"size-4"})})}function f({className:e,...t}){return(0,s.jsx)(r.wn,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,s.jsx)(i.A,{className:"size-4"})})}},91331:(e,t,a)=>{a.d(t,{PricingFooter:()=>i});var s=a(55763),r=a(61116);function i(){let e=(0,r.c3)("PricingPage.CreditPackages");return(0,s.jsx)("div",{className:"mx-auto w-full min-w-0 max-w-3xl text-center",children:(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[e("footer.contact")," ",(0,s.jsx)("a",{href:`mailto:${e("footer.email")}`,className:"text-primary hover:underline",children:e("footer.email")})]})})}},92491:(e,t,a)=>{a.d(t,{P:()=>s});let s="A premium skincare bottle on a warm beige stone pedestal, soft morning sunlight, delicate leaf shadows, minimalist studio background, elegant product photography, realistic details, no text."},96363:(e,t,a)=>{a.d(t,{T:()=>n});var s=a(55763),r=a(67571),i=a(40538);let n=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)("textarea",{ref:a,"data-slot":"textarea",className:(0,i.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t}));n.displayName="Textarea"},97289:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var s=a(55763),r=a(24915),i=a(55165),n=a(75393),o=a(67571);function l({section:e}){if(e.disabled)return null;let[t,a]=(0,o.useState)(0),l=e.items?.length||4;return(0,s.jsx)("section",{id:e.name,className:"relative py-16 overflow-hidden bg-background sm:py-24",children:(0,s.jsx)("div",{className:"container",children:(0,s.jsxs)("div",{className:"mx-auto max-w-6xl space-y-8 px-4 lg:space-y-20",children:[(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)(r.A,{direction:"up",children:(0,s.jsx)("h2",{className:"mb-6 text-pretty text-3xl font-bold text-foreground sm:text-4xl lg:text-5xl",children:e.title})}),e.description&&(0,s.jsx)(r.A,{direction:"up",delay:.05,children:(0,s.jsx)("p",{className:"mx-auto mt-6 max-w-4xl text-base text-muted-foreground sm:text-lg",children:e.description})})]}),(0,s.jsx)(r.A,{direction:"up",delay:.1,children:(0,s.jsxs)("div",{className:"space-y-8 rounded-3xl border border-border/80 bg-muted/5 p-6 shadow-lg sm:p-10",children:[(0,s.jsx)("div",{className:"relative h-1.5 overflow-hidden rounded-full bg-border/50",children:(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 rounded-full bg-primary transition-all duration-300",style:{width:`${(t+1)/l*100}%`}})}),(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:e.items?.map((e,r)=>
1{let i=r===t,n=r+1;return s.jsxs("div",{className:`flex h-full flex-col gap-3 rounded-2xl border p-5 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 focus-visible:ring-offset-2 ${i?"border-primary bg-primary/10 text-foreground":"border-border bg-background/40 text-muted-foreground hover:border-primary/60 hover:text-foreground"}`,onMouseEnter:()=>a(r),children:[s.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-full text-lg font-bold transition-colors ${i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:n}),s.jsx("h3",{className:"text-base font-semibold leading-tight",children:e.title}),s.jsx("p",{className:"text-sm leading-relaxed",children:e.description}),e.label&&s.jsx("div",{className:"mt-auto pt-2",children:s.jsxs("p",{className:"text-xs uppercase tracking-wider opacity-60",children:["• ",e.label]})})]},r)})})]})}),e.buttons&&e.buttons.length>0&&(0,s.jsx)(r.A,{direction:"up",delay:.15,children:(0,s.jsx)("div",{className:"flex justify-center pt-8",children:(0,s.jsxs)(i.$,{size:"lg",className:"gap-2",onClick:()=>{let t=e.buttons?.[0];t?.url&&(window.location.href=t.url)},children:[(0,s.jsx)(n.A,{className:"h-5 w-5"}),e.buttons[0].title]})})})]})})})}},99638:(e,t,a)=>{a.d(t,{Hr:()=>g,Ht:()=>f,I:()=>u,M5:()=>y,SQ:()=>m,_2:()=>h,hO:()=>p,lp:()=>x,lv:()=>w,mB:()=>b,nV:()=>v,rI:()=>d,ty:()=>c});var s=a(55763);a(67571);var r=a(87946),i=a(97726),n=a(67234),o=a(79182),l=a(40538);function d({...e}){return(0,s.jsx)(r.bL,{"data-slot":"dropdown-menu",...e})}function c({...e}){return(0,s.jsx)(r.l9,{"data-slot":"dropdown-menu-trigger",...e})}function m({className:e,sideOffset:t=4,...a}){return(0,s.jsx)(r.ZL,{children:(0,s.jsx)(r.UC,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...a})})}function u({...e}){return(0,s.jsx)(r.YJ,{"data-slot":"dropdown-menu-group",...e})}function h({className:e,inset:t,variant:a="default",...i}){return(0,s.jsx)(r.q7,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i})}function p({className:e,children:t,checked:a,...n}){return(0,s.jsxs)(r.H_,{"data-slot":"dropdown-menu-checkbox-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...n,children:[(0,s.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(r.VF,{children:(0,s.jsx)(i.A,{className:"size-4"})})}),t]})}function g({...e}){return(0,s.jsx)(r.z6,{"data-slot":"dropdown-menu-radio-group",...e})}function f({className:e,children:t,...a}){return(0,s.jsxs)(r.hN,{"data-slot":"dropdown-menu-radio-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[(0,s.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(r.VF,{children:(0,s.jsx)(n.A,{className:"size-2 fill-current"})})}),t]})}function x({className:e,inset:t,...a}){return(0,s.jsx)(r.JU,{"data-slot":"dropdown-menu-label","data-inset":t,className:(0,l.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function b({className:e,...t}){return(0,s.jsx)(r.wv,{"data-slot":"dropdown-menu-separator",className:(0,l.cn)("bg-border -mx-1 my-1 h-px",e),...t})}function w({...e}){return(0,s.jsx)(r.Pb,{"data-slot":"dropdown-menu-sub",...e})}function v({className:e,inset:t,children:a,...i}){return(0,s.jsxs)(r.ZP,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...i,children:[a,(0,s.jsx)(o.A,{className:"ml-auto size-4"})]})}function y({className:e,...t}){return(0,s.jsx)(r.G5,{"data-slot":"dropdown-menu-sub-content",className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}}}]);

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.