@local-logic/sdks-app 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/assets/{auto-track-legacy.c3c3a0b8.js → auto-track-legacy.541af3f5.js} +1 -1
  2. package/dist/assets/{auto-track.c84cea48.js → auto-track.10e7c441.js} +1 -1
  3. package/dist/assets/{index-legacy.d1c04f0c.js → index-legacy.07116093.js} +1 -1
  4. package/dist/assets/{index-legacy.9ef71ae1.js → index-legacy.4d95875e.js} +1 -1
  5. package/dist/assets/{index-legacy.781d0db7.js → index-legacy.60d9e590.js} +1 -1
  6. package/dist/assets/{index-legacy.a2bbfeb3.js → index-legacy.690811dc.js} +1 -1
  7. package/dist/assets/{index-legacy.5a21f088.js → index-legacy.89760bd0.js} +1 -1
  8. package/dist/assets/{index-legacy.c71389da.js → index-legacy.a4b02181.js} +1 -1
  9. package/dist/assets/{index-legacy.1501632c.js → index-legacy.be4ae81b.js} +1 -1
  10. package/dist/assets/{index-legacy.b41e509b.js → index-legacy.d24a67f5.js} +1 -1
  11. package/dist/assets/{index-legacy.ea761629.js → index-legacy.d281a40b.js} +1 -1
  12. package/dist/assets/{index-legacy.75ba90f8.js → index-legacy.d7f5a5d6.js} +1 -1
  13. package/dist/assets/{index.43c8d0af.js → index.0c5b062b.js} +1 -1
  14. package/dist/assets/{index.cd4b7a35.js → index.1787c8e5.js} +1 -1
  15. package/dist/assets/{index.1fe5d2b2.js → index.1b45b39b.js} +1 -1
  16. package/dist/assets/{index.9f38abbd.js → index.24a102e7.js} +1 -1
  17. package/dist/assets/{index.6f83ab3f.js → index.27821d72.js} +2 -2
  18. package/dist/assets/{index.4a23ceb0.js → index.7dae5d4e.js} +1 -1
  19. package/dist/assets/index.99863166.js +221 -0
  20. package/dist/assets/{index.0270a43d.js → index.c1827e8f.js} +1 -1
  21. package/dist/assets/{index.d8ae1763.js → index.ca339fe1.js} +1 -1
  22. package/dist/assets/index.e50321f4.js +1 -0
  23. package/dist/assets/index.umd-legacy.84ee2b87.js +1 -0
  24. package/dist/assets/{index.umd.15f465ad.js → index.umd.703b7a5f.js} +1 -1
  25. package/dist/index.html +2 -2
  26. package/dist/types/main.js +3 -1
  27. package/dist/types/main.js.map +1 -1
  28. package/dist/types/sdks/LocalContent/Map/CommuteContainer/CommuteCalculator/index.js +12 -9
  29. package/dist/types/sdks/LocalContent/Map/CommuteContainer/CommuteCalculator/index.js.map +1 -1
  30. package/dist/types/sdks/LocalContent/Map/CommuteContainer/index.js +1 -3
  31. package/dist/types/sdks/LocalContent/Map/CommuteContainer/index.js.map +1 -1
  32. package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.js +0 -6
  33. package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.js.map +1 -1
  34. package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/index.js +4 -3
  35. package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/index.js.map +1 -1
  36. package/dist/types/sdks/LocalContent/Map/index.js +3 -5
  37. package/dist/types/sdks/LocalContent/Map/index.js.map +1 -1
  38. package/dist/types/sdks/LocalContent/context.d.ts.map +1 -1
  39. package/dist/types/sdks/LocalContent/context.js +17 -19
  40. package/dist/types/sdks/LocalContent/context.js.map +1 -1
  41. package/package.json +1 -1
  42. package/dist/assets/index.0abff0c4.js +0 -1
  43. package/dist/assets/index.990db872.js +0 -221
  44. package/dist/assets/index.umd-legacy.633cb42e.js +0 -1
