import{j as e}from"./ui-vendor-CJlQk0Tq.js";import{r as t}from"./react-vendor-f6QdChhz.js";import{N as o}from"./index-BzXujQ-F.js";const n=({sections:n,className:r,activeSection:s,onSectionChange:i,onQuoteClick:a})=>{const[d,c]=t.useState(""),l=void 0!==s?s:d;t.useEffect(()=>{if(void 0!==s)return;const e=()=>{const e=n.map(e=>document.getElementById(e.id));for(let t=e.length-1;t>=0;t--){const o=e[t];if(o){if(o.getBoundingClientRect().top<=150){c(n[t].id);break}}}};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[n,s]);return e.jsx("div",{className:o("bg-white border border-gray-200 rounded-lg p-2 shadow-sm",r),children:e.jsx("nav",{className:"flex justify-center",children:e.jsx("div",{className:"flex space-x-1 overflow-x-auto scrollbar-hide",children:n.map(t=>e.jsx("button",{onClick:()=>(e=>{if("get-quote"===e&&a)a();else if(i)i(e);else{const t=document.getElementById(e);if(t){const e=-100,o=t.getBoundingClientRect().top+window.pageYOffset+e;window.scrollTo({top:o,behavior:"smooth"})}}})(t.id),className:o("px-4 py-2 text-sm font-medium rounded-md transition-all whitespace-nowrap flex-shrink-0","hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2","get-quote"===t.id?"bg-green-600 text-white hover:bg-green-700 shadow-sm":l===t.id?"bg-primary text-white shadow-sm":"text-gray-600 hover:text-gray-900"),children:t.label},t.id))})})})};export{n as S};