PageSourceSearch

https://www.atriaseniorliving.com/_nuxt/H3JZRqwB.js

js atriaseniorliving.com collected 2026-09-24 20:43:34 UTC 44,940 bytes, 3 lines download raw bytes

1import{m as O}from"./B2ypgI2b.js";import"./Cpj98o6Y.js";class f{static setup(e={}){f.options=e}static get(){return f.options||{}}static clear(){f.options={},f.errorCallback=null}static onError(e){f.errorCallback=e}static sendError(e){f.errorCallback&&e&&f.errorCallback(e)}}f.errorCallback=null;f.defaultOptions={live:!1,logLevel:"error",host:"https://api.radar.io",version:"v1",debug:!1};const M={none:0,error:1,warn:2,info:3,debug:4},J=()=>{if(window&&window.RADAR_TEST_ENV)return M.none;const{logLevel:n,debug:e}=f.get();return e?M.debug:n?M[n]:M.error};class g{static debug(e,t){J()===M.debug&&console.log(`Radar SDK (debug): ${e.trim()}`,t)}static info(e){J()>=M.info&&console.log(`Radar SDK: ${e.trim()}`)}static warn(e){J()>=M.warn&&console.warn(`Radar SDK: ${e.trim()}`)}static error(e){J()>=M.error&&console.error(`Radar SDK: ${e.trim()}`)}}class l{static get USER_ID(){return"radar-userId"}static get DEVICE_ID(){return"radar-deviceId"}static get INSTALL_ID(){return"radar-installId"}static get SESSION_ID(){return"radar-sessionId"}static get DESCRIPTION(){return"radar-description"}static get METADATA(){return"radar-metadata"}static get CACHED_LOCATION(){return"radar-cached-location"}static get TRIP_OPTIONS(){return"radar-trip-options"}static get PRODUCT(){return"radar-product"}static getStorage(){const e=window?.localStorage;return e||g.warn("localStorage not available."),e}static setItem(e,t){const i=this.getStorage();i&&t!=null&&i.setItem(e,t)}static getItem(e){const t=this.getStorage();if(!t)return null;const i=t.getItem(e);return i??null}static getJSON(e){const t=this.getItem(e);if(!t)return null;try{return JSON.parse(t)}
1catch{return g.warn(`could not getJSON from storage for key: ${e}`),null}}static removeItem(e){const t=this.getStorage();if(!t)return null;t.removeItem(e)}static clear(){const e=this.getStorage();if(!e)return null;e.clear()}}function E(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function d(a){try{u(i.next(a))}catch(h){o(h)}}function c(a){try{u(i.throw(a))}catch(h){o(h)}}function u(a){a.done?s(a.value):r(a.value).then(d,c)}u((i=i.apply(n,[])).next())})}class T extends Error{constructor(e){super(e),this.status=""}}class ce extends T{constructor(e){super(e),this.name="RadarPublishableKeyError",this.status="ERROR_PUBLISHABLE_KEY"}}class z extends T{constructor(e){super(e),this.name="RadarLocationError",this.status="ERROR_LOCATION"}}class Ae extends T{constructor(e){super(e),this.name="RadarPermissionsError",this.status="ERROR_PERMISSIONS"}}class ge extends T{constructor(){super("Radar Verify app not running."),this.name="RadarVerifyAppError",this.status="ERROR_VERIFY_APP"}}class Be extends T{constructor(e){var t;super(((t=e?.meta)===null||t===void 0?void 0:t.message)||"Bad request."),this.name="RadarBadRequestError",this.code=400,this.response=e,this.status="ERROR_BAD_REQUEST"}}class Ke extends T{constructor(e){var t;super(((t=e?.meta)===null||t===void 0?void 0:t.message)||"Unauthorized."),this.name="RadarUnauthorizedError",this.code=401,this.response=e,this.status="ERROR_UNAUTHORIZED"}}class Je extends T{constructor(e){var t;super(((t=e?.meta)===null||t===void 0?void 0:t.message)||"Payment required."),this.name="RadarPaymentRequiredError",this.code=402,this.response=e,this.status="ERROR_PAYMENT_REQUIRED"}}class je extends T{constructor(e){var t;super(((t=e?.meta)===null||t===void 0?void 0:t.message)||"Forbidden."),this.name="RadarForbiddenError",this.code=403,this.response=e,this.status="ERROR_FORBIDDEN"}}class We extends T{constructor(e){var t;super(((t=e?.meta)===null||t===void 0?void 0:t.message)||"Not found."),this.name="RadarNotFoundError",this.code=404,this.response=e,this.status="ERROR_NOT_FOUND"}}class ze extends T{constructor(e){var t,i;super(((t=e?.meta)===null||t===void 0?void 0:t.message)||"Rate limit exceeded."),this.name="RadarRateLimitError",this.code=429,this.response=e,this.type=(i=e?.meta)===null||i===void 0?void 0:i.type,this.status="ERROR_RATE_LIMIT"}}class me extends T{constructor(e){var t;super(((t=e?.meta)===null||t===void 0?void 0:t.message)||"Internal server error."),this.name="RadarServerError",this.response=e,this.status="ERROR_SERVER"}}class H extends T{constructor(){super("Request timed out."),this.name="RadarNetworkError",this.status="ERROR_NETWORK"}}class Ze extends T{constructor(e){var t;super(((t=e?.meta)===null||t===void 0?void 0:t.message)||"Something went wrong."),this.name="RadarUnknownError",this.response=e,this.status="ERROR_UNKNOWN"}}class Xe extends T{constructor(e){super(e),this.name="RadarAutocompleteContainerNotFound",this.status="CONTAINER_NOT_FOUND"}}const Ye={maximumAge:0,timeout:1e3*10,enableHighAccuracy:!0},ve=n=>n==="high";class A{static getCurrentPosition(e={}){return E(this,void 0,void 0,function*(){return new Promise((t,i)=>{const r=f.get();if(!navigator||!navigator.geolocation)return i(new z("navigator.geolocation is not available."));if(r.cacheLocationMinutes)try{const o=l.getItem(l.CACHED_LOCATION);if(o){const d=JSON.parse(o),{latitude:c,longitude:u,accuracy:a,expiresAt:h}=d||{};if(Date.now()<parseInt(h)&&c&&u&&a)return t({latitude:c,longitude:u,accuracy:a})}}catch{g.warn("could not load cached location.")}const s=Object.assign({},Ye);r.locationMaximumAge!==void 0&&(s.maximumAge=r.locationMaximumAge),r.locationTimeout!==void 0&&(s.timeout=r.locationTimeout),r.desiredAccuracy!==void 0&&(s.enableHighAccuracy=ve(r.desiredAccuracy)),e.desiredAccuracy!==void 0&&(s.enableHighAccuracy=ve(e.desiredAccuracy)),g.info(`Using geolocation options: ${JSON.stringify(s)}`),navigator.geolocation.getCurrentPosition(o=>{if(!o||!o.coords)return i(new z("device location return empty coordinates."));const{latitude:d,longitude:c,accuracy:u}=o.coords;if(r.cacheLocationMinutes){const a=Number.parseFloat(r.cacheLocationMinutes),h=Date.now(),p=h+a*60*1e3,v={latitude:d,longitude:c,accuracy:u,updatedAt:h,expiresAt:p};l.setItem(l.CACHED_LOCATION,JSON.stringify(v))}return t({latitude:d,longitude:c,accuracy:u})},o=>o&&o.code===1?i(new Ae("Location permissions denied.")):i(new z("Could not determine location.")),s)})})}static getPermissionStatus(){return E(this,void 0,void 0,function*(){return new Promise(e=>{let t="NOT_DETERMINED";if(!navigator||!navigator.permissions)return e(t);navigator.permissions.query({name:"geolocation"}).then(i=>{switch(i.state){case"granted":t="GRANTED_FOREGROUND";break;case"denied":t="DENIED";break;case"prompt":t="NOT_DETERMINED";break}return e(t)})})})}static online(){return navigator&&navigator.onLine}}var B="4.5.8";const ee=new Map;class I{static request({method:e,path:t,data:i,host:r,version:s,headers:o={},responseType:d,requestId:c}){return E(this,void 0,void 0,function*(){return new Promise((u,a)=>{const h=f.get(),p=h.publishableKey;if(!p){a(new ce("publishableKey not set."));return}const v=r||h.host,S=s||h.version;let x=`${v}/${S}/${t}`,L={};if(Object.keys(i||{}
1).forEach(R=>{const y=i[R];y!==void 0&&(L[R]=y)}),e==="GET"){const R=Object.keys(L).map(y=>`${y}=${encodeURIComponent(L[y])}`);if(R.length>0){const y=R.join("&");x=`${x}?${y}`}L=void 0}if(c){const R=ee.get(c);R&&R.abort()}const m=new XMLHttpRequest;m.open(e,x,!0),c&&ee.set(c,m);const D={Authorization:p,"Content-Type":"application/json","X-Radar-Device-Type":"Web","X-Radar-SDK-Version":B};let $={};typeof h.getRequestHeaders=="function"&&($=h.getRequestHeaders());const C=Object.assign(D,$,o);Object.keys(C).forEach(R=>{m.setRequestHeader(R,C[R])}),d&&(m.responseType=d),m.onload=()=>{var R;let y;c&&ee.delete(c);try{m.responseType==="blob"?y={code:m.status,data:m.response}:y=JSON.parse(m.response)}catch{return a(new me(y))}const U=(R=y?.meta)===null||R===void 0?void 0:R.error;if(U==="ERROR_PERMISSIONS")return a(new Ae("Location permissions not granted."));if(U==="ERROR_LOCATION")return a(new z("Could not determine location."));if(U==="ERROR_NETWORK")return a(new H);if(m.status==200)return u(y);h.debug&&(g.debug(`API call failed: ${x}`),g.debug(JSON.stringify(y))),m.status===400?a(new Be(y)):m.status===401?a(new Ke(y)):m.status===402?a(new Je(y)):m.status===403?a(new je(y)):m.status===404?a(new We(y)):m.status===429?a(new ze(y)):500<=m.status&&m.status<600?a(new me(y)):a(new Ze(y))},m.onerror=function(){a(r&&(r==="http://localhost:52516"||r==="https://radar-verify.com:52516")?A.online()?new ge:new H:new H)},m.ontimeout=function(){a(r&&(r==="http://localhost:52516"||r==="https://radar-verify.com:52516")?A.online()?new ge:new H:new H)},m.send(JSON.stringify(L))})})}}class Qe{static validateAddress(e){return E(this,void 0,void 0,function*(){const t=f.get(),i=yield I.request({method:"GET",path:"addresses/validate",data:e}),{address:r,result:s}=i,o={address:r,result:s};return t.debug&&(o.response=i),o})}}const ye=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)});class P{static getDeviceId(){const e=l.getItem(l.DEVICE_ID);if(e)return e;const t=ye();return l.setItem(l.DEVICE_ID,t),t}static getInstallId(){const e=l.getItem(l.INSTALL_ID);if(e)return e;const t=ye();return l.setItem(l.INSTALL_ID,t),t}}const et=300,tt=n=>{const e=Math.trunc(Date.now()/1e3),t=Number.parseInt(n);return Math.abs(e-t)<et};class ue{static getSessionId(){const e=l.getItem(l.SESSION_ID);if(e&&tt(e))return e;const t=Math.trunc(Date.now()/1e3).toString();return l.setItem(l.SESSION_ID,t),t}}class Ee{static getConfig(e={}){return E(this,void 0,void 0,function*(){if(f.get().version!="v1"){g.info("Skipping /config call.");return}const i=e.deviceId||P.getDeviceId(),r=e.installId||P.getInstallId(),s=ue.getSessionId();let o;try{o=yield A.getPermissionStatus()}catch(c){g.warn(`Location authorization error: ${c.message}`)}const d={deviceId:i,installId:r,sessionId:s,locationAuthorization:o};try{yield I.request({method:"GET",path:"config",data:d})}catch(c){g.warn(`Error calling /config: ${c.message}`)}})}}class it{static getContext(e){return E(this,void 0,void 0,function*(){const t=f.get();(!e.latitude||!e.longitude)&&(e=yield A.getCurrentPosition());const{latitude:i,longitude:r,accuracy:s}=e,o=yield I.request({method:"GET",path:"context",data:{coordinates:`${i},${r}`,accuracy:s}}),{geofences:d,place:c,country:u,state:a,dma:h,postalCode:p}=o,v={location:e,geofences:d,place:c,country:u,state:a,dma:h,postalCode:p};return t.debug&&(v.response=o),v})}}class st{static logConversion(e){return E(this,void 0,void 0,function*(){const t=f.get(),i=e.name,r=e.userId||l.getItem(l.USER_ID),s=e.deviceId||P.getDeviceId(),o=e.installId||P.getInstallId(),d=e.metadata||{},c=e.createdAt;e.revenue&&(d.revenue=e.revenue);const u={name:i,userId:r,deviceId:s,installId:o,metadata:d};typeof c=="string"?u.createdAt=c:c instanceof Date?u.createdAt=c.toISOString():u.createdAt=new Date().toISOString();const a=yield I.request({method:"POST",path:"events",data:u}),h={event:a.event};return t.debug&&(h.response=a),h})}}class te{static forwardGeocode(e){return E(this,void 0,void 0,function*(){const t=f.get(),{query:i,layers:r,country:s,lang:o}=e,d=yield I.request({method:"GET",path:"geocode/forward",data:{query:i,layers:r,country:s,lang:o}}),c={addresses:d.addresses};return t.debug&&(c.response=d),c})}static reverseGeocode(e){return E(this,void 0,void 0,function*(){const t=f.get();let{latitude:i,longitude:r,layers:s}=e;if(!i||!r){const c=yield A.getCurrentPosition();i=c.latitude,r=c.longitude}const o=yield I.request({method:"GET",path:"geocode/reverse",data:{coordinates:`${i},${r}`,layers:s}}),d={addresses:o.addresses};return t.debug&&(d.response=o),d})}static ipGeocode(){return E(this,void 0,void 0,function*(){const e=f.get(),t=yield I.request({method:"GET",path:"geocode/ip"}),i={ip:t.ip,address:t.address,proxy:t.proxy}
1;return e.debug&&(i.response=t),i})}}class Re{static distance(e){return E(this,void 0,void 0,function*(){const t=f.get();let{origin:i,destination:r,modes:s,units:o,geometry:d,geometryPoints:c,avoid:u}=e;if(i){if(typeof i!="string"){const{latitude:p,longitude:v}=i;i=`${p},${v}`}}else{const{latitude:p,longitude:v}=yield A.getCurrentPosition();i=`${p},${v}`}if(typeof r!="string"){const{latitude:p,longitude:v}=r;r=`${p},${v}`}Array.isArray(s)&&(s=s.join(",")),Array.isArray(u)&&(u=u.join(","));const a=yield I.request({method:"GET",path:"route/distance",data:{origin:i,destination:r,modes:s,units:o,geometry:d,geometryPoints:c,avoid:u}}),h={routes:a.routes};return t.debug&&(h.response=a),h})}static matrix(e){return E(this,void 0,void 0,function*(){const t=f.get();let{origins:i,destinations:r,mode:s,units:o,avoid:d}=e;if(i)Array.isArray(i)&&(i=i.map(a=>`${a.latitude},${a.longitude}`).join("|"));else{const{latitude:a,longitude:h}=yield A.getCurrentPosition();let p=[];for(let v=0;v<r.length;v++)p.push(`${a},${h}`);i=p.join("|")}Array.isArray(r)&&(r=r.map(a=>`${a.latitude},${a.longitude}`).join("|")),Array.isArray(d)&&(d=d.join(","));const c=yield I.request({method:"GET",path:"route/matrix",data:{origins:i,destinations:r,mode:s,units:o,avoid:d}}),u={origins:c.origins,destinations:c.destinations,matrix:c.matrix};return t.debug&&(u.response=c),u})}}class Z{static autocomplete(e,t){return E(this,void 0,void 0,function*(){const i=f.get();let{query:r,near:s,limit:o,layers:d,countryCode:c,expandUnits:u,mailable:a,lang:h,postalCode:p}=e;s&&typeof s!="string"&&s.latitude&&s.longitude&&(s=`${s.latitude},${s.longitude}`);const v=yield I.request({method:"GET",path:"search/autocomplete",data:{query:r,near:s,limit:o,layers:d,countryCode:c,expandUnits:u,mailable:a,lang:h,postalCode:p},requestId:t}),S={addresses:v.addresses};return i.debug&&(S.response=v),S})}static searchGeofences(e){return E(this,void 0,void 0,function*(){const t=f.get();let{near:i,radius:r,tags:s,metadata:o,limit:d,includeGeometry:c}=e;if(i){if(typeof i!="string"){const{latitude:h,longitude:p}=i;i=`${h},${p}`}}else{const{latitude:h,longitude:p}=yield A.getCurrentPosition();i=`${h},${p}`}Array.isArray(s)&&(s=s.join(","));const u=yield I.request({method:"GET",path:"search/geofences",data:{near:i,radius:r,tags:s,metadata:o,limit:d,includeGeometry:c}}),a={geofences:u.geofences};return t.debug&&(a.response=u),a})}static searchPlaces(e){return E(this,void 0,void 0,function*(){const t=f.get();let{near:i,radius:r,chains:s,categories:o,groups:d,limit:c}=e;if(i){if(typeof i!="string"){const{latitude:h,longitude:p}=i;i=`${h},${p}`}}else{const{latitude:h,longitude:p}=yield A.getCurrentPosition();i=`${h},${p}`}Array.isArray(s)&&(s=s.join(",")),Array.isArray(o)&&(o=o.join(",")),Array.isArray(d)&&(d=d.join(","));const u=yield I.request({method:"GET",path:"search/places",data:{near:i,radius:r,chains:s,categories:o,groups:d,limit:c}}),a={places:u.places};return t.debug&&(a.response=u),a})}}const Ie=n=>n&&Object.prototype.toString.call(n)==="[object Date]"&&!isNaN(n);class b{static setTripOptions(e){if(!e){b.clearTripOptions();return}const t=JSON.stringify(e);g.debug(`Saving trip options: ${t}`),l.setItem(l.TRIP_OPTIONS,t)}static getTripOptions(){let e=l.getItem(l.TRIP_OPTIONS);return e&&(e=JSON.parse(e)),e}static clearTripOptions(){l.removeItem(l.TRIP_OPTIONS)}static startTrip(e){return E(this,void 0,void 0,function*(){const t=f.get();e=e||b.getTripOptions(),e||g.warn('tripOptions not set when calling "startTrip"');const i=e.userId||l.getItem(l.USER_ID);i&&i!==l.getItem(l.USER_ID)&&l.setItem(l.USER_ID,i);const{externalId:r,destinationGeofenceTag:s,destinationGeofenceExternalId:o,mode:d,metadata:c,approachingThreshold:u,scheduledArrivalAt:a}=e,h={userId:i,externalId:r,destinationGeofenceTag:s,destinationGeofenceExternalId:o,mode:d,metadata:c,approachingThreshold:u};Ie(a)?h.scheduledArrivalAt=a?.toJSON():(a&&g.warn("Invalid date format for scheduledArrivalAt"),h.scheduledArrivalAt=void 0);const p=yield I.request({method:"POST",path:"trips",data:h});b.setTripOptions(e);const v={trip:p.trip,events:p.events};return t.debug&&(v.response=p),v})}static updateTrip(e,t){return E(this,void 0,void 0,function*(){const i=f.get();e=e||b.getTripOptions(),e||g.warn('tripOptions not set when calling "startTrip"');const{externalId:r,destinationGeofenceTag:s,destinationGeofenceExternalId:o,mode:d,metadata:c,approachingThreshold:u,scheduledArrivalAt:a}=e,h={status:t,externalId:r,destinationGeofenceTag:s,destinationGeofenceExternalId:o,mode:d,metadata:c,approachingThreshold:u};Ie(a)?h.scheduledArrivalAt=a?.toJSON():(a&&g.warn("Invalid date format for scheduledArrivalAt"),h.scheduledArrivalAt=void 0);const p=yield I.request({method:"PATCH",path:`trips/${r}/update`,data:h}),v={trip:p.trip,events:p.events};return i.debug&&(v.response=p),v})}static completeTrip(){return E(this,void 0,void 0,function*(){const e=b.getTripOptions(),t=yield b.updateTrip(e,"completed");return b.clearTripOptions(),t})}static cancelTrip(){return E(this,void 0,void 0,function*(){const e=b.getTripOptions(),t=yield b.updateTrip(e,"canceled");return b.clearTripOptions(),t})}}const ie=n=>btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),rt=(n,e)=>E(void 0,void 0,void 0,function*(){const t=new TextEncoder,i=ie(JSON.stringify({alg:"HS256",typ:"JWT"})),r=ie(JSON.stringify(n)),s=t.encode(e),o=t.encode(`${i}.${r}`),d=yield crypto.subtle.importKey("raw",s,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),c=yield crypto.subtle.sign("HMAC",d,o),u=ie(String.fromCharCode(...Array.from(new Uint8Array(c))));return`${i}.${r}.${u}`});class Le{static trackOnce(e){return E(this,void 0,void 0,function*(){const t=f.get();let{latitude:i,longitude:r,accuracy:s,desiredAccuracy:o,fraud:d}=e;if(!i||!r){const N=yield A.getCurrentPosition({desiredAccuracy:o});i=N.latitude,r=N.longitude,s=N.accuracy}const c=yield A.getPermissionStatus(),u=e.userId||l.getItem(l.USER_ID),a=e.deviceId||P.getDeviceId(),h=e.installId||P.getInstallId(),p=ue.getSessionId(),v=e.deviceType||"Web",S=e.description||l.getItem(l.DESCRIPTION);let x;try{x=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(N){g.warn(`Error getting time zone: ${N.message}`)}u?l.setItem(l.USER_ID,u):g.warn("userId not provided for trackOnce.");const L=e.metadata||l.getJSON(l.METADATA),m=e.tripOptions||b.getTripOptions();m&&(m.version="2");const D={},$=l.getItem(l.PRODUCT);$&&(D["X-Radar-Product"]=$);const C=Object.assign(Object.assign({},e),{locationAuthorization:c,accuracy:s,description:S,deviceId:a,deviceType:v,foreground:!0,installId:h,sessionId:p,latitude:i,longitude:r,metadata:L,sdkVersion:B,stopped:!0,userId:u,tripOptions:m,timeZone:x});let R;
1if(d){const N="https://api-verified.radar.io",ke=navigator.language,Oe=navigator.languages,{dk:De}=yield I.request({host:N,method:"GET",path:"config",data:{deviceId:a,installId:h,sessionId:p,locationAuthorization:c},headers:{"X-Radar-Desktop-Device-Type":"Web"}}),Ne={payload:JSON.stringify(Object.assign(Object.assign({},C),{lang:ke,langs:Oe}))},Me=yield rt(Ne,De);D["X-Radar-Body-Is-Token"]="true",R=yield I.request({host:N,method:"POST",path:"track",data:{token:Me},headers:D});let{user:Pe,events:$e,token:Ue,expiresAt:K,expiresIn:Fe,passed:Ve,failureReasons:He,_id:Ge}=R;const qe={latitude:i,longitude:r,accuracy:s};K&&(K=new Date(K));const fe={user:Pe,events:$e,location:qe,token:Ue,expiresAt:K,expiresIn:Fe,passed:Ve,failureReasons:He,_id:Ge};return t.debug&&(fe.response=R),fe}R=yield I.request({method:"POST",path:"track",data:C,headers:D});const{user:y,events:U}=R,V={user:y,events:U,location:{latitude:i,longitude:r,accuracy:s}};return t.debug&&(V.response=R),V})}}let G=null,q=null,se=!0,re=null,_=null,ne=0,be=null,we=null,j=null;class k{static checkIpChanges(){return E(this,void 0,void 0,function*(){try{const{ip:e}=yield I.request({method:"GET",path:"ping"}),t=j&&e!==j;return t&&(g.info(`IP changed from ${j} to ${e}`),_=null),j=e,t}catch(e){g.error(`Error checking IP: ${e}`)}return!1})}static trackVerified(e,t=!1){return E(this,void 0,void 0,function*(){try{const i=f.get(),{skipVerifyApp:r,reason:s}=e,o=e.userId||l.getItem(l.USER_ID),d=P.getDeviceId(),c=P.getInstallId(),u=ue.getSessionId(),a=e.description||l.getItem(l.DESCRIPTION);o?l.setItem(l.USER_ID,o):g.warn("userId not provided for trackVerified.");const h=e.metadata||l.getJSON(l.METADATA);let p;if(r)p=yield Le.trackOnce({userId:o??void 0,description:a??void 0,metadata:h,fraud:!0,reason:s});else{const v=Object.assign(Object.assign({},e),{description:a,deviceId:d,foreground:!0,installId:c,sessionId:u,metadata:h,sdkVersion:B,stopped:!0,userId:o,encrypted:t,expectedCountryCode:be,expectedStateCode:we});let S=navigator.userAgent;const x=S&&(S.toLowerCase().includes("mac")||S.toLowerCase().includes("iphone")||S.toLowerCase().includes("ipod")||S.toLowerCase().includes("ipad")),L=yield I.request({method:"GET",path:"verify",data:v,host:x?"https://radar-verify.com:52516":"http://localhost:52516"});let{user:m,events:D,token:$,expiresAt:C,expiresIn:R,passed:y,failureReasons:U,_id:Q}=L,V;m&&m.location&&m.location.coordinates&&m.locationAccuracy&&(V={latitude:m.location.coordinates[1],longitude:m.location.coordinates[0],accuracy:m.locationAccuracy}),C&&(C=new Date(C)),p={user:m,events:D,location:V,token:$,expiresAt:C,expiresIn:R,passed:y,failureReasons:U,_id:Q},i.debug&&(p.response=L)}return _=p,ne=performance.now(),re&&re(p),p}catch(i){throw f.sendError(i),i}})}static startTrackingVerified(e){se=!0;const t=()=>E(this,void 0,void 0,function*(){let{interval:r}=e;r||(r=20);let s=r;if(_){const o=(performance.now()-ne)/1e3,d=_.expiresIn||0;s=Math.min(d-o,r)}s=s-10,s<10&&(s=10),G&&clearTimeout(G),se&&(G=setTimeout(i,s*1e3))}),i=()=>E(this,void 0,void 0,function*(){try{yield this.trackVerified(e)}catch(r){g.error(`trackVerified error: ${r.message}`)}t()});e?.ipChanges&&(q&&clearInterval(q),q=setInterval(()=>E(this,void 0,void 0,function*(){(yield k.checkIpChanges())&&i()}),1e4)),this.isLastTokenValid()?t():i()}static stopTrackingVerified(){se=!1,G&&clearTimeout(G),q&&clearInterval(q)}static getVerifiedLocationToken(e){return E(this,void 0,void 0,function*(){return this.isLastTokenValid()?_:this.trackVerified(e)})}static clearVerifiedLocationToken(){_=null}static isLastTokenValid(){if(!_)return!1;const e=(performance.now()-ne)/1e3;return _.passed&&e<(_.expiresIn||0)}static setExpectedJurisdiction(e,t){be=e||null,we=t||null}static onTokenUpdated(e){re=e}}const nt=n=>n.includes("_sk_"),ot=n=>n.includes("_live_");let at=class{static get VERSION(){return B}static initialize(e,t={}){if(!e)throw new ce("Publishable key required in initialization.");if(nt(e))throw new ce("Secret keys are not allowed. Please use your Radar publishable key.");const i=ot(e),r=i?"error":"info",s=!i,o=Object.assign(f.defaultOptions,{publishableKey:e,live:i,logLevel:r,debug:s},t);f.setup(o),g.info(`initialized with ${i?"live":"test"} publishableKey.`),t.debug&&g.debug("using options",t),window?.RADAR_TEST_ENV||Ee.getConfig()}static clear(){f.clear()}static setUserId(e){if(!e){l.removeItem(l.USER_ID);return}l.setItem(l.USER_ID,String(e).trim())}static setDescription(e){if(!e){l.removeItem(l.DESCRIPTION);return}l.setItem(l.DESCRIPTION,String(e).trim())}static setMetadata(e){if(!e){l.removeItem(l.METADATA);return}l.setItem(l.METADATA,JSON.stringify(e))}static getLocation(){return A.getCurrentPosition()}static trackOnce(e={}){try{return Le.trackOnce(e)}finally{Ee.getConfig(e)}}static trackVerified(e={}){return k.trackVerified(e)}static startTrackingVerified(e){k.startTrackingVerified(e)}static stopTrackingVerified(){k.stopTrackingVerified()}static getVerifiedLocationToken(e={}){return k.getVerifiedLocationToken(e)}static clearVerifiedLocationToken(){k.clearVerifiedLocationToken()}static setExpectedJurisdiction(e,t){k.setExpectedJurisdiction(e,t)}static getContext(e){return it.getContext(e)}static setTripOptions(e){b.setTripOptions(e)}static clearTripOptions(){b.clearTripOptions()}
1static getTripOptions(){return b.getTripOptions()}static startTrip(e){return b.startTrip(e)}static updateTrip(e){return b.updateTrip(e)}static completeTrip(){return b.completeTrip()}static cancelTrip(){return b.cancelTrip()}static logConversion(e){return st.logConversion(e)}static setProduct(e){if(!e){l.removeItem(l.PRODUCT);return}l.setItem(l.PRODUCT,String(e).trim())}static onTokenUpdated(e){k.onTokenUpdated(e)}static onError(e){f.onError(e)}static forwardGeocode(e){return te.forwardGeocode(e)}static reverseGeocode(e){return te.reverseGeocode(e)}static ipGeocode(){return te.ipGeocode()}static autocomplete(e){return Z.autocomplete(e)}static searchGeofences(e){return Z.searchGeofences(e)}static searchPlaces(e){return Z.searchPlaces(e)}static validateAddress(e){return Qe.validateAddress(e)}static distance(e){return Re.distance(e)}static matrix(e){return Re.matrix(e)}};class dt{constructor(e,t,i){this.type=e,this.feature=t,this.originalEvent=i}}class Ce{constructor(e,t){var i;this._sourceIds=[],this._layerIds=[],this.id=((i=t.id)!==null&&i!==void 0?i:`feature-${Date.now()}`).toString(),(e.getFeatures()||[]).forEach(r=>{if(r.id===this.id)throw new Error(`RadarMapFeature: feature with id ${this.id} already exists.`)}),this.geometry=t.geometry,this.properties=t.properties||{},this._feature=t,this._map=e}remove(){this._layerIds.forEach(e=>{this._map.getLayer(e)&&this._map.removeLayer(e)}),this._sourceIds.forEach(e=>{this._map.getSource(e)&&this._map.removeSource(e)}),this._map._features=this._map._features.filter(e=>e.id!==this.id)}on(e,t){this._map.on(e,this.id,i=>{t(new dt(e,this,i))}),e==="click"&&(this._map.on("mouseenter",this.id,()=>{this._map.getCanvas().style.cursor="pointer"}),this._map.on("mouseleave",this.id,()=>{this._map.getCanvas().style.cursor=""}))}}const ct=(n,e=6)=>{let t=0,i=0,r=0,s=[],o=0,d=0,c=null,u,a,h=Math.pow(10,e||6);for(;t<n.length;){c=null,o=0,d=0;do c=n.charCodeAt(t++)-63,d|=(c&31)<<o,o+=5;while(c>=32);u=d&1?~(d>>1):d>>1,o=d=0;do c=n.charCodeAt(t++)-63,d|=(c&31)<<o,o+=5;while(c>=32);a=d&1?~(d>>1):d>>1,i+=u,r+=a,s.push([r/h,i/h])}return s},X=n=>{const e={};return Object.entries(n).forEach(([t,i])=>{i!==void 0&&(e[t]=i)}),e},he=(n,e={})=>{let t=Object.assign({},n);for(const i in e)e[i]instanceof Object&&!Array.isArray(e[i])&&i in n?t[i]=he(n[i],e[i]):Array.isArray(e[i])&&Array.isArray(n[i])?t[i]=n[i].concat(e[i]):t[i]=e[i];return t},lt={paint:{"line-cap":"round","line-color":"#000257","line-width":4,"border-color":"#FFFFFF","border-width":2}};class Y extends Ce{constructor(e,t,i){super(e,t);const r=this.id,s=he(lt,i),o=()=>{if(s.paint=s.paint||{},e.addSource(r,{type:"geojson",data:t}),this._sourceIds.push(r),s.paint["line-width"]&&s.paint["border-width"]){const d=`${r}-border`,c=s.paint["line-width"]+s.paint["border-width"];e.addLayer({id:d,source:r,type:"line",layout:{"line-cap":s.paint["line-cap"]},paint:X({"line-color":s.paint["border-color"],"line-opacity":s.paint["border-opacity"],"line-width":c})}),this._layerIds.push(d)}e.addLayer({id:r,source:r,type:"line",layout:{"line-cap":s.paint["line-cap"]},paint:X({"line-color":s.paint["line-color"],"line-width":s.paint["line-width"],"line-opacity":s.paint["line-opacity"],"line-offset":s.paint["line-offset"],"line-blur":s.paint["line-blur"],"line-dasharray":s.paint["line-dasharray"],"line-gap-width":s.paint["line-gap-width"],"line-gradient":s.paint["line-gradient"]})}),this._layerIds.push(r)};return e.loaded()?o():e.once("data",()=>{o()}),this}static fromPolyline(e,t,i){const r=i?.id||`polyline-feature-${Date.now()}`,s=ct(t,i?.precision),o={id:r,type:"Feature",geometry:{type:"LineString",coordinates:s},properties:i?.properties||{}};return new Y(e,o,i)}}const ut={paint:{"fill-color":"#FF6F00","fill-opacity":.3,"border-color":"#FF6F00","border-opacity":1,"border-width":2}};class ht extends Ce{constructor(e,t,i){super(e,t);const r=this.id,s=he(ut,i),o=()=>{if(s.paint=s.paint||{},e.addSource(r,{type:"geojson",data:t}),this._sourceIds.push(r),e.addLayer({id:r,source:r,type:"fill",layout:{},paint:X({"fill-color":s.paint["fill-color"],"fill-opacity":s.paint["fill-opacity"]})}),this._layerIds.push(r),s.paint["border-color"]&&s.paint["border-width"]&&s.paint["border-opacity"]){let d=`${r}-border`;e.addLayer({id:d,source:r,type:"line",layout:{},paint:X({"line-color":s.paint["border-color"],"line-opacity":s.paint["border-opacity"],"line-width":s.paint["border-width"]})}),this._layerIds.push(d)}};return e.loaded()?o():e.once("data",()=>{o()}),this}}const pt="https://api.radar.io/maps/static/images/logo.svg";class ft{onAdd(){const e=document.createElement("img");return e.src=pt,e.alt="Radar Maps Platform",this.link=document.createElement("a"),this.link.id="radar-map-logo",this.link.href="https://radar.com?ref=powered_by_radar",this.link.target="_blank",this.link.style.pointerEvents="auto",this.link.appendChild(e),this.link}onRemove(){var e;(e=this.link)===null||e===void 0||e.remove()}}const oe=(n,e)=>{e.forEach(t=>{n.push(t)})},gt=n=>{const e=[],t=n.geometry;switch(t.type){case"Point":e.push(t.coordinates);break;case"MultiPoint":case"LineString":oe(e,t.coordinates);break;
1case"MultiLineString":case"Polygon":t.coordinates.forEach(i=>oe(e,i));break;case"MultiPolygon":t.coordinates.forEach(i=>{i.forEach(r=>oe(e,r))});break;default:return e}return e},mt=n=>{const e=[];return(n||[]).forEach(t=>{gt(t).forEach(r=>{e.push(r)})}),e},vt="radar-default-v1",yt=["radar-default-v1","radar-light-v1","radar-dark-v1"],Et={showZoomControls:!0},Rt={maxZoom:20,attributionControl:!1,dragRotate:!1,touchPitch:!1,maplibreLogo:!1},It={padding:50},xe=(n,e)=>{const t=e.style||vt;let i=`${n.host}/maps/styles/${t}`;return e.language&&(i+=`?language=${e.language}`),i},_e=n=>!!(yt.includes(n)||!/^(http:|https:)/.test(n)),bt=(n,e)=>{const t=e.style;return!t||typeof t=="string"&&_e(t)?xe(n,e):e.style};class wt extends O.Map{constructor(e){const t=f.get();t.publishableKey||g.warn("publishableKey not set. Call Radar.initialize() with key before creating a new map.");const i=bt(t,e),r=Object.assign({},Et,Rt,e,{style:i},{validateStyle:!t.live});g.debug("map initialized with options",r),r.transformRequest=(a,h)=>{h==="Style"&&_e(a)&&(a=xe(t,Object.assign(Object.assign({},r),{style:a})));let p={Authorization:t.publishableKey,"X-Radar-Device-Type":"Web","X-Radar-SDK-Version":B};return typeof t.getRequestHeaders=="function"&&(p=Object.assign(p,t.getRequestHeaders())),{url:a,headers:p}},super(r),this._markers=[],this._features=[];const s=this.getContainer();!s.style.width&&!s.style.height&&g.warn('map container does not have a set "width" or "height"');const o=new ft;this.addControl(o,"bottom-left");const d=new O.AttributionControl({compact:!1});this.addControl(d,"bottom-right");const c=new O.NavigationControl({showCompass:!1,showZoom:r.showZoomControls});this.addControl(c,"bottom-right");const u=()=>{const a=document.querySelector(".maplibregl-ctrl-attrib");a&&(this.getContainer().clientWidth<380?a.classList.add("hidden"):a.classList.remove("hidden"))};this.on("resize",u),this.on("load",u)}addMarker(e){this._markers.push(e)}removeMarker(e){this._markers=this._markers.filter(t=>t!==e)}getMarkers(){return this._markers}fitToMarkers(e={},t){const i=t||this.getMarkers();if(i.length===0)return;const r=new O.LngLatBounds;i.forEach(o=>{r.extend(o.getLngLat())});const s=Object.assign(It,e);this.fitBounds(r,s)}clearMarkers(){this._markers.forEach(e=>{e.remove()})}getFeatures(){return this._features}fitToFeatures(e={},t){const i=(t||this._features).map(s=>s._feature),r=mt(i);if(r.length>0){const s=new O.LngLatBounds;r.forEach(o=>{s.extend(o)}),this.fitBounds(s,e)}}clearFeatures(){this._features.forEach(e=>{e.remove()})}addPolygon(e,t){const i=new ht(this,e,t);return this._features.push(i),i}addLine(e,t){const i=new Y(this,e,t);return this._features.push(i),i}addPolyline(e,t){const i=Y.fromPolyline(this,e,t);return this._features.push(i),i}}class Tt{constructor(e,t,i){this.target=t,this.originalEvent=i,this.point=t._pos,this.lngLat=t.getLngLat(),this.type=e}}const F=new Map,Te=(n,e=5e3)=>new Promise((t,i)=>{if(!F.has(n))return F.set(n,"pending"),i("miss");const r=Date.now(),s=setInterval(()=>{const o=F.get(n);o==="pending"?Date.now()-r>e&&(clearInterval(s),i("timed out")):o==="failed"?(clearInterval(s),i("failed")):o!==void 0&&(clearInterval(s),t(o))},100)}),St=n=>{const e=document.createElement("img");return e.src=n.url,n.width&&(typeof n.width=="number"?e.width=n.width:e.style.width=n.width),n.height&&(typeof n.height=="number"?e.height=n.height:e.style.height=n.height),!n.width&&!n.height&&(e.style.maxWidth="64px",e.style.maxHeight="64px",e.style.width="100%",e.style.height="100%"),e},At={color:"#000257"};class Lt extends O.Marker{constructor(e){const t=Object.assign({},At);if(e.color&&(t.color=e.color),e.element&&(t.element=e.element),e.scale&&(t.scale=e.scale),super(t),e.marker||e.url){const r=this._element.cloneNode(!0);this._element.childNodes.forEach(d=>{d.remove()});const s=d=>{this._element.replaceChildren(St({width:e.width,height:e.height,url:d}))},o=d=>{g.error(`Could not load marker: ${d.message} - falling back to default marker`),F.set(e.url,"failed"),this._element.replaceChildren(...Array.from(r.childNodes))};if(e.url){const d=()=>{fetch(e.url).then(c=>{c.status===200?c.blob().then(u=>{const a=URL.createObjectURL(u);F.set(e.url,a),s(a)}).catch(o):o(new Error(c.statusText))}).catch(o)};Te(e.url).then(s).catch(c=>{c!=="miss"&&g.debug(`RadarMarker: cache lookup for ${e.url}: ${c}`),d()})}if(e.marker){const d=()=>{I.request({method:"GET",version:"maps",path:`markers/${e.marker}`,responseType:"blob"}).then(({data:c})=>{const u=URL.createObjectURL(c);F.set(e.marker,u),s(u)}).catch(o)};Te(e.marker).then(s).catch(c=>{c!=="miss"&&g.debug(`RadarMarker: cache lookup for ${e.marker} ${c}`),d()})}}if(e.text&&(g.warn('marker option "text" is deprecated, and will be removed in a future version. Use "popup.text".'),e.popup=e.popup||{},e.popup.text=e.text),e.html&&(g.warn('marker option "html" is deprecated, and will be removed in a future version. Use "popup.html".'),e.popup=e.popup||{},e.popup.html=e.html),e.popup){const r=new O.Popup(e.popup);e.popup.text&&r.setText(e.popup.text),e.popup.html&&r.setHTML(e.popup.html),e.popup.element&&r.setDOMContent(e.popup.element),this.setPopup(r)}const i=this.getElement();i&&i.addEventListener("click",r=>{r.stopPropagation(),this.getPopup()&&((this._map.getMarkers()||[]).forEac
1h(s=>{var o;!((o=s.getPopup())===null||o===void 0)&&o.isOpen()&&s.togglePopup()}),this.togglePopup()),this.fire("click",new Tt("click",this,r))})}addTo(e){return e.addMarker(this),super.addTo(e)}remove(){return this._map&&this._map.removeMarker(this),super.remove()}}class Ct extends O.Popup{constructor(e){super(e),e.text&&this.setText(e.text),e.html&&this.setHTML(e.html),e.element&&this.setDOMContent(e.element)}}class W{static getMapLibre(){return O}static createMap(e){return new wt(e)}static createMarker(e={}){return new Lt(e)}static createPopup(e){return new Ct(e)}}const w={WRAPPER:"radar-autocomplete-wrapper",INPUT:"radar-autocomplete-input",SEARCH_ICON:"radar-autocomplete-search-icon",RESULTS_LIST:"radar-autocomplete-results-list",RESULTS_ITEM:"radar-autocomplete-results-item",RESULTS_MARKER:"radar-autocomplete-results-marker",SELECTED_ITEM:"radar-autocomplete-results-item-selected",POWERED_BY_RADAR:"radar-powered",NO_RESULTS:"radar-no-results"},xt={container:"autocomplete",debounceMS:200,minCharacters:3,limit:8,placeholder:"Search address",responsive:!0,disabled:!1,showMarkers:!0,hideResultsOnBlur:!0},le=n=>typeof n=="number"?`${n}px`:n,_t=400,ae=(n,e)=>{if(e.responsive){n.style.width="100%",e.width&&(n.style.maxWidth=le(e.width));return}n.style.width=le(e.width||_t),n.style.removeProperty("max-width")},Se=(n,e)=>{e.maxHeight&&(n.style.maxHeight=le(e.maxHeight),n.style.overflowY="auto")},de=(n="#ACBDC8")=>`data:image/svg+xml;charset=utf-8,${`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2    <path d="M12.5704 6.57036C12.5704 4.11632 10.6342 2.11257 8.21016 2C8.14262 2 8.06757 2 8.00003 2C7.93249 2 7.85744 2 7.7899 2C5.35838 2.11257 3.42967 4.11632 3.42967 6.57036C3.42967 6.60037 3.42967 6.6379 3.42967 6.66792C3.42967 6.69794 3.42967 6.73546 3.42967 6.76548C3.42967 9.46717 7.09196 13.3621 7.4672 13.7598C7.61729 13.9174 7.84994 14 8.00003 14C8.15012 14 8.38277 13.9174 8.53286 13.7598C8.9156 13.3621 12.5704 9.46717 12.5704 6.76548C12.5704 6.72795 12.5704 6.69794 12.5704 6.66792C12.5704 6.6379 12.5704 6.60037 12.5704 6.57036ZM7.99252 8.28893C7.04693 8.28893 6.27395 7.52345 6.27395 6.57036C6.27395 5.61726 7.03943 4.85178 7.99252 4.85178C8.94562 4.85178 9.7111 5.61726 9.7111 6.57036C9.7111 7.52345 8.94562 8.28893 7.99252 8.28893Z" fill="${n.replace("#","%23")}"/>
3  </svg>`.trim()}`;class pe{static createAutocomplete(e){return new pe(e)}constructor(e={}){this.config=Object.assign({},xt,e),this.isOpen=!1,this.debouncedFetchResults=this.debounce(this.fetchResults,this.config.debounceMS),this.results=[],this.highlightedIndex=-1,this.config.threshold!==void 0&&(this.config.minCharacters=this.config.threshold,g.warn('AutocompleteUI option "threshold" is deprecated, use "minCharacters" instead.')),e.near&&(typeof e.near=="string"?this.near=e.near:this.near=`${e.near.latitude},${e.near.longitude}`);let t;if(typeof this.config.container=="string"?t=document.getElementById(this.config.container):t=this.config.container,!t)throw new Xe(`Could not find container element: ${this.config.container}`);if(this.container=t,this.wrapper=document.createElement("div"),this.wrapper.classList.add(w.WRAPPER),this.wrapper.style.display=this.config.responsive?"block":"inline-block",ae(this.wrapper,this.config),this.resultsList=document.createElement("ul"),this.resultsList.classList.add(w.RESULTS_LIST),this.resultsList.setAttribute("id",w.RESULTS_LIST),this.resultsList.setAttribute("role","listbox"),this.resultsList.setAttribute("aria-live","polite"),this.resultsList.setAttribute("aria-label","Search results"),Se(this.resultsList,this.config),t.nodeName==="INPUT")this.inputField=t,this.wrapper.appendChild(this.resultsList),t.parentNode.appendChild(this.wrapper);else{this.inputField=document.createElement("input"),this.inputField.classList.add(w.INPUT),this.inputField.placeholder=this.config.placeholder,this.inputField.type="text",this.inputField.disabled=this.config.disabled;const i=document.createElement("div");i.classList.add(w.SEARCH_ICON),this.wrapper.appendChild(this.inputField),this.wrapper.appendChild(this.resultsList),this.wrapper.appendChild(i),this.container.appendChild(this.wrapper)}this.inputField.setAttribute("autocomplete","off"),this.inputField.setAttribute("role","combobox"),this.inputField.setAttribute("aria-controls",w.RESULTS_LIST),this.inputField.setAttribute("aria-expanded","fal
3se"),this.inputField.setAttribute("aria-haspopup","listbox"),this.inputField.setAttribute("aria-autocomplete","list"),this.inputField.setAttribute("aria-activedescendant",""),this.inputField.addEventListener("input",this.handleInput.bind(this)),this.inputField.addEventListener("keydown",this.handleKeyboardNavigation.bind(this)),this.config.hideResultsOnBlur&&this.inputField.addEventListener("blur",this.close.bind(this),!0),g.debug("AutocompleteUI initialized with options",this.config)}handleInput(){const e=this.inputField.value;e.length<this.config.minCharacters||this.debouncedFetchResults(e).then(t=>{const i=this.config.onResults;i&&i(t),this.displayResults(t)}).catch(t=>{g.warn(`Autocomplete ui error: ${t.message}`);const i=this.config.onError;i&&i(t)})}debounce(e,t){let i,r,s;return(...o)=>(clearTimeout(i),i=setTimeout(()=>{const d=e.apply(this,o);d instanceof Promise&&d.then(c=>{r&&r(c)}).catch(c=>{s&&s(c)})},t),new Promise((d,c)=>{r=d,s=c}))}fetchResults(e){return E(this,void 0,void 0,function*(){const{limit:t,layers:i,countryCode:r,expandUnits:s,mailable:o,lang:d,postalCode:c,onRequest:u}=this.config,a={query:e,limit:t,layers:i,countryCode:r,expandUnits:s,mailable:o,lang:d,postalCode:c};this.near&&(a.near=this.near),u&&u(a);const{addresses:h}=yield Z.autocomplete(a,"autocomplete-ui");return h})}displayResults(e){this.clearResultsList(),this.results=e;let t;if(this.config.showMarkers&&(t=document.createElement("img"),t.classList.add(w.RESULTS_MARKER),t.setAttribute("src",de(this.config.markerColor))),e.forEach((i,r)=>{const s=document.createElement("li");s.classList.add(w.RESULTS_ITEM),s.setAttribute("role","option"),s.setAttribute("id",`${w.RESULTS_ITEM}}-${r}`);let o;if(i.formattedAddress.includes(i.addressLabel)&&i.layer!=="postalCode"){const d=new RegExp(`(${i.addressLabel}),?`);o=i.formattedAddress.replace(d,"<b>$1</b>")}else o=`<b>${i.placeLabel||i.addressLabel}</b> ${i.formattedAddress}`;s.innerHTML=o,t&&s.prepend(t.cloneNode()),s.addEventListener("mousedown",()=>{this.select(r)}),this.resultsList.appendChild(s)}),this.open(),e.length>0){const i=document.createElement("a");i.href="https://radar.com?ref=powered_by_radar",i.target="_blank",this.poweredByLink=i;const r=document.createElement("span");r.textContent="Powered by",i.appendChild(r);const s=document.createElement("span");s.id="radar-powered-logo",s.textContent="Radar",i.appendChild(s);const o=document.createElement("div");o.classList.add(w.POWERED_BY_RADAR),o.appendChild(i),this.resultsList.appendChild(o)}else{const i=document.createElement("div");i.classList.add(w.NO_RESULTS),i.textContent="No results",this.resultsList.appendChild(i)}}open(){this.isOpen||(this.inputField.setAttribute("aria-expanded","true"),this.resultsList.removeAttribute("hidden"),this.isOpen=!0)}close(e){if(!this.isOpen)return;const t=e&&e.relatedTarget===this.poweredByLink;setTimeout(()=>{this.inputField.setAttribute("aria-expanded","false"),this.inputField.setAttribute("aria-activedescendant",""),this.resultsList.setAttribute("hidden",""),this.highlightedIndex=-1,this.isOpen=!1,this.clearResultsList()},t?100:0)}goTo(e){if(!this.isOpen||!this.results.length)return;e<0?e=this.results.length-1:e>=this.results.length&&(e=0);const t=this.resultsList.getElementsByTagName("li");this.highlightedIndex>-1&&t[this.highlightedIndex].classList.remove(w.SELECTED_ITEM),t[e].classList.add(w.SELECTED_ITEM),this.inputField.setAttribute("aria-activedescendant",`${w.RESULTS_ITEM}-${e}`),this.highlightedIndex=e}handleKeyboardNavigation(e){let t=e.key;if(this.isOpen)switch(t==="Tab"&&e.shiftKey&&(t="ArrowUp"),t){case"Tab":case"ArrowDown":e.preventDefault(),this.goTo(this.highlightedIndex+1);break;case"ArrowUp":e.preventDefault(),this.goTo(this.highlightedIndex-1);break;case"Enter":this.select(this.highlightedIndex);break;case"Esc":this.close();break}}select(e){const t=this.results[e];if(!t){g.warn(`No autocomplete result found at index: ${e}`);return}let i;t.formattedAddress.includes(t.addressLabel)?i=t.formattedAddress:i=`${t.placeLabel||t.addressLabel}, ${t.formattedAddress}`,this.inputField.value=i;const r=this.config.onSelection;r&&r(t),this.close()}clearResultsList(){this.resultsList.innerHTML="",this.results=[]}
3remove(){g.debug("AutocompleteUI removed."),this.inputField.remove(),this.resultsList.remove(),this.wrapper.remove()}setNear(e){return e==null?this.near=void 0:typeof e=="string"?this.near=e:this.near=`${e.latitude},${e.longitude}`,this}setPlaceholder(e){return this.config.placeholder=e,this.inputField.placeholder=e,this}setDisabled(e){return this.config.disabled=e,this.inputField.disabled=e,this}setResponsive(e){return this.config.responsive=e,ae(this.wrapper,this.config),this}setWidth(e){return e===null?this.config.width=void 0:(typeof e=="string"||typeof e=="number")&&(this.config.width=e),ae(this.wrapper,this.config),this}setMaxHeight(e){return e===null?this.config.maxHeight=void 0:(typeof e=="string"||typeof e=="number")&&(this.config.maxHeight=e),Se(this.resultsList,this.config),this}setMinCharacters(e){return this.config.minCharacters=e,this.config.threshold=e,this}setLimit(e){return this.config.limit=e,this}setLang(e){return e===null?this.config.lang=void 0:typeof e=="string"&&(this.config.lang=e),this}setPostalCode(e){return e===null?this.config.postalCode=void 0:typeof e=="string"&&(this.config.postalCode=e),this}setShowMarkers(e){if(this.config.showMarkers=e,e){const t=document.createElement("img");t.classList.add(w.RESULTS_MARKER),t.setAttribute("src",de(this.config.markerColor));const i=this.resultsList.getElementsByTagName("li");for(let r=0;r<i.length;r++)i[r].getElementsByClassName(w.RESULTS_MARKER)[0]||i[r].prepend(t.cloneNode())}else{const t=this.resultsList.getElementsByTagName("li");for(let i=0;i<t.length;i++){const r=t[i].getElementsByClassName(w.RESULTS_MARKER)[0];r&&r.remove()}}return this}setMarkerColor(e){this.config.markerColor=e;const t=this.resultsList.getElementsByClassName(w.RESULTS_MARKER);for(let i=0;i<t.length;i++)t[i].setAttribute("src",de(e));return this}setHideResultsOnBlur(e){return this.config.hideResultsOnBlur=e,e?this.inputField.addEventListener("blur",this.close.bind(this),!0):this.inputField.removeEventListener("blur",this.close.bind(this),!0),this}}class Nt extends at{static get ui(){return{maplibregl:W.getMapLibre(),map:W.createMap,marker:W.createMarker,popup:W.createPopup,autocomplete:pe.createAutocomplete}}}export{Nt as default};

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.