(this["webpackJsonpmusic-vine"]=this["webpackJsonpmusic-vine"]||[]).push([[10],{781:function(e,t,s){"use strict";s(1);var n=s(0);t.a=function(e){return Object(n.jsx)("img",{className:e.className,src:e.src,alt:e.alt})}},785:function(e,t,s){"use strict";var n=s(4),i=s(5),a=s(8),o=s(7),r=s(6),c=s(1),l=s.n(c),u=s(29),d=(s(43),s(10),s(33)),m=s(16),h=s(254),g=s(18),p=s(145),j=s(256),b=s(253),_=s(188),O=s(0),f=function(e){Object(o.a)(s,e);var t=Object(r.a)(s);function s(e){var i;return Object(n.a)(this,s),(i=t.call(this,e)).state={loginEmail:"",hasQuickLoginEmail:!(!localStorage.getItem("quick_login")||""===localStorage.getItem("quick_login")||"undefined"===localStorage.getItem("quick_login"))},i.resetModalForm=i.resetModalForm.bind(Object(a.a)(i)),i.handleChange=i.handleChange.bind(Object(a.a)(i)),i.handleLogin=i.handleLogin.bind(Object(a.a)(i)),i._handleKeyPress=i._handleKeyPress.bind(Object(a.a)(i)),i}return Object(i.a)(s,[{key:"componentDidMount",value:function(){this.state.hasQuickLoginEmail&&(this.setState({loginEmail:localStorage.getItem("quick_login")}),Object(m.C)(localStorage.getItem("quick_login")))}},{key:"handleChange",value:function(e){this.setState({loginEmail:e.target.value})}},{key:"handleLogin",value:function(){var e=this;Object(m.t)(this.props.redirect).then((function(){e.props.redirect||e.onSetupSite().then((function(){e.props.showSigninSuccess(e.state.userDisplayName)}))}))}},{key:"_handleKeyPress",value:function(e){"Enter"===e.key&&this.handleLogin()}},{key:"resetModalForm",value:function(e){e.preventDefault(),this.setState({loginEmail:"",hasQuickLoginEmail:!1}),Object(m.x)()}},{key:"onSetupSite",value:function(){var e=this;return new Promise((function(t,s){return Object(d.h)().then((function(s){"success"===s.status&&(sessionStorage.removeItem("customer_guid"),sessionStorage.setItem("currency_id",s.currency.id),sessionStorage.setItem("currency_symbol",s.currency.symbol_left),sessionStorage.setItem("currency_value",s.currency.value),sessionStorage.setItem("currency_code",s.currency.code),s.basket_data.tracks?(sessionStorage.setItem("basket_count",s.basket_data.count),sessionStorage.setItem("basket_track_ids",JSON.stringify(s.basket_data.tracks))):sessionStorage.setItem("basket_count",0),sessionStorage.setItem("playlists_data",JSON.stringify(s.playlists_data)),sessionStorage.setItem("favourites_data",JSON.stringify(s.favourites_data)),s.user.isTrusted?(sessionStorage.setItem("is_trusted",!0),sessionStorage.setItem("trusted_name",s.user.trustedName)):(sessionStorage.removeItem("is_trusted"),sessionStorage.removeItem("trusted_name")),s.be_branch&&sessionStorage.setItem("be_branch",JSON.stringify(s.be_branch).replace(/\"/g,"")),s.user.is_authenticated?(sessionStorage.setItem("auth_token",s.user.auth_token),Object(m.z)("auth_token",s.user.auth_token,180),sessionStorage.setItem("artist_account",s.user.hasAccountArtist),sessionStorage.setItem("customer_account",s.user.hasAccountCustomer),sessionStorage.setItem("admin_account",s.user.hasAccountAdmin)):(sessionStorage.removeItem("auth_token"),Object(m.z)("auth_token",s.user.auth_token,180),sessionStorage.removeItem("artist_account"),sessionStorage.removeItem("customer_account"),sessionStorage.removeItem("admin_account")),e.props.loadFavorites(s.favourites_data),e.props.loadFollowing(s.following),e.props.loadSubscriptionData(s.subscriptionData,s.user.is_authenticated),e.props.loadCurrency(s.currency),e.props.loadCountry(s.country),s.user.is_authenticated?(e.setState({userAuthKey:s.user.auth_token,userDisplayName:s.user.company?s.user.company:s.user.firstName,userHasCustomerAccount:s.hasAccountCustomer,userHasArtistAccount:s.hasAccountArtist}),e.props.onSetLoginStatus(!0),e.props.setEnteredProfession(s.enteredProfession),sessionStorage.setItem("auth_token",s.user.auth_token),Object(m.z)("auth_token",s.user.auth_token,180),sessionStorage.removeItem("customer_guid")):(e.props.onSetLoginStatus(!1),sessionStorage.removeItem("user_is_authenticated")),t(s))})).catch((function(e){return s(e),e}))}))}},{key:"render",value:function(){return Object(O.jsxs)("form",{className:"js-login-form login",style:{position:"relative"},children:[Object(O.jsxs)("div",{className:"modal-primary__form-stage-1".concat(this.state.hasQuickLoginEmail?" instant":""),children:[Object(O.jsx)("div",{className:"alert-general-error spacer login-error",style:{display:"none"},children:Object(O.jsx)("span",{children:"Bad credentials."})}),Object(O.jsx)("input",{autoFocus:!0,className:"modal-primary__input js-username",id:"signin__username",name:"_username",type:"text",placeholder:"Email Address","data-lpignore":"true",onChange:this.handleChange,value:this.state.loginEmail}),Object(O.jsx)("button",{id:"signin_check-email",name:"check-email","data-form-prefix":"signin_",className:"modal-primary__btn spacer",onClick:m.g,children:"Next"})]}),Object(O.jsxs)("div",{className:"modal-primary__form-stage-2 login-form-hide".concat(this.state.hasQuickLoginEmail?" instant":""),children:[Object(O.jsx)("div",{className:"alert-general-error spacer login-error",style:{display:"none"},children:Object(O.jsx)("span",{children:"Bad credentials."})}),Object(O.jsxs)("p",{className:"login_modal_supplied-user-email text-center",children:[Object(O.jsx)("span",{children:this.state.loginEmail})," (",Object(O.jsx)("a",{href:"#",onClick:this.resetModalForm,className:"login_modal_reset-modal",children:"Not you?"}),")"]}),Object(O.jsx)("input",{className:"modal-primary__input js-password",name:"_password",type:"password",placeholder:"Password","data-lpignore":"true",onKeyPress:this._handleKeyPress}),Object(O.jsx)("button",{className:"modal-primary__btn spacer js-modal-login",type:"button",name:"button",onClick:this.handleLogin,children:"Sign In"})]}),Object(O.jsxs)("div",{className:"modal-primary__form-mvnet-user text-center login-form-hide",children:[Object(O.jsx)("p",{style:{fontWeight:"600",marginTop:"22px",color:"#4a4a4a",fontSize:"16px"},children:"We've just sent you an email with a link to reset your password."}),Object(O.jsxs)("p",{className:"login_modal_mvnet-user-footer",children:["Already done this? ",Object(O.jsx)("a",{href:"#",onClick:this.resetModalForm,className:"login_modal_reset-modal",children:"Log in!"})]})]}),Object(O.jsx)("input",{id:"signin_js-login-customer-guid",name:"_customer_guid",type:"hidden"})]})}}]),s}(l.a.Component);t.a=Object(u.b)((function(e){return{}}),(function(e){return{setEnteredProfession:function(t){e(Object(m.A)(t))},onSetLoginStatus:function(t){e(Object(m.B)(t))},onSubmitSupplementalUserData:function(){e(Object(m.F)())},loadFavorites:function(t){e(Object(g.f)(t))},loadFollowing:function(t){e(Object(h.b)(t))},loadSubscriptionData:function(t,s){e(Object(p.e)(t,s))},loadCurrency:function(t){e(Object(j.a)(t))},loadCountry:function(t){e(Object(b.a)(t))},onSetAppliedFilters:function(t){e(Object(_.c)(t))},onSetNotFiltered:function(){e(Object(_.e)())},showNotificationSuccess:function(t){t?setTimeout((function(){e(Object(m.D)(t)),setTimeout((function(){e(Object(m.b)())}),10)}),4e3):(e(Object(m.D)()),e(Object(m.b)()))},hideNotificationSuccess:function(){e(Object(m.c)()),e(Object(m.q)())},showSigninSuccess:function(t){setTimeout((function(){e(Object(m.E)(t)),setTimeout((function(){e(Object(m.b)()),setTimeout((function(){e(Object(m.c)()),setTimeout((function(){e(Object(m.r)())}),400)}),4e3)}),10)}),400)}}}))(f)},792:function(e,t,s){"use strict";s.r(t),s.d(t,"mapDispatchToProps",(function(){return O}));var n=s(4),i=s(5),a=s(7),o=s(6),r=s(1),c=s.n(r),l=s(252),u=s.n(l),d=s(14),m=s(29),h=(s(66),s(16)),g=s(10),p=s(785),j=s(43),b=(s(781),s(0)),_=function(e){Object(a.a)(s,e);var t=Object(o.a)(s);function s(e){var i;return Object(n.a)(this,s),(i=t.call(this,e)).state={redirect:i.props.params,loginEmail:"",hasQuickLoginEmail:!(!localStorage.getItem("quick_login")||""===localStorage.getItem("quick_login")||"undefined"===localStorage.getItem("quick_login"))},i}return Object(i.a)(s,[{key:"messageToDisplay",value:function(){return this.props.params.requestIntent&&this.props.params.requestIntent.includes("artist")&&"true"!==sessionStorage.getItem("artist_account")?3:this.props.params.requestIntent?1:2}},{key:"render",value:function(){var e="Sign In";return this.props.params.requestIntent&&!this.props.userAuth.isLoggedIn&&(e="Sign in to Continue"),Object(b.jsxs)("div",{children:[Object(b.jsxs)(u.a,{children:[Object(b.jsx)("title",{children:"Sign In"}),Object(b.jsx)("meta",{name:"description",content:""})]}),Object(b.jsx)("div",{className:"signin-hero fill-page-height",children:Object(b.jsxs)("div",{className:"signin-container",children:[Object(b.jsxs)("div",{className:"signin-container-inner",children:[Object(b.jsx)("h1",{className:"hero-alternate-title about__main-title",children:e}),!this.props.userAuth.isLoggedIn&&Object(b.jsx)(p.a,{redirect:this.state.redirect}),this.props.userAuth.isLoggedIn&&Object(b.jsxs)("div",{style:{marginTop:"40px"},children:[1===this.messageToDisplay()&&Object(b.jsxs)("div",{children:[Object(b.jsx)("p",{children:"You are already signed in."}),Object(b.jsx)("a",{className:"btn-primary btn-fixed-lg",href:Object(h.o)(this.state.redirect),style:{display:"inline-block",lineHeight:"33px"},children:"Continue"})]}),2===this.messageToDisplay()&&Object(b.jsxs)("div",{children:[Object(b.jsx)("p",{children:"You are already signed in."}),Object(b.jsx)(d.a,{className:"btn-primary btn-fixed-lg",to:"/browse/all",style:{display:"inline-block",lineHeight:"33px"},children:"Start Browsing"})]}),3===this.messageToDisplay()&&Object(b.jsxs)("div",{children:[Object(b.jsx)("p",{children:"It looks like you're trying to access an artist page with a customer account."}),Object(b.jsx)("a",{className:"btn-primary btn-fixed-lg",href:"".concat(g.c.API,"user/handle-symfony-logout"),style:{display:"inline-block",lineHeight:"33px",width:"280px"},children:"Sign In With A Different Account"})]})]})]}),Object(b.jsx)("div",{className:"text-center",children:Object(b.jsx)("div",{className:"js-spinner-login spacer-b js-spinner",style:{display:"none"},children:Object(b.jsx)(j.a,{})})}),!this.props.userAuth.isLoggedIn&&Object(b.jsx)("div",{className:"password-prompt text-center",children:Object(b.jsx)("p",{children:Object(b.jsx)("a",{href:"/user/reset-password",children:"Lost your password?"})})})]})})]})}}]),s}(c.a.Component);function O(e){return{}}t.default=Object(m.b)((function(e){return{userAuth:e.get("userAuth")}}),O)(_)}}]); //# sourceMappingURL=10.chunk.js.map?hash=2c09ec8d