PageSourceSearch

https://conversiontab.com/build/assets/contact-us-page-DEUmegIT.js

js conversiontab.com collected 2026-09-24 10:08:08 UTC 10,112 bytes, 1 lines download raw bytes

1import{O as j,M as A}from"./app-gOHIPY12.js";const N={"New Tool Request":"Which tool should we add, and what should it convert?","Custom Conversion Service":"What files, formats, volume, and deadline do you have?","Request New Feature":"What should this tool do that it doesn’t today?","Report a Bug":"What happened, what did you expect, and which page?",Suggestion:"What would make ConversionTab more useful?",Other:"How can we help?"},O={"New Tool Request":"Submit request","Custom Conversion Service":"Send details","Request New Feature":"Submit request","Report a Bug":"Report bug",Suggestion:"Submit suggestion",Other:"Submit request"},D={email:"EmailError",subject:"SubjectError",message:"MessageError",captcha:"CaptchaError"};function M(t){return O[t]||"Submit request"}function H(t,e){const a=t.querySelector("[data-ct-contact-job-page]");a instanceof HTMLElement&&(t.classList.toggle("is-custom-job",e==="Custom Conversion Service"),a.setAttribute("aria-hidden",e==="Custom Conversion Service"?"false":"true"))}function F(t,e){var n,c;return`${((c=(n=t.querySelector('[name="email"]'))==null?void 0:n.id)==null?void 0:c.replace(/Email$/,""))||"ctContact"}${D[e]}`}function k(t,e){const a=t.querySelector("[data-ct-contact-submit]");!(a instanceof HTMLElement)||t.getAttribute("aria-busy")==="true"||(a.textContent=M(e))}function P(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}function W(t,e){return t.querySelector(`[data-ct-contact-error="${e}"]`)}function f(t,e,a){const n=W(t,e);if(n&&n.classList.toggle("d-none",!a),e==="subject"){const r=t.querySelector(".ct-contact-us-form__chips");r==null||r.classList.toggle("is-invalid",a),r instanceof HTMLElement&&(r.setAttribute("aria-invalid",a?"true":"false"),r.setAttribute("aria-describedby",F(t,"subject")));return}if(e==="captcha"){const r=t.querySelector(".g-recaptcha");r instanceof HTMLElement&&r.setAttribute("aria-invalid",a?"true":"false");return}const c=t.querySelector(`[name="${e}"]`);c==null||c.classList.toggle("is-invalid",a),c instanceof HTMLElement&&c.setAttribute("aria-invalid",a?"true":"false")}function S(t){["email","subject","message","captcha"].forEach(e=>f(t,e,!1))}function h(t,e,a="danger"){const n=t.querySelector("[data-ct-contact-alert]");n&&(n.textContent=e,n.classList.remove("d-none","alert-success","alert-danger","alert-info"),n.classList.add(a==="success"?"alert-success":"alert-danger"))}function y(t){const e=t.querySelector("[data-ct-contact-alert]");e&&(e.classList.add("d-none"),e.textContent="")}function I(t){const e=t.querySelector("[data-ct-contact-live]"),a=t.querySelector("[data-ct-contact-success]");y(t),e&&(e.hidden=!0,e.classList.add("d-none")),a&&(a.hidden=!1,a.classList.remove("d-none"))}function E(t){const e=t.querySelector("[data-ct-contact-live]"),a=t.querySelector("[data-ct-contact-success]");a&&(a.hidden=!0,a.classList.add("d-none")),e&&(e.hidden=!1,e.classList.remove("d-none"))}function _(t){var a,n;return t.dataset.ctRecaptchaKey&&((n=(a=window.grecaptcha)==null?void 0:a.getResponse)==null?void 0:n.call(a))||""}function $(t){var e;if(!(!t.dataset.ctRecaptchaKey||!((e=window.grecaptcha)!=null&&e.reset)))try{window.grecaptcha.reset()}catch{}}function R(t,e){Array.from(t.querySelectorAll("[data-ct-contact-reason]")).forEach((c,r)=>{const o=c.getAttribute("data-ct-contact-reason")===e&&e!=="";c.classList.toggle("is-active",o),c.setAttribute("aria-checked",o?"true":"false"),c.setAttribute("tabindex",o||!e&&r===0?"0":"-1")});const n=t.querySelector("[data-ct-contact-message]");n instanceof HTMLTextAreaElement&&!n.value.trim()&&(n.placeholder=N[e]||"Tell us what you need.")}function g(t,e){const a=t.querySelector('[name="subject"]');a instanceof HTMLSelectElement&&(a.value=e),R(t,e),k(t,e),H(t,e),f(t,"subject",!1)}function b(t){const e=t.querySelector("[data-ct-contact-message]"),a=t.querySelector("[data-ct-contact-count]");!(e instanceof HTMLTextAreaElement)||!a||(a.textContent=`${e.value.length} / ${e.maxLength||5e3}`)}function B(t,{onSuccess:e}={}){const a=String(t.dataset.ctContactApi||"").trim(),n=t.querySelector("[data-ct-contact-type]"),c=t.querySelector("[data-ct-contact-submit]"),r=t.querySelector('[name="subject"]');
1n&&(n.value=window.location.pathname||"/"),t.querySelectorAll("[data-ct-contact-reason]").forEach(o=>{o.addEventListener("click",()=>{g(t,o.getAttribute("data-ct-contact-reason")||""),y(t)}),o.addEventListener("keydown",s=>{const i=Array.from(t.querySelectorAll("[data-ct-contact-reason]")),d=i.indexOf(o);if(d<0)return;let u=d;if(s.key==="ArrowRight"||s.key==="ArrowDown")u=(d+1)%i.length;else if(s.key==="ArrowLeft"||s.key==="ArrowUp")u=(d-1+i.length)%i.length;else if(s.key==="Home")u=0;else if(s.key==="End")u=i.length-1;else if(s.key===" "||s.key==="Enter"){s.preventDefault(),g(t,o.getAttribute("data-ct-contact-reason")||"");return}else return;s.preventDefault();const l=i[u];l==null||l.focus(),g(t,(l==null?void 0:l.getAttribute("data-ct-contact-reason"))||"")})}),t.addEventListener("input",o=>{y(t);const s=o.target;s instanceof HTMLElement&&(s.getAttribute("name")==="email"&&f(t,"email",!1),s.getAttribute("name")==="message"&&(f(t,"message",!1),b(t)))}),t.addEventListener("change",()=>y(t)),b(t),R(t,r instanceof HTMLSelectElement?r.value:""),k(t,r instanceof HTMLSelectElement?r.value:""),H(t,r instanceof HTMLSelectElement?r.value:""),t.addEventListener("submit",async o=>{var C,p,w,L,v,T,q;o.preventDefault(),y(t),S(t);const s=((p=(C=t.querySelector('[name="email"]'))==null?void 0:C.value)==null?void 0:p.trim())||"",i=((L=(w=t.querySelector('[name="subject"]'))==null?void 0:w.value)==null?void 0:L.trim())||"",d=((T=(v=t.querySelector('[name="message"]'))==null?void 0:v.value)==null?void 0:T.trim())||"",u=_(t);let l=null;if(P(s)||(f(t,"email",!0),l=t.querySelector('[name="email"]')),i||(f(t,"subject",!0),l=l||t.querySelector("[data-ct-contact-reason]")),d||(f(t,"message",!0),l=l||t.querySelector('[name="message"]')),t.dataset.ctRecaptchaKey&&!u&&(f(t,"captcha",!0),l=l||t.querySelector(".g-recaptcha")),l){(q=l.focus)==null||q.call(l);return}if(!a){h(t,"Contact service is not configured.");return}const m=new URLSearchParams({email:s,subject:i,message:d,type:(n==null?void 0:n.value)||window.location.pathname||"/"});u&&m.set("g-recaptcha-response",u);const x=c==null?void 0:c.textContent;
1t.setAttribute("aria-busy","true"),c&&(c.disabled=!0,c.textContent="Sending…");try{if((await fetch(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:m.toString()})).ok){t.reset(),n&&(n.value=window.location.pathname||"/"),g(t,""),b(t),$(t),I(t),e==null||e();return}h(t,"Couldn’t send your message. Please try again.")}catch{h(t,"Something went wrong. Please try again.")}finally{t.removeAttribute("aria-busy"),c&&(c.disabled=!1,c.textContent=x||M(i))}})}function U(t){if(!t||t.dataset.ctContactSubjectWired==="1")return;t.dataset.ctContactSubjectWired="1";const e=t.querySelector("#ctContactModalLabel"),a=t.querySelector("#ctContactModalDesc"),n=t.querySelector("[data-ct-contact-form]");let c=null;const r=o=>{if(!(!(e instanceof HTMLElement)||!(a instanceof HTMLElement))){if(o==="New Tool Request"){e.textContent=e.dataset.ctContactTitleTool||"Request a new tool",a.textContent=a.dataset.ctContactDescTool||"Ask us to add a free product tool you can reuse anytime.";return}if(o==="Custom Conversion Service"){e.textContent=e.dataset.ctContactTitleJob||"Request a custom job",a.textContent=a.dataset.ctContactDescJob||"One-time or special conversion work—we’ll follow up by email.";return}e.textContent=e.dataset.ctContactTitleDefault||"Contact us",a.textContent=a.dataset.ctContactDescDefault||"Tell us what you need and how it should work."}};t.addEventListener("show.bs.modal",o=>{var i,d,u;c=o.relatedTarget instanceof HTMLElement?o.relatedTarget:null,n instanceof HTMLFormElement&&(y(n),E(n),S(n));const s=((u=(d=(i=o.relatedTarget)==null?void 0:i.getAttribute)==null?void 0:d.call(i,"data-ct-contact-subject"))==null?void 0:u.trim())||"";n instanceof HTMLFormElement&&g(n,s),r(s)}),t.addEventListener("shown.bs.modal",()=>{const o=t.querySelector('[name="email"]');o instanceof HTMLElement&&!o.value&&o.focus()}),t.addEventListener("hidden.bs.modal",()=>{if(r(""),n instanceof HTMLFormElement){const i=n.querySelector("[data-ct-contact-type]");n.reset(),i instanceof HTMLInputElement&&(i.value=window.location.pathname||"/"),g(n,""),b(n),E(n),y(n),S(n)}const o=document.querySelector('[aria-controls="ctMobileNav"]'),s=c&&document.contains(c)?c:o;s instanceof HTMLElement&&window.requestAnimationFrame(()=>s.focus())}),n instanceof HTMLFormElement&&n.querySelectorAll("[data-ct-contact-reason]").forEach(o=>{o.addEventListener("click",()=>{r(o.getAttribute("data-ct-contact-reason")||"")})})}function J(){document.querySelectorAll(".offcanvas-backdrop").forEach(t=>t.remove()),document.body.classList.remove("offcanvas-open"),document.body.style.removeProperty("overflow"),document.body.style.removeProperty("padding-right")}function K(t,e,a){let n=!1;const c=()=>{n||(n=!0,J(),a())};if(e instanceof HTMLElement&&e.setAttribute("aria-expanded","false"),!t.classList.contains("show")){c();return}t.addEventListener("hidden.bs.offcanvas",c,{once:!0}),j.getOrCreateInstance(t).hide(),window.setTimeout(c,450)}function V(t){const e=document.getElementById("ctMobileNav"),a=document.querySelector('[aria-controls="ctMobileNav"]');!t||!e||e.dataset.ctContactNavWired==="1"||(e.dataset.ctContactNavWired="1",e.querySelectorAll('[data-bs-target="#ctContactModal"]').forEach(n=>{n.removeAttribute("data-bs-toggle"),n.removeAttribute("data-bs-dismiss"),n.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),K(e,a,()=>{A.getOrCreateInstance(t).show(n)})})}))}function z(){const t=document.getElementById("ctContactModal");U(t),V(t),document.querySelectorAll("[data-ct-contact-form]").forEach(e=>{e.dataset.ctContactWired!=="1"&&(e.dataset.ctContactWired="1",B(e,{onSuccess:()=>{const a=e.closest("#ctContactModal");a&&window.setTimeout(()=>{var n;(n=A.getInstance(a))==null||n.hide()},2800)}}))})}function X(){z()}export{z as initContactUsForms,X as initContactUsPage};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.