{"version":3,"sources":["webpack:///./Avensia.Common/Features/ResetPassword/ForgotPasswordPage.tsx","webpack:///./Avensia.Common/Features/Account/Form/AccountForm.tsx","webpack:///./Avensia.Common/Features/Shared/MainContainer/index.tsx","webpack:///./Avensia.Common/Features/Account/Panel/AccountPanel.tsx","webpack:///./Avensia.Common/Features/Shared/email-pattern.ts"],"names":["props","onSubmit","isMobile","this","currentBreakpoint","Medium","isValidEmail","validateEmail","email","state","trim","url","location","pathname","query","setFailMessage","success","message","window","scroll","top","left","behavior","setSuccessMessage","successMessage","Promise","reject","onEmailFieldInput","e","setState","target","value","failedMessage","test","onLoginClick","bottomLinkPage","successSendEmailComponent","heading","successTitle","buttonCaption","pageTitle","buttonAction","replace","render","submitButtonCaption","redirectLink","redirectLabel","bottomLinkLabel","PartDescription","for","mainBody","component","InputContainer","InputLabel","emailLabel","InputField","required","type","name","placeholder","emailPlaceholder","onChange","onBlur","invalid","Error","redirectButtonHeading","redirectButtonPage","redirectButtonCaption","Component","label","marginLeft","paddingLeft","div","marginBottom","marginTop","textAlign","ForgotPassword","KeepEnabled","onClick","preventDefault","feedback","push","FeedbackButton","Button","FormContainer","css","customFormStyle","H1","Form","noValidate","children","compose","appearance","Primary","Full","disabled","Div","RedirectLink","to","color","textDecoration","h1","fontWeight","backgroundColor","borderRadius","padding","xy","CustomContainer","Narrow","layout","OneToOne","paddingBottom","maxWidth","AccountPanel","PanelContainer","ActionButton","Secondary","alignItems","display","flexDirection","paddingTop","x","y","letterSpacing","emailPattern"],"mappings":"2FAAA,W,EAAA,kIAkCA,cACE,WAAYA,GAAZ,MACE,YAAMA,IAAM,K,OAQd,EAAAC,SAAW,0D,qFACHC,EAAWC,KAAKH,MAAMI,kBAAoB,IAAWC,OACrDC,EAAeH,KAAKI,gBACpBC,EAAQL,KAAKM,MAAMD,MAAME,OACzBC,EAAM,YAAYC,SAASC,SAAU,yBACrCC,EAAQ,CAAEN,MAAK,GAEhBA,GACHL,KAAKY,eAAe,aAAU,gDAG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C,GAAI,aAAa,Q,iCClFrB,0CASe,aAAC1G,GAAoB,OAClC,kBAAC2G,EAAe,CAACf,WAAY,IAAWgB,QACtC,kBAAC,IAAK,CAACC,OAAQ,IAAOC,UAAW9G,EAAM0F,YAI3C,IAAMiB,EAAkB,YAAO,IAAM,CACnCI,cAAe,aAAa,KAC5BC,SAAU,aAAa,S,mHCNV,SAASC,EAAajH,GACnC,OACE,kBAACkH,EAAc,KACb,kBAAC3B,EAAE,KAAEvF,EAAMqC,WACRrC,EAAM6C,cACP,kBAACsE,EAAY,CAACjB,GAAIlG,EAAM6C,aAAc+C,WAAY,IAAiBwB,WAChEpH,EAAMuC,gBAOjB,IAAMgD,EAAK,IAAOc,KAAE,GAClBC,WAAY,SACZ7B,aAAc,aAAa,IAC3BE,UAAW,WACV,MAAsB,CACrBA,UAAW,Q,IAITuC,EAAiB,IAAO1C,MAAG,GAC/B6C,WAAY,SACZC,QAAS,OACTC,cAAe,SACfR,cAAe,aAAa,IAC5BS,WAAY,aAAa,MACxB,MAAsB,CACrBH,WAAY,aACZZ,QAAS,CACPgB,EAAG,aAAa,IAChBC,EAAG,aAAa,M,IAKhBP,EAAe,YAAO,MAAM,GAChCQ,cAAe,aAAa,GAC5BlB,QAAS,CACPgB,EAAG,aAAa,IAChBC,EAAG,KAEJ,MAAsB,CACrBhD,UAAW,aAAa,K,sCCvD5B,kCAAO,IAAMkD,EAAe","file":"assets/20.chunk.454bddb8a650c4163054.js","sourcesContent":["/**\r\n * @ComponentFor ForgotPasswordPage\r\n */\r\n\r\nimport React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport ForgotPasswordPageType from './ForgotPasswordPage.type';\r\nimport { Part } from 'Shared/PageLayout/index';\r\nimport Input from 'Shared/Fields/Text';\r\nimport { connectWithFeedback, ConnectPropType } from 'Shared/Button/Feedback';\r\nimport { pathCombine, postJson, translate, pushState, Breakpoint } from '@avensia/scope';\r\nimport { EpiProperty, epiPropertyValue } from '@avensia/scope-episerver';\r\nimport { ErrorMessage } from 'Shared/FeedbackMessage';\r\nimport { pixelsToUnit } from 'Shared/Style';\r\nimport AccountPanel from 'Account/Panel/AccountPanel';\r\nimport AccountForm from 'Account/Form/AccountForm';\r\nimport { emailPattern } from 'Shared/email-pattern';\r\nimport { minMediumMediaQuery } from 'Shared/Style';\r\nimport MainContainer from 'Shared/MainContainer';\r\nimport connect from 'Shared/connect';\r\n\r\ntype StateType = {\r\n email?: string;\r\n failedMessage?: string;\r\n successMessage?: string;\r\n};\r\n\r\ntype ConnectStateType = {\r\n currentBreakpoint: number;\r\n};\r\n\r\ntype RequiredProps = ForgotPasswordPageType;\r\ntype PropType = RequiredProps & ConnectPropType & ConnectStateType;\r\n\r\nclass ForgotPassword extends React.Component {\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n email: '',\r\n failedMessage: '',\r\n successMessage: '',\r\n };\r\n }\r\n\r\n onSubmit = async () => {\r\n const isMobile = this.props.currentBreakpoint < Breakpoint.Medium;\r\n const isValidEmail = this.validateEmail();\r\n const email = this.state.email.trim();\r\n const url = pathCombine(location.pathname, 'SendResetPasswordLink');\r\n const query = { email };\r\n\r\n if (!email) {\r\n this.setFailMessage(translate('/Account/ForgotPassword/EmailRequiredField'));\r\n }\r\n\r\n if (email && isValidEmail) {\r\n try {\r\n const { success, message } = await postJson(url, query);\r\n if (success) {\r\n if (isMobile) {\r\n window.scroll({ top: 0, left: 0, behavior: 'smooth' });\r\n }\r\n this.setSuccessMessage(epiPropertyValue(this.props.successMessage));\r\n } else {\r\n return Promise.reject(message);\r\n }\r\n } catch (error) {\r\n this.setFailMessage(error);\r\n return Promise.reject(null);\r\n }\r\n } else {\r\n return Promise.reject(null);\r\n }\r\n };\r\n\r\n setFailMessage(failedMessage: string) {\r\n this.setState({ failedMessage, successMessage: '' });\r\n }\r\n\r\n setSuccessMessage(successMessage: string) {\r\n this.setState({ successMessage, failedMessage: '' });\r\n }\r\n\r\n onEmailFieldInput = (e: React.FormEvent) => {\r\n this.setState({\r\n email: (e.target as HTMLInputElement).value,\r\n failedMessage: '',\r\n successMessage: '',\r\n });\r\n };\r\n\r\n validateEmail = () => {\r\n if (!!this.state.email && !emailPattern.test(this.state.email)) {\r\n this.setFailMessage(translate('/Account/ForgotPassword/InvalidEmail'));\r\n return false;\r\n }\r\n return true;\r\n };\r\n\r\n onLoginClick = async () => {\r\n if (!!epiPropertyValue(this.props.bottomLinkPage)) {\r\n return pushState(epiPropertyValue(this.props.bottomLinkPage).url);\r\n }\r\n return Promise.reject(null);\r\n };\r\n\r\n successSendEmailComponent() {\r\n return (\r\n \r\n \r\n {this.state.successMessage.replace('{{email}}', this.state.email)}\r\n \r\n \r\n );\r\n }\r\n\r\n render() {\r\n if (!!this.state.successMessage) {\r\n return this.successSendEmailComponent();\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {epiPropertyValue(this.props.emailLabel)}\r\n \r\n\r\n {!!this.state.failedMessage && {this.state.failedMessage}}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nconst InputLabel = styled.label({\r\n marginLeft: pixelsToUnit(16),\r\n});\r\n\r\nconst InputField = styled(Input, {\r\n paddingLeft: pixelsToUnit(16),\r\n});\r\n\r\nconst InputContainer = styled.div({\r\n marginBottom: pixelsToUnit(40),\r\n});\r\n\r\nconst Error = styled(ErrorMessage, {\r\n marginTop: pixelsToUnit(5),\r\n paddingLeft: pixelsToUnit(16),\r\n});\r\n\r\nconst PartDescription = styled(Part, {\r\n textAlign: 'center',\r\n [minMediumMediaQuery]: {\r\n textAlign: 'left',\r\n },\r\n});\r\n\r\nexport default connectWithFeedback()(\r\n connect(state => ({\r\n currentBreakpoint: state.currentBreakpoint,\r\n }))(ForgotPassword),\r\n);\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport {\r\n connectWithFeedback,\r\n Behavior as ButtonBehavior,\r\n Appearance as ButtonAppearance,\r\n ConnectPropType as FeedbackPropType,\r\n} from 'Shared/Button/Feedback';\r\nimport { whitelilac, mineshaft, pixelsToUnit, minMediumMediaQuery } from 'Shared/Style';\r\nimport Link from 'Shared/Link';\r\n\r\ntype PropType = {\r\n children: any;\r\n buttonCaption: string;\r\n heading?: string;\r\n redirectLabel?: string;\r\n redirectLink?: string;\r\n disabled?: boolean;\r\n customFormStyle?: any;\r\n buttonAction?: () => Promise;\r\n successMessage?: React.ReactNode;\r\n} & StyledProps &\r\n FeedbackPropType;\r\n\r\nexport default styled(\r\n connectWithFeedback({ behavior: ButtonBehavior.KeepEnabled })(\r\n class AccountForm extends React.Component {\r\n onClick = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n return this.props.feedback.push(this.props.buttonAction());\r\n };\r\n render() {\r\n const FeedbackButton = this.props.feedback.Button;\r\n return (\r\n \r\n {!!this.props.heading &&

{this.props.heading}

}\r\n\r\n \r\n {this.props.children}\r\n \r\n {this.props.buttonCaption}\r\n \r\n \r\n\r\n {!!this.props.redirectLink && (\r\n \r\n {this.props.redirectLabel}\r\n \r\n )}\r\n {!!this.props.successMessage && this.props.successMessage}\r\n
\r\n );\r\n }\r\n },\r\n ),\r\n);\r\n\r\nconst RedirectLink = styled(Link, {\r\n color: mineshaft,\r\n textAlign: 'center',\r\n textDecoration: 'underline',\r\n});\r\n\r\nconst H1 = styled.h1({\r\n fontWeight: 'normal',\r\n marginBottom: pixelsToUnit(21),\r\n textAlign: 'center',\r\n [minMediumMediaQuery]: {\r\n textAlign: 'left',\r\n },\r\n});\r\n\r\nconst FormContainer = styled.div({\r\n backgroundColor: whitelilac,\r\n borderRadius: '0.15rem',\r\n padding: {\r\n xy: pixelsToUnit(30),\r\n },\r\n});\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { Main, Basic, Layout, Appearance } from 'Shared/PageLayout';\r\nimport { pixelsToUnit } from 'Shared/Style';\r\n\r\ntype PropType = {\r\n children: React.ReactNode;\r\n};\r\n\r\nexport default (props: PropType) => (\r\n \r\n {props.children}\r\n \r\n);\r\n\r\nconst CustomContainer = styled(Main, {\r\n paddingBottom: pixelsToUnit(100),\r\n maxWidth: pixelsToUnit(1057),\r\n});\r\n","import React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { minMediumMediaQuery, pixelsToUnit } from 'Shared/Style';\r\nimport Button, { Appearance as ButtonAppearance } from 'Shared/Button';\r\n\r\ntype PropType = {\r\n buttonCaption: string;\r\n heading: string;\r\n redirectLink: string;\r\n};\r\n\r\nexport default function AccountPanel(props: PropType) {\r\n return (\r\n \r\n

{props.heading}

\r\n {!!props.redirectLink && (\r\n \r\n {props.buttonCaption}\r\n \r\n )}\r\n
\r\n );\r\n}\r\n\r\nconst H1 = styled.h1({\r\n fontWeight: 'normal',\r\n marginBottom: pixelsToUnit(21),\r\n textAlign: 'center',\r\n [minMediumMediaQuery]: {\r\n textAlign: 'left',\r\n },\r\n});\r\n\r\nconst PanelContainer = styled.div({\r\n alignItems: 'center',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n paddingBottom: pixelsToUnit(70),\r\n paddingTop: pixelsToUnit(28),\r\n [minMediumMediaQuery]: {\r\n alignItems: 'flex-start',\r\n padding: {\r\n x: pixelsToUnit(26),\r\n y: pixelsToUnit(28),\r\n },\r\n },\r\n});\r\n\r\nconst ActionButton = styled(Button, {\r\n letterSpacing: pixelsToUnit(1),\r\n padding: {\r\n x: pixelsToUnit(60),\r\n y: 0,\r\n },\r\n [minMediumMediaQuery]: {\r\n marginTop: pixelsToUnit(20),\r\n },\r\n});\r\n","export const emailPattern = /[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-‌​9-]+)*/;\r\n"],"sourceRoot":""}