1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1601],{5472:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/bus/search",function(){return a(17032)}])},17032:(e,s,a)=>{"use strict";a.r(s),a.d(s,{__N_SSP:()=>T,default:()=>k});var i=a(37876),l=a(14232),t=a(49995),n=a(62867),r=a(72048),c=a(64722),o=a(85819),d=a(8259),h=a(6369),u=a(82132),m=a(72050),x=a(77716),p=a(69999),g=a(16145),_=a(86940),j=a.n(_),N=a(47471),f=a.n(N);let b="time",v="priceAsc",y=["Gece","Sabah","Ogle","Aksam"];function S(e){let s=e?.key||{};return`${s.companyNo}-${s.routeNo}-${s.tripTrackingNo}-${s.time}-${s.tripCode||""}`}var T=!0;function k(){let{router:e,localize:s,appEnv:a}=(0,m.A)(),{isReady:_,query:N}=e,[T,k]=(0,l.useState)(!0),[L,w]=(0,l.useState)([]),[C,F]=(0,l.useState)([]),[M,A]=(0,l.useState)(null),[E,H]=(0,l.useState)([]),[G,D]=(0,l.useState)([]),[I,O]=(0,l.useState)([]),[Y,$]=(0,l.useState)(b),[P,B]=(0,l.useState)(!1),[q,R]=(0,l.useState)(null),X=parseInt(N.from,10),Z=parseInt(N.to,10),z=N.date||"",V=(0,g.TZ)(N.pax),K=N.fromName||"",Q=N.toName||"",J={from:Number.isFinite(X)&&X>0?{locationId:X,name:K}:null,to:Number.isFinite(Z)&&Z>0?{locationId:Z,name:Q}:null,date:z,pax:V};(0,l.useEffect)(()=>{_&&X&&Z&&z&&U()},[_,N.from,N.to,N.date,N.pax]);let U=async()=>{k(!0),A(null),w([]),F([]),W(),ee();try{let e=await x.MJ.search({departureLocationId:X,arrivalLocationId:Z,date:z,passengerCount:V},a);e?.header?.success===!0?(w(Array.isArray(e.body?.trips)?e.body.trips:[]),F(Array.isArray(e.body?.features)?e.body.features:[])):A(e?.header?.message?.message||s("bus","searchFailed"))}catch(e){console.error("Bus search failed:",e),A(s("bus","searchFailed"))}finally{k(!1)}},W=()=>{H([]),D([]),O([]),$(b)},ee=()=>R(null),es=(0,l.useMemo)(()=>{let e={};return L.forEach(s=>{let a=s.companyName||String(s.companyNo);e[a]=(e[a]||0)+1}),Object.keys(e).sort().map(s=>({name:s,count:e[s]}))},[L]),ea=(0,l.useMemo)(()=>{let e={};return L.forEach(s=>{s.period&&(e[s.period]=(e[s.period]||0)+1)}),e},[L]),ei=(0,l.useMemo)(()=>{let e={};return L.forEach(s=>{s.seatLayout&&(e[s.seatLayout]=(e[s.seatLayout]||0)+1)}),Object.keys(e).sort().map(s=>({name:s,count:e[s]}))},[L]),el=(e,s)=>e(e=>e.includes(s)?e.filter(e=>e!==s):[...e,s]),et=E.length>0||G.length>0||I.length>0,en=(0,l.useMemo)(()=>{let e=L.filter(e=>(!(E.length>0)||!!E.includes(e.companyName||String(e.companyNo)))&&(!(G.length>0)||!!G.includes(e.period))&&(!(I.length>0)||!!I.includes(e.seatLayout)));return Y===v?[...e].sort((e,s)=>e.price-s.price):[...e].sort((e,s)=>String(e.departureTime).localeCompare(String(s.departureTime)))},[L,E,G,I,Y]),er=!T&&!M&&L.length>0,ec=s("bus","resultsTitle",{from:K||N.from,to:Q||N.to});return(0,i.jsxs)(r.A,{children:[(0,i.jsx)(n.bV,{title:`${ec} - TezFly`,noindex:!0}),(0,i.jsx)(c.A,{compact:!0,onSearch:s=>{s.from?.locationId&&s.to?.locationId&&e.push({pathname:(0,g.Yg)(a,"search"),query:(0,g.dm)(s)})},initialValues:J}),(0,i.jsx)("section",{className:j().page,children:(0,i.jsxs)("div",{className:"container",children:[(0,i.jsxs)("div",{className:j().resultsHeader,children:[(0,i.jsxs)("h2",{className:j().title+" fontH4",children:[ec,z&&(0,i.jsxs)("span",{className:j().titleCount,children:[" \xb7 ",(0,p.Yq)(z,"DD MMM YYYY, ddd",a)]}),er&&(0,i.jsxs)("span",{className:j().titleCount,children:[" \xb7 ",s("bus","tripsFound",{count:en.length})]})]}),er&&(0,i.jsx)("div",{className:j().headerControls,children:(0,i.jsxs)("select",{id:"busSortSelect",className:j().sortSelect+" fontMedium","aria-label":s("bus","sortBy"),value:Y,onChange:e=>$(e.target.value),children:[(0,i.jsx)("option",{value:b,children:s("bus","sortTime")}),(0,i.jsx)("option",{value:v,children:s("bus","sortPriceAsc")})]})})]}),T?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.A,{headerText:s("bus","searchingTrips"),isShow:T}),(0,i.jsx)(h.A,{})]}):M?(0,i.jsxs)("div",{className:j().emptyState,children:[(0,i.jsx)("div",{className:j().emptyTitle+" fontH4",children:s("bus","noTripsTitle")}),(0,i.jsx)("div",{className:j().emptyDesc+" fontMedium",children:M})]}):0===L.length?(0,i.jsxs)("div",{className:j().emptyState,children:[(0,i.jsx)("div",{className:j().emptyTitle+" fontH4",children:s("bus","noTripsTitle")}),(0,i.jsx)("div",{className:j().emptyDesc+" fontMedium",children:s("bus","noTripsDesc")})]}):(0,i.jsxs)("div",{className:j().resultsLayout,children:[(0,i.jsxs)("aside",{className:j().filtersSidebar,children:[(0,i.jsxs)("div",{className:j().filtersHead,children:[(0,i.jsx)("span",{className:j().filtersTitle+" fontH4",children:s("bus","filters")}),(0,i.jsxs)("div",{className:j().filtersHeadActions,children:[et&&(0,i.jsx)("button",{className:j().clearFilters+" fontSmall",onClick:W,children:s("bus","clearFilters")}),(0,i.jsx)("button",{className:j().filtersMobileToggle+" fontSmall",onClick:()=>B(e=>!e),"aria-expanded":P,children:P?"â":"+"})]})]}),(0,i.jsxs)("div",{className:(0,t.A)(!P&&j().filtersBodyCollapsed),children:[es.length>1&&(0,i.jsxs)("div",{className:j().filterGroup,children:[(0,i.jsx)("div",{className:j().filterGroupTitle+" fontMedium",children:s("bus","companyFilterTitle")}),es.map(e=>(0,i.jsxs)("label",{className:j().checkboxRow+" fontMedium",children:[(0,i.jsx)("input",{type:"checkbox",checked:E.includes(e.name),onChange:()=>el(H,e.name)}),(0,i.jsx)("span",{children:e.name}),(0,i.jsxs)("span",{className:j().checkboxCount+" fontSmall",children:["(",e.count,")"]})]},e.name))]}),y.some(e=>ea[e])&&(0,i.jsxs)("div",{className:j().filterGroup,children:[(0,i.jsx)("div",{className:j().filterGroupTitle+" fontMedium",children:s("bus","periodFilterTitle")}),y.filter(e=>ea[e]).map(e=>(0,i.jsxs)("label",{className:j().checkboxRow+" fontMedium",children:[(0,i.jsx)("input",{type:"checkbox",checked:G.includes(e),onChange:()=>el(D,e)}),(0,i.jsx)("span",{children:s("bus",`period.${e}`)}),(0,i.jsxs)("span",{className:j().checkboxCount+" fontSmall",children:["(",ea[e],")"]})]},e))]}),ei.length>1&&(0,i.jsxs)("div",{className:j().filterGroup,children:[(0,i.jsx)("div",{className:j().filterGroupTitle+" fontMedium",children:s("bus","layoutFilterTitle")}),ei.map(e=>(0,i.jsxs)("label",{className:j().checkboxRow+" fontMedium",children:[(0,i.jsx)("input",{type:"checkbox",checked:I.includes(e.name),onChange:()=>el(O,e.name)}),(0,i.jsx)("span",{children:e.name}),(0,i.jsxs)("span",{className:j().checkboxCount+" fontSmall",children:["(",e.count,")"]})]},e.name))]})]})]}),(0,i.jsx)("div",{className:j().resultsMain,children:0===en.length?(0,i.jsxs)("div",{className:j().emptyState,children:[(0,i.jsx)("div",{className:j().emptyTitle+" fontH4",children:s("bus","noTripsTitle")}),(0,i.jsx)("div",{className:j().emptyDesc+" fontMedium",children:s("bus","noTripsFilterDesc")})]}):(0,i.jsx)("div",{className:f().tripList,children:en.map(l=>{let t=S(l);return(0,i.jsx)(o.A,{trip:l,features:C,isOpen:q===t,onToggle:()=>{let e;return e=S(l),void R(s=>s===e?null:e)},localize:s,appEnv:a,selectedFromName:K,children:q===t&&(0,i.jsx)(d.A,{trip:l,pax:V,search:{from:X,to:Z,date:z,pax:V,fromN
1ame:K,toName:Q},onPriceDeclined:U,router:e,localize:s,appEnv:a})},t)})})})]})]})})]})}},20704:e=>{e.exports={backdrop:"Loading1_backdrop__OxS2O",dialog:"Loading1_dialog__Dr_vh",loadingContainer:"Loading1_loadingContainer__w0363",container:"Loading1_container__iIBS8",header:"Loading1_header__KGuQT",headerText:"Loading1_headerText___41EN",loading:"Loading1_loading__2nQn5",bounce:"Loading1_bounce__o3KfG",one:"Loading1_one__Z93gT",two:"Loading1_two___q1eE",three:"Loading1_three__2jCyY",contain:"Loading1_contain__Xbb3x",rotate:"Loading1_rotate__BcZ3X",search:"Loading1_search__q_pFc",footer:"Loading1_footer__8VlGC",left:"Loading1_left__st6Sc",white:"Loading1_white__ENhiL",black:"Loading1_black__RvgxG",line:"Loading1_line__NEGvZ",right:"Loading1_right___iPpu"}},82132:(e,s,a)=>{"use strict";a.d(s,{A:()=>o});var i=a(37876),l=a(20704),t=a.n(l),n=a(14232),r=a(72050),c=a(94410);function o(e){let{localize:s}=(0,r.A)();return((0,n.useEffect)(()=>{if(!e.isShow)return;let s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s}},[e.isShow]),e.isShow)?(0,i.jsx)("div",{className:t().backdrop,role:"alertdialog","aria-modal":"true","aria-busy":"true","aria-labelledby":"loading1-title",children:(0,i.jsx)("div",{className:t().dialog,children:(0,i.jsx)("div",{className:t().loadingContainer,children:(0,i.jsxs)("div",{className:t().container,children:[(0,i.jsx)("div",{className:t().header,children:(0,i.jsxs)("div",{className:t().headerText,children:[(0,i.jsxs)("div",{className:t().loading,children:[(0,i.jsx)("div",{className:t().one}),(0,i.jsx)("div",{className:t().two}),(0,i.jsx)("div",{className:t().three})]}),(0,i.jsx)("span",{id:"loading1-title",children:e.headerText??s("searchFlight","loadingHeader1")})]})}),(0,i.jsxs)("div",{className:t().contain,children:[(0,i.jsxs)("div",{className:t().rotate,children:[(0,i.jsxs)("div",{className:t().search,children:[(0,i.jsx)("img",{src:(0,c.m)("icons/search"),alt:"search icon"}),(0,i.jsx)("span",{children:s("searchFlight","loadingHeader2")})]}),(0,i.jsx)("img",{src:(0,c.m)("loading-cards"),alt:"loading-cards icon"})]}),(0,i.jsxs)("div",{className:t().footer,children:[(0,i.jsxs)("div",{className:t().left,children:[(0,i.jsx)("div",{className:t().white,children:s("searchFlight","loadingHeader3_1")}),(0,i.jsx)("div",{className:t().black,children:s("searchFlight","loadingHeader3_2")})]}),(0,i.jsx)("div",{className:t().line}),(0,i.jsx)("div",{className:t().right,children:s("searchFlight","loadingHeader4")})]})]})]})})})}):null}}},e=>{e.O(0,[7765,3630,3601,9963,4015,1211,9514,4233,2239,4788,3936,4692,5378,9105,4722,636,6593,8792],()=>e(e.s=5472)),_N_E=e.O()}]);
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.