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AAOA,EAAK9B,QAAQ,OAAQ,OAAOA,QAAQ,OAAQ,OACnD,MACMqV,EADQ,IAAIC,OAAO,SAAWxT,EAAO,aACrByT,KAAKjH,SAASkH,QACpC,OAAmB,OAAZH,EACH,GACAI,mBAAmBJ,EAAQ,GAAGrV,QAAQ,MAAO,KACnD,CAGO,SAAS0V,IACd,6CAA4C1V,QAAQ,UAAW2V,IAE3DA,EACCC,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAM,IAAOH,EAAI,GAC5DI,SAAS,KAEf,CAEO,SAASC,EAAqBC,EAAOC,EAAUjV,EAAU,CAAC,GAC/D,MAAMkV,EAAOC,EAAEF,GAEXC,EAAKhQ,OAAS,GAChBgQ,EAAKE,MAAK,CAACC,EAAOC,KAChB,MAAMC,EAAW,IAAIP,EAAM,CAAEM,OACxBtV,EAAQwV,YACXD,EAASzV,QACX,GAGN,CAEO,SAAS2V,EAAkBC,EAAWC,GACvCzD,SAASQ,cAAcgD,IACzBC,GAEJ,CAEO,SAASC,EACdF,EACAG,GACA,WAAEL,GAAe,CAAC,GAElB,MAAMM,EAAM5D,SAAS6D,iBAAiBL,GAChCM,EAAQF,EAAI5Q,OAGd8Q,EAAQ,GACVH,IAAS3L,MAAK,EAAG+L,QAASC,MACxB,QAASC,EAAM,EAAGA,EAAMH,EAAOG,IAAO,CACpC,MACMZ,EAAW,IAAIW,EAAM,CAAEZ,GADlBQ,EAAIK,KAGVX,GACHD,EAASzV,QAEb,IAGN,CAEO,SAASsW,EAAWnD,GACzB,MAAMoD,EAAMnE,SAASoE,cAAc,UACnCD,EAAIjO,IAAM6K,EACVoD,EAAIpJ,OAAQ,EACZiF,SAASvU,KAAK4Y,OAAOF,EACvB,C","sources":["webpack://endrun/./app/javascript/app/analytics/helpers.js","webpack://endrun/./app/javascript/app/support/pitch.js","webpack://endrun/./app/javascript/app/support/moneyselector.js","webpack://endrun/./app/javascript/app/support/benefitoption.js","webpack://endrun/./app/javascript/app/support/shared.js","webpack://endrun/./app/javascript/app/support/membershipbenefitpanel.js","webpack://endrun/./app/javascript/app/shared/button.js","webpack://endrun/./app/javascript/app/support/recurringnudge.js","webpack://endrun/./app/javascript/app/shared/customselect.js","webpack://endrun/./app/javascript/app/support/frequencyselector.js","webpack://endrun/./app/javascript/app/support/nextbutton.js","webpack://endrun/./app/javascript/app/shared/validators.js","webpack://endrun/./app/javascript/app/support/supportintent.js","webpack://endrun/./app/javascript/app/shared/formfield.js","webpack://endrun/./app/javascript/app/shared/selectformfield.js","webpack://endrun/./app/javascript/app/support/contactinfoform.js","webpack://endrun/./app/javascript/app/support/hooks.js","webpack://endrun/./app/javascript/app/support/progresslogo.js","webpack://endrun/./app/javascript/app/support/stripeform.js","webpack://endrun/./app/javascript/app/support/paymentform.js","webpack://endrun/./app/javascript/app/support/supportsection.js","webpack://endrun/./app/javascript/app/support/analytics.js","webpack://endrun/./app/javascript/app/support/state.js","webpack://endrun/./app/javascript/app/support/supportpage.js","webpack://endrun/./app/javascript/app/support/index.js","webpack://endrun/./app/javascript/app/analytics/ga.js","webpack://endrun/./app/javascript/shared/http.js","webpack://endrun/./app/javascript/shared/utils.js"],"sourcesContent":["// packages\nimport delay from 'underscore/modules/delay.js';\n\n// local\nimport { gtag } from './ga.js';\n\n/**\n * Track a user interaction in GA.\n */\nexport function trackEvent(eventName, eventData = {}) {\n // Convert legacy event format to GA4 format\n if (typeof eventData === 'string') {\n eventData = convertLegacyEvent(...arguments);\n eventName = eventData.event_name;\n }\n\n try {\n gtag('event', eventName, eventData);\n } catch (e) {\n console.warn('error reporting event', eventData);\n }\n}\n\n/**\n * Convert a Universal analytics style event into GA4 format.\n */\nfunction convertLegacyEvent(\n category,\n action,\n label = '',\n value = undefined,\n options = {}\n) {\n return {\n event_name: `${category}_${action}`,\n event_category: category,\n event_action: action,\n event_label: label,\n event_value: value,\n };\n}\n\n/**\n * Track a non-interactive event in GA.\n */\nexport function trackPassiveEvent(\n category,\n action,\n label = '',\n value = undefined\n) {\n const passiveOptions = { nonInteraction: 1 };\n return trackEvent(category, action, label, value, passiveOptions);\n}\n\nexport const trackParselyConversion = (function () {\n // make a queue for conversion events\n const parselyConversionEventQueue = [];\n\n // wrapper function safely handles either case\n const capture = (type, label) => {\n if (window.PARSELY && window.PARSELY.loaded) {\n report(type, label);\n } else {\n parselyConversionEventQueue.push([type, label]);\n }\n };\n\n const report = function (type, label) {\n try {\n window.PARSELY.conversions[type](label);\n // console.log('reported', type, label)\n } catch (e) {\n console.log(\n `Error reporting Parsely conversion. type: ${type}, label: ${label}, error: ${e}`\n );\n }\n };\n\n // Preload an event if it's present in the bootstrap\n if (window.TMPBootstrapData && window.TMPBootstrapData.parselyConversion) {\n const conversion = window.TMPBootstrapData.parselyConversion;\n capture(conversion.type, conversion.label);\n }\n\n // flush the queue when the tracker loads\n window.PARSELY = window.PARSELY || {\n onload: function () {\n delay(() => {\n parselyConversionEventQueue.forEach((event) => {\n report(event[0], event[1]);\n });\n });\n },\n };\n\n return capture;\n})();\n\nexport function trackParselyNewsletterConversion(label) {\n trackParselyConversion('trackNewsletterSignup', label);\n}\n\nexport function trackParselyMonthlyDonationConversion(label) {\n trackParselyConversion('trackSubscription', label);\n}\n\nexport function trackParselyDonationConversion(label) {\n trackParselyConversion('trackPurchase', label);\n}\n\nexport function trackParselyCustomConversion(label) {\n trackParselyConversion('trackCustom', label);\n}\n\n// Make this available site-wide for graphics\nwindow.TMPAnalytics = window.TMPAnalytics || {};\nwindow.TMPAnalytics.trackConversion = trackParselyCustomConversion;\nwindow.TMPAnalytics.trackEvent = trackEvent;\n// For backwards compatibility with old graphics.\nwindow.report = trackEvent;\n","import { useState } from 'react';\nimport cx from 'classnames';\nimport { SlideDown } from 'react-slidedown';\nimport 'react-slidedown/lib/slidedown.css';\n\nconst FALLBACK_TITLE = 'We keep the spotlight on criminal justice.';\nconst FALLBACK_BODY =\n 'Our journalism establishes facts, exposes failures and examines solutions for a criminal justice system in crisis. If you believe in what we do, become a member today.';\n\nexport default function Pitch({ copyOptions }) {\n const [collapsed, setCollapsed] = useState(true);\n\n const { title, body } = copyOptions;\n\n const renderedBody =
;\n\n const fallbackBody =

