1import{r,j as e,e as H,L as je,f as ze,v as ts,h as ns,t as W,b as O,i as Ae,k as rs,l as os,m as ls,a as cs,c as ve,n as ds}from"./index-BiDoBQGc.js";import{u as ms,g as ps}from"./helpers-D-HFXimp.js";function hs({needed:i,remaining:s,onClose:a}){const m=r.useRef(null);return ms(m,!0),r.useEffect(()=>{const p=g=>{g.key==="Escape"&&(g.stopPropagation(),a())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[a]),e.jsx("div",{className:"credits-modal-overlay",onClick:a,children:e.jsxs("div",{ref:m,className:"credits-modal",role:"dialog","aria-modal":"true","aria-labelledby":"credits-modal-title",onClick:p=>p.stopPropagation(),children:[e.jsx("button",{className:"credits-modal-close","aria-label":"Close credits dialog",onClick:a,children:"Ã"}),e.jsx("div",{className:"credits-modal-icon",children:e.jsx(H,{size:40})}),e.jsx("h2",{id:"credits-modal-title",children:"Not enough credits"}),e.jsxs("p",{className:"credits-modal-detail",children:["This action requires ",e.jsxs("strong",{children:[e.jsx(H,{size:13})," ",i]})," credits, but you have ",e.jsxs("strong",{children:[e.jsx(H,{size:13})," ",s]})," remaining."]}),e.jsx("div",{className:"credits-modal-actions",children:e.jsx(je,{to:"/billing",className:"btn btn-primary",onClick:a,children:"Upgrade Plan"})}),e.jsx("p",{className:"credits-modal-upsell",children:"On Starter ($19/mo) you'd get 2,500 credits â enough for ~62 assets."}),e.jsx("p",{className:"credits-modal-hint",children:"Tip: Reuse saved brands to skip the 150-credit research fee."}),e.jsx(je,{to:"/",className:"credits-modal-gallery-link",onClick:a,children:"See what you've created â"})]})})}function us({imageAssetCount:i,presentationSlideAssets:s=0,videoAssets:a,isSavedBrand:m}){const p=ns(),g=ze(i,s,a,m),N=m?0:p.brand_research,u=i*p.asset_generation,f=s*(p.presentation_deck||p.asset_generation),w=a.map(d=>{const y=ts(d.video_type,d.resolution,d.duration_s),x=Math.max(1,d.variations??1),_=d.duration_s??15;return{label:`${d.video_type} Ã ${d.resolution} Ã ${_}s`,n:x,per:y,total:y*x}});return e.jsxs("div",{className:"wizard-cost-badge",title:"Estimated cost â deducted only when generation succeeds.",children:[e.jsx("span",{className:"wizard-cost-label",children:"Estimated cost"}),e.jsxs("span",{className:"wizard-cost-total",children:[e.jsx(H,{}),g.toLocaleString()]}),e.jsxs("div",{className:"wizard-cost-breakdown",children:[!m&&N>0&&e.jsxs("div",{className:"wizard-cost-row",children:[e.jsx("span",{children:"Brand research"}),e.jsx("span",{children:N})]}),m&&e.jsxs("div",{className:"wizard-cost-row wizard-cost-free",children:[e.jsx("span",{children:"Saved brand"}),e.jsx("span",{children:"0"})]}),i>0&&e.jsxs("div",{className:"wizard-cost-row",children:[e.jsxs("span",{children:[i," image asset",i!==1?"s":""]}),e.jsx("span",{children:u.toLocaleString()})]}),s>0&&e.jsxs("div",{className:"wizard-cost-row",children:[e.jsxs("span",{children:[s," presentation slide",s!==1?"s":""]}),e.jsx("span",{children:f.toLocaleString()})]}),w.map((d,y)=>e.jsxs("div",{className:"wizard-cost-row",children:[e.jsxs("span",{children:[d.n," Ã ",d.label]}),e.jsx("span",{children:d.total.toLocaleString()})]},y))]})]})}function ce({text:i,label:s="More information"}){const a=r.useId();return e.jsxs("span",{className:"info-tip",children:[e.jsx("button",{type:"button",className:"info-tip-button","aria-label":s,"aria-describedby":a,children:e.jsx("span",{"aria-hidden":"true",children:"i"})}),e.jsx("span",{id:a,role:"tooltip",className:"info-tip-bubble",children:i})]})}function xs({step:i,campaignPrompt:s,setCampaignPrompt:a,brandName:m,setBrandName:p,websiteUrl:g,setWebsiteUrl:N,brandLocked:u,instagramUrl:f,setInstagramUrl:w,igLockedByBrand:d,brands:y,selectedBrand:x,selectedBrandData:_,toggleSavedBrand:b,dragOver:t,setDragOver:v,fileRef:A,handleFiles:j,uploadedFiles:M,removeFile:S,hasPptx:B,presentationMode:L,togglePresentationMode:D,pptxInfo:I}){return e.jsx("div",{className:`wizard-panel ${i===1?"active":""}`,id:"wizard-step-1",children:e.jsxs("div",{className:"step-content",children:[e.jsxs("div",{className:"campaign-brief-hero",children:[e.jsxs("div",{className:"label-with-tip label-with-tip-brief",children:[e.jsx("label",{htmlFor:"campaign-prompt",className:"brief-label",children:"Campaign Vision"}),e.jsx(ce,{label:"Campaign Vision guidance",text:"If you want to move beyond your website's current look, describe the visual direction clearly: mood, composition, lighting, references, or the overall feel you want to achieve."})]}),e.jsx("textarea",{id:"campaign-prompt",className:"brief-textarea",placeholder:"Describe your campaign vision... e.g. 'Spring sale campaign highlighting our new product line with warm, inviting visuals and a 30% off promotion'",rows:5,value:s,onChange:h=>a(h.target.value)})]}),e.jsxs("div",{className:"brand-fields",children:[e.jsxs("div",{className:"field-row",children:[e.jsxs("div",{className:"field-group",children:[e.jsx("label",{htmlFor:"brand-name",children:"Brand Name"}),e.jsx("input",{type:"text",id:"brand-name",placeholder:"e.g. Acme Corp",autoComplete:"off",value:m,onChange:h=>p(h.target.value)})]}),e.jsxs("div",{className:"field-group",children:[e.jsxs("div",{className:"label-with-tip",children:[e.jsx("label",{htmlFor:"website-url",children:"Website URL"}),e.jsx(ce,{label:"Website URL guidance",text:"If you want to feature a specific product or collection, paste its direct page URL here instead of the homepage."})]}),e.jsxs("div",{className:"url-input-wrap",children:[e.jsxs("svg",{className:"url-input-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M2 12h20"}),e.jsx("path",{d:"M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"})]}),e.jsx("input",{type:"text",id:"website-url",placeholder:"example.com",autoComplete:"off",value:g,onChange:h=>N(h.target.value),disabled:u,title:u?"Part of saved brand â edit in Brand Library to change":void 0,className:u?"brand-locked":void 0,onClick:()=>u&&W("Part of saved brand. Edit in Brand Library to change.","info")})]})]})]}),e.jsx("div",{className:"field-row",children:e.jsxs("div",{className:"field-group",children:[e.jsxs("div",{className:"label-with-tip",children:[e.jsxs("label",{htmlFor:"instagram-url",children:["Instagram ",e.jsx("span",{className:"text-muted",children:"(optional)"})]}),e.jsx(ce,{label:"Instagram guidance",text:"Only public profiles are supported. Private or restricted accounts cannot be accessed."})]}),e.jsxs("div",{className:"url-input-wrap",children:[e.jsxs("svg",{className:"url-input-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"5",ry:"5"}),e.jsx("path",{d:"M16 11.37A4 4 0 1112.63 8 4 4 0 0116 11.37z"}),e.jsx("line",{x1:"17.5",y1:"6.5",x2:"17.51",y2:"6.5"})]}),e.jsx("input",{type:"text",id:"instagram-url",placeholder:"@profile or instagram.com/profile",autoComplete:"off",value:f,onChange:h=>w(h.target.value),disabled:d,title:d?"Part of saved brand â edit in Brand Library to change":void 0,className:d?"brand-locked":void 0,onClick:()=>d&&W("Part of saved brand. Edit in Brand Library to change.","info")})]})]})}),y.length>0&&e.jsxs("div",{className:"field-group saved-brands-section",children:[e.jsxs("label",{children:["Reuse Saved Brand ",e.jsx("span",{className:"text-muted",children:"(skip fresh brand research)"})]}),e.jsx("div",{className:"brand-chips",id:"brand-chips",children:y.map(h=>e.jsxs("button",{type:"button",className:`brand-chip ${x===h.slug?"selected":""}`,onClick:()=>b(h),children:[e.jsx("div",{className:"brand-chip-colors",children:(h.colors||[]).slice(0,3).map(P=>e.jsx("span",{className:"brand-chip-swatch",style:{background:P}},P))}),e.jsx("span",{children:h.brand_name})]},h.slug))}),_&&e.jsxs("div",{className:"brand-context-badge",children:[e.jsx("span",{className:"brand-context-dot"}),e.jsxs("span",{children:["Reusing saved brand intelligence for ",_.brand_name]})]})]}),e.jsxs("div",{className:"field-group",children:[e.jsxs("label",{children:["Reference Material ",e.jsx("span",{className:"text-muted",children:"(optional â highest priority)"})]}),e.jsxs("div",{className:`upload-zone ${t?"drag-over":""}`,id:"upload-zone",onClick:()=>A.current?.click(),onDragOver:h=>{h.preventDefault(),v(!0)},onDragLeave:()=>v(!1),onDrop:h=>{h.preventDefault(),v(!1),j(h.dataTransfer.files)},children:[e.jsxs("div",{className:"upload-zone-content",children:[e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),e.jsxs("p",{children:["Drop files here or ",e.jsx("span",{className:"upload-l
1ink",children:"browse"})]}),e.jsx("p",{className:"text-muted text-sm",children:"Images, PDFs, Word, Excel, PowerPoint â up to 50MB each"})]}),e.jsx("input",{ref:A,type:"file",id:"file-input",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.txt,.md,.rtf,.odt,.xls,.xlsx,.csv,.tsv,.ppt,.pptx",style:{display:"none"},onChange:h=>{h.target.files&&j(h.target.files),h.target.value=""}})]}),e.jsx("div",{className:"upload-previews",id:"upload-previews",children:M.map((h,P)=>e.jsxs("div",{className:"upload-preview",children:[h.dataUrl?e.jsx("img",{src:h.dataUrl,alt:""}):e.jsxs("div",{className:"upload-preview-doc",children:[e.jsx("span",{className:"upload-doc-ext",children:h.file.name.split(".").pop()?.toUpperCase()}),e.jsx("span",{className:"upload-doc-name",children:h.file.name.length>18?h.file.name.slice(0,15)+"...":h.file.name})]}),e.jsx("button",{className:"upload-preview-remove",onClick:C=>{C.stopPropagation(),S(P)},children:"Ã"})]},P))}),B&&e.jsxs("div",{className:"pptx-beautify-row",children:[e.jsxs("div",{className:"toggle-row",onClick:()=>D(!L),children:[e.jsxs("span",{className:"toggle-label",children:[e.jsx("strong",{children:"Beautify Presentation"}),I&&e.jsxs("span",{className:"pptx-meta text-muted text-sm",children:[I.slide_count," slide",I.slide_count!==1?"s":""," · ",I.aspect_ratio]})]}),e.jsx("div",{className:`toggle-switch ${L?"active":""}`,children:e.jsx("div",{className:"toggle-knob"})})]}),e.jsx("p",{className:"text-muted text-sm",style:{marginTop:4},children:"Redesign every slide with your brand's visual identity while preserving all content."})]})]})]})]})})}function Ee({active:i,requiredTier:s,message:a,style:m,children:p}){return i?e.jsxs("span",{className:"upgrade-hint-wrapper",style:m,children:[p,e.jsxs("span",{className:"upgrade-hint-popup",role:"tooltip",children:[e.jsx("strong",{className:"upgrade-hint-tier",children:s}),e.jsx("span",{children:a}),e.jsx(je,{to:"/billing",className:"upgrade-hint-link",children:"Upgrade on /billing â"})]})]}):e.jsx(e.Fragment,{children:p})}const Ce=[{key:"cinematic_portra_filmic",label:"Cinematic Portra",video_type:"story",description:"Muted filmic palette, shallow focus, quiet-luxury cinematography.",rhythm_hint:"PATIENT",category:"tv_spot"},{key:"tabletop_product_hero",label:"Tabletop Product Hero",video_type:"story",description:"Studio product film with macro inserts and controlled light.",rhythm_hint:"MINIMAL REVEAL",category:"product"},{key:"kinetic_crowd_festival",label:"Kinetic Crowd Festival",video_type:"story",description:"Fast crowd-energy montage with handheld commercial motion.",rhythm_hint:"KINETIC CROWD",category:"performance"},{key:"domestic_warm_family",label:"Domestic Warmth",video_type:"story",description:"Kitchen light, family rituals, and unhurried domestic moments.",rhythm_hint:"PATIENT",category:"tv_spot"}
1,{key:"swiss_grid_motion_graphic",label:"Swiss-Grid Motion Graphic",video_type:"infographic",description:"Orthographic grid motion, crisp hierarchy, broadcast polish.",rhythm_hint:"MINIMAL REVEAL",category:"motion_graphic"},{key:"flat_vector_cartoon",label:"Flat-Vector Cartoon",video_type:"infographic",description:"Bold 2D shapes with hand-animated bounce and appeal.",rhythm_hint:"FAST MONTAGE",category:"animation"},{key:"pixar_3d_cartoon_silent",label:"Pixar 3D Cartoon (Silent)",video_type:"infographic",description:"Polished silent 3D character animation with natural weight.",rhythm_hint:"FAST MONTAGE",category:"animation"},{key:"chalkboard_line_draw",label:"Chalkboard Line-Draw",video_type:"infographic",description:"White chalk strokes appearing on a deep green chalkboard.",rhythm_hint:"PATIENT",category:"tutorial"}],Le=[{key:"ugc",label:"UGC",description:"Raw, social-media-native creator videos",engine_hint:"story"},{key:"tutorial",label:"Tutorial",description:"Step-by-step explainers (photographic or animated)",engine_hint:"mixed"},{key:"unboxing",label:"Unboxing",description:"Product reveal and packaging films",engine_hint:"story"},{key:"hyper_motion",label:"Hyper Motion",description:"Camera-kinetic product cinema â orbits, FPV swoops, speed-ramps",engine_hint:"story"},{key:"performance",label:"Performance",description:"Athletic, festival, stage, broadcast energy",engine_hint:"story"},{key:"product_review",label:"Product Review",description:"Comparison, before/after, authentic field tests",engine_hint:"story"},{key:"tv_spot",label:"TV Spot",description:"Cinematic narrative brand films",engine_hint:"story"},{key:"product",label:"Product",description:"Studio product films â hero shots, macros, materials",engine_hint:"story"},{key:"try_on",label:"Try-On",description:"Body, wear, virtual fitting",engine_hint:"story"},{key:"animation",label:"Animation",description:"Illustrated, 3D character, hand-drawn (mixed engine)",engine_hint:"mixed"},{key:"motion_graphic",label:"Motion Graphic",description:"Typography, UI, data-viz â text rendered faithfully",engine_hint:"infographic"}],vs={cinematic_portra_filmic:"film",editorial_quiet_luxury:"film",heritage_craftsmanship:"macro",kinetic_crowd_festival:"kinetic",athletic_kinetic_grit:"kinetic",domestic_warm_family:"warm",nordic_minimalist_product:"product",wild_nature_panorama:"panorama",tabletop_product_hero:"product",liquid_hero_macro:"liquid",material_macro_archive:"macro",unboxing_ritual:"hands",tabletop_gourmet:"warm",engineering_reveal:"product",swiss_grid_motion_graphic:"grid",flat_vector_cartoon:"vector",pixar_3d_cartoon_silent:"toon3d",chalkboard_line_draw:"chalk",editorial_typographic:"type"};function gs(i){return i?vs[i.key]||(i.video_type==="infographic"?"grid":"film"):"auto"}function Pe({style:i}){return e.jsxs("div",{className:`video-style-loop video-style-loop-${gs(i)}`,"aria-hidden":"true",children:[e.jsx("span",{className:"vsl-layer vsl-a"}),e.jsx("span",{className:"vsl-layer vsl-b"}),e.jsx("span",{className:"vsl-layer vsl-c"}),e.jsx("span",{className:"vsl-layer vsl-d"})]})}function ge({style:i,selected:s,onClick:a}){return e.jsxs("button",{type:"button",className:`video-style-card ${s?"selected":""}`,"aria-pressed":s,onClick:a,children:[e.jsxs("div",{className:"video-style-thumb",children:[i.preview_url?e.jsx("video",{src:i.preview_url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"metadata"}):e.jsx(Pe,{style:i}),e.jsx("span",{className:`video-style-badge ${i.video_type==="infographic"?"video-style-badge-info":""}`,children:i.video_type==="infographic"?"Info":"Story"})]}),e.jsx("span",{className:"video-style-card-name",children:i.label}),e.jsx("span",{className:"video-style-card-desc",children:i.description})]})}function js({selectedStyle:i,selectedCategory:s,onSelectCategory:a,onSelectAuto:m,onSelectStyle:p}){const[g,N]=r.useState(Ce),[u,f]=r.useState(Le);r.useEffect(()=>{let t=!0;return O("/api/video-styles").then(v=>{!t||!Array.isArray(v)||!v.length||N(v)}).catch(()=>{t&&N(Ce)}),O("/api/video-categories").then(v=>{!t||!Array.isArray(v)||!v.length||f(v)}).catch(()=>{t&&f(Le)}),()=>{t=!1}},[]);const w=r.useMemo(()=>u.find(t=>t.key===s),[u,s]),d=r.useMemo(()=>s==="auto"?g:g.filter(t=>t.category===s),[g,s]),y=w?.engine_hint==="mixed",x=r.useMemo(()=>d.filter(t=>t.video_type!=="infographic"),[d]),_=r.useMemo(()=>d.filter(t=>t.video_type==="infographic"),[d]),b=e.jsxs("button",{type:"button",className:`video-style-card video-style-card-auto ${i?"":"selected"}`,"aria-pressed":!i,onClick:m,children:[e.jsxs("div",{className:"video-style-thumb",children:[e.jsx(Pe,{style:null}),e.jsx("span",{className:"video-style-badge",children:"Auto"})]}),e.jsx("span",{className:"video-style-card-name",children:"Auto match"}),e.jsx("span",{className:"video-style-card-desc",children:s==="auto"?"Pick the best treatment from the brand and campaign brief.":`Auto-pick within ${w?.label??"this category"} based on brand and brief.`})]});return e.jsxs("div",{className:"video-style-selector",children:[e.jsxs("div",{className:"video-style-tabs",role:"tablist","aria-label":"Video category",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":s==="auto",className:`video-style-tab ${s==="auto"?"active":""}`,onClick:()=>a("auto"),children:"Auto"}),u.map(t=>e.jsx("button",{type:"button",role:"tab","aria-selected":s===t.key,className:`video-style-tab ${s===t.key?"active":""}`,onClick:()=>a(t.key),children:t.label},t.key))]}),w&&e.jsx("p",{className:"video-style-tab-desc",children:w.description}),s==="auto"?null:y?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"video-style-grid",children:b}),x.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"video-style-section-header",children:"Photographic"}),e.jsx("div",{className:"video-style-grid",children:x.map(t=>e.jsx(ge,{style:t,selected:i===t.key,onClick:()=>p(t)},t.key))})]}),_.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"video-style-section-header video-style-section-header-info",children:"Animated · renders text and elements faithfully"}),e.jsx("div",{className:"video-style-grid",children:_.map(t=>e.jsx(ge,{style:t,selected:i===t.key,onClick:()=>p(t)},t.key))})]})]}):e.jsxs("div",{className:"video-style-grid",children:[b,d.map(t=>e.jsx(ge,{style:t,selected:i===t.key,onClick:()=>p(t)},t.key))]})]})}const ys=["480p","720p","1080p"];function fs(i,s){if(s!=="story"&&s!=="infographic")return i.label;const a=s==="infographic"?"Infographic spot":"Story spot";return i.label.replace(/^(Story|Infographic) spot/i,a)}function bs({selectedVideoMediums:i,allSupport1080p:s,plan1080pAllowed:a,videoDuration:m,setVideoDuration:p,videoRes
1olution:g,setVideoResolution:N,videoKind:u,setVideoKind:f,videoStyle:w,setVideoStyle:d,videoCategory:y,setVideoCategory:x}){const _=()=>{d(""),f("auto")},b=t=>{(t.video_type==="story"||t.video_type==="infographic")&&f(t.video_type),d(t.key)};return e.jsxs("div",{className:"section-block","data-testid":"video-options",children:[e.jsx("h3",{className:"section-title",children:"Video options"}),e.jsx("p",{className:"text-muted text-sm",children:i.length===0?"Duration, resolution, and kind apply to every video medium you pick below.":i.length===1?`Applies to the ${fs(i[0],u)} medium.`:`Applies to all ${i.length} video mediums in this campaign.`}),e.jsxs("div",{className:"setup-grid",style:{marginTop:12},children:[e.jsxs("div",{className:"section-block section-block-full",children:[e.jsx("h3",{className:"section-title",style:{fontSize:"0.9rem"},children:"Treatment"}),e.jsx(js,{selectedStyle:w,selectedCategory:y,onSelectCategory:x,onSelectAuto:_,onSelectStyle:b})]}),e.jsxs("div",{className:"section-block",children:[e.jsx("h3",{className:"section-title",style:{fontSize:"0.9rem"},children:"Duration"}),e.jsxs("div",{className:"slider-control",children:[e.jsx("input",{type:"range",id:"video-duration-slider",min:"5",max:"15",step:"1",value:m,onChange:t=>p(parseInt(t.target.value))}),e.jsxs("div",{className:"slider-labels",children:[e.jsx("span",{children:"5s"}),e.jsx("span",{children:"10s"}),e.jsx("span",{children:"15s"})]}),e.jsxs("div",{className:"slider-value",id:"video-duration-value",children:[m,"s"]})]}),e.jsx("p",{className:"text-muted text-sm",style:{marginTop:6},children:u==="infographic"?"Shorter durations use fewer keyframes (min 4 s/transition).":"One continuous clip of your chosen length."})]}),e.jsxs("div",{className:"section-block",children:[e.jsx("h3",{className:"section-title",style:{fontSize:"0.9rem"},children:"Resolution"}),e.jsx("div",{className:"segmented-control",id:"video-resolution-control",children:ys.map(t=>{const v=t==="1080p"&&!s,A=t==="1080p"&&!a,j=v||A,M=v?"A selected medium does not support 1080p.":A?"1080p is a Business-tier feature. Upgrade on /billing to unlock.":void 0,S=e.jsxs("button",{type:"button",className:`seg-btn ${g===t?"active":""}`,"data-value":t,disabled:j,title:M,onClick:()=>!j&&N(t),style:j?{opacity:.4,cursor:"not-allowed"}:void 0,children:[t,A&&e.jsx("span",{style:{marginLeft:4,fontSize:"0.7em",opacity:.8},children:"· Business"})]},t);return A&&!v?e.jsx(Ee,{active:!0,requiredTier:"Business",message:"1080p video is a Business-tier feature.",children:S},t):S})}),e.jsxs("p",{className:"text-muted text-sm",style:{marginTop:6},children:[g==="480p"&&"Fastest and cheapest. Good for tests.",g==="720p"&&"Recommended. Ships for most use cases.",g==="1080p"&&"Highest quality. Business-tier only."]})]})]})]})}const Ns=new Set(["video_seedance_story","video_seedance_infographic"]),ws=["video_story_landscape","video_story_portrait","video_story_square"],_s={video_story_landscape:{label:"Landscape 16:9",description:"Landscape paid-social creative for Facebook or Instagram feeds and reels."},video_story_portrait:{label:"Portrait 9:16",description:"Story or reel cover with strong top and bottom safe areas."},video_story_square:{label:"Square 1:1",description:"Square post for organic social, LinkedIn, or carousel single cards."}};function ks(i,s){const a=s.replace(/^video_(?:story|infographic)_/,"");return i.find(m=>m.match(/^video_(?:story|infographic)_(.+)$/)?.[1]===a)}function Ss({allMediums:i,selectedMediums:s,toggleMedium:a,variations:m,setVariations:p,imageModel:g,setImageModel:N,creativity:u,setCreativity:f,sortedLocales:w,selectedLocales:d,toggleLocale:y,includeLogo:x,setIncludeLogo:_,includeCta:b,setIncludeCta:t,videoDuration:v,setVideoDuration:A,videoResolution:j,setVideoResolution:M,videoKind:S,setVideoKind:B,videoStyle:L,setVideoStyle:D,videoCategory:I,setVideoCategory:h,presentationMode:P=!1,pptxInfo:C=null}){const{plan:G}=Ae(),V=G==="pro"||G==="business",Y=G==="business",[$,J]=r.useState(()=>s.some(z=>{const F=i.find(E=>E.key===z);return F&&Ns.has(F.generator)})?"video":"image"),de=$==="image"?i.filter(o=>o.generator==="image"&&o.key!=="presentation_deck"):ws.map(o=>i.find(z=>z.key===o)).filter(o=>!!o),T=o=>{if(o===$||o==="video"&&!V)return;const z=o==="image",F=new Set;for(const E of s){if(F.has(E))continue;F.add(E);const K=i.find(Q=>Q.key===E);if(!K)continue;const q=K.generator==="image";z!==q&&a(E)}J(o)},se=s.map(o=>i.find(z=>z.key===o)).filter(o=>!!o&&!!o.video_type),X=se.every(o=>o.supports_1080p);return e.jsxs("div",{className:"step-content",children:[P?e.jsxs("div",{className:"section-block",children:[e.jsx("h3",{className:"section-title",children:"Mediums"}),e.jsxs("div",{className:"presentation-summary-card","data-testid":"presentation-summary",children:[e.jsxs("div",{className:"presentation-summary-header",children:[e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,opacity:.8},children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),e.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),e.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),e.jsx("span",{className:"presentation-summary-title",children:"Presentation Deck"})]}),C?e.jsxs("div",{className:"presentation-summary-meta",children:[e.jsxs("span",{children:[C.slide_count," slide",C.slide_count!==1?"s":""]}),e.jsx("span",{className:"presentation-summary-dot",children:"·"}),e.jsx("span",{children:C.aspect_ratio}),e.jsx("span",{className:"presentation-summary-dot",children:"·"}),e.jsxs("span",{children:[C.width_px,"Ã",C.height_px]})]}):e.jsx("div",{className:"presentation-summary-meta",children:e.jsx("span",{children:"Slides detected from uploaded file"})}),e.jsxs("div",{className:"presentation-summary-estimate",children:[e.jsx(H,{size:13}
1),e.jsx("span",{children:C?`${rs(C.slide_count,m).toLocaleString()} credits estimated`:"Credit estimate available after upload"})]}),C&&C.slide_count>15&&e.jsxs("div",{className:"presentation-summary-warning",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),e.jsxs("span",{children:["Large deck (",C.slide_count," slides) â generation will take longer and use more credits."]})]})]})]}):e.jsxs("div",{className:"section-block",children:[e.jsx("h3",{className:"section-title",children:"Mediums"}),e.jsx("p",{className:"text-muted text-sm",children:"Select the formats you want to generate"}),e.jsxs("div",{className:"segmented-control",id:"medium-mode-control",style:{marginTop:8,marginBottom:12,maxWidth:260},children:[e.jsx("button",{type:"button",className:`seg-btn ${$==="image"?"active":""}`,"data-value":"image",onClick:()=>T("image"),children:"Image"}),e.jsx(Ee,{active:!V,requiredTier:"Pro or Business",message:"Video generation is available on paid tiers.",children:e.jsxs("button",{type:"button",className:`seg-btn ${$==="video"?"active":""}`,"data-value":"video",disabled:!V,title:V?void 0:"Video is a Pro/Business-tier feature. Upgrade on /billing to unlock.",onClick:()=>T("video"),style:V?void 0:{opacity:.55,cursor:"not-allowed"},children:["Video",!V&&e.jsx("span",{style:{marginLeft:4,fontSize:"0.7em",opacity:.8},children:"· Pro+"})]})})]}),e.jsx("div",{className:"medium-cards",id:"medium-cards",children:de.map(o=>{const z=ps(o.key,o.delivery_size),F=$==="video"?ks(s,o.key):void 0,E=$==="video"?!!F:s.includes(o.key),K=F||o.key,q=$==="video"?_s[o.key]:void 0,Q=q?.label??o.label,ie=q?.description??o.description;return e.jsxs("div",{className:`medium-card ${E?"selected":""}`,"data-medium":o.key,onClick:()=>a(K),children:[e.jsx("div",{className:"medium-card-check",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsx("div",{className:"medium-card-preview",children:e.jsx("div",{className:`medium-card-ratio ${z}`})}),e.jsx("div",{className:"medium-card-name",children:Q}),e.jsx("div",{className:"medium-card-desc",children:ie})]},o.key)})})]}),!P&&$==="video"&&e.jsx(bs,{selectedVideoMediums:se,allSupport1080p:X,plan1080pAllowed:Y,videoDuration:v,setVideoDuration:A,videoResolution:j,setVideoResolution:M,videoKind:S,setVideoKind:B,videoStyle:L,setVideoStyle:D,videoCategory:I,setVideoCategory:h}),e.jsxs("div",{className:"setup-grid",children:[e.jsxs("div",{className:"section-block",children:[e.jsx("h3",{className:"section-title",children:"Variations"}),e.jsxs("div",{className:"slider-control",children:[e.jsx("input",{type:"range",id:"variations-slider",min:"1",max:"4",value:m,step:"1",onChange:o=>p(parseInt(o.target.value))}),e.jsxs("div",{className:"slider-labels",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"2"}),e.jsx("span",{children:"3"}),e.jsx("span",{children:"4"})]}),e.jsx("div",{className:"slider-value",id:"variations-value",children:m===1?"1 variation":`${m} variations`})]})]}),!1,e.jsxs("div",{className:"section-block",children:[e.jsxs("h3",{className:"section-title",children:["Call To Action",e.jsx(ce,{label:"What is a Call To Action?",text:"A 'Call to Action' (CTA) is the button or short instruction â like 'Sign up', 'Get started', or 'Shop now' â that tells the viewer what to do next. Leave this off for pure brand-awareness ads where you don't want a button or directive copy inside the image."})]}),e.jsxs("div",{className:"toggle-row",onClick:()=>t(!b),children:[e.jsx("span",{className:"toggle-label",children:"Include a CTA in generated assets"}),e.jsx("div",{className:`toggle-switch ${b?"active":""}`,children:e.jsx("div",{className:"toggle-knob"})})]}),e.jsx("p",{className:"text-muted text-sm",style:{marginTop:6},children:b?"A short call-to-action button or directive copy will be rendered inside the image.":"Assets will be generated
1without any CTA button or directive copy â pure brand awareness."})]}),e.jsxs("div",{className:"section-block",children:[e.jsx("h3",{className:"section-title",children:"Creativity"}),e.jsxs("div",{className:"segmented-control",id:"creativity-control",children:[e.jsx("button",{type:"button",className:`seg-btn ${u==="low"?"active":""}`,"data-value":"low",onClick:()=>f("low"),children:"Safe"}),e.jsx("button",{type:"button",className:`seg-btn ${u==="medium"?"active":""}`,"data-value":"medium",onClick:()=>f("medium"),children:"Balanced"}),e.jsx("button",{type:"button",className:`seg-btn ${u==="high"?"active":""}`,"data-value":"high",onClick:()=>f("high"),children:"Wild"})]}),e.jsxs("div",{className:"creativity-desc",children:[u==="low"&&e.jsx("p",{children:"Consistent layouts, staying close to the brand's existing visual language."}),u==="medium"&&e.jsx("p",{children:"Fresh variations in composition and styling while keeping brand consistency."}),u==="high"&&e.jsx("p",{children:"Award-winning, scroll-stopping concepts. Surreal, bold, unconventional."})]})]}),e.jsxs("div",{className:"section-block",children:[e.jsx("h3",{className:"section-title",children:"Brand Logo"}),e.jsxs("div",{className:"toggle-row",onClick:()=>_(!x),children:[e.jsx("span",{className:"toggle-label",children:"Include logo in generated assets"}),e.jsx("div",{className:`toggle-switch ${x?"active":""}`,children:e.jsx("div",{className:"toggle-knob"})})]}),e.jsx("p",{className:"text-muted text-sm",style:{marginTop:6},children:x?"The brand logo will be used as reference and integrated into compositions.":"Assets will be generated without any brand logo."})]}),e.jsxs("div",{className:"section-block section-block-full",children:[e.jsx("h3",{className:"section-title",children:"Language"}),e.jsx("p",{className:"text-muted text-sm",children:"Choose the language for generated assets and brand copy"}),e.jsx("div",{className:"locale-cards",id:"locale-cards",children:w.map(o=>e.jsx("button",{className:`locale-card ${d.includes(o.code)?"selected":""}`,"data-code":o.code,type:"button",onClick:()=>y(o.code),children:e.jsx("span",{children:o.name})},o.code))})]})]})]})}function Cs({step:i,brandName:s,websiteUrl:a,campaignPrompt:m,mediumLabels:p,variations:g,imageModel:N,creativity:u,creativityLabels:f,localeLabels:w,selectedBrandData:d,uploadedFilesCount:y,selectedMediumsHaveVideo:x,isAdmin:_,testModeVideo:b,setTestModeVideo:t,disguiseBrand:v,setDisguiseBrand:A,generating:j,estimatedCredits:M,startGeneration:S,goToStep:B}){return e.jsx("div",{className:`wizard-panel ${i===3?"active":""}`,id:"wizard-step-3",children:e.jsxs("div",{className:"step-content",children:[e.jsx("h3",{className:"section-title",children:"Campaign Summary"}),e.jsx("div",{className:"review-card",children:e.jsxs("div",{className:"review-grid",id:"review-summary",children:[e.jsxs("div",{className:"review-item",children:[e.jsx("span",{className:"review-label",children:"Brand"}),e.jsx("span",{className:"review-value",children:s}),e.jsx("button",{className:"review-edit-btn",onClick:()=>B(1),children:"Edit"})]}),e.jsxs("div",{className:"review-item",children:[e.jsx("span",{className:"review-label",children:"Website"}),e.jsx("span",{className:"review-value",children:a||"Not specified"}),e.jsx("button",{className:"review-edit-btn",onClick:()=>B(1),children:"Edit"})]}),m&&e.jsxs("div",{className:"review-item review-item-full",children:[e.jsx("span",{className:"review-label",children:"Campaign Brief"}),e.jsx("span",{className:"review-value review-brief",children:m}),e.jsx("button",{className:"review-edit-btn",onClick:()=>B(1),children:"Edit"})]}),e.jsxs("div",{className:"review-item review-item-full",children:[e.jsx("span",{className:"review-label",children:"Mediums"}),e.jsx("div",{className:"review-mediums",children:p.map((L,D)=>e.jsx("span",{className:"review-medium-tag",children:L},D))}),e.jsx("button",{className:"review-edit-btn",onClick:()=>B(2),children:"Edit"})]}),e.jsxs("div",{className:"review-item",children:[e.jsx("span",{className:"review-label",children:"Variations"}),e.jsx("span",{className:"review-value",children:g})]}),e.jsxs("div",{className:"review-item",children:[e.jsx("span",{className:"review-label",children:"Engine"}),e.jsx("span",{className:"review-value",children:N==="openai"?"Artistic":"Faithful"})]}),e.jsxs("div",{className:"review-item",children:[e.jsx("span",{className:"review-label",children:"Creativity"}),e.jsx("span",{className:"review-value",children:f[u]})]}),e.jsxs("div",{className:"review-item",children:[e.jsx("span",{className:"review-label",children:"Language"}),e.jsx("span",{className:"review-value",children:w.join(", ")})]}),d&&e.jsxs("div",{className:"review-item",children:[e.jsx("span",{className:"review-label",children:"Saved Brand"}),e.jsx("span",{className:"review-value",children:d.brand_name})]}),y>0&&e.jsxs("div",{className:"review-item",children:[e.jsx("span",{className:"review-label",children:"Reference Images"}),e.jsxs("span",{className:"review-value",children:[y," file",y!==1?"s":""]})]})]})}),_&&x&&e.jsx("div",{className:"review-admin-toggle","data-testid":"test-mode-toggle",children:e.jsxs("label",{className:"toggle-row",htmlFor:"test-mode-video",children:[e.jsx("input",{id:"test-mode-video",type:"checkbox",checked:b,onChange:L=>t(L.target.checked)}),e.jsxs("span",{className:"toggle-label",children:[e.jsx("strong",{children:"Test mode"}),e.jsxs("span",{className:"text-muted text-sm",children:["Admin-only. Skip the Seedance render; the video will be a crossfade of the already-generated keyframes. Dossier, planning, and Studio UX
1still run normally, but the video credit cost is ",e.jsx("strong",{children:"0"}),"."]})]})]})}),_&&e.jsx("div",{className:"review-admin-toggle","data-testid":"disguise-brand-toggle",children:e.jsxs("label",{className:"toggle-row",htmlFor:"disguise-brand",children:[e.jsx("input",{id:"disguise-brand",type:"checkbox",checked:v,onChange:L=>A(L.target.checked)}),e.jsxs("span",{className:"toggle-label",children:[e.jsx("strong",{children:"Disguise brand"}),e.jsx("span",{className:"text-muted text-sm",children:"Admin-only. Anonymize brand identity for portfolio use â name, colors, logo, fonts, and people are randomized."})]})]})}),e.jsx("div",{className:"review-actions",children:e.jsxs("button",{className:"btn btn-primary btn-lg btn-generate",id:"btn-generate",disabled:j,onClick:S,children:[e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}),j?"Starting...":"Generate Campaign",e.jsxs("span",{className:"credit-cost",children:["(",e.jsx(H,{}),os(M),")"]})]})})]})})}async function Ls(i){if(!i.length)return"";const s=new FormData;for(const a of i)if(a.remoteUrl&&a.file.size===0)try{const m=await fetch(a.remoteUrl);if(m.ok){const p=await m.blob();s.append("files",new File([p],a.remoteName||a.file.name))}}catch{}else s.append("files",a.file);try{return(await O("/api/upload",{method:"POST",body:s})).upload_id}catch{return""}}function zs(i){let s=i.trim();return s?(/^www\./i.test(s)&&(s="https://"+s),/^https?:\/\//i.test(s)||(s="https://"+s),s):""}const As=["image/","application/pdf","text/","application/msword","application/vnd.openxmlformats-officedocument","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.oasis.opendocument","application/rtf","application/vnd.apple"];function Es(){const i=r.useRef(!1);return{async run(s){if(!i.current){i.current=!0;try{return await s()}finally{i.current=!1}}}}}function Ms(){const s=ls().state?.draft||{},[a,m]=r.useState(1),[p,g]=r.useState(s.brandName||""),[N,u]=r.useState(s.websiteUrl||""),[f,w]=r.useState(s.instagramUrl||""),[d,y]=r.useState(s.campaignPrompt||""),[x,_]=r.useState(s.mediums&&s.mediums.length?s.mediums:["square_social"]),[b,t]=r.useState([]),[v,A]=r.useState([]),[j,M]=r.useState(s.savedBrand||""),[S,B]=r.useState(s.variations||1),[L,D]=r.useState(s.imageModel||"openai"),[I,h]=r.useState(s.creativity||"medium"),[P,C]=r.useState(s.includeLogo!==!1),[G,V]=r.useState(s.includeCta===!0),[Y,$]=r.useState(s.videoDuration||15),[J,de]=r.useState(s.videoResolution||"720p"),[T,se]=r.useState(s.videoKind||"auto"),[X,o]=r.useState(s.videoStyle||""),[z,F]=r.useState("auto"),[E,K]=r.useState(!1),[q,Q]=r.useState(!1),[ie,ye]=r.useState([]),[Z,Te]=r.useState(s.locales&&s.locales.length?s.locales:["en"]),[ae,me]=r.useState(()=>s.referenceFiles?.length?s.referenceFiles.map(n=>({file:new File([],n.name),dataUrl:n.type==="image"?n.url:void 0,remoteUrl:n.url,remoteName:n.name})):[]),[Me,fe]=r.useState(!1),[Be,Ie]=r.useState(!1),[$e,be]=r.useState(!1),[Fe,Ve]=r.useState(0),[R,pe]=r.useState(!1),[te,ne]=r.useState(null),Re=r.useRef(null),Ue=Es(),We=cs(),he=ae.some(n=>/\.pptx$/i.test(n.file.name||n.remoteName||""));r.useEffect(()=>{!he&&R&&(pe(!1),ne(null))},[he,R]);const Oe=async n=>{if(pe(n),!n){ne(null);return}const l=await Ne();if(!l){pe(!1);return}try{const c=await O("/api/analyze-pptx",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({upload_id:l})});ne(c)}catch{ne(null)}};r.useEffect(()=>{O("/api/mediums").then(t).catch(n=>{ve(n,{area:"wizard.load_mediums"})}),O("/api/brands").then(A).catch(n=>{ve(n,{area:"wizard.load_brands"})}),O("/api/locales").then(ye).catch(n=>{ve(n,{area:"wizard.load_locales"}),ye([{code:"en",name:"English"}])})},[]),r.useEffect(()=>{(s.brandName||s.websiteUrl||s.campaignPrompt||s.mediums?.length||s.variations||s.locales?.length)&&W("Campaign settings imported","success")},[]);const De=r.useCallback(n=>{const l=Array.from(n).filter(c=>As.some(k=>c.type.startsWith(k))||/\.(pdf|txt|md|doc|docx|rtf|odt|xls|xlsx|csv|tsv|ppt|pptx)$/i.test(c.name));l.length&&l.forEach(c=>{if(c.type.startsWith("image/")){const k=new FileReader;k.onload=U=>me(le=>[...le,{file:c,dataUrl:U.target?.result}]),k.readAsDataURL(c)}else me(k=>[...k,{file:c}])})},[]),qe=n=>me(l=>l.filter((c,k)=>k!==n)),Ne=()=>Ls(ae),Ge=()=>{a>1&&m(a-1)},Ke=()=>{if(a===1&&!p.trim()){W("Please enter a brand name","error");return}if(a===1&&!N.trim()){W("Please enter a website URL","error");return}if(a===2&&!x.length){W("Select at least one medium","error");return}a<3&&m(a+1)},He=n=>_(l=>{const c=Array.from(new Set(l));return c.includes(n)?c.filter(k=>k!==n):[...c,n]}),Ye=n=>{if(j===n.slug){M("");return}M(n.slug),g(n.brand_name||""),n.website_url&&u(n.website_url),w(n.instagram_url||"")},we=!!j,Je=n=>Te(l=>l.includes(n)?l.length===1?l:l.filter(c=>c!==n):[...l,n]),ee=Ae(),re=[];let oe=0;const _e=R&&te?Math.max(0,te.slide_count)*Math.max(1,S):0;if(!R)for(const n of x){const l=b.find(c=>c.key===n);if(l)if(l.video_type==="story"||l.video_type==="infographic"){if(E)continue;const c=T==="story"||T==="infographic"?T:l.video_type;re.push({video_type:c,resolution:J||l.default_resolution||"720p",variations:Math.max(1,S),duration_s:Y})}else oe+=(l.asset_count||1)*Math.max(1,S)}const ue=Math.max(1,Z.length);oe*=ue;for(const n of re)n.variations=(n.variations??1)*ue;
1const ke=ze(oe,_e*ue,re,!!j),Xe=async()=>{await Ue.run(async()=>{if(!p.trim()){W("Brand name is required","error");return}const n=ke;if(ee.loaded&&ee.remaining<n){Ve(n),be(!0);return}fe(!0);const l=await Ne(),c=R?["presentation_deck"]:x,k=c.some(U=>{const le=b.find(as=>as.key===U);return!!(le&&le.video_type)});try{const U=await O("/api/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({brand_name:p,website_url:zs(N),instagram_url:f.trim(),campaign_prompt:d,mediums:c,variations:S,quality:"medium",creativity:I,image_model:L,upload_id:l,saved_brand:j,saved_brand_mode:j?"reuse":"",locales:Z.length?Z:["en"],include_logo:P,include_cta:G,...R?{pptx_upload_id:l}:{},...k?{video_duration_s:Y,video_resolution:J,video_kind:T,...X?{video_style:X}:{},...z&&z!=="auto"?{video_category:z}:{},test_mode_video:E}:{},...q?{disguise_brand:!0}:{}})});ds(),ee.refresh(),We("/studio/"+U.run_id)}catch(U){fe(!1),W(U instanceof Error?U.message:"Failed to start campaign","error")}})},Se=["en","es","it","fr","de","pt"],Qe=[...ie].sort((n,l)=>{const c=Se.indexOf(n.code),k=Se.indexOf(l.code);return c===-1&&k===-1?n.name.localeCompare(l.name):c===-1?1:k===-1?-1:c-k}),Ze=x.map(n=>{const l=b.find(c=>c.key===n);if(!l)return n;if((T==="story"||T==="infographic")&&l.video_type){const c=T==="infographic"?"Infographic spot":"Story spot";return l.label.replace(/^(Story|Infographic) spot/i,c)}return l.label}),es={low:"Safe",medium:"Balanced",high:"Wild"},ss=Z.map(n=>{const l=ie.find(c=>c.code===n);return l?l.name:n.toUpperCase()}),xe=v.find(n=>n.slug===j),is=we&&!!xe?.instagram_url;return e.jsxs("section",{className:"view view-wizard",children:[e.jsxs("div",{className:"wizard-container",children:[e.jsx(us,{imageAssetCount:oe,presentationSlideAssets:_e,videoAssets:re,isSavedBrand:!!j}),e.jsxs("div",{className:"wizard-progress",children:[e.jsxs("div",{className:`wizard-step ${a>=1?a===1?"active":"completed":""}`,"data-step":"1",children:[e.jsx("div",{className:"step-dot",children:e.jsx("span",{children:"1"})}),e.jsx("span",{className:"step-label",children:"Brand"})]}),e.jsx("div",{className:`step-line ${a>1?"completed":""}`}),e.jsxs("div",{className:`wizard-step ${a>=2?a===2?"active":"completed":""}`,"data-step":"2",children:[e.jsx("div",{className:"step-dot",children:e.jsx("span",{children:"2"})}),e.jsx("span",{className:"step-label",children:"Setup"})]}),e.jsx("div",{className:`step-line ${a>2?"completed":""}`}),e.jsxs("div",{className:`wizard-step ${a===3?"active":""}`,"data-step":"3",children:[e.jsx("div",{className:"step-dot",children:e.jsx("span",{children:"3"})}),e.jsx("span",{className:"step-label",children:"Review"})]})]}),e.jsxs("div",{className:"wizard-panels",children:[e.jsx(xs,{step:a,campaignPrompt:d,setCampaignPrompt:y,brandName:p,setBrandName:g,websiteUrl:N,setWebsiteUrl:u,brandLocked:we,instagramUrl:f,setInstagramUrl:w,igLockedByBrand:is,brands:v,selectedBrand:j,selectedBrandData:xe,toggleSavedBrand:Ye,dragOver:Be,setDragOver:Ie,fileRef:Re,handleFiles:De,uploadedFiles:ae,removeFile:qe,hasPptx:he,presentationMode:R,togglePresentationMode:Oe,pptxInfo:te}),e.jsx("div",{className:`wizard-panel ${a===2?"active":""}`,id:"wizard-step-2",children:e.jsx(Ss,{allMediums:b,selectedMediums:x,toggleMedium:He,variations:S,setVariations:B,imageModel:L,setImageModel:D,creativity:I,setCreativity:h,sortedLocales:Qe,selectedLocales:Z,toggleLocale:Je,includeLogo:P,setIncludeLogo:C,includeCta:G,setIncludeCta:V,videoDuration:Y,setVideoDuration:$,videoResolution:J,setVideoResolution:de,videoKind:T,setVideoKind:se,videoStyle:X,setVideoStyle:o,videoCategory:z,setVideoCategory:F,presentationMode:R,pptxInfo:te})}),e.jsx(Cs,{step:a,brandName:p,websiteUrl:N,campaignPrompt:d,mediumLabels:Ze,variations:S,imageModel:L,creativity:I,creativityLabels:es,localeLabels:ss,selectedBrandData:xe,uploadedFilesCount:ae.length,selectedMediumsHaveVideo:x.some(n=>{const l=b.find(c=>c.key===n);return!!(l&&l.video_type)}),isAdmin:!!ee.isAdmin,testModeVideo:E,setTestModeVideo:K,disguiseBrand:q,setDisguiseBrand:Q,generating:Me,estimatedCredits:ke,startGeneration:Xe,goToStep:m})]}),e.jsxs("div",{className:"wizard-nav",children:[e.jsxs("button",{className:"btn btn-ghost",id:"wizard-back",style:{visibility:a===1?"hidden":"visible"},onClick:Ge,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),e.jsx("polyline",{points:"12 19 5 12 12 5"})]}),"Back"]}),e.jsxs("button",{className:"btn btn-primary",id:"wizard-next",style:{display:a===3?"none":""},onClick:Ke,children:["Next",e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),e.jsx("polyline",{points:"12 5 19 12 12 19"})]})]})]})]}),$e&&e.jsx(hs,{needed:Fe,remaining:ee.remaining,onClose:()=>be(!1)})]})}export{Ms as default,Es as useSubmitGuard};
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.