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H,SACnCE,EAAOmS,mBAAmBlL,EAAMjH,MAChCsS,EAAcL,EAAMhQ,KAAK,KAG3BsQ,EAAwBtL,EAAMjH,KAAK5C,QAAQ,iBAAkB,IAC7DoV,EAAcL,mBAAmBI,GAErC,OAAQtL,EAAMP,cACZ,IAAK,eAgBL,QACE0L,EAAO,UACPjG,EAAS,GAAAtO,OAAMwU,EAAQ,aAAAxU,OAAYiC,EAAO,UAAAjC,OAASmC,EAAI,KAAAnC,OAAIyU,SAd7D,IAAK,QACHF,EAAO,mDACPjG,EAAS,MAAAtO,OAASwU,EAAQ,QAAAxU,OAAOiC,EAAO,UAAAjC,OAASmC,EAAI,KAAAnC,OAAIyU,GACzD,MACF,IAAK,UACHF,EAAO,+DACPjG,EAAS,MAAAtO,OAASwU,EAAQ,aAAAxU,OAAYiC,EAAO,UAAAjC,OAAS2U,EAAW,KAAA3U,OAAIyU,GACrE,MACF,IAAK,QACHF,EAAO,mCACPjG,EAAS,MAAAtO,OAASwU,EAAQ,aAAAxU,OAAYiC,EAAO,UAAAjC,OAASmC,EAAI,KAAAnC,OAAIyU,GAMlE,MAAM,GAANzU,OAAUuU,GAAIvU,OAAGsO,EACnB,C","sources":["webpack://app/./app/javascript/components/Button/Button.js","webpack://app/./app/javascript/util/locales/helpers.js","webpack://app/./app/javascript/util/TranslationsLoader.js","webpack://app/./app/javascript/components/ComponentWrapper.js","webpack://app/./app/javascript/components/EmailEditor/EmailEditor.js","webpack://app/./app/javascript/components/ErrorMessages.js","webpack://app/./app/javascript/components/Form/FormGroup.js","webpack://app/./app/javascript/components/SweetInput/SweetInput.js","webpack://app/./app/javascript/components/SweetSelect/SweetSelect.js","webpack://app/./app/javascript/modules/consent/consent.ts","webpack://app/./app/javascript/plugins/email_tool/EmailToolView.js","webpack://app/./app/javascript/plugins/email_tool/index.tsx","webpack://app/./app/javascript/plugins/plugin.ts","webpack://app/./app/javascript/util/ChampaignClient/Base.js","webpack://app/./app/javascript/util/ChampaignClient/CallsClient.js","webpack://app/./app/javascript/util/ChampaignClient/MailerClient.js","webpack://app/./app/javascript/util/util.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport './Button.scss';\n\nconst Button = props => {\n const className = classnames(\n 'Button-root',\n props.theme,\n props.disabled ? 'disabled' : '',\n props.className ? props.className : ''\n );\n return (\n \n {props.children}\n \n );\n};\n\nexport default Button;\n","// Converts translations from Rails format to ReactIntl format.\nimport flatten from 'flat';\nimport mapValues from 'lodash/mapValues';\nimport reduce from 'lodash/reduce';\nimport isPlainObject from 'lodash/reduce';\n\nexport function transform(translations) {\n return mapValues(flatten(translations), replaceInterpolations);\n}\n\nexport function replaceInterpolations(value) {\n if (typeof value === 'string') return value.replace(/%{(\\w+)}/g, '{$1}');\n return value;\n}\n","// champaign-i18n is an external (aliases to window.I18n)\n// see config/webpack/custom.js to see where it's aliased\nimport flatten from 'flat';\nimport I18n from 'champaign-i18n';\nimport { mapValues } from 'lodash';\nimport { replaceInterpolations } from './locales/helpers';\n\nconst translations = mapValues(I18n.translations, tree =>\n mapValues(flatten(tree), replaceInterpolations)\n);\n\nexport default function loadTranslations(locale) {\n if (!translations[locale]) {\n throw new Error(`Unsuported locale: ${locale}`);\n }\n return translations[locale];\n}\n","/* */\nimport React, { Component } from 'react';\nimport { Provider } from 'react-redux';\nimport { IntlProvider, addLocaleData } from 'react-intl';\nimport enLocaleData from 'react-intl/locale-data/en';\nimport deLocaleData from 'react-intl/locale-data/de';\nimport frLocaleData from 'react-intl/locale-data/fr';\nimport esLocaleData from 'react-intl/locale-data/es';\nimport ptLocaleData from 'react-intl/locale-data/pt';\nimport nlLocaleData from 'react-intl/locale-data/nl';\nimport arLocaleData from 'react-intl/locale-data/ar';\nimport loadTranslations from '../util/TranslationsLoader';\n\nfunction WrapInStore(options) {\n if (options.store) {\n return {options.children};\n }\n return options.children;\n}\n\nexport default class ComponentWrapper extends Component {\n render() {\n return (\n \n \n
{this.props.children}
\n
\n \n );\n }\n}\n\naddLocaleData([\n ...enLocaleData,\n ...deLocaleData,\n ...frLocaleData,\n ...esLocaleData,\n ...ptLocaleData,\n ...nlLocaleData,\n ...arLocaleData,\n]);\n","// weak\nimport React, { Component } from 'react';\nimport Input from '../SweetInput/SweetInput';\nimport FormGroup from '../Form/FormGroup';\nimport ErrorMessages from '../ErrorMessages';\nimport { FormattedMessage } from 'react-intl';\nimport { compact, debounce, template, isEqual, merge, isEmpty } from 'lodash';\nimport classnames from 'classnames';\nimport { Editor, EditorState } from 'draft-js';\nimport { htmlToText } from 'html-to-text';\nimport { stateFromHTML } from 'draft-js-import-html';\nimport { stateToHTML } from 'draft-js-export-html';\nimport memoizeOne from 'memoize-one';\nimport './EmailEditor.scss';\n\nconst MAX_SUBJECT_LENGTH = 64;\n\nexport default class EmailEditor extends Component {\n constructor(props) {\n super(props);\n this.state = {\n header: interpolateVars(props.header, props.templateVars),\n editableBody: htmlToText(interpolateVars(props.body, props.templateVars)), // interpolate, convert to text & assign content to state\n subject: interpolateVars(props.subject, props.templateVars),\n footer: interpolateVars(props.footer, props.templateVars),\n };\n }\n\n static getDerivedStateFromProps(props, state) {\n const fn = props.templateInterpolate || interpolateVars;\n let body = props.body;\n\n if (typeof fn == 'function') {\n body = fn(props.body, props.templateVars);\n }\n let stateParams = {\n header: interpolateVars(props.header, props.templateVars),\n body: htmlToText(body),\n footer: interpolateVars(props.footer, props.templateVars),\n };\n\n if (state.templateVars != props.templateVars) {\n stateParams = merge(stateParams, {\n editorState: EditorState.createWithContent(\n stateFromHTML(interpolateVars(props.body, props.templateVars))\n ),\n });\n }\n return stateParams;\n }\n\n // shouldComponentUpdate(nextProps, nextState) {\n // return (\n // !isEqual(nextProps.templateVars, this.props.templateVars) ||\n // this.state.subject !== nextState.subject ||\n // stateToHTML(this.state.editorState.getCurrentContent()) !==\n // stateToHTML(nextState.editorState.getCurrentContent()) ||\n // !isEqual(this.props.errors, nextProps.errors)\n // );\n // }\n\n componentDidMount() {\n this.update();\n }\n\n componentDidUpdate() {\n this.update();\n }\n\n update = debounce(() => {\n if (typeof this.props.onUpdate !== 'function') return;\n this.props.onUpdate({\n subject: this.state.subject,\n body: this.body(),\n });\n }, 400);\n\n body() {\n return compact([\n this.state.header + '\\n\\n',\n this.state.editableBody,\n '\\n\\n' + this.state.footer,\n ]).join('');\n }\n\n updateSubject = subject => {\n if (subject.length > MAX_SUBJECT_LENGTH) return;\n this.setState({ subject }, this.update);\n };\n\n updateEditableBody = e => {\n this.setState({ editableBody: e.target.value }, this.update);\n };\n\n onEditorChange = editorState => {\n this.setState({ editorState }, () => {\n if (!editorState.getLastChangeType()) return;\n this.update();\n });\n };\n\n hasValue = memoizeOne(content => {\n if (content) {\n let parser = new DOMParser();\n let parsedValue = parser.parseFromString(content, 'text/html');\n return parsedValue.lastElementChild.innerText.trim().length > 0;\n }\n return false;\n });\n\n // class applied to content blocks\n blockStyleFn = () => 'editor-content-block';\n\n render() {\n const { header, footer, errors } = this.props;\n\n const hasHeaderValue = this.hasValue(header);\n const hasFooterValue = this.hasValue(footer);\n\n const bodyClassName = classnames({\n 'has-error': errors.body && errors.body.length > 0,\n });\n\n return (\n
\n \n \n }\n onChange={this.updateSubject}\n />\n }\n errors={errors.subject}\n />\n \n \n \n
\n {hasHeaderValue && (\n \n )}\n\n \n\n {hasFooterValue && (\n \n )}\n
\n
\n }\n errors={errors.body}\n />\n
\n
\n );\n }\n}\n\nfunction interpolateVars(templateString, templateVars) {\n if (!templateString) return '';\n if (templateString && isEmpty(templateVars)) return templateString;\n return template(templateString)(templateVars);\n}\n","import React from 'react';\nimport { isArray } from 'lodash';\nimport { FormattedMessage } from 'react-intl';\n\nexport default function ErrorMessages(props) {\n if (!props.errors) return null;\n const { errors } = props;\n const name = props.name || (\n \n );\n let message = '';\n\n if (isArray(errors)) {\n message = errors\n .map((error, i) => (\n \n {error}\n \n ))\n .reduce((prev, curr) => [prev, ', ', curr]);\n } else {\n message = {errors};\n }\n\n return (\n
\n

\n {name} {message}.\n

\n
\n );\n}\n","import React from 'react';\nimport classnames from 'classnames';\nimport './FormGroup.scss';\n\nexport default function FormGroup(props) {\n const className = classnames('FormGroup', 'form__group', props.className);\n return
{props.children}
;\n}\n","// weak\nimport React, { Component } from 'react';\nimport classnames from 'classnames';\n\nexport default class SweetInput extends Component {\n constructor(props) {\n super(props);\n this.state = {\n focused: false,\n };\n }\n\n static defaultProps = {\n value: '',\n name: '',\n label: '',\n type: 'text',\n errorMessage: '',\n hasError: false,\n };\n\n hasError() {\n return this.props.hasError || !!this.props.errorMessage;\n }\n\n onChange = e => {\n if (this.props.onChange) {\n this.props.onChange(e.currentTarget.value);\n }\n };\n\n onFocus = () => {\n this.refs.input.focus();\n this.setState({ focused: true });\n };\n\n onBlur = () => this.setState({ focused: false });\n\n render() {\n const className = classnames('sweet-placeholder', this.props.className);\n const labelClassName = classnames({\n 'sweet-placeholder__label': true,\n 'sweet-placeholder__label--full':\n !!this.props.value && !this.state.focused,\n 'sweet-placeholder__label--active': this.state.focused,\n 'has-error': this.hasError(),\n });\n const inputClassName = classnames('sweet-placeholder__field', {\n 'has-error': this.hasError(),\n });\n\n return (\n
\n \n \n {this.props.errorMessage && (\n {this.props.errorMessage}\n )}\n
\n );\n }\n}\n","import React, { Component } from 'react';\nimport classnames from 'classnames';\nimport Select from 'react-select';\nimport 'react-select/dist/react-select.css';\nimport './SweetSelect.scss';\n\n// TODO: deduplicate this (also seen in SweetInput)\n\nexport default class SweetSelect extends Component {\n constructor(props) {\n super(props);\n this.state = {\n filled: false,\n focused: false,\n };\n }\n\n onChange(item) {\n if (this.props.onChange) {\n const value = item ? item.value : '';\n this.props.onChange(value);\n }\n }\n\n hasError() {\n const { validationState, errorMessage } = this.props;\n if (validationState || validationState === null) {\n return validationState === 'error';\n }\n return !!this.props.errorMessage;\n }\n\n focus() {\n if (!this.refs.select) return;\n this.refs.select.focus();\n }\n toggleFocus(focused) {\n if (focused) this.refs.select.focus();\n this.setState({ focused });\n }\n\n render() {\n const className = classnames('sweet-placeholder__label', {\n 'sweet-placeholder__label--full':\n !!this.props.value && !this.state.focused,\n 'sweet-placeholder__label--active': this.state.focused,\n 'has-error': this.hasError(),\n });\n\n const rootClassName = classnames(\n 'SweetSelect',\n 'sweet-placeholder',\n this.props.className\n );\n\n return (\n
\n \n this.toggleFocus(true)}\n onBlur={e => this.toggleFocus(false)}\n onChange={this.onChange.bind(this)}\n className={this.hasError() ? 'has-error' : ''}\n />\n {this.props.errorMessage}\n
\n );\n }\n}\n","import { includes } from 'lodash';\nimport EEA_LIST from '../../shared/eea-list';\nimport { Member } from '../../state/member/';\n\nconst GDPR_LIST = EEA_LIST.concat('BR');\nexport const isGDPR = (countryCode: string) => GDPR_LIST.includes(countryCode);\n\nexport const isDoubleOptIn = (countryCode: string) => {\n return ['DE', 'AT'].includes(countryCode);\n};\n\nexport const hasConsented = (member: Member) => {\n return member && member.consented != null;\n};\n\nexport const isRequired = (countryCode: string, member: Member) => {\n if (!isGDPR(countryCode)) {\n return false;\n }\n return !hasConsented(member);\n};\n\nexport default {\n hasConsented,\n isRequired,\n isGDPR,\n isDoubleOptIn,\n};\n","import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { compact, get, join, sample, isEmpty } from 'lodash';\nimport Select from '../../components/SweetSelect/SweetSelect';\nimport Input from '../../components/SweetInput/SweetInput';\nimport Button from '../../components/Button/Button';\nimport FormGroup from '../../components/Form/FormGroup';\nimport EmailEditor from '../../components/EmailEditor/EmailEditor';\nimport ErrorMessages from '../../components/ErrorMessages';\nimport ConsentComponent from '../../components/consent/ConsentComponent';\nimport { showConsentRequired } from '../../state/consent/index';\nimport { FormattedMessage } from 'react-intl';\nimport './EmailToolView.scss';\nimport { MailerClient } from '../../util/ChampaignClient';\nimport {\n convertHtmlToPlainText,\n copyToClipboard,\n composeEmailLink,\n buildToEmailForCompose,\n} from '../../util/util';\n\nimport './EmailToolView';\nimport consent from '../../modules/consent/consent';\nimport { changeConsent } from '../../state/consent';\nimport { resetMember } from '../../state/member/reducer';\n\nfunction emailTargetAsSelectOption(target) {\n return {\n label: join(compact([target.name, target.title]), ', '),\n value: target.id,\n };\n}\n\nexport class EmailToolView extends Component {\n constructor(props) {\n super(props);\n this.state = {\n name: this.props.name,\n email: this.props.email,\n cc: this.props.cc,\n bcc: this.props.bcc,\n isRequiredNew: this.props.isRequiredNew,\n emailService: null,\n subject: this.props.emailSubject,\n body: '', // this is the complete body: header + body + footer\n target: sample(this.props.targets),\n targetsForSelection: this.props.targets.map(emailTargetAsSelectOption),\n clickedCopyBodyButton: false,\n errors: {},\n isSubmitting: false,\n allTargetEmails: this.props.targets,\n };\n }\n\n targetId() {\n if (this.props.manualTargeting) {\n return get(this.state.target, 'id', undefined);\n } else {\n // EmailToolSender.rb relies on 'all' as target_id in case we're targeting all of the targets.\n return 'all';\n }\n }\n\n payload() {\n const payload = {\n page_id: this.props.pageId,\n email: {\n body: this.state.body,\n subject: this.state.subject,\n from_name: this.state.name,\n from_email: this.state.email,\n cc: this.state.cc,\n bcc: this.state.bcc,\n target_id: this.targetId(),\n country: this.props.country,\n email_service: this.state.emailService,\n clicked_copy_body_button: this.state.clickedCopyBodyButton,\n },\n tracking_params: {\n ...this.props.trackingParams,\n },\n };\n // For double optin countries consented field should not have a value\n if (this.props.consented !== null) {\n payload.email.consented = this.props.consented ? 1 : 0;\n }\n return payload;\n }\n\n validateForm() {\n const errors = {};\n // For GDPR countries alone this field should have value\n if (\n consent.isRequired(\n this.props.countryCode,\n window.champaign.personalization.member\n ) &&\n this.props.consented === null\n ) {\n this.props.setShowConsentRequired(true);\n errors['consented'] = true;\n }\n this.setState({ errors: errors });\n return isEmpty(errors);\n }\n\n // Event Handlers\n // Use arrow functions so that we don't create new instances\n // inside `render()` to avoid triggering unnecessary re-renders.\n\n // onSubmit\n // Attempt to send the email on submit. If successful, we call the\n // onSuccess prop with the selected target. On failure, we update\n // the state with the errors we receive from the backend.\n\n handleCopyTargetEmailButton = e => {\n e.preventDefault();\n copyToClipboard(\n buildToEmailForCompose(this.getTargetEmails(), this.state.emailService)\n );\n };\n\n handleCopyBodyButton = e => {\n e.preventDefault();\n copyToClipboard(convertHtmlToPlainText(this.state.body));\n this.setState({ clickedCopyBodyButton: true });\n };\n\n handleCopySubjectButton = e => {\n e.preventDefault();\n copyToClipboard(convertHtmlToPlainText(this.state.subject));\n };\n\n getTargetEmails = () => {\n let targetEmails = this.props.manualTargeting\n ? [this.state.target]\n : this.props.targets;\n return targetEmails.map(target => ({\n name: join(compact([target.name, target.title]), ', '),\n email: target.email,\n }));\n };\n\n handleSendEmail = () => {\n const emailParam = {\n emailService: this.state.emailService,\n toEmails: this.getTargetEmails(),\n subject: this.state.subject,\n cc: this.state.cc,\n bcc: this.state.bcc,\n body: convertHtmlToPlainText(this.state.body),\n };\n window.open(composeEmailLink(emailParam));\n };\n\n onSubmit = e => {\n e.preventDefault();\n const valid = this.validateForm();\n\n if (!valid) return;\n this.handleSendEmail();\n this.setState(s => ({ ...s, isSubmitting: true, errors: {} }));\n MailerClient.sendEmail(this.payload()).then(\n response => {\n this.setState(s => ({ ...s, isSubmitting: false }));\n if (typeof this.props.onSuccess === 'function' && this.state.target) {\n this.props.onSuccess(this.state.target, response.data);\n const { follow_up_page } = response.data || {};\n if (follow_up_page) {\n window.location.href = URI(follow_up_page);\n }\n }\n },\n ({ errors }) => {\n this.setState(s => ({ ...s, isSubmitting: false, errors }));\n }\n );\n };\n\n // onTargetChange\n // Update the selected target. We use the target.id to find the\n // target. If no id is passed, we clear the target property.\n onTargetChange = id => {\n this.setState({\n target: this.state.allTargetEmails.find(t => t.id === id),\n });\n };\n\n onNameChange = name => this.setState({ name });\n\n onEmailChange = email => {\n this.setState({ email });\n if (this.state.isRequiredNew) {\n if (window.champaign.personalization.member)\n window.champaign.store.dispatch(resetMember());\n window.champaign.store.dispatch(changeConsent(null));\n this.setState({\n isRequiredNew: consent.isRequired(\n this.props.countryCode,\n window.champaign.personalization.member\n ),\n });\n }\n };\n\n onEmailServiceChange = emailService => this.setState({ emailService });\n\n // onEmailEditorChange\n // The EmailEditor component returns a structure\n onEmailEditorUpdate = emailProps => {\n this.setState({ ...emailProps });\n };\n\n templateVars() {\n return {\n name: this.state.name,\n postal: this.props.postal,\n target: this.state.target,\n };\n }\n\n render() {\n const { errors } = this.state;\n return (\n
\n
\n
\n
\n

{this.props.title}

\n \n {/* Use a component */}\n \n \n {this.props.manualTargeting && (\n \n \n }\n value={get(this.state.target, 'id', undefined)}\n options={this.state.targetsForSelection}\n onChange={this.onTargetChange}\n />\n \n )}\n\n \n }\n value={this.state.name}\n onChange={this.onNameChange}\n />\n }\n errors={errors.fromName}\n />\n \n \n }\n value={this.state.email}\n onChange={this.onEmailChange}\n />\n }\n errors={errors.fromEmail}\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 {this.state.emailService === 'other_email_services' && (\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 {consent.isRequired(\n this.props.countryCode,\n window.champaign.personalization.member\n ) && (\n \n )}\n\n \n this.onSubmit(e)}\n >\n {this.state.emailService === 'other_email_services' ? (\n \n ) : (\n \n )}\n \n \n \n
\n
\n );\n }\n}\n\nexport const mapStateToProps = ({ consent }) => {\n const { countryCode, consented, isRequiredNew, isRequiredExisting } = consent;\n return {\n countryCode,\n consented,\n isRequiredNew,\n isRequiredExisting,\n };\n};\n\nexport const mapDispatchToProps = dispatch => ({\n setShowConsentRequired: consentRequired =>\n dispatch(showConsentRequired(consentRequired)),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(EmailToolView);\n","import { omit, pick } from 'lodash';\nimport * as React from 'react';\nimport { render } from 'react-dom';\nimport { Store } from 'redux';\nimport URI from 'urijs';\nimport ComponentWrapper from '../../components/ComponentWrapper';\nimport { IAppState } from '../../types';\nimport { camelizeKeys } from '../../util/util';\nimport Plugin from '../plugin';\nimport EmailToolView from './EmailToolView';\n\ninterface IEmailToolOptions {\n el: HTMLElement;\n namespace: string;\n config: any; // todo\n store: Store;\n}\nexport const init = options => {\n if (!options.el) {\n options.el = document.getElementById('email-tool-component');\n }\n const { el, store } = options;\n const personalization = window.champaign.personalization;\n const memberData = pick(\n personalization.member,\n 'name',\n 'email',\n 'country',\n 'postal'\n );\n const trackingParams = pick(\n window.champaign.personalization.urlParams,\n 'source',\n 'akid',\n 'referring_akid',\n 'referrer_id',\n 'rid'\n );\n const config = {\n ...options.config,\n ...memberData,\n trackingParams,\n country: memberData.country || personalization.location.country,\n onSuccess(target, response) {\n const searchParams: any = {\n 'target[name]': target.name,\n 'target[title]': target.title,\n };\n if (response?.double_opt_in) {\n searchParams.double_opt_in = 'true';\n }\n window.location.href = URI(`${window.location.pathname}/follow-up`)\n .addSearch(searchParams)\n .toString();\n },\n };\n\n return new EmailTool({\n config,\n el,\n namespace: 'emailtool',\n store,\n });\n};\n\nclass EmailTool extends Plugin {\n public customRenderer: (instance: EmailTool) => any | undefined;\n public wrappedReactComponent?: React.Component;\n\n constructor(options: IEmailToolOptions) {\n super(options);\n this.render();\n }\n\n public render() {\n if (this.customRenderer) {\n return this.customRenderer(this);\n }\n\n const props = omit(camelizeKeys(this.config), 'id', 'ref');\n\n return render(\n \n \n ,\n this.el\n );\n }\n}\n","import * as EventEmitter from 'eventemitter3';\nimport { unmountComponentAtNode } from 'react-dom';\nimport { Store } from 'redux';\nimport { IAppState } from '../types';\n\nexport interface IPluginConfig {\n id: number;\n active: boolean;\n page_id: number;\n ref: string;\n created_at?: string;\n updated_at?: string;\n}\n\nexport interface IPluginOptions {\n config: T;\n customRenderer?: (instance: any) => any | undefined;\n el: HTMLElement;\n eventEmitter?: any;\n namespace?: string;\n store?: Store;\n}\n\n// Plugin is the base class from which other\n// plugins inherit. It implements an EventEmitter\n// with some basic lifecycle methods;\nexport default class Plugin\n implements IPluginOptions {\n public el: HTMLElement;\n public namespace: string;\n public config: T;\n public events: EventEmitter;\n public customRenderer: (instance: any) => any | undefined;\n public store?: Store;\n\n constructor(options: IPluginOptions) {\n this.config = options.config;\n this.el = options.el;\n this.events = options.eventEmitter || new EventEmitter.EventEmitter();\n this.namespace = options.namespace || '';\n this.store = options.store;\n if (options.customRenderer) {\n this.customRenderer = options.customRenderer;\n }\n }\n\n public emit(eventName: string, data?: any) {\n this.events.emit(this.privateEventName(eventName), data);\n this.events.emit(`${this.namespace}:${eventName}`, data);\n }\n\n public on(eventName: string, listener: EventEmitter.ListenerFn, ctx: any) {\n return this.events.on(this.privateEventName(eventName), listener, ctx);\n }\n\n public listeners(eventName: string) {\n return this.events.listeners(this.privateEventName(eventName));\n }\n\n public update(options: Partial>) {\n if (options.namespace) {\n this.namespace = options.namespace;\n }\n if (options.el) {\n this.el = options.el;\n }\n if (options.config) {\n Object.assign(this.config, options.config);\n }\n this.emit('updated');\n }\n\n get renderer() {\n return this.customRenderer;\n }\n\n set renderer(customRenderer: (instance: any) => any) {\n this.customRenderer = customRenderer;\n\n if (this['render']) {\n unmountComponentAtNode(this.el);\n this['render']();\n }\n }\n\n private privateEventName(eventName: string) {\n return `${this.namespace}:${this.config.ref}:${eventName}`;\n }\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { camelizeKeys } from '../util';\n\nexport const parseResponse = response => {\n switch (response.status) {\n case 200:\n case 201:\n case 204:\n return { success: true, errors: {}, data: response.responseJSON };\n case 422:\n case 403:\n return {\n success: false,\n errors: camelizeKeys(response.responseJSON.errors),\n };\n default:\n return {\n success: false,\n errors: {\n base: [\n ,\n ],\n },\n };\n }\n};\n","import { parseResponse } from './Base';\nimport captcha from '../../shared/recaptcha';\n\nconst create = async function(params) {\n const inner = {};\n inner.member_phone_number = params.memberPhoneNumber;\n if (!!params.targetPhoneExtension)\n inner.target_phone_extension = params.targetPhoneExtension;\n if (!!params.targetPhoneNumber)\n inner.target_phone_number = params.targetPhoneNumber;\n if (!!params.targetTitle) inner.target_title = params.targetTitle;\n if (!!params.targetName) inner.target_name = params.targetName;\n if (!!params.checksum) inner.checksum = params.checksum;\n if (!!params.targetId) inner.target_id = params.targetId;\n\n const payload = {\n call: inner,\n ...params.trackingParams,\n 'g-recaptcha-response': params.recaptchaToken,\n };\n\n return new Promise((resolve, reject) => {\n $.post(`/api/pages/${params.pageId}/call`, payload)\n .done((data, textStatus, jqXHR) => {\n resolve(parseResponse(jqXHR));\n })\n .fail((jqXHR, textStatus, errorThrown) => {\n reject(parseResponse(jqXHR));\n });\n });\n};\n\nconst CallsClient = {\n create: create,\n};\n\nexport default CallsClient;\n","import $ from 'jquery';\nimport { parseResponse } from './Base';\n\nexport function sendEmail(params) {\n const { page_id, ...payload } = params;\n\n return new Promise((resolve, reject) => {\n $.post(`/api/pages/${page_id}/emails`, payload)\n .done((data, textStatus, jqXHR) => {\n // Facebook pixel tracking\n const tracking = data.tracking;\n if (tracking) {\n if (typeof window.fbq === 'function') {\n if (tracking.user_id) {\n window.fbq('track', 'CompleteRegistration', tracking);\n }\n }\n }\n // end of pixel tracking\n resolve(parseResponse(jqXHR));\n })\n .fail((jqXHR, textStatus, errorThrown) => {\n reject(parseResponse(jqXHR));\n });\n });\n}\n\nexport function sendPensionEmail(params) {\n const { page_id, payload } = params;\n\n return new Promise((resolve, reject) => {\n $.post(`/api/pages/${page_id}/pension_emails`, payload)\n .done((data, textStatus, jqXHR) => {\n // Facebook pixel tracking\n const tracking = data.tracking;\n if (tracking) {\n if (typeof window.fbq === 'function') {\n if (tracking.user_id) {\n window.fbq('track', 'CompleteRegistration', tracking);\n }\n }\n }\n // end of pixel tracking\n resolve(parseResponse(jqXHR));\n })\n .fail((jqXHR, textStatus, errorThrown) => {\n reject(parseResponse(jqXHR));\n });\n });\n}\n\nexport default {\n sendEmail,\n sendPensionEmail,\n};\n","import { camelCase, mapKeys, mapValues, forEach } from 'lodash';\n\nexport function camelizeKeys(obj) {\n if (!obj) return obj;\n if (Array.isArray(obj)) return obj.map(v => camelizeKeys(v));\n if (typeof obj === 'object') {\n const camelCased = mapKeys(obj, (v, k) => camelCase(k));\n return mapValues(camelCased, v => camelizeKeys(v));\n }\n return obj;\n}\n\nexport function convertHtmlToPlainText(htmlValue) {\n let htmlElement = document.createElement('div');\n htmlElement.innerHTML = htmlValue;\n return htmlElement.textContent || htmlElement.innerText || '';\n} //Should move this to Utils once feature is done\n\nexport function copyToClipboard(content) {\n const htmlElement = document.createElement('textarea');\n htmlElement.value = content;\n document.body.appendChild(htmlElement);\n htmlElement.select();\n document.execCommand('copy');\n document.body.removeChild(htmlElement);\n}\n\nexport function getToEmailBasedOn(emailItem, emailService) {\n if (emailService == 'yahoo') {\n return emailItem.email;\n } else {\n return `${emailItem.name} <${emailItem.email}>`;\n }\n}\n\nexport function buildToEmailForCompose(emailList, emailService) {\n // emailList = [{name: 'ABC', email: 'abs@xyz.com'}];\n let toEmailAddresses;\n forEach(emailList, emailItem => {\n const currentEmail = getToEmailBasedOn(emailItem, emailService);\n toEmailAddresses = toEmailAddresses\n ? `${toEmailAddresses}, ${currentEmail}`\n : currentEmail;\n });\n return toEmailAddresses;\n}\n\nexport function composeEmailLink(email) {\n const sanitizedToEmails = buildToEmailForCompose(\n email.toEmails,\n email.emailService\n );\n\n const { bcc, cc } = email;\n const ccBcc = [];\n\n if (cc && cc.length > 0) {\n ccBcc.push(`cc=${encodeURIComponent(cc)}`);\n }\n\n if (bcc && bcc.length > 0) {\n ccBcc.push(`bcc=${encodeURIComponent(bcc)}`);\n }\n\n const to_email = encodeURIComponent(sanitizedToEmails);\n const subject = encodeURIComponent(email.subject);\n const body = encodeURIComponent(email.body);\n const ccBccString = ccBcc.join('&');\n let host, urlParams;\n\n var textWithoutLineBreaks = email.body.replace(/(\\r\\n|\\n|\\r)/gm, '');\n var outlookBody = encodeURIComponent(textWithoutLineBreaks);\n\n switch (email.emailService) {\n case 'email_client':\n host = 'mailto:';\n urlParams = `${to_email}?subject=${subject}&body=${body}&${ccBccString}`;\n break;\n case 'gmail':\n host = 'https://mail.google.com/mail/?view=cm&fs=1&tf=1&';\n urlParams = `to=${to_email}&su=${subject}&body=${body}&${ccBccString}`;\n break;\n case 'outlook':\n host = 'https://outlook.live.com/mail/0/deeplink/compose?popoutv2=1&';\n urlParams = `to=${to_email}&subject=${subject}&body=${outlookBody}&${ccBccString}`;\n break;\n case 'yahoo':\n host = 'https://compose.mail.yahoo.com/?';\n urlParams = `to=${to_email}&subject=${subject}&body=${body}&${ccBccString}`;\n break;\n default:\n host = 'mailto:';\n urlParams = `${to_email}?subject=${subject}&body=${body}&${ccBccString}`;\n }\n return `${host}${urlParams}`;\n}\n"],"names":["props","className","classnames","theme","disabled","React","type","name","id","onClick","children","replaceInterpolations","value","replace","translations","mapValues","I18n","tree","flatten","loadTranslations","locale","Error","concat","WrapInStore","options","store","Provider","ComponentWrapper","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","key","IntlProvider","this","messages","Component","addLocaleData","_toConsumableArray","enLocaleData","deLocaleData","frLocaleData","esLocaleData","ptLocaleData","nlLocaleData","arLocaleData","EmailEditor","_this","call","update","debounce","onUpdate","subject","state","body","updateSubject","length","setState","updateEditableBody","e","editableBody","target","onEditorChange","editorState","getLastChangeType","hasValue","memoizeOne","content","DOMParser","parseFromString","lastElementChild","innerText","trim","blockStyleFn","header","interpolateVars","templateVars","htmlToText","footer","fn","templateInterpolate","stateParams","merge","EditorState","createWithContent","stateFromHTML","compact","join","_this$props","errors","hasHeaderValue","hasFooterValue","bodyClassName","FormGroup","Input","hasError","label","FormattedMessage","defaultMessage","onChange","ErrorMessages","dangerouslySetInnerHTML","__html","templateString","isEmpty","template","message","isArray","map","error","i","reduce","prev","curr","SweetInput","currentTarget","onFocus","refs","input","focus","focused","onBlur","errorMessage","labelClassName","inputClassName","ref","required","defaultProps","SweetSelect","filled","item","validationState","select","_this2","rootClassName","toggleFocus","Select","Object","assign","placeholder","openOnFocus","bind","GDPR_LIST","EEA_LIST","isGDPR","countryCode","includes","hasConsented","member","consented","isRequired","isDoubleOptIn","emailTargetAsSelectOption","title","EmailToolView","handleCopyTargetEmailButton","preventDefault","copyToClipboard","buildToEmailForCompose","getTargetEmails","emailService","handleCopyBodyButton","convertHtmlToPlainText","clickedCopyBodyButton","handleCopySubjectButton","manualTargeting","targets","email","handleSendEmail","emailParam","toEmails","cc","bcc","window","open","composeEmailLink","onSubmit","validateForm","s","_objectSpread","isSubmitting","MailerClient","sendEmail","payload","then","response","onSuccess","data","follow_up_page","location","href","URI","_ref2","onTargetChange","allTargetEmails","find","t","onNameChange","onEmailChange","isRequiredNew","champaign","personalization","dispatch","resetMember","changeConsent","consent","onEmailServiceChange","onEmailEditorUpdate","emailProps","emailSubject","sample","targetsForSelection","get","undefined","page_id","pageId","from_name","from_email","target_id","targetId","country","email_service","clicked_copy_body_button","tracking_params","trackingParams","setShowConsentRequired","postal","base","clearable","fromName","fromEmail","emailBody","emailHeader","emailFooter","checked","Button","ConsentComponent","alwaysShow","isRequiredExisting","connect","_ref3","consentRequired","showConsentRequired","init","el","document","getElementById","memberData","pick","urlParams","config","searchParams","double_opt_in","pathname","addSearch","toString","EmailTool","namespace","_Plugin","customRenderer","wrappedReactComponent","render","omit","camelizeKeys","Plugin","events","eventEmitter","EventEmitter","eventName","emit","privateEventName","listener","ctx","on","listeners","set","unmountComponentAtNode","parseResponse","status","success","responseJSON","code","create","_ref","_regeneratorRuntime","_callee","params","inner","_context","next","member_phone_number","memberPhoneNumber","targetPhoneExtension","target_phone_extension","targetPhoneNumber","target_phone_number","targetTitle","target_title","targetName","target_name","checksum","recaptchaToken","abrupt","Promise","resolve","reject","$","post","done","textStatus","jqXHR","fail","errorThrown","stop","_x","_objectWithoutProperties","_excluded","tracking","fbq","user_id","sendPensionEmail","obj","Array","v","camelCased","mapKeys","k","camelCase","htmlValue","htmlElement","createElement","innerHTML","textContent","appendChild","execCommand","removeChild","emailList","toEmailAddresses","forEach","emailItem","currentEmail","getToEmailBasedOn","sanitizedToEmails","ccBcc","push","encodeURIComponent","host","to_email","ccBccString","textWithoutLineBreaks","outlookBody"],"sourceRoot":""}