"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1962],{1962:function(e,l,a){let n;a.d(l,{default:function(){return X}});var i=a(7437),s=a(6105),d=a(1516),o=a(3126),t=a(2837),r=a(6765),c=a(5127),u=a(8087),m=a(6648),v=a(2265),h=a(4887),p=a(1389),x=e=>{var l;let{isOpen:a,handleCloseModal:n,items:d,selectedItem:o,title:t,bindingKey:x,bindingValue:g,onChange:j,hideClose:b=!1,showImage:f=!1,imageKey:y="",searchable:N=!1,notCloseOnFade:w=!1,noRecordMessage:k="noRecordFound",className:E}=e,[L,O]=(0,v.useState)(!1),[F,C]=(0,v.useState)(""),[A,S]=(0,v.useState)(d),I=(0,u.useTranslations)("Index");(0,v.useEffect)(()=>{S(d)},[d]),(0,v.useEffect)(()=>{O(!0)},[]),(0,v.useEffect)(()=>{if(L)return a?document.documentElement.classList.add("modal-open"):document.documentElement.classList.remove("modal-open"),()=>{document.documentElement.classList.remove("modal-open"),C(""),S(d)}},[L,a]);let T=(e,l)=>{e.stopPropagation(),null==j||j(l["".concat(g)])},U=e=>{C(e),e?S(d.filter(l=>l["".concat(x)].toLowerCase().includes(e.toLowerCase()))):S(d)};return L?h.createPortal(a?(0,i.jsxs)("div",{className:"cs-modal-dropdown ".concat(a?"opened":""," ").concat(E),children:[(0,i.jsx)(r.E.div,{className:"fade modal-backdrop",onClick:()=>{w||n()},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:[.04,.62,.23,.98]}}),(0,i.jsx)(r.E.div,{className:"cs-modal-dialog-dropdown",initial:{transform:"translateY(100%)",opacity:0},animate:{transform:"translateY(0)",opacity:1},exit:{transform:"translateY(100%)",opacity:0},transition:{duration:.3,ease:[.04,.62,.23,.98]},children:(0,i.jsxs)("div",{className:"modal-content-dropdown",children:[(0,i.jsxs)("div",{className:"modal-header-dropdown",children:[b?"":(0,i.jsxs)("button",{onClick:n,children:[" ",(0,i.jsx)(s.x8,{})," "]}),(0,i.jsx)("h3",{children:t}),(0,i.jsxs)("button",{type:"button",onClick:()=>{null==j||j(null)},children:[" ",I("reset")," "]})]}),(0,i.jsx)("div",{className:"modal-body-dropdown",children:(0,i.jsxs)(c.M,{children:[N&&(0,i.jsx)("div",{className:"search-modal",children:(0,i.jsx)("div",{className:"relative",children:(0,i.jsx)(p.Z,{fieldName:"search",label:I("search"),placeholder:"",value:F,icon:(0,i.jsx)(s.HN,{}),setValue:(e,l)=>{U(l.trim())}})})}),(0,i.jsx)("ul",{children:(null==A?void 0:A.length)>0?null==A?void 0:A.map((e,l)=>(0,i.jsxs)("li",{title:e["".concat(x)],onClick:l=>{T(l,e)},className:"".concat(o===e["".concat(g)]?"active":""),children:[(0,i.jsx)("div",{className:"select-modal-item",children:(0,i.jsxs)("div",{className:"item-name",children:[(0,i.jsx)("span",{className:o===e[x]?"checked":"",children:o===e[x]?(0,i.jsx)(s.Jr,{}):null}),e["".concat(x)]]})}),f?(0,i.jsx)("figure",{children:(0,i.jsx)(m.default,{src:e["".concat(y)],width:50,height:50,alt:e["".concat(x)]})}):""]},"".concat(e["".concat(x)],"-").concat(e["".concat(g)],"-").concat(l))):(0,i.jsx)("li",{className:"no-item",children:I("".concat(k))},"no-record")})]})})]})})]}):null,null!==(l=document.getElementById("modal-root"))&&void 0!==l?l:document.body):null},g=a(1670),j=a(1801),b=a(6138),f=a(7367);let y=()=>window.innerWidth<767;var N=a(9548),w=a(414),k=a(6463),E=a(6405),L=a(9733),O=a(1457),F=a(7268),C=e=>{let{brands:l,filters:a,setFilters:n,setIsOpen:d,isOpen:o}=e,t=(0,u.useTranslations)("Index"),r=(0,u.useLocale)(),[c,m]=(0,v.useState)({...a,yearFrom:null==a?void 0:a.year}),[h,x]=(0,v.useState)([]),[y,w]=(0,v.useState)([]),E=(0,g.jD)(),C=(0,g.tv)(),A=(0,k.useSearchParams)();(0,v.useEffect)(()=>{let e=null==l?void 0:l.find(e=>(null==e?void 0:e["ar"===r?"nameAr":"nameEn"])===(null==a?void 0:a.brand));e&&(x(e.carModels),m(l=>({...l,brandId:e.id})));let n=A.getAll("vehicleType");n.length&&(5===n.length?w([0]):f.k3.forEach(e=>{n.includes(e.label.toLocaleLowerCase())&&w(l=>[...l,e.id])})),m(e=>({...e,priceFrom:A.get("priceFrom")||void 0,priceTo:A.get("priceTo")||void 0,yearFrom:A.get("yearFrom")||void 0,yearTo:A.get("yearTo")||void 0,kmFrom:A.get("kmFrom")||void 0,kmTo:A.get("kmTo")||void 0,vehicleClassification:n.length?n:[]}))},[]),(0,v.useEffect)(()=>{let e=[];if(y.length){if(0===y[0])for(let l of f.k3)0!==l.id&&e.push(l.label.toLowerCase());else for(let l of f.k3)y.includes(l.id)&&e.push(l.label.toLowerCase());m(l=>({...l,vehicleClassification:e}))}else m(e=>({...e,vehicleClassification:[]}))},[y]);let S=e=>{0===e?w([0]):y.includes(0)?w([e]):y.includes(e)?w(y.filter(l=>l!==e)):w([...y,e])},I=async e=>{n(e);let l=(0,j.DW)(E,e,"advance"),a=(0,j.zH)(e),i=l+(a.length?"?".concat(a):"");C.push(i),d(!1)};return(0,i.jsx)(O.Z,{handleCloseModal:()=>d(!1),isOpen:o,title:t("advancedSearch"),footerContent:(0,i.jsxs)("div",{className:"search-action",children:[(0,i.jsx)("span",{className:"text-link",onClick:()=>{m({brand:void 0,brandId:void 0,model:void 0,condition:void 0,priceFrom:void 0,priceTo:void 0,yearFrom:void 0,yearTo:void 0,kmFrom:void 0,kmTo:void 0,vehicleClassification:[]}),w([]),x([])},children:t("clearAll")}),(0,i.jsx)(L.default,{type:"submit",message:t("searchAdvance"),icon:(0,i.jsx)(s.HN,{}),className:"btn-secondary",size:"md",handleClick:()=>I(c)})]}),children:(0,i.jsxs)("div",{className:"modal-blocks-search",children:[(0,i.jsxs)("div",{className:"block-search",children:[(0,i.jsx)("h4",{children:t("carParameters")}),(0,i.jsx)("div",{className:"fields-block",children:(0,i.jsxs)("div",{className:"dropdown-form grid grid-cols-1 gap-6 sm-round",children:[(0,i.jsx)(F.Z,{register:()=>{},selectedItem:(null==c?void 0:c.brand)==="all"?void 0:null==c?void 0:c.brand,label:t("brands"),items:l,fieldName:"brands",bindingKey:"ar"===r?"nameAr":"nameEn",bindingValue:"ar"===r?"nameAr":"nameEn",placeholder:"",setValue:(e,a)=>{var n;let i=null==l?void 0:l.find(e=>(null==e?void 0:e["ar"===r?"nameAr":"nameEn"])===a);m({...c,brand:a,brandId:(null==i?void 0:i.id)||void 0,model:void 0}),x(null!==(n=null==i?void 0:i.carModels)&&void 0!==n?n:[]),(0,N.bc)(b.aO.brandSelected,a)},hideClearIcon:!0,searchable:!0}),(0,i.jsx)(F.Z,{register:()=>{},selectedItem:(null==c?void 0:c.model)==="all"?void 0:null==c?void 0:c.model,label:t("models"),items:h,fieldName:"models",bindingKey:"ar"===r?"modelAr":"modelEn",bindingValue:"ar"===r?"modelAr":"modelEn",placeholder:"",setValue:(e,l)=>{m({...c,brand:null==c?void 0:c.brand,model:l}),(0,N.bc)(b.aO.modelSelected,l)},hideClearIcon:!0,disabled:!h.length}),(0,i.jsx)(F.Z,{register:()=>{},selectedItem:null==c?void 0:c.condition,label:t("carConditions"),items:[{name:t("certified"),slug:"certified"},{name:t("new"),slug:"new"},{name:t("used"),slug:"used"}],fieldName:"condition",bindingKey:"name",bindingValue:"slug",placeholder:"",setValue:(e,l)=>{m({...c,condition:l})},hideClearIcon:!0}),(0,i.jsx)("div",{className:"car-types-figure",children:(0,i.jsx)("ul",{children:f.k3.map(e=>(0,i.jsxs)("li",{className:y.includes(e.id)?"active":"",onClick:()=>S(e.id),children:[(0,i.jsx)("div",{className:"check-icon",children:(0,i.jsx)(s.Jr,{})}),null!==e.icon&&(0,i.jsx)("figure",{children:e.icon}),(0,i.jsx)("span",{children:t(e.langLabel)})]},e.id))})})]})})]}),(0,i.jsx)("div",{className:"separator"}),(0,i.jsxs)("div",{className:"block-search",children:[(0,i.jsx)("div",{className:"range-picker",children:(0,i.jsx)("h4",{children:t("setThePrice")})}),(0,i.jsxs)("div",{className:"price-block-search",children:[(0,i.jsx)(p.Z,{fieldName:"priceFrom",label:t("from"),placeholder:"",value:c.priceFrom||"",setValue:(e,l)=>{l=l.replace(/[^0-9]/g,""),m({...c,priceFrom:l})}}),(0,i.jsx)("span",{className:"dash"}),(0,i.jsx)(p.Z,{fieldName:"priceTo",label:t("to"),placeholder:"",value:c.priceTo||"",setValue:(e,l)=>{l=l.replace(/[^0-9]/g,""),m({...c,priceTo:l})}})]})]}),(0,i.jsx)("div",{className:"separator"}),(0,i.jsxs)("div",{className:"block-search",children:[(0,i.jsx)("div",{className:"range-picker",children:(0,i.jsx)("h4",{children:t("year")})}),(0,i.jsxs)("div",{className:"price-block-search",children:[(0,i.jsx)(p.Z,{fieldName:"yearFrom",label:t("from"),placeholder:"",value:c.yearFrom||"",setValue:(e,l)=>{(l=l.replace(/[^0-9]/g,"")).length<=4?m({...c,yearFrom:l}):m({...c,yearFrom:l.slice(0,4)})}}),(0,i.jsx)("span",{className:"dash"}),(0,i.jsx)(p.Z,{fieldName:"yearTo",label:t("to"),placeholder:"",value:c.yearTo||"",setValue:(e,l)=>{(l=l.replace(/[^0-9]/g,"")).length<=4?m({...c,yearTo:l}):m({...c,yearTo:l.slice(0,4)})}})]})]}),(0,i.jsxs)("div",{className:"block-search",children:[(0,i.jsx)("div",{className:"range-picker",children:(0,i.jsx)("h4",{children:t("kilometers")})}),(0,i.jsxs)("div",{className:"price-block-search",children:[(0,i.jsx)(p.Z,{fieldName:"kmFrom",label:t("from"),placeholder:"",value:c.kmFrom||"",setValue:(e,l)=>{l=l.replace(/[^0-9]/g,""),m({...c,kmFrom:l})}}),(0,i.jsx)("span",{className:"dash"}),(0,i.jsx)(p.Z,{fieldName:"kmTo",label:t("to"),placeholder:"",value:c.kmTo||"",setValue:(e,l)=>{l=l.replace(/[^0-9]/g,""),m({...c,kmTo:l})}})]})]})]})})};let A=[];var S=e=>{var l,a,n,c,m,h;let L;let{brands:O,pathname:F,filters:S,setFilters:I,assetsYears:T=[]}=e,[U,B]=(0,v.useState)([...A]),V=(0,g.tv)(),[Z,P]=(0,v.useState)((null==S?void 0:S.sortByValue)?null==S?void 0:S.sortByValue:"default"),[R,M]=(0,v.useState)(!1),[D,K]=(0,v.useState)(b.Mx),X=(0,u.useTranslations)("Index"),W=(0,u.useLocale)(),[_,H]=(0,v.useState)([]),$=(0,k.useSearchParams)(),[q,Y]=(0,v.useState)(""),G=$.get("showroomSearch")||$.get("officeSearch"),[J,Q]=(0,v.useState)(!1),[z,ee]=(0,v.useState)({sort:!1,brand:!1,model:!1,year:!1}),el=F.includes(b.$t.showrooms)||F.includes(b.$t.offices);(0,v.useEffect)(()=>{Q(!0),K(e=>b.Mx.map(e=>({...e,translation:X("".concat(e.langName))}))),(0,d.NJ)().then(e=>{var l,a;A=null!==(l=e.data)&&void 0!==l?l:[],B(null!==(a=e.data)&&void 0!==a?a:[])}).catch(e=>{}).finally(()=>Q(!1))},[]),(0,v.useEffect)(()=>{var e,l;H(null!==(l=null==O?void 0:null===(e=O.find(e=>(null==e?void 0:e["ar"===W?"nameAr":"nameEn"])===(null==S?void 0:S.brand)))||void 0===e?void 0:e.carModels)&&void 0!==l?l:[])},[null==S?void 0:S.brand]),(0,v.useEffect)(()=>{let e=null==U?void 0:U.find(e=>{var l,a;return(null==e?void 0:null===(l=e.nameEn)||void 0===l?void 0:l.toLowerCase())===(null==S?void 0:null===(a=S.vehicleType)||void 0===a?void 0:a.toLowerCase())});I(l=>({...l,tagId:(null==e?void 0:e.id)||0}))},[null==S?void 0:S.vehicleType]),(0,v.useEffect)(()=>{P((null==S?void 0:S.sortByValue)?null==S?void 0:S.sortByValue:"default")},[null==S?void 0:S.sortByValue]),(0,v.useEffect)(()=>{null===G&&Y("")},[G]);let ea=e=>{let l=(0,j.DW)(F,S),a="default"!==e?e.split("-"):void 0;I(l=>({...l,sortByValue:e,sortBy:null==a?void 0:a[0],sortByOrder:null==a?void 0:a[1]})),V.push("".concat(l,"?").concat((0,E.stringify)({...(null==a?void 0:a.length)&&{sortBy:a[0],sortByOrder:a[1]}})))},en=e=>{let l=(0,j.DW)(F,{...S,brand:e.brand,model:e.model,year:e.year}),a="";(null==S?void 0:S.sortBy)&&S.sortByOrder&&(a+="".concat((0,E.stringify)({sortBy:null==S?void 0:S.sortBy}),"&")+"".concat((0,E.stringify)({sortByOrder:null==S?void 0:S.sortByOrder}),"&"));let n=l+((a=a.length?a.slice(0,-1):a).length?"?".concat(a):"");V.push(n)},ei=e=>e.includes(b.$t.featured)?"certified":e.includes(b.$t.used)?"used":e.includes(b.$t.new)?"new":"all",es=e=>{var l,a,n,i,s,d,o;return el||e.includes(b.$t.showrooms)||e.includes(b.$t.offices)?e:"".concat(e).concat((null==S?void 0:S.brand)||(null==S?void 0:S.condition)||(null==S?void 0:S.year)||(null==S?void 0:S.view)||(null==S?void 0:S.tagId)?"/".concat(null!==(n=null===(l=S.brand)||void 0===l?void 0:l.replaceAll("&","amp"))&&void 0!==n?n:"all"):"").concat((null==S?void 0:S.model)||(null==S?void 0:S.condition)||(null==S?void 0:S.year)||(null==S?void 0:S.view)||(null==S?void 0:S.tagId)?"/".concat(null!==(i=null===(a=S.model)||void 0===a?void 0:a.replaceAll("&","amp"))&&void 0!==i?i:"all"):"").concat((null==S?void 0:S.condition)||(null==S?void 0:S.year)||(null==S?void 0:S.view)||(null==S?void 0:S.tagId)?"/".concat(null!==(s=ei(e))&&void 0!==s?s:"all"):"").concat((null==S?void 0:S.year)||(null==S?void 0:S.view)||(null==S?void 0:S.tagId)?"/".concat(null!==(d=S.year)&&void 0!==d?d:"all"):"").concat((null==S?void 0:S.view)||(null==S?void 0:S.tagId)?"/".concat(null!==(o=S.view)&&void 0!==o?o:"/list"):"").concat((null==S?void 0:S.tagId)?"/".concat(S.tagId):"")},ed=(h=e=>{let l=F.includes(b.$t.showrooms),a=(0,E.stringify)({[l?"showroomSearch":"officeSearch"]:e.trim()}),n=F+(a.length?"?".concat(a):"");V.push(n)},function(){for(var e=arguments.length,l=Array(e),a=0;a<e;a++)l[a]=arguments[a];let n=this;clearTimeout(L),L=setTimeout(()=>h.apply(n,l),300)});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"tab-system",children:(0,i.jsx)("div",{className:"container-main",children:(0,i.jsx)("div",{className:"tab-left",children:(0,i.jsx)("ul",{children:f.WA.map((e,l)=>(0,i.jsx)("li",{className:F===b.UF.EXPLORE&&(null==e?void 0:e.link.includes(b.$t.featured))||F.includes(null==e?void 0:e.link)?"active":"",children:(0,i.jsxs)(g.rU,{href:{pathname:es(e.link),query:{...(null==S?void 0:S.sortBy)&&{sortBy:null==S?void 0:S.sortBy},...(null==S?void 0:S.sortByOrder)&&{sortByOrder:null==S?void 0:S.sortByOrder}}},children:[(0,i.jsx)("figure",{children:null==e?void 0:e.icon()}),(0,i.jsx)("span",{children:X("".concat(e.langLabel))})]})},"".concat(null==e?void 0:e.label,"-").concat(l)))})})})}),J&&0===U.length?(0,i.jsx)(o.aJ,{}):(0,i.jsx)("div",{className:"tab-block ".concat(el?"showroomtab":""),children:(0,i.jsx)("div",{className:"container-main",children:(0,i.jsxs)("div",{className:"filter-categories ".concat(S&&"grid"===S.view?"active":""),children:[el?null:(0,i.jsx)("div",{className:"filter-btn mob md:hidden ".concat((null==S?void 0:S.search)==="advance"?"active":""),onClick:()=>M(!0),children:(0,i.jsx)(s.wn,{})}),R&&(0,i.jsx)(C,{filters:S,isOpen:R,setIsOpen:M,brands:O,setFilters:I}),el?(0,i.jsx)("div",{className:"filter-search",children:(0,i.jsx)(p.Z,{fieldName:"search",label:X("search"),icon:(0,i.jsx)(s.HN,{}),placeholder:"",value:q,setValue:(e,l)=>{Y(l),ed(l)}})}):(0,i.jsxs)(i.Fragment,{children:[y()?"":(0,i.jsx)("div",{className:"filter-dropdown-item filter-list",children:(0,i.jsx)("ul",{children:(0,i.jsx)("li",{children:(0,i.jsx)("div",{className:"filter-item",children:(0,i.jsx)(t.Z,{items:D,bindingKey:"translation",bindingValue:"id",placeholder:X("sortBy"),onChange:e=>{P(e),ea(e)},selectedItem:Z,data:(0,i.jsxs)("span",{className:"default"!==Z?"active":"",children:[(null===b.Mx||void 0===b.Mx?void 0:null===(l=b.Mx.find(e=>"default"!==Z&&e.id===Z))||void 0===l?void 0:l.langName)?X("".concat(null===b.Mx||void 0===b.Mx?void 0:null===(a=b.Mx.find(e=>"default"!==Z&&e.id===Z))||void 0===a?void 0:a.langName)):X("sortBy"),(0,i.jsx)(s.aQ,{})]})})},"short-by")})})}),(0,i.jsx)("div",{className:"filter-list filter-tag",children:(0,i.jsxs)(w.tv,{options:{autoplay:!1,autoWidth:!0,focus:0,pagination:!1,omitEnd:!0,perMove:1,gap:"12px",direction:"ar"===W?"rtl":"ltr"},children:[y()?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(w.jw,{className:"md:!hidden",children:[(0,i.jsx)("div",{className:"filter-item",children:(0,i.jsx)("div",{className:"dropdown-main dropdown-ui",children:(0,i.jsx)("div",{className:"dropdown-wrapper",children:(0,i.jsx)("div",{className:"cs-dropdown-head",children:(0,i.jsx)("button",{type:"button",onClick:()=>ee(e=>({...e,sort:!0})),children:(0,i.jsxs)("span",{className:"".concat("default"!==Z?"active":""),children:[(null===b.Mx||void 0===b.Mx?void 0:null===(n=b.Mx.find(e=>"default"!==Z&&e.id===Z))||void 0===n?void 0:n.langName)?X("".concat(null===b.Mx||void 0===b.Mx?void 0:null===(c=b.Mx.find(e=>"default"!==Z&&e.id===Z))||void 0===c?void 0:c.langName)):X("sortBy")," ",(0,i.jsx)(s.aQ,{})]})})})})})}),(0,i.jsx)(x,{isOpen:z.sort,handleCloseModal:()=>ee(e=>({...e,sort:!1})),items:D,selectedItem:"".concat(null==D?void 0:null===(m=D.find(e=>e.id===Z))||void 0===m?void 0:m.translation),title:X("sortBy"),bindingKey:"translation",bindingValue:"id",className:"filter-modal-dropdown",onChange:e=>{P(e||"default"),ea(e||"default"),ee(e=>({...e,sort:!1}))}})]}),(0,i.jsxs)(w.jw,{className:"md:!hidden",children:[(0,i.jsx)("div",{className:"filter-item",children:(0,i.jsx)("div",{className:"dropdown-main dropdown-ui",children:(0,i.jsx)("div",{className:"dropdown-wrapper",children:(0,i.jsx)("div",{className:"cs-dropdown-head",children:(0,i.jsx)("button",{type:"button",onClick:()=>ee(e=>({...e,brand:!0})),children:(0,i.jsxs)("span",{className:"".concat((null==S?void 0:S.brand)&&(null==S?void 0:S.brand)!=="all"?"active":""),children:[X("brand")," ",(0,i.jsx)(s.K5,{})]})})})})})}),(0,i.jsx)(x,{isOpen:z.brand,handleCloseModal:()=>ee(e=>({...e,brand:!1})),items:O,selectedItem:null==S?void 0:S.brand,title:X("brand"),bindingKey:"ar"===W?"nameAr":"nameEn",bindingValue:"ar"===W?"nameAr":"nameEn",onChange:e=>{var l,a;I(l=>({...l,brand:e||void 0,model:void 0})),(0,N.bc)(b.aO.brandSelected,{From:"Mobile Filters",selection:e}),H(null!==(a=null==O?void 0:null===(l=O.find(e=>(null==e?void 0:e["ar"===W?"nameAr":"nameEn"])===(null==S?void 0:S.brand)))||void 0===l?void 0:l.carModels)&&void 0!==a?a:[]),en({brand:e,model:null,year:null}),ee(e=>({...e,brand:!1}))},searchable:!0,showImage:!0,imageKey:"logo"})]}),(null==_?void 0:_.length)?(0,i.jsxs)(w.jw,{className:"md:!hidden",children:[(0,i.jsx)("div",{className:"filter-item",children:(0,i.jsx)("div",{className:"dropdown-main dropdown-ui",children:(0,i.jsx)("div",{className:"dropdown-wrapper",children:(0,i.jsx)("div",{className:"cs-dropdown-head",children:(0,i.jsx)("button",{type:"button",onClick:()=>ee(e=>({...e,model:!0})),children:(0,i.jsxs)("span",{className:"".concat((null==S?void 0:S.model)&&(null==S?void 0:S.model)!=="all"?"active":""),children:[X("model")," ",(0,i.jsx)(s.K5,{})]})})})})})}),(0,i.jsx)(x,{isOpen:z.model,handleCloseModal:()=>ee(e=>({...e,model:!1})),items:_,selectedItem:null==S?void 0:S.model,title:X("models"),bindingKey:"ar"===W?"modelAr":"modelEn",bindingValue:"ar"===W?"modelAr":"modelEn",onChange:e=>{I({...S,model:e||void 0}),(0,N.bc)(b.aO.modelSelected,{From:"Mobile Filters",selection:e}),en({model:e,brand:S.brand,year:null}),ee(e=>({...e,model:!1}))},searchable:!0})]}):"",(0,i.jsxs)(w.jw,{className:"md:!hidden",children:[(0,i.jsx)("div",{className:"filter-item",children:(0,i.jsx)("div",{className:"dropdown-main dropdown-ui",children:(0,i.jsx)("div",{className:"dropdown-wrapper",children:(0,i.jsx)("div",{className:"cs-dropdown-head",children:(0,i.jsx)("button",{type:"button",onClick:()=>ee(e=>({...e,year:!0})),children:(0,i.jsxs)("span",{className:"".concat((null==S?void 0:S.year)&&(null==S?void 0:S.year)!=="all"?"active":""),children:[X("year")," ",(0,i.jsx)(s.K5,{})]})})})})})}),(0,i.jsx)(x,{isOpen:z.year,handleCloseModal:()=>ee(e=>({...e,year:!1})),items:T,selectedItem:null==S?void 0:S.year,title:X("year"),bindingKey:"year",bindingValue:"year",onChange:e=>{I({...S,year:e||void 0}),(0,N.bc)(b.aO.yearSelected,{From:"Mobile Filters",selection:e}),en({year:e,brand:S.brand,model:S.model}),ee(e=>({...e,year:!1}))},searchable:!0})]})]}):"",U.map((e,l)=>{var a,n;return(0,i.jsx)(w.jw,{children:(0,i.jsx)(g.rU,{href:{pathname:(0,j.DW)(F,{...S,tagId:(null==S?void 0:S.tagId)===(null==e?void 0:e.id)?void 0:null==e?void 0:e.id}),query:{...(null==S?void 0:S.sortBy)&&{sortBy:null==S?void 0:S.sortBy},...(null==S?void 0:S.sortByOrder)&&{sortByOrder:null==S?void 0:S.sortByOrder},vehicleType:(null==S?void 0:S.vehicleType)===(null==e?void 0:null===(a=e.nameEn)||void 0===a?void 0:a.toLowerCase())?void 0:null==e?void 0:null===(n=e.nameEn)||void 0===n?void 0:n.toLowerCase()}},onClick:()=>{(0,N.bc)(b.aO.tagSelected,{isSelected:(null==S?void 0:S.tagId)!==(null==e?void 0:e.id),name:null==e?void 0:e.nameEn,id:null==e?void 0:e.id})},children:(0,i.jsx)(r.E.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:[.04,.62,.23,.98]},className:(null==S?void 0:S.tagId)===e.id?"active":"",children:"ar"===W?e.nameAr:e.nameEn})},"tag-".concat(l))},l)})]})})]}),(0,i.jsx)("div",{className:"filter-list filter-item-mob"}),(0,i.jsx)("div",{className:"filter-right",children:(0,i.jsx)("div",{className:"filter-btns",children:!el&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{className:"btn btn-filter ".concat((null==S?void 0:S.search)==="advance"?"active":""),onClick:()=>M(!0),children:[(0,i.jsx)(s.wn,{}),(0,i.jsx)("span",{children:X("filter")})]}),(0,i.jsxs)("button",{onClick:()=>{I({}),P("default"),V.push(b.UF.EXPLORE)},className:"btn btn-filter ".concat(Object.keys(null!=S?S:{}).filter(e=>"search"!==e).every(e=>!S[e])?"enabled":""," disabled:opacity-50 disabled:pointer-events-none"),disabled:Object.keys(null!=S?S:{}).filter(e=>"search"!==e).every(e=>!S[e]),children:[(0,i.jsx)(s.x8,{}),(0,i.jsx)("span",{children:X("clear")})]})]})})})]})})}),R&&(0,i.jsx)(C,{isOpen:R,setIsOpen:M,brands:O,filters:S,setFilters:I})]})},I=a(2226),T=a(1277),U=a(2649),B=a(998),V=a(3580),Z=()=>{var e,l;let n=(0,g.jD)(),d=(0,g.tv)(),o=(0,u.useTranslations)("Index"),[r,c]=(0,v.useState)(void 0),[m,h]=(0,v.useState)([{id:"login",name:o("logIn")}]);(0,v.useEffect)(()=>(window.addEventListener("userChanged",f),()=>{window.removeEventListener("userChanged",f)}),[]),(0,v.useEffect)(()=>{var e;(null===(e=a.g)||void 0===e?void 0:e.window)!==void 0&&(window.history.scrollRestoration="auto"),f()},[]);let p=()=>{let e=new URLSearchParams({redirectTo:n}).toString(),l="".concat(b.UF.LOGIN,"?").concat(n!==b.UF.LOGIN?e:"");d.push(l)},x=async()=>{await (0,B.signOut)({redirect:!1}),U.Z.remove("token",b.Ci),U.Z.remove("refreshToken",b.Ci),U.Z.remove("userDetails",b.Ci),f(),V.Am.success(o("logOutSuccess")),d.push(b.UF.LOGIN)},j=e=>{"logOut"===e?x():"login"===e||"signup"===e?p():"profile"===e?d.push(b.UF.PROFILE):"favorites"===e?d.push(b.UF.FAVORITES):"myRequest"===e?d.push(b.UF.MY_REQUESTS):"notifications"===e&&d.push(b.UF.NOTIFICATIONS)},f=async()=>{c(U.Z.get("userDetails")?JSON.parse(U.Z.get("userDetails")):null),U.Z.get("token")?h(e=>[{id:"profile",name:o("profile")},{id:"favorites",name:o("favorites")},{id:"myRequest",name:o("myRequests")},{id:"notifications",name:o("notifications")},{id:"logOut",name:o("logOut"),class:"log-out"}]):h(e=>[{id:"login",name:o("logIn")}])};return(0,i.jsx)("div",{className:"user-info",children:(0,i.jsx)(t.Z,{items:m,userDetails:r,bindingKey:"name",bindingValue:"id",onChange:e=>{j(e)},data:(0,i.jsxs)("figure",{children:[(0,i.jsx)(s.pr,{}),r?(0,i.jsx)("span",{className:"user-initial",children:null==r?void 0:null===(l=r.fullName)||void 0===l?void 0:null===(e=l.substr(0,2))||void 0===e?void 0:e.toUpperCase()}):(0,i.jsx)(s.BO,{})]})})})},P=a(5236),R=a(7175);let M=(0,P.C6)().length?(0,P.Mq)():(0,P.ZF)({apiKey:"AIzaSyBUUCwYCnZO0KZBQ5r9X3rX30V_I_krZJA",authDomain:"topcarkw-2db74.firebaseapp.com",databaseURL:"https://topcarkw-2db74.firebaseio.com",projectId:"topcarkw-2db74",storageBucket:"topcarkw-2db74.appspot.com",messagingSenderId:"436432849503",appId:"1:436432849503:web:4e9f37a063136fb444a9ea",measurementId:"G-X70X1YSY9N"});n=(0,R.IH)(M);var D=a(7870),K=e=>{let{pathname:l}=e,a=(0,u.useTranslations)("Index");return l.includes(b.UF.CARS)||l.includes(b.UF.SHOWROOM_DETAIL)||l.includes(b.UF.OFFICE_DETAIL)?null:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"mob-nav",children:(0,i.jsx)("ul",{children:f.V1.map((e,n)=>(0,i.jsx)("li",{className:l.includes(e.link)?"active":"",children:(0,i.jsxs)(g.rU,{href:e.link,children:[e.icon(),a("".concat(e.langLabel))]})},"main-menu-".concat(e.label,"-").concat(n)))})})})},X=e=>{var l;let{brands:d,assets:o,headerButtonAction:r,env:c}=e,m=(0,v.useRef)(null),h=(0,g.jD)(),p=(0,k.useSearchParams)(),[x,y]=(0,v.useState)(),w=(0,g.tv)(),[L,O]=(0,v.useState)(),C=(0,u.useLocale)(),[A,B]=(0,v.useState)(C),V=(0,u.useTranslations)("Index"),[P,R]=(0,v.useState)(!1),[M,X]=(0,v.useState)({appLink:"",appDeepLink:""}),[W,_]=(0,v.useState)(!1);(null===(l=a.g)||void 0===l?void 0:l.window)!==void 0&&(window.history.scrollRestoration="auto"),(0,v.useEffect)(()=>{let e=e=>{let l=e.target.closest(".mpt-click");if(l){let e=null==l?void 0:l.getAttribute("mpt-action"),a=null==l?void 0:l.getAttribute("mpt-properties"),n=a?JSON.parse(a):{};void 0===window||b.PP||(e===b.aO.downloadApp?(window.gtag("event","conversion",{send_to:"AW-10937401820/irHjCITggckZENyDrt8o",...n}),null==D||D.event(b.aO.downloadApp,n)):e===b.aO.adCallTapped?null==D||D.event(b.aO.adCallTapped,n):e===b.aO.adWhatsAppTapped&&(null==D||D.event(b.aO.adWhatsAppTapped,n))),(0,N.bc)(e,n)}};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[]),(0,v.useEffect)(()=>{n&&console.log("firebase analytics initialized")},[]),(0,v.useEffect)(()=>{U.Z.set("filters",JSON.stringify(L||{}),b.Ci)},[L]),(0,v.useEffect)(()=>{var e,l,a,n,i,s;b.Fd.some(e=>h.includes(e))?null===(e=m.current)||void 0===e||e.classList.add("cars-detail-page"):null===(l=m.current)||void 0===l||l.classList.remove("cars-detail-page"),[b.UF.LOGIN].includes(h)?null===(a=m.current)||void 0===a||a.classList.add("inner-page-header"):null===(n=m.current)||void 0===n||n.classList.remove("inner-page-header"),f.WA.map(e=>e.link).includes(h)||h.includes(b.UF.EXPLORE)?null===(s=m.current)||void 0===s||s.classList.remove("inner-header-view"):null===(i=m.current)||void 0===i||i.classList.add("inner-header-view")},[h]),(0,v.useEffect)(()=>{let e;let l=()=>{var l,a;clearTimeout(e),window.scrollY>0?null===(l=m.current)||void 0===l||l.classList.add("scroll-active"):null===(a=m.current)||void 0===a||a.classList.remove("scroll-active")},a=()=>{R(!1)};return window.addEventListener("scroll",l),window.addEventListener("popstate",a),()=>{window.removeEventListener("scroll",l),window.removeEventListener("popstate",a),clearTimeout(e)}},[]),(0,v.useEffect)(()=>{var e;let l=(null==h?void 0:h.includes(b.$t.showrooms))||(null==h?void 0:h.includes(b.$t.offices))?[]:h.split("/"),a=(0,j.Kb)(l.slice(2));y((null==d?void 0:null===(e=d.find(e=>(null==e?void 0:e["ar"===C?"nameAr":"nameEn"])===decodeURI(null==a?void 0:a.brand)))||void 0===e?void 0:e.carModels)||[]);let n=null==h?void 0:h.includes("grid"),i=null==h?void 0:h.includes("list");if((n||i)&&(a.view=n?"grid":"list"),p.get("sortBy")&&p.get("sortByOrder")?(a.sortBy=p.get("sortBy"),a.sortByOrder=p.get("sortByOrder"),a.sortByValue="".concat(p.get("sortBy"),"-").concat(p.get("sortByOrder"))):(a.sortBy=void 0,a.sortByOrder=void 0,a.sortByValue=void 0),a.vehicleType=void 0,p.get("vehicleType")){let e=p.get("vehicleType");e&&(a.vehicleType=e)}h.includes(b.UF.EXPLORE)&&O(e=>({...e,...a}))},[h,p,d]);let H=()=>{var e,l,a,n;let s={vip:b.UF.VIP_SERVICES,sellNow:b.UF.SELL_NOW,valuation:b.UF.VALUATION,postAd:b.UF.POST_AN_AD},d={vip:b.aO.VIPTap,sellNow:b.aO.sellNowTap,valuation:b.aO.valuationTap,postAd:b.aO.postAdTap},o=e=>{let l=U.Z.get("variant");(0,N.bc)(d[e],{From:b.aO.actionButtons,Design:l})};return(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{onClick:()=>{var e;o(null==r?void 0:null===(e=r.leading)||void 0===e?void 0:e.action)},children:(0,i.jsx)(g.rU,{href:s[null==r?void 0:null===(e=r.leading)||void 0===e?void 0:e.action],children:null==r?void 0:null===(l=r.leading)||void 0===l?void 0:l.text})},"leading-action"),(0,i.jsx)("li",{onClick:()=>{var e;o(null==r?void 0:null===(e=r.trailing)||void 0===e?void 0:e.action)},children:(0,i.jsx)(g.rU,{href:s[null==r?void 0:null===(a=r.trailing)||void 0===a?void 0:a.action],children:null==r?void 0:null===(n=r.trailing)||void 0===n?void 0:n.text})},"trailing-action")]})},$=()=>(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(t.Z,{items:[{id:"en",name:"English (EN)"},{id:"ar",name:"عربي (AR)"}],bindingKey:"name",bindingValue:"id",onChange:e=>{void 0!==location&&(h.includes(b.UF.EXPLORE)?(location.href="/".concat(e).concat(b.UF.EXPLORE),w.push(b.UF.EXPLORE,{locale:e})):(location.href="/".concat(e,"/").concat(h,"?").concat(new URLSearchParams(p).toString()),w.push(h,{locale:e}))),B(e)},selectedItem:A,data:(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"language-dropdown",children:[(0,i.jsx)("figure",{children:(0,i.jsx)(s.SQ,{})}),(0,i.jsxs)("div",{className:"language-head",children:[(0,i.jsx)("span",{children:A.toLocaleUpperCase()}),(0,i.jsx)(s.K5,{})]})]})})})}),q=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(F.Z,{register:()=>{},selectedItem:null==L?void 0:L.brand,label:V("brands"),items:d,fieldName:"brands",bindingKey:"ar"===C?"nameAr":"nameEn",bindingValue:"ar"===C?"nameAr":"nameEn",placeholder:V("selectBrand"),setValue:(e,l)=>{var a;O({...L,brand:null==l?void 0:l.replaceAll("&","amp"),model:void 0}),(0,N.bc)(b.aO.brandSelected,{From:"Headers Filters",selection:l}),y((null==d?void 0:null===(a=d.find(e=>(null==e?void 0:e["ar"===C?"nameAr":"nameEn"])===l))||void 0===a?void 0:a.carModels)||[]),Y({...L,brand:null==l?void 0:l.replaceAll("&","amp"),model:void 0})},searchable:!0}),(0,i.jsx)(F.Z,{register:()=>{},selectedItem:null==L?void 0:L.model,label:V("models"),items:x,fieldName:"models",bindingKey:"ar"===C?"modelAr":"modelEn",bindingValue:"ar"===C?"modelAr":"modelEn",placeholder:V("selectModel"),setValue:(e,l)=>{O({...L,model:null==l?void 0:l.replaceAll("&","amp")}),(0,N.bc)(b.aO.modelSelected,{From:"Headers Filters",selection:l}),Y({...L,model:null==l?void 0:l.replaceAll("&","amp")})},searchable:!0,disabled:!(null==x?void 0:x.length)}),(0,i.jsx)(F.Z,{register:()=>{},selectedItem:null==L?void 0:L.condition,label:V("carConditions"),items:[{name:V("certified"),slug:"certified"},{name:V("used"),slug:"used"},{name:V("new"),slug:"new"}],fieldName:"condition",bindingKey:"name",bindingValue:"slug",placeholder:V("selectCondition"),setValue:(e,l)=>{O({...L,condition:l}),Y({...L,condition:l})}}),(0,i.jsx)(F.Z,{register:()=>{},selectedItem:null==L?void 0:L.year,label:V("years"),items:null==o?void 0:o.years,fieldName:"year",bindingKey:"year",bindingValue:"year",placeholder:V("selectYear"),setValue:(e,l)=>{O({...L,year:l}),(0,N.bc)(b.aO.yearSelected,{From:"Headers Filters",selection:l}),Y({...L,year:l})},searchable:!0})]}),Y=e=>{var l;null===(l=m.current)||void 0===l||l.classList.remove("search-filter-sticky-active");let a=(0,j.DW)((null==e?void 0:e.condition)?"/explore/".concat("used"===e.condition?b.$t.used:"new"===e.condition?b.$t.new:b.$t.featured):h,e||L),n="";(null==L?void 0:L.sortBy)&&L.sortByOrder&&(n+="".concat((0,E.stringify)({sortBy:null==L?void 0:L.sortBy}),"&")+"".concat((0,E.stringify)({sortByOrder:null==L?void 0:L.sortByOrder}),"&"));let i=a+((n=n.length?n.slice(0,-1):n).length?"?".concat(n):"");w.push(i)},G=()=>{let e=U.Z.get("hideWidget");(!e||Date.now()-+e>12e4)&&_(!0)};return(0,v.useEffect)(()=>{let e=navigator.userAgent||window.opera,l={appLink:"",appDeepLink:""};/android/i.test(e)?l={appLink:"https://play.google.com/store/apps/details?id=com.trend.topcar",appDeepLink:"com.topcar.app"}:/iPad|iPhone|iPod/.test(e)&&!window.MSStream&&(l={appLink:"https://apps.apple.com/us/app/oogoo/id1530900437",appDeepLink:"com.googleusercontent.apps.436432849503-43lu7rk4tqko1v7tt6evsqo24nqkqge5://"}),X(l),G()},[h]),(0,i.jsxs)(i.Fragment,{children:[W&&M.appLink?(0,i.jsxs)("div",{className:"app-widget",children:[(0,i.jsx)("button",{type:"button",className:"dismiss",onClick:()=>{_(!1),U.Z.set("hideWidget",JSON.stringify(Date.now()),b.Ci)},children:"\xd7"}),(0,i.jsx)("div",{className:"logo-app",children:(0,i.jsx)(s.TR,{})}),(0,i.jsxs)("div",{className:"app-install-banner-content",children:[(0,i.jsx)("h5",{children:V("getTheApp")}),(0,i.jsx)("p",{children:V("easiestWayToExplore")})]}),(0,i.jsx)("a",{onClick:()=>{let e=Date.now(),l=navigator.userAgent||window.opera,a=/iPad|iPhone|iPod/.test(l)&&!window.MSStream,n=/android/i.test(l),i=a?"ios":n?"android":"";(0,N.bc)(b.aO.downloadApp,{from:"Header",triggered:i}),null==D||D.event(b.aO.downloadApp,{from:"Header",triggered:i}),M.appDeepLink&&(window.location.href=M.appDeepLink),document.addEventListener("visibilitychange",function l(){!document.hidden&&Date.now()-e<2e3&&(window.location.href=M.appLink),document.removeEventListener("visibilitychange",l)}),setTimeout(()=>{document.hidden||(window.location.href=M.appLink)},2e3)},children:V("useApp")})]}):"",(0,i.jsx)(K,{pathname:h}),(0,i.jsx)("div",{className:"mob-filers hidden",children:(0,i.jsx)(q,{})}),(0,i.jsx)("header",{ref:m,className:"header-wrap",children:(0,i.jsx)("div",{className:"header-inner-md",children:(0,i.jsxs)("div",{className:"container-main",children:[(0,i.jsxs)("div",{className:"header-sm-mob md:hidden",children:[(0,i.jsx)("button",{className:"search-btn",onClick:()=>R(!0),children:(0,i.jsx)(s.HN,{})}),(0,i.jsx)(H,{}),(0,i.jsx)("div",{className:"head-language head-language-mob",children:(0,i.jsx)($,{})})]}),(0,i.jsxs)("div",{className:"header-main max-md:hidden",children:[(0,i.jsx)(()=>(0,i.jsx)("div",{className:"logo-main",children:(0,i.jsx)(g.rU,{className:h===b.UF.EXPLORE?"pointer-events-none":"",href:b.UF.EXPLORE,onClick:()=>{var e;return null===(e=m.current)||void 0===e?void 0:e.classList.remove("search-filter-sticky-active")},children:(0,i.jsx)(s.TR,{})})}),{}),h===b.UF.LOGIN?null:(0,i.jsxs)("div",{className:"mid-header",children:[(0,i.jsx)("nav",{id:"navbar-default",className:"navigation-main",children:(0,i.jsx)("ul",{children:f.cy.map((e,l)=>(0,i.jsx)("li",{children:(0,i.jsxs)(g.rU,{href:e.link,className:"".concat(h.includes(e.link)?"active":""," mpt-click"),"mpt-action":b.aO.mainTabBarItemSelected,"mpt-properties":JSON.stringify({index:e.link}),onClick:e=>{var l;e.stopPropagation(),null===(l=m.current)||void 0===l||l.classList.remove("search-filter-sticky-active")},children:[e.icon(),V("".concat(e.langLabel))]})},"main-menu-".concat(e.label,"-").concat(l)))})}),f.WA.map(e=>e.link).includes(h)||h.includes(b.UF.EXPLORE)?(0,i.jsxs)("div",{className:"search-main sm-search-bar",children:[b.os.map((e,l)=>(0,i.jsx)("div",{className:"dropdown-main",children:(0,i.jsx)("div",{className:"dropdown-wrapper",children:(0,i.jsx)("div",{className:"dropdown-head",children:(0,i.jsx)("button",{onClick:()=>{var e;return null===(e=m.current)||void 0===e?void 0:e.classList.toggle("search-filter-sticky-active")},children:(0,i.jsx)("label",{children:V("".concat(e.langLabel))})})})})},e.label+l)),(0,i.jsx)("button",{name:"search",className:"search-btn",onClick:()=>R(!0),children:(0,i.jsx)(s.HN,{})})]}):""]}),(0,i.jsxs)("div",{className:"head-user-info",children:[b.PP?(0,i.jsx)("div",{className:"content toggle-env",children:(0,i.jsx)(I.default,{size:"lg",env:c})}):null,(0,i.jsx)("div",{className:"head-ad-block",children:(0,i.jsx)(H,{})}),(0,i.jsx)("div",{className:"head-language",children:(0,i.jsx)($,{})}),(0,i.jsx)(Z,{})]})]}),(f.WA.map(e=>e.link).includes(h)||h.includes(b.UF.EXPLORE))&&(0,i.jsxs)("div",{className:"search-main lg-search-bar",children:[(0,i.jsx)(q,{}),(0,i.jsx)("button",{className:"search-btn",name:"search",onClick:()=>R(!0),children:(0,i.jsx)(s.HN,{})})]})]})})}),(0,i.jsx)("div",{className:"backdrop-search-filter",onClick:()=>{var e;return null===(e=m.current)||void 0===e?void 0:e.classList.remove("search-filter-sticky-active")}}),(f.WA.map(e=>e.link).includes(h)||h.includes(b.UF.EXPLORE))&&(0,i.jsx)(S,{pathname:h,filters:L,setFilters:O,brands:d,assetsYears:null==o?void 0:o.years}),(0,i.jsx)(T.Z,{showSearchModal:P,setShowSearchModal:R,translate:V,brands:d,localActive:C})]})}},2837:function(e,l,a){var n=a(7437),i=a(5127),s=a(6765),d=a(8087),o=a(2265);l.Z=e=>{let{selectedItem:l,items:a,onChange:t,bindingKey:r,bindingValue:c,disabled:u=!1,noRecordMessage:m="noRecordFound",data:v,userDetails:h,className:p}=e,[x,g]=(0,o.useState)(!1),j=(0,o.useRef)(null),b=(0,d.useTranslations)("Index"),f=(e,l)=>{e.stopPropagation(),null==t||t(l["".concat(c)]),g(!1)},y=e=>{j.current&&!j.current.contains(e.target)&&g(!1)};(0,o.useEffect)(()=>(document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}),[x]);let N={hidden:{opacity:0},visible:{opacity:1}};return(0,n.jsx)("div",{className:"dropdown-main dropdown-ui",children:(0,n.jsxs)("div",{ref:j,className:"dropdown-wrapper",children:[(0,n.jsx)("div",{className:"cs-dropdown-head",children:(0,n.jsx)("button",{type:"button",onClick:()=>{j.current&&g(!x)},disabled:u,children:v})}),(0,n.jsx)(i.M,{children:x&&(0,n.jsxs)(s.E.div,{className:"dropdown-body",initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3,ease:[.04,.62,.23,.98]},children:[(null==h?void 0:h.fullName)&&(0,n.jsx)("h2",{className:"user-name",children:null==h?void 0:h.fullName}),(0,n.jsx)(s.E.ul,{initial:"hidden",animate:"visible",exit:"hidden",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.03}}},children:(null==a?void 0:a.length)>0?null==a?void 0:a.map(e=>(0,n.jsx)(s.E.li,{variants:N,title:e["".concat(r)],onClick:l=>{f(l,e)},className:"".concat(l===e["".concat(c)]?"active":""," ").concat((null==e?void 0:e.class)||""),children:(0,n.jsx)("p",{className:"item",onClick:l=>f(l,e),children:e["".concat(r)]})},"".concat(e["".concat(r)],"-").concat(e["".concat(c)],"-").concat(Math.random()))):(0,n.jsx)("li",{className:"no-item",children:b("".concat(m))},"no-record")})]})})]})})}},2226:function(e,l,a){var n=a(7437),i=a(5115),s=a(1670),d=a(6138),o=a(2649),t=a(2265);l.default=e=>{let{title:l,size:a="md",env:r="prod"}=e,[c,u]=(0,t.useState)("prod"===r),m=(0,s.tv)(),v=async e=>{if(o.Z.set("env",e?"prod":"dev",d.Ci),(0,i.d8)("env",e?"prod":"dev"),u(e),o.Z.remove("token",d.Ci),o.Z.remove("refreshToken",d.Ci),o.Z.remove("userDetails",d.Ci),void 0!==window){let e=new CustomEvent("userChanged",{detail:void 0});window.dispatchEvent(e)}m.push(d.UF.EXPLORE)};return(0,n.jsx)("div",{className:"toggle-switch ".concat({sm:"sm",md:"md",lg:"lg"}[a]),children:(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",onChange:e=>v(e.target.checked),checked:c,className:"peer"}),(0,n.jsxs)("div",{className:"toggle-btn peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-yellow/30 peer peer-checked:after:translate-x-[38px] rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] peer-checked:bg-yellow",children:[(0,n.jsx)("small",{className:"first",children:"Prod"}),(0,n.jsx)("small",{className:"last",children:"Dev"})]}),l&&(0,n.jsx)("span",{className:"title",children:l})]})})}},7870:function(e,l,a){a.r(l),a.d(l,{FB_PIXEL_ID:function(){return n},event:function(){return s},pageview:function(){return i}});let n="EAAOfEWVOpicBO2UxOliA1rCaf6hqYbZBjNjVZBU78FwM4TyvWXwFIfxRqQkZALk6yFIAV99Bh9VhgspAYbcqKy0w8zgUnnJozmVqjrQD4vKp1G0rjFlfgkr3VY7BfVVkvVZAAFX5E4ZBZBt2gwvCDoM4s9IVlRLH3eZAFjGlAHNxuVSZA6kQc0vHljSzLqcOZAJDMjQZDZD",i=()=>{window.fbq("track","PageView")},s=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};window.fbq("track",e,l)}},7367:function(e,l,a){a.d(l,{KT:function(){return r},V1:function(){return t},WA:function(){return d},cy:function(){return o},k3:function(){return u},rl:function(){return c}});var n=a(7437),i=a(6105),s=a(6138);let d=[{langLabel:"featured",label:"Featured",link:"".concat(s.UF.EXPLORE,"/").concat(s.$t.featured),icon:()=>(0,n.jsx)(i.g4,{})},{langLabel:"used",label:"Used",link:"".concat(s.UF.EXPLORE,"/").concat(s.$t.used),icon:()=>(0,n.jsx)(i.AK,{})},{langLabel:"new",label:"New",link:"".concat(s.UF.EXPLORE,"/").concat(s.$t.new),icon:()=>(0,n.jsx)(i.Hf,{})},{langLabel:"showrooms",label:"Showrooms",link:"".concat(s.UF.EXPLORE,"/").concat(s.$t.showrooms),icon:()=>(0,n.jsx)(i.y5,{})},{langLabel:"offices",label:"Offices",link:"".concat(s.UF.EXPLORE,"/").concat(s.$t.offices),icon:()=>(0,n.jsx)(i.lk,{})}],o=[{langLabel:"explore",label:"Explore",link:s.UF.EXPLORE,icon:()=>(0,n.jsx)(i.r3,{})},{langLabel:"valuation",label:"Valuation",link:s.UF.VALUATION,icon:()=>(0,n.jsx)(i.x0,{})},{langLabel:"services",label:"Services",link:s.UF.SERVICES,icon:()=>(0,n.jsx)(i.K9,{})},{langLabel:"myGarage",label:"My Garage",link:s.UF.MY_GARAGE,icon:()=>(0,n.jsx)(i.Bm,{})}],t=[...o,{langLabel:"profile",label:"Profile",link:s.UF.PROFILE,icon:()=>(0,n.jsx)(i.n5,{})}],r=[{label:"Facebook",link:"https://www.facebook.com/OogooCar-100153088915837",icon:()=>(0,n.jsx)(i.s1,{})},{label:"Twitter",link:"https://twitter.com/oogoocar",icon:()=>(0,n.jsx)(i.tL,{})},{label:"Instagram",link:"https://www.instagram.com/oogoocar/",icon:()=>(0,n.jsx)(i.mr,{})},{label:"WhatsApp",link:"https://wa.me/+96598042229",icon:()=>(0,n.jsx)(i.CD,{})}],c=[{langLabel:"aboutOogoo",label:"About Oogoo",link:s.UF.ABOUT_US},{langLabel:"contactUs",label:"Contact Us",link:s.UF.CONTACT_US},{langLabel:"faqs",label:"FAQs",link:s.UF.FAQ},{langLabel:"termsConditions",label:"Terms & Conditions",link:s.UF.TERMS_AND_CONDITION}],u=[{id:0,icon:null,label:"All",langLabel:"all"},{id:1,icon:(0,n.jsx)(i.Dd,{}),label:"Sedan",langLabel:"sedan"},{id:2,icon:(0,n.jsx)(i.Gy,{}),label:"Roadster",langLabel:"roadster"},{id:3,icon:(0,n.jsx)(i.Ij,{}),label:"Coupe",langLabel:"coupe"},{id:4,icon:(0,n.jsx)(i.Cl,{}),label:"Supercar",langLabel:"supercar"},{id:5,icon:(0,n.jsx)(i.Hv,{}),label:"Cabriolet",langLabel:"cabriolet"}]}}]);