atriusmaps-node-sdk 3.3.1117 → 3.3.1119
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/cjs/package.json.js +1 -1
- package/dist/cjs/plugins/venueDataLoader/src/fixedOffsetZones.js +22 -0
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +2 -1
- package/dist/package.json.js +1 -1
- package/dist/plugins/posthog/src/posthog.js +1 -1
- package/dist/plugins/venueDataLoader/src/fixedOffsetZones.js +1 -0
- package/dist/plugins/venueDataLoader/src/venueDataLoader.js +1 -1
- package/dist/src/app.js +1 -1
- package/package.json +1 -1
package/dist/cjs/package.json.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FIXED_OFFSET_ZONES = {
|
|
4
|
+
// Each of these stayed on its 2026 summer offset and skips the 2026-11-01 fall-back.
|
|
5
|
+
// Browsers with tzdata older than the listed release still fall back.
|
|
6
|
+
// British Columbia: permanent UTC−7 (tzdata 2026b, 2026-04-22)
|
|
7
|
+
"America/Vancouver": "Etc/GMT+7",
|
|
8
|
+
// Alberta, plus most of the Northwest Territories: permanent UTC−6 (tzdata 2026c, 2026-07-08)
|
|
9
|
+
"America/Edmonton": "Etc/GMT+6",
|
|
10
|
+
// Northwest Territories (Inuvik): permanent UTC−6 (tzdata 2026d, 2026-09-11)
|
|
11
|
+
"America/Inuvik": "Etc/GMT+6",
|
|
12
|
+
// Manitoba: permanent UTC−5 (tzdata 2026e, 2026-09-29)
|
|
13
|
+
"America/Winnipeg": "Etc/GMT+5"
|
|
14
|
+
};
|
|
15
|
+
function resolveVenueTimezone(tz) {
|
|
16
|
+
if (!tz || !FIXED_OFFSET_ZONES[tz]) {
|
|
17
|
+
return tz;
|
|
18
|
+
}
|
|
19
|
+
return FIXED_OFFSET_ZONES[tz];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.resolveVenueTimezone = resolveVenueTimezone;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var R = require('ramda');
|
|
4
4
|
var Zousan = require('zousan');
|
|
5
|
+
var fixedOffsetZones = require('./fixedOffsetZones.js');
|
|
5
6
|
var venueLoadingUtils = require('./venueLoadingUtils.js');
|
|
6
7
|
|
|
7
8
|
function _interopNamespaceDefault(e) {
|
|
@@ -283,7 +284,7 @@ async function create(app, config) {
|
|
|
283
284
|
app.bus.on("venueData/getVenueData", () => venueDataLoaded);
|
|
284
285
|
app.bus.on("venueData/getVenueName", getVenueDataProp("name"));
|
|
285
286
|
app.bus.on("venueData/getVenueCategory", getVenueDataProp("category"));
|
|
286
|
-
app.bus.on("venueData/getVenueTimezone",
|
|
287
|
+
app.bus.on("venueData/getVenueTimezone", () => venueDataLoaded.then((venueData) => fixedOffsetZones.resolveVenueTimezone(venueData.tz)));
|
|
287
288
|
app.bus.on("venueData/getAccountId", () => config.accountId);
|
|
288
289
|
app.bus.on("venueData/getVenueId", getVenueDataProp("id"));
|
|
289
290
|
app.bus.on("venueData/getPositioningSupported", getVenueDataProp("positioningSupported"));
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="3.3.
|
|
1
|
+
var a="3.3.1119",e={version:a};export{e as default,a as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{version as n}from"../../../package.json.js";const s={apiHost:"https://us.i.posthog.com",recordCanvas:!0,canvasFps:4,canvasQuality:.4};let a;function e(n){return"localhost"===n.hostname||"127.0.0.1"===n.hostname?"local":"apps.locuslabs.com"===n.hostname?/^\/previews\/[^/]+(?:\/|$)/.test(n.pathname)?"preview":"staging":"production"}async function o(o){if("undefined"==typeof window||!o||!1===o.active||a)return;const t=process.env.POSTHOG_PROJECT_TOKEN;if(!t)return void console.warn("PostHog is enabled but POSTHOG_PROJECT_TOKEN is missing");const{default:i}=await
|
|
1
|
+
import{version as n}from"../../../package.json.js";const s={apiHost:"https://us.i.posthog.com",recordCanvas:!0,canvasFps:4,canvasQuality:.4};let a;function e(n){return"localhost"===n.hostname||"127.0.0.1"===n.hostname?"local":"apps.locuslabs.com"===n.hostname?/^\/previews\/[^/]+(?:\/|$)/.test(n.pathname)?"preview":"staging":"production"}async function o(o){if("undefined"==typeof window||!o||!1===o.active||a)return;const t=process.env.POSTHOG_PROJECT_TOKEN;if(!t)return void console.warn("PostHog is enabled but POSTHOG_PROJECT_TOKEN is missing");const{default:i}=await(import("posthog-js"));if(a)return;a=i;const r={...s,...o};i.init(t,{api_host:r.apiHost,defaults:"2026-08-30",session_recording:{...void 0!==r.sessionReplaySampleRate&&{sampleRate:r.sessionReplaySampleRate},...r.recordCanvas&&{captureCanvas:{recordCanvas:!0,canvasFps:r.canvasFps,canvasQuality:String(r.canvasQuality)}}}}),i.register({environment:e(new URL(window.location.href)),webengine_version:n})}function t(){return{init:()=>{}}}function i(){a=void 0}export{s as DEFAULTS,o as activate,t as create,e as getEnvironment,i as reset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const c={"America/Vancouver":"Etc/GMT+7","America/Edmonton":"Etc/GMT+6","America/Inuvik":"Etc/GMT+6","America/Winnipeg":"Etc/GMT+5"};function n(n){return n&&c[n]?c[n]:n}export{n as resolveVenueTimezone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import t from"zousan";import{fetchStyleDoc as
|
|
1
|
+
import*as e from"ramda";import t from"zousan";import{resolveVenueTimezone as a}from"./fixedOffsetZones.js";import{fetchStyleDoc as n,normalizeCoords as s,getVenueDataFromUrls as r,buildStructures as u,createFetchJson as o,createFetchText as i,createFetchManifestJson as d}from"./venueLoadingUtils.js";async function l(l,c){const p=l.log.sublog("venueDataLoader");let v=new t,g=new t;const f=t=>t.defaultStructureId||e.path(["structureOrder",0],t)||e.path(["selectorOrder",0],t)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(t),b=(e,t)=>e.split("").reduce((a,n,s)=>e.substring(0,s+1)===t.substring(0,s+1)?s:a,-1)+1,m=e=>((e,t)=>Object.values(e.venueList).filter(e=>e.locale===t).sort((t,a)=>b(a.id,e.id)-b(t.id,e.id)).at(0))(e,"en")?.id;async function h(t,a){const n=o(),s=i(),c=d(t.auth,e=>l.bus.send("venueData/authError",{reason:"signedManifestForbidden",status:e})),p=await r(t,n,a,c),{accountId:g,venueId:b}=t;return p.assetStage=t.assetStage,p.defaultOrdinal=p.defaultOrdinal||function(t){const a=f(t),n=Object.values(t.structures).find(e.propEq(a,"id"));return n.levels[n.defaultLevelId].ordinal}(p),p.structures=u(p),p.baseVenueId=m(p),p.getTranslatedContentPath=e=>`https://content.locuslabs.com/${p.category}/${e}/${b}/${g}`,p.fetchJson=n,p.fetchText=s,l.config.debug&&l.env.isBrowser&&(window._venueData=p),p.queueTypes&&(p.securityQueueTypes=(()=>{const e=p.queueTypes.find(e=>"SecurityLane"===e.id);return e?e.subtypes.map(e=>e.id):[]})()),l.bus.send("venueData/venueDataLoaded",{venueData:p}),v.resolve(p),v}function y(e){const t={id:"venueDataLoader"};return e.id!==c.venueId&&(t.vid=e.id),t.lang=l.i18n().language,"prod"!==e.assetStage&&(t.stage=e.assetStage),l.bus.send("deepLinking/notifyState",t),e}l.bus.on("debugTools/fileDrop",async({file:e,content:t})=>{if("application/json"===e.type){const e=JSON.parse(t);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(t),void l.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return a=t,void l.bus.send("map/replaceStyle",{styleSrc:a})}var a,n});async function D(e){const t={...e},a=await l.bus.get("poi/getAll");return Object.values(t).forEach(e=>e.filter(e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type).forEach(e=>{const t=a[e.properties.id];t?t.mapLabel?e.properties.text=t.mapLabel:!1!==c.copyPOINamesToMap&&(e.properties.text=function(e){let t=e.name;return c.poiMapNameXForm?(Object.keys(c.poiMapNameXForm).filter(t=>((e,t)=>e===t||0===e.indexOf(t+"."))(e.category,t)).forEach(e=>{c.poiMapNameXForm[e].forEach(e=>t=t.replace(new RegExp(e.replace),e.with))}),t):t}(t)):p.warn(`Unknown poi in style: ${e.properties.id}`)})),t}async function I(a){return e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.keys),e.prepend(a.id),e.map(e=>a.files.geoJson.replace("${geoJsonId}",e)),e.map(a.fetchJson),e.map(e.andThen(e=>[e.id,w(e.id,e.features,a.id,a.structures)])),e=>t.all(e),e.andThen(e.fromPairs))(a)}const w=(t,a,n,s)=>{const r=t.replace(/-[^-]*$/,""),u=r===n?"landscape-background":`ordinal: ${s.find(e.hasPath(["levels",t])).levels[t].ordinal}`;return a.map(a=>{var s,o,i;return s="properties",o={venueId:n,structureId:r,ordinalId:u,levelId:t},i=a,a=e.over(e.lensProp(s),t=>e.mergeRight(t||{},o),i),a=e.assoc("id",a.properties.subid,a)})};l.bus.on("venueData/loadMap",async()=>{v.then(async e=>{const t=e.files.spritesheet,a=e.files.glyphs,{id:s,bounds:r,structures:u,venueCenter:o,venueRadius:i,defaultOrdinal:d}=e,[p,v,f]=await Promise.all([n(e.baseVenueId,e.category),e.fetchJson(e.files.theme),e.venueList[s].mapTokens?Promise.resolve({[s]:[]}):I(e).then(D)]),b={mapFeatures:f,mapStyleSource:p,mapTheme:v,badgesSpriteUrl:t,mapGlyphsUrl:a,structures:u,defaultOrdinal:d,venueBounds:{n:r.ne.lat,s:r.sw.lat,e:r.ne.lng,w:r.sw.lng},venueId:s,venueCenter:o,venueRadius:i,accountId:c.accountId,secure:void 0!==c.auth,tileServerAuthInfo:e.tileServerAuthInfo};g.resolve(b),l.bus.send("venueData/mapDataLoaded",b)})});const O=e=>null==e.shouldDisplay||e.shouldDisplay;l.bus.on("venueData/loadBuildingSelectorData",()=>v.then(async t=>{const a={buildings:t.structures.filter(O).map(e.evolve({levels:e.pipe(e.values,e.sortWith([e.descend(e.prop("ordinal"))]))})),structureOrder:t.structureOrder,selectorOrder:t.selectorOrder};return l.bus.send("venueData/buildingSelectorDataLoaded",a),a})),l.bus.on("venueData/normalizeCoords",({coords:e})=>v.then(t=>s(e,t.bounds)));const S={edges:[],nodes:[]};l.bus.on("venueData/loadNavGraph",async()=>v.then(async e=>{const t={navGraphData:e.files.nav?await e.fetchJson(e.files.nav):S,structures:e.structures};return l.bus.send("venueData/navGraphLoaded",t),t})),l.bus.on("venueData/loadPoiData",async()=>v.then(async e=>{const t=c.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld;if(t){const a=await e.fetchJson(t);l.bus.send("venueData/poiDataLoaded",{pois:a,structures:e.structures})}})),l.bus.on("venueData/getVenueCenter",async()=>v.then(async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))),l.bus.on("venueData/getContentUrl",({type:e,name:t=""})=>v.then(a=>a.files[e]+t)),l.bus.on("venueData/getFloorIdToNameMap",()=>v.then(e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.values),e.map(e.props(["id","name"])),e.fromPairs))),l.bus.on("venueData/getFloorIdName",({floorId:t})=>v.then(async a=>{const n=e.pipe(e.values,e.find(e.hasPath(["levels",t])))(a.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[t].name}:null}));const T=(t,a)=>()=>v.then(e.pipe(e.prop(t),e.defaultTo(a)));function P(e,t){const a=L(t);if(a.includes(e))return e;const n=e.split("-").slice(1).join("-");return a.find(e=>new RegExp(`${t.baseVenueId}.?.?-${n}`).test(e))}l.bus.on("venueData/getVenueData",()=>v),l.bus.on("venueData/getVenueName",T("name")),l.bus.on("venueData/getVenueCategory",T("category")),l.bus.on("venueData/getVenueTimezone",()=>v.then(e=>a(e.tz))),l.bus.on("venueData/getAccountId",()=>c.accountId),l.bus.on("venueData/getVenueId",T("id")),l.bus.on("venueData/getPositioningSupported",T("positioningSupported")),l.bus.on("venueData/getStructures",T("structures")),l.bus.on("venueData/loadNewVenue",async({venueId:e,accountId:a,assetStage:n=c.assetStage})=>{v.reject(new Error("loadNewVenue called - previous loading ignored")),g.reject(new Error("loadNewVenue called - previous loading ignored")),v=new t,g=new t,h({...c,venueId:e,accountId:a,assetStage:n},[]).then(y)}),l.bus.on("venueData/getPoiImageUrl",({imageName:e,size:t})=>`https://img.locuslabs.com/resize/${c.accountId}/png/transparent/${t}contain/poi/${e}`),l.bus.on("venueData/getDistributionId",()=>v.then(e=>`${e.baseVenueId}-${c.accountId}`)),l.bus.on("venueData/getCustomKeywords",()=>v.then(e=>{const t=c.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(t)})),l.bus.on("venueData/isGrabEnabled",T("enableGrab")),l.bus.on("venueData/getGrabPoiIds",T("grabPoiIds",[])),l.bus.on("venueData/getAssetsTimestamp",T("version")),l.bus.on("venueData/getTranslatedFloorId",async({floorId:e})=>v.then(t=>P(e,t)));const L=e=>e.structures.reduce((e,t)=>e.concat(Object.keys(t.levels)),[]);l.bus.on("venueData/getQueueTypes",()=>v.then(e=>{const t=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce((e,a)=>{const{id:n,subtypes:s}=a,r=s.map(e=>{const a=t.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return{...e,imageId:a}});return e[n]=r,e},{}):{}}));return{init:async()=>{let e=[];null===new URLSearchParams("undefined"==typeof window?"":window.location.search).get("lang")&&(e="undefined"==typeof window?[]:navigator.languages);const t=c.deepLinkProps||{};t.lang&&e.unshift(t.lang);const a=t.vid||c.venueId,n=c.useDynamicUrlParams&&t.stage?t.stage:c.assetStage,s=t.accountId||("alpha"===n?"A1VPTJKREFJWX5":c.accountId);h({...c,venueId:a,accountId:s,assetStage:n},e).then(y)},runTest:async({testRoutine:e,reset:a=!1,venueData:n=null})=>{let s,r;return(a||n)&&(v=new t,g=new t),n&&(v=t.resolve(n)),await e(),v.v&&(s=await v),g.v&&(r=await g),{venueDataObj:s,mapDataObj:r}},internal:{calculateBaseVenueId:m,getDefaultStructureId:f,getTranslatedFloorId:P,setConfigProperty:(e,t)=>{c[e]=t}}}}export{l as create};
|
package/dist/src/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{map as t,mergeDeepRight as n}from"ramda";import{evaluateResults as e}from"zousan/evaluate";import{series as o}from"zousan/series";import i from"./utils/i18n.js";import{startInitialStateListener as a}from"./utils/isInitialState.js";import{version as s}from"../package.json.js";import r from"./debugTools.js";import{buildEnv as l}from"./env.js";import{create as u}from"./extModules/bustle.js";import{initLog as c}from"./extModules/log.js";const g="undefined"!=typeof window;async function p(t,n,e){if(!e)return t.log.info(`Plugin ${n} explicitly disabled`),null;if(void 0!==e.active&&(!1===e.active||"notLocalhost"===e.active&&t.env.isLocalhost()))return t.log.info(`Plugin ${n} explicitly deativated`),null;return(n.includes("/")?(()=>{const[t,e]=n.split("/");return import(`../plugins/${t}/${e}/src/index.js`)})():import(`../plugins/${n}/src/index.js`)).then(o=>(t.log.info(`Creating plugin ${n}`),o.create(t,e)))}async function d(t){return g?import(`./configs/${t}.json`):import(`./configs/${t}.json.js`)}async function m(t,e){let o={};const i=await Promise.all(e.map(d));for(const t of i){let e=t.default;e=e.extends?await m(e,e.extends):e,o=n(o,e)}return o=n(o,t),o}const f=t=>n=>import(`./configs/postproc-${t}.ts`).then(t=>t.process(n));async function w(n){const d=Object.create(null);let w=n.extends?await m(n,n.extends):n;if(w.plugins?.monitoring&&!1!==w.plugins.monitoring.active){const t=w.plugins.monitoring;try{const n=await
|
|
1
|
+
import{map as t,mergeDeepRight as n}from"ramda";import{evaluateResults as e}from"zousan/evaluate";import{series as o}from"zousan/series";import i from"./utils/i18n.js";import{startInitialStateListener as a}from"./utils/isInitialState.js";import{version as s}from"../package.json.js";import r from"./debugTools.js";import{buildEnv as l}from"./env.js";import{create as u}from"./extModules/bustle.js";import{initLog as c}from"./extModules/log.js";const g="undefined"!=typeof window;async function p(t,n,e){if(!e)return t.log.info(`Plugin ${n} explicitly disabled`),null;if(void 0!==e.active&&(!1===e.active||"notLocalhost"===e.active&&t.env.isLocalhost()))return t.log.info(`Plugin ${n} explicitly deativated`),null;return(n.includes("/")?(()=>{const[t,e]=n.split("/");return import(`../plugins/${t}/${e}/src/index.js`)})():import(`../plugins/${n}/src/index.js`)).then(o=>(t.log.info(`Creating plugin ${n}`),o.create(t,e)))}async function d(t){return g?import(`./configs/${t}.json`):import(`./configs/${t}.json.js`)}async function m(t,e){let o={};const i=await Promise.all(e.map(d));for(const t of i){let e=t.default;e=e.extends?await m(e,e.extends):e,o=n(o,e)}return o=n(o,t),o}const f=t=>n=>import(`./configs/postproc-${t}.ts`).then(t=>t.process(n));async function w(n){const d=Object.create(null);let w=n.extends?await m(n,n.extends):n;if(w.plugins?.monitoring&&!1!==w.plugins.monitoring.active){const t=w.plugins.monitoring;try{const n=await(import("../_virtual/_empty_module_placeholder.js"));await n.activate(t)}catch(t){const n=t instanceof Error?t.message:String(t);console.warn("Monitoring plugin failed to load (continuing without it):",n)}}if(w=await(async t=>t.configPostProc?o(t,...t.configPostProc.map(f)):t)(w),g&&w.plugins?.posthog&&!1!==w.plugins.posthog.active)try{const{activate:t}=await(import("../plugins/posthog/src/posthog.js"));await t(w.plugins.posthog)}catch(t){console.warn("PostHog failed to start (continuing without it):",t)}const h=(t=>{const n=t.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","nl","pl","pt","ru","so","th","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let t=new URLSearchParams(location.search).get("lang")||navigator.language;for(;t;){if(t&&n.includes(t))return t;t=t.substring(0,t.lastIndexOf("-"))}}return t.defaultLanguage||"en"})(w),y=await i(h,{debug:w.debug});d.i18n=()=>y,d.gt=()=>y.t.bind(y),d.config=w,d.plugins={};const v=c("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g,trace:false});d.log=v.sublog(w.name),d.bus=u({showEvents:!0,reportAllErrors:!0,log:v}),d.info={wePkg:{version:s}},"undefined"!=typeof window&&(w.debug?(d.debug=t(t=>t.bind(d),r),r.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),d.env=l(d);const{theme:j}=w;if(j?await e({name:"ThemeManagerModule",value:import("../_virtual/_empty_module_placeholder.js")},{name:"HistoryManager",value:import("./historyManager.js")},{name:"LayerManager",value:import("../_virtual/_empty_module_placeholder.js")}).then(async({LayerManager:t,HistoryManager:n,ThemeManagerModule:e})=>{const o=e.initThemeManager(d);d.themePack=await o.buildTheme(j,w.defaultTheme),a(),t.initLayerManager(d),n.initHistoryManager(d),d.destroy=()=>t.destroy()}):d.destroy=()=>{},w.plugins){for(const t in w.plugins)try{const n=w.plugins[t];if(d.plugins[t])throw Error(`Duplicate plugin name "${t}"`);const e=await p(d,t,n);e&&(d.plugins[t]=e)}catch(n){v.error("Error instantiating plugin "+t),v.error(n)}for(const t in d.plugins)d.plugins[t].init()}return"undefined"!=typeof window&&d.bus.send("appInsights/log",{name:"app/loaded",properties:{deploymentHost:window.location.host}}),d}export{w as create};
|
package/package.json
CHANGED