@local-logic/sdks-app 1.2.3 → 1.2.4

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 (36) hide show
  1. package/dist/assets/{index-legacy.07116093.js → index-legacy.8274fd62.js} +1 -1
  2. package/dist/assets/index-legacy.ab2806f1.js +40 -0
  3. package/dist/assets/index-legacy.b0c3b101.js +1 -0
  4. package/dist/assets/index-legacy.ee970dd3.js +1 -0
  5. package/dist/assets/{index.1b45b39b.js → index.1798f035.js} +1 -1
  6. package/dist/assets/index.299746d3.js +221 -0
  7. package/dist/assets/{index.c1827e8f.js → index.5e5913ac.js} +1 -1
  8. package/dist/assets/{index.27821d72.js → index.603e3d3b.js} +52 -52
  9. package/dist/assets/{polyfills-legacy.d3683099.js → polyfills-legacy.bf9b122f.js} +1 -1
  10. package/dist/index.html +3 -3
  11. package/dist/types/sdks/LocalContent/index.d.ts.map +1 -1
  12. package/dist/types/sdks/LocalContent/index.js +5 -2
  13. package/dist/types/sdks/LocalContent/index.js.map +1 -1
  14. package/package.json +1 -1
  15. package/dist/assets/auto-track-legacy.541af3f5.js +0 -1
  16. package/dist/assets/auto-track.10e7c441.js +0 -1
  17. package/dist/assets/index-legacy.4d95875e.js +0 -40
  18. package/dist/assets/index-legacy.60d9e590.js +0 -1
  19. package/dist/assets/index-legacy.690811dc.js +0 -1
  20. package/dist/assets/index-legacy.89760bd0.js +0 -1
  21. package/dist/assets/index-legacy.a4b02181.js +0 -1
  22. package/dist/assets/index-legacy.be4ae81b.js +0 -672
  23. package/dist/assets/index-legacy.d24a67f5.js +0 -1
  24. package/dist/assets/index-legacy.d281a40b.js +0 -1
  25. package/dist/assets/index-legacy.d7f5a5d6.js +0 -1
  26. package/dist/assets/index.0c5b062b.js +0 -1345
  27. package/dist/assets/index.1787c8e5.js +0 -1
  28. package/dist/assets/index.24a102e7.js +0 -1
  29. package/dist/assets/index.7dae5d4e.js +0 -1
  30. package/dist/assets/index.99863166.js +0 -221
  31. package/dist/assets/index.ca339fe1.js +0 -1
  32. package/dist/assets/index.e50321f4.js +0 -1
  33. package/dist/assets/index.umd-legacy.84ee2b87.js +0 -1
  34. package/dist/assets/index.umd.703b7a5f.js +0 -1
  35. package/dist/assets/is-plan-event-enabled-legacy.0a339854.js +0 -1
  36. package/dist/assets/is-plan-event-enabled.681b46ca.js +0 -1
