PageSourceSearch

https://dumpstercontrols.io/assets/directoryShared-DlZGqRua.js

js dumpstercontrols.io collected 2026-10-02 01:05:17 UTC 7,139 bytes, 2 lines download raw bytes

1import{j as t,L as h,r as n}from"./vendor-react-kZYqt9_-.js";import{S as g}from"./SiteFooter-C46GVnS8.js";import{s as w}from"./index-CJLICdHJ.js";import{S as b,a as y}from"./landfillSlug-B9U5Sj5V.js";import{l as j}from"./logo-dumpster-controls-Ri8Ui11r.js";import{S as v}from"./share-2-BKSjavlq.js";import{C as N}from"./check-BeRDmh4q.js";import{L as S}from"./link-2-BpxPlv-U.js";import{S as k}from"./star-BCfU9VYO.js";import{S as C}from"./search-Dr2_WKFT.js";import{M as $}from"./mail-CUnx4KR5.js";import{M as L}from"./message-circle-Dfvgay83.js";import{F as E}from"./linkedin-DiF-GCSE.js";import{T}from"./twitter-RlDfmUaE.js";const Q=(e,s)=>{try{fetch("https://gcwyoiihrupbfqqlcurh.supabase.co/functions/v1/directory-notify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,company_slug:s||void 0}),keepalive:!0}).catch(()=>{})}catch{}},X=e=>{try{return new URL(e.startsWith("http")?e:`https://${e}`).hostname}catch{return e}},A=e=>(b[e==null?void 0:e.toUpperCase()]||e||"").toLowerCase().replace(/\s+/g,"-"),D=e=>(e||"").toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-"),K=e=>y.CA.includes(String(e).toUpperCase())?"CA$":"$",R=e=>`/directory/${A(e.state)}/${D(e.city)}/${e.slug}`,V=e=>(Array.isArray(e)?e:[]).map(s=>{var c;const l=String((s==null?void 0:s.label)||(s==null?void 0:s.size)||""),i=Number(s==null?void 0:s.yards)||parseInt(((c=l.match(/\d+/))==null?void 0:c[0])||"0",10);return{label:l,yards:i,price:Number(s==null?void 0:s.price)||0,...s!=null&&s.tons?{tons:Number(s.tons)}:{}}}),Z=Object.fromEntries(Object.entries(b).map(([e,s])=>[s.toLowerCase().replace(/\s+/g,"-"),e]));function O(){const[e,s]=n.useState(""),[l,i]=n.useState([]),[c,m]=n.useState(!1),d=n.useRef(null);return n.useEffect(()=>{const a=e.trim();if(a.length<2){i([]);return}const u=setTimeout(async()=>{var r;const p=(r=Object.entries(b).find(([,x])=>x.toLowerCase()===a.toLowerCase()))==null?void 0:r[0];let o=w.from("directory_companies").select("slug, name, city, state").eq("status","published").limit(8);o=p?o.or(`name.ilike.%${a}%,city.ilike.%${a}%,state.ilike.${p}`):o.or(`name.ilike.%${a}%,city.ilike.%${a}%,state.ilike.%${a}%`);const{data:f}=await o;i(f||[]),m(!0)},250);return()=>clearTimeout(u)},[e]),n.useEffect(()=>{const a=u=>{d.current&&!d.current.contains(u.target)&&m(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]),t.jsxs("div",{ref:d,className:"relative w-full max-w-xs sm:max-w-sm",children:[t.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2",children:[t.jsx(C,{className:"w-4 h-4 text-slate-400 shrink-0"}),t.jsx("input",{value:e,onChange:a=>s(a.target.value),onFocus:()=>{l.length&&m(!0)},placeholder:"Search companies by name, city or state",className:"w-full bg-transparent text-sm text-slate-800 placeholder:text-slate-400 outline-none"})]}),c&&e.trim().length>=2&&t.jsx("div",{className:"absolute z-30 mt-1.5 w-full rounded-xl border border-slate-200 bg-white shadow-xl overflow-hidden",children:l.length===0?t.jsx("p",{className:"px-4 py-3 text-sm text-slate-500",children:"No companies found yet. The directory is growing."}):l.map(a=>t.jsxs(h,{to:R(a),onClick:()=>{m(!1),s("")},className:"flex items-center justify-between px-4 py-2.5 text-sm hover:bg-slate-50",children:[t.jsx("span",{className:"font-semibold text-slate-800",children:a.name}),t.jsxs("span",{className:"text-xs text-slate-500",children:[a.city,", ",a.state]})]},a.slug))})]})}function ee({showSearch:e=!0}){return t.jsx("header",{className:"sticky top-0 z-40 bg-white/95 backdrop-blur border-b border-slate-200",children:t.jsxs("div",{className:"max-w-5xl mx-auto px-4 h-16 flex items-center justify-between gap-4",children:[t.jsx(h,{to:"/",className:"shrink-0","aria-label":"Dumpster Controls home",children:t.jsx("img",{src:j,alt:"Dumpster Controls",className:"h-8 w-auto",width:160,height:32})}),e?t.jsx(O,{}):t.jsxs("nav",{className:"flex items-center gap-4 text-sm",children:[t.jsx(h,{to:"/",className:"text-slate-600 hover:text-slate-900 font-semibold hidden sm:inline",children:"Home"}),t.jsx(h,{to:"/directory",className:"text-slate-600 hover:text-slate-900 font-semibold hidden sm:inline",children:"Directory"}),t.jsx(h,{to:"/landfills",className:"text-slate-600 hover:text-slate-900 font-semibold hidden sm:inline",children:"Landfills"}),t.jsx(h,{to:"/market-data",className:"text-slate-600 hover:text-slate-900 font-semibold hidden sm:inline",children:"Market Data"}),t.jsx(h,{to:"/help",className:"text-slate-600 hover:text-slate-900 font-semibold hidden sm:inline",children:"Help Center"}),t.jsx("a",{href:"/login?signup=true&ref=header",className:"rounded-lg bg-blue-600 text-white text-sm font-bold px-4 py-2 hover:bg-blue-700 transition-colors",children:"Start free"})]})]})})}function te(){return t.jsx(g,{})}function se({title:e,text:s}){const[l,i]=n.useState(!1),[c,m]=n.useState(!1),d=n.useRef(null);n.useEffect(()=>{const r=x=>{d.current&&!d.current.contains(x.target)&&i(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const a=typeof window<"u"?window.location.href:"",u=async()=>
1{if(typeof navigator<"u"&&"share"in navigator&&/Android|iPhone|iPad/i.test(navigator.userAgent))try{await navigator.share({title:e,text:s,url:a});return}catch{}i(r=>!r)},p=async()=>{try{await navigator.clipboard.writeText(a),m(!0),setTimeout(()=>{m(!1),i(!1)},1200)}catch{}},o=encodeURIComponent,f=[{label:"Email",icon:$,href:`mailto:?subject=${o(e)}&body=${o(`${s}
2${a}`)}`},{label:"WhatsApp",icon:L,href:`https://wa.me/?text=${o(`${s} ${a}`)}`},{label:"Facebook",icon:E,href:`https://www.facebook.com/sharer/sharer.php?u=${o(a)}`},{label:"X",icon:T,href:`https://twitter.com/intent/tweet?url=${o(a)}&text=${o(s)}`}];return t.jsxs("div",{ref:d,className:"relative",children:[t.jsx("button",{onClick:u,"aria-label":"Share this page",className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-white/90 text-slate-800 shadow hover:bg-white transition-colors",children:t.jsx(v,{className:"w-5 h-5"})}),l&&t.jsxs("div",{className:"absolute right-0 mt-2 z-30 w-44 rounded-xl border border-slate-200 bg-white shadow-xl overflow-hidden",children:[f.map(r=>t.jsxs("a",{href:r.href,target:r.label==="Email"?void 0:"_blank",rel:"noopener",onClick:()=>i(!1),className:"flex items-center gap-2.5 px-4 py-2.5 text-sm text-slate-700 hover:bg-slate-50",children:[t.jsx(r.icon,{className:"w-4 h-4 text-slate-400"})," ",r.label]},r.label)),t.jsxs("button",{onClick:p,className:"flex items-center gap-2.5 px-4 py-2.5 text-sm text-slate-700 hover:bg-slate-50 w-full text-left",children:[c?t.jsx(N,{className:"w-4 h-4 text-emerald-600"}):t.jsx(S,{className:"w-4 h-4 text-slate-400"}),c?"Copied!":"Copy Link"]})]})]})}function ae({value:e}){return t.jsx("span",{className:"inline-flex items-center gap-0.5",children:[1,2,3,4,5].map(s=>t.jsx(k,{className:`w-4 h-4 ${s<=Math.round(e)?"text-amber-400 fill-amber-400":"text-slate-300"}`},s))})}export{ee as D,se as S,ae as a,X as b,D as c,R as d,Q as e,te as f,Z as g,V as n,K as p,A as s};

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.