@local-logic/sdks-app 1.0.0-beta.53 → 1.0.0-beta.55
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.
- package/dist/assets/auto-track.000d2da6.js +1 -0
- package/dist/assets/{chevron_right.f4a05ecb.js → chevron_right.f7f802f5.js} +5 -5
- package/dist/assets/index.1fe3a37f.js +183 -0
- package/dist/assets/index.252bea88.js +1 -0
- package/dist/assets/{index.039c8af5.js → index.6af2d34a.js} +46 -46
- package/dist/assets/{index.bd887e31.js → index.85e812f8.js} +16 -16
- package/dist/assets/index.95833aec.js +1345 -0
- package/dist/assets/index.b5fad94d.js +1 -0
- package/dist/assets/index.bec88049.js +1 -0
- package/dist/assets/index.e9c00339.js +1 -0
- package/dist/assets/index.f4705c55.js +1 -0
- package/dist/assets/index.umd.8e71fd05.js +1 -0
- package/dist/assets/is-plan-event-enabled.681b46ca.js +1 -0
- package/dist/index.html +1 -1
- package/dist/types/constants/tracking.d.ts +20 -0
- package/dist/types/constants/tracking.d.ts.map +1 -0
- package/dist/types/constants/tracking.js +21 -0
- package/dist/types/constants/tracking.js.map +1 -0
- package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.js +6 -0
- package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/context.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/context.js +19 -1
- package/dist/types/sdks/LocalContent/context.js.map +1 -1
- package/dist/types/sdks/LocalContent/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/index.js +6 -2
- package/dist/types/sdks/LocalContent/index.js.map +1 -1
- package/dist/types/services/tracking/index.d.ts +11 -0
- package/dist/types/services/tracking/index.d.ts.map +1 -0
- package/dist/types/services/tracking/index.js +20 -0
- package/dist/types/services/tracking/index.js.map +1 -0
- package/package.json +14 -3
- package/dist/assets/index.8143f5fa.js +0 -183
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c,c as h,e as L,a as m}from"./index.85e812f8.js";import{l as P,g as z,u as M,i as k,a as R,C as S,b as C,c as y,e as A,m as B,p as F,P as O,f as Q,h as W,j as G,k as T}from"./index.1fe3a37f.js";import{i as U}from"./is-plan-event-enabled.681b46ca.js";import"./chevron_right.f7f802f5.js";function N(e){return e.toLowerCase().replace(".","").replace(/\s+/g,"-")}function j(e,t){return t===void 0&&(t=!1),t?btoa(e).replace(/=/g,""):void 0}function V(e,t,n){var i,r;try{var a=((r=(i=window==null?void 0:window.performance)===null||i===void 0?void 0:i.getEntriesByName(e,"resource"))!==null&&r!==void 0?r:[])[0];a&&t.stats.gauge("legacy_destination_time",Math.round(a.duration),L([n],a.duration<100?["cached"]:[],!0))}catch{}}function H(e,t,n,i,r,a){return c(this,void 0,void 0,function(){var o,s,u,f,l,v,d,w,g;return h(this,function(p){switch(p.label){case 0:o=N(n),s=j(o,a),u=z(),f="".concat(u,"/integrations/").concat(s!=null?s:o,"/").concat(i,"/").concat(s!=null?s:o,".dynamic.js.gz"),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,P(f)];case 2:return p.sent(),V(f,e,n),[3,4];case 3:throw l=p.sent(),e.stats.gauge("legacy_destination_time",-1,["plugin:".concat(n),"failed"]),l;case 4:return v=window["".concat(o,"Deps")],[4,Promise.all(v.map(function(_){return P(u+_+".gz")}))];case 5:return p.sent(),window["".concat(o,"Loader")](),d=window["".concat(o,"Integration")],d.Integration&&(w={user:function(){return t.user()},addIntegration:function(){}},d(w),d=d.Integration),g=new d(r),g.analytics=t,[2,g]}})})}function J(e,t,n){return c(this,void 0,void 0,function(){var i,r,a,o;return h(this,function(s){return i=z(),r=N(e),a=j(e,n),o="".concat(i,"/integrations/").concat(a!=null?a:r,"/").concat(t,"/").concat(a!=null?a:r,".dynamic.js.gz"),[2,M(o)]})})}function K(e){var t,n,i,r;return(r=(n=(t=e.versionSettings)===null||t===void 0?void 0:t.override)!==null&&n!==void 0?n:(i=e.versionSettings)===null||i===void 0?void 0:i.version)!==null&&r!==void 0?r:"latest"}function X(e,t){return c(this,void 0,void 0,function(){var n,i=this;return h(this,function(r){switch(r.label){case 0:return n=[],k()?[2,t]:[4,F(function(){return t.length>0&&G()},function(){return c(i,void 0,void 0,function(){var a,o,s;return h(this,function(u){switch(u.label){case 0:return a=t.pop(),a?[4,W(a,e)]:[2];case 1:return o=u.sent(),s=o instanceof T,s||n.push(a),[2]}})})})];case 1:return r.sent(),n.map(function(a){return t.pushWithBackoff(a)}),[2,t]}})})}var Y=function(){function e(t,n,i,r){i===void 0&&(i={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=n,this.settings=m({},i),this.settings.type&&this.settings.type==="browser"&&delete this.settings.type,this.options=r,this.buffer=r.disableClientPersistence?new O(4,[]):new Q(4,"dest-".concat(t)),this.scheduleFlush()}return e.prototype.isLoaded=function(){return this._ready},e.prototype.ready=function(){var t;return(t=this.onReady)!==null&&t!==void 0?t:Promise.resolve()},e.prototype.load=function(t,n){return c(this,void 0,void 0,function(){var i,r=this;return h(this,function(a){switch(a.label){case 0:return this._ready||this.onReady!==void 0?[2]:(i=this,[4,H(t,n,this.name,this.version,this.settings,this.options.obfuscate)]);case 1:i.integration=a.sent(),this.onReady=new Promise(function(o){var s=function(){r._ready=!0,o(!0)};r.integration.once("ready",s)}),this.onInitialize=new Promise(function(o){var s=function(){r._initialized=!0,o(!0)};r.integration.on("initialize",s)});try{t.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(o){throw t.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),o}return[2]}})})},e.prototype.unload=function(t,n){return J(this.name,this.version,this.options.obfuscate)},e.prototype.addMiddleware=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];this.middleware=(t=this.middleware).concat.apply(t,n)},e.prototype.shouldBuffer=function(t){return t.event.type!=="page"&&(k()||this._ready===!1||this._initialized===!1)},e.prototype.send=function(t,n,i){var r,a;return c(this,void 0,void 0,function(){var o,s,u,f,l,v;return h(this,function(d){switch(d.label){case 0:if(this.shouldBuffer(t))return this.buffer.push(t),this.scheduleFlush(),[2,t];if(o=(a=(r=this.options)===null||r===void 0?void 0:r.plan)===null||a===void 0?void 0:a.track,s=t.event.event,o&&s&&this.name!=="Segment.io"){if(u=o[s],U(o,u))t.updateEvent("integrations",m(m({},t.event.integrations),u==null?void 0:u.integrations));else return t.updateEvent("integrations",m(m({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new S({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t];if((u==null?void 0:u.enabled)&&(u==null?void 0:u.integrations[this.name])===!1)return t.cancel(new S({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t]}return[4,C(this.name,t.event,this.middleware)];case 1:if(f=d.sent(),f===null)return[2,t];l=new n(f,{}),t.stats.increment("analytics_js.integration.invoke",1,["method:".concat(i),"integration_name:".concat(this.name)]),d.label=2;case 2:return d.trys.push([2,5,,6]),this.integration?[4,R(this.integration.invoke.call(this.integration,i,l))]:[3,4];case 3:d.sent(),d.label=4;case 4:return[3,6];case 5:throw v=d.sent(),t.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(i),"integration_name:".concat(this.name)]),v;case 6:return[2,t]}})})},e.prototype.track=function(t){return c(this,void 0,void 0,function(){return h(this,function(n){return[2,this.send(t,y.Track,"track")]})})},e.prototype.page=function(t){var n;return c(this,void 0,void 0,function(){var i=this;return h(this,function(r){return((n=this.integration)===null||n===void 0?void 0:n._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then(function(){return i.send(t,y.Page,"page")})]})})},e.prototype.identify=function(t){return c(this,void 0,void 0,function(){return h(this,function(n){return[2,this.send(t,y.Identify,"identify")]})})},e.prototype.alias=function(t){return c(this,void 0,void 0,function(){return h(this,function(n){return[2,this.send(t,y.Alias,"alias")]})})},e.prototype.group=function(t){return c(this,void 0,void 0,function(){return h(this,function(n){return[2,this.send(t,y.Group,"group")]})})},e.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout(function(){return c(t,void 0,void 0,function(){var n;return h(this,function(i){switch(i.label){case 0:return this.flushing=!0,n=this,[4,X(this,this.buffer)];case 1:return n.buffer=i.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}})})},Math.random()*5e3)},e}();function tt(e,t,n,i){var r,a;if(t===void 0&&(t={}),n===void 0&&(n={}),A())return[];e.plan&&(n=n!=null?n:{},n.plan=e.plan);var o=(a=(r=e.middlewareSettings)===null||r===void 0?void 0:r.routingRules)!==null&&a!==void 0?a:[],s=B(e,n!=null?n:{});return Object.entries(e.integrations).map(function(u){var f,l=u[0],v=u[1];if(!l.startsWith("Segment")){var d=t.All===!1&&t[l]===void 0;if(!(t[l]===!1||d)){var w=v.type,g=v.bundlingStatus,p=v.versionSettings,_=g!=="unbundled"&&(w==="browser"||((f=p==null?void 0:p.componentTypes)===null||f===void 0?void 0:f.includes("browser")));if(!(!_&&l!=="Segment.io"||l==="Iterable")){var D=K(v),b=new Y(l,D,s[l],n),E=o.filter(function(I){return I.destinationName===l});return E.length>0&&i&&b.addMiddleware(i),b}}}}).filter(function(u){return u!==void 0})}export{Y as LegacyDestination,tt as ajsDestinations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as n,c as o,f as u}from"./index.85e812f8.js";function s(e){return n(this,void 0,void 0,function(){var t;return o(this,function(r){switch(r.label){case 0:return[4,u(()=>import("./index.umd.8e71fd05.js").then(function(i){return i.i}),["assets/index.umd.8e71fd05.js","assets/chevron_right.f7f802f5.js","assets/chevron_right.2aa1109f.css","assets/index.85e812f8.js"])];case 1:return t=r.sent(),e._plugins=t,[2]}})})}export{s as loadLegacyVideoPlugins};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./index.85e812f8.js";import{i as l}from"./is-plan-event-enabled.681b46ca.js";function c(r,u){var i,n;if(!r||!Object.keys(r))return{};var o=Object.keys(r.integrations).filter(function(e){return r.integrations[e]===!1}),s=[];return((i=u.remotePlugins)!==null&&i!==void 0?i:[]).forEach(function(e){o.forEach(function(t){(e.name.includes(t)||t.includes(e.name))&&s.push(e.name)})}),((n=u.remotePlugins)!==null&&n!==void 0?n:[]).reduce(function(e,t){return t.settings.subscriptions&&s.includes(t.name)&&t.settings.subscriptions.forEach(function(f){return e["".concat(t.name," ").concat(f.partnerAction)]=!1}),e},{})}function v(r,u){function i(n){var o=r,s=n.event.event;if(o&&s){var e=o[s];if(l(o,e)){var t=c(e,u);n.updateEvent("integrations",a(a(a({},n.event.integrations),e==null?void 0:e.integrations),t))}else return n.updateEvent("integrations",a(a({},n.event.integrations),{All:!1,"Segment.io":!0})),n}return n}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:i,alias:i,track:i,identify:i,group:i}}export{v as schemaFilter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as y}from"./index.1fe3a37f.js";import"./chevron_right.f7f802f5.js";import"./index.85e812f8.js";function _(a,i){return Object.keys(i).reduce(function(e,s){if(s.startsWith(a)){var r=s.substr(a.length);e[r]=i[s]}return e},{})}function P(a,i){var e=document.createElement("a");e.href=i;var s=e.search.slice(1),r=s.split("&").reduce(function(n,l){var u=l.split("="),A=u[0],h=u[1];return n[A]=y(h),n},{}),t=[],v=r.ajs_uid,d=r.ajs_event,j=r.ajs_aid;if(j){var o=Array.isArray(r.ajs_aid)?r.ajs_aid[0]:r.ajs_aid;a.setAnonymousId(o)}if(v){var p=Array.isArray(r.ajs_uid)?r.ajs_uid[0]:r.ajs_uid,f=_("ajs_trait_",r);t.push(a.identify(p,f))}if(d){var m=Array.isArray(r.ajs_event)?r.ajs_event[0]:r.ajs_event,c=_("ajs_prop_",r);t.push(a.track(m,c))}return Promise.all(t)}export{P as queryString};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as x}from"./chevron_right.f7f802f5.js";function _(g,w){return w.forEach(function(f){f&&typeof f!="string"&&!Array.isArray(f)&&Object.keys(f).forEach(function(l){if(l!=="default"&&!(l in g)){var s=Object.getOwnPropertyDescriptor(f,l);Object.defineProperty(g,l,s.get?s:{enumerable:!0,get:function(){return f[l]}})}})}),Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}var S={exports:{}};(function(g,w){(function(f,l){g.exports=l()})(window,function(){return function(f){var l={};function s(i){if(l[i])return l[i].exports;var u=l[i]={i,l:!1,exports:{}};return f[i].call(u.exports,u,u.exports,s),u.l=!0,u.exports}return s.m=f,s.c=l,s.d=function(i,u,c){s.o(i,u)||Object.defineProperty(i,u,{enumerable:!0,get:c})},s.r=function(i){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},s.t=function(i,u){if(1&u&&(i=s(i)),8&u||4&u&&typeof i=="object"&&i&&i.__esModule)return i;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:i}),2&u&&typeof i!="string")for(var d in i)s.d(c,d,function(p){return i[p]}.bind(null,d));return c},s.n=function(i){var u=i&&i.__esModule?function(){return i.default}:function(){return i};return s.d(u,"a",u),u},s.o=function(i,u){return Object.prototype.hasOwnProperty.call(i,u)},s.p="",s(s.s=2)}([function(f,l,s){s.r(l);var i=typeof fetch=="function"?fetch.bind():function(u,c){return c=c||{},new Promise(function(d,p){var r=new XMLHttpRequest;for(var a in r.open(c.method||"get",u,!0),c.headers)r.setRequestHeader(a,c.headers[a]);function t(){var e,n=[],o=[],h={};return r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(y,m,b){n.push(m=m.toLowerCase()),o.push([m,b]),e=h[m],h[m]=e?e+","+b:b}),{ok:(r.status/100|0)==2,status:r.status,statusText:r.statusText,url:r.responseURL,clone:t,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},headers:{keys:function(){return n},entries:function(){return o},get:function(y){return h[y.toLowerCase()]},has:function(y){return y.toLowerCase()in h}}}}r.withCredentials=c.credentials=="include",r.onload=function(){d(t())},r.onerror=p,r.send(c.body)})};l.default=i},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function c(d,p){for(var r=0;r<p.length;r++){var a=p[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}}return function(d,p,r){return p&&c(d.prototype,p),r&&c(d,r),d}}(),u=function(){function c(d,p){(function(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")})(this,c),this.pluginName=d}return i(c,[{key:"track",value:function(d,p){window.analytics.track(d,p,{integration:{name:this.pluginName}})}}]),c}();l.default=u},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0}),l.YouTubeAnalytics=l.VimeoAnalytics=void 0;var i=c(s(3)),u=c(s(4));function c(d){return d&&d.__esModule?d:{default:d}}l.VimeoAnalytics=i.default,l.YouTubeAnalytics=u.default},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function p(r,a){for(var t=0;t<a.length;t++){var e=a[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,e.key,e)}}return function(r,a,t){return a&&p(r.prototype,a),t&&p(r,t),r}}(),u=c(s(0));function c(p){return p&&p.__esModule?p:{default:p}}var d=function(p){function r(a,t){(function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")})(this,r);var e=function(n,o){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||typeof o!="object"&&typeof o!="function"?n:o}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,"VimeoAnalytics"));return e.authToken=t,e.player=a,e.metadata={content:{},playback:{videoPlayer:"Vimeo"}},e.mostRecentHeartbeat=0,e.isPaused=!1,e}return function(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(a,t):a.__proto__=t)}(r,p),i(r,[{key:"initialize",value:function(){var a=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var e in t)this.registerHandler(e,t[e]);this.player.getVideoId().then(function(n){a.retrieveMetadata({id:n})}).catch(console.error)}},{key:"registerHandler",value:function(a,t){var e=this;this.player.on(a,function(n){e.updateMetadata(n),t.call(e,n)})}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var a=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==a&&t-a>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(t))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(a){var t=this;return new Promise(function(e,n){var o=a.id;(0,u.default)("https://api.vimeo.com/videos/"+o,{headers:{Authorization:"Bearer "+t.authToken}}).then(function(h){return h.ok?h.json():n(h)}).then(function(h){t.metadata.content.title=h.name,t.metadata.content.description=h.description,t.metadata.content.publisher=h.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=h.duration}).catch(function(h){return console.error("Request to Vimeo API Failed with: ",h),n(h)})})}},{key:"updateMetadata",value:function(a){var t=this;return new Promise(function(e,n){t.player.getVolume().then(function(o){o&&(t.metadata.playback.sound=100*o),t.metadata.playback.position=a.seconds,e()}).catch(n)})}}]),r}(c(s(1)).default);l.default=d},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}}(),u=d(s(0)),c=d(s(1));function d(a){return a&&a.__esModule?a:{default:a}}var p=function(a){function t(e,n){(function(h,y){if(!(h instanceof y))throw new TypeError("Cannot call a class as a function")})(this,t);var o=function(h,y){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!y||typeof y!="object"&&typeof y!="function"?h:y}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return o.player=e,o.apiKey=n,o.playerLoaded=!1,o.playbackStarted=!1,o.contentStarted=!1,o.isPaused=!1,o.isBuffering=!1,o.isSeeking=!1,o.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},o.metadata=[{playback:{video_player:"youtube"},content:{}}],o.playlistIndex=0,o}return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}(t,a),i(t,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(e){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(e){var n=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=n,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),e.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var e=this;return new Promise(function(n,o){var h=e.player.getVideoData(),y=e.player.getPlaylist()||[h.video_id],m=y.join();(0,u.default)("https://www.googleapis.com/youtube/v3/videos?id="+m+"&part=snippet,contentDetails&key="+e.apiKey).then(function(b){if(!b.ok){var v=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw v.response=b,v}return b.json()}).then(function(b){e.metadata=[];for(var v=0,k=0;k<y.length;k++){var P=b.items[k];e.metadata.push({content:{title:P.snippet.title,description:P.snippet.description,keywords:P.snippet.tags,channel:P.snippet.channelTitle,airdate:P.snippet.publishedAt}}),v+=r(P.contentDetails.duration)}for(k=0;k<y.length;k++)e.metadata[k].playback={total_length:v,video_player:"youtube"};n()}).catch(function(b){e.metadata=y.map(function(v){return{playback:{video_player:"youtube"},content:{}}}),o(b)})})}},{key:"handleBuffer",value:function(){var e=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),e&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var n=this.player.getPlaylist();n&&this.player.getCurrentTime()===0&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===n.length-1&&this.player.getPlaylistIndex()===0&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),this.playlistIndex===-1&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var e=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(e?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var e=this.player.getPlaylistIndex(),n=this.player.getPlaylist();(n&&e===n.length-1||e===-1)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var e=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,n=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-n)>2e3}}]),t}(c.default);function r(a){var t=a.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map(function(e){if(e!=null)return e.replace(/\D/,"")}),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}l.default=p}])})})(S);var O=x(S.exports),j=_({__proto__:null,default:O},[S.exports]);export{j as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function l(e,d){var o,i;return typeof(d==null?void 0:d.enabled)=="boolean"?d.enabled:(i=(o=e==null?void 0:e.__default)===null||o===void 0?void 0:o.enabled)!==null&&i!==void 0?i:!0}export{l as i};
|
package/dist/index.html
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<link rel="manifest" href="data:application/manifest+json;base64,eyJuYW1lIjoiIiwic2hvcnRfbmFtZSI6IiIsImljb25zIjpbeyJzcmMiOiIvYW5kcm9pZC1jaHJvbWUtMTkyeDE5Mi5wbmciLCJzaXplcyI6IjE5MngxOTIiLCJ0eXBlIjoiaW1hZ2UvcG5nIn0seyJzcmMiOiIvYW5kcm9pZC1jaHJvbWUtNTEyeDUxMi5wbmciLCJzaXplcyI6IjUxMng1MTIiLCJ0eXBlIjoiaW1hZ2UvcG5nIn1dLCJ0aGVtZV9jb2xvciI6IiNmZmZmZmYiLCJiYWNrZ3JvdW5kX2NvbG9yIjoiI2ZmZmZmZiIsImRpc3BsYXkiOiJzdGFuZGFsb25lIn0=" />
|
|
24
24
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
25
25
|
<title>Local Logic</title>
|
|
26
|
-
<script type="module" crossorigin src="/sdks-app/v1/assets/index.
|
|
26
|
+
<script type="module" crossorigin src="/sdks-app/v1/assets/index.85e812f8.js"></script>
|
|
27
27
|
</head>
|
|
28
28
|
<body style="overflow: hidden; margin: 0;">
|
|
29
29
|
<script src="http://localhost:8097"></script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum TrackingEvents {
|
|
2
|
+
LC_VIEWED = "LC-Viewed",
|
|
3
|
+
LC_CATEGORY_CLICK = "LC-Category-Clicked",
|
|
4
|
+
LC_CATEGORY_VIEW = "LC-Category-Viewed",
|
|
5
|
+
LC_SCORE_CLICK = "LC-Score-Clicked",
|
|
6
|
+
LC_SCORE_VIEW = "LC-Score-Viewed",
|
|
7
|
+
LC_TRANSPORT_MODE_CLICK = "LC-Transportation-Method-Clicked",
|
|
8
|
+
LC_LONG_DESCRIPTION_CLICK = "LC-Long-Description-Clicked",
|
|
9
|
+
LC_LONG_DESCRIPTION_VIEW = "LC-Long-Description-Viewed",
|
|
10
|
+
LC_POI_CLICK = "LC-POI-Clicked",
|
|
11
|
+
LC_POI_VIEW = "LC-POI-Viewed",
|
|
12
|
+
LC_LIST_VIEW_CLICK = "LC-List-View-Clicked",
|
|
13
|
+
LC_MAP_VIEW_CLICK = "LC-Map-View-Clicked",
|
|
14
|
+
LC_SCORES_LIST_SCROLL = "LC-Scores-List-Scroll",
|
|
15
|
+
LC_COMMUTE_CALC_CLICK = "LC-Commute-Calc-Clicked",
|
|
16
|
+
LC_COMMUTE_CALC_VIEW = "LC-Commute-Calc-Viewed",
|
|
17
|
+
LC_COMMUTE_CALCULATE_CLICK = "LC-Commute-Calc-Calculate-Clicked",
|
|
18
|
+
LC_ATTRIBUTION_CLICK = "LC-Attribution-Clicked"
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../../src/constants/tracking.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,SAAS,cAAc;IACvB,iBAAiB,wBAAwB;IACzC,gBAAgB,uBAAuB;IACvC,cAAc,qBAAqB;IACnC,aAAa,oBAAoB;IACjC,uBAAuB,qCAAqC;IAC5D,yBAAyB,gCAAgC;IACzD,wBAAwB,+BAA+B;IACvD,YAAY,mBAAmB;IAC/B,WAAW,kBAAkB;IAC7B,kBAAkB,yBAAyB;IAC3C,iBAAiB,wBAAwB;IACzC,qBAAqB,0BAA0B;IAC/C,qBAAqB,4BAA4B;IACjD,oBAAoB,2BAA2B;IAC/C,0BAA0B,sCAAsC;IAChE,oBAAoB,2BAA2B;CAChD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export var TrackingEvents;
|
|
2
|
+
(function (TrackingEvents) {
|
|
3
|
+
TrackingEvents["LC_VIEWED"] = "LC-Viewed";
|
|
4
|
+
TrackingEvents["LC_CATEGORY_CLICK"] = "LC-Category-Clicked";
|
|
5
|
+
TrackingEvents["LC_CATEGORY_VIEW"] = "LC-Category-Viewed";
|
|
6
|
+
TrackingEvents["LC_SCORE_CLICK"] = "LC-Score-Clicked";
|
|
7
|
+
TrackingEvents["LC_SCORE_VIEW"] = "LC-Score-Viewed";
|
|
8
|
+
TrackingEvents["LC_TRANSPORT_MODE_CLICK"] = "LC-Transportation-Method-Clicked";
|
|
9
|
+
TrackingEvents["LC_LONG_DESCRIPTION_CLICK"] = "LC-Long-Description-Clicked";
|
|
10
|
+
TrackingEvents["LC_LONG_DESCRIPTION_VIEW"] = "LC-Long-Description-Viewed";
|
|
11
|
+
TrackingEvents["LC_POI_CLICK"] = "LC-POI-Clicked";
|
|
12
|
+
TrackingEvents["LC_POI_VIEW"] = "LC-POI-Viewed";
|
|
13
|
+
TrackingEvents["LC_LIST_VIEW_CLICK"] = "LC-List-View-Clicked";
|
|
14
|
+
TrackingEvents["LC_MAP_VIEW_CLICK"] = "LC-Map-View-Clicked";
|
|
15
|
+
TrackingEvents["LC_SCORES_LIST_SCROLL"] = "LC-Scores-List-Scroll";
|
|
16
|
+
TrackingEvents["LC_COMMUTE_CALC_CLICK"] = "LC-Commute-Calc-Clicked";
|
|
17
|
+
TrackingEvents["LC_COMMUTE_CALC_VIEW"] = "LC-Commute-Calc-Viewed";
|
|
18
|
+
TrackingEvents["LC_COMMUTE_CALCULATE_CLICK"] = "LC-Commute-Calc-Calculate-Clicked";
|
|
19
|
+
TrackingEvents["LC_ATTRIBUTION_CLICK"] = "LC-Attribution-Clicked";
|
|
20
|
+
})(TrackingEvents || (TrackingEvents = {}));
|
|
21
|
+
//# sourceMappingURL=tracking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/constants/tracking.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAkBX;AAlBD,WAAY,cAAc;IACxB,yCAAuB,CAAA;IACvB,2DAAyC,CAAA;IACzC,yDAAuC,CAAA;IACvC,qDAAmC,CAAA;IACnC,mDAAiC,CAAA;IACjC,8EAA4D,CAAA;IAC5D,2EAAyD,CAAA;IACzD,yEAAuD,CAAA;IACvD,iDAA+B,CAAA;IAC/B,+CAA6B,CAAA;IAC7B,6DAA2C,CAAA;IAC3C,2DAAyC,CAAA;IACzC,iEAA+C,CAAA;IAC/C,mEAAiD,CAAA;IACjD,iEAA+C,CAAA;IAC/C,kFAAgE,CAAA;IAChE,iEAA+C,CAAA;AACjD,CAAC,EAlBW,cAAc,KAAd,cAAc,QAkBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAYxD,UAAU,UAAU;IAClB,KAAK,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1C,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/C,SAAS,EAAE,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;CAC1D;AAED,QAAA,MAAM,KAAK,yDAA2C,UAAU,iBAuD9D,CAAC;AAIH,eAAe,KAAK,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { LoadingItem, Spacer, SVG, theme } from "@local-logic/ui";
|
|
|
3
3
|
import { Score as ScoreE, ScorePOIs } from "@local-logic/elements-react";
|
|
4
4
|
import * as Accordion from "@radix-ui/react-accordion";
|
|
5
5
|
import ChevronRightSVG from "~/assets/icons/chevron_right.svg";
|
|
6
|
+
import tracking from "~/services/tracking";
|
|
7
|
+
import { TrackingEvents } from "~/constants/tracking";
|
|
6
8
|
import Schools from "../../../../Schools";
|
|
7
9
|
import POIs from "../../../../POIs";
|
|
8
10
|
import * as S from "./styles";
|
|
@@ -16,6 +18,10 @@ const Score = React.memo(({ score, isLoading, data }) => {
|
|
|
16
18
|
React.createElement(ScoreE.Root, { options: {
|
|
17
19
|
score,
|
|
18
20
|
data,
|
|
21
|
+
}, onChange: (e) => {
|
|
22
|
+
if (e.type === "tooltip-toggle" && e.data) {
|
|
23
|
+
tracking.trackEvent(TrackingEvents.LC_LONG_DESCRIPTION_VIEW, score);
|
|
24
|
+
}
|
|
19
25
|
} },
|
|
20
26
|
React.createElement(S.Header, null,
|
|
21
27
|
React.createElement(S.Trigger, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../src/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGlE,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,eAAe,MAAM,kCAAkC,CAAC;AAC/D,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC;AAQ1C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAc,EAAE,EAAE;IAClE,IAAI,SAAS,EAAE;QACb,OAAO,CACL,oBAAC,CAAC,CAAC,oBAAoB;YACrB,oBAAC,WAAW,IAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,GAAI,CAC/B,CAC1B,CAAC;KACH;IAED,OAAO,CACL,oBAAC,SAAS,CAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK;QACtC,oBAAC,MAAM,CAAC,IAAI,IACV,OAAO,EAAE;gBACP,KAAK;gBACL,IAAI;aACL;YAED,oBAAC,CAAC,CAAC,MAAM;gBACP,oBAAC,CAAC,CAAC,OAAO;oBACR,oBAAC,CAAC,CAAC,gBAAgB;wBACjB,oBAAC,GAAG,IACF,UAAU,EAAE,eAAsC,EAClD,IAAI,EAAE,KAAK,CAAC,mCAAmC,CAAC,GAChD,CACiB;oBACrB,oBAAC,MAAM,IAAC,OAAO,EAAC,oBAAoB,GAAG;oBACvC,oBAAC,MAAM,CAAC,IAAI,OAAG;oBACf,oBAAC,MAAM,IAAC,OAAO,EAAC,oBAAoB,GAAG;oBACvC,oBAAC,MAAM,CAAC,KAAK,OAAG;oBAChB,oBAAC,MAAM,OAAG;oBACV,oBAAC,MAAM,CAAC,KAAK,OAAG,CACN,CACH;YACX,oBAAC,CAAC,CAAC,OAAO;gBACR,oBAAC,CAAC,CAAC,YAAY;oBACb,oBAAC,MAAM,CAAC,WAAW,OAAG;oBACtB,oBAAC,MAAM,IAAC,QAAQ,QAAC,OAAO,EAAC,oBAAoB,GAAG;oBAChD,oBAAC,MAAM,CAAC,QAAQ,OAAG;oBACnB,oBAAC,CAAC,CAAC,YAAY,QACZ,KAAK,KAAK,cAAc,IAAI,KAAK,KAAK,iBAAiB,CAAC,CAAC,CAAC,CACzD,oBAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI,CAC1B,CAAC,CAAC,CAAC,CACF,oBAAC,IAAI,IAAC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,GAAI,CACpC,CACc,CACF,CACP,CACA,CACC,CAClB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,eAAe,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../src/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGlE,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,eAAe,MAAM,kCAAkC,CAAC;AAC/D,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC;AAQ1C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAc,EAAE,EAAE;IAClE,IAAI,SAAS,EAAE;QACb,OAAO,CACL,oBAAC,CAAC,CAAC,oBAAoB;YACrB,oBAAC,WAAW,IAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,GAAI,CAC/B,CAC1B,CAAC;KACH;IAED,OAAO,CACL,oBAAC,SAAS,CAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK;QACtC,oBAAC,MAAM,CAAC,IAAI,IACV,OAAO,EAAE;gBACP,KAAK;gBACL,IAAI;aACL,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,IAAI,CAAC,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,CAAC,IAAI,EAAE;oBACzC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;iBACrE;YACH,CAAC;YAED,oBAAC,CAAC,CAAC,MAAM;gBACP,oBAAC,CAAC,CAAC,OAAO;oBACR,oBAAC,CAAC,CAAC,gBAAgB;wBACjB,oBAAC,GAAG,IACF,UAAU,EAAE,eAAsC,EAClD,IAAI,EAAE,KAAK,CAAC,mCAAmC,CAAC,GAChD,CACiB;oBACrB,oBAAC,MAAM,IAAC,OAAO,EAAC,oBAAoB,GAAG;oBACvC,oBAAC,MAAM,CAAC,IAAI,OAAG;oBACf,oBAAC,MAAM,IAAC,OAAO,EAAC,oBAAoB,GAAG;oBACvC,oBAAC,MAAM,CAAC,KAAK,OAAG;oBAChB,oBAAC,MAAM,OAAG;oBACV,oBAAC,MAAM,CAAC,KAAK,OAAG,CACN,CACH;YACX,oBAAC,CAAC,CAAC,OAAO;gBACR,oBAAC,CAAC,CAAC,YAAY;oBACb,oBAAC,MAAM,CAAC,WAAW,OAAG;oBACtB,oBAAC,MAAM,IAAC,QAAQ,QAAC,OAAO,EAAC,oBAAoB,GAAG;oBAChD,oBAAC,MAAM,CAAC,QAAQ,OAAG;oBACnB,oBAAC,CAAC,CAAC,YAAY,QACZ,KAAK,KAAK,cAAc,IAAI,KAAK,KAAK,iBAAiB,CAAC,CAAC,CAAC,CACzD,oBAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI,CAC1B,CAAC,CAAC,CAAC,CACF,oBAAC,IAAI,IAAC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,GAAI,CACpC,CACc,CACF,CACP,CACA,CACC,CAClB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/sdks/LocalContent/context.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/sdks/LocalContent/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAmB,MAAM,6BAA6B,CAAC;AAK/E,oBAAY,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;IAC3C,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC;IAC/D,cAAc,EAAE,eAAe,CAAC;IAChC,iBAAiB,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,SAAS,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACtD,UAAU,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACvD,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAClE,CAAC;AAKF,QAAA,MAAM,eAAe,sBAAwC,CAAC;AA4C9D,QAAA,MAAM,oBAAoB;cAA8B,MAAM,SAAS;iBAiGtE,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/* eslint-disable consistent-return */
|
|
2
2
|
/* eslint-disable default-case */
|
|
3
|
-
import React, { useContext, useState, useMemo, useReducer } from "react";
|
|
3
|
+
import React, { useContext, useState, useMemo, useReducer, useEffect, } from "react";
|
|
4
4
|
import { scoreCategories } from "@local-logic/elements-react";
|
|
5
5
|
import { baseStyles } from "@local-logic/ui";
|
|
6
|
+
import tracking from "~/services/tracking";
|
|
7
|
+
import { TrackingEvents } from "~/constants/tracking";
|
|
6
8
|
const LocalContentContext = React.createContext({});
|
|
7
9
|
const useLocalContent = () => useContext(LocalContentContext);
|
|
8
10
|
const scoreCategoryReducer = (state, action) => {
|
|
@@ -51,8 +53,24 @@ const LocalContentProvider = ({ children }) => {
|
|
|
51
53
|
const [scoreCategory, setScoreCategory] = useReducer(scoreCategoryReducer, scoreCategoryDefault);
|
|
52
54
|
const [activePOI, setActivePOI] = useState();
|
|
53
55
|
const [hoveredPOI, setHoveredPOI] = useState();
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (activePOI) {
|
|
58
|
+
tracking.trackEvent(TrackingEvents.LC_POI_VIEW, {
|
|
59
|
+
poi_name: activePOI === null || activePOI === void 0 ? void 0 : activePOI.name,
|
|
60
|
+
poi_info: activePOI === null || activePOI === void 0 ? void 0 : activePOI.address,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, [activePOI]);
|
|
54
64
|
const { activeCategory } = scoreCategory;
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
tracking.trackEvent(TrackingEvents.LC_CATEGORY_VIEW, activeCategory);
|
|
67
|
+
}, [activeCategory]);
|
|
55
68
|
const activeScore = scoreCategory.activeScoreByCategory[activeCategory];
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (activeScore !== "") {
|
|
71
|
+
tracking.trackEvent(TrackingEvents.LC_SCORE_VIEW, activeScore);
|
|
72
|
+
}
|
|
73
|
+
}, [activeScore]);
|
|
56
74
|
const setActiveScore = (value) => {
|
|
57
75
|
setScoreCategory({ type: "SCORE", value });
|
|
58
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/sdks/LocalContent/context.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AACjC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/sdks/LocalContent/context.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AACjC,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,GACV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAmB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAetD,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAC7C,EAAoB,CACrB,CAAC;AACF,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAS9D,MAAM,oBAAoB,GAAG,CAC3B,KAAoB,EACpB,MAE2D,EAC3D,EAAE;IACF,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,UAAU,CAAC,CAAC;YACf,uCACK,KAAK,KACR,cAAc,EAAE,MAAM,CAAC,KAAK,IAC5B;SACH;QAED,KAAK,OAAO,CAAC,CAAC;YACZ,oEAAoE;YACpE,MAAM,iBAAiB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;gBACnD,IAAI,MAAM,CAAC,KAAK,KAAK,EAAE,EAAE;oBACvB,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,cAAc,CAAC;iBACzC;gBAED,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzC,CAAC,CAAE,CAAC,KAAK,CAAC;YAEV,OAAO;gBACL,cAAc,EAAE,iBAAiB;gBACjC,qBAAqB,kCAChB,KAAK,CAAC,qBAAqB,KAC9B,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,KAAK,GAClC;aACF,CAAC;SACH;KACF;AACH,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC3E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,oBAAoB,GACxB,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO;QAChD,CAAC,CAAC;YACE,cAAc,EAAE,SAAS;YACzB,qBAAqB,EAAE;gBACrB,OAAO,EAAE,qBAAqB;gBAC9B,SAAS,EAAE,WAAW;gBACtB,SAAS,EAAE,SAAS;gBACpB,MAAM,EAAE,OAAO;gBACf,SAAS,EAAE,cAAc;aAC1B;SACF;QACH,CAAC,CAAC;YACE,cAAc,EAAE,SAAS;YACzB,qBAAqB,EAAE;gBACrB,OAAO,EAAE,EAAE;gBACX,SAAS,EAAE,EAAE;gBACb,SAAS,EAAE,EAAE;gBACb,MAAM,EAAE,EAAE;gBACV,SAAS,EAAE,EAAE;aACd;SACF,CAAC;IAER,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,UAAU,CAClD,oBAAoB,EACpB,oBAAoB,CACrB,CAAC;IAEF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAgB,CAAC;IAC3D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,EAAgB,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,EAAE;YACb,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,WAAW,EAAE;gBAC9C,QAAQ,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI;gBACzB,QAAQ,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO;aAC7B,CAAC,CAAC;SACJ;IACH,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,MAAM,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC;IAEzC,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IACvE,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,MAAM,WAAW,GAAG,aAAa,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAC;IAExE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,KAAK,EAAE,EAAE;YACtB,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;SAChE;IACH,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,cAAc,GAAG,CAAC,KAAoC,EAAE,EAAE;QAC9D,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAAsB,EAAE,EAAE;QACnD,gBAAgB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,WAAW;QACX,cAAc;QACd,cAAc;QACd,iBAAiB;QACjB,SAAS;QACT,YAAY;QACZ,UAAU;QACV,aAAa;QACb,cAAc;QACd,iBAAiB;KAClB,CAAC,EACF;QACE,WAAW;QACX,cAAc;QACd,cAAc;QACd,iBAAiB;QACjB,SAAS;QACT,YAAY;QACZ,UAAU;QACV,aAAa;QACb,cAAc;QACd,iBAAiB;KAClB,CACF,CAAC;IAEF,OAAO,CACL,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC9C,QAAQ,CACoB,CAChC,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdks/LocalContent/index.tsx"],"names":[],"mappings":";AACA,OAAO,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdks/LocalContent/index.tsx"],"names":[],"mappings":";AACA,OAAO,kCAAkC,CAAC;AAK1C,QAAA,MAAM,YAAY,mBAOjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "maplibre-gl/dist/maplibre-gl.css";
|
|
3
|
+
import tracking from "~/services/tracking";
|
|
3
4
|
import { LocalContentProvider } from "./context";
|
|
4
5
|
import Map from "./Map";
|
|
5
|
-
const LocalContent = () =>
|
|
6
|
-
|
|
6
|
+
const LocalContent = () => {
|
|
7
|
+
tracking.trackPageLoad();
|
|
8
|
+
return (React.createElement(LocalContentProvider, null,
|
|
9
|
+
React.createElement(Map, null)));
|
|
10
|
+
};
|
|
7
11
|
export default LocalContent;
|
|
8
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/sdks/LocalContent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/sdks/LocalContent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kCAAkC,CAAC;AAC1C,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,QAAQ,CAAC,aAAa,EAAE,CAAC;IACzB,OAAO,CACL,oBAAC,oBAAoB;QACnB,oBAAC,GAAG,OAAG,CACc,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AnalyticsBrowser } from "@segment/analytics-next";
|
|
2
|
+
import { TrackingEvents } from "../../constants/tracking";
|
|
3
|
+
declare class Tracking {
|
|
4
|
+
analytics: AnalyticsBrowser;
|
|
5
|
+
constructor();
|
|
6
|
+
trackPageLoad(): void;
|
|
7
|
+
trackEvent(eventName: TrackingEvents, eventData: string | object): void;
|
|
8
|
+
}
|
|
9
|
+
declare const tracking: Tracking;
|
|
10
|
+
export default tracking;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/tracking/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,cAAM,QAAQ;IACZ,SAAS,EAAE,gBAAgB,CAAC;;IAQ5B,aAAa;IAIb,UAAU,CAAC,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;CAMjE;AAED,QAAA,MAAM,QAAQ,UAAiB,CAAC;AAEhC,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AnalyticsBrowser } from "@segment/analytics-next";
|
|
2
|
+
class Tracking {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.analytics = AnalyticsBrowser.load({
|
|
5
|
+
writeKey: import.meta.env.VITE_SEGMENT_KEY,
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
trackPageLoad() {
|
|
9
|
+
this.analytics.page();
|
|
10
|
+
}
|
|
11
|
+
trackEvent(eventName, eventData) {
|
|
12
|
+
this.analytics.track(eventName, {
|
|
13
|
+
event_data: eventData,
|
|
14
|
+
environment: import.meta.env.MODE,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const tracking = new Tracking();
|
|
19
|
+
export default tracking;
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/tracking/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,QAAQ;IAGZ;QACE,IAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC;YACrC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB;SAC3C,CAAC,CAAC;IACL,CAAC;IAED,aAAa;QACX,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAED,UAAU,CAAC,SAAyB,EAAE,SAA0B;QAC9D,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE;YAC9B,UAAU,EAAE,SAAS;YACrB,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI;SAClC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;AAEhC,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@local-logic/sdks-app",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.55",
|
|
4
4
|
"main": "dist/types/index.js",
|
|
5
5
|
"typings": "dist/types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@local-logic/channel": "1.1.0-beta.10",
|
|
11
11
|
"@local-logic/client": "1.0.0-beta.13",
|
|
12
|
-
"@local-logic/elements-react": "1.0.0-beta.
|
|
12
|
+
"@local-logic/elements-react": "1.0.0-beta.35",
|
|
13
13
|
"@radix-ui/react-accordion": "^1.0.0",
|
|
14
14
|
"@radix-ui/react-select": "^1.0.0",
|
|
15
|
+
"@segment/analytics-next": "^1.44.0",
|
|
15
16
|
"@sentry/react": "^7.11.1",
|
|
16
17
|
"@sentry/tracing": "^7.11.1",
|
|
17
18
|
"@tanstack/react-location": "^3.7.4",
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
"@jest/globals": "^28.1.1",
|
|
37
38
|
"@local-logic/eslint-config": "2.1.0-beta.3",
|
|
38
39
|
"@local-logic/ui": "1.0.0-beta.20",
|
|
40
|
+
"@size-limit/file": "^8.1.0",
|
|
39
41
|
"@testing-library/react": "^13.3.0",
|
|
40
42
|
"@types/jest": "^28.1.4",
|
|
41
43
|
"@types/json2csv": "^5.0.3",
|
|
@@ -51,13 +53,21 @@
|
|
|
51
53
|
"jest": "^28.1.2",
|
|
52
54
|
"jest-environment-jsdom": "^28.1.0",
|
|
53
55
|
"jestconfig": "0.1.0-beta.0",
|
|
54
|
-
"rollup-plugin-visualizer": "^5.
|
|
56
|
+
"rollup-plugin-visualizer": "^5.8.3",
|
|
57
|
+
"size-limit": "^7.0.8",
|
|
55
58
|
"tsconfig": "0.1.0-beta.0",
|
|
56
59
|
"typescript": "^4.6.3",
|
|
57
60
|
"vite": "^2.9.9",
|
|
58
61
|
"vite-plugin-dts": "^1.2.0",
|
|
59
62
|
"vite-plugin-svgr": "^2.2.0"
|
|
60
63
|
},
|
|
64
|
+
"size-limit": [
|
|
65
|
+
{
|
|
66
|
+
"limit": "500 kB",
|
|
67
|
+
"path": "dist/assets",
|
|
68
|
+
"brotli": true
|
|
69
|
+
}
|
|
70
|
+
],
|
|
61
71
|
"publishConfig": {
|
|
62
72
|
"access": "public"
|
|
63
73
|
},
|
|
@@ -65,6 +75,7 @@
|
|
|
65
75
|
"dev": "vite",
|
|
66
76
|
"build": "vite build && tsc",
|
|
67
77
|
"stats": "STATS=1 vite build",
|
|
78
|
+
"size": "pnpm run build && size-limit",
|
|
68
79
|
"test": "jest --passWithNoTests",
|
|
69
80
|
"lint": "TIMING=1 npx eslint --ext .js,.jsx,.ts,.tsx .",
|
|
70
81
|
"check-types": "npx tsc --project ./tsconfig.json --noEmit",
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import{c as W,u as dt,p as te,s as ee,M as xt,a as ne,$ as oe,b as ie,d as re,e as se,S as ae,f as ce,g as le,h as ue,m as de,N as pe,P as fe}from"./chevron_right.f4a05ecb.js";import{R as T,r as b,$ as Tt,j as a,s as F,i as Z,u as q,a as tt,b as pt,c as w,y as g,F as et,d as k,e as it,I as V,U as Ot,f as Et,O as nt,g as I,k as U,S as K,T as he,h as D,l as ge,m as Q,_ as me,n as ye,o as ve,p as xe}from"./index.bd887e31.js";const zt=T.createContext({}),O=()=>b.exports.useContext(zt),be=(t,e)=>{switch(e.type){case"CATEGORY":return{...t,activeCategory:e.value};case"SCORE":{const n=F.find(o=>e.value===""?o.value===t.activeCategory:o.scores.includes(e.value)).value;return{activeCategory:n,activeScoreByCategory:{...t.activeScoreByCategory,[n]:e.value}}}}},we=({children:t})=>{const[e,n]=b.exports.useState(!1),o=window.innerWidth<Tt.screenSizes.mobileL?{activeCategory:"commute",activeScoreByCategory:{commute:"pedestrian_friendly",amenities:"groceries",character:"vibrant",nature:"parks",education:"high_schools"}}:{activeCategory:"commute",activeScoreByCategory:{commute:"",amenities:"",character:"",nature:"",education:""}},[i,s]=b.exports.useReducer(be,o),[c,l]=b.exports.useState(),[r,u]=b.exports.useState(),{activeCategory:d}=i,p=i.activeScoreByCategory[d],h=v=>{s({type:"SCORE",value:v})},f=v=>{s({type:"CATEGORY",value:v})},m=b.exports.useMemo(()=>({activeScore:p,setActiveScore:h,activeCategory:d,setActiveCategory:f,activePOI:c,setActivePOI:l,hoveredPOI:r,setHoveredPOI:u,showMobileList:e,setShowMobileList:n}),[p,h,d,f,c,l,r,u,e,n]);return a(zt.Provider,{value:m,children:t})};function Rt(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 bt(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(!wt(t[0])||!wt(t[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:t};return Rt(o,e,n)}function Me(t,e,n){n===void 0&&(n={});var o={type:"MultiPoint",coordinates:t};return Rt(o,e,n)}function wt(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Ht(t,e,n){if(t!==null)for(var o,i,s,c,l,r,u,d=0,p=0,h,f=t.type,m=f==="FeatureCollection",v=f==="Feature",x=m?t.features.length:1,y=0;y<x;y++){u=m?t.features[y].geometry:v?t.geometry:t,h=u?u.type==="GeometryCollection":!1,l=h?u.geometries.length:1;for(var L=0;L<l;L++){var C=0,S=0;if(c=h?u.geometries[L]:u,c!==null){r=c.coordinates;var $=c.type;switch(d=n&&($==="Polygon"||$==="MultiPolygon")?1:0,$){case null:break;case"Point":if(e(r,p,y,C,S)===!1)return!1;p++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<r.length;o++){if(e(r[o],p,y,C,S)===!1)return!1;p++,$==="MultiPoint"&&C++}$==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<r.length;o++){for(i=0;i<r[o].length-d;i++){if(e(r[o][i],p,y,C,S)===!1)return!1;p++}$==="MultiLineString"&&C++,$==="Polygon"&&S++}$==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<r.length;o++){for(S=0,i=0;i<r[o].length;i++){for(s=0;s<r[o][i].length-d;s++){if(e(r[o][i][s],p,y,C,S)===!1)return!1;p++}S++}C++}break;case"GeometryCollection":for(o=0;o<c.geometries.length;o++)if(Ht(c.geometries[o],e,n)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ct(t){var e=[1/0,1/0,-1/0,-1/0];return Ht(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}ct.default=ct;var Ce="Expected a function",Mt=0/0,$e="[object Symbol]",Se=/^\s+|\s+$/g,Pe=/^[-+]0x[0-9a-f]+$/i,ke=/^0b[01]+$/i,Le=/^0o[0-7]+$/i,Ie=parseInt,_e=typeof W=="object"&&W&&W.Object===Object&&W,Ae=typeof self=="object"&&self&&self.Object===Object&&self,Te=_e||Ae||Function("return this")(),Oe=Object.prototype,Ee=Oe.toString,ze=Math.max,Re=Math.min,rt=function(){return Te.Date.now()};function He(t,e,n){var o,i,s,c,l,r,u=0,d=!1,p=!1,h=!0;if(typeof t!="function")throw new TypeError(Ce);e=Ct(e)||0,lt(n)&&(d=!!n.leading,p="maxWait"in n,s=p?ze(Ct(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function f(M){var _=o,E=i;return o=i=void 0,u=M,c=t.apply(E,_),c}function m(M){return u=M,l=setTimeout(y,e),d?f(M):c}function v(M){var _=M-r,E=M-u,j=e-_;return p?Re(j,s-E):j}function x(M){var _=M-r,E=M-u;return r===void 0||_>=e||_<0||p&&E>=s}function y(){var M=rt();if(x(M))return L(M);l=setTimeout(y,v(M))}function L(M){return l=void 0,h&&o?f(M):(o=i=void 0,c)}function C(){l!==void 0&&clearTimeout(l),u=0,o=r=i=l=void 0}function S(){return l===void 0?c:L(rt())}function $(){var M=rt(),_=x(M);if(o=arguments,i=this,r=M,_){if(l===void 0)return m(r);if(p)return l=setTimeout(y,e),f(r)}return l===void 0&&(l=setTimeout(y,e)),c}return $.cancel=C,$.flush=S,$}function lt(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Ze(t){return!!t&&typeof t=="object"}function Ve(t){return typeof t=="symbol"||Ze(t)&&Ee.call(t)==$e}function Ct(t){if(typeof t=="number")return t;if(Ve(t))return Mt;if(lt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=lt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Se,"");var n=ke.test(t);return n||Le.test(t)?Ie(t.slice(2),n?2:8):Pe.test(t)?Mt:+t}var je=He;const Ne=()=>{const[t,e]=b.exports.useState(!1);return b.exports.useLayoutEffect(()=>{const n=()=>{e(window.innerWidth<Tt.screenSizes.mobileL)};return window.addEventListener("resize",je(n,250)),n(),()=>window.removeEventListener("resize",n)},[]),t},Be=t=>b.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},b.exports.createElement("g",{clipPath:"url(#clip0_6_16062)"},b.exports.createElement("path",{d:"M3 13H5V11H3V13ZM3 17H5V15H3V17ZM3 9H5V7H3V9ZM7 13H21V11H7V13ZM7 17H21V15H7V17ZM7 7V9H21V7H7ZM3 13H5V11H3V13ZM3 17H5V15H3V17ZM3 9H5V7H3V9ZM7 13H21V11H7V13ZM7 17H21V15H7V17ZM7 7V9H21V7H7Z"}))),{scorePois:De}=Z.Constants;function Zt(){var l;const{client:t}=q(),{sdkState:e}=tt(),n=pt(e.options,250),{activeScore:o}=O(),i=o?De[o]:void 0,c={...b.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:i};return dt(te.list(c),async()=>t.getPois(c),{enabled:!!c&&!!((l=c.include)!=null&&l.length)&&!!c.lat&&!!c.lng})}function Vt(){const{client:t}=q(),{sdkState:e}=tt(),n=pt(e.options,250),i={...b.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 dt(ee.list(i),async()=>t.getSchools(i),{enabled:!!i&&!!i.lat&&!!i.lng})}const jt=T.createContext({}),Nt=()=>b.exports.useContext(jt),Ge=({children:t,mapRef:e,mapPadding:n})=>a(jt.Provider,{value:{mapRef:e,mapPadding:n},children:t});function ut(t,e,n,o,i,s){if(i-o<=n)return;const c=o+i>>1;Bt(t,e,c,o,i,s%2),ut(t,e,n,o,c-1,s+1),ut(t,e,n,c+1,i,s+1)}function Bt(t,e,n,o,i,s){for(;i>o;){if(i-o>600){const u=i-o+1,d=n-o+1,p=Math.log(u),h=.5*Math.exp(2*p/3),f=.5*Math.sqrt(p*h*(u-h)/u)*(d-u/2<0?-1:1),m=Math.max(o,Math.floor(n-d*h/u+f)),v=Math.min(i,Math.floor(n+(u-d)*h/u+f));Bt(t,e,n,m,v,s)}const c=e[2*n+s];let l=o,r=i;for(B(t,e,o,n),e[2*i+s]>c&&B(t,e,o,i);l<r;){for(B(t,e,l,r),l++,r--;e[2*l+s]<c;)l++;for(;e[2*r+s]>c;)r--}e[2*o+s]===c?B(t,e,o,r):(r++,B(t,e,r,i)),r<=n&&(o=r+1),n<=r&&(i=r-1)}}function B(t,e,n,o){st(t,n,o),st(e,2*n,2*o),st(e,2*n+1,2*o+1)}function st(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function Fe(t,e,n,o,i,s,c){const l=[0,t.length-1,0],r=[];let u,d;for(;l.length;){const p=l.pop(),h=l.pop(),f=l.pop();if(h-f<=c){for(let x=f;x<=h;x++)u=e[2*x],d=e[2*x+1],u>=n&&u<=i&&d>=o&&d<=s&&r.push(t[x]);continue}const m=Math.floor((f+h)/2);u=e[2*m],d=e[2*m+1],u>=n&&u<=i&&d>=o&&d<=s&&r.push(t[m]);const v=(p+1)%2;(p===0?n<=u:o<=d)&&(l.push(f),l.push(m-1),l.push(v)),(p===0?i>=u:s>=d)&&(l.push(m+1),l.push(h),l.push(v))}return r}function We(t,e,n,o,i,s){const c=[0,t.length-1,0],l=[],r=i*i;for(;c.length;){const u=c.pop(),d=c.pop(),p=c.pop();if(d-p<=s){for(let x=p;x<=d;x++)$t(e[2*x],e[2*x+1],n,o)<=r&&l.push(t[x]);continue}const h=Math.floor((p+d)/2),f=e[2*h],m=e[2*h+1];$t(f,m,n,o)<=r&&l.push(t[h]);const v=(u+1)%2;(u===0?n-i<=f:o-i<=m)&&(c.push(p),c.push(h-1),c.push(v)),(u===0?n+i>=f:o+i>=m)&&(c.push(h+1),c.push(d),c.push(v))}return l}function $t(t,e,n,o){const i=t-n,s=e-o;return i*i+s*s}const Ue=t=>t[0],Ke=t=>t[1];class St{constructor(e,n=Ue,o=Ke,i=64,s=Float64Array){this.nodeSize=i,this.points=e;const c=e.length<65536?Uint16Array:Uint32Array,l=this.ids=new c(e.length),r=this.coords=new s(e.length*2);for(let u=0;u<e.length;u++)l[u]=u,r[2*u]=n(e[u]),r[2*u+1]=o(e[u]);ut(l,r,i,0,l.length-1,0)}range(e,n,o,i){return Fe(this.ids,this.coords,e,n,o,i,this.nodeSize)}within(e,n,o){return We(this.ids,this.coords,e,n,o,this.nodeSize)}}const Qe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},X=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1));class Ye{constructor(e){this.options=G(Object.create(Qe),e),this.trees=new Array(this.options.maxZoom+1)}load(e){const{log:n,minZoom:o,maxZoom:i,nodeSize:s}=this.options;n&&console.time("total time");const c=`prepare ${e.length} points`;n&&console.time(c),this.points=e;let l=[];for(let r=0;r<e.length;r++)!e[r].geometry||l.push(Xe(e[r],r));this.trees[i+1]=new St(l,kt,Lt,s,Float32Array),n&&console.timeEnd(c);for(let r=i;r>=o;r--){const u=+Date.now();l=this._cluster(l,r),this.trees[r]=new St(l,kt,Lt,s,Float32Array),n&&console.log("z%d: %d clusters in %dms",r,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 i=Math.max(-90,Math.min(90,e[1]));let s=e[2]===180?180:((e[2]+180)%360+360)%360-180;const c=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,s=180;else if(o>s){const d=this.getClusters([o,i,180,c],n),p=this.getClusters([-180,i,s,c],n);return d.concat(p)}const l=this.trees[this._limitZoom(n)],r=l.range(Y(o),J(c),Y(s),J(i)),u=[];for(const d of r){const p=l.points[d];u.push(p.numPoints?Pt(p):this.points[p.index])}return u}getChildren(e){const n=this._getOriginId(e),o=this._getOriginZoom(e),i="No cluster with the specified id.",s=this.trees[o];if(!s)throw new Error(i);const c=s.points[n];if(!c)throw new Error(i);const l=this.options.radius/(this.options.extent*Math.pow(2,o-1)),r=s.within(c.x,c.y,l),u=[];for(const d of r){const p=s.points[d];p.parentId===e&&u.push(p.numPoints?Pt(p):this.points[p.index])}if(u.length===0)throw new Error(i);return u}getLeaves(e,n,o){n=n||10,o=o||0;const i=[];return this._appendLeaves(i,e,n,o,0),i}getTile(e,n,o){const i=this.trees[this._limitZoom(e)],s=Math.pow(2,e),{extent:c,radius:l}=this.options,r=l/c,u=(o-r)/s,d=(o+1+r)/s,p={features:[]};return this._addTileFeatures(i.range((n-r)/s,u,(n+1+r)/s,d),i.points,n,o,s,p),n===0&&this._addTileFeatures(i.range(1-r/s,u,1,d),i.points,s,o,s,p),n===s-1&&this._addTileFeatures(i.range(0,u,r/s,d),i.points,-1,o,s,p),p.features.length?p: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,i,s){const c=this.getChildren(n);for(const l of c){const r=l.properties;if(r&&r.cluster?s+r.point_count<=i?s+=r.point_count:s=this._appendLeaves(e,r.cluster_id,o,i,s):s<i?s++:e.push(l),e.length===o)break}return s}_addTileFeatures(e,n,o,i,s,c){for(const l of e){const r=n[l],u=r.numPoints;let d,p,h;if(u)d=Dt(r),p=r.x,h=r.y;else{const v=this.points[r.index];d=v.properties,p=Y(v.geometry.coordinates[0]),h=J(v.geometry.coordinates[1])}const f={type:1,geometry:[[Math.round(this.options.extent*(p*s-o)),Math.round(this.options.extent*(h*s-i))]],tags:d};let m;u?m=r.id:this.options.generateId?m=r.index:this.points[r.index].id&&(m=this.points[r.index].id),m!==void 0&&(f.id=m),c.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const o=[],{radius:i,extent:s,reduce:c,minPoints:l}=this.options,r=i/(s*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 p=this.trees[n+1],h=p.within(d.x,d.y,r),f=d.numPoints||1;let m=f;for(const v of h){const x=p.points[v];x.zoom>n&&(m+=x.numPoints||1)}if(m>f&&m>=l){let v=d.x*f,x=d.y*f,y=c&&f>1?this._map(d,!0):null;const L=(u<<5)+(n+1)+this.points.length;for(const C of h){const S=p.points[C];if(S.zoom<=n)continue;S.zoom=n;const $=S.numPoints||1;v+=S.x*$,x+=S.y*$,S.parentId=L,c&&(y||(y=this._map(d,!0)),c(y,this._map(S)))}d.parentId=L,o.push(Je(v/m,x/m,L,m,y))}else if(o.push(d),m>1)for(const v of h){const x=p.points[v];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?G({},e.properties):e.properties;const o=this.points[e.index].properties,i=this.options.map(o);return n&&i===o?G({},i):i}}function Je(t,e,n,o,i){return{x:X(t),y:X(e),zoom:1/0,id:n,parentId:-1,numPoints:o,properties:i}}function Xe(t,e){const[n,o]=t.geometry.coordinates;return{x:X(Y(n)),y:X(J(o)),zoom:1/0,index:e,parentId:-1}}function Pt(t){return{type:"Feature",id:t.id,properties:Dt(t),geometry:{type:"Point",coordinates:[qe(t.x),tn(t.y)]}}}function Dt(t){const e=t.numPoints,n=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return G(G({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function Y(t){return t/360+.5}function J(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 qe(t){return(t-.5)*360}function tn(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function G(t,e){for(const n in e)t[n]=e[n];return t}function kt(t){return t.x}function Lt(t){return t.y}var It=Object.prototype.hasOwnProperty;function _t(t,e,n){for(n of t.keys())if(H(n,e))return n}function H(t,e){var n,o,i;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--&&H(t[o],e[o]););return o===-1}if(n===Set){if(t.size!==e.size)return!1;for(o of t)if(i=o,i&&typeof i=="object"&&(i=_t(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(o of t)if(i=o[0],i&&typeof i=="object"&&(i=_t(e,i),!i)||!H(o[1],e.get(i)))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(It.call(t,n)&&++o&&!It.call(e,n)||!(n in e)||!H(t[n],e[n]))return!1;return Object.keys(e).length===o}}return t!==t&&e!==e}function en(t){var e=b.exports.useRef(t),n=b.exports.useRef(0);return H(t,e.current)||(e.current=t,n.current+=1),b.exports.useMemo(function(){return e.current},[n.current])}function nn(t,e){return b.exports.useEffect(t,en(e))}var on=function(e){var n=e.points,o=e.bounds,i=e.zoom,s=e.options,c=b.exports.useRef(),l=b.exports.useRef(),r=b.exports.useState([]),u=r[0],d=r[1],p=Math.round(i);return nn(function(){(!c.current||!H(l.current,n)||!H(c.current.options,s))&&(c.current=new Ye(s),c.current.load(n)),o&&d(c.current.getClusters(o,p)),l.current=n},[n,o,p,s]),{clusters:u,supercluster:c.current}};const rn=w.div`
|
|
2
|
-
border-radius: 50%;
|
|
3
|
-
background: linear-gradient(
|
|
4
|
-
to top,
|
|
5
|
-
${g["--ll-color-primary-variant1"]},
|
|
6
|
-
${g["--ll-color-primary"]}
|
|
7
|
-
);
|
|
8
|
-
color: ${g["--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: ${g["--ll-font-family"]};
|
|
16
|
-
font-size: ${({diameter:t})=>t/2.5}px;
|
|
17
|
-
border: 2px solid #fff;
|
|
18
|
-
box-shadow: ${g["--ll-shadow-small"]};
|
|
19
|
-
cursor: default;
|
|
20
|
-
`,sn=({cluster:t,pointsCount:e,onClick:n})=>{const o=t.properties.point_count,i=20+o/e*25;return a(rn,{diameter:i,onClick:()=>n&&n(t),children:t.properties.point_count})};function an(t){return t.properties.cluster!==void 0}const Gt=T.memo(({rect:t,zoom:e,mapRef:n,points:o,isMobile:i,activePOI:s,hoveredPOI:c,isMapMoving:l,setActivePOI:r})=>{var h;const u=(h=n==null?void 0:n.current)==null?void 0:h.getMap().getBounds().toArray().flat(),{clusters:d,supercluster:p}=on({points:o,bounds:u,zoom:e,options:{radius:50,maxZoom:18}});return a(et,{children:d.map((f,m)=>{const[v,x]=f.geometry.coordinates;if(an(f))return a(xt,{latitude:x,longitude:v,children:a(sn,{cluster:f,pointsCount:o.length,onClick:()=>{var M;const $=Math.min(p.getClusterExpansionZoom(f.id),20);(M=n.current)==null||M.flyTo({zoom:$,center:[v,x],duration:1e3})}})},`cluster-${f.id}`);const{poi:y,type:L}=f.properties,C=s===y,S=c===y;return a(xt,{latitude:y.lat,longitude:y.lng,style:{zIndex:C?1:0},children:k(it.Root,{options:{type:L,poi:y,isOpen:l?!1:C,isHovered:S,side:"top",collisionPadding:i?{top:t.height+32,bottom:V*2,left:V*2,right:V*2}:{left:t.width+32,right:V*2,top:V*2,bottom:V*2}},onChange:$=>{$.type==="open-change"&&($.data?setTimeout(()=>{r(y)},0):C&&r(void 0))},children:[a(it.Marker,{}),a(it.Content,{})]})},`${y.name}-${y.lat}-${y.lng}-${m}`)})})});Gt.displayName="Markers";function ft(t){const{client:e}=q(),{sdkState:n}=tt(),o=pt(n.options,250),s={...b.exports.useMemo(()=>o!=null&&o.marker?o.marker:{lat:o==null?void 0:o.lat,lng:o==null?void 0:o.lng},[o]),geographyLevels:["10","30"],locationScoresRounding:!1,include:t};return dt(ne.list(s),async()=>e.getScores(s),{enabled:!!s})}const cn=w.div`
|
|
21
|
-
padding: ${g["--ll-spacing-small"]} ${g["--ll-spacing-medium"]};
|
|
22
|
-
background-color: ${g["--ll-color-surface"]};
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
flex: 1;
|
|
27
|
-
`,ln=w.div`
|
|
28
|
-
display: grid;
|
|
29
|
-
grid-template-columns: min-content 1fr;
|
|
30
|
-
grid-gap: ${g["--ll-spacing-medium"]};
|
|
31
|
-
margin-bottom: ${g["--ll-spacing-medium"]};
|
|
32
|
-
`,un=w.div`
|
|
33
|
-
overflow: auto;
|
|
34
|
-
|
|
35
|
-
&:not(:empty) {
|
|
36
|
-
margin-top: ${g["--ll-spacing-medium"]};
|
|
37
|
-
}
|
|
38
|
-
`,dn=Ot({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),pn=Ot({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),fn=w(oe)`
|
|
39
|
-
margin: 0;
|
|
40
|
-
`,Ft=w(ie)`
|
|
41
|
-
background: none;
|
|
42
|
-
border: none;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
width: 100%;
|
|
46
|
-
padding: ${g["--ll-spacing-x-small"]} 0;
|
|
47
|
-
`,hn=w(re)`
|
|
48
|
-
background-color: ${g["--ll-color-surface"]};
|
|
49
|
-
position: relative;
|
|
50
|
-
z-index: 1;
|
|
51
|
-
overflow: hidden;
|
|
52
|
-
margin-left: calc(-1 * ${g["--ll-spacing-medium"]});
|
|
53
|
-
margin-right: calc(-1 * ${g["--ll-spacing-medium"]});
|
|
54
|
-
|
|
55
|
-
[data-state="open"] & {
|
|
56
|
-
animation: ${dn} 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
[data-state="closed"] & {
|
|
60
|
-
animation: ${pn} 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
61
|
-
}
|
|
62
|
-
`,gn=w.div`
|
|
63
|
-
padding: ${g["--ll-spacing-medium"]};
|
|
64
|
-
`,mn=w.span`
|
|
65
|
-
${Ft}[data-state=open] & {
|
|
66
|
-
transform: rotate(90deg);
|
|
67
|
-
} ;
|
|
68
|
-
`;w.div`
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: flex-start;
|
|
71
|
-
justify-content: space-between;
|
|
72
|
-
`;const ht=w.div`
|
|
73
|
-
margin: ${g["--ll-spacing-small"]} 0;
|
|
74
|
-
`,yn=w.div`
|
|
75
|
-
margin-top: ${g["--ll-spacing-large"]};
|
|
76
|
-
|
|
77
|
-
&:empty {
|
|
78
|
-
margin: 0;
|
|
79
|
-
}
|
|
80
|
-
`,Wt=T.memo(({result:t,poi:e})=>{const{activePOI:n,setActivePOI:o,hoveredPOI:i,setHoveredPOI:s}=O(),{mapRef:c,mapPadding:l}=Nt();return!t.data||!t.data[e]?null:a(Z.Content,{options:{value:e},children:a(Et.Root,{options:{type:"poi",data:t.data[e],activePOI:n,hoveredPOI:i},onChange:r=>{var u;if(r.type==="poi-click"){const d=r.data;o(d);const p=window.innerWidth-l.left,h=window.innerWidth/2,f=p/2+l.left-h;d&&((u=c.current)==null||u.flyTo({zoom:18,center:[d.lng,d.lat],duration:1e3,offset:[f,0]}))}r.type==="poi-hover"&&s(r.data)}})},e)});Wt.displayName="POI";const gt=T.memo(({include:t})=>{const e=Zt();return e.isLoading&&t.length?a(et,{children:[...Array(10)].map((n,o)=>a(ht,{children:a(nt,{height:"34px",width:"100%"})},o))}):e.data?k(Z.Root,{options:{include:t},children:[a(Z.Tabs,{}),t.map(n=>a(Wt,{poi:n,result:e},n))]}):null});gt.displayName="POIs";const Ut=({score:t})=>{const{data:e,isLoading:n}=Vt(),{activePOI:o,setActivePOI:i,hoveredPOI:s,setHoveredPOI:c}=O(),{mapRef:l,mapPadding:r}=Nt();return n?a(et,{children:[...Array(10)].map(u=>a(ht,{children:a(nt,{height:"34px",width:"100%"})},u))}):e?a(Et.Root,{options:{type:"school",data:e==null?void 0:e[t],activePOI:o,hoveredPOI:s},onChange:u=>{var d;if(u.type==="poi-click"){const p=u.data;i(p);const h=window.innerWidth-r.left,f=window.innerWidth/2,m=h/2+r.left-f;p&&((d=l.current)==null||d.easeTo({zoom:18,center:[p.lng,p.lat],duration:1e3,offset:[m,0]}))}u.type==="poi-hover"&&c(u.data)}}):null},{scorePois:At}=Z.Constants,vn=()=>{const{activeCategory:t,activeScore:e,showMobileList:n}=O(),o=F.find(l=>l.value===t),{data:i,isLoading:s}=ft(o.scores),c=l=>!n||!At[l].length?null:l==="high_schools"||l==="primary_schools"?a(Ut,{score:l}):a(gt,{include:At[l]});return e&&(i==null?void 0:i.location[e])?s?a("div",{children:"Loading"}):a(I.Root,{options:{score:e,data:i},children:k(cn,{children:[k(ln,{children:[a(I.Badge,{}),a(I.BarChart,{})]}),a(I.Description,{}),a(un,{children:c(e)})]})}):null},xn=w.div`
|
|
81
|
-
display: flex;
|
|
82
|
-
overflow-x: scroll;
|
|
83
|
-
padding: ${g["--ll-spacing-x-small"]} ${g["--ll-spacing-medium"]};
|
|
84
|
-
flex-shrink: 0;
|
|
85
|
-
position: relative;
|
|
86
|
-
`,bn=w.button`
|
|
87
|
-
position: relative;
|
|
88
|
-
display: flex;
|
|
89
|
-
flex-direction: column;
|
|
90
|
-
align-items: center;
|
|
91
|
-
background: none;
|
|
92
|
-
border: none;
|
|
93
|
-
min-width: 60px;
|
|
94
|
-
padding: 0;
|
|
95
|
-
margin: 0 8px;
|
|
96
|
-
flex-shrink: 0;
|
|
97
|
-
|
|
98
|
-
&:first-child {
|
|
99
|
-
margin-left: 0;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&:last-child {
|
|
103
|
-
margin-right: 0;
|
|
104
|
-
}
|
|
105
|
-
`,wn=w.div`
|
|
106
|
-
position: absolute;
|
|
107
|
-
top: -6px;
|
|
108
|
-
right: 4px;
|
|
109
|
-
border: 2px solid ${g["--ll-color-background"]};
|
|
110
|
-
border-radius: 6px;
|
|
111
|
-
`,Mn=w.div`
|
|
112
|
-
flex: 1;
|
|
113
|
-
display: flex;
|
|
114
|
-
align-items: center;
|
|
115
|
-
`,Cn=w.div`
|
|
116
|
-
margin: 0 2px;
|
|
117
|
-
`,$n=({category:t})=>{const{data:e,isLoading:n,isFetching:o}=ft(t.scores),{activeScore:i,setActiveScore:s,setActiveCategory:c,setShowMobileList:l}=O();return a(xn,{children:t.scores.map(r=>{const u=r===i,d=u?"--ll-color-primary":"--ll-color-disabled";return n||o?a(Cn,{children:a(nt,{height:"44px",width:"60px"})},r):a(I.Root,{options:{score:r,data:e},children:k(bn,{onClick:()=>{l(!1),c(t.value),s(r)},children:[a(I.Icon,{options:{color:d,height:28,width:28}}),a(Mn,{children:a(I.Title,{options:{variant:"caption1",color:d,noWrap:!0,noMargin:!0,weight:"--ll-font-weight-bold"}})}),a(wn,{children:a(I.Badge,{options:{variant:"small",isPrimary:u}})})]})},r)})})},Sn=w.div`
|
|
118
|
-
display: flex;
|
|
119
|
-
padding: ${g["--ll-spacing-x-small"]} ${g["--ll-spacing-medium"]} ${g["--ll-spacing-xx-small"]} ${g["--ll-spacing-medium"]};
|
|
120
|
-
`,Pn=w.div`
|
|
121
|
-
position: absolute;
|
|
122
|
-
top: 0;
|
|
123
|
-
left: 0;
|
|
124
|
-
right: 0;
|
|
125
|
-
bottom: ${({showMobileList:t})=>t&&0};
|
|
126
|
-
z-index: 3;
|
|
127
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
|
|
128
|
-
background-color: #fff;
|
|
129
|
-
overflow: hidden;
|
|
130
|
-
display: flex;
|
|
131
|
-
flex-direction: column;
|
|
132
|
-
background-color: ${g["--ll-color-background"]};
|
|
133
|
-
border: 1px solid ${g["--ll-color-border"]};
|
|
134
|
-
`,Kt=T.forwardRef(({showMobileList:t},e)=>{const{activeCategory:n,setActiveCategory:o}=O();return k(Pn,{ref:e,showMobileList:t,children:[a(Sn,{children:k(U.Root,{value:n,onValueChange:i=>o(i),children:[a(U.Trigger,{size:"large",children:a(K.Root,{options:{scoreCategory:n},children:a(K.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},n)}),a(U.Content,{children:F.map(i=>a(K.Root,{options:{scoreCategory:i.value},children:a(U.Item,{value:i.value,children:a(K.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},i.value))})]})}),a($n,{category:F.find(i=>i.value===n)}),a(vn,{})]})});Kt.displayName="MobileScores";const{scorePois:kn}=Z.Constants,Qt=T.memo(({score:t,isLoading:e,data:n})=>e?a(ht,{children:a(nt,{height:"34px",width:"100%"},t)}):a(se,{value:t,children:k(I.Root,{options:{score:t,data:n},children:[a(fn,{children:k(Ft,{children:[a(mn,{children:a(he,{SVGElement:ae,fill:g["--ll-color-on-background-variant1"]})}),a(D,{spacing:"--ll-spacing-small"}),a(I.Icon,{}),a(D,{spacing:"--ll-spacing-small"}),a(I.Title,{}),a(D,{}),a(I.Badge,{})]})}),a(hn,{children:k(gn,{children:[a(I.Description,{}),a(D,{vertical:!0,spacing:"--ll-spacing-small"}),a(I.BarChart,{}),a(yn,{children:t==="high_schools"||t==="primary_schools"?a(Ut,{score:t}):a(gt,{include:kn[t]})})]})})]})},t));Qt.displayName="Score";const Ln=w.div`
|
|
135
|
-
padding: ${g["--ll-spacing-small"]} ${g["--ll-spacing-medium"]};
|
|
136
|
-
`,In=w.div`
|
|
137
|
-
display: flex;
|
|
138
|
-
justify-content: space-between;
|
|
139
|
-
align-items: center;
|
|
140
|
-
`,Yt=T.memo(({data:t,isLoading:e,isFetching:n,tabContent:o})=>{const{translations:i}=ge();return k(Ln,{children:[k(In,{children:[a(Q.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),n&&!e&&a(me,{size:"small"})]}),a(D,{spacing:"--ll-spacing-small",vertical:!0}),!n&&!Object.keys((t==null?void 0:t.location)||{}).length&&a(ye,{color:"--ll-color-on-background-variant1",children:i.EMPTY_TEXT}),o.scores.map(s=>a(Qt,{score:s,data:t,isLoading:e},s))]})});Yt.displayName="ScoreCategory";const Jt=T.memo(({tabContent:t})=>{q();const{data:e,isLoading:n,isFetching:o}=ft(t.scores),{activeScore:i,setActiveScore:s}=O();return a(ce,{value:i,onValueChange:c=>{s(c)},type:"single",collapsible:!0,children:a(Yt,{data:e,isLoading:n,isFetching:o,tabContent:t})})});Jt.displayName="ScoreCategoryAccordion";const _n=w.div`
|
|
141
|
-
overflow-y: auto;
|
|
142
|
-
`,An=w.div`
|
|
143
|
-
position: absolute;
|
|
144
|
-
top: ${g["--ll-spacing-medium"]};
|
|
145
|
-
left: ${g["--ll-spacing-medium"]};
|
|
146
|
-
width: 360px;
|
|
147
|
-
max-height: calc(100% - 2 * ${g["--ll-spacing-medium"]});
|
|
148
|
-
z-index: 1;
|
|
149
|
-
border-radius: ${g["--ll-border-radius-medium"]};
|
|
150
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
|
|
151
|
-
background-color: #fff;
|
|
152
|
-
overflow: hidden;
|
|
153
|
-
display: flex;
|
|
154
|
-
flex-direction: column;
|
|
155
|
-
background-color: ${g["--ll-color-background"]};
|
|
156
|
-
border: 1px solid ${g["--ll-color-border"]};
|
|
157
|
-
`;w.div`
|
|
158
|
-
display: flex;
|
|
159
|
-
justify-content: center;
|
|
160
|
-
padding: ${g["--ll-spacing-small"]};
|
|
161
|
-
`;const Tn=w.div`
|
|
162
|
-
padding: ${g["--ll-spacing-x-small"]};
|
|
163
|
-
border-bottom: 1px solid ${g["--ll-color-border"]};
|
|
164
|
-
`,On=w.div`
|
|
165
|
-
display: flex;
|
|
166
|
-
justify-content: center;
|
|
167
|
-
padding: ${g["--ll-spacing-small"]};
|
|
168
|
-
background-color: ${g["--ll-color-background"]};
|
|
169
|
-
`,Xt=()=>a(On,{children:a(ve.Root,{})}),qt=T.forwardRef((t,e)=>{const{activeCategory:n,setActiveCategory:o,setShowMobileList:i}=O();return a(Q.Root,{options:{currentTab:n},onChange:s=>{o(s.data)},children:k(An,{ref:e,children:[a(Tn,{children:a(Q.Tabs,{})}),a(_n,{children:F.map(s=>a(Q.Content,{options:{value:s.value},children:a(Jt,{tabContent:s},s.value)},s.value))}),a(Xt,{})]})})});qt.displayName="DesktopScores";const En=w.div`
|
|
170
|
-
position: relative;
|
|
171
|
-
display: flex;
|
|
172
|
-
flex-direction: column;
|
|
173
|
-
height: 100vh;
|
|
174
|
-
`,zn=w.div`
|
|
175
|
-
position: absolute;
|
|
176
|
-
bottom: 86px;
|
|
177
|
-
right: 10px;
|
|
178
|
-
background-color: ${g["--ll-color-background"]};
|
|
179
|
-
z-index: 3;
|
|
180
|
-
border-radius: 50%;
|
|
181
|
-
`,Rn=w(xe)`
|
|
182
|
-
box-shadow: ${g["--ll-shadow-medium"]};
|
|
183
|
-
`,{scorePois:at}=Z.Constants,Hn=()=>{var E,j,mt;const{sdkState:t,setSdkState:e}=tt(),{activeScore:n,activePOI:o,setActivePOI:i,hoveredPOI:s,showMobileList:c,setShowMobileList:l}=O(),r=Ne(),u=Zt(),d=Vt(),p=((j=(E=t==null?void 0:t.globalOptions)==null?void 0:E.appearance)==null?void 0:j.theme)==="night"?"basic-v2-dark":"600d69cb-288d-445e-9839-3dfe4d76b31a",[h,f]=b.exports.useState(!1),m=b.exports.useMemo(()=>{var P;return(n==="high_schools"||n==="primary_schools")&&!d.isFetching?{[n]:((P=d==null?void 0:d.data)==null?void 0:P[n])||[]}:!(n&&at[n]&&at[n].length)&&!u.isFetching?{[n]:[]}:u.data},[u.data,d.data,n]),v=b.exports.useMemo(()=>m?Object.entries(m).map(([z,R])=>R.map(A=>bt([A.lng,A.lat],{poi:A,type:z}))).flat().filter((z,R,A)=>A.findIndex(ot=>["lat","lng","name"].every(N=>ot.properties.poi[N]===z.properties.poi[N]))===R):[],[m]),x=b.exports.useMemo(()=>{var z,R,A;const P=((z=t==null?void 0:t.options)==null?void 0:z.marker)&&bt([(R=t==null?void 0:t.options)==null?void 0:R.marker.lng,(A=t==null?void 0:t.options)==null?void 0:A.marker.lat]);return[...v,...P?[P]:[]]},[v,(mt=t==null?void 0:t.options)==null?void 0:mt.marker]),y=b.exports.useRef(),[L,C]=le(),S=b.exports.useMemo(()=>({top:25+C.height,bottom:25,left:25,right:25}),[C.height]),$=b.exports.useMemo(()=>({top:50,bottom:50,left:C.width+32+50,right:50}),[C.width]),M=r?S:$,_=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 b.exports.useEffect(()=>{var N,yt;if(!x.length||!((N=t.options)!=null&&N.marker))return;const P=Me(x.map(({geometry:vt})=>[vt.coordinates[1],vt.coordinates[0]])),[z,R,A,ot]=ct(P);(yt=y==null?void 0:y.current)==null||yt.fitBounds([[R,z],[ot,A]],{maxZoom:17,padding:M,duration:1e3})},[x,M]),t.options?a(Ge,{mapRef:y,mapPadding:M,children:k(En,{children:[k(ue,{ref:y,mapLib:de,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/${p}/style.json?key=9jNGatuzs05Q1oNlctEs`,onMove:_,cooperativeGestures:t.options.cooperativeGestures,onMoveStart:()=>f(!0),onMoveEnd:()=>f(!1),children:[a(pe,{showCompass:!0,style:{marginTop:r?16+C.height:16,marginRight:16}}),t.options.marker&&a(fe,{marker:t.options.marker}),a(Gt,{rect:C,zoom:t.options.zoom,mapRef:y,points:v,isMobile:r,activePOI:o,hoveredPOI:s,isMapMoving:h,setActivePOI:i}),r?a(Kt,{ref:L,showMobileList:c}):a(qt,{ref:L})]}),r&&k(et,{children:[a(zn,{children:a(Rn,{size:"large",SVGElement:Be,onClick:()=>l(P=>!P),disabled:!(n&&!!at[n].length)})}),a(Xt,{})]})]})}):a("div",{children:"No options provided."})},jn=()=>a(we,{children:a(Hn,{})});export{jn as default};
|