@@ -1,221 +0,0 @@
1
- var Xn=Object.defineProperty;var ei=(e,t,r)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Sr=(e,t,r)=>(ei(e,typeof t!="symbol"?t+"":t,r),r);import{M as Jr,d as it,u as ht,p as ti,s as ri,a as Ir,b as ni,$ as ii,c as oi,e as ai,f as si,S as ui,g as li,h as ci,i as fi,A as di,j as pi,k as hi,m as vi,l as mi,N as gi,P as Mr}from"./index.1fe5d2b2.js";import{_ as oe,a as S,b as E,c as L,d as D,e as yi,f as z,g as W,R as ae,r as M,S as Qr,j as _,I as Ke,L as Ht,u as we,h as Wt,p as Ve,s as $,y as I,F as Ze,i as R,k as It,l as xe,m as U,M as He,n as le,B as et,U as Yr,A as Xr,x as Rt,O as en,o as Ee,q as Jt,C as ot,t as bi,v as Ue,w as _i,z as wi,N as tn,T as Ci}from"./index.6f83ab3f.js";function ye(e){return typeof e=="string"}function Ft(e){return typeof e=="number"}function Ae(e){return typeof e=="function"}function J(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()==="object"}function xi(e){var t,r,n,i=(n=(r=(t=e.userId)!==null&&t!==void 0?t:e.anonymousId)!==null&&r!==void 0?r:e.groupId)!==null&&n!==void 0?n:e.previousId;return ye(i)}var Fe=function(e){oe(t,e);function t(r,n){var i=e.call(this,n)||this;return i.field=r,i}return t}(Error);function Se(e){var t,r=e&&e.event&&e.event.type,n=e.event;if(n===void 0)throw new Fe("event","Event is missing");if(!ye(r))throw new Fe("event","Event is not a string");if(r==="track"&&!ye(n.event))throw new Fe("event","Event is not a string");var i=(t=n.properties)!==null&&t!==void 0?t:n.traits;if(r!=="alias"&&!J(i))throw new Fe("properties","properties is not an object");if(!xi(n))throw new Fe("userId","Missing userId or anonymousId");return e}var Si={name:"Event Validation",type:"before",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:Se,identify:Se,page:Se,alias:Se,group:Se,screen:Se};function Ii(e,t,r,n){var i,o=[e,t,r,n],a=J(e)?e.event:e;if(!a||!ye(a))throw new Error("Event missing");var s=J(e)?(i=e.properties)!==null&&i!==void 0?i:{}:J(t)?t:{},u={};J(t)&&!Ae(r)&&(u=r!=null?r:{}),J(e)&&!Ae(t)&&(u=t!=null?t:{});var f=o.find(Ae);return[a,s,u,f]}function Er(e,t,r,n,i){var o,a,s=null,u=null,f=[e,t,r,n,i],p=f.filter(ye);p[0]!==void 0&&p[1]!==void 0&&(s=p[0],u=p[1]),p.length===1&&(s=null,u=p[0]);var v=f.find(Ae),b=f.filter(function(x){return u===null?J(x):J(x)||x===null}),y=(o=b[0])!==null&&o!==void 0?o:{},w=(a=b[1])!==null&&a!==void 0?a:{};return[s,u,y,w,v]}var Lr=function(e){return function(){for(var t,r,n,i,o,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var u=null;u=(n=(t=a.find(ye))!==null&&t!==void 0?t:(r=a.find(Ft))===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:e.id();var f=a.filter(function(y){return u===null?J(y):J(y)||y===null}),p=(i=f[0])!==null&&i!==void 0?i:{},v=(o=f[1])!==null&&o!==void 0?o:{},b=a.find(Ae);return[u,p,v,b]}};function Mi(e,t,r,n){Ft(e)&&(e=e.toString()),Ft(t)&&(t=t.toString());var i=[e,t,r,n],o=i.filter(ye),a=o[0],s=a===void 0?e:a,u=o[1],f=u===void 0?null:u,p=i.filter(J)[0],v=p===void 0?{}:p,b=i.find(Ae);return[s,f,v,b]}function vt(e){return Promise.resolve(e)}function Ei(e,t){return new Promise(function(r,n){var i=setTimeout(function(){n(Error("Promise timed out"))},t);e.then(function(o){return clearTimeout(i),r(o)}).catch(n)})}function Li(e){return new Promise(function(t){return setTimeout(t,e)})}function Ai(e,t,r,n){var i=function(){try{return vt(t(e))}catch(o){return Promise.reject(o)}};return Li(r).then(function(){return Ei(i(),n!=null?n:1e3)}).catch(function(o){e==null||e.log("warn","Callback Error",{error:o}),e==null||e.stats.increment("callback_error")}).then(function(){return e})}function Qt(){return typeof window<"u"}function Iu(){return!Qt()}function rn(){return Qt()?window.navigator.onLine:!0}function ct(){return!rn()}var ve=256,at=[],tt;for(;ve--;)at[ve]=(ve+256).toString(16).substring(1);function Yt(){var e=0,t,r="";if(!tt||ve+16>256){for(tt=Array(e=256);e--;)tt[e]=256*Math.random()|0;e=ve=0}for(;e<16;e++)t=tt[ve+e],e==6?r+=at[t&15|64]:e==8?r+=at[t&63|128]:r+=at[t],e&1&&e>1&&e<11&&(r+="-");return ve++,r}function ft(e,t,r){t.split&&(t=t.split("."));for(var n=0,i=t.length,o=e,a,s;n<i&&(s=t[n++],!(s==="__proto__"||s==="constructor"||s==="prototype"));)o=o[s]=n===i?r:typeof(a=o[s])==typeof t?a:t[n]*0!==0||!!~(""+t[n]).indexOf(".")?{}:[]}const Mu=Object.freeze(Object.defineProperty({__proto__:null,dset:ft},Symbol.toStringTag,{value:"Module"}));var Oi=function(){function e(){var t=this;this._logs=[],this.log=function(r,n,i){var o=new Date;t._logs.push({level:r,message:n,time:o,extras:i})}}return Object.defineProperty(e.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),e.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(r,n){var i,o,a,s=S(S({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete s.time;var u=(a=(o=n.time)===null||o===void 0?void 0:o.toISOString())!==null&&a!==void 0?a:"";return r[u]&&(u="".concat(u,"-").concat(Math.random())),S(S({},r),(i={},i[u]=s,i))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(r){var n=r.level,i=r.message,o=r.extras;n==="info"||n==="debug"?console.log(i,o!=null?o:""):console[n](i,o!=null?o:"")});this._logs=[]},e}();const Pi=Oi;var $i=function(e){var t={gauge:"g",counter:"c"};return t[e]},Ti=function(){function e(t){this.metrics=[],this.remoteMetrics=t}return e.prototype.increment=function(t,r,n){var i;r===void 0&&(r=1),this.metrics.push({metric:t,value:r,tags:n!=null?n:[],type:"counter",timestamp:Date.now()}),(i=this.remoteMetrics)===null||i===void 0||i.increment(t,n!=null?n:[])},e.prototype.gauge=function(t,r,n){this.metrics.push({metric:t,value:r,tags:n!=null?n:[],type:"gauge",timestamp:Date.now()})},e.prototype.flush=function(){var t=this.metrics.map(function(r){return S(S({},r),{tags:r.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},e.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:$i(t.type),e:t.timestamp}})},e}();const Di=Ti;function Te(e,t){return t=t||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(p){return s[p.toLowerCase()]},has:function(p){return p.toLowerCase()in s}}}};for(var f in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(p,v,b){o.push(v=v.toLowerCase()),a.push([v,b]),s[v]=s[v]?s[v]+","+b:b}),r(u())},i.onerror=n,i.withCredentials=t.credentials=="include",t.headers)i.setRequestHeader(f,t.headers[f]);i.send(t.body||null)})}var Pe="1.44.0";/*! js-cookie v3.0.1 | MIT */function rt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var ki={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Nt(e,t){function r(i,o,a){if(!(typeof document>"u")){a=rt({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in a)!a[u]||(s+="; "+u,a[u]!==!0&&(s+="="+a[u].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var u=o[s].split("="),f=u.slice(1).join("=");try{var p=decodeURIComponent(u[0]);if(a[p]=e.read(f,p),i===p)break}catch(v){}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",rt({},o,{expires:-1}))},withAttributes:function(i){return Nt(this.converter,rt({},this.attributes,i))},withConverter:function(i){return Nt(rt({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var G=Nt(ki,{path:"/"});function ji(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function Ri(e){var t=e.hostname,r=t.split("."),n=r[r.length-1],i=[];if(r.length===4&&parseInt(n,10)>0||r.length<=1)return i;for(var o=r.length-2;o>=0;--o)i.push(r.slice(o).join("."));return i}function Fi(e){try{return new URL(e)}catch(t){return}}function nn(e){var t=Fi(e);if(!!t)for(var r=Ri(t),n=0;n<r.length;++n){var i="__tld__",o=r[n],a={domain:"."+o};try{if(G.set(i,"1",a),G.get(i))return G.remove(i,a),o}catch(s){return}}}var Ne;function Ni(){if(Ne)return Ne;var e=nn(window.location.href);return Ne={expires:31536e6,secure:!1,path:"/"},e&&(Ne.domain=e),Ne}var zi="npm";function on(){return zi}function Bi(){var e=G.get("_ga");if(e&&e.startsWith("amp"))return e}function Ui(e){return e.startsWith("?")&&(e=e.substring(1)),e=e.replace(/\?/g,"&"),e.split("&").reduce(function(t,r){var n=r.split("="),i=n[0],o=n[1],a=o===void 0?"":o;if(i.includes("utm_")&&i.length>4){var s=i.substr(4);s==="campaign"&&(s="name"),t[s]=ji(a)}return t},{})}function Vi(e){var t={btid:"dataxu",urid:"millennial-media"};e.startsWith("?")&&(e=e.substring(1)),e=e.replace(/\?/g,"&");for(var r=e.split("&"),n=0,i=r;n<i.length;n++){var o=i[n],a=o.split("="),s=a[0],u=a[1];if(t[s])return{id:u,type:t[s]}}}function Gi(e,t,r){var n=G.get("s:context.referrer"),i=Vi(e);n=n?JSON.parse(n):void 0,i=i!=null?i:n,i&&(t&&(t.referrer=S(S({},t.referrer),i)),r||G.set("s:context.referrer",JSON.stringify(i),Ni()))}function qi(e,t,r,n){var i,o,a,s,u=e.user(),f=window.location.search;t.context=(o=(i=t.context)!==null&&i!==void 0?i:t.options)!==null&&o!==void 0?o:{};var p=t.context,v=t.anonymousId;delete t.options,t.writeKey=r==null?void 0:r.apiKey,p.userAgent=window.navigator.userAgent;var b=navigator.userLanguage||navigator.language;if(typeof p.locale>"u"&&typeof b<"u"&&(p.locale=b),!p.library){var y=on();y==="web"?p.library={name:"analytics.js",version:"next-".concat(Pe)}:p.library={name:"analytics.js",version:"npm:next-".concat(Pe)}}f&&!p.campaign&&(p.campaign=Ui(f)),Gi(f,p,(a=e.options.disableClientPersistence)!==null&&a!==void 0?a:!1),t.userId=t.userId||u.id(),t.anonymousId=u.anonymousId(v),t.sentAt=new Date;var w=e.queue.failedInitializations||[];w.length>0&&(t._metadata={failedInitializations:w});var x=[],C=[];for(var m in n){var g=n[m];m==="Segment.io"&&x.push(m),g.bundlingStatus==="bundled"&&x.push(m),g.bundlingStatus==="unbundled"&&C.push(m)}for(var c=0,l=(r==null?void 0:r.unbundledIntegrations)||[];c<l.length;c++){var h=l[c];C.includes(h)||C.push(h)}var d=(s=r==null?void 0:r.maybeBundledConfigIds)!==null&&s!==void 0?s:{},A=[];x.sort().forEach(function(T){var B;((B=d[T])!==null&&B!==void 0?B:[]).forEach(function(Xe){A.push(Xe)})}),(r==null?void 0:r.addBundledMetadata)!==!1&&(t._metadata=S(S({},t._metadata),{bundled:x.sort(),unbundled:C.sort(),bundledIds:A}));var P=Bi();return P&&(p.amp={id:P}),t}function Mt(e){console.error("Error sending segment performance metrics",e)}var Ki=function(){function e(t){var r=this,n,i,o,a;if(this.host=(n=t==null?void 0:t.host)!==null&&n!==void 0?n:"api.segment.io/v1",this.sampleRate=(i=t==null?void 0:t.sampleRate)!==null&&i!==void 0?i:1,this.flushTimer=(o=t==null?void 0:t.flushTimer)!==null&&o!==void 0?o:30*1e3,this.maxQueueSize=(a=t==null?void 0:t.maxQueueSize)!==null&&a!==void 0?a:20,this.queue=[],this.sampleRate>0){var s=!1,u=function(){s||(s=!0,r.flush().catch(Mt),s=!1,setTimeout(u,r.flushTimer))};u()}}return e.prototype.increment=function(t,r){if(!!t.includes("analytics_js.")&&r.length!==0&&!(Math.random()>this.sampleRate)&&!(this.queue.length>=this.maxQueueSize)){var n=r.reduce(function(o,a){var s=a.split(":"),u=s[0],f=s[1];return o[u]=f,o},{});n.library="analytics.js";var i=on();i==="web"?n.library_version="next-".concat(Pe):n.library_version="npm:next-".concat(Pe),this.queue.push({type:"Counter",metric:t,value:1,tags:n}),t.includes("error")&&this.flush().catch(Mt)}},e.prototype.flush=function(){return E(this,void 0,void 0,function(){var t=this;return L(this,function(r){switch(r.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(n){Mt(n),t.sampleRate=0})];case 1:return r.sent(),[2]}})})},e.prototype.send=function(){return E(this,void 0,void 0,function(){var t,r,n;return L(this,function(i){return t={series:this.queue},this.queue=[],r={"Content-Type":"text/plain"},n="https://".concat(this.host,"/m"),[2,Te(n,{headers:r,body:JSON.stringify(t),method:"POST"})]})})},e}(),be=function(){function e(t){var r,n,i;this.retry=(r=t.retry)!==null&&r!==void 0?r:!0,this.type=(n=t.type)!==null&&n!==void 0?n:"plugin Error",this.reason=(i=t.reason)!==null&&i!==void 0?i:""}return e}(),Ar,re=function(){function e(t,r){this.logger=new Pi,this.cancel=function(n){throw n||new be({reason:"Context Cancel"})},this._attempts=0,this._event=t,this._id=r!=null?r:Yt(),this.stats=new Di(Ar)}return e.initMetrics=function(t){Ar=new Ki(t)},e.system=function(){return new e({type:"track",event:"system"})},e.prototype.isSame=function(t){return t._id===this._id},e.prototype.log=function(t,r,n){this.logger.log(t,r,n)},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"event",{get:function(){return this._event},set:function(t){this._event=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attempts",{get:function(){return this._attempts},set:function(t){this._attempts=t},enumerable:!1,configurable:!0}),e.prototype.updateEvent=function(t,r){var n;if(t.split(".")[0]==="integrations"){var i=t.split(".")[1];if(((n=this._event.integrations)===null||n===void 0?void 0:n[i])===!1)return this._event}return ft(this._event,t,r),this._event},e.prototype.failedDelivery=function(){return this._failedDelivery},e.prototype.setFailedDelivery=function(t){this._failedDelivery=t},e.prototype.logs=function(){return this.logger.logs},e.prototype.flush=function(){this.logger.flush(),this.stats.flush()},e.prototype.toJSON=function(){return{id:this._id,event:this._event,logs:this.logger.logs,metrics:this.stats.metrics}},e}(),Xt=function(){function e(){this.callbacks={}}return e.prototype.on=function(t,r){return this.callbacks[t]?this.callbacks[t].push(r):this.callbacks[t]=[r],this},e.prototype.once=function(t,r){var n=this,i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];n.off(t,i),r.apply(n,o)};return this.on(t,i),this},e.prototype.off=function(t,r){var n,i=(n=this.callbacks[t])!==null&&n!==void 0?n:[],o=i.filter(function(a){return a!==r});return this.callbacks[t]=o,this},e.prototype.emit=function(t){for(var r=this,n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var a=(n=this.callbacks[t])!==null&&n!==void 0?n:[];return a.forEach(function(s){s.apply(r,i)}),this},e}(),pe={},se={},er={},We={exports:{}};(function(e){e.exports=t(r),e.exports.find=e.exports,e.exports.replace=function(s,u,f,p){return t(i).call(this,s,u,f,p),s},e.exports.del=function(s,u,f){return t(n).call(this,s,u,null,f),s};function t(s){return function(u,f,p,v){var b=v&&a(v.normalizer)?v.normalizer:o;f=b(f);for(var y,w=!1;!w;)x();function x(){for(y in u){var C=b(y);if(f.indexOf(C)===0){var m=f.substr(C.length);if(m.charAt(0)==="."||m.length===0){f=m.substr(1);var g=u[y];if(g==null){w=!0;return}if(!f.length){w=!0;return}u=g;return}}}y=void 0,w=!0}if(!!y)return u==null?u:s(u,y,p)}}function r(s,u){if(s.hasOwnProperty(u))return s[u]}function n(s,u){return s.hasOwnProperty(u)&&delete s[u],s}function i(s,u,f){return s.hasOwnProperty(u)&&(s[u]=f),s}function o(s){return s.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}function a(s){return typeof s=="function"}})(We);var Zi=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(er,"__esModule",{value:!0});var de=Zi(We.exports);function Ie(e,t){return function(){var r=this.traits(),n=this.properties?this.properties():{};return de.default(r,"address."+e)||de.default(r,e)||(t?de.default(r,"address."+t):null)||(t?de.default(r,t):null)||de.default(n,"address."+e)||de.default(n,e)||(t?de.default(n,"address."+t):null)||(t?de.default(n,t):null)}}function Hi(e){e.zip=Ie("postalCode","zip"),e.country=Ie("country"),e.street=Ie("street"),e.state=Ie("state"),e.city=Ie("city"),e.region=Ie("region")}er.default=Hi;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.clone=void 0;function zt(e){if(Object.prototype.toString.call(e)==="[object Object]"){var t={};for(var r in e)t[r]=zt(e[r]);return t}else return Array.isArray(e)?e.map(zt):e}mt.clone=zt;var tr={};Object.defineProperty(tr,"__esModule",{value:!0});var Wi={Salesforce:!0};function Ji(e){return!Wi[e]}tr.default=Ji;var gt={},an=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;gt.parse=function(e){var t=[1,5,6,7,11,12],r=an.exec(e),n=0;if(!r)return new Date(e);for(var i=0,o;o=t[i];i++)r[o]=parseInt(r[o],10)||0;r[2]=parseInt(r[2],10)||1,r[3]=parseInt(r[3],10)||1,r[2]--,r[8]=r[8]?(r[8]+"00").substring(0,3):0,r[4]===" "?n=new Date().getTimezoneOffset():r[9]!=="Z"&&r[10]&&(n=r[11]*60+r[12],r[10]==="+"&&(n=0-n));var a=Date.UTC(r[1],r[2],r[3],r[5],r[6]+n,r[7],r[8]);return new Date(a)};gt.is=function(e,t){return typeof e!="string"||t&&/^\d{4}-\d{2}-\d{2}/.test(e)===!1?!1:an.test(e)};var rr={},Qi=/\d{13}/;rr.is=function(e){return Qi.test(e)};rr.parse=function(e){return e=parseInt(e,10),new Date(e)};var nr={},Yi=/\d{10}/;nr.is=function(e){return Yi.test(e)};nr.parse=function(e){var t=parseInt(e,10)*1e3;return new Date(t)};var Or=gt,Pr=rr,$r=nr,Xi=Object.prototype,sn=Xi.toString;function eo(e){return sn.call(e)==="[object Date]"}function to(e){return sn.call(e)==="[object Number]"}var ir=function(t){return eo(t)?t:to(t)?new Date(ro(t)):Or.is(t)?Or.parse(t):Pr.is(t)?Pr.parse(t):$r.is(t)?$r.parse(t):new Date(t)};function ro(e){return e<315576e5?e*1e3:e}var Tr=gt,no=or;function or(e,t){return t===void 0&&(t=!0),e&&typeof e=="object"?io(e,t):Array.isArray(e)?oo(e,t):Tr.is(e,t)?Tr.parse(e):e}function io(e,t){return Object.keys(e).forEach(function(r){e[r]=or(e[r],t)}),e}function oo(e,t){return e.forEach(function(r,n){e[n]=or(r,t)}),e}var Je=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(se,"__esModule",{value:!0});se.Facade=void 0;var ao=Je(er),$e=mt,so=Je(tr),uo=Je(ir),Bt=Je(We.exports),lo=Je(no);function q(e,t){t=t||{},this.raw=$e.clone(e),"clone"in t||(t.clone=!0),t.clone&&(e=$e.clone(e)),"traverse"in t||(t.traverse=!0),"timestamp"in e?e.timestamp=uo.default(e.timestamp):e.timestamp=new Date,t.traverse&&lo.default(e),this.opts=t,this.obj=e}se.Facade=q;var k=q.prototype;k.proxy=function(e){var t=e.split(".");e=t.shift();var r=this[e]||this.field(e);return r&&(typeof r=="function"&&(r=r.call(this)||{}),t.length===0?this.opts.clone?Ut(r):r:(r=Bt.default(r,t.join(".")),this.opts.clone?Ut(r):r))};k.field=function(e){var t=this.obj[e];return this.opts.clone?Ut(t):t};q.proxy=function(e){return function(){return this.proxy(e)}};q.field=function(e){return function(){return this.field(e)}};q.multi=function(e){return function(){var t=this.proxy(e+"s");if(Array.isArray(t))return t;var r=this.proxy(e);return r&&(r=[this.opts.clone?$e.clone(r):r]),r||[]}};q.one=function(e){return function(){var t=this.proxy(e);if(t)return t;var r=this.proxy(e+"s");if(Array.isArray(r))return r[0]}};k.json=function(){var e=this.opts.clone?$e.clone(this.obj):this.obj;return this.type&&(e.type=this.type()),e};k.rawEvent=function(){return this.raw};k.options=function(e){var t=this.obj.options||this.obj.context||{},r=this.opts.clone?$e.clone(t):t;if(!e)return r;if(!!this.enabled(e)){var n=this.integrations(),i=n[e]||Bt.default(n,e);return typeof i!="object"&&(i=Bt.default(this.options(),e)),typeof i=="object"?i:{}}};k.context=k.options;k.enabled=function(e){var t=this.proxy("options.providers.all");typeof t!="boolean"&&(t=this.proxy("options.all")),typeof t!="boolean"&&(t=this.proxy("integrations.all")),typeof t!="boolean"&&(t=!0);var r=t&&so.default(e),n=this.integrations();if(n.providers&&n.providers.hasOwnProperty(e)&&(r=n.providers[e]),n.hasOwnProperty(e)){var i=n[e];typeof i=="boolean"?r=i:r=!0}return!!r};k.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()};k.active=function(){var e=this.proxy("options.active");return e==null&&(e=!0),e};k.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")};k.sessionId=k.anonymousId;k.groupId=q.proxy("options.groupId");k.traits=function(e){var t=this.proxy("options.traits")||{},r=this.userId();e=e||{},r&&(t.id=r);for(var n in e){var i=this[n]==null?this.proxy("options.traits."+n):this[n]();i!=null&&(t[e[n]]=i,delete t[n])}return t};k.library=function(){var e=this.proxy("options.library");return e?typeof e=="string"?{name:e,version:null}:e:{name:"unknown",version:null}};k.device=function(){var e=this.proxy("context.device");(typeof e!="object"||e===null)&&(e={});var t=this.library().name;return e.type||(t.indexOf("ios")>-1&&(e.type="ios"),t.indexOf("android")>-1&&(e.type="android")),e};k.userAgent=q.proxy("context.userAgent");k.timezone=q.proxy("context.timezone");k.timestamp=q.field("timestamp");k.channel=q.field("channel");k.ip=q.proxy("context.ip");k.userId=q.field("userId");ao.default(k);function Ut(e){return $e.clone(e)}var yt={},ce={exports:{}};typeof Object.create=="function"?ce.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ce.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var co=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yt,"__esModule",{value:!0});yt.Alias=void 0;var fo=co(ce.exports),un=se;function Y(e,t){un.Facade.call(this,e,t)}yt.Alias=Y;fo.default(Y,un.Facade);Y.prototype.action=function(){return"alias"};Y.prototype.type=Y.prototype.action;Y.prototype.previousId=function(){return this.field("previousId")||this.field("from")};Y.prototype.from=Y.prototype.previousId;Y.prototype.userId=function(){return this.field("userId")||this.field("to")};Y.prototype.to=Y.prototype.userId;var bt={},De={};Object.defineProperty(De,"__esModule",{value:!0});var po=/.+\@.+\..+/;function ho(e){return po.test(e)}De.default=ho;var ar=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bt,"__esModule",{value:!0});bt.Group=void 0;var vo=ar(ce.exports),mo=ar(De),go=ar(ir),ke=se;function sr(e,t){ke.Facade.call(this,e,t)}bt.Group=sr;vo.default(sr,ke.Facade);var X=sr.prototype;X.action=function(){return"group"};X.type=X.action;X.groupId=ke.Facade.field("groupId");X.created=function(){var e=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(e)return go.default(e)};X.email=function(){var e=this.proxy("traits.email");if(e)return e;var t=this.groupId();if(mo.default(t))return t};X.traits=function(e){var t=this.properties(),r=this.groupId();e=e||{},r&&(t.id=r);for(var n in e){var i=this[n]==null?this.proxy("traits."+n):this[n]();i!=null&&(t[e[n]]=i,delete t[n])}return t};X.name=ke.Facade.proxy("traits.name");X.industry=ke.Facade.proxy("traits.industry");X.employees=ke.Facade.proxy("traits.employees");X.properties=function(){return this.field("traits")||this.field("properties")||{}};var Qe={},_t=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.Identify=void 0;var ue=se,Oe=_t(We.exports),yo=_t(ce.exports),bo=_t(De),ln=_t(ir),me=function(e){return e.trim()};function ur(e,t){ue.Facade.call(this,e,t)}Qe.Identify=ur;yo.default(ur,ue.Facade);var j=ur.prototype;j.action=function(){return"identify"};j.type=j.action;j.traits=function(e){var t=this.field("traits")||{},r=this.userId();e=e||{},r&&(t.id=r);for(var n in e){var i=this[n]==null?this.proxy("traits."+n):this[n]();i!=null&&(t[e[n]]=i,n!==e[n]&&delete t[n])}return t};j.email=function(){var e=this.proxy("traits.email");if(e)return e;var t=this.userId();if(bo.default(t))return t};j.created=function(){var e=this.proxy("traits.created")||this.proxy("traits.createdAt");if(e)return ln.default(e)};j.companyCreated=function(){var e=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(e)return ln.default(e)};j.companyName=function(){return this.proxy("traits.company.name")};j.name=function(){var e=this.proxy("traits.name");if(typeof e=="string")return me(e);var t=this.firstName(),r=this.lastName();if(t&&r)return me(t+" "+r)};j.firstName=function(){var e=this.proxy("traits.firstName");if(typeof e=="string")return me(e);var t=this.proxy("traits.name");if(typeof t=="string")return me(t).split(" ")[0]};j.lastName=function(){var e=this.proxy("traits.lastName");if(typeof e=="string")return me(e);var t=this.proxy("traits.name");if(typeof t=="string"){var r=me(t).indexOf(" ");if(r!==-1)return me(t.substr(r+1))}};j.uid=function(){return this.userId()||this.username()||this.email()};j.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")};j.age=function(){var e=this.birthday(),t=Oe.default(this.traits(),"age");if(t!=null)return t;if(e instanceof Date){var r=new Date;return r.getFullYear()-e.getFullYear()}};j.avatar=function(){var e=this.traits();return Oe.default(e,"avatar")||Oe.default(e,"photoUrl")||Oe.default(e,"avatarUrl")};j.position=function(){var e=this.traits();return Oe.default(e,"position")||Oe.default(e,"jobTitle")};j.username=ue.Facade.proxy("traits.username");j.website=ue.Facade.one("traits.website");j.websites=ue.Facade.multi("traits.website");j.phone=ue.Facade.one("traits.phone");j.phones=ue.Facade.multi("traits.phone");j.address=ue.Facade.proxy("traits.address");j.gender=ue.Facade.proxy("traits.gender");j.birthday=ue.Facade.proxy("traits.birthday");var je={},lr=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(je,"__esModule",{value:!0});je.Track=void 0;var _o=lr(ce.exports),F=se,wo=Qe,Co=lr(De),cn=lr(We.exports);function cr(e,t){F.Facade.call(this,e,t)}je.Track=cr;_o.default(cr,F.Facade);var O=cr.prototype;O.action=function(){return"track"};O.type=O.action;O.event=F.Facade.field("event");O.value=F.Facade.proxy("properties.value");O.category=F.Facade.proxy("properties.category");O.id=F.Facade.proxy("properties.id");O.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")};O.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")};O.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")};O.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")};O.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")};O.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")};O.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")};O.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")};O.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")};O.sku=F.Facade.proxy("properties.sku");O.tax=F.Facade.proxy("properties.tax");O.name=F.Facade.proxy("properties.name");O.price=F.Facade.proxy("properties.price");O.total=F.Facade.proxy("properties.total");O.repeat=F.Facade.proxy("properties.repeat");O.coupon=F.Facade.proxy("properties.coupon");O.shipping=F.Facade.proxy("properties.shipping");O.discount=F.Facade.proxy("properties.discount");O.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")};O.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")};O.description=F.Facade.proxy("properties.description");O.plan=F.Facade.proxy("properties.plan");O.subtotal=function(){var e=cn.default(this.properties(),"subtotal"),t=this.total()||this.revenue();if(e)return e;if(!t)return 0;if(this.total()){var r=this.tax();r&&(t-=r),r=this.shipping(),r&&(t-=r),r=this.discount(),r&&(t+=r)}return t};O.products=function(){var e=this.properties(),t=cn.default(e,"products");return Array.isArray(t)?t.filter(function(r){return r!==null}):[]};O.quantity=function(){var e=this.obj.properties||{};return e.quantity||1};O.currency=function(){var e=this.obj.properties||{};return e.currency||"USD"};O.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")};O.query=F.Facade.proxy("options.query");O.properties=function(e){var t=this.field("properties")||{};e=e||{};for(var r in e){var n=this[r]==null?this.proxy("properties."+r):this[r]();n!=null&&(t[e[r]]=n,delete t[r])}return t};O.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()};O.email=function(){var e=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(e)return e;var t=this.userId();if(Co.default(t))return t};O.revenue=function(){var e=this.proxy("properties.revenue"),t=this.event(),r=/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;return!e&&t&&t.match(r)&&(e=this.proxy("properties.total")),xo(e)};O.cents=function(){var e=this.revenue();return typeof e!="number"?this.value()||0:e*100};O.identify=function(){var e=this.json();return e.traits=this.traits(),new wo.Identify(e,this.opts)};function xo(e){if(!!e){if(typeof e=="number")return e;if(typeof e=="string"&&(e=e.replace(/\$/g,""),e=parseFloat(e),!isNaN(e)))return e}}var Ye={},fn=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Page=void 0;var So=fn(ce.exports),Ce=se,Io=je,Mo=fn(De);function fr(e,t){Ce.Facade.call(this,e,t)}Ye.Page=fr;So.default(fr,Ce.Facade);var V=fr.prototype;V.action=function(){return"page"};V.type=V.action;V.category=Ce.Facade.field("category");V.name=Ce.Facade.field("name");V.title=Ce.Facade.proxy("properties.title");V.path=Ce.Facade.proxy("properties.path");V.url=Ce.Facade.proxy("properties.url");V.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")};V.properties=function(e){var t=this.field("properties")||{},r=this.category(),n=this.name();e=e||{},r&&(t.category=r),n&&(t.name=n);for(var i in e){var o=this[i]==null?this.proxy("properties."+i):this[i]();o!=null&&(t[e[i]]=o,i!==e[i]&&delete t[i])}return t};V.email=function(){var e=this.proxy("context.traits.email")||this.proxy("properties.email");if(e)return e;var t=this.userId();if(Mo.default(t))return t};V.fullName=function(){var e=this.category(),t=this.name();return t&&e?e+" "+t:t};V.event=function(e){return e?"Viewed "+e+" Page":"Loaded a Page"};V.track=function(e){var t=this.json();return t.event=this.event(e),t.timestamp=this.timestamp(),t.properties=this.properties(),new Io.Track(t,this.opts)};var wt={},Eo=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wt,"__esModule",{value:!0});wt.Screen=void 0;var Lo=Eo(ce.exports),dn=Ye,Ao=je;function _e(e,t){dn.Page.call(this,e,t)}wt.Screen=_e;Lo.default(_e,dn.Page);_e.prototype.action=function(){return"screen"};_e.prototype.type=_e.prototype.action;_e.prototype.event=function(e){return e?"Viewed "+e+" Screen":"Loaded a Screen"};_e.prototype.track=function(e){var t=this.json();return t.event=this.event(e),t.timestamp=this.timestamp(),t.properties=this.properties(),new Ao.Track(t,this.opts)};var Ct={},Oo=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.Delete=void 0;var Po=Oo(ce.exports),pn=se;function dr(e,t){pn.Facade.call(this,e,t)}Ct.Delete=dr;Po.default(dr,pn.Facade);dr.prototype.type=function(){return"delete"};(function(e){var t=D&&D.__assign||function(){return t=Object.assign||function(p){for(var v,b=1,y=arguments.length;b<y;b++){v=arguments[b];for(var w in v)Object.prototype.hasOwnProperty.call(v,w)&&(p[w]=v[w])}return p},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Delete=e.Screen=e.Page=e.Track=e.Identify=e.Group=e.Alias=e.Facade=void 0;var r=se;Object.defineProperty(e,"Facade",{enumerable:!0,get:function(){return r.Facade}});var n=yt;Object.defineProperty(e,"Alias",{enumerable:!0,get:function(){return n.Alias}});var i=bt;Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return i.Group}});var o=Qe;Object.defineProperty(e,"Identify",{enumerable:!0,get:function(){return o.Identify}});var a=je;Object.defineProperty(e,"Track",{enumerable:!0,get:function(){return a.Track}});var s=Ye;Object.defineProperty(e,"Page",{enumerable:!0,get:function(){return s.Page}});var u=wt;Object.defineProperty(e,"Screen",{enumerable:!0,get:function(){return u.Screen}});var f=Ct;Object.defineProperty(e,"Delete",{enumerable:!0,get:function(){return f.Delete}}),e.default=t(t({},r.Facade),{Alias:n.Alias,Group:i.Group,Identify:o.Identify,Track:a.Track,Page:s.Page,Screen:u.Screen,Delete:f.Delete})})(pe);var hn={exports:{}};(function(e,t){(function(r){e.exports=r()})(function(r){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(m,g){var c=m[0],l=m[1],h=m[2],d=m[3];c+=(l&h|~l&d)+g[0]-680876936|0,c=(c<<7|c>>>25)+l|0,d+=(c&l|~c&h)+g[1]-389564586|0,d=(d<<12|d>>>20)+c|0,h+=(d&c|~d&l)+g[2]+606105819|0,h=(h<<17|h>>>15)+d|0,l+=(h&d|~h&c)+g[3]-1044525330|0,l=(l<<22|l>>>10)+h|0,c+=(l&h|~l&d)+g[4]-176418897|0,c=(c<<7|c>>>25)+l|0,d+=(c&l|~c&h)+g[5]+1200080426|0,d=(d<<12|d>>>20)+c|0,h+=(d&c|~d&l)+g[6]-1473231341|0,h=(h<<17|h>>>15)+d|0,l+=(h&d|~h&c)+g[7]-45705983|0,l=(l<<22|l>>>10)+h|0,c+=(l&h|~l&d)+g[8]+1770035416|0,c=(c<<7|c>>>25)+l|0,d+=(c&l|~c&h)+g[9]-1958414417|0,d=(d<<12|d>>>20)+c|0,h+=(d&c|~d&l)+g[10]-42063|0,h=(h<<17|h>>>15)+d|0,l+=(h&d|~h&c)+g[11]-1990404162|0,l=(l<<22|l>>>10)+h|0,c+=(l&h|~l&d)+g[12]+1804603682|0,c=(c<<7|c>>>25)+l|0,d+=(c&l|~c&h)+g[13]-40341101|0,d=(d<<12|d>>>20)+c|0,h+=(d&c|~d&l)+g[14]-1502002290|0,h=(h<<17|h>>>15)+d|0,l+=(h&d|~h&c)+g[15]+1236535329|0,l=(l<<22|l>>>10)+h|0,c+=(l&d|h&~d)+g[1]-165796510|0,c=(c<<5|c>>>27)+l|0,d+=(c&h|l&~h)+g[6]-1069501632|0,d=(d<<9|d>>>23)+c|0,h+=(d&l|c&~l)+g[11]+643717713|0,h=(h<<14|h>>>18)+d|0,l+=(h&c|d&~c)+g[0]-373897302|0,l=(l<<20|l>>>12)+h|0,c+=(l&d|h&~d)+g[5]-701558691|0,c=(c<<5|c>>>27)+l|0,d+=(c&h|l&~h)+g[10]+38016083|0,d=(d<<9|d>>>23)+c|0,h+=(d&l|c&~l)+g[15]-660478335|0,h=(h<<14|h>>>18)+d|0,l+=(h&c|d&~c)+g[4]-405537848|0,l=(l<<20|l>>>12)+h|0,c+=(l&d|h&~d)+g[9]+568446438|0,c=(c<<5|c>>>27)+l|0,d+=(c&h|l&~h)+g[14]-1019803690|0,d=(d<<9|d>>>23)+c|0,h+=(d&l|c&~l)+g[3]-187363961|0,h=(h<<14|h>>>18)+d|0,l+=(h&c|d&~c)+g[8]+1163531501|0,l=(l<<20|l>>>12)+h|0,c+=(l&d|h&~d)+g[13]-1444681467|0,c=(c<<5|c>>>27)+l|0,d+=(c&h|l&~h)+g[2]-51403784|0,d=(d<<9|d>>>23)+c|0,h+=(d&l|c&~l)+g[7]+1735328473|0,h=(h<<14|h>>>18)+d|0,l+=(h&c|d&~c)+g[12]-1926607734|0,l=(l<<20|l>>>12)+h|0,c+=(l^h^d)+g[5]-378558|0,c=(c<<4|c>>>28)+l|0,d+=(c^l^h)+g[8]-2022574463|0,d=(d<<11|d>>>21)+c|0,h+=(d^c^l)+g[11]+1839030562|0,h=(h<<16|h>>>16)+d|0,l+=(h^d^c)+g[14]-35309556|0,l=(l<<23|l>>>9)+h|0,c+=(l^h^d)+g[1]-1530992060|0,c=(c<<4|c>>>28)+l|0,d+=(c^l^h)+g[4]+1272893353|0,d=(d<<11|d>>>21)+c|0,h+=(d^c^l)+g[7]-155497632|0,h=(h<<16|h>>>16)+d|0,l+=(h^d^c)+g[10]-1094730640|0,l=(l<<23|l>>>9)+h|0,c+=(l^h^d)+g[13]+681279174|0,c=(c<<4|c>>>28)+l|0,d+=(c^l^h)+g[0]-358537222|0,d=(d<<11|d>>>21)+c|0,h+=(d^c^l)+g[3]-722521979|0,h=(h<<16|h>>>16)+d|0,l+=(h^d^c)+g[6]+76029189|0,l=(l<<23|l>>>9)+h|0,c+=(l^h^d)+g[9]-640364487|0,c=(c<<4|c>>>28)+l|0,d+=(c^l^h)+g[12]-421815835|0,d=(d<<11|d>>>21)+c|0,h+=(d^c^l)+g[15]+530742520|0,h=(h<<16|h>>>16)+d|0,l+=(h^d^c)+g[2]-995338651|0,l=(l<<23|l>>>9)+h|0,c+=(h^(l|~d))+g[0]-198630844|0,c=(c<<6|c>>>26)+l|0,d+=(l^(c|~h))+g[7]+1126891415|0,d=(d<<10|d>>>22)+c|0,h+=(c^(d|~l))+g[14]-1416354905|0,h=(h<<15|h>>>17)+d|0,l+=(d^(h|~c))+g[5]-57434055|0,l=(l<<21|l>>>11)+h|0,c+=(h^(l|~d))+g[12]+1700485571|0,c=(c<<6|c>>>26)+l|0,d+=(l^(c|~h))+g[3]-1894986606|0,d=(d<<10|d>>>22)+c|0,h+=(c^(d|~l))+g[10]-1051523|0,h=(h<<15|h>>>17)+d|0,l+=(d^(h|~c))+g[1]-2054922799|0,l=(l<<21|l>>>11)+h|0,c+=(h^(l|~d))+g[8]+1873313359|0,c=(c<<6|c>>>26)+l|0,d+=(l^(c|~h))+g[15]-30611744|0,d=(d<<10|d>>>22)+c|0,h+=(c^(d|~l))+g[6]-1560198380|0,h=(h<<15|h>>>17)+d|0,l+=(d^(h|~c))+g[13]+1309151649|0,l=(l<<21|l>>>11)+h|0,c+=(h^(l|~d))+g[4]-145523070|0,c=(c<<6|c>>>26)+l|0,d+=(l^(c|~h))+g[11]-1120210379|0,d=(d<<10|d>>>22)+c|0,h+=(c^(d|~l))+g[2]+718787259|0,h=(h<<15|h>>>17)+d|0,l+=(d^(h|~c))+g[9]-343485551|0,l=(l<<21|l>>>11)+h|0,m[0]=c+m[0]|0,m[1]=l+m[1]|0,m[2]=h+m[2]|0,m[3]=d+m[3]|0}function o(m){var g=[],c;for(c=0;c<64;c+=4)g[c>>2]=m.charCodeAt(c)+(m.charCodeAt(c+1)<<8)+(m.charCodeAt(c+2)<<16)+(m.charCodeAt(c+3)<<24);return g}function a(m){var g=[],c;for(c=0;c<64;c+=4)g[c>>2]=m[c]+(m[c+1]<<8)+(m[c+2]<<16)+(m[c+3]<<24);return g}function s(m){var g=m.length,c=[1732584193,-271733879,-1732584194,271733878],l,h,d,A,P,T;for(l=64;l<=g;l+=64)i(c,o(m.substring(l-64,l)));for(m=m.substring(l-64),h=m.length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<h;l+=1)d[l>>2]|=m.charCodeAt(l)<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(i(c,d),l=0;l<16;l+=1)d[l]=0;return A=g*8,A=A.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(A[2],16),T=parseInt(A[1],16)||0,d[14]=P,d[15]=T,i(c,d),c}function u(m){var g=m.length,c=[1732584193,-271733879,-1732584194,271733878],l,h,d,A,P,T;for(l=64;l<=g;l+=64)i(c,a(m.subarray(l-64,l)));for(m=l-64<g?m.subarray(l-64):new Uint8Array(0),h=m.length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<h;l+=1)d[l>>2]|=m[l]<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(i(c,d),l=0;l<16;l+=1)d[l]=0;return A=g*8,A=A.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(A[2],16),T=parseInt(A[1],16)||0,d[14]=P,d[15]=T,i(c,d),c}function f(m){var g="",c;for(c=0;c<4;c+=1)g+=n[m>>c*8+4&15]+n[m>>c*8&15];return g}function p(m){var g;for(g=0;g<m.length;g+=1)m[g]=f(m[g]);return m.join("")}p(s("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function m(g,c){return g=g|0||0,g<0?Math.max(g+c,0):Math.min(g,c)}ArrayBuffer.prototype.slice=function(g,c){var l=this.byteLength,h=m(g,l),d=l,A,P,T,B;return c!==r&&(d=m(c,l)),h>d?new ArrayBuffer(0):(A=d-h,P=new ArrayBuffer(A),T=new Uint8Array(P),B=new Uint8Array(this,h,A),T.set(B),P)}}();function v(m){return/[\u0080-\uFFFF]/.test(m)&&(m=unescape(encodeURIComponent(m))),m}function b(m,g){var c=m.length,l=new ArrayBuffer(c),h=new Uint8Array(l),d;for(d=0;d<c;d+=1)h[d]=m.charCodeAt(d);return g?h:l}function y(m){return String.fromCharCode.apply(null,new Uint8Array(m))}function w(m,g,c){var l=new Uint8Array(m.byteLength+g.byteLength);return l.set(new Uint8Array(m)),l.set(new Uint8Array(g),m.byteLength),c?l:l.buffer}function x(m){var g=[],c=m.length,l;for(l=0;l<c-1;l+=2)g.push(parseInt(m.substr(l,2),16));return String.fromCharCode.apply(String,g)}function C(){this.reset()}return C.prototype.append=function(m){return this.appendBinary(v(m)),this},C.prototype.appendBinary=function(m){this._buff+=m,this._length+=m.length;var g=this._buff.length,c;for(c=64;c<=g;c+=64)i(this._hash,o(this._buff.substring(c-64,c)));return this._buff=this._buff.substring(c-64),this},C.prototype.end=function(m){var g=this._buff,c=g.length,l,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d;for(l=0;l<c;l+=1)h[l>>2]|=g.charCodeAt(l)<<(l%4<<3);return this._finish(h,c),d=p(this._hash),m&&(d=x(d)),this.reset(),d},C.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},C.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},C.prototype.setState=function(m){return this._buff=m.buff,this._length=m.length,this._hash=m.hash,this},C.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},C.prototype._finish=function(m,g){var c=g,l,h,d;if(m[c>>2]|=128<<(c%4<<3),c>55)for(i(this._hash,m),c=0;c<16;c+=1)m[c]=0;l=this._length*8,l=l.toString(16).match(/(.*?)(.{0,8})$/),h=parseInt(l[2],16),d=parseInt(l[1],16)||0,m[14]=h,m[15]=d,i(this._hash,m)},C.hash=function(m,g){return C.hashBinary(v(m),g)},C.hashBinary=function(m,g){var c=s(m),l=p(c);return g?x(l):l},C.ArrayBuffer=function(){this.reset()},C.ArrayBuffer.prototype.append=function(m){var g=w(this._buff.buffer,m,!0),c=g.length,l;for(this._length+=m.byteLength,l=64;l<=c;l+=64)i(this._hash,a(g.subarray(l-64,l)));return this._buff=l-64<c?new Uint8Array(g.buffer.slice(l-64)):new Uint8Array(0),this},C.ArrayBuffer.prototype.end=function(m){var g=this._buff,c=g.length,l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h,d;for(h=0;h<c;h+=1)l[h>>2]|=g[h]<<(h%4<<3);return this._finish(l,c),d=p(this._hash),m&&(d=x(d)),this.reset(),d},C.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},C.ArrayBuffer.prototype.getState=function(){var m=C.prototype.getState.call(this);return m.buff=y(m.buff),m},C.ArrayBuffer.prototype.setState=function(m){return m.buff=b(m.buff,!0),C.prototype.setState.call(this,m)},C.ArrayBuffer.prototype.destroy=C.prototype.destroy,C.ArrayBuffer.prototype._finish=C.prototype._finish,C.ArrayBuffer.hash=function(m,g){var c=u(new Uint8Array(m)),l=p(c);return g?x(l):l},C})})(hn);const $o=hn.exports;var To=function(){function e(t){this.user=t}return e.prototype.track=function(t,r,n,i){return this.normalize(S(S({},this.baseEvent()),{event:t,type:"track",properties:r,options:S({},n),integrations:S({},i)}))},e.prototype.page=function(t,r,n,i,o){var a,s={type:"page",properties:S({},n),options:S({},i),integrations:S({},o)};return t!==null&&(s.category=t,s.properties=(a=s.properties)!==null&&a!==void 0?a:{},s.properties.category=t),r!==null&&(s.name=r),this.normalize(S(S({},this.baseEvent()),s))},e.prototype.screen=function(t,r,n,i,o){var a={type:"screen",properties:S({},n),options:S({},i),integrations:S({},o)};return t!==null&&(a.category=t),r!==null&&(a.name=r),this.normalize(S(S({},this.baseEvent()),a))},e.prototype.identify=function(t,r,n,i){return this.normalize(S(S({},this.baseEvent()),{type:"identify",userId:t,traits:r,options:S({},n),integrations:S({},i)}))},e.prototype.group=function(t,r,n,i){return this.normalize(S(S({},this.baseEvent()),{type:"group",traits:r,options:S({},n),integrations:S({},i),groupId:t}))},e.prototype.alias=function(t,r,n,i){var o={userId:t,type:"alias",options:S({},n),integrations:S({},i)};return r!==null&&(o.previousId=r),t===void 0?this.normalize(S(S({},o),this.baseEvent())):this.normalize(S(S({},this.baseEvent()),o))},e.prototype.baseEvent=function(){var t={integrations:{},options:{}},r=this.user;return r.id()&&(t.userId=r.id()),r.anonymousId()&&(t.anonymousId=r.anonymousId()),t},e.prototype.context=function(t){var r,n,i,o=["integrations","anonymousId","timestamp","userId"],a=(r=t.options)!==null&&r!==void 0?r:{};delete a.integrations;var s=Object.keys(a),u=(i=(n=t.options)===null||n===void 0?void 0:n.context)!==null&&i!==void 0?i:{},f={};return s.forEach(function(p){p!=="context"&&(o.includes(p)?ft(f,p,a[p]):ft(u,p,a[p]))}),[u,f]},e.prototype.normalize=function(t){var r,n,i=Object.keys((r=t.integrations)!==null&&r!==void 0?r:{}).reduce(function(y,w){var x,C;return S(S({},y),(x={},x[w]=Boolean((C=t.integrations)===null||C===void 0?void 0:C[w]),x))},{}),o=S(S({},i),(n=t.options)===null||n===void 0?void 0:n.integrations),a=this.context(t),s=a[0],u=a[1];t.options;var f=yi(t,["options"]),p=S(S(S({timestamp:new Date},f),{context:s,integrations:o}),u),v="ajs-next-"+$o.hash(JSON.stringify(p)+Yt()),b=S(S({},p),{messageId:v});return b},e}();function Do(e,t){var r={};return e.forEach(function(n){var i,o=void 0;if(typeof t=="string"){var a=n[t];o=typeof a!="string"?JSON.stringify(a):a}else t instanceof Function&&(o=t(n));o!==void 0&&(r[o]=z(z([],(i=r[o])!==null&&i!==void 0?i:[],!0),[n],!1))}),r}function ko(e){var t=Math.random()+1,r=e.minTimeout,n=r===void 0?500:r,i=e.factor,o=i===void 0?2:i,a=e.attempt,s=e.maxTimeout,u=s===void 0?1/0:s;return Math.min(t*n*Math.pow(o,a),u)}var vn="onRemoveFromFuture",pr=function(e){oe(t,e);function t(r,n,i){var o=e.call(this)||this;return o.future=[],o.maxAttempts=r,o.queue=n,o.seen=i!=null?i:{},o}return t.prototype.push=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=n.map(function(a){var s=r.updateAttempts(a);return s>r.maxAttempts||r.includes(a)?!1:(r.queue.push(a),!0)});return this.queue=this.queue.sort(function(a,s){return r.getAttempts(a)-r.getAttempts(s)}),o},t.prototype.pushWithBackoff=function(r){var n=this;if(this.getAttempts(r)===0)return this.push(r)[0];var i=this.updateAttempts(r);if(i>this.maxAttempts||this.includes(r))return!1;var o=ko({attempt:i-1});return setTimeout(function(){n.queue.push(r),n.future=n.future.filter(function(a){return a.id!==r.id}),n.emit(vn)},o),this.future.push(r),!0},t.prototype.getAttempts=function(r){var n;return(n=this.seen[r.id])!==null&&n!==void 0?n:0},t.prototype.updateAttempts=function(r){return this.seen[r.id]=this.getAttempts(r)+1,this.getAttempts(r)},t.prototype.includes=function(r){return this.queue.includes(r)||this.future.includes(r)||Boolean(this.queue.find(function(n){return n.id===r.id}))||Boolean(this.future.find(function(n){return n.id===r.id}))},t.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(t.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),t}(Xt),ne={getItem:function(){},setItem:function(){},removeItem:function(){}};try{ne=Qt()&&window.localStorage?window.localStorage:ne}catch(e){console.warn("Unable to access localStorage",e)}function mn(e){var t=ne.getItem(e);return(t?JSON.parse(t):[]).map(function(r){return new re(r.event,r.id)})}function jo(e,t){var r=mn(e),n=z(z([],t,!0),r,!0),i=n.reduce(function(o,a){var s;return S(S({},o),(s={},s[a.id]=a,s))},{});ne.setItem(e,JSON.stringify(Object.values(i)))}function gn(e){var t=ne.getItem(e);return t?JSON.parse(t):{}}function Ro(e,t){var r=gn(e);ne.setItem(e,JSON.stringify(S(S({},r),t)))}function Dr(e){ne.removeItem(e)}var Fo=function(){return new Date().getTime()};function Vt(e,t,r){r===void 0&&(r=0);var n=50,i="persisted-queue:v1:".concat(e,":lock"),o=function(f){return new Date().getTime()>f},a=ne.getItem(i),s=a?JSON.parse(a):null,u=s===null||o(s);if(u){ne.setItem(i,JSON.stringify(Fo()+n)),t(),ne.removeItem(i);return}!u&&r<3?setTimeout(function(){Vt(e,t,r+1)},n):console.error("Unable to retrieve lock")}var hr=function(e){oe(t,e);function t(r,n){var i=e.call(this,r,[])||this,o="persisted-queue:v1:".concat(n,":items"),a="persisted-queue:v1:".concat(n,":seen"),s=[],u={};return Vt(n,function(){try{s=mn(o),u=gn(a),Dr(o),Dr(a),i.queue=z(z([],s,!0),i.queue,!0),i.seen=S(S({},u),i.seen)}catch(f){console.error(f)}}),document.addEventListener("pagehide",function(){if(i.todo>0){var f=z(z([],i.queue,!0),i.future,!0);try{Vt(n,function(){jo(o,f),Ro(a,i.seen)})}catch(p){console.error(p)}}}),i}return t}(pr),yn=function(e){return typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"},No=function(){var e,t,r=0;return{done:function(){return e},run:function(n){var i=n();return yn(i)&&(++r===1&&(e=new Promise(function(o){return t=o})),i.finally(function(){return--r===0&&t()})),i}}};function zo(e){return E(this,void 0,void 0,function(){var t;return L(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e()];case 1:return[2,r.sent()];case 2:return t=r.sent(),[2,Promise.reject(t)];case 3:return[2]}})})}function Ge(e,t){var r="action"in t?t.action.name:t.name;e.log("debug","plugin",{plugin:r});var n=new Date().getTime(),i=t[e.event.type];if(i===void 0)return Promise.resolve(e);var o=zo(function(){return i.apply(t,[e])}).then(function(a){var s=new Date().getTime()-n;return a.stats.gauge("plugin_time",s,["plugin:".concat(r)]),a}).catch(function(a){if(a instanceof be&&a.type==="middleware_cancellation")throw a;return a instanceof be?(e.log("warn",a.type,{plugin:r,error:a}),a):(e.log("error","plugin Error",{plugin:r,error:a}),e.stats.increment("plugin_error",1,["plugin:".concat(r)]),a)});return o}function Bo(e,t){return Ge(e,t).then(function(r){if(r instanceof re)return r;e.log("debug","Context canceled"),e.stats.increment("context_canceled"),e.cancel(r)})}var bn=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:null},Et,kr,Uo=bn(),Le=(Et=(kr=Uo).__SEGMENT_INSPECTOR__)!==null&&Et!==void 0?Et:kr.__SEGMENT_INSPECTOR__={},Vo=function(e){oe(t,e);function t(r){var n=e.call(this)||this;return n.criticalTasks=No(),n.plugins=[],n.failedInitializations=[],n.flushing=!1,n.queue=r!=null?r:new hr(4,"event-queue"),n.queue.on(vn,function(){n.scheduleFlush(0)}),n}return t.prototype.register=function(r,n,i){return E(this,void 0,void 0,function(){var o=this;return L(this,function(a){switch(a.label){case 0:return[4,Promise.resolve(n.load(r,i)).then(function(){o.plugins.push(n)}).catch(function(s){if(n.type==="destination"){o.failedInitializations.push(n.name),console.warn(n.name,s),r.log("warn","Failed to load destination",{plugin:n.name,error:s});return}throw s})];case 1:return a.sent(),[2]}})})},t.prototype.deregister=function(r,n,i){return E(this,void 0,void 0,function(){var o;return L(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),n.unload?[4,Promise.resolve(n.unload(r,i))]:[3,2];case 1:a.sent(),a.label=2;case 2:return this.plugins=this.plugins.filter(function(s){return s.name!==n.name}),[3,4];case 3:return o=a.sent(),r.log("warn","Failed to unload destination",{plugin:n.name,error:o}),[3,4];case 4:return[2]}})})},t.prototype.dispatch=function(r){return E(this,void 0,void 0,function(){var n;return L(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.push(r),n=this.subscribeToDelivery(r),this.scheduleFlush(0),[2,n]})})},t.prototype.subscribeToDelivery=function(r){return E(this,void 0,void 0,function(){var n=this;return L(this,function(i){return[2,new Promise(function(o){var a=function(s,u){s.isSame(r)&&(n.off("flush",a),o(s))};n.on("flush",a)})]})})},t.prototype.dispatchSingle=function(r){return E(this,void 0,void 0,function(){var n=this;return L(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.updateAttempts(r),r.attempts=1,[2,this.deliver(r).catch(function(o){if(o instanceof be&&o.retry===!1)return r.setFailedDelivery({reason:o}),r;var a=n.enqueuRetry(o,r);return a?n.subscribeToDelivery(r):(r.setFailedDelivery({reason:o}),r)})]})})},t.prototype.isEmpty=function(){return this.queue.length===0},t.prototype.scheduleFlush=function(r){var n=this;r===void 0&&(r=500),!this.flushing&&(this.flushing=!0,setTimeout(function(){n.flush().then(function(){setTimeout(function(){n.flushing=!1,n.queue.length&&n.scheduleFlush(0)},0)})},r))},t.prototype.deliver=function(r){return E(this,void 0,void 0,function(){var n,i,o;return L(this,function(a){switch(a.label){case 0:return[4,this.criticalTasks.done()];case 1:a.sent(),n=Date.now(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.flushOne(r)];case 3:return r=a.sent(),i=Date.now()-n,r.stats.gauge("delivered",i),r.log("debug","Delivered",r.event),[2,r];case 4:throw o=a.sent(),r.log("error","Failed to deliver",o),r.stats.increment("delivery_failed"),o;case 5:return[2]}})})},t.prototype.enqueuRetry=function(r,n){var i=r instanceof be&&r.retry===!1,o=!i;if(o){var a=this.queue.pushWithBackoff(n);return a}return!1},t.prototype.flush=function(){return E(this,void 0,void 0,function(){var r,n,i;return L(this,function(o){switch(o.label){case 0:if(this.queue.length===0||!rn())return[2,[]];if(r=this.queue.pop(),!r)return[2,[]];r.attempts=this.queue.getAttempts(r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.deliver(r)];case 2:return r=o.sent(),this.emit("flush",r,!0),[3,4];case 3:return n=o.sent(),i=this.enqueuRetry(n,r),i||(r.setFailedDelivery({reason:n}),this.emit("flush",r,!1)),[2,[]];case 4:return[2,[r]]}})})},t.prototype.isReady=function(){return!0},t.prototype.availableExtensions=function(r){var n=this.plugins.filter(function(y){var w,x,C;if(y.type!=="destination"&&y.name!=="Segment.io")return!0;var m=void 0;return(w=y.alternativeNames)===null||w===void 0||w.forEach(function(g){r[g]!==void 0&&(m=r[g])}),(C=(x=r[y.name])!==null&&x!==void 0?x:m)!==null&&C!==void 0?C:(y.name==="Segment.io"?!0:r.All)!==!1}),i=Do(n,"type"),o=i.before,a=o===void 0?[]:o,s=i.enrichment,u=s===void 0?[]:s,f=i.destination,p=f===void 0?[]:f,v=i.after,b=v===void 0?[]:v;return{before:a,enrichment:u,destinations:p,after:b}},t.prototype.flushOne=function(r){var n,i,o,a;return E(this,void 0,void 0,function(){var s,u,f,p,v,b,C,y,w,x,C,m,g,c,l;return L(this,function(h){switch(h.label){case 0:if(!this.isReady())throw new Error("Not ready");s=this.availableExtensions((n=r.event.integrations)!==null&&n!==void 0?n:{}),u=s.before,f=s.enrichment,p=0,v=u,h.label=1;case 1:return p<v.length?(b=v[p],[4,Bo(r,b)]):[3,4];case 2:C=h.sent(),C instanceof re&&(r=C),h.label=3;case 3:return p++,[3,1];case 4:y=0,w=f,h.label=5;case 5:return y<w.length?(x=w[y],[4,Ge(r,x)]):[3,8];case 6:C=h.sent(),C instanceof re&&(r=C),h.label=7;case 7:return y++,[3,5];case 8:return(i=Le.enriched)===null||i===void 0||i.call(Le,r),m=this.availableExtensions((o=r.event.integrations)!==null&&o!==void 0?o:{}),g=m.destinations,c=m.after,[4,new Promise(function(d,A){setTimeout(function(){var P=g.map(function(T){return Ge(r,T)});Promise.all(P).then(d).catch(A)},0)})];case 9:return h.sent(),r.stats.increment("message_delivered"),(a=Le.delivered)===null||a===void 0||a.call(Le,r,["segment.io"]),l=c.map(function(d){return Ge(r,d)}),[4,Promise.all(l)];case 10:return h.sent(),[2,r]}})})},t}(Xt);function vr(e){for(var t=e.constructor.prototype,r=0,n=Object.getOwnPropertyNames(t);r<n.length;r++){var i=n[r];if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);!!o&&typeof o.value=="function"&&(e[i]=e[i].bind(e))}}return e}var Me={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},xt=function(){function e(){this.cache={}}return e.prototype.get=function(t){return this.cache[t]},e.prototype.set=function(t,r){return this.cache[t]=r,r},e.prototype.remove=function(t){delete this.cache[t]},e}(),Go=365,jr=function(e){oe(t,e);function t(r){r===void 0&&(r=t.defaults);var n=e.call(this)||this;return n.options=S(S({},t.defaults),r),n}return t.available=function(){var r=window.navigator.cookieEnabled;return r||(G.set("ajs:cookies","test"),r=document.cookie.includes("ajs:cookies"),G.remove("ajs:cookies")),r},Object.defineProperty(t,"defaults",{get:function(){return{maxage:Go,domain:nn(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),t.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},t.prototype.get=function(r){try{var n=G.get(r);if(!n)return null;try{return JSON.parse(n)}catch(i){return n}}catch(i){return null}},t.prototype.set=function(r,n){return typeof n=="string"?G.set(r,n,this.opts()):n===null?G.remove(r,this.opts()):G.set(r,JSON.stringify(n),this.opts()),n},t.prototype.remove=function(r){return G.remove(r,this.opts())},t}(xt),Lt=function(e){oe(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.get=function(n){return null},r.set=function(n,i){return null},r.remove=function(n){},r}return t}(xt),Rr=function(e){oe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.available=function(){var r="test";try{return localStorage.setItem(r,r),localStorage.removeItem(r),!0}catch(n){return!1}},t.prototype.get=function(r){var n=localStorage.getItem(r);if(n)try{return JSON.parse(n)}catch(i){return JSON.parse(JSON.stringify(n))}return null},t.prototype.set=function(r,n){try{localStorage.setItem(r,JSON.stringify(n))}catch(i){console.warn("Unable to set ".concat(r," in localStorage, storage may be full."))}return n},t.prototype.remove=function(r){return localStorage.removeItem(r)},t}(xt),_n=function(){function e(t,r){t===void 0&&(t=Me);var n=this,i,o,a,s;this.options={},this.id=function(v){var b,y;if(n.options.disable)return null;var w=n.chainGet(n.idKey);if(v!==void 0){n.trySet(n.idKey,v);var x=v!==w&&w!==null&&v!==null;x&&n.anonymousId(null)}return(y=(b=n.chainGet(n.idKey))!==null&&b!==void 0?b:n.cookies.get(Me.cookie.oldKey))!==null&&y!==void 0?y:null},this.anonymousId=function(v){var b,y;if(n.options.disable)return null;if(v===void 0){var w=(b=n.chainGet(n.anonKey))!==null&&b!==void 0?b:(y=n.legacySIO())===null||y===void 0?void 0:y[0];if(w)return w}return v===null?(n.trySet(n.anonKey,null),n.chainGet(n.anonKey)):(n.trySet(n.anonKey,v!=null?v:Yt()),n.chainGet(n.anonKey))},this.traits=function(v){var b,y;if(!n.options.disable)return v===null&&(v={}),v&&(n.mem.set(n.traitsKey,v!=null?v:{}),n.localStorage.set(n.traitsKey,v!=null?v:{})),(y=(b=n.localStorage.get(n.traitsKey))!==null&&b!==void 0?b:n.mem.get(n.traitsKey))!==null&&y!==void 0?y:{}},this.options=t,this.cookieOptions=r,this.idKey=(o=(i=t.cookie)===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:Me.cookie.key,this.traitsKey=(s=(a=t.localStorage)===null||a===void 0?void 0:a.key)!==null&&s!==void 0?s:Me.localStorage.key,this.anonKey="ajs_anonymous_id";var u=t.disable===!0,f=t.persist!==!1;this.localStorage=u||t.localStorageFallbackDisabled||!f||!Rr.available()?new Lt:new Rr,this.cookies=!u&&f&&jr.available()?new jr(r):new Lt,this.mem=u?new Lt:new xt;var p=this.cookies.get(Me.cookie.oldKey);p&&(p.id&&this.id(p.id),p.traits&&this.traits(p.traits)),vr(this)}return e.prototype.chainGet=function(t){var r,n,i,o=(i=(n=(r=this.localStorage.get(t))!==null&&r!==void 0?r:this.cookies.get(t))!==null&&n!==void 0?n:this.mem.get(t))!==null&&i!==void 0?i:null;return this.trySet(t,typeof o=="number"?o.toString():o)},e.prototype.trySet=function(t,r){return this.localStorage.set(t,r),this.cookies.set(t,r),this.mem.set(t,r),r},e.prototype.chainClear=function(t){this.localStorage.remove(t),this.cookies.remove(t),this.mem.remove(t)},e.prototype.legacySIO=function(){var t=this.cookies.get("_sio");if(!t)return null;var r=t.split("----"),n=r[0],i=r[1];return[n,i]},e.prototype.identify=function(t,r){if(!this.options.disable){r=r!=null?r:{};var n=this.id();(n===null||n===t)&&(r=S(S({},this.traits()),r)),t&&this.id(t),this.traits(r)}},e.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},e.prototype.reset=function(){this.logout(),this.chainClear(this.idKey),this.chainClear(this.anonKey),this.chainClear(this.traitsKey)},e.prototype.load=function(){return new e(this.options,this.cookieOptions)},e.prototype.save=function(){return!0},e.defaults=Me,e}(),qo={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},Ko=function(e){oe(t,e);function t(r,n){r===void 0&&(r=qo);var i=e.call(this,r,n)||this;return i.anonymousId=function(o){},vr(i),i}return t}(_n),he="This is being deprecated and will be not be available in future releases of Analytics JS",At=bn(),Ot=At==null?void 0:At.analytics;function Zo(e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=e?4:1,n=t?new pr(r,[]):new hr(r,"event-queue");return new Vo(n)}function te(){console.warn(he)}var Ho=function(e){oe(t,e);function t(r,n,i,o,a){var s=this,u,f,p;s=e.call(this)||this,s._debug=!1,s.initialized=!1,s.user=function(){return s._user},s.init=s.initialize.bind(s),s.log=te,s.addIntegrationMiddleware=te,s.listeners=te,s.addEventListener=te,s.removeAllListeners=te,s.removeListener=te,s.removeEventListener=te,s.hasListeners=te,s.add=te,s.addIntegration=te;var v=n==null?void 0:n.cookie,b=(u=n==null?void 0:n.disableClientPersistence)!==null&&u!==void 0?u:!1;return s.settings=r,s.settings.timeout=(f=s.settings.timeout)!==null&&f!==void 0?f:300,s.queue=i!=null?i:Zo(n==null?void 0:n.retryQueue,b),s._user=o!=null?o:new _n(b?S(S({},n==null?void 0:n.user),{persist:!1}):n==null?void 0:n.user,v).load(),s._group=a!=null?a:new Ko(b?S(S({},n==null?void 0:n.group),{persist:!1}):n==null?void 0:n.group,v).load(),s.eventFactory=new To(s._user),s.integrations=(p=n==null?void 0:n.integrations)!==null&&p!==void 0?p:{},s.options=n!=null?n:{},vr(s),s}return t.prototype.track=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o,a,s,u,f,p=this;return L(this,function(v){return i=Ii.apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],f=this.eventFactory.track(o,a,s,this.integrations),[2,this.dispatch(f,u).then(function(b){return p.emit("track",o,b.event.properties,b.event.options),b})]})})},t.prototype.page=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o,a,s,u,f,p,v=this;return L(this,function(b){return i=Er.apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],f=i[4],p=this.eventFactory.page(o,a,s,u,this.integrations),[2,this.dispatch(p,f).then(function(y){return v.emit("page",o,a,y.event.properties,y.event.options),y})]})})},t.prototype.identify=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o,a,s,u,f,p=this;return L(this,function(v){return i=Lr(this._user).apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],this._user.identify(o,a),f=this.eventFactory.identify(this._user.id(),this._user.traits(),s,this.integrations),[2,this.dispatch(f,u).then(function(b){return p.emit("identify",b.event.userId,b.event.traits,b.event.options),b})]})})},t.prototype.group=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(n.length===0)return this._group;var o=Lr(this._group).apply(void 0,n),a=o[0],s=o[1],u=o[2],f=o[3];this._group.identify(a,s);var p=this._group.id(),v=this._group.traits(),b=this.eventFactory.group(p,v,u,this.integrations);return this.dispatch(b,f).then(function(y){return r.emit("group",y.event.groupId,y.event.traits,y.event.options),y})},t.prototype.alias=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o,a,s,u,f,p=this;return L(this,function(v){return i=Mi.apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],f=this.eventFactory.alias(o,a,s,this.integrations),[2,this.dispatch(f,u).then(function(b){return p.emit("alias",o,a,b.event.options),b})]})})},t.prototype.screen=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o,a,s,u,f,p,v=this;return L(this,function(b){return i=Er.apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],f=i[4],p=this.eventFactory.screen(o,a,s,u,this.integrations),[2,this.dispatch(p,f).then(function(y){return v.emit("screen",o,a,y.event.properties,y.event.options),y})]})})},t.prototype.trackClick=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o;return L(this,function(a){switch(a.label){case 0:return[4,W(()=>import("./auto-track.c84cea48.js"),["assets/auto-track.c84cea48.js","assets/index.1fe5d2b2.js","assets/index.08649806.css","assets/index.6f83ab3f.js"])];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,z([this],r,!1))]}})})},t.prototype.trackLink=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o;return L(this,function(a){switch(a.label){case 0:return[4,W(()=>import("./auto-track.c84cea48.js"),["assets/auto-track.c84cea48.js","assets/index.1fe5d2b2.js","assets/index.08649806.css","assets/index.6f83ab3f.js"])];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,z([this],r,!1))]}})})},t.prototype.trackSubmit=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o;return L(this,function(a){switch(a.label){case 0:return[4,W(()=>import("./auto-track.c84cea48.js"),["assets/auto-track.c84cea48.js","assets/index.1fe5d2b2.js","assets/index.08649806.css","assets/index.6f83ab3f.js"])];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,z([this],r,!1))]}})})},t.prototype.trackForm=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o;return L(this,function(a){switch(a.label){case 0:return[4,W(()=>import("./auto-track.c84cea48.js"),["assets/auto-track.c84cea48.js","assets/index.1fe5d2b2.js","assets/index.08649806.css","assets/index.6f83ab3f.js"])];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,z([this],r,!1))]}})})},t.prototype.register=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o,a=this;return L(this,function(s){switch(s.label){case 0:return i=re.system(),o=r.map(function(u){return a.queue.register(i,u,a)}),[4,Promise.all(o)];case 1:return s.sent(),[2,i]}})})},t.prototype.deregister=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return E(this,void 0,void 0,function(){var i,o,a=this;return L(this,function(s){switch(s.label){case 0:return i=re.system(),o=r.map(function(u){return E(a,void 0,void 0,function(){var f;return L(this,function(p){return f=this.queue.plugins.find(function(v){return v.name===u}),f?[2,this.queue.deregister(i,f,this)]:(i.log("warn","plugin ".concat(u," not found")),[2])})})}),[4,Promise.all(o)];case 1:return s.sent(),[2,i]}})})},t.prototype.debug=function(r){return r===!1&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=r,this},t.prototype.reset=function(){this._user.reset(),this._group.reset()},t.prototype.timeout=function(r){this.settings.timeout=r},t.prototype.dispatch=function(r,n){var i;return E(this,void 0,void 0,function(){var o,a,s,u,f;return L(this,function(p){switch(p.label){case 0:return o=new re(r),(i=Le.triggered)===null||i===void 0||i.call(Le,o),ct()&&!this.options.retryQueue?[2,o]:(a=Date.now(),this.queue.isEmpty()?[4,this.queue.dispatchSingle(o)]:[3,2]);case 1:return s=p.sent(),[3,4];case 2:return[4,this.queue.dispatch(o)];case 3:s=p.sent(),p.label=4;case 4:return u=Date.now()-a,f=this.settings.timeout,n?[4,Ai(s,n,Math.max((f!=null?f:300)-u,0),f)]:[3,6];case 5:s=p.sent(),p.label=6;case 6:return this._debug&&s.flush(),[2,s]}})})},t.prototype.addSourceMiddleware=function(r){return E(this,void 0,void 0,function(){var n=this;return L(this,function(i){switch(i.label){case 0:return[4,this.queue.criticalTasks.run(function(){return E(n,void 0,void 0,function(){var o,a,s;return L(this,function(u){switch(u.label){case 0:return[4,W(()=>Promise.resolve().then(()=>oa),void 0)];case 1:return o=u.sent().sourceMiddlewarePlugin,a={},this.queue.plugins.forEach(function(f){if(f.type==="destination")return a[f.name]=!0}),s=o(r,a),[4,this.register(s)];case 2:return u.sent(),[2]}})})})];case 1:return i.sent(),[2,this]}})})},t.prototype.addDestinationMiddleware=function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this.queue.plugins.filter(function(a){return a.name.toLowerCase()===r.toLowerCase()});return o.forEach(function(a){a.addMiddleware.apply(a,n)}),Promise.resolve(this)},t.prototype.setAnonymousId=function(r){return this._user.anonymousId(r)},t.prototype.queryString=function(r){return E(this,void 0,void 0,function(){var n;return L(this,function(i){switch(i.label){case 0:return[4,W(()=>import("./index.4a23ceb0.js"),["assets/index.4a23ceb0.js","assets/index.1fe5d2b2.js","assets/index.08649806.css","assets/index.6f83ab3f.js"])];case 1:return n=i.sent().queryString,[2,n(this,r)]}})})},t.prototype.use=function(r){return r(this),this},t.prototype.ready=function(r){return r===void 0&&(r=function(n){return n}),E(this,void 0,void 0,function(){return L(this,function(n){return[2,Promise.all(this.queue.plugins.map(function(i){return i.ready?i.ready():Promise.resolve()})).then(function(i){return r(i),i})]})})},t.prototype.noConflict=function(){return console.warn(he),window.analytics=Ot!=null?Ot:this,this},t.prototype.normalize=function(r){return console.warn(he),this.eventFactory.normalize(r)},Object.defineProperty(t.prototype,"failedInitializations",{get:function(){return console.warn(he),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VERSION",{get:function(){return Pe},enumerable:!1,configurable:!0}),t.prototype.initialize=function(r,n){return E(this,void 0,void 0,function(){return L(this,function(i){return console.warn(he),[2,Promise.resolve(this)]})})},t.prototype.pageview=function(r){return E(this,void 0,void 0,function(){return L(this,function(n){switch(n.label){case 0:return console.warn(he),[4,this.page({path:r})];case 1:return n.sent(),[2,this]}})})},Object.defineProperty(t.prototype,"plugins",{get:function(){var r;return console.warn(he),(r=this._plugins)!==null&&r!==void 0?r:{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Integrations",{get:function(){console.warn(he);var r=this.queue.plugins.filter(function(n){return n.type==="destination"}).reduce(function(n,i){var o="".concat(i.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),a=window[o];if(!a)return n;var s=a.Integration;return s?(n[i.name]=s,n):(n[i.name]=a,n)},{});return r},enumerable:!1,configurable:!0}),t.prototype.push=function(r){var n=this,i=r.shift();i&&!n[i]||n[i].apply(this,r)},t}(Xt);function wn(){return typeof process>"u"||!process.env?{}:process.env}var Wo=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,Jo=function(){var e,t=Array.prototype.slice.call(document.querySelectorAll("script"));return t.forEach(function(r){var n,i=(n=r.getAttribute("src"))!==null&&n!==void 0?n:"",o=Wo.exec(i);o&&o[1]&&(e=o[1])}),e},st,Qo=function(){var e,t=st!=null?st:(e=window.analytics)===null||e===void 0?void 0:e._cdn;return t},Yo=function(e){window.analytics&&(window.analytics._cdn=e),st=e},mr=function(){var e=Qo();if(e)return e;var t=Jo();return t||"https://cdn.segment.com"},Eu=function(){var e=mr();return"".concat(e,"/next-integrations")};function Xo(e,t){var r,n=Object.entries((r=t.integrations)!==null&&r!==void 0?r:{}).reduce(function(i,o){var a,s,u=o[0],f=o[1];return typeof f=="object"?S(S({},i),(a={},a[u]=f,a)):S(S({},i),(s={},s[u]={},s))},{});return Object.entries(e.integrations).reduce(function(i,o){var a,s=o[0],u=o[1];return S(S({},i),(a={},a[s]=S(S({},u),n[s]),a))},{})}function Cn(){var e=document.getElementsByTagName("link"),t="";return Array.prototype.slice.call(e).forEach(function(r){r.getAttribute("rel")==="canonical"&&(t=r.getAttribute("href"))}),t}function ea(){var e=Cn();if(!e)return window.location.pathname;var t=document.createElement("a");t.href=e;var r=t.pathname.startsWith("/")?t.pathname:"/"+t.pathname;return r}function ta(e){e===void 0&&(e="");var t=Cn();if(t)return t.includes("?")?t:"".concat(t).concat(e);var r=window.location.href,n=r.indexOf("#");return n===-1?r:r.slice(0,n)}function xn(){return{path:ea(),referrer:document.referrer,search:location.search,title:document.title,url:ta(location.search)}}function ze(e){var t,r=e.event;r.context=r.context||{};var n=xn(),i=(t=r.properties)!==null&&t!==void 0?t:{};return Object.keys(n).forEach(function(o){i[o]&&(n[o]=i[o])}),r.context.page&&(n=Object.assign({},n,r.context.page)),r.context=Object.assign({},r.context,{page:n}),e.event=r,e}var ra={name:"Page Enrichment",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:function(e){return e.event.properties=Object.assign({},xn(),e.event.properties),e.event.name&&(e.event.properties.name=e.event.name),ze(e)},alias:ze,track:ze,identify:ze,group:ze};function Sn(e){var t=Array.prototype.slice.call(window.document.querySelectorAll("script"));return t.find(function(r){return r.src===e})}function Pt(e,t){var r=Sn(e);if(r!==void 0){var n=r==null?void 0:r.getAttribute("status");if(n==="loaded")return Promise.resolve(r);if(n==="loading")return new Promise(function(i,o){r.addEventListener("load",function(){return i(r)}),r.addEventListener("error",function(a){return o(a)})})}return new Promise(function(i,o){var a,s=window.document.createElement("script");s.type="text/javascript",s.src=e,s.async=!0,s.setAttribute("status","loading");for(var u=0,f=Object.entries(t!=null?t:{});u<f.length;u++){var p=f[u],v=p[0],b=p[1];s.setAttribute(v,b)}s.onload=function(){s.onerror=s.onload=null,s.setAttribute("status","loaded"),i(s)},s.onerror=function(){s.onerror=s.onload=null,s.setAttribute("status","error"),o(new Error("Failed to load ".concat(e)))};var y=window.document.getElementsByTagName("script")[0];(a=y.parentElement)===null||a===void 0||a.insertBefore(s,y)})}function Lu(e){var t=Sn(e);return t!==void 0&&t.remove(),Promise.resolve()}function gr(e,t){var r=new pe.Facade(e,t);return e.type==="track"&&(r=new pe.Track(e,t)),e.type==="identify"&&(r=new pe.Identify(e,t)),e.type==="page"&&(r=new pe.Page(e,t)),e.type==="alias"&&(r=new pe.Alias(e,t)),e.type==="group"&&(r=new pe.Group(e,t)),e.type==="screen"&&(r=new pe.Screen(e,t)),Object.defineProperty(r,"obj",{value:e,writable:!0}),r}var na=function(e){return JSON.parse(JSON.stringify(e))};function In(e,t,r){return E(this,void 0,void 0,function(){function n(f,p){return E(this,void 0,void 0,function(){var v,b,y;return L(this,function(w){switch(w.label){case 0:return v=!1,b=null,[4,vt(p({payload:gr(f,{clone:!0,traverse:!1}),integration:e,next:function(x){v=!0,x===null&&(b=null),x&&(b=x.obj)}}))];case 1:return w.sent(),!v&&b!==null&&(b=b,b.integrations=S(S({},f.integrations),(y={},y[e]=!1,y))),[2,b]}})})}var i,o,a,s,u;return L(this,function(f){switch(f.label){case 0:i=na(t),o=0,a=r,f.label=1;case 1:return o<a.length?(s=a[o],[4,n(i,s)]):[3,4];case 2:if(u=f.sent(),u===null)return[2,null];i=u,f.label=3;case 3:return o++,[3,1];case 4:return[2,i]}})})}function ia(e,t){function r(n){return E(this,void 0,void 0,function(){var i;return L(this,function(o){switch(o.label){case 0:return i=!1,[4,vt(e({payload:gr(n.event,{clone:!0,traverse:!1}),integrations:t!=null?t:{},next:function(a){i=!0,a&&(n.event=a.obj)}}))];case 1:if(o.sent(),!i)throw new be({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(e.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(n){return Promise.resolve(n)},track:r,page:r,identify:r,alias:r,group:r}}const oa=Object.freeze(Object.defineProperty({__proto__:null,applyDestinationMiddleware:In,sourceMiddlewarePlugin:ia},Symbol.toStringTag,{value:"Module"}));var aa=function(){function e(t,r){this.version="1.0.0",this.alternativeNames=[],this.middleware=[],this.alias=this._createMethod("alias"),this.group=this._createMethod("group"),this.identify=this._createMethod("identify"),this.page=this._createMethod("page"),this.screen=this._createMethod("screen"),this.track=this._createMethod("track"),this.action=r,this.name=t,this.type=r.type,this.alternativeNames.push(r.name)}return e.prototype.addMiddleware=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];(t=this.middleware).push.apply(t,r)},e.prototype.transform=function(t){return E(this,void 0,void 0,function(){var r;return L(this,function(n){switch(n.label){case 0:return[4,In(this.name,t.event,this.middleware)];case 1:return r=n.sent(),r===null&&t.cancel(new be({retry:!1,reason:"dropped by destination middleware"})),[2,new re(r)]}})})},e.prototype._createMethod=function(t){var r=this;return function(n){return E(r,void 0,void 0,function(){var i;return L(this,function(o){switch(o.label){case 0:return this.action[t]?[4,this.transform(n)]:[2,n];case 1:return i=o.sent(),[4,this.action[t](i)];case 2:return o.sent(),[2,n]}})})}},e.prototype.isLoaded=function(){return this.action.isLoaded()},e.prototype.ready=function(){return this.action.ready?this.action.ready():Promise.resolve()},e.prototype.load=function(t,r){return this.action.load(t,r)},e.prototype.unload=function(t,r){var n,i;return(i=(n=this.action).unload)===null||i===void 0?void 0:i.call(n,t,r)},e}();function sa(e){if(!Array.isArray(e))throw new Error("Not a valid list of plugins");var t=["load","isLoaded","name","version","type"];return e.forEach(function(r){t.forEach(function(n){var i;if(r[n]===void 0)throw new Error("Plugin: ".concat((i=r.name)!==null&&i!==void 0?i:"unknown"," missing required function ").concat(n))})}),!0}function ua(e,t,r,n,i){var o,a,s;return E(this,void 0,void 0,function(){var u,f,p,v,b=this;return L(this,function(y){switch(y.label){case 0:return u=[],f=mr(),p=(a=(o=e.middlewareSettings)===null||o===void 0?void 0:o.routingRules)!==null&&a!==void 0?a:[],v=((s=e.remotePlugins)!==null&&s!==void 0?s:[]).map(function(w){return E(b,void 0,void 0,function(){var x,C,m,g,c,l,h,d,A;return L(this,function(P){switch(P.label){case 0:if(t.All===!1&&!t[w.name]||t[w.name]===!1)return[2];P.label=1;case 1:if(P.trys.push([1,12,,13]),!n)return[3,7];x=w.url.split("/"),C=x[x.length-2],m=w.url.replace(C,btoa(C).replace(/=/g,"")),P.label=2;case 2:return P.trys.push([2,4,,6]),[4,Pt(m.replace("https://cdn.segment.com",f))];case 3:return P.sent(),[3,6];case 4:return P.sent(),[4,Pt(w.url.replace("https://cdn.segment.com",f))];case 5:return P.sent(),[3,6];case 6:return[3,9];case 7:return[4,Pt(w.url.replace("https://cdn.segment.com",f))];case 8:P.sent(),P.label=9;case 9:return g=w.libraryName,typeof window[g]!="function"?[3,11]:(c=window[g],[4,vt(c(S(S({},w.settings),r[w.name])))]);case 10:l=P.sent(),h=Array.isArray(l)?l:[l],sa(h),d=p.filter(function(T){return T.destinationName===w.creationName}),h.forEach(function(T){var B=new aa(w.creationName,T);d.length&&i&&T.type==="destination"&&B.addMiddleware(i),u.push(B)}),P.label=11;case 11:return[3,13];case 12:return A=P.sent(),console.warn("Failed to load Remote Plugin",A),[3,13];case 13:return[2]}})})}),[4,Promise.all(v)];case 1:return y.sent(),[2,u.filter(Boolean)]}})})}var la=function(e){var t=!1;document.addEventListener("pagehide",function(){t||(t=!0,e())}),document.addEventListener("visibilitychange",function(){if(document.visibilityState=="hidden"){if(t)return;t=!0,e()}else t=!1})},Mn=Te;typeof window<"u"&&(Mn=window.fetch||Te);var ca=500;function En(e){var t=encodeURI(JSON.stringify(e)).split(/%..|./).length-1;return t/1024}function fa(e){return En(e)>=ca-50}function da(e){var t=[],r=0;return e.forEach(function(n){var i=En(t[r]);i>=64&&r++,t[r]?t[r].push(n):t[r]=[n]}),t}function pa(e,t){var r,n,i=[],o=!1,a=(r=t==null?void 0:t.size)!==null&&r!==void 0?r:10,s=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:5e3;function u(y){var w;if(y.length!==0){var x=(w=y[0])===null||w===void 0?void 0:w.writeKey;return Mn("https://".concat(e,"/b"),{keepalive:o,headers:{"Content-Type":"text/plain"},method:"post",body:JSON.stringify({batch:y,writeKey:x})})}}function f(){return E(this,void 0,void 0,function(){var y;return L(this,function(w){return i.length?(y=i,i=[],[2,u(y)]):[2]})})}var p;function v(){p||(p=setTimeout(function(){p=void 0,f().catch(console.error)},s))}la(function(){if(o=!0,i.length){var y=da(i).map(u);Promise.all(y).catch(console.error)}});function b(y,w){return E(this,void 0,void 0,function(){var x;return L(this,function(C){return i.push(w),x=i.length>=a||fa(i),[2,x||o?f():v()]})})}return{dispatch:b}}var Ln=Te;typeof window<"u"&&(Ln=window.fetch||Te);function ha(){function e(t,r){return Ln(t,{headers:{"Content-Type":"text/plain"},method:"post",body:JSON.stringify(r)})}return{dispatch:e}}var va=function(e,t){return E(void 0,void 0,void 0,function(){var r;return L(this,function(n){return r=function(i){return E(void 0,void 0,void 0,function(){var o;return L(this,function(a){switch(a.label){case 0:return e(i)?(o=r,[4,t()]):[3,2];case 1:return[2,o.apply(void 0,[a.sent()])];case 2:return[2]}})})},[2,r(void 0)]})})};function ma(e,t){return E(this,void 0,void 0,function(){var r,n=this;return L(this,function(i){switch(i.label){case 0:return r=[],ct()?[2,t]:[4,va(function(){return t.length>0&&!ct()},function(){return E(n,void 0,void 0,function(){var o,a,s;return L(this,function(u){switch(u.label){case 0:return o=t.pop(),o?[4,Ge(o,e)]:[2];case 1:return a=u.sent(),s=a instanceof re,s||r.push(o),[2]}})})})];case 1:return i.sent(),r.map(function(o){return t.pushWithBackoff(o)}),[2,t]}})})}function nt(e,t,r,n){var i=this;e||setTimeout(function(){return E(i,void 0,void 0,function(){var o,a;return L(this,function(s){switch(s.label){case 0:return o=!0,[4,ma(r,t)];case 1:return a=s.sent(),o=!1,t.todo>0&&n(o,a,r,n),[2]}})})},Math.random()*5e3)}function ga(e,t){var r,n,i,o,a=e.user();return t.previousId=(i=(n=(r=t.previousId)!==null&&r!==void 0?r:t.from)!==null&&n!==void 0?n:a.id())!==null&&i!==void 0?i:a.anonymousId(),t.userId=(o=t.userId)!==null&&o!==void 0?o:t.to,delete t.from,delete t.to,t}function ya(e,t,r){var n,i,o,a,s=e.options.disableClientPersistence?new pr(e.queue.queue.maxAttempts,[]):new hr(e.queue.queue.maxAttempts,"dest-Segment.io"),u=!1,f=(n=t==null?void 0:t.apiHost)!==null&&n!==void 0?n:"api.segment.io/v1",p=(i=t==null?void 0:t.protocol)!==null&&i!==void 0?i:"https",v="".concat(p,"://").concat(f),b=((o=t==null?void 0:t.deliveryStrategy)===null||o===void 0?void 0:o.strategy)==="batching"?pa(f,(a=t==null?void 0:t.deliveryStrategy)===null||a===void 0?void 0:a.config):ha();function y(x){return E(this,void 0,void 0,function(){var C,m;return L(this,function(g){return ct()?(s.push(x),nt(u,s,w,nt),[2,x]):(C=x.event.type.charAt(0),m=gr(x.event).json(),x.event.type==="track"&&delete m.traits,x.event.type==="alias"&&(m=ga(e,m)),[2,b.dispatch("".concat(v,"/").concat(C),qi(e,m,t,r)).then(function(){return x}).catch(function(c){return(c.type==="error"||c.message==="Failed to fetch")&&(s.push(x),nt(u,s,w,nt)),x})])})})}var w={name:"Segment.io",type:"after",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:y,identify:y,page:y,alias:y,group:y};return w}var An=function(e,t,r){r.getCalls(e).forEach(function(n){yr(t,n).catch(console.error)})},ba=function(e,t){return E(void 0,void 0,void 0,function(){var r,n,i;return L(this,function(o){switch(o.label){case 0:r=0,n=t.getCalls("addSourceMiddleware"),o.label=1;case 1:return r<n.length?(i=n[r],[4,yr(e,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},_a=An.bind(globalThis,"on"),wa=An.bind(globalThis,"setAnonymousId"),Ca=function(e,t){t.toArray().forEach(function(r){setTimeout(function(){yr(e,r).catch(console.error)},0)})},xa=function(){function e(){this._value={}}return e.prototype.toArray=function(){var t;return(t=[]).concat.apply(t,Object.values(this._value))},e.prototype.getCalls=function(t){var r;return(r=this._value[t])!==null&&r!==void 0?r:[]},e.prototype.push=function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.forEach(function(i){t._value[i.method]?t._value[i.method].push(i):t._value[i.method]=[i]}),this},e.prototype.clear=function(){return this._value={},this},e}();function yr(e,t){return E(this,void 0,void 0,function(){var r,n;return L(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t.called?[2,void 0]:(t.called=!0,r=e[t.method].apply(e,t.args),yn(r)?[4,r]:[3,2]);case 1:i.sent(),i.label=2;case 2:return t.resolve(r),[3,4];case 3:return n=i.sent(),t.reject(n),[3,4];case 4:return[2]}})})}var Sa=function(){function e(t){var r=this;this._preInitBuffer=new xa,this.trackSubmit=this._createMethod("trackSubmit"),this.trackClick=this._createMethod("trackClick"),this.trackLink=this._createMethod("trackLink"),this.pageView=this._createMethod("pageview"),this.identify=this._createMethod("identify"),this.reset=this._createMethod("reset"),this.group=this._createMethod("group"),this.track=this._createMethod("track"),this.ready=this._createMethod("ready"),this.alias=this._createMethod("alias"),this.debug=this._createChainableMethod("debug"),this.page=this._createMethod("page"),this.once=this._createChainableMethod("once"),this.off=this._createChainableMethod("off"),this.on=this._createChainableMethod("on"),this.addSourceMiddleware=this._createMethod("addSourceMiddleware"),this.setAnonymousId=this._createMethod("setAnonymousId"),this.addDestinationMiddleware=this._createMethod("addDestinationMiddleware"),this.screen=this._createMethod("screen"),this.register=this._createMethod("register"),this.deregister=this._createMethod("deregister"),this.user=this._createMethod("user"),this.VERSION=Pe,this._promise=t(this._preInitBuffer),this._promise.then(function(n){var i=n[0],o=n[1];r.instance=i,r.ctx=o}).catch(function(){})}return e.prototype.then=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).then.apply(t,r)},e.prototype.catch=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).catch.apply(t,r)},e.prototype.finally=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).finally.apply(t,r)},e.prototype._createMethod=function(t){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(r.instance){var a=(n=r.instance)[t].apply(n,i);return Promise.resolve(a)}return new Promise(function(s,u){r._preInitBuffer.push({method:t,args:i,resolve:s,reject:u,called:!1})})}},e.prototype._createChainableMethod=function(t){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return r.instance?((n=r.instance)[t].apply(n,i),r):(r._preInitBuffer.push({method:t,args:i,resolve:function(){},reject:console.error,called:!1}),r)}},e}();function Ia(e){var t=e[0],r=e.slice(1);return{method:t,resolve:function(){},reject:console.error,args:r,called:!1}}var Ma=function(e){return e.map(Ia)},Gt=function(){var e=window.analytics;if(!Array.isArray(e))return[];var t=e.splice(0,e.length);return Ma(t)};function Ea(e,t){var r=t!=null?t:mr();return Te("".concat(r,"/v1/projects/").concat(e,"/settings")).then(function(n){return n.ok?n.json():n.text().then(function(i){throw new Error(i)})}).catch(function(n){throw console.error(n.message),n})}function La(e){return wn().NODE_ENV!=="test"&&Object.keys(e.integrations).length>1}function Aa(e){var t,r,n;return wn().NODE_ENV!=="test"&&((n=(r=(t=e.middlewareSettings)===null||t===void 0?void 0:t.routingRules)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0)>0}function Oa(e,t){t.push.apply(t,Gt()),wa(e,t),_a(e,t)}function Pa(e,t){return E(this,void 0,void 0,function(){return L(this,function(r){switch(r.label){case 0:return t.push.apply(t,Gt()),[4,ba(e,t)];case 1:return r.sent(),t.push.apply(t,Gt()),Ca(e,t),t.clear(),[2]}})})}function $a(e,t,r,n,i){var o,a,s;return E(this,void 0,void 0,function(){var u,f,p,v,b,y,w,x,C,m,g,c=this;return L(this,function(l){switch(l.label){case 0:return Aa(e)?[4,W(()=>import("./index.43c8d0af.js"),["assets/index.43c8d0af.js","assets/index.6f83ab3f.js","assets/index.1fe5d2b2.js","assets/index.08649806.css"]).then(function(h){return h.tsubMiddleware(e.middlewareSettings.routingRules)})]:[3,2];case 1:return f=l.sent(),[3,3];case 2:f=void 0,l.label=3;case 3:return u=f,La(e)?[4,W(()=>import("./index.9f38abbd.js"),["assets/index.9f38abbd.js","assets/index.6f83ab3f.js","assets/is-plan-event-enabled.681b46ca.js","assets/index.1fe5d2b2.js","assets/index.08649806.css"]).then(function(h){return h.ajsDestinations(e,t.integrations,r,u)})]:[3,5];case 4:return v=l.sent(),[3,6];case 5:v=[],l.label=6;case 6:return p=v,e.legacyVideoPluginsEnabled?[4,W(()=>import("./index.0abff0c4.js"),["assets/index.0abff0c4.js","assets/index.6f83ab3f.js"]).then(function(h){return h.loadLegacyVideoPlugins(t)})]:[3,8];case 7:l.sent(),l.label=8;case 8:return!((o=r.plan)===null||o===void 0)&&o.track?[4,W(()=>import("./index.cd4b7a35.js"),["assets/index.cd4b7a35.js","assets/index.6f83ab3f.js","assets/is-plan-event-enabled.681b46ca.js"]).then(function(h){var d;return h.schemaFilter((d=r.plan)===null||d===void 0?void 0:d.track,e)})]:[3,10];case 9:return y=l.sent(),[3,11];case 10:y=void 0,l.label=11;case 11:return b=y,w=Xo(e,n),[4,ua(e,t.integrations,w,n.obfuscate,u).catch(function(){return[]})];case 12:return x=l.sent(),C=z(z(z([Si,ra],i,!0),p,!0),x,!0),b&&C.push(b),m=((a=r.integrations)===null||a===void 0?void 0:a.All)===!1&&!r.integrations["Segment.io"]||r.integrations&&r.integrations["Segment.io"]===!1,m||C.push(ya(t,w["Segment.io"],e.integrations)),[4,t.register.apply(t,C)];case 13:return g=l.sent(),Object.entries((s=e.enabledMiddleware)!==null&&s!==void 0?s:{}).some(function(h){var d=h[1];return d})?[4,W(()=>import("./index.d8ae1763.js"),["assets/index.d8ae1763.js","assets/index.6f83ab3f.js","assets/index.1fe5d2b2.js","assets/index.08649806.css"]).then(function(h){var d=h.remoteMiddlewares;return E(c,void 0,void 0,function(){var A,P;return L(this,function(T){switch(T.label){case 0:return[4,d(g,e,n.obfuscate)];case 1:return A=T.sent(),P=A.map(function(B){return t.addSourceMiddleware(B)}),[2,Promise.all(P)]}})})})]:[3,15];case 14:l.sent(),l.label=15;case 15:return[2,g]}})})}function Ta(e,t,r){var n,i,o,a,s,u;return t===void 0&&(t={}),E(this,void 0,void 0,function(){var f,p,v,b,y,w,x,C,m,g;return L(this,function(c){switch(c.label){case 0:return e.cdnURL&&Yo(e.cdnURL),(n=e.cdnSettings)!==null&&n!==void 0?(p=n,[3,3]):[3,1];case 1:return[4,Ea(e.writeKey,e.cdnURL)];case 2:p=c.sent(),c.label=3;case 3:return f=p,v=(o=(i=f.integrations["Segment.io"])===null||i===void 0?void 0:i.retryQueue)!==null&&o!==void 0?o:!0,b=S({retryQueue:v},t),y=new Ho(e,b),w=(a=e.plugins)!==null&&a!==void 0?a:[],re.initMetrics(f.metrics),Oa(y,r),[4,$a(f,y,b,t,w)];case 4:return x=c.sent(),C=(s=window.location.search)!==null&&s!==void 0?s:"",m=(u=window.location.hash)!==null&&u!==void 0?u:"",g=C.length?C:m.replace(/(?=#).*(?=\?)/,""),g.includes("ajs_")?[4,y.queryString(g).catch(console.error)]:[3,6];case 5:c.sent(),c.label=6;case 6:return y.initialized=!0,y.emit("initialize",e,t),t.initialPageview&&y.page().catch(console.error),[4,Pa(y,r)];case 7:return c.sent(),[2,[y,x]]}})})}var Da=function(e){oe(t,e);function t(r){return e.call(this,r)||this}return t.load=function(r,n){return n===void 0&&(n={}),new this(function(i){return Ta(r,n,i)})},t.standalone=function(r,n){return t.load({writeKey:r},n).then(function(i){return i[0]})},t}(Sa);class ka{constructor(){Sr(this,"analytics");this.analytics=Da.load({writeKey:"c0SISxJpICLXxstkrSppa4uxwYzBQbqf"})}trackPageLoad(){this.analytics.page()}trackEvent(t,r){this.analytics.track(t,{event_data:r,environment:"production"})}}const ie=new ka;var Q=(e=>(e.LC_VIEWED="LC-Viewed",e.LC_CATEGORY_CLICK="LC-Category-Clicked",e.LC_CATEGORY_VIEW="LC-Category-Viewed",e.LC_SCORE_CLICK="LC-Score-Clicked",e.LC_SCORE_VIEW="LC-Score-Viewed",e.LC_SCORE_CLOSE="LC-Score-Close",e.LC_TRANSPORT_MODE_CLICK="LC-Transportation-Method-Clicked",e.LC_LONG_DESCRIPTION_CLICK="LC-Long-Description-Clicked",e.LC_LONG_DESCRIPTION_VIEW="LC-Long-Description-Viewed",e.LC_POI_CLICK="LC-POI-Clicked",e.LC_POI_VIEW="LC-POI-Viewed",e.LC_SCORES_LIST_SCROLL="LC-Scores-List-Scroll",e.LC_COMMUTE_CALC_CLICK="LC-Commute-Calc-Clicked",e.LC_COMMUTE_CALC_VIEW="LC-Commute-Calc-Viewed",e.LC_COMMUTE_CALCULATE_ROUTE="LC-Commute-Calc-Calculate-Route",e.LC_ATTRIBUTION_CLICK="LC-Attribution-Clicked",e))(Q||{});const On=ae.createContext({}),K=()=>M.exports.useContext(On),ja=(e,t)=>{switch(t.type){case"CATEGORY":return{...e,activeCategory:t.value};case"SCORE":{const r=Ke.find(n=>t.value===""?n.value===e.activeCategory:n.scores.includes(t.value)).value;return{activeCategory:r,activeScoreByCategory:{...e.activeScoreByCategory,[r]:t.value}}}}},Ra=({children:e})=>{const t=window.innerWidth<Qr.screenSizes.tablet?{activeCategory:"commute",activeScoreByCategory:{commute:"transit_friendly",amenities:"groceries",character:"quiet",nature:"parks",education:"primary_schools"}}:{activeCategory:"commute",activeScoreByCategory:{commute:"",amenities:"",character:"",nature:"",education:""}},[r,n]=M.exports.useReducer(ja,t),[i,o]=M.exports.useState(),[a,s]=M.exports.useState(),[u,f]=M.exports.useState(),[p,v]=M.exports.useState();M.exports.useEffect(()=>{i&&ie.trackEvent(Q.LC_POI_VIEW,{poi_name:i==null?void 0:i.name,poi_info:i==null?void 0:i.address})},[i]);const{activeCategory:b}=r;M.exports.useEffect(()=>{ie.trackEvent(Q.LC_CATEGORY_VIEW,b)},[b]);const y=r.activeScoreByCategory[b];M.exports.useEffect(()=>{y!==""&&ie.trackEvent(Q.LC_SCORE_VIEW,y)},[y]);const w=m=>{n({type:"SCORE",value:m})},x=m=>{n({type:"CATEGORY",value:m})},C=M.exports.useMemo(()=>({activeScore:y,setActiveScore:w,activeCategory:b,setActiveCategory:x,activePOI:i,setActivePOI:o,hoveredPOI:a,setHoveredPOI:s,commuteGeojson:u,setCommuteGeojson:f,destination:p,setDestination:v}),[y,w,b,x,i,o,a,s,u,f,p,v]);return _(On.Provider,{value:C,children:e})};function dt(e,t){if(!e)throw new Error(t)}let Fa=0;function Na(e,t,r){if(e.style&&e.style._loaded){const n={...r};return delete n.id,delete n.children,e.addSource(t,n),e.getSource(t)}return null}function za(e,t,r){dt(t.id===r.id,"source id changed"),dt(t.type===r.type,"source type changed");let n="",i=0;for(const a in t)a!=="children"&&a!=="id"&&!it(r[a],t[a])&&(n=a,i++);if(!i)return;const o=t.type;if(o==="geojson")e.setData(t.data);else if(o==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else if((o==="canvas"||o==="video")&&i===1&&n==="coordinates")e.setCoordinates(t.coordinates);else if(o==="vector"&&"setUrl"in e)switch(n){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles);break}else console.warn(`Unable to update <Source> prop: ${n}`)}function Ba(e){const t=M.exports.useContext(Jr).map.getMap(),r=M.exports.useRef(e),[,n]=M.exports.useState(0),i=M.exports.useMemo(()=>e.id||`jsx-source-${Fa++}`,[]);M.exports.useEffect(()=>{if(t){const a=()=>n(s=>s+1);return t.on("styledata",a),a(),()=>{var s;if(t.off("styledata",a),t.style&&t.style._loaded&&t.getSource(i)){const u=(s=t.getStyle())===null||s===void 0?void 0:s.layers;if(u)for(const f of u)f.source===i&&t.removeLayer(f.id);t.removeSource(i)}}}},[t]);let o=t&&t.style&&t.getSource(i);return o?za(o,e,r.current):o=Na(t,i,e),r.current=e,o&&M.exports.Children.map(e.children,a=>a&&M.exports.cloneElement(a,{source:i}))||null}function Ua(e,t,r,n){if(dt(r.id===n.id,"layer id changed"),dt(r.type===n.type,"layer type changed"),r.type==="custom"||n.type==="custom")return;const{layout:i={},paint:o={},filter:a,minzoom:s,maxzoom:u,beforeId:f}=r;if(f!==n.beforeId&&e.moveLayer(t,f),i!==n.layout){const p=n.layout||{};for(const v in i)it(i[v],p[v])||e.setLayoutProperty(t,v,i[v]);for(const v in p)i.hasOwnProperty(v)||e.setLayoutProperty(t,v,void 0)}if(o!==n.paint){const p=n.paint||{};for(const v in o)it(o[v],p[v])||e.setPaintProperty(t,v,o[v]);for(const v in p)o.hasOwnProperty(v)||e.setPaintProperty(t,v,void 0)}it(a,n.filter)||e.setFilter(t,a),(s!==n.minzoom||u!==n.maxzoom)&&e.setLayerZoomRange(t,s,u)}function Va(e,t,r){if(e.style&&e.style._loaded&&(!("source"in r)||e.getSource(r.source))){const n={...r,id:t};delete n.beforeId,e.addLayer(n,r.beforeId)}}let Ga=0;function qa(e){const t=M.exports.useContext(Jr).map.getMap(),r=M.exports.useRef(e),[,n]=M.exports.useState(0),i=M.exports.useMemo(()=>e.id||`jsx-layer-${Ga++}`,[]);if(M.exports.useEffect(()=>{if(t){const a=()=>n(s=>s+1);return t.on("styledata",a),a(),()=>{t.off("styledata",a),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]),t&&t.style&&t.getLayer(i))try{Ua(t,i,e,r.current)}catch(a){console.warn(a)}else Va(t,i,e);return r.current=e,null}function Pn(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function $t(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Fr(e[0])||!Fr(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return Pn(n,t,r)}function Ka(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return Pn(n,t,r)}function Fr(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function $n(e,t,r){if(e!==null)for(var n,i,o,a,s,u,f,p=0,v=0,b,y=e.type,w=y==="FeatureCollection",x=y==="Feature",C=w?e.features.length:1,m=0;m<C;m++){f=w?e.features[m].geometry:x?e.geometry:e,b=f?f.type==="GeometryCollection":!1,s=b?f.geometries.length:1;for(var g=0;g<s;g++){var c=0,l=0;if(a=b?f.geometries[g]:f,a!==null){u=a.coordinates;var h=a.type;switch(p=r&&(h==="Polygon"||h==="MultiPolygon")?1:0,h){case null:break;case"Point":if(t(u,v,m,c,l)===!1)return!1;v++,c++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],v,m,c,l)===!1)return!1;v++,h==="MultiPoint"&&c++}h==="LineString"&&c++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-p;i++){if(t(u[n][i],v,m,c,l)===!1)return!1;v++}h==="MultiLineString"&&c++,h==="Polygon"&&l++}h==="Polygon"&&c++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(l=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-p;o++){if(t(u[n][i][o],v,m,c,l)===!1)return!1;v++}l++}c++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if($n(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function qt(e){var t=[1/0,1/0,-1/0,-1/0];return $n(e,function(r){t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]<r[0]&&(t[2]=r[0]),t[3]<r[1]&&(t[3]=r[1])}),t}qt.default=qt;var Za="Expected a function",Nr=0/0,Ha="[object Symbol]",Wa=/^\s+|\s+$/g,Ja=/^[-+]0x[0-9a-f]+$/i,Qa=/^0b[01]+$/i,Ya=/^0o[0-7]+$/i,Xa=parseInt,es=typeof D=="object"&&D&&D.Object===Object&&D,ts=typeof self=="object"&&self&&self.Object===Object&&self,rs=es||ts||Function("return this")(),ns=Object.prototype,is=ns.toString,os=Math.max,as=Math.min,Tt=function(){return rs.Date.now()};function ss(e,t,r){var n,i,o,a,s,u,f=0,p=!1,v=!1,b=!0;if(typeof e!="function")throw new TypeError(Za);t=zr(t)||0,Kt(r)&&(p=!!r.leading,v="maxWait"in r,o=v?os(zr(r.maxWait)||0,t):o,b="trailing"in r?!!r.trailing:b);function y(d){var A=n,P=i;return n=i=void 0,f=d,a=e.apply(P,A),a}function w(d){return f=d,s=setTimeout(m,t),p?y(d):a}function x(d){var A=d-u,P=d-f,T=t-A;return v?as(T,o-P):T}function C(d){var A=d-u,P=d-f;return u===void 0||A>=t||A<0||v&&P>=o}function m(){var d=Tt();if(C(d))return g(d);s=setTimeout(m,x(d))}function g(d){return s=void 0,b&&n?y(d):(n=i=void 0,a)}function c(){s!==void 0&&clearTimeout(s),f=0,n=u=i=s=void 0}function l(){return s===void 0?a:g(Tt())}function h(){var d=Tt(),A=C(d);if(n=arguments,i=this,u=d,A){if(s===void 0)return w(u);if(v)return s=setTimeout(m,t),y(u)}return s===void 0&&(s=setTimeout(m,t)),a}return h.cancel=c,h.flush=l,h}function Kt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function us(e){return!!e&&typeof e=="object"}function ls(e){return typeof e=="symbol"||us(e)&&is.call(e)==Ha}function zr(e){if(typeof e=="number")return e;if(ls(e))return Nr;if(Kt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Kt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Wa,"");var r=Qa.test(e);return r||Ya.test(e)?Xa(e.slice(2),r?2:8):Ja.test(e)?Nr:+e}var cs=ss;const br=()=>{const[e,t]=M.exports.useState(!1);return M.exports.useLayoutEffect(()=>{const r=()=>{t(window.innerWidth<Qr.screenSizes.tablet)};return window.addEventListener("resize",cs(r,250)),r(),()=>window.removeEventListener("resize",r)},[]),e};function Tn(){var s;const{client:e}=Ht(),{sdkState:t}=we(),r=Wt(t.options,250),{activeScore:n}=K(),i=n?Ve[n]:void 0,a={...M.exports.useMemo(()=>r!=null&&r.marker?r.marker:{lat:r==null?void 0:r.lat,lng:r==null?void 0:r.lng},[r]),limit:10,radius:2e3,include:i};return ht(ti.list(a),async()=>e.getPois(a),{enabled:!!a&&!!((s=a.include)!=null&&s.length)&&!!a.lat&&!!a.lng})}function Dn(){const{client:e}=Ht(),{sdkState:t}=we(),r=Wt(t.options,250),{activeScore:n}=K(),i=n==="high_schools"||n==="primary_schools",a={...M.exports.useMemo(()=>r!=null&&r.marker?r.marker:{lat:r==null?void 0:r.lat,lng:r==null?void 0:r.lng},[r]),limit:10,radius:2e3};return ht(ri.list(a),async()=>e.getSchools(a),{enabled:!!a&&!!a.lat&&!!a.lng&&i})}const kn=ae.createContext({}),jn=()=>M.exports.useContext(kn),fs=({children:e,mapRef:t,mapPadding:r})=>_(kn.Provider,{value:{mapRef:t,mapPadding:r},children:e});function Zt(e,t,r,n,i,o){if(i-n<=r)return;const a=n+i>>1;Rn(e,t,a,n,i,o%2),Zt(e,t,r,n,a-1,o+1),Zt(e,t,r,a+1,i,o+1)}function Rn(e,t,r,n,i,o){for(;i>n;){if(i-n>600){const f=i-n+1,p=r-n+1,v=Math.log(f),b=.5*Math.exp(2*v/3),y=.5*Math.sqrt(v*b*(f-b)/f)*(p-f/2<0?-1:1),w=Math.max(n,Math.floor(r-p*b/f+y)),x=Math.min(i,Math.floor(r+(f-p)*b/f+y));Rn(e,t,r,w,x,o)}const a=t[2*r+o];let s=n,u=i;for(Be(e,t,n,r),t[2*i+o]>a&&Be(e,t,n,i);s<u;){for(Be(e,t,s,u),s++,u--;t[2*s+o]<a;)s++;for(;t[2*u+o]>a;)u--}t[2*n+o]===a?Be(e,t,n,u):(u++,Be(e,t,u,i)),u<=r&&(n=u+1),r<=u&&(i=u-1)}}function Be(e,t,r,n){Dt(e,r,n),Dt(t,2*r,2*n),Dt(t,2*r+1,2*n+1)}function Dt(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function ds(e,t,r,n,i,o,a){const s=[0,e.length-1,0],u=[];let f,p;for(;s.length;){const v=s.pop(),b=s.pop(),y=s.pop();if(b-y<=a){for(let C=y;C<=b;C++)f=t[2*C],p=t[2*C+1],f>=r&&f<=i&&p>=n&&p<=o&&u.push(e[C]);continue}const w=Math.floor((y+b)/2);f=t[2*w],p=t[2*w+1],f>=r&&f<=i&&p>=n&&p<=o&&u.push(e[w]);const x=(v+1)%2;(v===0?r<=f:n<=p)&&(s.push(y),s.push(w-1),s.push(x)),(v===0?i>=f:o>=p)&&(s.push(w+1),s.push(b),s.push(x))}return u}function ps(e,t,r,n,i,o){const a=[0,e.length-1,0],s=[],u=i*i;for(;a.length;){const f=a.pop(),p=a.pop(),v=a.pop();if(p-v<=o){for(let C=v;C<=p;C++)Br(t[2*C],t[2*C+1],r,n)<=u&&s.push(e[C]);continue}const b=Math.floor((v+p)/2),y=t[2*b],w=t[2*b+1];Br(y,w,r,n)<=u&&s.push(e[b]);const x=(f+1)%2;(f===0?r-i<=y:n-i<=w)&&(a.push(v),a.push(b-1),a.push(x)),(f===0?r+i>=y:n+i>=w)&&(a.push(b+1),a.push(p),a.push(x))}return s}function Br(e,t,r,n){const i=e-r,o=t-n;return i*i+o*o}const hs=e=>e[0],vs=e=>e[1];class Ur{constructor(t,r=hs,n=vs,i=64,o=Float64Array){this.nodeSize=i,this.points=t;const a=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new a(t.length),u=this.coords=new o(t.length*2);for(let f=0;f<t.length;f++)s[f]=f,u[2*f]=r(t[f]),u[2*f+1]=n(t[f]);Zt(s,u,i,0,s.length-1,0)}range(t,r,n,i){return ds(this.ids,this.coords,t,r,n,i,this.nodeSize)}within(t,r,n){return ps(this.ids,this.coords,t,r,n,this.nodeSize)}}const ms={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},pt=Math.fround||(e=>t=>(e[0]=+t,e[0]))(new Float32Array(1));class gs{constructor(t){this.options=qe(Object.create(ms),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:r,minZoom:n,maxZoom:i,nodeSize:o}=this.options;r&&console.time("total time");const a=`prepare ${t.length} points`;r&&console.time(a),this.points=t;let s=[];for(let u=0;u<t.length;u++)!t[u].geometry||s.push(bs(t[u],u));this.trees[i+1]=new Ur(s,Gr,qr,o,Float32Array),r&&console.timeEnd(a);for(let u=i;u>=n;u--){const f=+Date.now();s=this._cluster(s,u),this.trees[u]=new Ur(s,Gr,qr,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-f)}return r&&console.timeEnd("total time"),this}getClusters(t,r){let n=((t[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,t[1]));let o=t[2]===180?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,o=180;else if(n>o){const p=this.getClusters([n,i,180,a],r),v=this.getClusters([-180,i,o,a],r);return p.concat(v)}const s=this.trees[this._limitZoom(r)],u=s.range(ut(n),lt(a),ut(o),lt(i)),f=[];for(const p of u){const v=s.points[p];f.push(v.numPoints?Vr(v):this.points[v.index])}return f}getChildren(t){const r=this._getOriginId(t),n=this._getOriginZoom(t),i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);const a=o.points[r];if(!a)throw new Error(i);const s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),u=o.within(a.x,a.y,s),f=[];for(const p of u){const v=o.points[p];v.parentId===t&&f.push(v.numPoints?Vr(v):this.points[v.index])}if(f.length===0)throw new Error(i);return f}getLeaves(t,r,n){r=r||10,n=n||0;const i=[];return this._appendLeaves(i,t,r,n,0),i}getTile(t,r,n){const i=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:a,radius:s}=this.options,u=s/a,f=(n-u)/o,p=(n+1+u)/o,v={features:[]};return this._addTileFeatures(i.range((r-u)/o,f,(r+1+u)/o,p),i.points,r,n,o,v),r===0&&this._addTileFeatures(i.range(1-u/o,f,1,p),i.points,o,n,o,v),r===o-1&&this._addTileFeatures(i.range(0,f,u/o,p),i.points,-1,n,o,v),v.features.length?v:null}getClusterExpansionZoom(t){let r=this._getOriginZoom(t)-1;for(;r<=this.options.maxZoom;){const n=this.getChildren(t);if(r++,n.length!==1)break;t=n[0].properties.cluster_id}return r}_appendLeaves(t,r,n,i,o){const a=this.getChildren(r);for(const s of a){const u=s.properties;if(u&&u.cluster?o+u.point_count<=i?o+=u.point_count:o=this._appendLeaves(t,u.cluster_id,n,i,o):o<i?o++:t.push(s),t.length===n)break}return o}_addTileFeatures(t,r,n,i,o,a){for(const s of t){const u=r[s],f=u.numPoints;let p,v,b;if(f)p=Fn(u),v=u.x,b=u.y;else{const x=this.points[u.index];p=x.properties,v=ut(x.geometry.coordinates[0]),b=lt(x.geometry.coordinates[1])}const y={type:1,geometry:[[Math.round(this.options.extent*(v*o-n)),Math.round(this.options.extent*(b*o-i))]],tags:p};let w;f?w=u.id:this.options.generateId?w=u.index:this.points[u.index].id&&(w=this.points[u.index].id),w!==void 0&&(y.id=w),a.features.push(y)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,r){const n=[],{radius:i,extent:o,reduce:a,minPoints:s}=this.options,u=i/(o*Math.pow(2,r));for(let f=0;f<t.length;f++){const p=t[f];if(p.zoom<=r)continue;p.zoom=r;const v=this.trees[r+1],b=v.within(p.x,p.y,u),y=p.numPoints||1;let w=y;for(const x of b){const C=v.points[x];C.zoom>r&&(w+=C.numPoints||1)}if(w>y&&w>=s){let x=p.x*y,C=p.y*y,m=a&&y>1?this._map(p,!0):null;const g=(f<<5)+(r+1)+this.points.length;for(const c of b){const l=v.points[c];if(l.zoom<=r)continue;l.zoom=r;const h=l.numPoints||1;x+=l.x*h,C+=l.y*h,l.parentId=g,a&&(m||(m=this._map(p,!0)),a(m,this._map(l)))}p.parentId=g,n.push(ys(x/w,C/w,g,w,m))}else if(n.push(p),w>1)for(const x of b){const C=v.points[x];C.zoom<=r||(C.zoom=r,n.push(C))}}return n}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,r){if(t.numPoints)return r?qe({},t.properties):t.properties;const n=this.points[t.index].properties,i=this.options.map(n);return r&&i===n?qe({},i):i}}function ys(e,t,r,n,i){return{x:pt(e),y:pt(t),zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function bs(e,t){const[r,n]=e.geometry.coordinates;return{x:pt(ut(r)),y:pt(lt(n)),zoom:1/0,index:t,parentId:-1}}function Vr(e){return{type:"Feature",id:e.id,properties:Fn(e),geometry:{type:"Point",coordinates:[_s(e.x),ws(e.y)]}}}function Fn(e){const t=e.numPoints,r=t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${Math.round(t/100)/10}k`:t;return qe(qe({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function ut(e){return e/360+.5}function lt(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function _s(e){return(e-.5)*360}function ws(e){const t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function qe(e,t){for(const r in t)e[r]=t[r];return e}function Gr(e){return e.x}function qr(e){return e.y}var Kr=Object.prototype.hasOwnProperty;function Zr(e,t,r){for(r of e.keys())if(ge(r,t))return r}function ge(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&ge(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(i=n,i&&typeof i=="object"&&(i=Zr(t,i),!i)||!t.has(i))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(i=n[0],i&&typeof i=="object"&&(i=Zr(t,i),!i)||!ge(n[1],t.get(i)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(Kr.call(e,r)&&++n&&!Kr.call(t,r)||!(r in t)||!ge(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function Cs(e){var t=M.exports.useRef(e),r=M.exports.useRef(0);return ge(e,t.current)||(t.current=e,r.current+=1),M.exports.useMemo(function(){return t.current},[r.current])}function xs(e,t){return M.exports.useEffect(e,Cs(t))}var Ss=function(t){var r=t.points,n=t.bounds,i=t.zoom,o=t.options,a=M.exports.useRef(),s=M.exports.useRef(),u=M.exports.useState([]),f=u[0],p=u[1],v=Math.round(i);return xs(function(){(!a.current||!ge(s.current,r)||!ge(a.current.options,o))&&(a.current=new gs(o),a.current.load(r)),n&&p(a.current.getClusters(n,v)),s.current=r},[r,n,v,o]),{clusters:f,supercluster:a.current}};const Is=$.div`
2
- border-radius: 50%;
3
- background: linear-gradient(
4
- to top,
5
- ${I["--ll-color-primary-variant1"]},
6
- ${I["--ll-color-primary"]}
7
- );
8
- color: ${I["--ll-color-on-primary"]};
9
- height: ${({diameter:e})=>e}px;
10
- width: ${({diameter:e})=>e}px;
11
- display: flex;
12
- justify-content: center;
13
- align-items: center;
14
- line-height: 1;
15
- font-family: ${I["--ll-font-family"]};
16
- font-size: ${({diameter:e})=>e/2.5}px;
17
- border: 2px solid #fff;
18
- box-shadow: ${I["--ll-shadow-small"]};
19
- cursor: default;
20
- `,Ms=({cluster:e,pointsCount:t,onClick:r})=>{const i=20+e.properties.point_count/t*25;return _(Is,{diameter:i,onClick:()=>r&&r(e),children:e.properties.point_count})};function Es(e){return e.properties.cluster!==void 0}const Nn=ae.memo(({rect:e,zoom:t,mapRef:r,points:n,isMobile:i,activePOI:o,hoveredPOI:a,isMapMoving:s,setActivePOI:u})=>{var b;const f=(b=r==null?void 0:r.current)==null?void 0:b.getMap().getBounds().toArray().flat(),{clusters:p,supercluster:v}=Ss({points:n,bounds:f,zoom:t,options:{radius:50,maxZoom:18}});return _(Ze,{children:p.map((y,w)=>{const[x,C]=y.geometry.coordinates;if(Es(y))return _(Ir,{latitude:C,longitude:x,children:_(Ms,{cluster:y,pointsCount:n.length,onClick:()=>{var A;const d=Math.min(v.getClusterExpansionZoom(y.id),20);(A=r.current)==null||A.flyTo({zoom:d,center:[x,C],duration:1e3,essential:!0})}})},`cluster-${y.id}`);const{poi:m,type:g}=y.properties,c=o===m,l=a===m,h=["rapid_transit_stations"];return _(Ir,{latitude:m.lat,longitude:m.lng,style:{zIndex:c?1:0},children:R(It.Root,{options:{type:g,poi:m,isOpen:s?!1:c,isHovered:l,side:"top",size:h.includes(g)?"medium":"small",collisionPadding:i?{top:e.height+32,bottom:xe*2,left:xe*2,right:xe*2}:{left:e.width+32,right:xe*2,top:xe*2,bottom:xe*2}},onChange:d=>{d.type==="open-change"&&(d.data?setTimeout(()=>{u(m)},0):c&&u(void 0))},children:[_(It.Marker,{}),_(It.Content,{})]})},`${m.name}-${m.lat}-${m.lng}-${w}`)})})});Nn.displayName="Markers";const zn=e=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},M.exports.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2ZM12 11.5C10.62 11.5 9.5 10.38 9.5 9C9.5 7.62 10.62 6.5 12 6.5C13.38 6.5 14.5 7.62 14.5 9C14.5 10.38 13.38 11.5 12 11.5Z"})),Bn=e=>M.exports.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.exports.createElement("path",{d:"M10 20V14H14V20H19V12H22L12 3L2 12H5V20H10Z"}));function _r(e){const{client:t}=Ht(),{sdkState:r}=we(),n=Wt(r.options,250),o={...M.exports.useMemo(()=>n!=null&&n.marker?n.marker:{lat:n==null?void 0:n.lat,lng:n==null?void 0:n.lng},[n]),geographyLevels:["20","30"],locationScoresRounding:!1,include:e};return ht(ni.list(o),async()=>t.getScores(o),{enabled:!!o})}const Ls=$.div`
21
- padding: ${I["--ll-spacing-small"]} ${I["--ll-spacing-medium"]};
22
- background-color: ${I["--ll-color-surface"]};
23
- display: flex;
24
- flex-direction: column;
25
- overflow: hidden;
26
- flex: 1;
27
- `,As=$.div`
28
- display: grid;
29
- grid-template-columns: min-content 1fr;
30
- grid-gap: ${I["--ll-spacing-medium"]};
31
- margin-bottom: ${I["--ll-spacing-medium"]};
32
- `,Os=()=>{var a,s;const{sdkState:e}=we(),{activeCategory:t,activeScore:r}=K(),n=Ke.find(u=>u.value===t),{data:i,isLoading:o}=_r(n.scores);return r&&(i==null?void 0:i.location[r])?o?_("div",{children:"Loading"}):_(U.Root,{options:{score:r,scoresData:i},children:R(Ls,{children:[R(As,{children:[_(U.Badge,{}),_(U.BarChart,{options:{locationIcon:((s=(a=e.options)==null?void 0:a.marker)==null?void 0:s.icon)==="pin"?zn:Bn}})]}),_(U.Description,{})]})}):null},Ps=$.div`
33
- display: flex;
34
- overflow-x: scroll;
35
- padding: ${I["--ll-spacing-x-small"]} ${I["--ll-spacing-medium"]};
36
- flex-shrink: 0;
37
- position: relative;
38
- `,$s=$.button`
39
- position: relative;
40
- display: flex;
41
- flex-direction: column;
42
- align-items: center;
43
- background: none;
44
- border: none;
45
- min-width: 60px;
46
- padding: 0;
47
- margin: 0 8px;
48
- flex-shrink: 0;
49
-
50
- &:first-child {
51
- margin-left: 0;
52
- }
53
-
54
- &:last-child {
55
- margin-right: 0;
56
- }
57
- `,Ts=$.div`
58
- position: absolute;
59
- top: -6px;
60
- right: 4px;
61
- border: 2px solid ${I["--ll-color-background"]};
62
- border-radius: 6px;
63
- `,Ds=$.div`
64
- flex: 1;
65
- display: flex;
66
- align-items: center;
67
- `,ks=$.div`
68
- margin: 0 2px;
69
- `,js=({category:e})=>{const{data:t,isLoading:r,isFetching:n}=_r(e.scores),{activeScore:i,setActiveScore:o,setActiveCategory:a}=K();return _(Ps,{children:e.scores.map(s=>{const u=s===i,f=u?"--ll-color-primary":"--ll-color-disabled";return r||n?_(ks,{children:_(He,{height:"44px",width:"60px"})},s):_(U.Root,{options:{score:s,scoresData:t},children:R($s,{onClick:()=>{a(e.value),o(s)},children:[_(U.Icon,{options:{color:f,height:28,width:28}}),_(Ds,{children:_(U.Title,{options:{variant:"caption1",color:f,noWrap:!0,noMargin:!0,weight:"--ll-font-weight-bold"}})}),_(Ts,{children:_(U.Badge,{options:{variant:"small",isPrimary:u}})})]})},s)})})},Rs=$.div`
70
- display: flex;
71
- padding: ${I["--ll-spacing-x-small"]} ${I["--ll-spacing-medium"]}
72
- ${I["--ll-spacing-xx-small"]} ${I["--ll-spacing-medium"]};
73
- `,Fs=$.div`
74
- position: absolute;
75
- top: 0;
76
- left: 0;
77
- right: 0;
78
- z-index: 3;
79
- box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
80
- overflow: hidden;
81
- display: flex;
82
- flex-direction: column;
83
- background-color: ${I["--ll-color-background"]};
84
- border: 1px solid ${I["--ll-color-border"]};
85
- `,Un=ae.forwardRef((e,t)=>{const{activeCategory:r,setActiveCategory:n}=K();return R(Fs,{ref:t,children:[_(Rs,{children:R(le.Root,{value:r,onValueChange:i=>n(i),children:[_(le.Trigger,{size:"large",children:_(et.Root,{options:{scoreCategory:r},children:_(et.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},r)}),_(le.Content,{children:Ke.map(i=>_(et.Root,{options:{scoreCategory:i.value},children:_(le.Item,{value:i.value,children:_(et.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},i.value))})]})}),_(js,{category:Ke.find(i=>i.value===r)}),_(Os,{})]})});Un.displayName="MobileScores";const Ns=Yr({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),zs=Yr({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Bs=$(ii)`
86
- margin: 0;
87
- z-index: 1;
88
- position: relative;
89
- margin: 0 calc(-1 * ${I["--ll-spacing-medium"]});
90
- padding: 0 ${I["--ll-spacing-medium"]};
91
-
92
- &:hover {
93
- background-color: ${I["--ll-color-surface"]};
94
- box-shadow: ${I["--ll-shadow-small"]};
95
- }
96
- `,Vn=$(oi)`
97
- background: none;
98
- border: none;
99
- display: flex;
100
- align-items: center;
101
- width: 100%;
102
- padding: ${I["--ll-spacing-x-small"]} 0;
103
- `,Us=$(ai)`
104
- background-color: ${I["--ll-color-surface"]};
105
- position: relative;
106
- overflow: hidden;
107
- margin-left: calc(-1 * ${I["--ll-spacing-medium"]});
108
- margin-right: calc(-1 * ${I["--ll-spacing-medium"]});
109
-
110
- [data-state="open"] & {
111
- animation: ${Ns} 300ms cubic-bezier(0.87, 0, 0.13, 1);
112
- }
113
-
114
- [data-state="closed"] & {
115
- animation: ${zs} 300ms cubic-bezier(0.87, 0, 0.13, 1);
116
- }
117
- `,Vs=$.div`
118
- padding: ${I["--ll-spacing-medium"]};
119
- border-top: 1px solid ${I["--ll-color-border"]};
120
- border-bottom: 1px solid ${I["--ll-color-border"]};
121
- `,Gs=$.span`
122
- ${Vn}[data-state=open] & {
123
- transform: rotate(90deg);
124
- } ;
125
- `;$.div`
126
- display: flex;
127
- align-items: flex-start;
128
- justify-content: space-between;
129
- `;const wr=$.div`
130
- margin: ${I["--ll-spacing-small"]} 0;
131
- `,qs=$.div`
132
- margin-top: ${I["--ll-spacing-large"]};
133
- &:empty {
134
- margin: 0;
135
- }
136
- `,Ks=({score:e})=>{const{data:t,isLoading:r}=Dn(),{activePOI:n,setActivePOI:i,hoveredPOI:o,setHoveredPOI:a}=K(),{mapRef:s,mapPadding:u}=jn();return r?_(Ze,{children:[...Array(10)].map((f,p)=>_(wr,{children:_(He,{height:"34px",width:"100%"})},p))}):t?_(Xr.Root,{options:{type:"school",data:t==null?void 0:t[e],activePOI:n,hoveredPOI:o},onChange:f=>{var p;if(f.type==="poi-click"){const v=f.data;i(v);const b=window.innerWidth-u.left,y=window.innerWidth/2,w=b/2+u.left-y;v&&((p=s.current)==null||p.easeTo({zoom:18,center:[v.lng,v.lat],duration:1e3,offset:[w,0]}))}f.type==="poi-hover"&&a(f.data)}}):null},Gn=ae.memo(({result:e,poi:t})=>{const{activePOI:r,setActivePOI:n,hoveredPOI:i,setHoveredPOI:o}=K(),{mapRef:a,mapPadding:s}=jn();return!e.data||!e.data[t]?null:_(Rt.Content,{options:{value:t},children:_(Xr.Root,{options:{type:"poi",data:e.data[t],activePOI:r,hoveredPOI:i},onChange:u=>{var f;if(u.type==="poi-click"){const p=u.data;n(p);const v=window.innerWidth-s.left,b=window.innerWidth/2,y=v/2+s.left-b;p&&((f=a.current)==null||f.flyTo({zoom:18,center:[p.lng,p.lat],duration:1e3,offset:[y,0],essential:!0}))}u.type==="poi-hover"&&o(u.data)}})},t)});Gn.displayName="POI";const qn=ae.memo(({include:e})=>{const t=Tn(),r=e==null?void 0:e.filter(n=>{var i;return(((i=t==null?void 0:t.data)==null?void 0:i[n])||[]).length>0});return t.isLoading&&r.length?_(Ze,{children:[...Array(10)].map((n,i)=>_(wr,{children:_(He,{height:"34px",width:"100%"})},i))}):t.data?R(Rt.Root,{options:{include:r},children:[_(Rt.Tabs,{}),r.map(n=>_(Gn,{poi:n,result:t},n))]}):null});qn.displayName="POIs";const Kn=ae.memo(({score:e,isLoading:t,scoresData:r})=>{var a,s;const{sdkState:n}=we(),{activeScore:i}=K(),o=e===i;return t?_(wr,{children:_(He,{height:"34px",width:"100%"},e)}):r!=null&&r.location[e]?_(si,{value:e,children:R(U.Root,{options:{score:e,scoresData:r},onChange:u=>{u.type==="tooltip-toggle"&&u.data&&ie.trackEvent(Q.LC_LONG_DESCRIPTION_VIEW,e)},children:[_(Bs,{children:R(Vn,{children:[_(Gs,{children:_(en,{SVGElement:ui,fill:I["--ll-color-on-background-variant1"]})}),_(Ee,{spacing:"--ll-spacing-small"}),_(U.Icon,{}),_(Ee,{spacing:"--ll-spacing-small"}),_(U.Title,{}),_(Ee,{}),_(U.Badge,{options:{isPrimary:o}})]})}),_(Us,{children:R(Vs,{children:[_(U.Description,{}),_(Ee,{vertical:!0,spacing:"--ll-spacing-small"}),_(U.BarChart,{options:{locationIcon:((s=(a=n.options)==null?void 0:a.marker)==null?void 0:s.icon)==="pin"?zn:Bn}}),_(qs,{children:e==="high_schools"||e==="primary_schools"?_(Ks,{score:e}):_(qn,{include:Ve[e]})})]})})]})},e):null});Kn.displayName="Score";const Zs=$.div`
137
- padding: ${I["--ll-spacing-small"]} ${I["--ll-spacing-medium"]};
138
- `,Hs=$.div`
139
- display: flex;
140
- justify-content: space-between;
141
- align-items: center;
142
- `,Zn=ae.memo(({tabContent:e})=>{const{data:t,isLoading:r,isFetching:n}=_r(e.scores),{translations:i}=Jt();return R(Zs,{children:[R(Hs,{children:[_(ot.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),n&&!r&&_(bi,{size:"small"})]}),_(Ee,{spacing:"--ll-spacing-small",vertical:!0}),!n&&!Object.keys((t==null?void 0:t.location)||{}).length&&_(Ue,{color:"--ll-color-on-background-variant1",children:i.EMPTY_TEXT}),e.scores.map(o=>_(Kn,{score:o,isLoading:r,scoresData:t},o))]})});Zn.displayName="ScoreCategory";const Hn=ae.memo(({tabContent:e})=>{const{activeScore:t,setActiveScore:r}=K();return M.exports.useEffect(()=>{r(e.scores[0])},[]),_(li,{value:t,onValueChange:n=>{r(n),ie.trackEvent(Q.LC_SCORE_CLICK,n||Q.LC_SCORE_CLOSE)},type:"single",collapsible:!0,children:_(Zn,{tabContent:e})})});Hn.displayName="ScoreCategoryAccordion";const Ws=$.div`
143
- overflow-y: auto;
144
- `,Js=$.div`
145
- position: absolute;
146
- top: ${I["--ll-spacing-medium"]};
147
- left: ${I["--ll-spacing-medium"]};
148
- width: 360px;
149
- max-height: calc(100% - 2 * ${I["--ll-spacing-medium"]});
150
- z-index: 1;
151
- border-radius: ${I["--ll-border-radius-medium"]};
152
- box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
153
- background-color: #fff;
154
- overflow: hidden;
155
- display: flex;
156
- flex-direction: column;
157
- background-color: ${I["--ll-color-background"]};
158
- border: 1px solid ${I["--ll-color-border"]};
159
- `;$.div`
160
- display: flex;
161
- justify-content: center;
162
- padding: ${I["--ll-spacing-small"]};
163
- `;const Qs=$.div`
164
- padding: ${I["--ll-spacing-xx-small"]};
165
- border-bottom: 1px solid ${I["--ll-color-border"]};
166
- `,Ys=$.div`
167
- display: flex;
168
- justify-content: center;
169
- padding: ${I["--ll-spacing-small"]};
170
- background-color: ${I["--ll-color-background"]};
171
- `,Wn=()=>_(Ys,{children:_(_i.Root,{})}),Jn=ae.forwardRef((e,t)=>{const{activeCategory:r,setActiveCategory:n}=K();return _(ot.Root,{options:{currentTab:r},onChange:i=>{n(i.data)},children:R(Js,{ref:t,children:[_(Qs,{children:_(ot.Tabs,{})}),_(Ws,{children:Ke.map(i=>_(ot.Content,{options:{value:i.value},children:_(Hn,{tabContent:i},i.value)},i.value))}),_(Wn,{})]})})});Jn.displayName="DesktopScores";const Xs=$.div`
172
- position: relative;
173
- display: flex;
174
- flex-direction: column;
175
- height: 100vh;
176
- `,Hr=e=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},M.exports.createElement("path",{d:"M22.4275 10.5938L13.4175 1.58383C12.6675 0.833834 11.3475 0.823834 10.5875 1.58383L1.58745 10.5838C0.807453 11.3638 0.807453 12.6238 1.58745 13.4038L10.5875 22.4038C10.9775 22.7938 11.4875 22.9838 11.9975 22.9838C12.5075 22.9838 13.0175 22.7938 13.4075 22.4038L22.3975 13.4138C23.1875 12.6538 23.1975 11.3938 22.4275 10.5938ZM12.0075 20.9938L3.00745 11.9938L12.0075 2.99383L21.0075 11.9938L12.0075 20.9938ZM7.99745 11.0038V15.0038H9.99745V12.0038H13.9975V14.5038L17.4975 11.0038L13.9975 7.50383V10.0038H8.99745C8.44745 10.0038 7.99745 10.4538 7.99745 11.0038Z"})),eu=e=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},M.exports.createElement("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5H6.5C5.84 5 5.29 5.42 5.08 6.01L3 12V20C3 20.55 3.45 21 4 21H5C5.55 21 6 20.55 6 20V19H18V20C18 20.55 18.45 21 19 21H20C20.55 21 21 20.55 21 20V12L18.92 6.01ZM6.85 7H17.14L18.22 10.11H5.77L6.85 7ZM19 17H5V12H19V17Z"}),M.exports.createElement("path",{d:"M7.5 16C8.32843 16 9 15.3284 9 14.5C9 13.6716 8.32843 13 7.5 13C6.67157 13 6 13.6716 6 14.5C6 15.3284 6.67157 16 7.5 16Z"}),M.exports.createElement("path",{d:"M16.5 16C17.3284 16 18 15.3284 18 14.5C18 13.6716 17.3284 13 16.5 13C15.6716 13 15 13.6716 15 14.5C15 15.3284 15.6716 16 16.5 16Z"})),tu=e=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},M.exports.createElement("path",{d:"M13.5 5.5C14.6 5.5 15.5 4.6 15.5 3.5C15.5 2.4 14.6 1.5 13.5 1.5C12.4 1.5 11.5 2.4 11.5 3.5C11.5 4.6 12.4 5.5 13.5 5.5ZM9.8 8.9L7 23H9.1L10.9 15L13 17V23H15V15.5L12.9 13.5L13.5 10.5C14.8 12 16.8 13 19 13V11C17.1 11 15.5 10 14.7 8.6L13.7 7C13.14 6.11 12.02 5.75 11.05 6.16L6 8.3V13H8V9.6L9.8 8.9Z"})),ru=e=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},M.exports.createElement("path",{d:"M12,2C6.47,2,2,6.47,2,12s4.47,10,10,10s10-4.47,10-10S17.53,2,12,2z M17,15.59L15.59,17L12,13.41L8.41,17L7,15.59 L10.59,12L7,8.41L8.41,7L12,10.59L15.59,7L17,8.41L13.41,12L17,15.59z"})),Qn={all:()=>["commute-calc"],list:e=>[...Qn.all(),e]},nu="https://router.hereapi.com/v8/routes?";function iu({transportMode:e,origin:t,destination:r}){const n={return:"polyline,summary,typicalDuration",transportMode:e,origin:t,destination:`${r==null?void 0:r.lat},${r==null?void 0:r.lng}`,apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE"},i=()=>fetch(nu+new URLSearchParams(n)).then(o=>o.json()).then(o=>o.routes.length>0&&o.routes[0].sections.length>0?o.routes[0].sections[0]:[]).catch(o=>{wi(o)});return ht(Qn.list(n),i,{enabled:!!n&&!!r&&!!t})}const kt=(e,t,r)=>t===1?e:r!=null?r:`${e}s`,ou=[62,-1,-1,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,63,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],au=1,H=typeof BigInt<"u"?BigInt:Number;function su(e){const t=e.charCodeAt(0);return ou[t-45]}function uu(e){let t=H(0),r=H(0);const n=[];if(e.split("").forEach(i=>{const o=H(su(i));t|=(o&H(31))<<r,(o&H(32))===H(0)?(n.push(t),t=H(0),r=H(0)):r+=H(5)}),r>0)throw new Error("Invalid encoding");return n}function lu(e,t){if(+e.toString()!==au)throw new Error("Invalid format version");const r=+t.toString(),n=r&15,i=r>>4&7,o=r>>7&15;return{precision:n,thirdDim:i,thirdDimPrecision:o}}function jt(e){let t=e;return t&H(1)&&(t=~t),t>>=H(1),+t.toString()}function cu(e){const t=uu(e),r=lu(t[0],t[1]),n=10**r.precision,i=10**r.thirdDimPrecision,{thirdDim:o}=r;let a=0,s=0,u=0;const f=[];let p=2;for(;p<t.length;){const b=jt(t[p])/n,y=jt(t[p+1])/n;if(a+=b,s+=y,o){const w=jt(t[p+2])/i;u+=w,f.push([s,a,u]),p+=3}else f.push([s,a]),p+=2}if(p!==t.length)throw new Error("Invalid encoding. Premature ending reached");return{type:"FeatureCollection",features:[{id:"route",type:"Feature",geometry:{type:"LineString",coordinates:f}}]}}const fu=$.div`
177
- max-height: calc(100% - 2 * ${I["--ll-spacing-medium"]});
178
- border-radius: ${I["--ll-border-radius-medium"]};
179
- box-shadow: ${I["--ll-shadow-small"]};
180
- background-color: ${I["--ll-color-background"]};
181
- border: 1px solid ${I["--ll-color-border"]};
182
- padding: ${I["--ll-spacing-x-small"]};
183
- `,du=$.div`
184
- display: flex;
185
- justify-content: space-between;
186
- align-items: end;
187
-
188
- ${ci} {
189
- width: 229px;
190
- margin-right: ${I["--ll-spacing-x-small"]};
191
- }
192
- `,Wr=$.div`
193
- background-color: ${I["--ll-color-surface"]};
194
- padding: ${I["--ll-spacing-x-small"]} ${I["--ll-spacing-small"]} 0;
195
- border-radius: ${I["--ll-border-radius-medium"]};
196
- `,pu=$(tn)`
197
- position: absolute;
198
- right: ${I["--ll-spacing-xx-small"]};
199
- top: ${I["--ll-spacing-xx-small"]};
200
- `,Yn=({className:e,onClose:t})=>{var m,g,c,l;const{sdkState:r}=we(),{setCommuteGeojson:n,destination:i,setDestination:o}=K(),[a,s]=M.exports.useState("pedestrian"),u=br(),{translations:f}=Jt(),{data:p,isFetching:v,isFetched:b}=iu({destination:i,transportMode:a,origin:`${(g=(m=r==null?void 0:r.options)==null?void 0:m.marker)==null?void 0:g.lat},${(l=(c=r==null?void 0:r.options)==null?void 0:c.marker)==null?void 0:l.lng}`});M.exports.useEffect(()=>{ie.trackEvent(Q.LC_COMMUTE_CALC_VIEW,"Commute Calculator Viewed")},[]),M.exports.useEffect(()=>{!(p!=null&&p.summary)||(ie.trackEvent(Q.LC_COMMUTE_CALCULATE_ROUTE,{origin,destination:i}),n(cu(p.polyline)))},[p]);const y={pedestrian:[f.WALKING,tu],car:[f.DRIVING,eu]},w=M.exports.useMemo(()=>{if(!(p!=null&&p.summary))return null;const h=Math.floor(p.summary.typicalDuration/60/60),d=Math.floor(p.summary.typicalDuration/60%60);return h===0?`${d} ${kt(f.MINUTE,d)}`:`${h} ${kt(f.HOUR,h)} ${d} ${kt(f.MINUTE,d)}`},[p]),x=M.exports.useMemo(()=>{if(!(p!=null&&p.summary))return null;const h=Math.floor(p.summary.length/1e3);return h===0?`${p.summary.length} m`:`${h} km`},[p]),C=()=>v?_(He,{height:"70.4px",width:"100%"}):p!=null&&p.summary?R(Wr,{children:[_(Ue,{variant:"h5",children:w}),R(Ue,{children:[x," \u2013 ",f.FAST_ROUTE]})]}):R(Wr,{children:[_(Ue,{variant:"h5",children:f.NO_ROUTE}),_(Ue,{children:f.TRY_SUGGESTION})]});return R(fu,{className:e,children:[_(pu,{size:"medium",color:"neutral",onClick:t,SVGElement:ru}),R(du,{children:[_(fi,{label:f.CALCULATE_COMMUTE,placeholder:f.SEARCH_MAP,renderListBelow:u,renderListBelowPosition:30,onSearch:h=>{o({lat:h.latitude,lng:h.longitude})}}),_(le.Root,{value:a,onValueChange:h=>{s(h)},children:R(le.Trigger,{children:[_(en,{SVGElement:y[a][1],fill:I["--ll-color-on-background-variant1"],width:16}),y[a][0],R(le.Content,{children:[_(le.Item,{value:"car",children:f.DRIVING}),_(le.Item,{value:"pedestrian",children:f.WALKING})]})]})})]}),(b||v)&&R(Ze,{children:[_(Ee,{vertical:!0,spacing:"--ll-spacing-x-small"}),_(di,{open:!!p,children:C()})]})]})},hu=$.div`
201
- position: absolute;
202
- bottom: 0;
203
- right: 0;
204
- left: 0;
205
- z-index: 3;
206
- `,vu=$.div`
207
- position: absolute;
208
- top: ${I["--ll-spacing-medium"]};
209
- right: ${I["--ll-spacing-medium"]};
210
- z-index: 3;
211
- max-width: 356px;
212
- `,mu=$(tn)`
213
- box-shadow: ${I["--ll-shadow-medium"]};
214
- position: absolute;
215
- bottom: ${I["--ll-spacing-medium"]};
216
- right: ${I["--ll-spacing-medium"]};
217
- `,gu=$(Yn)``,yu=$(Yn)`
218
- border-radius: ${I["--ll-border-radius-small"]}
219
- ${I["--ll-border-radius-small"]} 0 0;
220
- border: 0;
221
- `,bu=()=>{const{setCommuteGeojson:e,setDestination:t}=K(),[r,n]=M.exports.useState(!1),{translations:i}=Jt(),o=br(),a=()=>{t(void 0),e(void 0),n(!1)},s=()=>{n(!0),ie.trackEvent(Q.LC_COMMUTE_CALC_CLICK,{isMobile:o})};return o?_(Ze,{children:r?_(hu,{children:_(yu,{onClose:a})}):_(mu,{size:"large",SVGElement:Hr,onClick:s})}):_(vu,{children:r?_(gu,{onClose:a}):_(Ci,{onClick:s,startAdornment:_(Hr,{}),children:i.CALCULATE_COMMUTE})})},_u=()=>{var T,B,Xe;const{sdkState:e,setSdkState:t}=we(),{activeScore:r,activePOI:n,setActivePOI:i,hoveredPOI:o,commuteGeojson:a,destination:s}=K(),u=br(),f=Tn(),p=Dn(),v=((B=(T=e==null?void 0:e.globalOptions)==null?void 0:T.appearance)==null?void 0:B.theme)==="night"?"dd191599-2a92-49fc-9a33-e12391753ad5":"600d69cb-288d-445e-9839-3dfe4d76b31a",b={id:"point",type:"line",paint:{"line-width":6,"line-color":"#0056D3"}};M.exports.useEffect(()=>{ie.trackEvent(Q.LC_VIEWED,r)},[]);const[y,w]=M.exports.useState(!1),x=M.exports.useMemo(()=>{var N,Z;return(r==="high_schools"||r==="primary_schools")&&!p.isFetching?{[r]:((N=p==null?void 0:p.data)==null?void 0:N[r])||[]}:!(Ve&&r&&Ve[r]&&((Z=Ve[r])==null?void 0:Z.length))&&!f.isFetching?{[r]:[]}:f.data},[f.data,p.data,r]),C=M.exports.useMemo(()=>x?Object.entries(x).map(([Z,fe])=>fe.map(ee=>$t([ee.lng,ee.lat],{poi:ee,type:Z}))).flat().filter((Z,fe,ee)=>ee.findIndex(St=>["lat","lng","name"].every(Re=>St.properties.poi[Re]===Z.properties.poi[Re]))===fe):[],[x]),m=M.exports.useMemo(()=>{var Z,fe,ee;const N=((Z=e==null?void 0:e.options)==null?void 0:Z.marker)&&$t([(fe=e==null?void 0:e.options)==null?void 0:fe.marker.lng,(ee=e==null?void 0:e.options)==null?void 0:ee.marker.lat]);return[...C,...N?[N]:[],...s?[$t([s==null?void 0:s.lng,s==null?void 0:s.lat])]:[]]},[C,(Xe=e==null?void 0:e.options)==null?void 0:Xe.marker,s]),g=M.exports.useRef(),[c,l]=pi(),h=M.exports.useMemo(()=>({top:25+l.height,bottom:25,left:25,right:25}),[l.height]),d=M.exports.useMemo(()=>({top:50,bottom:50,left:l.width+32+50,right:50}),[l.width]),A=u?h:d,P=N=>{t({...e,options:{...e.options,lat:N.viewState.latitude,lng:N.viewState.longitude,zoom:N.viewState.zoom,bearing:N.viewState.bearing,pitch:N.viewState.pitch}})};return M.exports.useEffect(()=>{var Re,Cr;if(!m.length||!((Re=e.options)!=null&&Re.marker))return;const N=Ka(m.map(({geometry:xr})=>[xr.coordinates[1],xr.coordinates[0]])),[Z,fe,ee,St]=qt(N);(Cr=g==null?void 0:g.current)==null||Cr.fitBounds([[fe,Z],[St,ee]],{maxZoom:17,padding:A,duration:1e3})},[m,A]),e.options?_(fs,{mapRef:g,mapPadding:A,children:R(Xs,{children:[R(hi,{ref:g,mapLib:vi,latitude:e.options.lat,longitude:e.options.lng,zoom:e.options.zoom,pitch:e.options.pitch,bearing:e.options.bearing,style:{flex:1,width:"100vw"},mapStyle:`https://api.maptiler.com/maps/${v}/style.json?key=9jNGatuzs05Q1oNlctEs`,onMove:P,cooperativeGestures:e.options.cooperativeGestures,onMoveStart:()=>w(!0),onMoveEnd:()=>w(!1),attributionControl:!1,children:[_(mi,{compact:!0,position:u?"bottom-left":"bottom-right"}),_(gi,{position:u?"top-right":"bottom-right",showCompass:!0,style:{marginTop:u?16+l.height:16,marginRight:16}}),e.options.marker&&_(Mr,{marker:e.options.marker}),_(Nn,{rect:l,zoom:e.options.zoom,mapRef:g,points:C,isMobile:u,activePOI:n,hoveredPOI:o,isMapMoving:y,setActivePOI:i}),u?_(Un,{ref:c}):_(Jn,{ref:c}),_(bu,{}),s&&_(Mr,{marker:{icon:"pin",...s}}),a&&_(Ba,{type:"geojson",data:a,children:_(qa,{...b})})]}),u&&_(Wn,{})]})}):_("div",{children:"No options provided."})},wu=()=>(ie.trackPageLoad(),_(Ra,{children:_(_u,{})})),Au=Object.freeze(Object.defineProperty({__proto__:null,default:wu},Symbol.toStringTag,{value:"Module"}));export{be as C,pr as P,vt as a,In as b,pe as c,Mu as d,Iu as e,hr as f,Eu as g,Ge as h,ct as i,rn as j,re as k,Pt as l,Xo as m,Ei as n,ji as o,va as p,Au as q,Lu as u};
@@ -1 +0,0 @@
1
- !function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}System.register(["./index-legacy.9ef71ae1.js"],(function(t,a){"use strict";var n;return{setters:[function(e){n=e.ac}],execute:function(){function a(e,t){for(var a=function(){var a=t[n];if("string"!=typeof a&&!Array.isArray(a)){var i=function(t){if("default"!==t&&!(t in e)){var n=Object.getOwnPropertyDescriptor(a,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:function(){return a[t]}})}};for(var r in a)i(r)}},n=0;n<t.length;n++)a();return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var i={exports:{}};!function(t,a){window,t.exports=function(t){var a={};function n(e){if(a[e])return a[e].exports;var i=a[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=a,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(t,a){if(1&a&&(t=n(t)),8&a)return t;if(4&a&&"object"==e(t)&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&a&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,a){a.r(t);var n="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise((function(a,n){var i=new XMLHttpRequest;for(var r in i.open(t.method||"get",e,!0),t.headers)i.setRequestHeader(r,t.headers[r]);function o(){var e,t=[],a=[],n={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,r,o){t.push(r=r.toLowerCase()),a.push([r,o]),e=n[r],n[r]=e?e+","+o:o})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:o,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},headers:{keys:function(){return t},entries:function(){return a},get:function(e){return n[e.toLowerCase()]},has:function(e){return e.toLowerCase()in n}}}}i.withCredentials="include"==t.credentials,i.onload=function(){a(o())},i.onerror=n,i.send(t.body)}))};t.default=n},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),i=function(){function e(t,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginName=t}return n(e,[{key:"track",value:function(e,t){window.analytics.track(e,t,{integration:{name:this.pluginName}})}}]),e}();t.default=i},function(e,t,a){Object.defineProperty(t,"__esModule",{value:!0}),t.YouTubeAnalytics=t.VimeoAnalytics=void 0;var n=r(a(3)),i=r(a(4));function r(e){return e&&e.__esModule?e:{default:e}}t.VimeoAnalytics=n.default,t.YouTubeAnalytics=i.default},function(t,a,n){Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),r=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(t){function a(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var i=function(t,a){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!=e(a)&&"function"!=typeof a?t:a}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"VimeoAnalytics"));return i.authToken=n,i.player=t,i.metadata={content:{},playback:{videoPlayer:"Vimeo"}},i.mostRecentHeartbeat=0,i.isPaused=!1,i}return function(t,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function, not "+e(a));t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(t,a):t.__proto__=a)}(a,t),i(a,[{key:"initialize",value:function(){var e=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var a in t)this.registerHandler(a,t[a]);this.player.getVideoId().then((function(t){e.retrieveMetadata({id:t})})).catch(console.error)}},{key:"registerHandler",value:function(e,t){var a=this;this.player.on(e,(function(e){a.updateMetadata(e),t.call(a,e)}))}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var e=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==e&&t-e>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(t))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(e){var t=this;return new Promise((function(a,n){var i=e.id;(0,r.default)("https://api.vimeo.com/videos/"+i,{headers:{Authorization:"Bearer "+t.authToken}}).then((function(e){return e.ok?e.json():n(e)})).then((function(e){t.metadata.content.title=e.name,t.metadata.content.description=e.description,t.metadata.content.publisher=e.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=e.duration})).catch((function(e){return console.error("Request to Vimeo API Failed with: ",e),n(e)}))}))}},{key:"updateMetadata",value:function(e){var t=this;return new Promise((function(a,n){t.player.getVolume().then((function(n){n&&(t.metadata.playback.sound=100*n),t.metadata.playback.position=e.seconds,a()})).catch(n)}))}}]),a}(o(n(1)).default);a.default=s},function(t,a,n){Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),r=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(t){function a(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var i=function(t,a){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!=e(a)&&"function"!=typeof a?t:a}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"YoutubeAnalytics"));return i.player=t,i.apiKey=n,i.playerLoaded=!1,i.playbackStarted=!1,i.contentStarted=!1,i.isPaused=!1,i.isBuffering=!1,i.isSeeking=!1,i.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},i.metadata=[{playback:{video_player:"youtube"},content:{}}],i.playlistIndex=0,i}return function(t,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function, not "+e(a));t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(t,a):t.__proto__=a)}(a,t),i(a,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(e){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(e){var t=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=t,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),e.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var e=this;return new Promise((function(t,a){var n=e.player.getVideoData(),i=e.player.getPlaylist()||[n.video_id],o=i.join();(0,r.default)("https://www.googleapis.com/youtube/v3/videos?id="+o+"&part=snippet,contentDetails&key="+e.apiKey).then((function(e){if(!e.ok){var t=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw t.response=e,t}return e.json()})).then((function(a){e.metadata=[];for(var n=0,r=0;r<i.length;r++){var o=a.items[r];e.metadata.push({content:{title:o.snippet.title,description:o.snippet.description,keywords:o.snippet.tags,channel:o.snippet.channelTitle,airdate:o.snippet.publishedAt}}),n+=l(o.contentDetails.duration)}for(r=0;r<i.length;r++)e.metadata[r].playback={total_length:n,video_player:"youtube"};t()})).catch((function(t){e.metadata=i.map((function(e){return{playback:{video_player:"youtube"},content:{}}})),a(t)}))}))}},{key:"handleBuffer",value:function(){var e=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),e&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var t=this.player.getPlaylist();t&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===t.length-1&&0===this.player.getPlaylistIndex()&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),-1===this.playlistIndex&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var e=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(e?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var e=this.player.getPlaylistIndex(),t=this.player.getPlaylist();(t&&e===t.length-1||-1===e)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var e=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,t=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-t)>2e3}}]),a}(o(n(1)).default);function l(e){var t=e.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map((function(e){if(null!=e)return e.replace(/\D/,"")})),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}a.default=s}])}(i),t("i",a({__proto__:null,default:n(i.exports)},[i.exports]))}}}))}();