1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="be1ecd76-1357-4a44-8d7f-0276291580b3",e._sentryDebugIdIdentifier="sentry-dbid-be1ecd76-1357-4a44-8d7f-0276291580b3")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1900],{21900:function(e,n,t){t.d(n,{$:function(){return C}});var r=t(85893),o=t(67294),i=t(44485),a=t(74864),u=t(67561),l=t(39332),d=t(81627),c=t(91828),s=t(63790),f=t(97673),g=t(25214),p=t(27601),h=t(37656),v=t(84094),m=t(85510);let w=new Set(["auth/cancelled-popup-request","auth/popup-closed-by-user","auth/popup-blocked","auth/web-storage-unsupported"]),b=/gsa\/|googleapp|instagram|fbav|fban|line\/|; wv\)|musical_ly|trill|bytedancewebview|linkedinapp|snapchat/;function y(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b.test((null!==(e=null==n?void 0:n.userAgent)&&void 0!==e?e:"undefined"==typeof navigator?"":navigator.userAgent).toLowerCase())}function k(e){let n=String((null==e?void 0:e.code)||""),t=String((null==e?void 0:e.message)||"");return w.has(n)||/pending promise was never set/i.test(t)}function _(e){return"auth/popup-blocked"===String((null==e?void 0:e.code)||"")}var S=t(65615),A=t(48038);function C(e){let{text:n}=e,t=(0,l.useRouter)(),w=(0,d.T)(),[b,C]=o.useState(null),[R,x]=o.use
1State(!1),[U,E]=o.useState(!1),[T,I]=o.useState(!1),[D,P]=o.useState(!1),[L,N]=o.useState(null),j=o.useRef(null),B=o.useRef(!1),G=o.useRef(!1),H=o.useCallback(()=>!!y()&&(N({href:window.location.href,platform:function(e){let n=e.toLowerCase();return/android/.test(n)?"android":/iphone|ipad|ipod/.test(n)?"ios":"other"}(navigator.userAgent)}),!0),[]);o.useEffect(()=>{H()},[H]);let F=async(e,r,o,i)=>{x(!0),C(null);let a="up"===n?"google_signup_button":"google_login_button";try{let{ensure:n,profile:u}=await (0,g.yp)({uid:e,providerType:"google.com",source:a,loadProfile:!0});r&&(await (0,h.W)(e),(0,s.t)(i),o&&(0,c.Fp)());let l=(0,m.bO)()||(0,m.Ug)(),d=await (0,p.L)({uid:e,ensure:n,profile:u,router:t,source:a,currentPath:window.location.pathname,returnTo:l,claimRoute:!r&&o?(0,c.CM)():null,isDesktopHandoff:(0,v.ur)()});if("handoff"===d.kind){I(!0);try{await (0,v.CO)()}catch(e){console.error("Desktop auth handoff failed",e),C(w((0,v.V3)(e)))}finally{I(!1)}return}"recover"===d.kind&&C(w(d.reason||"errors.accountSetupGeneric"))}catch(e){console.error("Google auth bootstrap failed",e),C(w((0,f.SA)(e)))}finally{x(!1)}},O=async e=>{a.hJ.credentialFromResult(e);let n=e.user,t=(0,a.gK)(e),r=(null==t?void 0:t.isNewUser)||!1,o=(0,c.be)();if(!n){console.warn("No user info yet.");return}j.current=async()=>{await F(n.uid,r,o,n.email)},await F(n.uid,r,o,n.email)};o.useEffect(()=>{if(G.current)return;G.current=!0;let e=!1;return(0,S.gp)()&&P(!0),(async()=>{let n=!1;try{var t;let r=(0,S.gp)();if("function"==typeof u.auth.authStateReady&&await u.auth.authStateReady(),e)return;let o=await (0,S.yc)(()=>(0,a.cx)(u.auth));if(e)return;let i=(0,A.jk)({redirectUser:null!==(t=null==o?void 0:o.user)&&void 0!==t?t:null,currentUser:u.auth.currentUser,redirectWasPending:r});if((0,S.S)("credential"===i||"existing-session"===i),n=!0,"idle"===i)return;if("incomplete"===i){C(w("google.redirectIncomplete"));return}if(B.current=!0,E(!0),C(null),"credential"===i&&o){await O(o);return}let l=u.auth.currentUser;if(!l){C(w("google.redirectIncomplete"));return}j.current=async()=>{await F(l.uid,!1,(0,c.be)(),l.email)},await F(l.uid,!1,(0,c.be)(),l.email)}catch(t){if(e||(n||(0,S.S)(!1),k(t)))return;console.error("Google redirect sign-in failed",t)}finally{e||(B.current=!1,E(!1),P(!1))}})(),()=>{e=!0}},[]);let V=async()=>{if(H()||B.current||R||T||D)return;B.current=!0,E(!0),C(null);let e=!1;try{let n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!e.desktopHandoff&&(y(e),!1)}({desktopHandoff:(0,v.ur)()}),t=(0,m.bO)();if(t&&(0,m.FY)(t),n){e=!0,(0,S.lo)(),await (0,a.F6)(u.auth,u.provider);return}try{let e=await (0,a.rh)(u.auth,u.provider);await O(e)}catch(n){if(_(n))throw n;if(k(n)&&!(0,v.ur)()&&!y()){console.warn("Google popup failed; falling back to redirect",n),e=!0,(0,S.lo)(),await (0,a.F6)(u.auth,u.provider);return}throw n}}catch(i){var n;let e=null==i?void 0:i.code,t=null==i?void 0:i.message,r=null==i?void 0:null===(n=i.customData)||void 0===n?void 0:n.email,o=a.hJ.credentialFromError(i);k(i)?(console.warn("Recoverable Google sign-in interruption: ",e,t),C(_(i)?w("google.popupBlocked"):null)):console.error("Error during sign-in: ",e,t,r,o)}finally{e||(B.current=!1,E(!1))}},J=U||R||T||D;if(L){let e="android"===L.platform?w("google.openInChrome"):"ios"===L.platform?w("google.openInSafari"):w("google.openInBrowser");return(0,r.jsxs)("div",{children:[(0,r.jsx)("a",{href:L.href,className:"d-flex justify-content-center align-items-center google-border text-body",children:(0,r.jsx)("p",{className:"mb-0",children:e})}),(0,r.jsx)("p",{className:"text-muted text-sm mt-2 mb-0",children:w("google.openInBrowserHint")})]})}return(0,r.jsxs)("div",{"data-sentry-component":"GoogleAuthButton","data-sentry-source-file":"GoogleAuthButton.tsx",children:[(0,r.jsxs)("button",{type:"button",className:"d-flex justify-content-center align-items-center google-border pointer-event",onClick:J?void 0:V,disabled:J,"aria-busy":J,style:J?{opacity:.7}:void 0,children:[(0,r.jsx)(i.Bm,{"data-sentry-element":"GoogleBrandIcon","data-sentry-source-file":"GoogleAuthButton.tsx"}),(0,r.jsx)("p",{children:T?w("google.authenticatingDesktop"):U?w("google.openingSignIn"):R?w("in"===n?"google.signingIn":"google.settingUpAccount"):"in"===n?w("google.signIn"):w("google.signUp")})]}),T?(0,r.jsx)("div",{className:"mt-2 text-center",children:(0,r.jsx)("p",{className:"text-muted text-sm mb-0",children:w("google.authenticatingDesktopHint")})}):null,b?(0,r.jsxs)("div",{className:"mt-2 text-center",children:[(0,r.jsx)("p",{className:"text-danger text-sm mb-2",children:b}),j.current?(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-outline-primary",onClick:()=>{let e=j.current;e&&e().catch(e=>{console.error("Google auth retry failed",e),C(w((0,f.SA)(e)))})},disabled:J,children:w("onboard.retrySetup")}):null]}):null]})}},84094:function(e,n,t){t.d(n,{CO:function(){return f},V3:function(){return g},ur:function(){return c}});var r,o,i,a=t(67561),u=t(83454);let l=null!==(r=u.env.NEXT_PUBLIC_DESKTOP_AUTH_MINT_CALLABLE)&&void 0!==r?r:"auth-mintDesktopCustomToken",d={desktop_app:null!==(o=u.env.NEXT_PUBLIC_DESKTOP_APP_AUTH_REDI
1RECT_BASE)&&void 0!==o?o:"braiv-compressor://auth",desktop_capture:null!==(i=u.env.NEXT_PUBLIC_DESKTOP_CAPTURE_AUTH_REDIRECT_BASE)&&void 0!==i?i:"braiv-capture://auth"};function c(e){return null!==p(e)}async function s(){var e;let n=(0,a.httpsCallable)(a.functions,l),t=await n({});if(!("object"==typeof(e=t.data)&&null!==e&&"string"==typeof e.customToken&&e.customToken.length>0))throw Error("invalid-desktop-custom-token-response");return t.data.customToken}async function f(){let e=await s();window.location.href=function(e,n){let t=p(void 0),r=(t?d[t]:d.desktop_app).replace(/\/+$/,""),o=r.includes("?")?"&":"?";return"".concat(r).concat(o,"token=").concat(encodeURIComponent(e))}(e)}function g(e){let n=String((null==e?void 0:e.code)||"").toLowerCase(),t=String((null==e?void 0:e.message)||"").toLowerCase();return n.includes("unauthenticated")||t.includes("unauthenticated")?"errors.desktopAuthUnauthenticated":n.includes("unavailable")||n.includes("network")||t.includes("network")?"errors.desktopAuthNetwork":"errors.desktopAuthFailed"}function p(e){var n;let t=((n=null!=e?e:window.location.search)?new URLSearchParams(n.startsWith("?")?n.slice(1):n):new URLSearchParams).get("client");return t&&t in d?t:null}},66367:function(e,n,t){t.d(n,{Gw:function(){return r},Hi:function(){return o}});let r="/email-verification";function o(e){var n,t;return!!e&&!e.emailVerified&&!!e&&null!==(t=null===(n=e.providerData)||void 0===n?void 0:n.some(e=>(null==e?void 0:e.providerId)==="password"))&&void 0!==t&&t}},37671:function(e,n,t){t.d(n,{U:function(){return r}});async function r(e){return"/video"}},32081:function(e,n,t){function r(e){return"".concat("braiv:onboardingComplete:").concat(e)}function o(e){if(!e)return!1;try{return"1"===window.localStorage.getItem(r(e))}catch(e){return console.warn("Failed to read onboarding completion cache:",e),!1}}function i(e){if(e)try{window.localStorage.setItem(r(e),"1")}catch(e){console.warn("Failed to write onboarding completion cache:",e)}}t.d(n,{h:function(){return o},v:function(){return i}})},17402:function(e,n,t){t.d(n,{hr:function(){return o},bN:function(){return c},Em:function(){return l}});var r=t(66367);let o="__authenticated_home__",i=new Set(["/onboard","/onboard-pricing","/setup-channel","/setup-channel-languages","/setup-channel-languages-add","/setup-branding"]),a=new Set(["/login","/signup"]),u=new Set(["/login","/signup","/"]);function l(e){var n,t;return e?{onboarding:{pricing:e.onboardPricing,connect:e.onboardConnect,player:e.onboardPlayer,editScreen:e.onboardEditScreen,intents:e.userIntents},signupIntent:null!==(n=e.signupIntent)&&void 0!==n?n:null,pendingAuthReturnTo:null!==(t=e.pendingAuthReturnTo)&&void 0!==t?t:null,pendingAuthReturnToConsumed:!!e.pendingAuthReturnToConsumedAt,pendingAuthReturnToCreatedAtMs:e.pendingAuthReturnToCreatedAt?e.pendingAuthReturnToCreatedAt.getTime():null}:null}function d(e){if(!e)return"";let n=e.split("?")[0]||"";return n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function c(e){var n,t,l,c,s,f;let g=e.mode||"entry",p=null!==(l=e.loopThreshold)&&void 0!==l?l:8,h=d(e.currentPath);if((null!==(c=e.loopCount)&&void 0!==c?c:0)>=p)return{kind:"recover",reason:"loop_breaker"};if(e.authLoading)return{kind:"wait",reason:"auth_loading"};if(void 0===e.contextUser||!e.contextUser&&e.firebaseUser)return{kind:"wait",reason:"auth_context_lag"};if(!(s={loading:e.authLoading,contextUser:e.contextUser,firebaseCurrentUser:e.firebaseUser}).loading&&void 0!==s.contextUser&&!s.contextUser&&!s.firebaseCurrentUser)return e.authDegraded?{kind:"recover",reason:"auth_degraded"}:a.has(h)||"/email-verification"===h?{kind:"render",reason:"signed_out"}:{kind:"navigate",route:"/login",reason:"signed_out"};if(e.requiresEmailVerification)return(f=r.Gw,d(h)===d(f))?{kind:"render",reason:"email_unverified"}:{kind:"navigate",route:r.Gw,reason:"email_unverified"};if(e.isDesktopHandoff)return{kind:"handoff",reason:"desktop_handoff"};if(e.claimRoute)return{kind:"navigate",route:e.claimRoute,reason:"claim"};if(e.returnTo)return{kind:"navigate",route:e.returnTo,reason:"return_to"};let v=(null===(t=e.snapshot)||void 0===t?void 0:null===(n=t.onboarding)||void 0===n?void 0:n.pricing)===!0,m=!!e.onboardingCompleteCached;if(v||m){let e=v?"onboarding_complete":"onboarding_complete_cached";return"gate"===g?{kind:"render",reason:e}
1:i.has(h)||u.has(h)||h===r.Gw?{kind:"navigate",route:o,reason:e}:{kind:"render",reason:e}}if(e.snapshot){let n=function(e){if((null==e?void 0:e.pricing)===!0)return null;let n=null==e?void 0:e.intents;return n&&Object.keys(n).length>0?(null==e?void 0:e.connect)?"/setup-channel":(null==e?void 0:e.player)?"/setup-branding":"/onboard-pricing":"/onboard"}(e.snapshot.onboarding);return n?"onboard"===g&&i.has(h)||d(h)===d(n)?{kind:"render",reason:"already_on_route"}:{kind:"navigate",route:n,reason:"/setup-channel"===n?"onboarding_connect":"/setup-branding"===n?"onboarding_player":"/onboard-pricing"===n?"onboarding_pricing":"onboarding_intent"}:"gate"===g?{kind:"render",reason:"onboarding_complete"}:{kind:"navigate",route:o,reason:"onboarding_complete"}}return"gate"===g?{kind:"render",reason:"snapshot_unknown"}:{kind:"recover",reason:"snapshot_unknown"}}},66140:function(e,n,t){t.d(n,{L2:function(){return l},aP:function(){return u},n0:function(){return a}}),t(17402);let r="braiv:sessionRouteLoop";function o(){try{let e=window.sessionStorage.getItem(r);if(!e)return null;let n=JSON.parse(e);if(!n||"number"!=typeof n.count||"number"!=typeof n.startedAt)return null;return n}catch(e){return null}}function i(e){try{window.sessionStorage.setItem(r,JSON.stringify(e))}catch(e){}}function a(){let e=o();return!e||Date.now()-e.startedAt>2e4?0:e.count}function u(e){let n=Date.now(),t=o();if(!t||n-t.startedAt>2e4){let t={count:1,startedAt:n,lastRoute:e};return i(t),t.count}if(t.lastRoute===e)return t.count;let r={count:t.count+1,startedAt:t.startedAt,lastRoute:e};return i(r),r.count}function l(){try{window.sessionStorage.removeItem(r)}catch(e){}}},19051:function(e,n,t){t.d(n,{RV:function(){return l},vr:function(){return s},x2:function(){return d}});var r=t(74005),o=t(37671),i=t(32081),a=t(17402),u=t(66140);function l(e){return"loop_breaker"===e?"errors.sessionLoopRecover":"auth_degraded"===e?"errors.sessionAuthDegraded":"errors.accountSetupGeneric"}function d(e){return e.authDegraded||"auth_degraded"===e.reason||"loop_breaker"===e.reason?"reload":"retry_ensure"}async function c(e){try{return await (0,o.U)(e)}catch(e){return console.error("Failed to determine home redirect destination",e),"/video"}}async function s(e){var n;let{decision:t,uid:o,router:l,source:d}=e,s=(0,u.n0)();if((0,r.logAnalyticsEvent)("session_route_resolved",{source:d,kind:t.kind,reason:t.reason,route:t.route||"",loop_count:s}),"navigate"!==t.kind||!t.route||(n=e.authenticatedUid,o&&void 0!==n&&n!==o))return"skipped";let f=t.route;if(f===a.hr){if(!o)return"skipped";("onboarding_complete"===t.reason||"onboarding_complete_cached"===t.reason)&&(0,i.v)(o),f=await c(o)}return(0,u.aP)(f),e.replace?l.replace(f):l.push(f),"applied"}},27601:function(e,n,t){t.d(n,{L:function(){return s}});var r=t(73029),o=t(13709),i=t(32081),a=t(66367),u=t(20943),l=t(17402),d=t(19051),c=t(66140);async function s(e){var n;let t=(0,u.O)(e.ensure)||(0,l.Em)(e.profile),s=(0,r.ar)(),f=(0,o.Bf)(e.profile),g=e.returnTo||null;g&&f===g?await (0,o.fS)(e.uid,f):!g&&f&&(await (0,o.fS)(e.uid,f),g=f);let p=(0,l.bN)({authLoading:!1,contextUser:{uid:e.uid},firebaseUser:s,requiresEmailVerification:(0,a.Hi)(s),snapshot:t,snapshotFailed:!t,onboardingCompleteCached:null!==(n=e.onboardingCompleteCached)&&void 0!==n?n:(0,i.h)(e.uid),returnTo:g,claimRoute:e.claimRoute,isDesktopHandoff:e.isDesktopHandoff,currentPath:e.currentPath,loopCount:(0,c.n0)(),mode:"entry"});return"handoff"===p.kind?{kind:"handoff",reason:p.reason}:"recover"===p.kind?{kind:"recover",reason:(0,d.RV)(p.reason)}:(null==s?void 0:s.uid)&&s.uid!==e.uid?{kind:"skipped",reason:"auth_uid_mismatch"}:{kind:await (0,d.vr)({decision:p,uid:e.uid,router:e.router,replace:e.replace,source:e.source,authenticatedUid:null==s?void 0:s.uid}),reason:p.reason}}},65615:function(e,n,t){t.d(n,{S:function(){return p},bI:function(){return g},gp:function(){return f},lo:function(){return s},uF:function(){return v},yc:function(){return h}});var r=t(67294),o=t(24384);let i="braiv.googleAuth.redirectPending",a="googleRedirect",u="braiv:google-redirect-settled",l=null,d=!1;function c(e){try{let n=new URL(window.location.href);if(e){if("1"===n.searchParams.get(a))return;n.searchParams.set(a,"1")}else{if(!n.searchParams.has(a))return;n.searchParams.delete(a)}window.history.replaceState(window.history.state,"","".concat(n.pathname).concat(n.search).concat(n.hash))}catch(e){}}function s(){d=!1,(0,o.D9)(i,"1"),c(!0)}function f(){return"1"===(0,o.St)(i)||function(){try{return"1"===new URLSearchParams(window.location.search).get(a)}catch(e){return!1}}()}function g(){return d}function p(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];d=e,f(),(0,o.lD)(i),c(!1),window.dispatchEvent(new Event(u))}function h(e){return l||(l=e()),l}function v(){let[e,n]=r.useState(!1);return r.useEffect(()=>{if(!f()){n(!0);return}let e=()=>n(!0);window.addEventListener(u,e);let t=window.setTimeout(e,12e3);return()=>{window.removeEventListener(u,e),window.clearTimeout(t)}},[]),e}}}]); 2//# sourceMappingURL=1900-2a4c53d6292523ed.js.map
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.