PageSourceSearch

https://www.coterieseniorliving.com/_nuxt/CM1LkWja.js

js coterieseniorliving.com collected 2026-09-29 14:23:43 UTC 3,049 bytes, 1 lines download raw bytes

1import{u as S}from"./Cga8d3Ty.js";import{o as M}from"./DkTjT6lu.js";import{s as w}from"./a0KI0hBD.js";import{e as N,s as C}from"./CSSxz1HG.js";import{u as A}from"./KQsXDnc0.js";const _=function(){return navigator?.permissions?.query({name:"geolocation"})},I=function(c,u,g,l,a){const m=Math.PI*c/180,d=Math.PI*g/180,y=u-l,f=Math.PI*y/180;let i=Math.sin(m)*Math.sin(d)+Math.cos(m)*Math.cos(d)*Math.cos(f);return i>1&&(i=1),i=Math.acos(i),i=i*180/Math.PI,i=i*60*1.1515,i},P={arc:["AtriaRetirementCanada"],asl:["AtriaLegacy","Park","Signature"],holiday:["HolidaybyAtria"]},v=()=>{const c=S(),u=N(),g=u.public.PACKAGE_NAME,l=(u.public.MAPS_MICROSERVICE_API_BASE??"").replace(/\/$/,""),a=P[g],m=function(t){let e=[];try{e=JSON.parse(localStorage.getItem("communityNumbers"))||[],e.includes(t)&&(e=e.slice(e.indexOf(t),1)),e.push(t),localStorage.setItem("communityNumbers",JSON.stringify(e))}catch{console.error(`Could not save ${t} to localStorage`)}},d=function(){let t=[];try{t=JSON.parse(localStorage.getItem("communityNumbers"))||[]}catch{console.error("Could not fetch from localStorage")}return t},y=function(){let t=[];try{t=JSON.parse(localStorage.getItem("communityNumbers"))||[]}catch{console.error("Could not fetch from localStorage")}return t.length>0?t[t.length-1]:""},f=async function(){const t=A(),e=Array.isArray(a)?"":a;try{let o=await t.getCommunityListing({brand:e});if(o=o.filter(n=>a.includes(n.brand)&&!c.disposedCommunities.includes(n.communityNumber)),o)return o}catch(o){console.error(o)}return[]},i=function(){return new Promise(function(t,e){navigator.geolocation.getCurrentPosition(t,e)})};return{saveCommunityId:m,getRecentlyViewedCommunityId:d,getMostRecentlyViewedCommunity:y,getNearbyOrFeaturedCommunity:async function(t){const e=await f();if(!t){const o=y();if(o!==""){const n=e.filter(s=>s.communityNumber===o);if(n.length)return{type:"recent",community:n[0]}}}try{let o,n;const s=C.get("rough_location");if(s){const r=JSON.parse(s);o=r.lat,n=r.lng}else{const r=await w(`${l}/location`,{method:"GET"});if(r&&Object.hasOwn(r,"lat"))o=r.lat,n=r.lng;else{const p=await i();p&&(o=p.coords.latitude,n=p.coords.longitude)}}C.set("rough_location",JSON.stringify({lat:o,lng:n}),36e5);const b=e.map(r=>({...r,distanceUserCoords:I(o,n,r.latitude,r.longitude,"M")})),h=M(b,r=>r.distanceUserCoords);if(h.length)return t?{type:"nearby",communities:h}:{type:"nearby",community:h[0]};throw new Error("get featured community instead")}catch(o){console.error("could not get current location",o);const n=e.filter(s=>s.isFeatured);return n.length?t?{type:"featured",communities:n}:{type:"featured",community:n[0]}:null}},searchAllCommunities:async function(t){try{const e=`${l}/communities?query=${encodeURIComponent(t??"")}&brands=${a.join(",")}`,o=await fetch(e,{method:"GET"});if(!o.ok)throw new Error(`API ${e} responded ${o.status}`);return(await o.json()).filter(s=>a.includes(s.brand)&&!c.disposedCommunities.includes(s.communityNumber))??[]}catch(e){return console.error(e),[]}},getAllCommunitiesByBrand:f}};export{_ as g,v as u};

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.