1"use strict";(self["webpackChunkshortform"]=self["webpackChunkshortform"]||[]).push([[138],{74935:function(t,e,i){i.d(e,{N:function(){return p}});var n=i(82805),o=i(81864);if(/^(524|839|977)$/.test(i.j))var a=i(35467);if(/^(524|839|977)$/.test(i.j))var s=i(41428);if(/^(524|839|977)$/.test(i.j))var r=i(2147);if(/^(524|839|977)$/.test(i.j))var l=i(78848);if(/^(524|839|977)$/.test(i.j))var d=i(20994);const c={clientId:"com.shortform.application",redirectURI:"https://www.shortform.com/app",scopes:"email name",state:"12345",nonce:"nonce"},u={clientId:"com.shortform.www",redirectURI:o.p8?"https://www.shortform.com/app":"https://dev.shortform.com/app",scopes:"email name",state:"12345",nonce:"nonce"},h="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js";class p{constructor(t,e,i,n,o){this.isEnabled=!0,this._webSdkReady=!1,this._sdkLoadPromise=null,this.validation=t,this.onStart=e,this.onSuccess=i,this.onError=n,this._isNativeApp=o}init(){this._isNativeApp||(this._sdkLoadPromise=new Promise(t=>{(0,s.f8)(h,{onload:()=>{this._webSdkReady=!0,t()}})}))}async start(){let t;try{const e=this._isNativeApp?n.r.authorize(c):this._authorizeWeb();await this.onStart(),t=await e,o.p8||!0===window.__UNIT_TESTING||console.log(t);const i=t.response,a={email:i.email,appleUser:i.user,appleGivenName:i.givenName,appleFamilyName:i.familyName,appleIdentityToken:i.identityToken,appleAuthorizationCode:i.authorizationCode},s=await r.H.appleLoginOrRegister(a);s.user.full_name=a.appleGivenName||"";const l=await(0,d.VN)(s,"apple");return this.onSuccess(l)}catch(e){let i="Apple authentication failed.";const n=(0,a.q3)(e);e.error?(i="Apple authentication failed: ","popup_closed_by_user"===e.error?i+="popup closed by user.":"user_trigger_new_signin_flow"===e.error?i+="triggered new signin flow.":"popup_blocked_by_browser"===e.error?i+="popup blocked by browser.":(i+=e.error,l.sQ.captureMessage(e.error))):n.isSocialAuthError()&&"apple_no_email_error"===n.message()?i="We couldn't get an email address from your Apple account. Please try again.":l.sQ.withScope(i=>{i.setContext("SF: Apple Response",{response:t}),l.sQ.captureException(e)}),this.validation.showError("social",i),this.onError()}}_authorizeWeb(){var t;const e=()=>{const t=window.AppleID;return t.auth.init({clientId:u.clientId,redirectURI:u.redirectURI,scope:u.scopes,state:u.state,nonce:u.nonce,usePopup:!0}),t.auth.signIn().then(t=>{var e,i,n,o,a,s;return{response:{user:null,email:null!==(e=null===(i=t.user)||void 0===i?void 0:i.email)&&void 0!==e?e:null,givenName:null!==(n=null===(o=t.user)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.firstName)&&void 0!==n?n:null,familyName:null!==(a=null===(s=t.user)||void 0===s||null===(s=s.name)||void 0===s?void 0:s.lastName)&&void 0!==a?a:null,identityToken:t.authorization.id_token,authorizationCode:t.authorization.code}}})};return this._webSdkReady?e():(null!==(t=this._sdkLoadPromise)&&void 0!==t?t:Promise.resolve()).then(e)}static async tryLogout(){}}},87138:function(t,e,i){i.d(e,{E:function(){return d}});var n=i(2404);const o=(0,n.F3)("GoogleAuth");var a=i(2147),s=i(78848),r=i(53932),l=i(20994);class d{constructor(t,e,i,n){this.isEnabled=!0,this.validation=t,this.onStart=e,this.onSuccess=i,this.onError=n}init(){}async start(){try{await this.onStart();const t=await o.signIn(),e=await r.i.isNativeIOSApp(),i=t.authentication.idToken,n={googleToken:i},s=await a.H.googleLoginOrRegister(n,e);s.user.full_name=t.givenName;const d=await(0,l.VN)(s,"google");return this.onSuccess(d)}catch(t){const e="Google Authentication error";this.validation.showMessage("social",e),s.sQ.withScope(e=>{e.setExtra("Google Native Signin Error",t),s.sQ.captureException(t)}),this.onError()}}static async tryLogout(){try{await o.signOut()}catch(t){console.log("Error on native Google logout",t)}}}},84249:function(t,e,i){if(i.d(e,{N:function(){return h}}),/^(524|839|977)$/.test(i.j))var n=i(81864);if(/^(524|839|977)$/.test(i.j))var o=i(2147);if(/^(524|839|977)$/.test(i.j))var a=i(78848);if(/^(524|839|977)$/.test(i.j))var s=i(41428);if(/^(524|839|977)$/.test(i.j))var r=i(20994);var l=i(85537);if(/^(524|839|977)$/.test(i.j))var d=i(11013);const c=5e3,u="https://accounts.google.com/gsi/client";class h{constructor(t,e,i,n){this.authMode=d.c.Signin,this.isEnabled=!1,this.hasContainerComponentMounted=!1,this.hasInitialized=!1,this.buttonLayout="default",this.bigC
1ontainer=null,this.smallContainer=null,this.signupTextExperiment="default",this.containerComponentHasMounted=async(t,e="default",i)=>{this.authMode=t,this.buttonLayout=e,this.bigContainer=i.big,this.smallContainer=i.small,this.hasContainerComponentMounted=Boolean(this.bigContainer||this.smallContainer),this._doSetup()},this._handleGoogleAuthToken=async t=>{try{await this.onStart();const e=t.credential,i=(0,l.s)(e),n=i.email,a={googleToken:e,email:n},s=await o.H.googleLoginOrRegister(a);s.user.full_name=i.given_name;const d=await(0,r.VN)(s,"google");return this.onSuccess(d)}catch(e){this._errorHandler(e)}},this.validation=t,this.onStart=e,this.onSuccess=i,this.onError=n,window._Hack_For_Testing_Google=this}init(){var t;setTimeout(()=>{this.hasInitialized||this.validation.hasError("social")||(this.validation.showError("social","Google library did not load."),this.onError())},c),window.addEventListener("google-loaded",()=>{window._hasGSILoaded=!0,this._doSetup()});const e=Boolean(document.querySelector(`script[src="${u}"]`));window._hasGSILoaded||null!==(t=window.google)&&void 0!==t&&null!==(t=t.accounts)&&void 0!==t&&t.id||e||(0,s.f8)(u,{onload:()=>{window._hasGSILoaded=!0,window.dispatchEvent(new Event("google-loaded"))}})}_doSetup(){if(window._hasGSILoaded&&this.hasContainerComponentMounted){if(!this.hasInitialized){const t={client_id:n.E5,callback:this._handleGoogleAuthToken};this._googleInitialize(t),this.hasInitialized=!0}this.validation.reset(),this.renderButtons()}}renderButtons(){const t=this.authMode===d.c.Signin?"signin_with":"signup_with",e={theme:"outline",size:"large",shape:"pill",width:240,text:t,logo_alignment:"left"};if("signup-desktop"===this.buttonLayout)e.width=360,e.logo_alignment="center";else if("mobile-stacked"===this.buttonLayout){e.logo_alignment="center";const t=document.querySelector(".facebookSignIn"),i=null===t||void 0===t?void 0:t.offsetWidth,n=window.innerWidth>327?327:window.innerWidth;e.width=i||n}else"signup-popup"===this.buttonLayout&&(e.width=400,e.logo_alignment="center");this.bigContainer&&this._googleRenderButton(this.bigContainer,e);const i={theme:"outline",type:"icon",width:40,size:"large",shape:"pill"};this.smallContainer&&this._googleRenderButton(this.smallContainer,i)}_googleRenderButton(t,e){try{window.google.accounts.id.renderButton(t,e)}catch(i){throw a.sQ.captureException(i),i}}_googleInitialize(t){try{window.google.accounts.id.initialize(t)}catch(e){throw a.sQ.captureException(e),e}}_errorHandler(t){const e="Google authentication error occurred. Please try again later.";this.onError(),this.validation.showMessage("social",e),a.sQ.withScope(e=>{e.setExtra("Google Error",t),a.sQ.captureMessage("Google Sign-In error")})}}},20994:function(t,e,i){i.d(e,{BE:function(){return u},VN:function(){return d},w2:function(){return c}});var n=i(54191),o=i(21692),a=i(17933),s=i(9343),r=i(49752),l=i(26543);async function d(t,e){return"login"===t.auth_type?c(t):u(t,e)}async function c(t){return a.wI(t.token,t.user),await(0,o.Tf)(),await(0,o.XB)(t.user),"B"===(0,s.RC)()&&await(0,r.u9)(),"B"===(0,s.Cm)()&&await(0,l.v7)(),{name:"discover"}}async function u(t,e){return a.wI(t.token,t.user),(0,n.SS)(!0),await(0,o.mY)(t.user,e),await(0,s.iN)(),null}},11013:function(t,e,i){var n;i.d(e,{c:function(){return n}}),function(t){t[t["Signup"]=0]="Signup",t[t["Signin"]=1]="Signin"}(n||(n={}))},52197:function(t,e,i){i.d(e,{i:function(){return s}});i(16280);var n=i(2404);class o{async initSdk(t){const e=window.AdjustConfig,i=new e(t.appToken,t.environment);window.Adjust.initSdk(i)}async trackEvent(t){const e=window.AdjustEvent,i=new e(t.eventToken);window.Adjust.trackEvent(i)}getAdid(){return new Promise((t,e)=>{window.cordova.exec(e=>t({adid:e}),e,"Adjust","getAdid",[])})}getIdfa(){return new Promise((t,e)=>{window.cordova.exec(e=>t({idfa:e}),e,"Adjust","getIdfa",[])})}getGoogleAdId(){return new Promise((t,e)=>{window.cordova.exec(e=>t({googleAdId:e}),e,"Adjust","getGoogleAdId",[])})}}class a{init(){var t;const e=!(null===(t=window.Capacitor)||void 0===t||null===(t=t.Plugins)||void 0===t||!t.CapacitorAdjust);this.instance=e?(0,n.F3)("CapacitorAdjust"):new o}async initSdk(t){if(!this.instance)throw new Error("AdjustAdapter: init() was not called before initSdk()");return this.instance.initSdk(t)}async trackEvent(t){if(!this.instance)throw new Error("AdjustAdapter: init() was not called before trackEvent()");return this.instance.trackEvent(t)}async getAdid(){if(!this.instance)throw new Error("AdjustAdapter: init() was not called before getAdid()");return this.instance.getAdid()}async getIdfa(){if(!this.instance)throw new Error("AdjustAdapter: init() was not called before getIdfa()");return this.instance.getIdfa()}async getGoogleAdId(){if(!this.instance)throw new Error("AdjustAdapter: init() was not called before getGoogleAdId()");return this.instance.getGoogleAdId()}}const s=new a}}]); 2//# sourceMappingURL=138.8c3c47d5.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.