{FALLBACK_BODY}

;\n\n return (\n
\n
\n

{title || FALLBACK_TITLE}

\n
\n {body ? renderedBody : fallbackBody}\n
\n
\n setCollapsed(!collapsed)}\n >\n Benefits of giving to The Marshall Project\n
\n \n {!collapsed && (\n
    \n
  • \n A tri-annual \"Impact Report\" on the difference our journalism\n has made.\n
  • \n
  • \n An annual analysis on criminal justice reform by\n Editor-in-Chief Susan Chira.\n
  • \n
  • \n Early access and discounted or free tickets to criminal\n justice-related special events.\n
  • \n
\n )}\n
\n
\n
\n \n );\n}\n","import { Component } from 'react';\n\nexport default class MoneySelector extends Component {\n constructor(props) {\n super(props);\n this.state = { open: false, ignoreFocus: false };\n }\n\n onChange(event) {\n let value = parseInt(event.target.value.replace('$', ''), 10);\n if (isNaN(value)) {\n value = '';\n }\n if (value < 0) {\n value = Math.abs(value);\n }\n this.props.onChange(value);\n }\n\n handleFocus(event) {\n if (this.state.ignoreFocus) {\n this.setState({ ignoreFocus: false });\n } else {\n this.setState({ open: true });\n }\n }\n\n handleBlur(event) {\n this.setState({ open: false });\n }\n\n handleSelection(value) {\n if (value === 'other') {\n this.setState({ open: false, ignoreFocus: true }, () => {\n _.delay(() => {\n this.input.focus();\n }, 1);\n });\n } else {\n this.props.onChange(value);\n }\n }\n\n getOptionValues() {\n if (this.props.frequency === 'monthly') {\n return {\n 15: '$15',\n 25: '$25',\n 35: '$35',\n other: 'Other',\n };\n } else {\n return {\n 50: '$50',\n 100: '$100',\n 250: '$250',\n 1000: '$1,000',\n other: 'Other',\n };\n }\n }\n\n render() {\n const optionValues = this.getOptionValues();\n const options = Object.keys(optionValues).map((key) => {\n return (\n \n {optionValues[key]}\n \n );\n });\n const optionsMarkup = (\n
\n {options}\n
\n );\n\n let className = '';\n if (this.props.errors && this.props.errors.donationAmount) {\n className = 'error';\n }\n\n return (\n
\n {\n this.input = i;\n }}\n autoComplete=\"off\"\n type=\"number\"\n value={this.props.value}\n name=\"amount\"\n placeholder=\"\"\n onChange={this.onChange.bind(this)}\n onFocus={this.handleFocus.bind(this)}\n onBlur={this.handleBlur.bind(this)}\n />\n $\n {this.state.open && optionsMarkup}\n
\n );\n }\n}\n","/**\n * @param {object} props\n * @param {boolean} props.desired\n * @param {React.MouseEventHandler} props.onToggle\n */\nexport default function BenefitOption({ desired, onToggle }) {\n const text = desired ? 'Not interested?' : 'Changed your mind?';\n\n return (\n \n \n ({text})\n \n \n );\n}\n","export const MONTHLY_THRESHOLD = 60;\nexport const ONE_TIME_THRESHOLD = 75;\n\nexport function getAnnualTotal(amount, frequency) {\n const multiplier = frequency === 'monthly' ? 12 : 1;\n return amount * multiplier;\n}\n\nexport function getAdditionalForBenefit(amount, frequency) {\n const multiplier = frequency === 'monthly' ? 12 : 1;\n return (\n (getBenefitThreshold(frequency) - getAnnualTotal(amount, frequency)) /\n multiplier\n );\n}\n\nexport function receivingBenefit(amount, frequency) {\n return getAnnualTotal(amount, frequency) >= getBenefitThreshold(frequency);\n}\n\nexport function getAmountWithFees(amount, coverFees) {\n const numericAmount = parseInt(amount, 10);\n if (coverFees) {\n return (\n numericAmount + Math.round((numericAmount * 0.029 + 0.3) * 100) / 100\n );\n } else {\n return numericAmount;\n }\n}\n\nexport function formatMoney(amount) {\n const number = Number(amount);\n if (Number.isInteger(number)) {\n return number.toFixed(0);\n } else if (Number.isNaN(number)) {\n return amount;\n } else {\n return number.toFixed(2);\n }\n}\n\nfunction getBenefitThreshold(frequency) {\n if (frequency == 'once' || frequency == 'annually') {\n return ONE_TIME_THRESHOLD;\n } else {\n return MONTHLY_THRESHOLD;\n }\n}\n","import { Component } from 'react';\nimport BenefitOption from './benefitoption.js';\nimport { getAdditionalForBenefit, receivingBenefit } from './shared.js';\n\nexport default class MembershipBenefitPanel extends Component {\n getAdditionalString() {\n const num = getAdditionalForBenefit(\n this.props.amount,\n this.props.frequency\n );\n return Math.ceil(num * 100) / 100;\n }\n\n getAdditionalFrequency() {\n if (this.props.frequency === 'monthly') {\n return 'per month';\n }\n\n return '';\n }\n\n render() {\n let className = '';\n let message;\n let shouldDisplayOption = false;\n if (!this.props.benefitDesired) {\n shouldDisplayOption = true;\n message = You have chosen not to get a tote bag.;\n } else if (this.props.amount == '') {\n message = '';\n } else if (receivingBenefit(this.props.amount, this.props.frequency)) {\n shouldDisplayOption = true;\n className = 'highlighted';\n message = You get a tote bag!;\n } else {\n message = (\n \n Give ${this.getAdditionalString()} more{' '}\n {this.getAdditionalFrequency()} to get a tote bag.\n \n );\n }\n\n return (\n
\n
\n {message}{' '}\n {shouldDisplayOption && (\n \n )}\n
\n
\n );\n }\n}\n","import { Component } from 'react';\n\nexport default class Button extends Component {\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n handleKeyPress(event) {\n if (event.keyCode === 10 || event.keyCode === 13) {\n this.props.onClick();\n }\n }\n\n render() {\n const extraProps = {};\n\n if (this.props.id) {\n extraProps.id = this.props.id;\n }\n\n if (this.props.disabled) {\n extraProps.disabled = this.props.disabled;\n }\n\n return (\n \n {this.props.text}\n \n );\n }\n}\n","import { Component } from 'react';\nimport Button from '../shared/button.js';\n\nexport default class RecurringNudge extends Component {\n render() {\n return (\n
\n

\n Thank you for becoming a member of The Marshall Project. Showing your\n support through a monthly donation makes our future more secure, which\n means that we can continue to publish journalism with impact.\n

\n

\n Would you please consider a monthly contribution to sustain our work?\n

\n
\n \n \n
\n
\n );\n }\n}\n","import { Component } from 'react';\n\nexport default class CustomSelect extends Component {\n constructor(props) {\n super(props);\n this.state = { open: false };\n }\n\n handleSelection(key) {\n this.setState({ open: false });\n this.props.onChange(key);\n }\n\n handleFocus() {\n this.setState({ open: true });\n }\n\n handleBlur() {\n this.setState({ open: false });\n }\n\n render() {\n const options = Object.keys(this.props.options).map((key) => {\n return (\n \n {this.props.options[key]}\n \n );\n });\n const optionsMarkup = (\n
{options}
\n );\n return (\n
\n \n {this.state.open && optionsMarkup}\n \n
\n );\n }\n}\n","import CustomSelect from '../shared/customselect.js';\n\nexport const FREQUENCY_OPTIONS = {\n annually: 'annually',\n monthly: 'monthly',\n once: 'once',\n};\n\n/**\n *\n * @param {object} props\n * @param {string} props.value\n * @param {(frequency: string) => void} props.onChange\n */\nexport default function FrequencySelector({ value, onChange }) {\n return (\n \n );\n}\n","import Button from '../shared/button.js';\n\nexport default function NextButton(props) {\n return (\n
\n
\n );\n}\n","export function createValidator(rules) {\n return (values = {}) => {\n const errors = {};\n Object.keys(rules).forEach((field) => {\n const fieldRules = rules[field];\n const fieldErrors = unique(fieldRules\n .map((rule) => rule(values[field], field, values))\n .filter((error) => Boolean(error)));\n const fieldError = `${fieldErrors.join(', ')}${fieldErrors.length ? '.' : ''}`;\n\n if (fieldError) {\n errors[field] = fieldError;\n }\n });\n\n return errors;\n };\n}\n\n\nexport function required(value) {\n const errorMessage = `is required`;\n\n if (!value && typeof value !== 'number') {\n return errorMessage;\n }\n\n if (Array.isArray(value) && value.length === 0) {\n return errorMessage;\n }\n\n if (typeof value === 'string' && value.trim() === '') {\n return errorMessage;\n }\n\n return false;\n}\n\n\nexport function isNumber(value) {\n const errorMessage = `must be a number`;\n\n if (typeof value === 'string') {\n value = parseInt(value, 10);\n }\n\n if (isNaN(value)) {\n return errorMessage;\n }\n\n if (typeof value !== 'number') {\n return errorMessage;\n }\n\n return false;\n}\n\n\nexport function min(num) {\n return (value, fieldName) => {\n const numberError = isNumber(value, fieldName);\n if (numberError) {\n return numberError;\n }\n\n if (typeof value === 'string') {\n value = parseInt(value, 10);\n }\n\n if (value < num) {\n return `must be at least ${num}`;\n }\n\n return false;\n };\n}\n\n\nexport function max(num) {\n return (value, fieldName) => {\n const numberError = isNumber(value, fieldName);\n if (numberError) {\n return numberError;\n }\n\n if (typeof value === 'string') {\n value = parseInt(value, 10);\n }\n\n if (value > num) {\n return `${fieldName} must be at most ${num}`;\n }\n\n return false;\n };\n}\n\n\nconst EMAIL_RE = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\nexport function isEmail(value) {\n const errorMessage = `is not valid`;\n\n if (!EMAIL_RE.test(value)) {\n return errorMessage;\n }\n\n return false;\n}\n\n\nfunction unique(arr) {\n const hash = {};\n return arr.filter((val) => {\n const alreadyPresent = hash[val];\n hash[val] = true;\n return !alreadyPresent;\n });\n}\n","import { Component } from 'react';\nimport MoneySelector from './moneyselector.js';\nimport MembershipBenefitPanel from './membershipbenefitpanel.js';\nimport RecurringNudge from './recurringnudge.js';\nimport FrequencySelector, { FREQUENCY_OPTIONS } from './frequencyselector.js';\nimport NextButton from './nextbutton.js';\nimport { createValidator, required, min } from '../shared/validators.js';\nimport { trackEvent } from '../analytics/helpers.js';\nimport { getUrlParameter, isNullOrUndefined } from '../../shared/utils';\nimport { formatMoney } from './shared.js';\n\nconst DEFAULT_MONTHLY_VALUE = 15; // dollars\nconst DEFAULT_ANNUAL_VALUE = 50;\nconst DEFAULT_ONCE_VALUE = 100;\nconst MINIMUM_ONCE_DONATION_AMOUNT = 5;\nconst MINIMUM_RECURRING_DONATION_AMOUNT = 3;\n\nconst recurringValidator = createValidator({\n donationAmount: [required, min(MINIMUM_RECURRING_DONATION_AMOUNT)],\n});\n\nconst onceValidator = createValidator({\n donationAmount: [required, min(MINIMUM_ONCE_DONATION_AMOUNT)],\n});\n\nexport default class SupportIntent extends Component {\n constructor(props) {\n super(props);\n this.state = this.getInitialState(props);\n }\n\n getInitialState(props) {\n let amount =\n parseInt(getUrlParameter('amount'), 10) || props.savedDonationAmount;\n let urlPeriod = getUrlParameter('period') || props.savedDonationFrequency;\n\n if (isNaN(amount) || amount === 0) {\n amount = this.getDefaultAmount(urlPeriod);\n }\n\n if (amount < 0) {\n amount = Math.abs(amount);\n }\n\n if (isNullOrUndefined(FREQUENCY_OPTIONS[urlPeriod])) {\n urlPeriod = undefined;\n }\n\n return {\n donationAmount: amount,\n donationFrequency: urlPeriod || 'monthly',\n benefitDesired: true,\n amountSet: false,\n coverFees: props.coverFees,\n };\n }\n\n getDefaultAmount(frequency) {\n if (frequency === 'annually') {\n return DEFAULT_ANNUAL_VALUE;\n } else if (frequency === 'once') {\n return DEFAULT_ONCE_VALUE;\n } else {\n return DEFAULT_MONTHLY_VALUE;\n }\n }\n\n getRecommendedRecurringAmount() {\n return Math.max(5, Math.ceil(this.state.donationAmount / 12));\n }\n\n getTotesEnabled() {\n return this.props.enableTotes == 'true';\n }\n\n validate(properties) {\n const validator =\n properties.donationFrequency === FREQUENCY_OPTIONS.once\n ? onceValidator\n : recurringValidator;\n const errors = validator(properties);\n this.setState({ errors: errors });\n return errors;\n }\n\n valid() {\n return !this.state.errors || Object.keys(this.state.errors).length === 0;\n }\n\n updateAmount(amount) {\n const newState = Object.assign({}, this.state, {\n donationAmount: amount,\n amountSet: true,\n });\n this.setState(newState);\n this.validate(newState);\n }\n\n updateFrequency(frequency, cb = undefined) {\n this.setState((state, props) => {\n const updatedState = {\n donationFrequency: frequency,\n };\n\n if (!state.amountSet) {\n updatedState.donationAmount = this.getDefaultAmount(frequency);\n }\n\n return updatedState;\n }, cb);\n }\n\n handleNudgeAgreement() {\n const amount = this.getRecommendedRecurringAmount();\n trackEvent('checkout', 'agreed-recurring', '', amount);\n this.updateAmount(amount);\n this.updateFrequency(FREQUENCY_OPTIONS.monthly, () => this.handleNext());\n }\n\n handleNudgeDecline() {\n trackEvent('checkout', 'decline-recurring', '', this.state.donationAmount);\n this.handleNext();\n }\n\n handleCoverFeesChange(event) {\n this.setState({ coverFees: event.target.checked });\n }\n\n toggleBenefitDesired() {\n this.setState({\n benefitDesired: !this.state.benefitDesired,\n });\n }\n\n handleNext() {\n const errors = this.validate(this.state);\n if (this.valid()) {\n this.props.onComplete(this.state);\n }\n }\n\n coverFeesOption() {\n return (\n
\n \n
\n );\n }\n\n render() {\n let className = '';\n if (!this.props.active && this.props.complete) {\n className += ' support-section-complete';\n }\n\n return (\n
\n {this.props.active && this.renderActive()}\n {!this.props.active && this.props.complete && this.renderComplete()}\n
\n );\n }\n\n renderActive() {\n return (\n
\n \n Yes, I will contribute{' '}\n \n \n \n {this.coverFeesOption()}\n {this.getTotesEnabled() && (\n \n )}\n {this.renderCTA()}\n {this.getTotesEnabled() && (\n
\n \n
\n )}\n
\n );\n }\n\n renderComplete() {\n return (\n
\n

Contribution

\n \n Contributing ${formatMoney(this.props.savedDonationAmount)}{' '}\n {this.props.savedDonationFrequency}.\n \n
\n );\n }\n\n renderCTA() {\n if (\n this.state.donationFrequency == FREQUENCY_OPTIONS.once &&\n this.valid()\n ) {\n return (\n \n );\n } else if (!this.valid()) {\n return (\n

\n \n We do not accept less than ${MINIMUM_RECURRING_DONATION_AMOUNT} for\n recurring donations or less than ${MINIMUM_ONCE_DONATION_AMOUNT} for\n one-time donations.\n \n

\n );\n } else {\n return (\n \n );\n }\n }\n}\n","import { Component } from 'react';\n\nexport default class FormField extends Component {\n constructor(props) {\n super(props);\n this.state = { touched: props.element };\n }\n\n componentDidMount() {\n if (this.props.autoFocus) {\n this.input.focus();\n }\n }\n\n handleBlur() {\n this.setState({ touched: true });\n }\n\n render() {\n let className = `minimal-field ${this.props.className}`;\n const error = this.props.errors && this.props.errors[this.props.name];\n let label = this.props.label || this.props.name;\n\n if (error) {\n className += ' error';\n label += ' ' + error;\n }\n\n let input;\n let id = this.props.name + '-field';\n if (!this.props.element) {\n input = (\n (this.input = input)}\n name={this.props.name}\n />\n );\n } else {\n input = this.props.children;\n }\n\n return (\n
\n {input}\n \n
\n );\n }\n}\n","// packages\nimport cx from 'classnames';\n\n/**\n * @param {object} props\n * @param {string} props.className\n * @param {boolean} props.disabled\n * @param {Record} props.errors\n * @param {string} props.label\n * @param {string} props.name\n * @param {React.ChangeEvent} props.onChange\n * @param {{name: string, value: string}[]} props.options\n * @param {string} props.value\n * @returns {JSX.Element}\n */\nexport default function SelectFormField({\n className,\n disabled = false,\n errors = {},\n label = name,\n name,\n onChange,\n options,\n value,\n}) {\n const id = `${name}-field`;\n const error = errors[name];\n\n if (error) {\n label += ` ${error}`;\n }\n\n return (\n
\n
\n \n \n {options.map((option) => (\n \n ))}\n \n \n
\n \n
\n );\n}\n","// packages\nimport { useState } from 'react';\nimport cx from 'classnames';\n\n// local\nimport FormField from '../shared/formfield.js';\nimport SelectFormField from '../shared/selectformfield.js';\nimport NextButton from './nextbutton.js';\nimport { useCountries, useSubdivisions } from './hooks.js';\nimport { createValidator, required, isEmail } from '../shared/validators.js';\n\nconst validator = createValidator({\n firstName: [required],\n lastName: [required],\n email: [required, isEmail],\n zip: [required],\n});\n\nconst shippingValidator = createValidator({\n firstName: [required],\n lastName: [required],\n email: [required, isEmail],\n address1: [required],\n city: [required],\n state: [required],\n country: [required],\n zip: [required],\n});\n\n// some countries do not have states/provinces/regions\nconst noSubdivisionsShippingValidator = createValidator({\n firstName: [required],\n lastName: [required],\n email: [required, isEmail],\n address1: [required],\n city: [required],\n country: [required],\n zip: [required],\n});\n\n/**\n * @param {object} props\n * @param {boolean} props.active\n * @param {boolean} props.complete\n * @param {Record} props.contactInfo\n * @param {(values: object) => void} props.onComplete\n * @param {boolean} props.receivingBenefit\n */\nexport default function ContactInfoForm({\n active,\n complete,\n contactInfo,\n onComplete,\n receivingBenefit,\n}) {\n const [values, setValues] = useState(contactInfo);\n const [errors, setErrors] = useState({});\n\n const countries = useCountries();\n const subdivisions = useSubdivisions(values.country);\n const noSubdivisions = subdivisions.length === 0;\n\n /**\n * @param {React.ChangeEvent} event\n */\n function handleChange(event) {\n const { name, value } = event.target;\n\n const newValues = Object.assign({}, values, {\n [name]: value,\n });\n\n // we need to un-set \"state\" if \"country\" has changed\n if (values.country !== newValues.country) {\n newValues.state = '';\n }\n\n setValues(newValues);\n }\n\n // Returns an object of { fieldName: 'Error message' } or false if valid.\n function validate(values) {\n let errors;\n\n if (receivingBenefit) {\n if (noSubdivisions) {\n errors = noSubdivisionsShippingValidator(values);\n } else {\n errors = shippingValidator(values);\n }\n } else {\n errors = validator(values);\n }\n\n setErrors(errors);\n\n return errors;\n }\n\n /**\n *\n * @param {React.FormEvent} event\n */\n function handleNext(event) {\n event.preventDefault();\n\n const errors = validate(values);\n\n if (Object.keys(errors).length === 0) {\n onComplete(values);\n }\n }\n\n const className = cx('contact-info-form', {\n 'shipping-benefits': receivingBenefit,\n 'support-section-complete': !active && complete,\n });\n\n return (\n
\n

