waygo-maps 1.0.78 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -592,7 +592,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
592
592
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
593
593
 
594
594
  "use strict";
595
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/DirectionsView/DirectionsView */ \"./src/components/DirectionsView/DirectionsView.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _components_DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/DirectionsView/StepsView */ \"./src/components/DirectionsView/StepsView.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\nvar DirectionsControl = /*#__PURE__*/function (_Control) {\n function DirectionsControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsControl);\n _this = _callSuper(this, DirectionsControl, [options]);\n _this.directionsView = null;\n _this.stepsView = null;\n _this.map = null;\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSearchApi();\n _this.startContentPlacement = null;\n _this.endContentPlacement = null;\n return _this;\n }\n _inherits(DirectionsControl, _Control);\n return _createClass(DirectionsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'directions-control-container';\n this.directionsView = new _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.stepsView = new _components_DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n this.container.appendChild(this.directionsView.getElement());\n this.initializeEventListeners();\n this.createDirectionsLineLayer();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(DirectionsControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n // this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n\n this.directionsView.on('getStartSuggestions', this._handleGettingStartSearchBarSuggestions.bind(this));\n this.directionsView.on('getEndSuggestions', this._handleGettingEndSearchBarSuggestions.bind(this));\n this.directionsView.on('initiate:findPath', this._handleIntiateFindPath.bind(this));\n // this.directionsView.on('initiate:changeLeg', this._handleLegChange.bind(this));\n this.directionsView.on('selectedStartContentPlacement', this._handleStartContentPlacementSelected.bind(this));\n this.directionsView.on('selectedEndContentPlacement', this._handleEndContentPlacementSelected.bind(this));\n this.stepsView.on('legSelect', this._handleLegChange.bind(this));\n }\n }, {\n key: \"_handleEndContentPlacementSelected\",\n value: function _handleEndContentPlacementSelected(data) {\n var endContentPlacement = data.endContentPlacement;\n this.endContentPlacement = endContentPlacement;\n var _convertVertexToCoord = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__.convertVertexToCoordinate)(endContentPlacement.location, null, 30.0),\n lat = _convertVertexToCoord.lat,\n lon = _convertVertexToCoord.lon;\n var coordinate = [lon, lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.content) {\n if (endContentPlacement.content.title_key) {\n var titleKey = endContentPlacement.content.title_key;\n var title = endContentPlacement.content.data[titleKey];\n endContentPlacement.name = title;\n }\n }\n }\n endContentPlacement._floor = endContentPlacement.floor;\n this.map.addSelectedFeature(coordinate, endContentPlacement);\n }\n }, {\n key: \"_handleStartContentPlacementSelected\",\n value: function _handleStartContentPlacementSelected(data) {\n var startContentPlacement = data.startContentPlacement;\n this.startContentPlacement = startContentPlacement;\n var _convertVertexToCoord2 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__.convertVertexToCoordinate)(startContentPlacement.location, null, 30.0),\n lat = _convertVertexToCoord2.lat,\n lon = _convertVertexToCoord2.lon;\n var coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.content) {\n if (startContentPlacement.content.title_key) {\n var titleKey = startContentPlacement.content.title_key;\n var title = startContentPlacement.content.data[titleKey];\n startContentPlacement.name = title;\n }\n }\n }\n startContentPlacement._floor = startContentPlacement.floor;\n this.map.clearHighlightedContentLayer();\n this.map.addHighlightedFeature(coordinate, startContentPlacement);\n }\n }, {\n key: \"_handleLegChange\",\n value: function _handleLegChange(data) {\n var index = data.index;\n if (!this.directionsView || !this.pathData) {\n return;\n }\n this.updateMapForPathLeg(this.pathData.legs[index]);\n }\n }, {\n key: \"_handleGettingStartSearchBarSuggestions\",\n value: function () {\n var _handleGettingStartSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (this.directionsView) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\");\n case 2:\n query = data.query;\n currentSearch = ++this.directionsView.startSearchBox.searchCount;\n if (!(query === '')) {\n _context.next = 7;\n break;\n }\n this.directionsView.startSearchBox.searchBarSuggestionsView.updateResults([]);\n return _context.abrupt(\"return\");\n case 7:\n if (this.map.mapData) {\n _context.next = 9;\n break;\n }\n return _context.abrupt(\"return\");\n case 9:\n skip = 0;\n limit = 5;\n _context.prev = 11;\n _context.next = 14;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 14:\n results = _context.sent;\n if (currentSearch === this.directionsView.startSearchBox.searchCount) {\n this.directionsView.startSearchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context.next = 21;\n break;\n case 18:\n _context.prev = 18;\n _context.t0 = _context[\"catch\"](11);\n if (axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].isCancel(_context.t0)) {\n console.error('Request canceled:', _context.t0.message);\n } else {\n console.error('Search error:', _context.t0);\n }\n case 21:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[11, 18]]);\n }));\n function _handleGettingStartSearchBarSuggestions(_x) {\n return _handleGettingStartSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingStartSearchBarSuggestions;\n }()\n }, {\n key: \"_handleGettingEndSearchBarSuggestions\",\n value: function () {\n var _handleGettingEndSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (this.directionsView) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt(\"return\");\n case 2:\n query = data.query;\n currentSearch = ++this.directionsView.endSearchBox.searchCount;\n if (!(query === '')) {\n _context2.next = 7;\n break;\n }\n this.directionsView.endSearchBox.searchBarSuggestionsView.updateResults([]);\n return _context2.abrupt(\"return\");\n case 7:\n if (this.map.mapData) {\n _context2.next = 9;\n break;\n }\n return _context2.abrupt(\"return\");\n case 9:\n skip = 0;\n limit = 5;\n _context2.prev = 11;\n _context2.next = 14;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 14:\n results = _context2.sent;\n if (currentSearch === this.directionsView.endSearchBox.searchCount) {\n this.directionsView.endSearchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context2.next = 21;\n break;\n case 18:\n _context2.prev = 18;\n _context2.t0 = _context2[\"catch\"](11);\n if (axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].isCancel(_context2.t0)) {\n console.error('Request canceled:', _context2.t0.message);\n } else {\n console.error('Search error:', _context2.t0);\n }\n case 21:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[11, 18]]);\n }));\n function _handleGettingEndSearchBarSuggestions(_x2) {\n return _handleGettingEndSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingEndSearchBarSuggestions;\n }()\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.directionsView) {\n return;\n }\n this.container.innerHTML = \"\";\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n this.container.appendChild(this.stepsView.getElement());\n // this.element.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.directionsView) {\n return;\n }\n this.container.innerHTML = \"\";\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n this.container.appendChild(this.stepsView.getElement());\n // this.element.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"createDirectionsLineLayer\",\n value: function createDirectionsLineLayer() {\n this.map.map.addSource('directionsLineSource', {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n }\n });\n\n // Add a new layer for the line\n this.map.map.addLayer({\n 'id': 'directionsLineLayer',\n 'type': 'line',\n 'source': 'directionsLineSource',\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': '#333333',\n 'line-width': 8\n // 'line-blur': 0.9\n }\n });\n\n // this.map.map.moveLayer('directionsLineLayer', 'off-limits');\n // this.map.map.moveLayer('directionsLineLayer', '0-tertiary-area');\n this.map.map.moveLayer('directionsLineLayer', 'FIRST_ELEVATED_FEATURE');\n }\n }, {\n key: \"updateMapForPathLeg\",\n value: function updateMapForPathLeg(leg) {\n this.clearLineData();\n var points = [];\n leg.steps.forEach(function (step, index) {\n points.push.apply(points, _toConsumableArray(index === 0 ? step.path : step.path.slice(1)));\n // console.log(`Step ${index} path: ${leg.steps.length}`);\n // if (index === 0) {\n // points.push(...step.path);\n // } else {\n // points.push(step.path[1]);\n // }\n });\n\n // else if (index === leg.steps.length - 1) {\n // console.log('last step', step.path);\n // points.push(step.path[1]);\n // points.push(step.path[2]);\n // }\n\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__.convertVerticesToCoordinates)(points, null, 30.0);\n console.log(coordinates);\n this._updateMapLineData(coordinates, leg.floor);\n var currentFloor = this.map.getCurrentFloor();\n if (currentFloor !== leg.floor) {\n this.map.updateFloor(leg.floor, false);\n }\n }\n }, {\n key: \"_updateMapLineData\",\n value: function _updateMapLineData(newCoordinates, floor) {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {\n '_floor': floor\n },\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': newCoordinates\n }\n });\n var bounds = new mapboxgl.LngLatBounds();\n newCoordinates.forEach(function (coordinate) {\n bounds.extend(coordinate);\n });\n if (this.currentViewType === 'desktop') {\n this.map.map.fitBounds(bounds, _defineProperty(_defineProperty(_defineProperty({\n padding: 200\n }, \"padding\", {\n top: 200,\n bottom: 200,\n left: 500,\n right: 150\n }), \"maxZoom\", 15), \"duration\", 1000));\n } else {\n this.map.map.fitBounds(bounds, {\n // padding: 200, // Add padding around the edges of the map\n padding: {\n top: 400,\n bottom: 60,\n left: 80,\n right: 100\n },\n maxZoom: 14,\n // Optional: Limit the maximum zoom level\n duration: 1000 // Optional: Animation duration in milliseconds\n });\n }\n }\n }, {\n key: \"clearLineData\",\n value: function clearLineData() {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n });\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n // this.clearLineData();\n this.clearData();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hide();\n // this.clearLineData();\n this.clearData();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.hide();\n this.directionsView.updateView(null, null);\n // this.clearLineData();\n this.clearData();\n // this.map.clearSelectedContentLayer();\n this.map.clearHighlightedContentLayer();\n }\n }, {\n key: \"clearData\",\n value: function clearData() {\n this.pathData = null;\n this.clearLineData();\n this.stepsView.clear();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n var startContentPlacement = data.startContentPlacement,\n endContentPlacement = data.endContentPlacement;\n this.clearData();\n // this._initialize();\n this.show();\n // this.clearLineData();\n this.directionsView.updateView(startContentPlacement, endContentPlacement);\n if (endContentPlacement) {\n var _convertVertexToCoord3 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__.convertVertexToCoordinate)(endContentPlacement.location, null, 30.0),\n lat = _convertVertexToCoord3.lat,\n lon = _convertVertexToCoord3.lon;\n var coordinate = [lon, lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.content) {\n if (endContentPlacement.content.title_key) {\n var titleKey = endContentPlacement.content.title_key;\n var title = endContentPlacement.content.data[titleKey];\n endContentPlacement.name = title;\n }\n }\n }\n endContentPlacement._floor = endContentPlacement.floor;\n this.map.addSelectedFeature(coordinate, endContentPlacement);\n }\n }\n }, {\n key: \"_handleIntiateFindPath\",\n value: function () {\n var _handleIntiateFindPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {\n var startContentPlacementId, endContentPlacementId;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n startContentPlacementId = data.startContentPlacementId, endContentPlacementId = data.endContentPlacementId;\n _context3.next = 3;\n return this.map.findPath(startContentPlacementId, endContentPlacementId);\n case 3:\n this.pathData = _context3.sent;\n this.directionsView.setNewPath(this.pathData);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false);\n } else {\n this.stepsView.setNewPath(this.pathData);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _handleIntiateFindPath(_x3) {\n return _handleIntiateFindPath2.apply(this, arguments);\n }\n return _handleIntiateFindPath;\n }()\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function _handleSelectDirectionsButton(data) {\n var placementId = data.placementId;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n return;\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/DirectionsControl.js?");
595
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/DirectionsView/DirectionsView */ \"./src/components/DirectionsView/DirectionsView.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _components_DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/DirectionsView/StepsView */ \"./src/components/DirectionsView/StepsView.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\nvar DirectionsControl = /*#__PURE__*/function (_Control) {\n function DirectionsControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsControl);\n _this = _callSuper(this, DirectionsControl, [options]);\n _this.directionsView = null;\n _this.stepsView = null;\n _this.map = null;\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSearchApi();\n _this.startContentPlacement = null;\n _this.endContentPlacement = null;\n return _this;\n }\n _inherits(DirectionsControl, _Control);\n return _createClass(DirectionsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'directions-control-container';\n this.directionsView = new _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.stepsView = new _components_DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n this.container.appendChild(this.directionsView.getElement());\n this.initializeEventListeners();\n this.createDirectionsLineLayer();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(DirectionsControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n // this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n\n this.directionsView.on('getStartSuggestions', this._handleGettingStartSearchBarSuggestions.bind(this));\n this.directionsView.on('getEndSuggestions', this._handleGettingEndSearchBarSuggestions.bind(this));\n this.directionsView.on('initiate:findPath', this._handleIntiateFindPath.bind(this));\n // this.directionsView.on('initiate:changeLeg', this._handleLegChange.bind(this));\n this.directionsView.on('selectedStartContentPlacement', this._handleStartContentPlacementSelected.bind(this));\n this.directionsView.on('selectedEndContentPlacement', this._handleEndContentPlacementSelected.bind(this));\n this.stepsView.on('legSelect', this._handleLegChange.bind(this));\n }\n }, {\n key: \"_handleEndContentPlacementSelected\",\n value: function _handleEndContentPlacementSelected(data) {\n var endContentPlacement = data.endContentPlacement;\n this.endContentPlacement = endContentPlacement;\n var _convertVertexToCoord = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__.convertVertexToCoordinate)(endContentPlacement.location, null, 30.0),\n lat = _convertVertexToCoord.lat,\n lon = _convertVertexToCoord.lon;\n var coordinate = [lon, lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.content) {\n if (endContentPlacement.content.title_key) {\n var titleKey = endContentPlacement.content.title_key;\n var title = endContentPlacement.content.data[titleKey];\n endContentPlacement.name = title;\n }\n }\n }\n endContentPlacement._floor = endContentPlacement.floor;\n this.map.addSelectedFeature(coordinate, endContentPlacement);\n }\n }, {\n key: \"_handleStartContentPlacementSelected\",\n value: function _handleStartContentPlacementSelected(data) {\n var startContentPlacement = data.startContentPlacement;\n this.startContentPlacement = startContentPlacement;\n var _convertVertexToCoord2 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__.convertVertexToCoordinate)(startContentPlacement.location, null, 30.0),\n lat = _convertVertexToCoord2.lat,\n lon = _convertVertexToCoord2.lon;\n var coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.content) {\n if (startContentPlacement.content.title_key) {\n var titleKey = startContentPlacement.content.title_key;\n var title = startContentPlacement.content.data[titleKey];\n startContentPlacement.name = title;\n }\n }\n }\n startContentPlacement._floor = startContentPlacement.floor;\n this.map.clearHighlightedContentLayer();\n this.map.addHighlightedFeature(coordinate, startContentPlacement);\n }\n }, {\n key: \"_handleLegChange\",\n value: function _handleLegChange(data) {\n var index = data.index;\n if (!this.directionsView || !this.pathData) {\n return;\n }\n this.updateMapForPathLeg(this.pathData.legs[index]);\n }\n }, {\n key: \"_handleGettingStartSearchBarSuggestions\",\n value: function () {\n var _handleGettingStartSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (this.directionsView) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\");\n case 2:\n query = data.query;\n currentSearch = ++this.directionsView.startSearchBox.searchCount;\n if (!(query === '')) {\n _context.next = 7;\n break;\n }\n this.directionsView.startSearchBox.searchBarSuggestionsView.updateResults([]);\n return _context.abrupt(\"return\");\n case 7:\n if (this.map.mapData) {\n _context.next = 9;\n break;\n }\n return _context.abrupt(\"return\");\n case 9:\n skip = 0;\n limit = 5;\n _context.prev = 11;\n _context.next = 14;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 14:\n results = _context.sent;\n if (currentSearch === this.directionsView.startSearchBox.searchCount) {\n this.directionsView.startSearchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context.next = 21;\n break;\n case 18:\n _context.prev = 18;\n _context.t0 = _context[\"catch\"](11);\n if (axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].isCancel(_context.t0)) {\n console.error('Request canceled:', _context.t0.message);\n } else {\n console.error('Search error:', _context.t0);\n }\n case 21:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[11, 18]]);\n }));\n function _handleGettingStartSearchBarSuggestions(_x) {\n return _handleGettingStartSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingStartSearchBarSuggestions;\n }()\n }, {\n key: \"_handleGettingEndSearchBarSuggestions\",\n value: function () {\n var _handleGettingEndSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (this.directionsView) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt(\"return\");\n case 2:\n query = data.query;\n currentSearch = ++this.directionsView.endSearchBox.searchCount;\n if (!(query === '')) {\n _context2.next = 7;\n break;\n }\n this.directionsView.endSearchBox.searchBarSuggestionsView.updateResults([]);\n return _context2.abrupt(\"return\");\n case 7:\n if (this.map.mapData) {\n _context2.next = 9;\n break;\n }\n return _context2.abrupt(\"return\");\n case 9:\n skip = 0;\n limit = 5;\n _context2.prev = 11;\n _context2.next = 14;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 14:\n results = _context2.sent;\n if (currentSearch === this.directionsView.endSearchBox.searchCount) {\n this.directionsView.endSearchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context2.next = 21;\n break;\n case 18:\n _context2.prev = 18;\n _context2.t0 = _context2[\"catch\"](11);\n if (axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].isCancel(_context2.t0)) {\n console.error('Request canceled:', _context2.t0.message);\n } else {\n console.error('Search error:', _context2.t0);\n }\n case 21:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[11, 18]]);\n }));\n function _handleGettingEndSearchBarSuggestions(_x2) {\n return _handleGettingEndSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingEndSearchBarSuggestions;\n }()\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.directionsView) {\n return;\n }\n this.container.innerHTML = \"\";\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n this.container.appendChild(this.stepsView.getElement());\n // this.element.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.directionsView) {\n return;\n }\n this.container.innerHTML = \"\";\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n this.container.appendChild(this.stepsView.getElement());\n // this.element.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"createDirectionsLineLayer\",\n value: function createDirectionsLineLayer() {\n this.map.map.addSource('directionsLineSource', {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n }\n });\n\n // Add a new layer for the line\n this.map.map.addLayer({\n 'id': 'directionsLineLayer',\n 'type': 'line',\n 'source': 'directionsLineSource',\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': '#333333',\n 'line-width': 8\n // 'line-blur': 0.9\n }\n });\n\n // this.map.map.moveLayer('directionsLineLayer', 'off-limits');\n // this.map.map.moveLayer('directionsLineLayer', '0-tertiary-area');\n this.map.map.moveLayer('directionsLineLayer', 'FIRST_ELEVATED_FEATURE');\n }\n }, {\n key: \"updateMapForPathLeg\",\n value: function updateMapForPathLeg(leg) {\n this.clearLineData();\n var points = [];\n leg.steps.forEach(function (step, index) {\n points.push.apply(points, _toConsumableArray(index === 0 ? step.path : step.path.slice(1)));\n // console.log(`Step ${index} path: ${leg.steps.length}`);\n // if (index === 0) {\n // points.push(...step.path);\n // } else {\n // points.push(step.path[1]);\n // }\n });\n\n // else if (index === leg.steps.length - 1) {\n // console.log('last step', step.path);\n // points.push(step.path[1]);\n // points.push(step.path[2]);\n // }\n\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__.convertVerticesToCoordinates)(points, null, 30.0);\n console.log(coordinates);\n this._updateMapLineData(coordinates, leg.floor);\n var currentFloor = this.map.getCurrentFloor();\n if (currentFloor !== leg.floor) {\n this.map.updateFloor(leg.floor, false);\n }\n }\n }, {\n key: \"_updateMapLineData\",\n value: function _updateMapLineData(newCoordinates, floor) {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {\n '_floor': floor\n },\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': newCoordinates\n }\n });\n var bounds = new mapboxgl.LngLatBounds();\n newCoordinates.forEach(function (coordinate) {\n bounds.extend(coordinate);\n });\n if (this.currentViewType === 'desktop') {\n this.map.map.fitBounds(bounds, _defineProperty(_defineProperty(_defineProperty({\n padding: 200\n }, \"padding\", {\n top: 200,\n bottom: 200,\n left: 500,\n right: 150\n }), \"maxZoom\", 15), \"duration\", 1000));\n } else {\n this.map.map.fitBounds(bounds, {\n // padding: 200, // Add padding around the edges of the map\n padding: {\n top: 350,\n bottom: 60,\n left: 80,\n right: 100\n },\n maxZoom: 14,\n // Optional: Limit the maximum zoom level\n duration: 1000 // Optional: Animation duration in milliseconds\n });\n }\n }\n }, {\n key: \"clearLineData\",\n value: function clearLineData() {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n });\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n // this.clearLineData();\n this.clearData();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hide();\n // this.clearLineData();\n this.clearData();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.hide();\n this.directionsView.updateView(null, null);\n // this.clearLineData();\n this.clearData();\n // this.map.clearSelectedContentLayer();\n this.map.clearHighlightedContentLayer();\n }\n }, {\n key: \"clearData\",\n value: function clearData() {\n this.pathData = null;\n this.clearLineData();\n this.stepsView.clear();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n var startContentPlacement = data.startContentPlacement,\n endContentPlacement = data.endContentPlacement;\n this.clearData();\n // this._initialize();\n this.show();\n // this.clearLineData();\n this.directionsView.updateView(startContentPlacement, endContentPlacement);\n if (endContentPlacement) {\n var _convertVertexToCoord3 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_4__.convertVertexToCoordinate)(endContentPlacement.location, null, 30.0),\n lat = _convertVertexToCoord3.lat,\n lon = _convertVertexToCoord3.lon;\n var coordinate = [lon, lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.content) {\n if (endContentPlacement.content.title_key) {\n var titleKey = endContentPlacement.content.title_key;\n var title = endContentPlacement.content.data[titleKey];\n endContentPlacement.name = title;\n }\n }\n }\n endContentPlacement._floor = endContentPlacement.floor;\n this.map.addSelectedFeature(coordinate, endContentPlacement);\n }\n }\n }, {\n key: \"_handleIntiateFindPath\",\n value: function () {\n var _handleIntiateFindPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {\n var startContentPlacementId, endContentPlacementId;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n startContentPlacementId = data.startContentPlacementId, endContentPlacementId = data.endContentPlacementId;\n _context3.next = 3;\n return this.map.findPath(startContentPlacementId, endContentPlacementId);\n case 3:\n this.pathData = _context3.sent;\n this.directionsView.setNewPath(this.pathData);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false);\n } else {\n this.stepsView.setNewPath(this.pathData);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _handleIntiateFindPath(_x3) {\n return _handleIntiateFindPath2.apply(this, arguments);\n }\n return _handleIntiateFindPath;\n }()\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function _handleSelectDirectionsButton(data) {\n var placementId = data.placementId;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n return;\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/DirectionsControl.js?");
596
596
 
