1import{K as se,r as l,j as e,J as S,a6 as V,B as n,b5 as F,S as ae,O as re,Q as te,V as x,F as ne,W as h,m as i,n as c,o,p as u,q as d,T as le,G as ie,I as ce,u as m,s as O}from"./index-C7pw77Xk.js";import{F as B}from"./Footer-B1FxTiVi.js";import{S as C,a as k,b as T,c as G,d as a}from"./select-DegmmPWz.js";import{B as L}from"./badge-DSmCHSpi.js";import{u as oe}from"./useGeminiChat-BL3d84S0.js";import{S as R}from"./search-DTrxlWOd.js";import{S as A}from"./share-2-VcC8D_W3.js";import{V as I}from"./video-DjVN5p7k.js";import{W as E}from"./wand-sparkles-DF1guG_i.js";import{C as de}from"./copy-uPohUJYc.js";import"./map-pin-CPjZeiIL.js";import"./index-BdQq_4o_.js";import"./index-CEvpGvV7.js";import"./check-DgAICY2I.js";const Ce=()=>{const{user:W,loading:M}=se(),[U,$]=l.useState("write"),[j,p]=l.useState(!1),[g,D]=l.useState(""),[f,H]=l.useState("blog"),[v,q]=l.useState("professional"),[w,J]=l.useState("medium"),[y,z]=l.useState(""),[b,K]=l.useState(""),[r,Q]=l.useState(null),[N,P]=l.useState("huggingface"),{sendMessage:_}=oe();if(M)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(S,{className:"w-8 h-8 animate-spin"})});if(!W)return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-secondary/5 to-background",children:[e.jsx(V,{}),e.jsxs("div",{className:"container mx-auto px-4 py-20 text-center",children:[e.jsx("h1",{className:"text-4xl font-bold mb-4",children:"AI Studio"}),e.jsx("p",{className:"text-xl text-muted-foreground",children:"Please sign in to access AI Studio"})]}),e.jsx(B,{})]});const X=async()=>{if(!g.trim()){m.error("Please enter a prompt");return}p(!0);try{if(N==="gemini"){const s=f==="recipe"?"recipe":"creative_content",t=`Create ${f} content about: ${g}. Use a ${v} tone and make it ${w} length.`,ee=await _([{role:"user",content:t}],{agentType:s});z(ee),m.success("Content generated with Gemini!")}else{const{data:s,error:t}=await O.functions.invoke("ai-service",{body:{task:"generate",prompt:g,inputs:{type:f},tone:v,length:w}});if(t)throw t;if(s.ok)z(s.data),m.success("Content generated successfully!");else throw new Error(s.error)}}catch(s){console.error("Generation error:",s),m.error("Failed to generate content")}finally{p(!1)}},Y=async()=>{if(!b.trim()){m.error("Please enter a URL to analyze");return}p(!0);try{const{data:s,error:t}=await O.functions.invoke("ai-service",{body:{task:"seo-analyze",url:b}});if(t)throw t;if(s.ok)Q(s.data),m.success("SEO analysis completed!");else throw new Error(s.error)}catch(s){console.error("SEO analysis error:",s),m.error("Failed to analyze SEO")}finally{p(!1)}},Z=s=>{navigator.clipboard.writeText(s),m.success("Copied to clipboard!")};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary/5 via-secondary/5 to-background",children:[e.jsx(V,{}),e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-4xl font-bold mb-4 bg-gradient-to-r from-primary to-purple-600 bg-clip-text text-transparent",children:"ð¤ AI Studio"}),e.jsxs("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:["Powered by ",N==="gemini"?"Google Gemini":"Hugging Face"," ⢠Create content, analyze SEO, generate videos, and automate workflows with AI"]}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4",children:[e.jsxs(n,{variant:N==="huggingface"?"default":"outline",onClick:()=>P("huggingface"),size:"sm",children:[e.jsx(F,{className:"w-4 h-4 mr-2"}),"Hugging Face"]}),e.jsxs(n,{variant:N==="gemini"?"default":"outline",onClick:()=>P("gemini"),size:"sm",children:[e.jsx(ae,{className:"w-4 h-4 mr-2"}),"Gemini AI"]})]})]}),e.jsxs(re,{value:U,onValueChange:$,className:"w-full",children:[e.jsxs(te,{className:"grid w-full grid-cols-5 mb-8",children:[e.jsxs(x,{value:"write",className:"flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4"}),"Write"]}),e.jsxs(x,{value:"seo",className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"SEO"]}),e.jsxs(x,{value:"social",className:"flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"}),"Social"]}),e.jsxs(x,{value:"video",className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"Video"]}),e.jsxs(x,{value:"workflow",className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4"}),"Workflow"]})]}),e.jsx(h,{value:"write",className:"space-y-6",children:e.jsxs(i,{children:[e.jsxs(c,{children:[e.jsxs(o,{className:"flex items-center gap-2",children:[e.jsx(F,{className:"w-5 h-5"}),"Content Generator"]}),e.jsx(u,{children:"Generate blogs, emails, ads, and more with AI-powered writing"})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs(C,{value:f,onValueChange:H,children:[e.jsx(k,{children:e.jsx(T,{placeholder:"Content Type"})}),e.jsxs(G,{children:[e.jsx(a,{value:"blog",children:"Blog Post"}),e.jsx(a,{value:"email",children:"Email"}),e.jsx(a,{value:"ad",children:"Ad Copy"}),e.jsx(a,{value:"social",children:"Social Post"}),e.jsx(a,{value:"script",children:"Video Script"}),e.jsx(a,{value:"recipe",children:"Recipe"})]})]}),e.jsxs(C,{value:v,onValueChange:q,children:[e.jsx(k,{children:e.jsx(T,{placeholder:"Tone"})}),e.jsxs(G,{children:[e.jsx(a,{value:"professional",children:"Professional"}),e.jsx(a,{value:"friendly",children:"Friendly"}),e.jsx(a,{value:"casual",children:"Casual"}),e.jsx(a,{value:"compelling",children:"Compelling"}),e.jsx(a,{value:"engaging",children:"Engaging"})]})]}),e.jsxs(C,{value:w,onValueChange:J,children:[e.jsx(k,{children:e.jsx(T,{placeholder:"Length"})}),e.jsxs(G,{children:[e.jsx(a,{value:"short",children:"Short"}),e.jsx(a,{value:"medium",children:"Medium"}),e.jsx(a,{value:"long",children:"Long"})]})]})]}),e.jsx(le,{placeholder:"Describe what you want to create... (e.g., 'healthy meal prep ideas for busy professionals')",value:g,onChange:s=>D(s.target.value),className:"min-h-[100px]"}),e.jsx(n,{onClick:X,disabled:j,className:"w-full",children:j?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Content"}),y&&e.jsxs(i,{className:"mt-4",children:[e.jsxs(c,{className:"flex flex-row items-center justify-between",children:[e.jsx(o,{className:"text-lg",children:"Generated Content"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(n,{variant:"outline",size:"sm",onClick:()=>Z(y),children:e.jsx(de,{className:"w-4 h-4"})}),e.jsx(n,{variant:"outline",size:"sm",children:e.jsx(ie,{className:"w-4 h-4"})})]})]}),e.jsx(d,{children:e.jsx("pre",{className:"whitespace-pre-wrap text-sm bg-muted p-4 rounded-lg",children:y})})]})]})]})}),e.jsx(h,{value:"seo",className:"space-y-6",children:e.jsxs(i,{children:[e.jsxs(c,{children:[e.jsxs(o,{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-5 h-5"}),"SEO Analyzer"]}),e.jsx(u,{children:"Analyze your website's SEO performance and get actionable insights"})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ce,{placeholder:"Enter URL to analyze (e.g., https://example.com)",value:b,onChange:s=>K(s.target.value),className:"flex-1"}),e.jsx(n,{onClick:Y,disabled:j,children:j?e.jsx(S,{className:"w-4 h-4 animate-spin"}):"Analyze"})]}),r&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs(i,{children:[e.jsx(c,{children:e.jsxs(o,{className:"flex items-center justify-between",children:["SEO Score",r.score===null||r.score===void 0?e.jsx(L,{variant:"outline",children:"Not analysed"}):e.jsxs(L,{variant:r.score>=80?"default":r.score>=60?"secondary":"destructive",children:[r.score,"/100"]})]})}),e.jsx(d,{children:r.score===null||r.score===void 0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"The page could not be fetched, so no checks were run. No score is shown rather than a placeholder one."}):e.jsx("div",{className:"w-full bg-secondary rounded-full h-3",children:e.jsx("div",{className:"bg-primary h-3 rounded-full transition-all duration-300",style:{width:`${r.score}%`}})})})]}),r.issues.length>0&&e.jsxs(i,{children:[e.jsx(c,{children:e.jsx(o,{className:"text-destructive",children:"Issues Found"})}),e.jsx(d,{children:e.jsx("ul",{className:"space-y-2",children:r.issues.map((s,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-destructive",children:"â¢"}),e.jsx("span",{children:s})]},t))})})]}),e.jsxs(i,{children:[e.jsx(c,{children:e.jsx(o,{className:"text-green-600",children:"Recommendations"})}),e.jsx(d,{children:e.jsx("ul",{className:"space-y-2",children:r.fixes.map((s,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600",children:"â"}),e.jsx("span",{children:s})]},t))})})]})]})]})]})}),e.jsx(h,{value:"social",className:"space-y-6",children:e.jsxs(i,{children:[e.jsxs(c,{children:[e.jsxs(o,{className:"flex items-center gap-2",children:[e.jsx(A,{className:"w-5 h-5"}),"Social Media Manager"]}),e.jsx(u,{children:"Generate and schedule social media content across platforms"})]}),e.jsxs(d,{className:"text-center py-12",children:[e.jsx(A,{className:"w-16 h-16 mx-auto mb-4 text-muted-foreground"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Social Media Integration"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Connect your social accounts to start generating platform-specific content"}),e.jsx(n,{className:"mr-2",children:"Connect Instagram"}),e.jsx(n,{variant:"outline",className:"mr-2",children:"Connect Twitter"}),e.jsx(n,{variant:"outline",children:"Connect LinkedIn"})]})]})}),e.jsx(h,{value:"video",className:"space-y-6",children:e.jsxs(i,{children:[e.jsxs(c,{children:[e.jsxs(o,{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-5 h-5"}),"Video Generator"]}),e.jsx(u,{children:"Create videos from scripts with AI-powered scenes and voiceover"})]}),e.jsxs(d,{className:"text-center py-12",children:[e.jsx(I,{className:"w-16 h-16 mx-auto mb-4 text-muted-foreground"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Video Production Pipeline"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Transform your content into engaging videos with automated script-to-video generation"}),e.jsx(n,{disabled:!0,children:"Coming Soon"})]})]})}),e.jsx(h,{value:"workflow",className:"space-y-6",children:e.jsxs(i,{children:[e.jsxs(c,{children:[e.jsxs(o,{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-5 h-5"}),"Workflow Builder"]}
1),e.jsx(u,{children:"Create automated workflows for content generation and marketing"})]}),e.jsxs(d,{className:"text-center py-12",children:[e.jsx(E,{className:"w-16 h-16 mx-auto mb-4 text-muted-foreground"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"AI-Powered Workflows"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Build custom workflows that automatically generate content, analyze performance, and optimize campaigns"}),e.jsx(n,{disabled:!0,children:"Coming Soon"})]})]})})]})]}),e.jsx(B,{})]})};export{Ce as AIStudio};
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.