PageSourceSearch

https://www.treatwell.co.uk/nmp/asset/50-1ef507.js

js treatwell.co.uk collected 2026-09-24 10:12:51 UTC 25,791 bytes, 2 lines download raw bytes

1(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{1038:function(e,t,a){"use strict";a.d(t,"a",(function(){return C})),a.d(t,"b",(function(){return k}));var n=a(0),i=a.n(n),o=a(1121),s=a.n(o),r=a(911),c=a.n(r),l=a(4),h=a(951),d=a(117),u=a(906),m=a(1122),g=a.n(m);const p={width:11,height:5},v={width:12,height:6},f={pointer:p,width:50,height:27,starScale:.58,starX:4,starY:4,textX:24,textY:18},w={pointer:p,width:64,height:34,starScale:.58,starX:10,starY:8,textX:32,textY:22},I={pointer:v,width:64,height:34,starScale:.75,starX:5,starY:5,textX:34,textY:22},b={pointer:v,width:72,height:42,starScale:.75,starX:8,starY:9,textX:38,textY:26},y=4,C=b.height+b.pointer.height,M="0 0 1";function k(e,t,a){const n=Object(u.c)(window.innerWidth)===u.a,o=function(e,t){return e?t?w:f:t?b:I}(n,a),r=o.height+o.pointer.height,m=Object(l.a)(g.a.mapMarker,{[g.a.selected]:a,[g.a.large]:!n}),p=e===`0${t}0`,v=i.a.createElement("div",{className:m,style:{width:`${o.width}px`,height:`${r}px`}},i.a.createElement("svg",{width:o.width,height:r,xmlns:"http://www.w3.org/2000/svg",version:"1.1",className:g.a.shadow},function(e){const t=e.width-2*y,a=(t-e.pointer.width)/2,n=e.pointer.width/2,o=e.height-2*y;return i.a.createElement("path",{className:g.a.outline,d:`\n          M ${y} 0\n          h ${t}\n          a ${y} ${y} ${M} ${y} ${y}\n          v ${o}\n          a ${y} ${y} ${M} -${y} ${y}\n          h -${a}\n          l -${n} ${e.pointer.height}\n          l -${n} -${e.pointer.height}\n          h -${a}\n          a ${y} ${y} ${M} -${y} -${y}\n          v -${o}\n          a ${y} ${y} ${M} ${y} -${y}\n        `})}(o)),i.a.createElement("svg",{width:o.width,height:r,xmlns:"http://www.w3.org/2000/svg",version:"1.1"},i.a.createElement("g",{transform:`translate(${o.starX},${o.starY}) scale(${o.starScale})`},Object(h.b)(d.colors.baseYellow)),i.a.createElement("text",{x:o.textX,y:o.textY,className:g.a.rating},p?`-${t}-`:e))),C=s.a.renderToString(v),k=c.a.point(o.width/2,r);return c.a.divIcon({html:C,className:"",iconAnchor:k})}},1119:function(e,t,a){e.exports={map:"Map-module--map--1d36e1",loadingOverlay:"Map-module--loadingOverlay--af5565",loadingButton:"Map-module--loadingButton--3be610"}},1120:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(14),i=a(911),o=a.n(i);function s(e,t){const a=n.f?"treatwell":"demo",i=window.devicePixelRatio>1?2:1;o.a.tileLayer(`https://maps.a-cdn.net/tiles/${a}/{z}/{x}/{y}.png?language=${t}&scale=${i}`,{attribution:'\xa9 <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(e)}},1122:function(e,t,a){e.exports={"font-family":"TreatwellSansWeb, Verdana, Geneva, Arial, Helvetica, sans-serif",mapMarker:"mapMarker-module--mapMarker--c410ee",shadow:"mapMarker-module--shadow--e1c379",outline:"mapMarker-module--outline--626df4",selected:"mapMarker-module--selected--3817e2",rating:"mapMarker-module--rating--3e15fd",large:"mapMarker-module--large--ef9412"}},1165:function(e,t,a){e.exports={"font-family":"TreatwellSansWeb, Verdana, Geneva, Arial, Helvetica, sans-serif","text-regular":"14px",control:"map-control-module--control--32b8e8"}},1442:function(e,t){function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var n=1/0,i=17976931348623157e292,o=NaN,s="[object Symbol]",r=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,h=/^0o[0-7]+$/i,d=parseInt;var u=Object.prototype.toString,m=Math.max;function g(e){var t=a(e);return!!e&&("object"==t||"function"==t)}e.exports=function(e,t){if("function"!=typeof e)throw new TypeError("Expected a function");var p,v;return function(e,t){return t=m(void 0===t?e.length-1:t,0),function(){for(var a=arguments,n=-1,i=m(a.length-t,0),o=Array(i);++n<i;)o[n]=a[t+n];n=-1;for(var s=Array(t+1);++n<t;)s[n]=a[n];return s[t]=o,function(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}(e,this,s)}}(e,t=void 0===t?t:(p=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==a(e)||function(e){return!!e&&"object"==a(e)}(e)&&u.call(e)==s}(e))return o;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=l.test(e);return n||h.test(e)?d(e.slice(2),n?2:8):c.test(e)?o:+e}(e))===n||e===-n?(e<0?-1:1)*i:e==e?e:0:0===e?e:0}(t),v=p%1,p==p?v?p-v:p:0))}},1443:function(e,t,a){},1444:function(e,t,a){e.exports={"font-family":"TreatwellSansWeb, Verdana, Geneva, Arial, Helvetica, sans-serif",noResults:"search-controls-module--noResults--9ee5a0",container:"search-controls-module--container--c7b1e7",redoSearchButtonHide:"search-controls-module--redoSearchButtonHide--a77419"}},1447:function(e,t,a){e.exports={"text-smaller":"12px","text-regular":"14px","breakpoint-tablet":"(min-width: 520px)",padding:"var(--spacing-2md)",venueDetailsContainer:"VenueDetailsOnMap-module--venueDetailsContainer--d952ff",details:"VenueDetailsOnMap-module--details--e5e113",imageArea:"VenueDetailsOnMap-module--imageArea--465274",image:"VenueDetailsOnMap-module--image--42c85c",textContainer:"VenueDetailsOnMap-module--textContainer--ee17de",name:"VenueDetailsOnMap-module--name--72f5a8",ratingContainer:"VenueDetailsOnMap-module--ratingContainer--033ce8",rating:"VenueDetailsOnMap-module--rating--92f98d",label:"VenueDetailsOnMap-module--label--b75e13",divider:"VenueDetailsOnMap-module--divider--4d6178",shortDivider:"VenueDetailsOnMap-module--shortDivider--31f6b4",servicesSection:"VenueDetailsOnMap-module--servicesSection--425cd6",goToVenueContainer:"VenueDetailsOnMap-module--goToVenueContainer--58cfa7",goToVenue:"VenueDetailsOnMap-module--goToVenue--2a9645",newVe
1nue:"VenueDetailsOnMap-module--newVenue--cb00d6"}},1448:function(e,t,a){e.exports={"font-family":"TreatwellSansWeb, Verdana, Geneva, Arial, Helvetica, sans-serif",imageHeight:"176px",detailsHeight:"48px",container:"FloatingVenueCard-module--container--20d2cc",image:"FloatingVenueCard-module--image--67738b",name:"FloatingVenueCard-module--name--56c89e",detailsContainer:"FloatingVenueCard-module--detailsContainer--b7bde5"}},1449:function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyBiYXNlUHJvZmlsZT0iZnVsbCIgd2lkdGg9Ijg2IiBoZWlnaHQ9Ijg2IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPGRlZnM+CiAgICAgICAgPGZpbHRlciBpZD0iYSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4KICAgICAgICAgICAgPGZlRHJvcFNoYWRvdyBkeD0iMCIgZHk9Ii41IiBzdGREZXZpYXRpb249Ii45IiBmbG9vZC1jb2xvcj0iIzkzOTM5OCIvPgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGNpcmNsZSBjeD0iNDMiIGN5PSI0MyIgcj0iOCIgZmlsbD0iIzk0YzdmZiI+CiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iciIgZnJvbT0iMTEiIHRvPSI0MCIgZHVyPSIycyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPgogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGZyb209IjEiIHRvPSIwIiBkdXI9IjJzIiBiZWdpbj0iMHMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIi8+CiAgICA8L2NpcmNsZT4KICAgIDxjaXJjbGUgY3g9IjQzIiBjeT0iNDMiIHI9IjgiIGZpbGw9IiNmZmYiIGZpbHRlcj0idXJsKCNhKSIvPgogICAgPGNpcmNsZSBjeD0iNDMiIGN5PSI0MyIgcj0iNSIgZmlsbD0iIzAxN2FmZiI+CiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iciIgdmFsdWVzPSI1OzYuNTs1IiBiZWdpbj0iMHMiIGR1cj0iNC41cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgIDwvY2lyY2xlPgo8L3N2Zz4K"},1450:function(e,t,a){e.exports={divIcon:"walkingTimeIcon-module--divIcon--b12c9c",icon:"walkingTimeIcon-module--icon--7b006f"}},1482:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return Me}));var n=a(0),i=a.n(n),o=a(136),s=a(1119),r=a.n(s),c=a(911),l=a.n(c),h=a(1442),d=a.n(h);a(1443);let u=!1;const m="topcenter",g="bottomcenter";function p(){if(u)return;const e=l.a.Map,t=e.prototype._initControlPos;e.prototype._initControlPos=function(){t.apply(this,d.a),this._controlCorners[m]=l.a.DomUtil.create("div","leaflet-top leaflet-center",this._controlContainer),this._controlCorners[g]=l.a.DomUtil.create("div","leaflet-bottom",l.a.DomUtil.create("div","leaflet-control-bottomcenter",this._controlContainer))},u=!0}function v(e,t,a){t=(t+360)%360;const n=Math.PI/180,i=180/Math.PI,o=6378137,s=e.lng*n,r=e.lat*n,c=t*n,h=Math.sin(r),d=Math.cos(r),u=Math.cos(a/o),m=Math.sin(a/o),g=Math.asin(h*u+d*m*Math.cos(c));let p=s+Math.atan2(Math.sin(c)*m*d,u-h*Math.sin(g));return p*=i,p=p>180?p-360:p<-180?p+360:p,l.a.latLng([g*i,p])}function f(e,t){return e.distanceTo(t)}var w=a(1120),I=a(1112),b=a(474),y=a.n(b),C=a(281);function M(e){return{type:"bounds",bounds:l.a.latLngBounds(l.a.latLng(e.southWestLat,e.southWestLon),l.a.latLng(e.northEastLat,e.northEastLon))}}function k(e,t){return e.length>0&&!(null==t?void 0:t.box)?function(e){const t=e.map((e=>l.a.latLng(e.location.lat,e.location.lon)));return{type:"bounds",bounds:l.a.latLngBounds(t),boundsOptions:{padding:[40,40],maxZoom:16}}}(e):function(e){const t={type:"view",center:l.a.latLng(0,0),zoom:2};return e?e.external?M(e.external.box):e.box?M(e.box):e.tree?{type:"view",center:l.a.latLng(e.tree.point.lat,e.tree.point.lon),zoom:9}:e.point?{type:"view",center:l.a.latLng(e.point.lat,e.point.lon),zoom:9}:e.postalReference?{type:"view",center:l.a.latLng(e.postalReference.point.lat,e.postalReference.point.lon),zoom:12}:t:t}(t)}var S=a(462),x=a(4),V=a(1165),E=a.n(V),N=a(62);const B="var(--color-grey-70)",Z="white",R="#c80f00";function O({error:e,white:t,positioningClassName:a}){const i=e?R:t?Z:B;return n.createElement("svg",{className:a,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},n.createElement("g",{fill:"none",fillRule:"evenodd"},n.createElement("path",{d:"M0 0h24v24H0z"}),n.createElement("circle",{cx:"10",cy:"10",r:"7",stroke:i,strokeWidth:"2"}),n.createElement("path",{stroke:i,strokeWidth:"2",d:"M17 17l4 4"})))}var D=a(44),T=a(1444),L=a.n(T);class j extends l.a.Control{constructor(e,t,a,n,i){super(),this.label=e,this.onClick=t,this.cms=a,this.shouldShowRedoSearchButton=n,this.shouldShowNoResultsMessage=i}onAdd(){this.container=document.createElement("div"),this.container.className=E.a.control;const e=Object(x.a)({[L.a.redoSearchButtonHide]:!this.shouldShowRedoSearchButton});return Object(S.createRoot)(this.container).render(i.a.createElement("div",{className:L.a.container},i.a.createElement("div",{className:e},i.a.createElement(N.a,{label:this.label,colour:N.b.Blue,size:N.c.Medium,icon:this.icon,onClick:this.onClick})),this.shouldShowNoResultsMessage&&i.a.createElement(D.a,{type:"caption",className:L.a.noResults},this.cms.page.browse.map["no-results-info"]),",")),this.container}onRemove(){return this.container&&l.a.DomUtil.remove(this.container),this}showRedoSearchButton(){this.shouldShowRedoSearchButton=!0}showNoResultsMessage(){this.shouldShowNoResultsMessage=!0}hideRedoSearchButton(){this.shouldShowRedoSearchButton=!1}hideNoResultsMessage(){this.shouldShowNoResultsMessage=!1}icon(){return i.a.createElement(O,{white:!0})}}var P=a(1038),A=a(266),$=a(137),z=a(27),H=a(436),W=a(1020),F=a(1166),G=a(1113),Y=a(63),X=a(400),U=a(1156),_=a.n(U),J=a(1447),K=a.n(J),Q=a(1036),q=a(926);class ee extends i.a.PureComponent{constructor(){super(...arguments),this.state={showServices:!1},this.category=this.props.isInHybridView?Q.a.BrowseHybridCard:Q.a.BrowseMapCard,this.getMenuHighlights=()=>{var e;
1if(!this.props.mapVenue.menuItems)return;return null===(e=this.props.mapVenue.menuItems)||void 0===e?void 0:e.map((e=>({dataOfferId:Object(W.f)(e.data.id),name:e.data.name||"",priceRangeOutput:e.data.priceRange,durationRange:e.data.durationRange,pricingDisplayType:e.data.pricingDisplayType,treatmentType:e.type})))},this.trackServicesToggle=e=>{const t=e.id.toString(),a=parseFloat(e.rating.average.toFixed(1));this.state.showServices?Object(Q.c)(this.category,t,a):Object(Q.i)(this.category,t,a)},this.toggleServices=(e,t)=>{t.preventDefault(),t.stopPropagation(),this.setState({showServices:!this.state.showServices}),this.trackServicesToggle(e)}}async onClick(e,t){e.preventDefault(),await Object(Q.b)(this.category,this.props.mapVenue.id),await Object(q.b)({eventName:"search_venue_clicked",menuHighlights:this.state.showServices?this.getMenuHighlights():void 0,venueId:this.props.mapVenue.id,rating:this.props.mapVenue.rating,countryCode:this.props.channel.country.countryCode,pageName:"browse_page",venueCardType:"map"}),window.location.href=t}render(){const{mapVenue:e,cmsBrowsePage:t,reviewCountTemplate:a}=this.props;if(!e)return null;const n=t.page.browse,{showServices:o}=this.state,s=Object(W.d)(e.result,e.listingSpecification),r=o?n.map["hide-services"]:n.map["show-services"],c=o?X.b.Up:X.b.Down,l=e.primaryImage?e.primaryImage.uris["360x240"]:"";return i.a.createElement("a",{href:s,className:K.a.venueDetailsContainer,onClick:e=>this.onClick(e,s)},i.a.createElement("div",{className:K.a.details},i.a.createElement("div",{className:K.a.imageArea},i.a.createElement("img",{className:K.a.image,src:l})),i.a.createElement("div",{className:K.a.textContainer},i.a.createElement(D.a,{type:"mdHeader",className:Object(x.a)(_.a.name,K.a.name)},e.name),i.a.createElement(G.a,{rating:e.rating,reviewCountTemplate:a}))),i.a.createElement("div",{className:K.a.divider}),i.a.createElement("div",{className:K.a.servicesSection,onClick:t=>this.toggleServices(e,t)},i.a.createElement(D.a,{type:"caption"},r),i.a.createElement(X.a,{direction:c,animated:!0})),o&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:K.a.shortDivider}),i.a.createElement(Y.a,{"data-cy":"browseResultServices",space:"2md"},e.menuItems.map((a=>{var n;const o=Object(W.b)(a,t);return i.a.createElement(F.a,{key:o.dataOfferId,cmsBrowsePage:t,menuHighlight:o,channelOutput:this.props.channel,isFilteringByDate:this.props.isFilteringByDate,isFilteringByTime:this.props.isFilteringByTime,venueId:e.id,venuePageUri:s,searchRank:null!==(n=e.searchRank)&&void 0!==n?n:0})})),i.a.createElement("div",{className:K.a.divider}),i.a.createElement("div",{className:K.a.goToVenueContainer},i.a.createElement("div",{className:K.a.goToVenue},t.venue["go-to-venue-button"]),i.a.createElement(X.a,{colour:"bloomBaseCoral600",direction:X.b.Right})))))}}ee.defaultProps={ratingText:"",seeMatchingServicesText:"See matching services"};class te extends l.a.Control{constructor(e,t,a){super(),this.selectedMapVenue=e,this.cms=t,this.channel=a}onAdd(){this.container=document.createElement("div"),this.container.className=E.a.control,l.a.DomEvent.disableClickPropagation(this.container);const e=Object(S.createRoot)(this.container),t=Object(z.c)({channel:this.channel,languageCode:window.__state__.languageCode,cms:this.cms,locale:this.channel.locale,pageData:window.__state__}),{isFilteringByDate:a,isFilteringByTime:n}=this.selectedMapVenue.listingSpecification?Object(W.c)(this.selectedMapVenue.listingSpecification):{isFilteringByDate:!1,isFilteringByTime:!1};return Object(H.b)().then((o=>{e.render(i.a.createElement($.a,{userAgent:navigator.userAgent},i.a.createElement(A.a,{growthbook:o},i.a.createElement(z.a.Provider,{value:t},i.a.createElement(ee,{mapVenue:this.selectedMapVenue,cmsBrowsePage:this.cms,reviewCountTemplate:this.cms.venue["reviews-template"],isFilteringByDate:a,isFilteringByTime:n,channel:this.channel})))))})),this.container}onRemove(){return this.container&&l.a.DomUtil.remove(this.container),this}}var ae=a(1448),ne=a.n(ae);function ie(e){const{mapVenue:t,reviewCountTemplate:a,countryCode:n}=e,o=t.primaryImage?t.primaryImage.uris["360x240"]:"",s=Object(W.d)(t.result,t.listingSpecification);return i.a.createElement("a",{className:ne.a.container,href:s,onClick:async function(e){e.preventDefault(),await Object(Q.b)(Q.a.BrowseHybridCard,t.id),await Object(q.b)({eventName:"search_venue_clicked",venueId:t.id,rating:t.rating,countryCode:n,pageName:"browse_page",venueCardType:"map"}),window.location.href=s}},i.a.createElement("img",{className:ne.a.image,src:o,onLoad:e.onLoad}),i.a.createElement("div",{className:ne.a.detailsContainer},i.a.createElement("h2",{className:ne.a.name}
1,t.name),i.a.createElement(G.a,{rating:t.rating,reviewCountTemplate:a,nowrap:!0})))}const oe=10;function se(e,t,a){const n=function(e,t,a){const n=oe,i=e.x-oe,o=t.x-a/2;return o>=n&&o+a<i?o:o<n?n:i-a}(e,t,a.x),i=function(e,t,a){return t.y-P.a/2<e.y/2?t.y+oe:t.y-(P.a+oe+a)}(e,t,a.y);return l.a.point(n,i)}class re extends l.a.Layer{constructor(e,t,a){super(),this.onLoad=()=>{var e;const{container:t,map:a}=this;if(!t||!a)return;null===(e=a.getPane("popupPane"))||void 0===e||e.appendChild(t);const n=t.firstElementChild,{lat:i,lon:o}=this.venue.location,s=l.a.latLng(i,o),r=a.latLngToLayerPoint(s),c=l.a.point(n.offsetWidth,n.offsetHeight),h=a.getPixelBounds().min.subtract(a.getPixelOrigin()),d=se(a.getSize(),r.subtract(h),c);l.a.DomUtil.setPosition(t,d.add(h))},this.venue=e,this.reviewCountTemplate=t,this.countryCode=a}onAdd(e){this.map=e,this.container=l.a.DomUtil.create("div");return Object(S.createRoot)(this.container).render(i.a.createElement(ie,{mapVenue:this.venue,reviewCountTemplate:this.reviewCountTemplate,onLoad:this.onLoad,countryCode:this.countryCode})),this}onRemove(){return this.container&&l.a.DomUtil.remove(this.container),this}}class ce{constructor(e,t,a,n,i,o,s){this.map=e,this.venue=t,this.decimalSeparator=a,this.reviewCountTemplate=n,this.unselectedIcon=this.createIcon(!1);const r=l.a.latLng(t.location.lat,t.location.lon);this.marker=l.a.marker(r,{icon:this.unselectedIcon}),this.marker.addTo(e),this.marker.on("click",i),this.selected=!1,this.cms=o,this.channel=s,p()}createIcon(e){return Object(P.b)(this.venue.rating.displayAverage||"-.-",this.decimalSeparator,e)}setSelected(e,t,a){var n;!e&&!a||this.selectedIcon||(this.selectedIcon=this.createIcon(!0));const i=e||a?this.selectedIcon:this.unselectedIcon;this.marker.setIcon(i),e&&this.selected||(e?"desktop"===t?(this.venueCard=new re(this.venue,this.reviewCountTemplate,this.channel.country.countryCode),null===(n=this.venueCard)||void 0===n||n.addTo(this.map)):"mobile"===t&&(this.venueCard=new te(this.venue,this.cms,this.channel),this.venueCard.setPosition(g),this.map.addControl(this.venueCard)):this.venueCard&&(this.venueCard.remove(),this.venueCard=void 0),this.selected=e)}setZIndex(e){this.marker.setZIndexOffset(e)}remove(){this.marker.remove()}venueId(){return this.venue.id}venueRating(){return this.venue.rating.average}}var le=a(936),he=a(1449),de=a.n(he),ue=a(117),me=a(1121),ge=a.n(me),pe=a(1450),ve=a.n(pe);const fe=750,we=Math.floor(10);class Ie{constructor(e,t){var a;this.update=()=>{var e,t,a;this.location&&(null===(e=this.circle)||void 0===e||e.remove(),null===(t=this.topMarker)||void 0===t||t.remove(),null===(a=this.bottomMarker)||void 0===a||a.remove(),this.map.getZoom()<13||(this.addCircle(this.location),this.addMarkers(this.location)))},this.map=e,this.markerIndex=t,this.markerIcon=(a=we,l.a.divIcon({className:ve.a.divIcon,html:ge.a.renderToString(i.a.createElement("div",{className:ve.a.icon},i.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"15",viewBox:"0 0 9 15"},i.a.createElement("path",{fill:"#FFF",fillRule:"nonzero",d:"M5 2.667c.733 0 1.333-.6 1.333-1.334C6.333.6 5.733 0 5 0S3.667.6 3.667 1.333c0 .734.6 1.334 1.333 1.334zM2.533 4.933l-1.866 9.4h1.4L3.267 9l1.4 1.333v4H6v-5L4.6 8 5 6c.867 1 2.2 1.667 3.667 1.667V6.333c-1.267 0-2.334-.666-2.867-1.6l-.667-1.066C4.867 3.267 4.467 3 4 3c-.2 0-.333.067-.533.067L0 4.533v3.134h1.333V5.4l1.2-.467"})),i.a.createElement(D.a,{type:"caption"},`${a} min`)))})),this.map.on("zoomend",this.update)}setLocation(e){this.location=e,this.update()}addCircle(e){this.circle=l.a.circle(e,{radius:fe,color:ue.ColorGrey70,weight:2,fill:!1}),this.circle.addTo(this.map)}addMarkers(e){const t=v(e,0,fe),a=v(e,180,fe),n={icon:this.markerIcon,zIndexOffset:this.markerIndex};this.topMarker=l.a.marker(t,n).addTo(this.map),this.bottomMarker=l.a.marker(a,n).addTo(this.map)}}class be{constructor(e,t){this.map=e,this.markerZIndex=t,this.walkingRadius=new Ie(this.map,t),this.getUserLocation()}async getUserLocation(){try{const e=await le.a(5e3);this.setLocation(l.a.latLng(e.coords.latitude,e.coords.longitude))}catch(e){}this.watchLocation()}watchLocation(){navigator.geolocation.watchPosition((({coords:{latitude:e,longitude:t}})=>{this.setLocation(l.a.latLng(e,t))}),(()=>{}))}createMarker(e){const t=new l.a.Icon({iconUrl:de.a,iconAnchor:l.a.point(43,43)});this.marker=l.a.marker(e,{icon:t,zIndexOffset:this.markerZIndex}),this.marker.addTo(this.map)}setLocation(e){this.location&&e.lat===this.location.lat&&e.lng===this.location.lng||(this.location=e,this.marker?this.marker.setLatLng(e):this.createMarker(e),this.walkingRadius.setLocation(e))}}var ye=a(937);p();class Ce{constructor(e,t,a,n,i){this.unselectMarker=()=>{this.onUserMapInteraction(),this.toggleSelectedVenue(void 0)},this.onZoomStart=()=>{"desktop"===this.mapView&&this.unselectMarker()},this.onMoveEnd=()=>{const e=this.map.getBounds();
1this.isBounding?(this.searchControls.hideRedoSearchButton(),this.isBounding=!1,this.map.removeControl(this.searchControls),this.initialBounds=e):this.conditionallyShowRedoSearchButton(e)},this.onDragEnd=()=>{this.onUserMapInteraction(),Object(Q.f)(this.category,this.map.getZoom())},this.onZoomEnd=()=>{const e=this.map.getZoom();if(!this.isBounding){const t=e>this.zoomLevel?"in":"out";this.trackZoom(this.category,t,e)}this.zoomLevel=e},this.redoSearch=()=>{Object(Q.g)(this.category);const e=function(e){const t=e.getNorthEast(),a=f(t,e.getSouthWest());if(a<=49800)return e;const n=e.getCenter(),i=a/49800,o=f(n,l.a.latLng(n.lat,t.lng))/i,s=f(n,l.a.latLng(t.lat,n.lng))/i,r=v(n,90,o),c=v(n,0,s),h=l.a.latLng(c.lat,r.lng),d=v(n,270,o),u=v(n,180,s),m=l.a.latLng(u.lat,d.lng);return l.a.latLngBounds(m,h)}(this.map.getBounds());this.changeBrowseData({location:{box:{northEastLatitude:e.getNorthEast().lat,northEastLongitude:e.getNorthEast().lng,southWestLatitude:e.getSouthWest().lat,southWestLongitude:e.getSouthWest().lng}}})},this.onUserMapInteraction=()=>{const e=new Event("map-user-action");document.dispatchEvent(e)},this.map=l.a.map(e,{keyboard:!1,tap:!1}),Object(w.a)(this.map,n.locale.substr(0,2)),this.map.on("click",this.unselectMarker),this.map.on("moveend",this.onMoveEnd),this.map.on("zoomstart",this.onZoomStart),this.map.on("zoomend",this.onZoomEnd),this.map.on("dragend",this.onDragEnd),this.changeBrowseData=t,this.decimalSeparator=n.decimalSeparator,this.reviewCountTemplate=a.venue["reviews-template"],this.markers=[],this.markerZIndex=1,this.isBounding=!1,this.cms=a,this.searchControl
1s=new j(a.page.browse.map["redo-search-btn"],this.redoSearch,this.cms),this.searchControls.setPosition(m),this.zoomLevel=this.map.getZoom(),this.trackZoom=y()(Q.j,1e3),this.channel=n,new be(this.map,this.nextMarkerZIndex()),this.mapView=i,this.category=this.mapView?Q.a.BrowseHybridResults:Q.a.BrowseMapResults}setData(e,t){Object(Q.e)(this.category,e.length.toString(),Object(I.a)(e)),this.unselectMarker(),this.map.removeControl(this.searchControls),this.setLocation(e,t),this.removeMarkers(),0===e.length&&"mobile"===this.mapView?(this.searchControls.showNoResultsMessage(),this.map.addControl(this.searchControls)):(this.searchControls.hideNoResultsMessage(),this.addMarkers(e))}invalidateSize(){this.map.invalidateSize()}setLocation(e,t){this.isBounding=!0;const a=k(e,t);"bounds"===a.type?this.map.fitBounds(a.bounds,a.boundsOptions):this.map.setView(a.center,a.zoom)}removeMarkers(){for(const e of this.markers)e.remove()}addMarkers(e){this.markers=[];for(const t of e){const e=new ce(this.map,t,this.decimalSeparator,this.reviewCountTemplate,(()=>this.toggleSelectedVenue(e)),this.cms,this.channel);e.setZIndex(this.nextMarkerZIndex()),this.markers.push(e)}}toggleSelectedVenue(e){this.onUserMapInteraction();const t=e?e.venueId():void 0;if(this.selectedVenueId===t)this.selectedVenueId=void 0;else if(this.selectedVenueId=t,e&&t){const a=Object(C.c)(window.navigator.userAgent);Object(ye.c)(this.channel.country.countryCode,a.type===C.b,e),Object(Q.h)(this.category,t.toString(),e.venueRating())}for(const a of this.markers)a.setSelected(a.venueId()===this.selectedVenueId,this.mapView);this.selectedVenueId&&this.bringVenueToFront(this.selectedVenueId)}setHighlightedVenueMarker(e){if(this.selectedVenueId&&this.selectedVenueId===e)this.bringVenueToFront(e);else{!e&&this.selectedVenueId&&this.bringVenueToFront(this.selectedVenueId);for(const t of this.markers)t.setSelected(this.selectedVenueId===t.venueId(),this.mapView,e===t.venueId());e&&this.bringVenueToFront(e)}}bringVenueToFront(e){var t;this.markerZIndex++,null===(t=this.markers.find((t=>e===t.venueId())))||void 0===t||t.setZIndex(this.nextMarkerZIndex())}conditionallyShowRedoSearchButton(e){if(!this.initialBounds)return;f(e.getNorthEast(),this.initialBounds.getNorthEast())/f(e.getNorthEast(),e.getSouthWest
1())>.1&&(this.searchControls.showRedoSearchButton(),this.map.addControl(this.searchControls))}nextMarkerZIndex(){return this.markerZIndex++,2e3*this.markerZIndex}}function Me({venues:e,location:t,hoveredMapVenue:a,changeBrowseData:n,cms:s,channel:c,mapView:l,loading:h}){const d=i.a.useRef(null),[u,m]=i.a.useState();i.a.useEffect((()=>{if(!d.current)return;const a=new Ce(d.current,n,s,c,l);m(a),a.setData(e,t)}),[]);const g=e.map((e=>e.id)).join();return i.a.useEffect((()=>{u&&u.setData(e,t)}),[g,t]),i.a.useEffect((()=>{u&&u.setHighlightedVenueMarker(null==a?void 0:a.id)}),[a]),i.a.useEffect((()=>{if(u&&d.current){const e=new ResizeObserver((()=>{u.invalidateSize()}));return e.observe(d.current),()=>e.disconnect()}}),[u]),i.a.createElement("div",{className:r.a.map,ref:d},h&&i.a.createElement("div",{className:r.a.loadingOverlay},i.a.createElement("div",{className:r.a.loadingButton},i.a.createElement(o.a,{buttonStyle:"secondary",isLoading:!0},"''"))))}}}]);
2//# sourceMappingURL=50-1ef507.js.map

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.