atriusmaps-node-sdk 3.2.10 → 3.2.30
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/README.md +41 -35
- package/config/rollup.config.cjs.js +31 -0
- package/dist/cjs/_virtual/_empty_module_placeholder.js +5 -0
- package/dist/cjs/deploy/nodeEntry.js +15 -0
- package/dist/cjs/deploy/prepareSDKConfig.js +9 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/package.json.js +11 -0
- package/dist/cjs/plugins/clientAPI/src/clientAPI.js +9 -0
- package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +33 -0
- package/dist/cjs/plugins/poiDataManager/src/poiDataManager.js +36 -0
- package/dist/cjs/plugins/sdkServer/src/sdkHeadless.js +31 -0
- package/dist/cjs/plugins/sdkServer/src/sdkServer.js +13 -0
- package/dist/cjs/plugins/sdkServer/src/util.js +10 -0
- package/dist/cjs/plugins/searchService/src/poiSearch.js +28 -0
- package/dist/cjs/plugins/searchService/src/searchService.js +37 -0
- package/dist/cjs/plugins/searchService/src/searchTypeahead.js +8 -0
- package/dist/cjs/plugins/searchService/src/utils.js +13 -0
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +36 -0
- package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +34 -0
- package/dist/cjs/plugins/wayfinder/src/findRoute.js +30 -0
- package/dist/cjs/plugins/wayfinder/src/minPriorityQueue.js +5 -0
- package/dist/cjs/plugins/wayfinder/src/navGraph.js +13 -0
- package/dist/cjs/plugins/wayfinder/src/navGraphDebug.js +30 -0
- package/dist/cjs/plugins/wayfinder/src/segmentBadges.js +5 -0
- package/dist/cjs/plugins/wayfinder/src/segmentBuilder.js +32 -0
- package/dist/cjs/plugins/wayfinder/src/segmentCategories.js +5 -0
- package/dist/cjs/plugins/wayfinder/src/stepBuilder.js +10 -0
- package/dist/cjs/plugins/wayfinder/src/wayfinder.js +40 -0
- package/dist/cjs/src/app.js +44 -0
- package/dist/cjs/src/auth/Auth.js +23 -0
- package/dist/cjs/src/configs/postproc-mol-url-parms.js +9 -0
- package/dist/cjs/src/configs/postproc-stateTracking.js +31 -0
- package/dist/cjs/src/configs/sdkHeadless.json.js +43 -0
- package/dist/cjs/src/controller.js +14 -0
- package/dist/cjs/src/debugTools.js +30 -0
- package/dist/cjs/src/env.js +7 -0
- package/dist/cjs/src/extModules/bustle.js +13 -0
- package/dist/cjs/src/extModules/flexapi/src/help.js +9 -0
- package/dist/cjs/src/extModules/flexapi/src/index.js +13 -0
- package/dist/cjs/src/extModules/flexapi/src/validate.js +10 -0
- package/dist/cjs/src/extModules/geohasher.js +8 -0
- package/dist/cjs/src/extModules/log.js +7 -0
- package/dist/cjs/src/historyManager.js +7 -0
- package/dist/cjs/src/utils/bounds.js +10 -0
- package/dist/cjs/src/utils/buildStructureLookup.js +29 -0
- package/dist/cjs/src/utils/configUtils.js +8 -0
- package/dist/cjs/src/utils/dom.js +10 -0
- package/dist/cjs/src/utils/funcs.js +15 -0
- package/dist/cjs/src/utils/geodesy.js +8 -0
- package/dist/cjs/src/utils/geom.js +35 -0
- package/dist/cjs/src/utils/i18n.js +14 -0
- package/dist/cjs/src/utils/observable.js +5 -0
- package/dist/cjs/src/utils/rand.js +8 -0
- package/lib/_virtual/_empty_module_placeholder.js +1 -0
- package/lib/deploy/nodeEntry.js +1 -1
- package/lib/deploy/prepareSDKConfig.js +1 -1
- package/lib/package.json.js +1 -1
- package/lib/plugins/dynamicPois/src/dynamicPois.js +1 -1
- package/lib/plugins/poiDataManager/src/poiDataManager.js +1 -1
- package/lib/plugins/sdkServer/src/sdkHeadless.js +1 -1
- package/lib/plugins/sdkServer/src/sdkServer.js +1 -1
- package/lib/plugins/sdkServer/src/util.js +1 -1
- package/lib/plugins/searchService/src/poiSearch.js +1 -1
- package/lib/plugins/searchService/src/searchTypeahead.js +1 -1
- package/lib/plugins/venueDataLoader/src/venueDataLoader.js +1 -1
- package/lib/plugins/venueDataLoader/src/venueLoadingUtils.js +1 -1
- package/lib/plugins/wayfinder/src/minPriorityQueue.js +1 -1
- package/lib/plugins/wayfinder/src/navGraph.js +1 -1
- package/lib/plugins/wayfinder/src/segmentBadges.js +1 -1
- package/lib/plugins/wayfinder/src/segmentBuilder.js +1 -1
- package/lib/plugins/wayfinder/src/segmentCategories.js +1 -1
- package/lib/plugins/wayfinder/src/stepBuilder.js +1 -1
- package/lib/plugins/wayfinder/src/wayfinder.js +1 -1
- package/lib/src/app.js +1 -1
- package/lib/src/auth/Auth.js +1 -1
- package/lib/src/configs/sdkHeadless.json +0 -4
- package/lib/src/configs/sdkHeadless.json.js +1 -1
- package/lib/src/debugTools.js +1 -1
- package/lib/src/extModules/bustle.js +1 -1
- package/lib/src/extModules/flexapi/src/index.js +1 -1
- package/lib/src/utils/configUtils.js +1 -1
- package/lib/src/utils/geom.js +1 -1
- package/lib/src/utils/i18n.js +1 -1
- package/lib/src/utils/observable.js +1 -1
- package/package.json +22 -6
- package/lib/_virtual/_empty_module_placeholder +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var e$1 = require('ramda');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var e__namespace = /*#__PURE__*/_interopNamespace(e$1);
|
|
26
|
+
|
|
27
|
+
const e=(n,e)=>{const t=n[0],r=n[1];let l=!1;for(let n=0,o=e.length-1;n<e.length;o=n++){const u=e[n][0],s=e[n][1],c=e[o][0],i=e[o][1];s>r!=i>r&&t<(c-u)*(r-s)/(i-s)+u&&(l=!l);}return l};function t(t,l,u,s){if(!e__namespace.length(t))return null;t=t.filter((n=>null==n.shouldDisplay||!0===n.shouldDisplay));const c=e__namespace.curry(e)([l,u]),i=t.filter(e__namespace.compose(c,r));if(0===i.length)return null;if(1===i.length&&!s)return e__namespace.head(i);const d=i.filter(e__namespace.compose(c,e__namespace.prop("boundsPolygon")));return 1===d.length?e__namespace.head(d):d.length?o(i):s?null:o(i)}const r=n=>{const{n:e,s:t,e:r,w:l}=n.bounds;return [[e,r],[e,l],[t,l],[t,r]]},l=n=>{if(!n.bounds)return 0;const{n:e,s:t,e:r,w:l}=n.bounds;return Math.abs((e-t)*(r-l))},o=n=>{return n.reduce((e=l,(n,t)=>e(n)<e(t)?n:t));var e;},u=(n,e)=>Object.values(n.levels).reduce(((n,t)=>t.ordinal===e?t:n),void 0),s=(n,e)=>n.reduce(((n,t)=>Object.values(t.levels).reduce(((n,t)=>t.id===e?t:n),null)||n),void 0);function c(n,e,r,l,o){const s=t(n,e,r,o);return {building:s,floor:s?u(s,l):null}}const i=(n,e,t,r,l)=>c(n,e,t,r,l).floor;function d(n,e,t,r,l,o,u,s){let c=0,i=0,d=0,f=0,a=0;const h=[{x:n,y:e}];for(let g=1,p=0;g<=20;++g)p=g/20,c=1-p,i=c*c,d=i*c,f=p*p,a=f*p,h.push({x:d*n+3*i*p*t+3*c*f*l+a*u,y:d*e+3*i*p*r+3*c*f*o+a*s});return h}
|
|
28
|
+
|
|
29
|
+
exports.bezierCurveTo = d;
|
|
30
|
+
exports.getBuildingAndFloorAtPoint = c;
|
|
31
|
+
exports.getFloor = s;
|
|
32
|
+
exports.getFloorAt = i;
|
|
33
|
+
exports.getStructureAtPoint = t;
|
|
34
|
+
exports.ordToFloor = u;
|
|
35
|
+
exports.pointInPolygon = e;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var n = require('i18next');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var n__default = /*#__PURE__*/_interopDefaultLegacy(n);
|
|
10
|
+
|
|
11
|
+
async function e(e,t){const a=n__default["default"].createInstance();return a.init({debug:t,interpolation:{escapeValue:!1},resources:{en:{translation:{"Walk xx minutes to":"Walk {{count}} minute to","Walk xx minutes to_plural":"Walk {{count}} minutes to"}}},fallbackLng:"en",lng:e,postProcess:["pseudoTrans"]}).then((()=>(t&&a.on("missingKey",(function(n,e,t,o){console.error("i18nNext: key not found. Language: "+a.language+", Key: "+t+", namespace: "+e+", lngs: ",n);})),a)))}const t={ar:"بال عن أمام الأخذ البرية. ثم كما وقام شاسعة الجنوبي, أمدها الإمداد عن انه. ٣٠ فكانت والكساد انه. أساسي الشمال الإتفاقية بال أم. زهاء المؤلّفة حين عل, سكان قررت هذه ان, شعار باستخدام ولم مع.\n\nدول الأمور الصفحة الأوروبية قد. تم حدى فاتّبع الهجوم, ما أوسع معاملة فعل, خلاف الأوروبية، إيو كل. تُصب واندونيسيا، حين قد. أي حاول حقول وهولندا، هذا, بين عن لهيمنة بالسيطرة.\n\nأعمال الإتحاد العمليات من وصل. وقوعها، باستخدام قد أخر, بل حتى علاقة التبرعات. فقد لم الأرض استبدال. حتى الخاسر اقتصادية بـ. أصقاع أعلنت اتفاقية تلك بل, كان إذ بحشد أخرى ليبين. الشتاء، اليابان، مكن أم, به، قد العالم، أوراقهم, بل لعدم لغزو أواخر مكن.\n",ja:"私は場合いよいよある所有らってのの末がしたた。無論結果に圧迫顔もよくその発展ないですまでを決するてみるでしでも発展云いませたから、そうには描いたないたた。機会へ載っない方は別に今をひょろひょろでずまし。むしろ嘉納さんを意味方面そう#「を積んない権力この自分何か記念をというおお尋ねだろででですで、ある今はこれか頼み例があるで、ネルソンさんののの引込のあなたにもっともお努力といと私赤に実建設が起っようにとやかくご附随を描いですましから、どうもとにかく相違に云おでてならますのが行っないませ。"},a=(n,e)=>"en"===e?n:o(n,t[e]),o=(n,e)=>n.length<e.length?e.substring(0,n.length):e;
|
|
12
|
+
|
|
13
|
+
exports["default"] = e;
|
|
14
|
+
exports.toLang = a;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function t(t){this._observers.splice(this._observers.indexOf(t),1);}function e(t){const e=s();return this.observe((function(){t.apply(this,arguments)&&e.fire.apply(e,arguments);})),e}function r(t){return e.call(this,(function(e){return t===e}))}const n={detach:t,filter:e,fire:function(){const t=this._observers;if(t){for(let e=0;e<t.length;e++)try{t[e].apply(this,arguments);}catch(t){console.error(t);}return this}},observe:function(e){return this._observers||(this._observers=[]),this._observers.push(e),{detach:t.bind(this,e),ob:this}},on:function(t,e){return r.call(this,t).observe(e)}};function s(t){return t?function(t,e){for(const r in e)t[r]=e[r];return t}(t,n):Object.create(n)}
|
|
4
|
+
|
|
5
|
+
module.exports = s;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const t={nextInt:t=>Math.floor(Math.random()*t)};function n(n,e,o){let s;o=o||t,e||(e=n),n>e&&(n=e);const h=[];if(e/n>=2||e<40)for(;h.length<n;)s=o.nextInt(e),h.indexOf(s)<0&&h.push(s);else {const t=[];for(s=0;s<e;s++)t.push(s);for(s=0;s<n;s++){const n=o.nextInt(t.length);h.push(t[n]),t.splice(n,1);}}return h}const e=(t,e)=>((t,n)=>n.map((n=>t[n])))(t,n(e=e||1,t.length));
|
|
6
|
+
|
|
7
|
+
exports.arrayPick = e;
|
|
8
|
+
exports.randomSet = n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={};export{a as default};
|
package/lib/deploy/nodeEntry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"node-fetch";import n from"../package.json.js";import{create as t}from"../src/controller.js";import o from"../src/utils/observable.js";import s from"./prepareSDKConfig.js";const r=n.version;globalThis.fetch||(globalThis.fetch=e);let c=!1;const i=e=>e.toString().length<2?"0"+e:e,a=()=>`AtriusMaps Node SDK (${(()=>{const e=new Date;return`${e.getHours()}:${i(e.getMinutes())}:${i(e.getSeconds())}.${e.getMilliseconds()}`})()}): `,g=function(){if(c){let e=a()+Array.from(arguments).map((e=>"object"==typeof e?JSON.stringify(e):e)).join(" ");const n=e.split("\n");n.length>1?e=n[0]+`… (+ ${n.length-1} lines)`:e.length>256&&(e=e.substring(0,255)+`… (length: ${e.length} chars)`),console.log(e)}};const l={getVersion:()=>r,newMap:e=>async function(e){return new Promise(((n,r)=>{e.headless=!0;const c=s(e);t(c).then((e=>{const t=(n,t)=>("string"==typeof n&&(n={...t,command:n}),g("Sending command object: ",n),e.bus.get("clientAPI/execute",n).then((e=>(g("Received Message: ",e),e))).catch((e=>{throw g("Error: ",e.message),e})));o(t),e.eventListener.observe((function(){t.fire.apply(t,arguments)})),t.on("ready",((e,o)=>{const{commands:s}=o.commandJSON;!function(e,n){n.forEach((n=>{e[n.command]=function(){const t={command:n.command};for(let e=0;e<arguments.length;e++)t[n.args[e].name]=arguments[e];return e(t)}}))}(t,s),n(t),g("map ready")}))}))}))}(e),setLogging:e=>{c=e,e&&g(`Atrius Maps JS SDK Client v${r} Logging enabled.`)}};export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setDeepLinksForParms as e}from"../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as t}from"../src/configs/postproc-stateTracking.js";import{filterOb as o}from"../src/utils/funcs.js";function i(i){const{name:
|
|
1
|
+
import{setDeepLinksForParms as e}from"../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as t}from"../src/configs/postproc-stateTracking.js";import{filterOb as o}from"../src/utils/funcs.js";function i(i){const{name:s,debug:r,headless:a,theme:c,defaultSearchTerms:d,venueId:p,accountId:l,poiCategories:u,preserveStateInURL:h,supportURLDeepLinks:g,initState:m,deepLinkParms:f,uiHide:k,renderDiv:v,parentConfig:S,desktopViewMinWidth:P,forceDesktop:A,hostAppId:V,hostAppVersion:b,hostAppProperties:I,logFilter:L,searchPlaceholder:j,dataFetch:w,engineName:y}=i,D=S?[S]:a?["sdkHeadless"]:["sdkVisual"],T=(e,t)=>e&&e.length>t?e.substring(0,t):e,C={name:s,engineName:y,extends:D,debug:r,logFilter:L,theme:c,uiHide:k,renderDiv:v,configPostProc:[],plugins:{venueDataLoader:{dataFetch:w,venueId:p,accountId:l},sdkServer:{headless:a},analytics2:{hostAppId:(e=>e?T(e.toString(),128):void 0)(V),hostAppVersion:(e=>e?T(e.toString(),128):void 0)(b),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const t={},o=Object.keys(e);return o.length>10&&(o.length=10),o.forEach((o=>{let i=T(o.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);i.match(/^[a-zA-Z]+/)||(i="X"+i);let n=e[o];null==n&&(n=""),n=T(n.toString(),128),t[i]=n})),t})(I)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};return a||(C.plugins["online/headerOnline"]={searchPlaceholder:j}),C.plugins.searchService=d?{defaultSearchTerms:d}:{},n(i,"defaultSearchTerms",C.plugins.searchService),D.includes("sdkVisual")&&(C.plugins["online/homeView"]=u?{poiCategories:u}:{},n(i,"poiCategories",C.plugins["online/homeView"])),h&&(C.configPostProc.push("stateTracking"),C.plugins.deepLinking={trackURL:!0}),g&&C.configPostProc.push("mol-url-parms"),m&&t(C,atob(m),!0),f&&e(C,f,!0),void 0!==P&&(C.desktopViewMinWidth=P),A&&(C.desktopViewMinWidth=0),o(((e,t)=>void 0!==t),C)}function n(e,t,o){Object.keys(e).filter((e=>e.startsWith(t+"-"))).forEach((t=>o[t]=e[t]))}export{i as default};
|
package/lib/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="web-engine",s="3.2.
|
|
1
|
+
var e="web-engine",s="3.2.30",o="src/main.js",l="module",a={demo:"cd demo/ && yarn start",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",mod:"demo/startMod.sh",mol:"demo/startMol.sh",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch"},t={"@aws-amplify/auth":"^4.1.2","@azure/event-hubs":"^5.6.0","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.11","@locus-labs/mod-default-theme":"^0.0.27","@locus-labs/mod-footer":"^0.0.25","@locus-labs/mod-header":"^0.0.19","@locus-labs/mod-location-marker":"^0.0.18","@locus-labs/mod-map-legend":"^0.0.18","@locus-labs/mod-offscreen-indicator":"^0.0.18","@locus-labs/mod-pin":"^0.0.18","@locus-labs/mod-qr-code-card":"^0.0.18","@locus-labs/mod-qr-code-window":"^0.0.19","@locus-labs/mod-walk-time-matrix":"^0.0.17","@locus-labs/mol-desktop-building-level-selector":"^0.1.15","@locus-labs/mol-desktop-compass":"^0.1.29","@locus-labs/mol-desktop-default-theme":"^0.2.13","@locus-labs/mol-desktop-icon":"^0.1.45","@locus-labs/mol-desktop-logo":"^0.1.10","@locus-labs/mol-desktop-map-nav-button":"^0.1.39","@locus-labs/mol-desktop-submenu":"^0.1.30","@locus-labs/mol-desktop-tooltip":"^0.3.11","@locus-labs/mol-desktop-zoom-control":"^0.1.37","@locus-labs/mol-mobile-floating-action-button":"^0.0.20","@locus-labs/mol-mobile-toast":"^0.1.11","@turf/circle":"^6.5.0",IObject:"^0.6.2","crypto-browserify":"^3.12.0","file-loader":"^6.2.0",flexsearch:"0.6.32",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1",jsonschema:"^1.2.6",luxon:"^2.0.1","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0",msal:"1.4.11","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"7.0.1",ramda:"^0.27.0",react:"^17.0.2","react-compound-slider":"^3.3.1","react-dom":"^17.0.2","react-json-editor-ajrm":"^2.5.13","react-qr-svg":"^2.2.1","react-svg":"^11.2.5","react-tageditor":"^0.2.3","react-virtualized-auto-sizer":"^1.0.2","smoothscroll-polyfill":"^0.4.4","styled-components":"5.1.0","styled-normalize":"^8.0.6","throttle-debounce":"^3.0.1",trackjs:"^3.7.4","ua-parser-js":"^0.7.23",uuid:"3.3.2",zousan:"^3.0.1","zousan-plus":"^4.0.1"},r={"@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-modules-commonjs":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/preset-env":"^7.14.8","@babel/preset-react":"^7.8.3","@percy/cli":"^1.0.0-beta.60","@percy/cypress":"^3.1.0","babel-eslint":"^10.0.1","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^4.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"9.5.2","cypress-wait-until":"^1.7.1",eslint:"^7.4.0","eslint-config-standard":"^16.0.3","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-react":"^7.12.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.3.0",husky:"^6.0.0",jest:"^26.0.0","jest-transform-css":"^2.0.0","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",webpack:"^5.45.1","webpack-merge":"^5.8.0"},c="UNLICENSED",n=["demo","deploy","pageSrc","src/extModules/flexapi"],i={name:"web-engine",version:"3.2.30",main:"src/main.js",type:"module",scripts:a,dependencies:t,devDependencies:r,"lint-staged":{"*.js":["eslint --fix"]},license:"UNLICENSED",workspaces:n,private:!0};export{i as default,t as dependencies,r as devDependencies,c as license,o as main,e as name,a as scripts,l as type,s as version,n as workspaces};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import t from"zousan";function a(a,n){let i=new t;function
|
|
1
|
+
import*as e from"ramda";import t from"zousan";function a(a,n){let s=new t;const i=new t;function o(t,n){const s=e.pipe(e.filter((e=>"parking"===e.category)),e.map((a=>{const n=a.dynamicAttributes;if(!n)throw Error(`No dynamicAttributes defined for parking POI ${a.poiId}`);return{...(t-a.timestamp)/1e3<n["parking.timeToLive"]?e.pick(["lotStatus","rateDay","rateHour","timeIsReal","timeToTerminal1","timeToTerminal2"],a):{lotStatus:n["parking.default"],rateDay:"$ -",rateHour:"$ -",timeIsReal:!1},lastUpdated:a.timestamp,lotName:a.lotName}})))(n);a.bus.send("poi/setDynamicData",{plugin:"parking",idValuesMap:s})}function r(t,n){const s=e.pipe(e.map((e=>[e.poiId,u(t,e)])),e.fromPairs)(n);a.bus.send("poi/setDynamicData",{plugin:"security",idValuesMap:s})}const u=(e,t)=>({queueTime:t.queueTime,isTemporarilyClosed:t.isTemporarilyClosed,timeIsReal:!t.isQueueTimeDefault&&t.expiration>e,lastUpdated:e});return a.bus.on("venueData/venueDataLoaded",(({venueData:e})=>{s.v?s=t.resolve(e):s.resolve(e)})),a.bus.on("sdk/readyWhenYouAre",(()=>i)),{init:async()=>{const e=n.urlBase||"https://rest.locuslabs.com/v3",t=n.urlBase||"https://rest.locuslabs.com/v1",u=a.config.plugins.venueDataLoader.accountId;async function c(){return s.then((e=>{let a=`${t}/venue/${e.id}/account/${u}/get-all-dynamic-pois/`;return(t.startsWith("./")||t.endsWith(".json"))&&(a=t),a}))}const l=async()=>s.then((t=>e.startsWith("./")||e.endsWith(".json")?e:`${e}/venueId/${t.id}/accountId/${u}/get-dynamic-queue-times/`)),m=async()=>{Promise.all([c().then(fetch).then((e=>e.json())).then((e=>o(Date.now(),e))),l().then(fetch).then((e=>e.json())).then((e=>r(Date.now(),e)))]).then((()=>i.resolve(!0))).catch((e=>{console.error(e),i.resolve(!0)}))},p=await a.bus.get("venueData/getQueueTypes");p.SecurityLane&&p.SecurityLane.length?s.then(m).then((()=>setInterval(m,3e4))):i.resolve(!0)},internal:{processSecurityWaitTimes:r,processParkingPOIS:o}}}export{a as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"ramda";import e from"zousan";import{buildStructuresLookup as t}from"../../../src/utils/buildStructureLookup.js";import{debugIsTrue as i}from"../../../src/utils/configUtils.js";import{toLang as a}from"../../../src/utils/i18n.js";async function n(a,n){const s=()=>{a.bus.send("venueData/loadPoiData")};let
|
|
1
|
+
import*as o from"ramda";import e from"zousan";import{buildStructuresLookup as t}from"../../../src/utils/buildStructureLookup.js";import{debugIsTrue as i}from"../../../src/utils/configUtils.js";import{toLang as a}from"../../../src/utils/i18n.js";async function n(a,n){const s=a.log.sublog("poiDataManager"),u=()=>{a.bus.send("venueData/loadPoiData")};let p=new e;const d=(o,e)=>{const{position:t}=o,i=e.floorIdToStructure(t.floorId);if(!i)return s.error(`No structure found for floorId: ${t.floorId} for POI ${o.poiId}`),{...o};const a=e.floorIdToFloor(t.floorId),n={...t,structureName:i.name,buildingId:i.id,floorName:a.name,floorOrdinal:a.ordinal};return{...o,position:n}},c=(o,e)=>{o.roomInfo||(o.roomInfo=[]),o.roomInfo.push(e)},l=o.pipe(o.propOr([],"externalIds"),o.find(o.propEq("type","roomId")),o.prop("id"),o.unless(o.isNil,o.tail));a.bus.on("venueData/poiDataLoaded",(async({pois:e,structures:n})=>{if(e=((e,t)=>o.pipe(o.values,o.map((o=>{o.distance=null,o.isNavigable=void 0===o.isNavigable||!0===o.isNavigable,o.capacity&&c(o,{name:`Seats ${o.capacity.join("-")}`,svgId:"number-of-seats"}),o.category.startsWith("meeting")&&c(o,{name:a.gt()("poiView:Conference Room"),svgId:"conference-room"});const e=l(o);return e&&(o.roomId=e),[o.poiId,d(o,t)]})),o.fromPairs)(e))(e,t(n)),i(a,"pseudoTransPois"))for(const o in e)e[o]=r(e[o],a.i18n().language);e=function(o){const e=[];return Object.values(o).forEach((o=>{try{const t=o.position;t?["buildingId","structureName","floorId","floorName","floorOrdinal","latitude","longitude"].forEach((i=>{null!==t[i]&&void 0!==t[i]||e.push({id:o.poiId,e:`invalid position property: ${i}: ${t[i]}`})})):e.push({poi:o,e:"No position information"})}catch(t){s.error(t),e.push({id:o.poiId,e:t.message})}})),e.length&&(s.warn("badPois:",e),e.forEach((e=>{delete o[e.id]}))),o}(e),await async function(o){for(const e of Object.values(o))await y(e);return o}(e),p.resolve(e),a.config.debug&&a.env.isBrowser&&(window._pois=e),a.config.debug&&async function(o){const e=Date.now(),t=[],i=await a.bus.get("wayfinder/_getNavGraph");Object.values(o).forEach((o=>{try{const e=o.position;i.findClosestNode(e.floorId,e.latitude,e.longitude)||t.push({id:o.poiId,e:"No closest Navgraph Node"})}catch(e){s.error(e),t.push({id:o.poiId,e:e.message})}})),t.length&&s.warn("badPois:",t),s(`Total time for navgraph POI check: ${Date.now()-e}ms`)}(e)})),a.bus.on("poi/getById",(async({id:o})=>p.then((e=>e[o])))),a.bus.on("poi/getByFloorId",(async({floorId:e})=>p.then(o.pickBy(o.pathEq(["position","floorId"],e))))),a.bus.on("poi/getByCategoryId",(async({categoryId:e})=>p.then(o.pickBy((o=>o.category===e||o.category.startsWith(e+".")))))),a.bus.on("poi/getAll",(async()=>p));const f=["queue","primaryQueueId"],m=(e,t,i)=>{const a=o.path(["queue","queueType"],t);if(!a)return null;const n=e[a],r=o.path(f,t);return i.filter(o.pathEq(f,r)).filter((o=>o.poiId!==t.poiId)).map((e=>{const t=o.path(["queue","queueSubtype"],e),i=g(t)(n);return{poiId:e.poiId,...i}}))},g=e=>{return o.pipe(o.find(o.propEq("id",e)),(t=`No queue found with ID: ${e}`,o=>{if(null!=o)return o;throw Error(t)}),o.pick(["displayText","imageId"]));var t};async function y(t){if(!t)return;const i="undefined"==typeof window?1:window.devicePixelRatio||1;return o.length(t.images)?t.images[0].startsWith("https:")||(t.images=await e.all(t.images.map((o=>a.bus.get("venueData/getPoiImageUrl",{imageName:o,size:`${351*i}x${197*i}`}))))):t.images=[],t}a.bus.on("poi/addOtherSecurityLanes",(({poi:e})=>(async e=>{if(!o.path(f,e))return e;const t=await a.bus.get("venueData/getQueueTypes"),i=await a.bus.get("poi/getByCategoryId",{categoryId:"security"}),n=Object.values(i);return e.queue.otherQueues=m(t,e,n),e})(e)));const I=o.memoizeWith(o.identity,o.pipe(o.pluck("category"),o.values,o.uniq));a.bus.on("poi/getAllCategories",(async()=>p.then(I))),a.bus.on("venueData/loadNewVenue",(()=>{p=new e,u()})),a.bus.on("poi/setDynamicData",(({plugin:e,idValuesMap:t})=>{p.then((i=>{for(const a in t){const n=i[a].dynamicData||{};n[e]={...t[a]};const r=o.mergeRight(i[a],{dynamicData:n});i[a]=r}}))}));return{init:u,runTest:async o=>(await o(),p),internal:{addImages:y,pseudoTransPoi:r}}}function r(o,e){return["description","nearbyLandmark","name","phone","operationHours"].forEach((t=>{o[t]&&(o[t]=a(o[t],e))})),o.keywords&&(o.keywords=o.keywords.map((o=>(o.name=a(o.name,e),o)))),o.position.floorName&&(o.position.floorName=a(o.position.floorName,e)),o.position.structureName&&(o.position.structureName=a(o.position.structureName,e)),o}export{n as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"./util.js";const
|
|
1
|
+
import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"./util.js";const s=[{command:"destroy"},{command:"getDirections",args:[{name:"from",type:"location"},{name:"to",type:"location"},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getPOIDetails",args:[{name:"poiId",type:"integer",min:0}]},{command:"getAllPOIs"},{command:"getStructures"},{command:"getVenueData"},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]}];function a(s){s.bus.on("clientAPI/destroy",(async()=>s.destroy())),s.bus.on("clientAPI/getDirections",(async({from:n,to:a,accessible:o,queueTypes:i})=>{const r=await t(s,n),c=await t(s,a),u={requiresAccessibility:!!o};return i&&(u.selectedSecurityLanes={SecurityLane:i}),s.bus.get("wayfinder/getRoute",{fromEndpoint:r,toEndpoint:c,options:u}).then(e.pick(["distance","time","steps","navline"]))})),s.bus.on("clientAPI/getPOIDetails",(async({poiId:e})=>s.bus.get("poi/getById",{id:e}))),s.bus.on("clientAPI/getAllPOIs",(async()=>s.bus.get("poi/getAll"))),s.bus.on("clientAPI/getStructures",(()=>n(s)));const a=e=>"function"!=typeof e;s.bus.on("clientAPI/getVenueData",(async()=>{const t=await s.bus.get("venueData/getVenueData");return e.filter(a,t)})),s.bus.on("clientAPI/search",(async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then((n=>{const a=n.map((e=>e.poiId));return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:a}),t?n:a}))))}export{a as handleHeadless,s as headlessCommands};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getBuildingAndFloorAtPoint as e}from"../../../src/utils/geom.js";import t from"../../../src/utils/observable.js";import{headlessCommands as o,handleHeadless as n}from"./sdkHeadless.js";let a
|
|
1
|
+
import{getBuildingAndFloorAtPoint as e}from"../../../src/utils/geom.js";import t from"../../../src/utils/observable.js";import{headlessCommands as o,handleHeadless as n}from"./sdkHeadless.js";let a=null;function s(e){const t=(e,t)=>{const o={payload:e,type:"LL-server"};t&&(o.clientMsgId=t);try{window.postMessage(o,"*")}catch(e){window.postMessage((e=>JSON.parse(JSON.stringify(e)))(o),"*")}};function o(o){const n=o.data;n&&"LL-client"===n.type&&e.bus.get("clientAPI/execute",n.payload).then((e=>t(e,n.msgId))).catch((t=>{e.config.debug&&console.error(t),((e,t)=>{const o={error:!0,payload:e,type:"LL-server"};t&&(o.clientMsgId=t),window.postMessage(o,"*")})(t.message,n.msgId)}))}return a&&a(),window.addEventListener("message",o),a=()=>window.removeEventListener("message",o),(e,t)=>{const o={event:e,payload:t,type:"LL-server"};window.postMessage(o,"*")}}async function r(a,r){const i=a.env.isBrowser?s(a):function(e){const o=t();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,o){t.bus.monitor("map/userMoveStart",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoveStart",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/userMoving",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoving",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/moveEnd",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("moveEnd",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/floorChanged",(({structure:e,floor:t})=>o("levelChange",{floorId:t?t.id:null,floorName:t?t.name:null,ord:t?t.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null}))),t.bus.monitor("map/poiClicked",(({poi:e})=>o("poiSelected",e))),t.bus.monitor("map/click",(async({lat:n,lng:a,ord:s})=>{const r=await t.bus.get("venueData/getStructures"),{building:i,floor:l}=e(r,n,a,s,!0);o("mapClicked",{lat:n,lng:a,ord:s,building:i,floor:l})}))}(a,i),{init:async()=>{!function(e){e.bus.send("clientAPI/registerCustomType",{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}}),e.bus.send("clientAPI/registerCustomType",{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}})}(a),o.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),n(a),r.headless||await import("../../../_virtual/_empty_module_placeholder.js").then((e=>{e.visualCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),e.handleVisual(a,i)}));const e=async()=>{await a.bus.send("sdk/readyWhenYouAre"),a.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then((e=>i("ready",{commandJSON:e}))),!r.headless&&a.config.uiHide&&a.config.uiHide.sidebar&&a.env.isDesktop()&&a.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}})};r.headless?Promise.all([new Promise((e=>a.bus.monitor("venueData/navGraphLoaded",e))),new Promise((e=>a.bus.monitor("venueData/poiDataLoaded",e)))]).then(e):a.bus.on("map/mapReadyToShow",e)}}}export{r as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFloorAt as o,getFloor as t}from"../../../src/utils/geom.js";const n=async o=>o.bus.get("venueData/getVenueData").then((o=>o.structures));async function i(i,r){if(r.poiId)return i.bus.get("wayfinder/getNavigationEndpoint",{ep:r.poiId});const{lat:l,lng:a,ord:e,floorId:d,title:u=""}=r,s=await n(),f=void 0!==e?o(s,l,a,e):t(s,d);if(void 0!==e)return{lat:l,lng:a,ordinal:e,floorId:f?f.id:null,title:u};if(!f)throw Error("Call to locationToEndpoint with no ordinal and no floorId (or an invalid one): "+d);return{lat:l,lng:a,floorId:d,ordinal:f.ordinal,title:u}}export{n as getStructures,i as locationToEndpoint};
|
|
1
|
+
import{getFloorAt as o,getFloor as t}from"../../../src/utils/geom.js";const n=async o=>o.bus.get("venueData/getVenueData").then((o=>o.structures));async function i(i,r){if(r.poiId)return i.bus.get("wayfinder/getNavigationEndpoint",{ep:r.poiId});const{lat:l,lng:a,ord:e,floorId:d,title:u=""}=r,s=await n(i),f=void 0!==e?o(s,l,a,e):t(s,d);if(void 0!==e)return{lat:l,lng:a,ordinal:e,floorId:f?f.id:null,title:u};if(!f)throw Error("Call to locationToEndpoint with no ordinal and no floorId (or an invalid one): "+d);return{lat:l,lng:a,floorId:d,ordinal:f.ordinal,title:u}}export{n as getStructures,i as locationToEndpoint};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as a from"ramda";import{getFlexSearchInstance as r}from"./utils.js";function t(t,e){const o=r({lang:e});function n(r){return Object.values(r).map((r=>{const{poiId:t,category:e="",name:o,keywords:n=[],roomId:c=""}=r,i=a.path(["dynamicData","grab","tags"],r)||[],p=n.filter(a.prop("isUserSearchable")).map(a.prop("name")),
|
|
1
|
+
import*as a from"ramda";import{getFlexSearchInstance as r}from"./utils.js";function t(t,e){const o=r({lang:e});function n(r){return Object.values(r).map((r=>{const{poiId:t,category:e="",name:o,keywords:n=[],roomId:c=""}=r,i=a.path(["dynamicData","grab","tags"],r)||[],p=n.filter(a.prop("isUserSearchable")).map(a.prop("name")),s=`${o} ${e.split(".").join(" ")} ${c} ${p.join(" ")} ${i.join(" ")}`;return[Number(t),s]}))}return o.addMatcher({"['.,]":""}),n(t).forEach((([a,r])=>o.add(a,r))),{search:function(r){const e=o.search(r);return Object.values(a.pick(e,t))},updateMultiple:function(a){n(a).forEach((([a,r])=>o.update(a,r)))}}}export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pipe as e,values as r,chain as t,prop as a,filter as n,pluck as o}from"ramda";import{getFlexSearchInstance as i}from"./utils.js";function
|
|
1
|
+
import{pipe as e,values as r,chain as t,prop as a,filter as n,pluck as o}from"ramda";import{getFlexSearchInstance as i}from"./utils.js";function s(s,d,u){const c=function(s,d){const u=function(e){return Object.values(e).map((e=>e.category)).map((e=>e.split("."))).map((e=>e[0]))}(s),c=e(r,t(a("keywords")),n(a("isUserSearchable")),o("name"))(s),m=[...u,...c],p=Array.from(new Set([...m])),l=i({lang:d,type:"typeahead"});p.forEach(((e,r)=>l.add(r,e)));return{search:e=>l.search(e).map((e=>p[e])),add:e=>{p.push(e),l.add(p.length-1,e)}}}(s,u);return{query:(e,r)=>{const t=c.search({query:e,limit:r}),a=!(e.length<3)&&t.length,n=r-t.length,o=a?function(e,r){const t=d({query:e,limit:r}),a=d({query:e,suggest:!0,limit:r}),n=t.map((e=>e.poiId)),o=a.filter((e=>-1===n.indexOf(e.poiId)));return t.concat(o)}(e,n):[];return{keywords:t,pois:o}},addKeyword:e=>{c.add(e)}}}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import a from"zousan";import t from"../../../src/auth/Auth.js";import{delay as n}from"../../../src/utils/funcs.js";import{getVenueDataFromUrls as s,buildStructures as u,createFetchJson as o,createFetchText as r}from"./venueLoadingUtils.js";async function i(i,l){const d=i.log.sublog("venueDataLoader");let c=new a,p=new a;const g=a=>a.defaultStructureId||e.path(["structureOrder",0],a)||e.path(["selectorOrder",0],a)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(a);const v=e=>{const a=l.availableLanguages.find((a=>a.langCode===e));return a||{langCode:e,assetSuffix:""}};async function f(a){a.assetStage&&"prod"!==a.assetStage&&location.hostname;const l=a.auth?await async function(e){const a=await t(e,i);let s=null,u=0;for(;!s&&u<6;)s=await a.getToken(),u++,s||await n(500)();return s?(i.bus.send("login/userLoggedIn",{token:s}),i.bus.on("app/logout",a.logout),s):i.bus.get("login/showLogin",{auth:a})}(a.auth):null,p=o(l),f=r(l),b=await s(a,p),{accountId:m,venueId:h}=a;b.assetStage=a.assetStage,b.defaultOrdinal=b.defaultOrdinal||function(a){const t=g(a),n=Object.values(a.structures).find(e.propEq("id",t));return n.levels[n.defaultLevelId].ordinal}(b),b.structures=u(b);const
|
|
1
|
+
import*as e from"ramda";import a from"zousan";import t from"../../../src/auth/Auth.js";import{delay as n}from"../../../src/utils/funcs.js";import{getVenueDataFromUrls as s,buildStructures as u,createFetchJson as o,createFetchText as r}from"./venueLoadingUtils.js";async function i(i,l){const d=i.log.sublog("venueDataLoader");let c=new a,p=new a;const g=a=>a.defaultStructureId||e.path(["structureOrder",0],a)||e.path(["selectorOrder",0],a)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(a);const v=e=>{const a=l.availableLanguages.find((a=>a.langCode===e));return a||{langCode:e,assetSuffix:""}};async function f(a){a.assetStage&&"prod"!==a.assetStage&&location.hostname;const l=a.auth?await async function(e){const a=await t(e,i);let s=null,u=0;for(;!s&&u<6;)s=await a.getToken(),u++,s||await n(500)();return s?(i.bus.send("login/userLoggedIn",{token:s}),i.bus.on("app/logout",a.logout),s):i.bus.get("login/showLogin",{auth:a})}(a.auth):null,p=o(l),f=r(l),b=await s(a,p),{accountId:m,venueId:h}=a;b.assetStage=a.assetStage,b.defaultOrdinal=b.defaultOrdinal||function(a){const t=g(a),n=Object.values(a.structures).find(e.propEq("id",t));return n.levels[n.defaultLevelId].ordinal}(b),b.structures=u(b);const y=i.i18n().language,D=v(y);return b.bareVenueId=h.slice(0,h.length-D.assetSuffix.length),b.getTranslatedContentPath=e=>`https://content.locuslabs.com/${b.category}/${e}/${h}/${m}`,b.fetchJson=p,b.fetchText=f,d.info("venueData ",b,D,y),i.config.debug&&i.env.isBrowser&&(window._venueData=b),b.queueTypes&&(b.securityQueueTypes=(()=>{const e=b.queueTypes.find((e=>"SecurityLane"===e.id));return e?e.subtypes.map((e=>e.id)):[]})()),i.bus.send("venueData/venueDataLoaded",{venueData:b}),c.resolve(b),c}function b(e){const a={id:"venueDataLoader"};e.id!==l.venueId&&(a.vid=e.id);const t=i.config.defaultLanguage||"en";return i.i18n().language!==t&&(a.lang=i.i18n().language),"prod"!==e.assetStage&&(a.stage=e.assetStage),i.bus.send("deepLinking/notifyState",a),e}i.bus.on("debugTools/fileDrop",(async({file:e,content:a})=>{if("application/json"===e.type){const e=JSON.parse(a);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(a),void i.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return t=a,void i.bus.send("map/replaceStyle",{styleSrc:t})}var t,n}));async function m(e){const a={...e},t=await i.bus.get("poi/getAll");return Object.values(a).forEach((e=>e.filter((e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type)).forEach((e=>{const a=t[e.properties.id];a?a.mapLabel?e.properties.text=a.mapLabel:!1!==l.copyPOINamesToMap&&(e.properties.text=function(e){let a=e.name;return l.poiMapNameXForm?(Object.keys(l.poiMapNameXForm).filter((a=>((e,a)=>e===a||0===e.indexOf(a+"."))(e.category,a))).forEach((e=>{l.poiMapNameXForm[e].forEach((e=>a=a.replace(new RegExp(e.replace),e.with)))})),a):a}(a)):d.warn(`Unknown poi in style: ${e.properties.id}`)})))),a}const h=(a,t,n,s)=>{const u=a.replace(/-[^-]*$/,""),o=u===n?"landscape-background":`ordinal: ${s.find(e.hasPath(["levels",a])).levels[a].ordinal}`;return t.map((t=>{var s,r,i;return s="properties",r={venueId:n,structureId:u,ordinalId:o,levelId:a},i=t,t=e.over(e.lensProp(s),(a=>e.mergeRight(a||{},r)),i),t=e.assoc("id",t.properties.subid,t)}))};i.bus.on("venueData/loadMap",(async()=>{c.then((async a=>{const t=await a.fetchText(a.files.style),n=await a.fetchJson(a.files.theme),s=a.files.spritesheet,u=a.files.glyphs,{id:o,bounds:r,structures:d,venueCenter:c,venueRadius:g,defaultOrdinal:v}=a,f=await async function(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,h(e.id,e.features,a.id,a.structures)]))),(e=>Promise.all(e)),e.andThen(e.fromPairs))(a)}(a).then(m),b={mapFeatures:f,mapStyleSource:t,mapTheme:n,badgesSpriteUrl:s,mapGlyphsUrl:u,structures:d,defaultOrdinal:v,venueBounds:{n:r.ne.lat,s:r.sw.lat,e:r.ne.lng,w:r.sw.lng},venueId:o,venueCenter:c,venueRadius:g,accountId:l.accountId,secure:void 0!==l.auth};p.resolve(b),i.bus.send("venueData/mapDataLoaded",b)}))}));const y=e=>null==e.shouldDisplay||e.shouldDisplay;i.bus.on("venueData/loadBuildingSelectorData",(()=>c.then((async a=>{const t={buildings:a.structures.filter(y).map(e.evolve({levels:e.pipe(e.values,e.sortWith([e.descend(e.prop("ordinal"))]))})),structureOrder:a.structureOrder,selectorOrder:a.selectorOrder};return i.bus.send("venueData/buildingSelectorDataLoaded",t),t})))),i.bus.on("venueData/loadNavGraph",(async()=>c.then((async e=>{const a=await e.fetchJson(e.files.nav);i.bus.send("venueData/navGraphLoaded",{navGraphData:a,structures:e.structures})})))),i.bus.on("venueData/loadPoiData",(async()=>c.then((async e=>{const a=l.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld,t=await e.fetchJson(a);i.bus.send("venueData/poiDataLoaded",{pois:t,structures:e.structures})})))),i.bus.on("venueData/getVenueCenter",(async()=>c.then((async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))))),i.bus.on("venueData/getContentUrl",(({type:e,name:a=""})=>c.then((t=>t.files[e]+a)))),i.bus.on("venueData/getFloorIdToNameMap",(()=>c.then(e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.values),e.map(e.props(["id","name"])),e.fromPairs)))),i.bus.on("venueData/getFloorIdName",(({floorId:a})=>c.then((async t=>{const n=e.pipe(e.values,e.find(e.hasPath(["levels",a])))(t.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[a].name}:null}))));const D=(a,t)=>()=>c.then(e.pipe(e.prop(a),e.defaultTo(t)));i.bus.on("venueData/getVenueData",(()=>c)),i.bus.on("venueData/getVenueName",D("name")),i.bus.on("venueData/getVenueCategory",D("category")),i.bus.on("venueData/getVenueTimezone",D("tz")),i.bus.on("venueData/getAccountId",(()=>l.accountId)),i.bus.on("venueData/getVenueId",D("id")),i.bus.on("venueData/getPositioningSupported",D("positioningSupported")),i.bus.on("venueData/getStructures",D("structures")),i.bus.on("venueData/loadNewVenue",(async({venueId:e,accountId:t,assetStage:n=l.assetStage})=>{c.reject(new Error("loadNewVenue called - previous loading ignored")),p.reject(new Error("loadNewVenue called - previous loading ignored")),c=new a,p=new a,f({...l,venueId:e,accountId:t,assetStage:n}).then(b)})),i.bus.on("venueData/changeVenueLanguage",(async({lang:e})=>c.then((async a=>{const t=v(e),n=`${a.bareVenueId}${t.assetSuffix}`;i.bus.send("venueData/loadNewVenue",{accountId:l.accountId,venueId:n})})))),i.bus.on("venueData/getPoiImageUrl",(({imageName:e,size:a})=>`https://img.locuslabs.com/resize/${l.accountId}/${a}cc/poi/${e}`)),i.bus.on("venueData/getDistributionId",(()=>c.then((e=>`${e.bareVenueId}-${l.accountId}`)))),i.bus.on("venueData/getCustomKeywords",(()=>c.then((e=>{const a=l.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(a)})))),i.bus.on("venueData/isGrabEnabled",D("enableGrab")),i.bus.on("venueData/getGrabPoiIds",D("grabPoiIds",[])),i.bus.on("venueData/getAssetsTimestamp",D("version")),i.bus.on("venueData/getTranslatedFloorId",(async({floorId:e})=>c.then((a=>{const t=i.i18n().language,n=v(t);return`${a.bareVenueId}${n.assetSuffix}-${e.split("-").slice(1).join("-")}`})))),i.bus.on("venueData/getQueueTypes",(()=>c.then((e=>{const a=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce(((e,t)=>{const{id:n,subtypes:s}=t,u=s.map((e=>{const t=a.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return{...e,imageId:t}}));return e[n]=u,e}),{}):{}}))));return{init:async()=>{const e=l.deepLinkProps||{},a=e.vid||l.venueId,t=l.useDynamicUrlParams&&e.stage?e.stage:l.assetStage,n="alpha"===t?"A1VPTJKREFJWX5":l.accountId;f({...l,venueId:a,accountId:n,assetStage:t}).then(b)},runTest:async({testRoutine:e,reset:t=!1,venueData:n=null})=>{let s,u;return(t||n)&&(c=new a,p=new a),n&&(c=a.resolve(n)),await e(),c.v&&(s=await c),p.v&&(u=await p),{venueDataObj:s,mapDataObj:u}},internal:{getDefaultStructureId:g}}}export{i as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"ramda";import{findBoundsOfCoordinates as a}from"../../../src/utils/bounds.js";const s=async(t,a)=>t?fetch(a,{headers:{Authorization:t}}):fetch(a),o=t=>a=>s(t,a).then((t=>t.json())),
|
|
1
|
+
import*as t from"ramda";import{findBoundsOfCoordinates as a}from"../../../src/utils/bounds.js";import{global as e}from"../../../src/utils/configUtils.js";const s=async(t,a)=>t?fetch(a,{headers:{Authorization:t}}):fetch(a),o=t=>a=>s(t,a).then((t=>t.json())),c=t=>a=>s(t,a).then((t=>t.text())),n=t=>`https://api.content.locuslabs.com/${t}`,r=(a,e,s,o,c)=>t.mapObjIndexed(((t,e)=>((t,a,e,s,o,c)=>"theme"===c||"style"===c?`${n(e)}/${a}/${c}/${o}/${s}/${c}.json`:t.replace(/https:\/\/content.locuslabs.com/gi,n(e)))(t,a,s,o,c,e)),e),u=async(t,a)=>{const s={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:o,venueId:c,accountId:n,formatVersion:u}=t,l=`https://${s[o]||s.prod}/accounts/${n}`,i=u||"v5",h=t.dataFetch&&e[t.dataFetch]&&e[t.dataFetch].getFiles?await e[t.dataFetch].getFiles(t):await a(`${l}/${i}.json`);if(!h[c])throw Error(`Attempt to access venue ${c} which is not within venue list: ${Object.keys(h)}`);const d=h[c].files,m=(t.dataFetch&&e[t.dataFetch]&&e[t.dataFetch].getVenueData?await e[t.dataFetch].getVenueData(t):await a(d.venueData))[c];m.venueList=h;const p=(t=>{const a=t.deepLinkProps?t.deepLinkProps.contentStage:null;return"alpha"===a||"beta"===a||"prod"===a?a:null})(t);return m.files=p?r(m.category,d,p,n,c):d,m},l=t=>{const{structureOrder:e,structures:s}=t;return e.map((t=>{const e=s[t],o=a(e.boundsPolygon);return{...e,bounds:o}}))};export{l as buildStructures,o as createFetchJson,c as createFetchText,u as getVenueDataFromUrls};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
class h{constructor(){this.heap=[null],this.heapMap={}}offerWithPriority(h,i){const t=this.heap.push([h,i])-1;this.heapMap[h]=t,this.bubble(t)}raisePriority(h,i){const t=this.heapMap[h];this.heap[t][1]=i,this.bubble(t)}poll(){if(1===this.heap.length)return null;if(2===this.heap.length){const h=this.heap.pop()[0];return delete this.heapMap[h],h}const h=this.heap[1][0];return delete this.heapMap[h],this.heap[1]=this.heap.pop(),this.heapMap[this.heap[1][0]]=1,this.sink(1),h}isEmpty(){return 1===this.heap.length}bubble(h){for(;h>1;){const i=h>>1;if(!this.isHigherPriority(h,i))break;this.swap(h,i),h=i}}sink(h){for(;2*h<this.heap.length;){const i=void 0!==this.heap[2*h+1]&&this.isHigherPriority(2*h+1,2*h)?2*h+1:2*h;if(this.isHigherPriority(h,i))break;this.swap(h,i),h=i}}swap(h,i){this.heapMap[this.heap[h][0]]=i,this.heapMap[this.heap[i][0]]=h;const t=this.heap[h];this.heap[h]=this.heap[i],this.heap[i]=t}isHigherPriority(h,i){return this.heap[h][1]<this.heap[i][1]}}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pick as t,isNil as o,map as e,omit as n,path as
|
|
1
|
+
import{pick as t,isNil as o,map as e,omit as n,path as r}from"ramda";import{encode as s,calculateAdjacent as i}from"../../../src/extModules/geohasher.js";import{distance as l}from"../../../src/utils/geodesy.js";import u from"./minPriorityQueue.js";function d(r,i,l,u){const d={},c={};let a={};return r.nodes.forEach((o=>{const e=i(o.floorId),n=l(o.floorId);!function(t){const o=t.floorId+":"+s(t.lat,t.lng).substr(0,7),e=t.floorId+":"+s(t.lat,t.lng).substr(0,8);c[o]||(c[o]=[]);c[o].push(t),c[e]||(c[e]=[]);c[e].push(t),d[t.id]=t}({...t(["id","lat","lng","floorId"],o),edges:[],ordinal:e,structureId:n})})),r.edges.forEach((t=>d[t.s].edges.push(function(t,e){const n=function(t){return t.x?"Security Checkpoint":""===t.t?"Ground":t.t}(t),r="escalator"!==n.toLowerCase()&&"stairs"!==n.toLowerCase(),s=f(t.s,t.d,e),i=t.l||s/60,l=t=>t.map((t=>({start:{lat:t.s[0],lng:t.s[1]},out:{lat:t.o[0],lng:t.o[1]},in:{lat:t.i[0],lng:t.i[1]},end:{lat:t.e[0],lng:t.e[1]}}))),u=t.p?l(t.p):null;return{distance:s,dst:t.d,o:t.o,isAccessible:r,isDriveway:!o(t.h)&&!t.h,src:t.s,transitTime:i,type:n,path:u,weight:i}}(t,d)))),{_nodes:d,_geoDb:c,findClosestNode:(t,o,e)=>w(t,o,e,c,d),findShortestPath:(t,o,e)=>function(t,o,e,n={}){return I(w(t.floorId,t.lat,t.lng,c,e),w(o.floorId,o.lat,o.lng,c,e),e,a,u,n)}(t,o,d,e),findAllShortestPaths:function(t,o,e){if(!t.floorId)throw Error("attempt to find a shortest path with null floorId");const n=t.lat||t.latitude,r=t.lng||t.longitude,s=w(t.floorId,n,r,c,d),i=o.map((t=>w(t.floorId,t.lat,t.lng,c,d)));return s&&i.length?function(t,o,e,n={},r={},s={}){return o.map((o=>{try{return I(t,o,e,n,r,s)}catch(t){return null}}))}(s,i,d,a,u,e):[]},floorIdToOrdinal:i,floorIdToStructureId:l,updateWithSecurityWaitTime:function(t){a=e(n(["lastUpdated"]),t),y()},clearCache:y}}function f(t,o,e){const n=e[t],r=e[o];return l(n.lat,n.lng,r.lat,r.lng)}let c,a,h,g,p,m;const y=()=>{c={},a={},h={},g=new u,p=null,m={}};function I(t,o,e,n={},s={},i={}){for(t.id===p&&m===JSON.stringify(i)||(y(),g.offerWithPriority(t.id,0),c[t.id]=0,h[t.id]=!0,p=t.id,m=JSON.stringify(i));!g.isEmpty()&&!h[o.id];){const t=e[g.poll()],o=c[t.id];for(let e=0;e<t.edges.length;e++){const l=t.edges[e];if(h[l.dst])continue;if(i.requiresAccessibility&&!l.isAccessible)continue;let u=l.weight;if(l.o&&n[l.o]){const t=n[l.o];t.queueTime&&(u=t.queueTime),t.isTemporarilyClosed&&(u=9999),l.securityWaitTimes=t}if(l.o&&s[l.o]){l.securityLane=s[l.o];const{type:t,id:o}=s[l.o],e=r(["selectedSecurityLanes",t],i);if(e&&!e.includes(o))continue}void 0===c[l.dst]?(a[l.dst]=t,c[l.dst]=o+u,g.offerWithPriority(l.dst,o+u)):c[l.dst]>o+u&&(c[l.dst]=o+u,a[l.dst]=t,g.raisePriority(l.dst,o+u))}h[t.id]=!0}if(!h[o.id])return null;const l=[];let u=o;for(;u;)l.push(u),u=a[u.id];return l.reverse()}function b(t,o,e,n){const r=o.substr(0,n),s=[];s.push(t+":"+i(i(r,"top"),"left")),s.push(t+":"+i(r,"top")),s.push(t+":"+i(i(r,"top"),"right")),s.push(t+":"+i(r,"left")),s.push(t+":"+r),s.push(t+":"+i(r,"right")),s.push(t+":"+i(i(r,"bottom"),"left")),s.push(t+":"+i(r,"bottom")),s.push(t+":"+i(i(r,"bottom"),"right"));const l=[];for(let t=0;t<s.length;t++){const o=e[s[t]];if(o)for(let t=0;t<o.length;t++)l.push(o[t])}return l}function w(t,o,e,n,r){const i=function(t,o,e,n){let r=b(t,o,e,8);return r.length>0?r:(r=b(t,o,e,7),r.length>0?r:null)}(t,s(o,e),n)||function(t,o,e,n){const r=Object.values(n).filter((o=>o.floorId===t)).map((t=>[t,l([t.lat,t.lng],[o,e])]));if(!r.length)throw Error(`findClosestNode2 found no nodes on floor ${t}`);return function(t){let o=t[0];for(let e=1;e<t.length;e++)t[e][1]<o[1]&&(o=t[e]);return o[0]}(r)}(t,o,e,r),u=[];for(let t=0;t<i.length;t++){const n=l(o,e,i[t].lat,i[t].lng);u.push([i[t],n])}u.sort((function(t,o){return t[1]-o[1]}));const d=[];for(let t=0;t<u.length;t++)d.push(u[t][0]);return d[0]}export{d as createNavGraph,I as findShortestPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const n={START:"wayfinding.start",END:"wayfinding.end",WALKING_TO_SECURITY_CHECKPOINT:"wayfinding.security",ELEVATOR:"wayfinding.elevator",ELEVATOR_UP:"wayfinding.elevator.up",ELEVATOR_DOWN:"wayfinding.elevator.down",STAIRS:"wayfinding.stairs",STAIRS_UP:"wayfinding.stairs.up",STAIRS_DOWN:"wayfinding.stairs.down",ESCALATOR:"wayfinding.escalator",ESCALATOR_UP:"wayfinding.escalator.up",ESCALATOR_DOWN:"wayfinding.escalator.down",WALK:"wayfinding.movingwalkway",WALK_DOWN:"walk.movingwalkway",WALK_UP:"walk.movingwalkway",TRAIN:"wayfinding.train",TRAIN_UP:"wayfinding.train.up",TRAIN_DOWN:"wayfinding.train.down",BUS:"wayfinding.bus",BUS_UP:"wayfinding.bus.up",BUS_DOWN:"wayfinding.bus.down",SECURITY_CHECKPOINT:"wayfinding.security",RAMP:"wayfinding.ramp",RAMP_UP:"wayfinding.ramp.up",RAMP_DOWN:"wayfinding.ramp.down"};export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import{bezierCurveTo as t}from"../../../src/utils/geom.js";import
|
|
1
|
+
import*as e from"ramda";import{bezierCurveTo as t}from"../../../src/utils/geom.js";import o from"./segmentCategories.js";import a from"./stepBuilder.js";const n=e.map(e.converge(e.assoc("coordinates"),[e=>e.waypoints.flatMap(((e,o)=>o>0&&e.curvedPathForward&&e.curvedPathForward.length>0?e.curvedPathForward.flatMap((e=>t(e.start.lng,e.start.lat,e.in.lng,e.in.lat,e.out.lng,e.out.lat,e.end.lng,e.end.lat))).map((e=>[e.x,e.y])):[[e.position.lng,e.position.lat]])),e.identity])),r=t=>{const a=[];let n={segmentCategory:void 0,waypoints:[]},r=null,s=[];return n.waypoints=[t[0]],n.type=t[0].isPortal?t[0].portalType:"Walk",a.push(n),n={segmentCategory:void 0,waypoints:[]},t.forEach((e=>{s.push(e),r?(r.isPortal===e.isPortal&&r.isSecurityCheckpoint===e.isSecurityCheckpoint||(n.waypoints=s,e.isPortal||r.isPortal?(s.length>1&&s.pop(),s=!e.isPortal||"train"!==e.portalType.toLowerCase()&&"bus"!==e.portalType.toLowerCase()?[e]:[s[s.length-1],e]):s=[],r.poiId&&(n.poiId=r.poiId),a.push(n),n={segmentCategory:void 0,waypoints:[]},n.type=e.isPortal?e.portalType:"Walk"),n.levelDifference=e.levelDifference,r=e):(n.type=e.isPortal?e.portalType:"Walk",r=e)})),n.waypoints=s,0===s.length&&(n.waypoints=[r]),a.push(n),(e=>{e.forEach(((t,a)=>{0===a?t.segmentCategory=o.START:t.waypoints[t.waypoints.length-1].isDestination?t.segmentCategory=o.WALKING_TO_END:"Security Checkpoint"===t.type?t.segmentCategory=o.SECURITY_CHECKPOINT:"Bus"===t.type?t.segmentCategory=o.BUS:"Train"===t.type?t.segmentCategory=o.TRAIN:"Stairs"===t.type?t.levelDifference>0?t.segmentCategory=o.STAIRS_UP:t.levelDifference<0?t.segmentCategory=o.STAIRS_DOWN:t.segmentCategory=o.STAIRS:"Elevator"===t.type?t.levelDifference>0?t.segmentCategory=o.ELEVATOR_UP:t.levelDifference<0?t.segmentCategory=o.ELEVATOR_DOWN:t.segmentCategory=o.ELEVATOR:"Escalator"===t.type?t.levelDifference>0?t.segmentCategory=o.ESCALATOR_UP:t.levelDifference<0?t.segmentCategory=o.ESCALATOR_DOWN:t.segmentCategory=o.ESCALATOR:"Ramp"===t.type?t.levelDifference>0?t.segmentCategory=o.RAMP_UP:t.levelDifference<0?t.segmentCategory=o.RAMP_DOWN:t.segmentCategory=o.RAMP:"Security Checkpoint"===e[a+1].type?t.segmentCategory=o.WALKING_TO_SECURITY_CHECKPOINT:"Walk"!==e[a+1].type&&(t.segmentCategory=o.WALKING_TO_PORTAL)}))})(a),((e,t)=>{if(1===e.length){const a={segmentCategory:void 0,waypoints:[]};a.segmentCategory=o.WALKING_TO_END,a.type="Walk",a.waypoints=[t],e.push(a)}})(a,r),(t=>{t.forEach(((o,a)=>{if(a>1&&0===e.head(o.waypoints).levelDifference){const n=e.last(t[a-1].waypoints);o.waypoints=e.prepend(n,o.waypoints)}}))})(a),a},s=(t,s,i,p,l,g)=>{let y=r(t);y=n(y),s&&y[0].coordinates.unshift([s.lng,s.lat]),i&&e.last(y).coordinates.push([i.lng,i.lat]);return{segments:y.map(((t,a)=>{const n=e.last(t.waypoints),r=t.coordinates,s=!(t.levelDifference&&t.waypoints.every(e.prop("isPortal"))),i={levelId:n.position.structureId,ordinalId:`ordinal: ${n.position.ordinal}`,coordinates:r,shouldDrawSegment:s},p=[];if(o.WALKING_TO_PORTAL===t.segmentCategory){const t=y[a+1];p.push({canonicalName:`wayfinding.${t.segmentCategory}`,coordinates:e.last(r)})}else o.START!==t.segmentCategory&&p.push({canonicalName:`wayfinding.${t.segmentCategory}`,coordinates:e.last(r)});return i.badges=p,i.segmentType=(e=>"Train"===e.type?"nav.train":"Bus"===e.type?"nav.transit":"Security Checkpoint"===e.type?"nav.secure":"nav.primary")(t),t.poiId&&(i.poiId=t.poiId),i})),steps:a(y,e.prop("title",s),e.prop("title",i),p,l,g)}};export{s as buildSegments};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a={START:"start",WALKING_TO_SECURITY_CHECKPOINT:"walking to security checkpoint",WALKING_TO_PORTAL:"walking to portal",WALKING_TO_END:"walking to end",ELEVATOR:"elevator",ELEVATOR_UP:"elevator.up",ELEVATOR_DOWN:"elevator.down",STAIRS:"stairs",STAIRS_UP:"stairs.up",STAIRS_DOWN:"stairs.down",ESCALATOR:"escalator",ESCALATOR_UP:"escalator.up",ESCALATOR_DOWN:"escalator.down",WALK:"walk",WALK_DOWN:"walk.down",WALK_UP:"walk.up",TRAIN:"train",TRAIN_UP:"train.up",TRAIN_DOWN:"train.down",BUS:"bus",BUS_UP:"bus.up",BUS_DOWN:"bus.down",SECURITY_CHECKPOINT:"enduring security checkpoint",RAMP:"ramp",RAMP_UP:"ramp.up",RAMP_DOWN:"ramp.down"};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compose as e,not as t,includes as r,__ as a,toLower as n,prop as s,find as c,drop as u,last as
|
|
1
|
+
import{compose as e,not as t,includes as r,__ as a,toLower as n,prop as s,find as c,drop as u,last as i,propEq as T}from"ramda";import{findBoundsOfWaypoints as o}from"../../../src/utils/bounds.js";import A from"./segmentBadges.js";import _ from"./segmentCategories.js";function R(e,t="",r="",a,n,c={}){return e.map(((u,T)=>{const R=N("securityWaitTimes")(u.waypoints),L=R&&!R.isTemporarilyClosed?R.queueTime:Math.round(1===(W=u.waypoints).length?W[0].eta:W.map(s("eta")).slice(1).reduce(((e,t)=>e+t),0));var W;const y=Math.round(function(e){return 1===e.length?e[0].distance:e.map((e=>e.distance)).slice(1).reduce(((e,t)=>e+t),0)}(u.waypoints)),I=function(e){switch(e){case _.START:return A.START;case _.WALKING_TO_END:return A.END;case _.ELEVATOR:return A.ELEVATOR;case _.ELEVATOR_UP:return A.ELEVATOR_UP;case _.ELEVATOR_DOWN:return A.ELEVATOR_DOWN;case _.STAIRS:return A.STAIRS;case _.STAIRS_UP:return A.STAIRS_UP;case _.STAIRS_DOWN:return A.STAIRS_DOWN;case _.ESCALATOR:return A.ESCALATOR;case _.ESCALATOR_UP:return A.ESCALATOR_UP;case _.ESCALATOR_DOWN:return A.ESCALATOR_DOWN;case _.WALKING_TO_PORTAL:case _.WALK:case _.WALK_DOWN:case _.WALK_UP:return A.WALK;case _.TRAIN:return A.TRAIN;case _.TRAIN_UP:return A.TRAIN_UP;case _.TRAIN_DOWN:return A.TRAIN_DOWN;case _.BUS:return A.BUS;case _.BUS_UP:return A.BUS_UP;case _.BUS_DOWN:return A.BUS_DOWN;case _.SECURITY_CHECKPOINT:return A.SECURITY_CHECKPOINT;case _.RAMP:return A.RAMP;case _.RAMP_UP:return A.RAMP_UP;case _.RAMP_DOWN:return A.RAMP_DOWN;default:return A.WALK}}(u.segmentCategory),m=function(e,t){let r;switch(e){case _.START:r=0;break;case _.WALKING_TO_END:r=t.length-1;break;case _.WALKING_TO_PORTAL:r=Math.min(t.length-1,Math.ceil(t.length/2));break;default:r=t.length-1}return t[r].position}(u.segmentCategory,u.waypoints),p=function(e,t,r,a,n,s){const c=e[t];switch(c.segmentCategory){case _.START:return O(c.waypoints[0].position,r);case _.WALKING_TO_END:return O(c.waypoints[c.waypoints.length-1].position,a);case _.WALKING_TO_SECURITY_CHECKPOINT:case _.WALKING_TO_PORTAL:return s(`wayfinder:${e[t+1].type}`);case _.SECURITY_CHECKPOINT:case _.ELEVATOR:case _.ELEVATOR_DOWN:case _.ELEVATOR_UP:case _.ESCALATOR:case _.ESCALATOR_DOWN:case _.ESCALATOR_UP:case _.STAIRS:case _.STAIRS_DOWN:case _.STAIRS_UP:return function(e,t){return t[i(e.waypoints).position.floorId]}(c,n);default:return s(`wayfinder:${c.type}`)}}(e,T,t,r,a,n),P=function(e,t,r,a){const n=S(t,a);switch(e.segmentCategory){case _.START:return a("wayfinder:Begin route at");case _.ELEVATOR:return a("wayfinder:Take elevator to");case _.ELEVATOR_UP:return a("wayfinder:Take elevator up to");case _.ELEVATOR_DOWN:return a("wayfinder:Take elevator down to");case _.STAIRS:return a("wayfinder:Take stairs to");case _.STAIRS_UP:return a("wayfinder:Take stairs up to");case _.STAIRS_DOWN:return a("wayfinder:Take stairs down to");case _.ESCALATOR:return a("wayfinder:Take escalator to");case _.ESCALATOR_UP:return a("wayfinder:Take escalator up to");case _.ESCALATOR_DOWN:return a("wayfinder:Take escalator down to");case _.WALK:case _.WALKING_TO_SECURITY_CHECKPOINT:case _.WALKING_TO_PORTAL:case _.WALKING_TO_END:return n("Walk <1 minute to","Walk xx minute to");case _.WALK_DOWN:return n("Walk <1 minute down to","Walk xx minute down to");case _.WALK_UP:return n("Walk <1 minute up to","Walk xx minute up to");case _.TRAIN:return n("Take train <1 minute","Take train xx minute");case _.BUS:return n("Take bus <1 minute","Take bus xx minute");case _.SECURITY_CHECKPOINT:return r?a("wayfinder:Through _security_ to",{name:r}):a("wayfinder:Through security to");case _.RAMP:return a("wayfinder:Take ramp to");case _.RAMP_UP:return a("wayfinder:Take ramp up to");case _.RAMP_DOWN:return a("wayfinder:Take ramp down to");default:return""}}(u,L,d(c,u.waypoints),n),w={primaryText:p,secondaryText:P,icon:I,animationAnchor:m,eta:L,distance:y,bounds:o(u.waypoints),isAccessible:E(u),securityWaitTimes:R};return u.poiId&&(w.poiId=u.poiId),w}))}function O(e,t){return e.name?e.name:t}const S=(e,t)=>(r,a)=>0===e?t("wayfinder:"+r):t("wayfinder:"+a,{count:e}),E=e(t,r(a,["escalator","stairs"]),n,s("type")),d=(e,t)=>{const r=N("securityLane")(t);if(!r)return;const a=s(r.type,e),n=c(T("id",r.id),a);return s("displayText",n)},N=t=>e(s(t),c(s(t)),u(1));export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"ramda";import n from"zousan";import{buildStructuresLookup as o}from"../../../src/utils/buildStructureLookup.js";import{distance as e}from"../../../src/utils/geodesy.js";import{findRoute as i}from"./findRoute.js";import{createNavGraph as r}from"./navGraph.js";import{enrichDebugNavGraph as a}from"./navGraphDebug.js";import{buildSegments as s}from"./segmentBuilder.js";const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function d(d,p){const l=d.log.sublog("wayfinder"),c=async()=>{d.bus.send("venueData/loadNavGraph")};let f=new n;d.bus.on("wayfinder/_getNavGraph",(()=>f)),d.bus.on("venueData/navGraphLoaded",(async({navGraphData:t,structures:n})=>{const e=o(n),i=await y(),a=r(t,e.floorIdToOrdinal,e.floorIdToStructureId,i);f.resolve(a)}));const y=async()=>{const n=await d.bus.get("poi/getByCategoryId",{categoryId:"security"});return t.pipe(t.map(m),t.filter(t.identity))(n)},m=n=>n.queue&&{type:t.path(["queue","queueType"],n),id:t.path(["queue","queueSubtype"],n)};d.bus.on("wayfinder/showNavLineFromPhysicalLocation",(async({toEndpoint:t,selectedSecurityLanes:n=null,requiresAccessibility:o})=>async function(t,n,o){const e=await b({fromEndpoint:t,toEndpoint:n,options:o});if(e){const{segments:t}=e;o.primary&&d.bus.send("map/resetNavlineFeatures"),d.bus.send("map/showNavlineFeatures",{segments:t,alternative:!o.primary})}return e}(await d.bus.get("user/getPhysicalLocation"),t,{selectedSecurityLanes:n,requiresAccessibility:o,primary:!0})));const g=(t,n)=>d.bus.get("poi/getById",{id:t}).then((o=>{if(o&&o.position)return w(o,n);throw Error("Unknown POI ID "+t)}));const I=["lat","lng","floorId","ordinal"],h=t.pipe(t.pick(I),t.keys,t.propEq("length",I.length),Boolean),w=(t,n)=>({lat:t.position.latitude,lng:t.position.longitude,floorId:t.position.floorId,ordinal:n(t.position.floorId),title:t.name});async function b({fromEndpoint:t,toEndpoint:n,options:o={}}){return f.then((async e=>{o.compareFindPaths=p.compareFindPaths;const r=i(e,t,n,o);if(!r)return null;v(t,n,r);const a=await d.bus.get("venueData/getFloorIdToNameMap"),u=await d.bus.get("venueData/getQueueTypes"),c=d.gt(),{steps:f,segments:y}=s(r.waypoints,t,n,a,c,u);l.info("route",r);const m=Math.round(r.waypoints.reduce(((t,{eta:n})=>t+n),0)),g=Math.round(r.waypoints.reduce(((t,{distance:n})=>t+n),0));return{...r,segments:y,steps:f,time:m,distance:g}}))}d.bus.on("wayfinder/getNavigationEndpoint",(({ep:t})=>async function(t){return f.then((n=>{if(!t)throw Error("wayfinder: Invalid endpoint definition",t);if("number"==typeof t)return g(t,n.floorIdToOrdinal);if("string"==typeof t){if(t.match(/^\d+$/))return g(parseInt(t),n.floorIdToOrdinal);if(t.indexOf(",")>0){let[o,e,i,r]=t.split(",");if(!n.floorIdToStructureId(i))throw Error("Unknown floorId in endpoint: "+i);return r||(r="Starting Point"),{lat:parseFloat(o),lng:parseFloat(e),ordinal:n.floorIdToOrdinal(i),floorId:i,title:r}}}if(h(t))return t;if(t.latitude)return{lat:t.latitude,lng:t.longitude,floorId:t.floorId,ordinal:n.floorIdToOrdinal(t.floorId),title:t.title};if(t.position&&t.name)return w(t,n.floorIdToOrdinal);throw Error("Invalid start or end point: "+t)}))}(t))),d.bus.on("wayfinder/checkIfPathHasSecurity",(({fromEndpoint:n,toEndpoint:o,options:e={}})=>f.then((r=>{e.compareFindPaths=p.compareFindPaths;const a=i(r,n,o,e);if(!a)return{routeExists:!1};const s=n=>Boolean(a.waypoints.find(t.pathEq(["securityLane","type"],n)));return{routeExists:!0,queues:a.waypoints.filter((n=>t.pathEq(["securityLane","type"],u.SECURITY,n)||t.pathEq(["securityLane","type"],u.IMMIGRATION,n))),hasSecurity:s(u.SECURITY),hasImmigration:s(u.IMMIGRATION)}})))),d.bus.on("wayfinder/getRoute",b);const v=(t,n,o)=>d.bus.send("session/submitEvent",{type:"navigation",startPosition:{venueId:t.floorId.split("-")[0],buildingId:o.waypoints[0].position.structureId,floorId:o.waypoints[0].position.floorId,lat:o.waypoints[0].position.lat,lng:o.waypoints[0].position.lng},endPosition:{venueId:n.floorId.split("-")[0],buildingId:o.waypoints[o.waypoints.length-1].position.structureId,floorId:o.waypoints[o.waypoints.length-1].position.floorId,lat:o.waypoints[o.waypoints.length-1].position.lat,lng:o.waypoints[o.waypoints.length-1].position.lng}});function T(t){return S(t,"transitTime")}function E(t){return S(t,"distance")}function S(n,o){return t.aperture(2,n).map((([n,o])=>{return(e=o.id,n=>t.find((t=>t.dst===e),n.edges))(n);var e})).map(t.prop(o)).reduce(((t,n)=>t+n),0)}function L(t,n){return t.distance=e(n.lat,n.lng,t.position.latitude,t.position.longitude),t}return d.bus.on("wayfinder/addPathTimeSingle",(async({poi:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){const i=w(o,t.floorIdToOrdinal),r=t.findShortestPath(e,i,n);if(!r)return(o=L(o,e)).transitTime=o.distance/60,o;return Object.assign(o,{transitTime:T(r),distance:E(r)})}(e,o,t,n))):t)),d.bus.on("wayfinder/addPathTimeMultiple",(async({pois:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){const i=o.map((n=>w(n,t.floorIdToOrdinal))),r=t.findAllShortestPaths(e,i,n);return o.map(((t,n)=>function(t,n,o){n&&n.length?t=Object.assign(t,{transitTime:T(n),distance:E(n)}):(t=L(t,o)).transitTime=t.distance/60;return t}(t,r[n],e)))}(e,o,t,n))):t)),d.bus.on("venueData/loadNewVenue",(()=>{f=new n,c()})),d.bus.on("poi/setDynamicData",(({plugin:t,idValuesMap:n})=>{"security"===t&&f.then((t=>t.updateWithSecurityWaitTime(n)))})),d.bus.on("wayfinder/getNavGraphFeatures",(()=>f.then((({_nodes:t})=>a(t))))),{init:c,internal:{resolveNavGraph:t=>f.resolve(t),prepareSecurityLanes:y}}}export{u as SecurityLaneType,d as create};
|
|
1
|
+
import*as t from"ramda";import n from"zousan";import{buildStructuresLookup as o}from"../../../src/utils/buildStructureLookup.js";import{distance as e}from"../../../src/utils/geodesy.js";import{findRoute as i}from"./findRoute.js";import{createNavGraph as r}from"./navGraph.js";import{enrichDebugNavGraph as a}from"./navGraphDebug.js";import{buildSegments as s}from"./segmentBuilder.js";const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function d(d,p){const l=d.log.sublog("wayfinder"),c=async()=>{d.bus.send("venueData/loadNavGraph")};let f=new n;d.bus.on("wayfinder/_getNavGraph",(()=>f)),d.bus.on("venueData/navGraphLoaded",(async({navGraphData:t,structures:n})=>{const e=o(n),i=await y(),a=r(t,e.floorIdToOrdinal,e.floorIdToStructureId,i);f.resolve(a)}));const y=async()=>{const n=await d.bus.get("poi/getByCategoryId",{categoryId:"security"});return t.pipe(t.map(m),t.filter(t.identity))(n)},m=n=>n.queue&&{type:t.path(["queue","queueType"],n),id:t.path(["queue","queueSubtype"],n)};d.bus.on("wayfinder/showNavLineFromPhysicalLocation",(async({toEndpoint:t,selectedSecurityLanes:n=null,requiresAccessibility:o})=>async function(t,n,o){const e=await b({fromEndpoint:t,toEndpoint:n,options:o});if(e){const{segments:t}=e;o.primary&&d.bus.send("map/resetNavlineFeatures"),d.bus.send("map/showNavlineFeatures",{segments:t,alternative:!o.primary})}return e}(await d.bus.get("user/getPhysicalLocation"),t,{selectedSecurityLanes:n,requiresAccessibility:o,primary:!0})));const g=(t,n)=>d.bus.get("poi/getById",{id:t}).then((o=>{if(o&&o.position)return w(o,n);throw Error("Unknown POI ID "+t)}));const I=["lat","lng","floorId","ordinal"],h=t.pipe(t.pick(I),t.keys,t.propEq("length",I.length),Boolean),w=(t,n)=>({lat:t.position.latitude,lng:t.position.longitude,floorId:t.position.floorId,ordinal:n(t.position.floorId),title:t.name});async function b({fromEndpoint:t,toEndpoint:n,options:o={}}){return f.then((async e=>{o.compareFindPaths=p.compareFindPaths;const r=i(e,t,n,o);if(!r)return null;v(t,n,r);const a=await d.bus.get("venueData/getFloorIdToNameMap"),u=await d.bus.get("venueData/getQueueTypes"),c=d.gt(),{steps:f,segments:y}=s(r.waypoints,t,n,a,c,u);l.info("route",r);const m=Math.round(r.waypoints.reduce(((t,{eta:n})=>t+n),0)),g=Math.round(r.waypoints.reduce(((t,{distance:n})=>t+n),0));return{...r,segments:y,steps:f,time:m,distance:g}}))}d.bus.on("wayfinder/getNavigationEndpoint",(({ep:t})=>async function(t){return f.then((n=>{if(!t)throw Error("wayfinder: Invalid endpoint definition",t);if("number"==typeof t)return g(t,n.floorIdToOrdinal);if("string"==typeof t){if(t.match(/^\d+$/))return g(parseInt(t),n.floorIdToOrdinal);if(t.indexOf(",")>0){let[o,e,i,r]=t.split(",");if(!n.floorIdToStructureId(i))throw Error("Unknown floorId in endpoint: "+i);return r||(r="Starting Point"),{lat:parseFloat(o),lng:parseFloat(e),ordinal:n.floorIdToOrdinal(i),floorId:i,title:r}}}if(h(t))return t;if(t.latitude)return{lat:t.latitude,lng:t.longitude,floorId:t.floorId,ordinal:n.floorIdToOrdinal(t.floorId),title:t.title};if(t.position&&t.name)return w(t,n.floorIdToOrdinal);throw Error("Invalid start or end point: "+t)}))}(t))),d.bus.on("wayfinder/checkIfPathHasSecurity",(({fromEndpoint:n,toEndpoint:o,options:e={}})=>f.then((r=>{e.compareFindPaths=p.compareFindPaths;const a=i(r,n,o,e);if(!a)return{routeExists:!1};const s=n=>Boolean(a.waypoints.find(t.pathEq(["securityLane","type"],n)));return{routeExists:!0,queues:a.waypoints.filter((n=>t.pathEq(["securityLane","type"],u.SECURITY,n)||t.pathEq(["securityLane","type"],u.IMMIGRATION,n))),hasSecurity:s(u.SECURITY),hasImmigration:s(u.IMMIGRATION)}})))),d.bus.on("wayfinder/getRoute",b);const v=(t,n,o)=>d.bus.send("session/submitEvent",{type:"navigation",startPosition:{venueId:t.floorId.split("-")[0],buildingId:o.waypoints[0].position.structureId,floorId:o.waypoints[0].position.floorId,lat:o.waypoints[0].position.lat,lng:o.waypoints[0].position.lng},endPosition:{venueId:n.floorId.split("-")[0],buildingId:o.waypoints[o.waypoints.length-1].position.structureId,floorId:o.waypoints[o.waypoints.length-1].position.floorId,lat:o.waypoints[o.waypoints.length-1].position.lat,lng:o.waypoints[o.waypoints.length-1].position.lng}});function T(t){return S(t,"transitTime")}function E(t){return S(t,"distance")}function S(n,o){return t.aperture(2,n).map((([n,o])=>{return(e=o.id,n=>t.find((t=>t.dst===e),n.edges))(n);var e})).map(t.prop(o)).reduce(((t,n)=>t+n),0)}function L(t,n){return t.distance=e(n.lat,n.lng,t.position.latitude,t.position.longitude),t}return d.bus.on("wayfinder/addPathTimeSingle",(async({poi:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){const i=w(o,t.floorIdToOrdinal),r=t.findShortestPath(e,i,n);if(!r)return(o=L(o,e)).transitTime=o.distance/60,o;return Object.assign(o,{transitTime:T(r),distance:E(r)})}(e,o,t,n))):t)),d.bus.on("wayfinder/addPathTimeMultiple",(async({pois:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){try{const i=o.map((n=>w(n,t.floorIdToOrdinal))),r=t.findAllShortestPaths(e,i,n);return o.map(((t,n)=>function(t,n,o){n&&n.length?t=Object.assign(t,{transitTime:T(n),distance:E(n)}):(t=L(t,o)).transitTime=t.distance/60;return t}(t,r[n],e)))}catch(t){return l.error(t),o}}(e,o,t,n))):t)),d.bus.on("venueData/loadNewVenue",(()=>{f=new n,c()})),d.bus.on("poi/setDynamicData",(({plugin:t,idValuesMap:n})=>{"security"===t&&f.then((t=>t.updateWithSecurityWaitTime(n)))})),d.bus.on("wayfinder/getNavGraphFeatures",(()=>f.then((({_nodes:t})=>a(t))))),{init:c,internal:{resolveNavGraph:t=>f.resolve(t),prepareSecurityLanes:y}}}export{u as SecurityLaneType,d as create};
|
package/lib/src/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"IObject";import t from"query-string";import{map as n,mergeDeepRight as o}from"ramda";import i from"zousan-plus";import r from"../package.json.js";import a from"./debugTools.js";import{buildEnv as s}from"./env.js";import{create as l}from"./extModules/bustle.js";import{initLog as u}from"./extModules/log.js";import
|
|
1
|
+
import e from"IObject";import t from"query-string";import{map as n,mergeDeepRight as o}from"ramda";import i from"zousan-plus";import r from"../package.json.js";import a from"./debugTools.js";import{buildEnv as s}from"./env.js";import{create as l}from"./extModules/bustle.js";import{initLog as u}from"./extModules/log.js";import c from"./utils/i18n.js";const g="undefined"!=typeof window;async function p(e,t,n){let o=t;if(o.includes("/")){const e=o.split("/");o=e[e.length-1]}return void 0!==n.active&&!1===n.active?(e.log.info(`Plugin ${t} explicitly deativated`),null):import(`../plugins/${t}/src/${o}.js`).then((o=>(e.log.info(`Creating plugin ${t}`),o.create(e,n))))}async function d(e){return g?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function m(e,t){let n={};const i=await Promise.all(t.map(d));for(const e of i){let t=e.default;t=t.extends?await m(t,t.extends):t,n=o(n,t)}return n=o(n,e),n}const f=e=>t=>import(`./configs/postproc-${e}.js`).then((e=>e.process(t)));async function w(o){const d=Object.create(null);let w=o.extends?await m(o,o.extends):o;w.plugins.monitoring&&import("../_virtual/_empty_module_placeholder.js").then((e=>e.activate(w))),w=await(async e=>e.configPostProc?i.series(e,...e.configPostProc.map(f)):e)(w);const y=(e=>{const n=e.supportedLanguages||["ar","en","es","fr","ja","ko","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=t.parse(location.search).lang||navigator.language;for(;e;){if(e&&n.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(w),h=await c(y,w.debug);d.i18n=()=>h,d.gt=()=>h.t.bind(h),d.config=w,d.plugins=new e;const j=u("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g});if(d.log=j.sublog(w.name),d.bus=l({trace:!1,showEvents:!0,reportAllErrors:!0,log:j}),d.info={wePkg:r},"undefined"!=typeof window&&(w.debug?(d.debug=n((e=>e.bind(d)),a),a.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),d.env=s(d),w.theme?await i.evaluate({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:e,HistoryManager:t,ThemeManagerModule:n})=>{const o=n.initThemeManager(d);d.themePack=await o.buildTheme(w.theme,w.defaultTheme),e.initLayerManager(d),t.initHistoryManager(d),d.destroy=()=>e.destroy(d)})):d.destroy=()=>{},w.plugins){for(const e in w.plugins)try{const t=w.plugins[e];if(d.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const n=await p(d,e,t);n&&(d.plugins=d.plugins.set(e,n))}catch(t){j.error("Error instantiating plugin "+e),j.error(t)}for(const e in d.plugins)d.plugins[e].init()}return d}export{w as create};
|
package/lib/src/auth/Auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
async function t(t,e){const o=await(async()=>{if(!t||!t.type)throw Error("No authentication type found in config");return Promise.resolve((t=>{switch(t.type){case"ms":return"MSAuth";case"cognito":return"CognitoAuth";case"google":return"GoogleAuth";default:throw Error(`Unknown auth type: '${t.type}'`)}})(t)).then((t=>import(`./${t}`))).then((o=>o.default(t.config,e)))})();return{getToken:async()=>o.getToken(),isLoggedIn:async()=>o.isLoggedIn(),federatedLogin:async()=>o.federatedLogin(),logout:()=>o.logout(),getAccountInfo:()=>o.getAccountInfo(),getType:()=>t.type}}export default
|
|
1
|
+
async function t(t,e){const o=await(async()=>{if(!t||!t.type)throw Error("No authentication type found in config");return Promise.resolve((t=>{switch(t.type){case"ms":return"MSAuth";case"cognito":return"CognitoAuth";case"google":return"GoogleAuth";default:throw Error(`Unknown auth type: '${t.type}'`)}})(t)).then((t=>import(`./${t}`))).then((o=>o.default(t.config,e)))})();return{getToken:async()=>o.getToken(),isLoggedIn:async()=>o.isLoggedIn(),federatedLogin:async()=>o.federatedLogin(),logout:()=>o.logout(),getAccountInfo:()=>o.getAccountInfo(),getType:()=>t.type}}export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="SDK headless",e={
|
|
1
|
+
var a="SDK headless",e={analytics2:{productName:"LocusMaps JS SDK",active:!1,disableSending:!1},clientAPI:{},dynamicPois:{},poiDataManager:{},sdkServer:{},searchService:{},venueDataLoader:{assetStage:"prod",formatVersion:"v5",availableLanguages:[{langCode:"en",assetSuffix:""}]},wayfinder:{compareFindPaths:!1}},s={name:"SDK headless",plugins:e};export{s as default,a as name,e as plugins};
|
package/lib/src/debugTools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import{orphanTest as n}from"../plugins/wayfinder/src/navGraphDebug.js";import{$ as
|
|
1
|
+
import*as e from"ramda";import{orphanTest as n}from"../plugins/wayfinder/src/navGraphDebug.js";import{$ as s,$$ as t,ad as o}from"./utils/dom.js";import{singleFile as a}from"./utils/funcs.js";"undefined"!=typeof window&&(window.R=e);const r=(e,n)=>{const s=n.monitor("homeview/performSearch",(({term:t})=>{t||(n.send(e),s())}))};var i={showIcons:()=>{s("#mapRenderDiv").innerHTML="<style> div { display: inline-block; text-align: center; border: 1px solid lightblue; }</style>"+t("svg symbol").map((e=>`<div><svg><use xlink:href="#${e.id}"/></svg><br/>${e.id}</div>`)).join("")},poisByCategory:function(){return this.bus.send("poi/getAll").then((e=>e[0])).then((e=>Object.values(e))).then(e.groupBy((e=>e.category)))},highlightNodes:()=>o({tag:"style",html:"* { background-color: rgba(255,0,0,.2); } * * { background-color: rgba(0,255,0,.2); } * * * { background-color: rgba(0,0,255,.2); } * * * * { background-color: rgba(255,0,255,.2); } * * * * * { background-color: rgba(0,255,255,.2); } * * * * * * { background-color: rgba(255,255,0,.2); } * * * * * * * { background-color: rgba(255,0,0,.2); } * * * * * * * * { background-color: rgba(0,255,0,.2); } * * * * * * * * * { background-color: rgba(0,0,255,.2); }"},s("head")),getPoiById:function(e){return this.bus.send("poi/getById",{id:e}).then((e=>e[0]))},orphanTest:n,showOrphaned:async function(){const e=await this.bus.get("wayfinder/_getNavGraph"),s=n(e._nodes);this.bus.send("map/showOrphanedGraphNodes",{orphanedNodes:s.orphaned})},showgraph:async function(){const e=await this.bus.get("wayfinder/getNavGraphFeatures");this.bus.send("map/showNavGraphFeatures",{navGraph:e}),r("map/resetNavGraphFeatures",this.bus)},dndGo:function(){const e=this.bus,n=(e,n)=>{e.preventDefault(),n?e.target.classList.add("dragover"):e.target.classList.remove("dragover")},s={drop:async function(s){n(s,!1);for(const n of s.dataTransfer.files){const s=n.name;if("application/json"===n.type||n.type.startsWith("text/")){const t=new FileReader;t.onload=a((async t=>e.send("debugTools/fileDrop",{file:n,filename:s,content:t.target.result}))),t.readAsText(n)}}},dragover:function(e){n(e,!0)},dragleave:function(e){n(e,!1)}};Object.keys(s).forEach((function(e){document.body.addEventListener(e,s[e])})),console.log("DnD Listeners installed")},bounds:async function(){const e=await this.bus.get("venueData/getVenueCenter"),{venueRadius:n,bounds:s}=await this.bus.get("venueData/getVenueData");this.bus.send("map/showVenueBounds",{venueCenter:e,venueRadius:n,bounds:s}),r("map/resetVenueBounds",this.bus)},buildingBounds:async function(e){this.bus.send("map/showBuildingBounds",{nameFilter:e}),r("map/resetVenueBounds",this.bus)},padding:async function(){this.bus.send("map/togglePadding"),r("map/togglePadding",this.bus)}};export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"zousan";const n=(o,n)=>o.splice(n,1)[0],t=(o,t)=>{let r=0;do{r=o.indexOf(t,r),r>=0&&n(o,r)}while(r>=0);return o};function r(n
|
|
1
|
+
import o from"zousan";const n=(o,n)=>o.splice(n,1)[0],t=(o,t)=>{let r=0;do{r=o.indexOf(t,r),r>=0&&n(o,r)}while(r>=0);return o};function r(n){const r=n.log?n.log.sublog?n.log.sublog("bustle",{color:"pink"}):n.log:console,e={},s={};function c(o,n){e[o]&&t(e[o],n)}function u(o,n){s[o]&&t(s[o],n)}function l(t,c){return n.trace&&(c||(c={}),c._stack=Error().stack),n.showEvents&&("function"==typeof n.showEvents?n.showEvents(t,c)&&r.info("send with",t," and ",c):r.info("send with",t," and ",c)),new o((u=>o.soon(((t,c,u)=>()=>{const l=e[t],f=s[t],i=[];if(l)for(const t of l)try{i.push(t(c))}catch(t){n.reportAllErrors&&r.error(t),n.rejectOnError&&i.push(o.reject(t)),i.push(t)}const h=o.all(i);if(f)for(const o of f)try{o(c,h)}catch(o){n.reportAllErrors&&r.error(o)}u(h)})(t,c,u))))}return{get:(n,t)=>l(n,t).then((t=>1!==t.length?o.reject(`${n} event did not return a single result, but ${t.length} results.`):t[0])),moff:u,monitor:function(o,n){return s[o]||(s[o]=[]),s[o].push(n),()=>u(o,n)},off:c,on:function(o,n){return e[o]||(e[o]=[]),e[o].push(n),()=>c(o,n)},send:l}}export{r as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from"zousan";import{getHelpList as o,getHelpHeader as r,getHelp as m}from"./help.js";import{getSigMatch as e,validate as t}from"./validate.js";const i=/^[-_.0-9a-zA-Z]+$/,s=JSON.stringify;function a(){const a=[],c=()=>a.map((n=>n.sig)),d={},f={customTypes:d,commandDefsList:a};function u(n,o){const r=n.command;if(void 0===r)throw Error(`Invalid command specification in registerCommand: ${s(n)}. No 'command' property specified.`);if(!i.test(r)){throw Error(`Invalid command specification in registerCommand: ${s(n)}. Command name '${r}' not valid.`)}return a.push({sig:n,fn:o}),p}function p(i){return new n(((n,a)=>{if(!i)return a(new Error(`No command specified in command object ${s(i)}`));const c=f.commandDefsList.filter((n=>n.sig.command===i.command));if(0===c.length)return a(new Error(`No API command '${i.command}' found.\n${o(f.commandDefsList.map((n=>n.sig)))}`));const d=e(f,i);if(!d)return 1===c.length?a(new Error(`Required fields not present in ${s(i)}\n${r()}${m(c[0].sig)}`)):a(new Error(`Command arguments did not match any required signatures: ${s(i)}\n${o(f.commandDefsList.map((n=>n.sig)))}`));try{t(f,d.sig,i)}catch(n){return a(n)}n(d.fn(i))}))}return u({command:"help",args:[]},(()=>o(c()))),u({command:"getCommandJSON",args:[]},(()=>({commands:c(),customTypes:d}))),{registerCommand:u,registerCustomType:function(n,o){d[n]=o},execute:p}}export default
|
|
1
|
+
import n from"zousan";import{getHelpList as o,getHelpHeader as r,getHelp as m}from"./help.js";import{getSigMatch as e,validate as t}from"./validate.js";const i=/^[-_.0-9a-zA-Z]+$/,s=JSON.stringify;function a(){const a=[],c=()=>a.map((n=>n.sig)),d={},f={customTypes:d,commandDefsList:a};function u(n,o){const r=n.command;if(void 0===r)throw Error(`Invalid command specification in registerCommand: ${s(n)}. No 'command' property specified.`);if(!i.test(r)){throw Error(`Invalid command specification in registerCommand: ${s(n)}. Command name '${r}' not valid.`)}return a.push({sig:n,fn:o}),p}function p(i){return new n(((n,a)=>{if(!i)return a(new Error(`No command specified in command object ${s(i)}`));const c=f.commandDefsList.filter((n=>n.sig.command===i.command));if(0===c.length)return a(new Error(`No API command '${i.command}' found.\n${o(f.commandDefsList.map((n=>n.sig)))}`));const d=e(f,i);if(!d)return 1===c.length?a(new Error(`Required fields not present in ${s(i)}\n${r()}${m(c[0].sig)}`)):a(new Error(`Command arguments did not match any required signatures: ${s(i)}\n${o(f.commandDefsList.map((n=>n.sig)))}`));try{t(f,d.sig,i)}catch(n){return a(n)}n(d.fn(i))}))}return u({command:"help",args:[]},(()=>o(c()))),u({command:"getCommandJSON",args:[]},(()=>({commands:c(),customTypes:d}))),{registerCommand:u,registerCustomType:function(n,o){d[n]=o},execute:p}}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(e,
|
|
1
|
+
function n(t,e,o,r){let u=e;o&&(u+="-"+o);const i=t[u];return i||(o?o.indexOf("-")>0?n(t,e,o.substring(0,o.indexOf("-")),r):n(t,e,null,r):r)}function t(n,t){if(!n.config.debug)return!1;let e=n.config.debug[t];return null!=e&&!1!==e&&(!0===e||(e=e.toLowerCase?e.toLowerCase():e,"no"!==e&&"false"!==e))}let e;try{e=Function("return this")()}catch(n){e=window}export{t as debugIsTrue,n as getLocalized,e as global};
|
package/lib/src/utils/geom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as n from"ramda";const e=(n,e)=>{const t=n[0],
|
|
1
|
+
import*as n from"ramda";const e=(n,e)=>{const t=n[0],r=n[1];let l=!1;for(let n=0,o=e.length-1;n<e.length;o=n++){const u=e[n][0],s=e[n][1],c=e[o][0],i=e[o][1];s>r!=i>r&&t<(c-u)*(r-s)/(i-s)+u&&(l=!l)}return l};function t(t,l,u,s){if(!n.length(t))return null;t=t.filter((n=>null==n.shouldDisplay||!0===n.shouldDisplay));const c=n.curry(e)([l,u]),i=t.filter(n.compose(c,r));if(0===i.length)return null;if(1===i.length&&!s)return n.head(i);const d=i.filter(n.compose(c,n.prop("boundsPolygon")));return 1===d.length?n.head(d):d.length?o(i):s?null:o(i)}const r=n=>{const{n:e,s:t,e:r,w:l}=n.bounds;return[[e,r],[e,l],[t,l],[t,r]]},l=n=>{if(!n.bounds)return 0;const{n:e,s:t,e:r,w:l}=n.bounds;return Math.abs((e-t)*(r-l))},o=n=>{return n.reduce((e=l,(n,t)=>e(n)<e(t)?n:t));var e},u=(n,e)=>Object.values(n.levels).reduce(((n,t)=>t.ordinal===e?t:n),void 0),s=(n,e)=>n.reduce(((n,t)=>Object.values(t.levels).reduce(((n,t)=>t.id===e?t:n),null)||n),void 0);function c(n,e,r,l,o){const s=t(n,e,r,o);return{building:s,floor:s?u(s,l):null}}const i=(n,e,t,r,l)=>c(n,e,t,r,l).floor;function d(n,e,t,r,l,o,u,s){let c=0,i=0,d=0,f=0,a=0;const h=[{x:n,y:e}];for(let g=1,p=0;g<=20;++g)p=g/20,c=1-p,i=c*c,d=i*c,f=p*p,a=f*p,h.push({x:d*n+3*i*p*t+3*c*f*l+a*u,y:d*e+3*i*p*r+3*c*f*o+a*s});return h}export{d as bezierCurveTo,c as getBuildingAndFloorAtPoint,s as getFloor,i as getFloorAt,t as getStructureAtPoint,u as ordToFloor,e as pointInPolygon};
|
package/lib/src/utils/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from"i18next";async function e(e,t){const
|
|
1
|
+
import n from"i18next";async function e(e,t){const a=n.createInstance();return a.init({debug:t,interpolation:{escapeValue:!1},resources:{en:{translation:{"Walk xx minutes to":"Walk {{count}} minute to","Walk xx minutes to_plural":"Walk {{count}} minutes to"}}},fallbackLng:"en",lng:e,postProcess:["pseudoTrans"]}).then((()=>(t&&a.on("missingKey",(function(n,e,t,o){console.error("i18nNext: key not found. Language: "+a.language+", Key: "+t+", namespace: "+e+", lngs: ",n)})),a)))}const t={ar:"بال عن أمام الأخذ البرية. ثم كما وقام شاسعة الجنوبي, أمدها الإمداد عن انه. ٣٠ فكانت والكساد انه. أساسي الشمال الإتفاقية بال أم. زهاء المؤلّفة حين عل, سكان قررت هذه ان, شعار باستخدام ولم مع.\n\nدول الأمور الصفحة الأوروبية قد. تم حدى فاتّبع الهجوم, ما أوسع معاملة فعل, خلاف الأوروبية، إيو كل. تُصب واندونيسيا، حين قد. أي حاول حقول وهولندا، هذا, بين عن لهيمنة بالسيطرة.\n\nأعمال الإتحاد العمليات من وصل. وقوعها، باستخدام قد أخر, بل حتى علاقة التبرعات. فقد لم الأرض استبدال. حتى الخاسر اقتصادية بـ. أصقاع أعلنت اتفاقية تلك بل, كان إذ بحشد أخرى ليبين. الشتاء، اليابان، مكن أم, به، قد العالم، أوراقهم, بل لعدم لغزو أواخر مكن.\n",ja:"私は場合いよいよある所有らってのの末がしたた。無論結果に圧迫顔もよくその発展ないですまでを決するてみるでしでも発展云いませたから、そうには描いたないたた。機会へ載っない方は別に今をひょろひょろでずまし。むしろ嘉納さんを意味方面そう#「を積んない権力この自分何か記念をというおお尋ねだろででですで、ある今はこれか頼み例があるで、ネルソンさんののの引込のあなたにもっともお努力といと私赤に実建設が起っようにとやかくご附随を描いですましから、どうもとにかく相違に云おでてならますのが行っないませ。"},a=(n,e)=>"en"===e?n:o(n,t[e]),o=(n,e)=>n.length<e.length?e.substring(0,n.length):e;export{e as default,a as toLang};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){this._observers.splice(this._observers.indexOf(t),1)}function e(t){const e=s();return this.observe((function(){t.apply(this,arguments)&&e.fire.apply(e,arguments)})),e}function r(t){return e.call(this,(function(e){return t===e}))}const n={detach:t,filter:e,fire:function(){const t=this._observers;if(t){for(let e=0;e<t.length;e++)try{t[e].apply(this,arguments)}catch(t){console.error(t)}return this}},observe:function(e){return this._observers||(this._observers=[]),this._observers.push(e),{detach:t.bind(this,e),ob:this}},on:function(t,e){return r.call(this,t).observe(e)}};function s(t){return t?function(t,e){for(const r in e)t[r]=e[r];return t}(t,n):Object.create(n)}export default
|
|
1
|
+
function t(t){this._observers.splice(this._observers.indexOf(t),1)}function e(t){const e=s();return this.observe((function(){t.apply(this,arguments)&&e.fire.apply(e,arguments)})),e}function r(t){return e.call(this,(function(e){return t===e}))}const n={detach:t,filter:e,fire:function(){const t=this._observers;if(t){for(let e=0;e<t.length;e++)try{t[e].apply(this,arguments)}catch(t){console.error(t)}return this}},observe:function(e){return this._observers||(this._observers=[]),this._observers.push(e),{detach:t.bind(this,e),ob:this}},on:function(t,e){return r.call(this,t).observe(e)}};function s(t){return t?function(t,e){for(const r in e)t[r]=e[r];return t}(t,n):Object.create(n)}export{s as default};
|