PageSourceSearch

https://skooltranslate.com/assets/Login-BKys0C7i.js

js skooltranslate.com collected 2026-09-24 14:52:41 UTC 13,968 bytes, 1 lines download raw bytes

1import{r as a,d as H,u as V,j as e,L as w,b as G,s as O}from"./index-CKRizoQT.js";import{u as q}from"./useTranslation-CnBUce51.js";import{B as A}from"./Button-2xVWwAgv.js";import{C as J,a as K,b as Q,c as X,d as Y}from"./Card-QoI4SUmU.js";import{I as E}from"./input-CNQbLXRn.js";import{A as Z}from"./arrow-left-azrDO_3H.js";import{E as ee}from"./eye-off-AGr87tag.js";import{E as te}from"./eye-BMVses7-.js";function de(){const{t}=q(),[N,m]=a.useState(""),[f,R]=a.useState(""),[p,U]=a.useState(""),[b,$]=a.useState(!1),[x,v]=a.useState(!1),[h,S]=a.useState(!1),[D,k]=a.useState(!1),[l]=a.useState(()=>new URLSearchParams(window.location.search).get("extension")==="true"),[u]=a.useState(()=>new URLSearchParams(window.location.search).get("redirect")||""),[d]=a.useState(()=>new URLSearchParams(window.location.search).get("new_account")==="true"),[j,_]=a.useState(!1),[z,F]=a.useState(()=>{try{return localStorage.getItem("skooltranslate_whats_new_dismissed")!=="1"}catch{return!0}}),P=()=>{try{localStorage.setItem("skooltranslate_whats_new_dismissed","1")}catch{}F(!1)},{isLoading:y,isAuthenticated:I,login:M}=H(),g=V();a.useEffect(()=>{if(new URLSearchParams(window.location.search).get("auto")==="google"){const n=setTimeout(()=>{L()},50);return()=>clearTimeout(n)}},[]),a.useEffect(()=>{if(!d)return;const r=new URLSearchParams(window.location.search).get("extId");let n="/auth/login?extension=true";r&&(n+=`&extId=${encodeURIComponent(r)}`);const o=setTimeout(()=>{window.location.href=n},1500);return()=>clearTimeout(o)},[d]),a.useEffect(()=>{(async()=>{if(!(!l||new URLSearchParams(window.location.search).get("auto")!=="google"))try{const o=localStorage.getItem("token")||localStorage.getItem("access_token"),i=localStorage.getItem("user");if(o&&i){const c=JSON.parse(i);C(o,{id:c.id||c.sub,email:c.email,full_name:c.full_name||c.name||""})}}catch{}})()},[l]);const[T,B]=a.useState(!1);a.useEffect(()=>{if(!l&&!j&&I&&!y&&!T){B(!0);const s=setTimeout(()=>{g(u||"/dashboard",{replace:!0})},100);return()=>clearTimeout(s)}},[I,l,y,T,g,j,u]);const C=async(s,r)=>{if(l){_(!0);try{const n={id:r.id,email:r.email,full_name:r.full_name},i=new URLSearchParams(window.location.search).get("extId"),c=`/auth/close-window?extension=true${i?`&extId=${encodeURIComponent(i)}`:""}`;await O({token:s,user:n},{extId:i,opener:window.opener,timeoutMs:1500}),setTimeout(()=>{g(c,{replace:!0})},0)}catch{setTimeout(()=>{g("/auth/close-window?extension=true",{replace:!0})},0)}}},W=async s=>{var r,n;s.preventDefault(),m(""),k(!1),v(!0);try{const o=await M({email:f,password:p},l);o.success?l&&((r=o.data)!=null&&r.token)?C(o.data.token,o.data.user):g(u||"/dashboard",{replace:!0}):((n=o.data)!=null&&n.needsVerification&&k(!0),m(o.error||t("auth.login.invalidCredentials")))}catch(o){m(o.message||t("auth.login.loginFailed"))}finally{v(!1)}},L=async()=>{try{S(!0),m("");const r=new URLSearchParams(window.location.search).get("extId");let n="";l&&(n=`?extension=true${r?`&extId=${r}`:""}`);const o=n?"&":"?",i=`${window.location.origin}/auth/callback${n}${u?`${o}redirect=${encodeURIComponent(u)}`:""}`,c="/api";window.location.href=`${c}/auth/google?redirect_uri=${encodeURIComponent(i)}`}catch(s){const r=s instanceof Error?s.message:t("auth.login.loginFailed");m(r),S(!1)}};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary-50 to-earth-600 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:[z&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm overflow-y-auto",role:"dialog","aria-modal":"true","aria-labelledby":"wnm-title",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl max-w-md w-full p-6 relative my-8 animate-in fade-in zoom-in-95 duration-200 max-h-[calc(100vh-4rem)] flex flex-col",children:[e.jsx("button",{type:"button",onClick:P,"aria-label":"Close",className:"absolute top-3 right-3 w-8 h-8 flex items-center justify-center text-gray-400 hover:text-gray-700 transition-colors z-10",children:"×"}),e.jsxs("div",{className:"flex items-center gap-2 mb-3 pr-8",children:[e.jsx("span",{className:"text-2xl",children:"✨"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-orange-600 bg-orange-100 px-2 py-0.5 rounded-full",children:t("login.whatsNew.badge",{},"What's new")})]}),e.jsx("h2",{id:"wnm-title",className:"text-xl font-bold text-gray-900 mb-2 pr-8",children:t("login.whatsNew.title",{},"What SkoolTranslate can do for you")}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:t("login.whatsNew.subtitle",{},"Eight AI-powered tools to help you learn from any video.")}),e.jsxs("div",{className:"space-y-1.5 mb-4 flex-1 overflow-y-auto min-h-0 pr-1",children:[e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg border border-gray-200",children:[e.jsx("span",{className:"text-lg mt-0.5",children:"📝"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t("login.whatsNew.feat1Title",{},"Instant summaries")}),e.jsx("div",{className:"text-xs text-gray-500",children:t("login.whatsNew.feat1Desc",{},"Key takeaways, bullet points, and topics in seconds.")})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg border border-gray-200",children:[e.jsx("span",{className:"text-lg mt-0.5",children:"💬"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t("login.whatsNew.feat2Title",{},"Chat with your video")}),e.jsx("div",{className:"text-xs text-gray-500",children:t("login.whatsNew.feat2Desc",{},"Ask anything and get instant answers with rich formatting and voice playback.")})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg border border-gray-200",children:[e.jsx("span",{className:"text-lg mt-0.5",children:"🧠"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t("login.whatsNew.feat3Title",{},"Visual mind maps")}),e.jsx("div",{className:"text-xs text-gray-500",children:t("login.whatsNew.feat3Desc",{},"See the structure of any video at a glance. Interactive, exportable, zoomable.")})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg border border-gray-200",children:[e.jsx("span",{className:"text-lg mt-0.5",children:"🎯"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t("login.whatsNew.feat4Title",{},"AI Quizzes")}),e.jsx("div",{className:"text-xs text-gray-500",children:t("login.whatsNew.feat4Desc",{},"Auto-generated multiple-choice questions with instant feedback and explanations.")})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg border border-gray-200",children:[e.jsx("span",{className:"text-lg mt-0.5",children:"🃏"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t("login.whatsNew.feat5Title",{},"AI Flashcards")}),e.jsx("div",{className:"text-xs text-gray-500",children:t("login.whatsNew.feat5Desc",{},"Tap-to-flip study cards for every video — the fastest way to memorize key concepts.")})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg border border-gray-200",children:[e.jsx("span",{className:"text-lg mt-0.5",children:"🔍"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t("login.whatsNew.feat6Title",{},"Search your library")}),e.jsx("div",{className:"text-xs text-gray-500",children:t("login.whatsNew.feat6Desc",{},"Full-text search across every summary, key takeaway, and topic.")})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg border border-gray-200",children:[e.jsx("span",{className:"text-lg mt-0.5",children:"📁"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t("login.whatsNew.feat7Title",{},"Organize your library")}),e.jsx("div",{className:"text-xs text-gray-500",children:t("login.whatsNew.feat7Desc",{},"Group videos into folders, mark favorites, and filter by date.")})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-2.5 rounded-lg border border-gray-200",children:[e.jsx("span",{className:"text-lg mt-0.5",children:"📝"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t("login.whatsNew.feat8Title",{},"Personal study notes")}),e.jsx("div",{className:"text-xs text-gray-500",children:t("login.whatsNew.feat8Desc",{},"WordPress-like rich-text notes on every video. Export as Markdown, PDF, DOC, TXT or HTML.")})]})]})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2 text-xs text-gray-600 bg-orange-50 border border-orange-100 rounded-lg px-3 py-2",children:[e.jsx("span",{"aria-hidden":"true",children:"💡"}),e.jsxs("span",{children:["              ",t("login.whatsNew.accessNote",{},"Access all of this from your dashboard at https://skooltranslate.com/dashboard/summaries once you log in.")]})]}),e.jsx("button",{type:"button",onClick:P,className:"w-full px-4 py-2.5 rounded-lg bg-gradient-to-r from-orange-500 to-amber-500 text-white text-sm font-semibold hover:from-orange-400 hover:to-amber-400 transition-colors",children:t("login.whatsNew.dism
1iss",{},"Don't show again")})]})}),e.jsxs("div",{className:"max-w-md w-full",children:[e.jsxs(w,{to:"/",className:"inline-flex items-center text-orange-600 hover:text-orange-700 mb-8 transition-colors",children:[e.jsx(Z,{className:"w-4 h-4 mr-2"}),t("auth.login.backToHome")]}),e.jsxs(J,{children:[e.jsxs(K,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("img",{src:"/logo.png",alt:"SkoolTranslate Logo",className:"h-16 w-auto"})}),e.jsx(Q,{className:"text-2xl font-bold text-gray-900",children:d?t("login.newAccountTitle",{},"Account created successfully"):t("auth.login.title")}),e.jsx(X,{children:d?t("login.newAccountDescription",{},"Please log in again with the account you just created to connect the extension."):t("auth.login.welcomeBack")})]}),e.jsxs(Y,{children:[e.jsxs("div",{className:"space-y-4",children:[N&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:[N,D&&e.jsx(w,{to:`/auth/verify-email?email=${encodeURIComponent(f)}`,className:"block mt-2 text-red-600 underline font-medium",children:t("auth.login.resendVerification")})]}),j&&l&&e.jsx("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(G,{className:"h-5 w-5 text-green-500 mr-2 flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-green-700 font-medium",children:t("auth.login.extensionSuccess")}),e.jsx("p",{className:"text-green-600 text-sm",children:t("auth.login.extensionAuthenticated")})]})]})}),l&&e.jsx("div",{className:"bg-primary-50 border border-primary-200 text-orange-700 px-4 py-3 rounded-lg",children:t("auth.login.extensionAuthenticating")}),!d&&e.jsxs("form",{onSubmit:W,className:"space-y-3",children:[e.jsx("div",{children:e.jsx(E,{type:"email",placeholder:t("auth.login.emailPlaceholder"),value:f,onChange:s=>R(s.target.value),required:!0,disabled:x||h,className:"w-full"})}),e.jsxs("div",{className:"relative",children:[e.jsx(E,{type:b?"text":"password",placeholder:t("auth.login.passwordPlaceholder"),value:p,onChange:s=>U(s.target.value),required:!0,disabled:x||h,className:"w-full pr-10"}),e.jsx("button",{type:"button",onClick:()=>$(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",tabIndex:-1,children:b?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(te,{className:"w-4 h-4"})})]}),e.jsx(A,{type:"submit",disabled:y||x||h||!f||!p,isLoading:x,className:"w-full",variant:"outline",children:t("auth.login.signInButton")})]}),!d&&e.jsxs("div",{className:"relative my-6",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-200"})}),e.jsx("div",{className:"relative flex justify-center text-sm",children:e.jsx("span",{className:"px-2 bg-white text-gray-500",children:t("auth.login.or")})})]}),e.jsxs(A,{type:"button",variant:"outline",onClick:L,disabled:h||x,isLoading:h,className:"w-full border-gray-300 text-gray-700 hover:bg-gray-50 bg-white shadow-sm",children:[e.jsxs("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",children:[e.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),e.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),e.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),e.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),t("auth.login.continueWithGoogle")]})]}),!d&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-4 text-center",children:e.jsx(w,{to:"/auth/forgot-password",className:"text-sm font-medium text-orange-600 hover:text-orange-500",children:t("auth.login.forgotPassword")})}),e.jsxs("div",{className:"mt-6 text-center text-sm text-gray-600",children:[t("auth.login.noAccount")," ",l?e.jsx(w,{to:`/auth/register?extension=true${new URLSearchParams(window.location.search).get("extId")?`&extId=${new URLSearchParams(window.location.search).get("extId")}`:""}`,className:"font-medium text-orange-600 hover:text-orange-500",children:t("auth.login.createAccount")}
1):e.jsx("a",{href:"https://chromewebstore.google.com/detail/skool-subtitle-translator/kbidneomiccmjdhpoibbodpobldjcedh",className:"font-medium text-orange-600 hover:text-orange-500",children:t("auth.login.createAccount")})]})]})]})]})]})]})}export{de as default};

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.