import{__assign as e}from"../../node_modules/tslib/tslib.es6.js";import t,{useState as o}from"react";import{DEFAULT_BLOC_PROPERTIES as r}from"../Bloc/BlocProperties.js";import a from"../Editor/Modal/BlocModalSettingProperties/Form/FormBuilderComponent/FormBuilder.js";import"../../node_modules/react-redux/es/index.js";import{useForm as n}from"../../node_modules/react-hook-form/dist/index.esm.js";import{useDispatch as m}from"../../node_modules/react-redux/es/hooks/useDispatch.js";var s=e({},r);export default function(e){var r=e.json,s=e.account,i=e.submitDynamicForm,l=m(),c=o(!1),d=c[0],u=c[1],f=n().reset;return t.createElement(t.Fragment,null,t.createElement("div",null,d&&t.createElement("div",{className:"Taking__overlay"},t.createElement("div",{className:"Taking__alert"},t.createElement("div",{className:"Taking__container"},t.createElement("h1",{className:"Taking__title"},"Message sent!"),t.createElement("br",null),t.createElement("p",{className:"Taking__information"},"Thank you, your message has been sent and we will respond to you as soon as possible.")))),t.createElement("div",{className:"dynamic-form"},r?t.createElement(a,{schema:r,onSubmit:function(e){return function(t){var o,r=e.domain,a=e.emailProviderTo,n=e.email;u(!0),l(i(r,{formData:t,emailProviderTo:a,email:n})),(o=9500,new Promise((function(e){return setTimeout(e,o)}))).then((function(){return u(!1)})),f()}}(s)}):"")),t.createElement("style",{jsx:!0},""))}export{s as DEFAULT_DYNAMIC_FORM};
//# sourceMappingURL=DynamicForm.js.map
