PageSourceSearch

https://ar-range.app/_astro/CtaFooter.astro_astro_type_script_index_0_lang.BVanbI9_.js

js ar-range.app collected 2026-09-29 10:48:35 UTC 4,784 bytes, 1 lines download raw bytes

1function e(e,t){var n=t||{};typeof window.gtag==`function`&&window.gtag(`event`,e,n),window.dataLayer=window.dataLayer||[],window.dataLayer.push(Object.assign({event:e},n))}document.querySelectorAll(`[data-cta-call]`).forEach(function(t){t.addEventListener(`click`,function(){e(`contact_choice`,{method:`phone`,where:`form`})})}),document.querySelectorAll(`[data-contact-form]`).forEach(function(t){var n=t.querySelector(`[data-cta-note]`),r=t.querySelector(`.cta-submit`),i=Date.now(),a=t.getAttribute(`data-mail`)||``,o=t.closest(`[data-cta-flip]`),s=o&&o.querySelector(`[data-cta-back]`),c=n?n.textContent:``,l=r.textContent,u=s&&s.querySelector(`h3`),d=s&&s.querySelector(`p`),f=u?u.textContent:``,p=d?d.textContent:``;function m(e,n){if(u&&(u.textContent=n&&n.title||f),d&&(d.textContent=n&&n.line||p),t.classList.add(`is-sent`),t.querySelectorAll(`input, textarea, button`).forEach(function(e){e.disabled=!0}),!o||!s){r.textContent=`Message sent`;return}e&&o.classList.add(`cta-no-anim`),o.classList.add(`is-flipped`),t.setAttribute(`inert`,``),t.setAttribute(`aria-hidden`,`true`),s.removeAttribute(`inert`),s.removeAttribute(`aria-hidden`),e?requestAnimationFrame(function(){o.classList.remove(`cta-no-anim`)}):setTimeout(function(){s.focus({preventScroll:!0})},450)}function h(){t.classList.remove(`is-sent`),t.querySelectorAll(`input, textarea, button`).forEach(function(e){e.disabled=!1}),r.textContent=l,n&&(n.textContent=c),!(!o||!s)&&(o.classList.remove(`is-flipped`),s.setAttribute(`inert`,``),s.setAttribute(`aria-hidden`,`true`),t.removeAttribute(`inert`),t.removeAttribute(`aria-hidden`))}function g(){if(r.disabled=!1,n){if(n.textContent=`Sorry, your message did not go through. Please try again in a moment`,a){var e=document.createElement(`a`);e.href=`mailto:`+a,e.textContent=`email us directly`,n.append(`, or `,e,`.`)}else n.append(`.`)}}var _={title:`Already in our inbox`,line:`We have your message from earlier today, and we are on it. We will reply by email.`};window.arContact={sent:function(){return m(!1),`flipped (nothing was sent)`},duplicate:function(){return m(!1,_),`duplicate card (nothing was sent)`},failed:function(){return h(),g(),`error state (nothing was sent)`},reset:function(){return h(),`form reset`}};var v={};try{v=JSON.parse(t.getAttribute(`data-free-mail`)||`{}`)}catch{}function y(e){if((v.domains||[]).indexOf(e)>=0)return!0;var t=e.split(`.`),n=t.slice(1);return!n.length||n.length>2||n.some(function(e){return e.length>3})?!1:(v.prefixes||[]).indexOf(t[0])>=0}function b(e){return String(e||``).trim().replace(/^https?:\/\//i,``)}var x=/^(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)\.)+(?:[a-z]{2,63}|xn--[a-z0-9-]{2,59})$/;function S(e){var t=b(e).replace(/[/?#:][\s\S]*$/,``).toLowerCase();return t.length<=253&&x.test(t)}var C=t.querySelector(`[name="website"]`);C&&C.addEventListener(`blur`,function(){C.value=b(C.value)});function w(e){return t.querySelector(`[name="`+e+`"]`)}function T(e){return String((w(e)||{}).value||``).trim()}function E(e,t){var r=w(e);n&&(n.textContent=t),r&&(r.setAttribute(`aria-invalid`,`true`),r.focus())}t.addEventListener(`input`,function(e){e.target&&e.target.removeAttribute&&e.target.removeAttribute(`aria-invalid`)});function D(){var e=T(`email`),t=e.slice(e.lastIndexOf(`@`)+1).toLowerCase();return T(`name`)?/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(e)?y(t)?[`email`,`Please use your company email address, such as [email protected].`]:T(`company`)?S(T(`website`))?(w(`consent`)||{}).checked?null:[`consent`,`Please tick the first box so we are allowed to reply.`]:[`website`,`Please add your company website, such as yourcompany.com.`]:[`company`,`Please add your company name.`]:[`email`,`Please add an email we can reply to.`]:[`name`,`Please add your name.`]}t.addEventListener(`submit`,function(a){a.preventDefault(),t.querySelectorAll(`[aria-invalid]`).forEach(function(e){e.removeAttribute(`aria-invalid`)});var o=D();if(o){E(o[0],o[1]);return}var s={name:T(`name`),email:T(`email`),company:T(`company`),website:`https://`+b(T(`website`)),consent:!0,marketing:!!(t.querySelector(`[name="marketing"]`)||{}).checked,fax:T(`fax`),page:location.pathname,t:i};r.disabled=!0,n&&(n.textContent=`Sending…`),fetch(`/api/enquiry.php`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}).then(function(e){return e.json().catch(function(){return{}}).then(function(t){return{ok:e.ok,d:t}})}).then(function(n){if(!n.ok&&n.d&&n.d.duplicate){m(!1,_);return}if(!n.ok&&n.d&&n.d.field&&n.d.error){r.disabled=!1,E(n.d.field,n.d.error);return}if(!n.ok)throw Error(n.d&&n.d.error||`failed`);t.querySelectorAll(`input, textarea`).forEach(function(e){e.type===`checkbox`?e.checked=!1:e.value=``}),m(!1),e(`generate_lead`,{form:`contact`,page:location.pathname})}).catch(g)})});

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.