Contact Info

\n {active && (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n )}\n {!active && complete && }\n
\n );\n}\n\n/**\n *\n * @param {object} props\n * @param {Record} props.contactInfo\n */\nfunction ContactFormComplete({ contactInfo: savedInfo }) {\n return (\n
\n
{compactJoin([savedInfo.firstName, savedInfo.lastName], ' ')}
\n
{compactJoin([savedInfo.email, savedInfo.phone], ' ยท ')}
\n
{compactJoin([savedInfo.address1, savedInfo.address2], ', ')}
\n
\n {compactJoin([savedInfo.city, savedInfo.state, savedInfo.zip], ', ')}\n
\n
{savedInfo.country}
\n
\n );\n}\n\nfunction compactJoin(list, separator) {\n const compactList = list.filter((x) => !!x);\n return compactList.join(separator);\n}\n","// packages\nimport { useEffect, useState } from 'react';\n\n// local\nimport http from '$shared/http.js';\n\nexport function useCountries() {\n const [countries, setCountries] = useState([]);\n\n useEffect(() => {\n http\n .get('/donate/countries')\n .json()\n .then((data) => {\n setCountries(data);\n });\n }, []);\n\n return countries;\n}\n\nexport function useSubdivisions(countryCode) {\n const [subdivisions, setSubdivisions] = useState([]);\n\n useEffect(() => {\n http\n .get(`/donate/countries/${countryCode}`)\n .json()\n .then((data) => {\n setSubdivisions(data);\n });\n }, [countryCode]);\n\n return subdivisions;\n}\n","import { Component } from 'react';\n\nexport default class ProgressLogo extends Component {\n constructor(props) {\n super(props);\n this.state = { logoPhase: 0 };\n this.timeout = window.setTimeout(this.animateLogos.bind(this), 300);\n }\n\n animateLogos() {\n this.setState({ logoPhase: (this.state.logoPhase + 1) % 6 });\n this.timeout = window.setTimeout(this.animateLogos.bind(this), 300);\n }\n\n componentWillUnmount() {\n window.clearTimeout(this.timeout);\n }\n\n render() {\n return (\n
\n
\n \n {this.state.logoPhase === 0 && (\n \n \n \n \n \n \n )}\n {(this.state.logoPhase === 1 || this.state.logoPhase === 5) && (\n \n \n \n \n \n \n \n \n \n \n )}\n {(this.state.logoPhase === 2 || this.state.logoPhase === 4) && (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n {this.state.logoPhase === 3 && (\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","import React, { useEffect, useState } from 'react';\nimport {\n PaymentElement,\n LinkAuthenticationElement,\n useStripe,\n useElements,\n} from '@stripe/react-stripe-js';\n\nimport Button from '../shared/button.js';\nimport ProgressLogo from './progresslogo.js';\nimport { getAmountWithFees, formatMoney } from './shared.js';\n\nexport default function StripeForm(props) {\n const stripe = useStripe();\n const elements = useElements();\n\n const [email, setEmail] = useState('');\n const [message, setMessage] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSubmit = async (e) => {\n e.preventDefault();\n\n if (!stripe || !elements) {\n // Stripe.js hasn't yet loaded.\n // Make sure to disable form submission until Stripe.js has loaded.\n return;\n }\n\n setIsLoading(true);\n\n const { error } = await stripe.confirmPayment({\n elements,\n confirmParams: {\n return_url: `${window.location.origin}/donate/newsletters`,\n },\n });\n\n // This point will only be reached if there is an immediate error when\n // confirming the payment. Otherwise, your customer will be redirected to\n // your `return_url`. For some payment methods like iDEAL, your customer will\n // be redirected to an intermediate site first to authorize the payment, then\n // redirected to the `return_url`.\n if (error.type === 'card_error') {\n setMessage(error.message);\n } else if (error.type === 'validation_error') {\n // These are displayed in the stripe UI.\n } else {\n setMessage(`An unexpected error occurred. ${error.message}`);\n }\n\n setIsLoading(false);\n };\n\n const getButtonText = function () {\n const amountString = formatMoney(\n getAmountWithFees(props.amount, props.coverFees)\n );\n let text = `Contribute $${amountString}`;\n\n if (props.frequency !== 'Once') {\n text += ' ' + props.frequency;\n }\n\n return text;\n };\n\n const stripeOptions = {\n defaultValues: {\n billingDetails: {\n name: `${props.contactInfo.firstName} ${props.contactInfo.lastName}`,\n email: props.contactInfo.email,\n phone: props.contactInfo.phone,\n address: {\n line1: props.contactInfo.address1,\n line2: props.contactInfo.address2,\n country: props.contactInfo.country,\n state: props.contactInfo.state,\n city: props.contactInfo.city,\n postal_code: props.contactInfo.zip,\n },\n },\n },\n };\n\n return (\n
\n \n \n {isLoading && }\n {/* Show any error or success messages */}\n {message && (\n
\n {message}\n
\n )}\n \n );\n}\n","import { Component } from 'react';\n\nimport StripeForm from './stripeform.js';\nimport PayPalForm from './paypalform.js';\n\nexport default class PaymentForm extends Component {\n render() {\n let className = '';\n if (!this.props.active && this.state.complete) {\n className += ' support-section-complete';\n }\n\n return (\n
\n
\n

Payment

\n
\n {this.props.active && this.renderActive()}\n {!this.props.active && this.state.complete && this.renderComplete()}\n
\n );\n }\n\n renderActive() {\n return (\n
\n \n
\n );\n }\n\n renderComplete() {\n const card = this.props.savedPaymentToken.card;\n return `${card.brand} ending in ${card.last4}`;\n }\n}\n","import cx from 'classnames';\n\nexport default function SupportSection({\n active,\n complete,\n onActivate,\n noEdit,\n children,\n}) {\n if (!active && !complete) {\n return
;\n }\n\n const controls = (\n \n );\n\n return (\n \n
{children}
\n {!active && complete && !noEdit && controls}\n
\n );\n}\n","import { trackEvent } from '../analytics/helpers.js';\n\n/**\n * Track a step of the checkout process using Google Analytics and their\n * recommended events. See https://developers.google.com/analytics/devguides/collection/ga4/reference/events?sjid=8256709344012883295-NA&client_type=gtag#purchase\n *\n * @param {string} step - The step of the checkout process\n * @param {Object} currentState - The current state of the checkout process\n * @param {number} currentState.donationAmount - The amount of the donation\n * @param {string} currentState.donationFrequency - The frequency of the\n * donation\n * @param {string} currentState.benefitDesired - Whether the donor wants to\n * receive a benefit\n * @param {string[]} currentState.subscriptions - The subscriptions the donor\n * wants to sign up for\n */\nexport function trackCheckoutStep(step, currentState) {\n if (step === 'intent') {\n trackEvent('begin_checkout', formatEventData(currentState));\n } else if (step === 'contact') {\n trackEvent('add_shipping_info', formatEventData(currentState));\n } else if (step === 'payment') {\n trackEvent('add_payment_info', {\n payment_type: 'Stripe',\n ...formatEventData(currentState),\n });\n } else if (step === 'review') {\n trackEvent('purchase', {\n newsletters: currentState.subscriptions,\n cover_fees: currentState.coverFees,\n ...formatEventData(currentState),\n });\n }\n}\n\n/**\n * Format the data for a GA4 event.\n * @param {Object} currentState - The current state of the checkout process\n * @param {number} currentState.donationAmount - The amount of the donation\n * @param {string} currentState.donationFrequency - The frequency of the\n * donation\n * @param {string} currentState.benefitDesired - Whether the donor wants to\n * receive a benefit\n * @returns {Object} - The formatted data\n * @private\n */\nfunction formatEventData(currentState) {\n return {\n currency: 'USD',\n value: currentState.donationAmount,\n donation_frequency: currentState.donationFrequency,\n benefit_desired: currentState.benefitDesired,\n items: [\n {\n item_name: `Donate ${currentState.donationFrequency}`,\n },\n ],\n };\n}\n","import {\n getUrlParameter,\n getBootstrapData,\n isNullOrUndefined,\n} from '$shared/utils.js';\n\nexport function getInitialState() {\n const notice = getBootstrapData('donate_error', true) || null;\n const inboundVia = getUrlParameter('via') || 'unknown';\n\n // Cover fees should always start as false, even if it was agreed to\n // initially and this is a page refresh. The backend stores the amount\n // that will actually be paid, not the amount without the fees, so the\n // amount being passed in here either already includes the fees and they\n // shouldn't be included again, or it doesn't because the donor didn't\n // opt in and it should be remain that way.\n const coverFees = false;\n\n return {\n coverFees,\n notice,\n inboundVia,\n error: null,\n ...getContactInfo(),\n ...getPaymentState(),\n ...getDonationState(),\n ...getInitialStepState(),\n };\n}\n\nfunction getInitialStepState() {\n const correctionStep = getUrlParameter('donate_step') || null;\n let step = 'intent';\n let completedSteps = [];\n\n if (correctionStep === 'contact') {\n step = 'contact';\n completedSteps = ['intent'];\n } else if (correctionStep === 'payment') {\n step = 'payment';\n completedSteps = ['intent', 'contact'];\n }\n\n return {\n step,\n completedSteps,\n };\n}\n\nfunction getDonationState() {\n const donation = getBootstrapData('donation', true) || {};\n let donationAmount = Number(donation.amount);\n if (Number.isNaN(donationAmount)) {\n donationAmount = 15;\n }\n\n let benefitDesired = donation.benefit_desired;\n if (isNullOrUndefined(benefitDesired)) {\n benefitDesired = true;\n }\n\n return {\n donationFrequency: donation.frequency || 'monthly',\n donationAmount,\n benefitDesired,\n };\n}\n\nfunction getContactInfo() {\n const donor = getBootstrapData('donor', true) || {};\n return {\n contactInfo: {\n firstName: donor.first_name || '',\n lastName: donor.last_name || '',\n email: donor.email || '',\n phone: donor.phone || '',\n address1: donor.address1 || '',\n address2: donor.address2 || '',\n country: donor.country || 'US', // default to US for now\n state: donor.state || '',\n city: donor.city || '',\n zip: donor.zip || '',\n },\n };\n}\n\nfunction getPaymentState() {\n const payment = getBootstrapData('payment', true) || {};\n\n return {\n paymentIntentId: payment.platform_id || null,\n clientSecret: getUrlParameter('client_secret') || null,\n };\n}\n","// packages\nimport { Component } from 'react';\nimport { loadStripe } from '@stripe/stripe-js';\nimport { Elements } from '@stripe/react-stripe-js';\nimport scrollToComponent from 'react-scroll-to-component';\n\n// local\nimport Pitch from './pitch.js';\nimport SupportIntent from './supportintent.js';\nimport ContactInfoForm from './contactinfoform.js';\nimport PaymentForm from './paymentform.js';\nimport SupportSection from './supportsection.js';\nimport { trackEvent } from '../analytics/helpers.js';\nimport { trackCheckoutStep } from './analytics.js';\nimport http from '$shared/http.js';\nimport { isMobileViewport } from '$shared/utils.js';\nimport { receivingBenefit, getAmountWithFees } from './shared.js';\nimport { getInitialState } from './state.js';\n\nconst STEPS = ['intent', 'contact', 'payment', 'complete'];\n\nconst stripePromise = loadStripe(window.TMPStripePublishableKey);\n\nexport default class SupportPage extends Component {\n constructor(props) {\n super(props);\n this.state = getInitialState();\n }\n\n markStepComplete(step) {\n let completedSteps = this.state.completedSteps;\n let firstCompletion = false;\n\n // Send GA virtual page view if this is the first time we've completed this step\n if (!completedSteps.includes(step)) {\n completedSteps = [...completedSteps, step];\n firstCompletion = true;\n }\n const nextStep = STEPS.find((step) => !completedSteps.includes(step));\n\n this.setState({ completedSteps, step: nextStep }, () => {\n trackCheckoutStep(step, this.state);\n this.scrollToSection(nextStep);\n });\n }\n\n handleActivate(section) {\n this.setState({ step: section }, () => {\n this.scrollToSection(section);\n });\n trackEvent('edit_completed_checkout_section', { section });\n }\n\n scrollToSection(section) {\n if (!isMobileViewport()) {\n return;\n }\n scrollToComponent(this[section], {\n align: 'top',\n offset: -80,\n duration: 300,\n });\n }\n\n intentComplete(data) {\n this.setState(\n {\n donationAmount: data.donationAmount,\n donationFrequency: data.donationFrequency,\n benefitDesired: data.benefitDesired,\n coverFees: data.coverFees,\n },\n () => this.fetchPaymentIntent()\n );\n this.markStepComplete('intent');\n }\n\n contactInfoComplete(info) {\n this.setState(\n {\n contactInfo: info,\n },\n () => this.save()\n );\n this.markStepComplete('contact');\n }\n\n fetchPaymentIntent() {\n http\n .post('/donate/payment-intent', {\n json: {\n amount: getAmountWithFees(\n this.state.donationAmount,\n this.state.coverFees\n ),\n frequency: this.state.donationFrequency,\n paymentIntentId: this.state.paymentIntentId,\n },\n })\n .json()\n .then((data) => {\n if (data.clientSecret) {\n this.setState({\n clientSecret: data.clientSecret,\n paymentIntentId: data.id,\n });\n }\n })\n .catch(async (error) => {\n const data = await error.response.json();\n\n console.log('Error fetching payment intent', data);\n this.setState({\n clientSecret: null,\n error: data.error || 'Something went wrong processing your donation.',\n });\n });\n }\n\n save() {\n http\n .post('/donate/save-details', {\n json: {\n inboundVia: this.state.inboundVia,\n amount: getAmountWithFees(\n this.state.donationAmount,\n this.state.coverFees\n ),\n coverFees: this.state.coverFees,\n paymentIntentId: this.state.paymentIntentId,\n email: this.state.contactInfo.email,\n contactInfo: this.state.contactInfo,\n frequency: this.state.donationFrequency.toLowerCase(),\n benefitDesired: this.state.benefitDesired,\n },\n })\n .json()\n .then(() => {\n this.setState({\n error: null,\n });\n\n window.history.pushState(\n null,\n '',\n `/donate?payment_intent=${this.state.paymentIntentId}&client_secret=${this.state.clientSecret}&donate_step=payment`\n );\n })\n .catch(async (error) => {\n let errorMessage;\n try {\n const data = await error.response.json();\n errorMessage = data.error;\n } catch (e) {\n errorMessage = 'Something went wrong processing your donation.';\n }\n\n this.setState({\n error: errorMessage,\n });\n });\n }\n\n getStripeOptions() {\n return {\n clientSecret: this.state.clientSecret,\n appearance: {\n theme: 'night',\n variables: {\n colorPrimary: '#ff0b3a',\n colorDanger: '#ff0b3a',\n },\n },\n };\n }\n\n render() {\n return (\n
\n {this.renderNotice()}\n {!this.state.error && this.renderSections()}\n
\n );\n }\n\n renderSections() {\n return (\n
\n {this.state.step === 'intent' && (\n \n )}\n \n \n \n \n \n \n \n \n {this.state.clientSecret && (\n \n )}\n \n \n
\n );\n }\n\n renderNotice() {\n if (this.state.error) {\n return (\n
\n
{this.state.error}
\n

\n If the problem persists please contact{' '}\n \n support@themarshallproject.org\n \n

\n
\n );\n } else if (this.state.notice) {\n return (\n
\n
{this.state.notice}
\n

\n Please correct the problem below. If the problem persists please\n contact{' '}\n \n support@themarshallproject.org\n \n

\n
\n );\n }\n }\n}\n","import React from 'react';\nimport { render } from 'react-dom';\n\nimport SupportPage from './supportpage.js';\n\nconst container = document.getElementById('support-app-js');\n\nrender(\n \n \n ,\n container\n);\n","// We set up the ga object here so that any code depending on the presence of\n// ga can import this file and forever assume that they can use it normally,\n// without checking whether its really running all the time. This decouples the\n// decision of \"Do we want analytics right now?\" from everywhere we actually\n// use analytics.\nwindow.dataLayer = window.dataLayer || [];\nexport const gtag =\n window.gtag ||\n function () {\n window.dataLayer.push(arguments);\n };\n\nexport const ga = (window.ga =\n window.ga ||\n function () {\n (ga.q = ga.q || []).push(arguments);\n });\n","// packages\nimport ky from 'ky';\n\n/**\n * Returns the CSRF token from the meta tag. This is injected by Rails using\n * the `csrf_meta_tags` helper.\n *\n * @returns {string}\n */\nexport function getCsrfToken() {\n return document\n .querySelector(\"meta[name='csrf-token']\")\n ?.getAttribute('content');\n}\n\n/**\n * Audits whether a given URL is on the same origin as the current page. We do\n * not want to send the CSRF token to different origins because sometimes third-party\n * services will throw errors if they receive a header they don't expect.\n *\n * @private\n * @param {string} url\n * @returns {boolean}\n */\nfunction isUrlSameOrigin(url) {\n // it is a relative URL so same origin\n if (!url.startsWith('http')) {\n return true;\n }\n\n try {\n // if the hostname matches, it's the same origin\n return new URL(url).hostname === window.location.hostname;\n } catch (_) {\n // if something goes wrong with the URL parsing we err on the side of\n // caution and assume it's the same origin\n return true;\n }\n}\n\n/**\n * @param {Request} request\n */\nfunction applyCsrfTokenToRequest(request) {\n // only need the CSRF token for non-GET requests\n if (request.method !== 'GET') {\n // send CSRF token only with same origin requests\n if (isUrlSameOrigin(request.url)) {\n request.headers.set('X-CSRF-Token', getCsrfToken());\n }\n }\n}\n\nexport default ky.create({\n hooks: { beforeRequest: [applyCsrfTokenToRequest] },\n});\n","export function ensure(name, object, requiredKeys) {\n const errors = [];\n\n requiredKeys.forEach((key) => {\n if (isUndefined(object[key])) {\n errors.push(`Required key ${key} missing from options`);\n }\n });\n\n if (errors.length > 0) {\n throw new Error(`Error calling ${name}:\\n${errors.join('\\n')}`);\n }\n}\n\nexport function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}\n\nexport function isUndefined(value) {\n return value === undefined;\n}\n\nexport function getBootstrapData(key, optional = false) {\n const value = window.TMPBootstrapData[key];\n\n if (!optional && isUndefined(value)) {\n throw new Error(`Required bootstrap value ${key} is absent \\\n did you forget to call set_bootstrap_data in the controller?`);\n }\n\n return value;\n}\n\nexport function abstractMethod(name) {\n throw new Error(\n `${name} is an abstract method and must be implemented in the child class`\n );\n}\n\nexport function getDomain(url) {\n const a = document.createElement('a');\n a.href = url;\n return a.hostname.replace('//www.', '//');\n}\n\nexport function isMobileViewport() {\n return window.innerWidth <= 768;\n}\n\n// Lifted from https://davidwalsh.name/query-string-javascript\nexport function getUrlParameter(name) {\n name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n const regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n const results = regex.exec(location.search);\n return results === null\n ? ''\n : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n}\n\n// Lifted from https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\nexport function uuidv4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>\n (\n c ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))\n ).toString(16)\n );\n}\n\nexport function renderClassToElement(klass, selector, options = {}) {\n const $els = $(selector);\n\n if ($els.length > 0) {\n $els.each((index, el) => {\n const instance = new klass({ el });\n if (!options.skipRender) {\n instance.render();\n }\n });\n }\n}\n\nexport function whenElementExists(selectors, fn) {\n if (document.querySelector(selectors)) {\n fn();\n }\n}\n\nexport function dynamicRenderClassToElement(\n selectors,\n loadFn,\n { skipRender } = {}\n) {\n const els = document.querySelectorAll(selectors);\n const count = els.length;\n\n // we have one, keep going\n if (count > 0) {\n loadFn().then(({ default: Class }) => {\n for (let idx = 0; idx < count; idx++) {\n const el = els[idx];\n const instance = new Class({ el });\n\n if (!skipRender) {\n instance.render();\n }\n }\n });\n }\n}\n\nexport function loadScript(url) {\n const tag = document.createElement('script');\n tag.src = url;\n tag.async = true;\n document.body.append(tag);\n}\n"],"names":["trackEvent","eventName","eventData","category","action","label","value","event_name","event_category","event_action","event_label","event_value","convertLegacyEvent","arguments","e","console","warn","trackParselyConversion","parselyConversionEventQueue","capture","type","window","PARSELY","loaded","report","push","conversions","log","TMPBootstrapData","parselyConversion","conversion","onload","forEach","event","trackParselyNewsletterConversion","TMPAnalytics","trackConversion","Pitch","copyOptions","collapsed","setCollapsed","useState","title","body","renderedBody","dangerouslySetInnerHTML","__html","fallbackBody","className","onClick","closed","MoneySelector","Component","constructor","props","super","this","state","open","ignoreFocus","onChange","parseInt","target","replace","isNaN","Math","abs","handleFocus","setState","handleBlur","handleSelection","_","delay","input","focus","getOptionValues","frequency","other","render","optionValues","options","Object","keys","map","key","onMouseDown","bind","optionsMarkup","errors","donationAmount","ref","i","autoComplete","name","placeholder","onFocus","onBlur","BenefitOption","desired","onToggle","text","getAnnualTotal","amount","receivingBenefit","getBenefitThreshold","getAmountWithFees","coverFees","numericAmount","round","formatMoney","number","Number","isInteger","toFixed","MembershipBenefitPanel","getAdditionalString","num","multiplier","getAdditionalForBenefit","ceil","getAdditionalFrequency","message","shouldDisplayOption","benefitDesired","toggleBenefitDesired","Button","handleKeyPress","keyCode","extraProps","id","disabled","role","tabIndex","onKeyDown","RecurringNudge","onAgree","recurringAmount","onDecline","CustomSelect","readOnly","FREQUENCY_OPTIONS","annually","monthly","once","FrequencySelector","NextButton","createValidator","rules","values","field","fieldErrors","arr","hash","filter","val","alreadyPresent","unique","rule","error","Boolean","fieldError","join","length","required","errorMessage","Array","isArray","trim","isNumber","min","fieldName","numberError","EMAIL_RE","isEmail","test","recurringValidator","onceValidator","SupportIntent","getInitialState","savedDonationAmount","urlPeriod","savedDonationFrequency","getDefaultAmount","donationFrequency","amountSet","getRecommendedRecurringAmount","max","getTotesEnabled","enableTotes","validate","properties","valid","updateAmount","newState","assign","updateFrequency","cb","updatedState","handleNudgeAgreement","handleNext","handleNudgeDecline","handleCoverFeesChange","checked","onComplete","coverFeesOption","viewBox","points","active","complete","renderActive","renderComplete","renderCTA","src","FormField","touched","element","componentDidMount","autoFocus","children","htmlFor","SelectFormField","option","validator","firstName","lastName","email","zip","shippingValidator","address1","city","country","noSubdivisionsShippingValidator","ContactInfoForm","contactInfo","setValues","setErrors","countries","setCountries","useEffect","http","get","json","then","data","useCountries","subdivisions","countryCode","setSubdivisions","useSubdivisions","noSubdivisions","handleChange","newValues","preventDefault","onSubmit","phone","address2","form","ContactFormComplete","savedInfo","compactJoin","list","separator","x","ProgressLogo","logoPhase","timeout","setTimeout","animateLogos","componentWillUnmount","clearTimeout","xmlns","StripeForm","stripe","useStripe","elements","useElements","setEmail","setMessage","isLoading","setIsLoading","stripeOptions","defaultValues","billingDetails","address","line1","line2","postal_code","PaymentElement","getButtonText","async","confirmPayment","confirmParams","return_url","location","origin","PaymentForm","card","savedPaymentToken","brand","last4","SupportSection","onActivate","noEdit","controls","formatEventData","currentState","currency","donation_frequency","benefit_desired","items","item_name","getInitialStepState","correctionStep","step","completedSteps","getDonationState","donation","getContactInfo","donor","first_name","last_name","getPaymentState","paymentIntentId","platform_id","clientSecret","STEPS","stripePromise","TMPStripePublishableKey","SupportPage","notice","inboundVia","markStepComplete","firstCompletion","includes","nextStep","find","payment_type","newsletters","subscriptions","cover_fees","trackCheckoutStep","scrollToSection","handleActivate","section","align","offset","duration","intentComplete","fetchPaymentIntent","contactInfoComplete","info","save","post","catch","response","toLowerCase","history","pushState","getStripeOptions","appearance","theme","variables","colorPrimary","colorDanger","renderNotice","renderSections","Elements","paymentToken","href","container","document","getElementById","dataset","dataLayer","gtag","ga","q","getCsrfToken","querySelector","getAttribute","create","hooks","beforeRequest","request","method","url","startsWith","URL","hostname","isUrlSameOrigin","headers","set","ensure","object","requiredKeys","isUndefined","Error","isNullOrUndefined","getBootstrapData","optional","abstractMethod","isMobileViewport","innerWidth","getUrlParameter","results","RegExp","exec","search","decodeURIComponent","uuidv4","c","crypto","getRandomValues","Uint8Array","toString","renderClassToElement","klass","selector","$els","$","each","index","el","instance","skipRender","whenElementExists","selectors","fn","dynamicRenderClassToElement","loadFn","els","querySelectorAll","count","default","Class","idx","loadScript","tag","createElement","append"],"sourceRoot":""}