PageSourceSearch

https://pinobite.com/assets/AdminLoginPage-0o_NtH6d.js

js pinobite.com collected 2026-10-08 02:01:46 UTC 13,232 bytes, 1 lines download raw bytes

1import{a as r,j as e}from"./vendor-framer-Bi1qEhT1.js";import{A as x}from"./index-Do3puBAy.js";import"./vendor-tiptap-DCrKpgXq.js";import"./vendor-gsap-C0eCJjti.js";const $=({onLoginSuccess:P,onBackToSite:_})=>{const[m,f]=r.useState(""),[v,h]=r.useState(""),[l,g]=r.useState(""),[p,y]=r.useState(""),[b,w]=r.useState(""),[j,N]=r.useState(""),[n,i]=r.useState(!1),[d,c]=r.useState("login"),[z,a]=r.useState(null),[k,u]=r.useState(null),E=async t=>{t.preventDefault(),i(!0),a(null);try{const s=await fetch(`${x}/api/token/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:m,password:v})});if(!s.ok)throw new Error("Invalid credentials");const o=await s.json(),S=await fetch(`${x}/api/users/me/`,{headers:{Authorization:`Bearer ${o.access}`}});if(!S.ok)throw new Error("Failed to verify permissions");if(!(await S.json()).is_staff)throw new Error("Access Denied: Administrative privileges required.");localStorage.setItem("admin_access_token",o.access),localStorage.setItem("admin_refresh_token",o.refresh),localStorage.setItem("admin_email",m),localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token"),P()}catch(s){a(s.message||"Authentication failed")}finally{i(!1)}},C=async t=>{t.preventDefault(),i(!0),a(null);try{if(!(await fetch(`${x}/api/password-reset/request/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l})})).ok)throw new Error("Failed to send OTP. Check email.");u(`OTP sent to ${l}. Valid for 5 minutes.`),c("reset-otp")}catch(s){a(s.message)}finally{i(!1)}},O=async t=>{t.preventDefault(),i(!0),a(null);try{const s=await fetch(`${x}/api/password-reset/verify/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,otp:p})}),o=await s.json();if(!s.ok)throw new Error(o.error||"Invalid OTP");u("OTP Verified. Please set a new password."),c("reset-password")}catch(s){a(s.message)}finally{i(!1)}},T=async t=>{if(t.preventDefault(),b!==j){a("Passwords do not match");return}i(!0),a(null);try{const s=await fetch(`${x}/api/password-reset/confirm/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,otp:p,new_password:b})}),o=await s.json();if(!s.ok)throw new Error(o.error||"Failed to reset password");u("Password reset successful. Please login."),c("login"),f(l),h(""),g(""),y(""),w(""),N("")}catch(s){a(s.message)}finally{i(!1)}},I=()=>e.jsxs("form",{onSubmit:C,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-zenvira-secondary text-sm text-center mb-8 leading-relaxed",children:"Enter your registered Corporate ID. A temporary access key will be dispatched to your encrypted mail."}),e.jsx("label",{className:"block text-xs font-bold uppercase tracking-wider text-zenvira-secondary mb-2",children:"Corporate ID / Email"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-zenvira-secondary pointer-events-none flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-lg leading-none",children:"badge"})}),e.jsx("input",{type:"email",value:l,onChange:t=>g(t.target.value),placeholder:"[email protected]",className:"w-full bg-[#f7f4ec]/50 border border-zenvira-border/20 text-zenvira-text pl-12 pr-4 py-4 rounded-2xl focus:border-zenvira-accent focus:ring-1 focus:ring-zenvira-accent/30 outline-none transition-all font-medium placeholder:text-zenvira-secondary/40",required:!0})]})]}),e.jsxs("button",{disabled:n,className:"w-full bg-zenvira-accent hover:bg-zenvira-accent/90 text-white py-4 rounded-full font-bold uppercase tracking-wider text-xs transition-all hover:shadow-[0_4px_12px_rgba(158,21,156,0.2)] disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-3 active:scale-95",children:[n?"SENDING...":"SEND OTP",e.jsx("span",{className:"material-symbols-outlined text-lg",children:"send"})]}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>c("login"),className:"text-zenvira-secondary hover:text-zenvira-accent text-xs uppercase font-bold tracking-wider",children:"Cancel"})})]}),R=()=>e.jsxs("form",{onSubmit:O,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-zenvira-secondary text-sm text-center mb-8 leading-relaxed",children:["Enter the 6-digit OTP sent to ",l]}),e.jsx("label",{className:"block text-xs font-bold uppercase tracking-wider text-zenvira-secondary mb-2",children:"One-Time Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-zenvira-secondary pointer-events-none flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-lg leading-none",children:"lock_clock"})}),e.jsx("input",{type:"text",value:p,onChange:t=>y(t.target.value),placeholder:"123456",maxLength:6,className:"w-full bg-[#f7f4ec]/50 border border-zenvira-border/20 text-zenvira-text pl-12 pr-4 py-4 rounded-2xl focus:border-zenvira-accent focus:ring-1 focus:ring-zenvira-accent/30 outline-none transition-all font-medium placeholder:text-zenvira-secondary/40 tracking-[0.5em] text-center text-lg",required:!0})]})]}),e.jsx("button",{disabled:n,className:"w-full bg-zenvira-accent hover:bg-zenvira-accent/90 text-white py-4 rounded-full font-bold uppercase tracking-wider text-xs transition-all hover:shadow-[0_4px_12px_rgba(158,21,156,0.2)] disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-3 active:scale-95",children:n?"VERIFYING...":"
1VERIFY OTP"}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>c("reset-email"),className:"text-zenvira-secondary hover:text-zenvira-accent text-xs uppercase font-bold tracking-wider",children:"Back"})})]}),A=()=>e.jsxs("form",{onSubmit:T,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-zenvira-secondary text-sm text-center mb-8 leading-relaxed",children:"Create a new secure password."}),e.jsx("label",{className:"block text-xs font-bold uppercase tracking-wider text-zenvira-secondary mb-2",children:"New Password"}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-zenvira-secondary pointer-events-none flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-lg leading-none",children:"vpn_key"})}),e.jsx("input",{type:"password",value:b,onChange:t=>w(t.target.value),className:"w-full bg-[#f7f4ec]/50 border border-zenvira-border/20 text-zenvira-text pl-12 pr-4 py-4 rounded-2xl focus:border-zenvira-accent focus:ring-1 focus:ring-zenvira-accent/30 outline-none transition-all font-medium",required:!0,minLength:8})]}),e.jsx("label",{className:"block text-xs font-bold uppercase tracking-wider text-zenvira-secondary mb-2",children:"Confirm Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-zenvira-secondary pointer-events-none flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-lg leading-none",children:"check_circle"})}),e.jsx("input",{type:"password",value:j,onChange:t=>N(t.target.value),className:"w-full bg-[#f7f4ec]/50 border border-zenvira-border/20 text-zenvira-text pl-12 pr-4 py-4 rounded-2xl focus:border-zenvira-accent focus:ring-1 focus:ring-zenvira-accent/30 outline-none transition-all font-medium",required:!0,minLength:8})]})]}),e.jsx("button",{disabled:n,className:"w-full bg-zenvira-accent hover:bg-zenvira-accent/90 text-white py-4 rounded-full font-bold uppercase tracking-wider text-xs transition-all hover:shadow-[0_4px_12px_rgba(158,21,156,0.2)] disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-3 active:scale-95",children:n?"RESETTING...":"RESET PASSWORD"})]});return e.jsxs("div",{className:"min-h-screen bg-zenvira-bg flex flex-col items-center justify-center p-4 relative overflow-hidden font-poppins text-zenvira-text",children:[e.jsxs("div",{className:"absolute inset-0 z-0",children:[e.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-[url('https://images.unsplash.com/photo-1497366216548-37526070297c?q=80&w=2000&auto=format&fit=crop')] bg-cover bg-center opacity-5 blur-sm"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-zenvira-bg/50 to-zenvira-bg"})]}),e.jsxs("div",{className:"relative z-10 w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 mb-4",children:[e.jsx("img",{src:"/logos/Pinobite-logo.png",alt:"Pinobite Logo",className:"h-12 w-auto object-contain"}),e.jsx("span",{className:"text-3xl font-bayon tracking-wide uppercase text-zenvira-accent",children:"GLOBAL"})]}),e.jsx("p",{className:"text-zenvira-secondary font-bold uppercase tracking-widest text-xs",children:d==="login"?"Internal Team Access Portal":"Security Recovery Protocol"})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur-xl border border-zenvira-border/10 p-8 md:p-10 rounded-[32px] shadow-[0_8px_30px_rgb(32,41,24,0.06)]",children:[z&&e.jsx("div",{className:"mb-6 bg-red-50 border border-red-200 text-red-700 p-4 rounded-2xl text-xs font-bold text-center tracking-wide",children:z}),k&&e.jsx("div",{className:"mb-6 bg-green-50 border border-green-200 text-green-700 p-4 rounded-2xl text-xs font-bold text-center tracking-wide",children:k}),d==="login"&&e.jsxs("form",{onSubmit:E,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold uppercase tracking-wider text-zenvira-secondary mb-2",children:"Corporate ID / Email"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-zenvira-secondary pointer-events-none flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-lg leading-none",children:"badge"})}),e.jsx("input",{type:"email",value:m,onChange:t=>f(t.target.value),placeholder:"[email protected]",className:"w-full bg-[#f7f4ec]/50 border border-zenvira-border/20 text-zenvira-text pl-12 pr-4 py-4 rounded-2xl focus:border-zenvira-accent focus:ring-1 focus:ring-zenvira-accent/30 outline-none transition-all font-medium placeholder:text-zenvira-secondary/40",required:!0})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold uppercase tracking-wider text-zenvira-secondary mb-2",children:"Access Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-zenvira-secondary pointer-events-none flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-lg leading-none",children:"vpn_key"})}
1),e.jsx("input",{type:"password",value:v,onChange:t=>h(t.target.value),placeholder:"••••••••••••",className:"w-full bg-[#f7f4ec]/50 border border-zenvira-border/20 text-zenvira-text pl-12 pr-4 py-4 rounded-2xl focus:border-zenvira-accent focus:ring-1 focus:ring-zenvira-accent/30 outline-none transition-all font-medium placeholder:text-zenvira-secondary/40",required:!0})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("label",{className:"flex items-center gap-2 text-zenvira-secondary cursor-pointer hover:text-zenvira-text transition-colors",children:[e.jsx("input",{type:"checkbox",className:"rounded border-zenvira-border/20 bg-white text-zenvira-accent focus:ring-zenvira-accent/50"}),"Remember Device"]}),e.jsx("button",{type:"button",onClick:()=>{c("reset-email"),a(null),u(null)},className:"text-zenvira-accent font-bold hover:text-zenvira-accent/80 transition-colors",children:"Lost Key?"})]}),e.jsx("button",{disabled:n,className:"w-full bg-zenvira-accent hover:bg-zenvira-accent/90 text-white py-4 rounded-full font-bold uppercase tracking-wider text-xs transition-all hover:shadow-[0_4px_12px_rgba(158,21,156,0.2)] disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-3 active:scale-95",children:n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"VERIFYING..."]}):e.jsxs(e.Fragment,{children:["Access Panel",e.jsx("span",{className:"material-symbols-outlined text-lg",children:"logout"})]})})]}),d==="reset-email"&&I(),d==="reset-otp"&&R(),d==="reset-password"&&A()]}),e.jsx("div",{className:"text-center mt-10",children:e.jsxs("button",{onClick:_,className:"text-zenvira-secondary hover:text-zenvira-accent transition-colors text-xs font-bold uppercase tracking-wider flex items-center justify-center gap-3 mx-auto",children:[e.jsx("span",{className:"material-symbols-outlined text-sm",children:"arrow_back"}),"Return to Public Site"]})})]}),e.jsx("div",{className:"absolute bottom-8 left-0 w-full text-center",children:e.jsx("p",{className:"text-zenvira-secondary/60 text-[10px] uppercase font-bold tracking-wider",children:"Authorized Personnel Only • Secure 256-bit Encrypted Connection"})})]})};export{$ 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.