1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[49180],{40137:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/buy-old-used-phones/location/[state]",function(){return l(31762)}])},31762:function(e,t,l){"use strict";l.r(t),l.d(t,{__N_SSP:function(){return M}});var a=l(85893),n=l(26560),o=l(92112),i=l(3744),s=l(94535),r=l(15620),d=l(93912),u=l(3279),c=l(65132),f=l(41453),p=l(46343),v=l(88886),g=l(17018),h=l(36513),x=l(56953),y=l(40197),m=l(77881),b=l(51614),j=l(88250),w=l(48308),_=l(32709),N=l(85959),C=l(71766),P=l(56661),S=l(18483),D=l(2962),E=l(5152),O=l.n(E),k=l(11163),q=l(67294),B=l(30495);let Z=O()(()=>l.e(81106).then(l.bind(l,81106)),{loadableGenerated:{webpack:()=>[81106]},ssr:!1});O()(()=>l.e(56215).then(l.bind(l,56215)),{loadableGenerated:{webpack:()=>[56215]},ssr:!1});let L="Buy Used Phones";var M=!0;t.default=e=>{var t,l,E,O,M,A,F,T,U,K,R,$;let{allMakes:G,latLong:H,stateName:I,otherDeals:J}=e,V=(0,m.Z)("lg"),X=(0,k.useRouter)(),Y=(0,S.Dv)(_.Jp),[Q,W]=(0,q.useState)(L),[z,ee]=(0,q.useState)(!1),[et,el]=(0,q.useState)(!1),ea=(0,q.useRef)();null===(t=X.asPath)||void 0===t||t.split("?")[0];let[en,eo]=(0,S.KO)(w.V);(0,S.b9)(j.sQ);let[ei,es]=(0,q.useState)([]),er=(0,S.Dv)(j.ZP),[ed,eu]=(0,S.KO)(j.lH),ec=(0,S.b9)(v.openLocationPopupAtom),ef=(0,S.Dv)(_.h_);(0,q.useEffect)(()=>{var e;let t=(0,b.NJ)(null===(e=X.query)||void 0===e?void 0:e.state);t&&(0,y.ol)(t).then(e=>{console.log(e),Array.isArray(e)&&e.forEach(async e=>{if("State"===e.type&&(null==e?void 0:e.state)&&(0,b.$p)(e.state).toLowerCase()===(0,b.$p)(t).toLowerCase()){var l;let t=await (0,y.k$)(e.latitude,e.longitude),a=null==t?void 0:null===(l=t.dataObject[0])||void 0===l?void 0:l.id;eu({...e,id:a})}})})},[null===(l=X.query)||void 0===l?void 0:l.state,eu]);let ep=(0,q.useMemo)(()=>({...Y,...ef,latitude:null==ed?void 0:ed.latitude,longitude:null==ed?void 0:ed.longitude,state:null==ed?void 0:ed.state,city:""}),[Y,ef,ed]),ev=(0,q.useCallback)(()=>{if(X.query["page-heading"])"string"==typeof X.query["page-heading"]&&W(X.query["page-heading"]);else{let{verified:e,condition:t,warranty:l}=X.query,a=0;Object.keys(X.query).forEach(e=>{("verified"===e||"condition"===e||"warranty"===e)&&++a}),1===a&&(!0===e||"true"===e?W("Verified Deals"):t?"string"==typeof t?W(t+" Deals"):Array.isArray(t)&&W(t[0]+" Deals"):l&&W("Under Warranty Deals"))}},[X.query]),{isLoading:eg,data:eh,isError:ex,hasNextPage:ey,fetchNextPage:em,isFetchingNextPage:eb}=(0,C.N)({enabled:z,queryKey:["filtered-listings",ep],queryFn:async e=>{let{pageParam:t}=e,l=(null==ep?void 0:ep.maxDistance)||30,a={...ep,maxDistance:l,page:(null==t?void 0:t.pageNum)||1,limit:18};return await (0,h.ZP)(a,!1)},getNextPageParam:(e,t)=>{var l;if(!(20*t.length>=((null===(l=t[0])||void 0===l?void 0:l.totalCount)||0)))return{pageNum:t.length+1}}}),{ref:ej,inView:ew}=(0,B.YD)({triggerOnce:!1,threshold:.01,rootMargin:"50px"});(0,q.useEffect)(()=>{ew&&!eb&&ey&&em()},[em,ey,ew,eb]),(0,q.useEffect)(()=>{W(L)},[ep]),(0,q.useEffect)(()=>{if(!et)return ea.current=setTimeout(()=>{ev(),el(!0)},600),()=>clearTimeout(ea.current)},[et,ev]),(0,q.useEffect)(()=>{function e(e,t){t.shallow||el(!1)}function t(e,t){t.shallow||el(!1)}return X.events.on("routeChangeStart",e),X.events.on("routeChangeComplete",t),()=>{X.events.off("routeChangeStart",e),X.events.off("routeChangeComplete",t)}},[X,ev]),(0,q.useEffect)(()=>{eh&&eh.pages&&es(eh.pages.flatMap(e=>e.data))},[eh]);let{data:e_}=(0,P.a)({queryKey:["Brand"],queryFn:async()=>{try{let e=[];return await (0,x.Z)(!0).then(t=>{null==t||t.dataObject.sort((e,t)=>(null==e?void 0:e.displayOrder)-(null==t?void 0:t.displayOrder)).find(t=>{e.push(null==t?void 0:t.make)})}),e}catch(e){console.error("Error fetching brands:",e)}}});return(0,a.jsxs)("div",{className:"flex w-full flex-col lg:px-[120px]",children:[(0,a.jsx)(D.PB,{title:"Buy Second Hand Phone in ".concat(I," | Best Prices â ORUphones"),description:"Buy Old Used Mobile Phones Online in ".concat(I," exclusively at ORUphones. Explore our range of branded second hand Phones available at best prices."),canonical:(0,N.n)(["buy-old-used-phones","location",I])}),(0,a.jsx)(s.Z,{}),(0,a.jsx)(d.Z,{}),V&&(0,a.jsxs)("div",{className:"mt-[10px] flex w-full flex-col ",children:[(0,a.jsxs)("div",{className:"relative mb-[20px] flex w-full items-center justify-between gap-x-2 ".concat((null==Y?void 0:null===(E=Y.model)||void 0===E?void 0:E.length)?"mt-0":""," ").concat(!V&&"mb-0 hidden"),children:[(0,a.jsxs)("h1",{className:"flex flex-wrap gap-2 text-left font-poppins text-[28px] font-[600] leading-3 text-black ",children:[(0,a.jsxs)("span",{children:[Q," Near You"]}),(0,a.jsx)("button",{className:"leading-0 min-w-0 text-left font-poppins text-[20px] font-[300] text-[#3E468F] cursor-pointer",id:"Deals_layout-InLocation_button",onClick:ec.bind(null,void 0),children:"(".concat(er,")")})]}),(0,a.jsxs)("div",{className:" whitespace-nowrap text-right text-[20px] font-[300] text-[#737377]",children:["(",null==eh?void 0:null===(M=eh.pages)||void 0===M?void 0:null===(O=M[0])||void 0===O?void 0:O.totalCount," devices)"]})]}),(0,a.jsx)(o.default,{data:null==eh?void 0:null===(A=eh.pages)||void 0===A?void 0:A[0]})]}),(0,a.jsx)(c.Z,{}),(0,a.jsxs)("section",{className:"flex gap-5 max-md:w-fit lg:mt-[20px] lg:gap-8",children:[V&&(0,a.jsx)(Z,{data:null==eh?void 0:null===(F=eh.pages)||void 0===F?void 0:F[0],brands:e_}),(0,a.jsxs)(r.Z,{title:Q,devicesCount:null==eh?void 0:null===(U=eh.pages)||void 0===U?void 0:null===(T=U[0])||void 0===T?void 0:T.totalCount,setStartSearching:ee,hardLocation:I,isLoading:eg,data:null==eh?void 0:null===(K=eh.pages)||void 0===K?void 0:K[0],children:[(!eh||eg)&&Array.from({length:18},(e,t)=>(0,a.jsx)(p.default,{id:"BestDeal_StateLocation"},"skeleton-".concat(t))),(null==eh?void 0:null===($=eh.pages)||void 0===$?void 0:null===(R=$[0])||void 0===R?void 0:R.totalCount)?eh.pages.flatMap((e,t)=>e.data.map((l,o)=>{let i=t*e.data.length+o,s=Math.floor((i+1)/7-1)%n.insertCards.length;return(0,a.jsxs)(q.Fragment,{children:[(0,a.jsx)(f.ZP,{id:"BestDeal_StateLocation_Product_Card",data:l,priority:i<6}),(i+1)%7==0&&(0,a.jsx)(q.Fragment,{children:n.insertCards[s]},"insert-card-".concat(i))]},"".concat(l.listingId,"-").concat(o))})):(0,a.jsxs)("div",{className:"flex w-full items-center justify-center",children:[(0,a.jsx)("button",{id:"Best_Deals-State-Notify_Me_Button",className:"mt-2 w-full rounded-lg bg-[#F8DB11] py-3 transition-transform hover:scale-105",onClick:()=>{eo(!0)},disabled:eg,children:"Notify Me"}),en&&(0,a.jsx)(g.Z,{setPopupOpen:eo,popupOpen:en})]}),eb&&Array.from({length:20},(e,t)=>(0,a.jsx)(p.default,{id:"BestDeal_StateLocation"},"skeleton-".concat(t))),(0,a.jsx)("div",{className:"infiniteScrollTrigger w-full",ref:ej})]})]}),(0,a.jsx)("div",{className:"infiniteScrollTrigger w-full",ref:ej}),(0,a.jsxs)("div",{children:[(0,a.jsx)(u.default,{otherDeals:J}),(0,a.jsx)(i.default,{})]})]})}}},function(e){e.O(0,[40878,3744,99577,26560,92888,49774,40179],function(){return e(e.s=40137)}),_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.