1import{a as u,j as i}from"./query-YQf5_TCb.js";import{B as E}from"./button-BoJFaSM5.js";import"./radix-ui-jHlGqCL3.js";import"./index-BBBx8TSb.js";import"./index-oGxM1WZq.js";const m="c2_analytics_consent",C=365,v="airo-banner-reset";function b(){if(typeof window>"u"||window.__SCC_INIT__)return;window.__SCC_INIT__=!0,window._signalsDataLayer=window._signalsDataLayer||[];const l=(e,t,a,o)=>{window._signalsDataLayer.push({schema:"add_event",version:"v1",data:{eid:e,type:t,event_label:a,custom_properties:{...o,timestamp:new Date().toISOString(),source:"airo-app-builder"}}})},r=e=>e.closest("header")?"header":e.closest("footer")?"footer":e.closest("nav")?"nav":e.closest("main")?"main":"page",f=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"};l("airo.website.session","session","start",{page_path:location.pathname,referrer:document.referrer,has_appointments:!0}),l("airo.website.pageview","pageview",document.title,{page_path:location.pathname,referrer:document.referrer,has_appointments:!0}),document.addEventListener("click",e=>{var _,S,x;const t=(_=e.target)==null?void 0:_.closest('a, button, [role="button"]');if(!t)return;const a=((x=(S=t.textContent)==null?void 0:S.trim())==null?void 0:x.substring(0,100))||"",o=t.href||"",s=t.tagName.toLowerCase()==="a"?"link":"button";let y;if(o)try{y=new URL(o,location.origin).origin!==location.origin}catch{}l("airo.website.click","click",a||s,{element_type:s,element_text:a,element_id:t.id||void 0,section:r(t),page_path:location.pathname,page_title:document.title,href:o||void 0,is_external:o?y:void 0,device:f(),viewport_width:window.innerWidth})},!0);let d=location.href;const p=()=>{location.href!==d&&(l("airo.website.pageview","pageview",document.title,{page_path:location.pathname,referrer:d,has_appointments:!0}),d=location.href)};window.addEventListener("popstate",p);const h=history.pushState,w=history.replaceState;history.pushState=(...e)=>{h.apply(history,e),setTimeout(p,0)},history.replaceState=(...e)=>{w.apply(history,e),setTimeout(p,0)};const c=location.hostname,g=c==="localhost"||c.includes("dev-airoapp")?"https://img1.dev-wsimg.com/signals/js/clients/scc-c2/scc-c2.js":c.includes("test-airoapp")?"https://img1.test-wsimg.com/signals/js/clients/scc-c2/scc-c2.min.js":"https://img1.wsimg.com/signals/js/clients/scc-c2/scc-c2.min.js",n=document.createElement("script");n.src=g,n.async=!0,document.head.appendChild(n)}function L(){const[l,r]=u.useState(!1),[f,d]=u.useState(!1),p=typeof window<"u"&&window.parent!==window,[h,w]=u.useState(()=>{if(!p)return!1;try{return sessionStorage.getItem(v)!=="true"}catch(n){return console.warn("CookieBanner: sessionStorage unavailable, banner state will not persist across remounts:",n instanceof Error?n.message:String(n)),!0}});u.useEffect(function(){if(typeof window>"u")return;const e=localStorage.getItem(m);if(!e){r(!0),d(!0);return}try{const t=JSON.parse(e);(Date.now()-t.timestamp)/(1e3*60*60*24)>C?(localStorage.removeItem(m),r(!0)):t.analytics&&b()}catch{localStorage.removeItem(m),r(!0)}d(!0)},[]);function c(n){localStorage.setItem(m,JSON.stringify({analytics:n,timestamp:Date.now()})),window.dispatchEvent(new CustomEvent("cookie-consent-changed",{detail:{consented:n}})),n&&b(),r(!1)}function g(){typeof window>"u"||(localStorage.removeItem(m),window.dispatchEvent(new CustomEvent("cookie-consent-changed",{detail:{consented:!1}})),r(!0))}return u.useEffect(function(){if(!(typeof window>"u"))return window.revokeAnalyticsConsent=g,()=>{delete window.revokeAnalyticsConsent}},[]),u.useEffect(function(){if(typeof window>"u"||window.parent===window)return;function e(t){var a,o;if(t.source===window.parent){if(((a=t.data)==null?void 0:a.type)==="INITIAL_BUILD_COMPLETE"){c(!0),w(!0);try{sessionStorage.removeItem(v)}catch(s){console.warn("CookieBanner: sessionStorage unavailable, could not clear reset flag:",s instanceof Error?s.message:String(s))}}if(((o=t.data)==null?void 0:o.type)==="RESET_INITIAL_BUILD_HIDE"){w(!1);try{sessionStorage.setItem(v,"true")}catch(s){console.warn("CookieBanner: sessionStorage unavailable, reset flag will not persist:",s instanceof Error?s.message:String(s))}}}}return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]),h||!f||!l?null:i.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 bg-white border-t border-gray-200 shadow-lg",role:"alertdialog","aria-live":"polite","aria-label":"Cookie consent banner","aria-describedby":"
1cookie-banner-description","data-airo-non-editable":!0,children:i.jsx("div",{className:"max-w-7xl mx-auto px-4 py-4 sm:px-6 lg:px-8",children:i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-1",children:"Cookie Consent"}),i.jsx("p",{id:"cookie-banner-description",className:"text-sm text-gray-600",children:"We serve cookies. We use tools, such as cookies, to enable essential services and functionality on our site and to collect data on how visitors interact with our site, products and services. By clicking Accept, you agree to our use of these tools for advertising, analytics and support."})]}),i.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[i.jsx(E,{size:"sm",variant:"secondary",onClick:()=>c(!1),className:"whitespace-nowrap",children:"Decline"}),i.jsx(E,{size:"sm",onClick:()=>c(!0),className:"whitespace-nowrap",autoFocus:!0,children:"Accept"})]})]})})})}export{L as default};
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.