PageSourceSearch

https://www.rag-bone.com/on/demandware.static/Sites-ragandbone-Sit…/storelocator.widgets.bundle.js

js rag-bone.com collected 2026-10-02 05:28:40 UTC 15,275 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksfra_boilerplate=self.webpackChunksfra_boilerplate||[]).push([[2763],{87264:function(e,t,r){function n(e,t){return r.e(4234).then(r.t.bind(r,466,23)).then((function(r){return r.render(e||"",t)}))}r.d(t,{s:function(){return n}}),r(66992),r(41539),r(88674),r(78783),r(33948)},63865:function(e,t,r){r.r(t),r.d(t,{default:function(){return p}}),r(12419),r(47941),r(82526),r(57327),r(38880),r(54747),r(49337),r(33321),r(69070);var n=r(4942),o=r(15671),s=r(43144),i=r(11752),a=r(79340),c=r(82963),u=r(61120),l=(r(74916),r(15306),r(66992),r(41539),r(78783),r(33948),r(41637),r(16270));function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){var t=function(e){(0,a.Z)(h,e);var t,r,p=(t=h,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,u.Z)(t);if(r){var o=(0,u.Z)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,c.Z)(this,e)});function h(){return(0,o.Z)(this,h),p.apply(this,arguments)}return(0,s.Z)(h,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({latitude:"",longitude:"",distanceUnit:"mi",distanceMessage:"",metersInOneMile:1609.34},(0,i.Z)((0,u.Z)(h.prototype),"prefs",this).call(this))}},{key:"init",value:function(){(0,i.Z)((0,u.Z)(h.prototype),"init",this).call(this);var e=this.getSearchCordinatesFromUrl();e&&this.calculateDistance(e)}},{key:"getSearchCordinatesFromUrl",value:function(){var e={},t=window.location.hash;if(!t)return null;var r=t.replace("#","?"),n=new URLSearchParams(r);return e.lat=n.get("lat"),e.lng=n.get("lng"),e.lat&&e.lng?e:null}},{key:"calculateDistance",value:function(e){var t=this;(0,l.Dp)(this.prefs().apiKey).then((function(){var r=(0,l.H)(e.lat,e.lng),n=(0,l.H)(t.prefs().latitude,t.prefs().longitude);t.renderDistance((0,l.Sp)(r,n))}))}},{key:"convertDistance",value:function(e){var t=e;return t/="mi"===this.prefs().distanceUnit?this.prefs().metersInOneMile:1e3,this.prefs().distanceMessage.replace("{0}",t.toFixed(1))}},{key:"renderDistance",value:function(e){var t=this.convertDistance(e);this.render(void 0,{distance:t},this.ref("container"))}}]),h}(e);return t}},55931:function(e,t,r){r.r(t),r.d(t,{default:function(){return p}}),r(41539),r(12419),r(47941),r(82526),r(57327),r(38880),r(54747),r(49337),r(33321),r(69070);var n=r(4942),o=r(15671),s=r(43144),i=r(11752),a=r(79340),c=r(82963),u=r(61120),l=r(16270);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){var t=function(e){(0,a.Z)(h,e);var t,r,p=(t=h,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,u.Z)(t);if(r){var o=(0,u.Z)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,c.Z)(this,e)});function h(){return(0,o.Z)(this,h),p.apply(this,arguments)}return(0,s.Z)(h,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEac
1h((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({countryCode:"US",apiKey:""},(0,i.Z)((0,u.Z)(h.prototype),"prefs",this).call(this))}},{key:"init",value:function(){(0,i.Z)((0,u.Z)(h.prototype),"init",this).call(this),this.autocompleteInited=!1}},{key:"handleFocus",value:function(){var e=this;this.autocompleteInited||(0,l.Dp)(this.prefs().apiKey).then((function(){var t=e.ref("field").get();t&&(0,l.ru)(t,e.prefs().countryCode).then(e.initEvents.bind(e)).then((function(){e.autocompleteInited=!0}))}))}},{key:"initEvents",value:function(e){var t=this;e&&(this.autocomplete=e,this.autocomplete.addListener("place_changed",(function(){var r=e.getPlace();if(r.geometry){var n=r.geometry.location,o=r.formatted_address;t.setCoordinates(n.lat(),n.lng(),o)}})))}},{key:"setCoordinates",value:function(e,t,r){this.emit("placechanged",{lat:e,lng:t,formattedAddress:r})}}]),h}(e);return t}},68414:function(e,t,r){r.r(t),r.d(t,{default:function(){return g}}),r(12419),r(47941),r(82526),r(57327),r(38880),r(49337),r(33321),r(69070);var n=r(4942),o=r(15671),s=r(43144),i=r(11752),a=r(79340),c=r(82963),u=r(61120),l=(r(21249),r(41539),r(54747),r(91058),r(92222),r(88674),r(17727),r(66992),r(78783),r(33948),r(34518)),f=r(87264),p=r(72506),h=r(46529),d=r(16270);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e){(0,a.Z)(y,e);var t,r,n=(t=y,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,u.Z)(t);if(r){var o=(0,u.Z)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,c.Z)(this,e)});function y(){return(0,o.Z)(this,y),n.apply(this,arguments)}return(0,s.Z)(y,[{key:"prefs",value:function(){return v({storesModel:{},allowLoadMoreThanOnce:!1,loadMoreButton:"storeLocatorLoadMoreButton",storeLocatorSearchForm:"storeLocatorSearchForm",classesExpandedMap:"m-expanded",classesSelectedStore:"m-selected",staticUrlMarkersImage:"",apiKey:"",mapStyleConfig:{},expandButtonText:"",hideButtonText:"",accessibilityAlerts:{}},(0,i.Z)((0,u.Z)(y.prototype),"prefs",this).call(this))}},{key:"init",value:function(){(0,i.Z)((0,u.Z)(y.prototype),"init",this).call(this),this.markers=[],this.activeStoreMarker=null,this.initMap()}},{key:"handleMarkers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.prefs().isMapInited&&e&&(this.removeAllMarkers(),this.getNewBounds(),this.getNewInfoWindow(),this.addUserLocationMarker(),this.addMarkers(e),this.createClusters(),this.map.fitBounds(this.bounds))}},{key:"addMarkers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t&&t.forEach((function(t){var r=(0,d.hM)({position:{lat:t.latitude,lng:t.longitude},icon:e.prefs().staticUrlMarkersImage+"default-marker.svg"});r.setMap(e.map),e.bounds&&e.bounds.extend(r.position),e.markerClickEventHandler(t,r),e.markers.push(r)}))}},{key:"markerClickEventHandler",value:function(e,t){var r=this;t.addListener("click",(function(){r.setActiveMarker(t),r.setActiveStore(e.uuid),r.renderInfoWindow(e,t),r.eventBus().emit("gtm.stores.map.activity",e)}))}},{key:"setActiveMarker",value:function(e){this.activeStoreMarker&&this.activeStoreMarker.setIcon(this.prefs().staticUrlMarkersImage+"default-marker.svg"),e.setIcon(this.prefs().staticUrlMarkersImage+"active-marker.svg"),this.activeStoreMarker=e}}
1,{key:"setActiveStore",value:function(e){var t=this.ref("id-"+e),r=t.get().offsetTop;this.prefs().activeStoreId&&this.ref("id-"+this.prefs().activeStoreId).removeClass(this.prefs().classesSelectedStore),t.addClass(this.prefs().classesSelectedStore),this.setPref("activeStoreId",e),(0,p.ru)(this.ref("storeListContainer").get(),r)}},{key:"renderInfoWindow",value:function(e,t){var r=this;(0,f.s)(this.prefs().storesModel.mapInfoWindowMarkup,e).then((function(e){r.infoWindow.setContent(e),r.infoWindow.open(r.map,t)}))}},{key:"removeAllMarkers",value:function(){this.userLocationMarker&&this.userLocationMarker.setMap(null),0!==this.markers.length&&(this.markerCluster&&this.markerCluster.clearMarkers(),this.markers.forEach((function(e){e.setMap(null)})),this.markers=[])}},{key:"createClusters",value:function(){this.map&&this.markers&&(this.markerCluster=new h.Z(this.map,this.markers,{styles:[{anchorText:[14,0],fontWeight:700,textColor:"white",textSize:16,url:this.prefs().staticUrlMarkersImage+"cluster-marker.svg",height:48,width:48}]}))}},{key:"initMap",value:function(){var e=this;(0,d.Dp)(this.prefs().apiKey).then((function(){var t=e.ref("googleMap").get();if(t){var r={center:{lat:e.prefs().storesModel.lat,lng:e.prefs().storesModel.lng},styles:e.prefs().mapStyleConfig},n=(0,d.HB)(t,r);e.map=n,e.setPref("isMapInited",!0),e.handleMarkers(e.prefs().storesModel.stores)}}))}},{key:"addUserLocationMarker",value:function(){if(this.prefs().isMapInited&&this.map&&this.prefs().storesModel&&this.prefs().storesModel.lat&&this.prefs().storesModel.lng){var e=(0,d.hM)({position:{lat:this.prefs().storesModel.lat,lng:this.prefs().storesModel.lng},icon:this.prefs().staticUrlMarkersImage+"search-location-marker.svg"});this.userLocationMarker=e,e.setMap(this.map),this.bounds&&this.bounds.extend(e.position)}}},{key:"getNewBounds",value:function(){this.bounds=(0,d.$j)()}},{key:"getNewInfoWindow",value:function(){this.infoWindow=(0,d.ju)()}},{key:"toggleMapState",value:function(e){var t=this.ref("googleMap");t&&(t.toggleClass(this.prefs().classesExpandedMap),t.hasClass(this.prefs().classesExpandedMap)?e.setText(this.prefs().hideButtonText):e.setText(this.prefs().expandButtonText))}},{key:"accessibilityAlert",value:function(e){var t=this;setTimeout((function(){return t.eventBus().emit("alert.show",{accessibilityAlert:e})}),400)}},{key:"renderStoreLocatorList",value:function(e){var t=this;return this.render("storeLocatorTemplate",e,this.ref("storeListContainer")).then((function(){t.accessibilityAlert(t.prefs().accessibilityAlerts.storesListUpdated)}))}},{key:"renderLoadMoreButton",value:function(e){return this.render("storeLocatorLoadMoreTemplate",e,this.ref("storeLocatorLoadMoreButton"))}},{key:"loadMore",value:function(e){var t=this,r=e.data("href"),n=String(parseInt(e.data("pageNumber"),10)+1),o=e.data("lat"),s=e.data("lng");(0,l.iX)(r,{pageNumber:n,lat:o,lng:s}).then((function(e){t.prefs().storesModel&&e.success&&(t.setPref("storesModel",v(v({},e.storesModel),{},{stores:t.prefs().storesModel.stores.concat(e.storesModel.stores)})),Promise.all([t.renderStoreLocatorList(t.prefs().storesModel),t.renderLoadMoreButton(t.prefs().storesModel)]).then((function(){t.prefs().storesModel.isLoadMoreButtonEnabled&&t.prefs().allowLoadMoreThanOnce||t.ref(t.prefs().loadMoreButton).hide()})).finally((function(){t.initMap()})))}))}}]),y}(e);return t}},5385:function(e,t,r){r.r(t),r.d(t,{default:function(){return h}}),r(12419),r(47941),r(82526),r(57327),r(38880),r(54747),r(49337),r(33321),r(69070);var n=r(4942),o=r(15671),s=r(43144),i=r(11752),a=r(79340),c=r(82963),u=r(61120),l=(r(43371),r(66992),r(41539),r(78783),r(33948),r(60285),r(41637),r(16270));function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var p=Object.freeze({ENTER:13,SPACE:32});function h(e){var t=function(e){(0,a.Z)(d,e);var t,r,h=(t=d,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,u.Z)(t);if(r){var o=(0,u.Z)(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return(0,c.Z)(this,e)});function d(){return(0,o.Z)(this,d),h.apply(this,arguments)}return(0,s.Z)(d,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?f(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({errorFeedback:"errorMessageLabel",errorMessage:"",errorMessagePlaceNotFound:"",actionUrl:"",searchInputFieldId:"searchByPlace",geolocationOptions:{enableHighAccuracy:!0,timeout:5e3,maximumAge:0}},(0,i.Z)((0,u.Z)(d.prototype),"prefs",this).call(this))}},{key:"getUserCurrentLocation",value:function(){var e=this;navigator.geolocation&&navigator.geolocation.getCurrentPosition((function(t){e.userAllowCurrentLocation(t)}),(function(){e.userDenyCurrentLocation()}),this.prefs().geolocationOptions)}},{key:"userAllowCurrentLocation",value:function(e){var t=e.coords;this.searchStoresByCoordinates(t)}},{key:"userDenyCurrentLocation",value:function(){this.ref(this.prefs().errorFeedback).setText(this.prefs().errorMessage).show()}},{key:"searchStoresByCoordinates",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=new URL(this.prefs().actionUrl);r&&(r.searchParams.append("lat",e.latitude),r.searchParams.append("lng",e.longitude),t&&r.searchParams.append("formattedAddress",t),window.location.assign(r))}},{key:"handlePlaceChange",value:function(e,t){this.searchStoresByCoordinates({latitude:t.lat,longitude:t.lng},t.formattedAddress)}},{key:"geocodeBySearchPhrase",value:function(e){var t=this;this.geocoder&&this.geocoder.geocode(e,(function(e,r){"OK"===r&&e[0]?t.searchStoresByCoordinates({latitude:e[0].geometry.location.lat(),longitude:e[0].geometry.location.lng()},e[0].formatted_address):t.getById("searchByPlace",(function(e){e.setError(t.prefs().errorMessagePlaceNotFound)}))}))}},{key:"searchByPhrase",value:function(){var e=this,t=this.getById("searchByPlace",(function(e){return e.isValid()?e.ref("field").val():null}));if(t){this.eventBus().emit("gtm.store.find.search",t);var r={address:t,componentRestrictions:{country:this.prefs().countryCode}};this.prefs().googleGeocoderInited?this.geocodeBySearchPhrase(r):(0,l.Dp)().then((function(){e.geocoder=(0,l.V_)(),e.setPref("googleGeocoderInited",!0),e.geocodeBySearchPhrase(r)}))}}},{key:"handleKeydown",value:function(e,t){t&&t.keyCode===p.ENTER&&(t.preventDefault(),t.stopPropagation(),this.searchByPhrase())}}]),d}(e);return t}}}]);

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.