1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="347868f0-af30-6f09-5bcd-bf1df91d1efe")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,328371,897206,e=>{"use strict";var t=e.i(843476),r=e.i(657688),a=e.i(522016),s=e.i(972520),i=e.i(463059),o=e.i(565365),l=e.i(283086),n=e.i(550827),d=e.i(892280),c=e.i(398552),u=e.i(217108);function m({pair:e}){return(0,t.jsx)("div",{className:"relative w-full min-w-0 px-2 py-1 sm:px-3 sm:py-1.5 md:px-4","aria-hidden":!0,children:(0,t.jsxs)("div",{className:"relative w-full",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -inset-3 rounded-3xl bg-gradient-to-br from-violet-500/25 via-blue-500/10 to-cyan-500/15 blur-2xl"}),(0,t.jsx)("div",{className:"relative overflow-hidden rounded-2xl border border-foreground/10 bg-white p-2 shadow-xl ring-1 ring-foreground/5 sm:p-2.5 dark:border-white/10 dark:bg-white dark:ring-white/10",children:(0,t.jsx)("div",{className:"overflow-hidden rounded-lg",children:(0,t.jsx)(r.default,{src:"https://assets.geniemode.com/geniemode-assets/frontend-uploads/0476bf3d-0897-4879-9731-cc54f93a78ef/Screenshot_2026-05-15_at_3.29.41_PM.png?format=webp",alt:"My Design Reviews workspace showing batches, filters, and designer chat",width:1200,height:720,className:"max-h-48 w-full object-cover object-top sm:max-h-56 md:max-h-64",sizes:e?"(max-width: 1024px) 100vw, 48vw":"(max-width: 1024px) 100vw, min(90rem, 100vw)",priority:!1})})})]})})}function h({pair:e=!1,viewMoreOnly:r=!1}){return(0,t.jsx)("section",{className:(0,c.cn)(!e&&"pb-6 pt-1 lg:pb-10 lg:pt-2",e&&"min-w-0"),"aria-labelledby":"design-review-promo-heading",children:(0,t.jsx)("div",{className:(0,c.cn)(e?"min-w-0":"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"),children:(0,t.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-foreground
2/10 bg-gradient-to-br from-violet-500/[0.07] via-background to-cyan-500/[0.06] dark:border-white/10 dark:from-violet-500/15 dark:via-background dark:to-cyan-500/10 lg:rounded-3xl",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -right-20 -top-20 h-56 w-56 rounded-full bg-violet-500/20 blur-3xl","aria-hidden":!0}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-16 -left-16 h-48 w-48 rounded-full bg-cyan-500/15 blur-3xl","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative flex flex-col gap-3 p-4 sm:p-6 lg:gap-4 lg:p-6",children:[(0,t.jsxs)("div",{className:"space-y-3 lg:space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(n.Badge,{className:"gap-1 border-violet-500/30 bg-violet-500/10 text-violet-700 dark:text-violet-200",children:[(0,t.jsx)(l.Sparkles,{className:"size-3","aria-hidden":!0}),"New"]}),(0,t.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Design review"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("h2",{id:"design-review-promo-heading",className:"text-lg font-semibold tracking-tight text-foreground sm:text-2xl lg:text-3xl",children:[(0,t.jsx)("span",{className:"lg:hidden",children:"Expert review on your AI designs"}),(0,t.jsxs)("span",{className:"hidden lg:inline",children:["Get"," ",(0,t.jsx)("span",{className:"gradient-text",children:"expert eyes"})," on your AI fashion designs"]})]}),(0,t.jsx)("p",{className:"max-w-2xl line-clamp-2 text-xs leading-snug text-muted-foreground sm:text-sm sm:leading-relaxed",children:"Send collections or selected looks to our designersâtrack batches, threaded feedback, and iteration without leaving Slayteq."})]})]}),(0,t.jsx)("div",{className:"w-[calc(100%+2rem)] max-w-none -mx-4 min-w-0 sm:w-[calc(100%+3rem)] sm:-mx-6 lg:w-[calc(100%+4rem)] lg:-mx-8",children:(0,t.jsx)(m,{pair:e})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row sm:flex-wrap sm:items-center sm:gap-2.5",children:[(0,t.jsx)(d.Button,{asChild:!0,variant:"outline",className:"h-9 w-full gap-2 rounded-full border-violet-500/30 bg-background/90 px-4 text-sm font-semibold shadow-sm ring-1 ring-violet-500/10 transition-colors hover:bg-violet-500/[0.06] hover:border-violet-500/45 sm:w-auto lg:h-10",children:(0,t.jsxs)(a.default,{href:"/design-review","aria-label":"Read the full design review guide",children:["View more",(0,t.jsx)(i.ChevronRight,{className:"size-4 opacity-80","aria-hidden":!0})]})}),r?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Button,{asChild:!0,variant:"gradient",className:"h-9 w-full gap-2 rounded-full px-4 shadow-md sm:w-auto lg:h-10",children:(0,t.jsxs)(a.default,{href:(0,u.collectionsTourUrl)(),children:["Send for review",(0,t.jsx)(s.ArrowRight,{className:"size-4"})]})}),(0,t.jsx)(d.Button,{asChild:!0,variant:"outline",className:"h-9 w-full gap-2 rounded-full border-border bg-background/80 px-4 sm:w-auto lg:h-10",children:(0,t.jsxs)(a.default,{href:"/collections/design-reviews",children:[(0,t.jsx)(o.MessageSquareText,{className:"size-4"}),"My reviews"]})})]})]})]})]})})})}e.s(["default",()=>h],328371);var p=e.i(581418),x=e.i(435073),g=e.i(510617);function b({pair:e}){return(0,t.jsx)("div",{className:"relative w-full min-w-0 px-2 py-1 sm:px-3 sm:py-1.5 md:px-4","aria-hidden":!0,children:(0,t.jsxs)("div",{className:"relative w-full",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -inset-3 rounded-3xl bg-gradient-to-br from-emerald-500/25 via-teal-500/10 to-cyan-500/15 blur-2xl"}),(0,t.jsx)("div",{className:"relative overflow-hidden rounded-2xl border border-foreground
2/10 bg-white p-2 shadow-xl ring-1 ring-foreground/5 sm:p-2.5 dark:border-white/10 dark:bg-white dark:ring-white/10",children:(0,t.jsx)("div",{className:"overflow-hidden rounded-lg",children:(0,t.jsx)(r.default,{src:"https://assets.geniemode.com/geniemode-assets/frontend-uploads/fcf77479-bb7e-4a75-b2ca-3bbbe752ded6/Screenshot_2026-05-18_at_6.24.37_PM.png?format=webp",alt:"Copyright and content usage report showing overall risk, pages analyzed, and brands detected",width:1200,height:720,className:"max-h-48 w-full object-cover object-top sm:max-h-56 md:max-h-64",sizes:e?"(max-width: 1024px) 100vw, 48vw":"(max-width: 1024px) 100vw, min(90rem, 100vw)",priority:!1})})})]})})}function f({pair:e=!1,viewMoreOnly:r=!1}){return(0,t.jsx)("section",{className:(0,c.cn)(!e&&"pb-6 pt-1 lg:pb-10 lg:pt-2",e&&"min-w-0"),"aria-labelledby":"content-usage-eligibility-promo-heading",children:(0,t.jsx)("div",{className:(0,c.cn)(e?"min-w-0":"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"),children:(0,t.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-foreground
2/10 bg-gradient-to-br from-emerald-500/[0.07] via-background to-teal-500/[0.06] dark:border-white/10 dark:from-emerald-500/12 dark:via-background dark:to-teal-500/10 lg:rounded-3xl",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -right-20 -top-20 h-56 w-56 rounded-full bg-emerald-500/20 blur-3xl","aria-hidden":!0}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-16 -left-16 h-48 w-48 rounded-full bg-teal-500/15 blur-3xl","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative flex flex-col gap-3 p-4 sm:p-6 lg:gap-4 lg:p-6",children:[(0,t.jsxs)("div",{className:"space-y-3 lg:space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(n.Badge,{className:"gap-1 border-emerald-500/35 bg-emerald-500/10 text-emerald-800 dark:text-emerald-200",children:[(0,t.jsx)(p.ShieldCheck,{className:"size-3","aria-hidden":!0}),"Brand safety"]}),(0,t.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Content usage"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("h2",{id:"content-usage-eligibility-promo-heading",className:"text-lg font-semibold tracking-tight text-foreground sm:text-2xl lg:text-3xl",children:[(0,t.jsx)("span",{className:"lg:hidden",children:"Check content usage eligibility"}),(0,t.jsxs)("span",{className:"hidden lg:inline",children:["Check"," ",(0,t.jsx)("span",{className:"bg-gradient-to-r from-emerald-600 to-teal-600 bg-clip-text text-transparent dark:from-emerald-300 dark:to-teal-300",children:"content usage eligibility"})," ","before you ship"]})]}),(0,t.jsx)("p",{className:"max-w-2xl line-clamp-2 text-xs leading-snug text-muted-foreground sm:text-sm sm:leading-relaxed",children:"Flag IP overlaps, unexpected marks, and risky similarity so you can adjust mocks and campaigns before launch."})]})]}),(0,t.jsx)("div",{className:"w-[calc(100%+2rem)] max-w-none -mx-4 min-w-0 sm:w-[calc(100%+3rem)] sm:-mx-6 lg:w-[calc(100%+4rem)] lg:-mx-8",children:(0,t.jsx)(b,{pair:e})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row sm:flex-wrap sm:items-center sm:gap-2.5",children:[(0,t.jsx)(d.Button,{asChild:!0,variant:"outline",className:"h-9 w-full gap-2 rounded-full border-emerald-500/35 bg-background/90 px-4 text-sm font-semibold shadow-sm ring-1 ring-emerald-500/10 transition-colors hover:bg-emerald-500/[0.06] hover:border-emerald-500/45 sm:w-auto lg:h-10",children:(0,t.jsxs)(a.default,{href:"/content-rights","aria-label":"Read the full content usage and rights guide",children:["View more",(0,t.jsx)(i.ChevronRight,{className:"size-4 opacity-80","aria-hidden":!0})]})}),r?null:(0,t.jsx)(d.Button,{asChild:!0,variant:"gradient",className:"h-9 w-full gap-2 rounded-full px-4 shadow-md sm:w-auto lg:h-10",children:(0,t.jsxs)(a.default,{href:"/collections",onClick:()=>(0,x.trackEvent)(g.EVENTS.CONTENT_RIGHTS_ENTRY_CLICK,{source:"home_promo"}),children:["Check Content Rights",(0,t.jsx)(s.ArrowRight,{className:"size-4"})]})})]})]})]})})})}e.s(["default",()=>f],897206)},666847,265046,741581,854184,554787,e=>{"use strict";let t,r,a="fashion_landing:pendingAction",s="fashion_resume";function i(e){if(e?.type){let t=JSON.stringify(e);try{localStorage.setItem(a,t)}catch{}try{sessionStorage.setItem(a,t)}catch{}}}function o(){let e=function(){try{let e=function(){try{return localStorage.getItem(a)||sessionStorage.getItem(a)}catch{return null}}();if(!e)return null;return JSON.parse(e)}catch{return null}}();try{localStorage.removeItem(a),sessionStorage.removeItem(a)}catch{}return e}function l(){return`/home?${s}=1`}function n(){return`/signup?redirect=${encodeURIComponent(l())}`}function d(){let e=new URL(window.location.href);if(!e.searchParams.has(s))return;e.searchParams.delete(s);let t=e.pathname+(e.searchParams.toString()?`?${e.searchParams}`:"")+e.hash;window.history.replaceState(null,"",t)}e.s(["buildFashionLandingReturnUrl",()=>l,"buildFashionLandingSignupUrl",()=>n,"readAndClearFashionLandingPendingAction",()=>o,"saveFashionLandingPendingAction",()=>i,"stripFashionResumeQueryFromUrl",()=>d],666847);var c=e.i(843476),u=e.i(271645),m=e.i(618566),h=e.i(575822),p=e.i(665088),x=e.i(387951),g=e.i(107233),b=e.i(239616),f=e.i(283086),v=e.i(837647),w=e.i(866531),N=e.i(37727),_=e.i(846696),k=e.i(892280),j=e.i(398552),y=e.i(966628),S=e.i(816748),E=e.i(113181),T=e.i(563139),O=e.i(162650),C=e.i(280068),I=e.i(1277),D=e.i(570579),A=e.i(885569),R=e.i(349349),M=e.i(185834),z=e.i(435073),L=e.i(510617),P=e.i(630244),U=e.i(454148),G=e.i(400970),B=e.i(335791),V=e.i(805406),F=e.i(100842);let H=["video/mp4","video/webm","video/quicktime"],$=["Flowing emerald silk gown with a draped open back","Oversized denim jacket with hand-embroidered floral cuffs","Minimalist linen co-ord set in warm sand tones"],W="gia_hero_spotlight_dismissed",q=(0,u.forwardRef)(function({variant:e="default",compact:t=!1,onRequireAuth:r,initialPrompt:a="",allowProgrammaticGenerate:s=!0},i){let o="fashion"===e,l=(0,m.useRouter)(),{isEditToolEnabled:n}=(0,G.useUserEditToolAccess)(),d=n("CREATE"),q=(0,u.useRef)(null),K=(0,u.useRef)(null),X=(0,u.useRef)(null),[Y,Q]=(0,u.useState)(()=>(a||"").slice(0,y.PROMPT_LIMITS.MAX)),[J,Z]=(0,u.useState)(!1),[ee,et]=(0,u.useState)(!1),[er,ea]=(0,u.useState)(""),[es,ei]=(0,u.useState)([]),[eo,el]=(0,u.useState)(0),en=eo>0,[ed,ec]=(0,u.useState)(null),[eu,em]=(0,u.useState)(!1),[eh,ep]=(0,u.useState)(!1),ex=(0,u.useRef)(0),[eg,eb]=(0,u.useState)(!1),[ef,ev]=(0,u.useState)(null),[ew,eN]=(0,u.useState)(!1),[e_,ek]=(0,u.useState)(""),[ej,ey]=(0,u.useState)(""),[eS,eE]=(0,u.useState)(null),eT=(0,A.useShowCreditCost)(),eO=!r,[eC,eI]=(0,u.useState)(y.GENERATION_MODES.IMAGE),[eD,eA]=(0,u.useState)(null),[eR,eM]=(0,u.useState)(null),[ez,eL]=(0,u.useState)(null),[eP,eU]=(0,u.useState)(null),[eG,eB]=(0,u.useState)(null),[eV,eF]=(0,u.useState)(1),[eH,e$]=(0,u.useState)(null),[eW,eq]=(0,u.useState)(!1),eK=eC===y.GENERATION_MODES.VIDEO,eX=eK?"GIA_VIDEO":"GIA",eY=(0,D.useCanUseAdminOnlySpeeds)(),eQ=(0,u.useRef)(null),[eJ,eZ]=(0,u.useState)({}),[e0,e5]=(0,u.useState)("apparel"),[e1,e2]=(0,u.useState)(""),[e4,e3]=(0,u.useState)(null),[e6,e8]=(0,u.useState)(!1);(0,u.useEffect)(()=>
2{if(!eO)return;let e=!1;return M.studioAPI.fetchMultipliers().then(t=>{e||eA(t)}).catch(e=>{console.warn("Failed to load generation settings:",e)}),()=>{e=!0}},[eO]),(0,u.useEffect)(()=>{if(!eD)return;let e=eD.models?.[eX]??{},t="GIA_VIDEO"===eX?(0,C.preferredVideoSettings)(eD,eY):(0,I.preferredImageSettings)(eD);eM(t.aspectRatio??(0,O.findDefaultOption)(e.aspect_ratios)),eL(t.resolution??(0,O.findDefaultOption)(e.resolutions)),eU(t.speed??(e.speeds?.length?(0,O.findDefaultOption)(e.speeds):null)),eB((0,E.preferredModelTier)(e.tiers)),e$(t.videoDuration??(e.durations?.length?(0,O.findDefaultOption)(e.durations):null)),eF(Number((0,O.findDefaultOption)(e.sample_counts))||1)},[eD,eX,eY]);let e9=eO&&(0,F.isBrandDnaFeatureEnabled)();(0,u.useEffect)(()=>{if(!e9||ef||null!==eS)return;let e=!1;return(async()=>{try{let t=await (0,F.fetchBrandDnaStudies)({page:1,size:1}),r=(0,F.parseBrandDnaListPage)(t,{page:1,size:1});e||eE(r.rows.length>0)}catch{e||eE(!0)}})(),()=>{e=!0}},[e9,ef,eS]);let e7=(0,u.useCallback)(()=>{ev(null),ek(""),ey("")},[]),te=!1===eS,tt=(0,u.useCallback)(()=>{if(!ee){if(te)return void l.push("/brand-dna/create");eN(!0)}},[ee,te,l]),tr=(0,u.useMemo)(()=>eO&&eD?eK?(0,O.computeTokenCost)(eD,"GIA_VIDEO",{speeds:eP,resolutions:ez,audios:(0,C.preferredGenerateAudio)()?"audio":"no_audio"},Number(eH)||0):(0,O.computeTokenCost)(eD,es.length>
20?"GIA_EDIT":"GIA",{speeds:eP,resolutions:ez,dnas:(0,O.multiplierDnaSelection)(e9&&!!ef)},Math.max(1,Number(eV)||1)):null,[eO,eD,eK,eP,ez,eH,es.length,e9,ef,eV]),ta=(0,u.useCallback)(async()=>{if(eQ.current)return eQ.current;let e=await (0,R.createNewDesign)();return e&&(eQ.current=e),e},[]),ts=(0,u.useCallback)(async({prompt:e,referenceImage:t}={})=>{let r=(e??Y).trim(),a=void 0!==t?t?[t]:[]:es;if(r&&!ee&&!en&&!eu){(0,z.trackEvent)(L.EVENTS.HOME_HERO_GENERATE_CLICK,{prompt_length:r.length,has_reference:a.length>0,reference_count:a.length,has_reference_video:!!ed}),et(!0),ea("");try{let e=await ta();if(!e)throw Error("No collection id returned");try{localStorage.setItem(W,"1")}catch{}sessionStorage.setItem("studio:pendingGen",JSON.stringify({collectionId:e,prompt:r,autoGenerate:!0,referenceImage:a[0]||null,referenceImages:a.length>0?a:null,referenceVideo:ed||null,brandDna:ef||null,brandDnaGarment:ef?e_.trim():"",brandDnaSeason:ef?ej.trim():"",...eO?{generationMode:eC,settings:{aspectRatio:eR,resolution:ez,speed:eP,modelTier:eG,imageCount:eV,videoDuration:eH}}:{}})),eQ.current=null,l.push(`/studio/${e}`)}catch(e){console.error("Failed to start generation:",e),ea("Couldn't start your design. Please try again."),_.toast.error("Couldn't start your design. Please try again."),et(!1)}}},[Y,ee,en,eu,es,ed,ef,e_,ej,eO,eC,eR,ez,eP,eG,eV,eH,ta,l]);(0,u.useImperativeHandle)(i,()=>({injectPrompt:e=>{Q((e||"").slice(0,y.PROMPT_LIMITS.MAX)),requestAnimationFrame(()=>{K.current?.scrollIntoView({behavior:"smooth",block:"start"}),q.current?.focus()})},openReferencePicker:()=>{X.current?.click()},submitGenerate:e=>{if(s)return ts(e)}}),[ts]),(0,u.useEffect)(()=>{e8("1"===localStorage.getItem(W))},[]),(0,u.useEffect)(()=>{a&&Q(a.slice(0,y.PROMPT_LIMITS.MAX))},[a]),(0,u.useEffect)(()=>{if(o||r)return void e3(!1);let e=!1;return(0,R.getDesignHistory)().then(t=>{e||e3(!!Array.isArray(t)&&0===t.length)}).catch(()=>{e||e3(!1)}),()=>{e=!0}},[o,r]),(0,u.useEffect)(()=>{let e=q.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,160)+"px")},[Y]),(0,u.useEffect)(()=>{let e,t=0,r=0,a=!1,s=!1,i=()=>{if(s)return;let o=$[t];if(a){if(r-=1,e2(o.slice(0,r)),r<=0){a=!1,t=(t+1)%$.length,e=setTimeout(i,350);return}}else if(r+=1,e2(o.slice(0,r)),r>=o.length){a=!0,e=setTimeout(i,1400);return}e=setTimeout(i,a?22:40)},o=()=>{(s=document.hidden)||(clearTimeout(e),e=setTimeout(i,120))};return e=setTimeout(i,600),document.addEventListener("visibilitychange",o),()=>{clearTimeout(e),document.removeEventListener("visibilitychange",o)}},[]);let ti=(0,u.useCallback)(e=>{let t=e.target.value;t.length<=y.PROMPT_LIMITS.MAX&&(Q(t),er&&ea(""))},[er]),to=(0,u.useCallback)(()=>{ee||(!r||r({type:"hero_reference_pick"}))&&X.current?.click()},[ee,r]),tl=(0,u.useCallback)(async e=>{if(!e.type.startsWith("image/"))return void _.toast.error("Please choose an image file.");if(e.size>0xa00000)return void _.toast.error("Image must be under 10 MB.");el(e=>e+1);try{let t=await M.studioAPI.uploadAsset(e,"reference");ei(r=>[...r,{id:t.id,url:t.url,label:t.label||e.name,type:"reference"}]),(0,z.trackEvent)(L.EVENTS.HOME_HERO_REFERENCE_UPLOAD,{status:"success"})}catch(e){console.error("Reference upload failed:",e),_.toast.error("Couldn't upload reference. Please try again."),(0,z.trackEvent)(L.EVENTS.HOME_HERO_REFERENCE_UPLOAD,{status:"fail"})}finally{el(e=>Math.max(0,e-1))}},[]),tn=(0,u.useCallback)(e=>{ei(t=>t.filter((t,r)=>r!==e))},[]),td=(0,u.useCallback)(async e=>{if(!H.includes(e.type))return void _.toast.error("Unsupported video format. Use MP4, WebM, or MOV.");if(e.size>524288e3)return void _.toast.error("Video must be under 500 MB.");em(!0);try{let t=await M.studioAPI.uploadFileToS3(e);if(!t?.url)throw Error("Upload failed");ec({url:t.url,mimeType:e.type||"video/mp4",label:e.name})}catch(e){console.error("Video upload failed:",e),_.toast.error("Couldn't upload video. Please try again.")}finally{em(!1)}},[]),tc=(0,u.useCallback)(()=>{ec(null)},[]),tu=(0,u.useCallback)(e=>{let t=e.filter(e=>e.type?.startsWith("image/")),r=e.filter(e=>e.type?.startsWith("video/"));0===t.length&&0===r.length?_.toast.error("Please choose image or video files."):(t.forEach(e
2=>tl(e)),r.length>0&&((r.length>1||ed)&&_.toast.info("Only one video can be used â keeping the latest."),td(r[0])))},[tl,td,ed]),tm=(0,u.useCallback)(e=>{let t=Array.from(e.target.files||[]);e.target.value="",0===t.length||(!r||r({type:"hero_reference_pick"}))&&tu(t)},[r,tu]),th=(0,u.useCallback)(e=>{e.preventDefault(),ex.current+=1,e.dataTransfer?.types?.includes?.("Files")&&ep(!0)},[]),tp=(0,u.useCallback)(e=>{e.preventDefault()},[]),tx=(0,u.useCallback)(e=>{e.preventDefault(),ex.current=Math.max(0,ex.current-1),0===ex.current&&ep(!1)},[]),tg=(0,u.useCallback)(e=>{if(e.preventDefault(),ex.current=0,ep(!1),ee)return;let t=Array.from(e.dataTransfer?.files||[]);t.some(e=>e.type?.startsWith("image/")||e.type?.startsWith("video/"))?(!r||r({type:"hero_reference_pick"}))&&tu(t):_.toast.error("Drop image or video files.")},[ee,r,tu]),tb=(0,u.useCallback)(e=>{Q(t=>{let r=t.trim();return(r?`${r} ${e}`:e).slice(0,y.PROMPT_LIMITS.MAX)}),requestAnimationFrame(()=>q.current?.focus())},[]),tf=(0,u.useCallback)(e=>{Q((e||"").slice(0,y.PROMPT_LIMITS.MAX))},[]),tv=(0,u.useCallback)((e,t)=>{"error"===t?_.toast.error(e):"success"===t?_.toast.success(e):_.toast.info(e)},[]),{assisting:tw,canUndo:tN,assist:t_,undo:tk}=(0,T.usePromptAssist)({collectionId:null,ensureCollectionId:eO?ta:void 0,prompt:Y,canvasImage:null,referenceImages:es,fabrics:[],sketches:[],uploadingAsset:en||eu,onPromptRefined:tf,showAlert:tv}),tj=(0,u.useCallback)(async()=>{let e=Y.trim();!e||ee||en||eu||(!r||r({type:"hero_generate",prompt:e,referenceImage:es[0]||null}))&&await ts()},[Y,ee,en,eu,es,r,ts]),ty=d&&Y.trim().length>0&&!ee&&!en&&!eu,tS=0===Y.length&&!J;return(0,c.jsxs)("section",{ref:K,className:(0,j.cn)("relative",o&&"home-hero--fashion"),children:[(0,c.jsxs)("div",{className:(0,j.cn)("text-center",o?"px-0 pt-0 pb-4":t?"max-w-4xl mx-auto px-4 sm:px-6 pt-0 pb-2 sm:pb-3":"max-w-4xl mx-auto px-4 sm:px-6 pt-6 sm:pt-8 pb-6 sm:pb-14"),children:[o?null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("h1",{className:"text-3xl sm:text-5xl font-semibold tracking-tight leading-[1.1] text-foreground",children:["What will you"," ",(0,c.jsx)("span",{className:"gradient-text-animated",children:"design"})," ","today?"]}),(0,c.jsx)("p",{className:"mt-3 text-sm sm:text-base text-foreground-muted max-w-xl mx-auto leading-snug",children:"Describe it. We'll bring it to life in seconds."})]}),(0,c.jsx)("div",{className:(0,j.cn)("flex justify-center",o?"mt-0":t?"mt-2 sm:mt-3":"mt-5 sm:mt-8"),children:(0,c.jsx)(P.default,{initialSelections:eJ,initialBusiness:e0,onApply:(e,t,r)=>{Q(e.slice(0,y.PROMPT_LIMITS.MAX)),eZ(t),e5(r),requestAnimationFrame(()=>q.current?.focus())}})}),(0,c.jsxs)("div",{className:(0,j.cn)("relative",o?"mt-3":"mt-3 sm:mt-4"),children:[(0,c.jsx)("div",{className:(0,j.cn)("absolute -inset-2 rounded-[32px] blur-2xl transition-opacity duration-500 pointer-events-none","bg-gradient-to-r from-violet-500/25 via-blue-500/15 to-cyan-400/20",J?"opacity-100":!0!==e4||e6?"opacity-50":"animate-breathe")}),(0,c.jsxs)("div",{onDragEnter:th,onDragOver:tp,onDragLeave:tx,onDrop:tg,className:(0,j.cn)("relative flex flex-col gap-2 rounded-3xl px-3 pt-3 pb-2.5 text-left backdrop-blur-2xl transition-all duration-300",o?J?"border border-violet-400/35 bg-white/[0.06] shadow-[0_8px_32px_rgba(0,0,0,0.35),0_0_0_1px_rgba(139,92,246,0.35),inset_0_1px_0_rgba(255,255,255,0.12)]":"border border-white/10 bg-white/[0.04] shadow-[0_8px_24px_rgba(0,0,0,0.25),inset_0_1px_0_rgba(255,255,255,0.06)]":J?"bg-foreground
2/[0.04] dark:bg-white/[0.05] border border-foreground/20 dark:border-white/25 shadow-[0_8px_32px_rgba(0,0,0,0.12),0_0_0_1px_rgba(139,92,246,0.2),inset_0_1px_0_rgba(255,255,255,0.15)] dark:shadow-[0_8px_32px_rgba(0,0,0,0.25),0_0_0_1px_rgba(139,92,246,0.2),inset_0_1px_0_rgba(255,255,255,0.15)]":"bg-foreground/[0.04] dark:bg-white/[0.05] border border-foreground/10 dark:border-white/[0.1] shadow-[0_8px_24px_rgba(0,0,0,0.08)] dark:shadow-[0_8px_24px_rgba(0,0,0,0.2),inset_0_1px_0_rgba(255,255,255,0.08)]"),children:[(0,c.jsx)("div",{className:(0,j.cn)("absolute top-0 left-6 right-6 h-px bg-gradient-to-r from-transparent to-transparent pointer-events-none",o?"via-white/20":"via-foreground/15 dark:via-white/30")}),eh&&(0,c.jsxs)("div",{className:"pointer-events-none absolute inset-0 z-10 flex flex-col items-center justify-center gap-1.5 rounded-3xl border-2 border-dashed border-purple bg-purple/10 backdrop-blur-[2px]",children:[(0,c.jsx)(w.UploadCloud,{className:(0,j.cn)("h-6 w-6",o?"text-white/80":"text-purple"),"aria-hidden":!0}),(0,c.jsx)("p",{className:(0,j.cn)("text-sm font-medium",o?"text-white/90":"text-foreground"),children:"Drop image or video"})]}),(es.length>0||en||ed||eu)&&(0,c.jsxs)("div",{className:"flex gap-2 px-1 pt-1 overflow-x-auto",children:[es.map((e,t)=>(0,c.jsxs)("div",{className:(0,j.cn)("relative h-20 w-20 sm:h-24 sm:w-24 shrink-0 rounded-xl overflow-hidden flex items-center justify-center",o?"bg-white/[0.06] border border-white/15":"bg-foreground
2/[0.05] dark:bg-white/[0.06] border border-foreground/15 dark:border-white/15"),children:[(0,c.jsx)("img",{src:e.url,alt:e.label||"Reference",className:"absolute inset-0 w-full h-full object-contain"}),(0,c.jsx)("button",{type:"button",onClick:()=>tn(t),"aria-label":"Remove reference image",className:"absolute top-1 right-1 inline-flex h-5 w-5 items-center justify-center rounded-full bg-black/70 text-white ring-1 ring-white/25 hover:bg-black/90 transition cursor-pointer",children:(0,c.jsx)(N.X,{className:"h-3 w-3"})})]},e.id??e.url)),Array.from({length:eo}).map((e,t)=>(0,c.jsx)("div",{className:(0,j.cn)("relative h-20 w-20 sm:h-24 sm:w-24 shrink-0 rounded-xl overflow-hidden flex items-center justify-center",o?"bg-white/[0.06] border border-white/15":"bg-foreground/[0.05] dark:bg-white/[0.06] border border-foreground/15 dark:border-white/15"),children:(0,c.jsx)("div",{className:"w-5 h-5 rounded-full border-2 border-purple/30 border-t-purple animate-spin"})},`uploading-${t}`)),(ed||eu)&&(0,c.jsx)("div",{className:(0,j.cn)("relative h-20 w-20 sm:h-24 sm:w-24 shrink-0 rounded-xl overflow-hidden flex items-center justify-center",o?"bg-white/[0.06] border border-white/15":"bg-foreground
2/[0.05] dark:bg-white/[0.06] border border-foreground/15 dark:border-white/15"),children:eu?(0,c.jsx)("div",{className:"w-5 h-5 rounded-full border-2 border-purple/30 border-t-purple animate-spin"}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("video",{src:ed.url,className:"absolute inset-0 w-full h-full object-cover",muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"metadata"}),(0,c.jsx)("span",{className:"absolute bottom-0 inset-x-0 bg-black/60 text-white text-[8px] font-medium text-center leading-tight py-0.5",children:"Video"}),(0,c.jsx)("button",{type:"button",onClick:tc,"aria-label":"Remove reference video",className:"absolute top-1 right-1 inline-flex h-5 w-5 items-center justify-center rounded-full bg-black/70 text-white ring-1 ring-white/25 hover:bg-black/90 transition cursor-pointer",children:(0,c.jsx)(N.X,{className:"h-3 w-3"})})]})})]}),(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsxs)("div",{"aria-hidden":"true",className:(0,j.cn)("pointer-events-none absolute inset-0 px-3 py-2",o?"text-base sm:text-lg leading-[1.5] text-white/35":"text-base sm:text-lg leading-[1.5] text-foreground-dim/60","whitespace-pre-wrap break-words select-none","transition-opacity duration-150",tS?"opacity-100":"opacity-0"),children:[e1,(0,c.jsx)("span",{className:(0,j.cn)("inline-block w-[2px] h-[1em] align-[-0.15em] ml-0.5 animate-caret",o?"bg-white/60":"bg-foreground
2/60 dark:bg-white/70")})]}),(0,c.jsx)("textarea",{ref:q,value:Y,onChange:ti,onFocus:()=>Z(!0),onBlur:()=>Z(!1),"aria-label":"Describe the design you want to generate",rows:1,disabled:ee,className:(0,j.cn)("relative w-full bg-transparent border-none outline-none resize-none px-3 py-2",o?"text-base sm:text-lg leading-[1.5] text-white/90 placeholder:text-white/30":"text-base sm:text-lg leading-[1.5] text-foreground","min-h-[44px] max-h-[160px] overflow-y-auto")})]}),(0,c.jsxs)("div",{className:"flex flex-wrap items-center justify-between px-1 gap-x-1.5 gap-y-2 sm:gap-x-2",children:[(0,c.jsx)("input",{ref:X,type:"file",accept:"image/*,video/mp4,video/webm,video/quicktime",multiple:!0,className:"hidden",onChange:tm}),(0,c.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[(0,c.jsx)("button",{type:"button",onClick:to,disabled:ee,"aria-label":"Add reference images or video",title:"Add reference images or video",className:(0,j.cn)("inline-flex h-9 w-9 sm:h-10 sm:w-10 shrink-0 touch-manipulation items-center justify-center rounded-full",o?"bg-white/[0.06] border border-white/15 text-white/80 hover:bg-white/[0.1] hover:border-white/25":"bg-foreground
2/[0.05] dark:bg-white/[0.06] border border-foreground/15 dark:border-white/15 text-foreground/80 hover:bg-foreground/10 dark:hover:bg-white/[0.12] hover:border-foreground/25 dark:hover:border-white/25","transition","disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"),children:en?(0,c.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-purple/30 border-t-purple animate-spin"}):(0,c.jsx)(g.Plus,{className:"h-5 w-5"})}),(0,c.jsx)("button",{type:"button",onClick:()=>eb(!0),disabled:ee,"aria-label":"Voice input",title:"Voice input",className:(0,j.cn)("inline-flex h-9 w-9 sm:h-10 sm:w-10 shrink-0 touch-manipulation items-center justify-center rounded-full",o?"bg-white/[0.06] border border-white/15 text-white/80 hover:bg-white/[0.1] hover:border-white/25":"bg-foreground/[0.05] dark:bg-white/[0.06] border border-foreground/15 dark:border-white/15 text-foreground/80 hover:bg-foreground/10 dark:hover:bg-white/[0.12] hover:border-foreground/25 dark:hover:border-white/25","transition","disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"),children:(0,c.jsx)(x.Mic,{className:"h-4 w-4"})}),e9&&(0,c.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,c.jsxs)("button",{type:"button",onClick:ef?()=>eN(!0):tt,disabled:ee,"aria-label":ef?`Brand DNA: ${ef.title}. Change`:te?"Create a Brand DNA":"Select a Brand DNA",title:ef?`Brand DNA: ${ef.title}`:te?"Create a Brand DNA":"Select a Brand DNA",className:(0,j.cn)("inline-flex h-9 max-w-[9.5rem] px-3 text-xs sm:h-10 sm:max-w-[12rem] sm:px-4 sm:text-sm shrink-0 touch-manipulation items-center gap-1.5 rounded-full font-medium",ef?"bg-purple/15 border border-purple/40 text-purple hover:bg-purple/20":o?"bg-white/[0.06] border border-white/15 text-white/80 hover:bg-white/[0.1] hover:border-white/25":"bg-foreground
2/[0.05] dark:bg-white/[0.06] border border-foreground/15 dark:border-white/15 text-foreground/80 hover:bg-foreground/10 dark:hover:bg-white/[0.12] hover:border-foreground/25 dark:hover:border-white/25","transition","disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"),children:[(0,c.jsx)(p.Dna,{className:"h-4 w-4 shrink-0"}),(0,c.jsx)("span",{className:"truncate",children:ef?ef.title:te?"Create Brand DNA":"Brand DNA"})]}),ef&&(0,c.jsx)("button",{type:"button",onClick:e7,disabled:ee,"aria-label":"Remove Brand DNA",title:"Remove Brand DNA",className:(0,j.cn)("inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full transition cursor-pointer",o?"text-white/60 hover:text-white hover:bg-white/10":"text-foreground-muted hover:text-red-400 hover:bg-foreground/10 dark:hover:bg-white/10","disabled:opacity-50 disabled:cursor-not-allowed"),children:(0,c.jsx)(N.X,{className:"h-3.5 w-3.5"})})]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[eO&&(0,c.jsx)("div",{className:(0,j.cn)("flex items-center gap-0.5 rounded-full border p-0.5",o?"bg-white/[0.06] border-white/15":"bg-foreground
2/[0.05] dark:bg-white/[0.04] border-foreground/15 dark:border-white/10"),role:"group","aria-label":"Generation mode",children:[{mode:y.GENERATION_MODES.IMAGE,label:"Image"},{mode:y.GENERATION_MODES.VIDEO,label:"Video"}].map(({mode:e,label:t})=>(0,c.jsx)("button",{type:"button",onClick:()=>eI(e),disabled:ee,"aria-pressed":eC===e,className:(0,j.cn)("px-2.5 py-1 text-xs sm:px-3.5 sm:py-1.5 sm:text-sm font-medium rounded-full transition-all cursor-pointer touch-manipulation",eC===e?"bg-purple text-white shadow-sm":o?"text-white/60 hover:text-white/90":"text-foreground-dim hover:text-foreground"),children:t},e))}),eO&&eD&&(0,c.jsx)("button",{type:"button",onClick:()=>eq(e=>!e),disabled:ee,"aria-expanded":eW,"aria-controls":"home-hero-generation-settings","aria-label":eW?"Hide generation settings":"Show generation settings",title:eW?"Hide settings":"Settings (ratio, quality, model, count)",className:(0,j.cn)("inline-flex h-9 w-9 sm:h-10 sm:w-10 shrink-0 touch-manipulation items-center justify-center rounded-full",eW?"bg-purple/15 border border-purple/40 text-purple hover:bg-purple/20":o?"bg-white/[0.06] border border-white/15 text-white/80 hover:bg-white/[0.1] hover:border-white/25":"bg-foreground
2/[0.05] dark:bg-white/[0.06] border border-foreground/15 dark:border-white/15 text-foreground/80 hover:bg-foreground/10 dark:hover:bg-white/[0.12] hover:border-foreground/25 dark:hover:border-white/25","transition","disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"),children:(0,c.jsx)(b.Settings,{className:"h-4 w-4"})}),eO&&(0,c.jsxs)("button",{type:"button",onClick:()=>void t_(),disabled:tw||ee||Y.trim().length<y.PROMPT_LIMITS.MIN,"aria-label":"Refine my prompt",title:"Refine my prompt",className:(0,j.cn)("inline-flex h-9 px-3 text-xs sm:h-10 sm:px-4 sm:text-sm shrink-0 touch-manipulation items-center gap-1.5 rounded-full font-medium",o?"bg-white/[0.06] border border-white/15 text-white/80 hover:bg-white/[0.1] hover:border-white/25":"bg-foreground/[0.05] dark:bg-white/[0.06] border border-foreground/15 dark:border-white/15 text-foreground/80 hover:bg-foreground/10 dark:hover:bg-white/[0.12] hover:border-foreground/25 dark:hover:border-white/25","transition","disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer"),children:[tw?(0,c.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-purple/30 border-t-purple animate-spin"}):(0,c.jsx)(f.Sparkles,{className:"h-4 w-4"}),"Assist"]}),(0,c.jsxs)(k.Button,{variant:ty||ee?"gradient":"ghost",className:(0,j.cn)("h-9 px-3.5 text-xs sm:h-10 sm:px-5 sm:text-sm shrink-0 touch-manipulation rounded-full gap-1.5 font-medium transition-all duration-300",!ty&&!ee&&(o?"opacity-60 bg-white/[0.04] border border-white/10 text-white/40":"opacity-60 bg-foreground
2/5 dark:bg-white/[0.04] border border-foreground/15 dark:border-white/10 text-foreground-muted"),ty&&"shadow-[0_0_18px_rgba(139,92,246,0.45)]"),disabled:!ty,onClick:tj,children:[ee?(0,c.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-white/40 border-t-white animate-spin"}):(0,c.jsx)(f.Sparkles,{className:"h-4 w-4"}),"Generate",eT&&null!=tr&&!ee&&(0,c.jsxs)("span",{className:(0,j.cn)("ml-0.5 inline-flex items-center gap-0.5 rounded-full px-1.5 py-px text-[11px] font-semibold tabular-nums",ty?"bg-white/20 text-white":o?"bg-white/10 text-white/60":"bg-foreground/10 text-foreground-muted"),title:`${tr} credit${1===tr?"":"s"}`,children:[(0,c.jsx)(h.Coins,{className:"h-3 w-3"}),tr]})]})]})]}),e9&&ef&&(0,c.jsx)("div",{className:(0,j.cn)("grid grid-cols-1 gap-2 border-t px-1 pt-2 pb-0.5 sm:grid-cols-2",o?"border-white/10":"border-foreground/10 dark:border-white/10"),children:[{id:"home-brand-dna-garment",label:"Garment",value:e_,onChange:ek,placeholder:"e.g. Oversized coat"},{id:"home-brand-dna-season",label:"Season",value:ej,onChange:ey,placeholder:"e.g. AW25"}].map(e=>(0,c.jsxs)("label",{htmlFor:e.id,className:"flex min-w-0 flex-col gap-1",children:[(0,c.jsxs)("span",{className:(0,j.cn)("text-[11px] font-medium",o?"text-white/60":"text-foreground-dim"),children:[e.label," ",(0,c.jsx)("span",{className:o?"text-white/40":"text-foreground-dim/70",children:"(optional)"})]}),(0,c.jsx)("input",{id:e.id,type:"text",value:e.value,onChange:t=>e.onChange(t.target.value.slice(0,80)),placeholder:e.placeholder,disabled:ee,maxLength:80,className:(0,j.cn)("h-8 w-full rounded-lg border px-2.5 text-sm outline-none transition",o?"bg-white/[0.06] border-white/15 text-white/90 placeholder:text-white/30 focus:border-violet-400/50":"bg-foreground
2/[0.04] dark:bg-white/[0.05] border-foreground/15 dark:border-white/15 text-foreground placeholder:text-foreground-dim/60 focus:border-purple/50","disabled:opacity-50")})]},e.id))}),eO&&eD&&eW&&(0,c.jsx)("div",{id:"home-hero-generation-settings",className:(0,j.cn)("border-t px-1 pt-1","max-sm:[&>div]:gap-0.5 max-sm:[&_button]:px-1 max-sm:[&_button]:text-[11px]",o?"border-white/10":"border-foreground/10 dark:border-white/10"),children:(0,c.jsx)(S.default,{aspectRatio:eR,onAspectRatioChange:e=>{eK?(0,C.setVideoPrefs)({aspectRatio:e}):(0,I.setImagePrefs)({aspectRatio:e}),eM(e)},resolution:ez,onResolutionChange:e=>{eK?(0,C.setVideoPrefs)({resolution:e}):(0,I.setImagePrefs)({resolution:e}),eL(e)},speed:eP,onSpeedChange:e=>{eK&&(0,C.setVideoPrefs)({speed:e}),eU(e)},modelTier:eG,onModelTierChange:e=>{eB(e),(0,E.setStoredModelTier)(e,{tiers:eD?.models?.[eX]?.tiers,modelId:eX})},videoDuration:eH,onVideoDurationChange:e=>{eK&&(0,C.setVideoPrefs)({videoDuration:e}),e$(e)},imageCount:eV,onImageCountChange:eF,multipliers:eD,modelId:eX})}),tN&&(0,c.jsx)("div",{className:"flex px-1 pb-0.5",children:(0,c.jsxs)("button",{type:"button",onClick:tk,className:(0,j.cn)("inline-flex items-center gap-1 text-[11px] transition-colors cursor-pointer",o?"text-white/50 hover:text-white/80":"text-foreground-dim hover:text-foreground"),children:[(0,c.jsx)(v.Undo2,{className:"size-3"}),"Undo â restore my prompt"]})})]}),(0,O.promptRequestsHighQuality)(Y)&&(0,c.jsx)(U.default,{active:!0,resolutionLabel:"4K",tokenCost:null,className:"mt-3"}),!d&&(0,c.jsx)("p",{className:"mt-3 text-sm text-foreground-dim",role:"note",children:G.EDIT_TOOL_DISABLED_MESSAGE}),er&&(0,c.jsx)("p",{className:"mt-3 text-sm text-red-400/90",role:"alert",children:er})]})]}),(0,c.jsx)(B.default,{open:eg,onOpenChange:eb,onInsert:tb}),e9&&(0,c.jsx)(V.default,{open:ew,onOpenChange:eN,onSelect:ev})]})});e.s(["default",0,q],265046);var K=e.i(657688),X=e.i(522016),Y=e.i(115057),Q=e.i(852008),J=e.i(40683),Z=e.i(733682),ee=e.i(152654),et=e.i(532292),er=e.i(366655),ea=e.i(668812),es=e.i(856533),ei=e.i(972520),eo=e.i(489853),el=e.i(503116),en=e.i(664030),ed=e.i(736120),ec=e.i(389983),eu=e.i(904980);let em={home:{view:L.EVENTS.CONTEST_BANNER_HOME_VIEW,click:L.EVENTS.CONTEST_BANNER_HOME_CLICK},fashion_landing:{view:L.EVENTS.CONTEST_BANNER_LANDING_VIEW,click:L.EVENTS.CONTEST_BANNER_LANDING_CLICK}};function eh(e){if(null==e)return null;let t=new Date(Number(e));return Number.isNaN(t.getTime())?null:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ep(e){let t=Date.now(),r=Number(e.start_at_millis),a=Number(e.end_at_millis);return Number.isFinite(a)&&t>a?"ended":Number.isFinite(r)&&t<r?"upcoming":"live"}function ex(e){let t=Math.max(0,e-Date.now());return{totalMs:t,days:Math.floor(t/864e5),hours:Math.floor(t%864e5/36e5),minutes:Math.floor(t%36e5/6e4),seconds:Math.floor(t%6e4/1e3),expired:t<=0}}function eg(e,t){return"live"!==t||e<=0?{label:"upcoming"===t?"Opens in":"Ended",strip:"from-black/55 via-black/25 to-transparent",box:"border-sky-400/45 bg-sky-950/92 text-sky-50 shadow-[0_8px_24px_rgba(0,0,0,0.35)]",digit:"border-sky-300/25 bg-sky-4
200/20 text-white",pulse:!1}:e<=36e5?{label:"Ends in",strip:"from-black/60 via-rose-950/30 to-transparent",box:"border-rose-400/55 bg-rose-950/92 text-rose-50 shadow-[0_8px_24px_rgba(127,29,29,0.45)]",digit:"border-rose-300/30 bg-rose-400/25 text-white",pulse:!0}:e<=2592e5?{label:"Ends in",strip:"from-black/55 via-amber-950/25 to-transparent",box:"border-amber-400/50 bg-amber-950/90 text-amber-50 shadow-[0_8px_24px_rgba(120,53,15,0.4)]",digit:"border-amber-300/30 bg-amber-400/20 text-white",pulse:!0}:{label:"Ends in",strip:"from-black/55 via-violet-950/25 to-transparent",box:"border-violet-400/45 bg-zinc-950/90 text-violet-50 shadow-[0_8px_24px_rgba(0,0,0,0.38)]",digit:"border-violet-300/25 bg-violet-400/18 text-white",pulse:!1}}function eb({value:e,label:t,digitClassName:r,compact:a}){return(0,c.jsxs)("div",{className:(0,j.cn)("flex flex-col items-center",a?"min-w-[2.1rem]":"min-w-[2.6rem]"),children:[(0,c.jsx)("span",{className:(0,j.cn)("rounded-md border px-1.5 font-mono font-bold tabular-nums shadow-sm",a?"text-sm leading-tight py-0.5":"text-base py-1",r),children:String(e).padStart(2,"0")}),(0,c.jsx)("span",{className:"mt-0.5 text-[9px] font-semibold uppercase tracking-wider opacity-70",children:t})]})}function ef({contest:e,layoutMode:t,timeLeft:r}){let a=ep(e),s="rail"===t||"quad"===t;if("ended"===a||!r||r.expired)return(0,c.jsxs)("div",{className:"inline-flex w-fit max-w-full items-center gap-1.5 rounded-xl border border-zinc-400/40 bg-zinc-950/92 px-3 py-2 text-[11px] font-semibold text-zinc-100 shadow-[0_8px_24px_rgba(0,0,0,0.35)] backdrop-blur-md",children:[(0,c.jsx)(el.Clock,{className:"size-3 shrink-0 opacity-80"}),"Entries closed"]});let i=eg(r.totalMs,a),o=r.days>0;return(0,c.jsxs)("div",{className:(0,j.cn)("inline-flex w-fit max-w-full flex-col backdrop-blur-md","rounded-xl border",i.box,i.pulse&&"ring-1 ring-amber-400/40",s?"px-2.5 py-1.5":"px-3 py-2"),children:[(0,c.jsxs)("div",{className:"mb-1 flex items-center gap-1.5",children:[(0,c.jsx)(el.Clock,{className:"size-3 shrink-0 opacity-80"}),(0,c.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.14em]",children:"upcoming"===a?"Opens in":i.label}),i.pulse&&"live"===a?(0,c.jsx)(f.Sparkles,{className:"size-3 shrink-0 text-amber-500 dark:text-amber-300"}):null]}),(0,c.jsxs)("div",{className:"flex items-end gap-1",children:[o?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(eb,{value:r.days,label:"days",digitClassName:i.digit,compact:s}),(0,c.jsx)("span",{className:(0,j.cn)("pb-3 font-bold opacity-50",s?"text-xs":"text-sm"),children:":"})]}):null,(0,c.jsx)(eb,{value:r.hours,label:"hrs",digitClassName:i.digit,compact:s}),(0,c.jsx)("span",{className:(0,j.cn)("pb-3 font-bold opacity-50",s?"text-xs":"text-sm"),children:":"}),(0,c.jsx)(eb,{value:r.minutes,label:"min",digitClassName:i.digit,compact:s}),(0,c.jsx)("span",{className:(0,j.cn)("pb-3 font-bold opacity-50",s?"text-xs":"text-sm"),children:":"}),(0,c.jsx)(eb,{value:r.seconds,label:"sec",digitClassName:i.digit,compact:s})]})]})}function ev(e){return(0,j.cn)("mb-4 flex w-full items-center justify-between gap-3",!e&&"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8")}function ew({contest:e,idx:t,layoutMode:r,source:a,isLoggedIn:s}){let i,o,l,n,d="ended"===(i=ep(e))?{label:"Ended",className:"border-zinc-300/80 bg-zinc-700/90 text-white"}:"upcoming"===i?{label:"Upcoming",className:"border-sky-300/80 bg-sky-600/90 text-white"}:{label:"Live",className:"border-emerald-300/80 bg-emerald-600/90 text-white"},m=ep(e),h=function(e){let[t,r]=(0,u.useState)(()=>e?ex(e):null);return(0,u.useEffect)(()=>{if(!e)return void r(null);let t=()=>r(ex(e));t();let a=window.setInterval(t,1e3);return()=>window.clearInterval(a)},[e]),t}((o=ep(e),l=Number(e.start_at_millis),n=Number(e.end_at_millis),"ended"===o?null:"upcoming"===o&&Number.isFinite(l)?l:"live"===o&&Number.isFinite(n)?n:null)),p="live"===m&&h?eg(h.totalMs,m):null,x=e.asset_url?(0,j.getOptimizedImageUrl)(e.asset_url):null,g=e.video_url&&(0,j.isVideoUrl)(e.video_url)?e.video_url:null,b=eh(e.start_at_millis),f=eh(e.end_at_millis),v=e.description?.trim(),w="single"===r;return(0,c.jsxs)(X.default,{href:"/contests",onClick:()=>{let r={contest_id:String(e.id),contest_name:e.name,position:t};(0,z.trackEvent)(L.EVENTS.CONTEST_RAIL_CARD_CLICK,{...r,source:a,is_logged_in:s});let i=em[a]?.click;i&&(0,z.trackEvent)(i,r)},className:function(e){let t="group relative min-w-0 overflow-hidden rounded-2xl border border-foreground
2/10 bg-gradient-to-b from-foreground/[0.05] to-background transition-all duration-300 hover:-translate-y-1 hover:border-violet-400/45 hover:shadow-[0_12px_36px_rgba(139,92,246,0.28)] dark:border-white/10 dark:from-white/[0.06] dark:to-background dark:hover:border-violet-500/45";switch(e){case"single":return(0,j.cn)(t,"w-full");case"pair":case"triple":case"quad":return(0,j.cn)(t,"w-[72%] shrink-0 snap-start sm:w-full");default:return(0,j.cn)(t,"w-[46%] shrink-0 snap-start sm:w-[260px] lg:w-[300px]")}}(r),children:[(0,c.jsxs)("div",{className:(0,j.cn)("relative w-full overflow-hidden bg-muted","single"===r?"h-[23.25rem] sm:h-[26.25rem]":"aspect-[16/10]"),children:[g?(0,c.jsxs)(c.Fragment,{children:[x?(0,c.jsx)("img",{src:x,alt:"","aria-hidden":!0,loading:"lazy",className:"absolute inset-0 size-full scale-110 object-cover blur-xl brightness-90 saturate-150"}):null,(0,c.jsx)("video",{src:g,"aria-label":e.name,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"auto",className:"absolute inset-0 size-full object-contain transition-transform duration-300 group-hover:scale-[1.03]"})]}):x?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{src:x,alt:"","aria-hidden":!0,loading:"lazy",className:"absolute inset-0 size-full scale-110 object-cover blur-xl brightness-90 saturate-150"}),(0,c.jsx)("img",{src:x,alt:e.name,loading:"lazy",className:"absolute inset-0 size-full object-contain transition-transform duration-300 group-hover:scale-[1.03]"})]}):(0,c.jsx)("div",{className:"flex size-full items-center justify-center text-muted-foreground",children:(0,c.jsx)(en.Trophy,{className:"size-8 opacity-40"})}),(0,c.jsx)("div",{className:(0,j.cn)("pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t to-transparent",p?.strip??"from-black/70 via-black/35",w?"h-28":"h-24")}),(0,c.jsx)("span",{className:(0,j.cn)("absolute left-2.5 top-2.5 rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide shadow-md",d.className),children:d.label}),"PRIVATE"===e.visibility?(0,c.jsx)("span",{className:"absolute right-2.5 top-2.5 rounded-full border border-violet-300/50 bg-violet-600/90 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-white shadow-md",children:"Invite only"}):null,(0,c.jsx)("div",{className:(0,j.cn)("absolute bottom-0 left-0 z-10 flex justify-start",w?"p-3 sm:p-4":"p-2.5"),children:(0,c.jsx)(ef,{contest:e,layoutMode:r,timeLeft:h})})]}),(0,c.jsxs)("div",{className:(0,j.cn)("space-y-2",w?"p-4 sm:p-5":"p-3"),children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h3",{className:(0,j.cn)("font-semibold leading-snug text-foreground group-hover:text-violet-700 dark:group-hover:text-violet-300",w?"text-base sm:text-lg":"line-clamp-1 text-sm"),children:e.name}),v?(0,c.jsx)("p",{className:(0,j.cn)("mt-1.5 text-muted-foreground",w?"line-clamp-3":"line-clamp-2",w?"text-sm leading-relaxed":"text-[11px] leading-snug sm:text-xs"),children:v}):(0,c.jsx)("p",{className:"mt-1.5 text-[11px] italic text-muted-foreground/80 sm:text-xs",children:"Submit your best designs before time runs out."})]}),(0,c.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2.5 border-t border-border/60 pt-2.5",children:[b&&f?(0,c.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,c.jsx)(eo.CalendarDays,{className:"size-3 shrink-0"}),(0,c.jsxs)("span",{className:"truncate",children:[b," â ",f]})]}):(0,c.jsx)("span",{className:"flex-1"}),(0,c.jsxs)("span",{className:(0,j.cn)("relative inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full font-semibold text-white","bg-gradient-to-r from-violet-600 via-violet-500 to-fuchsia-600","shadow-[0_4px_14px_rgba(139,92,246,0.35)]","ring-1 ring-white/20 transition-all duration-200","group-hover:-translate-y-px group-hover:from-violet-500 group-hover:via-violet-500 group-hover:to-fuchsia-500","group-hover:shadow-[0_6px_20px_rgba(139,92,246,0.45)]","ended"===m?"from-zinc-600 via-zinc-500 to-zinc-600 shadow-zinc-500/20 group-hover:from-zinc-500 group-hover:via-zinc-500 group-hover:to-zinc-500":"upcoming"===m?"from-sky-600 via-sky-500 to-violet-600 shadow-sky-500/25":null,w?"px-4 py-2 text-xs sm:text-sm":"px-3 py-1.5 text-[11px]"),children:[(0,c.jsx)("span",{"aria-hidden":!0,
2className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-white/0 via-white/20 to-white/0 opacity-0 transition-opacity duration-200 group-hover:opacity-100"}),(0,c.jsx)("span",{className:"relative",children:"ended"===m?"View contest":"upcoming"===m?"Get ready":"Enter now"}),(0,c.jsx)(ei.ArrowRight,{className:(0,j.cn)("relative transition-transform duration-200 group-hover:translate-x-0.5",w?"size-3.5":"size-3")})]})]})]})]})}function eN({usePublicContestApi:e=!1,source:t="home",embedded:r=!1}){let{isLoggedIn:a}=(0,eu.useAuth)(),[s,i]=(0,u.useState)([]),[o,l]=(0,u.useState)(!0),n=(0,u.useRef)(null),[d,m]=(0,u.useState)(!0),[h,p]=(0,u.useState)(!1),x=(0,u.useRef)(!1),g=(0,u.useMemo)(()=>{var e;return 1===(e=s.length)?"single":2===e?"pair":3===e?"triple":4===e?"quad":"rail"},[s.length]),b="rail"===g,f=b||"single"!==g;return((0,u.useEffect)(()=>{let t=!1;return l(!0),(e?(0,ec.fetchPublicContests)({page:1,size:10}):(0,ec.fetchContests)({page:1,size:10,status:"active"})).then(({items:e})=>{t||i(e.filter(e=>!1!==e.active))}).catch(e=>{t||(console.error("Failed to load contests rail:",e),i([]))}).finally(()=>{t||l(!1)}),()=>{t=!0}},[e]),(0,u.useEffect)(()=>{if(!b)return;let e=n.current;if(!e)return;let t=()=>{m(e.scrollLeft<=2),p(e.scrollLeft+e.clientWidth>=e.scrollWidth-2)};t(),e.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t);let r=new ResizeObserver(t);return r.observe(e),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",t),r.disconnect()}},[s.length,b]),(0,u.useEffect)(()=>{if(o||0===s.length||x.current)return;x.current=!0,(0,z.trackEvent)(L.EVENTS.CONTEST_RAIL_VIEW,{source:t,contest_count:s.length,layout_mode:g,is_logged_in:a});let e=em[t]?.view;e&&(0,z.trackEvent)(e,{contest_count:s.length,layout_mode:g})},[o,s.length,t,g,a]),o)?(0,c.jsxs)("section",{className:(0,j.cn)(r?"w-full":"pt-2 pb-8"),children:[(0,c.jsx)("div",{className:ev(r),children:(0,c.jsx)(ed.Skeleton,{className:"h-6 w-40 bg-foreground
2/10 dark:bg-white/5"})}),(0,c.jsx)("div",{className:(0,j.cn)("flex gap-3 overflow-hidden sm:gap-4",r?"w-full":"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"),children:Array.from({length:3}).map((e,t)=>(0,c.jsx)(ed.Skeleton,{className:"aspect-[16/10] w-full rounded-2xl bg-foreground/10 dark:bg-white/5"},t))})]}):0===s.length?null:(0,c.jsxs)("section",{className:(0,j.cn)(r?"w-full":"pt-2 pb-8"),children:[(0,c.jsxs)("div",{className:ev(r),children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(en.Trophy,{className:"size-5 text-violet-600 dark:text-violet-400"}),(0,c.jsx)("h2",{className:"text-lg font-semibold text-foreground sm:text-xl",children:"Design Contests"})]}),(0,c.jsxs)(X.default,{href:"/contests",className:(0,j.cn)("group/view-all relative inline-flex shrink-0 items-center gap-2 overflow-hidden rounded-full","border border-violet-400/40 bg-gradient-to-r from-violet-500/12 via-violet-500/8 to-fuchsia-500/12","px-3.5 py-2 text-sm font-semibold text-violet-700 shadow-sm shadow-violet-500/15","ring-1 ring-violet-500/10 transition-all duration-200","hover:-translate-y-px hover:border-violet-400/60 hover:from-violet-500/18 hover:to-fuchsia-500/18","hover:shadow-md hover:shadow-violet-500/25","dark:text-violet-200 dark:hover:text-white"),onClick:()=>(0,z.trackEvent)(L.EVENTS.CONTEST_RAIL_CARD_CLICK,{source:t,contest_id:"view_all",position:-1,is_logged_in:a}),children:[(0,c.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-white/0 via-white/30 to-white/0 opacity-0 transition-opacity duration-200 group-hover/view-all:opacity-100 dark:via-white/10"}),(0,c.jsx)("span",{className:"relative",children:"View all"}),(0,c.jsx)("span",{className:"relative inline-flex size-6 items-center justify-center rounded-full bg-violet-600/90 text-white shadow-sm transition-transform duration-200 group-hover/view-all:translate-x-0.5 dark:bg-violet-500",children:(0,c.jsx)(ei.ArrowRight,{className:"size-3.5"})})]})]}),(0,c.jsxs)("div",{className:(0,j.cn)("relative w-full",b&&!r&&"lg:mx-auto lg:max-w-7xl"),children:[b?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{"aria-hidden":!0,className:(0,j.cn)("pointer-events-none absolute left-0 top-0 bottom-2 z-10 hidden bg-gradient-to-r from-background via-background/80 to-transparent transition-opacity duration-200 sm:block sm:w-20",d?"opacity-0":"opacity-100")}),(0,c.jsx)("div",{"aria-hidden":!0,className:(0,j.cn)("pointer-events-none absolute right-0 top-0 bottom-2 z-10 hidden bg-gradient-to-l from-background via-background/80 to-transparent transition-opacity duration-200 sm:block sm:w-20",h?"opacity-0":"opacity-100")})]}):null,(0,c.jsx)("div",{ref:b?n:void 0,className:function(e,t=!1){let r=t?"flex snap-x snap-mandatory gap-3 overflow-x-auto pb-2 [&::-webkit-scrollbar]:hidden":"flex snap-x snap-mandatory gap-3 overflow-x-auto px-4 pb-2 scroll-pl-4 [&::-webkit-scrollbar]:hidden";switch(e){case"single":return(0,j.cn)(t?"w-full":"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8","grid grid-cols-1");case"pair":return(0,j.cn)(t?"w-full":"mx-auto max-w-7xl",r,"sm:grid sm:grid-cols-2 sm:gap-4 sm:overflow-visible sm:pb-0",!t&&"sm:px-6 lg:px-8");case"triple":return(0,j.cn)(t?"w-full":"mx-auto max-w-7xl",r,"sm:grid sm:grid-cols-2 sm:gap-4 sm:overflow-visible sm:pb-0 lg:grid-cols-3",!t&&"sm:px-6 lg:px-8");case"quad":return(0,j.cn)(t?"w-full":"mx-auto max-w-7xl",r,"sm:grid sm:grid-cols-2 sm:gap-4 sm:overflow-visible sm:pb-0 lg:grid-cols-4",!t&&"sm:px-6 lg:px-8");default:return t?r:(0,j.cn)("flex snap-x snap-mandatory gap-3 overflow-x-auto px-4 pb-2 scroll-pl-4 sm:gap-4 sm:px-6 sm:scroll-pl-6 lg:px-8 lg:scroll-pl-8 [&::-webkit-scrollbar]:hidden")}}(g,r),style:f?{scrollbarWidth:"none",msOverflowStyle:"none"}:void 0,children:s.map((e,r)=>(0,c.jsx)(ew,{contest:e,idx:r,layoutMode:g,source:t,isLoggedIn:a},e.id))})]})]})}let e_="h-full w-full object-cover object-top pointer-events-none",ek={[y.STUDIO_TOOLS.VARIATE_DESIGN]:"AI Fashion Design"},ej="brand-dna",ey={id:ej,label:"Brand DNA",description:"Extract your brand's design system and generate on-brand designs instantly.",href:"/brand-dna",image:"https://assets.geniemode.com/geniemode-assets/frontend-uploads/bbbf3307-b7f3-4e70-bd81-4c0295a35688/brandDNA.png"},eS=J.MAGIC_LAYERS_FEATURE.id,eE={id:eS,label:J.MAGIC_LAYERS_FEATURE.title,de
2scription:J.MAGIC_LAYERS_FEATURE.description,href:J.MAGIC_LAYERS_FEATURE.href,image:J.MAGIC_LAYERS_FEATURE.image},eT=[y.STUDIO_TOOLS.ANIMATE_DESIGN,y.STUDIO_TOOLS.THREE_D,y.STUDIO_TOOLS.MOODBOARD,y.STUDIO_TOOLS.TECHPACK,y.STUDIO_TOOLS.VARIATE_DESIGN,y.STUDIO_TOOLS.TRY_ON,y.STUDIO_TOOLS.MATERIAL_CHANGE,y.STUDIO_TOOLS.PRODUCT_SHOTS,y.STUDIO_TOOLS.GLAM_ROOM,y.STUDIO_TOOLS.FABRIC_CHANGE,y.STUDIO_TOOLS.COLOR_EDITING,y.STUDIO_TOOLS.PRINT_CHANGE,y.STUDIO_TOOLS.IMAGE_TO_SKETCH,y.STUDIO_TOOLS.SKETCH_TO_IMAGE,y.STUDIO_TOOLS.ADD_DETAIL_LOGO,y.STUDIO_TOOLS.ERASE,y.STUDIO_TOOLS.TAILORING,y.STUDIO_TOOLS.POSE_EDIT,y.STUDIO_TOOLS.BACKGROUND_EDIT],eO=(t=new Set([y.STUDIO_TOOLS.MOODBOARD,y.STUDIO_TOOLS.THREE_D]),[...(r=y.TOOL_CATEGORIES.flatMap(e=>e.tools).filter(e=>!t.has(e))).slice(0,1),y.STUDIO_TOOLS.THREE_D,y.STUDIO_TOOLS.MOODBOARD,...r.slice(1)]),eC=[{shell:"bg-gradient-to-br from-violet-400/25 via-fuchsia-500/15 to-indigo-600/20 border-violet-400/35 shadow-[inset_0_1px_0_rgba(255,255,255,0.45)] dark:shadow-[inset_0_1px_0_rgba(255,255,255,0.12)]",icon:"text-violet-950/85 dark:text-violet-100",hoverGlow:"group-hover:shadow-[0_0_22px_rgba(139,92,246,0.45)] group-hover:border-violet-400/60"},{shell:"bg-gradient-to-br from-sky-400/22 via-cyan-400/12 to-teal-600/18 border-sky-400/32 shadow-[inset_0_1px_0_rgba(255,255,255,0.4)] dark:shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]",icon:"text-teal-900/80 dark:text-cyan-50",hoverGlow:"group-hover:shadow-[0_0_20px_rgba(34,211,238,0.38)] group-hover:border-cyan-400/55"},{shell:"bg-gradient-to-br from-amber-400/22 via-orange-400/12 to-rose-500/18 border-amber-400/32 shadow-[inset_0_1px_0_rgba(255,255,255,0.4)]",icon:"text-amber-950/80 dark:text-amber-100",hoverGlow:"group-hover:shadow-[0_0_20px_rgba(251,191,36,0.35)] group-hover:border-amber-400/55"},{shell:"bg-gradient-to-br from-emerald-400/20 via-teal-400/12 to-cyan-600/18 border-emerald-400/30 shadow-[inset_0_1px_0_rgba(255,255,255,0.38)]",icon:"text-emerald-950/80 dark:text-emerald-100",hoverGlow:"group-hover:shadow-[0_0_20px_rgba(52,211,153,0.35)] group-hover:border-emerald-400/55"},{shell:"bg-gradient-to-br from-blue-400/22 via-indigo-400/12 to-violet-600/18 border-blue-400/32 shadow-[inset_0_1px_0_rgba(255,255,255,0.4)]",icon:"text-indigo-950/82 dark:text-blue-100",hoverGlow:"group-hover:shadow-[0_0_22px_rgba(99,102,241,0.4)] group-hover:border-indigo-400/55"},{shell:"bg-gradient-to-br from-pink-400/20 via-rose-400/12 to-fuchsia-600/18 border-pink-400/30 shadow-[inset_0_1px_0_rgba(255,255,255,0.38)]",icon:"text-rose-950/80 dark:text-pink-100",hoverGlow:"group-hover:shadow-[0_0_20px_rgba(244,114,182,0.38)] group-hover:border-pink-400/55"}],eI=[{shell:"bg-gradient-to-br from-violet-500/35 via-fuchsia-500/20 to-indigo-600/25 border-violet-400/50 shadow-[inset_0_1px_0_rgba(255,255,255,0.2)]",icon:"text-violet-100",hoverGlow:"group-hover:shadow-[0_0_22px_rgba(167,139,250,0.5)] group-hover:border-violet-300/70"},{shell:"bg-gradient-to-br from-sky-500/30 via-cyan-500/18 to-teal-600/22 border-sky-400/45 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]",icon:"text-cyan-100",hoverGlow:"group-hover:shadow-[0_0_20px_rgba(34,211,238,0.45)] group-hover:border-cyan-300/60"},{shell:"bg-gradient-to-br from-amber-500/28 via-orange-500/16 to-rose-500/22 border-amber-400/45 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]",icon:"text-amber-100",hoverGlow:"group-hover:shadow-[0_0_20px_rgba(251,191,36,0.4)] group-hover:border-amber-300/60"},{shell:"bg-gradient-to-br from-emerald-500/28 via-teal-500/16 to-cyan-600/22 border-emerald-400/40 shadow-[inset_0_1px_0_rgba(255,255,255,0.16)]",icon:"text-emerald-100",hoverGlow:"group-hover:shadow-[0_0_20px_rgba(52,211,153,0.4)] group-hover:border-emerald-300/55"},{shell:"bg-gradient-to-br from-blue-500/30 via-indigo-500/18 to-violet-600/24 border-blue-400/45 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]",icon:"text-blue-100",hoverGlow:"group-hover:shadow-[0_0_22px_rgba(99,102,241,0.45)] group-hover:border-indigo-300/55"},{shell:"bg-gradient-to-br from-pink-500/28 via-rose-500/16 to-fuchsia-600/22 border-pink-400/40 shadow-[inset_0_1px_0_rgba(255,255,255,0.16)]",icon:"text-pink-100",hoverGlow:"group-hover:shadow-[0_0_20px_rgba(244,114,182,0.42)] group-hover:border-pink-300/55"}];function eD({media:e}){return"mp4"===e.kind?(0,c.jsx)(et.default,{src:e.src,poster:e.poster,loop:!0,className:(0,j.cn)("absolute inset-0",e_),"aria-hidden":!0}):(0,c.jsx)(K.default,{src:e.src,alt:"",fill:!0,sizes:"(max-width: 640px) 100v
2w, (max-width: 1280px) 50vw, 33vw",className:(0,j.cn)(e_,"origin-top transition duration-500 ease-out group-hover:scale-[1.03]"),"aria-hidden":!0})}function eA({toolId:e,media:t,index:r,busyToolId:a,disabled:s,onToolClick:i,layout:o}){let l=y.TOOL_DEFINITIONS[e];if(!l)return null;let n=(0,Z.getStudioIcon)(l.icon),d=a===e,u=ek[e]??l.label,m=0===r&&e===y.STUDIO_TOOLS.ANIMATE_DESIGN,h="rail"===o,p=(0,c.jsxs)("div",{className:(0,j.cn)("relative isolate w-full shrink-0 overflow-hidden bg-zinc-100 dark:bg-zinc-800/80",h?"h-[9.75rem]":m?"aspect-[5/3] sm:aspect-[4/3] order-1 xl:order-2 xl:aspect-auto xl:min-h-[13rem] xl:flex-1":"aspect-[5/3] sm:aspect-[4/3]"),children:[(0,c.jsx)(eD,{media:t}),(0,c.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-t from-black/50 via-black/10 to-transparent","aria-hidden":!0})]}),x=(0,c.jsxs)("div",{className:(0,j.cn)("flex min-h-0 flex-1 flex-col justify-between gap-3 overflow-hidden p-4 sm:p-5",h&&"min-h-0 flex-1",m&&"order-2 xl:order-1 xl:max-w-[min(24rem,48%)] xl:shrink-0 xl:justify-center xl:border-r xl:border-black/[0.06] dark:xl:border-white/10"),children:[(0,c.jsxs)("div",{className:"flex items-start gap-3",children:[(0,c.jsx)("span",{className:(0,j.cn)("mt-0.5 flex size-10 shrink-0 items-center justify-center rounded-xl border","border-violet-200/80 bg-violet-500/10 text-violet-700","dark:border-violet-500/30 dark:bg-violet-500/15 dark:text-violet-200"),children:(0,c.jsx)(n,{size:20,className:"shrink-0","aria-hidden":!0})}),(0,c.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,c.jsx)("h3",{className:"line-clamp-2 text-base font-semibold leading-snug tracking-tight text-foreground sm:text-[1.05rem]",children:u}),e===y.STUDIO_TOOLS.MOODBOARD||e===y.STUDIO_TOOLS.TECHPACK||e===y.STUDIO_TOOLS.THREE_D?(0,c.jsx)("span",{className:"rounded-full bg-amber-500/15 px-2 py-0.5 text-[0.65rem] font-semibold uppercase tracking-wide text-amber-800 dark:text-amber-200",children:"New"}):null]}),(0,c.jsx)("p",{className:"mt-1.5 text-sm leading-relaxed text-foreground-muted line-clamp-3",children:l.description})]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2 pl-[3.25rem] text-xs font-medium text-violet-600 dark:text-violet-300/90",children:[(0,c.jsx)("span",{children:"Use this tool"}),(0,c.jsx)(Y.ArrowUpRight,{className:"size-3.5 opacity-80 transition group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]})]}),g=(0,c.jsxs)("button",{type:"button",disabled:s,onClick:()=>i(e),className:(0,j.cn)("group relative flex w-full cursor-pointer overflow-hidden rounded-2xl border text-left transition disabled:cursor-not-allowed",h?"h-[21rem] min-h-[21rem] flex-col":(0,j.cn)("h-full min-h-0",m?"flex-col xl:flex-row xl:items-stretch":"flex-col"),"border-black/[0.06] bg-white/80 shadow-sm backdrop-blur-sm","dar
2k:border-white/10 dark:bg-zinc-900/75 dark:shadow-none","hover:-translate-y-0.5 hover:border-violet-300/60 hover:shadow-md","dark:hover:border-violet-400/35 dark:hover:bg-zinc-900","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-45"),children:[p,x,d?(0,c.jsx)("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-background/55 backdrop-blur-[2px]",children:(0,c.jsx)("span",{className:"size-9 rounded-full border-2 border-violet-400/30 border-t-violet-600 dark:border-t-violet-200 animate-spin"})}):null]});return(0,c.jsx)("div",{className:(0,j.cn)("rail"===o?"flex h-[21rem] w-[min(280px,calc(100vw-3.5rem))] shrink-0 snap-start":(0,j.cn)("flex min-h-0 h-full flex-1",m&&"xl:col-span-2")),children:g})}function eR({entry:e,layout:t,icon:r,ctaLabel:a,badge:s}){let i="rail"===t,o=(0,c.jsxs)("div",{className:(0,j.cn)("relative isolate w-full shrink-0 overflow-hidden bg-zinc-100 dark:bg-zinc-800/80",i?"h-[9.75rem]":"aspect-[5/3] sm:aspect-[4/3]"),children:[(0,c.jsx)(K.default,{src:e.image,alt:"",fill:!0,sizes:"(max-width: 640px) 100vw, (max-width: 1280px) 50vw, 33vw",className:(0,j.cn)(e_,"origin-top transition duration-500 ease-out group-hover:scale-[1.03]"),"aria-hidden":!0}),(0,c.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-t from-black/50 via-black/10 to-transparent","aria-hidden":!0})]}),l=(0,c.jsxs)("div",{className:(0,j.cn)("flex min-h-0 flex-1 flex-col justify-between gap-3 overflow-hidden p-4 sm:p-5",i&&"min-h-0 flex-1"),children:[(0,c.jsxs)("div",{className:"flex items-start gap-3",children:[(0,c.jsx)("span",{className:(0,j.cn)("mt-0.5 flex size-10 shrink-0 items-center justify-center rounded-xl border","border-violet-200/80 bg-violet-500/10 text-violet-700","dark:border-violet-500/30 dark:bg-violet-500/15 dark:text-violet-200"),children:(0,c.jsx)(r,{size:20,className:"shrink-0","aria-hidden":!0})}),(0,c.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,c.jsx)("h3",{className:"line-clamp-2 text-base font-semibold leading-snug tracking-tight text-foreground sm:text-[1.05rem]",children:e.label}),s?(0,c.jsx)("span",{className:"rounded-full bg-amber-500/15 px-2 py-0.5 text-[0.65rem] font-semibold uppercase tracking-wide text-amber-800 dark:text-amber-200",children:s}):null]}),(0,c.jsx)("p",{className:"mt-1.5 text-sm leading-relaxed text-foreground-muted line-clamp-2",children:e.description})]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2 pl-[3.25rem] text-xs font-medium text-violet-600 dark:text-violet-300/90",children:[(0,c.jsx)("span",{children:a}),(0,c.jsx)(Y.ArrowUpRight,{className:"size-3.5 opacity-80 transition group-hover:translate-x-0.5 group-hover:-translate-y-0.5"})]})]});return(0,c.jsx)("div",{className:(0,j.cn)(i?"flex h-[21rem] w-[min(280px,calc(100vw-3.5rem))] shrink-0 snap-start":"flex min-h-0 h-full flex-1"),children:(0,c.jsxs)(X.default,{href:e.href,className:(0,j.cn)("group relative flex w-full cursor-pointer overflow-hidden rounded-2xl border text-left transition",i?"h-[21rem] min-h-[21rem] flex-col":"h-full min-h-0 flex-col","border-black/[0.06] bg-white/80 shadow-sm backdrop-blur-sm","dar
2k:border-white/10 dark:bg-zinc-900/75 dark:shadow-none","hover:-translate-y-0.5 hover:border-violet-300/60 hover:shadow-md","dark:hover:border-violet-400/35 dark:hover:bg-zinc-900","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background"),children:[o,l]})})}function eM({layout:e}){return(0,c.jsx)(eR,{entry:ey,layout:e,icon:p.Dna,ctaLabel:"Open Brand DNA",badge:"New"})}function ez({layout:e}){return(0,c.jsx)(eR,{entry:eE,layout:e,icon:Q.Layers,ctaLabel:"Open Magic Layers",badge:"New"})}function eL({toolIds:e,busyToolId:t,disabled:r,onToolClick:a,suppressTooltips:s,tone:i="theme"}){let o="fashion"===i,l=o?eI:eC;return(0,c.jsx)("div",{className:"min-w-0 relative z-10 -mx-0.5",style:{maskImage:"linear-gradient(90deg, #000 0%, #000 min(100% - 1.75rem, 100%), transparent 100%)",WebkitMaskImage:"linear-gradient(90deg, #000 0%, #000 min(100% - 1.75rem, 100%), transparent 100%)"},children:(0,c.jsx)("div",{role:"list",className:(0,j.cn)("flex gap-4 sm:gap-5 overflow-x-auto overscroll-x-contain py-1 pl-1 pr-6 sm:pr-8","scroll-smooth snap-x snap-mandatory","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","touch-pan-x"),children:e.map((e,n)=>{let d=l[n%l.length];if(e===ej)return(0,c.jsxs)(es.Tooltip,{open:!s&&!r&&void 0,children:[(0,c.jsx)(es.TooltipTrigger,{asChild:!0,children:(0,c.jsxs)(X.default,{href:ey.href,"aria-disabled":r,className:(0,j.cn)("group snap-start shrink-0 flex flex-col items-center gap-1.5 w-[3.65rem] sm:w-[4.1rem] touch-manipulation","cursor-pointer rounded-xl pb-0.5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/50 focus-visible:ring-offset-2",o?"focus-visible:ring-offset-[#0a0a0a]":"focus-visible:ring-offset-background",r&&"pointer-events-none opacity-45"),children:[(0,c.jsxs)("span",{className:(0,j.cn)("relative flex size-11 sm:size-12 items-center justify-center rounded-full transition-all duration-300","border-2",d.shell,d.hoverGlow,!r&&"group-hover:scale-[1.06] group-active:scale-[0.96]"),children:[o?(0,c.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full bg-gradient-to-t from-black/20 to-transparent opacity-60"}):"light"!==i?(0,c.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full bg-gradient-to-t from-black/10 to-transparent opacity-60 dark:from-black/20"}):null,(0,c.jsx)(p.Dna,{size:19,className:(0,j.cn)("relative z-[1] transition-transform duration-300 group-hover:scale-110",d.icon)})]}),(0,c.jsx)("span",{className:(0,j.cn)("w-full text-center text-[9px] sm:text-[10px] font-medium leading-[1.2] line-clamp-2",o?"text-white/45 group-hover:text-white/75":"text-muted-foreground group-hover:text-foreground"),children:ey.label})]})}),(0,c.jsx)(es.TooltipContent,{side:"top",className:"max-w-[14rem] text-xs",children:ey.description})]},e);if(e===eS)return(0,c.jsxs)(es.Tooltip,{open:!s&&!r&&void 0,children:[(0,c.jsx)(es.TooltipTrigger,{asChild:!0,children:(0,c.jsxs)(X.default,{href:eE.href,"aria-disabled":r,className:(0,j.cn)("group snap-start shrink-0 flex flex-col items-center gap-1.5 w-[3.65rem] sm:w-[4.1rem] touch-manipulation","cursor-pointer rounded-xl pb-0.5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/50 focus-visible:ring-offset-2",o?"focus-visible:ring-offset-[#0a0a0a]":"focus-visible:ring-offset-background",r&&"pointer-events-none opacity-45"),children:[(0,c.jsx)("span",{className:(0,j.cn)("relative flex size-11 sm:size-12 items-center justify-center rounded-full transition-all duration-300","border-2",d.shell,d.hoverGlow,!r&&"group-hover:scale-[1.06] group-active:scale-[0.96]"),children:(0,c.jsx)(Q.Layers,{size:19,className:(0,j.cn)("relative z-[1] transition-transform duration-300 group-hover:scale-110",d.icon)})}),(0,c.jsx)("span",{className:(0,j.cn)("w-full text-center text-[9px] sm:text-[10px] font-medium leading-[1.2] line-clamp-2",o?"text-white/45 group-hover:text-white/75":"text-muted-foreground group-hover:text-foreground"),children:eE.label})]})}),(0,c.jsx)(es.TooltipContent,{side:"top",className:"max-w-[14rem] text-xs",children:eE.description})]},e);let u=y.TOOL_DEFINITIONS[e];if(!u)return null;let m=(0,Z.getStudioIcon)(u.icon),h=t===e;return(0,c.jsxs)(es.Tooltip,{open:!s&&!r&&void 0,children:[(0,c.jsx)(es.TooltipTrigger,{asChild:!0,children:(0,c.jsxs)("button",{type:"button",role:"listitem",disabled:r,onClick:()=>a(e),className:(0,j.cn)("group snap-start shrink-0 flex flex-col items-center gap-1.5 w-[3.65rem] sm:w-[4.1rem] touch-manipulation","cursor-pointer disabled:cursor-not-allowed","disabled:opacity-45 disabled:pointer-events-none","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/50 rounded-xl pb-0.5","focus-visible:ring-offset-2",o?"focus-visible:ring-offset-[#0a0a0a]":"focus-visible:ring-offset-background"),children:[(0,c.jsxs)("span",{className:(0,j.cn)("relative flex size-11 sm:size-12 items-center justify-center rounded-full transition-all duration-300","border-2",d.shell,d.hoverGlow,!r&&"group-hover:scale-[1.06] group-active:scale-[0.96]",h&&(0,j.cn)("ring-2 ring-offset-2 ring-violet-500 border-violet-500/60 scale-[1.02]",o?"ring-offset-[#0a0a0a]":"ring-offset-background")),children:[o?(0,c.jsx)("span",{"aria-hidden":!0,
2className:"pointer-events-none absolute inset-0 rounded-full bg-gradient-to-t from-black/20 to-transparent opacity-60"}):"light"!==i?(0,c.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full bg-gradient-to-t from-black/10 to-transparent opacity-60 dark:from-black/20"}):null,h?(0,c.jsx)("span",{className:(0,j.cn)("relative z-[1] size-4 rounded-full border-2 animate-spin border-violet-400/30",o?"border-t-violet-100":"border-t-violet-700 dark:border-t-violet-100")}):(0,c.jsx)(m,{size:19,className:(0,j.cn)("relative z-[1] transition-transform duration-300 group-hover:scale-110",d.icon)})]}),(0,c.jsx)("span",{className:(0,j.cn)("w-full text-center text-[9px] sm:text-[10px] font-medium leading-[1.2] line-clamp-2",o?"text-white/45 group-hover:text-white/75":"text-muted-foreground group-hover:text-foreground"),children:u.label})]})}),(0,c.jsx)(es.TooltipContent,{side:"top",className:"max-w-[14rem] text-xs",children:u.description})]},e)})})})}let eP=(0,u.forwardRef)(function({onOpenQuickStudio:e,variant:t="default",fashionTone:r="dark",onRequireAuth:a},s){let i="fashion"===t,o="orbit"===t,l=i&&"light"===r,n=i||o,d=!0===(0,ee.useIsMobile)(),{fileInputRef:m,busyToolId:h,handleToolClick:p,handleFile:x,requestToolUpload:g}=(0,er.useStudioToolQuickEntry)({onOpenQuickStudio:e,analyticsSource:i?"fashion_landing":o?"home_orbit_rail":void 0,onBeforeToolClick:e=>!a||!!a({type:"quick_studio_tool",toolId:e})});(0,u.useImperativeHandle)(s,()=>({handleToolClick:p,requestToolUpload:g}));let b=!i&&(0,F.isBrandDnaFeatureEnabled)(),v=(0,u.useMemo)(()=>{var e;let t,r;return t=[],(e=b)&&t.push({type:"feature",id:ej}),r=e?4:5,eT.forEach((e,a)=>{a===r&&t.push({type:"feature",id:eS}),t.push({type:"tool",id:e})}),t},[b]),w=(0,u.useMemo)(()=>{let e=b?[...eO.slice(0,2),ej,...eO.slice(2)]:[...eO];return e.length>=5?[...e.slice(0,5),eS,...e.slice(5)]:[...e,eS]},[b]),N=!!h,_=(e,t,r)=>{if("feature"===e.type)return e.id===ej?(0,c.jsx)(eM,{layout:t},`${t}-${e.id}`):e.id===eS?(0,c.jsx)(ez,{layout:t},`${t}-${e.id}`):null;let a=(0,ea.studioToolMarketingMediaFor)(e.id);return(0,c.jsx)(eA,{toolId:e.id,media:a,index:r,busyToolId:h,disabled:N,onToolClick:p,layout:t},`${t}-${e.id}`)},k=(0,j.cn)("relative isolate overflow-hidden rounded-2xl sm:rounded-3xl","border-violet-200/50 dark:border-violet-500/20","bg-gradient-to-b from-violet-50/95 via-background to-background","dark:from-violet-950/35 dark:via-zinc-950 dark:to-zinc-950","shadow-[0_8px_40px_rgba(139,92,246,0.12),0_2px_12px_rgba(0,0,0,0.06)]","dark:shadow-[0_12px_48px_rgba(0,0,0,0.45),inset_0_1px_0_rgba(255,255,255,0.05)]"),y=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute -right-16 top-0 h-48 w-48 rounded-full bg-gradient-to-br from-violet-500/20 to-fuchsia-500/0 blur-3xl dark:from-violet-500/25"}),(0,c.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute -left-10 bottom-0 h-40 w-56 rounded-full bg-gradient-to-tr from-cyan-400/15 to-transparent blur-3xl"}),(0,c.jsx)(f.Sparkles,{"aria-hidden":!0,className:"pointer-events-none absolute right-6 top-4 size-4 text-amber-400/45 dark:text-amber-300/35"})]});return(0,c.jsx)(es.TooltipProvider,{delayDuration:300,children:(0,c.jsxs)("section",{className:(0,j.cn)(i&&(0,j.cn)("home-studio-entry--fashion px-0 pb-0 -mt-1",l?"mx-auto w-full max-w-7xl":"w-full max-w-none"),o&&"home-studio-entry--orbit mx-auto max-w-7xl px-4 pb-8 pt-2 sm:px-6 sm:pb-10 lg:px-8",!n&&"mx-auto max-w-7xl px-4 pb-4 sm:px-6 lg:px-8 sm:pb-6 -mt-0.5 sm:-mt-1"),children:[(0,c.jsx)("input",{ref:m,type:"file",accept:"image/*",className:"hidden",onChange:x}),n?(0,c.jsxs)("div",{className:(0,j.cn)("relative isolate overflow-hidden rounded-2xl sm:rounded-3xl",i?l?["border border-border bg-white","shadow-[0_4px_24px_rgba(124,58,237,0.08),0_1px_3px_rgba(0,0,0,0.06)]"]:["border border-white/10 backdrop-blur-xl","bg-gradient-to-b from-violet-950/50 via-[#0c0c1a]/90 to-[#0a0a0a]","shadow-[0_4px_36px_rgba(124,58,237,0.2),inset_0_1px_0_rgba(255,255,255,0.06)]"]:["border-violet-200/50 dark:border-violet-500/20","bg-gradient-to-b from-violet-50/95 via-background to-background","dark:from-violet-950/35 dar
2k:via-zinc-950 dark:to-zinc-950","shadow-[0_8px_40px_rgba(139,92,246,0.12),0_2px_12px_rgba(0,0,0,0.06)]","dark:shadow-[0_12px_48px_rgba(0,0,0,0.45),inset_0_1px_0_rgba(255,255,255,0.05)]"]),children:[(0,c.jsx)("div",{"aria-hidden":!0,className:(0,j.cn)("pointer-events-none absolute -right-16 top-0 h-48 w-48 rounded-full blur-3xl",i?l?"bg-gradient-to-br from-violet-500/10 to-fuchsia-500/0":"bg-gradient-to-br from-violet-500/25 to-fuchsia-500/0":"bg-gradient-to-br from-violet-500/20 to-fuchsia-500/0 dark:from-violet-500/25")}),(0,c.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute -left-10 bottom-0 h-40 w-56 rounded-full bg-gradient-to-tr from-cyan-400/15 to-transparent blur-3xl"}),(0,c.jsx)(f.Sparkles,{"aria-hidden":!0,className:(0,j.cn)("pointer-events-none absolute right-6 top-4 size-4",i?l?"text-amber-500/40":"text-amber-400/50":"text-amber-400/45 dark:text-amber-300/35")}),(0,c.jsx)("div",{className:"relative px-3 py-2.5 sm:px-4 sm:py-3",children:(0,c.jsx)(eL,{toolIds:w,busyToolId:h,disabled:N,onToolClick:p,suppressTooltips:d||N,tone:i?l?"light":"fashion":"theme"})}),(0,c.jsx)("p",{className:(0,j.cn)("relative z-10 px-3 pb-2.5 pt-0 text-[10px] sm:text-[11px] text-center leading-snug",l?"text-muted-foreground":i?"text-white/40":"text-foreground-muted"),children:"Tap a tool â then choose a photo to edit here."})]}):(0,c.jsxs)("div",{className:"flex flex-col gap-4 sm:gap-5",children:[(0,c.jsxs)("div",{className:k,children:[y,(0,c.jsx)("div",{className:"relative px-3 py-2.5 sm:px-4 sm:py-3",children:(0,c.jsx)(eL,{toolIds:w,busyToolId:h,disabled:N,onToolClick:p,suppressTooltips:d||N,tone:"theme"})})]}),(0,c.jsx)(eN,{source:"home",embedded:!0}),(0,c.jsxs)("div",{className:k,children:[y,(0,c.jsx)("div",{className:"relative z-10 border-b border-violet-200/40 bg-violet-500/[0.04] px-4 py-4 sm:px-6 sm:py-5 dark:border-white/10 dark:bg-white/[0.03]",children:(0,c.jsxs)("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-[0.65rem] font-semibold uppercase tracking-[0.22em] text-violet-600/90 dark:text-violet-300/90",children:"Quick edit"}),(0,c.jsx)("h2",{className:"mt-1 font-semibold text-lg tracking-tight text-foreground sm:text-xl",children:"Pick a tool, upload your look and start editing"}),(0,c.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:"Turn one photo into your next masterpiece"})]}),(0,c.jsxs)("p",{className:"mt-2 flex items-center gap-1.5 text-xs text-foreground-muted sm:mt-0 sm:text-sm",children:[(0,c.jsx)(Y.ArrowUpRight,{className:"size-3.5 shrink-0 opacity-70","aria-hidden":!0}),"Tap a card to choose an image"]})]})}),(0,c.jsxs)("div",{className:"relative z-10 p-3 sm:p-4 md:p-5",children:[(0,c.jsx)("div",{className:"home-quick-edit-scroll -mx-1 flex items-stretch gap-3 overflow-x-auto pb-2 pt-1 sm:hidden",children:v.map((e,t)=>_(e,"rail",t))}),(0,c.jsx)("div",{className:(0,j.cn)("hidden items-stretch gap-3 sm:grid sm:gap-4","sm:grid-cols-2 xl:grid-cols-3"),children:v.map((e,t)=>_(e,"grid",t))})]})]})]})]})})});e.s(["default",0,eP],741581);var eU=e.i(727612),eG=e.i(964053),eB=e.i(931959),eV=e.i(672584);function eF({blueprint:e,open:t,onOpenChange:r,onUsePrompt:a,source:s,canDelete:i=!1,onDelete:o}){let[l,n]=(0,u.useState)(!1),[d,m]=(0,u.useState)(!1),h=async()=>{if(o&&!d&&window.confirm("Delete this community creation? This cannot be undone.")){m(!0);try{await o()}finally{m(!1)}}};if(!e)return null;let p=e.asset_url,x=e.poster_url,g=!l&&(0,j.isVideoUrl)(p),b=l?x:p||x;return(0,c.jsx)(eB.Dialog,{open:t,onOpenChange:r,children:(0,c.jsxs)(eB.DialogContent,{variant:"glass",className:"sm:max-w-5xl w-[95vw] h-[85dvh] md:h-[80dvh] p-0 overflow-hidden gap-0 flex flex-col dark:bg-neutral-900/65 dark:border-white/10",overlayClassName:"dark:bg-black/65",showCloseButton:!1,children:[(0,c.jsx)(eB.DialogTitle,{className:"sr-only",children:"Blueprint preview"}),(0,c.jsxs)(eG.Dialog.Close,{"aria-label":"Close",className:"absolute top-3 right-3 z-20 inline-flex h-9 w-9 items-center justify-center rounded-full bg-black/70 text-white shadow-lg ring-1 ring-white/20 backdrop-blur transition hover:bg-black/85 focus:outline-none focus:ring-2 focus:ring-white/60 cursor-pointer",children:[(0,c.jsx)(N.X,{className:"h-5 w-5"}),(0,c.jsx)("span",{className:"sr-only",children:"Close"})]}),(0,c.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col md:grid md:grid-cols-2 gap-0 overflow-hidden",children:[(0,c.jsx)("div",{className:"relative min-h-0 basis-[60%] grow-0 shrink-0 md:basis-auto md:grow md:shrink flex items-center justify-center overflow-hidden bg-black/20 dark:bg-black/40",children:g?(0,c.jsx)(eV.default,{src:p,poster:x,autoPlay:!0,loop:!0,muted:!0,playsInl
2ine:!0,onError:()=>n(!0),className:"absolute inset-0 w-full h-full object-contain"},p):b&&(0,c.jsx)("img",{src:b,alt:"Blueprint reference",onError:()=>n(!0),className:"absolute inset-0 w-full h-full object-contain"})}),(0,c.jsxs)("div",{className:"flex-1 flex flex-col p-4 sm:p-6 min-h-0 overflow-hidden",children:[(0,c.jsx)("div",{className:"text-xs uppercase tracking-wider text-primary mb-2",children:"Prompt"}),(0,c.jsx)("div",{className:(0,j.cn)("flex-1 min-h-0 overflow-y-auto pr-1 text-sm sm:text-base leading-relaxed","text-foreground whitespace-pre-wrap dark:text-white"),children:e.prompt||"No prompt available."}),(0,c.jsxs)("div",{className:"mt-4 flex justify-end items-center gap-2 shrink-0",children:[i&&o&&(0,c.jsxs)(k.Button,{variant:"outline",className:"h-10 rounded-full px-4 gap-1.5 text-red-600 border-red-300 hover:bg-red-50 hover:text-red-700 dark:border-red-500/40 dark:hover:bg-red-500/10",onClick:h,disabled:d,children:[(0,c.jsx)(eU.Trash2,{className:"h-4 w-4"}),d?"Deletingâ¦":"Delete"]}),(0,c.jsxs)(k.Button,{variant:"gradient",className:"h-10 rounded-full px-5 gap-1.5 shadow-[0_0_18px_rgba(139,92,246,0.45)]",onClick:()=>{(0,z.trackEvent)(L.EVENTS.HOME_BLUEPRINT_USE_PROMPT,{blueprint_id:e?.id,source:s,prompt_length:e?.prompt?.length||0}),a?.(e.prompt||"")},disabled:!e.prompt,children:[(0,c.jsx)(f.Sparkles,{className:"h-4 w-4"}),"Use Prompt"]})]})]})]})]})})}function eH({onUsePrompt:e,usePublicApi:t=!1}){let[r,a]=(0,u.useState)([]),[s,i]=(0,u.useState)(0),[o,l]=(0,u.useState)(0),[n,d]=(0,u.useState)(!0),[m,h]=(0,u.useState)(null),p=(0,u.useRef)(null),x=(0,u.useRef)(null),g=(0,u.useRef)(!1),b=(0,u.useRef)(!1),[f,v]=(0,u.useState)(!0),[w,N]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{v(e.scrollLeft<=2),N(e.scrollLeft+e.clientWidth>=e.scrollWidth-2)};t(),e.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t);let r=new ResizeObserver(t);return r.observe(e),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",t),r.disconnect()}},[r.length]);let _=(0,u.useCallback)(async()=>{if(!g.current&&(!b.current||!o||!(s>=o))){g.current=!0,d(!0);try{let e=s+1,{items:r,totalPages:o}=t?await (async()=>{let{items:t,totalPages:r}=await (0,R.getPublicCollections)(e,20);return{items:t.map(e=>({id:e.id,asset_url:e.url,poster_url:e.url,prompt:e.collection_search?.prompt||""})),totalPages:r}})():await (0,R.getFeaturedBlueprints)(e,20);e>1&&(0,z.trackEvent)(L.EVENTS.HOME_FEATURED_LOAD_MORE,{page:e}),a(e=>[...e,...function(e){let t=e.slice();for(let e=t.length-1;e>0;e--){let r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t}(r)]),l(o),i(e)}catch(e){console.error("Failed to load featured blueprints:",e)}finally{g.current=!1,b.current=!0,d(!1)}}},[s,o,t]);(0,u.useEffect)(()=>{_()},[]),(0,u.useEffect)(()=>{if(!x.current||!p.current)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&_()},{root:p.current,rootMargin:"0px 600px 0px 0px"});return e.observe(x.current),()=>e.disconnect()},[_]);let k=!b.current||o>0&&s<o;return b.current&&0===r.length?null:(0,c.jsxs)("section",{className:"pt-2 pb-10",children:[(0,c.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-4",children:(0,c.jsx)("h2",{className:"text-lg sm:text-xl font-semibold text-foreground",children:"Use our Inspirations"})}),(0,c.jsxs)("div",{className:"relative lg:max-w-7xl lg:mx-auto",children:[(0,c.jsx)("div",{"aria-hidden":!0,className:`pointer-events-none hidden sm:block absolute left-0 top-0 bottom-2 sm:w-20 z-10 bg-gradient-to-r from-background via-background/80 to-transparent transition-opacity duration-200 ${f?"opacity-0":"opacity-100"}`}),(0,c.jsx)("div",{"aria-hidden":!0,className:`pointer-events-none hidden sm:block absolute right-0 top-0 bottom-2 sm:w-20 z-10 bg-gradient-to-l from-background via-background/80 to-transparent transition-opacity duration-200 ${w?"opacity-0":"opacity-100"}`}),(0,c.jsxs)("div",{ref:p,className:"flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory pb-2 pl-4 pr-4 sm:pl-6 sm:pr-6 lg:px-8 scroll-pl-4 sm:scroll-pl-6 lg:scroll-pl-8 [&::-webkit-scrollbar]:hidden",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[!b.current&&n&&0===r.length?Array.from({length:6}).map((e,t)=>(0,c.jsx)(ed.Skeleton,{className:`shrink-0 snap-start w-[180px] sm:w-[220px] aspect-[3/4] rounded-2xl bg-foreground
2/10 dark:bg-white/5 ${0===t?"ml-0":""}`},t)):r.map((e,t)=>{let r=(0,j.isVideoUrl)(e.asset_url),a=e.poster_url||e.asset_url;return(0,c.jsxs)("button",{type:"button",onClick:()=>{(0,z.trackEvent)(L.EVENTS.HOME_FEATURED_BLUEPRINT_CLICK,{blueprint_id:e.id,position:t}),h(e)},className:"group shrink-0 snap-start w-[180px] sm:w-[220px] aspect-[3/4] rounded-2xl overflow-hidden relative bg-foreground/[0.04] dark:bg-white/[0.04] border border-foreground/10 dark:border-white/10 transition-all duration-200 hover:border-foreground/25 dark:hover:border-white/25 hover:shadow-[0_8px_28px_rgba(139,92,246,0.25)] cursor-pointer",children:[r?(0,c.jsx)(eV.default,{src:e.asset_url,poster:e.poster_url||void 0,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"metadata",className:"absolute inset-0 w-full h-full object-cover transition-transform duration-300 group-hover:scale-[1.04]"}):a&&(0,c.jsx)("img",{src:(0,j.getOptimizedImageUrl)(a),alt:e.prompt?.slice(0,60)||"Blueprint",loading:"lazy",className:"absolute inset-0 w-full h-full object-cover transition-transform duration-300 group-hover:scale-[1.04]"}),(0,c.jsx)("div",{className:"absolute inset-x-0 bottom-0 p-3 bg-gradient-to-t from-black/80 via-black/40 to-transparent",children:(0,c.jsx)("div",{className:"text-xs sm:text-sm text-white font-medium line-clamp-2 text-left",children:e.prompt?.slice(0,80)||"Blueprint"})})]},e.id)}),n&&b.current&&(0,c.jsx)(ed.Skeleton,{className:"shrink-0 snap-start w-[180px] sm:w-[220px] aspect-[3/4] rounded-2xl bg-foreground
2/10 dark:bg-white/5"}),k&&(0,c.jsx)("div",{ref:x,className:"shrink-0 w-1","aria-hidden":!0})]})]}),(0,c.jsx)(eF,{blueprint:m,open:!!m,source:"featured_rail",onOpenChange:e=>!e&&h(null),onUsePrompt:t=>{h(null),e?.(t)}})]})}e.s(["default",()=>eF],854184),e.s(["default",()=>eH],554787)},495851,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(664659),s=e.i(655900),i=e.i(349349),o=e.i(798567),l=e.i(614123),n=e.i(398552),d=e.i(435073),c=e.i(510617),u=e.i(854184),m=e.i(532292);let h=["1 / 1","4 / 5","3 / 4","5 / 4"];function p(e){return e>=1024?4:e>=640?3:2}function x({onUsePrompt:e,variant:x="default",analyticsSource:g,maxItems:b,initialVisibleCount:f,expandActionsVariant:v="default"}){let w="fashion"===x,N="landing"===v,_=null!=f&&f>0,[k,j]=(0,r.useState)(!1),[y,S]=(0,r.useState)([]),[E,T]=(0,r.useState)(0),[O,C]=(0,r.useState)(0),[I,D]=(0,r.useState)(!1),[A,R]=(0,r.useState)(!1),[M,z]=(0,r.useState)(null),L=(0,r.useRef)(null),P=(0,r.useRef)(!1),U=function(){let[e,t]=(0,r.useState)(()=>p(window.innerWidth));return(0,r.useEffect)(()=>{let e=()=>t(p(window.innerWidth));return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),G=(0,r.useMemo)(()=>(0,l.isGlobalEditor)((0,o.getUserData)()?.roles),[]),B=(0,r.useCallback)(async(e,t)=>{try{await (0,i.deletePublicCollectionSearch)(e),S(e=>e.filter(e=>e.id!==t)),z(null)}catch(e){console.error("Failed to delete community creation:",e),alert("Failed to delete. Please try again.")}},[]),V=(0,r.useMemo)(()=>!_||k?b??null:Math.min(f,b??f),[_,k,b,f]),F=(0,r.useCallback)(async()=>{if(P.current||null!=V&&y.length>=V||A&&O&&E>=O)return;let e=null!=V?Math.max(0,V-y.length):24;if(null==V||0!==e){P.current=!0,D(!0);try{let t=E+1,r=null!=V?Math.min(24,e):24,{items:a,totalPages:s}=await (0,i.getPublicCollections)(t,r);t>1&&(0,d.trackEvent)(c.EVENTS.HOME_COMMUNITY_LOAD_MORE,{page:t,...g?{source:g}:{}}),S(e=>{let t=[...e,...a],r=b??(null!=V?V:null);return null!=r?t.slice(0,r):t}),C(s),T(t)}catch(e){console.error("Failed to load community creations:",e)}finally{P.current=!1,D(!1),R(!0)}}},[E,O,A,b,V,y.length]);(0,r.useEffect)(()=>{F()},[]),(0,r.useEffect)(()=>{if(_||!L.current)return;let e=L.current,t=new IntersectionObserver(e=>{e[0].isIntersecting&&F()},{rootMargin:"600px 0px"});return t.observe(e),()=>t.disconnect()},[F,_]),(0,r.useEffect)(()=>{!_||!k||null!=V&&y.length>=V||A&&O&&E>=O||F()},[_,k,V,y.length,A,O,E,F]);let H=(0,r.useMemo)(()=>!_||k?y:y.slice(0,f),[_,k,y,f]),$=(0,r.useMemo)(()=>{let e=Array.from({length:U},()=>[]);return H.forEach((t,r)=>{e[r%U].push({item:t,position:r})}),e},[H,U]),W=!(null!=V&&y.length>=V)&&(!A||O>0&&E<O),q=y.length>f||null!=b&&y.length<b||W,K=_&&!k&&q,X=_&&k&&y.length>f;return A&&0===y.length?null:(0,t.jsxs)("section",{className:(0,n.cn)("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16",w&&"fashion-lp-community mt-10 sm:mt-12"),children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)("h2",{className:(0,n.cn)("text-lg sm:text-xl font-semibold",w?"text-white":"text-foreground"),children:"Curated by Slayteq"}),(0,t.jsx)("p",{className:(0,n.cn)("text-sm mt-0.5",w?"text-white/50":"text-muted-foreground"),children:"Hand-picked designs crafted by our in-house design team."}),(0,t.jsx)("p",{className:(0,n.cn)("text-sm",w?"text-white/50":"text-muted-foreground"),children:"Your designs are always private â never shown here or to anyone else."})]}),(0,t.jsx)("div",{className:"flex gap-1 items-start",children:$.map((e,r)=>(0,t.jsx)("div",{className:"flex-1 flex flex-col gap-1 min-w-0",children:e.map(({item:e,position:r})=>{var a,s;let i=(0,n.isVideoUrl)(e.url),o=(a=e.url)?a.includes("?")?`${a}&format=webp`:`${a}?format=webp`:a,l=e.collection_search?.prompt||"";return(0,t.jsx)("button",{type:"button",onClick:()=>{(0,d.trackEvent)(c.EVENTS.HOME_COMMUNITY_CREATION_CLICK,{item_id:e.id,position:r,...g?{source:g}:{}}),z({id:e.id,collection_search_id:e.collection_search?.id,prompt:l,asset_url:o,poster_url:o})},className:(0,n.cn)("group overflow-hidden transition-all duration-200 relative block w-full text-left cursor-pointer",w?"bg-white/[0.04]":"bg-foreground
2/[0.04] dark:bg-white/[0.04]"),style:{aspectRatio:h[Math.abs("number"==typeof(s=e.id)?s:parseInt(String(s),10)||0)%h.length]},children:i?(0,t.jsx)(m.default,{src:o,loop:!0,preload:"metadata",className:"w-full h-full object-cover block transition-transform duration-300 group-hover:scale-[1.03]"}):(0,t.jsx)("img",{src:o,alt:"Community creation",loading:"lazy",className:"w-full h-full object-cover block transition-transform duration-300 group-hover:scale-[1.03]"})},e.id)})},r))}),I&&(0,t.jsx)("div",{className:"flex justify-center py-8","aria-label":"Loading more creations",children:(0,t.jsx)("div",{className:(0,n.cn)("w-8 h-8 rounded-full border-2 animate-spin",w?"border-white/20 border-t-white":"border-foreground/20 border-t-foreground")})}),(K||X)&&(0,t.jsxs)("div",{className:(0,n.cn)("flex gap-3 pt-6",N?"justify-start":"justify-center"),children:[K?(0,t.jsxs)("button",{type:"button",onClick:()=>j(!0),disabled:I,className:(0,n.cn)("transition-colors cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",N?"btn-fashion-primary min-w-[11rem]":(0,n.cn)("rounded-full border px-5 py-2 text-sm font-medium",w?"border-white/20 bg-white/5 text-white hover:bg-white/10":"border-border bg-background text-foreground hover:bg-muted")),children:[N?"View more designs":"View more",N?(0,t.jsx)(a.ChevronDown,{className:"h-4 w-4 shrink-0","aria-hidden":!0}):null]}):null,X?(0,t.jsxs)("button",{type:"button",onClick:()=>j(!1),className:(0,n.cn)("transition-colors cursor-pointer",N?"btn-fashion-primary min-w-[11rem]":(0,n.cn)("rounded-full border px-5 py-2 text-sm font-medium",w?"border-white/20 bg-transparent text-white/70 hover:text-white hover:bg-white/5":"border-border bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted")),children:[N?"Show less":"View less",N?(0,t.jsx)(s.ChevronUp,{className:"h-4 w-4 shrink-0","aria-hidden":!0}):null]}):null]}),W&&!_&&(0,t.jsx)("div",{ref:L,className:"h-10"}),(0,t.jsx)(u.default,{blueprint:M,open:!!M,source:"community_grid",onOpenChange:e=>!e&&z(null),onUsePrompt:t=>{z(null),e?.(t)},canDelete:G,onDelete:M?.collection_search_id?()=>B(M.collection_search_id,M.id):void 0})]})}e.s(["default",()=>x])}]); 3 4//# debugId=347868f0-af30-6f09-5bcd-bf1df91d1efe
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.