= (): JSX.Element | null => {\n const [isAuthenticated, setIsAuthenticated] = useState(false);\n\n useEffect(() => {\n Auth.currentAuthenticatedUser()\n .then(() => setIsAuthenticated(true))\n .catch(() => Auth.federatedSignIn());\n }, []);\n\n return isAuthenticated ? : null;\n};\n\nexport default SSORoute;\n","import React from 'react';\nimport { Link, List, ListItem, Typography } from '@material-ui/core';\n\nconst ItemWithLink = (props: { href: string; children: string }): JSX.Element => {\n return (\n \n \n \n {props.children} {'>'}\n \n \n \n );\n};\n\nconst Disclosures = (): JSX.Element => {\n return (\n \n Privacy \n Ethics statement \n Terms & conditions \n
\n );\n};\n\nexport default Disclosures;\n","import React from 'react';\nimport { Link, List, ListItem, Typography } from '@material-ui/core';\n\nconst Help = (): JSX.Element => {\n return (\n \n \n (800) 242 3837 (option 2) \n \n \n \n \n membersupport@aia.org\n \n \n \n
\n );\n};\n\nexport default Help;\n","import React from 'react';\nimport { ListItem, Typography } from '@material-ui/core';\n\ninterface InfoTileProps {\n title: string;\n divider?: boolean;\n children: JSX.Element;\n}\n\nconst InfoTile = ({ title, divider, children }: InfoTileProps): JSX.Element => {\n return (\n \n \n {title} \n {children}\n
\n \n );\n};\n\nexport default InfoTile;\n","import React from 'react';\nimport { List, ListItem, ListItemText } from '@material-ui/core';\nimport { Chapters } from '../../../data_types/member-order';\n\ninterface MembershipTaxesProps {\n chapters: Chapters;\n}\n\nconst MembershipTaxes = (props: MembershipTaxesProps): JSX.Element => {\n const renderChapterTax = (chapterName: string, deductibility: number): JSX.Element => (\n \n \n \n );\n\n return (\n \n {props.chapters.National?.Deductibility__c\n ? renderChapterTax('National', props.chapters.National.Deductibility__c)\n : null}\n {props.chapters.State?.Deductibility__c\n ? renderChapterTax('State', props.chapters.State.Deductibility__c)\n : null}\n {props.chapters.Local?.Deductibility__c\n ? renderChapterTax('Local', props.chapters.Local.Deductibility__c)\n : null}\n
\n );\n};\n\nexport default MembershipTaxes;\n","import React from 'react';\nimport { Chapters } from '../../../data_types/member-order';\nimport MembershipTaxes from '../../Membership/Taxes/Taxes';\nimport InfoTile from '../InfoTile/InfoTile';\n\ninterface TaxesTileProps {\n chapters?: Chapters;\n}\n\nconst TaxesTile = (props: TaxesTileProps): JSX.Element | null => {\n const showTaxesTile =\n props.chapters &&\n (props.chapters.National?.Deductibility__c ||\n props.chapters.State?.Deductibility__c ||\n props.chapters.Local?.Deductibility__c);\n\n return props.chapters && showTaxesTile ? (\n \n \n \n ) : null;\n};\n\nexport default TaxesTile;\n","import React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\n\ninterface VerticalSplitProps {\n title?: string;\n left: JSX.Element;\n right: JSX.Element;\n}\n\nconst VerticalSplit = (props: VerticalSplitProps): JSX.Element => {\n let titleSection;\n if (props.title) {\n titleSection = (\n \n \n \n {props.title}\n \n \n \n );\n }\n\n return (\n \n {titleSection}\n \n \n {props.left}\n \n \n {props.right}\n \n \n \n );\n};\n\nexport default VerticalSplit;\n","import React from 'react';\nimport { List, ListItem, ListItemText } from '@material-ui/core';\nimport { Contact } from '../../../data_types/member-order';\n\ninterface MembershipMemberInfoProps {\n contact?: Contact;\n}\n\nconst MembershipMemberInfo = (props: MembershipMemberInfoProps): JSX.Element => {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n );\n};\n\nexport default MembershipMemberInfo;\n","import React from 'react';\nimport { List } from '@material-ui/core';\n\ninterface MembershipSidebarProps {\n children: React.ReactNode[] | React.ReactNode;\n}\n\nconst MembershipSidebar = (props: MembershipSidebarProps): JSX.Element => {\n const children = React.Children.toArray(props.children).filter(Boolean);\n\n return (\n \n {React.Children.map(children, (child) => {\n return <>{child}>;\n })}\n
\n );\n};\n\nexport default MembershipSidebar;\n","import { PackageItemsEntity } from '../data_types/member-order';\n\nexport const filterByVisibleOptionalProducts = (\n items?: PackageItemsEntity[] | null,\n): PackageItemsEntity[] | undefined => {\n return items?.filter(\n (item: PackageItemsEntity) =>\n !item.OrderApi__Display_Name__c.startsWith('Installment') &&\n !item.OrderApi__Display_Name__c.startsWith('Supplemental Dues -'),\n );\n};\n","import React from 'react';\nimport { useFormContext } from 'react-hook-form';\n\nconst WithFormContext = (Component: React.ComponentType
): React.FC
=> {\n const ComponentWithFormContext = (props: P): JSX.Element => {\n const methods = useFormContext();\n\n return ;\n };\n\n return ComponentWithFormContext;\n};\n\nexport default WithFormContext;\n","import React from 'react';\nimport { CircularProgress as MuiCircularProgress, withStyles } from '@material-ui/core';\n\nexport interface WithLoadingProps {\n loading?: boolean;\n children?: React.ReactNode;\n}\n\nconst CircularProgress = withStyles({\n root: {\n position: 'absolute',\n },\n})(MuiCircularProgress);\n\n// eslint-disable-next-line react/display-name\nconst WithInsideLoading =
(Component: React.ComponentType
): React.FC
=> ({\n loading,\n ...props\n}: WithLoadingProps): JSX.Element => {\n return loading ? (\n \n {props.children}\n \n \n ) : (\n \n );\n};\n\nexport default WithInsideLoading;\n","import { OrderDues } from '../data_types/member-order';\n\nexport const calculateDuesTotal = (dues: OrderDues | undefined): number => {\n const prices: (number | null | undefined)[] = [dues?.Local?.price, dues?.State?.price, dues?.National?.price];\n return prices.reduce((a: number, b) => a + (b || 0), 0);\n};\n","import { Chapters } from '../data_types/member-order';\n\nexport const chargesSupplementalDues = (\n chapters: Chapters | undefined,\n emeritus: boolean | undefined,\n): boolean => {\n return !!(\n chapters &&\n !emeritus &&\n (chapters.State?.AIA_Charge_Supplemental_dues__c || chapters.Local?.AIA_Charge_Supplemental_dues__c)\n );\n};\n","import React from 'react';\nimport { Paper, PaperProps } from '@material-ui/core';\n\ninterface PaymentLayoutProps extends PaperProps {\n children?: React.ReactNode[] | React.ReactNode;\n}\n\nconst BorderedBox = (props: PaymentLayoutProps): JSX.Element => {\n const { children, ...paperProps } = props;\n return (\n \n {children}\n \n );\n};\n\nexport default BorderedBox;\n","import { makeStyles } from '@material-ui/core';\n\nexport const OneAtLeftStyle = makeStyles(({ breakpoints }) => ({\n root: {\n flexDirection: 'row',\n [breakpoints.down('xs')]: {\n flexDirection: 'column',\n alignItems: 'inherit',\n },\n '&> .MuiGrid-item:first-child': {\n flexGrow: 1,\n },\n },\n}));\n","import React from 'react';\nimport { Grid } from '@material-ui/core';\nimport { OneAtLeftStyle } from './OneAtLeft.style';\n\ninterface OneAtLeftProps extends React.HTMLAttributes {\n children: React.ReactNode[] | React.ReactNode;\n alignItems?: 'flex-start' | 'center' | 'flex-end';\n}\n\nconst OneAtLeft = (props: OneAtLeftProps): JSX.Element => {\n const classes = OneAtLeftStyle();\n\n return (\n \n {Array.isArray(props.children)\n ? props.children?.map((item, index) => (\n \n {item}\n \n ))\n : null}\n \n );\n};\n\nexport default OneAtLeft;\n","import { makeStyles } from '@material-ui/core';\n\nexport const TitledTableCellStyle = makeStyles({\n head: {\n padding: '12px 16px 5px 16px',\n },\n});\n","import React, { cloneElement } from 'react';\nimport { Table, TableHead, TableRow, TableBody, TableCell, Typography } from '@material-ui/core';\nimport { TitledTableCellStyle } from './TitledTable.style';\n\ninterface TitledTableProps {\n items: object[];\n title: string;\n children?: JSX.Element;\n}\n\nconst TitledTable = (props: TitledTableProps): JSX.Element | null => {\n const classes = TitledTableCellStyle();\n\n return (\n \n \n \n \n {props.title} \n \n \n \n \n {props.items.map((item) => {\n return props.children ? cloneElement(props.children, item) : null;\n })}\n \n
\n );\n};\n\nexport default TitledTable;\n","export const formatNumber = (num: number | undefined): string => {\n if (num) {\n return '$ ' + num.toFixed(2).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,');\n }\n\n return '$ 0';\n};\n","import { makeStyles } from '@material-ui/core';\n\nexport const OrderAdditionalFeesTableItemCellStyle = makeStyles({\n root: {\n padding: '5px 16px',\n height: '43.5px',\n '&:last-of-type': {\n textAlign: 'right',\n },\n },\n});\n","import React from 'react';\nimport { TableRow, TableCell } from '@material-ui/core';\nimport { formatNumber } from '../../../../../utils/format-number';\nimport { OrderAdditionalFeesTableItemCellStyle } from './Item.style';\n\ninterface OrderAdditionalFeesTableItemProps {\n id?: string;\n name?: string;\n price?: number;\n}\n\nconst OrderAdditionalFeesTableItem = (props: OrderAdditionalFeesTableItemProps): JSX.Element => {\n const classes = OrderAdditionalFeesTableItemCellStyle();\n return (\n \n {props.name} \n {formatNumber(props.price)} \n \n );\n};\n\nexport default OrderAdditionalFeesTableItem;\n","import React from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport { PackageItemsEntity } from '../../../../data_types/member-order';\nimport { INSTALLMENT_ADMINISTRATION_FEE_NAME } from '../../../../utils/constants';\nimport TitledTable from '../../../Common/TitledTable/TitledTable';\nimport OrderAdditionalFeesTableItem from './Item/Item';\n\ninterface OrderAdditionalFeesTableProps {\n optionalProducts?: PackageItemsEntity[] | null;\n defaultSubscriptionPlanId?: string;\n formMethods?: UseFormMethods;\n}\n\nconst OrderAdditionalFeesTable = (props: OrderAdditionalFeesTableProps): JSX.Element | null => {\n const subscriptionPlanId = useWatch({\n control: props.formMethods?.control,\n name: 'subscriptionPlanId',\n defaultValue: props.defaultSubscriptionPlanId,\n });\n\n const optionalProducts = props.optionalProducts\n ?.filter((item: PackageItemsEntity) =>\n item.OrderApi__Display_Name__c.startsWith(INSTALLMENT_ADMINISTRATION_FEE_NAME),\n )\n .map((item: PackageItemsEntity) => {\n return {\n id: item.Id,\n key: item.Id,\n name: item.OrderApi__Display_Name__c,\n price: item.OrderApi__Price__c,\n };\n });\n\n const show =\n subscriptionPlanId !== props.defaultSubscriptionPlanId && optionalProducts && optionalProducts.length > 0;\n\n return show && optionalProducts ? (\n \n \n \n ) : null;\n};\n\nexport default OrderAdditionalFeesTable;\n","import React from 'react';\nimport { Paper as MuiPaper, withStyles } from '@material-ui/core';\nimport WarningIcon from '@material-ui/icons/Warning';\nimport theme from '../../../utils/theme';\n\ninterface AlertProps extends React.HTMLAttributes {\n message: string;\n hideIcon?: boolean;\n}\n\nconst Paper = withStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n paddingBottom: '10px',\n color: theme.palette.error.main,\n border: 'none',\n },\n})(MuiPaper);\n\nconst AlertIcon = withStyles({\n root: {\n fontSize: '2.5em',\n paddingRight: '10px',\n },\n})(WarningIcon);\n\nconst Alert = (props: AlertProps): JSX.Element => {\n const { message, hideIcon, ...otherProps } = props;\n return (\n \n {!hideIcon && }\n {message}\n \n );\n};\n\nexport default Alert;\n","import React, { memo } from 'react';\nimport { UseFormMethods } from 'react-hook-form';\nimport Alert from '../../Common/Alert/Alert';\n\ninterface OrderAlertProps {\n formMethods?: UseFormMethods;\n}\n\ninterface OrderAlertMemoizedProps {\n hasErrors: boolean;\n}\n\nconst OrderAlertMemoized = memo(\n (props: OrderAlertMemoizedProps) => {\n return props.hasErrors ? : null;\n },\n (prev: OrderAlertMemoizedProps, next: OrderAlertMemoizedProps) => {\n return prev.hasErrors === next.hasErrors;\n },\n);\nOrderAlertMemoized.displayName = 'OrderAlertMemoized';\n\nconst OrderAlert = (props: OrderAlertProps): JSX.Element | null => {\n const hasErrors: boolean = props.formMethods?.errors ? Object.keys(props.formMethods?.errors).length > 0 : false;\n\n return ;\n};\n\nexport default OrderAlert;\n","import Link from '@material-ui/core/Link/Link';\nimport Modal from 'components/Common/Modal/Modal';\nimport React from 'react';\n\ninterface ArchiPACModalProps {\n showAutoRenewModal: boolean;\n setShowAutoRenewModal: React.Dispatch>;\n}\n\nconst ArchiPACModal = ({ showAutoRenewModal, setShowAutoRenewModal }: ArchiPACModalProps): JSX.Element => {\n const modalOptions = {\n isOpen: showAutoRenewModal,\n title: 'ArchiPAC Donation Note',\n content: (\n <>\n ArchiPAC contributions are for one year only and will not be enrolled in the AIA Automatic Membership\n Renewal Program. You can contribute to ArchiPAC anytime during the year by visiting the{' '}\n Advocacy page and logging in to your{' '}\n AIA account.\n >\n ),\n onCancel: (): void => {\n setShowAutoRenewModal(false);\n },\n cancelActionName: 'Close',\n };\n return ;\n};\n\nexport default ArchiPACModal;\n","import { makeStyles } from '@material-ui/core';\n\nexport const CheckboxStyle = makeStyles((theme) => ({\n root: {\n alignSelf: 'flex-start',\n '&$checked': {\n color: theme.palette.error.main,\n },\n },\n checked: {},\n}));\n","import React from 'react';\nimport { UseFormMethods } from 'react-hook-form';\nimport { FormControlLabel, Checkbox as MuiCheckbox } from '@material-ui/core';\nimport { CheckboxProps as MuiCheckboxProps } from '@material-ui/core/Checkbox/Checkbox';\nimport { CheckboxStyle } from './Checkbox.style';\n\ninterface CheckboxProps extends MuiCheckboxProps {\n formMethods?: UseFormMethods;\n label: JSX.Element | string;\n}\n\nconst Checkbox = (props: CheckboxProps): JSX.Element => {\n const classes = CheckboxStyle();\n const { formMethods, label, ...inputProps } = props;\n\n return (\n \n }\n label={label}\n />\n );\n};\n\nexport default Checkbox;\n","import { makeStyles } from '@material-ui/core';\n\nexport const TooltipStyle = makeStyles((theme) => ({\n tooltip: {\n backgroundColor: theme.palette.secondary.light,\n color: theme.palette.primary.dark,\n fontSize: theme.typography.caption.fontSize,\n },\n}));\n\nexport const InfoIconStyle = makeStyles(() => ({\n root: {\n '& > svg': {\n margin: '10px',\n },\n fontSize: '20px',\n verticalAlign: 'text-bottom',\n },\n}));\n","import React from 'react';\nimport { Tooltip as MaterialTooltip } from '@material-ui/core';\nimport InfoIcon from '@material-ui/icons/Info';\nimport { InfoIconStyle, TooltipStyle } from './Tooltip.style';\n\ninterface TooltipProps {\n title: string;\n}\n\nconst Tooltip = (props: TooltipProps): JSX.Element => {\n const tooltipClasses = TooltipStyle();\n const infoIconClasses = InfoIconStyle();\n\n return (\n \n \n \n );\n};\n\nexport default Tooltip;\n","import React from 'react';\nimport { Typography, makeStyles } from '@material-ui/core';\n\ninterface DisclaimerProps {\n grayedOut?: boolean;\n message: string | React.ReactElement;\n note?: string;\n}\n\nconst cssStyles = makeStyles((theme) => ({\n root: {\n textAlign: 'justify',\n textJustify: 'inter-word',\n marginTop: '12px',\n },\n grayedOut: {\n color: theme.palette.grey[500],\n },\n}));\n\nconst Disclaimer = (props: DisclaimerProps): JSX.Element => {\n const styles = cssStyles();\n\n return (\n \n {props.note ? (\n <>\n Note: {props.note} \n \n >\n ) : null}\n {props.message} \n
\n );\n};\n\nexport default Disclaimer;\n","import React from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport { Link } from '@material-ui/core';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport Checkbox from '../../../Common/Checkbox/Checkbox';\nimport Tooltip from 'components/Common/Tooltip/Tooltip';\nimport Disclaimer from 'components/Common/Disclaimer/Disclaimer';\n\nconst FormCheckbox = WithFormContext(Checkbox);\ninterface OrderAutoRenewCheckboxProps {\n defaultSubscriptionPlanId?: string;\n userHasSubscriptionPlanAvailable?: boolean;\n formMethods?: UseFormMethods;\n}\n\nconst OrderAutoRenewCheckbox = (props: OrderAutoRenewCheckboxProps): JSX.Element | null => {\n const subscriptionPlanId = useWatch({\n control: props.formMethods?.control,\n name: 'subscriptionPlanId',\n defaultValue: props.defaultSubscriptionPlanId,\n });\n const autoRenewIsChecked = useWatch({\n control: props.formMethods?.control,\n name: 'autoRenew',\n defaultValue: false,\n });\n const show = subscriptionPlanId === props.defaultSubscriptionPlanId;\n const tooltipText =\n 'If you opt for autorenewal, you will not be able to enroll in the monthly installment program. Each renewal cycle allows for only one payment program selection.';\n const label = (\n <>\n AIA Membership Autorenewal: I agree to enroll in AIA's Automatic Membership Dues Renewal Program. By\n selecting this option, I acknowledge and agree to the{' '}\n \n terms & conditions\n {' '}\n of the program. {props.userHasSubscriptionPlanAvailable ? : null}\n >\n );\n const disclaimerMessage = (\n <>\n Your autorenewal will be charged on December 31. You can cancel your enrollment at any time by logging in to\n My Account at{' '}\n \n me.aia.org\n \n . Select Membership > Manage My Autorenewal > Cancel. You may also cancel by contacting the Member\n Support Center at (800) 242-3837, option 2, or{' '}\n \n membersupport@aia.org\n \n . The program's terms and conditions are available on our website{' '}\n \n here\n \n .\n >\n );\n\n return show ? (\n <>\n \n {autoRenewIsChecked && }\n >\n ) : null;\n};\n\nexport default OrderAutoRenewCheckbox;\n","import React, { cloneElement, memo } from 'react';\nimport { FieldErrors, UseFormMethods } from 'react-hook-form';\nimport { FormControl, FormHelperText } from '@material-ui/core';\n\ntype WithErrorProps = {\n name?: string;\n required?: boolean;\n formMethods?: UseFormMethods;\n};\n\ntype FormControlMemoProps = {\n error: FieldErrors;\n required?: boolean;\n children: JSX.Element;\n};\n\nconst FormControlMemo = memo(\n (props: FormControlMemoProps) => {\n const hasError = !!props.error;\n\n return (\n \n {cloneElement(props.children, { 'aria-invalid': hasError })}\n {hasError && {props.error.message} }\n \n );\n },\n (prev: FormControlMemoProps, next: FormControlMemoProps) => {\n return prev.error === next.error && prev.required === next.required;\n },\n);\nFormControlMemo.displayName = 'FormControlMemo';\n\n// eslint-disable-next-line react/display-name\nconst WithErrorHelper = (Component: React.ComponentType
): React.FC
=> ({\n name,\n formMethods,\n required,\n ...props\n}: P & WithErrorProps): JSX.Element => {\n const error = name ? formMethods?.errors?.[name] : null;\n\n return (\n \n \n \n );\n};\n\nexport default WithErrorHelper;\n","import React from 'react';\nimport { Typography, makeStyles } from '@material-ui/core';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport WithErrorHelper from '../../../../hocs/WithErrorHelper/WithErrorHelper';\nimport Checkbox from '../../../Common/Checkbox/Checkbox';\nimport Tooltip from '../../../Common/Tooltip/Tooltip';\nimport { MEMBERSHIP_TYPE_ALLIED } from '../../../../utils/constants';\n\ninterface OrderConfirmLicenseCheckboxProps {\n membershipType?: string;\n}\n\nconst CheckboxWithError = WithFormContext(WithErrorHelper(Checkbox));\n\nexport const labelStyle = makeStyles({\n root: {\n marginRight: '5px',\n },\n});\n\nconst OrderConfirmLicenseCheckbox = (props: OrderConfirmLicenseCheckboxProps): JSX.Element | null => {\n const labelClasses = labelStyle();\n const show = props.membershipType === MEMBERSHIP_TYPE_ALLIED;\n\n const disclaimer = `Those with established professional reputations who are registered to practice their professions\n where such requirements exist, or persons who are employed outside of architectural practice but are involved\n in positions allied to the field of architecture. Individual Allied members may include engineers, planners,\n landscape architects, sculptors, muralists, artist, and others in government, education, journalism, manufacturing,\n industry and/or other fields allied to architecture.`;\n\n const label = (\n <>\n I attest that I meet the requirements for Allied Membership of the AIA.{' '}\n \n *\n \n \n >\n );\n\n return show ? (\n <>\n \n >\n ) : null;\n};\n\nexport default OrderConfirmLicenseCheckbox;\n","import React from 'react';\nimport { Typography } from '@material-ui/core';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport WithErrorHelper from '../../../../hocs/WithErrorHelper/WithErrorHelper';\nimport Checkbox from '../../../Common/Checkbox/Checkbox';\nimport { MEMBERSHIP_TYPE_ARCHITECT } from '../../../../utils/constants';\n\ninterface OrderConfirmLicenseCheckboxProps {\n membershipType?: string;\n}\n\nconst CheckboxWithError = WithFormContext(WithErrorHelper(Checkbox));\n\nconst OrderConfirmLicenseCheckbox = (props: OrderConfirmLicenseCheckboxProps): JSX.Element | null => {\n const show = props.membershipType === MEMBERSHIP_TYPE_ARCHITECT;\n\n const label = (\n <>\n I attest that I am currently licensed to practice architecture in the U.S.{' '}\n \n *\n \n >\n );\n\n return show ? (\n \n ) : null;\n};\n\nexport default OrderConfirmLicenseCheckbox;\n","import React from 'react';\nimport { Link, Typography } from '@material-ui/core';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport WithErrorHelper from '../../../../hocs/WithErrorHelper/WithErrorHelper';\nimport Checkbox from '../../../Common/Checkbox/Checkbox';\n\nconst CheckboxWithError = WithFormContext(WithErrorHelper(Checkbox));\n\nconst OrderConfirmTermsCheckbox = (): JSX.Element | null => {\n const label = (\n <>\n I agree to the{' '}\n \n AIA Membership Terms and Conditions\n {' '}\n \n *\n \n >\n );\n\n return ;\n};\n\nexport default OrderConfirmTermsCheckbox;\n","import { makeStyles } from '@material-ui/core';\n\nexport const DuesTableItemCellStyle = makeStyles({\n root: {\n padding: '12px 16px',\n '&:first-of-type': {\n paddingLeft: '27px',\n },\n '&:last-of-type': {\n textAlign: 'right',\n },\n },\n});\n","import React from 'react';\nimport { TableRow, TableCell } from '@material-ui/core';\nimport { formatNumber } from '../../../../../utils/format-number';\nimport { DuesTableItemCellStyle } from './Item.style';\n\ninterface OrderDuesTableItemProps {\n name?: string;\n price?: number;\n}\n\nconst OrderDuesTableItem = (props: OrderDuesTableItemProps): JSX.Element => {\n const classes = DuesTableItemCellStyle();\n\n return (\n \n {props.name} \n {formatNumber(props.price)} \n \n );\n};\n\nexport default OrderDuesTableItem;\n","import React from 'react';\nimport { OrderDues } from '../../../../data_types/member-order';\nimport TitledTable from '../../../Common/TitledTable/TitledTable';\nimport OrderDuesTableItem from './Item/Item';\n\ninterface OrderDuesTableProps {\n dues?: OrderDues;\n}\n\nconst OrderDuesTable = (props: OrderDuesTableProps): JSX.Element => {\n const chapterItems = [];\n if (props.dues) {\n chapterItems.push({ key: 'national', name: props.dues?.National.name, price: props.dues?.National.price });\n props.dues.State &&\n chapterItems.push({ key: 'state', name: props.dues?.State?.name, price: props.dues?.State?.price });\n props.dues.Local &&\n chapterItems.push({ key: 'local', name: props.dues?.Local?.name, price: props.dues?.Local?.price });\n }\n\n return (\n \n \n \n );\n};\n\nexport default OrderDuesTable;\n","import React from 'react';\nimport { Typography } from '@material-ui/core';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport WithErrorHelper from '../../../../hocs/WithErrorHelper/WithErrorHelper';\nimport Checkbox from '../../../Common/Checkbox/Checkbox';\n\ninterface OrderInstallmentsCheckboxProps {\n defaultSubscriptionPlanId?: string;\n formMethods?: UseFormMethods;\n}\n\nconst CheckboxWithError = WithFormContext(WithErrorHelper(Checkbox));\n\nconst OrderInstallmentsCheckbox = (props: OrderInstallmentsCheckboxProps): JSX.Element | null => {\n const subscriptionPlanId = useWatch({\n control: props.formMethods?.control,\n name: 'subscriptionPlanId',\n defaultValue: props.defaultSubscriptionPlanId,\n });\n\n const show = subscriptionPlanId !== props.defaultSubscriptionPlanId;\n\n const installmentsLabel = (\n <>\n By clicking the checkbox you agree to pay all installments until membership is paid in full. You will be\n charged today and the last day of each month. You must use a credit card for installment payments. Only\n membership dues can be paid in installments.{' '}\n \n *\n \n >\n );\n\n return show ? (\n \n ) : null;\n};\n\nexport default OrderInstallmentsCheckbox;\n","import { makeStyles } from '@material-ui/core';\n\nexport const SelectStyle = makeStyles({\n root: {\n width: '100%',\n },\n});\n","import React, { ReactNode } from 'react';\nimport { FormControl, InputLabel, Select as MuiSelect } from '@material-ui/core';\nimport { SelectProps as MuiSelectProps } from '@material-ui/core/Select/Select';\nimport { SelectStyle } from './Select.style';\n\ninterface SelectProps extends MuiSelectProps {\n label: string;\n required?: boolean;\n children?: ReactNode[] | ReactNode;\n}\n\nconst Select = (props: SelectProps): JSX.Element => {\n const selectClasses = SelectStyle();\n const { label, children, ...otherProps } = props;\n\n return (\n \n \n {label} {props.required && * }\n \n \n {children}\n \n \n );\n};\n\nexport default Select;\n","import React from 'react';\nimport { UseFormMethods, Controller } from 'react-hook-form';\n\ntype ControllerProps = {\n name: string;\n defaultValue?: string | number | undefined | null;\n formMethods?: UseFormMethods;\n};\n\nconst WithController =
(Component: React.ComponentType
): React.FC
=> {\n const ComponentWithController = ({ name, formMethods, ...props }: P & ControllerProps): JSX.Element => {\n return (\n } />\n );\n };\n\n return ComponentWithController;\n};\n\nexport default WithController;\n","import { makeStyles } from '@material-ui/core';\n\nexport const InstalmentsSelectStyle = makeStyles(({ breakpoints }) => ({\n root: {\n [breakpoints.up('sm')]: {\n width: '100px',\n },\n },\n}));\n","import React from 'react';\nimport { MenuItem } from '@material-ui/core';\nimport { SubscriptionPlan } from '../../../../data_types/member-order';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport SelectComponent from '../../../Common/Select/Select';\nimport WithController from '../../../../hocs/WithController/WithController';\nimport { InstalmentsSelectStyle } from './Select.style';\n\ninterface OrderInstallmentsSelectProps {\n subscriptionPlans?: SubscriptionPlan[];\n}\n\nconst Select = WithFormContext(WithController(SelectComponent));\n\nconst OrderInstallmentsSelect = (props: OrderInstallmentsSelectProps): JSX.Element | null => {\n const instalmentsSelectClasses = InstalmentsSelectStyle();\n\n const sortedSubscriptionPlans = props.subscriptionPlans?.sort(\n (a, b) => (a.OrderApi__Number_Of_Installments__c || 1) - (b.OrderApi__Number_Of_Installments__c || 1),\n );\n\n return (\n \n {sortedSubscriptionPlans?.map((subscription: SubscriptionPlan) => (\n \n {subscription.OrderApi__Number_Of_Installments__c || 'Pay in full'}\n \n ))}\n \n );\n};\n\nexport default OrderInstallmentsSelect;\n","import { makeStyles } from '@material-ui/core';\n\nexport const OptionalProductsItemCellStyle = makeStyles({\n root: {\n padding: '12px 16px',\n '&:last-of-type': {\n textAlign: 'right',\n minWidth: '110px',\n },\n verticalAlign: 'top',\n },\n});\n","import React from 'react';\nimport { TableRow, TableCell } from '@material-ui/core';\nimport WithFormContext from 'hocs/WithFormContext/WithFormContext';\nimport CheckboxComponent from 'components/Common/Checkbox/Checkbox';\nimport { formatNumber } from 'utils/format-number';\nimport { OptionalProductsItemCellStyle } from './Item.style';\nimport Disclaimer from 'components/Common/Disclaimer/Disclaimer';\n\ninterface OrderOptionalProductsTableItemComponentProps {\n id: string;\n name: string;\n price: number;\n label: string;\n disclaimer?: {\n message: string;\n note?: string;\n };\n onChange: () => void;\n checked: boolean;\n disabled?: boolean;\n}\n\nconst Checkbox = WithFormContext(CheckboxComponent);\n\nconst OrderOptionalProductsTableItemComponent = (props: OrderOptionalProductsTableItemComponentProps): JSX.Element => {\n const cellClasses = OptionalProductsItemCellStyle();\n\n return (\n \n \n props.onChange()}\n checked={!!props.checked}\n disabled={props.disabled}\n />\n {props.disclaimer ? (\n \n ) : null}\n \n \n {formatNumber(props.price)} \n \n \n );\n};\n\nexport default OrderOptionalProductsTableItemComponent;\n","import React, { useEffect, useState } from 'react';\nimport OrderOptionalProductsTableItemComponent from './ItemComponent';\ninterface OrderOptionalProductsTableItemProps {\n id?: string;\n name?: string;\n price?: number;\n label?: string;\n checkedByDefault?: boolean;\n disabled?: boolean;\n disclaimer?: {\n message: string;\n note?: string;\n };\n}\nconst OrderOptionalProductsTableItem = (props: OrderOptionalProductsTableItemProps): JSX.Element => {\n const [checkboxChecked, setCheckboxChecked] = useState(false);\n useEffect(() => {\n if (props.checkedByDefault) {\n setCheckboxChecked(true);\n }\n }, [props.checkedByDefault]);\n const handleCheck = (): void => setCheckboxChecked(!checkboxChecked);\n return (\n \n );\n};\nexport default OrderOptionalProductsTableItem;\n","import React from 'react';\nimport { PackageItemsEntity } from '../../../../data_types/member-order';\nimport TitledTable from '../../../Common/TitledTable/TitledTable';\nimport OrderOptionalProductsTableItem from './Item/Item';\nimport { generateOptionalCheckboxState } from 'utils/generate-optional-checkbox-state';\nimport { useMembershipInfo } from 'hooks/use-membership-info';\nimport { filterByVisibleOptionalProducts } from 'utils/filterByVisibleOptionalProducts';\n\ninterface OrderOptionalProductsTableProps {\n optionalProducts?: PackageItemsEntity[] | null;\n}\ninterface IterableProductInterface {\n key: string;\n id: string;\n name: string;\n price: number;\n label: string;\n checkedByDefault: boolean;\n disclaimer: React.ReactNode | undefined;\n disabled: boolean;\n}\n\nconst OrderOptionalProductsTable = (props: OrderOptionalProductsTableProps): JSX.Element | null => {\n const membershipInfo = useMembershipInfo();\n\n const generateProductOptions = (item: PackageItemsEntity, itemIndex: number): IterableProductInterface => {\n const checkboxData = generateOptionalCheckboxState({\n productName: item.OrderApi__Display_Name__c,\n membershipInfo: membershipInfo.membershipInfo,\n });\n\n return {\n key: item.Id,\n id: item.Id,\n name: `additionalPackages[${itemIndex}].${item.Id}`,\n price: item.OrderApi__Price__c,\n label: item.OrderApi__Display_Name__c,\n checkedByDefault: checkboxData.checked,\n disclaimer: checkboxData.disclaimer,\n disabled: checkboxData.disabled,\n };\n };\n\n const optionalProducts = filterByVisibleOptionalProducts(\n props.optionalProducts,\n )?.map((item: PackageItemsEntity, index: number) => generateProductOptions(item, index));\n\n const show = optionalProducts && optionalProducts.length > 0;\n\n return show && optionalProducts ? (\n \n \n \n ) : null;\n};\n\nexport default OrderOptionalProductsTable;\n","import { MemberOrderResponse } from 'data_types/member-order';\nimport {\n ARCHIPAC_DONATION_DISCLAIMER,\n ARCHIPAC_DONATION_NOTE,\n MEMBERSHIP_TYPE_ASSOCIATE,\n MEMBERSHIP_TYPE_INTL_ASSOCIATE,\n ORLANDO_FOUNDATION_FOR_ARCHITECTURE_DISCLAIMER,\n PARTIAL_AIAU_SUBSCRIPTION_OPTIONAL_ITEM_NAME,\n SAN_FRANCISCO_SPECIAL_ASSESSMENT_DISCLAIMER,\n TAMPA_BAY_CENTER_FOR_ARCHITECTURE_DISCLAIMER,\n} from 'utils/constants';\n\ntype OptionalProductCheckboxData = {\n checked: boolean;\n disclaimer?: {\n message: string;\n note?: string;\n };\n disabled: boolean;\n};\n\ntype Props = {\n membershipInfo: MemberOrderResponse | null;\n productName: string;\n};\n\nexport const generateOptionalCheckboxState = ({ membershipInfo, productName }: Props): OptionalProductCheckboxData => {\n const packageItems = membershipInfo?.related?.packageItems;\n const contactData = membershipInfo?.contact;\n\n let needToPrecheckDonationForUser;\n\n switch (productName) {\n case 'ArchiPAC donation':\n const storedValue = sessionStorage.getItem('isArchiPACPrechecked');\n const isPrechecked = storedValue ? JSON.parse(storedValue) : false;\n const isPacDonationActive = !!membershipInfo?.chapters?.State?.AIA_Require_PAC__c || isPrechecked;\n\n return {\n checked: isPacDonationActive,\n disclaimer: {\n message: ARCHIPAC_DONATION_DISCLAIMER,\n note: ARCHIPAC_DONATION_NOTE,\n },\n disabled: false,\n };\n case 'Orlando Foundation for Architecture':\n needToPrecheckDonationForUser = packageItems?.find((item) => item.OrderApi__Display_Name__c === productName)\n ?.AIA_Require_Item__c;\n\n return {\n checked: !!needToPrecheckDonationForUser,\n disclaimer: {\n message: ORLANDO_FOUNDATION_FOR_ARCHITECTURE_DISCLAIMER,\n },\n disabled: false,\n };\n case 'Special Assessment for the Center for Architecture + Design':\n let canOptionalBeUnchecked = false;\n canOptionalBeUnchecked = [MEMBERSHIP_TYPE_ASSOCIATE, MEMBERSHIP_TYPE_INTL_ASSOCIATE].includes(\n contactData?.membershipType as string,\n );\n canOptionalBeUnchecked = canOptionalBeUnchecked || !!contactData?.emeritus;\n\n needToPrecheckDonationForUser = packageItems?.find((item) => item.OrderApi__Display_Name__c === productName)\n ?.AIA_Require_Item__c;\n\n needToPrecheckDonationForUser = needToPrecheckDonationForUser && !canOptionalBeUnchecked;\n return {\n checked: !!needToPrecheckDonationForUser,\n disclaimer: {\n message: SAN_FRANCISCO_SPECIAL_ASSESSMENT_DISCLAIMER,\n },\n disabled: !canOptionalBeUnchecked,\n };\n case 'Tampa Bay Center for Architecture & Design':\n needToPrecheckDonationForUser = packageItems?.find((item) => item.OrderApi__Display_Name__c === productName)\n ?.AIA_Require_Item__c;\n return {\n checked: !!needToPrecheckDonationForUser,\n disclaimer: {\n message: TAMPA_BAY_CENTER_FOR_ARCHITECTURE_DISCLAIMER,\n },\n disabled: false,\n };\n default:\n // Handle partial matches within the default case\n if (productName.includes(PARTIAL_AIAU_SUBSCRIPTION_OPTIONAL_ITEM_NAME)) {\n const storedValue = sessionStorage.getItem('isAiauPrechecked');\n const isPrechecked = storedValue ? JSON.parse(storedValue) : false;\n const disclaimerText = packageItems?.find((item) =>\n item.OrderApi__Display_Name__c.includes(PARTIAL_AIAU_SUBSCRIPTION_OPTIONAL_ITEM_NAME),\n )?.AIA_Help_Text__c;\n return {\n checked: isPrechecked,\n disclaimer: disclaimerText\n ? {\n message: disclaimerText,\n }\n : undefined,\n disabled: false,\n };\n }\n\n // Handle unknown cases\n return {\n checked: false,\n disclaimer: undefined,\n disabled: false,\n };\n }\n};\n","import { makeStyles } from '@material-ui/core';\n\nexport const BorderedBoxStyle = makeStyles({\n root: {\n padding: '16px',\n marginBottom: '25px',\n '& > fieldset > .Mui-error': {\n paddingLeft: '16px',\n },\n },\n});\n\nexport const MarginTopStyle = makeStyles({\n root: {\n marginTop: '30px',\n },\n});\n\nexport const ButtonRowStyle = makeStyles(({ breakpoints }) => ({\n root: {\n [breakpoints.down('xs')]: {\n '&> :nth-child(2)': {\n order: -1,\n },\n },\n },\n}));\n","import React from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport WithInsideLoading, { WithLoadingProps } from '../../../../hocs/WithInsideLoading/WithInsideLoading';\nimport ArrowedButton, { ArrowedButtonProps } from '../../../Common/ArrowedButton/ArrowedButton';\n\ninterface OrderPayOfflineButtonProps extends WithLoadingProps, ArrowedButtonProps {\n formMethods?: UseFormMethods;\n defaultSubscriptionPlanId: string | undefined;\n}\n\nconst ArrowedButtonWithLoading = WithInsideLoading(ArrowedButton);\n\nconst OrderPayOfflineButton = ({\n defaultSubscriptionPlanId,\n disabled,\n formMethods,\n ...orderButtonProps\n}: OrderPayOfflineButtonProps): JSX.Element => {\n const subscriptionPlanId = useWatch({\n control: formMethods?.control,\n name: 'subscriptionPlanId',\n defaultValue: defaultSubscriptionPlanId,\n });\n\n disabled = disabled || subscriptionPlanId !== defaultSubscriptionPlanId;\n\n return ;\n};\n\nexport default OrderPayOfflineButton;\n","import { makeStyles } from '@material-ui/core';\n\nexport const RadioStyle = makeStyles((theme) => ({\n root: {\n '&$checked': {\n color: theme.palette.error.main,\n },\n },\n checked: {},\n}));\n\nexport const FormControlLabelStyle = makeStyles((theme) => ({\n label: theme.typography.h5,\n}));\n","import React from 'react';\nimport { UseFormMethods } from 'react-hook-form';\nimport { FormControlLabel, Radio as MuiRadio } from '@material-ui/core';\nimport { RadioProps as MuiRadioProps } from '@material-ui/core/Radio/Radio';\nimport { RadioStyle, FormControlLabelStyle } from './Radio.style';\n\ninterface RadioProps extends MuiRadioProps {\n formMethods?: UseFormMethods;\n label: JSX.Element | string;\n}\n\nconst Radio = (props: RadioProps): JSX.Element => {\n const radioClasses = RadioStyle();\n const formControlLabelClasses = FormControlLabelStyle();\n const { formMethods, label, style, ...inputProps } = props;\n\n return (\n \n }\n label={label}\n />\n );\n};\n\nexport default Radio;\n","import React, { ReactNode } from 'react';\nimport { RadioGroup as MuiRadioGroup } from '@material-ui/core';\nimport { RadioGroupProps as MuiRadioGroupProps } from '@material-ui/core/RadioGroup/RadioGroup';\nimport { UseFormMethods } from 'react-hook-form';\n\ninterface RadioGroupProps extends MuiRadioGroupProps {\n formMethods?: UseFormMethods;\n children?: ReactNode[] | ReactNode;\n}\n\nconst RadioGroup = (props: RadioGroupProps): JSX.Element => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { children, formMethods, ...radioGroupProps } = props;\n return {children} ;\n};\n\nexport default RadioGroup;\n","import { makeStyles } from '@material-ui/core';\n\nexport const MemberTypeRadioGroupStyle = makeStyles({\n root: {\n padding: '16px 16px 0 16px',\n },\n});\n","import React from 'react';\nimport WithErrorHelper from '../../../../hocs/WithErrorHelper/WithErrorHelper';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport {\n SUPPLEMENTAL_DUES_OPTIONS_DESIGNATE_MEMBER,\n SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM,\n SUPPLEMENTAL_DUES_OPTIONS_NON_SOLE_PRACTITIONER,\n SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER,\n} from '../../../../utils/constants';\nimport RadioComponent from '../../../Common/Radio/Radio';\nimport RadioGroup from '../../../Common/RadioGroup/RadioGroup';\nimport { MemberTypeRadioGroupStyle } from './MemberType.style';\n\nconst RadioGroupWithError = WithFormContext(WithErrorHelper(RadioGroup));\nconst Radio = WithFormContext(RadioComponent);\n\nconst SUPPLEMENTAL_DUES_OPTIONS = [\n {\n label: SUPPLEMENTAL_DUES_OPTIONS_NON_SOLE_PRACTITIONER,\n value: SUPPLEMENTAL_DUES_OPTIONS_NON_SOLE_PRACTITIONER,\n },\n {\n label: SUPPLEMENTAL_DUES_OPTIONS_DESIGNATE_MEMBER,\n value: SUPPLEMENTAL_DUES_OPTIONS_DESIGNATE_MEMBER,\n },\n {\n label: SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER,\n value: SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER,\n },\n {\n label: SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM,\n value: SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM,\n },\n];\n\nconst OrderSuppDuesMemberType = (): JSX.Element => {\n const classes = MemberTypeRadioGroupStyle();\n return (\n \n {SUPPLEMENTAL_DUES_OPTIONS.map((option) => (\n \n ))}\n \n );\n};\n\nexport default OrderSuppDuesMemberType;\n","import React from 'react';\nimport { UseFormMethods } from 'react-hook-form';\nimport { TextField, StandardTextFieldProps } from '@material-ui/core';\n\ninterface InputProps extends Omit {\n formMethods?: UseFormMethods;\n variant?: 'filled' | 'standard';\n}\n\nconst Input = (props: InputProps): JSX.Element => {\n const { formMethods, ...otherProps } = props;\n return (\n \n );\n};\n\nexport default Input;\n","import { makeStyles } from '@material-ui/core';\n\nexport const MemberResponsibleStyle = makeStyles({\n root: {\n marginLeft: '24px',\n marginBottom: '16px',\n },\n});\n","import React from 'react';\nimport { Grid } from '@material-ui/core';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport WithErrorHelper from '../../../../hocs/WithErrorHelper/WithErrorHelper';\nimport InputComponent from '../../../Common/Input/Input';\nimport { MemberResponsibleStyle } from './Responsible.style';\n\nconst InputWithError = WithFormContext(WithErrorHelper(InputComponent));\nconst Input = WithFormContext(InputComponent);\n\nconst OrderSuppDuesResponsibleComponent = (): JSX.Element => {\n const gridClasses = MemberResponsibleStyle();\n\n return (\n \n \n \n \n \n \n \n \n );\n};\n\nexport default OrderSuppDuesResponsibleComponent;\n","import React from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport { SUPPLEMENTAL_DUES_OPTIONS_DESIGNATE_MEMBER } from '../../../../utils/constants';\nimport OrderSuppDuesResponsibleComponent from './ResponsibleComponent';\n\ninterface OrderSuppDuesResponsibleProps {\n formMethods?: UseFormMethods;\n}\n\nconst OrderSuppDuesResponsible = (props: OrderSuppDuesResponsibleProps): JSX.Element | null => {\n const supplementalDuesMemberType = useWatch({\n control: props.formMethods?.control,\n name: 'supplementalDuesMemberType',\n defaultValue: '',\n });\n\n const show = supplementalDuesMemberType === SUPPLEMENTAL_DUES_OPTIONS_DESIGNATE_MEMBER;\n\n return show ? : null;\n};\n\nexport default OrderSuppDuesResponsible;\n","import { makeStyles } from '@material-ui/core';\n\nexport const SuppDuesTableItemCellStyle = makeStyles({\n root: {\n padding: '5px 0px 5px 5px',\n verticalAlign: 'top',\n '&:first-of-type': {\n paddingLeft: '12px',\n '&> :first-child': {\n width: '100%',\n maxWidth: '300px',\n paddingBottom: '5px',\n },\n },\n '&:not(:first-child)': {\n paddingTop: '16px',\n textAlign: 'right',\n },\n },\n});\n","import React, { ChangeEvent } from 'react';\nimport { TableRow, TableCell } from '@material-ui/core';\nimport WithFormContext from '../../../../../hocs/WithFormContext/WithFormContext';\nimport WithErrorHelper from '../../../../../hocs/WithErrorHelper/WithErrorHelper';\nimport Input from '../../../../Common/Input/Input';\nimport { formatNumber } from '../../../../../utils/format-number';\nimport { SuppDuesTableItemCellStyle } from './Item.style';\n\ninterface OrderSuppDuesTableItemComponentProps {\n keyValue: string;\n placeholder: string;\n name: string;\n stateDues?: number;\n localDues?: number;\n total: number;\n onChange: (value: string) => void;\n}\n\nconst InputWithError = WithFormContext(WithErrorHelper(Input));\n\nconst OrderSuppDuesTableItemComponent = (props: OrderSuppDuesTableItemComponentProps): JSX.Element => {\n const classes = SuppDuesTableItemCellStyle();\n\n return (\n \n \n ): void => {\n props.onChange(e.target.value);\n }}\n />\n \n {props.stateDues !== undefined ? (\n {formatNumber(props.stateDues)} \n ) : null}\n {props.localDues !== undefined ? (\n {formatNumber(props.localDues)} \n ) : null}\n \n {formatNumber(props.total)}\n \n \n );\n};\n\nexport default OrderSuppDuesTableItemComponent;\n","import React, { useState } from 'react';\nimport OrderSuppDuesTableItemComponent from './ItemComponent';\n\nexport interface OrderSuppDuesTableItemProps {\n keyValue?: string;\n name?: string;\n placeholder?: string;\n stateDues?: number;\n localDues?: number;\n total?: number;\n}\n\nconst OrderSuppDuesTableItem = (props: OrderSuppDuesTableItemProps): JSX.Element => {\n const [total, setTotal] = useState(props.total || 0);\n\n const handleOnChange = (value: string): void => {\n const stateDues = props.stateDues || 0;\n const localDues = props.localDues || 0;\n const total = (+value || 0) * (stateDues + localDues);\n setTotal(total);\n };\n\n return (\n \n );\n};\n\nexport default OrderSuppDuesTableItem;\n","import { makeStyles } from '@material-ui/core';\n\nexport const SuppDuesTableCellStyle = makeStyles({\n head: {\n padding: '16px 5px 5px 5px',\n border: 'none',\n '&:first-of-type': {\n paddingLeft: '12px',\n },\n '&:last-of-type': {\n paddingRight: '0px',\n textAlign: 'right',\n },\n '&:not(:first-child)': {\n paddingRight: '0px',\n textAlign: 'right',\n },\n },\n});\n","import React, { cloneElement } from 'react';\nimport { Table, TableHead, TableRow, TableCell, TableBody } from '@material-ui/core';\nimport { OrderSuppDuesTableItemProps } from './Item/Item';\nimport { SuppDuesTableCellStyle } from './Table.style';\n\ninterface OrderSuppDuesTableComponentProps {\n items?: OrderSuppDuesTableItemProps[];\n children?: JSX.Element;\n}\n\nconst showColumn = (value: 'stateDues' | 'localDues', items?: OrderSuppDuesTableItemProps[]): boolean => {\n return items && items.length > 0 ? !!items?.[0][value] : true;\n};\n\nconst ShowStateAndLocalColumn = (props: {\n showColumn: boolean | number | undefined;\n showOtherColumn: boolean | number | undefined;\n children: string;\n}): JSX.Element | null => {\n const classes = SuppDuesTableCellStyle();\n\n return props.showColumn ? (\n \n {props.children}\n \n ) : null;\n};\n\nconst OrderSuppDuesTableComponent = (props: OrderSuppDuesTableComponentProps): JSX.Element => {\n const classes = SuppDuesTableCellStyle();\n\n const showStateColumn = showColumn('stateDues', props.items);\n const showLocalColumn = showColumn('localDues', props.items);\n\n return (\n \n \n \n \n # Employees\n \n \n State\n \n \n Local\n \n \n Total\n \n \n \n \n {props.items?.map((elem) => {\n return props.children ? cloneElement(props.children, { ...elem, key: elem.keyValue }) : null;\n })}\n \n
\n );\n};\n\nexport default OrderSuppDuesTableComponent;\n","import React from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport { TableCell, TableRow } from '@material-ui/core';\nimport { Chapters } from '../../../../data_types/member-order';\nimport OrderSuppDuesTableItem, { OrderSuppDuesTableItemProps } from './Item/Item';\nimport TitledTable from '../../../Common/TitledTable/TitledTable';\nimport OrderSuppDuesTableComponent from './TableComponent';\nimport {\n EMPLOYEES_INFO,\n SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM,\n SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER,\n} from '../../../../utils/constants';\n\ninterface OrderSuppDuesTableProps {\n formMethods?: UseFormMethods;\n chapters?: Chapters;\n}\n\nconst OrderSuppDuesTable = (props: OrderSuppDuesTableProps): JSX.Element | null => {\n const supplementalDuesMemberType = useWatch({\n control: props.formMethods?.control,\n name: 'supplementalDuesMemberType',\n defaultValue: '',\n });\n\n const state = props.chapters?.State;\n const local = props.chapters?.Local;\n const show =\n supplementalDuesMemberType === SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER ||\n supplementalDuesMemberType === SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM;\n\n const employeeTypesWithSupplementalDues = (): OrderSuppDuesTableItemProps[] => {\n const employeeTypes: OrderSuppDuesTableItemProps[] = [];\n\n Object.keys(EMPLOYEES_INFO).forEach((key) => {\n const stateDues = (state && (state[EMPLOYEES_INFO[key].rate] as number)) || 0;\n const localDues = (local && (local[EMPLOYEES_INFO[key].rate] as number)) || 0;\n\n if (stateDues + localDues > 0) {\n const row: OrderSuppDuesTableItemProps = {\n keyValue: key,\n name: key,\n placeholder: EMPLOYEES_INFO[key].label,\n stateDues: state?.AIA_Charge_Supplemental_dues__c ? stateDues : undefined,\n localDues: local?.AIA_Charge_Supplemental_dues__c ? localDues : undefined,\n total: key === 'memberArchitectCount' ? stateDues + localDues : 0,\n };\n employeeTypes.push(row);\n }\n });\n\n return employeeTypes;\n };\n\n const supplementalDuesItems = employeeTypesWithSupplementalDues();\n\n return show ? (\n \n \n \n \n \n \n \n \n \n ) : null;\n};\n\nexport default OrderSuppDuesTable;\n","import { Chapters, EmployeesTotal } from '../data_types/member-order';\nimport { EMPLOYEES_INFO } from './constants';\n\ninterface SupplementalDues {\n name: string;\n label: string;\n stateDues: number;\n localDues: number;\n}\n\nconst getSupplementalDues = (employeeTypes: string[], chapters: Chapters): SupplementalDues[] => {\n return employeeTypes.map((employeeType) => ({\n name: employeeType,\n label: EMPLOYEES_INFO[employeeType].label,\n stateDues: (chapters.State && (chapters.State[EMPLOYEES_INFO[employeeType].rate] as number)) || 0,\n localDues: (chapters.Local && (chapters.Local[EMPLOYEES_INFO[employeeType].rate] as number)) || 0,\n }));\n};\n\nexport interface SuppDuesTotal {\n state: number;\n local: number;\n}\n\nconst calculateSupplementalDuesTotal = (employeesTotal: EmployeesTotal, chapters: Chapters): SuppDuesTotal => {\n const supplementalDues = getSupplementalDues(Object.keys(employeesTotal), chapters);\n let stateTotal = supplementalDues.reduce((acc, elem) => acc + elem.stateDues * (employeesTotal[elem.name] || 0), 0);\n const stateMinRate = chapters.State?.AIA_Min_Limit__c || 0;\n const stateMaxRate = chapters.State?.AIA_Max_Limit__c || stateTotal;\n\n if (stateTotal < stateMinRate) {\n stateTotal = stateMinRate;\n } else if (stateMaxRate !== 0 && stateTotal > stateMaxRate) {\n stateTotal = stateMaxRate;\n }\n\n let localTotal = supplementalDues.reduce((acc, elem) => acc + elem.localDues * (employeesTotal[elem.name] || 0), 0);\n const localMinRate = chapters.Local?.AIA_Min_Limit__c || 0;\n const localMaxRate = chapters.Local?.AIA_Max_Limit__c || localTotal;\n\n if (localTotal < localMinRate) {\n localTotal = localMinRate;\n } else if (localMaxRate !== 0 && localTotal > localMaxRate) {\n localTotal = localMaxRate;\n }\n\n return {\n state: stateTotal,\n local: localTotal,\n };\n};\n\nexport default calculateSupplementalDuesTotal;\n","import { makeStyles } from '@material-ui/core';\n\nexport const TotalTableRowStyle = makeStyles((theme) => ({\n root: {\n backgroundColor: theme.palette.secondary.light,\n },\n}));\n","import React from 'react';\nimport { Table, TableBody, TableRow, TableCell, Typography } from '@material-ui/core';\nimport { formatNumber } from '../../../../utils/format-number';\nimport { TotalTableRowStyle } from './Table.style';\n\ninterface OrderTotalTableComponentProps {\n total: number;\n}\n\nconst OrderTotalTableComponent = (props: OrderTotalTableComponentProps): JSX.Element => {\n const classes = TotalTableRowStyle();\n\n return (\n \n \n \n \n Total membership dues \n \n \n {formatNumber(props.total)}\n \n \n \n
\n );\n};\n\nexport default OrderTotalTableComponent;\n","import { Dispatch, SetStateAction, createContext } from 'react';\n\nexport const OrderContext = createContext({\n orderTotal: null as null | number,\n setOrderTotal: (null as unknown) as Dispatch>,\n});\n","import React, { useContext } from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport { EmployeesTotal, OrderDues, StateOrLocal } from '../../../../data_types/member-order';\nimport {\n SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER,\n SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM,\n} from '../../../../utils/constants';\nimport calculateSupplementalDuesTotal from '../../../../utils/supplemental-dues-calculation';\nimport OrderTotalTableComponent from './TableComponent';\nimport { OrderContext } from 'contexts/OrderContext';\n\nexport interface OrderTotalTableProps {\n formMethods?: UseFormMethods;\n dues?: OrderDues;\n state?: StateOrLocal;\n local?: StateOrLocal;\n}\n\nconst OrderTotalTable = (props: OrderTotalTableProps): JSX.Element | null => {\n let prices: (number | null | undefined)[] = [\n props.dues?.Local?.price,\n props.dues?.State?.price,\n props.dues?.National?.price,\n ];\n const { setOrderTotal } = useContext(OrderContext);\n const memberType: string =\n useWatch({\n control: props.formMethods?.control,\n name: 'supplementalDuesMemberType',\n }) || '';\n\n const employeesTotal: EmployeesTotal = {\n memberArchitectCount: useWatch({\n control: props.formMethods?.control,\n name: 'memberArchitectCount',\n defaultValue: 1,\n }),\n nonMemberArchitectCount: useWatch({\n control: props.formMethods?.control,\n name: 'nonMemberArchitectCount',\n defaultValue: null,\n }),\n associateCount: useWatch({\n control: props.formMethods?.control,\n name: 'associateCount',\n defaultValue: null,\n }),\n technicalStaffCount: useWatch({\n control: props.formMethods?.control,\n name: 'technicalStaffCount',\n defaultValue: null,\n }),\n otherStaffCount: useWatch({\n control: props.formMethods?.control,\n name: 'otherStaffCount',\n defaultValue: null,\n }),\n };\n\n const countEmployees = [\n SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER,\n SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM,\n ].includes(memberType);\n const totalByEmployees = calculateSupplementalDuesTotal(employeesTotal, { State: props.state, Local: props.local });\n countEmployees && (prices = prices.concat(totalByEmployees.local + totalByEmployees.state));\n\n const total = prices.reduce((a: number, b) => a + (b || 0), 0);\n setOrderTotal(total);\n return ;\n};\n\nexport default OrderTotalTable;\n","import { makeStyles } from '@material-ui/core';\n\nexport const InstallmentDisabledStyle = makeStyles(() => ({\n root: {\n marginTop: '20px',\n },\n}));\n","import { Typography } from '@material-ui/core';\nimport React, { BaseSyntheticEvent, useEffect, useState } from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport { filterByVisibleOptionalProducts } from 'utils/filterByVisibleOptionalProducts';\nimport { MemberOrderResponse, SubscriptionPlan } from '../../data_types/member-order';\nimport WithFormContext from '../../hocs/WithFormContext/WithFormContext';\nimport WithInsideLoading from '../../hocs/WithInsideLoading/WithInsideLoading';\nimport { calculateDuesTotal } from '../../utils/calculate-dues-total';\nimport { chargesSupplementalDues } from '../../utils/charges-supplemental-dues';\nimport ArrowedButton from '../Common/ArrowedButton/ArrowedButton';\nimport BorderedBox from '../Common/BorderedBox/BorderedBox';\nimport OneAtLeft from '../Common/OneAtLeft/OneAtLeft';\nimport OrderAdditionalFeesTable from './AdditionalFees/Table/Table';\nimport OrderAlert from './Alert/Alert';\nimport ArchiPACModal from './ArchiPACModal/ArchiPACModal';\nimport OrderAutoRenewCheckbox from './AutoRenew/Checkbox/Checkbox';\nimport OrderConfirmAlliedCheckbox from './ConfirmAllied/Checkbox/Checkbox';\nimport OrderConfirmLicenseCheckbox from './ConfirmLicense/Checkbox/Checkbox';\nimport OrderConfirmTermsCheckbox from './ConfirmTerms/Checkbox/Checkbox';\nimport OrderDuesTable from './Dues/Table/Table';\nimport OrderInstallmentsCheckbox from './Installments/Checkbox/Checkbox';\nimport OrderInstallmentsSelect from './Installments/Select/Select';\nimport OrderOptionalProductsTable from './OptionalProducts/Table/Table';\nimport { BorderedBoxStyle, ButtonRowStyle, MarginTopStyle } from './Order.style';\nimport OrderPayOfflineButtonComponent from './PayOffline/Button/Button';\nimport OrderSuppDuesMemberType from './SuppDues/MemberType/MemberType';\nimport OrderSuppDuesResponsible from './SuppDues/Responsible/Responsible';\nimport OrderSuppDuesTable from './SuppDues/Table/Table';\nimport OrderTotalTable from './Total/Table/Table';\nimport DisabledInstallment from './Installments/Disabled/DisabledInstallment';\nimport { OrderContext } from 'contexts/OrderContext';\n\nexport interface OrderComponentProps {\n membershipInfo: MemberOrderResponse;\n isLoading: boolean;\n hasError: boolean;\n paymentMethod: string;\n onSubmit?: (e?: BaseSyntheticEvent | undefined) => Promise;\n formMethods?: UseFormMethods;\n}\nconst ARCHIPAC_DONATION = 'ArchiPAC donation';\nconst OrderPayOfflineButton = WithInsideLoading(OrderPayOfflineButtonComponent);\nconst OrderPayNowButton = WithInsideLoading(ArrowedButton);\nconst AlertWithFormContext = WithFormContext(OrderAlert);\nconst today = new Date();\nconst currentYear = today.getFullYear();\nconst currentMonth = today.getMonth() + 1;\n\nconst getDefaultSubscription = (subscriptionPlans: SubscriptionPlan[] | undefined): SubscriptionPlan | undefined => {\n return subscriptionPlans?.find((sub: SubscriptionPlan) => sub.OrderApi__Number_Of_Installments__c === null);\n};\n\nconst handlePayment = (\n submitAction: 'online' | 'offline',\n e: React.FormEvent,\n onSubmit?: (e?: BaseSyntheticEvent | undefined) => Promise,\n): void => {\n const event = { ...e, submitAction };\n onSubmit?.(event);\n};\n\nconst getPaymentState = (\n paymentMethod: 'online' | 'offline',\n selectedPayment: string,\n isLoading: boolean,\n): {\n loading: boolean;\n disabled: boolean;\n} => {\n return {\n loading: selectedPayment === paymentMethod && isLoading,\n disabled: isLoading,\n };\n};\n\nconst OrderComponent = (props: OrderComponentProps): JSX.Element => {\n const [showAutoRenewModal, setShowAutoRenewModal] = useState(false);\n const [orderTotal, setTotal] = useState(null);\n const borderedBoxClasses = BorderedBoxStyle();\n const marginTopClasses = MarginTopStyle();\n const buttonRowClasses = ButtonRowStyle();\n const handlePayOnline = (e: React.FormEvent): void => handlePayment('online', e, props.onSubmit);\n const handlePayOffline = (e: React.FormEvent): void => handlePayment('offline', e, props.onSubmit);\n const payOnlineState = getPaymentState('online', props.paymentMethod, props.isLoading);\n const payOfflineState = getPaymentState('offline', props.paymentMethod, props.isLoading);\n\n const hasArchiPACDonationOption = props.membershipInfo.related?.packageItems?.some(\n (item) => item.OrderApi__Display_Name__c.toLowerCase() === ARCHIPAC_DONATION.toLowerCase(),\n );\n const getArchiPACCheckboxName = (): string => {\n if (hasArchiPACDonationOption) {\n const items = filterByVisibleOptionalProducts(props.membershipInfo.related?.packageItems);\n const itemIndex = items?.findIndex(\n (item) => item.OrderApi__Display_Name__c.toLowerCase() === ARCHIPAC_DONATION.toLowerCase(),\n ) as number;\n const itemId = items?.[itemIndex]?.Id;\n return `additionalPackages[${itemIndex}].${itemId}`;\n } else {\n return 'not-exist';\n }\n };\n const autoRenewIsChecked = useWatch({\n control: props.formMethods?.control,\n name: 'autoRenew',\n defaultValue: false,\n });\n const archiPACIsChecked = useWatch({\n control: props.formMethods?.control,\n name: getArchiPACCheckboxName(),\n });\n const isInstallmentsDisabled = process.env.REACT_APP_FEATURE_INSTALLMENTS_DISABLED === 'true';\n const userHasInstallmentsOption =\n props.membershipInfo.related?.subscriptionPlans &&\n props.membershipInfo.related?.subscriptionPlans.length > 1 &&\n calculateDuesTotal(props.membershipInfo.order?.items) > 0;\n const allowedInstallmentBasedOnMonth =\n !props.membershipInfo.contact?.renewYear ||\n (props.membershipInfo.contact?.renewYear === currentYear && currentMonth < 10) ||\n (props.membershipInfo.contact?.renewYear ?? 0) > currentYear;\n const hasAvailableInstallments = userHasInstallmentsOption && !autoRenewIsChecked && allowedInstallmentBasedOnMonth;\n const showSubscriptionPlans = isInstallmentsDisabled ? false : hasAvailableInstallments;\n const defaultSubscriptionPlanId = getDefaultSubscription(props.membershipInfo.related?.subscriptionPlans)?.Id;\n\n useEffect(() => {\n if (autoRenewIsChecked && archiPACIsChecked) {\n setShowAutoRenewModal(true);\n }\n }, [autoRenewIsChecked, archiPACIsChecked]);\n return (\n \n \n \n );\n};\n\nexport default OrderComponent;\n","import { OrderData } from '../components/Order/Order';\nimport {\n MemberOrderResponse,\n UpdateMembershipInfoRequest,\n SupplementalDuePaid,\n SupplementalDueContact,\n LineItem,\n PackageItemsEntity,\n StateOrLocal,\n} from '../data_types/member-order';\nimport { chargesSupplementalDues } from './charges-supplemental-dues';\nimport { SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER, SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM } from './constants';\nimport calculateSupplementalDuesTotal, { SuppDuesTotal } from './supplemental-dues-calculation';\n\nconst calculateAdditionalPackagesItems = (\n additionalPackages: object[],\n packageItems?: PackageItemsEntity[] | null,\n): LineItem[] => {\n const lineItems: LineItem[] = [];\n additionalPackages.forEach((item) => {\n const additionalPackage = item as { [key: string]: boolean };\n const id = Object.keys(additionalPackage)[0];\n const value = additionalPackage[id];\n\n if (value) {\n const packageItem = packageItems?.find((packageItem) => {\n return packageItem.Id === id;\n });\n\n lineItems.push({\n OrderApi__Item__c: packageItem?.Id,\n OrderApi__Sale_Price__c: packageItem?.OrderApi__Price__c,\n });\n }\n });\n return lineItems;\n};\n\nconst calculateInstallmentFeesItems = (\n subscriptionPlanId: string | undefined,\n defaultSubscriptionId: string | undefined,\n packageItems?: PackageItemsEntity[] | null,\n): LineItem[] => {\n const lineItems: LineItem[] = [];\n if (subscriptionPlanId && subscriptionPlanId !== defaultSubscriptionId) {\n const installmentFee = packageItems?.find((item) => item.OrderApi__Display_Name__c.startsWith('Installment'));\n installmentFee &&\n lineItems.push({\n OrderApi__Item__c: installmentFee?.Id || undefined,\n OrderApi__Sale_Price__c: installmentFee?.OrderApi__Price__c,\n });\n }\n return lineItems;\n};\n\nconst getTotal = (data: OrderData, state?: StateOrLocal, local?: StateOrLocal): SuppDuesTotal => {\n return calculateSupplementalDuesTotal(\n {\n memberArchitectCount: data.memberArchitectCount,\n nonMemberArchitectCount: data.nonMemberArchitectCount,\n associateCount: data.associateCount,\n technicalStaffCount: data.technicalStaffCount,\n otherStaffCount: data.otherStaffCount,\n },\n { State: state, Local: local },\n );\n};\n\nconst calculateSuppDuesItems = (\n suppDuesTotals: SuppDuesTotal,\n packageItems?: PackageItemsEntity[] | null,\n): LineItem[] => {\n const lineItems: LineItem[] = [];\n const supplementalDues = packageItems?.filter((item) =>\n item.OrderApi__Display_Name__c.startsWith('Supplemental Dues -'),\n );\n supplementalDues?.forEach((supplementalDue) => {\n if (\n (supplementalDue.AIA_Chapter_Level__c === 'Local' && suppDuesTotals.local > 0) ||\n suppDuesTotals.state > 0\n ) {\n lineItems.push({\n OrderApi__Item__c: supplementalDue.Id,\n OrderApi__Sale_Price__c:\n supplementalDue.AIA_Chapter_Level__c === 'Local' ? suppDuesTotals.local : suppDuesTotals.state,\n OrderApi__Price_Override__c: true,\n });\n }\n });\n return lineItems;\n};\n\nconst paysSuppDues = (supplementalDuesMemberType: string | undefined): boolean => {\n return (\n supplementalDuesMemberType !== undefined &&\n [SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER, SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM].includes(\n supplementalDuesMemberType,\n )\n );\n};\n\nconst createSupplementalDuePay = (\n data: OrderData,\n total: number,\n accountId: string | undefined,\n renewYear: number | null | undefined,\n): SupplementalDuePaid => ({\n AIA_Member_Architect_Count__c: data.memberArchitectCount,\n AIA_Non_member_Architect_Count__c: data.nonMemberArchitectCount,\n AIA_Associate_Count__c: data.associateCount,\n AIA_Technical_Staff_Count__c: data.technicalStaffCount,\n AIA_Other_Staff_Count__c: data.otherStaffCount,\n AIA_Total_Supplemental_Dues_Amount_Paid__c: total,\n AIA_Account__c: accountId,\n AIA_Supplemental_Dues_Year__c: renewYear || undefined,\n});\n\nconst createSupplementalDueContact = (data: OrderData): SupplementalDueContact => ({\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n AIA_Supp_Dues_Questionnaire_Response__c: data.supplementalDuesMemberType!,\n AIA_Supp_Dues_Member_ID__c: data.memberId,\n AIA_Supp_Dues_Name__c: data.memberName,\n});\n\nconst createPayload = (\n data: OrderData,\n membershipInfo: MemberOrderResponse,\n defaultSubscriptionId: string | undefined,\n): UpdateMembershipInfoRequest => {\n const additionalPackageItems = data.additionalPackages\n ? calculateAdditionalPackagesItems(data.additionalPackages, membershipInfo.related?.packageItems)\n : [];\n const installmentFeesItems = calculateInstallmentFeesItems(\n data.subscriptionPlanId,\n defaultSubscriptionId,\n membershipInfo.related?.packageItems,\n );\n\n let supplementalDuePaid: SupplementalDuePaid | undefined;\n let supplementalDueContact: SupplementalDueContact | undefined;\n let suppDuesItems: LineItem[] = [];\n\n if (chargesSupplementalDues(membershipInfo.chapters, membershipInfo.contact.emeritus)) {\n if (paysSuppDues(data.supplementalDuesMemberType)) {\n const suppDuesTotals = getTotal(data, membershipInfo.chapters?.State, membershipInfo.chapters?.Local);\n suppDuesItems = calculateSuppDuesItems(suppDuesTotals, membershipInfo.related?.packageItems);\n supplementalDuePaid = createSupplementalDuePay(\n data,\n suppDuesTotals.local + suppDuesTotals.state,\n membershipInfo.contact?.accountId,\n membershipInfo.contact?.renewYear,\n );\n }\n\n supplementalDueContact = createSupplementalDueContact(data);\n }\n\n return {\n OrderId: membershipInfo.order?.order?.Id || '',\n OrderApi__Subscription_Plan__c: data.subscriptionPlanId || defaultSubscriptionId,\n lineItems: additionalPackageItems.concat(installmentFeesItems, suppDuesItems),\n contact: supplementalDueContact,\n SupplementalDuePaid: supplementalDuePaid,\n AutoRenew: data.autoRenew || false,\n };\n};\n\nexport default createPayload;\n","import { API, Auth } from 'aws-amplify';\nimport { LineItem, MemberOrderResponse, OrderDues, UpdateMembershipInfoRequest } from '../data_types/member-order';\nimport { calculateDuesTotal } from './calculate-dues-total';\n\nconst calculateOrderTotal = (dues: OrderDues | undefined, request: UpdateMembershipInfoRequest): number => {\n const duesTotal = calculateDuesTotal(dues);\n const lineItemsTotal = request.lineItems.reduce(\n (a: number, b: LineItem) => a + (b.OrderApi__Sale_Price__c || 0),\n 0,\n );\n\n return duesTotal + lineItemsTotal;\n};\n\nconst sendPayload = async (\n submitAction: string,\n membershipInfo: MemberOrderResponse,\n request: UpdateMembershipInfoRequest,\n): Promise => {\n const user = await Auth.currentAuthenticatedUser();\n const currentSession = await Auth.currentSession();\n const token = currentSession.getAccessToken().getJwtToken();\n\n return API.post('membership', '/membership-info', {\n body: {\n ...request,\n },\n headers: {\n Authorization: token,\n },\n });\n};\n\nexport default sendPayload;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Joi from 'joi';\nimport { joiResolver } from '@hookform/resolvers/joi';\nimport {\n SUPPLEMENTAL_DUES_OPTIONS_DESIGNATE_MEMBER,\n SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM,\n SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER,\n} from './constants';\nimport { Resolver } from 'react-hook-form';\n\nconst requiredMessage = 'This information is required.';\nconst employeeCountCondition = Joi.alternatives().conditional('supplementalDuesMemberType', {\n is: Joi.string().valid(SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER, SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM),\n then: Joi.number().required(),\n});\n\nconst employeeArchitectCountCondition = Joi.alternatives().conditional('supplementalDuesMemberType', {\n is: Joi.string().valid(SUPPLEMENTAL_DUES_OPTIONS_SOLE_PRACTITIONER, SUPPLEMENTAL_DUES_OPTIONS_MANAGE_FIRM),\n then: Joi.number().min(1).required().messages({ 'number.min': 'You should include at least yourself.' }),\n});\n\nconst joiSchemaMessages = {\n 'number.base': requiredMessage,\n 'string.empty': requiredMessage,\n 'any.invalid': requiredMessage,\n};\n\nexport const generateRenewSchema = (chargeSuppDues: boolean): Resolver, object> => {\n return joiResolver(\n Joi.object({\n subscriptionPlanId: Joi.string(),\n supplementalDuesMemberType: chargeSuppDues ? Joi.string().required() : Joi.valid(),\n memberName: Joi.alternatives().conditional('supplementalDuesMemberType', {\n is: SUPPLEMENTAL_DUES_OPTIONS_DESIGNATE_MEMBER,\n then: Joi.string().required(),\n }),\n memberId: Joi.alternatives().conditional('supplementalDuesMemberType', {\n is: SUPPLEMENTAL_DUES_OPTIONS_DESIGNATE_MEMBER,\n then: Joi.string().allow(''),\n }),\n memberArchitectCount: employeeArchitectCountCondition,\n nonMemberArchitectCount: employeeCountCondition,\n associateCount: employeeCountCondition,\n technicalStaffCount: employeeCountCondition,\n otherStaffCount: employeeCountCondition,\n additionalPackages: Joi.array().items(Joi.object()),\n confirmLicense: Joi.boolean().invalid(false),\n confirmTerms: Joi.boolean().invalid(false),\n confirmAlliedProfessional: Joi.boolean().invalid(false),\n confirmInstallments: Joi.boolean().invalid(false),\n autoRenew: Joi.boolean(),\n }).prefs({\n messages: joiSchemaMessages,\n }),\n );\n};\n","import { CircularProgress, Typography } from '@material-ui/core';\nimport React from 'react';\n\nconst OrderRedirectToCheckout = (): JSX.Element => {\n return (\n <>\n \n \n Redirecting to checkout page...\n \n >\n );\n};\n\nexport default OrderRedirectToCheckout;\n","import { BackdropOptions } from 'data_types/backdrop-options';\nimport { Dispatch, SetStateAction, createContext } from 'react';\n\nexport const BackdropContext = createContext({\n options: { isOpen: false } as BackdropOptions,\n setOptions: (null as unknown) as Dispatch>,\n});\n","import { API } from 'aws-amplify';\n\nconst getSalesforceSsoUrl = async (): Promise => {\n const response = await API.get('membership', '/salesforce-app-sso-url', {});\n return response.data;\n};\n\nexport default getSalesforceSsoUrl;\n","import React, { memo, useContext, useState } from 'react';\nimport { MemberOrderResponse } from '../../data_types/member-order';\nimport OrderComponent, { OrderComponentProps } from './OrderComponent';\nimport createPayload from '../../utils/order-create-payload';\nimport sendPayload from '../../utils/order-send-payload';\nimport { getDefaultSubscription } from '../../utils/get-default-subscription';\nimport { generateRenewSchema } from '../../utils/generate-renew-schema';\nimport { generateRenewFormOptions } from '../../utils/generate-renew-form-options';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { chargesSupplementalDues } from '../../utils/charges-supplemental-dues';\nimport OrderRedirectToCheckout from './RedirectToCheckout/RedirectToCheckout';\nimport { ModalContext } from '../../contexts/ModalContext';\nimport { BackdropContext } from '../../contexts/BackdropContext';\nimport { DEFAULT_MODAL_CONTENT, INVALID_SESSION_MODAL_CONTENT, SESSION_INVALID_ERROR } from '../../utils/constants';\nimport getSalesforceSsoUrl from 'utils/get-salesforce-sso-url';\n\ntype OrderProps = {\n membershipInfo: MemberOrderResponse;\n};\n\nexport interface OrderData {\n subscriptionPlanId: string | undefined;\n supplementalDuesMemberType?: string;\n memberName?: string;\n memberId?: string;\n memberArchitectCount: number;\n nonMemberArchitectCount: number;\n associateCount: number;\n technicalStaffCount: number;\n otherStaffCount: number;\n additionalPackages?: object[];\n confirmLicense: boolean;\n confirmTerms: boolean;\n confirmInstallments: boolean;\n autoRenew: boolean;\n}\n\nconst orderFormPropsAreEqual = (prev: OrderComponentProps, next: OrderComponentProps): boolean => {\n return prev.hasError === next.hasError && prev.isLoading === next.isLoading;\n};\n\nconst MemoizedOrderComponent = memo(OrderComponent, orderFormPropsAreEqual);\n\nconst redirectToCheckoutPage = async (\n paymentType: string,\n orderId: string,\n contactId?: string,\n): Promise => {\n const ssoUrl = await getSalesforceSsoUrl();\n const startUrl =\n paymentType === 'online'\n ? `${process.env.REACT_APP_CHECKOUT_PATH}/${orderId}`\n : `${process.env.REACT_APP_PDF_PATH}?recordId=${contactId}`;\n\n const redirectUrl = `${process.env.REACT_APP_SSO_URL}?startURL=${encodeURIComponent(startUrl)}`;\n window.location.assign(redirectUrl);\n};\n\nconst scrollToTop = (): void => {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n};\n\nconst Order = (props: OrderProps): JSX.Element => {\n const [isLoading, setIsLoading] = useState(false);\n const [hasError, setHasError] = useState(false);\n const [paymentMethod, setPaymentMethod] = useState('');\n\n const { setOptions: setModalOptions } = useContext(ModalContext);\n const { setOptions: setBackdropOptions } = useContext(BackdropContext);\n\n const defaultSubscriptionPlanId = getDefaultSubscription(props.membershipInfo.related?.subscriptionPlans)?.Id;\n const schema = generateRenewSchema(\n chargesSupplementalDues(\n props.membershipInfo.chapters,\n props.membershipInfo.contact?.emeritus,\n ),\n );\n const formOptions = generateRenewFormOptions({\n resolver: schema,\n defaultValues: {\n subscriptionPlanId: defaultSubscriptionPlanId || '',\n },\n });\n\n const formMethods = useForm(formOptions);\n\n const { membershipInfo } = props;\n\n const payInInstallmentsFailureModalContent = {\n isOpen: true,\n title: 'Paying in installments failed',\n content: (\n \n Thank you for attempting to renew your 2023 AIA Membership Dues. We are sorry that you were unable to\n complete your transaction online due to a timeout issue.\n
\n
\n Please contact the Support Center at (800) 242 3837, option 2, to complete your application for a Dues\n Installment Plan. We look forward to serving you during the hours of 8:30 am – 6:00 pm EST.\n
\n
\n Best regards,\n
\n The Membership Team\n
\n
membersupport@aia.org \n
\n ),\n onCancel: (): void => {\n return;\n },\n cancelActionName: 'Close',\n };\n\n const updateOrder = async (data: unknown, e: unknown): Promise => {\n const request = createPayload(data as OrderData, membershipInfo, defaultSubscriptionPlanId);\n\n try {\n const submitAction = (e as { submitAction: string }).submitAction;\n setPaymentMethod(submitAction);\n setIsLoading(true);\n\n await sendPayload(submitAction, membershipInfo, request);\n\n sessionStorage.clear();\n setBackdropOptions?.({\n isOpen: true,\n child: ,\n action: redirectToCheckoutPage(submitAction, request.OrderId, membershipInfo.contact?.id),\n });\n } catch (error) {\n setHasError(true);\n\n const triedPayingWithInstallments = membershipInfo.related?.subscriptionPlans?.find(\n (plan) => plan.Id === request.OrderApi__Subscription_Plan__c,\n )?.OrderApi__Number_Of_Installments__c;\n\n if (triedPayingWithInstallments) {\n setModalOptions(payInInstallmentsFailureModalContent);\n } else if (error === SESSION_INVALID_ERROR) {\n setModalOptions({ ...INVALID_SESSION_MODAL_CONTENT, isOpen: true });\n } else {\n setModalOptions?.({ ...DEFAULT_MODAL_CONTENT, isOpen: true });\n }\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n \n \n \n );\n};\n\nexport default Order;\n","import { SubscriptionPlan } from '../data_types/member-order';\n\nexport const getDefaultSubscription = (\n subscriptionPlans: SubscriptionPlan[] | undefined,\n): SubscriptionPlan | undefined => {\n return subscriptionPlans?.find((sub: SubscriptionPlan) => sub.OrderApi__Number_Of_Installments__c === null);\n};\n","import { CustomFormOptions, FormOptions } from '../data_types/form-options';\n\ninterface RenewDefaultValues {\n subscriptionPlanId: string;\n supplementalDuesMemberType: string;\n memberName: string;\n memberId: string;\n memberArchitectCount: number;\n nonMemberArchitectCount: string;\n associateCount: string;\n technicalStaffCount: string;\n otherStaffCount: string;\n additionalPackages: string[];\n confirmLicense: boolean;\n confirmTerms: boolean;\n confirmInstallments: boolean;\n}\n\nexport const generateRenewFormOptions = (options: CustomFormOptions): FormOptions => {\n const defaultFormOptions = {\n resolver: options.resolver,\n defaultValues: {\n ...{\n subscriptionPlanId: '',\n supplementalDuesMemberType: '',\n memberName: '',\n memberId: '',\n memberArchitectCount: 1,\n nonMemberArchitectCount: '',\n associateCount: '',\n technicalStaffCount: '',\n otherStaffCount: '',\n additionalPackages: [],\n confirmLicense: false,\n confirmTerms: false,\n confirmInstallments: false,\n autoRenew: false,\n },\n ...options.defaultValues,\n },\n shouldFocusError: false,\n };\n return defaultFormOptions as FormOptions;\n};\n","import React, { Dispatch, SetStateAction, useContext } from 'react';\n\nconst WithBackdropContext = (\n type: 'modal' | 'backdrop',\n context: React.Context<{\n options: T;\n setOptions: Dispatch>;\n }>,\n Component: React.ComponentType,\n): React.FC
=> {\n const ComponentWithBackdropContext = (props: P): JSX.Element => {\n const { options, setOptions } = useContext(context);\n\n return type === 'backdrop' ? (\n \n ) : (\n \n );\n };\n\n return ComponentWithBackdropContext;\n};\n\nexport default WithBackdropContext;\n","import React from 'react';\nimport Disclosures from '../components/Common/Disclosures/Disclosures';\nimport Help from '../components/Common/Help/Help';\nimport InfoTile from '../components/Common/InfoTile/InfoTile';\nimport TaxesTile from '../components/Common/TaxesTile/TaxesTile';\nimport VerticalSplit from '../components/Common/VerticalSplit/VerticalSplit';\nimport MembershipMemberInfo from '../components/Membership/MemberInfo/MemberInfo';\nimport MembershipSidebar from '../components/Membership/Sidebar/Sidebar';\nimport Order from '../components/Order/Order';\nimport { MemberOrderResponse } from '../data_types/member-order';\nimport WithBackdropContext from '../hocs/WithBackdropContext/WithBackdropContext';\nimport { BackdropContext } from '../contexts/BackdropContext';\nimport { ModalContext } from '../contexts/ModalContext';\n\ninterface ScreensRenewProps {\n membershipInfo?: MemberOrderResponse;\n}\n\nconst OrderWithContext = WithBackdropContext(\n 'backdrop',\n BackdropContext,\n WithBackdropContext('modal', ModalContext, Order),\n);\n\nconst ScreensRenew = (props: ScreensRenewProps): JSX.Element | null => {\n if (!props.membershipInfo) {\n return null;\n }\n\n return (\n }\n right={\n \n \n \n \n \n \n \n \n \n \n \n \n }\n />\n );\n};\n\nexport default ScreensRenew;\n","import React from 'react';\nimport { CircularProgress as MuiCircularProgress, withStyles } from '@material-ui/core';\nimport ScreensError from '../../screens/Error';\n\ninterface WithLoadingProps {\n loading?: boolean;\n error?: boolean;\n}\n\nconst CircularProgress = withStyles(() => ({\n root: {},\n}))(MuiCircularProgress);\n\n// eslint-disable-next-line react/display-name\nconst WithLoading = (Component: React.ComponentType
): React.FC
=> ({\n loading,\n error,\n ...props\n}: WithLoadingProps): JSX.Element => {\n return loading ? (\n \n ) : error ? (\n \n ) : (\n \n );\n};\n\nexport default WithLoading;\n","import { useEffect, useState } from 'react';\n\nexport const useExternalScript = (url: string): string => {\n const [state, setState] = useState(url ? 'loading' : 'idle');\n\n useEffect(() => {\n if (!url) {\n setState('idle');\n return;\n }\n let script = document.querySelector(`script[src=\"${url}\"]`) as HTMLScriptElement;\n\n const handleScript = (e: { type: string }): void => {\n setState(e.type === 'load' ? 'ready' : 'error');\n };\n\n if (!script) {\n script = document.createElement('script');\n script.type = 'application/javascript';\n script.src = url;\n script.async = true;\n document.body.appendChild(script);\n script.addEventListener('load', handleScript);\n script.addEventListener('error', handleScript);\n }\n\n script.addEventListener('load', handleScript);\n script.addEventListener('error', handleScript);\n\n return (): void => {\n script.removeEventListener('load', handleScript);\n script.removeEventListener('error', handleScript);\n };\n }, [url]);\n\n return state;\n};\n","import { CustomFormOptions, FormOptions } from '../data_types/form-options';\n\nexport interface ContactFormDefaultValues {\n [key: string]: string | boolean | undefined;\n selfDescribe: string;\n country: string;\n careerType: string;\n zipCode: string;\n gradDate: string;\n licenseDate: string;\n membershipStatus?: string;\n}\n\nexport const generateContactFormOptions = (options: CustomFormOptions): FormOptions => {\n const defaultFormOptions = {\n resolver: options.resolver,\n defaultValues: {\n ...{\n selfDescribe: '',\n country: '',\n careerType: '',\n zipCode: '',\n gradDate: '',\n licenseDate: '',\n membershipStatus: 'Non-Member',\n },\n ...options.defaultValues,\n },\n shouldFocusError: false,\n };\n return defaultFormOptions as FormOptions;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Joi from 'joi';\nimport { joiResolver } from '@hookform/resolvers/joi';\nimport {\n MEMBERSHIP_COUNTRY_UNITED_STATES,\n SELF_DESCRIBE_ARCHITECT_DEGREE,\n SELF_DESCRIBE_FACULTY_MEMBER,\n SELF_DESCRIBE_NEW_GRADUATE,\n SELF_DESCRIBE_NON_US_ARCHITECT,\n SELF_DESCRIBE_US_ARCHITECT,\n SELF_DESCRIBE_ALLIED,\n} from './constants';\nimport { Resolver } from 'react-hook-form';\n\nconst requiredMessage = 'This information is required.';\nconst noFutureDateMessage = 'Future dates are not valid.';\nconst joiSchemaMessages = {\n 'string.base': requiredMessage,\n 'string.empty': requiredMessage,\n 'any.invalid': requiredMessage,\n 'date.base': requiredMessage,\n 'date.max': noFutureDateMessage,\n};\n\nconst countryConditions = Joi.alternatives().conditional('selfDescribe', {\n is: SELF_DESCRIBE_ALLIED,\n then: Joi.string().allow('').empty(['']).default(MEMBERSHIP_COUNTRY_UNITED_STATES),\n otherwise: Joi.string().required(),\n});\n\nconst usZipCodeValidation = {\n is: MEMBERSHIP_COUNTRY_UNITED_STATES,\n then: Joi.string()\n .pattern(/^[0-9]{5}(?:-[0-9]{4})?$/)\n .required()\n .messages({\n 'string.pattern.base': 'It should be a valid US postal code.',\n }),\n otherwise: Joi.string(),\n};\n\nconst zipCodeConditions = Joi.alternatives()\n .conditional('country', usZipCodeValidation)\n .when('selfDescribe', { is: SELF_DESCRIBE_ALLIED, then: Joi.forbidden() });\n\nconst addressZipCodeConditions = Joi.alternatives().conditional('addressCountry', usZipCodeValidation);\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nconst selfDescribeCondition = (options: string[], isDateField?: boolean) => {\n return Joi.alternatives().conditional('selfDescribe', {\n is: Joi.string().valid(...options),\n then: isDateField ? Joi.date().max('now').required() : Joi.string().required(),\n otherwise: isDateField ? Joi.date().max('now').allow('') : Joi.string().allow(''),\n });\n};\n\nexport const generateContactFormSchema = (addressRequired = true): Resolver, object> => {\n return joiResolver(\n Joi.object({\n selfDescribe: Joi.string().required(),\n country: countryConditions,\n zipCode: zipCodeConditions,\n careerType: selfDescribeCondition([\n SELF_DESCRIBE_US_ARCHITECT,\n SELF_DESCRIBE_NON_US_ARCHITECT,\n SELF_DESCRIBE_FACULTY_MEMBER,\n ]),\n gradDate: selfDescribeCondition([SELF_DESCRIBE_NEW_GRADUATE, SELF_DESCRIBE_ARCHITECT_DEGREE], true),\n licenseDate: selfDescribeCondition([SELF_DESCRIBE_US_ARCHITECT, SELF_DESCRIBE_NON_US_ARCHITECT], true),\n membershipStatus: Joi.string(),\n addressStreet: addressRequired ? Joi.string().required() : Joi.string(),\n addressStreetLine2: Joi.string().allow(''),\n addressCity: addressRequired ? Joi.string().required() : Joi.string(),\n addressState: addressRequired ? Joi.string().required() : Joi.string(),\n addressCountry: addressRequired ? Joi.string().required() : Joi.string(),\n addressZipCode: addressRequired ? addressZipCodeConditions : Joi.string(),\n }).prefs({\n messages: joiSchemaMessages,\n }),\n );\n};\n","import { API, Auth } from 'aws-amplify';\nimport { UpdateContactRequest } from '../data_types/update-contact-request';\n\nconst updateContact = async (contactId: string, request: UpdateContactRequest): Promise => {\n const user = await Auth.currentAuthenticatedUser();\n const currentSession = await Auth.currentSession();\n const token = currentSession.getAccessToken().getJwtToken();\n\n return API.post('membership', `/contact/${contactId}`, {\n body: {\n ...request,\n },\n headers: {\n Authorization: token,\n },\n });\n};\n\nexport default updateContact;\n","import { makeStyles } from '@material-ui/core';\n\nexport const MembershipTypeRadioGroupStyle = makeStyles({\n root: {\n padding: '16px 0 0 16px',\n },\n});\n","import { makeStyles } from '@material-ui/core';\n\nexport const SubDescriptionStyle = makeStyles({\n root: {\n paddingLeft: '20px',\n },\n});\n","import { Typography } from '@material-ui/core';\nimport React from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport Radio from '../../../../Common/Radio/Radio';\nimport { SubDescriptionStyle } from './Radio.style';\n\ninterface ContactFormSelfDescribeRadioProps {\n formMethods?: UseFormMethods;\n label: string;\n value: string;\n membershipStatus?: string;\n caption: string | (string | JSX.Element)[];\n}\n\nconst ContactFormSelfDescribeRadio = (props: ContactFormSelfDescribeRadioProps): JSX.Element => {\n const subDescriptionClasses = SubDescriptionStyle();\n\n const selfDescribe = useWatch({\n control: props.formMethods?.control,\n name: 'selfDescribe',\n defaultValue: props.formMethods?.getValues('selfDescribe'),\n });\n\n return (\n \n
\n {props.value === selfDescribe && (\n
\n {props.caption} \n
\n )}\n
\n );\n};\n\nexport default ContactFormSelfDescribeRadio;\n","/* eslint-disable react/jsx-key */\nimport React from 'react';\nimport WithController from '../../../../hocs/WithController/WithController';\nimport WithErrorHelper from '../../../../hocs/WithErrorHelper/WithErrorHelper';\nimport WithFormContext from '../../../../hocs/WithFormContext/WithFormContext';\nimport RadioGroup from '../../../Common/RadioGroup/RadioGroup';\nimport { MembershipTypeRadioGroupStyle } from './MembershipType.style';\nimport {\n CONTACT_STATUS,\n JOIN_SELF_DESCRIBE_OPTIONS,\n MEMBERSHIP_TYPE_MAPPING,\n SELF_DESCRIBE_NEW_GRADUATE,\n} from '../../../../utils/constants';\nimport ContactFormSelfDescribeRadio from '../SelfDescribe/Radio/Radio';\n\nconst RadioGroupWithError = WithFormContext(WithErrorHelper(WithController(RadioGroup)));\n\ninterface ContactFormMembershipType {\n hideNewGrad?: boolean;\n membershipStatus?: string;\n}\n\nconst ContactFormMembershipType = (props: ContactFormMembershipType): JSX.Element => {\n const classes = MembershipTypeRadioGroupStyle();\n const options = props.hideNewGrad\n ? JOIN_SELF_DESCRIBE_OPTIONS.filter((option) => option.value !== SELF_DESCRIBE_NEW_GRADUATE)\n : JOIN_SELF_DESCRIBE_OPTIONS;\n\n return (\n \n {options.map((option, index) => {\n const caption = [\n 'You will be ',\n props.membershipStatus === CONTACT_STATUS.TERMINATED ? 'restarting your membership' : 'joining',\n ' as an ',\n {MEMBERSHIP_TYPE_MAPPING[option.value]} ,\n ' member.',\n ];\n return (\n \n );\n })}\n \n );\n};\n\nexport default ContactFormMembershipType;\n","import { makeStyles } from '@material-ui/core';\n\nexport const BorderedBoxStyle = makeStyles({\n root: {\n padding: '16px',\n },\n});\n\nexport const CaptionStyle = makeStyles({\n root: {\n padding: '10px 4px 10px 4px',\n },\n});\n\nexport const ContainerStyle = makeStyles(({ breakpoints }) => ({\n root: {\n paddingTop: '16px',\n paddingBottom: '16px',\n '&> div': {\n margin: 0,\n '& fieldset': {\n width: '100%',\n },\n '& .MuiTextField-root': {\n width: '100%',\n },\n [breakpoints.down('xs')]: {\n width: '100%',\n '&> .MuiGrid-item': {\n width: '100%',\n padding: '4px 0',\n },\n },\n },\n },\n}));\n\nexport const ErrorHelperStyle = makeStyles({\n root: {\n '& .Mui-error': {\n paddingLeft: '16px',\n },\n },\n});\n","import { FunctionComponent } from 'react';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport WithFormContext from '../../../hocs/WithFormContext/WithFormContext';\n\ninterface ConditionalFormPropertyRendererProps {\n formPropertyName: string;\n showValues: unknown[];\n formMethods?: UseFormMethods;\n}\n\nconst ConditionalFormPropertyRenderer: FunctionComponent = (\n props,\n): JSX.Element | null => {\n const property = useWatch({\n control: props.formMethods?.control,\n name: props.formPropertyName,\n defaultValue: props.formMethods?.getValues(props.formPropertyName),\n });\n\n const show = props.showValues.includes(property);\n\n return show ? (props.children as JSX.Element) : null;\n};\n\nexport default WithFormContext(ConditionalFormPropertyRenderer);\n","import { makeStyles } from '@material-ui/core';\n\nexport const InputStyles = makeStyles({\n root: {\n width: '100%',\n },\n});\n","import React, { useRef } from 'react';\nimport { UseFormMethods } from 'react-hook-form';\nimport { TextField, StandardTextFieldProps } from '@material-ui/core';\nimport { InputStyles } from './DateInput.styles';\n\ninterface InputProps extends StandardTextFieldProps {\n formMethods?: UseFormMethods;\n label: string;\n}\n\nconst DateInput = (props: InputProps): JSX.Element => {\n const dateInputClasses = InputStyles();\n const textInput = useRef(null);\n\n const { formMethods, ...otherProps } = props;\n return (\n \n );\n};\n\nexport default DateInput;\n","const countries = {\n ChinaShanghai: {\n value: 'China (Shanghai)',\n text: 'Select this option if you live or work in Shanghai.',\n },\n ChinaOthers: {\n value: 'China (Others)',\n text:\n 'Select this option if you live or work in China, excluding Shanghai. If you live or work in Hong Kong, please make that selection.',\n },\n HongKong: {\n value: 'Hong Kong',\n text:\n 'Select this option if you live or work in China, excluding Shanghai (select Shanghai option) and the Greater Bay Area of Hong Kong, including Hong Kong SAR, Macao SAR, Guangzhou, Shenzhen, Zhuhai, Foshan, Huizhou, Dongguan, Zhongshan, Jiangmen, or Zhaoqing, (select Hong Kong option).',\n },\n};\n\nexport default countries;\n","import React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport { useWatch } from 'react-hook-form';\nimport countries from 'utils/help-country-list';\n\nconst CountryHelp = (): JSX.Element | null => {\n const selectedCountry = (useWatch({\n name: 'country',\n }) as unknown) as string;\n let helpText = '';\n Object.entries(countries).forEach(([, val]) => {\n if (val.value === selectedCountry) {\n helpText = val.text;\n }\n });\n\n return helpText ? (\n \n \n {helpText}\n \n \n ) : null;\n};\n\nexport default CountryHelp;\n","import { Grid, MenuItem, Typography } from '@material-ui/core';\nimport React, { BaseSyntheticEvent } from 'react';\nimport { GlobalValue } from '../../../data_types/global-value';\nimport BorderedBox from '../../Common/BorderedBox/BorderedBox';\nimport ContactFormMembershipType from './MembershipType/MembershipType';\nimport ArrowedButton from '../../Common/ArrowedButton/ArrowedButton';\nimport WithInsideLoading from '../../../hocs/WithInsideLoading/WithInsideLoading';\nimport { BorderedBoxStyle, ErrorHelperStyle, ContainerStyle, CaptionStyle } from './Form.style';\nimport ConditionalFormPropertyRenderer from '../../Common/ConditionalFormPropertyRenderer/ConditionalFormPropertyRenderer';\nimport {\n MEMBERSHIP_COUNTRY_UNITED_STATES,\n SELF_DESCRIBE_ARCHITECT_DEGREE,\n SELF_DESCRIBE_AXP_ENROLLED,\n SELF_DESCRIBE_FACULTY_MEMBER,\n SELF_DESCRIBE_NEW_GRADUATE,\n SELF_DESCRIBE_NON_US_ARCHITECT,\n SELF_DESCRIBE_US_ARCHITECT,\n CONTACT_STATUS,\n SELF_DESCRIBE_SUPERVISION,\n} from '../../../utils/constants';\nimport WithFormContext from '../../../hocs/WithFormContext/WithFormContext';\nimport WithErrorHelper from '../../../hocs/WithErrorHelper/WithErrorHelper';\nimport Input from '../../Common/Input/Input';\nimport DateInput from '../../Common/DateInput/DateInput';\nimport Select from '../../Common/Select/Select';\nimport WithController from '../../../hocs/WithController/WithController';\nimport { UseFormMethods, useWatch } from 'react-hook-form';\nimport RadioGroup from '../../Common/RadioGroup/RadioGroup';\nimport Radio from '../../Common/Radio/Radio';\nimport CountryHelp from './CountryHelp';\n\nexport interface ContactFormComponentProps {\n countries: GlobalValue[];\n careerTypes: GlobalValue[];\n isLoading: boolean;\n hasError: boolean;\n membershipStatus: string;\n onSubmit?: (e?: BaseSyntheticEvent | undefined) => Promise;\n isDuesEstimator?: boolean;\n}\n\nconst ContactFormNextButton = WithInsideLoading(ArrowedButton);\nconst InputWithError = WithFormContext(WithErrorHelper(Input));\nconst DateWithError = WithFormContext(WithErrorHelper(DateInput));\nconst SelectWithError = WithFormContext(WithErrorHelper(WithController(Select)));\nconst RadioGroupWithError = WithFormContext(WithErrorHelper(WithController(RadioGroup)));\n\nconst NON_ALLIED = [\n SELF_DESCRIBE_US_ARCHITECT,\n SELF_DESCRIBE_NON_US_ARCHITECT,\n SELF_DESCRIBE_NEW_GRADUATE,\n SELF_DESCRIBE_AXP_ENROLLED,\n SELF_DESCRIBE_ARCHITECT_DEGREE,\n SELF_DESCRIBE_SUPERVISION,\n SELF_DESCRIBE_FACULTY_MEMBER,\n];\n\nconst SelectWithErrorEntity = (props: {\n entities: GlobalValue[];\n name: string;\n label: string;\n describedBy?: string;\n}): JSX.Element => {\n const { name, label, entities } = props;\n return (\n \n {entities.map((entity) => (\n \n {entity.value}\n \n ))}\n \n );\n};\n\nconst CountryField = (props: { countries: GlobalValue[] }): JSX.Element => (\n \n \n \n \n \n \n);\n\nconst ZipCodeField = (): JSX.Element => (\n \n \n \n \n \n \n \n);\n\ninterface GradDateFieldProps {\n formMethods?: UseFormMethods;\n}\n\nconst GradDateField = (props: GradDateFieldProps): JSX.Element => {\n const selfDescribe = useWatch({\n control: props.formMethods?.control,\n name: 'selfDescribe',\n defaultValue: props.formMethods?.getValues('selfDescribe'),\n });\n const required = selfDescribe !== SELF_DESCRIBE_AXP_ENROLLED;\n\n return (\n \n \n \n \n \n );\n};\n\ninterface AddressCustomFieldProps {\n name: string;\n label: string;\n required: boolean;\n [key: string]: string | Date | boolean | number | undefined;\n}\n\nconst AddressCustomField = (props: AddressCustomFieldProps): JSX.Element => {\n const { name, label, required, ...otherProps } = props;\n\n return (\n \n \n \n );\n};\n\nconst GradDateFieldWithFormContext = WithFormContext(GradDateField);\n\nconst LicenseDateField = (): JSX.Element => (\n \n \n \n \n \n);\n\nconst CareerTypeField = (props: { careerTypes: GlobalValue[] }): JSX.Element => (\n \n \n \n \n \n);\n\nconst ContactFormComponent = (props: ContactFormComponentProps): JSX.Element | null => {\n const borderedBoxClasses = BorderedBoxStyle();\n const errorHelperClasses = ErrorHelperStyle();\n const containerClasses = ContainerStyle();\n const captionClasses = CaptionStyle();\n\n const handleOnClick = (e: React.FormEvent): void => {\n props.onSubmit?.(e);\n };\n\n const hideNewGrad = props.membershipStatus === CONTACT_STATUS.TERMINATED;\n\n return (\n <>\n \n *\n \n Asterisks indicate required fields. \n \n >\n );\n};\n\nexport default ContactFormComponent;\n","import React, { Dispatch, SetStateAction, useContext, useEffect, useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { MembershipContext } from '../../../contexts/MembershipContext';\nimport { GlobalValue } from '../../../data_types/global-value';\nimport { Contact, MemberOrderResponse } from '../../../data_types/member-order';\nimport { UpdateContactRequest } from '../../../data_types/update-contact-request';\nimport { useExternalScript } from '../../../hooks/use-external-script';\nimport {\n CONTACT_STATUS,\n DEFAULT_MODAL_CONTENT,\n INVALID_SESSION_MODAL_CONTENT,\n LOCAL_STORAGE_DUES_ESTIMATOR_VALUES_KEY,\n MEMBERSHIP_TYPE_MAPPING,\n SELF_DESCRIBE_NEW_GRADUATE,\n SESSION_INVALID_ERROR,\n} from '../../../utils/constants';\nimport { ContactFormDefaultValues, generateContactFormOptions } from '../../../utils/generate-contact-form-options';\nimport { generateContactFormSchema } from '../../../utils/generate-contact-form-schema';\nimport getMembershipInfo from '../../../utils/get-membership-info';\nimport updateContact from '../../../utils/update-contact';\nimport { DuesEstimatorData } from '../../DuesEstimator/DuesEstimator';\nimport ContactFormComponent from './FormComponent';\nimport { ModalAttributes } from 'data_types/modal';\n\nexport interface ContactFormProps {\n contact: Contact;\n countries: GlobalValue[];\n careerTypes: GlobalValue[];\n setMembershipInfo?: Dispatch>;\n setModalOptions?: Dispatch>;\n onSubmit?: () => void;\n}\n\ninterface ContactFormData {\n [key: string]: string | Date | boolean | undefined;\n selfDescribe: string;\n country: string;\n careerType?: string;\n zipCode?: string;\n gradDate?: Date;\n licenseDate?: Date;\n addressStreet: string;\n addressStreetLine2?: string;\n addressCity: string;\n addressState: string;\n addressCountry: string;\n addressZipCode: string;\n}\n\ninterface Address {\n street: string;\n city: string;\n state: string;\n country: string;\n zipCode: string;\n}\n\nconst isDirty = (data: ContactFormData, defaultValues: ContactFormDefaultValues): boolean => {\n const hasDirtyValues: boolean = [\n 'country',\n 'careerType',\n 'zipCode',\n 'gradDate',\n 'licenseDate',\n 'addressStreet',\n 'addressCity',\n 'addressState',\n 'addressZipCode',\n 'addressCountry',\n ]\n .map((key) => data[key] !== undefined && data[key] !== defaultValues[key])\n .some((value) => value === true);\n\n return data.selfDescribe !== defaultValues.selfDescribe || hasDirtyValues;\n};\n\nconst updateContactBody = (\n data: ContactFormData,\n contact: Contact,\n orderDoesntExists: boolean,\n): UpdateContactRequest => {\n return {\n AIA_Membership_Country_Picklist__c: data.country,\n AIA_Career_Type__c: data.careerType || contact.careerType,\n AIA_Membership_Zip_Code_Assignment__c: data.zipCode || null,\n AIA_Join_SelfDescribe__c: data.selfDescribe,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n AIA_Membership_Type__c: MEMBERSHIP_TYPE_MAPPING[data.selfDescribe]!,\n AIA_Join_Grad_Date__c: data.gradDate ? data.gradDate.toISOString().slice(0, 10) : contact.joinGradDate,\n AIA_Join_License_Date__c: data.licenseDate\n ? data.licenseDate.toISOString().slice(0, 10)\n : contact.joinLicenseDate,\n AIA_Mailing_Address_Street__c: data.addressStreetLine2\n ? data.addressStreet + ' ' + data.addressStreetLine2\n : data.addressStreet,\n AIA_Mailing_Address_City__c: data.addressCity,\n AIA_Mailing_Address_State__c: data.addressState,\n AIA_Mailing_Address_Zip__c: data.addressZipCode,\n AIA_Mailing_Address_Country__c: data.addressCountry,\n bundle__c: orderDoesntExists.toString(),\n };\n};\n\nconst getDefaultValues = (contact: Contact): ContactFormDefaultValues => {\n const duesEstimatorDefaultValues: DuesEstimatorData =\n !contact.joinSelfDescribe && JSON.parse(localStorage.getItem(LOCAL_STORAGE_DUES_ESTIMATOR_VALUES_KEY) || '{}');\n\n const selfDescribe = contact.joinSelfDescribe || duesEstimatorDefaultValues.selfDescribe || '';\n const defaultSelfDescribe =\n contact.membershipStatus === CONTACT_STATUS.TERMINATED && selfDescribe === SELF_DESCRIBE_NEW_GRADUATE\n ? ''\n : selfDescribe;\n\n return {\n selfDescribe: defaultSelfDescribe,\n country: '',\n careerType:\n contact.careerType && contact.careerType !== 'None Selected'\n ? contact.careerType\n : duesEstimatorDefaultValues.careerType || '',\n zipCode: '',\n gradDate: contact.joinGradDate || duesEstimatorDefaultValues.gradDate?.slice(0, 10) || '',\n licenseDate: contact.joinLicenseDate || duesEstimatorDefaultValues.licenseDate?.slice(0, 10) || '',\n };\n};\n\nconst extractAddress = (address: google.maps.GeocoderAddressComponent[]): Address => {\n let street = '';\n let city = '';\n let state = '';\n let country = '';\n let zipCode = '';\n\n for (const component of address as google.maps.GeocoderAddressComponent[]) {\n const componentType = component.types[0];\n\n switch (componentType) {\n case 'street_number': {\n street = `${component.long_name} ${street}`;\n break;\n }\n\n case 'route': {\n street += component.short_name;\n break;\n }\n\n case 'postal_code': {\n zipCode = `${component.long_name}${zipCode}`;\n break;\n }\n\n case 'postal_code_suffix': {\n zipCode = `${zipCode}-${component.long_name}`;\n break;\n }\n\n case 'locality':\n city = component.long_name;\n break;\n\n case 'administrative_area_level_1': {\n state = component.short_name;\n break;\n }\n\n case 'country':\n country = component.long_name;\n break;\n }\n }\n return { street, city, state, country, zipCode };\n};\n\nconst ContactForm = (props: ContactFormProps): JSX.Element | null => {\n const [isLoading, setIsLoading] = useState(false);\n const [hasError, setHasError] = useState(false);\n const { membershipInfo, setMembershipInfo } = useContext(MembershipContext);\n const externalScript = `https://maps.googleapis.com/maps/api/js?key=${process.env.REACT_APP_GOOGLE_MAPS_KEY}&libraries=places`;\n const state = useExternalScript(externalScript);\n\n let autocomplete: google.maps.places.Autocomplete | null = null;\n let address2Field: HTMLInputElement;\n\n const defaultValues = getDefaultValues(props.contact);\n\n const schema = generateContactFormSchema();\n const formOptions = generateContactFormOptions({\n resolver: schema,\n defaultValues,\n });\n\n const formMethods = useForm(formOptions);\n\n const handlePlaceSelect = (): void => {\n const addressObject = (autocomplete as google.maps.places.Autocomplete).getPlace();\n const address = addressObject.address_components;\n if (address) {\n const selectedAddress = extractAddress(address);\n formMethods.setValue('addressStreet', selectedAddress.street);\n formMethods.setValue('addressCity', selectedAddress.city);\n formMethods.setValue('addressState', selectedAddress.state);\n formMethods.setValue('addressZipCode', selectedAddress.zipCode);\n formMethods.setValue('addressCountry', selectedAddress.country);\n }\n address2Field.focus();\n };\n\n useEffect(() => {\n if (state === 'ready') {\n address2Field = document.getElementById('addressStreetLine2') as HTMLInputElement;\n const autocompleteInput = document.getElementById('autocomplete') as HTMLInputElement;\n autocomplete = new google.maps.places.Autocomplete(autocompleteInput, {});\n autocomplete.addListener('place_changed', handlePlaceSelect);\n }\n }, [state]);\n\n const onSubmitHandler = async (data: ContactFormData): Promise => {\n try {\n setIsLoading(true);\n if (isDirty(data, defaultValues) || !membershipInfo?.order?.order) {\n await updateContact(\n props.contact.id,\n updateContactBody(data, props.contact, !membershipInfo?.order?.order),\n );\n const newMembershipInfo = await getMembershipInfo();\n setMembershipInfo(newMembershipInfo);\n }\n props.onSubmit?.();\n } catch (error) {\n setHasError(true);\n if (error === SESSION_INVALID_ERROR) {\n props.setModalOptions?.({ ...INVALID_SESSION_MODAL_CONTENT, isOpen: true });\n } else {\n props.setModalOptions?.({ ...DEFAULT_MODAL_CONTENT, isOpen: true });\n }\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n \n \n \n );\n};\n\nexport default ContactForm;\n","import { makeStyles } from '@material-ui/core';\nimport theme from '../utils/theme';\n\nexport const StepperStyle = makeStyles({\n root: {\n paddingTop: '15px',\n },\n});\n\nexport const StepperLabelStyle = makeStyles({\n labelContainer: { marginLeft: '25px' },\n label: {\n color: theme.palette.primary.main + '!important',\n '&:hover': {\n textDecoration: 'underline',\n },\n },\n});\n\nexport const StepperContentStyle = makeStyles({\n transition: { marginLeft: '25px' },\n});\n\nexport const StepperIconStyle = makeStyles((theme) => ({\n root: {\n backgroundColor: '#ccc',\n zIndex: 1,\n color: '#fff',\n width: 25,\n height: 25,\n display: 'flex',\n borderRadius: '50%',\n justifyContent: 'center',\n alignItems: 'center',\n },\n active: {\n backgroundColor: theme.palette.primary.main,\n },\n completed: {\n backgroundColor: theme.palette.primary.main,\n },\n}));\n","import { makeStyles } from '@material-ui/core';\n\nexport const DisclaimerStyle = makeStyles({\n root: {\n padding: '25px 0',\n },\n});\n","import { Link, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { DisclaimerStyle } from './NonPayableZipCodeDisclaimer.style';\n\nconst NonPayableZipCodeDisclaimer = (): JSX.Element => {\n const disclaimerClasses = DisclaimerStyle();\n\n return (\n \n The zip code you have entered may provide you with alternative chapter membership options.{' '}\n \n Learn more\n \n \n );\n};\n\nexport default NonPayableZipCodeDisclaimer;\n","const EXCLUDED_ZIPCODES = [\n '66012',\n '66018',\n '66021',\n '66030',\n '66031',\n '66051',\n '66061',\n '66062',\n '66063',\n '66083',\n '66085',\n '66101',\n '66102',\n '66103',\n '66104',\n '66105',\n '66106',\n '66109',\n '66110',\n '66111',\n '66112',\n '66113',\n '66115',\n '66117',\n '66118',\n '66119',\n '66160',\n '66201',\n '66202',\n '66203',\n '66204',\n '66205',\n '66206',\n '66207',\n '66208',\n '66209',\n '66210',\n '66211',\n '66212',\n '66213',\n '66214',\n '66215',\n '66216',\n '66217',\n '66218',\n '66219',\n '66220',\n '66221',\n '66222',\n '66223',\n '66224',\n '66225',\n '66226',\n '66227',\n '66250',\n '66251',\n '66276',\n '66282',\n '66283',\n '66285',\n '66286',\n];\n\nconst isZipCodePayable = (zipCode: string | null | undefined): boolean => {\n return !EXCLUDED_ZIPCODES.includes(zipCode || '');\n};\n\nexport default isZipCodePayable;\n","import { Stepper, Step, StepLabel, StepContent, StepButton } from '@material-ui/core';\nimport { AttachMoney, Check, Person } from '@material-ui/icons';\nimport React from 'react';\nimport VerticalSplit from '../components/Common/VerticalSplit/VerticalSplit';\nimport ContactForm from '../components/Contact/Form/Form';\nimport MembershipSidebar from '../components/Membership/Sidebar/Sidebar';\nimport Order from '../components/Order/Order';\nimport { GlobalValue } from '../data_types/global-value';\nimport { MemberOrderResponse } from '../data_types/member-order';\nimport clsx from 'clsx';\nimport { StepIconProps } from '@material-ui/core';\nimport { StepperIconStyle, StepperStyle, StepperLabelStyle, StepperContentStyle } from './Join.style';\nimport InfoTile from '../components/Common/InfoTile/InfoTile';\nimport Help from '../components/Common/Help/Help';\nimport Disclosures from '../components/Common/Disclosures/Disclosures';\nimport TaxesTile from '../components/Common/TaxesTile/TaxesTile';\nimport WithBackdropContext from '../hocs/WithBackdropContext/WithBackdropContext';\nimport { BackdropContext } from '../contexts/BackdropContext';\nimport { ModalContext } from '../contexts/ModalContext';\nimport { CONTACT_STATUS } from '../utils/constants';\nimport NonPayableZipCodeDisclaimer from '../components/NonPayableZipCodeDisclaimer/NonPayableZipCodeDisclaimer';\nimport isZipCodePayable from '../utils/is-zip-code-payable';\n\ninterface ScreensJoinProps {\n membershipInfo?: MemberOrderResponse;\n countries?: GlobalValue[];\n careerTypes?: GlobalValue[];\n}\n\ninterface LeftSideProps {\n membershipInfo: MemberOrderResponse;\n countries: GlobalValue[];\n careerTypes: GlobalValue[];\n}\n\ninterface StepsProps extends LeftSideProps {\n activeStep: number;\n handleStep: (step: number) => void;\n}\ninterface RightSideProps {\n membershipInfo: MemberOrderResponse;\n}\n\nconst ContactFormWithModal = WithBackdropContext('modal', ModalContext, ContactForm);\nconst OrderWithContext = WithBackdropContext(\n 'backdrop',\n BackdropContext,\n WithBackdropContext('modal', ModalContext, Order),\n);\n\nconst JoinStepperIcon = (props: StepIconProps): JSX.Element => {\n const { active, completed, icon } = props;\n const classes = StepperIconStyle();\n\n const stepperIcons: { [key: string]: JSX.Element } = {\n 1: ,\n 2: ,\n };\n\n const completedIcon = ;\n\n return (\n \n {completed ? completedIcon : stepperIcons[String(icon)]}\n
\n );\n};\n\nconst JoinStepLabel = (label: string): JSX.Element => {\n const labelClasses = StepperLabelStyle();\n\n return (\n \n {label}\n \n );\n};\n\nconst JoinStepContent = (content: JSX.Element): JSX.Element => {\n const contentClasses = StepperContentStyle();\n\n return {content} ;\n};\n\nconst Steps = (props: StepsProps): { label: string; content: JSX.Element }[] => {\n const showPaymentDisclaimer = !isZipCodePayable(props.membershipInfo.contact.membershipZipAssignment);\n\n return [\n {\n label: 'Primary information',\n content: (\n props.handleStep(props.activeStep + 1)}\n />\n ),\n },\n {\n label: 'Order summary',\n content: showPaymentDisclaimer ? (\n \n ) : (\n \n ),\n },\n ];\n};\n\nconst LeftSide = (props: LeftSideProps): JSX.Element | null => {\n const stepperClasses = StepperStyle();\n\n const [activeStep, setActiveStep] = React.useState(0);\n\n const handleStep = (stepIndex: number): void => {\n setActiveStep(stepIndex);\n };\n\n const steps = Steps({ ...props, activeStep, handleStep });\n\n return (\n \n {steps.map((step, index) => {\n return (\n \n handleStep(index)}>{JoinStepLabel(step.label)} \n {JoinStepContent(step.content)}\n \n );\n })}\n \n );\n};\n\nconst RightSide = (props: RightSideProps): JSX.Element | null => {\n return (\n \n \n \n \n \n \n \n \n \n );\n};\n\nconst ScreensJoin = (props: ScreensJoinProps): JSX.Element | null => {\n if (!props.membershipInfo || !props.countries || !props.careerTypes) {\n return null;\n }\n\n const title =\n props.membershipInfo.contact.membershipStatus === CONTACT_STATUS.TERMINATED\n ? 'Restart your membership'\n : 'Welcome to AIA';\n\n return (\n \n }\n right={ }\n />\n );\n};\n\nexport default ScreensJoin;\n","import React from 'react';\nimport { MemberOrderResponse } from '../../data_types/member-order';\nimport { Link, Typography } from '@material-ui/core';\n\ninterface ScreensActiveProps {\n membershipInfo?: MemberOrderResponse;\n}\n\nconst getExpireDate = (membershipInfo: MemberOrderResponse | undefined): number | undefined => {\n return membershipInfo &&\n membershipInfo.contact &&\n membershipInfo.contact?.membershipExpireDate &&\n membershipInfo.contact?.membershipExpireDate !== ''\n ? new Date(membershipInfo.contact.membershipExpireDate).getFullYear()\n : undefined;\n};\n\nconst ScreensActive = (props: ScreensActiveProps): JSX.Element => {\n const expireDate = getExpireDate(props.membershipInfo);\n\n return (\n \n \n {expireDate\n ? `According to our records, your membership is active and is due to expire on 12/31/${expireDate}. No further action is required at this time.`\n : 'According to our records, your membership is active. No further action is required at this time.'}\n
\n \n Should you like to verify this, please reach out to us by phone (800) 242 3837 (option 2) or email us at{' '}\n membersupport@aia.org\n
\n \n );\n};\n\nexport default ScreensActive;\n","import { makeStyles } from '@material-ui/core';\n\nexport const CustomBackdropStyle = makeStyles((theme) => ({\n root: {\n zIndex: theme.zIndex.drawer + 1,\n color: '#fff',\n },\n}));\n","import React, { useEffect, useState } from 'react';\nimport { Backdrop, CircularProgress } from '@material-ui/core';\nimport { CustomBackdropStyle } from './CustomBackdrop.style';\n\ninterface BackdropProps {\n backdropOptions?: { isOpen: boolean; child: JSX.Element; action?: Promise };\n}\n\nconst CustomBackdrop = (props: BackdropProps): JSX.Element | null => {\n const classes = CustomBackdropStyle();\n\n const [loading, setLoading] = useState(true);\n const backdropOptions = props.backdropOptions || { isOpen: false, child: };\n\n useEffect(() => {\n const executeAction = async (): Promise => {\n if (backdropOptions?.action) {\n await backdropOptions.action;\n setLoading(false);\n }\n };\n\n executeAction();\n });\n\n const isOpened = backdropOptions.isOpen && loading;\n return isOpened ? (\n \n {backdropOptions.child}\n \n ) : null;\n};\n\nexport default CustomBackdrop;\n","import { API } from 'aws-amplify';\n\nexport interface ContactStatus {\n email: string;\n status: string | null;\n legacyId: string;\n cesAudit: string | null;\n renewYear: number | null;\n renewEligibleYears: number[];\n epaymentStatus: string;\n deceased: boolean;\n}\n\nconst getContactStatuses = async (email: string): Promise => {\n const response = await API.get('membership', `/users?email=${email}`, {});\n\n return response.data;\n};\n\nexport default getContactStatuses;\n","import { makeStyles } from '@material-ui/core';\n\nexport const LandingStyle = makeStyles(() => ({\n form: {\n zIndex: 2,\n },\n box: {\n textAlign: 'center',\n '& fieldset.MuiFormControl-root, button': {\n width: '100%',\n padding: '16px 0',\n },\n },\n}));\n","import { makeStyles } from '@material-ui/core';\n\nexport const HeaderStyle = makeStyles((theme) => ({\n root: {\n backgroundColor: theme.palette.secondary.dark,\n color: '#fff',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: '40px',\n },\n}));\n\nexport const BoxStyle = (width?: string): Record => {\n return makeStyles({\n root: {\n width: width || '400px',\n },\n borderedBox: {\n borderTop: 'none',\n padding: '25px 60px',\n },\n })();\n};\n","import { Typography } from '@material-ui/core';\nimport React from 'react';\nimport BorderedBox from '../BorderedBox/BorderedBox';\nimport { BoxStyle, HeaderStyle } from './BoxWithTitle.style';\n\ninterface BoxWithTitleProps extends React.HTMLAttributes {\n title: string;\n width?: string;\n children: React.ReactNode[] | React.ReactNode;\n}\n\nconst BoxWithTitle = (props: BoxWithTitleProps): JSX.Element => {\n const headerClasses = HeaderStyle();\n const boxClasses = BoxStyle(props.width);\n\n return (\n \n
\n {props.title} \n
\n
{props.children} \n
\n );\n};\n\nexport default BoxWithTitle;\n","import { makeStyles } from '@material-ui/core';\n\nexport const GridStyle = makeStyles({\n root: {\n '& > div': {\n width: '100%',\n textAlign: 'center',\n '& .MuiFormControl-root, button': {\n width: '100%',\n },\n '& button': {\n marginBottom: '10px',\n },\n },\n },\n});\n","import { Grid } from '@material-ui/core';\nimport React from 'react';\nimport { GridStyle } from './SimpleForm.style';\n\ninterface SimpleFormProps extends React.HTMLAttributes {\n spacing?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;\n}\n\nconst SimpleForm = (props: SimpleFormProps): JSX.Element => {\n const gridClasses = GridStyle();\n const { spacing, ...otherProps } = props;\n\n return (\n \n {Array.isArray(props.children) ? (\n props.children.map((item, index) => (\n \n {item}\n \n ))\n ) : (\n {props.children} \n )}\n \n );\n};\n\nexport default SimpleForm;\n","import { makeStyles } from '@material-ui/core';\n\nexport const LandingBoxStyle = makeStyles(({ palette }) => ({\n root: {\n width: 'auto',\n '& .MuiPaper-root': {\n borderBottom: 'none',\n },\n '& button.action-button': {\n margin: '15px 0 5px 0',\n },\n zIndex: 2,\n },\n footer: {\n padding: '15px',\n textAlign: 'center',\n backgroundColor: palette.secondary.main,\n width: '400px',\n border: '1px solid rgba(0, 0, 0, 0.12)',\n borderTop: 'none',\n },\n}));\n","/* eslint-disable react/no-unescaped-entities */\nimport { Grid, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport BoxWithTitle from '../Common/BoxWithTitle/BoxWithTitle';\nimport SimpleForm from '../Common/SimpleForm/SimpleForm';\nimport { LandingBoxStyle } from './LandingBox.style';\n\nconst LandingBox = (props: { title: string; children?: JSX.Element | JSX.Element[] }): JSX.Element => {\n const classes = LandingBoxStyle();\n\n return (\n \n \n \n \n {props.children}\n \n \n \n \n \n \n Don't have access to your account?\n \n \n \n \n );\n};\n\nexport default LandingBox;\n","import { Typography } from '@material-ui/core';\nimport { Auth } from 'aws-amplify';\nimport React from 'react';\nimport { ContactStatus } from '../../utils/get-contact-statuses';\nimport ArrowedButton from '../Common/ArrowedButton/ArrowedButton';\nimport PlainButton from '../Common/PlainButton/PlainButton';\nimport LandingBox from './LandingBox';\nimport { membershipCondition } from '../../utils/membership-condition';\n\nconst handleSignIn = (e: React.MouseEvent, callToAction?: string, email?: string): void => {\n e.preventDefault();\n Auth.federatedSignIn({\n customProvider: 'COGNITO',\n customState: email,\n });\n};\n\nexport const handleGoToAia = (): void => {\n window.location.href = 'https://aia.org';\n};\n\nconst getCallToActionName = (\n contactStatus: ContactStatus,\n): [(string | JSX.Element)[], string | undefined, string | undefined] => {\n const foundMessage = ['We found an AIA account for ', {contactStatus.email} , '.'];\n const notFoundMessage = [\n 'The account for ',\n {contactStatus.email} ,\n ' is already active. No action is required until the next membership renewal period.',\n ];\n const cesAuditFailedMessage = [\n 'We found an AIA account for ',\n {contactStatus.email} ,\n \". Your record is under audit for not meeting AIA's education requirements, and are not eligible to renew till this has been corrected. Please contact member services at (800) AIA 3837.\",\n ];\n const underCesAuditMessage = [\n 'You are currently under AIA CES audit for failure to meet your annual continuing education requirement. Your membership is not currently eligible for renewal. Please contact ',\n \n ces@aia.org\n ,\n ' for more details.',\n ];\n const deceasedMessage = ['This member is not eligible to renew because is marked as deceased.'];\n const epaymentInProgressOrPendingMessage = [\n 'Payment for your dues is already in progress. To avoid duplicate charges, please allow 3-4 days for the transaction to be completed.',\n ];\n const underAuditTitle = 'Under Audit';\n const epaymentInProgressOrPendingMessageTitle = 'Payment in Progress';\n const condition = membershipCondition(\n contactStatus.status || '',\n contactStatus.cesAudit,\n contactStatus.renewYear,\n contactStatus.renewEligibleYears,\n contactStatus.epaymentStatus,\n contactStatus.deceased,\n );\n\n switch (condition) {\n case 'renew':\n return [foundMessage, 'Renew your membership', undefined];\n case 'restart':\n return [foundMessage, 'Restart your membership', undefined];\n case 'join':\n return [foundMessage, 'Join AIA', undefined];\n case 'ces-audit':\n return [cesAuditFailedMessage, undefined, undefined];\n case 'under-audit':\n return [underCesAuditMessage, undefined, underAuditTitle];\n case 'deceased':\n return [deceasedMessage, undefined, undefined];\n case 'epayment-in-progress-or-pending':\n return [epaymentInProgressOrPendingMessage, undefined, epaymentInProgressOrPendingMessageTitle];\n default:\n return [notFoundMessage, undefined, undefined];\n }\n};\n\nconst LandingAccountFound = (props: { contactStatus: ContactStatus; onBack: () => void }): JSX.Element | null => {\n const [message, callToAction, titleName] = getCallToActionName(props.contactStatus);\n\n return (\n \n \n {message}\n \n\n handleSignIn(e, callToAction, props.contactStatus?.email)\n : handleGoToAia\n }\n />\n props.onBack()} />\n \n );\n};\n\nexport default LandingAccountFound;\n","import { generateState } from './generate-state';\n\nconst redirectToJoin = (): void => {\n const redirectUri = `${window.location.protocol}//${window.location.host}`;\n const clientId = process.env.REACT_APP_WEBCLIENT_ID;\n const scope = ['phone', 'email', 'profile', 'openid', process.env.REACT_APP_AUTH_MEMBERSHIP_SCOPE].join(' ');\n const state = generateState();\n\n window.location.assign(\n `https://${process.env.REACT_APP_AUTH_DOMAIN}/signup?redirect_uri=${redirectUri}&response_type=code&client_id=${clientId}&scope=${scope}&state=${state}`,\n );\n};\n\nexport default redirectToJoin;\n","export const generateState = (): string => {\n return Math.random().toString(16).substr(2, 8);\n};\n","/* eslint-disable react/no-unescaped-entities */\nimport { Typography } from '@material-ui/core';\nimport React from 'react';\nimport redirectToJoin from '../../utils/redirect-to-join';\nimport ArrowedButton from '../Common/ArrowedButton/ArrowedButton';\nimport PlainButton from '../Common/PlainButton/PlainButton';\nimport LandingBox from './LandingBox';\n\nconst handleJoin = (): void => {\n redirectToJoin();\n};\n\nconst LandingAccountNotFound = (props: { email: string; onBack: () => void }): JSX.Element => {\n return (\n \n <>\n \n Are you new here?\n \n \n If you are attempting to renew an existing membership or reactivate a former membership, go back and\n enter the email associated with your account.\n \n \n If you are joining AIA for the first time, create an account for {props.email} \n \n \n If you have any questions, please contact: 800 242 3837 Option 2\n \n \n props.onBack()} />\n >\n \n );\n};\n\nexport default LandingAccountNotFound;\n","/* eslint-disable react/no-unescaped-entities */\nimport { Typography } from '@material-ui/core';\nimport React from 'react';\nimport WithErrorHelper from '../../hocs/WithErrorHelper/WithErrorHelper';\nimport WithFormContext from '../../hocs/WithFormContext/WithFormContext';\nimport WithInsideLoading from '../../hocs/WithInsideLoading/WithInsideLoading';\nimport { ContactStatus } from '../../utils/get-contact-statuses';\nimport ArrowedButton from '../Common/ArrowedButton/ArrowedButton';\nimport Input from '../Common/Input/Input';\nimport { LandingStyle } from './LandingHome.style';\nimport LandingAccountFound from './LandingAccountFound';\nimport LandingAccountNotFound from './LandingAccountNotFound';\nimport BoxWithTitle from '../Common/BoxWithTitle/BoxWithTitle';\n\nconst InputWithError = WithFormContext(WithErrorHelper(Input));\nconst ButtonWithLoading = WithInsideLoading(ArrowedButton);\n\nexport interface LandingHomeComponentProps {\n onSubmit: (e?: React.BaseSyntheticEvent | undefined) => Promise;\n onBack: () => void;\n status: null | 'Found' | 'Not-Found';\n email: string;\n contactStatus: null | ContactStatus;\n loading: boolean;\n}\n\nconst LandingHomeComponent = (props: LandingHomeComponentProps): JSX.Element => {\n const classes = LandingStyle();\n\n const handleFormSubmit = (event: React.FormEvent): void => {\n event.preventDefault();\n props.onSubmit(event);\n };\n\n return props.status === null ? (\n \n ) : props.status === 'Not-Found' ? (\n \n ) : (\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n \n );\n};\n\nexport default LandingHomeComponent;\n","const getUserEmail = async (sfid: string): Promise<{ email: string }> => {\n const response = await fetch(`${process.env.REACT_APP_API_URL}/users/email/${sfid}`);\n return await response.json();\n};\n\nexport default getUserEmail;\n","import React, { useEffect, useState } from 'react';\nimport Joi from 'joi';\nimport { joiResolver } from '@hookform/resolvers/joi';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport getContactStatuses, { ContactStatus } from '../../utils/get-contact-statuses';\nimport LandingHomeComponent from './LandingHomeComponent';\nimport getUserEmail from '../../utils/get-preferred-email';\nimport useQuery from '../../hooks/use-query';\n\nconst requiredMessage = 'This information is required.';\nconst invalidEmailMessage = 'Email must be valid.';\n\nconst LandingHome = (): JSX.Element => {\n const [loading, setLoading] = useState(false);\n const [status, setStatus] = useState(null as null | 'Found' | 'Not-Found');\n const [contactStatus, setContactStatus] = useState(null as null | ContactStatus);\n const [email, setEmail] = useState('' as string);\n const [wasPreferredEmailFetched, setWasPreferredEmailFetched] = useState(false);\n\n const formMethods = useForm({\n resolver: joiResolver(\n Joi.object({\n email: Joi.string()\n .email({ tlds: { allow: false } })\n .required(),\n }).prefs({\n messages: {\n 'string.empty': requiredMessage,\n 'string.email': invalidEmailMessage,\n },\n }),\n ),\n });\n\n const query = useQuery();\n useEffect(() => {\n const sfid = query.get('ck');\n if (sfid && !wasPreferredEmailFetched) {\n getUserEmail(sfid).then(({ email }) => {\n formMethods.setValue('email', email);\n });\n setWasPreferredEmailFetched(true);\n }\n }, [query, formMethods, wasPreferredEmailFetched]);\n\n const getContactStatus = async (data: { email: string }): Promise => {\n try {\n setLoading(true);\n setEmail(data.email);\n\n const statuses = await getContactStatuses(data.email);\n if (!statuses.length) {\n setStatus('Not-Found');\n } else {\n setContactStatus(statuses[0]);\n setStatus('Found');\n }\n } catch (error) {\n formMethods.setError('email', {\n type: 'manual',\n message: 'Something went wrong. Please try again later.',\n });\n } finally {\n setLoading(false);\n }\n };\n\n const handleBack = (): void => {\n setStatus(null);\n };\n\n return (\n \n \n \n );\n};\n\nexport default LandingHome;\n","import { makeStyles } from '@material-ui/core';\n\nexport const HomeStyle = makeStyles(({ breakpoints }) => ({\n root: {\n margin: 'auto',\n [breakpoints.down('sm')]: {\n marginTop: '25px',\n },\n [breakpoints.up('sm')]: {\n marginTop: 'auto',\n },\n },\n}));\n","/* eslint-disable react/no-unescaped-entities */\nimport { Grid } from '@material-ui/core';\nimport React from 'react';\nimport LandingHome from '../components/LandingHome/LandingHome';\nimport { HomeStyle } from './Home.style';\n\nconst ScreensHome = (): JSX.Element | null => {\n const classes = HomeStyle();\n\n return (\n \n \n \n );\n};\n\nexport default ScreensHome;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Joi from 'joi';\nimport { joiResolver } from '@hookform/resolvers/joi';\nimport { Resolver } from 'react-hook-form';\n\nconst requiredMessage = 'This information is required.';\nconst joiSchemaMessages = {\n 'string.empty': requiredMessage,\n};\n\nexport const generateAccountRecoverySchema = (): Resolver, object> => {\n return joiResolver(\n Joi.object({\n action: Joi.string().valid().required(),\n }).prefs({\n messages: joiSchemaMessages,\n }),\n );\n};\n","import { makeStyles } from '@material-ui/core';\n\nexport const GridStyle = makeStyles({\n root: {\n '& .full-width': {\n width: '100%',\n '& p': {\n textAlign: 'center',\n },\n '& button': {\n width: '100%',\n },\n },\n },\n});\n","/* eslint-disable react/no-unescaped-entities */\nimport { FormHelperText, Grid } from '@material-ui/core';\nimport React, { FormEvent } from 'react';\nimport WithFormContext from '../../hocs/WithFormContext/WithFormContext';\nimport WithController from '../../hocs/WithController/WithController';\nimport ArrowedButton from '../Common/ArrowedButton/ArrowedButton';\nimport BoxWithTitle from '../Common/BoxWithTitle/BoxWithTitle';\nimport Radio from '../Common/Radio/Radio';\nimport RadioGroup from '../Common/RadioGroup/RadioGroup';\nimport { GridStyle } from './AccountRecovery.style';\ninterface AccountRecoveryComponentProps {\n errors: boolean;\n onSubmit: (event: FormEvent) => void;\n}\n\nconst RadioGroupWithController = WithFormContext(WithController(RadioGroup));\n\nconst AccountRecoveryComponent = (props: AccountRecoveryComponentProps): JSX.Element => {\n const classes = GridStyle();\n\n return (\n \n \n \n );\n};\n\nexport default AccountRecoveryComponent;\n","import React, { useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { generateAccountRecoverySchema } from '../../utils/generate-account-recovery-schema';\nimport AccountRecoveryComponent from './AccountRecoveryComponent';\nimport { useHistory } from 'react-router-dom';\n\nconst AccountRecovery = (): JSX.Element => {\n const formMethods = useForm({ resolver: generateAccountRecoverySchema(), defaultValues: { action: '' } });\n const history = useHistory();\n const [errors, setErrors] = useState(false);\n\n const onSubmitHandler = (data: { action: string }): void => {\n if (data.action === 'forgotPassword') {\n window.location.assign(`https://${process.env.REACT_APP_AUTH_DOMAIN}/forgot-password`);\n } else {\n history.push('/account-recovery-attempt');\n }\n };\n\n const onErrorHandler = (): void => {\n setErrors(true);\n };\n\n return (\n \n \n \n );\n};\n\nexport default AccountRecovery;\n","import React from 'react';\nimport AccountRecoveryContainer from '../components/AccountRecovery/AccountRecovery';\n\nconst AccountRecovery = (): JSX.Element => {\n return ;\n};\n\nexport default AccountRecovery;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Joi from 'joi';\nimport { joiResolver } from '@hookform/resolvers/joi';\nimport { Resolver } from 'react-hook-form';\n\nconst requiredMessage = 'This information is required.';\nconst validDateMessage = 'Date is not valid.';\nconst joiSchemaMessages = {\n 'string.empty': requiredMessage,\n 'date.base': validDateMessage,\n};\n\nconst stepCondition = (step: number, stepLimit: number, condition: Joi.AnySchema): Joi.AnySchema => {\n return step >= stepLimit ? condition : Joi.valid();\n};\n\nconst emailCondition = (step: number): Joi.AnySchema => {\n return stepCondition(\n step,\n 3,\n Joi.string()\n .email({ tlds: { allow: false } })\n .required(),\n );\n};\n\nconst confirmEmailCondition = (step: number): Joi.AnySchema => {\n return stepCondition(\n step,\n 3,\n Joi.any()\n .equal(Joi.ref('email'))\n .required()\n .label('Confirm email')\n .options({ messages: { 'any.only': '{{#label}} does not match' } }),\n );\n};\n\nexport const generateRecoveryAttemptFormSchema = (step: 1 | 2 | 3): Resolver, object> => {\n return joiResolver(\n Joi.object({\n firstName: Joi.string().required(),\n lastName: Joi.string().required(),\n previousEmail: Joi.string()\n .email({ tlds: { allow: false } })\n .allow(''),\n memberNumber: Joi.string().empty('').default(null),\n birthdate: stepCondition(step, 2, Joi.date().required()),\n degreeGraduationYear: stepCondition(step, 2, Joi.number().empty('').default(null)),\n universityAttended: stepCondition(step, 2, Joi.string().allow('')),\n stateFirstLicense: stepCondition(step, 2, Joi.string().allow('')),\n previousChapter: stepCondition(step, 2, Joi.string().allow('')),\n email: emailCondition(step),\n confirmEmail: confirmEmailCondition(step),\n phoneNumber: stepCondition(step, 3, Joi.string().required()),\n }).prefs({\n messages: joiSchemaMessages,\n }),\n );\n};\n","/* eslint-disable react/no-unescaped-entities */\nimport React, { FormEvent } from 'react';\nimport WithErrorHelper from '../../../hocs/WithErrorHelper/WithErrorHelper';\nimport WithFormContext from '../../../hocs/WithFormContext/WithFormContext';\nimport Input from '../../Common/Input/Input';\nimport ArrowedButton from '../../Common/ArrowedButton/ArrowedButton';\nimport SimpleForm from '../../Common/SimpleForm/SimpleForm';\nimport { InputLabel } from '@material-ui/core';\n\ninterface AccountRecoveryAttemptBasicInformationProps {\n onSubmit: (event: FormEvent) => void;\n show: boolean;\n}\n\nconst InputWithError = WithFormContext(WithErrorHelper(Input));\n\nconst AccountRecoveryAttemptBasicInformation = (props: AccountRecoveryAttemptBasicInformationProps): JSX.Element => {\n return (\n \n \n Please enter the following information so we can identify your account.\n \n \n \n \n \n \n \n );\n};\n\nexport default AccountRecoveryAttemptBasicInformation;\n","/* eslint-disable react/no-unescaped-entities */\nimport { InputLabel } from '@material-ui/core';\nimport React, { FormEvent } from 'react';\nimport WithErrorHelper from '../../../hocs/WithErrorHelper/WithErrorHelper';\nimport WithFormContext from '../../../hocs/WithFormContext/WithFormContext';\nimport WithInsideLoading from '../../../hocs/WithInsideLoading/WithInsideLoading';\nimport Input from '../../Common/Input/Input';\nimport ArrowedButton from '../../Common/ArrowedButton/ArrowedButton';\nimport DateInput from '../../Common/DateInput/DateInput';\nimport SimpleForm from '../../Common/SimpleForm/SimpleForm';\nimport PlainButton from '../../Common/PlainButton/PlainButton';\n\ninterface AccountRecoveryAttemptAdditionalInformationProps {\n onBack: (event: FormEvent) => void;\n onSubmit: (event: FormEvent) => void;\n show: boolean;\n}\n\nconst InputWithError = WithFormContext(WithErrorHelper(Input));\nconst DateWithError = WithFormContext(WithErrorHelper(DateInput));\nconst ButtonWithLoading = WithInsideLoading(ArrowedButton);\n\nconst AccountRecoveryAttemptAdditionalInformation = (\n props: AccountRecoveryAttemptAdditionalInformationProps,\n): JSX.Element => {\n return (\n \n \n Please enter as many fields as possible. This information will be used for verifying your request and\n its approval will depend on the correctness of your answers.\n \n \n \n \n \n \n\n \n \n );\n};\n\nexport default AccountRecoveryAttemptAdditionalInformation;\n","/* eslint-disable react/no-unescaped-entities */\nimport { InputLabel, Link } from '@material-ui/core';\nimport React, { FormEvent } from 'react';\nimport WithErrorHelper from '../../../hocs/WithErrorHelper/WithErrorHelper';\nimport WithFormContext from '../../../hocs/WithFormContext/WithFormContext';\nimport WithInsideLoading from '../../../hocs/WithInsideLoading/WithInsideLoading';\nimport Alert from '../../Common/Alert/Alert';\nimport Input from '../../Common/Input/Input';\nimport ArrowedButton from '../../Common/ArrowedButton/ArrowedButton';\nimport SimpleForm from '../../Common/SimpleForm/SimpleForm';\nimport PlainButton from '../../Common/PlainButton/PlainButton';\n\ninterface AccountRecoveryAttemptAdditionalInformationProps {\n onBack: (event: FormEvent) => void;\n onSubmit: (event: FormEvent) => void;\n errorMessage: string;\n success: boolean;\n loading: boolean;\n show: boolean;\n}\n\nconst InputWithError = WithFormContext(WithErrorHelper(Input));\nconst ButtonWithLoading = WithInsideLoading(ArrowedButton);\n\nconst AccountRecoveryAttemptAdditionalInformation = (\n props: AccountRecoveryAttemptAdditionalInformationProps,\n): JSX.Element => {\n return props.success ? (\n \n \n Your account recovery request has been sent. We will review it and get in touch with you via phone or\n email.\n \n Go to AIA.org\n \n ) : (\n \n {props.errorMessage ? (\n \n ) : (\n \n Please enter the new email for your account and your phone number in case we need to get in touch\n with you.\n \n )}\n \n \n \n\n \n \n );\n};\n\nexport default AccountRecoveryAttemptAdditionalInformation;\n","import { API } from 'aws-amplify';\nimport { AccountRecoveryAttempt } from '../data_types/account-recovery-attempt';\n\nconst createAccountRecoveryAttempt = async (request: AccountRecoveryAttempt): Promise => {\n return API.post('membership', '/account-recovery-attempt', {\n body: {\n ...request,\n },\n });\n};\n\nexport default createAccountRecoveryAttempt;\n","import { makeStyles } from '@material-ui/core';\n\nexport const StepperIconStyle = makeStyles((theme) => ({\n root: {\n backgroundColor: '#ccc',\n zIndex: 1,\n color: '#fff',\n width: 25,\n height: 25,\n display: 'flex',\n borderRadius: '50%',\n justifyContent: 'center',\n alignItems: 'center',\n },\n active: {\n backgroundColor: theme.palette.primary.main,\n },\n completed: {\n backgroundColor: theme.palette.primary.main,\n },\n}));\n\nexport const StepperStyle = makeStyles({\n horizontal: {\n padding: 0,\n marginBottom: '24px',\n '& :nth-child(1)': {\n '& span': {\n alignItems: 'flex-start',\n },\n },\n '& :nth-child(2)': {\n '& .MuiStepConnector-root': {\n left: 'calc(-50% + -5px)',\n right: 'calc(50% + 20px)',\n },\n },\n '& :nth-child(3)': {\n '& .MuiStepConnector-root': {\n left: 'calc(-50% + 20px)',\n right: 'calc(50% - 5px)',\n },\n '& span': {\n alignItems: 'flex-end',\n },\n },\n },\n});\n","import React, { useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { generateRecoveryAttemptFormSchema } from '../../../utils/generate-recovery-attempt-form-schema';\nimport AccountRecoveryAttemptBasicInformation from './AttemptBasicInformation';\nimport AccountRecoveryAttemptAdditionalInformation from './AttemptAdditionalInformation';\nimport AccountRecoveryAttemptConfirmEmail from './AttemptConfirmEmail';\nimport { AccountRecoveryAttempt as AccountRecoveryAttemptType } from '../../../data_types/account-recovery-attempt';\nimport createAccountRecoveryAttempt from '../../../utils/create-account-recovery-attempt';\nimport { Step, StepIconProps, StepLabel, Stepper } from '@material-ui/core';\nimport { Check } from '@material-ui/icons';\nimport clsx from 'clsx';\nimport { StepperIconStyle, StepperStyle } from './Attempt.style';\n\nconst StepperIcon = (props: StepIconProps): JSX.Element => {\n const { active, completed, icon, style } = props;\n const classes = StepperIconStyle();\n\n const completedIcon = ;\n\n return (\n \n {completed ? completedIcon : icon}\n
\n );\n};\n\nconst AccountRecoveryAttempt = (): JSX.Element => {\n const [errorMessage, setErrorMessage] = useState('');\n const [success, setSuccess] = useState(false);\n const [loading, setLoading] = useState(false);\n const [step, setStep] = useState(1 as 1 | 2 | 3);\n const formMethods = useForm({\n resolver: generateRecoveryAttemptFormSchema(step),\n });\n\n const onSubmitHandler = async (data: AccountRecoveryAttemptType): Promise => {\n try {\n setLoading(true);\n await createAccountRecoveryAttempt(data);\n setErrorMessage('');\n setSuccess(true);\n } catch (error) {\n const message =\n error?.response?.data?.message === 'Error:A contact with that email already exists'\n ? 'A user with that email already exists. Try to reset your password instead or use a different recovery email.'\n : 'Creating the recovery request failed. Please try again or call (800) AIA-3887.';\n\n setErrorMessage(message);\n } finally {\n setLoading(false);\n }\n };\n\n const stepperClass = StepperStyle();\n\n return (\n \n
\n {!success ? (\n \n {[1, 2, 3].map((stepNumber) => {\n return (\n stepNumber} key={`step-${stepNumber}`}>\n \n \n );\n })}\n \n ) : (\n \n )}\n {\n setStep(2);\n })}\n />\n {\n setStep(1);\n }}\n onSubmit={formMethods.handleSubmit((): void => {\n setStep(3);\n })}\n />\n {\n setStep(2);\n }}\n onSubmit={formMethods.handleSubmit(onSubmitHandler)}\n />\n \n
\n );\n};\n\nexport default AccountRecoveryAttempt;\n","import React from 'react';\nimport AccountRecoveryAttemptContainer from '../components/AccountRecovery/Attempt/Attempt';\nimport BoxWithTitle from '../components/Common/BoxWithTitle/BoxWithTitle';\n\nconst AccountRecoveryAttempt = (): JSX.Element => {\n return (\n \n \n \n );\n};\n\nexport default AccountRecoveryAttempt;\n","import { API } from 'aws-amplify';\nimport { DuesEstimatorData } from '../components/DuesEstimator/DuesEstimator';\nimport { Order } from '../data_types/member-order';\nimport { MEMBERSHIP_TYPE_MAPPING, SELF_DESCRIBE_SUPERVISION } from './constants';\n\nconst getDues = async (props: DuesEstimatorData): Promise => {\n if (props.selfDescribe === SELF_DESCRIBE_SUPERVISION) {\n props.alternativeLicensePath = true;\n }\n let filter = '';\n Object.entries(props).forEach(([key, value]: [string, string]) => {\n if (key === 'selfDescribe') {\n value = MEMBERSHIP_TYPE_MAPPING[value] as string;\n key = 'membershipType';\n }\n filter = `${key}=${value}&${filter}`;\n });\n filter = filter.substring(0, filter.length - 1);\n\n const response = await API.get('membership', `/dues?${filter}`, {});\n return response.data[0];\n};\n\nexport default getDues;\n","import React, { memo, useContext, useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport getDues from '../../utils/get-dues';\nimport OrderDuesTable from '../Order/Dues/Table/Table';\nimport OrderTotalTable from '../Order/Total/Table/Table';\nimport { Order } from '../../data_types/member-order';\nimport { MembershipContext } from '../../contexts/MembershipContext';\nimport { Grid, Typography } from '@material-ui/core';\nimport {\n DEFAULT_MODAL_CONTENT,\n DUES_ESTIMATOR_DISCLAIMER,\n INVALID_SESSION_MODAL_CONTENT,\n LOCAL_STORAGE_DUES_ESTIMATOR_VALUES_KEY,\n SESSION_INVALID_ERROR,\n} from '../../utils/constants';\nimport ContactFormComponent, { ContactFormComponentProps } from '../Contact/Form/FormComponent';\nimport { generateContactFormSchema } from '../../utils/generate-contact-form-schema';\nimport { generateContactFormOptions } from '../../utils/generate-contact-form-options';\nimport ArrowedButton from '../Common/ArrowedButton/ArrowedButton';\nimport WithInsideLoading from '../../hocs/WithInsideLoading/WithInsideLoading';\nimport redirectToJoin from '../../utils/redirect-to-join';\nimport NonPayableZipCodeDisclaimer from '../NonPayableZipCodeDisclaimer/NonPayableZipCodeDisclaimer';\nimport isZipCodePayable from '../../utils/is-zip-code-payable';\nimport { OrderContext } from 'contexts/OrderContext';\n\ninterface DuesEstimatorProps {\n setModalOptions?: (opt: object) => void;\n}\nexport interface DuesEstimatorData {\n selfDescribe: string;\n country: string;\n zipCode?: string;\n careerType?: string;\n gradDate?: string;\n licenseDate?: string;\n alternativeLicensePath?: boolean;\n}\n\nconst contactFormPropsAreEqual = (prev: ContactFormComponentProps, next: ContactFormComponentProps): boolean => {\n return prev.hasError === next.hasError && prev.isLoading === next.isLoading;\n};\n\nconst MemoizedContactForm = memo(ContactFormComponent, contactFormPropsAreEqual);\n\nconst ArrowedButtonWithLoading = WithInsideLoading(ArrowedButton);\n\nconst DuesEstimator = (props: DuesEstimatorProps): JSX.Element | null => {\n const [loadingDues, setLoadingDues] = useState(false);\n const [hasError, setHasError] = useState(false);\n const { countries, careerTypes } = useContext(MembershipContext);\n const [dues, setDues] = useState(null as Order | null);\n const [showPaymentDisclaimer, setShowPaymentDisclaimer] = useState(false);\n const [contactData, setContactData] = useState(null as DuesEstimatorData | null);\n const [loadingJoin, setLoadingJoin] = useState(false);\n const [orderTotal, setTotal] = useState(null);\n\n const schema = generateContactFormSchema(false);\n const formOptions = generateContactFormOptions({\n resolver: schema,\n });\n\n const formMethods = useForm(formOptions);\n\n const onSubmitHandler = async (contactData: DuesEstimatorData): Promise => {\n try {\n if (!isZipCodePayable(contactData.zipCode)) {\n setShowPaymentDisclaimer(true);\n } else {\n setLoadingDues(true);\n setShowPaymentDisclaimer(false);\n setContactData(contactData);\n const dues = await getDues(contactData);\n setDues(dues);\n }\n setTimeout(() => {\n window.scrollTo({ top: 1000, behavior: 'smooth' });\n }, 0);\n } catch (error) {\n setHasError(true);\n if (error === SESSION_INVALID_ERROR) {\n props.setModalOptions?.({ ...INVALID_SESSION_MODAL_CONTENT, isOpen: true });\n } else {\n props.setModalOptions?.({ ...DEFAULT_MODAL_CONTENT, isOpen: true });\n }\n } finally {\n setLoadingDues(false);\n }\n };\n\n const handleJoin = (): void => {\n setLoadingJoin(true);\n\n const prefillData = JSON.stringify(contactData);\n localStorage.setItem(LOCAL_STORAGE_DUES_ESTIMATOR_VALUES_KEY, prefillData);\n\n redirectToJoin();\n };\n\n return (\n \n \n \n {dues && !loadingDues && (\n <>\n \n \n \n \n \n \n \n {DUES_ESTIMATOR_DISCLAIMER}\n \n \n \n \n \n \n >\n )}\n {showPaymentDisclaimer && }\n \n \n );\n};\n\nexport default DuesEstimator;\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport React, { useEffect } from 'react';\nimport VerticalSplit from '../components/Common/VerticalSplit/VerticalSplit';\nimport DuesEstimator from '../components/DuesEstimator/DuesEstimator';\nimport { ModalContext } from '../contexts/ModalContext';\nimport WithBackdropContext from '../hocs/WithBackdropContext/WithBackdropContext';\nimport WithLoading from '../hocs/WithLoading/WithLoading';\nimport { useEntities } from '../hooks/use-entities';\n\nconst VerticalSplitWithLoading = WithLoading(VerticalSplit);\nconst DuesEstimatorWithModal = WithBackdropContext('modal', ModalContext, DuesEstimator);\n\nconst ScreensDuesEstimator = (): JSX.Element | null => {\n const { loading, error, fetchData, countries, careerTypes } = useEntities();\n\n useEffect(() => {\n if (!(countries && careerTypes)) {\n fetchData();\n }\n }, []);\n\n return (\n }\n right={<>>}\n />\n );\n};\n\nexport default ScreensDuesEstimator;\n","import { AppBar, Grid } from '@material-ui/core';\nimport React from 'react';\nimport background from '../../../assets/images/landing.jpg';\nimport { BackgroundImageStyle } from './BackgroundImage.style';\n\nexport interface BackgroundImageProps {\n children: React.ReactNode;\n}\n\nconst BackgroundImage = (props: BackgroundImageProps): JSX.Element => {\n const classes = BackgroundImageStyle(background);\n\n return (\n \n {props.children}\n
\n \n \n Conjunctive Points— The New City\n \n Eric Owen Moss, FAIA \n Winner, AIA Twenty-five Year Award 2020 \n \n \n
\n );\n};\n\nexport default BackgroundImage;\n","import { makeStyles } from '@material-ui/core';\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const BackgroundImageStyle = (background: string) =>\n makeStyles({\n root: {\n height: '100%',\n },\n backgroundImage: {\n backgroundImage: `url(${background})`,\n backgroundSize: 'cover',\n backgroundPosition: 'center center',\n },\n caption: {\n background: 'linear-gradient(0deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.5) 50%, rgba(255,255,255,0) 100%)',\n position: 'fixed',\n bottom: 0,\n '& .MuiGrid-container': {\n marginLeft: '40px',\n marginBottom: '10px',\n margin: '20px 0px 10px 40px',\n },\n zIndex: 1,\n },\n })();\n","import React from 'react';\nimport {\n AppBar,\n Container as MuiContainer,\n List as MuiList,\n ListItem,\n Divider as MuiDivider,\n Link,\n withStyles,\n} from '@material-ui/core';\n\nconst List = withStyles((theme) => ({\n root: {\n 'min-height': '71px',\n [theme.breakpoints.up('sm')]: {\n display: 'flex',\n flexDirection: 'row',\n },\n '& .MuiListItem-root': {\n width: 'initial',\n },\n },\n}))(MuiList);\n\nconst Divider = withStyles((theme) => ({\n root: {\n [theme.breakpoints.up('sm')]: {\n height: '22px',\n 'margin-top': 'auto',\n 'margin-bottom': 'auto',\n width: '1px',\n },\n },\n}))(MuiDivider);\n\nconst Footer = (): JSX.Element | null => {\n const year = new Date().getFullYear();\n\n return (\n \n \n \n © {year} AIA \n \n (800) AIA-3837 \n \n \n \n membersupport@aia.org\n \n \n \n \n \n Privacy\n \n \n
\n \n \n );\n};\n\nexport default Footer;\n","import { makeStyles } from '@material-ui/core';\n\nexport const HeaderAppBarStyle = makeStyles(({ breakpoints }) => ({\n root: {\n height: '74px',\n '& img': {\n height: '70px',\n },\n [breakpoints.down('xs')]: {\n height: '54px',\n '& img': {\n height: '50px',\n },\n },\n },\n}));\n\nexport const HeaderContainerStyle = makeStyles(({ breakpoints }) => ({\n root: {\n padding: '0 65px',\n [breakpoints.down('xs')]: {\n padding: '0 24px',\n },\n },\n}));\n","import React, { useEffect, useState } from 'react';\nimport { AppBar, Container, Grid, Link, makeStyles } from '@material-ui/core';\nimport logo from '../../../assets/images/logo.svg';\nimport { HeaderAppBarStyle, HeaderContainerStyle } from './Header.style';\nimport { Auth } from 'aws-amplify';\n\nconst whiteLink = makeStyles({\n root: {\n color: '#fff',\n cursor: 'pointer',\n },\n});\n\nconst Header = (): JSX.Element => {\n const appBarClass = HeaderAppBarStyle();\n const containerClass = HeaderContainerStyle();\n const whiteLinkClass = whiteLink();\n\n const [user, setUser] = useState(undefined as undefined | null);\n const handleHeader = (): void => {\n if (user) {\n window.location.assign(process.env.REACT_APP_MY_ACCOUNT_URL as string);\n } else {\n Auth.federatedSignIn();\n }\n };\n\n useEffect(() => {\n Auth.currentAuthenticatedUser()\n .then((userData) => {\n setUser(userData);\n })\n .catch(() => {\n setUser(null);\n });\n }, []);\n\n return (\n \n \n \n \n \n \n \n \n {user !== undefined && (\n \n \n {user ? 'My account' : 'Sign In'}\n \n \n )}\n \n \n \n );\n};\n\nexport default Header;\n","import { useLocation } from 'react-router-dom';\n\nexport const useQueryParam: (name: string) => string | null = (name: string) => {\n const { search } = useLocation();\n const urlParams = new URLSearchParams(search);\n return urlParams.get(name);\n};\n","import { Auth } from 'aws-amplify';\nimport React, { useEffect, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport BackgroundImage from '../BackgroundImage/BackgroundImage';\nimport Footer from '../Footer/Footer';\nimport Header from '../Header/Header';\nimport { useQueryParam } from 'utils/use-query-param';\n\ninterface MainLayoutProps {\n children: JSX.Element | JSX.Element[];\n}\n\nconst MainLayout = (props: MainLayoutProps): JSX.Element => {\n const location = useLocation();\n const [landing, setLanding] = useState(false);\n\n const aiauParam = JSON.parse(useQueryParam('aiau') || 'false');\n const archiPACParam = JSON.parse(useQueryParam('archiPAC') || 'false');\n\n useEffect(() => {\n if (aiauParam) {\n sessionStorage.setItem('isAiauPrechecked', aiauParam);\n }\n if (archiPACParam) {\n sessionStorage.setItem('isArchiPACPrechecked', archiPACParam);\n }\n }, [aiauParam, archiPACParam]);\n\n useEffect(() => {\n Auth.currentAuthenticatedUser()\n .then(() => {\n setLanding(false);\n })\n .catch(() => {\n setLanding(location.pathname === '/');\n });\n }, [location]);\n\n return (\n <>\n {landing ? (\n \n \n {props.children}\n \n ) : (\n \n \n {props.children}\n \n
\n )}\n >\n );\n};\n\nexport default MainLayout;\n","import React from 'react';\nimport { Typography } from '@material-ui/core';\n\nconst ScreensCesAudit = (): JSX.Element => {\n return (\n \n \n Your record is under audit for not meeting AIA's education requirements, and are not eligible to\n renew till this has been corrected. Please contact member services at (800) AIA 3837.\n
\n \n );\n};\n\nexport default ScreensCesAudit;\n","import React from 'react';\nimport { Typography } from '@material-ui/core';\n\nconst ScreensUnderAudit = (): JSX.Element => {\n return (\n \n \n You are currently under AIA CES audit for failure to meet your annual continuing education requirement.\n Your membership is not currently eligible for renewal. Please contact \n \n ces@aia.org\n \n for more details.\n
\n \n );\n};\n\nexport default ScreensUnderAudit;\n","import React from 'react';\nimport { Typography } from '@material-ui/core';\nimport ArrowedButton from 'components/Common/ArrowedButton/ArrowedButton';\nimport PlainButton from 'components/Common/PlainButton/PlainButton';\nimport { Auth } from 'aws-amplify';\nimport LandingBox from 'components/LandingHome/LandingBox';\nimport { handleGoToAia } from 'components/LandingHome/LandingAccountFound';\n\nconst LandingEpaymentInProcess = (): JSX.Element => {\n const title = 'Payment in Progress';\n const message =\n 'Payment for your dues is already in progress. To avoid duplicate charges, please allow 3-4 days for the transaction to be completed.';\n return (\n \n \n {message}\n \n\n \n => await Auth.signOut()} />\n \n );\n};\n\nexport default LandingEpaymentInProcess;\n","import React, { Dispatch, SetStateAction, useState } from 'react';\nimport CssBaseline from '@material-ui/core/CssBaseline';\nimport { Container } from '@material-ui/core';\nimport { ThemeProvider } from '@material-ui/core/styles';\nimport { BrowserRouter as Router, Route, Switch } from 'react-router-dom';\nimport Amplify, { Auth } from 'aws-amplify';\nimport awsExports from './aws-exports';\nimport theme from './utils/theme';\nimport ScreensError from './screens/Error';\nimport { ModalContext } from './contexts/ModalContext';\nimport Modal from './components/Common/Modal/Modal';\nimport { DEFAULT_MODAL_CONTENT } from './utils/constants';\nimport { AppContainerStyle } from './App.style';\nimport { MembershipContext } from './contexts/MembershipContext';\nimport MembershipRoute from './components/Common/MembershipRoute/MembershipRoute';\nimport SSORoute from './components/Common/SSORoute/SSORoute';\nimport ScreensRenew from './screens/Renew';\nimport WithLoading from './hocs/WithLoading/WithLoading';\nimport ScreensJoin from './screens/Join';\nimport ScreensActive from './screens/Active/Active';\nimport { BackdropContext } from './contexts/BackdropContext';\nimport WithBackdropContext from './hocs/WithBackdropContext/WithBackdropContext';\nimport CustomBackdrop from './components/Common/CustomBackdrop/CustomBackdrop';\nimport ScreensHome from './screens/Home';\nimport AccountRecovery from './screens/AccountRecovery';\nimport AccountRecoveryAttempt from './screens/AccountRecoveryAttempt';\nimport DuesEstimator from './screens/DuesEstimator';\nimport MainLayout from './components/Common/MainLayout/MainLayout';\nimport ScreensCesAudit from './screens/CesAudit';\nimport ScreensUnderAudit from './screens/UnderAudit';\nimport { MemberOrderResponse } from 'data_types/member-order';\nimport { BackdropOptions } from 'data_types/backdrop-options';\nimport { GlobalValue } from 'data_types/global-value';\nimport LandingEpaymentInProcess from 'screens/LandingEpaymentInProcess';\n\nconst ScreensHomeWithLoading = WithLoading(ScreensHome);\nconst ScreensRenewWithLoading = WithLoading(ScreensRenew);\nconst ScreensJoinWithLoading = WithLoading(ScreensJoin);\nconst ScreensActiveWithLoading = WithLoading(ScreensActive);\nconst ScreensCesAuditWithLoading = WithLoading(ScreensCesAudit);\nconst ScreensUnderAuditWithLoading = WithLoading(ScreensUnderAudit);\n\nconst App = (): JSX.Element => {\n const [modalOptions, setModalOptions] = useState(DEFAULT_MODAL_CONTENT);\n const [backdropOptions, setBackdropOptions] = useState({ isOpen: false } as BackdropOptions);\n const [membershipInfo, setMembershipInfo] = useState((null as unknown) as MemberOrderResponse);\n const [countries, setCountries] = useState((null as unknown) as GlobalValue[]);\n const [careerTypes, setCareerTypes] = useState((null as unknown) as GlobalValue[]);\n const ModalWithContext = WithBackdropContext('modal', ModalContext, Modal);\n const BackdropWithContext = WithBackdropContext(\n 'backdrop',\n BackdropContext as React.Context<{\n options: BackdropOptions;\n setOptions: Dispatch>;\n }>,\n CustomBackdrop,\n );\n const containerClass = AppContainerStyle();\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nconst awsConfig = {\n ...awsExports,\n Auth: {\n region: process.env.REACT_APP_AWS_REGION,\n userPoolId: process.env.REACT_APP_USER_POOL_ID,\n userPoolWebClientId: process.env.REACT_APP_WEBCLIENT_ID,\n mandatorySignIn: false,\n storage: sessionStorage,\n },\n};\n\nconst authConfig = {\n domain: process.env.REACT_APP_AUTH_DOMAIN,\n scope: ['phone', 'email', 'profile', 'openid', process.env.REACT_APP_AUTH_MEMBERSHIP_SCOPE],\n redirectSignIn: `${window.location.protocol}//${window.location.host}`,\n redirectSignOut: `${window.location.protocol}//${window.location.host}`,\n responseType: 'code',\n};\n\nAmplify.configure(awsConfig);\nAuth.configure({ oauth: authConfig });\n\nexport default App;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Amplify from 'aws-amplify';\nimport App from './App';\nimport awsExports from './aws-exports';\n\nAmplify.configure(awsExports);\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root'),\n);\n"],"sourceRoot":""}