{"version":3,"file":"showcase-listings.min.js","names":["_a","shouldToggleIcons","zipcode","managementCompanyID","filterLessUrl","numberOfItemsToShowPerPage","showMap","priceRange","neighborhoods","bedroomRange","bathroomRange","travelTime","travelBy","byUnit","byUnitDefault","detailsLinkBase","unitPrices","roomPrices","bedrooms","bathrooms","polygonCoordinates","hidePolygon","cacheKeyRandomString","neighborhoodMapCenterKey","neighborhoodMapCenterValue","clusterMarkers","clusterQuantity","brandColorPrimary","brandColorSecondary","abShowAlternate","abMainImageName","loggedIn","cityName","lastSearchSeen","featuredIconText","isInitialLoad","showInitialKnockoutView","mapsAreInitialized","loadingMaps","resultsCacheKey","initialItems","globalThis","showcaseItemID","loaded","trackedABViews","ils","filterEventTracked","initialFilterDisplay","showcaseListings","cdpClicks","attributeClicks","filterUses","filterUndos","priceUsed","bedUsed","bathUsed","travelTimeUsed","FilterItem","constructor","attributeID","type","value","title","self","this","AttributeID","Title","Type","Value","ko","observable","ClearFilter","siblingFilter","$","next","ClearRangeSlider","find","each","ClearCheckBox","ClearListBoxOrDropDown","nextAll","ClearRadioButtonList","subscribe","newValue","viewModel","FiltersChanged","GetFilterByID","attrId","parseInt","filterItem","utils","arrayFirst","FilterList","item","e","console","error","async","ShowNextPage","NextEnabled","PageNumber","i","LazyLoadedListings","length","currentIndex","codeAddress","ShowKnockoutView","Listings","push","LazyLoadNextPage","MobileUpdatePriceRange","PriceMin","val","PriceMax","PriceRange","removeAttr","prop","MobileUpdateBedroomRange","BedroomMin","BedroomMax","BedroomRange","MobileUpdateBathroomRange","BathroomMin","BathroomMax","BathroomRange","LoadNewSet","LoadNextSet","currentFilter","GetFilterJSONString","maxNumberOfLoops","Math","ceil","TotalRowCount","PageSize","countOfLoops","ClearTravelTimeFilter","ReadyToLoadData","AddressLat","AddressLong","TravelTime","TravelBy","AddressText","ClearManagementCompany","ManagementCompanyID","ClearPriceFilter","breakpoint","isTablet","ClearMobileDropdownFilter","parent","minValue","text","replace","maxValue","sliderElement","html","slider","ClearBedroomFilter","FormatBedroomText","ClearBathroomFilter","ClearNeighborhoodFilter","Neighborhoods","ClearSearchText","SearchText","ClearZipcodeFilter","Zipcode","ClearMapAreaFilter","polygon","setMap","polyline","PolygonCoordinates","success_method","d","Loading","response","fetch","baseUrl","method","headers","body","GetNextPageRequestJSON","json","Error","data","results","map","clearMarkers","bounds","initializeMap","addClass","toString","found","ShowcaseItemID","on","communityClick","trigger","setTimeout","jcarousel","ABTestImage","checkAbImageTimeout","CheckIfABImageInView","clearTimeout","iconTimeout","removeClass","HookupCommunityEventHandlers","yValueToCheck","height","window","scrollTop","document","querySelectorAll","forEach","element","offsetTop","indexOf","dataset","id","getAttribute","trackABImageImpression","communityId","imageName","testContext","communityName","toJSON","Filter","ByUnit","ZipcodeClean","ManagementCompanyIDClean","pageNumber","FilterString","lazy_success_method","EscapeFilter","filterValue","toLowerCase","CleanupFilter","GetAttributeID","prev","finalizeInitialLoad","elem","addEventListener","evt","target","hasAttribute","closest","hasAb","trackABView","testName","version","trackCommunityClickedEvent","communityUrl","url","isFeaturedIcon","featuredIcon","ThingsToDoOnResize","hasClass","preventDefault","attr","ShowMobileFilters","MobileFilterPendingRefresh","css","width","SetupResponsiveCarousel","UnstackSliderLabels","loadMapScripts","callbackPromise","Promise","resolve","contentDisplay","getElementById","classList","toggle","querySelector","removeAttribute","onListTabClick","mapClickHandler","LoadTabs","SetTitlePosition","setDesktopFiltersBar","SetResultsToFixed","shouldLoadNewSet","currentMaxPageSize","MapResized","fitBounds","setMapZoom","maxPageSize","smzTimeoutPromise","outerWidth","footerIsVisible","viewportWidth","innerWidth","documentElement","clientWidth","viewportHeight","innerHeight","clientHeight","rect","getBoundingClientRect","top","left","right","footerIsInViewPort","menuRect","filtersPanelRect","bottomAreaRect","bottom","outerHeight","theElement","siblings","dropdownContainer","sliderUpdateFilter","sliderValue","currentFilterItem","rangeSliderUpdateFilter","sliderValue1","sliderValue2","BindPriceSlider","values","remove","append","value1","value2","range","step","min","max","create","event","ui","priceSliderUpdateFilter","slide","handle","stop","numBeds","minSliderValue","maxSliderValue","selectOptionByValue","selectId","String","selectElement","bedroomSliderUpdateFilter","bathroomSliderUpdateFilter","handleText","rightHandleLabel","leftHandleLabel","leftHandleEnd","offset","observableArray","PriceRangeAdds","Favorites","Trash","MapMode","FeaturedIcons","OriginalLocationHref","location","href","ActiveFilters","computed","arrayFilter","allFilters","arrayForEach","join","LastIndexVisible","NextClicked","drawingManager","setDrawingMode","google","maps","drawing","OverlayType","POLYGON","setOptions","draggableCursor","draggable","isDrawing","EncodedPolygon","geometry","encoding","encodePath","getPath","getArray","queryParams","URLSearchParams","encodedPolygon","address","trim","existingAddress","get","Set","split","set","queryString","LinkToThisPage","LocationHrefUrl","filterString","substring","strippedOriginalUrl","FiltersUsed","PriceRangeIncreased","allPrices","TotalResultsDisplay","total","SetUserAddress","trackMetric","metricName","count","IncrementNotifications","history","pushState","ajax","contentType","dataType","success","newRowCount","extend","throttle","FormatPhone","phone","isNaN","FormatFloorPlanTypes","types","typeArray","consecutive","GetTitleClass","GetImage","Image","preset","imageDomain","UpdatePriceRange","index","bindingHandlers","afterRenderWireups","update","valueAccessor","allBindingsAccessor","unwrapObservable","unbind","mouseenter","showInfoWindow","featuredIconCommunities","IsFeaturedIcon","log","GetFeaturedIconCommunities","trackedImpressions","copyFilterLink","isMobile","jqElem","navigator","clipboard","alert","originalTitle","originalHtml","writeText","then","destroyTimeout","impressions","inArray","keydown","keyCode","parents","stopPropagation","is","isNeighborhoodFilter","isRegionFilter","custom","tempFilters","tempNeighborhoods","neighborhoodIDs","thisLabel","labelText","change","BindBathroomSlider","off","applyBindings","tooltip","mapLoaded","hide","show","slideDown","trackedAdViews","HideActiveFilterPanel","slideToggle","tabToOpen","adToTrack","TrackAdViewed","toggleClass","animate","hasRoles","trackSearchFilterUsedEvent","filterName","ev","contains","key","checked","listingsObserver","IntersectionObserver","entries","entry","isIntersecting","rootMargin","threshold","listingObserverTarget","observe","reload"],"sources":["showcase-listings.js"],"m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rl;\nvar numberOfItemsToShowPerPage;\nglobalThis.showcaseItemID = (_a = globalThis.showcaseItemID) !== null && _a !== void 0 ? _a : 0;\nvar showMap;\n//let imageDomain : string; --> Declared in apartment-window-types.d.ts\nvar priceRange;\nvar neighborhoods;\nvar bedroomRange;\nvar bathroomRange;\nvar travelTime;\nvar travelBy;\nvar byUnit;\nvar byUnitDefault;\nvar detailsLinkBase;\nvar unitPrices;\nvar roomPrices;\nvar bedrooms;\nvar bathrooms;\nvar polygonCoordinates;\nvar hidePolygon;\nvar cacheKeyRandomString;\nvar neighborhoodMapCenterKey;\nvar neighborhoodMapCenterValue;\nvar clusterMarkers;\nvar clusterQuantity;\nvar brandColorPrimary;\nvar brandColorSecondary;\nvar abShowAlternate;\nvar abMainImageName;\n//var hasRoles: boolean; --> Declared in apartment-window-types.d.ts\nvar loggedIn;\nvar cityName;\nvar lastSearchSeen;\nvar featuredIconText;\nvar isInitialLoad;\nvar showInitialKnockoutView;\nvar mapsAreInitialized;\nvar loadingMaps;\n/**\n* This is used to cache the results of the initial page load of showcase items that came from the server-side. We\n* are doing this so that when we make initialize the javascript knockout view model, the data we fetch comes\n* back with the exact same results to avoid any flickering or changes in the UI.\n*/\nvar resultsCacheKey;\nvar initialItems;\nglobalThis.loaded = false;\nvar trackedABViews = [];\nfeaturedIconText = featuredIconText || \"Icon Community\";\nvar filterEventTracked = false;\nvar initialFilterDisplay = true;\nvar ils;\n(function (ils) {\n var showcaseListings;\n (function (showcaseListings) {\n let cdpClicks = 0;\n let attributeClicks = 0;\n let filterUses = 0;\n showcaseListings.filterUndos = 0;\n let priceUsed = false;\n let bedUsed = false;\n let bathUsed = false;\n let travelTimeUsed = false;\n class FilterItem {\n constructor(attributeID, type, value, title) {\n var self = this;\n this.AttributeID = attributeID;\n this.Title = title;\n this.Type = type;\n this.Value = ko.observable(value);\n this.ClearFilter = () => {\n this.Value(\"\");\n const siblingFilter = $(`input[type=hidden][value=${this.AttributeID}]`).next();\n if (this.Type === \"RangeSlider\")\n ClearRangeSlider(siblingFilter.find(\"> div\"));\n else if (this.Type === \"CheckBoxList\" || this.Type === \"RadioButtonGrid\") {\n siblingFilter.find(\":checkbox\").each(function () {\n ClearCheckBox($(this));\n });\n }\n else if (this.Type === \"DropDown\")\n globalThis.ClearListBoxOrDropDown(siblingFilter);\n else if (this.Type === 'RadioButtonList') {\n $(\".filters input[type='hidden'][value='\" + this.AttributeID + \"']\").nextAll(\"[id*=uxFilterRadioButtonList]\").find(\"input[type='radio']\")\n .each(function () {\n ClearRadioButtonList($(this));\n });\n }\n };\n this.Value.subscribe(function (newValue) {\n showcaseListings.viewModel.FiltersChanged(newValue !== self.Value());\n });\n }\n }\n showcaseListings.FilterItem = FilterItem;\n function GetFilterByID(attributeID) {\n try {\n const attrId = !attributeID ? 0 : parseInt(attributeID);\n let filterItem = ko.utils.arrayFirst(showcaseListings.viewModel.FilterList(), function (item) {\n return item.AttributeID === attrId;\n });\n if (!filterItem) {\n filterItem = new FilterItem(attrId, \"\", \"\", \"\");\n }\n return filterItem;\n }\n catch (e) {\n console.error(e);\n return new FilterItem(0, \"\", \"\", \"\");\n }\n }\n showcaseListings.viewModel = {\n FilterList: ko.observableArray([]),\n FiltersChanged: ko.observable(false),\n ShowMobileFilters: ko.observable(false),\n AddressText: ko.observable($(\"input[id*=uxFilterAddress]\").length > 0 ? $(\"input[id*=uxFilterAddress]\").val() : \"\"),\n AddressLat: ko.observable(null),\n AddressLong: ko.observable(null),\n SearchText: ko.observable($(\"input[id*=uxSearchText]\").val()),\n PageNumber: ko.observable(1),\n PageSize: ko.observable(numberOfItemsToShowPerPage),\n TotalRowCount: ko.observable(0),\n Loading: ko.observable(showInitialKnockoutView),\n Listings: ko.observableArray([]),\n LazyLoadedListings: ko.observableArray([]),\n ReadyToLoadData: ko.observable(false),\n PriceRange: ko.observable(priceRange),\n PriceRangeAdds: ko.observableArray([0, 0]),\n ByUnit: ko.observable(byUnit),\n Neighborhoods: ko.observable(neighborhoods),\n BedroomRange: ko.observable(bedroomRange),\n BathroomRange: ko.observable(bathroomRange),\n TravelTime: ko.observable(travelTime),\n TravelBy: ko.observable(travelBy),\n Zipcode: ko.observable(zipcode),\n ManagementCompanyID: ko.observable(managementCompanyID),\n PolygonCoordinates: ko.observable(\"\"),\n Favorites: ko.observableArray([]),\n Trash: ko.observableArray([]),\n MapMode: ko.observable(null),\n Error: ko.observable(null),\n PriceMin: ko.observable(null),\n PriceMax: ko.observable(null),\n BedroomMin: ko.observable(null),\n BedroomMax: ko.observable(null),\n BathroomMin: ko.observable(null),\n BathroomMax: ko.observable(null),\n FeaturedIcons: ko.observableArray([]),\n ShowKnockoutView: ko.observable(showInitialKnockoutView),\n OriginalLocationHref: ko.observable(location.href),\n MobileFilterPendingRefresh: ko.observable(false)\n };\n showcaseListings.viewModel.ActiveFilters = ko.computed(function () {\n return ko.utils.arrayFilter(showcaseListings.viewModel.FilterList(), function (item) {\n return item.Value() !== \"\";\n });\n });\n showcaseListings.viewModel.Filter = ko.computed(function () {\n var allFilters = [];\n ko.utils.arrayForEach(showcaseListings.viewModel.ActiveFilters(), function (item) {\n allFilters.push(`${item.AttributeID}:${item.Value()}|`);\n });\n return allFilters.join(\"\").replace(/\\|*$/, \"\");\n });\n showcaseListings.viewModel.LastIndexVisible = ko.computed(function () {\n return showcaseListings.viewModel.PageNumber() * showcaseListings.viewModel.PageSize() > showcaseListings.viewModel.TotalRowCount() ? showcaseListings.viewModel.TotalRowCount() : showcaseListings.viewModel.PageNumber() * showcaseListings.viewModel.PageSize();\n });\n showcaseListings.viewModel.NextEnabled = ko.computed(function () {\n return (showcaseListings.viewModel.LastIndexVisible() > showcaseListings.viewModel.TotalRowCount() ? showcaseListings.viewModel.TotalRowCount() : showcaseListings.viewModel.LastIndexVisible()) !== showcaseListings.viewModel.TotalRowCount();\n });\n showcaseListings.viewModel.ZipcodeClean = ko.computed(function () {\n return showcaseListings.viewModel.Zipcode() === \"All\" ? \"\" : showcaseListings.viewModel.Zipcode();\n });\n showcaseListings.viewModel.ManagementCompanyIDClean = ko.computed(function () {\n return showcaseListings.viewModel.ManagementCompanyID() === \"All\" ? \"\" : showcaseListings.viewModel.ManagementCompanyID();\n });\n /**\n * Displays the next page of listings based on what's in the current viewModel.LazyLoadedListings() and\n * updates the view model.\n * If the next page is enabled, it increments the page number and performs necessary operations.\n * If showMap and mapsAreInitialized are true, it iterates through the lazy loaded listings and calls\n * codeAddress for each listing.\n * Finally, it updates the view and adds the lazy loaded listings to the main listings array.\n * @returns {Promise}\n */\n async function ShowNextPage() {\n if (!showcaseListings.viewModel.NextEnabled()) {\n return;\n }\n showcaseListings.viewModel.PageNumber(showcaseListings.viewModel.PageNumber() + 1);\n if (showMap && mapsAreInitialized) {\n for (let i = 0; i < showcaseListings.viewModel.LazyLoadedListings().length; i++) {\n const currentIndex = i;\n showcaseListings.codeAddress(showcaseListings.viewModel.LazyLoadedListings()[currentIndex], i === showcaseListings.viewModel.LazyLoadedListings().length - 1);\n }\n }\n showcaseListings.viewModel.ShowKnockoutView(true);\n for (let i = 0; i < showcaseListings.viewModel.LazyLoadedListings().length; i++) {\n showcaseListings.viewModel.Listings.push(showcaseListings.viewModel.LazyLoadedListings()[i]);\n }\n await LazyLoadNextPage();\n }\n showcaseListings.viewModel.NextClicked = function () {\n ShowNextPage();\n return false;\n };\n showcaseListings.viewModel.MapMode.subscribe(function (newValue) {\n showcaseListings.drawingManager.setDrawingMode(newValue === \"polygon\" ? google.maps.drawing.OverlayType.POLYGON : null);\n if (showcaseListings.map) {\n showcaseListings.map.setOptions({ draggableCursor: (newValue === \"freeform\" ? \"crosshair\" : null), draggable: newValue !== \"freeform\" });\n if (showcaseListings.isDrawing && showcaseListings.polyline)\n google.maps.event.trigger(showcaseListings.polyline, \"mouseup\");\n }\n });\n showcaseListings.viewModel.EncodedPolygon = ko.computed(function () {\n return showcaseListings.viewModel.PolygonCoordinates() && showcaseListings.viewModel.PolygonCoordinates() !== \"\" && ((typeof (showcaseListings.polyline) != \"undefined\" && showcaseListings.polyline) || (typeof (showcaseListings.polygon) != \"undefined\" && showcaseListings.polygon)) ? google.maps.geometry.encoding.encodePath((showcaseListings.polyline && showcaseListings.polyline.getPath().getArray().length > 0 ? showcaseListings.polyline : showcaseListings.polygon).getPath().getArray()) : \"\";\n });\n showcaseListings.viewModel.FilterString = ko.computed(function () {\n const queryParams = new URLSearchParams(); // Use URLSearchParams to manage query parameters\n function removeDuplicateValues(value) {\n if (!value)\n return value;\n const uniqueValues = [...new Set(value.split(\",\"))];\n return uniqueValues.join(\",\");\n }\n // Add parameters if they exist and are valid\n if (showcaseListings.viewModel.PriceRange())\n queryParams.append(\"PriceRange\", showcaseListings.viewModel.PriceRange());\n if (showcaseListings.viewModel.ByUnit() !== byUnitDefault)\n queryParams.append(\"ByUnit\", showcaseListings.viewModel.ByUnit().toString());\n if (showcaseListings.viewModel.BedroomRange())\n queryParams.append(\"Bedrooms\", showcaseListings.viewModel.BedroomRange());\n if (showcaseListings.viewModel.BathroomRange())\n queryParams.append(\"Bathrooms\", showcaseListings.viewModel.BathroomRange());\n if (showcaseListings.viewModel.Neighborhoods())\n queryParams.append(\"Neighborhoods\", showcaseListings.viewModel.Neighborhoods());\n if (showcaseListings.viewModel.Filter())\n queryParams.append(\"Filters\", showcaseListings.viewModel.Filter());\n if (showcaseListings.viewModel.SearchText())\n queryParams.append(\"SearchText\", showcaseListings.viewModel.SearchText());\n if (showcaseListings.viewModel.ZipcodeClean())\n queryParams.append(\"ZipCode\", showcaseListings.viewModel.ZipcodeClean());\n if (showcaseListings.viewModel.ManagementCompanyIDClean())\n queryParams.append(\"ManagementCompanyID\", showcaseListings.viewModel.ManagementCompanyIDClean());\n if (showcaseListings.viewModel.PolygonCoordinates()) {\n const encodedPolygon = showcaseListings.viewModel.EncodedPolygon().replace(/~/g, \"%7e\");\n queryParams.append(\"maparea\", encodedPolygon);\n }\n // Handle address, travel time, and travel mode\n let address = showcaseListings.viewModel.AddressText().trim();\n if (address) {\n let existingAddress = queryParams.get(\"address\") || \"\";\n let combinedAddresses = `${existingAddress},${address}`;\n address = removeDuplicateValues(combinedAddresses);\n queryParams.set(\"address\", address);\n queryParams.set(\"traveltime\", showcaseListings.viewModel.TravelTime());\n if (showcaseListings.viewModel.TravelBy() !== \"drive\") {\n queryParams.set(\"travelby\", showcaseListings.viewModel.TravelBy());\n }\n }\n // Convert query parameters to string and ensure consistency\n let queryString = queryParams.toString()\n .replace(/%20/g, \"+\") // Replace spaces with '+'\n .replace(/^\\?+/, \"\") // Remove duplicate '?' on start\n .replace(/\\?*$/, \"\"); // Remove trailing '?' if any\n return queryString ? `${queryString}` : \"\";\n });\n showcaseListings.viewModel.LinkToThisPage = ko.computed(function () {\n return (filterLessUrl + (filterLessUrl.indexOf(\"?\") <= -1 ? \"?\" : \"&\") + showcaseListings.viewModel.FilterString()).replace(\"?&\", \"?\").replace(/\\?*$/, \"\");\n });\n showcaseListings.viewModel.LocationHrefUrl = ko.computed(() => {\n try {\n const filterString = showcaseListings.viewModel.FilterString().replace('?&', '?').replace(/\\?*$/, \"\");\n if (!filterString) {\n if (showcaseListings.viewModel.OriginalLocationHref().indexOf('?') <= -1) {\n return showcaseListings.viewModel.OriginalLocationHref();\n }\n return showcaseListings.viewModel.OriginalLocationHref().substring(0, showcaseListings.viewModel.OriginalLocationHref().indexOf('?'));\n }\n // Build the query string by removing any starting question mark or ampersand from the \"filterQueryString\"\n const queryString = `?${filterString.replace(/\\^?/, '').replace(/\\^&/, '')}`;\n if (showcaseListings.viewModel.OriginalLocationHref().indexOf('?') <= -1) {\n const finalUrl = `${showcaseListings.viewModel.OriginalLocationHref()}${queryString}`;\n return finalUrl;\n }\n const strippedOriginalUrl = showcaseListings.viewModel.OriginalLocationHref().substring(0, showcaseListings.viewModel.OriginalLocationHref().indexOf('?'));\n const resultUrl = `${strippedOriginalUrl}${queryString}`;\n return resultUrl;\n }\n catch (error) {\n console.error(error);\n return showcaseListings.viewModel.LinkToThisPage();\n }\n });\n showcaseListings.viewModel.FiltersUsed = ko.computed(function () {\n return showcaseListings.viewModel.Filter() !== \"\" || showcaseListings.viewModel.SearchText() !== \"\" || showcaseListings.viewModel.AddressLat() != null || showcaseListings.viewModel.AddressLong() != null || showcaseListings.viewModel.PriceRange() !== \"\" || showcaseListings.viewModel.Neighborhoods() !== \"\" || showcaseListings.viewModel.BedroomRange() !== \"\" || showcaseListings.viewModel.BathroomRange() !== \"\" || showcaseListings.viewModel.ZipcodeClean() !== \"\" || (showcaseListings.viewModel.ManagementCompanyIDClean() != null && showcaseListings.viewModel.ManagementCompanyIDClean() !== \"\") || showcaseListings.viewModel.PolygonCoordinates() !== \"\";\n });\n showcaseListings.viewModel.PriceRangeIncreased = ko.computed(function () {\n if (!showcaseListings.viewModel.PriceRange())\n return null;\n const allPrices = showcaseListings.viewModel.ByUnit() ? unitPrices : roomPrices;\n return [Math.max(parseInt(showcaseListings.viewModel.PriceRange().split(\"-\")[0]) - 100, allPrices[0]) + \"-\" + Math.min(parseInt(showcaseListings.viewModel.PriceRange().split(\"-\")[1]) + 100, allPrices[allPrices.length - 1]), Math.max(parseInt(showcaseListings.viewModel.PriceRange().split(\"-\")[0]) - 50, allPrices[0]) + \"-\" + Math.min(parseInt(showcaseListings.viewModel.PriceRange().split(\"-\")[1]) + 50, allPrices[allPrices.length - 1])];\n });\n showcaseListings.viewModel.TotalResultsDisplay = ko.computed(function () {\n const total = showcaseListings.viewModel.TotalRowCount();\n if (total <= 0)\n return \"\";\n return `(${total})`;\n });\n // Watch the filters for changes\n showcaseListings.viewModel.AddressText.subscribe(function () {\n showcaseListings.SetUserAddress();\n });\n showcaseListings.viewModel.AddressLat.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.AddressLong.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.TravelTime.subscribe(function () {\n if (showcaseListings.viewModel.AddressLat() != null && showcaseListings.viewModel.AddressLong() != null)\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.TravelBy.subscribe(function () {\n if (showcaseListings.viewModel.AddressLat() != null && showcaseListings.viewModel.AddressLong() != null)\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.SearchText.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.Filter.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.PriceRange.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.ByUnit.subscribe(function () {\n if (showcaseListings.viewModel.PriceRange() !== \"\")\n showcaseListings.viewModel.PriceRange(\"\");\n BindPriceSlider();\n });\n showcaseListings.viewModel.Neighborhoods.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.BedroomRange.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.BathroomRange.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.Zipcode.subscribe(function (newValue) {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.ManagementCompanyID.subscribe(function (newValue) {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.PolygonCoordinates.subscribe(function () {\n showcaseListings.viewModel.FiltersChanged(true);\n });\n showcaseListings.viewModel.PriceMin.subscribe(function () {\n MobileUpdatePriceRange();\n });\n showcaseListings.viewModel.PriceMax.subscribe(function () {\n MobileUpdatePriceRange();\n });\n showcaseListings.viewModel.BedroomMin.subscribe(function () {\n MobileUpdateBedroomRange();\n });\n showcaseListings.viewModel.BedroomMax.subscribe(function () {\n MobileUpdateBedroomRange();\n });\n showcaseListings.viewModel.BathroomMin.subscribe(function () {\n MobileUpdateBathroomRange();\n });\n showcaseListings.viewModel.BathroomMax.subscribe(function () {\n MobileUpdateBathroomRange();\n });\n function MobileUpdatePriceRange() {\n if (showcaseListings.viewModel.PriceMin() === $(\"#uxPriceMin option:first\").val() && showcaseListings.viewModel.PriceMax() === $(\"#uxPriceMin option:last\").val())\n showcaseListings.viewModel.PriceRange(\"\");\n else\n showcaseListings.viewModel.PriceRange(showcaseListings.viewModel.PriceMin() + \"-\" + showcaseListings.viewModel.PriceMax());\n $(\"#uxPriceMin option\").each(function () {\n if (parseInt($(this).val()) <= parseInt(showcaseListings.viewModel.PriceMax()))\n $(this).removeAttr(\"disabled\");\n else\n $(this).prop(\"disabled\", \"disabled\");\n });\n $(\"#uxPriceMax option\").each(function () {\n if (parseInt($(this).val()) >= parseInt(showcaseListings.viewModel.PriceMin()))\n $(this).removeAttr(\"disabled\");\n else\n $(this).prop(\"disabled\", \"disabled\");\n });\n }\n function MobileUpdateBedroomRange() {\n if (showcaseListings.viewModel.BedroomMin() === $(\"#uxBedroomMin option:first\").val() && showcaseListings.viewModel.BedroomMax() === $(\"#uxBedroomMin option:last\").val())\n showcaseListings.viewModel.BedroomRange(\"\");\n else\n showcaseListings.viewModel.BedroomRange(showcaseListings.viewModel.BedroomMin() + \"-\" + showcaseListings.viewModel.BedroomMax());\n $(\"#uxBedroomMin option\").each(function () {\n if (parseInt($(this).val()) <= parseInt(showcaseListings.viewModel.BedroomMax()))\n $(this).removeAttr(\"disabled\");\n else\n $(this).prop(\"disabled\", \"disabled\");\n });\n $(\"#uxBedroomMax option\").each(function () {\n if (parseInt($(this).val()) >= parseInt(showcaseListings.viewModel.BedroomMin()))\n $(this).removeAttr(\"disabled\");\n else\n $(this).prop(\"disabled\", \"disabled\");\n });\n }\n function MobileUpdateBathroomRange() {\n if (showcaseListings.viewModel.BathroomMin() === $(\"#uxBathroomMin option:first\").val() && showcaseListings.viewModel.BathroomMax() === $(\"#uxBathroomMin option:last\").val())\n showcaseListings.viewModel.BathroomRange(\"\");\n else\n showcaseListings.viewModel.BathroomRange(showcaseListings.viewModel.BathroomMin() + \"-\" + showcaseListings.viewModel.BathroomMax());\n $(\"#uxBathroomMin option\").each(function () {\n if (parseInt($(this).val()) <= parseInt(showcaseListings.viewModel.BathroomMax()))\n $(this).removeAttr(\"disabled\");\n else\n $(this).prop(\"disabled\", \"disabled\");\n });\n $(\"#uxBathroomMax option\").each(function () {\n if (parseInt($(this).val()) >= parseInt(showcaseListings.viewModel.BathroomMin()))\n $(this).removeAttr(\"disabled\");\n else\n $(this).prop(\"disabled\", \"disabled\");\n });\n }\n ko.computed(function () {\n if (showcaseListings.viewModel.FiltersChanged() && showcaseListings.viewModel.ReadyToLoadData()) {\n if (!filterEventTracked && globalThis.loaded) {\n ils.trackMetric({ metricName: \"Listing Page Filters Used\", count: 1 });\n //ga(\"send\", \"event\", \"FiltersUsed\", \"click\", \"1\");\n filterEventTracked = true;\n if (lastSearchSeen)\n IncrementNotifications();\n }\n // Change the URL to include the query string parameters so the user can share a link\n if (!isInitialLoad) {\n history.pushState(null, null, showcaseListings.viewModel.LocationHrefUrl());\n LoadNewSet();\n }\n }\n });\n ko.computed(function () {\n if (!showcaseListings.viewModel.Loading() && showcaseListings.viewModel.TotalRowCount() <= 3 && showcaseListings.viewModel.PriceRange() && showcaseListings.viewModel.ReadyToLoadData())\n $.ajax({\n type: \"POST\",\n url: globalThis.baseUrl + \"TftServices/Showcase/ShowcaseWebMethods.asmx/LoadMoreItems\",\n data: GetNextPageRequestJSON(1, showcaseListings.viewModel.PriceRangeIncreased()[0]),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data) {\n const newRowCount = data.d.length > 0 ? data.d[0].TotalRowCount : 0;\n showcaseListings.viewModel.PriceRangeAdds([newRowCount - showcaseListings.viewModel.TotalRowCount()]);\n },\n error: function () {\n showcaseListings.viewModel.PriceRangeAdds([0, 0]);\n }\n });\n }).extend({ throttle: 100 });\n async function LoadNewSet() {\n showcaseListings.viewModel.PageNumber(1);\n await LoadNextSet();\n if (isInitialLoad || showcaseListings.viewModel.LazyLoadedListings().length < 1) {\n await LazyLoadNextPage();\n }\n isInitialLoad = false;\n // If we are going to Load a new set then we need to page through and get all results. This is the\n // business rule for the showcase listings pages so that the map on desktop can show all results.\n try {\n globalThis.currentFilter = GetFilterJSONString();\n await ShowNextPage();\n const maxNumberOfLoops = Math.ceil(showcaseListings.viewModel.TotalRowCount() / showcaseListings.viewModel.PageSize());\n for (let countOfLoops = 0; showcaseListings.viewModel.TotalRowCount() > showcaseListings.viewModel.Listings().length && countOfLoops < maxNumberOfLoops; countOfLoops++) {\n await ShowNextPage();\n }\n }\n catch (error) {\n console.error(`Error during final loading of communities: ${error}`);\n }\n }\n showcaseListings.LoadNewSet = LoadNewSet;\n function ReplaceQuotes(text) {\n return text.replace(/\\\"/g, \"\");\n }\n function FormatPhone(phone) {\n if (!phone || phone.length < 10 || isNaN(phone))\n return phone;\n return `(${phone.substring(0, 3)}) ${phone.substring(3, 6)}-${phone.substring(6)}`;\n }\n showcaseListings.FormatPhone = FormatPhone;\n function FormatFloorPlanTypes(types) {\n if (!types)\n return types;\n const typeArray = types.split(\",\");\n var consecutive = true;\n for (let i = 1; i < typeArray.length; i++) {\n if (parseInt(typeArray[i]) !== (parseInt(typeArray[i - 1]) + 1))\n consecutive = false;\n }\n return (consecutive ? (typeArray[0] === typeArray[typeArray.length - 1] ? (typeArray[0] === 0 ? \"Studios\" : typeArray[0] + \" BR\") : `${typeArray[0] === 0 ? \"Studio\" : typeArray[0]} to ${typeArray[typeArray.length - 1]} BR`) : `${types.replace(/,/g, \", \").replace(/,([^,]*)$/, \" and $1\")} BR`);\n }\n showcaseListings.FormatFloorPlanTypes = FormatFloorPlanTypes;\n function GetTitleClass(Title) {\n return Title.length >= 20 ? `long${Title.length >= 23 ? \" super-long\" : \"\"}` : Title.length >= 18 ? \"long-mobile\" : \"\";\n }\n showcaseListings.GetTitleClass = GetTitleClass;\n function GetImage(Image, ABTestImage, preset) {\n return `${globalThis.imageDomain}uploads/images/${ABTestImage && abShowAlternate ? ABTestImage : Image}${preset ? preset : `?preset=community${ABTestImage && abShowAlternate ? \"&mode=crop\" : \"\"}`}`;\n }\n showcaseListings.GetImage = GetImage;\n function ClearFilter(attributeID) {\n GetFilterByID(attributeID).ClearFilter();\n }\n showcaseListings.ClearFilter = ClearFilter;\n function ClearTravelTimeFilter() {\n showcaseListings.viewModel.ReadyToLoadData(false);\n showcaseListings.viewModel.AddressLat(null);\n showcaseListings.viewModel.AddressLong(null);\n showcaseListings.viewModel.TravelTime(\"30\");\n showcaseListings.viewModel.TravelBy(\"drive\");\n showcaseListings.viewModel.AddressText(\"\");\n showcaseListings.viewModel.ReadyToLoadData(true);\n }\n showcaseListings.ClearTravelTimeFilter = ClearTravelTimeFilter;\n function ClearManagementCompany() {\n showcaseListings.viewModel.ManagementCompanyID(\"All\");\n }\n showcaseListings.ClearManagementCompany = ClearManagementCompany;\n function ClearPriceFilter() {\n if (breakpoint() === \"mobile\" && !isTablet()) {\n ClearMobileDropdownFilter($(\"#uxPriceMin\").parent());\n ClearMobileDropdownFilter($(\"#uxPriceMax\").parent());\n var minValue = $('#uxPriceMin option:selected').text().replace('$', '');\n var maxValue = $('#uxPriceMax option:selected').text().replace('$', '');\n showcaseListings.viewModel.PriceMax(maxValue);\n showcaseListings.viewModel.PriceMin(minValue);\n showcaseListings.viewModel.PriceRange(minValue + '-' + maxValue);\n return;\n }\n let sliderElement = $(\"#uxPriceRangeSlider\");\n ClearRangeSlider(sliderElement);\n sliderElement.find(\".handle-text:first\").html(`$${sliderElement.slider(\"option\", \"min\")}`);\n sliderElement.find(\".handle-text:last\").html(`$${sliderElement.slider(\"option\", \"max\")}`);\n showcaseListings.viewModel.PriceRange(\"\");\n }\n showcaseListings.ClearPriceFilter = ClearPriceFilter;\n function ClearBedroomFilter() {\n if (breakpoint() === \"mobile\" && !isTablet()) {\n ClearMobileDropdownFilter($(\"#uxBedroomMin\").parent());\n return;\n }\n const sliderElement = $(\"#uxBedroomRangeSlider\");\n ClearRangeSlider(sliderElement);\n sliderElement.find(\".handle-text:first\").html(FormatBedroomText(sliderElement.slider(\"option\", \"min\")));\n sliderElement.find(\".handle-text:last\").html(FormatBedroomText(sliderElement.slider(\"option\", \"max\")));\n showcaseListings.viewModel.BedroomRange(\"\");\n }\n showcaseListings.ClearBedroomFilter = ClearBedroomFilter;\n function ClearBathroomFilter() {\n if (breakpoint() === \"mobile\" && !isTablet()) {\n ClearMobileDropdownFilter($(\"#uxBathroomMin\").parent());\n return;\n }\n const sliderElement = $(\"#uxBathroomRangeSlider\");\n ClearRangeSlider(sliderElement);\n sliderElement.find(\".handle-text:first\").html(sliderElement.slider(\"option\", \"min\"));\n sliderElement.find(\".handle-text:last\").html(sliderElement.slider(\"option\", \"max\"));\n showcaseListings.viewModel.BathroomRange(\"\");\n }\n showcaseListings.ClearBathroomFilter = ClearBathroomFilter;\n function ClearNeighborhoodFilter() {\n $(\"input[id*=uxNeighborhoodCheckBoxList]\").each(function () {\n ClearCheckBox($(this));\n });\n showcaseListings.viewModel.Neighborhoods(\"\");\n }\n showcaseListings.ClearNeighborhoodFilter = ClearNeighborhoodFilter;\n function ClearSearchText() {\n showcaseListings.viewModel.SearchText(\"\");\n }\n showcaseListings.ClearSearchText = ClearSearchText;\n function ClearZipcodeFilter() {\n showcaseListings.viewModel.Zipcode(\"All\");\n }\n showcaseListings.ClearZipcodeFilter = ClearZipcodeFilter;\n function ClearMapAreaFilter() {\n {\n if (showcaseListings.polygon)\n showcaseListings.polygon.setMap(null);\n if (showcaseListings.polyline)\n showcaseListings.polyline.setMap(null);\n showcaseListings.viewModel.PolygonCoordinates(\"\");\n }\n }\n showcaseListings.ClearMapAreaFilter = ClearMapAreaFilter;\n function UpdatePriceRange(index) {\n const value1 = parseInt(showcaseListings.viewModel.PriceRangeIncreased()[index].split(\"-\")[0]);\n const value2 = parseInt(showcaseListings.viewModel.PriceRangeIncreased()[index].split(\"-\")[1]);\n showcaseListings.viewModel.PriceRangeAdds([0, 0]);\n const sliderElement = $(\"#uxPriceRangeSlider\");\n try {\n // Attempt to set the slider values - desktop\n sliderElement.slider(\"values\", [value1, value2]);\n sliderElement.find(\".handle-text:first\").html(`$${value1}`);\n sliderElement.find(\".handle-text:last\").html(`$${value2}`);\n }\n catch (error) {\n // If slider fails, fall back to setting data attributes - mobile\n sliderElement.data('value1', value1);\n sliderElement.data('value2', value2);\n sliderElement.attr('data-value1', value1);\n sliderElement.attr('data-value2', value2);\n }\n priceSliderUpdateFilter(sliderElement);\n }\n showcaseListings.UpdatePriceRange = UpdatePriceRange;\n ko.bindingHandlers.afterRenderWireups = {\n // ReSharper disable once UnusedParameter\n update: function (element, valueAccessor, allBindingsAccessor) {\n ko.utils.unwrapObservable(valueAccessor());\n if (!showcaseListings.viewModel.ReadyToLoadData())\n return;\n if (showMap) {\n $(element).find(\"li:visible\").unbind(\"mouseenter\").mouseenter(function () {\n showcaseListings.showInfoWindow($(element).find(\"li:visible\").index($(this)), true);\n });\n }\n }\n };\n /**\n * Loads the next set of showcase items into the view model that shows the listings.\n *\n * @param callbackAfterSuccess A callback function to be executed after the success of loading the items.\n */\n async function LoadNextSet() {\n globalThis.currentFilter = GetFilterJSONString();\n // If this is the initial page load, we already have the showcase items from the server-side so no need to go fetch them again \n if (isInitialLoad) {\n // The globalThis.initialItems is defined in the NewListingPage.ascx.cs code behind around line 522 and then \"rendered\"\n // at the bottom of the NewListingPage.ascx web form page\n await success_method({ d: initialItems });\n showcaseListings.viewModel.Loading(false);\n return;\n }\n try {\n const response = await fetch(globalThis.baseUrl + \"TftServices/Showcase/ShowcaseWebMethods.asmx/LoadMoreItems\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n body: GetNextPageRequestJSON(showcaseListings.viewModel.PageNumber(), showcaseListings.viewModel.PriceRange())\n });\n const data = await response.json();\n success_method(data);\n }\n catch (error) {\n if (showcaseListings.viewModel.PolygonCoordinates())\n showcaseListings.viewModel.Error(\"Please make sure that your shape does not intersect itself.\");\n else\n showcaseListings.viewModel.Error(\"\");\n showcaseListings.viewModel.TotalRowCount(0);\n showcaseListings.viewModel.Listings([]);\n showcaseListings.viewModel.Loading(false);\n isInitialLoad = false;\n }\n async function success_method(data) {\n const results = data.d;\n // If it's a subsequent load, we need to clear the cache key so that the next time we load the data, we get a fresh set of results\n resultsCacheKey = '';\n showcaseListings.viewModel.Error(null);\n if (mapsAreInitialized && showMap && showcaseListings.map != null) {\n showcaseListings.clearMarkers();\n showcaseListings.bounds = null;\n showcaseListings.initializeMap();\n }\n if (results.length === 0) {\n showcaseListings.viewModel.TotalRowCount(0);\n showcaseListings.viewModel.Listings(results);\n showcaseListings.viewModel.FiltersChanged(false);\n showcaseListings.viewModel.Loading(false);\n return;\n }\n else {\n showcaseListings.viewModel.TotalRowCount(results[0].TotalRowCount);\n }\n showcaseListings.viewModel.Listings(results);\n $(\".tab-pane.results\").addClass(\"globalThis.loaded\");\n if (!globalThis.loaded) {\n globalThis.loaded = true;\n if (globalThis.showcaseItemID != null && globalThis.showcaseItemID.toString() !== \"\") {\n let found = false;\n for (let i = 0; i < showcaseListings.viewModel.Listings().length; i++) {\n if (showcaseListings.viewModel.Listings()[i].ShowcaseItemID === globalThis.showcaseItemID) {\n found = true;\n break;\n }\n }\n if (!found)\n $(\".communities\").html(`${$(\".communities\").html()}`);\n $(`.communities a[data-id=${parseInt(globalThis.showcaseItemID.toString())}]`).on('click', communityClick).trigger('click');\n }\n }\n if (breakpoint() !== \"mobile\" || isTablet())\n setTimeout(function () { $(\"#filter-categories\").jcarousel(\"reload\"); }, 100);\n showcaseListings.viewModel.FiltersChanged(false);\n showcaseListings.viewModel.Loading(false);\n showcaseListings.viewModel.ShowKnockoutView((!isInitialLoad && showcaseListings.viewModel.ShowKnockoutView()) || (breakpoint() !== \"mobile\" || isTablet()));\n if (showMap && mapsAreInitialized && showcaseListings.map != null) {\n for (let i = 0; i < results.length; i++) {\n showcaseListings.codeAddress(results[i], i === results.length - 1);\n }\n }\n if (ko.utils.arrayFirst(showcaseListings.viewModel.Listings(), function (item) { return item.ABTestImage && item.ABTestImage !== \"\"; }) != null) {\n const checkAbImageTimeout = setTimeout(function () {\n CheckIfABImageInView();\n clearTimeout(checkAbImageTimeout);\n }, 500);\n }\n var iconTimeout = setTimeout(function () {\n if (shouldToggleIcons) {\n $(\".featured-icon\").removeClass(\"ilsicon ilsicon-star-favorite in-corner-rounded\");\n $(\".featured-icon\").html(featuredIconText);\n $(\".featured-icon\").addClass(\"in-corner-spotlight\");\n }\n HookupCommunityEventHandlers();\n clearTimeout(iconTimeout);\n }, 250);\n }\n }\n showcaseListings.LoadNextSet = LoadNextSet;\n function CheckIfABImageInView() {\n if ((breakpoint() === \"mobile\" && !isTablet() && $(\".mobile-tab.results.active\").length === 0) || showcaseListings.viewModel.Listings().length === 0)\n return;\n var yValueToCheck = breakpoint() === \"mobile\" && !isTablet()\n ? $(window).scrollTop() + $(window).height()\n : $(\".filters-results\").height();\n document.querySelectorAll(\".filters-results .community[data-has-ab]\").forEach(function (element) {\n if (element.offsetTop <= yValueToCheck && trackedABViews.indexOf(element.dataset.id) === -1) {\n trackedABViews.push(element.getAttribute(\"data-id\"));\n ils.trackABImageImpression({\n communityId: parseInt(element.dataset.id),\n imageName: `${abMainImageName}View`,\n testContext: (abShowAlternate ? \"alternate\" : \"main\"),\n communityName: element.dataset.title,\n });\n //ga(\"send\", \"event\", `${abMainImageName}View`, (abShowAlternate ? \"alternate\" : \"main\"), element.getAttribute(\"data-id\"));\n }\n });\n }\n function GetFilterJSONString() {\n return ko.toJSON([resultsCacheKey, showcaseListings.viewModel.PageSize(), showcaseListings.viewModel.Filter(), showcaseListings.viewModel.AddressLat(), showcaseListings.viewModel.AddressLong(), showcaseListings.viewModel.TravelTime(), showcaseListings.viewModel.TravelBy(), showcaseListings.viewModel.SearchText(), showcaseListings.viewModel.PriceRange(), showcaseListings.viewModel.ByUnit(), showcaseListings.viewModel.Neighborhoods(), showcaseListings.viewModel.BedroomRange(), showcaseListings.viewModel.BathroomRange(), showcaseListings.viewModel.ZipcodeClean(), showcaseListings.viewModel.ManagementCompanyIDClean(), showcaseListings.viewModel.PolygonCoordinates()]);\n }\n function GetNextPageRequestJSON(pageNumber, priceRange) {\n return `{pageSize: ${showcaseListings.viewModel.PageSize()}, pageNumber: ${pageNumber}, filters: \"${showcaseListings.viewModel.Filter()}\", addressLat: ${showcaseListings.viewModel.AddressLat()}, addressLong: ${showcaseListings.viewModel.AddressLong()}, travelTime: ${showcaseListings.viewModel.TravelTime()}, travelBy: \"${showcaseListings.viewModel.TravelBy()}\", searchText: \"${showcaseListings.viewModel.SearchText()}\", priceRange: \"${priceRange}\", priceByUnit: ${showcaseListings.viewModel.ByUnit()}, neighborhoods: \"${showcaseListings.viewModel.Neighborhoods()}\", bedroomRange: \"${showcaseListings.viewModel.BedroomRange()}\", bathroomRange: \"${showcaseListings.viewModel.BathroomRange()}\", zipcode: ${showcaseListings.viewModel.ZipcodeClean() !== \"\" ? `\"${showcaseListings.viewModel.ZipcodeClean()}\"` : null}, managementCompanyID: ${showcaseListings.viewModel.ManagementCompanyIDClean() === \"\" ? null : showcaseListings.viewModel.ManagementCompanyIDClean()}, polygonCoordinates: \"${showcaseListings.viewModel.PolygonCoordinates()}\", cacheKeyRandomString: \"${cacheKeyRandomString}\", filterString: \"${showcaseListings.viewModel.FilterString()}\", resultsCacheKey: \"${resultsCacheKey}\"}`;\n }\n async function LazyLoadNextPage() {\n if (!showcaseListings.viewModel.NextEnabled() || showcaseListings.viewModel.Listings().length >= showcaseListings.viewModel.TotalRowCount()) {\n // Clear out the array so that the scrolling doesn't keep trying to load the same final set of items into view\n showcaseListings.viewModel.LazyLoadedListings([]);\n return;\n }\n var thisFilter = GetFilterJSONString();\n try {\n const response = await fetch(globalThis.baseUrl + \"TftServices/Showcase/ShowcaseWebMethods.asmx/LoadMoreItems\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\"\n },\n body: GetNextPageRequestJSON(showcaseListings.viewModel.PageNumber() + 1, showcaseListings.viewModel.PriceRange())\n });\n const data = await response.json();\n lazy_success_method(data);\n }\n catch (error) {\n console.error('Error fetching more showcase items:', error);\n }\n function lazy_success_method(data) {\n const results = data.d;\n showcaseListings.viewModel.LazyLoadedListings(results);\n }\n }\n function EscapeFilter(filterValue) {\n return filterValue.toLowerCase().replace(/\\,/g, \"[COMMA]\").replace(/\\:/g, \"[COLON]\").replace(/\\|/g, \"[PIPE]\").replace(/\\/g, \"[GREATERTHAN]\");\n }\n function CleanupFilter(filterValue) {\n return filterValue.toLowerCase().replace(/\\,*$/, \"\").replace(/\\,\\,/, \",\").replace(/^\\,/, \"\");\n }\n function GetAttributeID(element) {\n return element.prev();\n }\n function GetFeaturedIconCommunities() {\n try {\n $.ajax({\n type: \"POST\",\n url: globalThis.baseUrl + \"api/showcase/load-featured-icons\",\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data) {\n const featuredIconCommunities = [];\n for (let i = 0; i < data.d.length; i++) {\n if (data.d[i].IsFeaturedIcon) {\n featuredIconCommunities.push(data.d[i].ShowcaseItemID);\n }\n }\n showcaseListings.viewModel.FeaturedIcons(featuredIconCommunities);\n }\n });\n }\n catch (e) {\n console.error(e);\n console.log(\"Previous exception was caught and swallowed\");\n }\n }\n document.addEventListener('DOMContentLoaded', async function () {\n showcaseListings.viewModel.OriginalLocationHref(window.location.href);\n GetFeaturedIconCommunities();\n var trackedImpressions = [];\n $(\"[data-impressions]\").on('click', function () {\n const impressions = $(this).data(\"impressions\");\n if ($.inArray(impressions, trackedImpressions) === -1) {\n $.ajax({\n type: \"POST\",\n url: globalThis.baseUrl + \"TftServices/Showcase/ShowcaseWebMethods.asmx/TrackAttributeImpression\",\n data: `{ showcaseAttributeValueID: [${impressions}]}`,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\"\n });\n trackedImpressions.push(impressions);\n }\n });\n $(\"input[id*=uxFilterAddress], input[id*=uxSearchText]\").keydown(function (event) {\n if (event.keyCode === 13)\n $(this).trigger(\"change\").trigger(\"blur\");\n return event.keyCode !== 13;\n });\n //Begin Filters\n $(\".filters input[id*=uxFilterRadioButtonList]\").on('click', function (e) {\n if ($(this).val() !== \"\") {\n const attributeID = GetAttributeID($(this).parents(\".radiobuttons\"));\n const currentFilterItem = GetFilterByID(attributeID.val());\n if ($(this).val() !== \"all\")\n currentFilterItem.Value(EscapeFilter($(this).val()));\n else\n currentFilterItem.Value(\"\");\n e.stopPropagation();\n }\n });\n $(\".filters .checkboxes li\").on('click', function (e) {\n if ($(e.target).is(\"li\"))\n $(e.target).find(\"input\").trigger('click');\n });\n $(\".filters input[id*=CheckBoxList]\").on('click', function () {\n var isNeighborhoodFilter = false;\n var isRegionFilter = false;\n if ($(this).parents(\"[id*=uxRegionCheckBoxList]\").length > 0)\n isRegionFilter = true;\n if ($(this).parents(\"[id*=uxNeighborhoodCheckBoxList]\").length > 0)\n isNeighborhoodFilter = true;\n var custom = isNeighborhoodFilter || isRegionFilter;\n var attributeID = GetAttributeID($(this).parents(\".checkboxes\"));\n var currentFilter = GetFilterByID(attributeID.val());\n if ($(this).is(\":checked\")) {\n var tempFilters = \"\";\n var tempNeighborhoods = \"\";\n $(this).parents(\".checkboxes\").find(\":checkbox:checked\").each(function () {\n if (!custom)\n tempFilters += EscapeFilter($(this).siblings().text()) + \"[yes],\";\n else if (isNeighborhoodFilter)\n tempNeighborhoods += $(this).parent().data(\"id\") + \",\";\n else if (isRegionFilter)\n tempNeighborhoods += $(this).parent().find(\"[type=hidden]\").val() + \",\";\n });\n if (!custom)\n currentFilter.Value(CleanupFilter(tempFilters));\n else\n showcaseListings.viewModel.Neighborhoods(tempNeighborhoods.replace(/\\,*$/, \"\"));\n if (isRegionFilter) {\n let neighborhoodIDs = $(this).parent().find(\"[type=hidden]\").val().split(\",\");\n for (let i = 0; i < neighborhoodIDs.length; i++) {\n $(`[id*=uxNeighborhoodCheckBoxList] span[data-id='${neighborhoodIDs[i]}'] input`).prop(\"checked\", true);\n }\n }\n }\n else {\n var thisLabel = $(`label[for=${$(this).attr(\"id\")}]`);\n var labelText = isNeighborhoodFilter ? ($(this).parent().data(\"id\") ? $(this).parent().data(\"id\").toString() : null) : thisLabel.text();\n if (!custom)\n currentFilter.Value(CleanupFilter(currentFilter.Value().toLowerCase().replace(EscapeFilter(labelText.toLowerCase()) + \"[yes]\", \"\")));\n else if (isNeighborhoodFilter)\n showcaseListings.viewModel.Neighborhoods(showcaseListings.viewModel.Neighborhoods().toLowerCase().replace(labelText.toLowerCase(), \"\").replace(/^\\,/, \"\").replace(/\\,*$/, \"\").replace(/\\,\\,/, \",\"));\n else if (isRegionFilter)\n showcaseListings.viewModel.Neighborhoods(showcaseListings.viewModel.Neighborhoods().toLowerCase().replace($(this).parent().find(\"[type=hidden]\").val().toLowerCase(), \"\").replace(/\\,*$/, \"\").replace(/\\,\\,/, \",\"));\n $(this).siblings().removeClass(\"focused\");\n if (isRegionFilter) {\n let neighborhoodIDs = $(this).parent().find(\"[type=hidden]\").val().split(\",\");\n for (let i = 0; i < neighborhoodIDs.length; i++) {\n $(`[id*=uxNeighborhoodCheckBoxList] span[data-id='${neighborhoodIDs[i]}'] input`).prop(\"checked\", false);\n }\n }\n }\n });\n $(\".filters [id*=uxFilterDropDown]\").change(function () {\n const attributeID = GetAttributeID($(this));\n const currentFilter = GetFilterByID(attributeID.val());\n if ($(this).val() === \"all\")\n currentFilter.Value(\"\");\n else\n currentFilter.Value(EscapeFilter($(this).val()));\n });\n $(\".filter-reset\").on('click', function () {\n showcaseListings.viewModel.ReadyToLoadData(false);\n for (let i = 0; i < showcaseListings.viewModel.FilterList().length; i++) {\n showcaseListings.viewModel.FilterList()[i].Value(\"\");\n }\n ClearPriceFilter();\n ClearBedroomFilter();\n ClearBathroomFilter();\n $(\"[data-slider]\").each(function () {\n if ($(this).data(\"range\"))\n ClearRangeSlider($(this));\n else\n ClearSlider($(this));\n });\n $(\".filters [id*=uxFilterDropDown]\").each(function () {\n ClearListBoxOrDropdown($(this));\n });\n $(\".filters [id*=uxFilterRadioButtonList]\").each(function () {\n ClearRadioButtonList($(this));\n });\n $(\".filters input[id*=uxRadioButtons]\").each(function () {\n ClearRadioButton($(this));\n });\n $(\".filters :checkbox\").each(function () {\n ClearCheckBox($(this));\n });\n ClearSearchText();\n showcaseListings.viewModel.PriceRange(\"\");\n ClearRegionFilter();\n ClearNeighborhoodFilter();\n showcaseListings.viewModel.BedroomRange(\"\");\n showcaseListings.viewModel.BathroomRange(\"\");\n ClearZipcodeFilter();\n ClearManagementCompany();\n ClearMapAreaFilter();\n ClearTravelTimeFilter();\n showcaseListings.viewModel.ReadyToLoadData(true);\n history.pushState(null, null, showcaseListings.viewModel.LocationHrefUrl());\n MobileUpdatePriceRange();\n return false;\n });\n function copyFilterLink(isMobile, jqElem) {\n if (!navigator.clipboard) {\n alert(\"Cannot copy the search link. Your browser doesn't support it. Please manually copy the URL in the browser's address bar instead.\");\n return false;\n }\n const originalTitle = jqElem.attr('title');\n const originalHtml = jqElem.html();\n jqElem.attr('title', '');\n navigator.clipboard.writeText(showcaseListings.viewModel.LocationHrefUrl())\n .then(() => {\n jqElem.html(` Copied!`);\n });\n var destroyTimeout = setTimeout(() => {\n jqElem.attr('title', originalTitle);\n jqElem.html(originalHtml);\n clearTimeout(destroyTimeout);\n }, 2250);\n return false;\n }\n $(\".copy-filter-link\").on('click', function () {\n return copyFilterLink(false, $(this));\n });\n $(\".copy-filter-link-mobile\").on('click', function () {\n return copyFilterLink(true, $(this));\n });\n // If we're on a desktop, we need to bind the sliders, load the map scripts, and ensure the communities are loaded correctly\n if (breakpoint() !== \"mobile\" || isTablet()) {\n BindPriceSlider();\n BindBedroomSlider();\n BindBathroomSlider();\n ils.loadMapScripts(async function () {\n await finalizeInitialLoad();\n });\n }\n // Otherwise we simply pre-load the map scripts and make sure the communities are loaded correctly\n else {\n showcaseListings.viewModel.ShowKnockoutView(true);\n ils.loadMapScripts(async function () {\n showMap = false;\n await finalizeInitialLoad();\n loadingMaps = false;\n isInitialLoad = false;\n showMap = true;\n });\n showcaseListings.viewModel.MobileFilterPendingRefresh(true);\n }\n $(\".link-to-page\").on('click', function () {\n $(this).trigger('select');\n $(this).on('mouseup', function () {\n $(this).off(\"mouseup\");\n return false;\n });\n });\n ko.applyBindings(showcaseListings.viewModel);\n $(\"[data-slider]\").each(function () {\n var sliderElement = $(this);\n const values = sliderElement.data(\"values\");\n var range = $(this).data(\"range\");\n if (range == null)\n range = false;\n var value1 = $(this).data(\"value1\") ? $(this).data(\"value1\") : values[0];\n var value2 = $(this).data(\"value2\") ? $(this).data(\"value2\") : values[values.length - 1];\n $(this).removeAttr(\"data-values\").removeAttr(\"data-value1\").removeAttr(\"data-value2\");\n sliderElement.slider({\n range: range,\n min: values[0],\n max: values[values.length - 1],\n values: [value1, value2],\n create: function (event, ui) {\n if (sliderElement.find(\".handle-text\").length === 0)\n sliderElement.find(\".ui-slider-handle\").append('');\n sliderElement.find(\".handle-text:first\").html(value1);\n if (range) {\n sliderElement.find(\".handle-text:last\").html(value2);\n sliderElement.find(\".ui-slider-handle:last\").addClass(\"reverse\");\n }\n UnstackSliderLabels(sliderElement.find(\".ui-slider-handle:first\"), value1, value2);\n if (range)\n rangeSliderUpdateFilter(sliderElement);\n else\n sliderUpdateFilter(sliderElement);\n },\n slide: function (event, ui) {\n const handle = $(ui.handle);\n handle.find(\".handle-text\").html(ui.value.toString());\n if (range)\n UnstackSliderLabels(handle, ui.values[0], ui.values[1]);\n },\n stop: function (event, ui) {\n if (range)\n rangeSliderUpdateFilter(sliderElement);\n else\n sliderUpdateFilter(sliderElement);\n }\n });\n });\n $(\".add-tooltip\").tooltip();\n $(window).on(\"resize\", function () {\n globalThis.mapLoaded = false;\n ThingsToDoOnResize();\n });\n ThingsToDoOnResize();\n HookupCommunityEventHandlers();\n if ($(\"#prefiltered-content\").height() < 115)\n $(\".expander\").hide();\n $(\".collapser\").on('click', function () {\n $(\"#prefiltered-content\").hide();\n $(\".showcase-title\").outerWidth(\"\");\n $(\"#prefiltered-content\").removeClass(\"mid\");\n $(\".showcase-title\").addClass(\"minimized\");\n $(this).hide();\n $(\".expander\").show();\n return false;\n });\n $(\".expander\").on('click', function () {\n $(\".showcase-title\").removeClass(\"minimized\");\n SetTitlePosition();\n $(\"#prefiltered-content\").removeClass(\"mid\").slideDown(\"slow\");\n $(this).hide();\n $(\".collapser\").show();\n return false;\n });\n var trackedAdViews = [];\n $(\"#filter-categories\").on(\"click\", \"li\", function (e) {\n $(\".filters-results\").addClass(\"advanced\");\n if ($(this).hasClass(\"active\"))\n HideActiveFilterPanel();\n else {\n $(\".filter-tabs .filter-tab:visible\").slideToggle();\n const tabToOpen = $($(this).find(\"a\").attr(\"href\"));\n tabToOpen.slideToggle(400, function () { if (breakpoint() !== \"mobile\" || isTablet())\n $(\"#filter-categories\").jcarousel(\"reload\"); });\n const adToTrack = tabToOpen.find(\".advertisement\");\n if (adToTrack.length > 0 && $.inArray(adToTrack.data(\"id\"), trackedAdViews) === -1) {\n TrackAdViewed(adToTrack);\n trackedAdViews.push(adToTrack.data(\"id\"));\n }\n $(this).siblings(\".active\").removeClass(\"active\");\n $(this).toggleClass(\"active\");\n }\n e.preventDefault();\n });\n $(\".close-filter\").on('click', function () {\n return HideActiveFilterPanel();\n });\n function HideActiveFilterPanel() {\n $(\"#filter-categories li.active\").removeClass(\"active\");\n $(\".filter-tabs .filter-tab:visible\").slideToggle(400, function () { if (breakpoint() !== \"mobile\" || isTablet())\n $(\"#filter-categories\").jcarousel(\"reload\"); });\n $(\".filters-results\").removeClass(\"advanced\");\n return false;\n }\n $(\".scroll-filters\").on('click', function () {\n $(\".filters-results\").animate({ scrollTop: 0 });\n });\n if (breakpoint() === \"mobile\" && !isTablet()) {\n $(window).on('scroll', function () {\n if ($(\".showcase-title\").offset().top + $(\".showcase-title\").outerHeight(true) <= $(window).scrollTop()) {\n $(\".filters-results\").css(\"margin-top\", $(\".showcase-tabs\").outerHeight(true));\n $(\".showcase-tabs\").addClass(\"fix-top\");\n }\n else {\n $(\".filters-results\").css(\"margin-top\", 0);\n $(\".showcase-tabs\").removeClass(\"fix-top\");\n }\n CheckIfABImageInView();\n });\n $(\"#filter-categories li:first\").trigger('click');\n $(\"#attrcategory-traveltime\").append($(\".travel-time\"));\n }\n else {\n $(\"#travelCarousel\").remove();\n }\n window.addEventListener(\"beforeunload\", function () {\n if (window.hasRoles)\n return;\n ils.trackMetric({ metricName: \"CDPClickCount\", count: cdpClicks });\n ils.trackMetric({ metricName: \"FilterUsageCount\", count: filterUses });\n ils.trackMetric({ metricName: \"FilterUndoCount\", count: showcaseListings.filterUndos });\n ils.trackMetric({ metricName: \"AttributeClickCount\", count: attributeClicks });\n //ga(\"send\", \"event\", \"CDPClicks\", \"alternate\", cdpClicks);\n //ga(\"send\", \"event\", \"AttributeClicks\", \"alternate\", attributeClicks);\n //ga(\"send\", \"event\", \"FilterUses\", \"alternate\", filterUses);\n //ga(\"send\", \"event\", \"FilterUndos\", \"alternate\", filterUndos);\n if (priceUsed) {\n ils.trackSearchFilterUsedEvent({ filterName: \"price\" });\n //ga(\"send\", \"event\", \"PriceUsed\", \"alternate\", 1);\n }\n if (bedUsed) {\n ils.trackSearchFilterUsedEvent({ filterName: \"bedroom\" });\n //ga(\"send\", \"event\", \"BedUsed\", \"alternate\", 1);\n }\n if (bathUsed) {\n ils.trackSearchFilterUsedEvent({ filterName: \"bathroom\" });\n //ga(\"send\", \"event\", \"BathUsed\", \"alternate\", 1);\n }\n if (travelTimeUsed) {\n ils.trackSearchFilterUsedEvent({ filterName: \"traveltime\" });\n //ga(\"send\", \"event\", \"TravelTimeUsed\", \"alternate\", 1);\n }\n });\n document.querySelectorAll(\"#filter-categories li\").forEach((elem) => {\n elem.addEventListener(\"click\", (ev) => {\n const currentTarget = ev.target;\n if (currentTarget.classList.contains(\"active\")) {\n return;\n }\n attributeClicks++;\n });\n });\n //$(\"#filter-categories li\").on('click', function () {\n //\tif ($(this).hasClass(\"active\"))\n //\t\treturn;\n //\tattributeClicks++;\n //});\n document.querySelectorAll(\".filters-panel select\").forEach((elem, key, parent) => {\n elem.addEventListener(\"change\", (ev) => {\n const currentEl = ev.target;\n if (currentEl.value === \"\") {\n showcaseListings.filterUndos++;\n }\n else {\n filterUses++;\n }\n });\n });\n //$(\".filters-panel select\").on(\"change\", function () {\n //\tif ($(this).val() === \"\")\n //\t\tfilterUndos++;\n //\telse\n //\t\tfilterUses++;\n //});\n document.querySelectorAll(\".filters-panel .checkboxes input\").forEach((elem) => {\n elem.addEventListener(\"click\", (evt) => {\n const currentTarget = evt.target;\n if (currentTarget.checked) {\n filterUses++;\n }\n else {\n showcaseListings.filterUndos++;\n }\n });\n });\n //$(\".filters-panel .checkboxes input\").on('click', function () {\n //\tif ($(this).is(\":checked\"))\n //\t\tfilterUses++;\n //\telse\n //\t\tfilterUndos++;\n //});\n document.querySelectorAll(\".filter-reset\").forEach((elem) => {\n elem.addEventListener('click', () => {\n showcaseListings.filterUndos++;\n });\n });\n document.getElementById(\"uxFilterAddress\").addEventListener(\"change\", () => {\n travelTimeUsed = true;\n });\n // This is how scrolling lazy loads new showcase items into the view\n const listingsObserver = new IntersectionObserver(async (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n globalThis.currentFilter = GetFilterJSONString();\n await ShowNextPage();\n }\n }\n }, {\n rootMargin: \"100px 0px 100px 0px\",\n threshold: 0.00\n });\n const listingObserverTarget = document.querySelector(\".prefiltered-content-below\");\n listingsObserver.observe(listingObserverTarget);\n });\n /**\n * This will run a final fetch of the communities to ensure that the view is fully loaded with all the\n * communities that are available. This is necessary because the initial load only loads a subset of the entire\n * data set of communities to enhance the initial load time of the page.\n * @returns {Promise}\n */\n async function finalizeInitialLoad() {\n isInitialLoad = true;\n await LoadNewSet();\n }\n function HookupCommunityEventHandlers() {\n document.querySelectorAll(\".community\").forEach((elem) => {\n elem.addEventListener(\"click\", (evt) => {\n let element = evt.target;\n if (!element.hasAttribute(\"href\")) {\n element = element.closest(\"[href]\");\n }\n if (element.dataset.hasAb) {\n ils.trackABView({\n communityId: parseInt(element.dataset.id),\n communityName: element.dataset.title,\n testName: `${abMainImageName}Click`,\n version: (abShowAlternate ? \"alternate\" : \"main\")\n });\n //ga(\"send\", \"event\", abMainImageName, (abShowAlternate ? \"alternate\" : \"main\"), element.dataset.id);\n }\n ils.trackCommunityClickedEvent({\n communityId: parseInt(element.dataset.id),\n communityName: element.dataset.title,\n communityUrl: element.dataset.url,\n isFeaturedIcon: !element.dataset.featuredIcon\n ? false\n : element.dataset.featuredIcon.toLowerCase() === \"true\"\n });\n cdpClicks++;\n });\n });\n }\n function ThingsToDoOnResize() {\n LoadTabs();\n SetTitlePosition();\n SetResultsToFixed();\n }\n function LoadTabs() {\n if (breakpoint() !== \"mobile\" || isTablet())\n return;\n $(\".showcase-tabs a\").on('click', async function (e) {\n if ($(this).hasClass(\"filter-reset\") || $(this).hasClass(\"copy-filter-link-mobile\"))\n return;\n e.preventDefault();\n $(\".mobile-tab.active\").removeClass(\"active\");\n $($(this).attr(\"href\")).addClass(\"active\");\n if ($(this).attr(\"href\").indexOf(\"#filter-panel\") >= 0) {\n $(\".tab-results,.tab-map\").removeClass(\"hidden\");\n $(\".tab-filter,.tab-list\").addClass(\"hidden\");\n showcaseListings.viewModel.ShowMobileFilters(true);\n showcaseListings.viewModel.MobileFilterPendingRefresh(true);\n if (initialFilterDisplay) {\n $(\"#filter-categories li\").css(\"max-width\", $(\"#filter-categories\").width() / 3);\n globalThis.SetupResponsiveCarousel($(\"#filter-categories\"));\n $(\"#filter-categories ul\").css(\"left\", 0);\n $(\".ui-slider\").each(function () {\n if ($(this).find(\".ui-slider-handle\").length === 2)\n UnstackSliderLabels($(this).find(\".ui-slider-handle:first\"), $(this).slider(\"option\", \"values\")[0], $(this).slider(\"option\", \"values\")[1]);\n });\n if (!mapsAreInitialized && !loadingMaps) {\n loadingMaps = true;\n ils.loadMapScripts(async function () {\n await LoadNewSet();\n mapsAreInitialized = true;\n loadingMaps = false;\n });\n }\n initialFilterDisplay = false;\n }\n else {\n if (!mapsAreInitialized && !loadingMaps) {\n loadingMaps = true;\n ils.loadMapScripts(async function () {\n const callbackPromise = new Promise((resolve) => {\n setTimeout(async () => {\n mapsAreInitialized = true;\n loadingMaps = false;\n resolve();\n }, 10);\n });\n await callbackPromise;\n });\n }\n }\n }\n else if ($(this).attr(\"href\").indexOf(\"#results\") >= 0) {\n showcaseListings.viewModel.ShowMobileFilters(false);\n $(\".tab-filter, .tab-map\").removeClass(\"hidden\");\n $(\".tab-results,.tab-list\").addClass(\"hidden\");\n onListTabClick();\n }\n else {\n $(\".tab-map, .tab-results\").addClass(\"hidden\");\n $(\".tab-list, .tab-filter\").removeClass(\"hidden\");\n showcaseListings.viewModel.ShowMobileFilters(false);\n }\n if ($(this).attr(\"href\").indexOf(\"#map\") >= 0) {\n if (!mapsAreInitialized) {\n isInitialLoad = true;\n ils.loadMapScripts(async function () {\n await mapClickHandler(true);\n });\n }\n else if (showcaseListings.viewModel.MobileFilterPendingRefresh()) {\n showcaseListings.viewModel.MobileFilterPendingRefresh(false);\n await mapClickHandler(true);\n }\n else {\n await mapClickHandler(false);\n }\n }\n });\n }\n async function mapClickHandler(shouldLoadNewSet) {\n const contentDisplay = document.getElementById(\"content-display\");\n contentDisplay.classList.toggle(\"not-in-mobile\", false);\n contentDisplay.classList.toggle(\"mobile-map\", true);\n document.querySelector(\"footer\").classList.toggle(\"hide\", true);\n if (shouldLoadNewSet) {\n showcaseListings.viewModel.MobileFilterPendingRefresh(false);\n const currentMaxPageSize = showcaseListings.viewModel.PageSize();\n showcaseListings.viewModel.PageSize(showcaseListings.viewModel.TotalRowCount());\n await LoadNewSet();\n showcaseListings.MapResized();\n showcaseListings.map.fitBounds(showcaseListings.bounds);\n await setMapZoom(currentMaxPageSize);\n }\n else {\n showcaseListings.MapResized();\n showcaseListings.map.fitBounds(showcaseListings.bounds);\n await setMapZoom(showcaseListings.viewModel.PageSize());\n }\n async function setMapZoom(maxPageSize) {\n let smzTimeoutPromise = new Promise((resolve) => {\n setTimeout(() => {\n setMapZoom(17);\n showcaseListings.viewModel.PageSize(maxPageSize);\n resolve();\n }, 20);\n });\n await smzTimeoutPromise;\n }\n }\n function onListTabClick() {\n const contentDisplay = document.getElementById(\"content-display\");\n contentDisplay.classList.toggle(\"not-in-mobile\", true);\n contentDisplay.classList.toggle(\"mobile-map\", false);\n document.querySelector(\"footer\").classList.toggle(\"hide\", false);\n document.getElementById(\"content-display\").removeAttribute(\"style\");\n document.querySelector(\".prefiltered-content-below\").classList.toggle(\"active\", true);\n }\n function SetTitlePosition() {\n if ($(\".showcase-title\").hasClass(\"minimized\") || (breakpoint() === \"mobile\" && !isTablet()))\n return;\n $(\".showcase-title\").outerWidth($(window).width() - $(\".filters-results\").width() - 25 - 2 * parseInt($(\".showcase-title\").css(\"padding-right\")));\n }\n function footerIsInViewPort() {\n const viewportWidth = globalThis.innerWidth || document.documentElement.clientWidth;\n const viewportHeight = globalThis.innerHeight || document.documentElement.clientHeight;\n const footerContainer = document.querySelector(\"footer\");\n const rect = footerContainer.getBoundingClientRect();\n return rect.top >= 0 &&\n rect.left >= 0 &&\n rect.top < ((viewportHeight - 1)) &&\n rect.right < (viewportWidth);\n }\n function getMenuRectangle() {\n var menuRect = document.querySelector(\".container-fluid,.navigation\").getBoundingClientRect();\n return menuRect;\n }\n function SetResultsToFixed() {\n if (breakpoint() === \"mobile\" && !isTablet())\n return;\n $(\".filters-results\").on(\"scroll\", function () {\n setDesktopFiltersBar();\n });\n globalThis.addEventListener(\"scroll\", function () {\n setDesktopFiltersBar();\n });\n $(\".show-footer\").css(\"margin-left\", $(\".filters-results\").width() + 75);\n }\n function setDesktopFiltersBar() {\n const footerIsVisible = footerIsInViewPort();\n const menuRect = getMenuRectangle();\n const filtersPanelRect = document.querySelector(\".filters\").getBoundingClientRect();\n const bottomAreaRect = document.querySelector(\".bottom-area\").getBoundingClientRect();\n if (!footerIsVisible && filtersPanelRect.bottom - bottomAreaRect.height < menuRect.bottom) {\n $(\".filters\").addClass(\"fix-top\").css(\"margin-bottom\", $(\".bottom-area\").outerHeight(true));\n $(\".bottom-area\").addClass(\"fix-top\").css({ \"max-width\": $(\".filters\").width() });\n if (menuRect.bottom <= 0) {\n $(\".bottom-area\").css(\"top\", 0);\n }\n else {\n $(\".bottom-area\").css(\"top\", menuRect.bottom);\n }\n }\n else {\n $(\".filters\").css(\"margin-bottom\", 0);\n if (filtersPanelRect.bottom - bottomAreaRect.height <= 0) {\n if (menuRect.bottom <= 34) {\n $(\".bottom-area\").addClass(\"fix-top\").css({ \"max-width\": $(\".filters\").width() });\n if (menuRect.bottom < 0) {\n $(\".bottom-area\").css(\"top\", 0);\n }\n else {\n $(\".bottom-area\").css(\"top\", menuRect.bottom + 1);\n }\n }\n }\n else {\n $(\".bottom-area\").removeClass(\"fix-top\").css(\"max-width\", \"none\");\n }\n }\n CheckIfABImageInView();\n }\n function ClearRangeSlider(sliderElement) {\n if (sliderElement.length > 0) {\n sliderElement.slider(\"values\", [sliderElement.slider(\"option\", \"min\"), sliderElement.slider(\"option\", \"max\")]);\n sliderElement.find(\".ui-slider-handle\").removeClass(\"on-top\");\n sliderElement.find(\".handle-text:first\").html(sliderElement.slider(\"option\", \"min\"));\n sliderElement.find(\".handle-text:last\").html(sliderElement.slider(\"option\", \"max\"));\n }\n }\n function ClearSlider(sliderElement) {\n sliderElement.slider(\"values\", [sliderElement.slider(\"option\", \"max\")]);\n sliderElement.find(\".handle-text:last\").html(sliderElement.slider(\"option\", \"max\"));\n }\n function ClearListBoxOrDropdown(theElement) {\n if (theElement.val() !== \"\")\n theElement.val(\"\");\n }\n function ClearRadioButtonList(theElement) {\n if (theElement.val() === \"all\")\n theElement.prop(\"checked\", true);\n else\n theElement.prop(\"checked\", false);\n }\n function ClearRadioButton(theElement) {\n if (theElement.parent().is(\":last-child\"))\n theElement.prop(\"checked\", true);\n else\n theElement.prop(\"checked\", false);\n }\n function ClearCheckBox(theElement) {\n theElement.siblings().removeClass(\"focused\");\n if (theElement.siblings().text() === \"All\") {\n theElement.prop(\"checked\", true);\n theElement.prop(\"disabled\", true);\n }\n else\n theElement.prop(\"checked\", false);\n }\n function ClearMobileDropdownFilter(dropdownContainer) {\n const minValue = dropdownContainer.find(\"select:first option:first\").val();\n const maxValue = dropdownContainer.find(\"select:first option:last\").val();\n dropdownContainer.find(\"select:first\").val(minValue);\n dropdownContainer.find(\"select:last\").val(maxValue);\n }\n function ClearRegionFilter() {\n $(\"input[id*=uxRegionCheckBoxList]\").each(function () {\n ClearCheckBox($(this));\n });\n showcaseListings.viewModel.Neighborhoods(\"\");\n }\n function sliderUpdateFilter(sliderElement) {\n const sliderValue = sliderElement.slider(\"value\");\n const attributeID = GetAttributeID(sliderElement.parent());\n const currentFilterItem = GetFilterByID(attributeID.val());\n if (sliderValue === \"0\")\n currentFilterItem.Value(\"\");\n else\n currentFilterItem.Value(sliderValue);\n }\n function rangeSliderUpdateFilter(sliderElement) {\n const sliderValue1 = sliderElement.slider(\"values\", 0);\n const sliderValue2 = sliderElement.slider(\"values\", 1);\n const attributeID = GetAttributeID(sliderElement.parent());\n const currentFilter = GetFilterByID(attributeID.val());\n if (sliderValue1 === sliderElement.slider(\"option\", \"min\") && sliderValue2 === sliderElement.slider(\"option\", \"max\")) {\n currentFilter.Value(\"\");\n if (globalThis.loaded)\n showcaseListings.filterUndos++;\n }\n else {\n currentFilter.Value(`>${sliderValue1}<${sliderValue2}`);\n if (globalThis.loaded)\n filterUses++;\n }\n }\n function BindPriceSlider() {\n if (breakpoint() === \"mobile\" && !isTablet()) {\n const values = showcaseListings.viewModel.ByUnit() ? unitPrices : roomPrices;\n $(\"#uxPriceMin option,#uxPriceMax option\").remove();\n for (let i = values[0]; i <= values[values.length - 1]; i = i + 50) {\n $(\"#uxPriceMin,#uxPriceMax\").append(``);\n }\n $(\"#uxPriceMax\").val(values[values.length - 1]);\n return;\n }\n // else\n var sliderElement = $(\"#uxPriceRangeSlider\");\n const values = showcaseListings.viewModel.ByUnit() ? unitPrices : roomPrices;\n var value1 = sliderElement.data(\"value1\") ? sliderElement.data(\"value1\") : values[0];\n var value2 = sliderElement.data(\"value2\") ? sliderElement.data(\"value2\") : values[values.length - 1];\n sliderElement.removeAttr(\"data-value1\").removeAttr(\"data-value2\");\n sliderElement.data({ value1: null, value2: null });\n sliderElement.slider({\n range: true,\n step: 25,\n min: values[0],\n max: values[values.length - 1],\n values: [value1, value2],\n create: function (event, ui) {\n if (sliderElement.find(\".handle-text\").length == 0)\n sliderElement.find(\".ui-slider-handle\").append('');\n sliderElement.find(\".ui-slider-handle:last\").addClass(\"reverse\");\n UnstackSliderLabels(sliderElement.find(`.ui-slider-handle:${(value2 == values[0] ? \"last\" : \"first\")}`), value1, value2);\n priceSliderUpdateFilter(sliderElement);\n },\n slide: function (event, ui) {\n const handle = $(ui.handle);\n const handleText = handle.find(\".handle-text\");\n handleText.html(`$${ui.value}`);\n UnstackSliderLabels(handle, ui.values[0], ui.values[1]);\n },\n stop: function (event, ui) {\n priceSliderUpdateFilter(sliderElement);\n priceUsed = true;\n }\n });\n sliderElement.find(\".handle-text:first\").html(`$${value1}`);\n sliderElement.find(\".handle-text:last\").html(`$${value2}`);\n }\n function BindBedroomSlider() {\n var sliderElement = $(\"#uxBedroomRangeSlider\");\n var values = bedrooms;\n var value1 = sliderElement.data(\"value1\") != null ? sliderElement.data(\"value1\") : values[0];\n var value2 = sliderElement.data(\"value2\") != null ? sliderElement.data(\"value2\") : values[values.length - 1];\n sliderElement.removeAttr(\"data-value1\").removeAttr(\"data-value2\");\n sliderElement.slider({\n range: true,\n min: parseInt(values[0]),\n max: parseInt(values[values.length - 1]),\n values: [value1, value2],\n create: function (event, ui) {\n if (sliderElement.find(\".handle-text\").length === 0)\n sliderElement.find(\".ui-slider-handle\").append('');\n sliderElement.find(\".handle-text:first\").html(FormatBedroomText(value1));\n sliderElement.find(\".handle-text:last\").html(FormatBedroomText(value2));\n sliderElement.find(\".ui-slider-handle:last\").addClass(\"reverse\");\n UnstackSliderLabels(sliderElement.find(`.ui-slider-handle:${value2 === values[0] ? \"last\" : \"first\"}`), value1, value2);\n bedroomSliderUpdateFilter(sliderElement);\n },\n slide: function (event, ui) {\n const handle = $(ui.handle);\n handle.find(\".handle-text\").html(FormatBedroomText(ui.value));\n UnstackSliderLabels(handle, ui.values[0], ui.values[1]);\n },\n stop: function (event, ui) {\n bedroomSliderUpdateFilter(sliderElement);\n bedUsed = true;\n }\n });\n }\n function BindBathroomSlider() {\n var sliderElement = $(\"#uxBathroomRangeSlider\");\n var values = bathrooms;\n var value1 = sliderElement.data(\"value1\") ? sliderElement.data(\"value1\") : values[0];\n var value2 = sliderElement.data(\"value2\") ? sliderElement.data(\"value2\") : values[values.length - 1];\n sliderElement.removeAttr(\"data-value1\").removeAttr(\"data-value2\");\n sliderElement.slider({\n range: true,\n min: parseInt(values[0]),\n max: parseInt(values[values.length - 1]),\n values: [value1, value2],\n create: function (event, ui) {\n if (sliderElement.find(\".handle-text\").length === 0)\n sliderElement.find(\".ui-slider-handle\").append('');\n sliderElement.find(\".handle-text:first\").html(value1);\n sliderElement.find(\".handle-text:last\").html(value2);\n sliderElement.find(\".ui-slider-handle:last\").addClass(\"reverse\");\n UnstackSliderLabels(sliderElement.find(`.ui-slider-handle:${value2 === values[0] ? \"last\" : \"first\"}`), value1, value2);\n bathroomSliderUpdateFilter(sliderElement);\n },\n slide: function (event, ui) {\n const handle = $(ui.handle);\n handle.find(\".handle-text\").html(ui.value.toString());\n UnstackSliderLabels(handle, ui.values[0], ui.values[1]);\n },\n stop: function (event, ui) {\n bathroomSliderUpdateFilter(sliderElement);\n bathUsed = true;\n }\n });\n }\n function FormatBedroomText(numBeds) {\n return numBeds === 0 ? \"Studio\" : numBeds + \"BR\";\n }\n function priceSliderUpdateFilter(sliderElement) {\n let minValue, maxValue;\n try {\n // Attempt to fetch slider values - desktop\n minValue = sliderElement.slider(\"values\", 0);\n maxValue = sliderElement.slider(\"values\", 1);\n }\n catch (error) {\n // If an error occurs, fall back to fetching data attributes - mobile\n minValue = sliderElement.data('value1');\n maxValue = sliderElement.data('value2');\n }\n var minSliderValue, maxSliderValue;\n try {\n minSliderValue = sliderElement.slider(\"option\", \"min\");\n maxSliderValue = sliderElement.slider(\"option\", \"max\");\n }\n catch (error) {\n minSliderValue = $('#uxPriceMin option:first').val();\n maxSliderValue = $('#uxPriceMax option:last').val();\n selectOptionByValue('uxPriceMin', minValue);\n selectOptionByValue('uxPriceMax', maxValue);\n }\n showcaseListings.viewModel.PriceRange((minValue === minSliderValue && maxValue === maxSliderValue) ? \"\" : minValue + \"-\" + maxValue);\n }\n function selectOptionByValue(selectId, value) {\n value = String(value);\n var selectElement = $('#' + selectId);\n if (selectId == 'uxPriceMin') {\n showcaseListings.viewModel.PriceMin(value);\n }\n else if (selectId == 'uxPriceMax') {\n showcaseListings.viewModel.PriceMax(value);\n }\n else {\n console.error('Wrong selectId');\n }\n selectElement.trigger('change');\n }\n function bedroomSliderUpdateFilter(sliderElement) {\n var minValue = sliderElement.slider(\"values\", 0);\n var maxValue = sliderElement.slider(\"values\", 1);\n if (minValue === \"Studio\")\n minValue = 0;\n if (maxValue === \"Studio\")\n maxValue = 0;\n if (minValue === sliderElement.slider(\"option\", \"min\") && maxValue === sliderElement.slider(\"option\", \"max\"))\n showcaseListings.viewModel.BedroomRange(\"\");\n else\n showcaseListings.viewModel.BedroomRange(minValue + \"-\" + maxValue);\n }\n function bathroomSliderUpdateFilter(sliderElement) {\n const minValue = sliderElement.slider(\"values\", 0);\n const maxValue = sliderElement.slider(\"values\", 1);\n if (minValue === sliderElement.slider(\"option\", \"min\") && maxValue === sliderElement.slider(\"option\", \"max\"))\n showcaseListings.viewModel.BathroomRange(\"\");\n else\n showcaseListings.viewModel.BathroomRange(minValue + \"-\" + maxValue);\n }\n function travelTimeSliderUpdateFilter(sliderElement) {\n const value = sliderElement.slider(\"value\");\n showcaseListings.viewModel.TravelTime(value);\n }\n function UnstackSliderLabels(handle, value1, value2) {\n setTimeout(function () {\n const handleText = handle.find(\".handle-text\");\n const rightHandleLabel = handle.parent().find(\".ui-slider-handle:last .handle-text\");\n if (value1 === value2) {\n handle.addClass(\"on-top\");\n handleText.html(\"Only\");\n }\n else {\n handle.removeClass(\"on-top\");\n }\n const leftHandleLabel = handle.parent().find(\".ui-slider-handle:first .handle-text\");\n leftHandleLabel.css(\"margin-left\", \"0\");\n rightHandleLabel.css(\"margin-left\", \"0\");\n const leftHandleEnd = leftHandleLabel.offset().left + leftHandleLabel.outerWidth(true);\n const rightHandleStart = rightHandleLabel.offset().left;\n const offset = rightHandleStart - leftHandleEnd;\n if (offset < 0) {\n if (handle.hasClass(\"reverse\"))\n rightHandleLabel.css(\"margin-left\", offset + \"px\");\n else\n leftHandleLabel.css(\"margin-left\", offset + \"px\");\n }\n }, 5);\n }\n window.addEventListener(\"popstate\", function (e) {\n if (!isInitialLoad) {\n location.reload();\n }\n });\n })(showcaseListings = ils.showcaseListings || (ils.showcaseListings = {}));\n})(ils || (ils = {}));\n"]}