{"version":3,"file":"contact-us.js","sources":["../../../../../Flow.Showcase.Static.Bundler/Root/entrypoints/contact-us.ts"],"sourcesContent":["// @ts-nocheck\n\nimport {\n getCustomFileInputFromElement,\n CustomFileInput,\n} from \"../modules/custom-file-input.module.ts\";\nimport {\n setValidationErrorMessage,\n validateInputEmail,\n validateInputRequired,\n} from \"../modules/form-field.module.ts\";\nimport { commonState } from \"../modules/common-state.module.ts\";\n\nconst contactUsForm = /** @type {HTMLFormElement} */ (\n document.querySelector(\".js-contact-us-form\")\n);\n\nconst nameField = /** @type {HTMLElement} */ (\n contactUsForm.querySelector(\".js-name\")\n);\n\nconst emailField = /** @type {HTMLElement} */ (\n contactUsForm.querySelector(\".js-email\")\n);\n\nconst messageField = /** @type {HTMLElement} */ (\n contactUsForm.querySelector(\".js-message\")\n);\n\nconst filesField = /** @type {HTMLElement} */ (\n contactUsForm.querySelector(\".js-files\")\n);\nconst customFileInput = /** @type {CustomFileInput} */ (\n getCustomFileInputFromElement(filesField)\n);\n\ncontactUsForm.addEventListener(\"submit\", (event) => {\n if (!validateInputRequired(nameField, commonState.translations[\"Name\"])) {\n event.preventDefault();\n }\n\n if (\n !validateInputRequired(\n emailField,\n commonState.translations[\"RequiredEmail\"]\n ) ||\n !validateInputEmail(\n emailField,\n commonState.translations[\"InvalidEmail\"]\n )\n ) {\n event.preventDefault();\n }\n\n if (\n !validateInputRequired(\n messageField,\n commonState.translations[\"RequiredTicketMessage\"]\n )\n ) {\n event.preventDefault();\n }\n\n if (!customFileInput.isValid()) {\n event.preventDefault();\n }\n});\n"],"names":["contactUsForm","nameField","emailField","messageField","filesField","customFileInput","getCustomFileInputFromElement","event","validateInputRequired","commonState","validateInputEmail"],"mappings":"oMAaA,MAAMA,EACF,SAAS,cAAc,qBAAqB,EAG1CC,EACFD,EAAc,cAAc,UAAU,EAGpCE,EACFF,EAAc,cAAc,WAAW,EAGrCG,EACFH,EAAc,cAAc,aAAa,EAGvCI,EACFJ,EAAc,cAAc,WAAW,EAErCK,EACFC,EAA8BF,CAAU,EAG5CJ,EAAc,iBAAiB,SAAWO,GAAU,CAC3CC,EAAsBP,EAAWQ,EAAY,aAAa,IAAO,GAClEF,EAAM,eAAe,GAIrB,CAACC,EACGN,EACAO,EAAY,aAAa,gBAE7B,CAACC,EACGR,EACAO,EAAY,aAAa,YAAc,IAG3CF,EAAM,eAAe,EAIpBC,EACGL,EACAM,EAAY,aAAa,qBAAuB,GAGpDF,EAAM,eAAe,EAGpBF,EAAgB,WACjBE,EAAM,eAAe,CAE7B,CAAC"}