1var j=Object.freeze,P=Object.defineProperty;var f=(n,h)=>j(P(n,"raw",{value:j(h||n.slice())}));import{f as b,k as T,l as p,u as D,a as G,s as H,R as d,m as z,n as A,o as Q,j as i,L as m,p as O,q as U,r as $,C as l,i as V,g as W,h as B}from"./index-A6ch38ZX.js";import{C as J}from"./RoutesCardList-crpIwYe0.js";var v;const K=V(J)(v||(v=f(["\n padding-left: ",";\n padding-right: ",";\n &:first-child {\n margin-top: 0.5rem;\n }\n h2 {\n margin-bottom: 1.75rem;\n }\n div.card {\n margin-top: 0.5rem;\n }\n"])),n=>n!=null&&n.$isMobile?"0.5rem":"0.75rem",n=>n!=null&&n.$isMobile?"0.5rem":"0.75rem"),X=()=>{const{t:n}=b(),h=T(),[C]=p(),t=C.get("query"),{isMobile:S}=D(),[o]=G(a=>{var r;return[(r=a==null?void 0:a.routesPolylinesData)==null?void 0:r.initRoutesData]},H),[e,_]=d.useState([]),[s,L]=d.useState([]);d.useEffect(()=>{t&&async function(){var r;if(t)try{const c=await z.get("".concat(A,"/api/search"),{params:{search_query:t},headers:Q()}),F=(r=c==null?void 0:c.data)==null?void 0:r.data,{filteredRoutesReducedIds:g,filteredStopsReduced:M}=F||{},N=o==null?void 0:o.filter(x=>g==null?void 0:g.includes(x==null?void 0:x.route_id));_(N),L(M)}catch(c){console.error("Error fetching results:",c)}}()},[o,t]);const I=a=>{h("/route/".concat(a==null?void 0:a.route_id))},k=a=>{h("/stop/".concat(a==null?void 0:a.stop_id))},w=e==null?void 0:e.map((a,r)=>i.jsx(m.Item,{as:"li",variant:"light",action:!0,onClick:()=>I(a),children:i.jsx(O,{route:a,addDescription:!0,query:t,isRouteList:!1})},"".concat(r,"_").concat(a==null?void 0:a.route_id))),E=s==null?void 0:s.map((a,r)=>i.jsx(m.Item,{as:"li",variant:"light",action:!0,onClick:()=>k(a),children:i.jsx(U,{stop:a,query:t})},"".concat(r,"_").concat(a==null?void 0:a.stop_id)));return i.jsx(d.Fragment,{children:i.jsxs(K,{$isMobile:S,children:[e!=null&&e.length||s!=null&&s.length?i.jsxs($,{children:["".concat(n("Search Results for"),":")," ",i.jsx("span",{children:t})]}):null,!(e!=null&&e.length)&&!(s!=null&&s.length)?i.jsxs($,{children:["".concat(n("No data for the given parameters"),":")," ",i.jsx("span",{children:t})]}):null,e!=null&&e.length?i.jsxs(l,{style:{width:"100%"},as:"div",border:"success",children:[i.jsx(l.Header,{as:"div",children:i.jsx("span",{className:"span_bold",children:n("Routes")})}),i.jsx(m,{variant:"flush",as:"ol",numbered:!1,horizontal:!1,children:w}),i.jsx(l.Footer,{as:"div",children:"".concat(n("Total"),": ").concat(e==null?void 0:e.length)})]}):null,s!=null&&s.length?i.jsxs(l,{style:{width:"100%"},as:"div",border:"secondary",children:[i.jsx(l.Header,{as:"div",children:i.jsx("span",{className:"span_bold",children:n("Stops")})}),i.jsx(m,{variant:"flush",as:"ol",numbered:!1,horizontal:!1,children:E}),i.jsx(l.Footer,{as:"div",children:"".concat(n("Total"),": ").concat(s==null?void 0:s.length)})]}):null]})})},y=()=>{const{t:n}=b();return i.jsxs(d.Fragment,{children:[i.jsx(X,{}),i.jsx(W,{title:"".concat(B," - ").concat(n("Search Page")),description:"GTFS Data Viewer"})]})};export{y 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.