597
597
  /***/ }),
598
598
 
@@ -790,7 +790,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
790
790
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
791
791
 
792
792
  "use strict";
793
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MapView: () => (/* binding */ MapView)\n/* harmony export */ });\n/* harmony import */ var _utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/resourceLoader */ \"./src/utils/resourceLoader.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _StateCoordinator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./StateCoordinator */ \"./src/components/MapView/StateCoordinator.js\");\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../index */ \"./src/index.js\");\n/* harmony import */ var _assets_logoOutline_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/logoOutline.svg */ \"./src/assets/logoOutline.svg\");\n/* harmony import */ var _assets_logoInner_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../assets/logoInner.svg */ \"./src/assets/logoInner.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\n\n\n// import WaygoLogoUrl from \"../../assets/WaygoLogoWhite.svg\";\n// import WaygoLogoUrl from \"../../assets/WaygoIconWhite.svg\";\n\n// import { convertVerticesToCoordinates } from \"../../utils/coordinateSystems\";\n\nvar mapboxCSS = 'https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css';\nvar mapboxJS = 'https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js';\nvar accessToken = 'pk.eyJ1Ijoid2F5Z28tbWFwcyIsImEiOiJjbGtxYzZ1N3QxdG43M210bXFuYmJ4a3gxIn0.tlbznj_fRJ8La6s2UUMO6A';\nvar mock = {\n '2d1d26267da84c4b87eedc1751d71067:0dc23522b7f841ab88756a94428538d1': {\n 'steps': ['Leave Keynote Theater and make a left (73 ft)', 'Turn right at Kyndral (104 ft)', 'Turn left at SAP (182 ft)', 'Turn right at Samsung (47 ft)', 'Turn left at May Mobility (142 feet)', 'Turn right and arrive at Monta, on your left'],\n 'path': [[-81.557308010743881, -195.68687504906683], [-66.793528483184829, -195.68687504906688], [-66.793528483184829, -136.30367294932935], [-6.7541584044446665, -136.30367294932955], [-6.7541584044446195, -106.92078820451393], [81.828518760909716, -106.92078820451393], [81.828518760909716, -47.209502115275079], [140.88363687114594, -47.209502115275079]]\n }\n};\nvar mockData = {\n 'b1800bf6e3ed480cae21526e42464676:a7fa2fb07ae04049b9026c296d015d66': {\n 'steps': ['Leave Roundtable and make a left', 'Turn right after walking 177 feet', 'Turn left after walking 203 feet', 'Turn right after walking 100 feet', 'Continue straight in 242 feet', 'Arrive at Stage 4, on your left'],\n 'path': [[95.645948774511609, -118.96329432647396], [41.840174496296385, -118.96329432647379], [41.840174496296484, -56.955420310725756], [10.344111504170499, -56.955420310725756], [10.34411150417062, 18.175813285074767], [0.17350782962993705, 18.175813285074767], [0.17350782962999536, 54.265052130219125], [-25.417043351472369, 54.26505213021921]]\n },\n // ROUNDTABLE TO STAGE 4\n '529803fcdd7e4d5db5ed71b9ff1ef0e2:899969e0115b4d8da8fb51bedf7caff2': {\n 'steps': [\"Leave Startups Info Point and make a left\", \"Turn right in 12 feet\", \"Turn left in 37 feet\", \"Continue straight for 182 feet\", \"Turn right in 36 feet\", \"Turn left after 29 feet\", \"Turn right after 57 feet\", \"Turn left after walking 42 feet\", \"Arrive at Alpha 1, on your right\"],\n 'path': [[284.28160504078147, -119.85123601826949], [258.75367051155007, -119.8512360182694], [258.75367051155007, -57.515278013020058], [-40.902596633706594, -57.515278013019092], [-40.902596633706445, 19.584459519789313], [-169.83960450772221, 19.584459519789728], [-169.83960450772213, 78.311493640524645], [-215.11519505890323, 78.311493640524787]]\n },\n 'd1910e5724844b40bf8e2a721fba172a:3673b48d96b04d7aa65937dec3276d3c': {\n 'steps': [\"Leave startup lounge and make a right\", \"Continue straight for 22 feet, then turn left\", \"Turn right in 37 feet\", \"Continue straight for 143 feet, then turn left\", \"Turn right in 32 feet\", \"Continue straight for 210 feet\", \"Turn right, and continue for 5 feet\", \"Arrive at The Black Innovation Zone, on your right\"],\n 'path': [[417.35544488563073, 75.74517709550193], [356.33182283838664, 75.745177095502129], [356.33182283838653, 17.674310953769847], [121.7517703449482, 17.674310953770604], [121.75177034494808, -56.800754663027305], [-207.21694798680142, -56.80075466302624], [-207.21694798680144, -78.116837633560053]]\n }\n};\nvar defaultMapOptions = {\n container: 'map',\n sourceId: 'collision-conference.2024.2xw_YUXYS8GoDTB2AQgN3A',\n center: [0, 0],\n floor: 0,\n zoom: 13,\n bearing: 0,\n pitch: 0,\n minPitch: 0,\n maxPitch: 60,\n minZoom: 10.5,\n maxZoom: 16.8,\n bounds: null,\n // The bounds of the map, would override center and zoom options.\n doubleClickZoom: true,\n dragPan: true,\n dragRotate: true,\n scrollZoom: true,\n touchPitch: true,\n touchZoomRotate: true,\n interactive: true,\n trackResize: true,\n keyboard: true,\n defaultControls: false\n};\nvar MapView = /*#__PURE__*/function (_Component) {\n function MapView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, MapView);\n _this = _callSuper(this, MapView, [_objectSpread(_objectSpread({}, defaultMapOptions), options)]);\n _this.mapViewApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMapViewApi();\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSearchApi();\n _this.routesApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getRotuesApi();\n _this.mapContainer = document.createElement('div');\n _this.mapContainer.className = 'inner-map-container';\n _this.ready = _this._initialize(options);\n _this.initialLoad = false;\n _this.originalFilters = {};\n _this._currentFloorIndex = options.floor;\n _this.mapData = null;\n _this._stateCoordinator = new _StateCoordinator__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_this);\n _this.defaultControls = options.defaultControls; // || false;\n return _this;\n }\n _inherits(MapView, _Component);\n return _createClass(MapView, [{\n key: \"_initialize\",\n value: function () {\n var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this2 = this;\n var styleId;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this._loadMapLibraries();\n case 3:\n mapboxgl.clearStorage();\n this.render();\n _context.next = 7;\n return this._initializeMapData();\n case 7:\n if (this.mapData) {\n _context.next = 10;\n break;\n }\n console.error(\"Error initializing map data.\");\n return _context.abrupt(\"return\");\n case 10:\n styleId = this.mapData.style_id;\n if (typeof mapboxgl !== 'undefined' && styleId) {\n mapboxgl.accessToken = accessToken;\n this.map = new mapboxgl.Map({\n container: this.mapContainer,\n style: \"mapbox://styles/waygo-maps/\".concat(styleId),\n center: this.options.center,\n zoom: this.options.zoom,\n bearing: this.options.bearing,\n pitch: this.options.pitch,\n minPitch: this.options.minPitch,\n maxPitch: this.options.maxPitch,\n minZoom: this.options.minZoom,\n maxZoom: this.options.maxZoom,\n bounds: this.options.bounds,\n doubleClickZoom: this.options.doubleClickZoom,\n dragPan: this.options.dragPan,\n dragRotate: this.options.dragRotate,\n scrollZoom: this.options.scrollZoom,\n touchPitch: this.options.touchPitch,\n touchZoomRotate: this.options.touchZoomRotate,\n interactive: this.options.interactive,\n trackResize: this.options.trackResize,\n keyboard: this.options.keyboard\n });\n this.map.on('styledata', function () {\n if (!_this2.initialLoad) {\n _this2._initializeOriginalFilters();\n _this2.updateFloor(_this2.options.floor, false);\n _this2.initialLoad = true;\n }\n });\n this.map.on('load', function () {\n if (_this2.defaultControls) {\n _this2._addDefaultControls();\n _this2.updateFloor(_this2.options.floor, false);\n _this2._addLogoImage();\n }\n _this2.fire('load', {\n mapData: _this2.mapData\n });\n });\n this._initializeEventListeners();\n } else {\n console.error('Mapbox GL JS is not loaded.');\n }\n _context.next = 17;\n break;\n case 14:\n _context.prev = 14;\n _context.t0 = _context[\"catch\"](0);\n console.error('Failed to initialize the map:', _context.t0);\n case 17:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[0, 14]]);\n }));\n function _initialize() {\n return _initialize2.apply(this, arguments);\n }\n return _initialize;\n }()\n }, {\n key: \"_addLogoImage\",\n value: function _addLogoImage() {\n var linkUrl = 'https://waygomaps.com';\n var imageContainer = document.createElement('div');\n imageContainer.className = 'logo-image-container';\n var outlineImageElement = document.createElement('img');\n outlineImageElement.className = 'logo-outline-element';\n outlineImageElement.src = _assets_logoOutline_svg__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n outlineImageElement.alt = 'Clickable image';\n\n // Append the image to the container\n imageContainer.appendChild(outlineImageElement);\n var fillImageElement = document.createElement('img');\n fillImageElement.className = 'logo-fill-element';\n fillImageElement.src = _assets_logoInner_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n fillImageElement.alt = 'Clickable image';\n\n // Append the image to the container\n imageContainer.appendChild(fillImageElement);\n\n // Add click event to open the link\n imageContainer.addEventListener('click', function () {\n window.open(linkUrl, '_blank'); // Open link in a new tab\n });\n\n // Append the container to the map container\n this.mapContainer.appendChild(imageContainer);\n var websiteContainer = document.createElement('div');\n websiteContainer.className = 'website-container';\n websiteContainer.textContent = '© Waygo Maps';\n websiteContainer.addEventListener('click', function () {\n window.open(linkUrl, '_blank'); // Open link in a new tab\n });\n this.mapContainer.appendChild(websiteContainer);\n }\n }, {\n key: \"getCurrentFloor\",\n value: function getCurrentFloor() {\n return this._currentFloorIndex;\n }\n }, {\n key: \"_addDefaultControls\",\n value: function _addDefaultControls() {\n var _this3 = this;\n var controls = [\n // new waygo.ContentPlacementControl(),\n new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SearchBoxControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].FloorSelectorControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CategoryBarControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SearchResultsControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ContentPlacementControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].DirectionsControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].InteractionControl()\n // new waygo.FloorSelectorControl()\n ];\n controls.forEach(function (control) {\n return _this3.addControl(control);\n });\n }\n }, {\n key: \"_initializeOriginalFilters\",\n value: function _initializeOriginalFilters() {\n var _this4 = this;\n var layers = this.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type !== 'background' && layer.type !== 'raster' && layer.type !== 'heatmap') {\n // Get and store the original filter, or set to null if no filter exists\n _this4.originalFilters[layer.id] = _this4.map.getFilter(layer.id) || null;\n }\n });\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n var _this5 = this;\n this.mapContainer.addEventListener('mousedown', function (event) {\n return _this5.fire('mousedown', {\n originalEvent: event\n });\n });\n // preclick\n this.mapContainer.addEventListener('click', function (event) {\n return _this5.fire('click', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mouseover', function (event) {\n return _this5.fire('mouseover', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mousemove', function (event) {\n return _this5.fire('mousemove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('dblclick', function (event) {\n return _this5.fire('dblclick', {\n originalEvent: event\n });\n });\n // mouseenter\n // mouseleave\n this.mapContainer.addEventListener('mouseout', function (event) {\n return _this5.fire('mouseout', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('contextmenu', function (event) {\n return _this5.fire('contextmenu', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('wheel', function (event) {\n return _this5.fire('wheel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchstart', function (event) {\n return _this5.fire('touchstart', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchend', function (event) {\n return _this5.fire('touchend', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchmove', function (event) {\n return _this5.fire('touchmove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchcancel', function (event) {\n return _this5.fire('touchcancel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('move', function (event) {\n return _this5.fire('move', {\n originalEvent: event\n });\n });\n var movementEvents = ['movestart', 'move', 'moveend', 'dragstart', 'drag', 'dragend', 'zoomstart', 'zoom', 'zoomend', 'rotatestart', 'rotate', 'rotateend', 'pitchstart', 'pitch', 'pitchend', 'boxzoomstart', 'boxzoomend', 'boxzoomcancel'];\n movementEvents.forEach(function (eventName) {\n _this5.map.on(eventName, function (event) {\n _this5.fire(eventName, {\n originalEvent: event\n });\n });\n });\n }\n }, {\n key: \"_initializeMapData\",\n value: function () {\n var _initializeMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var parts, accountId, mapId, mapViewId, data;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n parts = this.options.sourceId.split('.');\n if (!(parts.length !== 3)) {\n _context2.next = 4;\n break;\n }\n console.error('The mapViewId format is incorrect. It should be in the format \"businessId.mapId.mapViewId\".');\n return _context2.abrupt(\"return\");\n case 4:\n accountId = parts[0] || '';\n mapId = parts[1] || '';\n mapViewId = parts[2] || ''; // Set account id in WaygoMaps\n _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setAccountId(accountId);\n _context2.prev = 8;\n _context2.next = 11;\n return this.mapViewApi.loadMapView(mapId, mapViewId);\n case 11:\n data = _context2.sent;\n this.mapData = data;\n _context2.next = 18;\n break;\n case 15:\n _context2.prev = 15;\n _context2.t0 = _context2[\"catch\"](8);\n console.error('Error fetching map style:', _context2.t0);\n case 18:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[8, 15]]);\n }));\n function _initializeMapData() {\n return _initializeMapData2.apply(this, arguments);\n }\n return _initializeMapData;\n }()\n }, {\n key: \"_loadMapLibraries\",\n value: function () {\n var _loadMapLibraries2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadCSS)(mapboxCSS);\n case 2:\n _context3.next = 4;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadScript)(mapboxJS);\n case 4:\n mapboxgl.clearStorage();\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function _loadMapLibraries() {\n return _loadMapLibraries2.apply(this, arguments);\n }\n return _loadMapLibraries;\n }()\n }, {\n key: \"render\",\n value: function render() {\n // this._addLogoImage();\n var targetContainer = document.getElementById(this.options.container);\n if (targetContainer) {\n targetContainer.appendChild(this.mapContainer);\n this.mapContainer.style.width = '100%';\n this.mapContainer.style.height = '100%';\n this.mapContainer.style.position = 'relative';\n } else {\n console.error(\"Container element with id \\\"\".concat(this.containerId, \"\\\" not found.\"));\n }\n }\n }, {\n key: \"updateFloor\",\n value: function updateFloor(floorIndex) {\n var _this6 = this;\n var zoomOut = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n // if (floorIndex === this._currentFloorIndex) { \n // console.log(`Floor ${floorIndex} is already selected`);\n // return; \n // }\n var layers = this.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type !== 'background' && layer.type !== 'raster' && layer.type !== 'heatmap') {\n var originalFilter = _this6.originalFilters[layer.id];\n _this6.map.setFilter(layer.id, originalFilter);\n var floorFilter = ['==', ['get', '_floor'], floorIndex];\n if (originalFilter) {\n var combinedFilter = ['all', floorFilter, originalFilter];\n _this6.map.setFilter(layer.id, combinedFilter);\n } else {\n _this6.map.setFilter(layer.id, floorFilter);\n }\n }\n });\n this._currentFloorIndex = floorIndex;\n if (zoomOut) {\n this.map.flyTo({\n zoom: 12,\n pitch: 36,\n bearing: -22,\n speed: 1.2,\n curve: 1.5,\n duration: 300\n });\n }\n this.fire('floorChanged', {\n floorIndex: floorIndex\n });\n }\n }, {\n key: \"addHighlightedFeature\",\n value: function addHighlightedFeature(coordinates, properties) {\n var source = this.map.getSource('highlighted-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n return newFeature;\n }\n }, {\n key: \"addSelectedFeature\",\n value: function addSelectedFeature(coordinates, properties) {\n var allow_multi_select = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var source = this.map.getSource('selected-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n if (allow_multi_select) {\n currentData.features.push(newFeature);\n } else {\n currentData.features = [newFeature];\n }\n source.setData(currentData);\n }\n }, {\n key: \"clearSelectedContentLayer\",\n value: function clearSelectedContentLayer() {\n this.map.getSource('selected-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"clearHighlightedContentLayer\",\n value: function clearHighlightedContentLayer() {\n this.map.getSource('highlighted-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n\n // MARK: Controls\n }, {\n key: \"addControl\",\n value: function addControl(control) {\n var container = control.onAdd(this);\n this.mapContainer.appendChild(container);\n }\n }, {\n key: \"removeControl\",\n value: function removeControl(control) {\n this.map.removeControl(control);\n }\n\n // MARK: Map states\n }, {\n key: \"getCurrentState\",\n value: function getCurrentState() {\n return this._stateCoordinator.state;\n }\n }, {\n key: \"setToDefaultState\",\n value: function setToDefaultState() {\n this._stateCoordinator.transitionTo('default');\n }\n }, {\n key: \"setToSearchState\",\n value: function () {\n var _setToSearchState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {\n var results;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this.search(query);\n case 2:\n results = _context4.sent;\n this._stateCoordinator.transitionTo('search', {\n query: query,\n results: results\n });\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function setToSearchState(_x) {\n return _setToSearchState.apply(this, arguments);\n }\n return setToSearchState;\n }()\n }, {\n key: \"setToSelectedContentState\",\n value: function () {\n var _setToSelectedContentState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(contentPlacementIds) {\n var lastContentPlacementId, selectedContentPlacement;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n lastContentPlacementId = contentPlacementIds[contentPlacementIds.length - 1];\n _context5.next = 3;\n return this.getContentPlacementDetails(lastContentPlacementId);\n case 3:\n selectedContentPlacement = _context5.sent;\n this.updateFloor(selectedContentPlacement.floor);\n this._stateCoordinator.transitionTo('selectedContent', {\n contentPlacementIds: contentPlacementIds,\n selectedContentPlacement: selectedContentPlacement\n });\n case 6:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function setToSelectedContentState(_x2) {\n return _setToSelectedContentState.apply(this, arguments);\n }\n return setToSelectedContentState;\n }()\n }, {\n key: \"setToDirectionsState\",\n value: function () {\n var _setToDirectionsState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n var startContentPlacementId,\n endContentPlacementId,\n startContentPlacement,\n endContentPlacement,\n _args6 = arguments;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n startContentPlacementId = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : null;\n endContentPlacementId = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : null;\n startContentPlacement = null;\n if (!startContentPlacementId) {\n _context6.next = 7;\n break;\n }\n _context6.next = 6;\n return this.getContentPlacementDetails(startContentPlacementId);\n case 6:\n startContentPlacement = _context6.sent;\n case 7:\n endContentPlacement = null;\n if (!endContentPlacementId) {\n _context6.next = 12;\n break;\n }\n _context6.next = 11;\n return this.getContentPlacementDetails(endContentPlacementId);\n case 11:\n endContentPlacement = _context6.sent;\n case 12:\n this._stateCoordinator.transitionTo('directions', {\n startContentPlacement: startContentPlacement,\n endContentPlacement: endContentPlacement\n });\n case 13:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function setToDirectionsState() {\n return _setToDirectionsState.apply(this, arguments);\n }\n return setToDirectionsState;\n }()\n }, {\n key: \"initiateBack\",\n value: function initiateBack() {\n this.fire('initiate:back');\n }\n }, {\n key: \"initiateSetToSearchState\",\n value: function initiateSetToSearchState() {\n this.fire('initiate:search');\n }\n }, {\n key: \"findPath\",\n value: function () {\n var _findPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(startContentPlacementId, endContentPlacementId) {\n var response_data;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return this.routesApi.findPath(this.mapData.map_id, startContentPlacementId, endContentPlacementId);\n case 2:\n response_data = _context7.sent;\n if (!response_data) {\n _context7.next = 7;\n break;\n }\n return _context7.abrupt(\"return\", response_data);\n case 7:\n console.error('Failed to find path.');\n case 8:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function findPath(_x3, _x4) {\n return _findPath.apply(this, arguments);\n }\n return findPath;\n }() // MARK: Map methods\n }, {\n key: \"_findFeatureByPlacementId\",\n value: function _findFeatureByPlacementId(placementId) {\n var features = this.map.queryRenderedFeatures({\n filter: ['==', ['get', 'placement_id'], placementId]\n });\n\n // Return the first feature that matches the placementId\n return features.length > 0 ? features[0] : null;\n }\n }, {\n key: \"getCenter\",\n value: function getCenter() {\n // Update to convert from lat, lon, to x, y in meters\n if (this.map) {\n return this.map.getCenter();\n } else {\n console.error('Map is not initialized.');\n }\n }\n }, {\n key: \"setCenter\",\n value: function setCenter(lngLat) {\n // Update to convert from lat, lon, to x, y in meters\n if (this.map) {\n this.map.setCenter(lngLat);\n } else {\n console.error('Map is not initialized.');\n }\n }\n }, {\n key: \"search\",\n value: function () {\n var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(query) {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n if (!(query === '')) {\n _context8.next = 2;\n break;\n }\n return _context8.abrupt(\"return\");\n case 2:\n if (this.mapData) {\n _context8.next = 4;\n break;\n }\n return _context8.abrupt(\"return\");\n case 4:\n _context8.prev = 4;\n _context8.next = 7;\n return this.searchApi.search(this.mapData.map_id, this.mapData.map_view_id, query);\n case 7:\n return _context8.abrupt(\"return\", _context8.sent);\n case 10:\n _context8.prev = 10;\n _context8.t0 = _context8[\"catch\"](4);\n if (axios.isCancel(_context8.t0)) {\n console.error('Request canceled:', _context8.t0.message);\n } else {\n console.error('Search error:', _context8.t0);\n }\n case 13:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this, [[4, 10]]);\n }));\n function search(_x5) {\n return _search.apply(this, arguments);\n }\n return search;\n }()\n }, {\n key: \"getContentPlacementDetails\",\n value: function () {\n var _getContentPlacementDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(contentPlacementId) {\n return _regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n _context9.prev = 0;\n _context9.next = 3;\n return this.searchApi.fetchContentPlacementDetails(contentPlacementId);\n case 3:\n return _context9.abrupt(\"return\", _context9.sent);\n case 6:\n _context9.prev = 6;\n _context9.t0 = _context9[\"catch\"](0);\n if (axios.isCancel(_context9.t0)) {\n console.error('Request canceled:', _context9.t0.message);\n } else {\n console.error('Fetching content placement details error:', _context9.t0);\n }\n case 9:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9, this, [[0, 6]]);\n }));\n function getContentPlacementDetails(_x6) {\n return _getContentPlacementDetails.apply(this, arguments);\n }\n return getContentPlacementDetails;\n }()\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n//# sourceURL=webpack://waygomaps/./src/components/MapView/MapView.js?");
793
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MapView: () => (/* binding */ MapView)\n/* harmony export */ });\n/* harmony import */ var _utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/resourceLoader */ \"./src/utils/resourceLoader.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _StateCoordinator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./StateCoordinator */ \"./src/components/MapView/StateCoordinator.js\");\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../index */ \"./src/index.js\");\n/* harmony import */ var _assets_logoOutline_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/logoOutline.svg */ \"./src/assets/logoOutline.svg\");\n/* harmony import */ var _assets_logoInner_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../assets/logoInner.svg */ \"./src/assets/logoInner.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\n\n\n// import WaygoLogoUrl from \"../../assets/WaygoLogoWhite.svg\";\n// import WaygoLogoUrl from \"../../assets/WaygoIconWhite.svg\";\n\n// import { convertVerticesToCoordinates } from \"../../utils/coordinateSystems\";\n\nvar mapboxCSS = 'https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css';\nvar mapboxJS = 'https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js';\nvar accessToken = 'pk.eyJ1Ijoid2F5Z28tbWFwcyIsImEiOiJjbGtxYzZ1N3QxdG43M210bXFuYmJ4a3gxIn0.tlbznj_fRJ8La6s2UUMO6A';\nvar mock = {\n '2d1d26267da84c4b87eedc1751d71067:0dc23522b7f841ab88756a94428538d1': {\n 'steps': ['Leave Keynote Theater and make a left (73 ft)', 'Turn right at Kyndral (104 ft)', 'Turn left at SAP (182 ft)', 'Turn right at Samsung (47 ft)', 'Turn left at May Mobility (142 feet)', 'Turn right and arrive at Monta, on your left'],\n 'path': [[-81.557308010743881, -195.68687504906683], [-66.793528483184829, -195.68687504906688], [-66.793528483184829, -136.30367294932935], [-6.7541584044446665, -136.30367294932955], [-6.7541584044446195, -106.92078820451393], [81.828518760909716, -106.92078820451393], [81.828518760909716, -47.209502115275079], [140.88363687114594, -47.209502115275079]]\n }\n};\nvar mockData = {\n 'b1800bf6e3ed480cae21526e42464676:a7fa2fb07ae04049b9026c296d015d66': {\n 'steps': ['Leave Roundtable and make a left', 'Turn right after walking 177 feet', 'Turn left after walking 203 feet', 'Turn right after walking 100 feet', 'Continue straight in 242 feet', 'Arrive at Stage 4, on your left'],\n 'path': [[95.645948774511609, -118.96329432647396], [41.840174496296385, -118.96329432647379], [41.840174496296484, -56.955420310725756], [10.344111504170499, -56.955420310725756], [10.34411150417062, 18.175813285074767], [0.17350782962993705, 18.175813285074767], [0.17350782962999536, 54.265052130219125], [-25.417043351472369, 54.26505213021921]]\n },\n // ROUNDTABLE TO STAGE 4\n '529803fcdd7e4d5db5ed71b9ff1ef0e2:899969e0115b4d8da8fb51bedf7caff2': {\n 'steps': [\"Leave Startups Info Point and make a left\", \"Turn right in 12 feet\", \"Turn left in 37 feet\", \"Continue straight for 182 feet\", \"Turn right in 36 feet\", \"Turn left after 29 feet\", \"Turn right after 57 feet\", \"Turn left after walking 42 feet\", \"Arrive at Alpha 1, on your right\"],\n 'path': [[284.28160504078147, -119.85123601826949], [258.75367051155007, -119.8512360182694], [258.75367051155007, -57.515278013020058], [-40.902596633706594, -57.515278013019092], [-40.902596633706445, 19.584459519789313], [-169.83960450772221, 19.584459519789728], [-169.83960450772213, 78.311493640524645], [-215.11519505890323, 78.311493640524787]]\n },\n 'd1910e5724844b40bf8e2a721fba172a:3673b48d96b04d7aa65937dec3276d3c': {\n 'steps': [\"Leave startup lounge and make a right\", \"Continue straight for 22 feet, then turn left\", \"Turn right in 37 feet\", \"Continue straight for 143 feet, then turn left\", \"Turn right in 32 feet\", \"Continue straight for 210 feet\", \"Turn right, and continue for 5 feet\", \"Arrive at The Black Innovation Zone, on your right\"],\n 'path': [[417.35544488563073, 75.74517709550193], [356.33182283838664, 75.745177095502129], [356.33182283838653, 17.674310953769847], [121.7517703449482, 17.674310953770604], [121.75177034494808, -56.800754663027305], [-207.21694798680142, -56.80075466302624], [-207.21694798680144, -78.116837633560053]]\n }\n};\nvar defaultMapOptions = {\n container: 'map',\n sourceId: 'collision-conference.2024.2xw_YUXYS8GoDTB2AQgN3A',\n center: [0, 0],\n floor: 0,\n zoom: 13,\n bearing: 0,\n pitch: 0,\n minPitch: 0,\n maxPitch: 60,\n minZoom: 10.5,\n maxZoom: 16.8,\n bounds: null,\n // The bounds of the map, would override center and zoom options.\n doubleClickZoom: true,\n dragPan: true,\n dragRotate: true,\n scrollZoom: true,\n touchPitch: true,\n touchZoomRotate: true,\n interactive: true,\n trackResize: true,\n keyboard: true,\n defaultControls: false\n};\nvar MapView = /*#__PURE__*/function (_Component) {\n function MapView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, MapView);\n _this = _callSuper(this, MapView, [_objectSpread(_objectSpread({}, defaultMapOptions), options)]);\n _this.mapViewApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMapViewApi();\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSearchApi();\n _this.routesApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getRotuesApi();\n _this.mapContainer = document.createElement('div');\n _this.mapContainer.className = 'inner-map-container';\n _this.ready = _this._initialize(options);\n _this.initialLoad = false;\n _this.originalFilters = {};\n _this._currentFloorIndex = options.floor;\n _this.mapData = null;\n _this._stateCoordinator = new _StateCoordinator__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_this);\n _this.defaultControls = options.defaultControls; // || false;\n return _this;\n }\n _inherits(MapView, _Component);\n return _createClass(MapView, [{\n key: \"_initialize\",\n value: function () {\n var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this2 = this;\n var styleId;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this._loadMapLibraries();\n case 3:\n mapboxgl.clearStorage();\n this.render();\n _context.next = 7;\n return this._initializeMapData();\n case 7:\n if (this.mapData) {\n _context.next = 10;\n break;\n }\n console.error(\"Error initializing map data.\");\n return _context.abrupt(\"return\");\n case 10:\n styleId = this.mapData.style_id;\n if (typeof mapboxgl !== 'undefined' && styleId) {\n mapboxgl.accessToken = accessToken;\n this.map = new mapboxgl.Map({\n container: this.mapContainer,\n style: \"mapbox://styles/waygo-maps/\".concat(styleId),\n center: this.options.center,\n zoom: this.options.zoom,\n bearing: this.options.bearing,\n pitch: this.options.pitch,\n minPitch: this.options.minPitch,\n maxPitch: this.options.maxPitch,\n minZoom: this.options.minZoom,\n maxZoom: this.options.maxZoom,\n bounds: this.options.bounds,\n doubleClickZoom: this.options.doubleClickZoom,\n dragPan: this.options.dragPan,\n dragRotate: this.options.dragRotate,\n scrollZoom: this.options.scrollZoom,\n touchPitch: this.options.touchPitch,\n touchZoomRotate: this.options.touchZoomRotate,\n interactive: this.options.interactive,\n trackResize: this.options.trackResize,\n keyboard: this.options.keyboard\n });\n this.map.on('styledata', function () {\n if (!_this2.initialLoad) {\n _this2._initializeOriginalFilters();\n _this2.updateFloor(_this2.options.floor, false);\n _this2.initialLoad = true;\n }\n });\n this.map.on('load', function () {\n if (_this2.defaultControls) {\n _this2._addLogoImage();\n _this2._addDefaultControls();\n _this2.updateFloor(_this2.options.floor, false);\n }\n _this2.fire('load', {\n mapData: _this2.mapData\n });\n });\n this._initializeEventListeners();\n } else {\n console.error('Mapbox GL JS is not loaded.');\n }\n _context.next = 17;\n break;\n case 14:\n _context.prev = 14;\n _context.t0 = _context[\"catch\"](0);\n console.error('Failed to initialize the map:', _context.t0);\n case 17:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[0, 14]]);\n }));\n function _initialize() {\n return _initialize2.apply(this, arguments);\n }\n return _initialize;\n }()\n }, {\n key: \"_addLogoImage\",\n value: function _addLogoImage() {\n var linkUrl = 'https://waygomaps.com';\n var imageContainer = document.createElement('div');\n imageContainer.className = 'logo-image-container';\n var outlineImageElement = document.createElement('img');\n outlineImageElement.className = 'logo-outline-element';\n outlineImageElement.src = _assets_logoOutline_svg__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n outlineImageElement.alt = 'Clickable image';\n\n // Append the image to the container\n imageContainer.appendChild(outlineImageElement);\n var fillImageElement = document.createElement('img');\n fillImageElement.className = 'logo-fill-element';\n fillImageElement.src = _assets_logoInner_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n fillImageElement.alt = 'Clickable image';\n\n // Append the image to the container\n imageContainer.appendChild(fillImageElement);\n\n // Add click event to open the link\n imageContainer.addEventListener('click', function () {\n window.open(linkUrl, '_blank'); // Open link in a new tab\n });\n\n // Append the container to the map container\n this.mapContainer.appendChild(imageContainer);\n var websiteContainer = document.createElement('div');\n websiteContainer.className = 'website-container';\n websiteContainer.textContent = '© Waygo Maps';\n // websiteContainer.textContent = 'waygomaps.com';\n\n websiteContainer.addEventListener('click', function () {\n window.open(linkUrl, '_blank'); // Open link in a new tab\n });\n this.mapContainer.appendChild(websiteContainer);\n }\n }, {\n key: \"getCurrentFloor\",\n value: function getCurrentFloor() {\n return this._currentFloorIndex;\n }\n }, {\n key: \"_addDefaultControls\",\n value: function _addDefaultControls() {\n var _this3 = this;\n var controls = [\n // new waygo.ContentPlacementControl(),\n new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SearchBoxControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].FloorSelectorControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CategoryBarControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SearchResultsControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ContentPlacementControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].DirectionsControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].InteractionControl()\n // new waygo.FloorSelectorControl()\n ];\n controls.forEach(function (control) {\n return _this3.addControl(control);\n });\n }\n }, {\n key: \"_initializeOriginalFilters\",\n value: function _initializeOriginalFilters() {\n var _this4 = this;\n var layers = this.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type !== 'background' && layer.type !== 'raster' && layer.type !== 'heatmap') {\n // Get and store the original filter, or set to null if no filter exists\n _this4.originalFilters[layer.id] = _this4.map.getFilter(layer.id) || null;\n }\n });\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n var _this5 = this;\n this.mapContainer.addEventListener('mousedown', function (event) {\n return _this5.fire('mousedown', {\n originalEvent: event\n });\n });\n // preclick\n this.mapContainer.addEventListener('click', function (event) {\n return _this5.fire('click', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mouseover', function (event) {\n return _this5.fire('mouseover', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mousemove', function (event) {\n return _this5.fire('mousemove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('dblclick', function (event) {\n return _this5.fire('dblclick', {\n originalEvent: event\n });\n });\n // mouseenter\n // mouseleave\n this.mapContainer.addEventListener('mouseout', function (event) {\n return _this5.fire('mouseout', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('contextmenu', function (event) {\n return _this5.fire('contextmenu', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('wheel', function (event) {\n return _this5.fire('wheel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchstart', function (event) {\n return _this5.fire('touchstart', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchend', function (event) {\n return _this5.fire('touchend', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchmove', function (event) {\n return _this5.fire('touchmove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchcancel', function (event) {\n return _this5.fire('touchcancel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('move', function (event) {\n return _this5.fire('move', {\n originalEvent: event\n });\n });\n var movementEvents = ['movestart', 'move', 'moveend', 'dragstart', 'drag', 'dragend', 'zoomstart', 'zoom', 'zoomend', 'rotatestart', 'rotate', 'rotateend', 'pitchstart', 'pitch', 'pitchend', 'boxzoomstart', 'boxzoomend', 'boxzoomcancel'];\n movementEvents.forEach(function (eventName) {\n _this5.map.on(eventName, function (event) {\n _this5.fire(eventName, {\n originalEvent: event\n });\n });\n });\n }\n }, {\n key: \"_initializeMapData\",\n value: function () {\n var _initializeMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var parts, accountId, mapId, mapViewId, data;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n parts = this.options.sourceId.split('.');\n if (!(parts.length !== 3)) {\n _context2.next = 4;\n break;\n }\n console.error('The mapViewId format is incorrect. It should be in the format \"businessId.mapId.mapViewId\".');\n return _context2.abrupt(\"return\");\n case 4:\n accountId = parts[0] || '';\n mapId = parts[1] || '';\n mapViewId = parts[2] || ''; // Set account id in WaygoMaps\n _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setAccountId(accountId);\n _context2.prev = 8;\n _context2.next = 11;\n return this.mapViewApi.loadMapView(mapId, mapViewId);\n case 11:\n data = _context2.sent;\n this.mapData = data;\n _context2.next = 18;\n break;\n case 15:\n _context2.prev = 15;\n _context2.t0 = _context2[\"catch\"](8);\n console.error('Error fetching map style:', _context2.t0);\n case 18:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[8, 15]]);\n }));\n function _initializeMapData() {\n return _initializeMapData2.apply(this, arguments);\n }\n return _initializeMapData;\n }()\n }, {\n key: \"_loadMapLibraries\",\n value: function () {\n var _loadMapLibraries2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadCSS)(mapboxCSS);\n case 2:\n _context3.next = 4;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadScript)(mapboxJS);\n case 4:\n mapboxgl.clearStorage();\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function _loadMapLibraries() {\n return _loadMapLibraries2.apply(this, arguments);\n }\n return _loadMapLibraries;\n }()\n }, {\n key: \"render\",\n value: function render() {\n // this._addLogoImage();\n var targetContainer = document.getElementById(this.options.container);\n if (targetContainer) {\n targetContainer.appendChild(this.mapContainer);\n this.mapContainer.style.width = '100%';\n this.mapContainer.style.height = '100%';\n this.mapContainer.style.position = 'relative';\n } else {\n console.error(\"Container element with id \\\"\".concat(this.containerId, \"\\\" not found.\"));\n }\n }\n }, {\n key: \"updateFloor\",\n value: function updateFloor(floorIndex) {\n var _this6 = this;\n var zoomOut = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n // if (floorIndex === this._currentFloorIndex) { \n // console.log(`Floor ${floorIndex} is already selected`);\n // return; \n // }\n var layers = this.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type !== 'background' && layer.type !== 'raster' && layer.type !== 'heatmap') {\n var originalFilter = _this6.originalFilters[layer.id];\n _this6.map.setFilter(layer.id, originalFilter);\n var floorFilter = ['==', ['get', '_floor'], floorIndex];\n if (originalFilter) {\n var combinedFilter = ['all', floorFilter, originalFilter];\n _this6.map.setFilter(layer.id, combinedFilter);\n } else {\n _this6.map.setFilter(layer.id, floorFilter);\n }\n }\n });\n this._currentFloorIndex = floorIndex;\n if (zoomOut) {\n this.map.flyTo({\n zoom: 12,\n pitch: 36,\n bearing: -22,\n speed: 1.2,\n curve: 1.5,\n duration: 300\n });\n }\n this.fire('floorChanged', {\n floorIndex: floorIndex\n });\n }\n }, {\n key: \"addHighlightedFeature\",\n value: function addHighlightedFeature(coordinates, properties) {\n var source = this.map.getSource('highlighted-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n return newFeature;\n }\n }, {\n key: \"addSelectedFeature\",\n value: function addSelectedFeature(coordinates, properties) {\n var allow_multi_select = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var source = this.map.getSource('selected-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n if (allow_multi_select) {\n currentData.features.push(newFeature);\n } else {\n currentData.features = [newFeature];\n }\n source.setData(currentData);\n }\n }, {\n key: \"clearSelectedContentLayer\",\n value: function clearSelectedContentLayer() {\n this.map.getSource('selected-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"clearHighlightedContentLayer\",\n value: function clearHighlightedContentLayer() {\n this.map.getSource('highlighted-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n\n // MARK: Controls\n }, {\n key: \"addControl\",\n value: function addControl(control) {\n var container = control.onAdd(this);\n this.mapContainer.appendChild(container);\n }\n }, {\n key: \"removeControl\",\n value: function removeControl(control) {\n this.map.removeControl(control);\n }\n\n // MARK: Map states\n }, {\n key: \"getCurrentState\",\n value: function getCurrentState() {\n return this._stateCoordinator.state;\n }\n }, {\n key: \"setToDefaultState\",\n value: function setToDefaultState() {\n this._stateCoordinator.transitionTo('default');\n }\n }, {\n key: \"setToSearchState\",\n value: function () {\n var _setToSearchState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {\n var results;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this.search(query);\n case 2:\n results = _context4.sent;\n this._stateCoordinator.transitionTo('search', {\n query: query,\n results: results\n });\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function setToSearchState(_x) {\n return _setToSearchState.apply(this, arguments);\n }\n return setToSearchState;\n }()\n }, {\n key: \"setToSelectedContentState\",\n value: function () {\n var _setToSelectedContentState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(contentPlacementIds) {\n var lastContentPlacementId, selectedContentPlacement;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n lastContentPlacementId = contentPlacementIds[contentPlacementIds.length - 1];\n _context5.next = 3;\n return this.getContentPlacementDetails(lastContentPlacementId);\n case 3:\n selectedContentPlacement = _context5.sent;\n this.updateFloor(selectedContentPlacement.floor);\n this._stateCoordinator.transitionTo('selectedContent', {\n contentPlacementIds: contentPlacementIds,\n selectedContentPlacement: selectedContentPlacement\n });\n case 6:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function setToSelectedContentState(_x2) {\n return _setToSelectedContentState.apply(this, arguments);\n }\n return setToSelectedContentState;\n }()\n }, {\n key: \"setToDirectionsState\",\n value: function () {\n var _setToDirectionsState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n var startContentPlacementId,\n endContentPlacementId,\n startContentPlacement,\n endContentPlacement,\n _args6 = arguments;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n startContentPlacementId = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : null;\n endContentPlacementId = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : null;\n startContentPlacement = null;\n if (!startContentPlacementId) {\n _context6.next = 7;\n break;\n }\n _context6.next = 6;\n return this.getContentPlacementDetails(startContentPlacementId);\n case 6:\n startContentPlacement = _context6.sent;\n case 7:\n endContentPlacement = null;\n if (!endContentPlacementId) {\n _context6.next = 12;\n break;\n }\n _context6.next = 11;\n return this.getContentPlacementDetails(endContentPlacementId);\n case 11:\n endContentPlacement = _context6.sent;\n case 12:\n this._stateCoordinator.transitionTo('directions', {\n startContentPlacement: startContentPlacement,\n endContentPlacement: endContentPlacement\n });\n case 13:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function setToDirectionsState() {\n return _setToDirectionsState.apply(this, arguments);\n }\n return setToDirectionsState;\n }()\n }, {\n key: \"initiateBack\",\n value: function initiateBack() {\n this.fire('initiate:back');\n }\n }, {\n key: \"initiateSetToSearchState\",\n value: function initiateSetToSearchState() {\n this.fire('initiate:search');\n }\n }, {\n key: \"findPath\",\n value: function () {\n var _findPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(startContentPlacementId, endContentPlacementId) {\n var response_data;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return this.routesApi.findPath(this.mapData.map_id, startContentPlacementId, endContentPlacementId);\n case 2:\n response_data = _context7.sent;\n if (!response_data) {\n _context7.next = 7;\n break;\n }\n return _context7.abrupt(\"return\", response_data);\n case 7:\n console.error('Failed to find path.');\n case 8:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function findPath(_x3, _x4) {\n return _findPath.apply(this, arguments);\n }\n return findPath;\n }() // MARK: Map methods\n }, {\n key: \"_findFeatureByPlacementId\",\n value: function _findFeatureByPlacementId(placementId) {\n var features = this.map.queryRenderedFeatures({\n filter: ['==', ['get', 'placement_id'], placementId]\n });\n\n // Return the first feature that matches the placementId\n return features.length > 0 ? features[0] : null;\n }\n }, {\n key: \"getCenter\",\n value: function getCenter() {\n // Update to convert from lat, lon, to x, y in meters\n if (this.map) {\n return this.map.getCenter();\n } else {\n console.error('Map is not initialized.');\n }\n }\n }, {\n key: \"setCenter\",\n value: function setCenter(lngLat) {\n // Update to convert from lat, lon, to x, y in meters\n if (this.map) {\n this.map.setCenter(lngLat);\n } else {\n console.error('Map is not initialized.');\n }\n }\n }, {\n key: \"search\",\n value: function () {\n var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(query) {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n if (!(query === '')) {\n _context8.next = 2;\n break;\n }\n return _context8.abrupt(\"return\");\n case 2:\n if (this.mapData) {\n _context8.next = 4;\n break;\n }\n return _context8.abrupt(\"return\");\n case 4:\n _context8.prev = 4;\n _context8.next = 7;\n return this.searchApi.search(this.mapData.map_id, this.mapData.map_view_id, query);\n case 7:\n return _context8.abrupt(\"return\", _context8.sent);\n case 10:\n _context8.prev = 10;\n _context8.t0 = _context8[\"catch\"](4);\n if (axios.isCancel(_context8.t0)) {\n console.error('Request canceled:', _context8.t0.message);\n } else {\n console.error('Search error:', _context8.t0);\n }\n case 13:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this, [[4, 10]]);\n }));\n function search(_x5) {\n return _search.apply(this, arguments);\n }\n return search;\n }()\n }, {\n key: \"getContentPlacementDetails\",\n value: function () {\n var _getContentPlacementDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(contentPlacementId) {\n return _regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n _context9.prev = 0;\n _context9.next = 3;\n return this.searchApi.fetchContentPlacementDetails(contentPlacementId);\n case 3:\n return _context9.abrupt(\"return\", _context9.sent);\n case 6:\n _context9.prev = 6;\n _context9.t0 = _context9[\"catch\"](0);\n if (axios.isCancel(_context9.t0)) {\n console.error('Request canceled:', _context9.t0.message);\n } else {\n console.error('Fetching content placement details error:', _context9.t0);\n }\n case 9:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9, this, [[0, 6]]);\n }));\n function getContentPlacementDetails(_x6) {\n return _getContentPlacementDetails.apply(this, arguments);\n }\n return getContentPlacementDetails;\n }()\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n//# sourceURL=webpack://waygomaps/./src/components/MapView/MapView.js?");
794
794
 
