atriusmaps-node-sdk 3.3.790 → 3.3.792

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.
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var funcs = require('../../../src/utils/funcs.js');
4
- var postprocMolUrlParms = require('../../../src/configs/postproc-mol-url-parms.js');
5
- var postprocStateTracking = require('../../../src/configs/postproc-stateTracking.js');
3
+ var postprocMolUrlParms = require('../src/configs/postproc-mol-url-parms.js');
4
+ var postprocStateTracking = require('../src/configs/postproc-stateTracking.js');
5
+ var funcs = require('../src/utils/funcs.js');
6
6
 
7
7
  function prepareSDKConfig(sc) {
8
8
  const {
@@ -32,7 +32,7 @@ function prepareSDKConfig(sc) {
32
32
  engineName,
33
33
  dynamicPoisUrlBaseV1,
34
34
  plugins,
35
- analytics2ActiveFlag,
35
+ anaytics2ActiveFlag,
36
36
  enablePoiSelection,
37
37
  minZoom,
38
38
  maxZoom,
@@ -106,8 +106,8 @@ function prepareSDKConfig(sc) {
106
106
  uuid: typeof document !== 'undefined' && document && document.location ? document.location.host : 'unknown', // used in analytics
107
107
  };
108
108
 
109
- if (analytics2ActiveFlag !== undefined) {
110
- config.plugins.analytics2.active = analytics2ActiveFlag;
109
+ if (anaytics2ActiveFlag !== undefined) {
110
+ config.plugins.analytics2.active = anaytics2ActiveFlag;
111
111
  }
112
112
 
113
113
  // return an object with the named property set to the specified value, unless the
@@ -173,7 +173,7 @@ function prepareSDKConfig(sc) {
173
173
  }
174
174
 
175
175
  if (initState) {
176
- postprocStateTracking.setStateFromStateString(config, funcs.b64DecodeUnicode(initState), true);
176
+ postprocStateTracking.setStateFromStateString(config, atob(initState), true);
177
177
  }
178
178
 
179
179
  if (deepLinkParms) {
@@ -4,8 +4,8 @@ var http = require('node:http');
4
4
  var https = require('node:https');
5
5
  var httpsProxyAgent = require('https-proxy-agent');
6
6
  var fetch = require('node-fetch');
7
+ var prepareSDKConfig = require('../deploy/prepareSDKConfig.js');
7
8
  var _package = require('../package.json.js');
8
- var prepareSDKConfig = require('../plugins/sdkServer/src/prepareSDKConfig.js');
9
9
  var controller = require('../src/controller.js');
10
10
  var observable = require('../src/utils/observable.js');
11
11
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var name = "web-engine";
6
- var version = "3.3.790";
6
+ var version = "3.3.792";
7
7
  var license = "UNLICENSED";
8
8
  var type = "module";
9
9
  var main = "src/main.js";
@@ -48,6 +48,50 @@ const getContentStage = vconfig => {
48
48
  return stage === 'alpha' || stage === 'beta' || stage === 'prod' ? stage : null;
49
49
  };
50
50
 
51
+ // Groups of locale tags that refer to the same language variant and should match each other
52
+ // when no exact match is available. zh-CN/zh-SG use simplified script; zh-TW/zh-HK/zh-MO use traditional.
53
+ const LOCALE_ALIAS_GROUPS = [
54
+ ['zh-CN', 'zh-SG', 'zh-Hans'],
55
+ ['zh-TW', 'zh-HK', 'zh-MO', 'zh-Hant'],
56
+ ];
57
+
58
+ const getLocaleAliases = locale => {
59
+ const group = LOCALE_ALIAS_GROUPS.find(g => g.includes(locale));
60
+ return group ? group.filter(l => l !== locale) : [];
61
+ };
62
+
63
+ // Three tiers of locale match, from most to least specific. Returned as predicates
64
+ // so the resolver below can walk all venues at each tier before falling to the next.
65
+ // 1. Exact full-tag match (e.g. "zh-Hans" === "zh-Hans")
66
+ // 2. Known aliases (e.g. browser "zh-CN" matches venue "zh-Hans")
67
+ // 3. Two-char language-subtag prefix on both sides (e.g. "fr-FR" vs "fr_CA" both reduce to "fr")
68
+ const getLocaleMatchTiers = browserLang => {
69
+ const aliases = getLocaleAliases(browserLang);
70
+ const prefix = browserLang.slice(0, 2);
71
+ return [
72
+ locale => locale === browserLang,
73
+ locale => aliases.includes(locale),
74
+ locale => locale.slice(0, 2) === prefix,
75
+ ];
76
+ };
77
+
78
+ // Resolve a browser locale to a venue. Within each tier, prefer `currentVenue` over
79
+ // other siblings when both would match — this keeps the caller on their intended venue
80
+ // when it satisfies the preference, and prevents a lower-tier match (e.g. "en" prefix)
81
+ // from yanking a user off an exactly-matching region sibling.
82
+ const findVenueForLocale = (venues, browserLang, currentVenue = null) => {
83
+ for (const matches of getLocaleMatchTiers(browserLang)) {
84
+ if (currentVenue && matches(currentVenue.locale)) {
85
+ return currentVenue;
86
+ }
87
+ const venue = venues.find(v => matches(v.locale));
88
+ if (venue) {
89
+ return venue;
90
+ }
91
+ }
92
+ return null;
93
+ };
94
+
51
95
  const getVenueDataFromUrls = async (vconfig, fetchJson, languagesToTry) => {
52
96
  const stages = {
53
97
  alpha: 'alpha-a.locuslabs.com',
@@ -69,17 +113,22 @@ const getVenueDataFromUrls = async (vconfig, fetchJson, languagesToTry) => {
69
113
  : await fetchJson(`${accountUrl}/${assetFormat}.json`);
70
114
 
71
115
  // Reassign venue id to venueId+langauge preference if that venue in that language is avaialbe to us in the v5 json
72
- if (languagesToTry.length > 0) {
73
- const convertedLangsToTry = languagesToTry.map(lang => lang.slice(0, 2)); // Browser langs can look like this [fr', 'fr-FR', 'ar', 'en-US', 'en'] so we need to process them so they match our lang codes which are just 2 digits
74
- for (let i = 0; i < convertedLangsToTry.length; i += 1) {
75
- const venue = Object.values(venueList).find(
76
- v => v.locale === convertedLangsToTry[i] && v.id !== venueId && v.id.startsWith(venueId),
77
- );
78
- if (venue) {
79
- venueId = venue.id;
80
- vconfig.venueId = `${venueId}`;
81
- break;
82
- }
116
+
117
+ // First, obtain the "venue code" for the venueId - This unique identifies the "same venue absent of language suffix"
118
+ const venueCode = venueList[venueId] ? venueList[venueId].venueCode : null;
119
+ if (!venueCode) {
120
+ throw Error(`Venue id ${venueId} not found in venue list: ${Object.keys(venueList)}`);
121
+ }
122
+
123
+ // Now find the first language in the user's browser preferences that matches a venue with the same venue code - and if we find it, switch to that venue id instead (which will have the language suffix)
124
+ const venuesWithSameVenueCode = Object.values(venueList).filter(v => v.venueCode === venueCode);
125
+ const currentVenue = venueList[venueId];
126
+ for (const browserLang of languagesToTry) {
127
+ const venue = findVenueForLocale(venuesWithSameVenueCode, browserLang, currentVenue);
128
+ if (venue) {
129
+ venueId = venue.id;
130
+ vconfig.venueId = `${venueId}`;
131
+ break;
83
132
  }
84
133
  }
85
134
 
@@ -199,5 +248,6 @@ const normalizeCoords = (coords, venueBounds) => {
199
248
  exports.buildStructures = buildStructures;
200
249
  exports.createFetchJson = createFetchJson;
201
250
  exports.createFetchText = createFetchText;
251
+ exports.findVenueForLocale = findVenueForLocale;
202
252
  exports.getVenueDataFromUrls = getVenueDataFromUrls;
203
253
  exports.normalizeCoords = normalizeCoords;
@@ -34,17 +34,5 @@ function filterOb(fn, ob) {
34
34
  return ret;
35
35
  }
36
36
 
37
- const b64DecodeUnicode = str =>
38
- // Going backwards: from bytestream, to percent-encoding, to original string.
39
- decodeURIComponent(
40
- atob(str)
41
- .split('')
42
- .map(function (c) {
43
- return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
44
- })
45
- .join(''),
46
- );
47
-
48
- exports.b64DecodeUnicode = b64DecodeUnicode;
49
37
  exports.filterOb = filterOb;
50
38
  exports.singleFile = singleFile;
@@ -0,0 +1 @@
1
+ import{setDeepLinksForParms as e}from"../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as i}from"../src/configs/postproc-stateTracking.js";import{filterOb as n}from"../src/utils/funcs.js";function t(t){const{name:s,debug:a,headless:r,theme:l,defaultSearchTerms:c,venueId:p,accountId:d,poiCategories:u,preserveStateInURL:g,supportURLDeepLinks:h,initState:m,deepLinkParms:f,uiHide:S,renderDiv:v,parentConfig:k,desktopViewMinWidth:L,forceDesktop:P,hostAppId:A,hostAppVersion:w,hostAppProperties:V,logFilter:b,searchPlaceholder:y,dataFetch:D,engineName:I,dynamicPoisUrlBaseV1:Z,plugins:j,anaytics2ActiveFlag:F,enablePoiSelection:O,minZoom:R,maxZoom:T,noLangOptions:U,pinnedLocation:x,pinnedLocationZoom:C,pinnedLocationFocusAtStart:M,pinnedLocationBearing:W,pinnedLocationPitch:z}=t,B=k?[k]:r?["sdkHeadless"]:["sdkVisual"],H=(e,i)=>e&&e.length>i?e.substring(0,i):e,E={name:s,engineName:I,extends:B,debug:a,logFilter:b,theme:l,uiHide:S,renderDiv:v,configPostProc:[],plugins:{venueDataLoader:{dataFetch:D,venueId:p,accountId:d},sdkServer:{headless:r},analytics2:{hostAppId:(e=>e?H(e.toString(),128):void 0)(A),hostAppVersion:(e=>e?H(e.toString(),128):void 0)(w),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const i={},n=Object.keys(e);return n.length>10&&(n.length=10),n.forEach(n=>{let t=H(n.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);t.match(/^[a-zA-Z]+/)||(t="X"+t);let o=e[n];null==o&&(o=""),o=H(o.toString(),128),i[t]=o}),i})(V)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};void 0!==F&&(E.plugins.analytics2.active=F);const N=(e,i)=>void 0!==i?{[e]:i}:{};return r||(E.plugins["online/headerOnline"]={searchPlaceholder:y},E.plugins.mapRenderer={...N("enablePoiSelection",O),viewLimits:{...N("maxZoom",T),...N("minZoom",R)}},E.plugins.userMenu={noLangOptions:U},x&&(E.plugins["online/pinnedLocation"]={location:x,zoom:C,focusAtStart:M,bearing:W,pitch:z})),E.plugins.searchService=c?{defaultSearchTerms:c}:{},o(t,"defaultSearchTerms",E.plugins.searchService),B.includes("sdkVisual")&&(E.plugins["online/homeView"]=u?{poiCategories:u}:{},o(t,"poiCategories",E.plugins["online/homeView"])),j&&(j.draw&&(E.plugins.draw=j.draw),j.flightStatus&&(E.plugins.flightStatus=j.flightStatus,E.plugins["online/flightDetails"]={},E.plugins["online/flightDetailsSearch"]={})),g&&(E.configPostProc.push("stateTracking"),E.plugins.deepLinking={trackURL:!0}),h&&E.configPostProc.push("mol-url-parms"),m&&i(E,atob(m),!0),f&&e(E,new URLSearchParams(f),!0),void 0!==L&&(E.desktopViewMinWidth=L),P&&(E.desktopViewMinWidth=0),Z&&(E.plugins.dynamicPois={urlBaseV1:Z}),n((e,i)=>void 0!==i,E)}function o(e,i,n){Object.keys(e).filter(e=>e.startsWith(i+"-")).forEach(i=>n[i]=e[i])}export{t as default};
@@ -1 +1 @@
1
- import e from"node:http";import t from"node:https";import{HttpsProxyAgent as n}from"https-proxy-agent";import o from"node-fetch";import r from"../package.json.js";import s from"../plugins/sdkServer/src/prepareSDKConfig.js";import{create as i}from"../src/controller.js";import c from"../src/utils/observable.js";const g=r.version;let a=!1;const l=e=>e.toString().length<2?"0"+e:e,m=()=>`AtriusMaps Node SDK (${(()=>{const e=new Date;return`${e.getHours()}:${l(e.getMinutes())}:${l(e.getSeconds())}.${e.getMilliseconds()}`})()}): `,p=function(){if(a){let e=m()+Array.from(arguments).map(e=>"object"==typeof e?JSON.stringify(e):e).join(" ");const t=e.split("\n");t.length>1?e=t[0]+`… (+ ${t.length-1} lines)`:e.length>256&&(e=e.substring(0,255)+`… (length: ${e.length} chars)`),console.log(e)}};async function f(r){return new Promise((g,a)=>{r.headless=!0,function(r){const s=new e.Agent({keepAlive:!0}),i=new t.Agent({keepAlive:!0}),c=r.proxy?new n(`http://${r.proxy.host}:${r.proxy.port}`):null,g=r.agent||c||(e=>"http:"===e.protocol?s:i);global.fetch=async(e,t)=>o(e,{...t,agent:g})}(r);const l=s(r);l.plugins.monitoring=null,i(l).then(e=>{const t=(t,n)=>("string"==typeof t&&(t={...n,command:t}),p("Sending command object: ",t),e.bus.get("clientAPI/execute",t).then(e=>(p("Received Message: ",e),e)).catch(e=>{throw p("Error: ",e.message),e}));c(t),e.eventListener.observe(function(){t.fire.apply(t,arguments)}),t.on("ready",(e,n)=>{const{commands:o}=n.commandJSON;!function(e,t){t.forEach(t=>{e[t.command]=function(){const n={command:t.command};for(let e=0;e<arguments.length;e++)n[t.args[e].name]=arguments[e];return e(n)}})}(t,o),g(t),p("map ready")})})})}const h={getVersion:()=>g,newMap:e=>f(e),setLogging:e=>{a=e,e&&p(`Atrius Maps JS SDK Client v${g} Logging enabled.`)}};export{h as default};
1
+ import e from"node:http";import t from"node:https";import{HttpsProxyAgent as n}from"https-proxy-agent";import o from"node-fetch";import r from"../deploy/prepareSDKConfig.js";import s from"../package.json.js";import{create as i}from"../src/controller.js";import c from"../src/utils/observable.js";const a=s.version;let g=!1;const l=e=>e.toString().length<2?"0"+e:e,m=()=>`AtriusMaps Node SDK (${(()=>{const e=new Date;return`${e.getHours()}:${l(e.getMinutes())}:${l(e.getSeconds())}.${e.getMilliseconds()}`})()}): `,p=function(){if(g){let e=m()+Array.from(arguments).map(e=>"object"==typeof e?JSON.stringify(e):e).join(" ");const t=e.split("\n");t.length>1?e=t[0]+`… (+ ${t.length-1} lines)`:e.length>256&&(e=e.substring(0,255)+`… (length: ${e.length} chars)`),console.log(e)}};async function f(s){return new Promise((a,g)=>{s.headless=!0,function(r){const s=new e.Agent({keepAlive:!0}),i=new t.Agent({keepAlive:!0}),c=r.proxy?new n(`http://${r.proxy.host}:${r.proxy.port}`):null,a=r.agent||c||(e=>"http:"===e.protocol?s:i);global.fetch=async(e,t)=>o(e,{...t,agent:a})}(s);const l=r(s);l.plugins.monitoring=null,i(l).then(e=>{const t=(t,n)=>("string"==typeof t&&(t={...n,command:t}),p("Sending command object: ",t),e.bus.get("clientAPI/execute",t).then(e=>(p("Received Message: ",e),e)).catch(e=>{throw p("Error: ",e.message),e}));c(t),e.eventListener.observe(function(){t.fire.apply(t,arguments)}),t.on("ready",(e,n)=>{const{commands:o}=n.commandJSON;!function(e,t){t.forEach(t=>{e[t.command]=function(){const n={command:t.command};for(let e=0;e<arguments.length;e++)n[t.args[e].name]=arguments[e];return e(n)}})}(t,o),a(t),p("map ready")})})})}const h={getVersion:()=>a,newMap:e=>f(e),setLogging:e=>{g=e,e&&p(`Atrius Maps JS SDK Client v${a} Logging enabled.`)}};export{h as default};
@@ -1 +1 @@
1
- var e="web-engine",t="3.3.790",s="UNLICENSED",r="module",o="src/main.js",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],l={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:comp":"cypress open --component --browser chrome","cypress:comp:ci":"cypress run --component",demo:"cd demo/ && yarn start",dev:"yarn mol e2e","format:check":"yarn prettier . --check","format:fix":"yarn prettier . --write",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh","icons:convert":"node scripts/convertSvgToJsx.mjs",lint:"eslint . --ext .js,.jsx,.ts,.tsx",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol","playwright:ci":"yarn playwright test --grep-invert sdk","playwright:ci:failed":"yarn playwright test --last-failed --grep-invert sdk","playwright:sdk":"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./test/sdk && npx http-server' 8080 'yarn playwright test sdk --ui'","playwright:ui":"yarn playwright test --ui --grep-invert sdk",prepare:"husky",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:all":"yarn lint && yarn format:check && yarn test && yarn test:vitest && yarn cypress:comp:ci && yarn playwright:ci","test:mod":"playwright test --config=playwright.mod.config.ts","test:vitest":"vitest run",typecheck:"tsc -p tsconfig.checkjs.json",storybook:"storybook dev -p 6006","build-storybook":"storybook build"},a=["defaults"],n={"@azure/event-hubs":"^5.12.2","@csstools/normalize.css":"^11.0.1","@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/bearing":"^7.2.0","@turf/circle":"^7.2.0","@turf/helpers":"^7.2.0","@turf/point-to-line-distance":"^7.2.0","@vitejs/plugin-react":"^5.2.0","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1","cypress-multi-reporters":"^2.0.5","cypress-real-events":"^1.14.0",dompurify:"^3.3.3","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^20.6.1","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"6.0.2",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","mocha-junit-reporter":"^2.2.1",mochawesome:"^7.1.3","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1",pmtiles:"^4.4.0","prop-types":"^15.8.1","qrcode.react":"^4.2.0",ramda:"^0.30.1",react:"^19.2.4","react-compound-slider":"^3.4.0","react-dom":"^19.2.4","react-json-editor-ajrm":"^2.5.14","react-svg":"^16.3.0","react-virtualized-auto-sizer":"^1.0.25","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.15","styled-normalize":"^8.1.1","throttle-debounce":"^5.0.2",trackjs:"^3.10.4","ua-parser-js":"^0.7.40",uuid:"11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},c={"@applitools/eyes-playwright":"^1.44.1","@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@babel/core":"^7.26.10","@babel/eslint-parser":"^7.26.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.26.0","@babel/plugin-transform-modules-commonjs":"^7.26.3","@babel/plugin-transform-runtime":"^7.26.10","@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@playwright/test":"^1.56.0","@storybook/addon-essentials":"^8.6.15","@storybook/blocks":"^8.6.15","@storybook/react":"^8.6.15","@storybook/react-vite":"^8.6.15","@testing-library/jest-dom":"^6.6.3","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","babel-jest":"^29.7.0","babel-loader":"^10.0.0","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.2","babel-plugin-styled-components":"^2.1.4","chai-colors":"^1.0.1","css-loader":"^7.1.2",cypress:"^15.0.0","cypress-wait-until":"^3.0.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-config-standard":"^17.1.0","eslint-import-resolver-alias":"^1.1.2","eslint-import-resolver-typescript":"^3.9.1","eslint-plugin-cypress":"^2.15.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"^28.11.0","eslint-plugin-n":"^17.16.2","eslint-plugin-node":"^11.1.0","eslint-plugin-playwright":"^2.2.2","eslint-plugin-promise":"^5.2.0","eslint-plugin-react":"^7.37.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.5.1",glob:"^11.0.1",husky:"^9.1.7",jest:"29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^15.5.0","node-fetch":"^2.7.0","null-loader":"^4.0.1",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"3.7.4","start-server-and-test":"^2.0.11",storybook:"^8.6.15",typescript:"^5.8.2",vite:"^7.3.2",vitest:"^4.1.2","webpack-merge":"^6.0.1"},p="yarn@4.13.0",d={node:"24.x"},m={},y={name:e,version:t,private:!0,license:s,type:r,main:o,workspaces:i,scripts:l,"lint-staged":{"*.js":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"]},browserslist:a,dependencies:n,devDependencies:c,packageManager:p,engines:d,nx:m};export{a as browserslist,y as default,n as dependencies,c as devDependencies,d as engines,s as license,o as main,e as name,m as nx,p as packageManager,l as scripts,r as type,t as version,i as workspaces};
1
+ var e="web-engine",t="3.3.792",s="UNLICENSED",r="module",o="src/main.js",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],l={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:comp":"cypress open --component --browser chrome","cypress:comp:ci":"cypress run --component",demo:"cd demo/ && yarn start",dev:"yarn mol e2e","format:check":"yarn prettier . --check","format:fix":"yarn prettier . --write",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh","icons:convert":"node scripts/convertSvgToJsx.mjs",lint:"eslint . --ext .js,.jsx,.ts,.tsx",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol","playwright:ci":"yarn playwright test --grep-invert sdk","playwright:ci:failed":"yarn playwright test --last-failed --grep-invert sdk","playwright:sdk":"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./test/sdk && npx http-server' 8080 'yarn playwright test sdk --ui'","playwright:ui":"yarn playwright test --ui --grep-invert sdk",prepare:"husky",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:all":"yarn lint && yarn format:check && yarn test && yarn test:vitest && yarn cypress:comp:ci && yarn playwright:ci","test:mod":"playwright test --config=playwright.mod.config.ts","test:vitest":"vitest run",typecheck:"tsc -p tsconfig.checkjs.json",storybook:"storybook dev -p 6006","build-storybook":"storybook build"},a=["defaults"],n={"@azure/event-hubs":"^5.12.2","@csstools/normalize.css":"^11.0.1","@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/bearing":"^7.2.0","@turf/circle":"^7.2.0","@turf/helpers":"^7.2.0","@turf/point-to-line-distance":"^7.2.0","@vitejs/plugin-react":"^5.2.0","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1","cypress-multi-reporters":"^2.0.5","cypress-real-events":"^1.14.0",dompurify:"^3.3.3","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^20.6.1","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"6.0.2",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","mocha-junit-reporter":"^2.2.1",mochawesome:"^7.1.3","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1",pmtiles:"^4.4.0","prop-types":"^15.8.1","qrcode.react":"^4.2.0",ramda:"^0.30.1",react:"^19.2.4","react-compound-slider":"^3.4.0","react-dom":"^19.2.4","react-json-editor-ajrm":"^2.5.14","react-svg":"^16.3.0","react-virtualized-auto-sizer":"^1.0.25","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.15","styled-normalize":"^8.1.1","throttle-debounce":"^5.0.2",trackjs:"^3.10.4","ua-parser-js":"^0.7.40",uuid:"11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},c={"@applitools/eyes-playwright":"^1.44.1","@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@babel/core":"^7.26.10","@babel/eslint-parser":"^7.26.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.26.0","@babel/plugin-transform-modules-commonjs":"^7.26.3","@babel/plugin-transform-runtime":"^7.26.10","@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@playwright/test":"^1.56.0","@storybook/addon-essentials":"^8.6.15","@storybook/blocks":"^8.6.15","@storybook/react":"^8.6.15","@storybook/react-vite":"^8.6.15","@testing-library/jest-dom":"^6.6.3","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","babel-jest":"^29.7.0","babel-loader":"^10.0.0","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.2","babel-plugin-styled-components":"^2.1.4","chai-colors":"^1.0.1","css-loader":"^7.1.2",cypress:"^15.0.0","cypress-wait-until":"^3.0.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-config-standard":"^17.1.0","eslint-import-resolver-alias":"^1.1.2","eslint-import-resolver-typescript":"^3.9.1","eslint-plugin-cypress":"^2.15.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"^28.11.0","eslint-plugin-n":"^17.16.2","eslint-plugin-node":"^11.1.0","eslint-plugin-playwright":"^2.2.2","eslint-plugin-promise":"^5.2.0","eslint-plugin-react":"^7.37.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.5.1",glob:"^11.0.1",husky:"^9.1.7",jest:"29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^15.5.0","node-fetch":"^2.7.0","null-loader":"^4.0.1",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"3.7.4","start-server-and-test":"^2.0.11",storybook:"^8.6.15",typescript:"^5.8.2",vite:"^7.3.2",vitest:"^4.1.2","webpack-merge":"^6.0.1"},p="yarn@4.13.0",d={node:"24.x"},m={},y={name:e,version:t,private:!0,license:s,type:r,main:o,workspaces:i,scripts:l,"lint-staged":{"*.js":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"]},browserslist:a,dependencies:n,devDependencies:c,packageManager:p,engines:d,nx:m};export{a as browserslist,y as default,n as dependencies,c as devDependencies,d as engines,s as license,o as main,e as name,m as nx,p as packageManager,l as scripts,r as type,t as version,i as workspaces};
@@ -1 +1 @@
1
- import*as e from"ramda";import{findBoundsOfCoordinates as t}from"../../../src/utils/bounds.js";const a=async(e,t)=>fetch(t),s=e=>e=>a(0,e).then(e=>e.json()),n=e=>e=>a(0,e).then(e=>e.text()),l=e=>`https://api.content.locuslabs.com/${e}`,o=(t,a,s,n,o)=>e.mapObjIndexed((e,a)=>((e,t,a,s,n,o)=>"theme"===o||"style"===o?`${l(a)}/${t}/${o}/${n}/${s}/${o}.json`:e.replace(/https:\/\/content.locuslabs.com/gi,l(a)))(e,t,s,n,o,a),a),i=async(e,t,a)=>{const s={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:n,accountId:l,formatVersion:i}=e;let{venueId:c}=e;const r=`https://${s[n]||s.prod}/accounts/${l}`,u=i||"v5",d=e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getFiles?await globalThis[e.dataFetch].getFiles(e):await t(`${r}/${u}.json`);if(a.length>0){const t=a.map(e=>e.slice(0,2));for(let a=0;a<t.length;a+=1){const s=Object.values(d).find(e=>e.locale===t[a]&&e.id!==c&&e.id.startsWith(c));if(s){c=s.id,e.venueId=`${c}`;break}}}if(!d[c])throw Error(`Attempt to access venue ${c} which is not within venue list: ${Object.keys(d)}`);const g=d[c].files,h=(e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getVenueData?await globalThis[e.dataFetch].getVenueData(e):await t(g.venueData))[c];h.tileServerAuthInfo&&function(e){const t={defaultOrdinal:0,defaultStructureId:"singleBuilding",formatVersion:"v5",structures:{singleBuilding:{name:"singleBuilding",boundsPolygon:[],defaultLevelId:"singleLevel",id:"singleBuilding",levels:{singleLevel:{boundsPolygon:[],clfloor:0,details:"",id:"singleLevel",name:"singleLevel",ordinal:0}}}},structureOrder:["singleBuilding"]};for(const a in t)e[a]=t[a]}(h),h.venueList=d;const b=(e=>{const t=e.deepLinkProps?e.deepLinkProps.contentStage:null;return"alpha"===t||"beta"===t||"prod"===t?t:null})(e);return h.files=b?o(h.category,g,b,l,c):g,h},c=e=>{const{structureOrder:a,structures:s}=e;return a.map(e=>{const a=s[e];Object.values(a.levels).forEach(e=>e.bounds=t(e.boundsPolygon));const n=t(a.boundsPolygon);return{...a,bounds:n}})};const r=([e,t,...a])=>[t,e,...a],u=(e,t)=>{return!e||!Array.isArray(e)||e.length<1?e:(a=e[0][0],s=t.ne.lng,n=t.sw.lng,(a>s?a<=n:e=>n)?e:e.map(r));var a,s,n};export{c as buildStructures,s as createFetchJson,n as createFetchText,i as getVenueDataFromUrls,u as normalizeCoords};
1
+ import*as e from"ramda";import{findBoundsOfCoordinates as t}from"../../../src/utils/bounds.js";const n=async(e,t)=>fetch(t),s=e=>e=>n(0,e).then(e=>e.json()),l=e=>e=>n(0,e).then(e=>e.text()),o=e=>`https://api.content.locuslabs.com/${e}`,a=(t,n,s,l,a)=>e.mapObjIndexed((e,n)=>((e,t,n,s,l,a)=>"theme"===a||"style"===a?`${o(n)}/${t}/${a}/${l}/${s}/${a}.json`:e.replace(/https:\/\/content.locuslabs.com/gi,o(n)))(e,t,s,l,a,n),n),r=[["zh-CN","zh-SG","zh-Hans"],["zh-TW","zh-HK","zh-MO","zh-Hant"]],i=e=>{const t=(e=>{const t=r.find(t=>t.includes(e));return t?t.filter(t=>t!==e):[]})(e),n=e.slice(0,2);return[t=>t===e,e=>t.includes(e),e=>e.slice(0,2)===n]},c=(e,t,n=null)=>{for(const s of i(t)){if(n&&s(n.locale))return n;const t=e.find(e=>s(e.locale));if(t)return t}return null},u=async(e,t,n)=>{const s={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:l,accountId:o,formatVersion:r}=e;let{venueId:i}=e;const u=`https://${s[l]||s.prod}/accounts/${o}`,d=r||"v5",h=e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getFiles?await globalThis[e.dataFetch].getFiles(e):await t(`${u}/${d}.json`),g=h[i]?h[i].venueCode:null;if(!g)throw Error(`Venue id ${i} not found in venue list: ${Object.keys(h)}`);const f=Object.values(h).filter(e=>e.venueCode===g),b=h[i];for(const t of n){const n=c(f,t,b);if(n){i=n.id,e.venueId=`${i}`;break}}if(!h[i])throw Error(`Attempt to access venue ${i} which is not within venue list: ${Object.keys(h)}`);const m=h[i].files,p=(e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getVenueData?await globalThis[e.dataFetch].getVenueData(e):await t(m.venueData))[i];p.tileServerAuthInfo&&function(e){const t={defaultOrdinal:0,defaultStructureId:"singleBuilding",formatVersion:"v5",structures:{singleBuilding:{name:"singleBuilding",boundsPolygon:[],defaultLevelId:"singleLevel",id:"singleBuilding",levels:{singleLevel:{boundsPolygon:[],clfloor:0,details:"",id:"singleLevel",name:"singleLevel",ordinal:0}}}},structureOrder:["singleBuilding"]};for(const n in t)e[n]=t[n]}(p),p.venueList=h;const v=(e=>{const t=e.deepLinkProps?e.deepLinkProps.contentStage:null;return"alpha"===t||"beta"===t||"prod"===t?t:null})(e);return p.files=v?a(p.category,m,v,o,i):m,p},d=e=>{const{structureOrder:n,structures:s}=e;return n.map(e=>{const n=s[e];Object.values(n.levels).forEach(e=>e.bounds=t(e.boundsPolygon));const l=t(n.boundsPolygon);return{...n,bounds:l}})};const h=([e,t,...n])=>[t,e,...n],g=(e,t)=>{return!e||!Array.isArray(e)||e.length<1?e:(n=e[0][0],s=t.ne.lng,l=t.sw.lng,(n>s?n<=l:e=>l)?e:e.map(h));var n,s,l};export{d as buildStructures,s as createFetchJson,l as createFetchText,c as findVenueForLocale,u as getVenueDataFromUrls,g as normalizeCoords};
@@ -1 +1 @@
1
- import"ramda";import"zousan";let n=null;const t=t=>function(){return n=n?n.then(()=>t.apply(null,arguments)):t.apply(null,arguments),n};function o(n,t){const o={};return Object.keys(t).forEach(e=>{n(e,t[e])&&(o[e]=t[e])}),o}const e=n=>decodeURIComponent(atob(n).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""));export{e as b64DecodeUnicode,o as filterOb,t as singleFile};
1
+ import"ramda";import"zousan";let n=null;const t=t=>function(){return n=n?n.then(()=>t.apply(null,arguments)):t.apply(null,arguments),n};function l(n,t){const l={};return Object.keys(t).forEach(o=>{n(o,t[o])&&(l[o]=t[o])}),l}export{l as filterOb,t as singleFile};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.790",
3
+ "version": "3.3.792",
4
4
  "description": "This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information",
5
5
  "keywords": [
6
6
  "map",
@@ -1 +0,0 @@
1
- import{b64DecodeUnicode as e,filterOb as i}from"../../../src/utils/funcs.js";import{setDeepLinksForParms as n}from"../../../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as t}from"../../../src/configs/postproc-stateTracking.js";function o(o){const{name:a,debug:r,headless:l,theme:c,defaultSearchTerms:p,venueId:d,accountId:u,poiCategories:g,preserveStateInURL:h,supportURLDeepLinks:m,initState:f,deepLinkParms:S,uiHide:v,renderDiv:k,parentConfig:L,desktopViewMinWidth:P,forceDesktop:A,hostAppId:w,hostAppVersion:V,hostAppProperties:b,logFilter:y,searchPlaceholder:D,dataFetch:I,engineName:Z,dynamicPoisUrlBaseV1:j,plugins:F,analytics2ActiveFlag:O,enablePoiSelection:R,minZoom:T,maxZoom:U,noLangOptions:x,pinnedLocation:C,pinnedLocationZoom:M,pinnedLocationFocusAtStart:W,pinnedLocationBearing:z,pinnedLocationPitch:B}=o,H=L?[L]:l?["sdkHeadless"]:["sdkVisual"],E=(e,i)=>e&&e.length>i?e.substring(0,i):e,N={name:a,engineName:Z,extends:H,debug:r,logFilter:y,theme:c,uiHide:v,renderDiv:k,configPostProc:[],plugins:{venueDataLoader:{dataFetch:I,venueId:d,accountId:u},sdkServer:{headless:l},analytics2:{hostAppId:(e=>e?E(e.toString(),128):void 0)(w),hostAppVersion:(e=>e?E(e.toString(),128):void 0)(V),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const i={},n=Object.keys(e);return n.length>10&&(n.length=10),n.forEach(n=>{let t=E(n.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);t.match(/^[a-zA-Z]+/)||(t="X"+t);let o=e[n];null==o&&(o=""),o=E(o.toString(),128),i[t]=o}),i})(b)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};void 0!==O&&(N.plugins.analytics2.active=O);const X=(e,i)=>void 0!==i?{[e]:i}:{};return l||(N.plugins["online/headerOnline"]={searchPlaceholder:D},N.plugins.mapRenderer={...X("enablePoiSelection",R),viewLimits:{...X("maxZoom",U),...X("minZoom",T)}},N.plugins.userMenu={noLangOptions:x},C&&(N.plugins["online/pinnedLocation"]={location:C,zoom:M,focusAtStart:W,bearing:z,pitch:B})),N.plugins.searchService=p?{defaultSearchTerms:p}:{},s(o,"defaultSearchTerms",N.plugins.searchService),H.includes("sdkVisual")&&(N.plugins["online/homeView"]=g?{poiCategories:g}:{},s(o,"poiCategories",N.plugins["online/homeView"])),F&&(F.draw&&(N.plugins.draw=F.draw),F.flightStatus&&(N.plugins.flightStatus=F.flightStatus,N.plugins["online/flightDetails"]={},N.plugins["online/flightDetailsSearch"]={})),h&&(N.configPostProc.push("stateTracking"),N.plugins.deepLinking={trackURL:!0}),m&&N.configPostProc.push("mol-url-parms"),f&&t(N,e(f),!0),S&&n(N,new URLSearchParams(S),!0),void 0!==P&&(N.desktopViewMinWidth=P),A&&(N.desktopViewMinWidth=0),j&&(N.plugins.dynamicPois={urlBaseV1:j}),i((e,i)=>void 0!==i,N)}function s(e,i,n){Object.keys(e).filter(e=>e.startsWith(i+"-")).forEach(i=>n[i]=e[i])}export{o as default};