From a22fd964da78cd526b6dad133162b46eca7126c8 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Sun, 9 Jul 2023 16:32:46 -0400 Subject: [PATCH 01/42] add attribute to ignore raycaster on env-sky element --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 8339c10ee..473b5fc1f 100644 --- a/src/index.js +++ b/src/index.js @@ -403,6 +403,7 @@ AFRAME.registerComponent('street-environment', { this.sky = document.createElement('a-sky'); const sky = this.sky; sky.setAttribute('id', 'env-sky'); + sky.setAttribute('data-ignore-raycaster', ''); el.appendChild(sky); }, update: function (oldData) { From 8d7f78d9f8d0d8a59040628820f40fa45cd34dac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 22:07:44 +0000 Subject: [PATCH 02/42] Bump word-wrap from 1.2.3 to 1.2.4 Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 309900a9c..231e3a4ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16052,9 +16052,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -28977,9 +28977,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "wordwrapjs": { From d343f5c9b332362f36ad9250380397608e9255ab Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Fri, 21 Jul 2023 23:42:40 -0400 Subject: [PATCH 03/42] furst version of notify component --- index.html | 5 +++++ src/components/notify.js | 47 ++++++++++++++++++++++++++++++++++++++++ src/index.js | 1 + src/lib/notyf.min.js | 16 ++++++++++++++ src/notyf.min.css | 1 + src/viewer-styles.css | 2 ++ 6 files changed, 72 insertions(+) create mode 100644 src/components/notify.js create mode 100644 src/lib/notyf.min.js create mode 100644 src/notyf.min.css diff --git a/index.html b/index.html index af8206b36..18bfc427e 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,9 @@ + + @@ -45,6 +48,7 @@ vr-mode-ui-if-headset renderer="colorManagement: true; physicallyCorrectLights: true;" inspector="url: //3dstreet.app/dist/3dstreet-editor.js" + notify > @@ -176,6 +180,7 @@ } createEntities(streetObject.data, streetContainerEl); + //AFRAME.scenes[0] } function inputJSON() { diff --git a/src/components/notify.js b/src/components/notify.js new file mode 100644 index 000000000..09a83fe34 --- /dev/null +++ b/src/components/notify.js @@ -0,0 +1,47 @@ +/* global AFRAME */ +var { Notyf } = require('../lib/notyf.min.js'); + +AFRAME.registerComponent('notify', { + schema: { + duration: { type: 'number', default: 2000 }, + ripple: { type: 'boolean', default: true }, + position: { + type: 'string', + default: { + // x: left | center | right + // y: top | center | bottom + x: 'right', + y: 'bottom' + } + }, + dismissible: { type: 'boolean', default: false }, + errorMsg: {type: 'string', default: ''}, + successMsg: {type: 'string', default: ''} + }, + init: function () { + this.notify = new Notyf({ + // Set your global Notyf configuration here + duration: this.data.duration, + ripple: this.data.ripple, + position: this.data.position, + dismissible: this.data.dismissible + }); + }, + successMsg: function (messageText) { + if (messageText) this.notify.success(messageText); + }, + errorMsg: function (messageText) { + if (messageText) this.notify.error(messageText); + }, + update: function (oldData) { + const newErrorMsg = this.data.errorMsg; + const newSuccessMsg = this.data.successMsg; + // If `oldData` is empty, then this means we're in the initialization process. + // No need to update. + if (Object.keys(oldData).length === 0) { return; } + this.successMsg(newSuccessMsg); + this.errorMsg(newErrorMsg); + this.data.errorMsg = ''; + this.data.successMsg = ''; + } +}); \ No newline at end of file diff --git a/src/index.js b/src/index.js index 473b5fc1f..349346bf9 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ require('./components/gltf-part'); require('./lib/aframe-cursor-teleport-component.min.js'); require('./lib/animation-mixer.js'); require('./assets.js'); +require('./components/notify.js'); require('./components/create-from-json'); require('./components/screentock.js'); require('aframe-atlas-uvs-component'); diff --git a/src/lib/notyf.min.js b/src/lib/notyf.min.js new file mode 100644 index 000000000..830d65723 --- /dev/null +++ b/src/lib/notyf.min.js @@ -0,0 +1,16 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +var __assign=function(){return __assign=Object.assign||function(t){for(var i,e=1,n=arguments.length;e Date: Thu, 27 Jul 2023 14:23:18 -0400 Subject: [PATCH 04/42] update notify component --- index.html | 3 --- src/components/notify.js | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 18bfc427e..1eeeecd80 100644 --- a/index.html +++ b/index.html @@ -13,9 +13,6 @@ - - diff --git a/src/components/notify.js b/src/components/notify.js index 09a83fe34..4cca5309d 100644 --- a/src/components/notify.js +++ b/src/components/notify.js @@ -10,38 +10,50 @@ AFRAME.registerComponent('notify', { default: { // x: left | center | right // y: top | center | bottom - x: 'right', + x: 'center', y: 'bottom' } }, dismissible: { type: 'boolean', default: false }, - errorMsg: {type: 'string', default: ''}, - successMsg: {type: 'string', default: ''} + type: {type: 'string', default: 'info'}, + message: {type: 'string', default: ''} }, init: function () { this.notify = new Notyf({ + types: [ + { + type: 'info', + background: 'blue', + icon: false + } + ], // Set your global Notyf configuration here duration: this.data.duration, ripple: this.data.ripple, position: this.data.position, dismissible: this.data.dismissible }); + this.types = this.notify.options.types.map(messType => messType.type); }, - successMsg: function (messageText) { - if (messageText) this.notify.success(messageText); - }, - errorMsg: function (messageText) { - if (messageText) this.notify.error(messageText); + message: function (messageText, messageType = 'info') { + if (messageText && this.types.includes(messageType)) { + this.notify.open({ + type: messageType, + message: messageText + }); + } }, update: function (oldData) { - const newErrorMsg = this.data.errorMsg; - const newSuccessMsg = this.data.successMsg; // If `oldData` is empty, then this means we're in the initialization process. // No need to update. if (Object.keys(oldData).length === 0) { return; } - this.successMsg(newSuccessMsg); - this.errorMsg(newErrorMsg); - this.data.errorMsg = ''; - this.data.successMsg = ''; + + const newMessage = this.data.message; + const messageType = this.data.type; + + if (newMessage && this.types.includes(messageType)) { + this.message(newMessage, messageType); + this.data.message = ''; + } } }); \ No newline at end of file From e81f61e42d8bd05909b150c7658f6963b14cdcb6 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 27 Jul 2023 22:15:21 -0400 Subject: [PATCH 05/42] npm run lint fix --- src/components/notify.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/notify.js b/src/components/notify.js index 4cca5309d..d6221f4c2 100644 --- a/src/components/notify.js +++ b/src/components/notify.js @@ -5,18 +5,18 @@ AFRAME.registerComponent('notify', { schema: { duration: { type: 'number', default: 2000 }, ripple: { type: 'boolean', default: true }, - position: { - type: 'string', + position: { + type: 'string', default: { // x: left | center | right // y: top | center | bottom x: 'center', y: 'bottom' - } + } }, dismissible: { type: 'boolean', default: false }, - type: {type: 'string', default: 'info'}, - message: {type: 'string', default: ''} + type: { type: 'string', default: 'info' }, + message: { type: 'string', default: '' } }, init: function () { this.notify = new Notyf({ @@ -27,7 +27,7 @@ AFRAME.registerComponent('notify', { icon: false } ], - // Set your global Notyf configuration here + // Set your global Notyf configuration here duration: this.data.duration, ripple: this.data.ripple, position: this.data.position, @@ -53,7 +53,7 @@ AFRAME.registerComponent('notify', { if (newMessage && this.types.includes(messageType)) { this.message(newMessage, messageType); - this.data.message = ''; + this.data.message = ''; } } -}); \ No newline at end of file +}); From dfcf91aee193062c3913cac6e13ccb04b03e23ce Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 27 Jul 2023 22:50:57 -0400 Subject: [PATCH 06/42] convert comment to success message --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 1eeeecd80..f44981b66 100644 --- a/index.html +++ b/index.html @@ -177,7 +177,7 @@ } createEntities(streetObject.data, streetContainerEl); - //AFRAME.scenes[0] + AFRAME.scenes[0].components['notify'].message('Scene loaded from JSON', 'success') } function inputJSON() { From c286c6ff1d278e55c6a2ce4470d2b12c6cd1d92a Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Sun, 30 Jul 2023 15:33:59 -0400 Subject: [PATCH 07/42] add layers-2d node support to save/load --- index.html | 2 +- src/json-utils.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index af8206b36..af12c1677 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - + diff --git a/src/json-utils.js b/src/json-utils.js index af45e94f4..d42edc4af 100644 --- a/src/json-utils.js +++ b/src/json-utils.js @@ -7,7 +7,8 @@ and returns a Javascript object function convertDOMElToObject (entity) { const data = []; const environmentElement = document.querySelector('#environment'); - const sceneEntities = [entity, environmentElement]; + const layers2DElement = document.querySelector('#layers-2d'); + const sceneEntities = [entity, environmentElement, layers2DElement]; for (const entry of sceneEntities) { const entityData = getElementData(entry); @@ -83,7 +84,8 @@ function getAttributes (entity) { } function toPropString (propData) { - if (typeof propData === 'string' || typeof propData === 'number' || typeof propData === 'boolean') { + if (typeof propData === 'string' || typeof propData === 'number' || typeof propData === 'boolean' + || Array.isArray(propData)) { return (propData).toString(); } if (propData.isVector3 || propData.isVector2 || propData.isVector4 || From 89d80fbe6fa09acfd9e7e4ff9238b054ef9796e0 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Wed, 2 Aug 2023 18:52:41 -0400 Subject: [PATCH 08/42] fix saving issue - saving car position. Fix issue - prevent save/load streets twice --- src/aframe-streetmix-parsers.js | 11 +++++------ src/json-utils.js | 5 ++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index 364fd32f0..269d754f6 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -413,14 +413,13 @@ function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, s const params = carParams[carType]; const reusableObjectEl = document.createElement('a-entity'); - reusableObjectEl.object3D.position.setX(positionX); - if (positionZ) { - reusableObjectEl.object3D.position.setZ(positionZ); - } else { - randomPosition(reusableObjectEl, 'z', streetLength, params['length']); + + if (!positionZ) { + positionZ = randomPosition(reusableObjectEl, 'z', streetLength, params['length']); } + reusableObjectEl.setAttribute('position', `${positionX} 0 ${positionZ}`); reusableObjectEl.setAttribute('mixin', params['mixin']); - reusableObjectEl.object3D.rotation.set(0, THREE.MathUtils.degToRad(rotationY), 0); + reusableObjectEl.setAttribute('rotation', `0 ${rotationY} 0`); if (animated) { speed = 5; // meters per second diff --git a/src/json-utils.js b/src/json-utils.js index af45e94f4..c850112f5 100644 --- a/src/json-utils.js +++ b/src/json-utils.js @@ -169,8 +169,8 @@ function filterJSONstreet (removeProps, renameProps, streetJSON) { }); // rename components for (var renameKey in renameProps) { - const reKey = new RegExp(`"${renameKey}":`); - stringJSON = stringJSON.replace(reKey, `"${renameProps[renameKey]}":`); + const reKey = new RegExp(`"${renameKey}":`, 'g'); + stringJSON = stringJSON.replaceAll(reKey, `"${renameProps[renameKey]}":`); } return stringJSON; } @@ -250,7 +250,6 @@ function getModifiedProperty (entity, componentName) { // skip properties, if they exists in element's mixin return null; } - // If its single-property like position, rotation, etc if (isSingleProperty(defaultData)) { const defaultValue = defaultData.default; From 84f166d9cedee7659a2070cd05fe76b247778c4e Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 3 Aug 2023 12:16:36 -0400 Subject: [PATCH 09/42] minor lint fixes --- src/json-utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/json-utils.js b/src/json-utils.js index d42edc4af..9dfe52103 100644 --- a/src/json-utils.js +++ b/src/json-utils.js @@ -7,7 +7,7 @@ and returns a Javascript object function convertDOMElToObject (entity) { const data = []; const environmentElement = document.querySelector('#environment'); - const layers2DElement = document.querySelector('#layers-2d'); + const layers2DElement = document.querySelector('#layers-2d'); const sceneEntities = [entity, environmentElement, layers2DElement]; for (const entry of sceneEntities) { @@ -84,8 +84,8 @@ function getAttributes (entity) { } function toPropString (propData) { - if (typeof propData === 'string' || typeof propData === 'number' || typeof propData === 'boolean' - || Array.isArray(propData)) { + if (typeof propData === 'string' || typeof propData === 'number' || typeof propData === 'boolean' || + Array.isArray(propData)) { return (propData).toString(); } if (propData.isVector3 || propData.isVector2 || propData.isVector4 || From 97ff91f25c599457787826df49f9e8382f03178a Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 3 Aug 2023 12:17:32 -0400 Subject: [PATCH 10/42] tiny lint fix --- src/aframe-streetmix-parsers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index 269d754f6..d3dd28ba1 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -413,7 +413,7 @@ function createDriveLaneElement (variantList, positionX, segmentWidthInMeters, s const params = carParams[carType]; const reusableObjectEl = document.createElement('a-entity'); - + if (!positionZ) { positionZ = randomPosition(reusableObjectEl, 'z', streetLength, params['length']); } From ca8165eafb8218688871989ff9776062f07cb8f6 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 3 Aug 2023 12:30:47 -0400 Subject: [PATCH 11/42] do not create license.txt during webpack build the license.txt did not reflect actual licenses of the project. Not sure why it just started happening now. docs for future reference: https://github.com/webpack-contrib/terser-webpack-plugin/issues/383 https://github.com/webpack-contrib/terser-webpack-plugin/issues/229#issuecomment-761294644 --- package-lock.json | 101 ++++++++++++++++++++++++++++------------------ package.json | 1 + webpack.config.js | 4 ++ 3 files changed, 66 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 231e3a4ae..acc442cfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "rewire": "^5.0.0", "semistandard": "^14.2.0", "snazzy": "^8.0.0", + "terser-webpack-plugin": "^5.3.9", "webpack": "^5.75.0", "webpack-cli": "^4.2.0" } @@ -2242,9 +2243,9 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", @@ -2274,9 +2275,9 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", @@ -14936,13 +14937,13 @@ } }, "node_modules/terser": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", - "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", "dev": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -14954,16 +14955,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz", - "integrity": "sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==", + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", + "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.14", + "@jridgewell/trace-mapping": "^0.3.17", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.0", - "terser": "^5.14.1" + "serialize-javascript": "^6.0.1", + "terser": "^5.16.8" }, "engines": { "node": ">= 10.13.0" @@ -14987,10 +14988,19 @@ } } }, + "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/terser/node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -18107,9 +18117,9 @@ } }, "@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "requires": { "@jridgewell/set-array": "^1.0.1", @@ -18130,9 +18140,9 @@ "dev": true }, "@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", "dev": true, "requires": { "@jridgewell/gen-mapping": "^0.3.0", @@ -28131,36 +28141,47 @@ } }, "terser": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", - "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", "dev": true, "requires": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "dependencies": { "acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true } } }, "terser-webpack-plugin": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz", - "integrity": "sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==", + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", + "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", "dev": true, "requires": { - "@jridgewell/trace-mapping": "^0.3.14", + "@jridgewell/trace-mapping": "^0.3.17", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.0", - "terser": "^5.14.1" + "serialize-javascript": "^6.0.1", + "terser": "^5.16.8" + }, + "dependencies": { + "serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + } } }, "test-exclude": { diff --git a/package.json b/package.json index 38b9fb40f..f09eb8352 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "rewire": "^5.0.0", "semistandard": "^14.2.0", "snazzy": "^8.0.0", + "terser-webpack-plugin": "^5.3.9", "webpack": "^5.75.0", "webpack-cli": "^4.2.0" }, diff --git a/webpack.config.js b/webpack.config.js index 107bf530c..f3016985c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const TerserPlugin = require('terser-webpack-plugin'); module.exports = { entry: './src/index.js', @@ -11,5 +12,8 @@ module.exports = { rules: [ { test: /\.js$/, loader: 'babel-loader' } ] + }, + optimization: { + minimizer: [new TerserPlugin({ extractComments: false })], } }; From a3cc351f7826a809da1fc305d02b77aa91e4ecf6 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 3 Aug 2023 12:31:03 -0400 Subject: [PATCH 12/42] npm run dist --- dist/aframe-street-component.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index 3e51b1337..2c05da67c 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -1 +1,16 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var a in i)("object"==typeof exports?exports:t)[a]=i[a]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,a,r){const n=1/r,s=1/a;return e[0].set(n*i,s*t+s),e[1].set(n*i,s*t),e[2].set(n*i+n,s*t),e[3].set(n*i+n,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),a=this.el.getObject3D("mesh").geometry;var r=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);a.setAttribute("uv",new THREE.BufferAttribute(r,2)),a.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,a,r,n){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,a)});const l=n||s.height/o.numRows,c=r||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*a,c,l),i(e,a,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],a=!0,r=!1,n=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){r=!0,n=t}finally{try{a||null==o.return||o.return()}finally{if(r)throw n}}return i}}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,r=p(e,"dividers-".concat(t,"-parent"));return c({objectMixinId:"dividers-".concat(t),parentEl:r,step:a,radius:i}),r}function g(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",n=p(e,"".concat(t,"-parent"));return c({objectMixinId:t,parentEl:n,step:a,radius:i,rotation:r}),n}function f(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var a=Math.floor((e-t)/i)+1;return Array(a).fill().map((function(e,a){return t+a*i})).sort((function(){return.5-Math.random()}))}function y(t,e,i,a){for(var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*a,.5*a,1.5),l={empty:0,sparse:.0625,normal:.125,dense:.25},c=parseInt(l[i]*a,10),d=p(t,"pedestrians-parent"),m=0;m3&&void 0!==arguments[3]?arguments[3]:void 0,r=t.object3D,n=a||A(r)[e],s=w(i,n),o=s.start,l=s.end,c="set".concat(e.toUpperCase()),d=b(o,l);return r.position[c](d),d}function _(t,e,i,a,r){if(r){var n="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+n+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){E(t.target,"z",a)}),{once:!0}),s}}function k(t,e,i,a){if(a){var r="inbound"===t[0]?0:180,n=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin","bus");var o=E(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),n.append(s),n}}function S(t,e,i,a){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,o=i/e*1e3,l="outbound"===s?-i/2:i/2,c=Math.abs(l-n),d=c/e*1e3,m={property:"position",easing:"linear",loop:"false",from:{x:a,y:r,z:n},to:{z:l},dur:d},u={property:"position",easing:"linear",loop:"true",from:{x:a,y:r,z:-l},to:{x:a,y:r,z:l},delay:d,dur:o};return t.setAttribute("animation__1",m),t.setAttribute("animation__2",u),t}function M(t,e,i,r){var n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(s){var c=0,d=a(t,3),m=d[0],u=d[1],p=d[2];2===t.length&&(p=u);var h,g={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(h="sideways"==m?g.sideways[u]:g[m],"pedestrian"===p)return y(e,i,"normal",r,m,n);var f=document.createElement("a-entity");if(1==t.length)return f;var b={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(o>1){var v=r/2,A=l/2+l,w=x(-v+A,v-A,l),_=w.slice(0,o),k="sideways"==m||m.includes("angled")?"width":"length",M=b[p][k];_.forEach((function(t){var e=l-M-.2,i=-e/2+e*Math.random();e>0&&C(t+i,p)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car",a=b[i],s=document.createElement("a-entity");return s.object3D.position.setX(e),t?s.object3D.position.setZ(t):E(s,"z",r,a.length),s.setAttribute("mixin",a.mixin),s.object3D.rotation.set(0,THREE.MathUtils.degToRad(h),0),n&&(c=5,s.setAttribute("wheel",{speed:c,wheelDiameter:a.wheelDiameter}),S(s,c,r,e,0,t,u)),f.append(s),s}}function C(t,e,i){var a=document.createElement("a-entity"),r=document.createElement("a-entity"),n="left"===t[0]?0:180;return r.setAttribute("position",e+" 0 0"),r.setAttribute("rotation","0 "+n+" 0"),r.setAttribute("mixin","food-trailer-rig"),r.addEventListener("model-loaded",(function(t){E(t.target,"z",i)}),{once:!0}),a.append(r),a}function R(t,e){if(e){var i=document.createElement("a-entity"),a=document.createElement("a-entity");a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","magic-carpet"),i.append(a);var r=document.createElement("a-entity");return r.setAttribute("position",t+" 1.75 0"),r.setAttribute("rotation","0 0 0"),r.setAttribute("mixin","Character_1_M"),i.append(r),i}}function j(t,e){var i=document.createElement("a-entity"),a=document.createElement("a-entity");a.setAttribute("mixin","outdoor_dining");var r=E(a,"z",e,2.27);return a.setAttribute("position",t+" 0 "+r),i.append(a),i}function O(t,e,i,a,r){if(r){var n=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=E(s,"z",a,2.03);return s.setAttribute("position",e+" 0 "+l),n.append(s),n}}function I(t,e,i){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(a){var r=document.createElement("a-entity"),n=document.createElement("a-entity"),s="inbound"===t[1]?0:180;n.setAttribute("rotation","0 "+s+" 0"),"taxi"===t[0]?n.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&n.setAttribute("mixin","sedan-rig");var o=E(n,"z",i,5);return n.setAttribute("position",e+" 0 "+o),r.append(n),r}}function T(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function P(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function B(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var a="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+a+" 0"),i}function D(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var a="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+a+" 0"),i}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function N(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function F(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function V(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,a,r,n,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=n/150,d=t+" "+c+" 1",m=t+" 1 1";return"sidewalk"===r||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",n),l.setAttribute("scale",m)):r.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",n),l.setAttribute("scale",m)):(l.setAttribute("rotation","270 "+a+" 0"),l.setAttribute("scale",d)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",r),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,p){var f=i/2;i>12&&(f=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,a,r){if(0===a)return t.concat(i);var n=r[a-1];if(e(i.type)&&e(n.type)){var s="solid";i.type===n.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===n.type||"drive-lane"===n.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==n.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===n.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==n.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===n.type&&"shared"===n.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==n.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===n.type||e(n.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var b,x=function(t){var e=document.createElement("a-entity"),i=0-o.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);x.classList.add("street-parent");for(var A,w=0,E=0;E{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var a=e.split(" "),r=Object.keys(i).filter((function(t){return a.includes(t)})),n="";for(var s in i)r.includes(s)&&(n+=i[s]);return n}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(n.prototype,s),d}();customElements.define("street-assets",n),document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var a=document.createElement("street-assets");i.append(a),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var a=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);a.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var a=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(a.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(r){var n=new THREE.GLTFLoader;a.dracoLoader&&n.setDRACOLoader(a.dracoLoader),n.load(a.data.src,(function(n){var s=n.scene||n.scenes[0];e[a.data.src]=s,delete t[a.data.src],i(a.selectFromModel(s)),r(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},699:()=>{takeScreenshotNow=function(t,e,i){var a=AFRAME.scenes[0].renderer;"img"!=e?function(t,e){var i=document.createElement("a"),a=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",a),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}(t+"."+e,"png"==e?a.domElement.toDataURL("image/png"):a.domElement.toDataURL("image/jpeg",.95)):i.src=a.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var a,r,n,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(a){if(e[a])return e[a].exports;var r=e[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,a){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(a,r,function(e){return t[e]}.bind(null,r));return a},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var a=new THREE.MeshBasicMaterial({color:7818734}),r=new THREE.Mesh(i,a),n=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);n.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4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RSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(n,o),c=new THREE.Group;c.add(r),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,a=new THREE.Mesh(e,i);a.userData.collision=!0,this.collisionMesh=a}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var a=this.cam,r=this.canvas.getBoundingClientRect();t.x=e/(r.right-r.left)*2-1,t.y=-i/(r.bottom-r.top)*2+1,this.rayCaster.setFromCamera(t,a);var n=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===n.length||!this.isValidNormalsAngle(n[0].face.normal))&&!0===n[0].object.userData.collision&&n[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var a=this.easeInOutQuad(this.transitionProgress),r=a<.5?a:1.5-1*(a+.5);this.teleportIndicator.scale.set(1+r,1,1+r);var n=this.camRig.position;n.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*a,n.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*a,n.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*a,this.transitionProgress>=1&&(this.transitioning=!1,n.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(r=[],void 0===(n="function"==typeof(a=s)?a.apply(e,r):a)||(t.exports=n))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,a=AFRAME.utils.diff(i,t);if("clip"in a)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in a&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in a&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in a||"repetitions"in a)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in a&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===a||"wide"===a)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===a)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==a)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var r=0,n=0,s=[];n{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],a=!0,r=!1,n=void 0;try{for(var s,o=t[Symbol.iterator]();!(a=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);a=!0);}catch(t){r=!0,n=t}finally{try{a||null==o.return||o.return()}finally{if(r)throw n}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var a=0,r=Object.entries(t);a0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;return t.forEach((function(t,i){e.appendChild(a(t))})),e}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],a=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+a:"https://streetmix.net/api/v1/streets?namespacedId="+a+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),a=0;a(t.paths=[],t.children||(t.children=[]),t),(()=>{function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),a=t.data.street.segments,r=t.name;i.setAttribute("streetmix-loader","name",r),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:a})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},r.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},r.send()}else{if(e.streetmixStreetURL.length>0){var n=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",n),void i.setAttribute("streetmix-loader","streetmixAPIURL",n)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){var e=this.data,i=this.el,a=e.dimensions.split(" ").map((function(t){return Number(t)})),r=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],n=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),m=e.trafficsignal.split(" ").map((function(t){return Number(t)})),u=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=a[0],h=a[1];function g(t){var e=t.length,a=t.width,r=t.positionVec,n=t.scaleVec,s=void 0===n?{x:1,y:1,z:1}:n,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=a/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",r),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",a),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive","plane"),this.geometry=new THREE.PlaneGeometry(p,h,1,1),this.material=new THREE.MeshStandardMaterial({color:"#FF0000"}),this.mesh=new THREE.Mesh(this.geometry,this.material),i.setObject3D("mesh",this.mesh),this.el.setAttribute("position",{x:r[0],y:r[1],z:r[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var f,b,x={west:{positionVec:{x:p/2-n[0]/2},rotationVec:{x:90,y:0,z:0},length:h,width:n[0]},east:{positionVec:{x:-p/2+n[1]/2},rotationVec:{x:90,y:0,z:0},length:h,width:n[1]},north:{positionVec:{y:-h/2+n[2]/2,x:n[1]/2-n[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-n[1]-n[0],width:n[2]},south:{positionVec:{y:h/2-n[3]/2,x:n[1]/2-n[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-n[1]-n[0],width:n[3]}};Object.keys(x).filter((function(t,e){return n[e]})).forEach((function(t,e){g(x[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},v=0,A=Object.entries(y);v(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.0625,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function M(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function S(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:2e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDI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T8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +var n,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;i.setAttribute("streetmix-loader","name",a),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){var e=this.data,i=this.el,n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive","plane"),this.geometry=new THREE.PlaneGeometry(p,h,1,1),this.material=new THREE.MeshStandardMaterial({color:"#FF0000"}),this.mesh=new THREE.Mesh(this.geometry,this.material),i.setObject3D("mesh",this.mesh),this.el.setAttribute("position",{x:a[0],y:a[1],z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b Date: Thu, 3 Aug 2023 21:48:09 +0000 Subject: [PATCH 13/42] Update src/index.js --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 349346bf9..6b1bb39a3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ /* global AFRAME, THREE, XMLHttpRequest */ +console.log(`3DStreet version: ${VERSION}`); var streetmixParsers = require('./aframe-streetmix-parsers'); var streetmixUtils = require('./tested/streetmix-utils'); require('./components/anisotropy'); From 6c23b2d8daed4dcf0fe51d6bec6ba0568ce8f2fb Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 21:48:23 +0000 Subject: [PATCH 14/42] Update webpack.config.js --- webpack.config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index f3016985c..c711acd7c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const webpack = require('webpack'); const TerserPlugin = require('terser-webpack-plugin'); module.exports = { @@ -15,5 +16,10 @@ module.exports = { }, optimization: { minimizer: [new TerserPlugin({ extractComments: false })], - } + }, + plugins: [ + new webpack.DefinePlugin({ + VERSION: JSON.stringify(process.env.npm_package_version) + }) + ] }; From e62727a7052dad914294d8e022c2faf31044c0ee Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 21:54:02 +0000 Subject: [PATCH 15/42] Update src/index.js --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 6b1bb39a3..53f40222d 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ /* global AFRAME, THREE, XMLHttpRequest */ -console.log(`3DStreet version: ${VERSION}`); +console.log(`3DStreet Version: ${VERSION}`); var streetmixParsers = require('./aframe-streetmix-parsers'); var streetmixUtils = require('./tested/streetmix-utils'); require('./components/anisotropy'); From 6f7975d783125c374e675404bc2c5354c0a2b3a0 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 21:54:26 +0000 Subject: [PATCH 16/42] Update webpack.config.js --- webpack.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index c711acd7c..7ff7fe1b8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,6 +20,12 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ VERSION: JSON.stringify(process.env.npm_package_version) + }), + new webpack.DefinePlugin({ + COMMIT_DATE: JSON.stringify(require('child_process').execSync('git log -1 --format=%cd').toString().trim()) + }), + new webpack.DefinePlugin({ + COMMIT_HASH: JSON.stringify(require('child_process').execSync('git rev-parse --short HEAD').toString().trim()) }) ] }; From 33c04a7ac2d7c735d6dc9862780ed4a9c5ea4f0a Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 21:58:05 +0000 Subject: [PATCH 17/42] Update src/index.js --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 53f40222d..9dc5ffa04 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ /* global AFRAME, THREE, XMLHttpRequest */ -console.log(`3DStreet Version: ${VERSION}`); +console.log(`3DStreet Version: ${VERSION}, Commit Date: ${COMMIT_DATE}, Commit Hash: ${COMMIT_HASH}`); var streetmixParsers = require('./aframe-streetmix-parsers'); var streetmixUtils = require('./tested/streetmix-utils'); require('./components/anisotropy'); From b42632c82f436acd663f05910ea6e4d1da66acc5 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 22:03:23 +0000 Subject: [PATCH 18/42] Update src/index.js --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9dc5ffa04..33d7258b8 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ /* global AFRAME, THREE, XMLHttpRequest */ -console.log(`3DStreet Version: ${VERSION}, Commit Date: ${COMMIT_DATE}, Commit Hash: ${COMMIT_HASH}`); +console.log(`3DStreet Version: ${VERSION} (Date: ${new Date(COMMIT_DATE).toISOString().split('T')[0]}, Commit Hash: #${COMMIT_HASH})`); var streetmixParsers = require('./aframe-streetmix-parsers'); var streetmixUtils = require('./tested/streetmix-utils'); require('./components/anisotropy'); From 34424e0191d497b9a08050b2ea74d49a6d500b22 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 4 Aug 2023 01:10:35 +0000 Subject: [PATCH 19/42] Update src/index.js --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 33d7258b8..466f2d5d5 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ /* global AFRAME, THREE, XMLHttpRequest */ +if (typeof VERSION === 'undefined') { var VERSION = 'local'; } console.log(`3DStreet Version: ${VERSION} (Date: ${new Date(COMMIT_DATE).toISOString().split('T')[0]}, Commit Hash: #${COMMIT_HASH})`); var streetmixParsers = require('./aframe-streetmix-parsers'); var streetmixUtils = require('./tested/streetmix-utils'); From d794139a6913852de772230545194073feb9cdc8 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Fri, 4 Aug 2023 20:17:14 -0400 Subject: [PATCH 20/42] rename layers-2 entity --- index.html | 2 +- mapbox.html | 2 +- src/json-utils.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 1a08b18b5..5a39086ae 100644 --- a/index.html +++ b/index.html @@ -68,7 +68,7 @@ - + diff --git a/mapbox.html b/mapbox.html index 69a1a8e87..16d3b9ff4 100644 --- a/mapbox.html +++ b/mapbox.html @@ -107,7 +107,7 @@ - + Date: Tue, 8 Aug 2023 20:51:13 +0000 Subject: [PATCH 21/42] Update src/index.js --- src/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 466f2d5d5..9457f69c3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,8 @@ /* global AFRAME, THREE, XMLHttpRequest */ if (typeof VERSION === 'undefined') { var VERSION = 'local'; } -console.log(`3DStreet Version: ${VERSION} (Date: ${new Date(COMMIT_DATE).toISOString().split('T')[0]}, Commit Hash: #${COMMIT_HASH})`); +if (VERSION !== 'local') { + console.log(`3DStreet Version: ${VERSION} (Date: ${new Date(COMMIT_DATE).toISOString().split('T')[0]}, Commit Hash: #${COMMIT_HASH})`); +} var streetmixParsers = require('./aframe-streetmix-parsers'); var streetmixUtils = require('./tested/streetmix-utils'); require('./components/anisotropy'); @@ -467,4 +469,4 @@ AFRAME.registerComponent('wheel', { this.wheel_B_R.rotateY(rateOfRotation); } } -}); +}); \ No newline at end of file From 4e8ef098ee672b21f4ab0b5251f99aa2f7bb9937 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 20:52:44 +0000 Subject: [PATCH 22/42] Update src/index.js --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index 9457f69c3..5cdb48d88 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,8 @@ if (typeof VERSION === 'undefined') { var VERSION = 'local'; } if (VERSION !== 'local') { console.log(`3DStreet Version: ${VERSION} (Date: ${new Date(COMMIT_DATE).toISOString().split('T')[0]}, Commit Hash: #${COMMIT_HASH})`); +} else { + console.log('Running in local development environment'); } var streetmixParsers = require('./aframe-streetmix-parsers'); var streetmixUtils = require('./tested/streetmix-utils'); From bbc3ea55a79f4adc5851ef8e4f75d649ac3defce Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Tue, 8 Aug 2023 17:04:41 -0400 Subject: [PATCH 23/42] fewer pedestrians in 'sparse' mode --- src/aframe-streetmix-parsers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aframe-streetmix-parsers.js b/src/aframe-streetmix-parsers.js index d3dd28ba1..e4a1acb3d 100644 --- a/src/aframe-streetmix-parsers.js +++ b/src/aframe-streetmix-parsers.js @@ -200,7 +200,7 @@ function createSidewalkClonedVariants (BasePositionX, segmentWidthInMeters, dens const zValueRange = getZPositions((-0.5 * streetLength), (0.5 * streetLength), 1.5); const densityFactors = { empty: 0, - sparse: 0.0625, + sparse: 0.03, normal: 0.125, dense: 0.25 }; From 8ac658e1d8c1fb512a0dcb376a7db6c3ed8cd63c Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Tue, 8 Aug 2023 14:24:26 -0700 Subject: [PATCH 24/42] simplify logic to display version --- src/index.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 5cdb48d88..34d03779a 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,5 @@ /* global AFRAME, THREE, XMLHttpRequest */ -if (typeof VERSION === 'undefined') { var VERSION = 'local'; } -if (VERSION !== 'local') { - console.log(`3DStreet Version: ${VERSION} (Date: ${new Date(COMMIT_DATE).toISOString().split('T')[0]}, Commit Hash: #${COMMIT_HASH})`); -} else { - console.log('Running in local development environment'); -} +if (typeof VERSION !== 'undefined') { console.log(`3DStreet Version: ${VERSION} (Date: ${new Date(COMMIT_DATE).toISOString().split('T')[0]}, Commit Hash: #${COMMIT_HASH})`); } var streetmixParsers = require('./aframe-streetmix-parsers'); var streetmixUtils = require('./tested/streetmix-utils'); require('./components/anisotropy'); @@ -471,4 +466,4 @@ AFRAME.registerComponent('wheel', { this.wheel_B_R.rotateY(rateOfRotation); } } -}); \ No newline at end of file +}); From 0eebcb5191391e8bc08b5568e136ccf07d00e63b Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Tue, 8 Aug 2023 14:24:38 -0700 Subject: [PATCH 25/42] minor lint fix --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 7ff7fe1b8..0aa5653d3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,7 +15,7 @@ module.exports = { ] }, optimization: { - minimizer: [new TerserPlugin({ extractComments: false })], + minimizer: [new TerserPlugin({ extractComments: false })] }, plugins: [ new webpack.DefinePlugin({ From c043fb8390ebbd17803c3ef6f10046cd22550d5d Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Tue, 8 Aug 2023 14:47:48 -0700 Subject: [PATCH 26/42] npm run dist --- dist/aframe-street-component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index 2c05da67c..91167587d 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -1,4 +1,4 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.0625,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function M(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function S(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:2e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nw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VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function M(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function S(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:2e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkV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72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. From 4bab04a37004b1ae8ac09228e1094da4e3bc3656 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Tue, 8 Aug 2023 14:48:16 -0700 Subject: [PATCH 27/42] npm run dist again --- dist/aframe-street-component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index 91167587d..53de41860 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -1,4 +1,4 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function M(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function S(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:2e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAF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ADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function S(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function M(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:2e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMB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HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var n,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;i.setAttribute("streetmix-loader","name",a),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){var e=this.data,i=this.el,n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive","plane"),this.geometry=new THREE.PlaneGeometry(p,h,1,1),this.material=new THREE.MeshStandardMaterial({color:"#FF0000"}),this.mesh=new THREE.Mesh(this.geometry,this.material),i.setObject3D("mesh",this.mesh),this.el.setAttribute("position",{x:a[0],y:a[1],z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;i.setAttribute("streetmix-loader","name",a),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){var e=this.data,i=this.el,n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive","plane"),this.geometry=new THREE.PlaneGeometry(p,h,1,1),this.material=new THREE.MeshStandardMaterial({color:"#FF0000"}),this.mesh=new THREE.Mesh(this.geometry,this.material),i.setObject3D("mesh",this.mesh),this.el.setAttribute("position",{x:a[0],y:a[1],z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b Date: Tue, 8 Aug 2023 14:48:29 -0700 Subject: [PATCH 28/42] 0.4.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index acc442cfe..96d20d2d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "3dstreet", - "version": "0.4.0", + "version": "0.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "3dstreet", - "version": "0.4.0", + "version": "0.4.1", "license": "AGPLv3", "dependencies": { "aframe-atlas-uvs-component": "^3.0.0", diff --git a/package.json b/package.json index f09eb8352..dd6ba30b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "3dstreet", - "version": "0.4.0", + "version": "0.4.1", "description": "Web-based 3D visualization of streets using A-Frame and WebXR", "main": "dist/aframe-street-component.js", "scripts": { From 124feaeec33b5a002c44e5e7987ff716c407caff Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Tue, 8 Aug 2023 15:08:25 -0700 Subject: [PATCH 29/42] Update CHANGELOG for 0.4.1 --- CHANGELOG.md | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c9aab42..4d234233f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,24 +5,42 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [Unreleased - to be 0.4.1] - TBD +## 0.4.1 - 2023-08-08 -### Changes and additions -* v2 save / load - includes environment +### What's Changed + +### Major improvements +* v2 save / load - ability to edit a 3DStreet JSON file previously saved including environment and reference layers +* ability to load 3DStreet json file from third-party path (precursor to cloud) * ability to update night / day live (street-environment component) -* ability to load json file from third-party path (precursor to cloud) * improve asset loading - lazy load vehicles (only load vehicles when needed for scene) -* new LRV -* new bus model -* [Improved screenshot capture and capture modal (editor)](https://github.com/3DStreet/3dstreet/pull/277) -* [Improved support for varying levels of pedestrian densiy on sidewalk segments](https://github.com/3DStreet/3dstreet/pull/276) + +### Changes and additions +* Sidewalk segment variants by @Algorush in https://github.com/3DStreet/3dstreet/pull/276 +* add perpendicular parking option by @Algorush in https://github.com/3DStreet/3dstreet/pull/273 +* New Screentock component by @kfarr in https://github.com/3DStreet/3dstreet/pull/277 +* support new LRV by @kfarr in https://github.com/3DStreet/3dstreet/pull/289 +* Lazy load rigged vehicles by @kfarr in https://github.com/3DStreet/3dstreet/pull/296 +* Add first version to load JSON from URL by @Algorush in https://github.com/3DStreet/3dstreet/pull/304 +* add update environment option by @Algorush in https://github.com/3DStreet/3dstreet/pull/307 +* add environment node support by @Algorush in https://github.com/3DStreet/3dstreet/pull/300 +* add attribute to ignore raycaster on env-sky element by @Algorush in https://github.com/3DStreet/3dstreet/pull/312 +* Notification component by @Algorush in https://github.com/3DStreet/3dstreet/pull/319 +* add layers-2d node support to save/load by @Algorush in https://github.com/3DStreet/3dstreet/pull/320 +* rename layers-2 entity by @Algorush in https://github.com/3DStreet/3dstreet/pull/326 +* fewer pedestrians in 'sparse' mode by @Algorush in https://github.com/3DStreet/3dstreet/pull/328 +* Add console log for npm version number and github hash by @sweep-ai in https://github.com/3DStreet/3dstreet/pull/324 +* brt station segment support by @Algorush https://github.com/3DStreet/3dstreet/pull/268 ### Fixed -* ability to edit a street previously saved -* restore parallel parking t stencil -* fix empty lot / parking lot variants showing -* [Add perpindicular parking option](https://github.com/3DStreet/3dstreet/pull/273) -* [brt station support](https://github.com/3DStreet/3dstreet/pull/268) +* fix NaN issue with pedestrians by @Algorush in https://github.com/3DStreet/3dstreet/pull/283 +* fix empty building variant showing by @Algorush in https://github.com/3DStreet/3dstreet/pull/285 +* Save load fixing by @Algorush in https://github.com/3DStreet/3dstreet/pull/287 +* Save load fixing by @Algorush in https://github.com/3DStreet/3dstreet/pull/310 +* fix saving issue by @Algorush in https://github.com/3DStreet/3dstreet/pull/321 +* return parking-t mixin by @Algorush in https://github.com/3DStreet/3dstreet/pull/302 + +**Full Changelog**: https://github.com/3DStreet/3dstreet/compare/0.4.0...0.4.1 ## 0.4.0 - 2023-05-04 From 1f8f4eb09bea4e52601187fde63232988f91faea Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Tue, 8 Aug 2023 15:10:14 -0700 Subject: [PATCH 30/42] update assets submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 3f1483552..25645ccd4 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 3f1483552ee5814936d38e45ba28fdd6747da8cf +Subproject commit 25645ccd421a7e50682b0e5b4ebe3d22f667dcb3 From e461c729d53c08f712b038cab27e7a2813d58903 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Tue, 8 Aug 2023 15:23:18 -0700 Subject: [PATCH 31/42] dist bump --- dist/aframe-street-component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index 53de41860..599c1f136 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var n,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;i.setAttribute("streetmix-loader","name",a),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){var e=this.data,i=this.el,n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive","plane"),this.geometry=new THREE.PlaneGeometry(p,h,1,1),this.material=new THREE.MeshStandardMaterial({color:"#FF0000"}),this.mesh=new THREE.Mesh(this.geometry,this.material),i.setObject3D("mesh",this.mesh),this.el.setAttribute("position",{x:a[0],y:a[1],z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;i.setAttribute("streetmix-loader","name",a),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){var e=this.data,i=this.el,n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive","plane"),this.geometry=new THREE.PlaneGeometry(p,h,1,1),this.material=new THREE.MeshStandardMaterial({color:"#FF0000"}),this.mesh=new THREE.Mesh(this.geometry,this.material),i.setObject3D("mesh",this.mesh),this.el.setAttribute("position",{x:a[0],y:a[1],z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b Date: Sun, 13 Aug 2023 18:51:42 -0700 Subject: [PATCH 32/42] create new screenshot entity also ensure playing when in editor mode --- index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 5a39086ae..140e0e480 100644 --- a/index.html +++ b/index.html @@ -60,6 +60,7 @@ + @@ -130,9 +131,12 @@ }); function buttonScreenshotTock() { - AFRAME.scenes[0].setAttribute('screentock', 'type', 'jpg'); - AFRAME.scenes[0].setAttribute('screentock', 'takeScreenshot', true); + const screenshotEl = document.getElementById('screenshot'); + screenshotEl.play(); // double check playing in case we're in editor mode + screenshotEl.setAttribute('screentock', 'type', 'jpg'); + screenshotEl.setAttribute('screentock', 'takeScreenshot', true); } + function startEditor() { var sceneEl = document.querySelector('a-scene'); sceneEl.components.inspector.openInspector(); From 214a06bd744541deefdb17a29399c2208f5f9bdd Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Tue, 5 Sep 2023 20:43:48 -0300 Subject: [PATCH 33/42] fix intersection saving issue --- src/index.js | 64 +++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/src/index.js b/src/index.js index 34d03779a..df257f91f 100644 --- a/src/index.js +++ b/src/index.js @@ -124,6 +124,11 @@ AFRAME.registerComponent('intersection', { init: function () { var data = this.data; var el = this.el; + + // remove all child nodes if exists + while (el.firstChild) { + el.removeChild(el.lastChild); + } const dimensionsArray = data.dimensions.split(' ').map((i) => Number(i)); const positionArray = [this.el.getAttribute('position').x, this.el.getAttribute('position').y, this.el.getAttribute('position').z]; const sidewalkArray = data.sidewalk.split(' ').map((i) => Number(i)); @@ -138,13 +143,8 @@ AFRAME.registerComponent('intersection', { const intersectWidth = dimensionsArray[0]; const intersectDepth = dimensionsArray[1]; - this.el.setAttribute('geometry', 'primitive', 'plane'); - this.geometry = new THREE.PlaneGeometry(intersectWidth, intersectDepth, 1, 1); - this.material = new THREE.MeshStandardMaterial({ color: '#FF0000' }); - this.mesh = new THREE.Mesh(this.geometry, this.material); - el.setObject3D('mesh', this.mesh); - - this.el.setAttribute('position', { x: positionArray[0], y: positionArray[1], z: positionArray[2] }); + this.el.setAttribute('geometry', `primitive:box; width: ${intersectWidth}; height: ${intersectDepth}; depth:0.2`); + this.el.setAttribute('position', { x: positionArray[0], y: - 0.1, z: positionArray[2] }); this.el.setAttribute('rotation', '-90 0 0'); this.el.setAttribute('material', 'src: #asphalt-texture; repeat:5 5; roughness:1'); @@ -170,13 +170,13 @@ AFRAME.registerComponent('intersection', { // describe sidewalk parameters const sidewalkParams = { west: { - positionVec: { x: intersectWidth / 2 - sidewalkArray[0] / 2 }, + positionVec: { x: intersectWidth / 2 - sidewalkArray[0] / 2, z: 0.1 }, rotationVec: { x: 90, y: 0, z: 0 }, length: intersectDepth, width: sidewalkArray[0] }, east: { - positionVec: { x: -intersectWidth / 2 + sidewalkArray[1] / 2 }, + positionVec: { x: -intersectWidth / 2 + sidewalkArray[1] / 2, z: 0.1 }, rotationVec: { x: 90, y: 0, z: 0 }, length: intersectDepth, width: sidewalkArray[1] @@ -185,7 +185,8 @@ AFRAME.registerComponent('intersection', { positionVec: { y: -intersectDepth / 2 + sidewalkArray[2] / 2, // add x offset to avoid sidewalk's element overlap - x: sidewalkArray[1] / 2 - sidewalkArray[0] / 2 + x: sidewalkArray[1] / 2 - sidewalkArray[0] / 2, + z: 0.1 }, rotationVec: { x: 0, y: 90, z: -90 }, // minus the width of the crossing sidewalk @@ -196,7 +197,8 @@ AFRAME.registerComponent('intersection', { positionVec: { y: intersectDepth / 2 - sidewalkArray[3] / 2, // add x offset to avoid sidewalk's element overlap - x: sidewalkArray[1] / 2 - sidewalkArray[0] / 2 + x: sidewalkArray[1] / 2 - sidewalkArray[0] / 2, + z: 0.1 }, rotationVec: { x: 0, y: 90, z: -90 }, // minus the width of the crossing sidewalk @@ -217,25 +219,25 @@ AFRAME.registerComponent('intersection', { // describe curb parameters const curbParams = { northeast: { - positionVec: { x: intersectWidth / 2 - northeastcurbArray[0] / 2, y: intersectDepth / 2 - northeastcurbArray[1] / 2 }, + positionVec: { x: intersectWidth / 2 - northeastcurbArray[0] / 2, y: intersectDepth / 2 - northeastcurbArray[1] / 2, z: 0.1 }, rotationVec: { x: 0, y: 90, z: -90 }, length: northeastcurbArray[0], width: northeastcurbArray[1] }, southwest: { - positionVec: { x: -intersectWidth / 2 + southwestcurbArray[0] / 2, y: -intersectDepth / 2 + southwestcurbArray[1] / 2 }, + positionVec: { x: -intersectWidth / 2 + southwestcurbArray[0] / 2, y: -intersectDepth / 2 + southwestcurbArray[1] / 2, z: 0.1 }, rotationVec: { x: 0, y: 90, z: -90 }, length: southwestcurbArray[0], width: southwestcurbArray[1] }, southeast: { - positionVec: { x: intersectWidth / 2 - southeastcurbArray[0] / 2, y: -intersectDepth / 2 + southeastcurbArray[1] / 2 }, + positionVec: { x: intersectWidth / 2 - southeastcurbArray[0] / 2, y: -intersectDepth / 2 + southeastcurbArray[1] / 2, z: 0.1 }, rotationVec: { x: 0, y: 90, z: -90 }, length: southeastcurbArray[0], width: southeastcurbArray[1] }, northwest: { - positionVec: { x: -intersectWidth / 2 + northwestcurbArray[0] / 2, y: intersectDepth / 2 - northwestcurbArray[1] / 2 }, + positionVec: { x: -intersectWidth / 2 + northwestcurbArray[0] / 2, y: intersectDepth / 2 - northwestcurbArray[1] / 2, z: 0.1 }, rotationVec: { x: 0, y: 90, z: -90 }, length: northwestcurbArray[0], width: northwestcurbArray[1] @@ -251,28 +253,28 @@ AFRAME.registerComponent('intersection', { if (stopsignArray[0]) { const ss1 = document.createElement('a-entity'); - ss1.setAttribute('position', { x: intersectWidth / 2, y: intersectDepth / 3, z: 0.03 }); + ss1.setAttribute('position', { x: intersectWidth / 2, y: intersectDepth / 3, z: 0.1 }); ss1.setAttribute('rotation', { x: 0, y: 90, z: 90 }); ss1.setAttribute('mixin', 'stop_sign'); el.appendChild(ss1); } if (stopsignArray[1]) { const ss2 = document.createElement('a-entity'); - ss2.setAttribute('position', { x: -intersectWidth / 2, y: -intersectDepth / 3, z: 0.03 }); + ss2.setAttribute('position', { x: -intersectWidth / 2, y: -intersectDepth / 3, z: 0.1 }); ss2.setAttribute('rotation', { x: 0, y: -90, z: -90 }); ss2.setAttribute('mixin', 'stop_sign'); el.appendChild(ss2); } if (stopsignArray[2]) { const ss3 = document.createElement('a-entity'); - ss3.setAttribute('position', { x: -intersectWidth / 3, y: intersectDepth / 2, z: 0.03 }); + ss3.setAttribute('position', { x: -intersectWidth / 3, y: intersectDepth / 2, z: 0.1 }); ss3.setAttribute('rotation', { x: -90, y: 90, z: 90 }); ss3.setAttribute('mixin', 'stop_sign'); el.appendChild(ss3); } if (stopsignArray[3]) { const ss4 = document.createElement('a-entity'); - ss4.setAttribute('position', { x: intersectWidth / 3, y: -intersectDepth / 2, z: 0.03 }); + ss4.setAttribute('position', { x: intersectWidth / 3, y: -intersectDepth / 2, z: 0.1 }); ss4.setAttribute('rotation', { x: 90, y: -90, z: -90 }); ss4.setAttribute('mixin', 'stop_sign'); el.appendChild(ss4); @@ -280,48 +282,48 @@ AFRAME.registerComponent('intersection', { if (trafficsignalArray[0]) { const ts1 = document.createElement('a-entity'); - ts1.setAttribute('position', { x: intersectWidth / 2, y: intersectDepth / 3, z: 0.03 }); + ts1.setAttribute('position', { x: intersectWidth / 2, y: intersectDepth / 3, z: 0.3 }); ts1.setAttribute('rotation', { x: 210, y: 90, z: 90 }); ts1.setAttribute('mixin', 'signal_left'); el.appendChild(ts1); const ts2 = document.createElement('a-entity'); - ts2.setAttribute('position', { x: intersectWidth / 2, y: -intersectDepth / 3, z: 0.03 }); + ts2.setAttribute('position', { x: intersectWidth / 2, y: -intersectDepth / 3, z: 0.3 }); ts2.setAttribute('rotation', { x: 180, y: 90, z: 90 }); ts2.setAttribute('mixin', 'signal_right'); el.appendChild(ts2); } if (trafficsignalArray[1]) { const ts3 = document.createElement('a-entity'); - ts3.setAttribute('position', { x: -intersectWidth / 2, y: -intersectDepth / 3, z: 0.03 }); + ts3.setAttribute('position', { x: -intersectWidth / 2, y: -intersectDepth / 3, z: 0.3 }); ts3.setAttribute('rotation', { x: 30, y: 90, z: 90 }); ts3.setAttribute('mixin', 'signal_left'); el.appendChild(ts3); const ts4 = document.createElement('a-entity'); - ts4.setAttribute('position', { x: -intersectWidth / 2, y: intersectDepth / 3, z: 0.03 }); + ts4.setAttribute('position', { x: -intersectWidth / 2, y: intersectDepth / 3, z: 0.3 }); ts4.setAttribute('rotation', { x: 0, y: 90, z: 90 }); ts4.setAttribute('mixin', 'signal_right'); el.appendChild(ts4); } if (trafficsignalArray[2]) { const ts5 = document.createElement('a-entity'); - ts5.setAttribute('position', { x: -intersectWidth / 3, y: intersectDepth / 2, z: 0.03 }); + ts5.setAttribute('position', { x: -intersectWidth / 3, y: intersectDepth / 2, z: 0.1 }); ts5.setAttribute('rotation', { x: 120, y: 90, z: 90 }); ts5.setAttribute('mixin', 'signal_left'); el.appendChild(ts5); const ts6 = document.createElement('a-entity'); - ts6.setAttribute('position', { x: intersectWidth / 3, y: intersectDepth / 2, z: 0.03 }); + ts6.setAttribute('position', { x: intersectWidth / 3, y: intersectDepth / 2, z: 0.1 }); ts6.setAttribute('rotation', { x: 90, y: 90, z: 90 }); ts6.setAttribute('mixin', 'signal_right'); el.appendChild(ts6); } if (trafficsignalArray[3]) { const ts7 = document.createElement('a-entity'); - ts7.setAttribute('position', { x: intersectWidth / 3, y: -intersectDepth / 2, z: 0.03 }); + ts7.setAttribute('position', { x: intersectWidth / 3, y: -intersectDepth / 2, z: 0.1 }); ts7.setAttribute('rotation', { x: -60, y: 90, z: 90 }); ts7.setAttribute('mixin', 'signal_left'); el.appendChild(ts7); const ts8 = document.createElement('a-entity'); - ts8.setAttribute('position', { x: -intersectWidth / 3, y: -intersectDepth / 2, z: 0.03 }); + ts8.setAttribute('position', { x: -intersectWidth / 3, y: -intersectDepth / 2, z: 0.1 }); ts8.setAttribute('rotation', { x: -90, y: 90, z: 90 }); ts8.setAttribute('mixin', 'signal_right'); el.appendChild(ts8); @@ -329,7 +331,7 @@ AFRAME.registerComponent('intersection', { if (crosswalklArray[0]) { const cw1 = document.createElement('a-entity'); - cw1.setAttribute('position', { x: intersectWidth / 2 - 2, z: 0.013 }); + cw1.setAttribute('position', { x: intersectWidth / 2 - 2, z: 0.11 }); cw1.setAttribute('rotation', { x: 0, y: 0, z: 180 }); cw1.setAttribute('scale', { y: intersectDepth / 12 }); cw1.setAttribute('mixin', 'markings crosswalk-zebra'); @@ -337,7 +339,7 @@ AFRAME.registerComponent('intersection', { } if (crosswalklArray[1]) { const cw2 = document.createElement('a-entity'); - cw2.setAttribute('position', { x: -intersectWidth / 2 + 2, z: 0.012 }); + cw2.setAttribute('position', { x: -intersectWidth / 2 + 2, z: 0.11 }); cw2.setAttribute('rotation', { x: 0, y: 0, z: 180 }); cw2.setAttribute('scale', { y: intersectDepth / 12 }); cw2.setAttribute('mixin', 'markings crosswalk-zebra'); @@ -345,7 +347,7 @@ AFRAME.registerComponent('intersection', { } if (crosswalklArray[2]) { const cw3 = document.createElement('a-entity'); - cw3.setAttribute('position', { y: -intersectDepth / 2 + 2, z: 0.011 }); + cw3.setAttribute('position', { y: -intersectDepth / 2 + 2, z: 0.11 }); cw3.setAttribute('rotation', { x: 0, y: 0, z: 90 }); cw3.setAttribute('scale', { y: intersectWidth / 12 }); cw3.setAttribute('mixin', 'markings crosswalk-zebra'); @@ -353,7 +355,7 @@ AFRAME.registerComponent('intersection', { } if (crosswalklArray[3]) { const cw4 = document.createElement('a-entity'); - cw4.setAttribute('position', { y: intersectDepth / 2 - 2, z: 0.01 }); + cw4.setAttribute('position', { y: intersectDepth / 2 - 2, z: 0.11 }); cw4.setAttribute('rotation', { x: 0, y: 0, z: 90 }); cw4.setAttribute('scale', { y: intersectWidth / 12 }); cw4.setAttribute('mixin', 'markings crosswalk-zebra'); From 2ceae96da1ab55bb9b31b9dac89a3e12847666ad Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Tue, 5 Sep 2023 23:10:19 -0300 Subject: [PATCH 34/42] Update json-utils.js --- src/json-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/json-utils.js b/src/json-utils.js index 760c96060..76b6c53fa 100644 --- a/src/json-utils.js +++ b/src/json-utils.js @@ -130,7 +130,8 @@ const removeProps = { // a list of component_name:new_component_name pairs to rename in JSON string const renameProps = { 'streetmix-loader': 'not-streetmix-loader', - street: 'not-street' + street: 'not-street', + intersection: 'not-intersection' }; function filterJSONstreet (removeProps, renameProps, streetJSON) { From 6f4c23b5fea91f85539b40e69b56e22f501f60d3 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Thu, 7 Sep 2023 15:30:16 -0300 Subject: [PATCH 35/42] add intesection scene for deploy-preview test --- index-intersection.html | 227 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 index-intersection.html diff --git a/index-intersection.html b/index-intersection.html new file mode 100644 index 000000000..1151b0779 --- /dev/null +++ b/index-intersection.html @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + 3DStreet + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5252f283b3957f265c2186b95e8d29575030a1bb Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 7 Sep 2023 23:11:36 -0700 Subject: [PATCH 36/42] quick lint fix --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index df257f91f..9d71b3110 100644 --- a/src/index.js +++ b/src/index.js @@ -128,7 +128,7 @@ AFRAME.registerComponent('intersection', { // remove all child nodes if exists while (el.firstChild) { el.removeChild(el.lastChild); - } + } const dimensionsArray = data.dimensions.split(' ').map((i) => Number(i)); const positionArray = [this.el.getAttribute('position').x, this.el.getAttribute('position').y, this.el.getAttribute('position').z]; const sidewalkArray = data.sidewalk.split(' ').map((i) => Number(i)); @@ -144,7 +144,7 @@ AFRAME.registerComponent('intersection', { const intersectDepth = dimensionsArray[1]; this.el.setAttribute('geometry', `primitive:box; width: ${intersectWidth}; height: ${intersectDepth}; depth:0.2`); - this.el.setAttribute('position', { x: positionArray[0], y: - 0.1, z: positionArray[2] }); + this.el.setAttribute('position', { x: positionArray[0], y: -0.1, z: positionArray[2] }); this.el.setAttribute('rotation', '-90 0 0'); this.el.setAttribute('material', 'src: #asphalt-texture; repeat:5 5; roughness:1'); From da6870b065e720ef6c412ecb73811b9a001937bf Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Sat, 9 Sep 2023 21:03:39 -0700 Subject: [PATCH 37/42] streetmix-loader set metadata sceneTitle if none --- src/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.js b/src/index.js index 9d71b3110..48273d37d 100644 --- a/src/index.js +++ b/src/index.js @@ -88,6 +88,12 @@ AFRAME.registerComponent('streetmix-loader', { const streetmixSegments = streetmixResponseObject.data.street.segments; const streetmixName = streetmixResponseObject.name; el.setAttribute('streetmix-loader', 'name', streetmixName); + + let currentSceneTitle = AFRAME.scenes[0].getAttribute('metadata', 'sceneTitle'); + if (!currentSceneTitle) { // only set title from streetmix if none exists + AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', streetmixName); + } + if (data.showBuildings) { el.setAttribute('street', 'right', streetmixResponseObject.data.street.rightBuildingVariant); el.setAttribute('street', 'left', streetmixResponseObject.data.street.leftBuildingVariant); From 932b0c0106c9d5b77b96da90b5094878d885eb59 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Sat, 9 Sep 2023 22:30:14 -0700 Subject: [PATCH 38/42] set scene name from json, sceneid from path --- index.html | 54 ++++++++++++++++++++++++++++++++++++++++++++++++---- src/index.js | 6 ++++-- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 140e0e480..15e7e1ba1 100644 --- a/index.html +++ b/index.html @@ -46,6 +46,7 @@ renderer="colorManagement: true; physicallyCorrectLights: true;" inspector="url: //3dstreet.app/dist/3dstreet-editor.js" notify + metadata > @@ -109,6 +110,11 @@ // } }, fetchJSON: function (requestURL) { + let sceneId = getUUIDFromPath(requestURL); + if (sceneId) { + console.log('sceneId from fetchJSON from url hash loader', sceneId); + AFRAME.scenes[0].setAttribute('metadata', 'sceneId', sceneId); + } const request = new XMLHttpRequest(); request.open('GET', requestURL, true); request.onload = function () { @@ -120,6 +126,11 @@ console.log('[set-loader-from-hash]', '200 response received and JSON parsed, now createElementsFromJSON'); createElementsFromJSON(jsonData); + let sceneId = getUUIDFromPath(requestURL); + if (sceneId) { + console.log('sceneId from fetchJSON from url hash loader', sceneId); + AFRAME.scenes[0].setAttribute('metadata', 'sceneId', sceneId); + } } }; request.onerror = function () { @@ -142,11 +153,36 @@ sceneEl.components.inspector.openInspector(); document.querySelector('.viewer-header-wrapper').style.display = 'none'; } - // uncomment the below to autostart the editor within 2 seconds of page load - // setTimeout(() => { - // startEditor(); - // }, "2000") + AFRAME.registerComponent('timed-inspector', { + init: function() { + setTimeout( function () { + window.postMessage('INJECT_AFRAME_INSPECTOR') + }, this.data * 1000) + } + }); + + AFRAME.registerComponent('metadata', { + schema: { + sceneTitle: {default: ''}, + sceneId: {default: ''} + }, + init: function() { + } + }) + + function getUUIDFromPath(path) { + // UUID regex pattern: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} + const uuidPattern = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/; + + const match = path.match(uuidPattern); + if (match) { + return match[0]; + } + + return null; // return null or whatever default value you prefer if no UUID found + } + function inputStreetmix() { streetmixURL = prompt("Please enter a Streetmix URL", "https://streetmix.net/kfarr/3/example-street"); setTimeout(function() { window.location.hash = streetmixURL; }); @@ -154,6 +190,8 @@ while (streetContainerEl.firstChild) { streetContainerEl.removeChild(streetContainerEl.lastChild); } + AFRAME.scenes[0].setAttribute('metadata', 'sceneId', ''); + AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', ''); streetContainerEl.innerHTML = ''; } @@ -175,6 +213,12 @@ streetObject = streetJSON; } + let sceneTitle = streetObject.title; + if (sceneTitle) { + console.log('sceneTitle from createElementsFromJSON', sceneTitle); + AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', sceneTitle); + } + streetContainerEl = document.getElementById('street-container'); while (streetContainerEl.firstChild) { streetContainerEl.removeChild(streetContainerEl.lastChild); @@ -194,6 +238,8 @@ function fileJSON() { let reader=new FileReader(); reader.onload=function(){ + AFRAME.scenes[0].setAttribute('metadata', 'sceneId', ''); + AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', ''); createElementsFromJSON(reader.result); } reader.readAsText(this.files[0]); diff --git a/src/index.js b/src/index.js index 48273d37d..d843b420b 100644 --- a/src/index.js +++ b/src/index.js @@ -87,11 +87,13 @@ AFRAME.registerComponent('streetmix-loader', { const streetmixResponseObject = JSON.parse(this.response); const streetmixSegments = streetmixResponseObject.data.street.segments; const streetmixName = streetmixResponseObject.name; + console.log('streetmixName', streetmixName) el.setAttribute('streetmix-loader', 'name', streetmixName); - let currentSceneTitle = AFRAME.scenes[0].getAttribute('metadata', 'sceneTitle'); + let currentSceneTitle = AFRAME.scenes[0].getAttribute('metadata').sceneTitle; if (!currentSceneTitle) { // only set title from streetmix if none exists - AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', streetmixName); + AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', streetmixName); + console.log('therefore setting metadata sceneTitle as streetmixName', streetmixName) } if (data.showBuildings) { From 463082fac6bdd7674e51cc0cabc958479e181571 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Sun, 10 Sep 2023 18:45:41 -0700 Subject: [PATCH 39/42] npm run dist --- dist/aframe-street-component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index 599c1f136..af19e4484 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -1,4 +1,4 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function S(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function M(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:2e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYF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xO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function S(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function M(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:2e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE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bYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var n,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;i.setAttribute("streetmix-loader","name",a),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){var e=this.data,i=this.el,n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive","plane"),this.geometry=new THREE.PlaneGeometry(p,h,1,1),this.material=new THREE.MeshStandardMaterial({color:"#FF0000"}),this.mesh=new THREE.Mesh(this.geometry,this.material),i.setObject3D("mesh",this.mesh),this.el.setAttribute("position",{x:a[0],y:a[1],z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;i.setAttribute("streetmix-loader","name",a),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:a[0],y:-.1,z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b Date: Sun, 10 Sep 2023 20:32:38 -0700 Subject: [PATCH 40/42] moving more things from index.html into json-utils.js --- index.html | 145 ++------------------------------------------- src/json-utils.js | 147 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+), 141 deletions(-) diff --git a/index.html b/index.html index 15e7e1ba1..30a3c6ba0 100644 --- a/index.html +++ b/index.html @@ -75,6 +75,10 @@ diff --git a/src/json-utils.js b/src/json-utils.js index 76b6c53fa..943a9600f 100644 --- a/src/json-utils.js +++ b/src/json-utils.js @@ -368,3 +368,150 @@ function createEntityFromObj (entityData, parentEl) { } } } + +/* + Code imported from index.html, mix of save load utils and some ui functions +*/ + + +AFRAME.registerComponent('metadata', { + schema: { + sceneTitle: {default: ''}, + sceneId: {default: ''} + }, + init: function() { + } +}) + +AFRAME.registerComponent('set-loader-from-hash', { + dependencies: ['streetmix-loader'], + schema: { + defaultURL: { type: 'string' } + }, + init: function () { + // get hash from window + const streetURL = window.location.hash.substring(1); + if (!streetURL) { + return; + } + if (streetURL.includes('//streetmix.net')) { + console.log('[set-loader-from-hash]','Set streetmix-loader streetmixStreetURL to', streetURL) + this.el.setAttribute('streetmix-loader', 'streetmixStreetURL', streetURL); + } else { + // try to load JSON file from remote resource + console.log('[set-loader-from-hash]','Load 3DStreet scene with fetchJSON from', streetURL) + this.fetchJSON(streetURL); + } + // else { + // console.log('[set-loader-from-hash]','Using default URL', this.data.defaultURL) + // this.el.setAttribute('streetmix-loader', 'streetmixStreetURL', this.data.defaultURL); + // } + }, + fetchJSON: function (requestURL) { + let sceneId = getUUIDFromPath(requestURL); + if (sceneId) { + console.log('sceneId from fetchJSON from url hash loader', sceneId); + AFRAME.scenes[0].setAttribute('metadata', 'sceneId', sceneId); + } + const request = new XMLHttpRequest(); + request.open('GET', requestURL, true); + request.onload = function () { + if (this.status >= 200 && this.status < 400) { + // Connection success + // remove 'set-loader-from-hash' component from json data + const jsonData = JSON.parse(this.response, + (key, value) => (key === 'set-loader-from-hash') ? undefined : value ); + + console.log('[set-loader-from-hash]', '200 response received and JSON parsed, now createElementsFromJSON'); + createElementsFromJSON(jsonData); + let sceneId = getUUIDFromPath(requestURL); + if (sceneId) { + console.log('sceneId from fetchJSON from url hash loader', sceneId); + AFRAME.scenes[0].setAttribute('metadata', 'sceneId', sceneId); + } + } + }; + request.onerror = function () { + // There was a connection error of some sort + console.log('Loading Error: There was a connection error during JSON loading'); + }; + request.send(); + } +}); + +function getUUIDFromPath(path) { + // UUID regex pattern: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} + const uuidPattern = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/; + + const match = path.match(uuidPattern); + if (match) { + return match[0]; + } + + return null; // return null or whatever default value you prefer if no UUID found +} + +// this use os text input prompt, delete current scene, then load streetmix file +function inputStreetmix() { + streetmixURL = prompt("Please enter a Streetmix URL", "https://streetmix.net/kfarr/3/example-street"); + setTimeout(function() { window.location.hash = streetmixURL; }); + streetContainerEl = document.getElementById('street-container'); + while (streetContainerEl.firstChild) { + streetContainerEl.removeChild(streetContainerEl.lastChild); + } + AFRAME.scenes[0].setAttribute('metadata', 'sceneId', ''); + AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', ''); + streetContainerEl.innerHTML = ''; +} + +// JSON loading starts here +function getValidJSON(stringJSON) { + // Preserve newlines, etc. - use valid JSON + // Remove non-printable and other non-valid JSON characters + return stringJSON.replace(/\'/g, "") + .replace(/\n/g, "") + .replace(/[\u0000-\u0019]+/g,""); +} + +function createElementsFromJSON(streetJSON) { + let streetObject = {}; + if (typeof streetJSON == 'string') { + const validJSONString = getValidJSON(streetJSON); + streetObject = JSON.parse(validJSONString); + } else if (typeof streetJSON == 'object') { + streetObject = streetJSON; + } + + let sceneTitle = streetObject.title; + if (sceneTitle) { + console.log('sceneTitle from createElementsFromJSON', sceneTitle); + AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', sceneTitle); + } + + streetContainerEl = document.getElementById('street-container'); + while (streetContainerEl.firstChild) { + streetContainerEl.removeChild(streetContainerEl.lastChild); + } + + createEntities(streetObject.data, streetContainerEl); + AFRAME.scenes[0].components['notify'].message('Scene loaded from JSON', 'success') +} + +// viewer widget click to paste json string of 3dstreet scene +function inputJSON() { + const stringJSON = prompt("Please paste 3DStreet JSON string"); + if (stringJSON) { + createElementsFromJSON(stringJSON); + } +} + +// handle viewer widget click to open 3dstreet json scene +function fileJSON() { + let reader=new FileReader(); + reader.onload=function(){ + AFRAME.scenes[0].setAttribute('metadata', 'sceneId', ''); + AFRAME.scenes[0].setAttribute('metadata', 'sceneTitle', ''); + createElementsFromJSON(reader.result); + } + reader.readAsText(this.files[0]); +} From 5937130ef3e8a79c1910e0eaafd24e2b091d5dd7 Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Sun, 10 Sep 2023 21:05:21 -0700 Subject: [PATCH 41/42] increase notyf font size, width, and time on screen https://github.com/3DStreet/3dstreet/issues/333 --- src/components/notify.js | 2 +- src/viewer-styles.css | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/notify.js b/src/components/notify.js index d6221f4c2..3acdc589d 100644 --- a/src/components/notify.js +++ b/src/components/notify.js @@ -3,7 +3,7 @@ var { Notyf } = require('../lib/notyf.min.js'); AFRAME.registerComponent('notify', { schema: { - duration: { type: 'number', default: 2000 }, + duration: { type: 'number', default: 6000 }, ripple: { type: 'boolean', default: true }, position: { type: 'string', diff --git a/src/viewer-styles.css b/src/viewer-styles.css index 754ad4ce3..0418d02d9 100644 --- a/src/viewer-styles.css +++ b/src/viewer-styles.css @@ -18,6 +18,14 @@ body { margin: 0; } +/* notification hack */ +.notyf__message { font-size: 20px !important; } + +/* notification width hack */ +.notyf__toast { + max-width: 66.66vw !important; /* 2/3rds of viewport width */ + width: auto !important; /* Resetting any specific width, if set */ +} /********* viewer header css *********/ From 717be035927fa35dc7e26a392fe8f3ed27433c0c Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Sun, 10 Sep 2023 21:08:49 -0700 Subject: [PATCH 42/42] npm run dist --- dist/aframe-street-component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/aframe-street-component.js b/dist/aframe-street-component.js index af19e4484..f044429d4 100644 --- a/dist/aframe-street-component.js +++ b/dist/aframe-street-component.js @@ -1,4 +1,4 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function S(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function M(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:2e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbG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lca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(()=>(()=>{var t={631:t=>{var e=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function i(t,i,n,a){const r=1/a,s=1/n;return e[0].set(r*i,s*t+s),e[1].set(r*i,s*t),e[2].set(r*i+r,s*t),e[3].set(r*i+r,s*t+s),e}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const t=this.data,e=i(t.row-1,t.column-1,t.totalRows,t.totalColumns),n=this.el.getObject3D("mesh").geometry;var a=new Float32Array([e[0].x,e[0].y,e[3].x,e[3].y,e[1].x,e[1].y,e[2].x,e[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(a,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const t=this.canvas=document.createElement("canvas");t.id=this.data.canvasId,t.height=this.data.canvasHeight,t.width=this.data.canvasWidth,this.ctx=t.getContext("2d"),document.body.appendChild(t),this.data.debug&&(t.style.left=0,t.style.top=0,t.style.position="fixed",t.style.zIndex=9999999999)},drawTexture:function(t,e,n,a,r){const s=this.canvas,o=this.data;t.complete||(t.onload=()=>{this.drawTexture(t,e,n)});const l=r||s.height/o.numRows,c=a||s.width/o.numColumns;return this.ctx.drawImage(t,c*e,c*n,c,l),i(e,n,o.numRows,o.numColumns)}}),t.exports.getGridUvs=i},844:(t,e,i)=>{function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||r(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){if(t){if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i3&&void 0!==arguments[3]?arguments[3]:2.25,a=h(e,"dividers-".concat(t,"-parent"));return d({objectMixinId:"dividers-".concat(t),parentEl:a,step:n,radius:i}),a}function g(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2.25,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"0 0 0",r=h(e,"".concat(t,"-parent"));return d({objectMixinId:t,parentEl:r,step:n,radius:i,rotation:a}),r}function y(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1)+t)}function b(t,e){return Math.random()*(e-t)+t}function x(t,e,i){var n=Math.floor((e-t)/i)+1;return Array(n).fill().map((function(e,n){return t+n*i})).sort((function(){return.5-Math.random()}))}function v(t,e,i,n){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"random",r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[-.37*e,.37*e],o=x(-.5*n,.5*n,1.5),l=parseInt({empty:0,sparse:.03,normal:.125,dense:.25}[i]*n,10),c=h(t,"pedestrians-parent"),d=0;d3&&void 0!==arguments[3]?arguments[3]:void 0,l=t.object3D,c=o||(n=l,a=(new THREE.Box3).setFromObject(n),{x:a.max.x-a.min.x,y:a.max.y-a.min.y,z:a.max.z-a.min.z})[e],d={start:-.5*(r=i)+.5*(s=c),end:.5*r-.5*s},u=d.start,m=d.end,p="set".concat(e.toUpperCase()),h=b(u,m);return l.position[p](h),h}function E(t,e,i,n,a){if(a){var r="inbound"===t[0]?0:180,s=document.createElement("a-entity");return s.setAttribute("class",e),s.setAttribute("position",i+" 0 0"),s.setAttribute("rotation","0 "+r+" 0"),s.setAttribute("mixin",e),s.addEventListener("model-loaded",(function(t){w(t.target,"z",n)}),{once:!0}),s}}function _(t,e,i,n){if(n){var a="inbound"===t[0]?0:180,r=document.createElement("a-entity"),s=document.createElement("a-entity");s.setAttribute("rotation","0 "+a+" 0"),s.setAttribute("mixin","bus");var o=w(s,"z",i,12);return s.setAttribute("position",e+" 0 "+o),r.append(s),r}}function k(t,e,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5?arguments[5]:void 0,s=i/e*1e3,o="outbound"===(arguments.length>6?arguments[6]:void 0)?-i/2:i/2,l=Math.abs(o-r)/e*1e3,c={property:"position",easing:"linear",loop:"false",from:{x:n,y:a,z:r},to:{z:o},dur:l},d={property:"position",easing:"linear",loop:"true",from:{x:n,y:a,z:-o},to:{x:n,y:a,z:o},delay:l,dur:s};return t.setAttribute("animation__1",c),t.setAttribute("animation__2",d),t}function C(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0;if(!(arguments.length>5&&void 0!==arguments[5])||arguments[5]){var l=0,c=a(t,3),d=c[0],u=c[1],m=c[2];2===t.length&&(m=u);var p,h={inbound:0,outbound:180,sideways:{left:-90,right:90},"angled-front-left":-60,"angled-front-right":60,"angled-rear-left":-120,"angled-rear-right":120};if(p="sideways"==d?h.sideways[u]:h[d],"pedestrian"===m)return v(e,i,"normal",n,d,r);var f=document.createElement("a-entity");if(1==t.length)return f;var g={car:{mixin:"sedan-rig",wheelDiameter:.76,length:5.17,width:2},microvan:{mixin:"suv-rig",wheelDiameter:.84,length:5,width:2},truck:{mixin:"box-truck-rig",wheelDiameter:1.05,length:6.95,width:2.5}};if(s>1){var y=n/2,b=o/2+o,A=x(-y+b,y-b,o).slice(0,s),E="sideways"==d||d.includes("angled")?"width":"length",_=g[m][E];A.forEach((function(t){var e=o-_-.2,i=-e/2+e*Math.random();e>0&&C(t+i,m)}))}else C();return f}function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=g[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"car"],a=document.createElement("a-entity");return t||(t=w(a,"z",n,i.length)),a.setAttribute("position","".concat(e," 0 ").concat(t)),a.setAttribute("mixin",i.mixin),a.setAttribute("rotation","0 ".concat(p," 0")),r&&(l=5,a.setAttribute("wheel",{speed:l,wheelDiameter:i.wheelDiameter}),k(a,l,n,e,0,t,u)),f.append(a),a}}function S(t,e,i){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="left"===t[0]?0:180;return a.setAttribute("position",e+" 0 0"),a.setAttribute("rotation","0 "+r+" 0"),a.setAttribute("mixin","food-trailer-rig"),a.addEventListener("model-loaded",(function(t){w(t.target,"z",i)}),{once:!0}),n.append(a),n}function M(t,e){if(e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("position",t+" 1.75 0"),n.setAttribute("rotation","0 0 0"),n.setAttribute("mixin","magic-carpet"),i.append(n);var a=document.createElement("a-entity");return a.setAttribute("position",t+" 1.75 0"),a.setAttribute("rotation","0 0 0"),a.setAttribute("mixin","Character_1_M"),i.append(a),i}}function R(t,e){var i=document.createElement("a-entity"),n=document.createElement("a-entity");n.setAttribute("mixin","outdoor_dining");var a=w(n,"z",e,2.27);return n.setAttribute("position",t+" 0 "+a),i.append(n),i}function N(t,e,i,n,a){if(a){var r=document.createElement("a-entity"),s=document.createElement("a-entity"),o="inbound"===t[0]?0:180;s.setAttribute("rotation","0 "+o+" 0"),"bike-lane"===i?s.setAttribute("mixin","Bicycle_1"):s.setAttribute("mixin","ElectricScooter_1");var l=w(s,"z",n,2.03);return s.setAttribute("position",e+" 0 "+l),r.append(s),r}}function j(t,e,i){if(!(arguments.length>3&&void 0!==arguments[3])||arguments[3]){var n=document.createElement("a-entity"),a=document.createElement("a-entity"),r="inbound"===t[1]?0:180;a.setAttribute("rotation","0 "+r+" 0"),"taxi"===t[0]?a.setAttribute("mixin","sedan-taxi"):"rideshare"===t[0]&&a.setAttribute("mixin","sedan-rig");var s=w(a,"z",i,5);return a.setAttribute("position",e+" 0 "+s),n.append(a),n}}function O(t){var e,i=document.createElement("a-entity");return(e=document.createElement("a-entity")).setAttribute("position",t+" 1 0"),e.setAttribute("mixin","wayfinding-box"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 0.06"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),(e=document.createElement("a-entity")).setAttribute("position",t+" 1.2 -0.06"),e.setAttribute("rotation","0 180 0"),e.setAttribute("geometry","primitive: plane; width: 0.8; height: 1.6"),e.setAttribute("material","src:#wayfinding-map"),i.append(e),i}function T(t){var e=document.createElement("a-entity");return e.setAttribute("class","bench-parent"),e.setAttribute("position",t+" 0.2 3.5"),e}function L(t){var e=document.createElement("a-entity");return e.setAttribute("class","bikerack-parent"),e.setAttribute("position",t+" 0 -3.5"),e}function I(t,e){var i=document.createElement("a-entity");i.setAttribute("class","bikeshare"),i.setAttribute("position",t+" 0 0"),i.setAttribute("mixin","bikeshare");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function P(t,e){var i=document.createElement("a-entity");i.setAttribute("class","parklet"),i.setAttribute("position",t+" .02 0"),i.setAttribute("mixin","parklet");var n="left"===e[0]?90:270;return i.setAttribute("rotation","0 "+n+" 0"),i}function z(t){var e=document.createElement("a-entity");return e.setAttribute("class","tree-parent"),e.setAttribute("position",t+" 0.2 7"),e}function D(t){var e=document.createElement("a-entity");return e.setAttribute("class","lamp-parent"),e.setAttribute("position",t+" 0.2 0"),e}function B(t,e){var i=document.createElement("a-entity");return i.setAttribute("class","bus-stop"),i.setAttribute("position",t+" 0 0"),i.setAttribute("rotation","0 "+e+" 0"),i.setAttribute("mixin","bus-stop"),i}function F(t){var e=document.createElement("a-entity");return e.setAttribute("class","brt-station"),e.setAttribute("position",t+" 0 0"),e.setAttribute("mixin","brt-station"),e}function H(t,e,i,n,a,r,s){var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=document.createElement("a-entity"),c=t+" "+r/150+" 1",d=t+" 1 1";return"sidewalk"===a||1===o?(l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):a.match("lane")?(i-=.1,l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.2"),l.setAttribute("geometry","depth",r),l.setAttribute("scale",d)):(l.setAttribute("rotation","270 "+n+" 0"),l.setAttribute("scale",c)),l.setAttribute("position",e+" "+i+" 0"),l.setAttribute("mixin",a),0!==s.length&&l.setAttribute("material","repeat: ".concat(s[0]," ").concat(s[1])),l}t.exports.processSegments=function(t,e,i,a,r){var s=i/2;i>12&&(s=(i-12)/2),e&&(t=function(t){function e(t){return"lane"===t.slice(t.length-4)||"light-rail"===t||"streetcar"===t||"flex-zone"===t}return t.reduce((function(t,i,n,a){if(0===n)return t.concat(i);var r=a[n-1];if(e(i.type)&&e(r.type)){var s="solid";i.type===r.type&&(s="dashed"),("drive-lane"===i.type&&"turn-lane"===r.type||"drive-lane"===r.type&&"turn-lane"===i.type)&&(s="dashed"),i.variantString.split("|")[0]!==r.variantString.split("|")[0]&&(s="doubleyellow","bike-lane"===i.type&&"bike-lane"===r.type&&(s="shortdashedyellow"),"flex-zone"!==i.type&&"flex-zone"!==r.type||(s="solid")),"turn-lane"===i.type&&"shared"===i.variantString.split("|")[1]?s="soliddashedyellow":"turn-lane"===r.type&&"shared"===r.variantString.split("|")[1]&&(s="soliddashedyellowinverted"),"parking-lane"!==i.type&&"parking-lane"!==r.type||(s="invisible"),t.push({type:"separator",variantString:s,width:0})}return(e(i.type)&&"divider"===r.type||e(r.type)&&"divider"===i.type)&&t.push({type:"separator",variantString:"solid",width:0}),t.push(i),t}),[])}(t));var h=function(t){var e=document.createElement("a-entity"),i=0-l.calcStreetWidth(t)/2;return e.setAttribute("position",i+" 0 0"),e}(t);h.classList.add("street-parent");for(var y,b=0,x=0;x{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),people:'\n \x3c!-- human characters --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"people-rigged":' \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),vehicles:'\n \x3c!-- vehicles --\x3e\n \n \n \n \x3c!-- micro mobility vehicles --\x3e\n \n \n \n '),"vehicles-rigged":'\n \x3c!-- vehicles rigged --\x3e\n \n \n \n \n \n \n '),buildings:'\n \x3c!-- blocks --\x3e\n \n \n \n\n \x3c!-- buildings and blocks --\x3e\n \n \n \n \n \n\n \x3c!-- suburban buildings --\x3e\n \n \n \n\n \x3c!-- arched style buildings --\x3e\n \n \n \n \n'),"intersection-props":'\n \n \n \n \n \n \n '),"segment-textures":' \n \x3c!-- segment mixins with textures --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n '),"segment-colors":' \n \x3c!-- segment color modifier mixins --\x3e\n \n \n \n ',"lane-separator":'\n \x3c!-- lane separator markings --\x3e\n \n \n \n \n \n \n \n \n '),stencils:' \n \x3c!-- stencil markings --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),"vehicles-transit":'\n \x3c!-- vehicles-transit --\x3e\n \n \n \n \n \n \n '),dividers:'\n \x3c!-- dividers --\x3e\n \n \n \n \n \n \n \n \n \n \n \n '),sky:'\n \x3c!-- sky --\x3e\n \n \n '),grounds:'\n \x3c!-- grounds --\x3e\n \n \n \n\n \n \n \n \n\n \n \n '),"loud-bicycle":'\n \x3c!-- loud-bicycle-game --\x3e\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ')};if(e){var n=e.split(" "),a=Object.keys(i).filter((function(t){return n.includes(t)})),r="";for(var s in i)a.includes(s)&&(r+=i[s]);return r}return Object.values(i).join("")}(e,t)),AFRAME.ANode.prototype.load.call(this)}}])&&e(a.prototype,r),s&&e(a,s),l}();customElements.define("street-assets",r);document.addEventListener("DOMSubtreeModified",(function t(e){if("A-SCENE"===e.target.nodeName){var i=e.target.querySelector("a-assets");if(i||(i=document.createElement("a-assets"),e.target.append(i)),i.querySelector("street-assets"))document.removeEventListener("DOMSubtreeModified",t);else{var n=document.createElement("street-assets");i.append(n),document.removeEventListener("DOMSubtreeModified",t)}}}),!1)},51:()=>{AFRAME.registerComponent("anisotropy",{schema:{default:0},dependencies:["material","geometry"],init:function(){var t=this;this.maxAnisotropy=this.el.sceneEl.renderer.capabilities.getMaxAnisotropy(),["model-loaded","materialtextureloaded"].forEach((function(e){return t.el.addEventListener(e,(function(){var e=t.el.getObject3D("mesh"),i=t.data;0===(i=+i||0)&&(i=t.maxAnisotropy),e.traverse((function(t){!0===t.isMesh&&null!==t.material.map&&(t.material.map.anisotropy=i,t.material.map.needsUpdate=!0)}))}),!1)}))}})},391:(t,e,i)=>{var n=i(334);AFRAME.registerComponent("create-from-json",{schema:{jsonString:{type:"string",default:""}},update:function(t){var e=this.data,i=this.el;if(t.string&&e.string!==t.string)for(;i.firstChild;)i.removeChild(i.lastChild);n.appendChildElementsFromArray(JSON.parse(e.jsonString),i)}})},71:()=>{var t={},e={};AFRAME.registerComponent("gltf-part",{schema:{buffer:{default:!0},part:{type:"string"},src:{type:"asset"}},init:function(){this.dracoLoader=document.querySelector("a-scene").systems["gltf-model"].getDRACOLoader()},update:function(){var t=this.el;!this.data.part&&this.data.src||this.getModel((function(e){e&&t.setObject3D("mesh",e)}))},getModel:function(i){var n=this;if(!e[this.data.src])return t[this.data.src]?t[this.data.src].then((function(t){i(n.selectFromModel(t))})):void(t[this.data.src]=new Promise((function(a){var r=new THREE.GLTFLoader;n.dracoLoader&&r.setDRACOLoader(n.dracoLoader),r.load(n.data.src,(function(r){var s=r.scene||r.scenes[0];e[n.data.src]=s,delete t[n.data.src],i(n.selectFromModel(s)),a(s)}),(function(){}),console.error)})));i(this.selectFromModel(e[this.data.src]))},selectFromModel:function(t){var e,i;if(i=t.getObjectByName(this.data.part))return e=i.getObjectByProperty("type","Mesh").clone(!0),this.data.buffer?(e.geometry=e.geometry.toNonIndexed(),e):(e.geometry=(new THREE.Geometry).fromBufferGeometry(e.geometry),e);console.error("[gltf-part] `"+this.data.part+"` not found in model.")}})},247:(t,e,i)=>{var n=i(502).Notyf;AFRAME.registerComponent("notify",{schema:{duration:{type:"number",default:6e3},ripple:{type:"boolean",default:!0},position:{type:"string",default:{x:"center",y:"bottom"}},dismissible:{type:"boolean",default:!1},type:{type:"string",default:"info"},message:{type:"string",default:""}},init:function(){this.notify=new n({types:[{type:"info",background:"blue",icon:!1}],duration:this.data.duration,ripple:this.data.ripple,position:this.data.position,dismissible:this.data.dismissible}),this.types=this.notify.options.types.map((function(t){return t.type}))},message:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";t&&this.types.includes(e)&&this.notify.open({type:e,message:t})},update:function(t){if(0!==Object.keys(t).length){var e=this.data.message,i=this.data.type;e&&this.types.includes(i)&&(this.message(e,i),this.data.message="")}}})},699:()=>{takeScreenshotNow=function(t,e,i){var n=AFRAME.scenes[0].renderer;function a(t,e){var i=document.createElement("a"),n=e.replace(/^data:image\/[^;]/,"data:application/octet-stream");i.setAttribute("href",n),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}var r=t+"."+e;"img"!=e?a(r,"png"==e?n.domElement.toDataURL("image/png"):n.domElement.toDataURL("image/jpeg",.95)):i.src=n.domElement.toDataURL()},AFRAME.registerComponent("screentock",{schema:{takeScreenshot:{type:"boolean",default:!1},filename:{type:"string",default:"screenshot"},type:{type:"string",default:"jpg"},imgElementSelector:{type:"selector"}},tock:function(){this.data.takeScreenshot&&(this.el.setAttribute("screentock","takeScreenshot",!1),takeScreenshotNow(this.data.filename,this.data.type,this.data.imgElementSelector))}})},54:function(t,e,i){var n,a,r,s;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}t=i.nmd(t),s=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==o(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("cursor-teleport",{schema:{cameraHead:{type:"selector",default:""},cameraRig:{type:"selector",default:""},collisionEntities:{type:"string",default:""},ignoreEntities:{type:"string",default:""},landingMaxAngle:{default:45,min:0,max:360},landingNormal:{type:"vec3",default:{x:0,y:1,z:0}},transitionSpeed:{type:"number",default:6e-4}},init:function(){var t=this;this.mobile=AFRAME.utils.device.isMobile();var e=this.el.sceneEl;this.canvas=e.renderer.domElement,this.data.cameraHead.object3D.traverse((function(e){e instanceof THREE.Camera&&(t.cam=e)})),this.camRig=this.data.cameraRig.object3D,this.rayCaster=new THREE.Raycaster,this.referenceNormal=new THREE.Vector3,this.rayCastObjects=[],this.referenceNormal.copy(this.data.landingNormal);var i=new THREE.RingGeometry(.25,.3,32,1);i.rotateX(-Math.PI/2),i.translate(0,.02,0);var n=new THREE.MeshBasicMaterial({color:7818734}),a=new THREE.Mesh(i,n),r=new THREE.CylinderGeometry(.3,.3,.5,32,1,!0);r.translate(0,.25,0);var s=(new THREE.TextureLoader).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAQCAYAAADXnxW3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQL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pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAADJJREFUeNpEx7ENgDAAAzArK0JA6f8X9oewlcWStU1wBGdwB08wgjeYm79jc2nbYH0DAC/+CORJxO5fAAAAAElFTkSuQmCC"),o=new THREE.MeshBasicMaterial({color:7818734,side:"double",map:s,transparent:!0,depthTest:!1}),l=new THREE.Mesh(r,o),c=new THREE.Group;c.add(a),c.add(l),this.teleportIndicator=c,e.object3D.add(this.teleportIndicator),this.transitioning=!1,this.transitionProgress=0,this.transitionCamPosStart=new THREE.Vector3,this.transitionCamPosEnd=new THREE.Vector3,this.updateRaycastObjects=this.updateRaycastObjects.bind(this),this.getMouseState=this.getMouseState.bind(this),this.getTeleportPosition=this.getTeleportPosition.bind(this),this.isValidNormalsAngle=this.isValidNormalsAngle.bind(this),this.transition=this.transition.bind(this),this.mouseMove=this.mouseMove.bind(this),this.mouseDown=this.mouseDown.bind(this),this.mouseUp=this.mouseUp.bind(this),this.easeInOutQuad=this.easeInOutQuad.bind(this),this.updateRaycastObjects()},remove:function(){this.cam=null,this.canvas=null,this.rayCastObjects.length=0,this.el.sceneEl.object3D.remove(this.teleportIndicator),this.teleportIndicator.children[0].material.dispose(),this.teleportIndicator.children[0].geometry.dispose(),this.teleportIndicator.children[1].material.dispose(),this.teleportIndicator.children[1].geometry.dispose(),this.teleportIndicator=null,this.collisionMesh&&(this.collisionMesh.geometry.dispose(),this.collisionMesh.material.dispose(),this.collisionMesh=null)},play:function(){var t=this.canvas;t.addEventListener("mousedown",this.mouseDown,!1),t.addEventListener("mousemove",this.mouseMove,!1),t.addEventListener("mouseup",this.mouseUp,!1),t.addEventListener("touchstart",this.mouseDown,!1),t.addEventListener("touchmove",this.mouseMove,!1),t.addEventListener("touchend",this.mouseUp,!1)},pause:function(){var t=this.canvas;t.removeEventListener("mousedown",this.mouseDown),t.removeEventListener("mousemove",this.mouseMove),t.removeEventListener("mouseup",this.mouseUp),t.removeEventListener("touchstart",this.mouseDown),t.removeEventListener("touchmove",this.mouseMove),t.removeEventListener("touchend",this.mouseUp)},updateRaycastObjects:function(){var t=this;if(this.rayCastObjects.length=0,""!==this.data.collisionEntities)this.el.sceneEl.querySelectorAll(this.data.collisionEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&(e.userData.collision=!0,t.rayCastObjects.push(e))}))}));else{if(!this.collisionMesh){var e=new THREE.PlaneGeometry(500,500,1);e.rotateX(-Math.PI/2);var i=new THREE.MeshNormalMaterial,n=new THREE.Mesh(e,i);n.userData.collision=!0,this.collisionMesh=n}this.rayCastObjects.push(this.collisionMesh)}""!==this.data.ignoreEntities&&this.el.sceneEl.querySelectorAll(this.data.ignoreEntities).forEach((function(e){e.object3D.traverse((function(e){e.isMesh&&t.rayCastObjects.push(e)}))}))},getMouseState:function(){var t=new THREE.Vector2;return function(e){var i=this.canvas.getBoundingClientRect();return null!=e.clientX?(t.x=e.clientX-i.left,t.y=e.clientY-i.top,t):null!=e.touches[0]?(t.x=e.touches[0].clientX-i.left,t.y=e.touches[0].clientY-i.top,t):void 0}}(),getTeleportPosition:function(){var t=new THREE.Vector2;return function(e,i){if(0!==this.rayCastObjects.length){if(this.cam&&this.canvas){var n=this.cam,a=this.canvas.getBoundingClientRect();t.x=e/(a.right-a.left)*2-1,t.y=-i/(a.bottom-a.top)*2+1,this.rayCaster.setFromCamera(t,n);var r=this.rayCaster.intersectObjects(this.rayCastObjects);return!(0===r.length||!this.isValidNormalsAngle(r[0].face.normal))&&!0===r[0].object.userData.collision&&r[0].point}return!1}return!1}}(),isValidNormalsAngle:function(t){var e=this.referenceNormal.angleTo(t);return THREE.MathUtils.RAD2DEG*e<=this.data.landingMaxAngle},transition:function(t){this.transitionProgress=0,this.transitionCamPosEnd.copy(t),this.transitionCamPosStart.copy(this.camRig.position),this.transitioning=!0},mouseMove:function(t){var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y},mouseDown:function(t){this.updateRaycastObjects();var e=this.getMouseState(t);this.mouseX=e.x,this.mouseY=e.y,this.mouseXOrig=e.x,this.mouseYOrig=e.y},mouseUp:function(t){if(this.mouseX===this.mouseXOrig&&this.mouseY===this.mouseYOrig){var e=this.getTeleportPosition(this.mouseX,this.mouseY);e&&(this.teleportIndicator.position.copy(e),this.transition(e))}},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},tick:function(t,e){if(!this.transitioning&&!this.mobile){var i=this.getTeleportPosition(this.mouseX,this.mouseY);i&&this.teleportIndicator.position.copy(i)}if(this.transitioning){this.transitionProgress+=e*this.data.transitionSpeed;var n=this.easeInOutQuad(this.transitionProgress),a=n<.5?n:1.5-1*(n+.5);this.teleportIndicator.scale.set(1+a,1,1+a);var r=this.camRig.position;r.x=this.transitionCamPosStart.x+(this.transitionCamPosEnd.x-this.transitionCamPosStart.x)*n,r.y=this.transitionCamPosStart.y+(this.transitionCamPosEnd.y-this.transitionCamPosStart.y)*n,r.z=this.transitionCamPosStart.z+(this.transitionCamPosEnd.z-this.transitionCamPosStart.z)*n,this.transitionProgress>=1&&(this.transitioning=!1,r.copy(this.transitionCamPosEnd))}}})}])},"object"==o(e)&&"object"==o(t)?t.exports=s():(a=[],void 0===(r="function"==typeof(n=s)?n.apply(e,a):n)||(t.exports=r))},475:t=>{var e={once:THREE.LoopOnce,repeat:THREE.LoopRepeat,pingpong:THREE.LoopPingPong};function i(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}t.exports=AFRAME.registerComponent("animation-mixer",{schema:{clip:{default:"*"},duration:{default:0},clampWhenFinished:{default:!1,type:"boolean"},crossFadeDuration:{default:0},loop:{default:"repeat",oneOf:Object.keys(e)},repetitions:{default:1/0,min:0},timeScale:{default:1},startAt:{default:0}},init:function(){var t=this;this.model=null,this.mixer=null,this.activeActions=[];var e=this.el.getObject3D("mesh");e?this.load(e):this.el.addEventListener("model-loaded",(function(e){t.load(e.detail.model)}))},load:function(t){var e=this.el;this.model=t,this.mixer=new THREE.AnimationMixer(t),this.mixer.addEventListener("loop",(function(t){e.emit("animation-loop",{action:t.action,loopDelta:t.loopDelta})})),this.mixer.addEventListener("finished",(function(t){e.emit("animation-finished",{action:t.action,direction:t.direction})})),this.data.clip&&this.update({})},remove:function(){this.mixer&&this.mixer.stopAllAction()},update:function(t){if(t){var i=this.data,n=AFRAME.utils.diff(i,t);if("clip"in n)return this.stopAction(),void(i.clip&&this.playAction());this.activeActions.forEach((function(t){"duration"in n&&i.duration&&t.setDuration(i.duration),"clampWhenFinished"in n&&(t.clampWhenFinished=i.clampWhenFinished),("loop"in n||"repetitions"in n)&&t.setLoop(e[i.loop],i.repetitions),"timeScale"in n&&t.setEffectiveTimeScale(i.timeScale)}))}},stopAction:function(){for(var t=this.data,e=0;e{"use strict";function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var n,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;i.setAttribute("streetmix-loader","name",a),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:a[0],y:-.1,z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b{t.exports.isSidewalk=function(t){return t.startsWith("sidewalk")||["utilities","scooter-drop-zone","bikeshare","flex-zone-curb","transit-shelter","brt-station"].includes(t)},t.exports.createBuildingsArray=function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:150,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"narrow";if("narrow"===n||"wide"===n)t=[{id:"SM3D_Bld_Mixed_4fl",width:5.251},{id:"SM3D_Bld_Mixed_Double_5fl",width:10.9041},{id:"SM3D_Bld_Mixed_4fl_2",width:5.309},{id:"SM3D_Bld_Mixed_5fl",width:5.903},{id:"SM3D_Bld_Mixed_Corner_4fl",width:5.644}],e="41431323432402434130303230234102402341";else if("residential"===n)t=[{id:"SM_Bld_House_Preset_03_1800",width:20},{id:"SM_Bld_House_Preset_08_1809",width:20},{id:"SM_Bld_House_Preset_09_1845",width:20}],e="12021201210101212021201012012021201210";else{if("arcade"!==n)return[];t=[{id:"arched-building-01",width:9.191},{id:"arched-building-02",width:11.19},{id:"arched-building-03",width:13.191},{id:"arched-building-04",width:15.191}],e="03120223130210321203123023103201232013"}for(var a=0,r=0,s=[];r{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0&&void 0!==arguments[0]?arguments[0]:{},i=document.createElement(t.tag);delete t.tag;for(var n=0,a=Object.entries(t);n1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e,i){t.appendChild(n(e))})),t}},394:t=>{t.exports.streetmixUserToAPI=function(t){var e=new URL(t).pathname.split("/"),i=e[1],n=e[2];return"-"===i?"https://streetmix.net/api/v1/streets?namespacedId="+n:"https://streetmix.net/api/v1/streets?namespacedId="+n+"&creatorId="+i},t.exports.pathStartsWithAPI=function(t){var e=document.createElement("a");return e.href=t,"api"===e.pathname.split("/")[1]},t.exports.streetmixAPIToUser=function(t){function e(t,e){for(var i=t.split("&"),n=0;n(t.paths=[],t.children||(t.children=[]),t);return(()=>{function t(t,i){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}return i}(t,i)||function(t,i){if(!t)return;if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=200&&this.status<400){var t=JSON.parse(this.response),n=t.data.street.segments,a=t.name;console.log("streetmixName",a),i.setAttribute("streetmix-loader","name",a),AFRAME.scenes[0].getAttribute("metadata").sceneTitle||(AFRAME.scenes[0].setAttribute("metadata","sceneTitle",a),console.log("therefore setting metadata sceneTitle as streetmixName",a)),e.showBuildings&&(i.setAttribute("street","right",t.data.street.rightBuildingVariant),i.setAttribute("street","left",t.data.street.leftBuildingVariant)),i.setAttribute("street","type","streetmixSegmentsFeet"),i.setAttribute("street","JSON",JSON.stringify({streetmixSegmentsFeet:n})),i.emit("streetmix-loader-street-loaded")}else console.log("[streetmix-loader]","Loading Error: We reached the target server, but it returned an error")},n.onerror=function(){console.log("[streetmix-loader]","Loading Error: There was a connection error of some sort")},n.send()}else{if(e.streetmixStreetURL.length>0){var r=a.streetmixUserToAPI(e.streetmixStreetURL);return console.log("[streetmix-loader]","setting `streetmixAPIURL` to",r),void i.setAttribute("streetmix-loader","streetmixAPIURL",r)}console.log("[streetmix-loader]","Neither `streetmixAPIURL` nor `streetmixStreetURL` properties provided, please provide at least one.")}}}),AFRAME.registerComponent("intersection",{schema:{dimensions:{type:"string",default:"20 20"},sidewalk:{type:"string",default:"0 0 0 0"},northeastcurb:{type:"string",default:"0 0"},southwestcurb:{type:"string",default:"0 0"},southeastcurb:{type:"string",default:"0 0"},northwestcurb:{type:"string",default:"0 0"},stopsign:{type:"string",default:"0 0 0 0"},trafficsignal:{type:"string",default:"0 0 0 0"},crosswalk:{type:"string",default:"0 0 0 0"}},init:function(){for(var e=this.data,i=this.el;i.firstChild;)i.removeChild(i.lastChild);var n=e.dimensions.split(" ").map((function(t){return Number(t)})),a=[this.el.getAttribute("position").x,this.el.getAttribute("position").y,this.el.getAttribute("position").z],r=e.sidewalk.split(" ").map((function(t){return Number(t)})),s=e.northeastcurb.split(" ").map((function(t){return Number(t)})),o=e.southwestcurb.split(" ").map((function(t){return Number(t)})),l=e.southeastcurb.split(" ").map((function(t){return Number(t)})),c=e.northwestcurb.split(" ").map((function(t){return Number(t)})),d=e.stopsign.split(" ").map((function(t){return Number(t)})),u=e.trafficsignal.split(" ").map((function(t){return Number(t)})),m=e.crosswalk.split(" ").map((function(t){return Number(t)})),p=n[0],h=n[1];function f(t){var e=t.length,n=t.width,a=t.positionVec,r=t.scaleVec,s=void 0===r?{x:1,y:1,z:1}:r,o=t.rotationVec,l=document.createElement("a-entity"),c=[];c[0]=n/2,c[1]=parseInt(e/2),l.setAttribute("geometry","primitive","box"),l.setAttribute("geometry","height: 0.4"),l.setAttribute("position",a),l.setAttribute("scale",s),l.setAttribute("geometry","depth",e),l.setAttribute("geometry","width",n),l.setAttribute("rotation",o),l.setAttribute("mixin","sidewalk"),l.setAttribute("material","repeat: ".concat(c[0]," ").concat(c[1])),i.appendChild(l)}this.el.setAttribute("geometry","primitive:box; width: ".concat(p,"; height: ").concat(h,"; depth:0.2")),this.el.setAttribute("position",{x:a[0],y:-.1,z:a[2]}),this.el.setAttribute("rotation","-90 0 0"),this.el.setAttribute("material","src: #asphalt-texture; repeat:5 5; roughness:1");var g={west:{positionVec:{x:p/2-r[0]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[0]},east:{positionVec:{x:-p/2+r[1]/2,z:.1},rotationVec:{x:90,y:0,z:0},length:h,width:r[1]},north:{positionVec:{y:-h/2+r[2]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[2]},south:{positionVec:{y:h/2-r[3]/2,x:r[1]/2-r[0]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:p-r[1]-r[0],width:r[3]}};Object.keys(g).filter((function(t,e){return r[e]})).forEach((function(t,e){f(g[t])}));for(var y={northeast:{positionVec:{x:p/2-s[0]/2,y:h/2-s[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:s[0],width:s[1]},southwest:{positionVec:{x:-p/2+o[0]/2,y:-h/2+o[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:o[0],width:o[1]},southeast:{positionVec:{x:p/2-l[0]/2,y:-h/2+l[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:l[0],width:l[1]},northwest:{positionVec:{x:-p/2+c[0]/2,y:h/2-c[1]/2,z:.1},rotationVec:{x:0,y:90,z:-90},length:c[0],width:c[1]}},b=0,x=Object.entries(y);b