795
795
  /***/ }),
796
796
 
package/dist/style.css CHANGED
@@ -103,30 +103,35 @@ body {
103
103
 
104
104
  .logo-outline-element {
105
105
  position: absolute;
106
- width: 80px;
107
- height: calc(80px * 0.25);
106
+ width: 85px;
107
+ height: calc(85px * 0.25);
108
108
  opacity: 0.25;
109
109
  }
110
110
 
111
111
  .logo-fill-element {
112
112
  position: relative;
113
- width: 80px;
114
- height: calc(80px * 0.25);
113
+ width: 85px;
114
+ height: calc(85px * 0.25);
115
115
  opacity: 1.0;
116
116
  }
117
117
 
118
118
  .website-container {
119
119
  position: absolute;
120
- right: 0px;
121
- bottom: 0px;
120
+ right: 10px;
121
+ bottom: 10px;
122
+ /* right: 0px; */
123
+ /* bottom: 0px; */
122
124
  height: fit-content;
123
125
  width: fit-content;
124
126
  cursor: pointer;
125
- background-color: rgba(255, 255, 255, 0.45);
126
- padding: 1px 5px;
127
+ background-color: rgba(255, 255, 255, 1.0);
128
+ /* background-color: rgba(255, 255, 255, 0.45); */
129
+ /* padding: 0px 5px; */
130
+ padding: 3px 10px;
127
131
  font-family: 'Inter', sans-serif;
128
132
  font-size: 12px;
129
133
  color: #1e1e1e;
134
+ border-radius: 30px;
130
135
  }
131
136
 
132
137
  .website-container:hover {
@@ -384,7 +389,7 @@ body {
384
389
 
385
390
  /* max-height: fit-content; */
386
391
  /* max-height: calc(100% - 400px); */
387
- padding: 8px 14px 14px 14px;
392
+ padding: 8px 14px 34px 14px;
388
393
  }
389
394
 
390
395
  .search-results-control-container.mobile-view {
@@ -482,6 +487,7 @@ body {
482
487
  padding: 2px 13px 0px 13px;
483
488
  /* z-index: 9; */
484
489
  overflow-y: hidden;
490
+ /* background-color: beige; */
485
491
  /* Prevent internal scrolling */
486
492
  /* transition: bottom 0.3s ease; */
487
493
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygo-maps",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "main": "dist/bundle.js",
5
5
  "files": [
6
6
  "dist/bundle.js",