1import{a as q,b as B,c as U,d as D,e as G,f as N,g as H,i as K}from"./chunk-X2HFMDUG.js";import{a as A}from"./chunk-4SSS2OJZ.js";import"./chunk-3XIPWIBB.js";import{c as T,e as V}from"./chunk-WAWFYPMX.js";import{a as Y,b as J}from"./chunk-7MQTEMAJ.js";import"./chunk-HTCLQCOU.js";import"./chunk-6XPI5QYW.js";import"./chunk-YWMD53KQ.js";import{b as k,f as L,g as z}from"./chunk-A6AWQOXQ.js";import{C as R,c as W,h as j,l as F}from"./chunk-PJ5GV7IK.js";import{i as O,x as I}from"./chunk-EDUSMAQY.js";import{Ab as E,Bb as b,Da as x,Fb as _,Gb as w,Hb as C,Xa as d,Ya as t,Za as i,_a as u,fb as S,ia as l,jb as h,k as f,lb as g,p,q as m,xa as y,zb as o}from"./chunk-FFQQO7O7.js";import{S as v,Ta as P,sa as M}from"./chunk-ID4WHIPA.js";import"./chunk-QUA7QOZA.js";import"./chunk-C6Q5SG76.js";function X(s,n){if(s&1){let e=S();t(0,"div",17)(1,"div",18),o(2,"Dev testing sign-in"),i(),t(3,"p"),o(4,"Use the dev Firebase test account for localhost testing."),i(),t(5,"label"),o(6," Email "),t(7,"input",19),C("ngModelChange",function(r){p(e);let c=g();return w(c.devEmail,r)||(c.devEmail=r),m(r)}),i()(),t(8,"label"),o(9," Password "),t(10,"input",20),C("ngModelChange",function(r){p(e);let c=g();return w(c.devPassword,r)||(c.devPassword=r),m(r)}),h("keyup.enter",function(){p(e);let r=g();return m(r.signInWithEmailPassword())}),i()(),t(11,"button",21),h("click",function(){p(e);let r=g();return m(r.signInWithEmailPassword())}),o(12),i()()}if(s&2){let e=g();l(7),_("ngModel",e.devEmail),d("placeholder",e.devEmailPlaceholder)("disabled",e.isSigningIn||e.isEmailSigningIn),l(3),_("ngModel",e.devPassword),d("disabled",e.isSigningIn||e.isEmailSigningIn),l(),d("disabled",e.isSigningIn||e.isEmailSigningIn||!e.devEmail||!e.devPassword),l(),b(" ",e.isEmailSigningIn?"Signing in...":"Sign in on dev"," ")}}function Z(s,n){if(s&1&&(t(0,"p",22),o(1),i()),s&2){let e=g();l(),E(e.authError)}}var Q=class s{auth=f(A);router=f(L);route=f(k);isSigningIn=!1;isEmailSigningIn=!1;authError=null;devEmailPlaceholder="[email protected]";devEmail=this.auth.devPasswordLoginAvailable()?this.devEmailPlaceholder:"";devPassword="";async ngOnInit(){try{await this.auth.getCurrentUser()&&await this.finishLogin()}catch(n){console.error("Login initialization failed:",n),this.authError=this.getSignInErrorMessage(n),this.isSigningIn=!1}}async signIn(){if(!this.isSigningIn){this.isSigningIn=!0,this.authError=null;try{if(await this.auth.loginWithGoogle()==="redirecting")return;await this.finishLogin()}catch(n){console.error("Sign in failed:",n),this.authError=this.getSignInErrorMessage(n),this.isSigningIn=!1}}}async signInWithEmailPassword(){if(!(this.isEmailSigningIn||this.isSigningIn)){this.isEmailSigningIn=!0,this.authError=null;try{await this.auth.loginWithEmailPassword(this.devEmail,this.devPassword),await this.finishLogin()}catch(n){console.error("Dev email sign in failed:",n),this.authError=this.getSignInErrorMessage(n),this.isEmailSigningIn=!1}}}async finishLogin(){await v(this.auth.user$.pipe(M(e=>!!e),P(1)));let n=this.route.snapshot.queryParamMap.get("returnUrl");await this.router.navigateByUrl(n==="/access-requests"?n:"/dashboard")}getSignInErrorMessage(n){let e=typeof n=="string"?n:n&&typeof n=="object"&&"message"in n?String(n.message||""):"";return/wrong Firebase project|loaded the wrong Firebase project/i.test(e)?e:/admin-restricted-operation|permission-denied|access.*approval|approved.*access/i.test(e)?"Access is by invitation. Request access below, or sign in with the email address that was invited.":/unauthorized.*domain|domain.*unauthorized|auth\/unauthorized-domain/i.test(e)?"Google sign-in is not authorized for this local URL. Open http://localhost:4200/login and try again.":/popup-closed-by-user|cancelled|canceled|did not finish/i.test(e)?"Google sign-in did not finish. Try again when you are ready.":/operation-not-allowed/i.test(e)?"Email/password sign-in is not enabled for the dev Firebase project yet.":/invalid-credential|wrong-password|user-not-found|invalid-email/i.test(e)?"The dev email/password did not match an existing linked Firebase user.":/different app user|dev email and password|existing app user/i.test(e)?e:"Sign-in failed. Refresh the page and try again."}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=y({type:s,selectors:[["app-login"]],decls:47,vars:4,consts:[[1,"login-page"],[1,"glass-container"],[1,"brand-section"],["src","assets/images/ad_intelligence_logo.png","alt","Ad Intelligence",1,"login-logo"],[1,"login-card-container"],[1,"login-card"],[1,"features-list"],[1,"feature-item"],["mat-flat-button","","color","primary",1,"google-btn",3,"click","disabled"],["src","https://www.gstatic.
1com/firebasejs/ui/2.0.0/images/auth/google.svg","alt","Google"],["class","dev-login-panel",4,"ngIf"],[1,"request-access-link"],["routerLink","/request-access"],["class","login-error","role","alert",4,"ngIf"],[1,"footer-note"],[1,"blob","blob-1"],[1,"blob","blob-2"],[1,"dev-login-panel"],[1,"dev-login-title"],["type","email","autocomplete","email",3,"ngModelChange","ngModel","placeholder","disabled"],["type","password","autocomplete","current-password",3,"ngModelChange","keyup.enter","ngModel","disabled"],["type","button",1,"dev-login-btn",3,"click","disabled"],["role","alert",1,"login-error"]],template:function(e,a){e&1&&(t(0,"div",0)(1,"div",1)(2,"div",2),u(3,"img",3),t(4,"h1"),o(5,"Strategic Ad Intelligence"),i(),t(6,"p"),o(7,"The ultimate performance rollup for Amazon Brand Owners and Agencies."),i()(),t(8,"div",4)(9,"mat-card",5)(10,"mat-card-header")(11,"mat-card-title"),o(12,"Portal Access"),i(),t(13,"mat-card-subtitle"),o(14,"Sign in to your specialized dashboard"),i()(),t(15,"mat-card-content")(16,"div",6)(17,"div",7)(18,"mat-icon"),o(19,"analytics"),i(),t(20,"span"),o(21,"Advanced Performance Rollups"),i()(),t(22,"div",7)(23,"mat-icon"),o(24,"group_work"),i(),t(25,"span"),o(26,"Smart SKU Grouping Logic"),i()(),t(27,"div",7)(28,"mat-icon"),o(29,"psychology"),i(),t(30,"span"),o(31,"Strategy Recommendation Engine"),i()()()(),t(32,"mat-card-actions")(33,"button",8),h("click",function(){return a.signIn()}),u(34,"img",9),o(35),i()(),x(36,X,13,7,"div",10),t(37,"p",11),o(38,"New here? "),t(39,"a",12),o(40,"Request access"),i()(),x(41,Z,2,1,"p",13),t(42,"mat-card-footer")(43,"p",14),o(44,"By signing in, you agree to our Terms of Service."),i()()()()(),u(45,"div",15)(46,"div",16),i()),e&2&&(l(33),d("disabled",a.isSigningIn||a.isEmailSigningIn),l(2),b(" ",a.isSigningIn?"Connecting...":"Sign in with Google"," "),l(),d("ngIf",a.auth.devPasswordLoginAvailable()),l(5),d("ngIf",a.authError))},dependencies:[I,O,R,W,j,F,K,q,G,U,H,N,D,B,V,T,J,Y,z],styles:[".login-page[_ngcontent-%COMP%]{min-height:100dvh;width:100vw;display:flex;align-items:center;justify-content:center;background:#0f172a;overflow-x:hidden;position:relative}.glass-container[_ngcontent-%COMP%]{display:flex;width:900px;max-width:95%;min-height:550px;background:#ffffff08;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.1);border-radius:32px;overflow:hidden;z-index:10;box-shadow:0 25px 50px -12px #00000080}.brand-section[_ngcontent-%COMP%]{flex:1;padding:60px;background:linear-gradient(135deg,#1e293b,#0f172a);display:flex;flex-direction:column;justify-content:center;color:#fff;border-right:1px solid rgba(255,255,255,.05)}.brand-section[_ngcontent-%COMP%] .login-logo[_ngcontent-%COMP%]{width:180px;margin-bottom:40px}.brand-section[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:2.5rem;font-weight:800;margin:0 0 16px;letter-spacing:-1px;background:linear-gradient(to right,#60a5fa,#2dd4bf);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.brand-section[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:1.1rem;line-height:1.6;color:#94a3b8;max-width:350px}.login-card-container[_ngcontent-%COMP%]{flex:.8;padding:60px;display:flex;align-items:center;justify-content:center;background:#fff}.login-card[_ngcontent-%COMP%]{width:100%;border:none;box-shadow:none!important;background:transparent}mat-card-title[_ngcontent-%COMP%]{font-size:1.75rem;font-weight:700;color:#1e293b;margin-bottom:8px!important}mat-card-subtitle[_ngcontent-%COMP%]{color:#64748b;font-size:1rem;margin-bottom:32px!important}.features-list[_ngcontent-%COMP%]{margin-bottom:40px;display:flex;flex-direction:column;gap:20px}.feature-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;color:#475569;font-weight:500}.feature-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#27a4a4;background:#f0fdfa;padding:8px;border-radius:12px;width:24px;height:24px;font-size:24px}.google-btn[_ngcontent-%COMP%]{width:100%;height:56px;border-radius:16px;font-size:1.05rem;font-weight:600;display:flex;align-items:center;justify-content:center;gap:12px;background:#1e293b!important;transition:all .3s}.google-btn[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:24px;height:24px;background:#fff;padding:4px;border-radius:4px}.google-btn[_ngcontent-%COMP%]:hover{background:#0f172a!important;transform:translateY(-2px);box-shadow:0 10px 15px -3px #0003}.footer-note[_ngcontent-%COMP%]{text-align:center;font-size:.8rem;color:#94a3b8;margin-top:32px}.request-access-link[_ngcontent-%COMP%]{margin:24px 0 0;color:#64748b;text-align:center;font-size:.9rem}.request-access-link[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#0f766e;font-weight:600;text-underline-offset:3px}.login-error[_ngcontent-%COMP%]{margin:16px 0 0;padding:12px 14px;border:1px solid #fecaca;border-radius:12px;background:#fef2f2;color:#991b1b;font-size:.9rem;line-height:1.4}.dev-login-panel[_ngcontent-%COMP%]{margin-top:18px;padding:16px;border:1px solid #bfdbfe;border-radius:16px;background:#eff6ff;color:#1e3a8a}.dev-login-panel[_ngcontent-%COMP%] .dev-login-title[_ngcontent-%COMP%]{font-weight:800;color:#1e293b;margin-bottom:4px}.dev-login-panel[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 12px;color:#475569;font-size:.82rem;line-height:1.4}.dev-login-panel[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:block;margin:10px 0;color:#334155;font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.dev-login-panel[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;margin-top:6px;padding:11px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;font:inherit;text-transform:none;letter-spacing:0}.dev-login-panel[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:2px solid #93c5fd;outline-offset:1px;border-color:#2563eb}.dev-login-panel[_ngcontent-%COMP%] .dev-login-btn[_ngcontent-%COMP%]{width:100%;margin-top:6px;padding:12px 14px;border:0;border-radius:12px;background:#2563eb;
1color:#fff;font-weight:800;cursor:pointer}.dev-login-panel[_ngcontent-%COMP%] .dev-login-btn[_ngcontent-%COMP%]:disabled{cursor:not-allowed;opacity:.55}.blob[_ngcontent-%COMP%]{position:absolute;width:500px;height:500px;filter:blur(80px);border-radius:50%;z-index:1;opacity:.3}.blob-1[_ngcontent-%COMP%]{background:#3b82f6;top:-100px;left:-100px;animation:_ngcontent-%COMP%_drift 20s infinite alternate}.blob-2[_ngcontent-%COMP%]{background:#14b8a6;bottom:-100px;right:-100px;animation:_ngcontent-%COMP%_drift 25s infinite alternate-reverse}@keyframes _ngcontent-%COMP%_drift{0%{transform:translate(0) scale(1)}to{transform:translate(100px,100px) scale(1.2)}}@media(max-width:850px){.glass-container[_ngcontent-%COMP%]{flex-direction:column;width:100%;height:100%;border-radius:0}.brand-section[_ngcontent-%COMP%]{padding:40px;min-height:250px;align-items:center;text-align:center}.brand-section[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:100%}.login-card-container[_ngcontent-%COMP%]{padding:40px}}"]})};export{Q as LoginComponent};
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.