/* Maitha Tech — "Fale conosco" + RD Station embed, and the site footer. */ const RD_FORM_ID = "form-contato-fd023f7afdfeff704fb7"; const RD_TOKEN = "UA-148000340-1"; const RD_SRC = "https://d335luupugsy2.cloudfront.net/js/rdstation-forms/stable/rdstation-forms.min.js"; /* Where to send the visitor after a successful "Fale conosco" submission. In production this resolves to the route /agradecimento-formulario. */ const CONTACT_REDIRECT = "/agradecimento-formulario"; /* Theme the RD-injected markup to match the Maitha Tech design system. Targets the [data-rd-form] wrapper so it themes ANY RD form id. */ const RD_STYLE = ` [data-rd-form] { color-scheme: dark; font-family: var(--font-sans); color: var(--text-body); background: transparent !important; } [data-rd-form] form, [data-rd-form] > div, [data-rd-form] .rd-form, [data-rd-form] .bricks-form, [data-rd-form] .bricks-container, [data-rd-form] .bricks-form__fieldset, [data-rd-form] .bricks-form__field, [data-rd-form] .bricks-form__confirmation, [data-rd-form] .bricks--section, [data-rd-form] .rd-section, [data-rd-form] [class*="bricks--section"], [data-rd-form] .bricks-form__submit { background: transparent !important; box-shadow: none !important; border: 0 !important; } [data-rd-form] .select2-choice, [data-rd-form] .select2-container .select2-choice, [data-rd-form] .select2-drop, [data-rd-form] .select2-dropdown { background: var(--mt-near-black) !important; color: var(--text-strong) !important; border-color: var(--border-strong) !important; } [data-rd-form] .bricks-form__fieldset, [data-rd-form] .bricks-form__field { margin-bottom: 16px !important; } [data-rd-form] label { font-family: var(--font-sans) !important; font-size: var(--fs-sub) !important; font-weight: 500 !important; color: var(--text-muted) !important; letter-spacing: 0.01em !important; text-transform: none !important; margin-bottom: 7px !important; display: block !important; } [data-rd-form] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), [data-rd-form] select, [data-rd-form] textarea { width: 100% !important; box-sizing: border-box !important; background: var(--mt-near-black) !important; color: var(--text-strong) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--radius-md) !important; padding: 0.8rem 1rem !important; font-family: var(--font-sans) !important; font-size: var(--fs-body) !important; line-height: 1.5 !important; height: auto !important; min-height: 3rem !important; box-shadow: none !important; outline: none !important; transition: border-color var(--dur-base), box-shadow var(--dur-base) !important; } [data-rd-form] select { line-height: 1.5 !important; height: auto !important; min-height: 3rem !important; } [data-rd-form] input:focus, [data-rd-form] select:focus, [data-rd-form] textarea:focus { border-color: var(--mt-white) !important; box-shadow: 0 0 0 4px var(--focus-ring) !important; } [data-rd-form] input::placeholder, [data-rd-form] textarea::placeholder { color: var(--text-faint) !important; opacity: 1 !important; } [data-rd-form] input[type="checkbox"], [data-rd-form] input[type="radio"] { accent-color: var(--accent) !important; width: auto !important; } [data-rd-form] a { color: var(--accent) !important; text-decoration: underline !important; } [data-rd-form] [class*="error"], [data-rd-form] [class*="validation"] { color: var(--mt-orange) !important; } [data-rd-form] button, [data-rd-form] input[type="submit"], [data-rd-form] .bricks-form__submit button { background: var(--mt-white) !important; color: var(--mt-black) !important; border: 0 !important; border-radius: var(--radius-pill) !important; padding: 0.9rem 1.7rem !important; font-family: var(--font-sans) !important; font-size: var(--fs-h6) !important; font-weight: 600 !important; letter-spacing: 0.01em !important; cursor: pointer !important; width: auto !important; min-width: 0 !important; transition: transform .15s var(--ease-out), opacity .15s var(--ease-out) !important; } [data-rd-form] button:hover, [data-rd-form] .bricks-form__submit button:hover { opacity: 0.9 !important; } [data-rd-form] button:active, [data-rd-form] .bricks-form__submit button:active { transform: scale(0.97) !important; } `; function injectRdStyle() { if (document.getElementById("mt-rd-style")) return; const el = document.createElement("style"); el.id = "mt-rd-style"; el.textContent = RD_STYLE; document.head.appendChild(el); } /* Embeds an RD Station form. Pass `formId` (the page-specific form id) and optional `token`; defaults to the shared "Fale conosco" contact form. Loads the RD script once, then createForm() into the container. */ function RDStationForm({ formId = RD_FORM_ID, token = RD_TOKEN, redirectTo = null } = {}) { const ref = React.useRef(null); React.useEffect(() => { injectRdStyle(); let cancelled = false; let observer = null; /* On a successful submission RD injects a confirmation block into the container. When redirectTo is set (contact form only), watch for it and send the visitor to the thank-you page. */ const watchForSuccess = () => { if (!redirectTo || !ref.current) return; observer = new MutationObserver(() => { const done = ref.current && ref.current.querySelector( '.bricks-form__confirmation, [class*="confirmation"], [class*="conversion"]' ); if (done) { observer.disconnect(); window.location.href = redirectTo; } }); observer.observe(ref.current, { childList: true, subtree: true }); }; const init = () => { if (cancelled || !ref.current || ref.current.dataset.rdInit === "1") return; if (!window.RDStationForms) return; try { new window.RDStationForms(formId, token).createForm(); ref.current.dataset.rdInit = "1"; watchForSuccess(); } catch (e) { /* will retry on next poll tick */ } }; if (window.RDStationForms) { init(); return () => { cancelled = true; if (observer) observer.disconnect(); }; } let s = document.querySelector(`script[src="${RD_SRC}"]`); if (!s) { s = document.createElement("script"); s.src = RD_SRC; s.async = true; document.body.appendChild(s); } s.addEventListener("load", init); const poll = setInterval(() => { if (window.RDStationForms) { clearInterval(poll); init(); } }, 250); const stop = setTimeout(() => clearInterval(poll), 10000); return () => { cancelled = true; clearInterval(poll); clearTimeout(stop); if (observer) observer.disconnect(); if (s) s.removeEventListener("load", init); }; }, [formId, token, redirectTo]); return
; } function Contact() { return (Para nós, toda conversa é uma oportunidade de entender como podemos ajudar uma empresa a dar seu próximo passo. Deixe suas informações e nossos especialistas farão contato em seguida.
Prometemos não enviar e-mails indesejados ;)