import React,{useState,useEffect,useRef} from 'https://esm.sh/react@18.3.1'; import {createRoot} from 'https://esm.sh/react-dom@18.3.1/client'; const GOOGLE_CLIENT_ID=window.YT10X.googleClientId; const TOOLS=[ {id:"title",name:"Viral Titles",desc:"10 titles + CTR",cost:2,icon:"šŸ”„"}, {id:"desc",name:"SEO Description",desc:"220 words + timestamps",cost:3,icon:"šŸ“"}, {id:"tags",name:"Tags & Hashtags",desc:"30 tags + SEO",cost:2,icon:"#⃣"}, {id:"thumb",name:"Thumbnail Lab",desc:"4 concepts for 12%+ CTR",cost:5,icon:"šŸ–¼ļø"}, {id:"script",name:"Script Writer",desc:"8 min viral script",cost:10,icon:"āœļø"}, {id:"clips",name:"Viral Clips",desc:"5 Shorts from long",cost:8,icon:"āœ‚ļø",new:true}, {id:"audit",name:"Channel Auditor",desc:"Real audit via API",cost:8,icon:"šŸ“Š"}, ]; function App(){ const [session,setSession]=useState(window.YT10X.user); const [channel,setChannel]=useState(()=>{try{return JSON.parse(localStorage.getItem("yt10x_youtube_channel")||"null")}catch{return null}}); const [googleToken,setGoogleToken]=useState(()=>localStorage.getItem("yt10x_google_token")||null); const [videos,setVideos]=useState(()=>{try{return JSON.parse(localStorage.getItem("yt10x_videos_cache")||"[]")}catch{return []}}); const [loading,setLoading]=useState(false); const [toasts,setToasts]=useState([]); const [showLogin,setShowLogin]=useState(false); const [showSignup,setShowSignup]=useState(false); const [showKeys,setShowKeys]=useState(false); const [activeTool,setActiveTool]=useState(null); const [inputText,setInputText]=useState(""); const [outputText,setOutputText]=useState(""); const [generating,setGenerating]=useState(false); const [selectedVideo,setSelectedVideo]=useState(null); const [filter,setFilter]=useState("all"); const [search,setSearch]=useState(""); const [sort,setSort]=useState("date"); const [preferredAI,setPreferredAI]=useState(()=>localStorage.getItem("yt10x_pref_ai")||"auto"); const [loginForm,setLoginForm]=useState({email:"demo@yt10x.com",pass:"demo123"}); const [signupForm,setSignupForm]=useState({name:"",email:"",pass:"",cpass:""}); const [keys,setKeys]=useState({}); const tokenRef=useRef(null); const toast=(msg,type="ok")=>{const id=Date.now()+Math.random(); setToasts(p=>[...p,{id,msg,type}]); setTimeout(()=>setToasts(p=>p.filter(x=>x.id!==id)),4000);}; const saveSession=(u)=>setSession(u); const saveKeys=()=>toast("AI is not configured. Contact the site administrator.","info"); const fetchVideos=async(token,uploadsId)=>{ let T=token||googleToken; if(!T){toast("Connect YouTube first","err");return;} setLoading(true); try{ let L=uploadsId||channel?.uploads; if(!L){let ch=await fetch("https://www.googleapis.com/youtube/v3/channels?part=contentDetails&mine=true",{headers:{Authorization:`Bearer ${T}`}}).then(r=>r.json()); L=ch.items?.[0]?.contentDetails?.relatedPlaylists?.uploads;} let allItems=[], nextPageToken=""; do{ let url=`https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,contentDetails&playlistId=${L}&maxResults=50${nextPageToken?`&pageToken=${nextPageToken}`:""}`; let data=await fetch(url,{headers:{Authorization:`Bearer ${T}`}}).then(r=>r.json()); if(data.error) throw Error(data.error.message); if(data.items) allItems=[...allItems,...data.items]; nextPageToken=data.nextPageToken; }while(nextPageToken && allItems.length<1000); let finalVideos=[]; for(let i=0;ix.contentDetails.videoId).join(","); let vData=await fetch(`https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics,contentDetails&id=${ids}`,{headers:{Authorization:`Bearer ${T}`}}).then(r=>r.json()); if(!vData.items) continue; for(let v of vData.items){ let dur=v.contentDetails?.duration||"PT0S"; let m=dur.match(/PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?/)||[]; let h=parseInt(m[1]||0), mm=parseInt(m[2]||0), s=parseInt(m[3]||0); let sec=h*3600+mm*60+s; let isShort=sec>0 && sec<=62 || (v.snippet?.title||"").toLowerCase().includes("#shorts"); finalVideos.push({id:v.id,title:v.snippet?.title||"Untitled",thumb:v.snippet?.thumbnails?.medium?.url||v.snippet?.thumbnails?.default?.url||"",views:parseInt(v.statistics?.viewCount||0),likes:v.statistics?.likeCount||0,comments:v.statistics?.commentCount||0,publishedAt:v.snippet?.publishedAt,sec,isShort}); } } finalVideos.sort((a,b)=> new Date(b.publishedAt)-new Date(a.publishedAt)); setVideos(finalVideos); localStorage.setItem("yt10x_videos_cache",JSON.stringify(finalVideos)); toast(`Fetched ${finalVideos.length} videos (${finalVideos.filter(x=>x.isShort).length} Shorts) — Real API`,"ok"); }catch(e){toast(e.message,"err");} finally{setLoading(false);} }; const connectYouTube=async(accessToken)=>{ setLoading(true); try{ let chData=await fetch("https://www.googleapis.com/youtube/v3/channels?part=snippet,statistics,contentDetails&mine=true",{headers:{Authorization:`Bearer ${accessToken}`}}).then(r=>r.json()); if(!chData.items?.[0]) throw Error("No channel found"); let ch=chData.items[0]; let obj={id:ch.id,title:ch.snippet.title,subs:ch.statistics.subscriberCount,avatar:ch.snippet.thumbnails?.default?.url||"",uploads:ch.contentDetails.relatedPlaylists.uploads}; setChannel(obj); localStorage.setItem("yt10x_youtube_channel",JSON.stringify(obj)); localStorage.setItem("yt10x_google_token",accessToken); setGoogleToken(accessToken); toast(`Connected ${obj.title} • ${Number(obj.subs).toLocaleString()} subs`,"ok"); await fetchVideos(accessToken,obj.uploads); }catch(e){toast(e.message,"err");} finally{setLoading(false);} }; const initGoogle=async()=>{ if(!GOOGLE_CLIENT_ID){toast("Administrator: configure the Google client ID in Appearance > Customize.","info");return;} if(!session){setShowLogin(true);return;} if(!window.google?.accounts?.oauth2){await new Promise(res=>{let s=document.createElement("script"); s.src="https://accounts.google.com/gsi/client"; s.onload=res; document.head.appendChild(s);});} if(!tokenRef.current){tokenRef.current=window.google.accounts.oauth2.initTokenClient({client_id:GOOGLE_CLIENT_ID, scope:"https://www.googleapis.com/auth/youtube.readonly openid email profile", callback:(r)=>{if(r.access_token) connectYouTube(r.access_token);}});} tokenRef.current.requestAccessToken({prompt:"consent"}); }; const generate=()=>toast("Live AI generation is not configured yet. Use the creator workspace below for planning.","info"); const handleLogin=()=>{location.href=window.YT10X.login;}; const handleSignup=()=>{location.href=window.YT10X.register;}; let displayed=videos.filter(v=>{if(filter==="shorts"&&!v.isShort) return false; if(filter==="long"&&v.isShort) return false; if(search&&!v.title.toLowerCase().includes(search.toLowerCase())) return false; return true;}); if(sort==="views") displayed=[...displayed].sort((a,b)=>b.views-a.views); if(sort==="date") displayed=[...displayed].sort((a,b)=>new Date(b.publishedAt)-new Date(a.publishedAt)); return React.createElement("div",{className:"min-h-screen"}, channel&&React.createElement("div",{className:"bg-black text-white text-[11px] py-2 px-4 flex justify-center gap-4 items-center"}, React.createElement("span",{className:"flex items-center gap-2"}, React.createElement("span",{className:"w-2 h-2 bg-emerald-400 rounded-full animate-pulse"}), `šŸ“ŗ ${channel.title} • ${videos.length}/1000 videos • ${videos.filter(v=>v.isShort).length} Shorts`), React.createElement("button",{onClick:()=>fetchVideos(),className:"underline opacity-70 hover:opacity-100"},"↻ Resync") ), React.createElement("header",{className:"sticky top-0 z-40 bg-white/90 backdrop-blur-xl border-b h-[64px] flex items-center justify-between px-4 sm:px-6"}, React.createElement("div",{className:"flex items-center gap-3"}, React.createElement("div",{className:"w-9 h-9 bg-black text-white flex items-center justify-center rounded-[10px] font-extrabold display"},"Yt",React.createElement("span",{className:"text-red-600"},"10x")), React.createElement("div",{className:"leading-none"}, React.createElement("div",{className:"font-bold display text-[17px]"},"Yt",React.createElement("span",{className:"text-red-600"},"10x")," Ultimate"), React.createElement("div",{className:"text-[10px] text-zinc-500 font-medium"},"4 AI • Real YouTube API • MrIndigi")) ), React.createElement("div",{className:"flex items-center gap-2"}, session? React.createElement(React.Fragment,{}, React.createElement("span",{className:"hidden sm:flex px-3 py-1.5 bg-zinc-900 text-white rounded-full text-[12px] font-bold"},`šŸ’³ ${session.credits}`), React.createElement("select",{value:preferredAI,onChange:e=>{setPreferredAI(e.target.value); localStorage.setItem("yt10x_pref_ai",e.target.value); toast(`Preferred AI: ${e.target.value}`);},className:"hidden sm:flex h-8 rounded-full border bg-white px-2 text-[11px] font-bold"}, React.createElement("option",{value:"auto"},"šŸ¤– Auto (Best Available)"), React.createElement("option",{value:"gemini"},"šŸ’Ž Gemini"), React.createElement("option",{value:"openai"},"🧠 ChatGPT"), React.createElement("option",{value:"claude"},"🟣 Claude"), React.createElement("option",{value:"meta"},"šŸ¦™ Meta Llama") ), React.createElement("button",{onClick:()=>toast("AI configuration pending. No keys are stored in this browser.","info"),className:`w-8 h-8 rounded-full flex items-center justify-center ${Object.keys(keys).filter(k=>keys[k]).length>0?"bg-green-600 text-white":"bg-zinc-100"}`,title:"API Keys"},"āš™"), React.createElement("button",{onClick:initGoogle,className:"hidden sm:flex px-4 py-2 rounded-full bg-red-600 text-white text-[12px] font-bold hover:bg-red-700"}, channel?"↻ Sync 1000":"Connect YouTube") ): React.createElement(React.Fragment,{}, React.createElement("button",{onClick:()=>{location.href=window.YT10X.login},className:"text-[13px] font-medium px-3 py-2 hover:bg-zinc-100 rounded-full"},"Login"), React.createElement("button",{onClick:()=>{location.href=window.YT10X.register},className:"px-5 py-2.5 bg-black text-white rounded-full text-[13px] font-bold"},"Start Free") ) ) ), React.createElement("section",{className:"max-w-[1280px] mx-auto p-4 sm:p-6"}, React.createElement("div",{className:"flex flex-wrap gap-2 mb-4"}, React.createElement("div",{className:"px-3 py-1 rounded-full bg-black text-white text-[10px] font-bold"},`šŸ¤– 4 AI: ${Object.keys(keys).filter(k=>keys[k]).length>0?Object.keys(keys).filter(k=>keys[k]).join(" • "):"Add keys in āš™"} | Preferred: ${preferredAI}`), React.createElement("div",{className:"px-3 py-1 rounded-full bg-emerald-50 border border-emerald-200 text-emerald-700 text-[10px] font-bold"},"āœ… Real YouTube API • No Mock Data • Up to 1000 videos") ), React.createElement("h1",{className:"display text-[30px] sm:text-[48px] font-[800] leading-[0.9] tracking-tight max-w-[20ch]"},"Grow 10x Faster with ",React.createElement("span",{className:"text-red-600"},"4 Real AIs")), React.createElement("p",{className:"mt-3 text-[14px] sm:text-[16px] text-zinc-600 max-w-[60ch] leading-[1.5]"},"Gemini + ChatGPT + Claude + Meta Llama. Real YouTube Data API v3 with OAuth. No fake videos, no mock data. Built for yt10x.mrindigi.com"), React.createElement("div",{className:"mt-6 grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-7 gap-3"}, TOOLS.map(t=>React.createElement("button",{key:t.id,onClick:()=>{if(!session){setShowLogin(true);return;} setActiveTool(t.id); if(selectedVideo) setInputText(selectedVideo.title); setOutputText(""); setTimeout(()=>document.getElementById("workspace")?.scrollIntoView({behavior:"smooth"}),100);},className:`relative border rounded-[16px] p-4 text-left hover:border-black hover:shadow-lg transition bg-white text-left`}, t.new&&React.createElement("span",{className:"absolute -top-2 -right-2 bg-red-600 text-white text-[9px] font-bold px-2 py-0.5 rounded-full"},"NEW"), React.createElement("div",{className:"flex justify-between"}, React.createElement("span",{className:"text-[18px]"},t.icon), React.createElement("span",{className:"text-[10px] bg-black/10 px-2 py-1 rounded-full font-bold"},t.cost+"c")), React.createElement("div",{className:"font-bold text-[12px] mt-2 leading-tight"},t.name), React.createElement("div",{className:"text-[10px] opacity-70 mt-1"},t.desc) )) ), activeTool&&React.createElement("div",{id:"workspace",className:"mt-8 border-2 border-black rounded-[24px] bg-white shadow-[0_20px_60px_-20px_rgba(0,0,0,0.3)] overflow-hidden"}, React.createElement("div",{className:"p-4 border-b bg-zinc-50 flex justify-between items-center"}, React.createElement("div",{className:"flex items-center gap-3"}, React.createElement("span",{className:"text-[20px]"},TOOLS.find(x=>x.id===activeTool).icon), React.createElement("div",{}, React.createElement("div",{className:"font-bold text-[14px]"},TOOLS.find(x=>x.id===activeTool).name), React.createElement("div",{className:"text-[11px] text-zinc-500"}, selectedVideo?`Selected: ${selectedVideo.title.slice(0,50)}...`:"Enter topic or select video"))), React.createElement("button",{onClick:()=>setActiveTool(null),className:"w-8 h-8 rounded-full bg-white border flex items-center justify-center"},"āœ•") ), React.createElement("div",{className:"p-4 sm:p-6 grid lg:grid-cols-[1.1fr_0.9fr] gap-6"}, React.createElement("div",{}, React.createElement("textarea",{value:inputText,onChange:e=>setInputText(e.target.value),placeholder:"Topic or select real video below...",className:"w-full min-h-[130px] rounded-[16px] border-2 border-zinc-200 p-4 text-[14px] focus:border-black focus:outline-none"}), React.createElement("button",{onClick:generate,disabled:generating,className:"mt-4 w-full py-3.5 rounded-full bg-red-600 text-white font-bold text-[14px] hover:bg-red-700 disabled:opacity-50"}, generating?`šŸ¤– Generating with ${preferredAI}...`:`✨ Generate with ${preferredAI==="auto"?"Best AI":preferredAI.toUpperCase()}`) ), React.createElement("div",{className:"bg-zinc-900 rounded-[16px] p-5 min-h-[340px] flex flex-col"}, React.createElement("div",{className:"flex justify-between items-center"}, React.createElement("span",{className:"text-[10px] uppercase tracking-widest font-bold text-white/50"},"Real AI Output"), outputText&&React.createElement("button",{onClick:()=>{navigator.clipboard.writeText(outputText); toast("Copied!");},className:"text-[11px] px-3 py-1 rounded-full bg-white text-black font-bold"},"Copy")), React.createElement("div",{className:"mt-4 text-[13px] leading-[1.6] whitespace-pre-wrap text-zinc-100 flex-1"}, outputText||"Your real AI output appears here...\n\nSupports:\n• Gemini 1.5 Flash (free tier 1500 req/day)\n• ChatGPT gpt-4o-mini\n• Claude 3.5 Sonnet\n• Meta Llama 3.1 405B\n\nAdd keys in āš™ Settings to enable.") ) ) ) ), React.createElement("section",{className:"max-w-[1280px] mx-auto p-4 sm:p-6"}, React.createElement("div",{className:"bg-white border rounded-[24px] p-4 sm:p-6 shadow-sm"}, React.createElement("div",{className:"flex flex-wrap gap-3 items-center justify-between"}, React.createElement("h3",{className:"display font-bold text-[18px]"},"šŸ“ŗ Your Videos — Real YouTube Studio (No Mock)"), React.createElement("div",{className:"flex gap-2 items-center"}, React.createElement("input",{value:search,onChange:e=>setSearch(e.target.value),placeholder:"Search...",className:"h-9 px-4 rounded-full border text-[13px] w-[160px]"}), React.createElement("select",{value:sort,onChange:e=>setSort(e.target.value),className:"h-9 px-3 rounded-full border text-[12px] bg-white"}, React.createElement("option",{value:"date"},"Newest"), React.createElement("option",{value:"views"},"Views")), React.createElement("div",{className:"flex rounded-full border overflow-hidden"}, [["all","All"],["shorts","Shorts"],["long","Long"]].map(([k,l])=>React.createElement("button",{key:k,onClick:()=>setFilter(k),className:`px-3 py-1.5 text-[11px] font-bold ${filter===k?"bg-black text-white":"bg-white"}`},l))) ) ), !channel? React.createElement("div",{className:"mt-6 text-center py-12 border-2 border-dashed rounded-[20px] bg-[#FFFBF7]"}, React.createElement("div",{className:"font-bold"},"Connect YouTube to fetch ALL real videos — No fake data"), React.createElement("button",{onClick:initGoogle,className:"mt-4 px-6 py-2.5 bg-red-600 text-white rounded-full font-bold"},"Connect YouTube — Real OAuth") ) : loading? React.createElement("div",{className:"mt-6 text-center py-10 animate-pulse"},"Fetching up to 1000 videos...") : React.createElement("div",{className:"mt-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"}, displayed.map(v=>React.createElement("div",{key:v.id,onClick:()=>{setSelectedVideo(v); setInputText(v.title); toast(`Selected ${v.title.slice(0,30)}...`);},className:`cursor-pointer rounded-[16px] overflow-hidden border-2 bg-white hover:border-black transition ${selectedVideo?.id===v.id?"border-black ring-2 ring-black":"border-zinc-100"}`}, React.createElement("div",{className:"relative aspect-[16/9] bg-zinc-100"}, React.createElement("img",{src:v.thumb,className:"w-full h-full object-cover",loading:"lazy"}), React.createElement("div",{className:"absolute bottom-1 right-1 bg-black/80 text-white text-[10px] px-1 rounded"}, `${Math.floor(v.sec/60)}:${String(v.sec%60).padStart(2,"0")}`), React.createElement("span",{className:`absolute top-2 left-2 text-[9px] font-bold px-2 py-1 rounded-full ${v.isShort?"bg-red-600 text-white":"bg-black/80 text-white"}`}, v.isShort?"SHORTS • REAL":"LONG • REAL")), React.createElement("div",{className:"p-3"}, React.createElement("div",{className:"font-semibold text-[12px] line-clamp-2 min-h-[32px]"},v.title), React.createElement("div",{className:"text-[11px] text-zinc-500 mt-1 flex justify-between"}, React.createElement("span",{},`${(v.views||0).toLocaleString()} views`), React.createElement("span",{}, new Date(v.publishedAt).toLocaleDateString()))) )) ) ) ), showLogin&&React.createElement("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur flex items-center justify-center p-4"}, React.createElement("div",{className:"bg-white rounded-[20px] p-6 w-full max-w-[380px]"}, React.createElement("div",{className:"flex justify-between"}, React.createElement("b",{},"Login"), React.createElement("button",{onClick:()=>setShowLogin(false),className:"w-8 h-8 rounded-full bg-zinc-100 flex items-center justify-center"},"āœ•")), React.createElement("input",{value:loginForm.email,onChange:e=>setLoginForm({...loginForm,email:e.target.value}),placeholder:"Email",className:"mt-5 w-full h-11 border rounded-full px-4 text-[14px]"}), React.createElement("input",{type:"password",value:loginForm.pass,onChange:e=>setLoginForm({...loginForm,pass:e.target.value}),placeholder:"Password",className:"mt-3 w-full h-11 border rounded-full px-4 text-[14px]"}), React.createElement("button",{onClick:handleLogin,className:"mt-4 w-full h-11 bg-black text-white rounded-full font-bold"},"Login"), React.createElement("div",{className:"mt-3 text-[12px] text-center"}, "No account? ", React.createElement("button",{onClick:()=>{setShowLogin(false); setShowSignup(true);},className:"underline font-bold"},"Signup")) ) ), showSignup&&React.createElement("div",{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur flex items-center justify-center p-4"}, React.createElement("div",{className:"bg-white rounded-[20px] p-6 w-full max-w-[380px]"}, React.createElement("div",{className:"flex justify-between"}, React.createElement("b",{},"Create Account"), React.createElement("button",{onClick:()=>setShowSignup(false),className:"w-8 h-8 rounded-full bg-zinc-100 flex items-center justify-center"},"āœ•")), React.createElement("input",{value:signupForm.name,onChange:e=>setSignupForm({...signupForm,name:e.target.value}),placeholder:"Name",className:"mt-5 w-full h-11 border rounded-full px-4 text-[14px]"}), React.createElement("input",{value:signupForm.email,onChange:e=>setSignupForm({...signupForm,email:e.target.value}),placeholder:"Email",className:"mt-3 w-full h-11 border rounded-full px-4 text-[14px]"}), React.createElement("input",{type:"password",value:signupForm.pass,onChange:e=>setSignupForm({...signupForm,pass:e.target.value}),placeholder:"Password",className:"mt-3 w-full h-11 border rounded-full px-4 text-[14px]"}), React.createElement("input",{type:"password",value:signupForm.cpass,onChange:e=>setSignupForm({...signupForm,cpass:e.target.value}),placeholder:"Confirm",className:"mt-3 w-full h-11 border rounded-full px-4 text-[14px]"}), React.createElement("button",{onClick:handleSignup,className:"mt-4 w-full h-11 bg-red-600 text-white rounded-full font-bold"},"Create • 150 Credits") ) ), showKeys&&React.createElement("div",{className:"fixed inset-0 z-[100] bg-black/60 backdrop-blur flex items-center justify-center p-4"}, React.createElement("div",{className:"bg-white rounded-[24px] p-6 w-full max-w-[540px] max-h-[90vh] overflow-auto"}, React.createElement("div",{className:"flex justify-between items-center"}, React.createElement("div",{className:"font-bold text-[18px]"},"āš™ 4 AI Keys + Preferences"), React.createElement("button",{onClick:()=>setShowKeys(false),className:"w-8 h-8 rounded-full bg-zinc-100 flex items-center justify-center"},"āœ•")), React.createElement("div",{className:"mt-4 p-3 rounded-xl bg-zinc-900 text-white text-[11px]"}, "šŸ”’ Keys saved locally only in your browser. Never sent to our server. Preferred AI decides order. Auto = best available."), React.createElement("div",{className:"mt-4"}, React.createElement("label",{className:"text-[11px] font-bold uppercase"},"Preferred AI Provider"), React.createElement("select",{value:preferredAI,onChange:e=>setPreferredAI(e.target.value),className:"mt-1 w-full h-11 border-2 border-black rounded-full px-4 text-[13px] font-bold"}, React.createElement("option",{value:"auto"},"šŸ¤– Auto — Try all in order, best first"), React.createElement("option",{value:"gemini"},"šŸ’Ž Gemini (Google) — Fast & Free"), React.createElement("option",{value:"openai"},"🧠 ChatGPT (OpenAI) — Creative"), React.createElement("option",{value:"claude"},"🟣 Claude (Anthropic) — Best writing"), React.createElement("option",{value:"meta"},"šŸ¦™ Meta Llama 3.1 — Open source") ) ), React.createElement("div",{className:"mt-5 space-y-4"}, React.createElement("div",{}, React.createElement("label",{className:"text-[11px] font-bold"},"šŸ’Ž GEMINI API KEY (Free 1500/day)"), React.createElement("input",{value:keys.gemini||"",onChange:e=>setKeys({...keys,gemini:e.target.value}),placeholder:"AIza... from aistudio.google.com/app/apikey",className:"mt-1 w-full h-11 border rounded-full px-4 text-[12px]"}), React.createElement("a",{href:"https://aistudio.google.com/app/apikey",target:"_blank",className:"text-[11px] text-blue-600 underline"},"Get free key → aistudio.google.com")), React.createElement("div",{}, React.createElement("label",{className:"text-[11px] font-bold"},"🧠 CHATGPT API KEY (OpenAI)"), React.createElement("input",{value:keys.openai||"",onChange:e=>setKeys({...keys,openai:e.target.value}),placeholder:"sk-... from platform.openai.com/api-keys",className:"mt-1 w-full h-11 border rounded-full px-4 text-[12px]"}), React.createElement("a",{href:"https://platform.openai.com/api-keys",target:"_blank",className:"text-[11px] text-blue-600 underline"},"Get key → platform.openai.com")), React.createElement("div",{}, React.createElement("label",{className:"text-[11px] font-bold"},"🟣 CLAUDE API KEY (Anthropic)"), React.createElement("input",{value:keys.claude||"",onChange:e=>setKeys({...keys,claude:e.target.value}),placeholder:"sk-ant-... from console.anthropic.com",className:"mt-1 w-full h-11 border rounded-full px-4 text-[12px]"}), React.createElement("a",{href:"https://console.anthropic.com/settings/keys",target:"_blank",className:"text-[11px] text-blue-600 underline"},"Get key → console.anthropic.com")), React.createElement("div",{}, React.createElement("label",{className:"text-[11px] font-bold"},"šŸ¦™ META LLAMA API KEY (Meta)"), React.createElement("input",{value:keys.meta||"",onChange:e=>setKeys({...keys,meta:e.target.value}),placeholder:"llx-... from llama-api.com or groq",className:"mt-1 w-full h-11 border rounded-full px-4 text-[12px]"}), React.createElement("div",{className:"text-[10px] text-zinc-500 mt-1"},"Get from llama-api.com, groq.com (free), or api.llama.com — uses Llama 3.1 405B")), React.createElement("div",{className:"flex gap-2 mt-6"}, React.createElement("button",{onClick:()=>{saveKeys(keys); setShowKeys(false);},className:"flex-1 h-11 bg-black text-white rounded-full font-bold"},"Save & Enable 4 AI"), React.createElement("button",{onClick:()=>setShowKeys(false),className:"px-6 h-11 border rounded-full font-bold"},"Close")) ) ) ), React.createElement("div",{className:"fixed bottom-4 right-4 z-[120] space-y-2 w-[340px] pointer-events-none"}, toasts.map(t=>React.createElement("div",{key:t.id,className:`pointer-events-auto px-4 py-3 rounded-full text-[12px] font-medium shadow-xl border backdrop-blur ${t.type==="err"?"bg-red-600 text-white border-red-700":"bg-zinc-900 text-white border-zinc-800"}`},t.msg))), React.createElement("footer",{className:"mt-10 border-t bg-white py-8 text-center text-[11px] text-zinc-500"}, "Yt10x Ultimate • Creator workspace • Real YouTube API • No mock data • by MrIndigi") ); } createRoot(document.getElementById("root")).render(React.createElement(App));