@@ -0,0 +1 @@
1
+ !function(){var t,e,n,r,o,i,a,l,c,u,s,d,f,p,h,v,m,g,y,b,x,w,C,S,M,k,L,P,O,E,I,j,_,A,z;function T(t){return function(t){if(Array.isArray(t))return Y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||W(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function N(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Z(t,e,n){return e&&D(t.prototype,e),n&&D(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function G(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */G=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(L){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,i=Object.create(o.prototype),a=new S(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=x(a,n);if(l){if(l===s)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===s)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(L){return{type:"throw",arg:L}}}t.wrap=c;var s={};function d(){}function f(){}function p(){}var h={};l(h,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(M([])));m&&m!==e&&n.call(m,o)&&(h=m);var g=p.prototype=d.prototype=Object.create(h);function y(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(o,i,a,l){var c=u(t[o],t,i);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==H(d)&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,a,l)}),(function(t){r("throw",t,a,l)})):e.resolve(d).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,l)}))}l(c.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,s;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function M(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=p,l(g,"constructor",p),l(p,"constructor",f),f.displayName=l(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},y(b.prototype),l(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(c(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(g),l(g,a,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=M,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),s}},t}function V(t,e,n,r,o,i,a){try{var l=t[i](a),c=l.value}catch(u){return void n(u)}l.done?e(c):Promise.resolve(c).then(r,o)}function F(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){V(i,r,o,a,l,"next",t)}function l(t){V(i,r,o,a,l,"throw",t)}a(void 0)}))}}function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function B(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=W(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(c){l=!0,o=c}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(t,e)||W(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(t,e){if(t){if("string"==typeof t)return Y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Y(t,e):void 0}}function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function K(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$(Object(n),!0).forEach((function(e){q(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function q(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}System.register(["./index-legacy.b0c3b101.js","./index-legacy.ab2806f1.js"],(function(D,V){"use strict";var W,Y,$,Q,X,J,tt,et,nt,rt,ot,it,at,lt,ct,ut,st,dt,ft,pt,ht,vt,mt,gt,yt,bt,xt,wt,Ct,St,Mt,kt,Lt,Pt,Ot,Et,It,jt,_t,At,zt,Tt,Rt,Nt,Dt,Zt,Gt,Vt,Ft,Ht,Bt,Ut,Wt,Yt,$t;return{setters:[function(t){W=t.M,Y=t.d,$=t.u,Q=t.p,X=t.s,J=t.a,tt=t.b,et=t.$,nt=t.c,rt=t.e,ot=t.f,it=t.S,at=t.g,lt=t.h,ct=t.i,ut=t.A,st=t.j,dt=t.k,ft=t.m,pt=t.l,ht=t.N,vt=t.P},function(t){mt=t.R,gt=t.r,yt=t.S,bt=t.j,xt=t.I,wt=t.c,Ct=t.L,St=t.u,Mt=t.a,kt=t.p,Lt=t.s,Pt=t.y,Ot=t.F,Et=t.b,It=t.d,jt=t.e,_t=t.h,At=t.M,zt=t.f,Tt=t.B,Rt=t.U,Nt=t.A,Dt=t.x,Zt=t.O,Gt=t.g,Vt=t.i,Ft=t.C,Ht=t.k,Bt=t.l,Ut=t.m,Wt=t.n,Yt=t.N,$t=t.T}],execute:function(){var V=mt.createContext({}),Kt=function(){return gt.exports.useContext(V)},qt=function(t,e){switch(e.type){case"CATEGORY":return K(K({},t),{},{activeCategory:e.value});case"SCORE":var n=xt.find((function(n){return""===e.value?n.value===t.activeCategory:n.scores.includes(e.value)})).value;return{activeCategory:n,activeScoreByCategory:K(K({},t.activeScoreByCategory),{},q({},n,e.value))}}},Qt=function(t){var e=t.children,n=window.innerWidth<yt.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=U(gt.exports.useReducer(qt,n),2),o=r[0],i=r[1],a=U(gt.exports.useState(),2),l=a[0],c=a[1],u=U(gt.exports.useState(),2),s=u[0],d=u[1],f=U(gt.exports.useState(),2),p=f[0],h=f[1],v=U(gt.exports.useState(),2),m=v[0],g=v[1],y=o.activeCategory,b=o.activeScoreByCategory[y],x=function(t){i({type:"SCORE",value:t})},w=function(t){i({type:"CATEGORY",value:t})},C=gt.exports.useMemo((function(){return{activeScore:b,setActiveScore:x,activeCategory:y,setActiveCategory:w,activePOI:l,setActivePOI:c,hoveredPOI:s,setHoveredPOI:d,commuteGeojson:p,setCommuteGeojson:h,destination:m,setDestination:g}}),[b,x,y,w,l,c,s,d,p,h,m,g]);return bt(V.Provider,{value:C,children:e})};function Xt(t,e){if(!t)throw new Error(e)}var Jt=0;function te(t){var e=gt.exports.useContext(W).map.getMap(),n=gt.exports.useRef(t),r=U(gt.exports.useState(0),2)[1],o=gt.exports.useMemo((function(){return t.id||"jsx-source-".concat(Jt++)}),[]);gt.exports.useEffect((function(){if(e){var t=function(){return r((function(t){return t+1}))};return e.on("styledata",t),t(),function(){var n;if(e.off("styledata",t),e.style&&e.style._loaded&&e.getSource(o)){var r=null===(n=e.getStyle())||void 0===n?void 0:n.layers;if(r){var i,a=B(r);try{for(a.s();!(i=a.n()).done;){var l=i.value;l.source===o&&e.removeLayer(l.id)}}catch(c){a.e(c)}finally{a.f()}}e.removeSource(o)}}}}),[e]);var i=e&&e.style&&e.getSource(o);return i?function(t,e,n){Xt(e.id===n.id,"source id changed"),Xt(e.type===n.type,"source type changed");var r="",o=0;for(var i in e)"children"===i||"id"===i||Y(n[i],e[i])||(r=i,o++);if(o){var a=e.type;if("geojson"===a)t.setData(e.data);else if("image"===a)t.updateImage({url:e.url,coordinates:e.coordinates});else if("canvas"!==a&&"video"!==a||1!==o||"coordinates"!==r)if("vector"===a&&"setUrl"in t)switch(r){case"url":t.setUrl(e.url);break;case"tiles":t.setTiles(e.tiles)}else console.warn("Unable to update <Source> prop: ".concat(r));else t.setCoordinates(e.coordinates)}}(i,t,n.current):i=function(t,e,n){if(t.style&&t.style._loaded){var r=K({},n);return delete r.id,delete r.children,t.addSource(e,r),t.getSource(e)}return null}(e,o,t),n.current=t,i&&gt.exports.Children.map(t.children,(function(t){return t&&gt.exports.cloneElement(t,{source:o})}))||null}var ee=0;function ne(t){var e=gt.exports.useContext(W).map.getMap(),n=gt.exports.useRef(t),r=U(gt.exports.useState(0),2)[1],o=gt.exports.useMemo((function(){return t.id||"jsx-layer-".concat(ee++)}),[]);if(gt.exports.useEffect((function(){if(e){var t=function(){return r((function(t){return t+1}))};return e.on("styledata",t),t(),function(){e.off("styledata",t),e.style&&e.style._loaded&&e.getLayer(o)&&e.removeLayer(o)}}}),[e]),e&&e.style&&e.getLayer(o))try{!function(t,e,n,r){if(Xt(n.id===r.id,"layer id changed"),Xt(n.type===r.type,"layer type changed"),"custom"!==n.type&&"custom"!==r.type){var o=n.layout,i=void 0===o?{}:o,a=n.paint,l=void 0===a?{}:a,c=n.filter,u=n.minzoom,s=n.maxzoom,d=n.beforeId;if(d!==r.beforeId&&t.moveLayer(e,d),i!==r.layout){var f=r.layout||{};for(var p in i)Y(i[p],f[p])||t.setLayoutProperty(e,p,i[p]);for(var h in f)i.hasOwnProperty(h)||t.setLayoutProperty(e,h,void 0)}if(l!==r.paint){var v=r.paint||{};for(var m in l)Y(l[m],v[m])||t.setPaintProperty(e,m,l[m]);for(var g in v)l.hasOwnProperty(g)||t.setPaintProperty(e,g,void 0)}Y(c,r.filter)||t.setFilter(e,c),u===r.minzoom&&s===r.maxzoom||t.setLayerZoomRange(e,u,s)}}(e,o,t,n.current)}catch(i){console.warn(i)}else!function(t,e,n){if(t.style&&t.style._loaded&&(!("source"in n)||t.getSource(n.source))){var r=K(K({},n),{},{id:e});delete r.beforeId,t.addLayer(r,n.beforeId)}}(e,o,t);return n.current=t,null}function re(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function oe(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ie(t[0])||!ie(t[1]))throw new Error("coordinates must contain numbers");return re({type:"Point",coordinates:t},e,n)}function ie(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function ae(t,e,n){if(null!==t)for(var r,o,i,a,l,c,u,s,d=0,f=0,p=t.type,h="FeatureCollection"===p,v="Feature"===p,m=h?t.features.length:1,g=0;g<m;g++){l=(s=!!(u=h?t.features[g].geometry:v?t.geometry:t)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var y=0;y<l;y++){var b=0,x=0;if(null!==(a=s?u.geometries[y]:u)){c=a.coordinates;var w=a.type;switch(d=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(c,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(!1===e(c[r],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(o=0;o<c[r].length-d;o++){if(!1===e(c[r][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for(x=0,o=0;o<c[r].length;o++){for(i=0;i<c[r][o].length-d;i++){if(!1===e(c[r][o][i],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===ae(a.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function le(t){var e=[1/0,1/0,-1/0,-1/0];return ae(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}le.default=le;var ce=/^\s+|\s+$/g,ue=/^[-+]0x[0-9a-f]+$/i,se=/^0b[01]+$/i,de=/^0o[0-7]+$/i,fe=parseInt,pe="object"==H(wt)&&wt&&wt.Object===Object&&wt,he="object"==("undefined"==typeof self?"undefined":H(self))&&self&&self.Object===Object&&self,ve=pe||he||Function("return this")(),me=Object.prototype.toString,ge=Math.max,ye=Math.min,be=function(){return ve.Date.now()};function xe(t){var e=H(t);return!!t&&("object"==e||"function"==e)}function we(t){return"symbol"==H(t)||function(t){return!!t&&"object"==H(t)}(t)&&"[object Symbol]"==me.call(t)}function Ce(t){if("number"==typeof t)return t;if(we(t))return NaN;if(xe(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=xe(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(ce,"");var n=se.test(t);return n||de.test(t)?fe(t.slice(2),n?2:8):ue.test(t)?NaN:+t}var Se=function(t,e,n){var r,o,i,a,l,c,u=0,s=!1,d=!1,f=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var n=r,i=o;return r=o=void 0,u=e,a=t.apply(i,n)}function h(t){return u=t,l=setTimeout(m,e),s?p(t):a}function v(t){var n=t-c;return void 0===c||n>=e||n<0||d&&t-u>=i}function m(){var t=be();if(v(t))return g(t);l=setTimeout(m,function(t){var n=e-(t-c);return d?ye(n,i-(t-u)):n}(t))}function g(t){return l=void 0,f&&r?p(t):(r=o=void 0,a)}function y(){var t=be(),n=v(t);if(r=arguments,o=this,c=t,n){if(void 0===l)return h(c);if(d)return l=setTimeout(m,e),p(c)}return void 0===l&&(l=setTimeout(m,e)),a}return e=Ce(e)||0,xe(n)&&(s=!!n.leading,i=(d="maxWait"in n)?ge(Ce(n.maxWait)||0,e):i,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==l&&clearTimeout(l),u=0,r=c=o=l=void 0},y.flush=function(){return void 0===l?a:g(be())},y},Me=function(){var t=U(gt.exports.useState(!1),2),e=t[0],n=t[1];return gt.exports.useLayoutEffect((function(){var t=function(){n(window.innerWidth<yt.screenSizes.tablet)};return window.addEventListener("resize",Se(t,250)),t(),function(){return window.removeEventListener("resize",t)}}),[]),e};function ke(){var t,e=Ct().client,n=St().sdkState,r=Mt(n.options,250),o=Kt().activeScore,i=o?kt[o]:void 0,a=K(K({},gt.exports.useMemo((function(){return!(null==r||!r.marker)?r.marker:{lat:null==r?void 0:r.lat,lng:null==r?void 0:r.lng}}),[r])),{},{limit:10,radius:2e3,include:i});return $(Q.list(a),F(G().mark((function t(){return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getPois(a));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!(a&&null!==(t=a.include)&&void 0!==t&&t.length&&a.lat&&a.lng)})}function Le(){var t=Ct().client,e=St().sdkState,n=Mt(e.options,250),r=Kt().activeScore,o="high_schools"===r||"primary_schools"===r,i=K(K({},gt.exports.useMemo((function(){return!(null==n||!n.marker)?n.marker:{lat:null==n?void 0:n.lat,lng:null==n?void 0:n.lng}}),[n])),{},{limit:10,radius:2e3});return $(X.list(i),F(G().mark((function e(){return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.getSchools(i));case 1:case"end":return e.stop()}}),e)}))),{enabled:!!i&&!!i.lat&&!!i.lng&&o})}var Pe=mt.createContext({}),Oe=function(){return gt.exports.useContext(Pe)},Ee=function(t){var e=t.children,n=t.mapRef,r=t.mapPadding;return bt(Pe.Provider,{value:{mapRef:n,mapPadding:r},children:e})};function Ie(t,e,n,r,o,i){if(!(o-r<=n)){var a=r+o>>1;je(t,e,a,r,o,i%2),Ie(t,e,n,r,a-1,i+1),Ie(t,e,n,a+1,o,i+1)}}function je(t,e,n,r,o,i){for(;o>r;){if(o-r>600){var a=o-r+1,l=n-r+1,c=Math.log(a),u=.5*Math.exp(2*c/3),s=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);je(t,e,n,Math.max(r,Math.floor(n-l*u/a+s)),Math.min(o,Math.floor(n+(a-l)*u/a+s)),i)}var d=e[2*n+i],f=r,p=o;for(_e(t,e,r,n),e[2*o+i]>d&&_e(t,e,r,o);f<p;){for(_e(t,e,f,p),f++,p--;e[2*f+i]<d;)f++;for(;e[2*p+i]>d;)p--}e[2*r+i]===d?_e(t,e,r,p):_e(t,e,++p,o),p<=n&&(r=p+1),n<=p&&(o=p-1)}}function _e(t,e,n,r){Ae(t,n,r),Ae(e,2*n,2*r),Ae(e,2*n+1,2*r+1)}function Ae(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ze(t,e,n,r){var o=t-n,i=e-r;return o*o+i*i}var Te,Re=function(t){return t[0]},Ne=function(t){return t[1]},De=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Re,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ne,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Float64Array;N(this,t),this.nodeSize=o,this.points=e;for(var a=e.length<65536?Uint16Array:Uint32Array,l=this.ids=new a(e.length),c=this.coords=new i(2*e.length),u=0;u<e.length;u++)l[u]=u,c[2*u]=n(e[u]),c[2*u+1]=r(e[u]);Ie(l,c,o,0,l.length-1,0)}return Z(t,[{key:"range",value:function(t,e,n,r){return function(t,e,n,r,o,i,a){for(var l,c,u=[0,t.length-1,0],s=[];u.length;){var d=u.pop(),f=u.pop(),p=u.pop();if(f-p<=a)for(var h=p;h<=f;h++)l=e[2*h],c=e[2*h+1],l>=n&&l<=o&&c>=r&&c<=i&&s.push(t[h]);else{var v=Math.floor((p+f)/2);l=e[2*v],c=e[2*v+1],l>=n&&l<=o&&c>=r&&c<=i&&s.push(t[v]);var m=(d+1)%2;(0===d?n<=l:r<=c)&&(u.push(p),u.push(v-1),u.push(m)),(0===d?o>=l:i>=c)&&(u.push(v+1),u.push(f),u.push(m))}}return s}(this.ids,this.coords,t,e,n,r,this.nodeSize)}},{key:"within",value:function(t,e,n){return function(t,e,n,r,o,i){for(var a=[0,t.length-1,0],l=[],c=o*o;a.length;){var u=a.pop(),s=a.pop(),d=a.pop();if(s-d<=i)for(var f=d;f<=s;f++)ze(e[2*f],e[2*f+1],n,r)<=c&&l.push(t[f]);else{var p=Math.floor((d+s)/2),h=e[2*p],v=e[2*p+1];ze(h,v,n,r)<=c&&l.push(t[p]);var m=(u+1)%2;(0===u?n-o<=h:r-o<=v)&&(a.push(d),a.push(p-1),a.push(m)),(0===u?n+o>=h:r+o>=v)&&(a.push(p+1),a.push(s),a.push(m))}}return l}(this.ids,this.coords,t,e,n,this.nodeSize)}}]),t}(),Ze={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},Ge=Math.fround||(Te=new Float32Array(1),function(t){return Te[0]=+t,Te[0]}),Ve=function(){function t(e){N(this,t),this.options=Ke(Object.create(Ze),e),this.trees=new Array(this.options.maxZoom+1)}return Z(t,[{key:"load",value:function(t){var e=this.options,n=e.log,r=e.minZoom,o=e.maxZoom,i=e.nodeSize;n&&console.time("total time");var a="prepare ".concat(t.length," points");n&&console.time(a),this.points=t;for(var l=[],c=0;c<t.length;c++)t[c].geometry&&l.push(He(t[c],c));this.trees[o+1]=new De(l,qe,Qe,i,Float32Array),n&&console.timeEnd(a);for(var u=o;u>=r;u--){var s=+Date.now();l=this._cluster(l,u),this.trees[u]=new De(l,qe,Qe,i,Float32Array),n&&console.log("z%d: %d clusters in %dms",u,l.length,+Date.now()-s)}return n&&console.timeEnd("total time"),this}},{key:"getClusters",value:function(t,e){var n=((t[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[1])),o=180===t[2]?180:((t[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,o=180;else if(n>o){var a=this.getClusters([n,r,180,i],e),l=this.getClusters([-180,r,o,i],e);return a.concat(l)}var c,u=this.trees[this._limitZoom(e)],s=[],d=B(u.range(We(n),Ye(i),We(o),Ye(r)));try{for(d.s();!(c=d.n()).done;){var f=c.value,p=u.points[f];s.push(p.numPoints?Be(p):this.points[p.index])}}catch(h){d.e(h)}finally{d.f()}return s}},{key:"getChildren",value:function(t){var e=this._getOriginId(t),n=this._getOriginZoom(t),r="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(r);var i=o.points[e];if(!i)throw new Error(r);var a,l=this.options.radius/(this.options.extent*Math.pow(2,n-1)),c=[],u=B(o.within(i.x,i.y,l));try{for(u.s();!(a=u.n()).done;){var s=a.value,d=o.points[s];d.parentId===t&&c.push(d.numPoints?Be(d):this.points[d.index])}}catch(f){u.e(f)}finally{u.f()}if(0===c.length)throw new Error(r);return c}},{key:"getLeaves",value:function(t,e,n){e=e||10,n=n||0;var r=[];return this._appendLeaves(r,t,e,n,0),r}},{key:"getTile",value:function(t,e,n){var r=this.trees[this._limitZoom(t)],o=Math.pow(2,t),i=this.options,a=i.extent,l=i.radius/a,c=(n-l)/o,u=(n+1+l)/o,s={features:[]};return this._addTileFeatures(r.range((e-l)/o,c,(e+1+l)/o,u),r.points,e,n,o,s),0===e&&this._addTileFeatures(r.range(1-l/o,c,1,u),r.points,o,n,o,s),e===o-1&&this._addTileFeatures(r.range(0,c,l/o,u),r.points,-1,n,o,s),s.features.length?s:null}},{key:"getClusterExpansionZoom",value:function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var n=this.getChildren(t);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e}},{key:"_appendLeaves",value:function(t,e,n,r,o){var i,a=B(this.getChildren(e));try{for(a.s();!(i=a.n()).done;){var l=i.value,c=l.properties;if(c&&c.cluster?o+c.point_count<=r?o+=c.point_count:o=this._appendLeaves(t,c.cluster_id,n,r,o):o<r?o++:t.push(l),t.length===n)break}}catch(u){a.e(u)}finally{a.f()}return o}},{key:"_addTileFeatures",value:function(t,e,n,r,o,i){var a,l=B(t);try{for(l.s();!(a=l.n()).done;){var c=e[a.value],u=c.numPoints,s=void 0,d=void 0,f=void 0;if(u)s=Ue(c),d=c.x,f=c.y;else{var p=this.points[c.index];s=p.properties,d=We(p.geometry.coordinates[0]),f=Ye(p.geometry.coordinates[1])}var h={type:1,geometry:[[Math.round(this.options.extent*(d*o-n)),Math.round(this.options.extent*(f*o-r))]],tags:s},v=void 0;u?v=c.id:this.options.generateId?v=c.index:this.points[c.index].id&&(v=this.points[c.index].id),void 0!==v&&(h.id=v),i.features.push(h)}}catch(m){l.e(m)}finally{l.f()}}},{key:"_limitZoom",value:function(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}},{key:"_cluster",value:function(t,e){for(var n=[],r=this.options,o=r.radius,i=r.extent,a=r.reduce,l=r.minPoints,c=o/(i*Math.pow(2,e)),u=0;u<t.length;u++){var s=t[u];if(!(s.zoom<=e)){s.zoom=e;var d,f=this.trees[e+1],p=f.within(s.x,s.y,c),h=s.numPoints||1,v=h,m=B(p);try{for(m.s();!(d=m.n()).done;){var g=d.value,y=f.points[g];y.zoom>e&&(v+=y.numPoints||1)}}catch(_){m.e(_)}finally{m.f()}if(v>h&&v>=l){var b,x=s.x*h,w=s.y*h,C=a&&h>1?this._map(s,!0):null,S=(u<<5)+(e+1)+this.points.length,M=B(p);try{for(M.s();!(b=M.n()).done;){var k=b.value,L=f.points[k];if(!(L.zoom<=e)){L.zoom=e;var P=L.numPoints||1;x+=L.x*P,w+=L.y*P,L.parentId=S,a&&(C||(C=this._map(s,!0)),a(C,this._map(L)))}}}catch(_){M.e(_)}finally{M.f()}s.parentId=S,n.push(Fe(x/v,w/v,S,v,C))}else if(n.push(s),v>1){var O,E=B(p);try{for(E.s();!(O=E.n()).done;){var I=O.value,j=f.points[I];j.zoom<=e||(j.zoom=e,n.push(j))}}catch(_){E.e(_)}finally{E.f()}}}}return n}},{key:"_getOriginId",value:function(t){return t-this.points.length>>5}},{key:"_getOriginZoom",value:function(t){return(t-this.points.length)%32}},{key:"_map",value:function(t,e){if(t.numPoints)return e?Ke({},t.properties):t.properties;var n=this.points[t.index].properties,r=this.options.map(n);return e&&r===n?Ke({},r):r}}]),t}();function Fe(t,e,n,r,o){return{x:Ge(t),y:Ge(e),zoom:1/0,id:n,parentId:-1,numPoints:r,properties:o}}function He(t,e){var n=U(t.geometry.coordinates,2),r=n[0],o=n[1];return{x:Ge(We(r)),y:Ge(Ye(o)),zoom:1/0,index:e,parentId:-1}}function Be(t){return{type:"Feature",id:t.id,properties:Ue(t),geometry:{type:"Point",coordinates:[(e=t.x,360*(e-.5)),$e(t.y)]}};var e}function Ue(t){var e=t.numPoints,n=e>=1e4?"".concat(Math.round(e/1e3),"k"):e>=1e3?"".concat(Math.round(e/100)/10,"k"):e;return Ke(Ke({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function We(t){return t/360+.5}function Ye(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function $e(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function Ke(t,e){for(var n in e)t[n]=e[n];return t}function qe(t){return t.x}function Qe(t){return t.y}var Xe=Object.prototype.hasOwnProperty;function Je(t,e,n){var r,o=B(t.keys());try{for(o.s();!(r=o.n()).done;)if(tn(n=r.value,e))return n}catch(i){o.e(i)}finally{o.f()}}function tn(t,e){var n,r,o;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&tn(t[r],e[r]););return-1===r}if(n===Set){if(t.size!==e.size)return!1;var i,a=B(t);try{for(a.s();!(i=a.n()).done;){if((o=r=i.value)&&"object"===H(o)&&!(o=Je(e,o)))return!1;if(!e.has(o))return!1}}catch(u){a.e(u)}finally{a.f()}return!0}if(n===Map){if(t.size!==e.size)return!1;var l,c=B(t);try{for(c.s();!(l=c.n()).done;){if((o=(r=l.value)[0])&&"object"===H(o)&&!(o=Je(e,o)))return!1;if(!tn(r[1],e.get(o)))return!1}}catch(u){c.e(u)}finally{c.f()}return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return-1===r}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return-1===r}if(!n||"object"===H(t)){for(n in r=0,t){if(Xe.call(t,n)&&++r&&!Xe.call(e,n))return!1;if(!(n in e)||!tn(t[n],e[n]))return!1}return Object.keys(e).length===r}}return t!=t&&e!=e}function en(t,e){return gt.exports.useEffect(t,(n=e,r=gt.exports.useRef(n),o=gt.exports.useRef(0),tn(n,r.current)||(r.current=n,o.current+=1),gt.exports.useMemo((function(){return r.current}),[o.current])));var n,r,o}var nn=Lt.div(t||(t=R(["\n border-radius: 50%;\n background: linear-gradient(\n to top,\n ",",\n ","\n );\n color: ",";\n height: ","px;\n width: ","px;\n display: flex;\n justify-content: center;\n align-items: center;\n line-height: 1;\n font-family: ",";\n font-size: ","px;\n border: 2px solid #fff;\n box-shadow: ",";\n cursor: default;\n"])),Pt["--ll-color-primary-variant1"],Pt["--ll-color-primary"],Pt["--ll-color-on-primary"],(function(t){return t.diameter}),(function(t){return t.diameter}),Pt["--ll-font-family"],(function(t){return t.diameter/2.5}),Pt["--ll-shadow-small"]),rn=function(t){var e=t.cluster,n=t.pointsCount,r=t.onClick,o=e.properties.point_count;return bt(nn,{diameter:20+o/n*25,onClick:function(){return r&&r(e)},children:e.properties.point_count})};var on=mt.memo((function(t){var e,n=t.rect,r=t.zoom,o=t.mapRef,i=t.points,a=t.isMobile,l=t.activePOI,c=t.hoveredPOI,u=t.isMapMoving,s=t.setActivePOI,d=null==o||null===(e=o.current)||void 0===e?void 0:e.getMap().getBounds().toArray().flat(),f=function(t){var e=t.points,n=t.bounds,r=t.zoom,o=t.options,i=gt.exports.useRef(),a=gt.exports.useRef(),l=gt.exports.useState([]),c=l[0],u=l[1],s=Math.round(r);return en((function(){i.current&&tn(a.current,e)&&tn(i.current.options,o)||(i.current=new Ve(o),i.current.load(e)),n&&u(i.current.getClusters(n,s)),a.current=e}),[e,n,s,o]),{clusters:c,supercluster:i.current}}({points:i,bounds:d,zoom:r,options:{radius:50,maxZoom:18}}),p=f.clusters,h=f.supercluster;return bt(Ot,{children:p.map((function(t,e){var r=U(t.geometry.coordinates,2),d=r[0],f=r[1];if(function(t){return void 0!==t.properties.cluster}(t))return bt(J,{latitude:f,longitude:d,children:bt(rn,{cluster:t,pointsCount:i.length,onClick:function(){var e,n=Math.min(h.getClusterExpansionZoom(t.id),20);null===(e=o.current)||void 0===e||e.flyTo({zoom:n,center:[d,f],duration:1e3,essential:!0})}})},"cluster-".concat(t.id));var p=t.properties,v=p.poi,m=p.type,g=l===v,y=c===v;return bt(J,{latitude:v.lat,longitude:v.lng,style:{zIndex:g?1:0},children:Et(It.Root,{options:{type:m,poi:v,isOpen:!u&&g,isHovered:y,side:"top",size:["rapid_transit_stations"].includes(m)?"medium":"small",collisionPadding:a?{top:n.height+32,bottom:2*jt,left:2*jt,right:2*jt}:{left:n.width+32,right:2*jt,top:2*jt,bottom:2*jt}},onChange:function(t){"open-change"===t.type&&(t.data?setTimeout((function(){s(v)}),0):g&&s(void 0))},children:[bt(It.Marker,{}),bt(It.Content,{})]})},"".concat(v.name,"-").concat(v.lat,"-").concat(v.lng,"-").concat(e))}))})}));on.displayName="Markers";var an=function(t){return gt.exports.createElement("svg",K({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),gt.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"}))},ln=function(t){return gt.exports.createElement("svg",K({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),gt.exports.createElement("path",{d:"M10 20V14H14V20H19V12H22L12 3L2 12H5V20H10Z"}))};function cn(t){var e=Ct().client,n=St().sdkState,r=Mt(n.options,250),o=K(K({},gt.exports.useMemo((function(){return!(null==r||!r.marker)?r.marker:{lat:null==r?void 0:r.lat,lng:null==r?void 0:r.lng}}),[r])),{},{geographyLevels:["20","30"],locationScoresRounding:!1,include:t});return $(tt.list(o),F(G().mark((function t(){return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getScores(o));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!o})}var un=Lt.div(e||(e=R(["\n padding: "," ",";\n background-color: ",";\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex: 1;\n"])),Pt["--ll-spacing-small"],Pt["--ll-spacing-medium"],Pt["--ll-color-surface"]),sn=Lt.div(n||(n=R(["\n display: grid;\n grid-template-columns: min-content 1fr;\n grid-gap: ",";\n margin-bottom: ",";\n"])),Pt["--ll-spacing-medium"],Pt["--ll-spacing-medium"]),dn=function(){var t,e,n=St().sdkState,r=Kt(),o=r.activeCategory,i=r.activeScore,a=cn(xt.find((function(t){return t.value===o})).scores),l=a.data,c=a.isLoading;return i&&null!=l&&l.location[i]?c?bt("div",{children:"Loading"}):bt(_t.Root,{options:{score:i,scoresData:l},children:Et(un,{children:[Et(sn,{children:[bt(_t.Badge,{}),bt(_t.BarChart,{options:{locationIcon:"pin"===(null===(t=n.options)||void 0===t||null===(e=t.marker)||void 0===e?void 0:e.icon)?an:ln}})]}),bt(_t.Description,{})]})}):null},fn=Lt.div(r||(r=R(["\n display: flex;\n overflow-x: scroll;\n padding: "," ",";\n flex-shrink: 0;\n position: relative;\n"])),Pt["--ll-spacing-x-small"],Pt["--ll-spacing-medium"]),pn=Lt.button(o||(o=R(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n background: none;\n border: none;\n min-width: 60px;\n padding: 0;\n margin: 0 8px;\n flex-shrink: 0;\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n margin-right: 0;\n }\n"]))),hn=Lt.div(i||(i=R(["\n position: absolute;\n top: -6px;\n right: 4px;\n border: 2px solid ",";\n border-radius: 6px;\n"])),Pt["--ll-color-background"]),vn=Lt.div(a||(a=R(["\n flex: 1;\n display: flex;\n align-items: center;\n"]))),mn=Lt.div(l||(l=R(["\n margin: 0 2px;\n"]))),gn=function(t){var e=t.category,n=cn(e.scores),r=n.data,o=n.isLoading,i=n.isFetching,a=Kt(),l=a.activeScore,c=a.setActiveScore,u=a.setActiveCategory;return bt(fn,{children:e.scores.map((function(t){var n=t===l,a=n?"--ll-color-primary":"--ll-color-disabled";return o||i?bt(mn,{children:bt(At,{height:"44px",width:"60px"})},t):bt(_t.Root,{options:{score:t,scoresData:r},children:Et(pn,{onClick:function(){u(e.value),c(t)},children:[bt(_t.Icon,{options:{color:a,height:28,width:28}}),bt(vn,{children:bt(_t.Title,{options:{variant:"caption1",color:a,noWrap:!0,noMargin:!0,weight:"--ll-font-weight-bold"}})}),bt(hn,{children:bt(_t.Badge,{options:{variant:"small",isPrimary:n}})})]})},t)}))})},yn=Lt.div(c||(c=R(["\n display: flex;\n padding: "," ","\n "," ",";\n"])),Pt["--ll-spacing-x-small"],Pt["--ll-spacing-medium"],Pt["--ll-spacing-xx-small"],Pt["--ll-spacing-medium"]),bn=Lt.div(u||(u=R(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 3;\n box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background-color: ",";\n border: 1px solid ",";\n"])),Pt["--ll-color-background"],Pt["--ll-color-border"]),xn=mt.forwardRef((function(t,e){var n=Kt(),r=n.activeCategory,o=n.setActiveCategory;return Et(bn,{ref:e,children:[bt(yn,{children:Et(zt.Root,{value:r,onValueChange:function(t){return o(t)},children:[bt(zt.Trigger,{size:"large",children:bt(Tt.Root,{options:{scoreCategory:r},children:bt(Tt.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},r)}),bt(zt.Content,{children:xt.map((function(t){return bt(Tt.Root,{options:{scoreCategory:t.value},children:bt(zt.Item,{value:t.value,children:bt(Tt.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},t.value)}))})]})}),bt(gn,{category:xt.find((function(t){return t.value===r}))}),bt(dn,{})]})}));xn.displayName="MobileScores";var wn=Rt({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Cn=Rt({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Sn=Lt(et)(s||(s=R(["\n margin: 0;\n z-index: 1;\n position: relative;\n margin: 0 calc(-1 * ",");\n padding: 0 ",";\n\n &:hover {\n background-color: ",";\n box-shadow: ",";\n }\n"])),Pt["--ll-spacing-medium"],Pt["--ll-spacing-medium"],Pt["--ll-color-surface"],Pt["--ll-shadow-small"]),Mn=Lt(nt)(d||(d=R(["\n background: none;\n border: none;\n display: flex;\n align-items: center;\n width: 100%;\n padding: "," 0;\n"])),Pt["--ll-spacing-x-small"]),kn=Lt(rt)(f||(f=R(["\n background-color: ",";\n position: relative;\n overflow: hidden;\n margin-left: calc(-1 * ",");\n margin-right: calc(-1 * ",');\n\n [data-state="open"] & {\n animation: ',' 300ms cubic-bezier(0.87, 0, 0.13, 1);\n }\n\n [data-state="closed"] & {\n animation: '," 300ms cubic-bezier(0.87, 0, 0.13, 1);\n }\n"])),Pt["--ll-color-surface"],Pt["--ll-spacing-medium"],Pt["--ll-spacing-medium"],wn,Cn),Ln=Lt.div(p||(p=R(["\n padding: ",";\n border-top: 1px solid ",";\n border-bottom: 1px solid ",";\n"])),Pt["--ll-spacing-medium"],Pt["--ll-color-border"],Pt["--ll-color-border"]),Pn=Lt.span(h||(h=R(["\n ","[data-state=open] & {\n transform: rotate(90deg);\n } ;\n"])),Mn);Lt.div(v||(v=R(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n"])));var On=Lt.div(m||(m=R(["\n margin: "," 0;\n"])),Pt["--ll-spacing-small"]),En=Lt.div(g||(g=R(["\n margin-top: ",";\n &:empty {\n margin: 0;\n }\n"])),Pt["--ll-spacing-large"]),In=function(t){var e=t.score,n=Le(),r=n.data,o=n.isLoading,i=Kt(),a=i.activePOI,l=i.setActivePOI,c=i.hoveredPOI,u=i.setHoveredPOI,s=Oe(),d=s.mapRef,f=s.mapPadding;return o?bt(Ot,{children:T(Array(10)).map((function(t,e){return bt(On,{children:bt(At,{height:"34px",width:"100%"})},e)}))}):r?bt(Nt.Root,{options:{type:"school",data:null==r?void 0:r[e],activePOI:a,hoveredPOI:c},onChange:function(t){if("poi-click"===t.type){var e=t.data;l(e);var n,r=window.innerWidth-f.left,o=window.innerWidth/2,i=r/2+f.left-o;if(e)null===(n=d.current)||void 0===n||n.easeTo({zoom:18,center:[e.lng,e.lat],duration:1e3,offset:[i,0]})}"poi-hover"===t.type&&u(t.data)}}):null},jn=mt.memo((function(t){var e=t.result,n=t.poi,r=Kt(),o=r.activePOI,i=r.setActivePOI,a=r.hoveredPOI,l=r.setHoveredPOI,c=Oe(),u=c.mapRef,s=c.mapPadding;return e.data&&e.data[n]?bt(Dt.Content,{options:{value:n},children:bt(Nt.Root,{options:{type:"poi",data:e.data[n],activePOI:o,hoveredPOI:a},onChange:function(t){if("poi-click"===t.type){var e=t.data;i(e);var n,r=window.innerWidth-s.left,o=window.innerWidth/2,a=r/2+s.left-o;if(e)null===(n=u.current)||void 0===n||n.flyTo({zoom:18,center:[e.lng,e.lat],duration:1e3,offset:[a,0],essential:!0})}"poi-hover"===t.type&&l(t.data)}})},n):null}));jn.displayName="POI";var _n=mt.memo((function(t){var e=t.include,n=ke(),r=null==e?void 0:e.filter((function(t){var e;return((null==n||null===(e=n.data)||void 0===e?void 0:e[t])||[]).length>0}));return n.isLoading&&r.length?bt(Ot,{children:T(Array(10)).map((function(t,e){return bt(On,{children:bt(At,{height:"34px",width:"100%"})},e)}))}):n.data?Et(Dt.Root,{options:{include:r},children:[bt(Dt.Tabs,{}),r.map((function(t){return bt(jn,{poi:t,result:n},t)}))]}):null}));_n.displayName="POIs";var An=mt.memo((function(t){var e,n,r=t.score,o=t.isLoading,i=t.scoresData,a=St().sdkState,l=r===Kt().activeScore;return o?bt(On,{children:bt(At,{height:"34px",width:"100%"},r)}):null!=i&&i.location[r]?bt(ot,{value:r,children:Et(_t.Root,{options:{score:r,scoresData:i},children:[bt(Sn,{children:Et(Mn,{children:[bt(Pn,{children:bt(Zt,{SVGElement:it,fill:Pt["--ll-color-on-background-variant1"]})}),bt(Gt,{spacing:"--ll-spacing-small"}),bt(_t.Icon,{}),bt(Gt,{spacing:"--ll-spacing-small"}),bt(_t.Title,{}),bt(Gt,{}),bt(_t.Badge,{options:{isPrimary:l}})]})}),bt(kn,{children:Et(Ln,{children:[bt(_t.Description,{}),bt(Gt,{vertical:!0,spacing:"--ll-spacing-small"}),bt(_t.BarChart,{options:{locationIcon:"pin"===(null===(e=a.options)||void 0===e||null===(n=e.marker)||void 0===n?void 0:n.icon)?an:ln}}),bt(En,{children:"high_schools"===r||"primary_schools"===r?bt(In,{score:r}):bt(_n,{include:kt[r]})})]})})]})},r):null}));An.displayName="Score";var zn=Lt.div(y||(y=R(["\n padding: "," ",";\n"])),Pt["--ll-spacing-small"],Pt["--ll-spacing-medium"]),Tn=Lt.div(b||(b=R(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]))),Rn=mt.memo((function(t){var e=t.tabContent,n=cn(e.scores),r=n.data,o=n.isLoading,i=n.isFetching,a=Vt().translations;return Et(zn,{children:[Et(Tn,{children:[bt(Ft.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),i&&!o&&bt(Ht,{size:"small"})]}),bt(Gt,{spacing:"--ll-spacing-small",vertical:!0}),!i&&!Object.keys((null==r?void 0:r.location)||{}).length&&bt(Bt,{color:"--ll-color-on-background-variant1",children:a.EMPTY_TEXT}),e.scores.map((function(t){return bt(An,{score:t,isLoading:o,scoresData:r},t)}))]})}));Rn.displayName="ScoreCategory";var Nn=mt.memo((function(t){var e=t.tabContent,n=Kt(),r=n.activeScore,o=n.setActiveScore;return gt.exports.useEffect((function(){o(e.scores[0])}),[]),bt(at,{value:r,onValueChange:function(t){o(t)},type:"single",collapsible:!0,children:bt(Rn,{tabContent:e})})}));Nn.displayName="ScoreCategoryAccordion";var Dn=Lt.div(x||(x=R(["\n overflow-y: auto;\n"]))),Zn=Lt.div(w||(w=R(["\n position: absolute;\n top: ",";\n left: ",";\n width: 360px;\n max-height: calc(100% - 2 * ",");\n z-index: 1;\n border-radius: ",";\n box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;\n background-color: #fff;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background-color: ",";\n border: 1px solid ",";\n"])),Pt["--ll-spacing-medium"],Pt["--ll-spacing-medium"],Pt["--ll-spacing-medium"],Pt["--ll-border-radius-medium"],Pt["--ll-color-background"],Pt["--ll-color-border"]);Lt.div(C||(C=R(["\n display: flex;\n justify-content: center;\n padding: ",";\n"])),Pt["--ll-spacing-small"]);var Gn=Lt.div(S||(S=R(["\n padding: ",";\n border-bottom: 1px solid ",";\n"])),Pt["--ll-spacing-xx-small"],Pt["--ll-color-border"]),Vn=Lt.div(M||(M=R(["\n display: flex;\n justify-content: center;\n padding: ",";\n background-color: ",";\n"])),Pt["--ll-spacing-small"],Pt["--ll-color-background"]),Fn=function(){return bt(Vn,{children:bt(Ut.Root,{})})},Hn=mt.forwardRef((function(t,e){var n=Kt(),r=n.activeCategory,o=n.setActiveCategory;return bt(Ft.Root,{options:{currentTab:r},onChange:function(t){o(t.data)},children:Et(Zn,{ref:e,children:[bt(Gn,{children:bt(Ft.Tabs,{})}),bt(Dn,{children:xt.map((function(t){return bt(Ft.Content,{options:{value:t.value},children:bt(Nn,{tabContent:t},t.value)},t.value)}))}),bt(Fn,{})]})})}));Hn.displayName="DesktopScores";var Bn=Lt.div(k||(k=R(["\n position: relative;\n display: flex;\n flex-direction: column;\n height: 100vh;\n"]))),Un=function(t){return gt.exports.createElement("svg",K({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),gt.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"}))},Wn=function(t){return gt.exports.createElement("svg",K({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),gt.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"}),gt.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"}),gt.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"}))},Yn=function(t){return gt.exports.createElement("svg",K({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),gt.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"}))},$n=function(t){return gt.exports.createElement("svg",K({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),gt.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"}))},Kn={all:function(){return["commute-calc"]},list:function(t){return[].concat(T(Kn.all()),[t])}};var qn=function(t,e,n){return 1===e?t:null!=n?n:"".concat(t,"s")},Qn=[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],Xn="undefined"!=typeof BigInt?BigInt:Number;function Jn(t){var e=Xn(0),n=Xn(0),r=[];if(t.split("").forEach((function(t){var o=Xn(function(t){var e=t.charCodeAt(0);return Qn[e-45]}(t));e|=(o&Xn(31))<<n,(o&Xn(32))===Xn(0)?(r.push(e),e=Xn(0),n=Xn(0)):n+=Xn(5)})),n>0)throw new Error("Invalid encoding");return r}function tr(t){var e=t;return e&Xn(1)&&(e=~e),+(e>>=Xn(1)).toString()}function er(t){for(var e=Jn(t),n=function(t,e){if(1!=+t.toString())throw new Error("Invalid format version");var n=+e.toString();return{precision:15&n,thirdDim:n>>4&7,thirdDimPrecision:n>>7&15}}(e[0],e[1]),r=Math.pow(10,n.precision),o=Math.pow(10,n.thirdDimPrecision),i=n.thirdDim,a=0,l=0,c=0,u=[],s=2;s<e.length;){if(a+=tr(e[s])/r,l+=tr(e[s+1])/r,i)c+=tr(e[s+2])/o,u.push([l,a,c]),s+=3;else u.push([l,a]),s+=2}if(s!==e.length)throw new Error("Invalid encoding. Premature ending reached");return{type:"FeatureCollection",features:[{id:"route",type:"Feature",geometry:{type:"LineString",coordinates:u}}]}}var nr=Lt.div(L||(L=R(["\n max-height: calc(100% - 2 * ",");\n border-radius: ",";\n box-shadow: ",";\n background-color: ",";\n border: 1px solid ",";\n padding: ",";\n"])),Pt["--ll-spacing-medium"],Pt["--ll-border-radius-medium"],Pt["--ll-shadow-small"],Pt["--ll-color-background"],Pt["--ll-color-border"],Pt["--ll-spacing-x-small"]),rr=Lt.div(P||(P=R(["\n display: flex;\n justify-content: space-between;\n align-items: end;\n\n "," {\n width: 229px;\n margin-right: ",";\n }\n"])),lt,Pt["--ll-spacing-x-small"]),or=Lt.div(O||(O=R(["\n background-color: ",";\n padding: "," "," 0;\n border-radius: ",";\n"])),Pt["--ll-color-surface"],Pt["--ll-spacing-x-small"],Pt["--ll-spacing-small"],Pt["--ll-border-radius-medium"]),ir=Lt(Yt)(E||(E=R(["\n position: absolute;\n right: ",";\n top: ",";\n"])),Pt["--ll-spacing-xx-small"],Pt["--ll-spacing-xx-small"]),ar=function(t){var e,n,r,o,i=t.className,a=t.onClose,l=St().sdkState,c=Kt(),u=c.setCommuteGeojson,s=c.destination,d=c.setDestination,f=U(gt.exports.useState("pedestrian"),2),p=f[0],h=f[1],v=Me(),m=Vt().translations,g=function(t){var e=t.transportMode,n=t.origin,r=t.destination,o={return:"polyline,summary,typicalDuration",transportMode:e,origin:n,destination:"".concat(null==r?void 0:r.lat,",").concat(null==r?void 0:r.lng),apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE"};return $(Kn.list(o),(function(){return fetch("https://router.hereapi.com/v8/routes?"+new URLSearchParams(o)).then((function(t){return t.json()})).then((function(t){return t.routes.length>0&&t.routes[0].sections.length>0?t.routes[0].sections[0]:[]})).catch((function(t){Wt(t)}))}),{enabled:!!o&&!!r&&!!n})}({destination:s,transportMode:p,origin:"".concat(null==l||null===(e=l.options)||void 0===e||null===(n=e.marker)||void 0===n?void 0:n.lat,",").concat(null==l||null===(r=l.options)||void 0===r||null===(o=r.marker)||void 0===o?void 0:o.lng)}),y=g.data,b=g.isFetching,x=g.isFetched;gt.exports.useEffect((function(){null!=y&&y.summary&&u(er(y.polyline))}),[y]);var w={pedestrian:[m.WALKING,Yn],car:[m.DRIVING,Wn]},C=gt.exports.useMemo((function(){if(null==y||!y.summary)return null;var t=Math.floor(y.summary.typicalDuration/60/60),e=Math.floor(y.summary.typicalDuration/60%60);return 0===t?"".concat(e," ").concat(qn(m.MINUTE,e)):"".concat(t," ").concat(qn(m.HOUR,t)," ").concat(e," ").concat(qn(m.MINUTE,e))}),[y]),S=gt.exports.useMemo((function(){if(null==y||!y.summary)return null;var t=Math.floor(y.summary.length/1e3);return 0===t?"".concat(y.summary.length," m"):"".concat(t," km")}),[y]);return Et(nr,{className:i,children:[bt(ir,{size:"medium",color:"neutral",onClick:a,SVGElement:$n}),Et(rr,{children:[bt(ct,{label:m.CALCULATE_COMMUTE,placeholder:m.SEARCH_MAP,renderListBelow:v,renderListBelowPosition:30,onSearch:function(t){d({lat:t.latitude,lng:t.longitude})}}),bt(zt.Root,{value:p,onValueChange:function(t){h(t)},children:Et(zt.Trigger,{children:[bt(Zt,{SVGElement:w[p][1],fill:Pt["--ll-color-on-background-variant1"],width:16}),w[p][0],Et(zt.Content,{children:[bt(zt.Item,{value:"car",children:m.DRIVING}),bt(zt.Item,{value:"pedestrian",children:m.WALKING})]})]})})]}),(x||b)&&Et(Ot,{children:[bt(Gt,{vertical:!0,spacing:"--ll-spacing-x-small"}),bt(ut,{open:!!y,children:b?bt(At,{height:"70.4px",width:"100%"}):null!=y&&y.summary?Et(or,{children:[bt(Bt,{variant:"h5",children:C}),Et(Bt,{children:[S," – ",m.FAST_ROUTE]})]}):Et(or,{children:[bt(Bt,{variant:"h5",children:m.NO_ROUTE}),bt(Bt,{children:m.TRY_SUGGESTION})]})})]})]})},lr=Lt.div(I||(I=R(["\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 3;\n"]))),cr=Lt.div(j||(j=R(["\n position: absolute;\n top: ",";\n right: ",";\n z-index: 3;\n max-width: 356px;\n"])),Pt["--ll-spacing-medium"],Pt["--ll-spacing-medium"]),ur=Lt(Yt)(_||(_=R(["\n box-shadow: ",";\n position: absolute;\n bottom: ",";\n right: ",";\n"])),Pt["--ll-shadow-medium"],Pt["--ll-spacing-medium"],Pt["--ll-spacing-medium"]),sr=Lt(ar)(A||(A=R([""]))),dr=Lt(ar)(z||(z=R(["\n border-radius: ","\n "," 0 0;\n border: 0;\n"])),Pt["--ll-border-radius-small"],Pt["--ll-border-radius-small"]),fr=function(){var t=Kt(),e=t.setCommuteGeojson,n=t.setDestination,r=U(gt.exports.useState(!1),2),o=r[0],i=r[1],a=Vt().translations,l=function(){n(void 0),e(void 0),i(!1)},c=function(){i(!0)};return Me()?bt(Ot,{children:o?bt(lr,{children:bt(dr,{onClose:l})}):bt(ur,{size:"large",SVGElement:Un,onClick:c})}):bt(cr,{children:o?bt(sr,{onClose:l}):bt($t,{onClick:c,startAdornment:bt(Un,{}),children:a.CALCULATE_COMMUTE})})},pr=function(){var t,e,n,r=St(),o=r.sdkState,i=r.setSdkState,a=Kt(),l=a.activeScore,c=a.activePOI,u=a.setActivePOI,s=a.hoveredPOI,d=a.commuteGeojson,f=a.destination,p=Me(),h=ke(),v=Le(),m="night"===(null==o||null===(t=o.globalOptions)||void 0===t||null===(e=t.appearance)||void 0===e?void 0:e.theme)?"dd191599-2a92-49fc-9a33-e12391753ad5":"600d69cb-288d-445e-9839-3dfe4d76b31a",g=U(gt.exports.useState(!1),2),y=g[0],b=g[1],x=gt.exports.useMemo((function(){var t,e;return"high_schools"!==l&&"primary_schools"!==l||v.isFetching?kt&&l&&kt[l]&&null!==(t=kt[l])&&void 0!==t&&t.length||h.isFetching?h.data:q({},l,[]):q({},l,(null==v||null===(e=v.data)||void 0===e?void 0:e[l])||[])}),[h.data,v.data,l]),w=gt.exports.useMemo((function(){return x?Object.entries(x).map((function(t){var e=U(t,2),n=e[0];return e[1].map((function(t){return oe([t.lng,t.lat],{poi:t,type:n})}))})).flat().filter((function(t,e,n){return n.findIndex((function(e){return["lat","lng","name"].every((function(n){return e.properties.poi[n]===t.properties.poi[n]}))}))===e})):[]}),[x]),C=gt.exports.useMemo((function(){var t,e,n,r=(null==o||null===(t=o.options)||void 0===t?void 0:t.marker)&&oe([null==o||null===(e=o.options)||void 0===e?void 0:e.marker.lng,null==o||null===(n=o.options)||void 0===n?void 0:n.marker.lat]);return[].concat(T(w),T(r?[r]:[]),T(f?[oe([null==f?void 0:f.lng,null==f?void 0:f.lat])]:[]))}),[w,null==o||null===(n=o.options)||void 0===n?void 0:n.marker,f]),S=gt.exports.useRef(),M=U(st(),2),k=M[0],L=M[1],P=gt.exports.useMemo((function(){return{top:25+L.height,bottom:25,left:25,right:25}}),[L.height]),O=gt.exports.useMemo((function(){return{top:50,bottom:50,left:L.width+32+50,right:50}}),[L.width]),E=p?P:O;return gt.exports.useEffect((function(){var t,e;if(C.length&&null!==(t=o.options)&&void 0!==t&&t.marker){var n,r,i,a=U(le((n=C.map((function(t){var e=t.geometry;return[e.coordinates[1],e.coordinates[0]]})),void 0===i&&(i={}),re({type:"MultiPoint",coordinates:n},r,i))),4),l=a[0],c=a[1],u=a[2],s=a[3];null==S||null===(e=S.current)||void 0===e||e.fitBounds([[c,l],[s,u]],{maxZoom:17,padding:E,duration:1e3})}}),[C,E]),o.options?bt(Ee,{mapRef:S,mapPadding:E,children:Et(Bn,{children:[Et(dt,{ref:S,mapLib:ft,latitude:o.options.lat,longitude:o.options.lng,zoom:o.options.zoom,pitch:o.options.pitch,bearing:o.options.bearing,style:{flex:1,width:"100vw"},mapStyle:"https://api.maptiler.com/maps/".concat(m,"/style.json?key=","9jNGatuzs05Q1oNlctEs"),onMove:function(t){i(K(K({},o),{},{options:K(K({},o.options),{},{lat:t.viewState.latitude,lng:t.viewState.longitude,zoom:t.viewState.zoom,bearing:t.viewState.bearing,pitch:t.viewState.pitch})}))},cooperativeGestures:o.options.cooperativeGestures,onMoveStart:function(){return b(!0)},onMoveEnd:function(){return b(!1)},attributionControl:!1,children:[bt(pt,{compact:!0,position:p?"bottom-left":"bottom-right"}),bt(ht,{position:p?"top-right":"bottom-right",showCompass:!0,style:{marginTop:p?16+L.height:16,marginRight:16}}),o.options.marker&&bt(vt,{marker:o.options.marker}),bt(on,{rect:L,zoom:o.options.zoom,mapRef:S,points:w,isMobile:p,activePOI:c,hoveredPOI:s,isMapMoving:y,setActivePOI:u}),bt(p?xn:Hn,{ref:k}),bt(fr,{}),f&&bt(vt,{marker:K({icon:"pin"},f)}),d&&bt(te,{type:"geojson",data:d,children:bt(ne,K({},{id:"point",type:"line",paint:{"line-width":6,"line-color":"#0056D3"}}))})]}),p&&bt(Fn,{})]})}):bt("div",{children:"No options provided."})};D("default",(function(){return bt(Qt,{children:bt(pr,{})})}))}}}))}();
@@ -1,4 +1,4 @@
1
- import{D as Mp,E as ih,G as zp,H as rh,J as nh,K as Pp,P as kp,Q as Dp,V as oh,W as Lp,X as Qs,r as ge,Y as Rp,Z as Bp,g as Fp,j as Oi,$ as Sc,d as Op,R as ht,a0 as Up,a1 as Si,a2 as $p,s as ts,a3 as mh,y as bo,a4 as Vp,h as Np,i as Gp,a5 as qp}from"./index.27821d72.js";class Zp extends Mp{constructor(D,R){super(),this.client=D,this.options=R,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(R)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),sh(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return wc(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wc(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(D,R){const N=this.options,G=this.currentQuery;if(this.options=this.client.defaultQueryOptions(D),ih(N,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=N.queryKey),this.updateQuery();const X=this.hasListeners();X&&ah(this.currentQuery,G,this.options,N)&&this.executeFetch(),this.updateResult(R),X&&(this.currentQuery!==G||this.options.enabled!==N.enabled||this.options.staleTime!==N.staleTime)&&this.updateStaleTimeout();const fe=this.computeRefetchInterval();X&&(this.currentQuery!==G||this.options.enabled!==N.enabled||fe!==this.currentRefetchInterval)&&this.updateRefetchInterval(fe)}getOptimisticResult(D){const R=this.client.getQueryCache().build(this.client,D);return this.createResult(R,D)}getCurrentResult(){return this.currentResult}trackResult(D){const R={};return Object.keys(D).forEach(N=>{Object.defineProperty(R,N,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(N),D[N])})}),R}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:D,...R}={}){return this.fetch({...R,meta:{refetchPage:D}})}fetchOptimistic(D){const R=this.client.defaultQueryOptions(D),N=this.client.getQueryCache().build(this.client,R);return N.isFetchingOptimistic=!0,N.fetch().then(()=>this.createResult(N,R))}fetch(D){var R;return this.executeFetch({...D,cancelRefetch:(R=D.cancelRefetch)!=null?R:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(D){this.updateQuery();let R=this.currentQuery.fetch(this.options,D);return D!=null&&D.throwOnError||(R=R.catch(zp)),R}updateStaleTimeout(){if(this.clearStaleTimeout(),rh||this.currentResult.isStale||!nh(this.options.staleTime))return;const R=Pp(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},R)}computeRefetchInterval(){var D;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(D=this.options.refetchInterval)!=null?D:!1}updateRefetchInterval(D){this.clearRefetchInterval(),this.currentRefetchInterval=D,!(rh||this.options.enabled===!1||!nh(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||kp.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(D,R){const N=this.currentQuery,G=this.options,X=this.currentResult,fe=this.currentResultState,a=this.currentResultOptions,ye=D!==N,pe=ye?D.state:this.currentQueryInitialState,Ee=ye?this.currentResult:this.previousQueryResult,{state:xe}=D;let{dataUpdatedAt:ne,error:dt,errorUpdatedAt:ot,fetchStatus:Xe,status:st}=xe,Pt=!1,at=!1,vt;if(R._optimisticResults){const xt=this.hasListeners(),Ii=!xt&&sh(D,R),fi=xt&&ah(D,N,R,G);(Ii||fi)&&(Xe=Dp(D.options.networkMode)?"fetching":"paused",ne||(st="loading")),R._optimisticResults==="isRestoring"&&(Xe="idle")}if(R.keepPreviousData&&!xe.dataUpdateCount&&Ee!=null&&Ee.isSuccess&&st!=="error")vt=Ee.data,ne=Ee.dataUpdatedAt,st=Ee.status,Pt=!0;else if(R.select&&typeof xe.data<"u")if(X&&xe.data===(fe==null?void 0:fe.data)&&R.select===this.selectFn)vt=this.selectResult;else try{this.selectFn=R.select,vt=R.select(xe.data),vt=oh(X==null?void 0:X.data,vt,R),this.selectResult=vt,this.selectError=null}catch(xt){this.selectError=xt}else vt=xe.data;if(typeof R.placeholderData<"u"&&typeof vt>"u"&&st==="loading"){let xt;if(X!=null&&X.isPlaceholderData&&R.placeholderData===(a==null?void 0:a.placeholderData))xt=X.data;else if(xt=typeof R.placeholderData=="function"?R.placeholderData():R.placeholderData,R.select&&typeof xt<"u")try{xt=R.select(xt),xt=oh(X==null?void 0:X.data,xt,R),this.selectError=null}catch(Ii){this.selectError=Ii}typeof xt<"u"&&(st="success",vt=xt,at=!0)}this.selectError&&(dt=this.selectError,vt=this.selectResult,ot=Date.now(),st="error");const pi=Xe==="fetching";return{status:st,fetchStatus:Xe,isLoading:st==="loading",isSuccess:st==="success",isError:st==="error",data:vt,dataUpdatedAt:ne,error:dt,errorUpdatedAt:ot,failureCount:xe.fetchFailureCount,errorUpdateCount:xe.errorUpdateCount,isFetched:xe.dataUpdateCount>0||xe.errorUpdateCount>0,isFetchedAfterMount:xe.dataUpdateCount>pe.dataUpdateCount||xe.errorUpdateCount>pe.errorUpdateCount,isFetching:pi,isRefetching:pi&&st!=="loading",isLoadingError:st==="error"&&xe.dataUpdatedAt===0,isPaused:Xe==="paused",isPlaceholderData:at,isPreviousData:Pt,isRefetchError:st==="error"&&xe.dataUpdatedAt!==0,isStale:Ic(D,R),refetch:this.refetch,remove:this.remove}}updateResult(D){const R=this.currentResult,N=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,ih(N,R))return;this.currentResult=N;const G={cache:!0},X=()=>{if(!R)return!0;const{notifyOnChangeProps:fe}=this.options;if(fe==="all"||!fe&&!this.trackedProps.size)return!0;const a=new Set(fe!=null?fe:this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(ye=>{const pe=ye;return this.currentResult[pe]!==R[pe]&&a.has(pe)})};(D==null?void 0:D.listeners)!==!1&&X()&&(G.listeners=!0),this.notify({...G,...D})}updateQuery(){const D=this.client.getQueryCache().build(this.client,this.options);if(D===this.currentQuery)return;const R=this.currentQuery;this.currentQuery=D,this.currentQueryInitialState=D.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(R==null||R.removeObserver(this),D.addObserver(this))}onQueryUpdate(D){const R={};D.type==="success"?R.onSuccess=!D.manual:D.type==="error"&&!Lp(D.error)&&(R.onError=!0),this.updateResult(R),this.hasListeners()&&this.updateTimers()}notify(D){Qs.batch(()=>{if(D.onSuccess){var R,N,G,X;(R=(N=this.options).onSuccess)==null||R.call(N,this.currentResult.data),(G=(X=this.options).onSettled)==null||G.call(X,this.currentResult.data,null)}else if(D.onError){var fe,a,ye,pe;(fe=(a=this.options).onError)==null||fe.call(a,this.currentResult.error),(ye=(pe=this.options).onSettled)==null||ye.call(pe,void 0,this.currentResult.error)}D.listeners&&this.listeners.forEach(Ee=>{Ee(this.currentResult)}),D.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function jp(C,D){return D.enabled!==!1&&!C.state.dataUpdatedAt&&!(C.state.status==="error"&&D.retryOnMount===!1)}function sh(C,D){return jp(C,D)||C.state.dataUpdatedAt>0&&wc(C,D,D.refetchOnMount)}function wc(C,D,R){if(D.enabled!==!1){const N=typeof R=="function"?R(C):R;return N==="always"||N!==!1&&Ic(C,D)}return!1}function ah(C,D,R,N){return R.enabled!==!1&&(C!==D||N.enabled===!1)&&(!R.suspense||C.state.status!=="error")&&Ic(C,R)}function Ic(C,D){return C.isStaleByTime(D.staleTime)}const gh=ge.exports.createContext(!1),Xp=()=>ge.exports.useContext(gh);gh.Provider;var _h={exports:{}},yh={};/**
1
+ import{o as Mp,q as ih,t as zp,v as rh,w as nh,z as Pp,D as kp,E as Dp,G as oh,H as Lp,J as Qs,r as ge,K as Rp,P as Bp,_ as Fp,j as Oi,Q as Sc,c as Op,R as ht,V as Up,W as Si,$ as $p,s as ts,X as mh,y as bo,Y as Vp,a as Np,b as Gp,Z as qp}from"./index.603e3d3b.js";class Zp extends Mp{constructor(D,R){super(),this.client=D,this.options=R,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(R)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),sh(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return wc(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wc(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(D,R){const N=this.options,G=this.currentQuery;if(this.options=this.client.defaultQueryOptions(D),ih(N,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=N.queryKey),this.updateQuery();const X=this.hasListeners();X&&ah(this.currentQuery,G,this.options,N)&&this.executeFetch(),this.updateResult(R),X&&(this.currentQuery!==G||this.options.enabled!==N.enabled||this.options.staleTime!==N.staleTime)&&this.updateStaleTimeout();const fe=this.computeRefetchInterval();X&&(this.currentQuery!==G||this.options.enabled!==N.enabled||fe!==this.currentRefetchInterval)&&this.updateRefetchInterval(fe)}getOptimisticResult(D){const R=this.client.getQueryCache().build(this.client,D);return this.createResult(R,D)}getCurrentResult(){return this.currentResult}trackResult(D){const R={};return Object.keys(D).forEach(N=>{Object.defineProperty(R,N,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(N),D[N])})}),R}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:D,...R}={}){return this.fetch({...R,meta:{refetchPage:D}})}fetchOptimistic(D){const R=this.client.defaultQueryOptions(D),N=this.client.getQueryCache().build(this.client,R);return N.isFetchingOptimistic=!0,N.fetch().then(()=>this.createResult(N,R))}fetch(D){var R;return this.executeFetch({...D,cancelRefetch:(R=D.cancelRefetch)!=null?R:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(D){this.updateQuery();let R=this.currentQuery.fetch(this.options,D);return D!=null&&D.throwOnError||(R=R.catch(zp)),R}updateStaleTimeout(){if(this.clearStaleTimeout(),rh||this.currentResult.isStale||!nh(this.options.staleTime))return;const R=Pp(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},R)}computeRefetchInterval(){var D;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(D=this.options.refetchInterval)!=null?D:!1}updateRefetchInterval(D){this.clearRefetchInterval(),this.currentRefetchInterval=D,!(rh||this.options.enabled===!1||!nh(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||kp.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(D,R){const N=this.currentQuery,G=this.options,X=this.currentResult,fe=this.currentResultState,a=this.currentResultOptions,ye=D!==N,pe=ye?D.state:this.currentQueryInitialState,Ee=ye?this.currentResult:this.previousQueryResult,{state:xe}=D;let{dataUpdatedAt:ne,error:dt,errorUpdatedAt:ot,fetchStatus:Xe,status:st}=xe,Pt=!1,at=!1,vt;if(R._optimisticResults){const xt=this.hasListeners(),Ii=!xt&&sh(D,R),fi=xt&&ah(D,N,R,G);(Ii||fi)&&(Xe=Dp(D.options.networkMode)?"fetching":"paused",ne||(st="loading")),R._optimisticResults==="isRestoring"&&(Xe="idle")}if(R.keepPreviousData&&!xe.dataUpdateCount&&Ee!=null&&Ee.isSuccess&&st!=="error")vt=Ee.data,ne=Ee.dataUpdatedAt,st=Ee.status,Pt=!0;else if(R.select&&typeof xe.data<"u")if(X&&xe.data===(fe==null?void 0:fe.data)&&R.select===this.selectFn)vt=this.selectResult;else try{this.selectFn=R.select,vt=R.select(xe.data),vt=oh(X==null?void 0:X.data,vt,R),this.selectResult=vt,this.selectError=null}catch(xt){this.selectError=xt}else vt=xe.data;if(typeof R.placeholderData<"u"&&typeof vt>"u"&&st==="loading"){let xt;if(X!=null&&X.isPlaceholderData&&R.placeholderData===(a==null?void 0:a.placeholderData))xt=X.data;else if(xt=typeof R.placeholderData=="function"?R.placeholderData():R.placeholderData,R.select&&typeof xt<"u")try{xt=R.select(xt),xt=oh(X==null?void 0:X.data,xt,R),this.selectError=null}catch(Ii){this.selectError=Ii}typeof xt<"u"&&(st="success",vt=xt,at=!0)}this.selectError&&(dt=this.selectError,vt=this.selectResult,ot=Date.now(),st="error");const pi=Xe==="fetching";return{status:st,fetchStatus:Xe,isLoading:st==="loading",isSuccess:st==="success",isError:st==="error",data:vt,dataUpdatedAt:ne,error:dt,errorUpdatedAt:ot,failureCount:xe.fetchFailureCount,errorUpdateCount:xe.errorUpdateCount,isFetched:xe.dataUpdateCount>0||xe.errorUpdateCount>0,isFetchedAfterMount:xe.dataUpdateCount>pe.dataUpdateCount||xe.errorUpdateCount>pe.errorUpdateCount,isFetching:pi,isRefetching:pi&&st!=="loading",isLoadingError:st==="error"&&xe.dataUpdatedAt===0,isPaused:Xe==="paused",isPlaceholderData:at,isPreviousData:Pt,isRefetchError:st==="error"&&xe.dataUpdatedAt!==0,isStale:Ic(D,R),refetch:this.refetch,remove:this.remove}}updateResult(D){const R=this.currentResult,N=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,ih(N,R))return;this.currentResult=N;const G={cache:!0},X=()=>{if(!R)return!0;const{notifyOnChangeProps:fe}=this.options;if(fe==="all"||!fe&&!this.trackedProps.size)return!0;const a=new Set(fe!=null?fe:this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(ye=>{const pe=ye;return this.currentResult[pe]!==R[pe]&&a.has(pe)})};(D==null?void 0:D.listeners)!==!1&&X()&&(G.listeners=!0),this.notify({...G,...D})}updateQuery(){const D=this.client.getQueryCache().build(this.client,this.options);if(D===this.currentQuery)return;const R=this.currentQuery;this.currentQuery=D,this.currentQueryInitialState=D.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(R==null||R.removeObserver(this),D.addObserver(this))}onQueryUpdate(D){const R={};D.type==="success"?R.onSuccess=!D.manual:D.type==="error"&&!Lp(D.error)&&(R.onError=!0),this.updateResult(R),this.hasListeners()&&this.updateTimers()}notify(D){Qs.batch(()=>{if(D.onSuccess){var R,N,G,X;(R=(N=this.options).onSuccess)==null||R.call(N,this.currentResult.data),(G=(X=this.options).onSettled)==null||G.call(X,this.currentResult.data,null)}else if(D.onError){var fe,a,ye,pe;(fe=(a=this.options).onError)==null||fe.call(a,this.currentResult.error),(ye=(pe=this.options).onSettled)==null||ye.call(pe,void 0,this.currentResult.error)}D.listeners&&this.listeners.forEach(Ee=>{Ee(this.currentResult)}),D.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function jp(C,D){return D.enabled!==!1&&!C.state.dataUpdatedAt&&!(C.state.status==="error"&&D.retryOnMount===!1)}function sh(C,D){return jp(C,D)||C.state.dataUpdatedAt>0&&wc(C,D,D.refetchOnMount)}function wc(C,D,R){if(D.enabled!==!1){const N=typeof R=="function"?R(C):R;return N==="always"||N!==!1&&Ic(C,D)}return!1}function ah(C,D,R,N){return R.enabled!==!1&&(C!==D||N.enabled===!1)&&(!R.suspense||C.state.status!=="error")&&Ic(C,R)}function Ic(C,D){return C.isStaleByTime(D.staleTime)}const gh=ge.exports.createContext(!1),Xp=()=>ge.exports.useContext(gh);gh.Provider;var _h={exports:{}},yh={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.min.js
4
4
  *
@@ -0,0 +1,221 @@
1
+ import{M as Ve,d as ee,u as se,p as yt,s as vt,a as Pe,b as xt,$ as Ct,c as bt,e as wt,f as Mt,S as St,g as $t,h as Lt,i as Et,A as Pt,j as It,k as kt,m as At,l as Tt,N as _t,P as Ie}from"./index.1798f035.js";import{R,r as h,S as Be,j as c,I as Y,c as X,L as ve,u as D,a as xe,p as W,s as C,y as p,F as Q,b as E,d as le,e as H,h as k,M as J,f as z,B as q,U as Ge,A as Ue,x as he,O as Fe,g as V,i as Ce,C as te,k as Ot,l as F,m as Rt,n as zt,N as We,T as jt}from"./index.603e3d3b.js";const Ke=R.createContext({}),A=()=>h.exports.useContext(Ke),Nt=(t,e)=>{switch(e.type){case"CATEGORY":return{...t,activeCategory:e.value};case"SCORE":{const n=Y.find(o=>e.value===""?o.value===t.activeCategory:o.scores.includes(e.value)).value;return{activeCategory:n,activeScoreByCategory:{...t.activeScoreByCategory,[n]:e.value}}}}},Zt=({children:t})=>{const e=window.innerWidth<Be.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:""}},[n,o]=h.exports.useReducer(Nt,e),[r,i]=h.exports.useState(),[s,l]=h.exports.useState(),[a,u]=h.exports.useState(),[d,f]=h.exports.useState(),{activeCategory:m}=n,g=n.activeScoreByCategory[m],y=v=>{o({type:"SCORE",value:v})},b=v=>{o({type:"CATEGORY",value:v})},x=h.exports.useMemo(()=>({activeScore:g,setActiveScore:y,activeCategory:m,setActiveCategory:b,activePOI:r,setActivePOI:i,hoveredPOI:s,setHoveredPOI:l,commuteGeojson:a,setCommuteGeojson:u,destination:d,setDestination:f}),[g,y,m,b,r,i,s,l,a,u,d,f]);return c(Ke.Provider,{value:x,children:t})};function re(t,e){if(!t)throw new Error(e)}let Dt=0;function Ht(t,e,n){if(t.style&&t.style._loaded){const o={...n};return delete o.id,delete o.children,t.addSource(e,o),t.getSource(e)}return null}function Vt(t,e,n){re(e.id===n.id,"source id changed"),re(e.type===n.type,"source type changed");let o="",r=0;for(const s in e)s!=="children"&&s!=="id"&&!ee(n[s],e[s])&&(o=s,r++);if(!r)return;const i=e.type;if(i==="geojson")t.setData(e.data);else if(i==="image")t.updateImage({url:e.url,coordinates:e.coordinates});else if((i==="canvas"||i==="video")&&r===1&&o==="coordinates")t.setCoordinates(e.coordinates);else if(i==="vector"&&"setUrl"in t)switch(o){case"url":t.setUrl(e.url);break;case"tiles":t.setTiles(e.tiles);break}else console.warn(`Unable to update <Source> prop: ${o}`)}function Bt(t){const e=h.exports.useContext(Ve).map.getMap(),n=h.exports.useRef(t),[,o]=h.exports.useState(0),r=h.exports.useMemo(()=>t.id||`jsx-source-${Dt++}`,[]);h.exports.useEffect(()=>{if(e){const s=()=>o(l=>l+1);return e.on("styledata",s),s(),()=>{var l;if(e.off("styledata",s),e.style&&e.style._loaded&&e.getSource(r)){const a=(l=e.getStyle())===null||l===void 0?void 0:l.layers;if(a)for(const u of a)u.source===r&&e.removeLayer(u.id);e.removeSource(r)}}}},[e]);let i=e&&e.style&&e.getSource(r);return i?Vt(i,t,n.current):i=Ht(e,r,t),n.current=t,i&&h.exports.Children.map(t.children,s=>s&&h.exports.cloneElement(s,{source:r}))||null}function Gt(t,e,n,o){if(re(n.id===o.id,"layer id changed"),re(n.type===o.type,"layer type changed"),n.type==="custom"||o.type==="custom")return;const{layout:r={},paint:i={},filter:s,minzoom:l,maxzoom:a,beforeId:u}=n;if(u!==o.beforeId&&t.moveLayer(e,u),r!==o.layout){const d=o.layout||{};for(const f in r)ee(r[f],d[f])||t.setLayoutProperty(e,f,r[f]);for(const f in d)r.hasOwnProperty(f)||t.setLayoutProperty(e,f,void 0)}if(i!==o.paint){const d=o.paint||{};for(const f in i)ee(i[f],d[f])||t.setPaintProperty(e,f,i[f]);for(const f in d)i.hasOwnProperty(f)||t.setPaintProperty(e,f,void 0)}ee(s,o.filter)||t.setFilter(e,s),(l!==o.minzoom||a!==o.maxzoom)&&t.setLayerZoomRange(e,l,a)}function Ut(t,e,n){if(t.style&&t.style._loaded&&(!("source"in n)||t.getSource(n.source))){const o={...n,id:e};delete o.beforeId,t.addLayer(o,n.beforeId)}}let Ft=0;function Wt(t){const e=h.exports.useContext(Ve).map.getMap(),n=h.exports.useRef(t),[,o]=h.exports.useState(0),r=h.exports.useMemo(()=>t.id||`jsx-layer-${Ft++}`,[]);if(h.exports.useEffect(()=>{if(e){const s=()=>o(l=>l+1);return e.on("styledata",s),s(),()=>{e.off("styledata",s),e.style&&e.style._loaded&&e.getLayer(r)&&e.removeLayer(r)}}},[e]),e&&e.style&&e.getLayer(r))try{Gt(e,r,t,n.current)}catch(s){console.warn(s)}else Ut(e,r,t);return n.current=t,null}function Ye(t,e,n){n===void 0&&(n={});var o={type:"Feature"};return(n.id===0||n.id)&&(o.id=n.id),n.bbox&&(o.bbox=n.bbox),o.properties=e||{},o.geometry=t,o}function ce(t,e,n){if(n===void 0&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ke(t[0])||!ke(t[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:t};return Ye(o,e,n)}function Kt(t,e,n){n===void 0&&(n={});var o={type:"MultiPoint",coordinates:t};return Ye(o,e,n)}function ke(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Qe(t,e,n){if(t!==null)for(var o,r,i,s,l,a,u,d=0,f=0,m,g=t.type,y=g==="FeatureCollection",b=g==="Feature",x=y?t.features.length:1,v=0;v<x;v++){u=y?t.features[v].geometry:b?t.geometry:t,m=u?u.type==="GeometryCollection":!1,l=m?u.geometries.length:1;for(var L=0;L<l;L++){var $=0,S=0;if(s=m?u.geometries[L]:u,s!==null){a=s.coordinates;var w=s.type;switch(d=n&&(w==="Polygon"||w==="MultiPolygon")?1:0,w){case null:break;case"Point":if(e(a,f,v,$,S)===!1)return!1;f++,$++;break;case"LineString":case"MultiPoint":for(o=0;o<a.length;o++){if(e(a[o],f,v,$,S)===!1)return!1;f++,w==="MultiPoint"&&$++}w==="LineString"&&$++;break;case"Polygon":case"MultiLineString":for(o=0;o<a.length;o++){for(r=0;r<a[o].length-d;r++){if(e(a[o][r],f,v,$,S)===!1)return!1;f++}w==="MultiLineString"&&$++,w==="Polygon"&&S++}w==="Polygon"&&$++;break;case"MultiPolygon":for(o=0;o<a.length;o++){for(S=0,r=0;r<a[o].length;r++){for(i=0;i<a[o][r].length-d;i++){if(e(a[o][r][i],f,v,$,S)===!1)return!1;f++}S++}$++}break;case"GeometryCollection":for(o=0;o<s.geometries.length;o++)if(Qe(s.geometries[o],e,n)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function me(t){var e=[1/0,1/0,-1/0,-1/0];return Qe(t,function(n){e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]<n[0]&&(e[2]=n[0]),e[3]<n[1]&&(e[3]=n[1])}),e}me.default=me;var Yt="Expected a function",Ae=0/0,Qt="[object Symbol]",Jt=/^\s+|\s+$/g,Xt=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,en=/^0o[0-7]+$/i,tn=parseInt,nn=typeof X=="object"&&X&&X.Object===Object&&X,on=typeof self=="object"&&self&&self.Object===Object&&self,rn=nn||on||Function("return this")(),sn=Object.prototype,an=sn.toString,ln=Math.max,cn=Math.min,ue=function(){return rn.Date.now()};function un(t,e,n){var o,r,i,s,l,a,u=0,d=!1,f=!1,m=!0;if(typeof t!="function")throw new TypeError(Yt);e=Te(e)||0,ge(n)&&(d=!!n.leading,f="maxWait"in n,i=f?ln(Te(n.maxWait)||0,e):i,m="trailing"in n?!!n.trailing:m);function g(M){var I=o,N=r;return o=r=void 0,u=M,s=t.apply(N,I),s}function y(M){return u=M,l=setTimeout(v,e),d?g(M):s}function b(M){var I=M-a,N=M-u,B=e-I;return f?cn(B,i-N):B}function x(M){var I=M-a,N=M-u;return a===void 0||I>=e||I<0||f&&N>=i}function v(){var M=ue();if(x(M))return L(M);l=setTimeout(v,b(M))}function L(M){return l=void 0,m&&o?g(M):(o=r=void 0,s)}function $(){l!==void 0&&clearTimeout(l),u=0,o=a=r=l=void 0}function S(){return l===void 0?s:L(ue())}function w(){var M=ue(),I=x(M);if(o=arguments,r=this,a=M,I){if(l===void 0)return y(a);if(f)return l=setTimeout(v,e),g(a)}return l===void 0&&(l=setTimeout(v,e)),s}return w.cancel=$,w.flush=S,w}function ge(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function dn(t){return!!t&&typeof t=="object"}function fn(t){return typeof t=="symbol"||dn(t)&&an.call(t)==Qt}function Te(t){if(typeof t=="number")return t;if(fn(t))return Ae;if(ge(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=ge(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Jt,"");var n=qt.test(t);return n||en.test(t)?tn(t.slice(2),n?2:8):Xt.test(t)?Ae:+t}var pn=un;const be=()=>{const[t,e]=h.exports.useState(!1);return h.exports.useLayoutEffect(()=>{const n=()=>{e(window.innerWidth<Be.screenSizes.tablet)};return window.addEventListener("resize",pn(n,250)),n(),()=>window.removeEventListener("resize",n)},[]),t};function Je(){var l;const{client:t}=ve(),{sdkState:e}=D(),n=xe(e.options,250),{activeScore:o}=A(),r=o?W[o]:void 0,s={...h.exports.useMemo(()=>n!=null&&n.marker?n.marker:{lat:n==null?void 0:n.lat,lng:n==null?void 0:n.lng},[n]),limit:10,radius:2e3,include:r};return se(yt.list(s),async()=>t.getPois(s),{enabled:!!s&&!!((l=s.include)!=null&&l.length)&&!!s.lat&&!!s.lng})}function Xe(){const{client:t}=ve(),{sdkState:e}=D(),n=xe(e.options,250),{activeScore:o}=A(),r=o==="high_schools"||o==="primary_schools",s={...h.exports.useMemo(()=>n!=null&&n.marker?n.marker:{lat:n==null?void 0:n.lat,lng:n==null?void 0:n.lng},[n]),limit:10,radius:2e3};return se(vt.list(s),async()=>t.getSchools(s),{enabled:!!s&&!!s.lat&&!!s.lng&&r})}const qe=R.createContext({}),et=()=>h.exports.useContext(qe),hn=({children:t,mapRef:e,mapPadding:n})=>c(qe.Provider,{value:{mapRef:e,mapPadding:n},children:t});function ye(t,e,n,o,r,i){if(r-o<=n)return;const s=o+r>>1;tt(t,e,s,o,r,i%2),ye(t,e,n,o,s-1,i+1),ye(t,e,n,s+1,r,i+1)}function tt(t,e,n,o,r,i){for(;r>o;){if(r-o>600){const u=r-o+1,d=n-o+1,f=Math.log(u),m=.5*Math.exp(2*f/3),g=.5*Math.sqrt(f*m*(u-m)/u)*(d-u/2<0?-1:1),y=Math.max(o,Math.floor(n-d*m/u+g)),b=Math.min(r,Math.floor(n+(u-d)*m/u+g));tt(t,e,n,y,b,i)}const s=e[2*n+i];let l=o,a=r;for(U(t,e,o,n),e[2*r+i]>s&&U(t,e,o,r);l<a;){for(U(t,e,l,a),l++,a--;e[2*l+i]<s;)l++;for(;e[2*a+i]>s;)a--}e[2*o+i]===s?U(t,e,o,a):(a++,U(t,e,a,r)),a<=n&&(o=a+1),n<=a&&(r=a-1)}}function U(t,e,n,o){de(t,n,o),de(e,2*n,2*o),de(e,2*n+1,2*o+1)}function de(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function mn(t,e,n,o,r,i,s){const l=[0,t.length-1,0],a=[];let u,d;for(;l.length;){const f=l.pop(),m=l.pop(),g=l.pop();if(m-g<=s){for(let x=g;x<=m;x++)u=e[2*x],d=e[2*x+1],u>=n&&u<=r&&d>=o&&d<=i&&a.push(t[x]);continue}const y=Math.floor((g+m)/2);u=e[2*y],d=e[2*y+1],u>=n&&u<=r&&d>=o&&d<=i&&a.push(t[y]);const b=(f+1)%2;(f===0?n<=u:o<=d)&&(l.push(g),l.push(y-1),l.push(b)),(f===0?r>=u:i>=d)&&(l.push(y+1),l.push(m),l.push(b))}return a}function gn(t,e,n,o,r,i){const s=[0,t.length-1,0],l=[],a=r*r;for(;s.length;){const u=s.pop(),d=s.pop(),f=s.pop();if(d-f<=i){for(let x=f;x<=d;x++)_e(e[2*x],e[2*x+1],n,o)<=a&&l.push(t[x]);continue}const m=Math.floor((f+d)/2),g=e[2*m],y=e[2*m+1];_e(g,y,n,o)<=a&&l.push(t[m]);const b=(u+1)%2;(u===0?n-r<=g:o-r<=y)&&(s.push(f),s.push(m-1),s.push(b)),(u===0?n+r>=g:o+r>=y)&&(s.push(m+1),s.push(d),s.push(b))}return l}function _e(t,e,n,o){const r=t-n,i=e-o;return r*r+i*i}const yn=t=>t[0],vn=t=>t[1];class Oe{constructor(e,n=yn,o=vn,r=64,i=Float64Array){this.nodeSize=r,this.points=e;const s=e.length<65536?Uint16Array:Uint32Array,l=this.ids=new s(e.length),a=this.coords=new i(e.length*2);for(let u=0;u<e.length;u++)l[u]=u,a[2*u]=n(e[u]),a[2*u+1]=o(e[u]);ye(l,a,r,0,l.length-1,0)}range(e,n,o,r){return mn(this.ids,this.coords,e,n,o,r,this.nodeSize)}within(e,n,o){return gn(this.ids,this.coords,e,n,o,this.nodeSize)}}const xn={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},ie=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1));class Cn{constructor(e){this.options=K(Object.create(xn),e),this.trees=new Array(this.options.maxZoom+1)}load(e){const{log:n,minZoom:o,maxZoom:r,nodeSize:i}=this.options;n&&console.time("total time");const s=`prepare ${e.length} points`;n&&console.time(s),this.points=e;let l=[];for(let a=0;a<e.length;a++)!e[a].geometry||l.push(wn(e[a],a));this.trees[r+1]=new Oe(l,ze,je,i,Float32Array),n&&console.timeEnd(s);for(let a=r;a>=o;a--){const u=+Date.now();l=this._cluster(l,a),this.trees[a]=new Oe(l,ze,je,i,Float32Array),n&&console.log("z%d: %d clusters in %dms",a,l.length,+Date.now()-u)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let o=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let i=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,i=180;else if(o>i){const d=this.getClusters([o,r,180,s],n),f=this.getClusters([-180,r,i,s],n);return d.concat(f)}const l=this.trees[this._limitZoom(n)],a=l.range(ne(o),oe(s),ne(i),oe(r)),u=[];for(const d of a){const f=l.points[d];u.push(f.numPoints?Re(f):this.points[f.index])}return u}getChildren(e){const n=this._getOriginId(e),o=this._getOriginZoom(e),r="No cluster with the specified id.",i=this.trees[o];if(!i)throw new Error(r);const s=i.points[n];if(!s)throw new Error(r);const l=this.options.radius/(this.options.extent*Math.pow(2,o-1)),a=i.within(s.x,s.y,l),u=[];for(const d of a){const f=i.points[d];f.parentId===e&&u.push(f.numPoints?Re(f):this.points[f.index])}if(u.length===0)throw new Error(r);return u}getLeaves(e,n,o){n=n||10,o=o||0;const r=[];return this._appendLeaves(r,e,n,o,0),r}getTile(e,n,o){const r=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:s,radius:l}=this.options,a=l/s,u=(o-a)/i,d=(o+1+a)/i,f={features:[]};return this._addTileFeatures(r.range((n-a)/i,u,(n+1+a)/i,d),r.points,n,o,i,f),n===0&&this._addTileFeatures(r.range(1-a/i,u,1,d),r.points,i,o,i,f),n===i-1&&this._addTileFeatures(r.range(0,u,a/i,d),r.points,-1,o,i,f),f.features.length?f:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const o=this.getChildren(e);if(n++,o.length!==1)break;e=o[0].properties.cluster_id}return n}_appendLeaves(e,n,o,r,i){const s=this.getChildren(n);for(const l of s){const a=l.properties;if(a&&a.cluster?i+a.point_count<=r?i+=a.point_count:i=this._appendLeaves(e,a.cluster_id,o,r,i):i<r?i++:e.push(l),e.length===o)break}return i}_addTileFeatures(e,n,o,r,i,s){for(const l of e){const a=n[l],u=a.numPoints;let d,f,m;if(u)d=nt(a),f=a.x,m=a.y;else{const b=this.points[a.index];d=b.properties,f=ne(b.geometry.coordinates[0]),m=oe(b.geometry.coordinates[1])}const g={type:1,geometry:[[Math.round(this.options.extent*(f*i-o)),Math.round(this.options.extent*(m*i-r))]],tags:d};let y;u?y=a.id:this.options.generateId?y=a.index:this.points[a.index].id&&(y=this.points[a.index].id),y!==void 0&&(g.id=y),s.features.push(g)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const o=[],{radius:r,extent:i,reduce:s,minPoints:l}=this.options,a=r/(i*Math.pow(2,n));for(let u=0;u<e.length;u++){const d=e[u];if(d.zoom<=n)continue;d.zoom=n;const f=this.trees[n+1],m=f.within(d.x,d.y,a),g=d.numPoints||1;let y=g;for(const b of m){const x=f.points[b];x.zoom>n&&(y+=x.numPoints||1)}if(y>g&&y>=l){let b=d.x*g,x=d.y*g,v=s&&g>1?this._map(d,!0):null;const L=(u<<5)+(n+1)+this.points.length;for(const $ of m){const S=f.points[$];if(S.zoom<=n)continue;S.zoom=n;const w=S.numPoints||1;b+=S.x*w,x+=S.y*w,S.parentId=L,s&&(v||(v=this._map(d,!0)),s(v,this._map(S)))}d.parentId=L,o.push(bn(b/y,x/y,L,y,v))}else if(o.push(d),y>1)for(const b of m){const x=f.points[b];x.zoom<=n||(x.zoom=n,o.push(x))}}return o}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n){if(e.numPoints)return n?K({},e.properties):e.properties;const o=this.points[e.index].properties,r=this.options.map(o);return n&&r===o?K({},r):r}}function bn(t,e,n,o,r){return{x:ie(t),y:ie(e),zoom:1/0,id:n,parentId:-1,numPoints:o,properties:r}}function wn(t,e){const[n,o]=t.geometry.coordinates;return{x:ie(ne(n)),y:ie(oe(o)),zoom:1/0,index:e,parentId:-1}}function Re(t){return{type:"Feature",id:t.id,properties:nt(t),geometry:{type:"Point",coordinates:[Mn(t.x),Sn(t.y)]}}}function nt(t){const e=t.numPoints,n=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return K(K({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function ne(t){return t/360+.5}function oe(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function Mn(t){return(t-.5)*360}function Sn(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function K(t,e){for(const n in e)t[n]=e[n];return t}function ze(t){return t.x}function je(t){return t.y}var Ne=Object.prototype.hasOwnProperty;function Ze(t,e,n){for(n of t.keys())if(Z(n,e))return n}function Z(t,e){var n,o,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((o=t.length)===e.length)for(;o--&&Z(t[o],e[o]););return o===-1}if(n===Set){if(t.size!==e.size)return!1;for(o of t)if(r=o,r&&typeof r=="object"&&(r=Ze(e,r),!r)||!e.has(r))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(o of t)if(r=o[0],r&&typeof r=="object"&&(r=Ze(e,r),!r)||!Z(o[1],e.get(r)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((o=t.byteLength)===e.byteLength)for(;o--&&t.getInt8(o)===e.getInt8(o););return o===-1}if(ArrayBuffer.isView(t)){if((o=t.byteLength)===e.byteLength)for(;o--&&t[o]===e[o];);return o===-1}if(!n||typeof t=="object"){o=0;for(n in t)if(Ne.call(t,n)&&++o&&!Ne.call(e,n)||!(n in e)||!Z(t[n],e[n]))return!1;return Object.keys(e).length===o}}return t!==t&&e!==e}function $n(t){var e=h.exports.useRef(t),n=h.exports.useRef(0);return Z(t,e.current)||(e.current=t,n.current+=1),h.exports.useMemo(function(){return e.current},[n.current])}function Ln(t,e){return h.exports.useEffect(t,$n(e))}var En=function(e){var n=e.points,o=e.bounds,r=e.zoom,i=e.options,s=h.exports.useRef(),l=h.exports.useRef(),a=h.exports.useState([]),u=a[0],d=a[1],f=Math.round(r);return Ln(function(){(!s.current||!Z(l.current,n)||!Z(s.current.options,i))&&(s.current=new Cn(i),s.current.load(n)),o&&d(s.current.getClusters(o,f)),l.current=n},[n,o,f,i]),{clusters:u,supercluster:s.current}};const Pn=C.div`
2
+ border-radius: 50%;
3
+ background: linear-gradient(
4
+ to top,
5
+ ${p["--ll-color-primary-variant1"]},
6
+ ${p["--ll-color-primary"]}
7
+ );
8
+ color: ${p["--ll-color-on-primary"]};
9
+ height: ${({diameter:t})=>t}px;
10
+ width: ${({diameter:t})=>t}px;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ line-height: 1;
15
+ font-family: ${p["--ll-font-family"]};
16
+ font-size: ${({diameter:t})=>t/2.5}px;
17
+ border: 2px solid #fff;
18
+ box-shadow: ${p["--ll-shadow-small"]};
19
+ cursor: default;
20
+ `,In=({cluster:t,pointsCount:e,onClick:n})=>{const r=20+t.properties.point_count/e*25;return c(Pn,{diameter:r,onClick:()=>n&&n(t),children:t.properties.point_count})};function kn(t){return t.properties.cluster!==void 0}const ot=R.memo(({rect:t,zoom:e,mapRef:n,points:o,isMobile:r,activePOI:i,hoveredPOI:s,isMapMoving:l,setActivePOI:a})=>{var m;const u=(m=n==null?void 0:n.current)==null?void 0:m.getMap().getBounds().toArray().flat(),{clusters:d,supercluster:f}=En({points:o,bounds:u,zoom:e,options:{radius:50,maxZoom:18}});return c(Q,{children:d.map((g,y)=>{const[b,x]=g.geometry.coordinates;if(kn(g))return c(Pe,{latitude:x,longitude:b,children:c(In,{cluster:g,pointsCount:o.length,onClick:()=>{var I;const M=Math.min(f.getClusterExpansionZoom(g.id),20);(I=n.current)==null||I.flyTo({zoom:M,center:[b,x],duration:1e3,essential:!0})}})},`cluster-${g.id}`);const{poi:v,type:L}=g.properties,$=i===v,S=s===v,w=["rapid_transit_stations"];return c(Pe,{latitude:v.lat,longitude:v.lng,style:{zIndex:$?1:0},children:E(le.Root,{options:{type:L,poi:v,isOpen:l?!1:$,isHovered:S,side:"top",size:w.includes(L)?"medium":"small",collisionPadding:r?{top:t.height+32,bottom:H*2,left:H*2,right:H*2}:{left:t.width+32,right:H*2,top:H*2,bottom:H*2}},onChange:M=>{M.type==="open-change"&&(M.data?setTimeout(()=>{a(v)},0):$&&a(void 0))},children:[c(le.Marker,{}),c(le.Content,{})]})},`${v.name}-${v.lat}-${v.lng}-${y}`)})})});ot.displayName="Markers";const rt=t=>h.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},h.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"})),it=t=>h.exports.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},h.exports.createElement("path",{d:"M10 20V14H14V20H19V12H22L12 3L2 12H5V20H10Z"}));function we(t){const{client:e}=ve(),{sdkState:n}=D(),o=xe(n.options,250),i={...h.exports.useMemo(()=>o!=null&&o.marker?o.marker:{lat:o==null?void 0:o.lat,lng:o==null?void 0:o.lng},[o]),geographyLevels:["20","30"],locationScoresRounding:!1,include:t};return se(xt.list(i),async()=>e.getScores(i),{enabled:!!i})}const An=C.div`
21
+ padding: ${p["--ll-spacing-small"]} ${p["--ll-spacing-medium"]};
22
+ background-color: ${p["--ll-color-surface"]};
23
+ display: flex;
24
+ flex-direction: column;
25
+ overflow: hidden;
26
+ flex: 1;
27
+ `,Tn=C.div`
28
+ display: grid;
29
+ grid-template-columns: min-content 1fr;
30
+ grid-gap: ${p["--ll-spacing-medium"]};
31
+ margin-bottom: ${p["--ll-spacing-medium"]};
32
+ `,_n=()=>{var s,l;const{sdkState:t}=D(),{activeCategory:e,activeScore:n}=A(),o=Y.find(a=>a.value===e),{data:r,isLoading:i}=we(o.scores);return n&&(r==null?void 0:r.location[n])?i?c("div",{children:"Loading"}):c(k.Root,{options:{score:n,scoresData:r},children:E(An,{children:[E(Tn,{children:[c(k.Badge,{}),c(k.BarChart,{options:{locationIcon:((l=(s=t.options)==null?void 0:s.marker)==null?void 0:l.icon)==="pin"?rt:it}})]}),c(k.Description,{})]})}):null},On=C.div`
33
+ display: flex;
34
+ overflow-x: scroll;
35
+ padding: ${p["--ll-spacing-x-small"]} ${p["--ll-spacing-medium"]};
36
+ flex-shrink: 0;
37
+ position: relative;
38
+ `,Rn=C.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
+ `,zn=C.div`
58
+ position: absolute;
59
+ top: -6px;
60
+ right: 4px;
61
+ border: 2px solid ${p["--ll-color-background"]};
62
+ border-radius: 6px;
63
+ `,jn=C.div`
64
+ flex: 1;
65
+ display: flex;
66
+ align-items: center;
67
+ `,Nn=C.div`
68
+ margin: 0 2px;
69
+ `,Zn=({category:t})=>{const{data:e,isLoading:n,isFetching:o}=we(t.scores),{activeScore:r,setActiveScore:i,setActiveCategory:s}=A();return c(On,{children:t.scores.map(l=>{const a=l===r,u=a?"--ll-color-primary":"--ll-color-disabled";return n||o?c(Nn,{children:c(J,{height:"44px",width:"60px"})},l):c(k.Root,{options:{score:l,scoresData:e},children:E(Rn,{onClick:()=>{s(t.value),i(l)},children:[c(k.Icon,{options:{color:u,height:28,width:28}}),c(jn,{children:c(k.Title,{options:{variant:"caption1",color:u,noWrap:!0,noMargin:!0,weight:"--ll-font-weight-bold"}})}),c(zn,{children:c(k.Badge,{options:{variant:"small",isPrimary:a}})})]})},l)})})},Dn=C.div`
70
+ display: flex;
71
+ padding: ${p["--ll-spacing-x-small"]} ${p["--ll-spacing-medium"]}
72
+ ${p["--ll-spacing-xx-small"]} ${p["--ll-spacing-medium"]};
73
+ `,Hn=C.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: ${p["--ll-color-background"]};
84
+ border: 1px solid ${p["--ll-color-border"]};
85
+ `,st=R.forwardRef((t,e)=>{const{activeCategory:n,setActiveCategory:o}=A();return E(Hn,{ref:e,children:[c(Dn,{children:E(z.Root,{value:n,onValueChange:r=>o(r),children:[c(z.Trigger,{size:"large",children:c(q.Root,{options:{scoreCategory:n},children:c(q.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},n)}),c(z.Content,{children:Y.map(r=>c(q.Root,{options:{scoreCategory:r.value},children:c(z.Item,{value:r.value,children:c(q.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},r.value))})]})}),c(Zn,{category:Y.find(r=>r.value===n)}),c(_n,{})]})});st.displayName="MobileScores";const Vn=Ge({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Bn=Ge({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Gn=C(Ct)`
86
+ margin: 0;
87
+ z-index: 1;
88
+ position: relative;
89
+ margin: 0 calc(-1 * ${p["--ll-spacing-medium"]});
90
+ padding: 0 ${p["--ll-spacing-medium"]};
91
+
92
+ &:hover {
93
+ background-color: ${p["--ll-color-surface"]};
94
+ box-shadow: ${p["--ll-shadow-small"]};
95
+ }
96
+ `,at=C(bt)`
97
+ background: none;
98
+ border: none;
99
+ display: flex;
100
+ align-items: center;
101
+ width: 100%;
102
+ padding: ${p["--ll-spacing-x-small"]} 0;
103
+ `,Un=C(wt)`
104
+ background-color: ${p["--ll-color-surface"]};
105
+ position: relative;
106
+ overflow: hidden;
107
+ margin-left: calc(-1 * ${p["--ll-spacing-medium"]});
108
+ margin-right: calc(-1 * ${p["--ll-spacing-medium"]});
109
+
110
+ [data-state="open"] & {
111
+ animation: ${Vn} 300ms cubic-bezier(0.87, 0, 0.13, 1);
112
+ }
113
+
114
+ [data-state="closed"] & {
115
+ animation: ${Bn} 300ms cubic-bezier(0.87, 0, 0.13, 1);
116
+ }
117
+ `,Fn=C.div`
118
+ padding: ${p["--ll-spacing-medium"]};
119
+ border-top: 1px solid ${p["--ll-color-border"]};
120
+ border-bottom: 1px solid ${p["--ll-color-border"]};
121
+ `,Wn=C.span`
122
+ ${at}[data-state=open] & {
123
+ transform: rotate(90deg);
124
+ } ;
125
+ `;C.div`
126
+ display: flex;
127
+ align-items: flex-start;
128
+ justify-content: space-between;
129
+ `;const Me=C.div`
130
+ margin: ${p["--ll-spacing-small"]} 0;
131
+ `,Kn=C.div`
132
+ margin-top: ${p["--ll-spacing-large"]};
133
+ &:empty {
134
+ margin: 0;
135
+ }
136
+ `,Yn=({score:t})=>{const{data:e,isLoading:n}=Xe(),{activePOI:o,setActivePOI:r,hoveredPOI:i,setHoveredPOI:s}=A(),{mapRef:l,mapPadding:a}=et();return n?c(Q,{children:[...Array(10)].map((u,d)=>c(Me,{children:c(J,{height:"34px",width:"100%"})},d))}):e?c(Ue.Root,{options:{type:"school",data:e==null?void 0:e[t],activePOI:o,hoveredPOI:i},onChange:u=>{var d;if(u.type==="poi-click"){const f=u.data;r(f);const m=window.innerWidth-a.left,g=window.innerWidth/2,y=m/2+a.left-g;f&&((d=l.current)==null||d.easeTo({zoom:18,center:[f.lng,f.lat],duration:1e3,offset:[y,0]}))}u.type==="poi-hover"&&s(u.data)}}):null},lt=R.memo(({result:t,poi:e})=>{const{activePOI:n,setActivePOI:o,hoveredPOI:r,setHoveredPOI:i}=A(),{mapRef:s,mapPadding:l}=et();return!t.data||!t.data[e]?null:c(he.Content,{options:{value:e},children:c(Ue.Root,{options:{type:"poi",data:t.data[e],activePOI:n,hoveredPOI:r},onChange:a=>{var u;if(a.type==="poi-click"){const d=a.data;o(d);const f=window.innerWidth-l.left,m=window.innerWidth/2,g=f/2+l.left-m;d&&((u=s.current)==null||u.flyTo({zoom:18,center:[d.lng,d.lat],duration:1e3,offset:[g,0],essential:!0}))}a.type==="poi-hover"&&i(a.data)}})},e)});lt.displayName="POI";const ct=R.memo(({include:t})=>{const e=Je(),n=t==null?void 0:t.filter(o=>{var r;return(((r=e==null?void 0:e.data)==null?void 0:r[o])||[]).length>0});return e.isLoading&&n.length?c(Q,{children:[...Array(10)].map((o,r)=>c(Me,{children:c(J,{height:"34px",width:"100%"})},r))}):e.data?E(he.Root,{options:{include:n},children:[c(he.Tabs,{}),n.map(o=>c(lt,{poi:o,result:e},o))]}):null});ct.displayName="POIs";const ut=R.memo(({score:t,isLoading:e,scoresData:n})=>{var s,l;const{sdkState:o}=D(),{activeScore:r}=A(),i=t===r;return e?c(Me,{children:c(J,{height:"34px",width:"100%"},t)}):n!=null&&n.location[t]?c(Mt,{value:t,children:E(k.Root,{options:{score:t,scoresData:n},children:[c(Gn,{children:E(at,{children:[c(Wn,{children:c(Fe,{SVGElement:St,fill:p["--ll-color-on-background-variant1"]})}),c(V,{spacing:"--ll-spacing-small"}),c(k.Icon,{}),c(V,{spacing:"--ll-spacing-small"}),c(k.Title,{}),c(V,{}),c(k.Badge,{options:{isPrimary:i}})]})}),c(Un,{children:E(Fn,{children:[c(k.Description,{}),c(V,{vertical:!0,spacing:"--ll-spacing-small"}),c(k.BarChart,{options:{locationIcon:((l=(s=o.options)==null?void 0:s.marker)==null?void 0:l.icon)==="pin"?rt:it}}),c(Kn,{children:t==="high_schools"||t==="primary_schools"?c(Yn,{score:t}):c(ct,{include:W[t]})})]})})]})},t):null});ut.displayName="Score";const Qn=C.div`
137
+ padding: ${p["--ll-spacing-small"]} ${p["--ll-spacing-medium"]};
138
+ `,Jn=C.div`
139
+ display: flex;
140
+ justify-content: space-between;
141
+ align-items: center;
142
+ `,dt=R.memo(({tabContent:t})=>{const{data:e,isLoading:n,isFetching:o}=we(t.scores),{translations:r}=Ce();return E(Qn,{children:[E(Jn,{children:[c(te.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),o&&!n&&c(Ot,{size:"small"})]}),c(V,{spacing:"--ll-spacing-small",vertical:!0}),!o&&!Object.keys((e==null?void 0:e.location)||{}).length&&c(F,{color:"--ll-color-on-background-variant1",children:r.EMPTY_TEXT}),t.scores.map(i=>c(ut,{score:i,isLoading:n,scoresData:e},i))]})});dt.displayName="ScoreCategory";const ft=R.memo(({tabContent:t})=>{const{activeScore:e,setActiveScore:n}=A();return h.exports.useEffect(()=>{n(t.scores[0])},[]),c($t,{value:e,onValueChange:o=>{n(o)},type:"single",collapsible:!0,children:c(dt,{tabContent:t})})});ft.displayName="ScoreCategoryAccordion";const Xn=C.div`
143
+ overflow-y: auto;
144
+ `,qn=C.div`
145
+ position: absolute;
146
+ top: ${p["--ll-spacing-medium"]};
147
+ left: ${p["--ll-spacing-medium"]};
148
+ width: 360px;
149
+ max-height: calc(100% - 2 * ${p["--ll-spacing-medium"]});
150
+ z-index: 1;
151
+ border-radius: ${p["--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: ${p["--ll-color-background"]};
158
+ border: 1px solid ${p["--ll-color-border"]};
159
+ `;C.div`
160
+ display: flex;
161
+ justify-content: center;
162
+ padding: ${p["--ll-spacing-small"]};
163
+ `;const eo=C.div`
164
+ padding: ${p["--ll-spacing-xx-small"]};
165
+ border-bottom: 1px solid ${p["--ll-color-border"]};
166
+ `,to=C.div`
167
+ display: flex;
168
+ justify-content: center;
169
+ padding: ${p["--ll-spacing-small"]};
170
+ background-color: ${p["--ll-color-background"]};
171
+ `,pt=()=>c(to,{children:c(Rt.Root,{})}),ht=R.forwardRef((t,e)=>{const{activeCategory:n,setActiveCategory:o}=A();return c(te.Root,{options:{currentTab:n},onChange:r=>{o(r.data)},children:E(qn,{ref:e,children:[c(eo,{children:c(te.Tabs,{})}),c(Xn,{children:Y.map(r=>c(te.Content,{options:{value:r.value},children:c(ft,{tabContent:r},r.value)},r.value))}),c(pt,{})]})})});ht.displayName="DesktopScores";const no=C.div`
172
+ position: relative;
173
+ display: flex;
174
+ flex-direction: column;
175
+ height: 100vh;
176
+ `,De=t=>h.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},h.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"})),oo=t=>h.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},h.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"}),h.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"}),h.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"})),ro=t=>h.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},h.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"})),io=t=>h.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},h.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"})),mt={all:()=>["commute-calc"],list:t=>[...mt.all(),t]},so="https://router.hereapi.com/v8/routes?";function ao({transportMode:t,origin:e,destination:n}){const o={return:"polyline,summary,typicalDuration",transportMode:t,origin:e,destination:`${n==null?void 0:n.lat},${n==null?void 0:n.lng}`,apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE"},r=()=>fetch(so+new URLSearchParams(o)).then(i=>i.json()).then(i=>i.routes.length>0&&i.routes[0].sections.length>0?i.routes[0].sections[0]:[]).catch(i=>{zt(i)});return se(mt.list(o),r,{enabled:!!o&&!!n&&!!e})}const fe=(t,e,n)=>e===1?t:n!=null?n:`${t}s`,lo=[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],co=1,_=typeof BigInt<"u"?BigInt:Number;function uo(t){const e=t.charCodeAt(0);return lo[e-45]}function fo(t){let e=_(0),n=_(0);const o=[];if(t.split("").forEach(r=>{const i=_(uo(r));e|=(i&_(31))<<n,(i&_(32))===_(0)?(o.push(e),e=_(0),n=_(0)):n+=_(5)}),n>0)throw new Error("Invalid encoding");return o}function po(t,e){if(+t.toString()!==co)throw new Error("Invalid format version");const n=+e.toString(),o=n&15,r=n>>4&7,i=n>>7&15;return{precision:o,thirdDim:r,thirdDimPrecision:i}}function pe(t){let e=t;return e&_(1)&&(e=~e),e>>=_(1),+e.toString()}function ho(t){const e=fo(t),n=po(e[0],e[1]),o=10**n.precision,r=10**n.thirdDimPrecision,{thirdDim:i}=n;let s=0,l=0,a=0;const u=[];let d=2;for(;d<e.length;){const m=pe(e[d])/o,g=pe(e[d+1])/o;if(s+=m,l+=g,i){const y=pe(e[d+2])/r;a+=y,u.push([l,s,a]),d+=3}else u.push([l,s]),d+=2}if(d!==e.length)throw new Error("Invalid encoding. Premature ending reached");return{type:"FeatureCollection",features:[{id:"route",type:"Feature",geometry:{type:"LineString",coordinates:u}}]}}const mo=C.div`
177
+ max-height: calc(100% - 2 * ${p["--ll-spacing-medium"]});
178
+ border-radius: ${p["--ll-border-radius-medium"]};
179
+ box-shadow: ${p["--ll-shadow-small"]};
180
+ background-color: ${p["--ll-color-background"]};
181
+ border: 1px solid ${p["--ll-color-border"]};
182
+ padding: ${p["--ll-spacing-x-small"]};
183
+ `,go=C.div`
184
+ display: flex;
185
+ justify-content: space-between;
186
+ align-items: end;
187
+
188
+ ${Lt} {
189
+ width: 229px;
190
+ margin-right: ${p["--ll-spacing-x-small"]};
191
+ }
192
+ `,He=C.div`
193
+ background-color: ${p["--ll-color-surface"]};
194
+ padding: ${p["--ll-spacing-x-small"]} ${p["--ll-spacing-small"]} 0;
195
+ border-radius: ${p["--ll-border-radius-medium"]};
196
+ `,yo=C(We)`
197
+ position: absolute;
198
+ right: ${p["--ll-spacing-xx-small"]};
199
+ top: ${p["--ll-spacing-xx-small"]};
200
+ `,gt=({className:t,onClose:e})=>{var v,L,$,S;const{sdkState:n}=D(),{setCommuteGeojson:o,destination:r,setDestination:i}=A(),[s,l]=h.exports.useState("pedestrian"),a=be(),{translations:u}=Ce(),{data:d,isFetching:f,isFetched:m}=ao({destination:r,transportMode:s,origin:`${(L=(v=n==null?void 0:n.options)==null?void 0:v.marker)==null?void 0:L.lat},${(S=($=n==null?void 0:n.options)==null?void 0:$.marker)==null?void 0:S.lng}`});h.exports.useEffect(()=>{!(d!=null&&d.summary)||o(ho(d.polyline))},[d]);const g={pedestrian:[u.WALKING,ro],car:[u.DRIVING,oo]},y=h.exports.useMemo(()=>{if(!(d!=null&&d.summary))return null;const w=Math.floor(d.summary.typicalDuration/60/60),M=Math.floor(d.summary.typicalDuration/60%60);return w===0?`${M} ${fe(u.MINUTE,M)}`:`${w} ${fe(u.HOUR,w)} ${M} ${fe(u.MINUTE,M)}`},[d]),b=h.exports.useMemo(()=>{if(!(d!=null&&d.summary))return null;const w=Math.floor(d.summary.length/1e3);return w===0?`${d.summary.length} m`:`${w} km`},[d]),x=()=>f?c(J,{height:"70.4px",width:"100%"}):d!=null&&d.summary?E(He,{children:[c(F,{variant:"h5",children:y}),E(F,{children:[b," \u2013 ",u.FAST_ROUTE]})]}):E(He,{children:[c(F,{variant:"h5",children:u.NO_ROUTE}),c(F,{children:u.TRY_SUGGESTION})]});return E(mo,{className:t,children:[c(yo,{size:"medium",color:"neutral",onClick:e,SVGElement:io}),E(go,{children:[c(Et,{label:u.CALCULATE_COMMUTE,placeholder:u.SEARCH_MAP,renderListBelow:a,renderListBelowPosition:30,onSearch:w=>{i({lat:w.latitude,lng:w.longitude})}}),c(z.Root,{value:s,onValueChange:w=>{l(w)},children:E(z.Trigger,{children:[c(Fe,{SVGElement:g[s][1],fill:p["--ll-color-on-background-variant1"],width:16}),g[s][0],E(z.Content,{children:[c(z.Item,{value:"car",children:u.DRIVING}),c(z.Item,{value:"pedestrian",children:u.WALKING})]})]})})]}),(m||f)&&E(Q,{children:[c(V,{vertical:!0,spacing:"--ll-spacing-x-small"}),c(Pt,{open:!!d,children:x()})]})]})},vo=C.div`
201
+ position: absolute;
202
+ bottom: 0;
203
+ right: 0;
204
+ left: 0;
205
+ z-index: 3;
206
+ `,xo=C.div`
207
+ position: absolute;
208
+ top: ${p["--ll-spacing-medium"]};
209
+ right: ${p["--ll-spacing-medium"]};
210
+ z-index: 3;
211
+ max-width: 356px;
212
+ `,Co=C(We)`
213
+ box-shadow: ${p["--ll-shadow-medium"]};
214
+ position: absolute;
215
+ bottom: ${p["--ll-spacing-medium"]};
216
+ right: ${p["--ll-spacing-medium"]};
217
+ `,bo=C(gt)``,wo=C(gt)`
218
+ border-radius: ${p["--ll-border-radius-small"]}
219
+ ${p["--ll-border-radius-small"]} 0 0;
220
+ border: 0;
221
+ `,Mo=()=>{const{setCommuteGeojson:t,setDestination:e}=A(),[n,o]=h.exports.useState(!1),{translations:r}=Ce(),i=be(),s=()=>{e(void 0),t(void 0),o(!1)},l=()=>{o(!0)};return i?c(Q,{children:n?c(vo,{children:c(wo,{onClose:s})}):c(Co,{size:"large",SVGElement:De,onClick:l})}):c(xo,{children:n?c(bo,{onClose:s}):c(jt,{onClick:l,startAdornment:c(De,{}),children:r.CALCULATE_COMMUTE})})},So=()=>{var B,Se,$e;const{sdkState:t,setSdkState:e}=D(),{activeScore:n,activePOI:o,setActivePOI:r,hoveredPOI:i,commuteGeojson:s,destination:l}=A(),a=be(),u=Je(),d=Xe(),f=((Se=(B=t==null?void 0:t.globalOptions)==null?void 0:B.appearance)==null?void 0:Se.theme)==="night"?"dd191599-2a92-49fc-9a33-e12391753ad5":"600d69cb-288d-445e-9839-3dfe4d76b31a",m={id:"point",type:"line",paint:{"line-width":6,"line-color":"#0056D3"}},[g,y]=h.exports.useState(!1),b=h.exports.useMemo(()=>{var P,T;return(n==="high_schools"||n==="primary_schools")&&!d.isFetching?{[n]:((P=d==null?void 0:d.data)==null?void 0:P[n])||[]}:!(W&&n&&W[n]&&((T=W[n])==null?void 0:T.length))&&!u.isFetching?{[n]:[]}:u.data},[u.data,d.data,n]),x=h.exports.useMemo(()=>b?Object.entries(b).map(([T,j])=>j.map(O=>ce([O.lng,O.lat],{poi:O,type:T}))).flat().filter((T,j,O)=>O.findIndex(ae=>["lat","lng","name"].every(G=>ae.properties.poi[G]===T.properties.poi[G]))===j):[],[b]),v=h.exports.useMemo(()=>{var T,j,O;const P=((T=t==null?void 0:t.options)==null?void 0:T.marker)&&ce([(j=t==null?void 0:t.options)==null?void 0:j.marker.lng,(O=t==null?void 0:t.options)==null?void 0:O.marker.lat]);return[...x,...P?[P]:[],...l?[ce([l==null?void 0:l.lng,l==null?void 0:l.lat])]:[]]},[x,($e=t==null?void 0:t.options)==null?void 0:$e.marker,l]),L=h.exports.useRef(),[$,S]=It(),w=h.exports.useMemo(()=>({top:25+S.height,bottom:25,left:25,right:25}),[S.height]),M=h.exports.useMemo(()=>({top:50,bottom:50,left:S.width+32+50,right:50}),[S.width]),I=a?w:M,N=P=>{e({...t,options:{...t.options,lat:P.viewState.latitude,lng:P.viewState.longitude,zoom:P.viewState.zoom,bearing:P.viewState.bearing,pitch:P.viewState.pitch}})};return h.exports.useEffect(()=>{var G,Le;if(!v.length||!((G=t.options)!=null&&G.marker))return;const P=Kt(v.map(({geometry:Ee})=>[Ee.coordinates[1],Ee.coordinates[0]])),[T,j,O,ae]=me(P);(Le=L==null?void 0:L.current)==null||Le.fitBounds([[j,T],[ae,O]],{maxZoom:17,padding:I,duration:1e3})},[v,I]),t.options?c(hn,{mapRef:L,mapPadding:I,children:E(no,{children:[E(kt,{ref:L,mapLib:At,latitude:t.options.lat,longitude:t.options.lng,zoom:t.options.zoom,pitch:t.options.pitch,bearing:t.options.bearing,style:{flex:1,width:"100vw"},mapStyle:`https://api.maptiler.com/maps/${f}/style.json?key=9jNGatuzs05Q1oNlctEs`,onMove:N,cooperativeGestures:t.options.cooperativeGestures,onMoveStart:()=>y(!0),onMoveEnd:()=>y(!1),attributionControl:!1,children:[c(Tt,{compact:!0,position:a?"bottom-left":"bottom-right"}),c(_t,{position:a?"top-right":"bottom-right",showCompass:!0,style:{marginTop:a?16+S.height:16,marginRight:16}}),t.options.marker&&c(Ie,{marker:t.options.marker}),c(ot,{rect:S,zoom:t.options.zoom,mapRef:L,points:x,isMobile:a,activePOI:o,hoveredPOI:i,isMapMoving:g,setActivePOI:r}),a?c(st,{ref:$}):c(ht,{ref:$}),c(Mo,{}),l&&c(Ie,{marker:{icon:"pin",...l}}),s&&c(Bt,{type:"geojson",data:s,children:c(Wt,{...m})})]}),a&&c(pt,{})]})}):c("div",{children:"No options provided."})},Eo=()=>c(Zt,{children:c(So,{})});export{Eo as default};
@@ -1,4 +1,4 @@
1
- import{g as fa,c as la,n as ca,f as ha,S as pa,u as Ue,b as da,s as ga,p as ma,i as ya,k as va,m as wa,N as xa,P as Sa}from"./index.1b45b39b.js";import{R as _a,u as qn,r as re,j as w,s as L,y as b,U as Yn,i as D,v as zt,a6 as ba,O as Ea,d as Pe,L as je,q as Oe,t as Ra,T as pt,o as Kt,M as Ta,a7 as Aa,F as Xt,m as jn,a8 as Ca,a9 as $n,aa as Ne}from"./index.27821d72.js";const Wn=_a.createContext({}),xe=()=>re.exports.useContext(Wn),Oa=({children:l})=>{var h,E;const{sdkState:y}=qn(),[d,v]=re.exports.useReducer((k,N)=>({...k,...N}),{location:{lat:((h=y.options)==null?void 0:h.lat)||43.661337,lng:((E=y.options)==null?void 0:E.lng)||-79.401903},scores:{checked:!1,include:[]},pois:{checked:!1,include:[],radius:5e3,limit:15},schools:{checked:!1,radius:5e3,limit:15},demographics:{checked:!1,radius:2500},profiles:{checked:!1}}),m=re.exports.useMemo(()=>({dataExplorerState:d,setDataExplorerState:v}),[d,v]);return w(Wn.Provider,{value:m,children:l})},Fa=L.div`
1
+ import{g as fa,c as la,n as ca,f as ha,S as pa,u as Ue,b as da,s as ga,p as ma,i as ya,k as va,m as wa,N as xa,P as Sa}from"./index.1798f035.js";import{R as _a,u as qn,r as re,j as w,s as L,y as b,U as Yn,b as D,l as zt,a0 as ba,O as Ea,c as Pe,L as je,i as Oe,k as Ra,T as pt,g as Kt,M as Ta,a1 as Aa,F as Xt,h as jn,a2 as Ca,a3 as $n,a4 as Ne}from"./index.603e3d3b.js";const Wn=_a.createContext({}),xe=()=>re.exports.useContext(Wn),Oa=({children:l})=>{var h,E;const{sdkState:y}=qn(),[d,v]=re.exports.useReducer((k,N)=>({...k,...N}),{location:{lat:((h=y.options)==null?void 0:h.lat)||43.661337,lng:((E=y.options)==null?void 0:E.lng)||-79.401903},scores:{checked:!1,include:[]},pois:{checked:!1,include:[],radius:5e3,limit:15},schools:{checked:!1,radius:5e3,limit:15},demographics:{checked:!1,radius:2500},profiles:{checked:!1}}),m=re.exports.useMemo(()=>({dataExplorerState:d,setDataExplorerState:v}),[d,v]);return w(Wn.Provider,{value:m,children:l})},Fa=L.div`
2
2
  height: 100vh;
3
3
  display: flex;
4
4
  flex-direction: column;