PageSourceSearch

https://www.topii.com/_next/static/chunks/7284-fef0deb2e17c9a0f.js

js topii.com collected 2026-10-02 00:08:35 UTC 22,956 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7284],{16627:e=>{e.exports={sidebar:"Sidebar_sidebar__Lt7dP",sidebar__empty:"Sidebar_sidebar__empty__Ncdqe",card:"Sidebar_card__x_0be",card__logo:"Sidebar_card__logo___Zzmo",card__meta:"Sidebar_card__meta__gGWdk",card__brand:"Sidebar_card__brand__P_jO3",card__tipologia:"Sidebar_card__tipologia__C_T9C",card__distance:"Sidebar_card__distance__dVOBY"}},17433:(e,a,t)=>{"use strict";t.d(a,{n:()=>n});let l={"a coruna":"A Coru\xf1a",almeria:"Almer\xeda",avila:"\xc1vila",badajoz:"Badajoz",caceres:"C\xe1ceres",cadiz:"C\xe1diz",cantabria:"Cantabria",castello:"Castell\xf3",cordoba:"C\xf3rdoba",gijon:"Gij\xf3n",jaen:"Ja\xe9n",leon:"Le\xf3n",lerida:"L\xe9rida",logrono:"Logro\xf1o",malaga:"M\xe1laga",mostoles:"M\xf3stoles",palencia:"Palencia",asturias:"Asturias",salamanca:"Salamanca",segovia:"Segovia",soria:"Soria",tenerife:"Tenerife",caracas:"Caracas"},r={al:"Alabama",ak:"Alaska",az:"Arizona",ar:"Arkansas",ca:"California",co:"Colorado",ct:"Connecticut",de:"Delaware",fl:"Florida",ga:"Georgia",hi:"Hawaii",id:"Idaho",il:"Illinois",in:"Indiana",ia:"Iowa",ks:"Kansas",ky:"Kentucky",la:"Louisiana",me:"Maine",md:"Maryland",ma:"Massachusetts",mi:"Michigan",mn:"Minnesota",ms:"Mississippi",mo:"Missouri",mt:"Montana",ne:"Nebraska",nv:"Nevada",nh:"New Hampshire",nj:"New Jersey",nm:"New Mexico",ny:"New York",nc:"North Carolina",nd:"North Dakota",oh:"Ohio",ok:"Oklahoma",or:"Oregon",pa:"Pennsylvania",ri:"Rhode Island",sc:"South Carolina",sd:"South Dakota",tn:"Tennessee",tx:"Texas",ut:"Utah",vt:"Vermont",va:"Virginia",wa:"Washington",wv:"West Virginia",wi:"Wisconsin",wy:"Wyoming",dc:"District of Columbia"},o=new Set(["de","del","la","las","los","el","y","da","do"]);function n(e){if(!e)return"";let a=e.toLowerCase().trim();return 2===a.length&&r[a]?r[a]:l[a]?l[a]:a.split(/\s+/).map((e,a)=>l[e]?l[e]:a>0&&o.has(e)?e:e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}},60080:(e,a,t)=>{"use strict";t.d(a,{UA:()=>n,Wr:()=>o,Xi:()=>r,sx:()=>l});let l=(e,a)=>{window.gtag&&window.gtag("event",e,a)},r=e=>{l("app_download_click",{platform:e.platform,source:e.source||"website"})},o=e=>{l("generate_lead",{form_name:e.form_name,form_location:e.form_location||""})},n=e=>{l("cta_click",{cta_name:e.cta_name,cta_location:e.cta_location||"",cta_text:e.cta_text||""})}},67119:e=>{e.exports={filtersBar:"Filters_filtersBar__Q_1py",filter:"Filters_filter__fepK3",filter__label:"Filters_filter__label__J7QJD",filter__select:"Filters_filter__select__jIq_b",filter__input:"Filters_filter__input__ZavJO",clearBtn:"Filters_clearBtn__kvXB6"}},69421:e=>{e.exports={layout:"MapClient_layout__n9drp",layoutEmbedded:"MapClient_layoutEmbedded__Nv5Kh",filters:"MapClient_filters__73f9z",mapArea:"MapClient_mapArea__4_6go",sidebarPanel:"MapClient_sidebarPanel__y9toA",overlay:"MapClient_overlay__nlorQ",retryButton:"MapClient_retryButton__artoA",sidebarHandle:"MapClient_sidebarHandle__lVDgc"}},77284:(e,a,t)=>{"use strict";t.d(a,{default:()=>U});var l=t(95155),r=t(18955),o=t(20063),n=t(67909),i=t(12115),s=t(60080),c=t(52619),u=t.n(c),d=t(91840),m=t.n(d);function _(e){let{homeHref:a}=e,t=(0,r.c)("MapV3.errors.featureDisabled");return(0,l.jsxs)("section",{className:m().featureDisabled,children:[(0,l.jsx)("h1",{className:m().featureDisabled__title,children:t("title")}),(0,l.jsx)("p",{className:m().featureDisabled__subtitle,children:t("subtitle")}),(0,l.jsx)(u(),{href:a,className:m().featureDisabled__cta,children:t("cta")})]})}var p=t(67119),f=t.n(p);function b(e){let{onClick:a}=e,t=(0,r.c)("MapV3.actions")("clearFilters");return(0,l.jsx)("button",{type:"button",className:f().clearBtn,onClick:a,"aria-label":t,title:t,children:(0,l.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,l.jsx)("path",{d:"M3 6h18"}),(0,l.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),(0,l.jsx)("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,l.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,l.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})})}var h=t(17433);function v(e){let{options:a,value:t,onChange:o}=e,n=(0,r.c)("MapV3.filters.brand"),i=t[0]||"";return(0,l.jsxs)("label",{className:f().filter,children:[(0,l.jsx)("span",{className:f().filter__label,children:n("label")}),(0,l.jsxs)("select",{className:f().filter__select,value:i,onChange:e=>{let a=e.target.value;o(a?[a]:[])},children:[(0,l.jsx)("option",{value:"",children:n("all")}),a.map(e=>(0,l.jsx)("option",{value:e.value,children:(0,h.n)(e.value)},e.value))]})]})}
1function g(e){let{corridor:a,options:t,value:o,status:n,onChange:i}=e,s=(0,r.c)("MapV3.filters.city"),c=o[0]||"",u="us"===a,d=u?s("unavailableUs"):"disabled"===n||"idle"===n?s("disabled"):"";return(0,l.jsxs)("label",{className:f().filter,title:d,children:[(0,l.jsx)("span",{className:f().filter__label,children:s("label")}),(0,l.jsxs)("select",{className:f().filter__select,value:c,onChange:e=>{let a=e.target.value;i(a?[a]:[])},disabled:u||"idle"===n||"disabled"===n||"loading"===n,children:[(0,l.jsx)("option",{value:"",children:s("all")}),t.map(e=>(0,l.jsx)("option",{value:e.value,children:(0,h.n)(e.value)},e.value))]})]})}function z(e){let{value:a,onChange:t}=e,o=(0,r.c)("MapV3.filters.postalCode"),[n,s]=(0,i.useState)(a);return(0,i.useEffect)(()=>{s(a)},[a]),(0,l.jsxs)("label",{className:f().filter,children:[(0,l.jsx)("span",{className:f().filter__label,children:o("label")}),(0,l.jsx)("input",{type:"text",inputMode:"numeric",className:f().filter__input,placeholder:o("placeholder"),value:n,onChange:e=>{let a=e.target.value.replace(/\D/g,"").slice(0,5);s(a),(5===a.length||0===a.length)&&t(a)}})]})}
1function y(e){let{corridor:a,options:t,value:o,onChange:n}=e,i=(0,r.c)("eu"===a?"MapV3.filters.provinceEu":"MapV3.filters.provinceUs"),s=o[0]||"",c=t.filter(e=>""!==e.value.trim());return(0,l.jsxs)("label",{className:f().filter,children:[(0,l.jsx)("span",{className:f().filter__label,children:i("label")}),(0,l.jsxs)("select",{className:f().filter__select,value:s,onChange:e=>{let a=e.target.value;n(a?[a]:[])},children:[(0,l.jsx)("option",{value:"",children:i("all")}),c.map(e=>(0,l.jsx)("option",{value:e.value,children:(0,h.n)(e.value)},e.value))]})]})}function j(e){let{options:a,value:t,onChange:o}=e,n=(0,r.c)("MapV3.filters.tipologia"),i=t[0]||"";return(0,l.jsxs)("label",{className:f().filter,children:[(0,l.jsx)("span",{className:f().filter__label,children:n("label")}),(0,l.jsxs)("select",{className:f().filter__select,value:i,onChange:e=>{let a=e.target.value;o(a?[a]:[])},children:[(0,l.jsx)("option",{value:"",children:n("all")}),a.map(e=>(0,l.jsx)("option",{value:e.value,children:e.value},e.value))]})]})}function x(e){let{corri
1dor:a,filters:t,facets:r,cities:o,citiesStatus:n,onChange:i,onClear:s}=e;return(0,l.jsxs)("div",{className:f().filtersBar,children:[(0,l.jsx)(v,{options:r.brands,value:t.brand||[],onChange:e=>i({...t,brand:e})}),(0,l.jsx)(y,{corridor:a,options:r.provinces,value:t.province||[],onChange:e=>i({...t,province:e,city:[]})}),(0,l.jsx)(g,{corridor:a,options:o,value:t.city||[],status:n,onChange:e=>i({...t,city:e})}),(0,l.jsx)(z,{value:t.postalCode||"",onChange:e=>i({...t,postalCode:e})}),(0,l.jsx)(j,{options:r.tipologias,value:t.tipologia||[],onChange:e=>i({...t,tipologia:e})}),(0,l.jsx)(b,{onClick:s})]})}var C=t(15239),k=t(16627),N=t.n(k);function w(e){let{item:a,onClick:t}=e,o=(0,r.c)("MapV3.sidebar");return(0,l.jsxs)("button",{type:"button",className:N().card,onClick:()=>t(a.uuid),children:[(0,l.jsx)(C.default,{src:a.logo,alt:a.brandName,width:48,height:48,className:N().card__logo,unoptimized:!0}),(0,l.jsxs)("div",{className:N().card__meta,children:[(0,l.jsx)("div",{className:N().card__brand,children:(0,h.n)(a.brandName)}),(0,l.jsx)("div",{className:N().card__tipologia,children:a.tipologia})]}),(0,l.jsx)("div",{className:N().card__distance,children:o("distance",{km:a.distance.toFixed(1)})})]})}function M(e){let{items:a,onSelect:t}=e,o=(0,r.c)("MapV3.sidebar");return 0===a.length?(0,l.jsx)("div",{className:N().sidebar__empty,children:o("empty")}):(0,l.jsx)("ul",{className:N().sidebar,children:a.map(e=>(0,l.jsx)("li",{children:(0,l.jsx)(w,{item:e,onClick:t})},e.uuid))})}function S(e){return"eu"===e?"ES":"US"}let E={"a coruna":{lat:43,lon:-8.4,zoom:9},alava:{lat:42.85,lon:-2.67,zoom:10},albacete:{lat:38.99,lon:-1.86,zoom:9},alicante:{lat:38.35,lon:-.49,zoom:9},almeria:{lat:36.84,lon:-2.46,zoom:9},asturias:{lat:43.36,lon:-5.85,zoom:9},avila:{lat:40.66,lon:-4.69,zoom:9},badajoz:{lat:38.88,lon:-6.4,zoom:8},baleares:{lat:39.57,lon:2.95,zoom:9},"illes balears":{lat:39.57,lon:2.95,zoom:9},barcelona:{lat:41.55,lon:2,zoom:9},burgos:{lat:42.34,lon:-3.69,zoom:9},caceres:{lat:39.6,lon:-6,zoom:8},cadiz:{lat:36.53,lon:-6.3,zoom:9},cantabria:{lat:43.3,lon:-3.95,zoom:10},castellon:{lat:40,lon:-.04,zoom:9},castello:{lat:40,lon:-.04,zoom:9},"ciudad real":{lat:38.99,lon:-3.93,zoom:9},cordoba:{lat:37.89,lon:-4.78,zoom:9},cuenca:{lat:40.07,lon:-2.13,zoom:9},girona:{lat:42,lon:2.82,zoom:9},gerona:{lat:42,lon:2.82,zoom:9},granada:{lat:37.18,lon:-3.4,zoom:9},guadalajara:{lat:40.7,lon:-2.6,zoom:9},guipuzcoa:{lat:43.18,lon:-2.18,zoom:10},gipuzkoa:{lat:43.18,lon:-2.18,zoom:10},huelva:{lat:37.5,lon:-7,zoom:9},huesca:{lat:42.3,lon:-.1,zoom:9},jaen:{lat:37.95,lon:-3.5,zoom:9},"la rioja":{lat:42.28,lon:-2.54,zoom:10},rioja:{lat:42.28,lon:-2.54,zoom:10},"las palmas":{lat:28.12,lon:-15.43,zoom:9},leon:{lat:42.6,lon:-5.57,zoom:9},lerida:{lat:41.91,lon:1,zoom:9},lleida:{lat:41.91,lon:1,zoom:9},lugo:{lat:43,lon:-7.55,zoom:9},madrid:{lat:40.42,lon:-3.7,zoom:10},malaga:{lat:36.72,lon:-4.42,zoom:9},murcia:{lat:37.99,lon:-1.5,zoom:9},navarra:{lat:42.81,lon:-1.65,zoom:9},nafarroa:{lat:42.81,lon:-1.65,zoom:9},ourense:{lat:42.34,lon:-7.86,zoom:9},orense:{lat:42.34,lon:-7.86,zoom:9},palencia:{lat:42,lon:-4.5,zoom:9},pontevedra:{lat:42.43,lon:-8.65,zoom:9},salamanca:{lat:40.97,lon:-5.9,zoom:9},"santa cruz de tenerife":{lat:28.47,lon:-16.25,zoom:9},tenerife:{lat:28.47,lon:-16.25,zoom:9},segovia:{lat:40.95,lon:-4.12,zoom:9},sevilla:{lat:37.39,lon:-5.99,zoom:9},soria:{lat:41.76,lon:-2.46,zoom:9},tarragona:{lat:41.12,lon:1,zoom:9},teruel:{lat:40.5,lon:-.9,zoom:9},toledo:{lat:39.86,lon:-4.02,zoom:9},valencia:{lat:39.47,lon:-.5,zoom:9},valladolid:{lat:41.65,lon:-4.72,zoom:9},vizcaya:{lat:43.26,lon:-2.93,zoom:10},bizkaia:{lat:43.26,lon:-2.93,zoom:10},zamora:{lat:41.5,lon:-5.75,zoom:9},zaragoza:{lat:41.65,lon:-.88,zoom:9},cataluna:{lat:41.82,lon:1.7,zoom:7},catalunya:{lat:41.82,lon:1.7,zoom:7},andalucia:{lat:37.54,lon:-4.74,zoom:7},galicia:{lat:42.81,lon:-7.99,zoom:7},"pais vasco":{lat:43.04,lon:-2.61,zoom:8},euskadi:{lat:43.04,lon:-2.61,zoom:8},aragon:{lat:41.5,lon:-.92,zoom:7},"castilla y leon":{lat:41.66,lon:-4.72,zoom:7},"castilla-la mancha":{lat:39.59,lon:-3.07,zoom:7},"castilla la mancha":{lat:39.59,lon:-3.07,zoom:7},extremadura:{lat:39.5,lon:-6,zoom:7},canarias:{lat:28.3,lon:-16.46,zoom:7},"comunidad valenciana":{lat:39.5,lon:-.5,zoom:8},valenciana:{lat:39.5,lon:-.5,zoom:8},"comunidad de madrid":{lat:40.42,lon:-3.7,zoom:10},"principado de asturias":{lat:43.36,lon:-5.85,zoom:9},"region de murcia":{lat:37.99,lon:-1.5,zoom:9}};var D=t(69421),A=t.n(D);let R=(0,n.default)(()=>Promise.all([t.e(5779),t.e(974),t.e(2515)]).then(t.bind(t,42515)),{loadableGenerated:{webpack:()=>[42515]},ssr:!1}),L=(0,n.default)(()=>Promise.all([t.e(9282),t.e(3769)]).then(t.bind(t,13769)),{loadableGenerated:{webpack:()=>[13769]},ssr:!1}),T={lat:40.4168,lon:-3.7038};
1function U(e){let{corridor:a,homeHref:t,embedded:n=!1}=e,c=(0,r.c)("MapV3"),u=(0,o.useRouter)(),d=(0,o.useSearchParams)(),m=function(){let[e,a]=(0,i.useState)("light");return(0,i.useEffect)(()=>{let e=document.documentElement,t=()=>a("dark"===e.getAttribute("data-theme")?"dark":"light");t();let l=new MutationObserver(t);return l.observe(e,{attributes:!0,attributeFilter:["data-theme"]}),()=>l.disconnect()},[]),e}(),p="c1003bb6ba5bb408f00d3c5e",f=S(a),[b,h]=(0,i.useState)(()=>(function(e){let a=a=>{var t;return(null==(t=e.get(a))?void 0:t.split(",").filter(Boolean))||[]};return{brand:a("brand"),province:a("province"),city:a("city"),postalCode:e.get("postalCode")||"",tipologia:a("tipologia"),country:a("country")}})(new URLSearchParams(d.toString()))),[v,g]=(0,i.useState)(T),[z,y]=(0,i.useState)(13),[j,C]=(0,i.useState)(null),[k,N]=(0,i.useState)(null),[w,D]=(0,i.useState)(!1),[U,V]=(0,i.useState)(0),F=(0,i.useRef)(!1),[P,B]=(0,i.useState)(0),I=(0,i.useRef)(null),O=(0,i.useRef)(!1),H=(0,i.useRef)(Date.now()),W=function(e){let[a,t]=(0,i.useState)({facets:null,loading:!0,error:null});return(0,i.useEffect)(()=>{let a=new AbortController,l="eu"===e?"ES":"US",r=S(e),o="https://api.topii.com".replace(/\/v[2-3]\/.*$/,"").replace(/\/$/,"");return fetch("".concat(o,"/v3/facets?country=").concat(l,"&corridor=").concat(r),{signal:a.signal}).then(async e=>{if(!e.ok)throw Error("facets returned ".concat(e.status));return await e.json()}).then(e=>t({facets:e,loading:!1,error:null})).catch(e=>{e instanceof Error&&"AbortError"===e.name||t({facets:null,loading:!1,error:e instanceof Error?e.message:"Unknown error"})}),()=>a.abort()},[e]),a}(a),{cities:J,status:G,load:K,clear:Q}=function(e){let a=(0,i.useRef)(new Map),[t,l]=(0,i.useState)({cities:[],status:"idle",error:null}),r=(0,i.useCallback)(async t=>{if(!t)return void l({cities:[],status:"idle",error:null});let r=a.current.get(t);if(r)return void l({cities:r,status:"ready",error:null});l(e=>({...e,status:"loading",error:null}));let o=S(e),n="".concat("https://api.topii.com".replace(/\/v[2-3]\/.*$/,"").replace(/\/$/,""),"/v3/facets/cities?province=").concat(encodeURIComponent(t),"&corridor=").concat(o);try{let e=await fetch(n);if(403===e.status){var i;let a=await e.json().catch(()=>({}));if((null==a||null==(i=a.detail)?void 0:i.errorType)==="FEATURE_DISABLED")return void l({cities:[],status:"disabled",error:null})}if(!e.ok)throw Error("cities returned ".concat(e.status));let r=await e.json();a.current.set(t,r.cities),l({cities:r.cities,status:"ready",error:null})}catch(e){l({cities:[],status:"error",error:e instanceof Error?e.message:"Unknown error"})}},[e]),o=(0,i.useCallback)(()=>{l({cities:[],status:"idle",error:null})},[]);return{...t,load:r,clear:o}}(a),{search:Y,status:$,data:q}=function(){let[e,a]=(0,i.useState)({data:null,status:"idle",error:null}),t=(0,i.useRef)(0),l=(0,i.useRef)(null),r=(0,i.useCallback)(async e=>{let r=++t.current;l.current&&l.current.abort();let o=new AbortController;l.current=o,a(e=>({...e,status:"loading",error:null}));let n={...e,filters:function(e){if(!e)return;let a={};return e.brand&&e.brand.length>0&&(a.brand=e.brand),e.province&&e.province.length>0&&(a.province=e.province),e.city&&e.city.length>0&&(a.city=e.city),e.postalCode&&e.postalCode.length>0&&(a.postalCode=e.postalCode),e.tipologia&&e.tipologia.length>0&&(a.tipologia=e.tipologia),e.country&&e.country.length>0&&(a.country=e.country),Object.keys(a).length>0?a:void 0}(e.filters)};try{let e=await fetch("/api/v3/map-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:o.signal});if(403===e.status){var i;let l=await e.json().catch(()=>({}));if((null==l||null==(i=l.detail)?void 0:i.errorType)==="FEATURE_DISABLED"){r===t.current&&a({data:null,status:"featureDisabled",error:null});return}}if(!e.ok){let l=await e.text();r===t.current&&a({data:null,status:"error",error:"HTTP ".concat(e.status,": ").concat(l.slice(0,200))});return}let l=await e.json();r===t.current&&a({data:l,status:"ready",error:null})}catch(l){if("AbortError"===l.name)return;let e=l instanceof Error?l.message:"Unknown error";r===t.current&&a({data:null,status:"error",error:e})}},[]);return{...e,search:r}}(),{fetchBusiness:X,clear:Z,status:ee,data:ea}=function(){let e=(0,i.useRef)(new Map),[a,t]=(0,i.useState)({data:null,status:"idle",error:null}),l=(0,i.useCallback)(async(a,l)=>{let r=e.current.get(a);if(r)return void t({data:r,status:"ready",error:null});t({data:null,status:"loading",error:null});let o=l?"?withDistance=true&latUser=".concat(l.lat,"&lonUser=").concat(l.lon):"";try{let l=await fetch("/api/v3/business/".concat(encodeURIComponent(a)).concat(o));if(404===l.status)return void t({data:null,status:"notFound",error:null});if(!l.ok)return void t({data:null,status:"error",error:"HTTP ".concat(l.status)});let r=await l.json();e.current.set(a,r),t({data:r,status:"ready",error:null})}catch(e){t({data:null,status:"error",error:e instanceof Error?e.message:"Unknown error"})}},[]),r=(0,i.useCallback)(()=>{t({data:null,status:"idle",error:null})},[]);return{...a,fetchBusiness:l,clear:r}}(),et=(0,i.useRef)(new Map),[el,er]=(0,i.useState)(0);(0,i.useEffect)(()=>
1{if(w)return;let e=!1,a=a=>{e||(g(a),Y({corridor:f,center:a,filters:b,markersLimit:200}),D(!0))};if("undefined"==typeof navigator||!navigator.geolocation)return void a(T);let t=setTimeout(()=>a(T),5e3);return navigator.geolocation.getCurrentPosition(l=>{if(clearTimeout(t),e)return;let r={lat:l.coords.latitude,lon:l.coords.longitude};C(r),a(r)},()=>{clearTimeout(t),a(T)},{timeout:5e3,maximumAge:6e4}),()=>{e=!0,clearTimeout(t)}},[f,w,b,Y]),(0,i.useEffect)(()=>{if("ready"===$&&q){let e=Date.now()-H.current;(0,s.sx)("map_v3_loaded",{corridor:a,ms_to_first_marker:e})}},[$]),(0,i.useEffect)(()=>{"error"===$&&(0,s.sx)("map_v3_search_error",{corridor:a})},[$]),(0,i.useEffect)(()=>{(null==ea?void 0:ea.brandName)&&(null==ea?void 0:ea.logo)&&(et.current.set(ea.brandName,ea.logo),er(e=>e+1))},[ea]),(0,i.useEffect)(()=>{"ready"===$&&q&&0!==q.markers.length&&F.current&&(F.current=!1,V(e=>e+1))},[$,q]),(0,i.useEffect)(()=>{let e=null==q?void 0:q.markers;if(!e||0===e.length)return;let a=et.current,t=new Map;for(let l of e)a.has(l.brandName)||t.has(l.brandName)||t.set(l.brandName,l.uuid);if(0===t.size)return;let l=[];return t.forEach(e=>{let a=new AbortController;l.push(a),fetch("/api/v3/business/".concat(encodeURIComponent(e)),{signal:a.signal}).then(e=>e.ok?e.json():null).then(e=>{(null==e?void 0:e.brandName)&&e.logo&&!et.current.has(e.brandName)&&(et.current.set(e.brandName,e.logo),er(e=>e+1))}).catch(()=>{})}),()=>l.forEach(e=>e.abort())},[null==q?void 0:q.markers]);let eo=(0,i.useCallback)((e,t,l)=>{if(w){if(g(t),y(l),O.current){O.current=!1,I.current&&(clearTimeout(I.current),I.current=null);return}I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{let l={brand:b.brand,tipologia:b.tipologia,country:b.country};(function(e){let a=Math.abs(e.bottomRight.lon-e.topLeft.lon),t=Math.abs(e.topLeft.lat-e.bottomRight.lat);return Math.abs(111*t*(111*a*Math.cos((e.topLeft.lat+e.bottomRight.lat)/2*Math.PI/180)))})(e)>45e3?Y({corridor:f,center:t,filters:l,markersLimit:200}):Y({corridor:f,bbox:e,filters:l,markersLimit:200}),(0,s.sx)("map_v3_pan_refresh",{corridor:a})},2e3)}},[f,w,a,b.brand,b.country,b.tipologia,Y]),en=(0,i.useCallback)(()=>{Y({corridor:f,center:v,filters:b,markersLimit:200})},[f,b,v,Y]),ei=(0,i.useCallback)(()=>{"undefined"!=typeof navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{let a={lat:e.coords.latitude,lon:e.coords.longitude};C(a),g(a),y(15),B(e=>e+1),O.current=!0},()=>{},{timeout:8e3,maximumAge:6e4})},[]),es=(0,i.useCallback)(e=>{var t,l,r,o,n,i;h(e);let c=function(e){var a,t,l,r,o;let n=new URLSearchParams;return(null==(a=e.brand)?void 0:a.length)&&n.set("brand",e.brand.join(",")),(null==(t=e.province)?void 0:t.length)&&n.set("province",e.province.join(",")),(null==(l=e.city)?void 0:l.length)&&n.set("city",e.city.join(",")),e.postalCode&&n.set("postalCode",e.postalCode),(null==(r=e.tipologia)?void 0:r.length)&&n.set("tipologia",e.tipologia.join(",")),(null==(o=e.country)?void 0:o.length)&&n.set("country",e.country.join(",")),n}(e);u.replace("?".concat(c.toString()),{scroll:!1}),(0,s.sx)("map_v3_filter_applied",{corridor:a,filter_type:"multi",filter_value:c.toString()});let d=null==(t=b.province)?void 0:t[0],m=null==(l=e.province)?void 0:l[0];d!==m&&K(m||null);let _=(null==(r=b.city)?void 0:r[0])||"",p=(null==(o=e.city)?void 0:o[0])||"",z=b.postalCode||"",x=e.postalCode||"",C=(d||"")!==(m||"")||_!==p||z!==x,k=!!((null==(n=e.province)?void 0:n.length)||(null==(i=e.city)?void 0:i.length)||e.postalCode),N=v;if(C&&k){if(F.current=!0,m&&m!==d){let e=function(e){if(!e)return null;let a=e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[/\\,]+/g," ").replace(/\s+/g," ").trim();if(E[a])return E[a];for(let e of a.split(" "))if(E[e])return E[e];return null}(m);e&&(g(N={lat:e.lat,lon:e.lon}),y(e.zoom),B(e=>e+1),O.current=!0,F.current=!1)}}else if(C&&!k){let e=j||T;N=e,g(e),y(13),B(e=>e+1),O.current=!0,F.current=!1}Y({corridor:f,center:N,filters:e,markersLimit:200})},[f,K,a,b.province,b.city,b.postalCode,v,j,Y,u]),ec=(0,i.useCallback)(()=>{let e={brand:[],province:[],city:[],postalCode:"",tipologia:[],country:[]};h(e),u.replace("",{scroll:!1}),Q();let a=j||T;g(a),y(13),B(e=>e+1),O.current=!0,Y({corridor:f,center:a,filters:e,markersLimit:200})},[f,Q,Y,u,j]),eu=(0,i.useCallback)(e=>{N(e),X(e,j||void 0),(0,s.sx)("map_v3_marker_click",{corridor:a,uuid:e})},[X,a,j]);if("featureDisabled"===$)return(0,l.jsx)(_,{homeHref:t});let ed=(null==q?void 0:q.sidebar)||[],em=W.facets,e_=(0,i.useMemo)(()=>{let e=(null==q?void 0:q.markers)||[];for(let e of ed)e.logo&&!et.current.has(e.brandName)&&et.current.set(e.brandName,e.logo);return e.map(e=>({...e,logo:et.current.get(e.brandName)}))},[null==q?void 0:q.markers,ed,el]);return(0,l.jsxs)("div",{className:"".concat(A().layout," ").concat(n?A().layoutEmbedded:""),children:[(0,l.jsx)("div",{className:A().filters,children:em&&(0,l.jsx)(x,{corridor:a,filters:b,facets:{brands:em.brands,provinces:em.provinces,tipologias:em.tipologias},cities:J,citiesStatus:G,onChange:es,onClear:ec})}),(0,l.jsxs)("div",{className:A().mapArea,children:[(0,l.jsx)(R,{apiKey:"AIzaSyAOBYxOY0j1D_Vta8RffE0tn_Lwc_Q-xoo",mapId:"dark"===m&&p?p:"a07c991e00a135e830476558",center:v,zoom:z,markers:e_,user:j,fitVersion:U,recenterVersion:P,onIdle:eo,onMarkerClick:eu,onManualRefresh:en,onRequestUserLocation:ei}),0===e_.length&&"ready"===$&&(0,l.jsx)("div",{className:A().overlay,children:c(Object.values(b).some(e=>Array.isArray(e)?e.length>0:!!e)?"errors.noResults":"errors.noResultsEmpty")}),"error"===$&&(0,l.jsxs)("div",{className:A().overlay,children:[(0,l.jsx)("span",{children:c("errors.searchError")}),(0,l.jsx)("button",{type:"button",className:A().retryButton,onClick:en,children:c("errors.retry")})]}
1),k&&(0,l.jsx)(L,{status:"idle"===ee?"loading":ee,data:ea,userLocation:j,onClose:()=>{N(null),Z()}})]}),(0,l.jsx)("div",{className:A().sidebarPanel,children:(0,l.jsx)(M,{items:ed,onSelect:eu})})]})}},91840:e=>{e.exports={featureDisabled:"FeatureDisabled_featureDisabled__siWn3",featureDisabled__title:"FeatureDisabled_featureDisabled__title__4_FxA",featureDisabled__subtitle:"FeatureDisabled_featureDisabled__subtitle__tep71",featureDisabled__cta:"FeatureDisabled_featureDisabled__cta__36Reh"}}}]);

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.