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,aAAa,WAAY,YACzC,MAAO8F,GACDpH,GAASA,EAAQoH,GARzB,QAUIjH,GAAuB,OAtM/BmD,GACAzC,4BA0MJU,eAAe8F,sBACX,MAAMC,EAAmBvH,EAAQsD,cAAc,4CACzCkE,QAA6B,QAAc,0BACjDD,EAAkBnF,UAAYoF,EA5M9BF,MAGJnH,EAAmBW,4BAwOvBf,YAAYP,MAAQ,CAChBH,UAAW,CACPI,KAAMgI,UAEVxH,QAAS,CACLR,KAAMgI,UAEVtI,cAAe,CACXM,KAAMC,OACNE,eAAe,GAEnBR,eAAgB,CACZK,KAAMiI,SAId,QAAc,eAAgB3H,c,iFEhU9B,MCUM4H,EAAY,WAMZC,EAAU,CACZ,CAACD,GAAY,CAACE,EAAmBC,KDjBbtG,WACSuG,SAASzE,cAAc,qBAG1C,8BAEN,iBAAqB,4BCarB0E,GAGAH,EAAMI,OAAS,IAAIJ,EAAMI,OAAQ,CAAEC,KAAMJ,EAAQI,KAAMC,YAAY,IAE5DN,IAIFO,GAAa,OAAwB,CAC9CC,aAjB6B,CAC7BJ,OAAQ,IAiBRL,YAGSU,SAAYJ,IACrBE,EAAWG,SAASZ,EAAW,CAAEO,W,iEClCjCM,E,MAA0B,GAA4B,KAE1DA,EAAwBzG,KAAK,CAAC0G,EAAO9F,GAAI,0FAA2F,KAEpI,QAAe6F,EAAwBE","sources":["webpack://frontend-setup/./src/components/organisms/message-form-inline/utilities/message-form-inline.tsx","webpack://frontend-setup/./src/components/organisms/message-form/message-form.tsx","webpack://frontend-setup/./src/utilities/api-calls/ask-a-question.ts","webpack://frontend-setup/./src/store/alert/utilities/alert-utilitites.tsx","webpack://frontend-setup/./src/store/alert/store.ts","webpack://frontend-setup/./src/components/organisms/message-form/message-form.scss"],"sourcesContent":["import '@organisms/message-form';\n\nimport { defineElement, FC, useProp } from '@atomify/hooks';\nimport { h } from '@atomify/jsx';\nimport { addAlert } from '@source/store/alert';\n\nconst MessageFormInline: FC = () => {\n    const [successMessage] = useProp<string>('successMessage');\n    const [contactReason] = useProp<string>('contactReason', '');\n    const [complaintTypes] = useProp<string>('complaintTypes', '');\n\n    function onSuccess() {\n        addAlert(successMessage);\n    }\n\n    return (\n        <message-form\n            onSuccess={onSuccess}\n            {...(contactReason && { contactReason })}\n            {...(complaintTypes && { complaintTypes: JSON.parse(complaintTypes) })}\n        />\n    );\n};\n\nMessageFormInline.props = {\n    successMessage: {\n        type: String,\n        required: true,\n    },\n    contactReason: {\n        type: String,\n        reflectToAttr: true,\n    },\n    complaintTypes: {\n        type: String,\n    },\n};\n\ndefineElement('message-form-inline', MessageFormInline);\n","import { Component, defineElement, FC, onDidLoad, useProp } from '@atomify/hooks';\nimport { h } from '@atomify/jsx';\nimport { Button } from '@atoms/button/button';\nimport {\n    BPDFormElement,\n    InputElement,\n    RadioElement,\n    SelectElement,\n    SelectOption,\n    TextareaElement,\n} from '@atoms/form-elements';\nimport { PagesProps } from '@atoms/index';\nimport { Col, Row } from '@bpd-library/components';\nimport { askAQuestion, AskAQuestionProps } from '@utilities/api-calls/ask-a-question';\nimport {\n    translateItem,\n    useButtonLoadingState,\n    useStylesheet,\n    useTranslate,\n} from '@utilities/hooks';\nimport { isGermany } from '@utilities/is-germany';\n\nimport style from './message-form.scss';\n\ntype ContactReason = 'Question' | 'Complaint';\n\ninterface MessageFormInterface extends Component {\n    bpdPages: PagesProps;\n    contactReason: ContactReason;\n}\n\nconst DEFAULT_COMPLAINT_TYPES = ['Makelaar', 'Aannemer', 'BPD', 'Website / Account', 'Overig'];\nconst SR_ONLY_CLASS = 'u-sr-only';\n\nconst MessageForm: FC<MessageFormInterface> = ({ element }) => {\n    const [onSuccess] = useProp<Function | null>('onSuccess', null);\n    const [onError] = useProp<Function | null>('onError', null);\n    const [, setContactReason, watchContactReason] = useProp<ContactReason | null>(\n        'contactReason',\n        null,\n    );\n    const [complaintTypes] = useProp<string[]>('complaintTypes', DEFAULT_COMPLAINT_TYPES);\n\n    const setSubmitButtonLoading = useButtonLoadingState('[js-hook-message-form-submit]');\n\n    useStylesheet(style);\n\n    const contactReasons: ContactReason[] = ['Question', 'Complaint'];\n    const contactReasonSelectOptions: SelectOption[] = [];\n    const complaintTypeSelectOptions: SelectOption[] = [];\n    let messageTranslation: string;\n    const loadedAsComplaintForm = element.contactReason === 'Complaint';\n\n    let form: BPDFormElement | null;\n    let submitButton: HTMLElement | null;\n    let complaintTypeSelectWrapper: HTMLDivElement | null;\n    let complaintTypeSelect: HTMLSelectElement | null;\n\n    onDidLoad(async () => {\n        messageTranslation = await translateItem('Message');\n\n        await generateTranslatedOptions(\n            contactReasons,\n            contactReasonSelectOptions,\n            element.contactReason,\n        );\n        await generateTranslatedOptions(complaintTypes, complaintTypeSelectOptions);\n\n        renderForm();\n        queryElements();\n        bindEvents();\n        toggleComplaintTypeSelect();\n        setPrivacyStatement();\n    });\n\n    watchContactReason(toggleComplaintTypeSelect);\n\n    function renderForm() {\n        element.innerHTML = '';\n        element.append(\n            <bpd-form>\n                <form class=\"message-form__container\">\n                    <Row>\n                        <Col cols={[12, , 8]}>\n                            <RadioElement\n                                label={useTranslate('Salutation')}\n                                validationTypes=\"required\"\n                                horizontal\n                                options={[\n                                    {\n                                        label: useTranslate('Acronym-Mister'),\n                                        id: 'message-form-gender-dhr',\n                                        name: 'gender',\n                                        value: 'Mr',\n                                    },\n                                    {\n                                        label: useTranslate('Acronym-Misses'),\n                                        id: 'message-form-gender-ms',\n                                        name: 'gender',\n                                        value: 'Mrs',\n                                    },\n                                ]}\n                            />\n                        </Col>\n                        <Col cols={isGermany() ? [12, , 6] : [12, , 5]}>\n                            <InputElement\n                                label={useTranslate('FirstName')}\n                                id=\"message-form-first-name\"\n                                name=\"first_name\"\n                                validationTypes=\"required,text\"\n                            />\n                        </Col>\n                        {!isGermany() && (\n                            <Col cols={[12, , 2]}>\n                                <InputElement\n                                    label={useTranslate('LastNamePrefix')}\n                                    id=\"message-form-last-name-prefix\"\n                                    name=\"last_name_prefix\"\n                                    validationTypes=\"text\"\n                                />\n                            </Col>\n                        )}\n                        <Col cols={isGermany() ? [12, , 6] : [12, , 5]}>\n                            <InputElement\n                                label={useTranslate('LastName')}\n                                id=\"message-form-last-name\"\n                                name=\"last_name\"\n                                validationTypes=\"required,text\"\n                            />\n                        </Col>\n                        <Col cols={[12]}>\n                            <InputElement\n                                label={useTranslate('EmailAdres')}\n                                id=\"message-form-email\"\n                                name=\"email\"\n                                validationTypes=\"required,email\"\n                            />\n                        </Col>\n                        <Col\n                            cols={[12]}\n                            {...(loadedAsComplaintForm && { extraClass: 'u-sr-only ' })}>\n                            <SelectElement\n                                label={useTranslate('SelectReason')}\n                                id=\"message-form-contact-reason\"\n                                name=\"contact_reason\"\n                                validationTypes=\"required\"\n                                customSelect\n                                options={[\n                                    {\n                                        label: '',\n                                        value: '',\n                                        default: true,\n                                    },\n                                    ...contactReasonSelectOptions,\n                                ]}\n                                onOptionSelect={({ rawValue }) => {\n                                    setContactReason(rawValue as ContactReason);\n                                }}\n                            />\n                        </Col>\n                        <Col\n                            cols={[12]}\n                            extraClass=\"message-form__complaint-type-wrapper u-sr-only\">\n                            <SelectElement\n                                label={useTranslate('SelectComplaintCategory')}\n                                id=\"message-form-complaint-type\"\n                                name=\"complaint_type\"\n                                validationTypes=\"required\"\n                                customSelect\n                                options={[\n                                    {\n                                        label: '',\n                                        value: '',\n                                        default: true,\n                                    },\n                                    ...complaintTypeSelectOptions,\n                                ]}\n                            />\n                        </Col>\n                        <Col cols={[12]}>\n                            <TextareaElement\n                                label={messageTranslation}\n                                id=\"message-form-message\"\n                                name=\"message\"\n                                required\n                            />\n                        </Col>\n                        <Col cols={[12, , 9]} extraClass=\"s-rich-text\">\n                            <p js-hook-message-form-privacy-statement></p>\n                        </Col>\n                        <Col cols={[12, , 3]} extraClass=\"u-flex u-flex-end message-form__submit\">\n                            <Button\n                                label={useTranslate('Send')}\n                                variant=\"primary\"\n                                width=\"full-width-mobile\"\n                                hook=\"message-form-submit\"\n                                type=\"submit\"\n                                hasLoading\n                                disabled\n                            />\n                        </Col>\n                    </Row>\n                </form>\n            </bpd-form>,\n        );\n    }\n\n    function queryElements() {\n        form = element.querySelector<BPDFormElement>('bpd-form');\n        submitButton = element.querySelector<HTMLButtonElement>('[js-hook-message-form-submit]');\n        complaintTypeSelectWrapper = element.querySelector('.message-form__complaint-type-wrapper');\n        complaintTypeSelect = complaintTypeSelectWrapper?.querySelector('select') || null;\n    }\n\n    function toggleComplaintTypeSelect() {\n        if (!complaintTypeSelectWrapper || !complaintTypeSelect) return;\n\n        if (element.contactReason === 'Complaint') {\n            complaintTypeSelectWrapper.classList.remove(SR_ONLY_CLASS);\n            complaintTypeSelect.disabled = false;\n        } else {\n            complaintTypeSelectWrapper.classList.add(SR_ONLY_CLASS);\n            complaintTypeSelect.disabled = true;\n        }\n\n        updateSubmitButtonState();\n    }\n\n    function bindEvents() {\n        if (!form) return;\n        form.addEventListener('change', updateSubmitButtonState);\n\n        form.addEventListener('serializedForm', async (e: CustomEvent) => {\n            setSubmitButtonLoading(true);\n            const {\n                email,\n                message,\n                gender,\n                first_name: firstName,\n                last_name: lastName,\n                last_name_prefix: lastNamePrefix,\n                contact_reason: contactReason,\n                complaint_type: complaintType,\n            } = e.detail;\n\n            const data: AskAQuestionProps = {\n                gender,\n                firstName,\n                lastName,\n                email,\n                contactReason,\n                message,\n                refererUrl: window.location.href,\n                areaId: window.__ENVIRONMENT_DETAILS__.areaId,\n                ...(lastNamePrefix && { lastNamePrefix }),\n                ...(complaintType && { complaintType }),\n            };\n\n            try {\n                await askAQuestion(data);\n\n                if (onSuccess) onSuccess();\n\n                form?.clearInputs();\n                submitButton?.setAttribute('disabled', 'disabled');\n            } catch (error) {\n                if (onError) onError(error);\n            } finally {\n                setSubmitButtonLoading(false);\n            }\n        });\n    }\n\n    async function setPrivacyStatement() {\n        const privacyStatement = element.querySelector('[js-hook-message-form-privacy-statement]');\n        const privacyStatementHTML = await translateItem('PrivacyLinkContactForm');\n        privacyStatement!.innerHTML = privacyStatementHTML;\n    }\n\n    function updateSubmitButtonState() {\n        if (!form?.validate || !submitButton) return;\n\n        if (form.validate(false).valid) {\n            submitButton.removeAttribute('disabled');\n        } else {\n            submitButton.setAttribute('disabled', 'disabled');\n        }\n    }\n\n    async function generateTranslatedOptions(\n        source: string[],\n        destination: SelectOption[],\n        selected?: string | null,\n    ) {\n        for (const option of source) {\n            const translated = await translateItem(option);\n\n            destination.push({\n                label: translated || option,\n                value: translated || option,\n                rawValue: option,\n                ...(option === selected && { selected: true }),\n            });\n        }\n    }\n};\n\nMessageForm.props = {\n    onSuccess: {\n        type: Function,\n    },\n    onError: {\n        type: Function,\n    },\n    contactReason: {\n        type: String,\n        reflectToAttr: true,\n    },\n    complaintTypes: {\n        type: Array,\n    },\n};\n\ndefineElement('message-form', MessageForm);\n","import environment from '../environment';\n\nexport interface AskAQuestionProps {\n    gender: string;\n    firstName: string;\n    lastName: string;\n    email: string;\n    message: string;\n    areaId: string;\n    regionId?: string;\n    projectId?: string;\n    propertyTypeId?: string;\n    districtId?: string;\n    lastNamePrefix?: string;\n    refererUrl?: string;\n    contactReason: string;\n    complaintType?: string;\n    phoneNumber?: string;\n    webcareSubject?: string;\n    chatUrl?: string;\n    appointmentSelection?: string;\n    isAppointmentForm?: boolean;\n    url?: string;\n}\n\nconst ENDPOINT = '/umbraco/api/AjaxForm/SubmitAskAQuestionForm';\n\nexport const askAQuestion = async ({\n    regionId,\n    projectId,\n    propertyTypeId,\n    areaId,\n    districtId,\n    lastNamePrefix,\n    firstName,\n    lastName,\n    email,\n    message,\n    refererUrl,\n    contactReason,\n    complaintType,\n    phoneNumber,\n    webcareSubject,\n    chatUrl,\n    appointmentSelection,\n    isAppointmentForm,\n    url,\n}: AskAQuestionProps) => {\n    const data: any = {\n        FirstName: firstName,\n        LastName: lastName,\n        Email: email,\n        Message: message,\n        AreaId: areaId,\n    };\n\n    if (regionId) data.RegionId = regionId;\n    if (projectId) data.ProjectId = projectId;\n    if (propertyTypeId) data.PropertyTypeId = propertyTypeId;\n    if (districtId) data.DistrictId = districtId;\n    if (lastNamePrefix) data.LastNamePrefix = lastNamePrefix;\n    if (refererUrl) data.RefererUrl = refererUrl;\n    if (contactReason) data.ContactReason = contactReason;\n    if (complaintType) data.ComplaintType = complaintType;\n    if (phoneNumber) data.PhoneNumber = phoneNumber;\n    if (webcareSubject) data.WebcareSubject = webcareSubject;\n    if (chatUrl) data.ChatUrl = chatUrl;\n    if (appointmentSelection) data.AppointmentSelection = appointmentSelection;\n    if (isAppointmentForm) data.IsAppointmentForm = isAppointmentForm;\n    if (url) data.Url = url;\n\n    if (environment.isLocal) {\n        console.log(data);\n    }\n\n    await fetch(ENDPOINT, {\n        method: 'POST',\n        headers: {\n            'Content-Type': 'application/json',\n        },\n        body: JSON.stringify(data),\n    });\n};\n","import { h } from '@atomify/jsx';\nimport { elements } from '@source/utilities/dom';\n\nconst initialiseAlert = async () => {\n    const alertElementExists = !!document.querySelector('bpd-alert');\n\n    if (!alertElementExists) {\n        await import('@atoms/alert');\n\n        elements.body.append(<bpd-alert />);\n    }\n};\n\nexport { initialiseAlert };\n","import createStore from '@utilities/store';\n\nimport { initialiseAlert } from './utilities/alert-utilitites';\n\nexport interface AlertItem {\n    text: string | Text;\n    isRendered: boolean;\n}\n\nexport interface AlertState {\n    alerts: AlertItem[];\n}\n\nconst ADD_ALERT = 'addAlert';\n\nconst initialState: AlertState = {\n    alerts: [],\n};\n\nconst actions = {\n    [ADD_ALERT]: (state: AlertState, payload: { text: string }) => {\n        // Make sure alerts are loaded and added to the body\n        initialiseAlert();\n\n        // Add alert string\n        state.alerts = [...state.alerts, { text: payload.text, isRendered: false }];\n\n        return state;\n    },\n};\n\nexport const alertStore = createStore<AlertState>({\n    initialState,\n    actions,\n});\n\nexport const addAlert = (text: string) => {\n    alertStore.dispatch(ADD_ALERT, { text });\n};\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"@media only screen and (max-width:47.96875em){.message-form__submit{margin-top:2.4rem}}\", \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["MessageFormInline","successMessage","contactReason","complaintTypes","onSuccess","JSON","parse","props","type","String","required","reflectToAttr","DEFAULT_COMPLAINT_TYPES","SR_ONLY_CLASS","MessageForm","element","onError","setContactReason","watchContactReason","setSubmitButtonLoading","contactReasons","contactReasonSelectOptions","complaintTypeSelectOptions","messageTranslation","loadedAsComplaintForm","form","submitButton","complaintTypeSelectWrapper","complaintTypeSelect","toggleComplaintTypeSelect","classList","remove","disabled","add","updateSubmitButtonState","validate","valid","removeAttribute","setAttribute","async","generateTranslatedOptions","source","destination","selected","option","translated","push","label","value","rawValue","renderForm","innerHTML","append","class","cols","validationTypes","horizontal","options","id","name","extraClass","customSelect","default","onOptionSelect","variant","width","hook","hasLoading","queryElements","querySelector","bindEvents","addEventListener","email","message","gender","first_name","firstName","last_name","lastName","last_name_prefix","lastNamePrefix","contact_reason","complaint_type","complaintType","e","detail","data","refererUrl","window","location","href","areaId","__ENVIRONMENT_DETAILS__","regionId","projectId","propertyTypeId","districtId","phoneNumber","webcareSubject","chatUrl","appointmentSelection","isAppointmentForm","url","FirstName","LastName","Email","Message","AreaId","RegionId","ProjectId","PropertyTypeId","DistrictId","LastNamePrefix","RefererUrl","ContactReason","ComplaintType","PhoneNumber","WebcareSubject","ChatUrl","AppointmentSelection","IsAppointmentForm","Url","environment","console","log","fetch","method","headers","body","stringify","askAQuestion","clearInputs","error","setPrivacyStatement","privacyStatement","privacyStatementHTML","Function","Array","ADD_ALERT","actions","state","payload","document","initialiseAlert","alerts","text","isRendered","alertStore","initialState","addAlert","dispatch","___CSS_LOADER_EXPORT___","module","toString"],"sourceRoot":""}