waygo-maps 1.1.101 → 1.1.103

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 _components_QRCodeView_QRCodeView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/QRCodeView/QRCodeView */ \"./src/components/QRCodeView/QRCodeView.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\n/* harmony import */ var _assets_qrCodeIcon_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../assets/qrCodeIcon.svg */ \"./src/assets/qrCodeIcon.svg\");\n/* harmony import */ var _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../assets/cancel.svg */ \"./src/assets/cancel.svg\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_8__ = __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\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 _this.fromLocation = false;\n _this.qrCodeView = null;\n _this.qrCodeButton = null;\n _this.pathData = null;\n return _this;\n }\n _inherits(DirectionsControl, _Control);\n return _createClass(DirectionsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n var _this$map$mapData;\n console.log('🔵 DirectionsControl: onAdd called');\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 floorData: ((_this$map$mapData = this.map.mapData) === null || _this$map$mapData === void 0 ? void 0 : _this$map$mapData.floors) || []\n });\n this.qrCodeView = new _components_QRCodeView_QRCodeView__WEBPACK_IMPORTED_MODULE_4__[\"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 var _this2 = this;\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('state:setup', this._handleSetupState.bind(this));\n this.map.on('initiate:findPath', this._handleIntiateFindPath.bind(this));\n this.map.on('initiate:findPathFromLocation', this._handleInitiateFindPathFromLocation.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', function (data) {\n return _this2.map.initiateFindPath(data.startContentPlacementId, data.endContentPlacementId);\n });\n this.directionsView.on('initiate:findPathFromLocation', function (data) {\n return _this2.map.initiateFindPathFromLocation(data.endContentPlacement);\n });\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 _this$map$mapData2, _this$map$mapData3;\n var endContentPlacement = data.endContentPlacement;\n this.endContentPlacement = endContentPlacement;\n var referenceCoordinate = ((_this$map$mapData2 = this.map.mapData) === null || _this$map$mapData2 === void 0 ? void 0 : _this$map$mapData2.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData3 = this.map.mapData) === null || _this$map$mapData3 === void 0 ? void 0 : _this$map$mapData3.coordinate_scaling_multiplier) || 30.0;\n var _convertVertexToCoord = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__.convertVertexToCoordinate)(endContentPlacement.location, referenceCoordinate, scaleFactor),\n lat = _convertVertexToCoord.lat,\n lon = _convertVertexToCoord.lon;\n var coordinate = [lon, lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.catalog && endContentPlacement.content) {\n var titleKey = endContentPlacement.catalog.content_title_key;\n if (titleKey) {\n // const 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 _this$map$mapData4, _this$map$mapData5;\n var startContentPlacement = data.startContentPlacement;\n this.startContentPlacement = startContentPlacement;\n var referenceCoordinate = ((_this$map$mapData4 = this.map.mapData) === null || _this$map$mapData4 === void 0 ? void 0 : _this$map$mapData4.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData5 = this.map.mapData) === null || _this$map$mapData5 === void 0 ? void 0 : _this$map$mapData5.coordinate_scaling_multiplier) || 30.0;\n var _convertVertexToCoord2 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__.convertVertexToCoordinate)(startContentPlacement.location, referenceCoordinate, scaleFactor),\n lat = _convertVertexToCoord2.lat,\n lon = _convertVertexToCoord2.lon;\n var coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.catalog && startContentPlacement.content) {\n var titleKey = startContentPlacement.catalog.content_title_key;\n if (titleKey) {\n // const 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_8__[\"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_8__[\"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 console.log('🔵 DirectionsControl: _renderDesktopView called');\n if (!this.directionsView) {\n console.warn('⚠️ DirectionsControl: directionsView is null');\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\n // Add QR code button if in kiosk mode and path exists\n if (this._shouldShowQRCodeButton()) {\n if (!this.qrCodeButton || !this.qrCodeButton.parentNode) {\n this._createQRCodeButton();\n }\n this.container.appendChild(this.qrCodeButton);\n } else if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n this.container.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n console.log('🔵 DirectionsControl: _renderMobileView called');\n if (!this.directionsView) {\n console.warn('⚠️ DirectionsControl: directionsView is null');\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\n // Add QR code button if in kiosk mode and path exists\n if (this._shouldShowQRCodeButton()) {\n if (!this.qrCodeButton || !this.qrCodeButton.parentNode) {\n this._createQRCodeButton();\n }\n this.container.appendChild(this.qrCodeButton);\n } else if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n this.container.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 var _this$map$mapData6, _this$map$mapData7;\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 });\n var referenceCoordinate = ((_this$map$mapData6 = this.map.mapData) === null || _this$map$mapData6 === void 0 ? void 0 : _this$map$mapData6.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData7 = this.map.mapData) === null || _this$map$mapData7 === void 0 ? void 0 : _this$map$mapData7.coordinate_scaling_multiplier) || 30.0;\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__.convertVerticesToCoordinates)(points, referenceCoordinate, scaleFactor);\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\", 18), \"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: 18,\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: \"_handleSetupState\",\n value: function _handleSetupState() {\n this.hide();\n }\n }, {\n key: \"clearData\",\n value: function clearData() {\n this.pathData = null;\n this.clearLineData();\n this.stepsView.clear();\n if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function () {\n var _handleDirectionsState2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {\n var _this$map$mapData8, _this$map$mapData9;\n var startContentPlacement, endContentPlacement, startNodeId, referenceCoordinate, scaleFactor, _convertVertexToCoord3, lat, lon, coordinate, titleKey, title, _convertVertexToCoord4, _lat, _lon, _coordinate, _titleKey, _title, nodeIdToUse, firstLocation, _convertVertexToCoord5, _lat2, _lon2, _coordinate2;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n console.log('🔵 DirectionsControl: _handleDirectionsState called', data);\n startContentPlacement = data.startContentPlacement, endContentPlacement = data.endContentPlacement, startNodeId = data.startNodeId;\n this.clearData();\n\n // Re-render the view to ensure all elements are in the DOM\n console.log('🔵 DirectionsControl: Current view type:', this.currentViewType);\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n this.show();\n this.startContentPlacement = startContentPlacement;\n this.endContentPlacement = endContentPlacement;\n this.directionsView.updateView(startContentPlacement, endContentPlacement);\n referenceCoordinate = ((_this$map$mapData8 = this.map.mapData) === null || _this$map$mapData8 === void 0 ? void 0 : _this$map$mapData8.reference_coordinate) || [0.0, 0.0];\n scaleFactor = ((_this$map$mapData9 = this.map.mapData) === null || _this$map$mapData9 === void 0 ? void 0 : _this$map$mapData9.coordinate_scaling_multiplier) || 30.0;\n if (startContentPlacement) {\n _convertVertexToCoord3 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__.convertVertexToCoordinate)(startContentPlacement.location, referenceCoordinate, scaleFactor), lat = _convertVertexToCoord3.lat, lon = _convertVertexToCoord3.lon;\n coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.catalog && startContentPlacement.content) {\n titleKey = startContentPlacement.catalog.content_title_key;\n if (titleKey) {\n 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 if (!endContentPlacement) {\n _context3.next = 30;\n break;\n }\n _convertVertexToCoord4 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__.convertVertexToCoordinate)(endContentPlacement.location, referenceCoordinate, scaleFactor), _lat = _convertVertexToCoord4.lat, _lon = _convertVertexToCoord4.lon;\n _coordinate = [_lon, _lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.catalog && endContentPlacement.content) {\n _titleKey = endContentPlacement.catalog.content_title_key;\n if (_titleKey) {\n _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 // Determine which node ID to use: prioritize startNodeId if provided\n nodeIdToUse = null;\n if (startNodeId != null && startNodeId !== '') {\n // Explicitly provided node ID takes priority\n nodeIdToUse = startNodeId;\n console.log('�� DirectionsControl: Using provided startNodeId:', startNodeId);\n } else if (this.map.location && !startContentPlacement) {\n // Fall back to map.location if no startContentPlacement\n nodeIdToUse = this.map.location;\n console.log('�� DirectionsControl: Using map.location:', this.map.location);\n }\n if (!nodeIdToUse) {\n _context3.next = 29;\n break;\n }\n console.log('�� DirectionsControl: Finding path from node to end placement, nodeId:', nodeIdToUse);\n // Find path from node to the end placement\n _context3.next = 24;\n return this.map.findPathFromNodeToPlacement(nodeIdToUse, endContentPlacement.placement_id);\n case 24:\n this.pathData = _context3.sent;\n console.log('�� DirectionsControl: Path data received:', !!this.pathData);\n if (this.pathData) {\n this.fromLocation = true;\n this.directionsView.setNewPath(this.pathData, true);\n firstLocation = this.pathData.legs[0].steps[0].path[0];\n _convertVertexToCoord5 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__.convertVertexToCoordinate)(firstLocation, referenceCoordinate, scaleFactor), _lat2 = _convertVertexToCoord5.lat, _lon2 = _convertVertexToCoord5.lon;\n _coordinate2 = [_lon2, _lat2];\n this.map.addHighlightedFeature(_coordinate2, {\n '_floor': this.pathData.legs[0].floor,\n 'name': 'Start'\n });\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n } else {\n console.warn('⚠️ DirectionsControl: No path data returned');\n }\n _context3.next = 30;\n break;\n case 29:\n console.log('🔵 DirectionsControl: Not finding path from node. startNodeId?', startNodeId, 'map.location?', !!this.map.location, 'startContentPlacement?', !!startContentPlacement);\n case 30:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _handleDirectionsState(_x3) {\n return _handleDirectionsState2.apply(this, arguments);\n }\n return _handleDirectionsState;\n }()\n }, {\n key: \"_handleInitiateFindPathFromLocation\",\n value: function () {\n var _handleInitiateFindPathFromLocation2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {\n var endContentPlacement;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n console.log('�� DirectionsControl: _handleInitiateFindPathFromLocation called', data);\n endContentPlacement = data.endContentPlacement;\n if (!(this.map.location && endContentPlacement)) {\n _context4.next = 7;\n break;\n }\n _context4.next = 5;\n return this.map.findPathFromNodeToPlacement(this.map.location, endContentPlacement.placement_id);\n case 5:\n this.pathData = _context4.sent;\n if (this.pathData) {\n this.fromLocation = true;\n this.directionsView.setNewPath(this.pathData, true);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n }\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _handleInitiateFindPathFromLocation(_x4) {\n return _handleInitiateFindPathFromLocation2.apply(this, arguments);\n }\n return _handleInitiateFindPathFromLocation;\n }() // async _handleInitiateFindNodeToPlacementPath(data) {\n // const { startNodeId, endContentPlacementId } = data;\n // this.pathData = await this.map.findPathNodeToPlacement(startNodeId, endContentPlacementId);\n // }\n }, {\n key: \"_handleIntiateFindPath\",\n value: function () {\n var _handleIntiateFindPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {\n var startContentPlacementId, endContentPlacementId;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n console.log('🔵 DirectionsControl: _handleIntiateFindPath called', data);\n startContentPlacementId = data.startContentPlacementId, endContentPlacementId = data.endContentPlacementId;\n _context5.next = 4;\n return this.map.findPath(startContentPlacementId, endContentPlacementId);\n case 4:\n this.pathData = _context5.sent;\n this.fromLocation = false;\n this.directionsView.setNewPath(this.pathData);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n case 10:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _handleIntiateFindPath(_x5) {\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 key: \"_shouldShowQRCodeButton\",\n value: function _shouldShowQRCodeButton() {\n // Only show in kiosk mode (not setup state)\n if (!this.map.location) {\n return false;\n }\n\n // Check if feature is enabled\n if (this.map.options.showQRCodeInKioskMode === false) {\n return false;\n }\n\n // Only show when path data exists\n if (!this.pathData) {\n return false;\n }\n\n // Only show when we have end placement\n if (!this.endContentPlacement) {\n return false;\n }\n return true;\n }\n }, {\n key: \"_createQRCodeButton\",\n value: function _createQRCodeButton() {\n this.qrCodeButton = document.createElement('button');\n this.qrCodeButton.className = 'qr-code-button';\n var iconContainer = document.createElement('div');\n iconContainer.className = 'qr-code-button-icon';\n var icon = document.createElement('img');\n icon.src = _assets_qrCodeIcon_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n icon.alt = 'QR Code';\n iconContainer.appendChild(icon);\n var textContainer = document.createElement('div');\n textContainer.className = 'qr-code-button-text';\n textContainer.textContent = 'Continue on your phone ->';\n this.qrCodeButton.appendChild(iconContainer);\n this.qrCodeButton.appendChild(textContainer);\n this.qrCodeButton.addEventListener('click', this._showQRCodeModal.bind(this));\n }\n }, {\n key: \"_generateQRCodeURL\",\n value: function _generateQRCodeURL() {\n if (!this.map.mapData || !this.endContentPlacement) {\n return null;\n }\n var mapId = this.map.mapData.map_id;\n var mapViewId = this.map.mapData.map_view_id;\n var endPlacementId = this.endContentPlacement.placement_id;\n var startPlacementId;\n if (this.fromLocation) {\n // Use the node ID when path starts from kiosk location\n startPlacementId = this.map.location;\n } else if (this.startContentPlacement) {\n // Use the placement ID when path starts from a content placement\n startPlacementId = this.startContentPlacement.placement_id;\n } else {\n return null;\n }\n var url = \"https://maps.waygomaps.com/\".concat(mapId, \"/\").concat(mapViewId, \"/directions/\").concat(startPlacementId, \"/\").concat(endPlacementId);\n return url;\n }\n }, {\n key: \"_showQRCodeModal\",\n value: function () {\n var _showQRCodeModal2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n var _this3 = this,\n _this$map$modalContai;\n var url, modalContent, closeButton, closeIcon, modalContentWrapper;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n url = this._generateQRCodeURL();\n if (url) {\n _context6.next = 4;\n break;\n }\n console.warn('⚠️ DirectionsControl: No URL generated for QR code');\n return _context6.abrupt(\"return\");\n case 4:\n // Create modal content wrapper\n modalContent = document.createElement('div');\n modalContent.className = 'qr-code-modal-card';\n\n // Create close button\n closeButton = document.createElement('button');\n closeButton.className = 'qr-code-modal-close';\n closeIcon = document.createElement('img');\n closeIcon.src = _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n closeIcon.alt = 'Close';\n closeButton.appendChild(closeIcon);\n closeButton.addEventListener('click', function () {\n _this3.map.hideModal();\n });\n modalContent.appendChild(closeButton);\n\n // Update and add QR code view\n _context6.next = 16;\n return this.qrCodeView.updateQRCode(url, 250);\n case 16:\n modalContent.appendChild(this.qrCodeView.getElement());\n\n // Show modal and adjust modal content styling for QR code\n this.map.showModal(modalContent);\n\n // Adjust modal content wrapper styling for QR code card\n modalContentWrapper = (_this$map$modalContai = this.map.modalContainer) === null || _this$map$modalContai === void 0 ? void 0 : _this$map$modalContai.querySelector('.waygo-map-modal-content');\n if (modalContentWrapper) {\n modalContentWrapper.style.backgroundColor = 'transparent';\n modalContentWrapper.style.width = 'auto';\n modalContentWrapper.style.height = 'auto';\n modalContentWrapper.style.maxWidth = 'none';\n modalContentWrapper.style.maxHeight = 'none';\n }\n case 20:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function _showQRCodeModal() {\n return _showQRCodeModal2.apply(this, arguments);\n }\n return _showQRCodeModal;\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 _components_QRCodeView_QRCodeView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/QRCodeView/QRCodeView */ \"./src/components/QRCodeView/QRCodeView.js\");\n/* harmony import */ var _components_GpsFallbackPopup_GpsFallbackPopup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/GpsFallbackPopup/GpsFallbackPopup */ \"./src/components/GpsFallbackPopup/GpsFallbackPopup.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\n/* harmony import */ var _assets_qrCodeIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../assets/qrCodeIcon.svg */ \"./src/assets/qrCodeIcon.svg\");\n/* harmony import */ var _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../assets/cancel.svg */ \"./src/assets/cancel.svg\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __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\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 _this.fromLocation = false;\n _this.qrCodeView = null;\n _this.qrCodeButton = null;\n _this.pathData = null;\n return _this;\n }\n _inherits(DirectionsControl, _Control);\n return _createClass(DirectionsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n var _this$map$mapData;\n console.log('🔵 DirectionsControl: onAdd called');\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 floorData: ((_this$map$mapData = this.map.mapData) === null || _this$map$mapData === void 0 ? void 0 : _this$map$mapData.floors) || []\n });\n this.qrCodeView = new _components_QRCodeView_QRCodeView__WEBPACK_IMPORTED_MODULE_4__[\"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 var _this2 = this;\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('state:setup', this._handleSetupState.bind(this));\n this.map.on('initiate:findPath', this._handleIntiateFindPath.bind(this));\n this.map.on('initiate:findPathFromLocation', this._handleInitiateFindPathFromLocation.bind(this));\n this.map.on('gps:fallback', this._handleGpsFallback.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', function (data) {\n return _this2.map.initiateFindPath(data.startContentPlacementId, data.endContentPlacementId);\n });\n this.directionsView.on('initiate:findPathFromLocation', function (data) {\n return _this2.map.initiateFindPathFromLocation(data.endContentPlacement);\n });\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.directionsView.on('selectGpsCurrentLocation', this._handleSelectGpsCurrentLocation.bind(this));\n this.stepsView.on('legSelect', this._handleLegChange.bind(this));\n }\n }, {\n key: \"_handleEndContentPlacementSelected\",\n value: function _handleEndContentPlacementSelected(data) {\n var _this$map$mapData2, _this$map$mapData3;\n var endContentPlacement = data.endContentPlacement;\n this.endContentPlacement = endContentPlacement;\n var referenceCoordinate = ((_this$map$mapData2 = this.map.mapData) === null || _this$map$mapData2 === void 0 ? void 0 : _this$map$mapData2.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData3 = this.map.mapData) === null || _this$map$mapData3 === void 0 ? void 0 : _this$map$mapData3.coordinate_scaling_multiplier) || 30.0;\n var _convertVertexToCoord = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(endContentPlacement.location, referenceCoordinate, scaleFactor),\n lat = _convertVertexToCoord.lat,\n lon = _convertVertexToCoord.lon;\n var coordinate = [lon, lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.catalog && endContentPlacement.content) {\n var titleKey = endContentPlacement.catalog.content_title_key;\n if (titleKey) {\n // const 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 _this$map$mapData4, _this$map$mapData5;\n var startContentPlacement = data.startContentPlacement;\n this.startContentPlacement = startContentPlacement;\n var referenceCoordinate = ((_this$map$mapData4 = this.map.mapData) === null || _this$map$mapData4 === void 0 ? void 0 : _this$map$mapData4.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData5 = this.map.mapData) === null || _this$map$mapData5 === void 0 ? void 0 : _this$map$mapData5.coordinate_scaling_multiplier) || 30.0;\n var _convertVertexToCoord2 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(startContentPlacement.location, referenceCoordinate, scaleFactor),\n lat = _convertVertexToCoord2.lat,\n lon = _convertVertexToCoord2.lon;\n var coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.catalog && startContentPlacement.content) {\n var titleKey = startContentPlacement.catalog.content_title_key;\n if (titleKey) {\n // const 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_9__[\"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_9__[\"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 console.log('🔵 DirectionsControl: _renderDesktopView called');\n if (!this.directionsView) {\n console.warn('⚠️ DirectionsControl: directionsView is null');\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\n // Add QR code button if in kiosk mode and path exists\n if (this._shouldShowQRCodeButton()) {\n if (!this.qrCodeButton || !this.qrCodeButton.parentNode) {\n this._createQRCodeButton();\n }\n this.container.appendChild(this.qrCodeButton);\n } else if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n this.container.appendChild(this.stepsView.getElement());\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n console.log('🔵 DirectionsControl: _renderMobileView called');\n if (!this.directionsView) {\n console.warn('⚠️ DirectionsControl: directionsView is null');\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\n // Add QR code button if in kiosk mode and path exists\n if (this._shouldShowQRCodeButton()) {\n if (!this.qrCodeButton || !this.qrCodeButton.parentNode) {\n this._createQRCodeButton();\n }\n this.container.appendChild(this.qrCodeButton);\n } else if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n this.container.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 var _this$map$mapData6, _this$map$mapData7;\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 });\n var referenceCoordinate = ((_this$map$mapData6 = this.map.mapData) === null || _this$map$mapData6 === void 0 ? void 0 : _this$map$mapData6.reference_coordinate) || [0.0, 0.0];\n var scaleFactor = ((_this$map$mapData7 = this.map.mapData) === null || _this$map$mapData7 === void 0 ? void 0 : _this$map$mapData7.coordinate_scaling_multiplier) || 30.0;\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVerticesToCoordinates)(points, referenceCoordinate, scaleFactor);\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\", 18), \"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: 18,\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: \"_handleSetupState\",\n value: function _handleSetupState() {\n this.hide();\n }\n }, {\n key: \"clearData\",\n value: function clearData() {\n this.pathData = null;\n this.clearLineData();\n this.stepsView.clear();\n if (this.qrCodeButton && this.qrCodeButton.parentNode) {\n this.qrCodeButton.parentNode.removeChild(this.qrCodeButton);\n }\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function () {\n var _handleDirectionsState2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {\n var _this3 = this,\n _this$map$mapData8,\n _this$map$mapData9;\n var startContentPlacement, endContentPlacement, startNodeId, showGpsCell, referenceCoordinate, scaleFactor, _convertVertexToCoord3, lat, lon, coordinate, titleKey, title, _convertVertexToCoord4, _lat, _lon, _coordinate, _titleKey, _title, nodeIdToUse, firstLocation, _convertVertexToCoord5, _lat2, _lon2, _coordinate2;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n console.log('🔵 DirectionsControl: _handleDirectionsState called', data);\n startContentPlacement = data.startContentPlacement, endContentPlacement = data.endContentPlacement, startNodeId = data.startNodeId;\n this.clearData();\n\n // Re-render the view to ensure all elements are in the DOM\n console.log('🔵 DirectionsControl: Current view type:', this.currentViewType);\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n this.show();\n this.startContentPlacement = startContentPlacement;\n this.endContentPlacement = endContentPlacement;\n this.directionsView.updateView(startContentPlacement, endContentPlacement);\n\n // GPS \"Use current location\" cell handling\n showGpsCell = this.map.shouldShowGpsCell && this.map.shouldShowGpsCell() && !startContentPlacement && !startNodeId && endContentPlacement;\n if (showGpsCell) {\n this.directionsView.enableGpsStartCell();\n setTimeout(function () {\n return _this3.directionsView.focusStartInput();\n }, 50);\n } else {\n this.directionsView.disableGpsStartCell();\n }\n referenceCoordinate = ((_this$map$mapData8 = this.map.mapData) === null || _this$map$mapData8 === void 0 ? void 0 : _this$map$mapData8.reference_coordinate) || [0.0, 0.0];\n scaleFactor = ((_this$map$mapData9 = this.map.mapData) === null || _this$map$mapData9 === void 0 ? void 0 : _this$map$mapData9.coordinate_scaling_multiplier) || 30.0;\n if (startContentPlacement) {\n _convertVertexToCoord3 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(startContentPlacement.location, referenceCoordinate, scaleFactor), lat = _convertVertexToCoord3.lat, lon = _convertVertexToCoord3.lon;\n coordinate = [lon, lat];\n if (!startContentPlacement.name) {\n if (startContentPlacement.catalog && startContentPlacement.content) {\n titleKey = startContentPlacement.catalog.content_title_key;\n if (titleKey) {\n 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 if (!endContentPlacement) {\n _context3.next = 32;\n break;\n }\n _convertVertexToCoord4 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(endContentPlacement.location, referenceCoordinate, scaleFactor), _lat = _convertVertexToCoord4.lat, _lon = _convertVertexToCoord4.lon;\n _coordinate = [_lon, _lat];\n if (!endContentPlacement.name) {\n if (endContentPlacement.catalog && endContentPlacement.content) {\n _titleKey = endContentPlacement.catalog.content_title_key;\n if (_titleKey) {\n _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 // Determine which node ID to use: prioritize startNodeId if provided\n nodeIdToUse = null;\n if (startNodeId != null && startNodeId !== '') {\n // Explicitly provided node ID takes priority\n nodeIdToUse = startNodeId;\n console.log('�� DirectionsControl: Using provided startNodeId:', startNodeId);\n } else if (this.map.location && !startContentPlacement) {\n // Fall back to map.location if no startContentPlacement\n nodeIdToUse = this.map.location;\n console.log('�� DirectionsControl: Using map.location:', this.map.location);\n }\n if (!nodeIdToUse) {\n _context3.next = 31;\n break;\n }\n console.log('�� DirectionsControl: Finding path from node to end placement, nodeId:', nodeIdToUse);\n // Find path from node to the end placement\n _context3.next = 26;\n return this.map.findPathFromNodeToPlacement(nodeIdToUse, endContentPlacement.placement_id);\n case 26:\n this.pathData = _context3.sent;\n console.log('�� DirectionsControl: Path data received:', !!this.pathData);\n if (this.pathData) {\n this.fromLocation = true;\n this.directionsView.setNewPath(this.pathData, true);\n firstLocation = this.pathData.legs[0].steps[0].path[0];\n _convertVertexToCoord5 = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_6__.convertVertexToCoordinate)(firstLocation, referenceCoordinate, scaleFactor), _lat2 = _convertVertexToCoord5.lat, _lon2 = _convertVertexToCoord5.lon;\n _coordinate2 = [_lon2, _lat2];\n this.map.addHighlightedFeature(_coordinate2, {\n '_floor': this.pathData.legs[0].floor,\n 'name': 'Start'\n });\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n } else {\n console.warn('⚠️ DirectionsControl: No path data returned');\n }\n _context3.next = 32;\n break;\n case 31:\n console.log('🔵 DirectionsControl: Not finding path from node. startNodeId?', startNodeId, 'map.location?', !!this.map.location, 'startContentPlacement?', !!startContentPlacement);\n case 32:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _handleDirectionsState(_x3) {\n return _handleDirectionsState2.apply(this, arguments);\n }\n return _handleDirectionsState;\n }()\n }, {\n key: \"_handleInitiateFindPathFromLocation\",\n value: function () {\n var _handleInitiateFindPathFromLocation2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {\n var endContentPlacement;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n console.log('�� DirectionsControl: _handleInitiateFindPathFromLocation called', data);\n endContentPlacement = data.endContentPlacement;\n if (!(this.map.location && endContentPlacement)) {\n _context4.next = 7;\n break;\n }\n _context4.next = 5;\n return this.map.findPathFromNodeToPlacement(this.map.location, endContentPlacement.placement_id);\n case 5:\n this.pathData = _context4.sent;\n if (this.pathData) {\n this.fromLocation = true;\n this.directionsView.setNewPath(this.pathData, true);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n }\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _handleInitiateFindPathFromLocation(_x4) {\n return _handleInitiateFindPathFromLocation2.apply(this, arguments);\n }\n return _handleInitiateFindPathFromLocation;\n }() // async _handleInitiateFindNodeToPlacementPath(data) {\n // const { startNodeId, endContentPlacementId } = data;\n // this.pathData = await this.map.findPathNodeToPlacement(startNodeId, endContentPlacementId);\n // }\n }, {\n key: \"_handleIntiateFindPath\",\n value: function () {\n var _handleIntiateFindPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {\n var startContentPlacementId, endContentPlacementId;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n console.log('🔵 DirectionsControl: _handleIntiateFindPath called', data);\n startContentPlacementId = data.startContentPlacementId, endContentPlacementId = data.endContentPlacementId;\n _context5.next = 4;\n return this.map.findPath(startContentPlacementId, endContentPlacementId);\n case 4:\n this.pathData = _context5.sent;\n this.fromLocation = false;\n this.directionsView.setNewPath(this.pathData);\n if (this.currentViewType === 'mobile') {\n this.stepsView.setNewPath(this.pathData, false, this.map.mapData.floors);\n } else {\n this.stepsView.setNewPath(this.pathData, true, this.map.mapData.floors);\n }\n this.updateMapForPathLeg(this.pathData.legs[0]);\n\n // Re-render to show QR code button if applicable\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n case 10:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function _handleIntiateFindPath(_x5) {\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: \"_handleSelectGpsCurrentLocation\",\n value: function () {\n var _handleSelectGpsCurrentLocation2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n if (this.endContentPlacement) {\n _context6.next = 3;\n break;\n }\n console.warn('⚠️ DirectionsControl: GPS cell selected but no end placement set');\n return _context6.abrupt(\"return\");\n case 3:\n _context6.next = 5;\n return this.map.useCurrentLocation(this.endContentPlacement.placement_id);\n case 5:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function _handleSelectGpsCurrentLocation() {\n return _handleSelectGpsCurrentLocation2.apply(this, arguments);\n }\n return _handleSelectGpsCurrentLocation;\n }()\n }, {\n key: \"_handleGpsFallback\",\n value: function _handleGpsFallback(data) {\n var _this4 = this;\n var reason = data.reason;\n if (!this.gpsFallbackPopup) {\n this.gpsFallbackPopup = new _components_GpsFallbackPopup_GpsFallbackPopup__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n }\n this.gpsFallbackPopup.show(this.map, reason, function () {\n if (_this4.map.shouldShowGpsCell && _this4.map.shouldShowGpsCell()) {\n setTimeout(function () {\n return _this4.directionsView.focusStartInput();\n }, 50);\n } else {\n _this4.directionsView.disableGpsStartCell();\n }\n });\n }\n }, {\n key: \"_render\",\n value: function _render() {\n return;\n }\n }, {\n key: \"_shouldShowQRCodeButton\",\n value: function _shouldShowQRCodeButton() {\n // Only show in kiosk mode (not setup state)\n if (!this.map.location) {\n return false;\n }\n\n // Check if feature is enabled\n if (this.map.options.showQRCodeInKioskMode === false) {\n return false;\n }\n\n // Only show when path data exists\n if (!this.pathData) {\n return false;\n }\n\n // Only show when we have end placement\n if (!this.endContentPlacement) {\n return false;\n }\n return true;\n }\n }, {\n key: \"_createQRCodeButton\",\n value: function _createQRCodeButton() {\n this.qrCodeButton = document.createElement('button');\n this.qrCodeButton.className = 'qr-code-button';\n var iconContainer = document.createElement('div');\n iconContainer.className = 'qr-code-button-icon';\n var icon = document.createElement('img');\n icon.src = _assets_qrCodeIcon_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n icon.alt = 'QR Code';\n iconContainer.appendChild(icon);\n var textContainer = document.createElement('div');\n textContainer.className = 'qr-code-button-text';\n textContainer.textContent = 'Continue on your phone ->';\n this.qrCodeButton.appendChild(iconContainer);\n this.qrCodeButton.appendChild(textContainer);\n this.qrCodeButton.addEventListener('click', this._showQRCodeModal.bind(this));\n }\n }, {\n key: \"_generateQRCodeURL\",\n value: function _generateQRCodeURL() {\n if (!this.map.mapData || !this.endContentPlacement) {\n return null;\n }\n var mapId = this.map.mapData.map_id;\n var mapViewId = this.map.mapData.map_view_id;\n var endPlacementId = this.endContentPlacement.placement_id;\n var startPlacementId;\n if (this.fromLocation) {\n // Use the node ID when path starts from kiosk location\n startPlacementId = this.map.location;\n } else if (this.startContentPlacement) {\n // Use the placement ID when path starts from a content placement\n startPlacementId = this.startContentPlacement.placement_id;\n } else {\n return null;\n }\n var url = \"https://maps.waygomaps.com/\".concat(mapId, \"/\").concat(mapViewId, \"/directions/\").concat(startPlacementId, \"/\").concat(endPlacementId);\n return url;\n }\n }, {\n key: \"_showQRCodeModal\",\n value: function () {\n var _showQRCodeModal2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n var _this5 = this,\n _this$map$modalContai;\n var url, modalContent, closeButton, closeIcon, modalContentWrapper;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n url = this._generateQRCodeURL();\n if (url) {\n _context7.next = 4;\n break;\n }\n console.warn('⚠️ DirectionsControl: No URL generated for QR code');\n return _context7.abrupt(\"return\");\n case 4:\n // Create modal content wrapper\n modalContent = document.createElement('div');\n modalContent.className = 'qr-code-modal-card';\n\n // Create close button\n closeButton = document.createElement('button');\n closeButton.className = 'qr-code-modal-close';\n closeIcon = document.createElement('img');\n closeIcon.src = _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n closeIcon.alt = 'Close';\n closeButton.appendChild(closeIcon);\n closeButton.addEventListener('click', function () {\n _this5.map.hideModal();\n });\n modalContent.appendChild(closeButton);\n\n // Update and add QR code view\n _context7.next = 16;\n return this.qrCodeView.updateQRCode(url, 250);\n case 16:\n modalContent.appendChild(this.qrCodeView.getElement());\n\n // Show modal and adjust modal content styling for QR code\n this.map.showModal(modalContent);\n\n // Adjust modal content wrapper styling for QR code card\n modalContentWrapper = (_this$map$modalContai = this.map.modalContainer) === null || _this$map$modalContai === void 0 ? void 0 : _this$map$modalContai.querySelector('.waygo-map-modal-content');\n if (modalContentWrapper) {\n modalContentWrapper.style.backgroundColor = 'transparent';\n modalContentWrapper.style.width = 'auto';\n modalContentWrapper.style.height = 'auto';\n modalContentWrapper.style.maxWidth = 'none';\n modalContentWrapper.style.maxHeight = 'none';\n }\n case 20:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function _showQRCodeModal() {\n return _showQRCodeModal2.apply(this, arguments);\n }\n return _showQRCodeModal;\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
 
@@ -779,7 +779,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
779
779
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
780
780
 
781
781
  "use strict";
782
- 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_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SearchBox/SearchBox */ \"./src/components/SearchBox/SearchBox.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _assets_pinOutlineIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../assets/pinOutlineIcon.svg */ \"./src/assets/pinOutlineIcon.svg\");\n/* harmony import */ var _assets_loading_spinner_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../assets/loading-spinner.svg */ \"./src/assets/loading-spinner.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 _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// import StepsView from \"../DirectionsView/StepsView\";\n\n\n\nvar DirectionsView = /*#__PURE__*/function (_Component) {\n function DirectionsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsView);\n _this = _callSuper(this, DirectionsView, [options]);\n _this.startSearchBox = new _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"](); // Create a SearchBox for the start location\n _this.endSearchBox = new _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"](); // Create a SearchBox for the end location\n\n _this.startContentPlacement = null;\n _this.endContentPlacement = null;\n _this.pathData = null;\n _this.fromLocation = false;\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSearchApi();\n\n // this.stepsView = new StepsView();\n\n _this._initialize();\n return _this;\n }\n _inherits(DirectionsView, _Component);\n return _createClass(DirectionsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement(\"div\");\n this.element.className = \"directions-view\";\n this.directionsViewHeader = document.createElement(\"div\");\n this.directionsViewHeader.className = \"directions-view-header\";\n this.searchBoxesContainer = document.createElement('div');\n this.searchBoxesContainer.className = \"directions-search-boxes-container\";\n this.circlesAndSearchWrapper = document.createElement('div');\n this.circlesAndSearchWrapper.className = 'directions-circles-search-wrapper';\n var circlesContainer = this._createCirclesContainer();\n this.circlesAndSearchWrapper.appendChild(circlesContainer);\n this.startSearchBox.searchBar.updateLeftButtonIcon('none');\n this.startSearchBox.searchBar.updateRightButtonIcon('none');\n this.endSearchBox.searchBar.updateLeftButtonIcon('none');\n this.endSearchBox.searchBar.updateRightButtonIcon('none');\n this.startSearchBox.searchBar.setPlaceholderText('Choose starting point');\n this.endSearchBox.searchBar.setPlaceholderText('Choose destination');\n this.searchBoxesContainer.appendChild(this.startSearchBox.getElement());\n this.searchBoxesContainer.appendChild(this.endSearchBox.getElement());\n this.circlesAndSearchWrapper.appendChild(this.searchBoxesContainer);\n this.directionsViewHeader.appendChild(this.circlesAndSearchWrapper);\n this._render();\n this._setupEventListeners();\n }\n }, {\n key: \"_createCirclesContainer\",\n value: function _createCirclesContainer() {\n var circlesContainer = document.createElement('div');\n circlesContainer.className = \"directions-circles-container\";\n var startCircle = document.createElement('div');\n startCircle.className = \"large-circle\";\n var endCircle = document.createElement('div');\n endCircle.className = \"end-circle\";\n var smallCircle1 = document.createElement('div');\n smallCircle1.className = \"small-circle\";\n var smallCircle2 = document.createElement('div');\n smallCircle2.className = \"small-circle\";\n var smallCircle3 = document.createElement('div');\n smallCircle3.className = \"small-circle\";\n circlesContainer.appendChild(startCircle);\n circlesContainer.appendChild(smallCircle1);\n circlesContainer.appendChild(smallCircle2);\n circlesContainer.appendChild(smallCircle3);\n circlesContainer.appendChild(endCircle);\n return circlesContainer;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n this.element.innerHTML = \"\";\n this.element.appendChild(this.directionsViewHeader);\n\n // if (this.pathData) {\n // this.element.appendChild(this.stepsView.getElement());\n // }\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n this.startSearchBox.searchBar.on('focus', this._handleStartSearchBarFocus.bind(this));\n this.startSearchBox.searchBar.on('blur', this._handleStartSearchBarBlur.bind(this));\n this.startSearchBox.on('getSearchBarSuggestions', this._handleGettingStartSearchBarSuggestions.bind(this));\n this.endSearchBox.searchBar.on('focus', this._handleEndSearchBarFocus.bind(this));\n this.endSearchBox.searchBar.on('blur', this._handleEndSearchBarBlur.bind(this));\n this.endSearchBox.on('getSearchBarSuggestions', this._handleGettingEndSearchBarSuggestions.bind(this));\n this.startSearchBox.searchBarSuggestionsView.on('selectCell', this._handleStartContentPlacementSelect.bind(this));\n this.endSearchBox.searchBarSuggestionsView.on('selectCell', this._handleEndContentPlacementSelect.bind(this));\n\n // this.stepsView.on('legSelect', this._handleLegChange.bind(this));\n }\n\n // _handleLegChange(data) {\n // const { index } = data;\n // this.fire('initiate:changeLeg', data);\n\n // }\n }, {\n key: \"_handleGettingStartSearchBarSuggestions\",\n value: function () {\n var _handleGettingStartSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var query;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n query = data.query;\n this.fire('getStartSuggestions', {\n query: query\n });\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\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;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n query = data.query;\n this.fire('getEndSuggestions', {\n query: query\n });\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleGettingEndSearchBarSuggestions(_x2) {\n return _handleGettingEndSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingEndSearchBarSuggestions;\n }()\n }, {\n key: \"_handleStartContentPlacementSelect\",\n value: function () {\n var _handleStartContentPlacementSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {\n var result, placementId, titleKey, startContentPlacement;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n result = data.result;\n placementId = result.placement_id;\n titleKey = result.catalog.content_title_key; // const titleKey = result.content.title_key;\n this.startSearchBox.searchBar.setText(result.content.data[titleKey]);\n _context3.next = 6;\n return this.searchApi.fetchContentPlacementDetails(placementId);\n case 6:\n startContentPlacement = _context3.sent;\n this.fire('selectedStartContentPlacement', {\n startContentPlacement: startContentPlacement\n });\n this.updateView(startContentPlacement, this.endContentPlacement);\n case 9:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _handleStartContentPlacementSelect(_x3) {\n return _handleStartContentPlacementSelect2.apply(this, arguments);\n }\n return _handleStartContentPlacementSelect;\n }()\n }, {\n key: \"_handleEndContentPlacementSelect\",\n value: function () {\n var _handleEndContentPlacementSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {\n var result, placementId, titleKey, endContentPlacement;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n result = data.result;\n placementId = result.placement_id; // const titleKey = result.content.title_key;\n titleKey = result.catalog.content_title_key;\n this.endSearchBox.searchBar.setText(result.content.data[titleKey]);\n _context4.next = 6;\n return this.searchApi.fetchContentPlacementDetails(placementId);\n case 6:\n endContentPlacement = _context4.sent;\n this.fire('selectedEndContentPlacement', {\n endContentPlacement: endContentPlacement\n });\n this.updateView(this.startContentPlacement, endContentPlacement);\n case 9:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _handleEndContentPlacementSelect(_x4) {\n return _handleEndContentPlacementSelect2.apply(this, arguments);\n }\n return _handleEndContentPlacementSelect;\n }()\n }, {\n key: \"_handleStartSearchBarFocus\",\n value: function _handleStartSearchBarFocus() {\n this.startSearchBox.searchBar.updateRightButtonIcon('search');\n this.startSearchBox.searchBar.setPlaceholderText('Choose starting point');\n }\n }, {\n key: \"_handleEndSearchBarFocus\",\n value: function _handleEndSearchBarFocus() {\n this.endSearchBox.searchBar.updateRightButtonIcon('search');\n }\n }, {\n key: \"_handleStartSearchBarBlur\",\n value: function _handleStartSearchBarBlur() {\n this.startSearchBox.searchBar.updateRightButtonIcon('none');\n }\n }, {\n key: \"_handleEndSearchBarBlur\",\n value: function _handleEndSearchBarBlur() {\n this.endSearchBox.searchBar.updateRightButtonIcon('none');\n }\n }, {\n key: \"updateView\",\n value: function updateView(startContentPlacement, endContentPlacement) {\n this.startContentPlacement = startContentPlacement;\n this.endContentPlacement = endContentPlacement;\n if (startContentPlacement && endContentPlacement) {\n var startData = startContentPlacement.content.data;\n var startTitleKey = startContentPlacement.catalog.content_title_key;\n var startTitle = startData[startTitleKey];\n this.startSearchBox.searchBar.setText(startTitle);\n var endData = endContentPlacement.content.data;\n var endTitleKey = endContentPlacement.catalog.content_title_key;\n var endTitle = endData[endTitleKey];\n this.endSearchBox.searchBar.setText(endTitle);\n this.fire('initiate:findPath', {\n startContentPlacementId: startContentPlacement.placement_id,\n endContentPlacementId: endContentPlacement.placement_id\n });\n } else if (startContentPlacement) {\n var data = startContentPlacement.content.data;\n // const titleKey = startContentPlacement.content.title_key;\n var titleKey = startContentPlacement.catalog.content_title_key;\n var title = data[titleKey];\n this.startSearchBox.searchBar.setText(title);\n this.endSearchBox.searchBar.setText('');\n this.endSearchBox.searchBar.input.focus();\n // this.clearSteps();\n } else if (endContentPlacement) {\n var _data = endContentPlacement.content.data;\n // const titleKey = endContentPlacement.content.title_key;\n var _titleKey = endContentPlacement.catalog.content_title_key;\n var _title = _data[_titleKey];\n this.endSearchBox.searchBar.setText(_title);\n this.startSearchBox.searchBar.setText('');\n if (this.fromLocation) {\n this.fire('initiate:findPathFromLocation', {\n endContentPlacement: endContentPlacement\n });\n }\n // this.clearSteps();\n }\n }\n\n // setSteps(steps) {\n // this.steps = steps;\n // this._render();\n // }\n }, {\n key: \"setNewPath\",\n value: function setNewPath(pathData) {\n var fromLocation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.fromLocation = fromLocation;\n\n // Add extra leg for testing\n var leg = pathData.legs[0];\n var step = leg.steps[0];\n var customLeg = {\n floor: 1,\n steps: [{\n instruction: 'right',\n distance: 20.0,\n path: step.path,\n text: 'Instruction for this step'\n }, {\n instruction: 'right',\n distance: 20.0,\n path: step.path,\n text: 'Instruction for this step'\n }, {\n instruction: 'right',\n distance: 20.0,\n path: step.path,\n text: 'Instruction for this step'\n }]\n };\n // const customLeg2 = {\n // floor: 2,\n // steps: [\n // {\n // instruction: 'right',\n // distance: 20.0,\n // path: step.path,\n // text: 'Instruction for this step'\n // },\n // {\n // instruction: 'right',\n // distance: 20.0,\n // path: step.path,\n // text: 'Instruction for this step'\n // },\n // {\n // instruction: 'right',\n // distance: 20.0,\n // path: step.path,\n // text: 'Instruction for this step'\n // }\n // ]\n // }\n // pathData.legs.push(customLeg);\n // pathData.legs.push(customLeg2);\n\n if (fromLocation) {\n this.startSearchBox.searchBar.setPlaceholderText('Your location');\n }\n this.pathData = pathData;\n // this.stepsView.setNewPath(pathData);\n this._render();\n }\n\n // clearSteps() {\n // const stepsViewElement = this.element.querySelector('.steps-view'); // Assuming .steps-view is a class in StepsView\n // if (stepsViewElement) {\n // stepsViewElement.remove(); // Remove the StepsView element if it exists\n // }\n // }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"showLoading\",\n value: function showLoading() {\n // Show loading state while directions are being calculated\n if (this.loadingElement) {\n this.loadingElement.style.display = 'flex';\n }\n }\n }, {\n key: \"hideLoading\",\n value: function hideLoading() {\n // Hide loading state when directions are ready\n if (this.loadingElement) {\n this.loadingElement.style.display = 'none';\n }\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/DirectionsView/DirectionsView.js?");
782
+ 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_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SearchBox/SearchBox */ \"./src/components/SearchBox/SearchBox.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _assets_pinOutlineIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../assets/pinOutlineIcon.svg */ \"./src/assets/pinOutlineIcon.svg\");\n/* harmony import */ var _assets_loading_spinner_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../assets/loading-spinner.svg */ \"./src/assets/loading-spinner.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 _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// import StepsView from \"../DirectionsView/StepsView\";\n\n\n\nvar DirectionsView = /*#__PURE__*/function (_Component) {\n function DirectionsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsView);\n _this = _callSuper(this, DirectionsView, [options]);\n _this.startSearchBox = new _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"](); // Create a SearchBox for the start location\n _this.endSearchBox = new _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"](); // Create a SearchBox for the end location\n\n _this.startContentPlacement = null;\n _this.endContentPlacement = null;\n _this.pathData = null;\n _this.fromLocation = false;\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSearchApi();\n\n // this.stepsView = new StepsView();\n\n _this._initialize();\n return _this;\n }\n _inherits(DirectionsView, _Component);\n return _createClass(DirectionsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement(\"div\");\n this.element.className = \"directions-view\";\n this.directionsViewHeader = document.createElement(\"div\");\n this.directionsViewHeader.className = \"directions-view-header\";\n this.searchBoxesContainer = document.createElement('div');\n this.searchBoxesContainer.className = \"directions-search-boxes-container\";\n this.circlesAndSearchWrapper = document.createElement('div');\n this.circlesAndSearchWrapper.className = 'directions-circles-search-wrapper';\n var circlesContainer = this._createCirclesContainer();\n this.circlesAndSearchWrapper.appendChild(circlesContainer);\n this.startSearchBox.searchBar.updateLeftButtonIcon('none');\n this.startSearchBox.searchBar.updateRightButtonIcon('none');\n this.endSearchBox.searchBar.updateLeftButtonIcon('none');\n this.endSearchBox.searchBar.updateRightButtonIcon('none');\n this.startSearchBox.searchBar.setPlaceholderText('Choose starting point');\n this.endSearchBox.searchBar.setPlaceholderText('Choose destination');\n this.searchBoxesContainer.appendChild(this.startSearchBox.getElement());\n this.searchBoxesContainer.appendChild(this.endSearchBox.getElement());\n this.circlesAndSearchWrapper.appendChild(this.searchBoxesContainer);\n this.directionsViewHeader.appendChild(this.circlesAndSearchWrapper);\n this._render();\n this._setupEventListeners();\n }\n }, {\n key: \"_createCirclesContainer\",\n value: function _createCirclesContainer() {\n var circlesContainer = document.createElement('div');\n circlesContainer.className = \"directions-circles-container\";\n var startCircle = document.createElement('div');\n startCircle.className = \"large-circle\";\n var endCircle = document.createElement('div');\n endCircle.className = \"end-circle\";\n var smallCircle1 = document.createElement('div');\n smallCircle1.className = \"small-circle\";\n var smallCircle2 = document.createElement('div');\n smallCircle2.className = \"small-circle\";\n var smallCircle3 = document.createElement('div');\n smallCircle3.className = \"small-circle\";\n circlesContainer.appendChild(startCircle);\n circlesContainer.appendChild(smallCircle1);\n circlesContainer.appendChild(smallCircle2);\n circlesContainer.appendChild(smallCircle3);\n circlesContainer.appendChild(endCircle);\n return circlesContainer;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n this.element.innerHTML = \"\";\n this.element.appendChild(this.directionsViewHeader);\n\n // if (this.pathData) {\n // this.element.appendChild(this.stepsView.getElement());\n // }\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n this.startSearchBox.searchBar.on('focus', this._handleStartSearchBarFocus.bind(this));\n this.startSearchBox.searchBar.on('blur', this._handleStartSearchBarBlur.bind(this));\n this.startSearchBox.on('getSearchBarSuggestions', this._handleGettingStartSearchBarSuggestions.bind(this));\n this.endSearchBox.searchBar.on('focus', this._handleEndSearchBarFocus.bind(this));\n this.endSearchBox.searchBar.on('blur', this._handleEndSearchBarBlur.bind(this));\n this.endSearchBox.on('getSearchBarSuggestions', this._handleGettingEndSearchBarSuggestions.bind(this));\n this.startSearchBox.searchBarSuggestionsView.on('selectCell', this._handleStartContentPlacementSelect.bind(this));\n this.endSearchBox.searchBarSuggestionsView.on('selectCell', this._handleEndContentPlacementSelect.bind(this));\n\n // this.stepsView.on('legSelect', this._handleLegChange.bind(this));\n }\n\n // _handleLegChange(data) {\n // const { index } = data;\n // this.fire('initiate:changeLeg', data);\n\n // }\n }, {\n key: \"_handleGettingStartSearchBarSuggestions\",\n value: function () {\n var _handleGettingStartSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var query;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n query = data.query;\n this.fire('getStartSuggestions', {\n query: query\n });\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\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;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n query = data.query;\n this.fire('getEndSuggestions', {\n query: query\n });\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleGettingEndSearchBarSuggestions(_x2) {\n return _handleGettingEndSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingEndSearchBarSuggestions;\n }()\n }, {\n key: \"_handleStartContentPlacementSelect\",\n value: function () {\n var _handleStartContentPlacementSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {\n var result, placementId, titleKey, startContentPlacement;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n result = data.result;\n if (!(result && result.type === 'gps-current-location')) {\n _context3.next = 4;\n break;\n }\n this.fire('selectGpsCurrentLocation');\n return _context3.abrupt(\"return\");\n case 4:\n placementId = result.placement_id;\n titleKey = result.catalog.content_title_key; // const titleKey = result.content.title_key;\n this.startSearchBox.searchBar.setText(result.content.data[titleKey]);\n _context3.next = 9;\n return this.searchApi.fetchContentPlacementDetails(placementId);\n case 9:\n startContentPlacement = _context3.sent;\n this.fire('selectedStartContentPlacement', {\n startContentPlacement: startContentPlacement\n });\n this.updateView(startContentPlacement, this.endContentPlacement);\n case 12:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _handleStartContentPlacementSelect(_x3) {\n return _handleStartContentPlacementSelect2.apply(this, arguments);\n }\n return _handleStartContentPlacementSelect;\n }()\n }, {\n key: \"enableGpsStartCell\",\n value: function enableGpsStartCell() {\n this.startSearchBox.setShowSuggestionsOnEmptyFocus(true);\n this.startSearchBox.setPinnedResults([{\n type: 'gps-current-location'\n }]);\n }\n }, {\n key: \"disableGpsStartCell\",\n value: function disableGpsStartCell() {\n this.startSearchBox.setShowSuggestionsOnEmptyFocus(false);\n this.startSearchBox.clearPinnedResults();\n }\n }, {\n key: \"focusStartInput\",\n value: function focusStartInput() {\n var input = this.startSearchBox.searchBar.input;\n if (input) {\n input.focus();\n }\n this.startSearchBox.openSuggestionsView();\n }\n }, {\n key: \"_handleEndContentPlacementSelect\",\n value: function () {\n var _handleEndContentPlacementSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {\n var result, placementId, titleKey, endContentPlacement;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n result = data.result;\n placementId = result.placement_id; // const titleKey = result.content.title_key;\n titleKey = result.catalog.content_title_key;\n this.endSearchBox.searchBar.setText(result.content.data[titleKey]);\n _context4.next = 6;\n return this.searchApi.fetchContentPlacementDetails(placementId);\n case 6:\n endContentPlacement = _context4.sent;\n this.fire('selectedEndContentPlacement', {\n endContentPlacement: endContentPlacement\n });\n this.updateView(this.startContentPlacement, endContentPlacement);\n case 9:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function _handleEndContentPlacementSelect(_x4) {\n return _handleEndContentPlacementSelect2.apply(this, arguments);\n }\n return _handleEndContentPlacementSelect;\n }()\n }, {\n key: \"_handleStartSearchBarFocus\",\n value: function _handleStartSearchBarFocus() {\n this.startSearchBox.searchBar.updateRightButtonIcon('search');\n this.startSearchBox.searchBar.setPlaceholderText('Choose starting point');\n }\n }, {\n key: \"_handleEndSearchBarFocus\",\n value: function _handleEndSearchBarFocus() {\n this.endSearchBox.searchBar.updateRightButtonIcon('search');\n }\n }, {\n key: \"_handleStartSearchBarBlur\",\n value: function _handleStartSearchBarBlur() {\n this.startSearchBox.searchBar.updateRightButtonIcon('none');\n }\n }, {\n key: \"_handleEndSearchBarBlur\",\n value: function _handleEndSearchBarBlur() {\n this.endSearchBox.searchBar.updateRightButtonIcon('none');\n }\n }, {\n key: \"updateView\",\n value: function updateView(startContentPlacement, endContentPlacement) {\n this.startContentPlacement = startContentPlacement;\n this.endContentPlacement = endContentPlacement;\n if (startContentPlacement && endContentPlacement) {\n var startData = startContentPlacement.content.data;\n var startTitleKey = startContentPlacement.catalog.content_title_key;\n var startTitle = startData[startTitleKey];\n this.startSearchBox.searchBar.setText(startTitle);\n var endData = endContentPlacement.content.data;\n var endTitleKey = endContentPlacement.catalog.content_title_key;\n var endTitle = endData[endTitleKey];\n this.endSearchBox.searchBar.setText(endTitle);\n this.fire('initiate:findPath', {\n startContentPlacementId: startContentPlacement.placement_id,\n endContentPlacementId: endContentPlacement.placement_id\n });\n } else if (startContentPlacement) {\n var data = startContentPlacement.content.data;\n // const titleKey = startContentPlacement.content.title_key;\n var titleKey = startContentPlacement.catalog.content_title_key;\n var title = data[titleKey];\n this.startSearchBox.searchBar.setText(title);\n this.endSearchBox.searchBar.setText('');\n this.endSearchBox.searchBar.input.focus();\n // this.clearSteps();\n } else if (endContentPlacement) {\n var _data = endContentPlacement.content.data;\n // const titleKey = endContentPlacement.content.title_key;\n var _titleKey = endContentPlacement.catalog.content_title_key;\n var _title = _data[_titleKey];\n this.endSearchBox.searchBar.setText(_title);\n this.startSearchBox.searchBar.setText('');\n if (this.fromLocation) {\n this.fire('initiate:findPathFromLocation', {\n endContentPlacement: endContentPlacement\n });\n }\n // this.clearSteps();\n }\n }\n\n // setSteps(steps) {\n // this.steps = steps;\n // this._render();\n // }\n }, {\n key: \"setNewPath\",\n value: function setNewPath(pathData) {\n var fromLocation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.fromLocation = fromLocation;\n\n // Add extra leg for testing\n var leg = pathData.legs[0];\n var step = leg.steps[0];\n var customLeg = {\n floor: 1,\n steps: [{\n instruction: 'right',\n distance: 20.0,\n path: step.path,\n text: 'Instruction for this step'\n }, {\n instruction: 'right',\n distance: 20.0,\n path: step.path,\n text: 'Instruction for this step'\n }, {\n instruction: 'right',\n distance: 20.0,\n path: step.path,\n text: 'Instruction for this step'\n }]\n };\n // const customLeg2 = {\n // floor: 2,\n // steps: [\n // {\n // instruction: 'right',\n // distance: 20.0,\n // path: step.path,\n // text: 'Instruction for this step'\n // },\n // {\n // instruction: 'right',\n // distance: 20.0,\n // path: step.path,\n // text: 'Instruction for this step'\n // },\n // {\n // instruction: 'right',\n // distance: 20.0,\n // path: step.path,\n // text: 'Instruction for this step'\n // }\n // ]\n // }\n // pathData.legs.push(customLeg);\n // pathData.legs.push(customLeg2);\n\n if (fromLocation) {\n this.startSearchBox.searchBar.setPlaceholderText('Your location');\n }\n this.pathData = pathData;\n // this.stepsView.setNewPath(pathData);\n this._render();\n }\n\n // clearSteps() {\n // const stepsViewElement = this.element.querySelector('.steps-view'); // Assuming .steps-view is a class in StepsView\n // if (stepsViewElement) {\n // stepsViewElement.remove(); // Remove the StepsView element if it exists\n // }\n // }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"showLoading\",\n value: function showLoading() {\n // Show loading state while directions are being calculated\n if (this.loadingElement) {\n this.loadingElement.style.display = 'flex';\n }\n }\n }, {\n key: \"hideLoading\",\n value: function hideLoading() {\n // Hide loading state when directions are ready\n if (this.loadingElement) {\n this.loadingElement.style.display = 'none';\n }\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/DirectionsView/DirectionsView.js?");
783
783
 
784
784
  /***/ }),
785
785
 
@@ -794,6 +794,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
794
794
 
795
795
  /***/ }),
796
796
 
797
+ /***/ "./src/components/GpsFallbackPopup/GpsFallbackPopup.js":
798
+ /*!*************************************************************!*\
799
+ !*** ./src/components/GpsFallbackPopup/GpsFallbackPopup.js ***!
800
+ \*************************************************************/
801
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
802
+
803
+ "use strict";
804
+ 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_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _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\nvar MESSAGES = {\n DENIED: {\n title: 'Location access is off',\n body: 'We couldn\\'t use your location. Search for a starting point instead.'\n },\n TIMEOUT: {\n title: 'Couldn\\'t get your location',\n body: 'We couldn\\'t read your location in time. Search for a starting point instead.'\n },\n UNAVAILABLE: {\n title: 'Couldn\\'t get your location',\n body: 'Your device didn\\'t share a location. Search for a starting point instead.'\n },\n NO_NODE: {\n title: 'You\\'re too far from this map',\n body: 'We couldn\\'t find a path near your location. Search for a starting point instead.'\n },\n TOO_FAR: {\n title: 'You\\'re too far from this map',\n body: 'You\\'re not close enough to this map to start from your location. Search for a starting point instead.'\n }\n};\nvar GpsFallbackPopup = /*#__PURE__*/function (_Component) {\n function GpsFallbackPopup() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, GpsFallbackPopup);\n return _callSuper(this, GpsFallbackPopup, [options]);\n }\n _inherits(GpsFallbackPopup, _Component);\n return _createClass(GpsFallbackPopup, [{\n key: \"show\",\n value: function show(map, reason, onDismiss) {\n var _this = this;\n var config = MESSAGES[reason] || MESSAGES.UNAVAILABLE;\n var card = document.createElement('div');\n card.className = 'gps-fallback-popup-card';\n var title = document.createElement('div');\n title.className = 'gps-fallback-popup-title';\n title.textContent = config.title;\n card.appendChild(title);\n var body = document.createElement('div');\n body.className = 'gps-fallback-popup-body';\n body.textContent = config.body;\n card.appendChild(body);\n var okButton = document.createElement('button');\n okButton.className = 'gps-fallback-popup-ok';\n okButton.textContent = 'OK';\n okButton.addEventListener('click', function () {\n _this._resetModalStyles(map);\n map.hideModal();\n if (typeof onDismiss === 'function') onDismiss();\n });\n card.appendChild(okButton);\n map.showModal(card);\n\n // The shared modal container sets a full-screen black content box with\n // an 80% opaque overlay. Override both so our small card sits centered\n // with a lighter dim behind it.\n if (map.modalContainer) {\n this._previousContainerBg = map.modalContainer.style.backgroundColor;\n map.modalContainer.style.backgroundColor = 'rgba(0, 0, 0, 0.35)';\n var contentWrapper = map.modalContainer.querySelector('.waygo-map-modal-content');\n if (contentWrapper) {\n contentWrapper.style.backgroundColor = 'transparent';\n contentWrapper.style.width = 'auto';\n contentWrapper.style.height = 'auto';\n contentWrapper.style.maxWidth = 'none';\n contentWrapper.style.maxHeight = 'none';\n contentWrapper.style.boxShadow = 'none';\n contentWrapper.style.display = 'flex';\n contentWrapper.style.alignItems = 'center';\n contentWrapper.style.justifyContent = 'center';\n }\n }\n }\n }, {\n key: \"_resetModalStyles\",\n value: function _resetModalStyles(map) {\n if (!map.modalContainer) return;\n if (this._previousContainerBg !== undefined) {\n map.modalContainer.style.backgroundColor = this._previousContainerBg;\n this._previousContainerBg = undefined;\n }\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GpsFallbackPopup);\n\n//# sourceURL=webpack://waygomaps/./src/components/GpsFallbackPopup/GpsFallbackPopup.js?");
805
+
806
+ /***/ }),
807
+
797
808
  /***/ "./src/components/MapView/MapView.js":
798
809
  /*!*******************************************!*\
799
810
  !*** ./src/components/MapView/MapView.js ***!
@@ -801,7 +812,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
801
812
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
802
813
 
803
814
  "use strict";
804
- 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\");\n/* harmony import */ var _assets_loading_spinner_1_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/loading-spinner 1.svg */ \"./src/assets/loading-spinner 1.svg\");\n/* harmony import */ var _utils_outdoorMapIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/outdoorMapIds */ \"./src/utils/outdoorMapIds.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\nvar _defaultMapOptions;\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 _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 _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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure 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 _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 _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\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 _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 _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); }\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 _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); }\n\n\n\n\n\n\n\n\n\n\n// import WaygoLogoUrl from \"../../assets/WaygoLogoWhite.svg\";\n// import WaygoLogoUrl from \"../../assets/WaygoIconWhite.svg\";\n\n\nvar MAPBOX_VERSIONS = {\n \"default\": '3.5.1',\n 'johnson-controls-roadshow-2026': '3.17.0',\n 'usbank-del-coronado-2026': '3.17.0'\n};\nfunction getMapboxUrls(mapId) {\n var version = MAPBOX_VERSIONS[mapId] || MAPBOX_VERSIONS[\"default\"];\n return {\n css: \"https://api.mapbox.com/mapbox-gl-js/v\".concat(version, \"/mapbox-gl.css\"),\n js: \"https://api.mapbox.com/mapbox-gl-js/v\".concat(version, \"/mapbox-gl.js\")\n };\n}\nvar accessToken = 'pk.eyJ1Ijoid2F5Z28tbWFwcyIsImEiOiJjbGtxYzZ1N3QxdG43M210bXFuYmJ4a3gxIn0.tlbznj_fRJ8La6s2UUMO6A';\nvar KIOSK_RESET_TIME = 90000;\nvar MAP_BOUNDS_OVERRIDES = {\n 'johnson-controls-roadshow-2026': {\n bounds: [[-25, 27], [30, 68]],\n maxBounds: [[-25, 27], [30, 68]]\n }\n};\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 = (_defaultMapOptions = {\n container: 'map',\n sourceId: '2024.2xw_YUXYS8GoDTB2AQgN3A',\n center: [0, 0],\n floor: 0,\n zoom: 13,\n bearing: 0,\n // 46.15762290134818,-25.60000000000025\n // pitch: 30,\n pitch: 46\n}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defaultMapOptions, \"bearing\", 0), \"minPitch\", 0), \"maxPitch\", 60), \"minZoom\", 0.0), \"maxZoom\", 19.5), \"bounds\", null), \"doubleClickZoom\", true), \"dragPan\", true), \"dragRotate\", true), \"scrollZoom\", true), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defaultMapOptions, \"touchPitch\", true), \"touchZoomRotate\", true), \"interactive\", true), \"trackResize\", true), \"keyboard\", true), \"defaultControls\", false), \"setup\", false), \"selectionCriteria\", null), \"initialState\", 'default'), \"initialStateData\", null), _defineProperty(_defaultMapOptions, \"showQRCodeInKioskMode\", true));\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\n // Store initial state configuration BEFORE calling _initialize\n _this.initialState = options.initialState || 'default';\n _this.initialStateData = options.initialStateData || null;\n\n // If initializing in selection state, show loading overlay immediately\n if (_this.initialState === 'selection') {\n _this._createSelectionLoadingOverlay();\n _this._showSelectionLoadingOverlay();\n }\n _this.ready = _this._initialize(options);\n _this.initialLoad = false;\n _this.originalFilters = {};\n _this._currentFloorIndex = options.floor;\n // Store default values from merged options (after super call)\n _this._defaultFloorIndex = _this.options.floor || 0;\n _this._defaultZoom = _this.options.zoom || 13;\n _this._defaultBearing = _this.options.bearing || 0;\n _this._defaultPitch = _this.options.pitch || 0;\n _this.mapData = null;\n _this._stateCoordinator = new _StateCoordinator__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_this);\n _this.defaultControls = options.defaultControls;\n _this.setupControl = null;\n _this.location = options.location || null;\n _this.modalContainer = null;\n _this.selectionCriteria = options.selectionCriteria || null;\n _this.multiSelect = true;\n _this.confirmedSelection = null;\n\n // Initialize kiosk auto-reset timer if in kiosk mode\n _this.kioskResetTimer = null;\n _this.kioskCountdownInterval = null;\n _this.isKioskMode = _this.location !== null;\n if (_this.isKioskMode) {\n _this._initializeKioskReset();\n } else {\n console.log('📍 Not in kiosk mode - no auto-reset timer');\n }\n return _this;\n }\n _inherits(MapView, _Component);\n return _createClass(MapView, [{\n key: \"showModal\",\n value: function showModal(content) {\n var _this2 = this;\n // Create modal container if it doesn't exist\n if (!this.modalContainer) {\n this.modalContainer = document.createElement('div');\n this.modalContainer.className = 'waygo-map-modal-container';\n this.mapContainer.appendChild(this.modalContainer);\n\n // Add click handler to close modal when clicking outside\n this.modalContainer.addEventListener('click', function (e) {\n if (e.target === _this2.modalContainer) {\n _this2.hideModal();\n }\n });\n }\n\n // Create modal content\n var modalContent = document.createElement('div');\n modalContent.className = 'waygo-map-modal-content';\n\n // Can accept HTML string or DOM element\n if (typeof content === 'string') {\n modalContent.innerHTML = content;\n } else {\n modalContent.appendChild(content);\n }\n\n // Clear existing content and add new\n this.modalContainer.innerHTML = '';\n this.modalContainer.appendChild(modalContent);\n this.modalContainer.style.display = 'flex';\n }\n }, {\n key: \"hideModal\",\n value: function hideModal() {\n if (this.modalContainer) {\n this.modalContainer.style.display = 'none';\n }\n }\n }, {\n key: \"_initialize\",\n value: function () {\n var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this3 = this;\n var mapId, styleId, boundsOverride;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n mapId = this.options.sourceId.split('.')[0];\n _context.next = 4;\n return this._loadMapLibraries(mapId);\n case 4:\n mapboxgl.clearStorage();\n this.render();\n _context.next = 8;\n return this._initializeMapData();\n case 8:\n if (this.mapData) {\n _context.next = 11;\n break;\n }\n console.error(\"Error initializing map data.\");\n return _context.abrupt(\"return\");\n case 11:\n styleId = this.mapData.style_id;\n boundsOverride = MAP_BOUNDS_OVERRIDES[this.mapData.map_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 // maxBounds: boundsOverride?.maxBounds || undefined,\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 (!_this3.initialLoad) {\n _this3._initializeOriginalFilters();\n _this3.updateFloor(_this3.options.floor, false);\n _this3.initialLoad = true;\n }\n });\n this.map.on('style.load', function () {\n console.log(mapboxgl.version);\n // this.map.setConfigProperty('basemap', 'theme', 'monochrome');\n // this.map.setConfigProperty('basemap', 'lightPreset', 'dusk');\n });\n this.map.on('load', function () {\n if (_this3.defaultControls) {\n _this3._addLogoImage();\n _this3._addDefaultControls();\n _this3.updateFloor(_this3.options.floor, false);\n }\n\n // Initialize the specified state after map loads\n _this3._initializeState();\n _this3.fire('load', {\n mapData: _this3.mapData\n });\n });\n this._initializeEventListeners();\n } else {\n console.error('Mapbox GL JS is not loaded.');\n }\n _context.next = 19;\n break;\n case 16:\n _context.prev = 16;\n _context.t0 = _context[\"catch\"](0);\n console.error('Failed to initialize the map:', _context.t0);\n case 19:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[0, 16]]);\n }));\n function _initialize() {\n return _initialize2.apply(this, arguments);\n }\n return _initialize;\n }()\n }, {\n key: \"_addLogoImage\",\n value: function _addLogoImage() {\n if (this.mapData.map_id === 'johnson-controls-roadshow-2026') {\n return;\n }\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\n // const websiteContainer = document.createElement('div');\n // websiteContainer.className = 'website-container';\n // websiteContainer.textContent = '© Waygo Maps';\n // // websiteContainer.textContent = 'waygomaps.com';\n\n // websiteContainer.addEventListener('click', () => {\n // window.open(linkUrl, '_blank'); // Open link in a new tab\n // });\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 _this4 = this;\n var currentState = this._stateCoordinator.state;\n var controls = [];\n if (currentState === 'selection') {\n // In selection mode, only add essential controls\n controls = [new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].FloorSelectorControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ContentPlacementControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].InteractionControl()];\n } else {\n // Default controls for other states\n 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 }\n controls.forEach(function (control) {\n return _this4.addControl(control);\n });\n }\n }, {\n key: \"_initializeOriginalFilters\",\n value: function _initializeOriginalFilters() {\n var _this5 = 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 _this5.originalFilters[layer.id] = _this5.map.getFilter(layer.id) || null;\n }\n });\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n var _this6 = this;\n var passive = {\n passive: true\n };\n this.mapContainer.addEventListener('mousedown', function (event) {\n return _this6.fire('mousedown', {\n originalEvent: event\n });\n });\n // preclick\n this.mapContainer.addEventListener('click', function (event) {\n return _this6.fire('click', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mouseover', function (event) {\n return _this6.fire('mouseover', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mousemove', function (event) {\n return _this6.fire('mousemove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('dblclick', function (event) {\n return _this6.fire('dblclick', {\n originalEvent: event\n });\n });\n // mouseenter\n // mouseleave\n this.mapContainer.addEventListener('mouseout', function (event) {\n return _this6.fire('mouseout', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('contextmenu', function (event) {\n return _this6.fire('contextmenu', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('wheel', function (event) {\n return _this6.fire('wheel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchstart', function (event) {\n return _this6.fire('touchstart', {\n originalEvent: event\n });\n }, passive);\n this.mapContainer.addEventListener('touchend', function (event) {\n return _this6.fire('touchend', {\n originalEvent: event\n });\n }, passive);\n this.mapContainer.addEventListener('touchmove', function (event) {\n return _this6.fire('touchmove', {\n originalEvent: event\n });\n }, passive);\n this.mapContainer.addEventListener('touchcancel', function (event) {\n return _this6.fire('touchcancel', {\n originalEvent: event\n });\n }, passive);\n this.mapContainer.addEventListener('move', function (event) {\n return _this6.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 _this6.map.on(eventName, function (event) {\n _this6.fire(eventName, {\n originalEvent: event\n });\n });\n });\n\n // Add selection confirmation event listener\n this.on('selection:confirmed', function (data) {\n _this6.confirmedSelection = data.feature;\n });\n }\n }, {\n key: \"_initializeMapData\",\n value: function () {\n var _initializeMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var parts, 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 < 1 || parts.length > 2)) {\n _context2.next = 4;\n break;\n }\n console.error('The sourceId format is incorrect. It should be in the format \"mapId\" or \"mapId.mapViewId\".');\n return _context2.abrupt(\"return\");\n case 4:\n // let accountId = parts[0] || '';\n // let mapId = parts[1] || '';\n // let mapViewId = parts[2] || '';\n mapId = parts[0];\n mapViewId = parts[1]; // Set account id in WaygoMaps\n // waygoMaps.setAccountId(accountId);\n _context2.prev = 6;\n _context2.next = 9;\n return this.mapViewApi.loadMapView(mapId, mapViewId);\n case 9:\n data = _context2.sent;\n this.mapData = data;\n _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setAccountId(data.account_id);\n _context2.next = 17;\n break;\n case 14:\n _context2.prev = 14;\n _context2.t0 = _context2[\"catch\"](6);\n console.error('Error fetching map style:', _context2.t0);\n case 17:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[6, 14]]);\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(mapId) {\n var _getMapboxUrls, css, js;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _getMapboxUrls = getMapboxUrls(mapId), css = _getMapboxUrls.css, js = _getMapboxUrls.js;\n _context3.next = 3;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadCSS)(css);\n case 3:\n _context3.next = 5;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadScript)(js);\n case 5:\n mapboxgl.clearStorage();\n case 6:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function _loadMapLibraries(_x) {\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 _this7 = this;\n var zoomOut = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var customBearing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var customPitch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\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 = _this7.originalFilters[layer.id];\n _this7.map.setFilter(layer.id, originalFilter);\n var floorFilter = ['==', ['get', '_floor'], floorIndex];\n if (originalFilter) {\n var combinedFilter = ['all', floorFilter, originalFilter];\n _this7.map.setFilter(layer.id, combinedFilter);\n } else {\n _this7.map.setFilter(layer.id, floorFilter);\n }\n }\n });\n this._currentFloorIndex = floorIndex;\n\n // Use custom bearing/pitch if provided, otherwise use current values\n var pitch = customPitch !== null ? customPitch : this.map.getPitch();\n var bearing = customBearing !== null ? customBearing : this.map.getBearing();\n if (zoomOut) {\n var style = this.map.getStyle();\n var sources = Object.keys(style.sources);\n var allFeatures = [];\n sources.forEach(function (sourceId) {\n var floorSourceLayer = \"\".concat(floorIndex, \"-feature\");\n var features = _this7.map.querySourceFeatures(sourceId, {\n sourceLayer: floorSourceLayer\n });\n allFeatures = allFeatures.concat(features);\n });\n\n // If we have features, calculate their bounds\n if (allFeatures.length > 0) {\n var bounds = new mapboxgl.LngLatBounds();\n allFeatures.forEach(function (feature) {\n var geom = feature.geometry;\n // Handle different geometry types:\n if (geom.type === 'Point') {\n bounds.extend(geom.coordinates);\n } else if (geom.type === 'LineString') {\n geom.coordinates.forEach(function (coord) {\n return bounds.extend(coord);\n });\n } else if (geom.type === 'Polygon') {\n // For a Polygon, iterate through the outer ring (and inner rings if needed)\n geom.coordinates[0].forEach(function (coord) {\n return bounds.extend(coord);\n });\n }\n // Add cases for MultiPoint, MultiLineString, MultiPolygon as needed\n });\n\n // Fit the map to these bounds with some padding\n this.map.fitBounds(bounds, {\n padding: 50,\n duration: 1300,\n maxZoom: 15.5,\n pitch: pitch,\n bearing: bearing\n });\n } else {\n // If no features found, zoom out from current center\n this.map.once('moveend', function () {\n var allFeaturesAgain = [];\n sources.forEach(function (sourceId) {\n var floorSourceLayer = \"\".concat(floorIndex, \"-feature\");\n var features = _this7.map.querySourceFeatures(sourceId, {\n sourceLayer: floorSourceLayer\n });\n allFeaturesAgain = allFeaturesAgain.concat(features);\n });\n if (allFeaturesAgain.length > 0) {\n var _bounds = new mapboxgl.LngLatBounds();\n allFeaturesAgain.forEach(function (feature) {\n var geom = feature.geometry;\n // Handle different geometry types:\n if (geom.type === 'Point') {\n _bounds.extend(geom.coordinates);\n } else if (geom.type === 'LineString') {\n geom.coordinates.forEach(function (coord) {\n return _bounds.extend(coord);\n });\n } else if (geom.type === 'Polygon') {\n // For a Polygon, iterate through the outer ring (and inner rings if needed)\n geom.coordinates[0].forEach(function (coord) {\n return _bounds.extend(coord);\n });\n }\n // Add cases for MultiPoint, MultiLineString, MultiPolygon as needed\n });\n\n // Fit the map to these bounds with some padding\n _this7.map.fitBounds(_bounds, {\n padding: 50,\n duration: 1300,\n maxZoom: 15.5,\n pitch: pitch,\n bearing: bearing\n });\n }\n });\n this.map.flyTo({\n zoom: this.map.getZoom() - 3,\n duration: 500,\n essential: true\n });\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 // console.log(\"SET TO DEFAULT STATE\", this.location);\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 skip,\n limit,\n floor,\n results,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n skip = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 0;\n limit = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : 30;\n floor = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : null;\n // Set loading state\n this._stateCoordinator.setLoading(true, 'search');\n _context4.prev = 4;\n _context4.next = 7;\n return this.search(query, skip, limit, floor);\n case 7:\n results = _context4.sent;\n this._stateCoordinator.transitionTo('search', {\n query: query,\n results: results\n });\n // Loading state will be reset in the transitionTo method\n _context4.next = 15;\n break;\n case 11:\n _context4.prev = 11;\n _context4.t0 = _context4[\"catch\"](4);\n console.error(\"\\u274C MapView: Search error occurred:\", _context4.t0);\n this._stateCoordinator.setLoading(false, 'search');\n // Handle error appropriately\n case 15:\n _context4.prev = 15;\n this._stateCoordinator.setLoading(false, 'search');\n return _context4.finish(15);\n case 18:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this, [[4, 11, 15, 18]]);\n }));\n function setToSearchState(_x2) {\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 // console.log(`📄 MapView: setToSelectedContentState called with IDs:`, contentPlacementIds);\n\n // Set loading state\n this._stateCoordinator.setLoading(true, 'content');\n _context5.prev = 1;\n lastContentPlacementId = contentPlacementIds[contentPlacementIds.length - 1];\n _context5.next = 5;\n return this.getContentPlacementDetails(lastContentPlacementId);\n case 5:\n selectedContentPlacement = _context5.sent;\n this.updateFloor(selectedContentPlacement.floor);\n this._stateCoordinator.transitionTo('selectedContent', {\n contentPlacementIds: contentPlacementIds,\n selectedContentPlacement: selectedContentPlacement\n });\n // Loading state will be reset in the transitionTo method\n _context5.next = 14;\n break;\n case 10:\n _context5.prev = 10;\n _context5.t0 = _context5[\"catch\"](1);\n console.error(\"\\u274C MapView: Content loading error occurred:\", _context5.t0);\n this._stateCoordinator.setLoading(false, 'content');\n // Handle error appropriately\n case 14:\n _context5.prev = 14;\n this._stateCoordinator.setLoading(false, 'content');\n return _context5.finish(14);\n case 17:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this, [[1, 10, 14, 17]]);\n }));\n function setToSelectedContentState(_x3) {\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 _this$initialStateDat,\n startContentPlacement,\n startNodeId,\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 _context6.prev = 2;\n startContentPlacement = null;\n startNodeId = null; // Handle empty string as null (from URL parsing when start is empty)\n if (startContentPlacementId === '' || startContentPlacementId === null || startContentPlacementId === undefined) {\n startContentPlacementId = null;\n }\n\n // Check if initialStateData has a startNodeId (for cases where URL has empty start but node ID is provided separately)\n if (!(!startContentPlacementId && (_this$initialStateDat = this.initialStateData) !== null && _this$initialStateDat !== void 0 && _this$initialStateDat.startNodeId)) {\n _context6.next = 11;\n break;\n }\n startNodeId = this.initialStateData.startNodeId;\n console.log(\"\\uD83D\\uDD35 MapView: Using startNodeId from initialStateData: \".concat(startNodeId));\n _context6.next = 26;\n break;\n case 11:\n if (!startContentPlacementId) {\n _context6.next = 26;\n break;\n }\n console.log(\"\\uD83D\\uDD35 MapView: Attempting to fetch startContentPlacement for ID: \".concat(startContentPlacementId));\n _context6.prev = 13;\n _context6.next = 16;\n return this.getContentPlacementDetails(startContentPlacementId);\n case 16:\n startContentPlacement = _context6.sent;\n console.log(\"\\uD83D\\uDD35 MapView: getContentPlacementDetails returned:\", startContentPlacement);\n\n // Check if we got a valid content placement (must have placement_id property)\n if (!startContentPlacement || !startContentPlacement.placement_id) {\n // If fetching returns null/undefined or invalid object, assume startContentPlacementId is a node ID\n console.log(\"\\uD83D\\uDD35 MapView: startContentPlacementId is a node ID (fetch returned invalid result): \".concat(startContentPlacementId));\n startNodeId = startContentPlacementId;\n startContentPlacement = null;\n } else {\n console.log(\"\\uD83D\\uDD35 MapView: Successfully fetched startContentPlacement with placement_id: \".concat(startContentPlacement.placement_id));\n }\n _context6.next = 26;\n break;\n case 21:\n _context6.prev = 21;\n _context6.t0 = _context6[\"catch\"](13);\n // If the API call fails (e.g., 500 error for node ID), treat it as a node ID\n console.log(\"\\uD83D\\uDD35 MapView: Error fetching startContentPlacement (likely a node ID): \".concat(startContentPlacementId), _context6.t0);\n startNodeId = startContentPlacementId;\n startContentPlacement = null;\n case 26:\n endContentPlacement = null;\n if (!endContentPlacementId) {\n _context6.next = 31;\n break;\n }\n _context6.next = 30;\n return this.getContentPlacementDetails(endContentPlacementId);\n case 30:\n endContentPlacement = _context6.sent;\n case 31:\n console.log(\"\\uD83D\\uDD35 MapView: Transitioning to directions state with:\", {\n startContentPlacement: !!startContentPlacement,\n endContentPlacement: !!endContentPlacement,\n startNodeId: startNodeId\n });\n this._stateCoordinator.transitionTo('directions', {\n startContentPlacement: startContentPlacement,\n endContentPlacement: endContentPlacement,\n startNodeId: startNodeId\n });\n // Loading state will be reset in the transitionTo method\n _context6.next = 38;\n break;\n case 35:\n _context6.prev = 35;\n _context6.t1 = _context6[\"catch\"](2);\n console.error(\"\\u274C MapView: Directions state error occurred:\", _context6.t1);\n // console.log(`�� MapView: Resetting loading state due to error`);\n // this._stateCoordinator.setLoading(false, 'directions');\n // Handle error appropriately\n case 38:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this, [[2, 35], [13, 21]]);\n }));\n function setToDirectionsState() {\n return _setToDirectionsState.apply(this, arguments);\n }\n return setToDirectionsState;\n }()\n }, {\n key: \"setToSetupState\",\n value: function () {\n var _setToSetupState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n // console.log(\"SET TO SETUP STATE\");\n\n // Reset map view to default top-down perspective\n if (this.map) {\n this.map.easeTo({\n pitch: 0,\n bearing: 0,\n duration: 0\n });\n }\n if (!this.setupControl) {\n this.setupControl = new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SetupControl();\n this.addControl(this.setupControl);\n }\n this._stateCoordinator.transitionTo('setup');\n case 3:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function setToSetupState() {\n return _setToSetupState.apply(this, arguments);\n }\n return setToSetupState;\n }()\n }, {\n key: \"setToSelectionState\",\n value: function () {\n var _setToSelectionState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(criteria) {\n var multiSelect,\n _selectionStateData$f,\n _selectionStateData$f2,\n _selectionStateData$f3,\n selectionStateData,\n bounds,\n _args8 = arguments;\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n multiSelect = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : true;\n this.selectionCriteria = criteria;\n this.multiSelect = multiSelect;\n\n // Set loading state for selection features\n this._stateCoordinator.setLoading(true, 'selection');\n\n // Call the loadMapViewSelectionState endpoint\n _context8.prev = 4;\n _context8.next = 7;\n return this.mapViewApi.loadMapViewSelectionState(this.mapData.map_id, this.mapData.map_view_id, criteria);\n case 7:\n selectionStateData = _context8.sent;\n // Store the GeoJSON data for creating selectable layers\n this.selectionGeoJSON = selectionStateData;\n console.log('✅ Selection GeoJSON loaded:', {\n type: selectionStateData === null || selectionStateData === void 0 ? void 0 : selectionStateData.type,\n featureCount: selectionStateData === null || selectionStateData === void 0 || (_selectionStateData$f = selectionStateData.features) === null || _selectionStateData$f === void 0 ? void 0 : _selectionStateData$f.length,\n firstFeature: selectionStateData === null || selectionStateData === void 0 || (_selectionStateData$f2 = selectionStateData.features) === null || _selectionStateData$f2 === void 0 ? void 0 : _selectionStateData$f2[0],\n fullData: selectionStateData\n });\n\n // Transition to selection state WITH the GeoJSON data\n this._stateCoordinator.transitionTo('selection', {\n criteria: criteria,\n geojson: selectionStateData,\n multiSelect: multiSelect\n });\n\n // After transition, animate to fit bounds and lock to bird's eye view\n if ((selectionStateData === null || selectionStateData === void 0 || (_selectionStateData$f3 = selectionStateData.features) === null || _selectionStateData$f3 === void 0 ? void 0 : _selectionStateData$f3.length) > 0) {\n // Lock to bird's eye view first\n this.map.easeTo({\n pitch: 0,\n bearing: 0,\n duration: 500\n });\n\n // Calculate bounds from converted GeoJSON features\n bounds = new mapboxgl.LngLatBounds(); // Add null check here\n if (selectionStateData && selectionStateData.features) {\n selectionStateData.features.forEach(function (feature) {\n // Add bounds calculation logic here\n // Make sure feature.geometry.coordinates exists\n if (feature.geometry && feature.geometry.coordinates) {\n // Calculate bounds based on geometry type\n if (feature.geometry.type === 'Point') {\n bounds.extend(feature.geometry.coordinates);\n } else if (feature.geometry.type === 'LineString') {\n feature.geometry.coordinates.forEach(function (coord) {\n return bounds.extend(coord);\n });\n } else if (feature.geometry.type === 'Polygon') {\n // For a Polygon, iterate through the outer ring (and inner rings if needed)\n feature.geometry.coordinates[0].forEach(function (coord) {\n return bounds.extend(coord);\n });\n }\n }\n });\n\n // Only call fitBounds if bounds is valid\n if (bounds.isEmpty() === false) {\n this.map.fitBounds(bounds, {\n padding: 80,\n duration: 1000,\n maxZoom: 16\n });\n }\n }\n }\n _context8.next = 19;\n break;\n case 14:\n _context8.prev = 14;\n _context8.t0 = _context8[\"catch\"](4);\n console.error('❌ Error loading map view selection state:', _context8.t0);\n this.selectionGeoJSON = null;\n // Still transition but without data\n this._stateCoordinator.transitionTo('selection', {\n criteria: criteria,\n geojson: null,\n multiSelect: multiSelect\n });\n case 19:\n _context8.prev = 19;\n // Reset loading state\n this._stateCoordinator.setLoading(false, 'selection');\n return _context8.finish(19);\n case 22:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this, [[4, 14, 19, 22]]);\n }));\n function setToSelectionState(_x4) {\n return _setToSelectionState.apply(this, arguments);\n }\n return setToSelectionState;\n }()\n }, {\n key: \"getConfirmedSelection\",\n value: function getConfirmedSelection() {\n return this.confirmedSelection;\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: \"initiateFindPath\",\n value: function initiateFindPath(startContentPlacementId, endContentPlacementId) {\n this.fire('initiate:findPath', {\n startContentPlacementId: startContentPlacementId,\n endContentPlacementId: endContentPlacementId\n });\n }\n }, {\n key: \"initiateFindPathFromLocation\",\n value: function initiateFindPathFromLocation(endContentPlacement) {\n this.fire('initiate:findPathFromLocation', {\n location: this.location,\n endContentPlacement: endContentPlacement\n });\n }\n }, {\n key: \"findPath\",\n value: function () {\n var _findPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(startContentPlacementId, endContentPlacementId) {\n var response_data;\n return _regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n this._stateCoordinator.setLoading(true, 'directions');\n _context9.prev = 1;\n _context9.next = 4;\n return this.routesApi.findPath(this.mapData.map_id, startContentPlacementId, endContentPlacementId);\n case 4:\n response_data = _context9.sent;\n if (!response_data) {\n _context9.next = 9;\n break;\n }\n return _context9.abrupt(\"return\", response_data);\n case 9:\n console.error('Failed to find path.');\n case 10:\n _context9.prev = 10;\n this._stateCoordinator.setLoading(false, 'directions');\n return _context9.finish(10);\n case 13:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9, this, [[1,, 10, 13]]);\n }));\n function findPath(_x5, _x6) {\n return _findPath.apply(this, arguments);\n }\n return findPath;\n }()\n }, {\n key: \"findPathFromNodeToPlacement\",\n value: function () {\n var _findPathFromNodeToPlacement = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(startNodeId, endPlacementId) {\n var response_data;\n return _regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n this._stateCoordinator.setLoading(true, 'directions');\n _context10.prev = 1;\n _context10.next = 4;\n return this.routesApi.findPathFromNodeToPlacement(this.mapData.map_id, startNodeId, endPlacementId);\n case 4:\n response_data = _context10.sent;\n if (!response_data) {\n _context10.next = 9;\n break;\n }\n return _context10.abrupt(\"return\", response_data);\n case 9:\n console.error('Failed to find path.');\n case 10:\n _context10.prev = 10;\n this._stateCoordinator.setLoading(false, 'directions');\n return _context10.finish(10);\n case 13:\n case \"end\":\n return _context10.stop();\n }\n }, _callee10, this, [[1,, 10, 13]]);\n }));\n function findPathFromNodeToPlacement(_x7, _x8) {\n return _findPathFromNodeToPlacement.apply(this, arguments);\n }\n return findPathFromNodeToPlacement;\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 _callee11(query) {\n var skip,\n limit,\n floor,\n _args11 = arguments;\n return _regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n skip = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : 0;\n limit = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : 30;\n floor = _args11.length > 3 && _args11[3] !== undefined ? _args11[3] : null;\n if (!(query === '')) {\n _context11.next = 5;\n break;\n }\n return _context11.abrupt(\"return\");\n case 5:\n if (this.mapData) {\n _context11.next = 7;\n break;\n }\n return _context11.abrupt(\"return\");\n case 7:\n _context11.prev = 7;\n _context11.next = 10;\n return this.searchApi.search(this.mapData.map_id, this.mapData.map_view_id, query, skip, limit, floor);\n case 10:\n return _context11.abrupt(\"return\", _context11.sent);\n case 13:\n _context11.prev = 13;\n _context11.t0 = _context11[\"catch\"](7);\n if (axios.isCancel(_context11.t0)) {\n console.error('Request canceled:', _context11.t0.message);\n } else {\n console.error('Search error:', _context11.t0);\n }\n case 16:\n case \"end\":\n return _context11.stop();\n }\n }, _callee11, this, [[7, 13]]);\n }));\n function search(_x9) {\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 _callee12(contentPlacementId) {\n var details;\n return _regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n _context12.prev = 0;\n _context12.next = 3;\n return this.searchApi.fetchContentPlacementDetails(contentPlacementId);\n case 3:\n details = _context12.sent;\n return _context12.abrupt(\"return\", details);\n case 7:\n _context12.prev = 7;\n _context12.t0 = _context12[\"catch\"](0);\n if (axios.isCancel(_context12.t0)) {\n console.error('Request canceled:', _context12.t0.message);\n } else {\n console.error('Fetching content placement details error:', _context12.t0);\n }\n case 10:\n case \"end\":\n return _context12.stop();\n }\n }, _callee12, this, [[0, 7]]);\n }));\n function getContentPlacementDetails(_x10) {\n return _getContentPlacementDetails.apply(this, arguments);\n }\n return getContentPlacementDetails;\n }()\n }, {\n key: \"flyTo\",\n value: function flyTo(options) {\n // console.log('flyTo', options);\n this.map.flyTo(options);\n }\n }, {\n key: \"removeMatchingFeaturesFromExistingLayers\",\n value: function removeMatchingFeaturesFromExistingLayers(criteria) {\n var _this8 = 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 var layerId = layer.id;\n\n // Skip our own selectable layers\n if (layerId.includes('selectable-') || layerId.includes('booked-') || layerId.includes('selected-feature') || layerId.includes('confirmed-selection')) {\n return;\n }\n\n // Get current filter\n var currentFilter = _this8.map.getFilter(layerId);\n\n // Create a filter to exclude features that match ALL criteria\n var matchingCondition = null;\n var _loop = function _loop() {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n property = _Object$entries$_i[0],\n value = _Object$entries$_i[1];\n var condition;\n if (Array.isArray(value)) {\n // Handle multiple values (e.g., size: ['10x10', '20x10'])\n var conditions = value.map(function (v) {\n return ['==', ['get', property], v];\n });\n condition = ['any'].concat(_toConsumableArray(conditions));\n } else {\n // Handle single value\n condition = ['==', ['get', property], value];\n }\n if (matchingCondition === null) {\n matchingCondition = condition;\n } else {\n // Combine with AND logic - feature must match ALL criteria\n matchingCondition = ['all', matchingCondition, condition];\n }\n };\n for (var _i = 0, _Object$entries = Object.entries(criteria); _i < _Object$entries.length; _i++) {\n _loop();\n }\n\n // Create exclusion filter - hide features that match ALL criteria\n var exclusionFilter = ['!', matchingCondition];\n\n // Apply the exclusion filter\n if (exclusionFilter) {\n if (currentFilter) {\n // Combine with existing filter\n var combinedFilter = ['all', currentFilter, exclusionFilter];\n _this8.map.setFilter(layerId, combinedFilter);\n } else {\n // Apply only the exclusion filter\n _this8.map.setFilter(layerId, exclusionFilter);\n }\n }\n }\n });\n }\n }, {\n key: \"_getLabelGeometry\",\n value: function _getLabelGeometry(feature) {\n var _this$mapData, _this$mapData2, _this$mapData3;\n var refCoordinate = ((_this$mapData = this.mapData) === null || _this$mapData === void 0 ? void 0 : _this$mapData.reference_coordinate) || [0.0, 0.0];\n var scalingFactor = ((_this$mapData2 = this.mapData) === null || _this$mapData2 === void 0 ? void 0 : _this$mapData2.coordinate_scaling_multiplier) || 30.0;\n var mapId = ((_this$mapData3 = this.mapData) === null || _this$mapData3 === void 0 ? void 0 : _this$mapData3.map_id) || null;\n console.log('🔵 MapView: mapId:', mapId);\n if (_utils_outdoorMapIds__WEBPACK_IMPORTED_MODULE_8__.outdoorMapIdTemplates.includes(mapId)) {\n console.log('🔵 MapId:', mapId);\n return feature.geometry;\n }\n if (feature.properties.label_location) {\n var labelLocation = feature.properties.label_location;\n\n // Parse JSON string if label_location is a string\n if (typeof labelLocation === 'string') {\n try {\n labelLocation = JSON.parse(labelLocation);\n } catch (error) {\n console.warn('Failed to parse label_location JSON:', error);\n return feature.geometry;\n }\n }\n if (labelLocation && labelLocation.coordinates && Array.isArray(labelLocation.coordinates) && labelLocation.coordinates.length >= 2) {\n var labelCoords = labelLocation.coordinates;\n if (typeof labelCoords[0] === 'number' && typeof labelCoords[1] === 'number') {\n var convertedLabelCoords = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__.convertVerticesToCoordinates)([labelCoords], refCoordinate, scalingFactor);\n\n // Round coordinates to reduce precision issues\n var roundedCoords = [Math.round(convertedLabelCoords[0][0] * 1000000) / 1000000,\n // ~6 decimal places\n Math.round(convertedLabelCoords[0][1] * 1000000) / 1000000];\n return {\n type: 'Point',\n coordinates: roundedCoords\n };\n }\n }\n }\n return feature.geometry;\n }\n }, {\n key: \"_findOriginalFeature\",\n value: function _findOriginalFeature(featureId) {\n if (!this.selectionGeoJSON || !this.selectionGeoJSON.features) {\n return null;\n }\n return this.selectionGeoJSON.features.find(function (feature) {\n return feature.properties.feature_id === featureId;\n });\n }\n }, {\n key: \"createSelectableContentLayers\",\n value: function createSelectableContentLayers() {\n var _this9 = this;\n var geojsonData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var dataToUse = geojsonData || this.selectionGeoJSON;\n if (!dataToUse || !dataToUse.features) {\n console.error('❌ NO DATA TO CREATE LAYERS');\n return;\n }\n try {\n var _this$mapData4, _this$mapData5;\n // Remove old layers if they exist\n if (this.map.getLayer('selectable-label-layer')) this.map.removeLayer('selectable-label-layer');\n if (this.map.getLayer('selectable-outline-layer')) this.map.removeLayer('selectable-outline-layer');\n if (this.map.getLayer('selectable-fill-layer')) this.map.removeLayer('selectable-fill-layer');\n if (this.map.getLayer('booked-label-layer')) this.map.removeLayer('booked-label-layer');\n // if (this.map.getLayer('booked-outline-layer')) this.map.removeLayer('booked-outline-layer');\n if (this.map.getLayer('booked-fill-layer')) this.map.removeLayer('booked-fill-layer');\n if (this.map.getSource('selectable-labels')) this.map.removeSource('selectable-labels');\n if (this.map.getSource('selectable-content')) this.map.removeSource('selectable-content');\n if (this.map.getSource('booked-labels')) this.map.removeSource('booked-labels');\n if (this.map.getSource('booked-content')) this.map.removeSource('booked-content');\n var refCoordinate = ((_this$mapData4 = this.mapData) === null || _this$mapData4 === void 0 ? void 0 : _this$mapData4.reference_coordinate) || [0.0, 0.0];\n var scalingFactor = ((_this$mapData5 = this.mapData) === null || _this$mapData5 === void 0 ? void 0 : _this$mapData5.coordinate_scaling_multiplier) || 30.0;\n var convertedFeatures = dataToUse.features;\n\n // Separate features into selectable and booked\n var selectableFeatures = convertedFeatures.filter(function (feature) {\n return feature.properties.booking_status !== 'booked';\n });\n var bookedFeatures = convertedFeatures.filter(function (feature) {\n return feature.properties.booking_status === 'booked';\n });\n\n // Create selectable GeoJSON\n var selectableGeoJSON = {\n type: 'FeatureCollection',\n features: selectableFeatures\n };\n\n // Create booked GeoJSON\n var bookedGeoJSON = {\n type: 'FeatureCollection',\n features: bookedFeatures\n };\n\n // Add selectable content source\n this.map.addSource('selectable-content', {\n type: 'geojson',\n data: selectableGeoJSON,\n promoteId: 'feature_id'\n });\n\n // Add booked content source\n this.map.addSource('booked-content', {\n type: 'geojson',\n data: bookedGeoJSON,\n // promoteId: 'placement_id'\n promoteId: 'feature_id'\n });\n\n // Create label features for selectable content\n var selectableLabelFeatures = selectableFeatures.map(function (feature) {\n var labelGeometry;\n if (feature.properties.label_location) {\n var labelCoords = feature.properties.label_location.coordinates;\n var convertedLabelCoords = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__.convertVerticesToCoordinates)([labelCoords], refCoordinate, scalingFactor);\n labelGeometry = {\n type: 'Point',\n coordinates: convertedLabelCoords[0]\n };\n } else {\n labelGeometry = feature.geometry;\n }\n return {\n type: 'Feature',\n geometry: labelGeometry,\n properties: feature.properties\n };\n });\n\n // Create label features for booked content\n var bookedLabelFeatures = bookedFeatures.map(function (feature) {\n var labelGeometry;\n if (feature.properties.label_location) {\n var labelCoords = feature.properties.label_location.coordinates;\n var convertedLabelCoords = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__.convertVerticesToCoordinates)([labelCoords], refCoordinate, scalingFactor);\n labelGeometry = {\n type: 'Point',\n coordinates: convertedLabelCoords[0]\n };\n } else {\n labelGeometry = feature.geometry;\n }\n return {\n type: 'Feature',\n geometry: labelGeometry,\n properties: feature.properties\n };\n });\n this.map.addSource('selectable-labels', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: selectableLabelFeatures\n }\n });\n this.map.addSource('booked-labels', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: bookedLabelFeatures\n }\n });\n\n // Create canvas-based checkmark icon for confirmed selections\n var canvas = document.createElement('canvas');\n var baseSize = 48;\n var scaleFactor = 1;\n canvas.width = baseSize * scaleFactor;\n canvas.height = baseSize * scaleFactor;\n var ctx = canvas.getContext('2d');\n ctx.scale(scaleFactor, scaleFactor);\n\n // Draw white circle background\n ctx.fillStyle = 'white';\n ctx.beginPath();\n ctx.arc(24, 24, 20, 0, Math.PI * 2);\n ctx.fill();\n\n // Draw green circle border\n ctx.strokeStyle = '#00C853';\n ctx.lineWidth = 3;\n ctx.stroke();\n\n // Draw green checkmark\n ctx.strokeStyle = '#00C853';\n ctx.lineWidth = 4;\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n ctx.beginPath();\n ctx.moveTo(14, 24);\n ctx.lineTo(20, 30);\n ctx.lineTo(34, 16);\n ctx.stroke();\n var pngDataUri = canvas.toDataURL('image/png');\n this.map.loadImage(pngDataUri, function (error, image) {\n if (error) {\n console.error('❌ Error loading canvas checkmark icon:', error);\n } else {\n _this9.map.addImage('checkmark-icon', image);\n if (!_this9.map.getLayer('confirmed-selection-icon-layer')) {\n _this9.map.addLayer({\n id: 'confirmed-selection-icon-layer',\n type: 'symbol',\n source: 'confirmed-selection-labels',\n layout: {\n 'icon-image': 'checkmark-icon',\n 'icon-size': 0.60,\n 'icon-anchor': 'center',\n 'icon-allow-overlap': true\n }\n });\n }\n }\n });\n\n // Create confirmed selection label source\n this.map.addSource('confirmed-selection-labels', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: []\n }\n });\n\n // Add confirmed selection label layer\n this.map.addLayer({\n id: 'confirmed-selection-label-layer',\n type: 'symbol',\n source: 'confirmed-selection-labels',\n layout: {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium', 'Arial Unicode MS Regular'],\n 'text-size': ['interpolate', ['exponential', 1.99], ['zoom'], 12, 1.5, 22, 1000]\n },\n paint: {\n 'text-color': '#00C853',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n this.map.addSource('confirmed-selection', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: []\n }\n });\n\n // Add layers in correct order (bottom to top)\n // 1. Booked fill layer (light grey) - bottom layer\n this.map.addLayer({\n id: 'booked-fill-layer',\n type: 'fill',\n source: 'booked-content',\n paint: {\n 'fill-color': '#f2f2f2',\n 'fill-opacity': 1.0\n }\n });\n\n // 2. Booked outline layer (grey outline)\n // this.map.addLayer({\n // id: 'booked-outline-layer',\n // type: 'line',\n // source: 'booked-content',\n // paint: {\n // 'line-color': '#999999',\n // 'line-width': 1\n // }\n // });\n // console.log('✅ BOOKED OUTLINE LAYER ADDED');\n\n // 3. Booked label layer (grey text)\n this.map.addLayer({\n id: 'booked-label-layer',\n type: 'symbol',\n source: 'booked-labels',\n layout: {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium', 'Arial Unicode MS Regular'],\n 'text-size': ['interpolate', ['exponential', 1.99], ['zoom'], 12, 1.5, 22, 1000]\n },\n paint: {\n 'text-color': '#666666',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n\n // 4. Base selectable fill layer (white)\n this.map.addLayer({\n id: 'selectable-fill-layer',\n type: 'fill',\n source: 'selectable-content',\n paint: {\n 'fill-color': '#FFFFFF',\n 'fill-opacity': 0.8\n }\n });\n\n // 5. Selectable outline layer (blue outline)\n this.map.addLayer({\n id: 'selectable-outline-layer',\n type: 'line',\n source: 'selectable-content',\n paint: {\n 'line-color': '#1987ff',\n 'line-width': 2\n }\n });\n\n // 6. Confirmed selection fill layer (light green fill)\n this.map.addLayer({\n id: 'confirmed-selection-fill-layer',\n type: 'fill',\n source: 'confirmed-selection',\n paint: {\n 'fill-color': '#d1fae2',\n 'fill-opacity': ['interpolate', ['linear'], ['zoom'], 10, 0.6, 16, 0.8]\n }\n });\n\n // 7. Confirmed selection outline layer (green outline)\n this.map.addLayer({\n id: 'confirmed-selection-outline-layer',\n type: 'line',\n source: 'confirmed-selection',\n paint: {\n 'line-color': '#00C853',\n 'line-width': 2,\n 'line-opacity': ['interpolate', ['linear'], ['zoom'], 10, 0.7, 16, 1.0]\n }\n });\n\n // 8. Selectable label layer (blue text)\n this.map.addLayer({\n id: 'selectable-label-layer',\n type: 'symbol',\n source: 'selectable-labels',\n layout: {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium', 'Arial Unicode MS Regular'],\n 'text-size': ['interpolate', ['exponential', 1.99], ['zoom'], 12, 1.5, 22, 1000]\n },\n paint: {\n 'text-color': '#0263ca',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n\n // Verify layer order and existence\n var allLayers = this.map.getStyle().layers;\n var ourLayers = allLayers.filter(function (layer) {\n return layer.id.includes('selectable-') || layer.id.includes('booked-') || layer.id.includes('confirmed-selection');\n });\n } catch (error) {\n console.error('❌ ERROR:', error);\n console.error('Stack:', error.stack);\n }\n }\n }, {\n key: \"removeSelectableContentLayers\",\n value: function removeSelectableContentLayers() {\n var _this10 = this;\n // Remove layers if they exist\n var layerIds = ['selectable-label-layer', 'selectable-outline-layer', 'selectable-fill-layer', 'booked-label-layer',\n // 'booked-outline-layer', \n 'booked-fill-layer', 'confirmed-selection-fill-layer', 'confirmed-selection-outline-layer', 'confirmed-selection-icon-layer', 'confirmed-selection-label-layer'];\n layerIds.forEach(function (layerId) {\n if (_this10.map.getLayer(layerId)) {\n _this10.map.removeLayer(layerId);\n }\n });\n\n // Remove sources if they exist\n if (this.map.getSource('selectable-content')) {\n this.map.removeSource('selectable-content');\n }\n if (this.map.getSource('selectable-labels')) {\n this.map.removeSource('selectable-labels');\n }\n if (this.map.getSource('booked-content')) {\n this.map.removeSource('booked-content');\n }\n if (this.map.getSource('booked-labels')) {\n this.map.removeSource('booked-labels');\n }\n if (this.map.getSource('confirmed-selection')) {\n this.map.removeSource('confirmed-selection');\n }\n if (this.map.getSource('confirmed-selection-labels')) {\n this.map.removeSource('confirmed-selection-labels');\n }\n\n // Remove checkmark icon\n if (this.map.hasImage('checkmark-icon')) {\n this.map.removeImage('checkmark-icon');\n }\n }\n\n // Clear confirmed selection layers\n }, {\n key: \"clearSelectionLayers\",\n value: function clearSelectionLayers() {\n var confirmedSource = this.map.getSource('confirmed-selection');\n var confirmedLabelsSource = this.map.getSource('confirmed-selection-labels');\n if (confirmedSource) {\n confirmedSource.setData({\n type: 'FeatureCollection',\n features: []\n });\n }\n if (confirmedLabelsSource) {\n confirmedLabelsSource.setData({\n type: 'FeatureCollection',\n features: []\n });\n }\n }\n\n // Add feature directly to confirmed selection (immediate selection)\n }, {\n key: \"addConfirmedSelectionFeature\",\n value: function addConfirmedSelectionFeature(feature) {\n var _this11 = this;\n var clearExisting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var confirmedSource = this.map.getSource('confirmed-selection');\n var confirmedLabelsSource = this.map.getSource('confirmed-selection-labels');\n var selectableSource = this.map.getSource('selectable-content');\n var selectableLabelsSource = this.map.getSource('selectable-labels');\n if (!confirmedSource || !confirmedLabelsSource || !selectableSource || !selectableLabelsSource) {\n console.error('❌ Required sources not found for confirmed selection');\n return;\n }\n var confirmedData = confirmedSource._data;\n var confirmedLabelsData = confirmedLabelsSource._data;\n var selectableData = selectableSource._data;\n var selectableLabelsData = selectableLabelsSource._data;\n\n // Use feature_id as the primary identifier since it's guaranteed to exist\n var featureId = feature.properties.feature_id;\n\n // Clear existing selections if requested (single-select mode)\n if (clearExisting) {\n // Move all confirmed features back to selectable layers using original geometry\n confirmedData.features.forEach(function (confirmedFeature) {\n var confirmedFeatureId = confirmedFeature.properties.feature_id;\n\n // Get original feature geometry\n var originalFeature = _this11._findOriginalFeature(confirmedFeatureId);\n if (originalFeature) {\n // Use original geometry\n selectableData.features.push(originalFeature);\n selectableLabelsData.features.push({\n type: 'Feature',\n geometry: _this11._getLabelGeometry(originalFeature),\n properties: originalFeature.properties\n });\n } else {\n // Fallback to current geometry\n console.warn('⚠️ Original feature not found for feature:', confirmedFeatureId);\n selectableData.features.push(confirmedFeature);\n selectableLabelsData.features.push({\n type: 'Feature',\n geometry: _this11._getLabelGeometry(confirmedFeature),\n properties: confirmedFeature.properties\n });\n }\n });\n\n // Clear confirmed layers\n confirmedData.features = [];\n confirmedLabelsData.features = [];\n }\n\n // Add new feature to confirmed layers\n // CHECK: Don't add if feature already exists\n var alreadyExists = confirmedData.features.some(function (f) {\n return f.properties.feature_id === featureId;\n });\n if (!alreadyExists) {\n confirmedData.features.push(feature);\n confirmedSource.setData(confirmedData);\n\n // Create and add label feature\n var labelFeature = {\n type: 'Feature',\n geometry: this._getLabelGeometry(feature),\n properties: feature.properties\n };\n confirmedLabelsData.features.push(labelFeature);\n confirmedLabelsSource.setData(confirmedLabelsData);\n\n // Remove from selectable layers using feature_id\n selectableData.features = selectableData.features.filter(function (f) {\n return f.properties.feature_id !== featureId;\n });\n selectableSource.setData(selectableData);\n selectableLabelsData.features = selectableLabelsData.features.filter(function (f) {\n return f.properties.feature_id !== featureId;\n });\n selectableLabelsSource.setData(selectableLabelsData);\n }\n }\n\n // Remove feature from confirmed selection (deselect)\n }, {\n key: \"removeConfirmedSelectionFeature\",\n value: function removeConfirmedSelectionFeature(featureId) {\n var confirmedSource = this.map.getSource('confirmed-selection');\n var confirmedLabelsSource = this.map.getSource('confirmed-selection-labels');\n var selectableSource = this.map.getSource('selectable-content');\n var selectableLabelsSource = this.map.getSource('selectable-labels');\n if (!confirmedSource || !confirmedLabelsSource || !selectableSource || !selectableLabelsSource) {\n console.error('❌ Required sources not found for confirmed selection');\n return;\n }\n var confirmedData = confirmedSource._data;\n var confirmedLabelsData = confirmedLabelsSource._data;\n var selectableData = selectableSource._data;\n var selectableLabelsData = selectableLabelsSource._data;\n\n // Find and remove feature from confirmed layers using feature_id\n var featureToRemove = confirmedData.features.find(function (f) {\n return f.properties.feature_id === featureId;\n });\n if (!featureToRemove) {\n return;\n }\n\n // Get the original feature geometry from the original GeoJSON\n var originalFeature = this._findOriginalFeature(featureId);\n if (!originalFeature) {\n console.warn('⚠️ Original feature not found for feature:', featureId);\n // Fallback to using the current geometry\n var fallbackFeature = featureToRemove;\n selectableData.features.push(fallbackFeature);\n selectableSource.setData(selectableData);\n var labelFeature = {\n type: 'Feature',\n geometry: this._getLabelGeometry(fallbackFeature),\n properties: fallbackFeature.properties\n };\n selectableLabelsData.features.push(labelFeature);\n selectableLabelsSource.setData(selectableLabelsData);\n } else {\n // Use original geometry - this ensures high quality geometry\n selectableData.features.push(originalFeature);\n selectableSource.setData(selectableData);\n var _labelFeature = {\n type: 'Feature',\n geometry: this._getLabelGeometry(originalFeature),\n properties: originalFeature.properties\n };\n selectableLabelsData.features.push(_labelFeature);\n selectableLabelsSource.setData(selectableLabelsData);\n }\n\n // Remove from confirmed layers\n confirmedData.features = confirmedData.features.filter(function (f) {\n return f.properties.feature_id !== featureId;\n });\n confirmedSource.setData(confirmedData);\n confirmedLabelsData.features = confirmedLabelsData.features.filter(function (f) {\n return f.properties.feature_id !== featureId;\n });\n confirmedLabelsSource.setData(confirmedLabelsData);\n }\n\n // Update _findOriginalFeature to use feature_id instead of placement_id\n // _findOriginalFeature(featureId) {\n // if (!this.selectionGeoJSON || !this.selectionGeoJSON.features) {\n // return null;\n // }\n\n // return this.selectionGeoJSON.features.find(feature => \n // feature.properties.feature_id === featureId\n // );\n // }\n\n // Get all currently confirmed selection features\n }, {\n key: \"getConfirmedSelectionFeatures\",\n value: function getConfirmedSelectionFeatures() {\n var confirmedSource = this.map.getSource('confirmed-selection');\n if (!confirmedSource) {\n return [];\n }\n return confirmedSource._data.features || [];\n }\n\n // Check if a feature is currently selected\n }, {\n key: \"isFeatureSelected\",\n value: function isFeatureSelected(placementId) {\n var confirmedFeatures = this.getConfirmedSelectionFeatures();\n return confirmedFeatures.some(function (f) {\n return f.properties.placement_id === placementId || f.properties.feature_id === placementId;\n });\n }\n }, {\n key: \"_initializeState\",\n value: function () {\n var _initializeState2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {\n var _this$initialStateDat2, _this$initialStateDat3;\n return _regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n _context13.prev = 0;\n _context13.t0 = this.initialState;\n _context13.next = _context13.t0 === 'default' ? 4 : _context13.t0 === 'search' ? 6 : _context13.t0 === 'selectedContent' ? 13 : _context13.t0 === 'directions' ? 20 : _context13.t0 === 'selection' ? 23 : _context13.t0 === 'setup' ? 32 : 35;\n break;\n case 4:\n // Default state - explicitly fire the state:default event\n this._stateCoordinator.transitionTo('default');\n return _context13.abrupt(\"break\", 38);\n case 6:\n if (!(this.initialStateData && this.initialStateData.query)) {\n _context13.next = 11;\n break;\n }\n _context13.next = 9;\n return this.setToSearchState(this.initialStateData.query, this.initialStateData.skip || 0, this.initialStateData.limit || 30, this.initialStateData.floor || null);\n case 9:\n _context13.next = 12;\n break;\n case 11:\n console.warn('⚠️ Search state requires initialStateData with query property');\n case 12:\n return _context13.abrupt(\"break\", 38);\n case 13:\n if (!(this.initialStateData && this.initialStateData.contentPlacementIds)) {\n _context13.next = 18;\n break;\n }\n _context13.next = 16;\n return this.setToSelectedContentState(this.initialStateData.contentPlacementIds);\n case 16:\n _context13.next = 19;\n break;\n case 18:\n console.warn('⚠️ SelectedContent state requires initialStateData with contentPlacementIds property');\n case 19:\n return _context13.abrupt(\"break\", 38);\n case 20:\n _context13.next = 22;\n return this.setToDirectionsState(((_this$initialStateDat2 = this.initialStateData) === null || _this$initialStateDat2 === void 0 ? void 0 : _this$initialStateDat2.startContentPlacementId) || null, ((_this$initialStateDat3 = this.initialStateData) === null || _this$initialStateDat3 === void 0 ? void 0 : _this$initialStateDat3.endContentPlacementId) || null);\n case 22:\n return _context13.abrupt(\"break\", 38);\n case 23:\n if (!(this.initialStateData && this.initialStateData.criteria)) {\n _context13.next = 29;\n break;\n }\n _context13.next = 26;\n return this.setToSelectionState(this.initialStateData.criteria, this.initialStateData.multiSelect !== false // Default to true\n );\n case 26:\n // Hide loading overlay after selection state is loaded\n this._hideSelectionLoadingOverlay();\n _context13.next = 31;\n break;\n case 29:\n console.warn('⚠️ Selection state requires initialStateData with criteria property');\n // Hide loading overlay on invalid data\n this._hideSelectionLoadingOverlay();\n case 31:\n return _context13.abrupt(\"break\", 38);\n case 32:\n _context13.next = 34;\n return this.setToSetupState();\n case 34:\n return _context13.abrupt(\"break\", 38);\n case 35:\n console.warn('⚠️ Unknown initial state:', this.initialState);\n // Hide loading overlay on unknown state\n this._hideSelectionLoadingOverlay();\n return _context13.abrupt(\"break\", 38);\n case 38:\n _context13.next = 45;\n break;\n case 40:\n _context13.prev = 40;\n _context13.t1 = _context13[\"catch\"](0);\n console.error('❌ Error initializing state:', _context13.t1);\n // Hide loading overlay on error\n this._hideSelectionLoadingOverlay();\n // Fall back to default state\n this._stateCoordinator.transitionTo('default');\n case 45:\n case \"end\":\n return _context13.stop();\n }\n }, _callee13, this, [[0, 40]]);\n }));\n function _initializeState() {\n return _initializeState2.apply(this, arguments);\n }\n return _initializeState;\n }()\n }, {\n key: \"_createSelectionLoadingOverlay\",\n value: function _createSelectionLoadingOverlay() {\n this.selectionLoadingOverlay = document.createElement('div');\n this.selectionLoadingOverlay.className = 'selection-loading-overlay';\n\n // Option 2: NEW Circular progress loader - FIXED SIZE\n var progressContainer = document.createElement('div');\n progressContainer.className = 'selection-circular-progress';\n\n // Create SVG for circular progress with smaller circle to prevent cutoff\n var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('viewBox', '0 0 40 40'); // Keep viewBox at 40x40\n\n // Background circle - smaller radius to fit within container\n var backgroundCircle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n backgroundCircle.setAttribute('class', 'progress-ring');\n backgroundCircle.setAttribute('cx', '20'); // Center X\n backgroundCircle.setAttribute('cy', '20'); // Center Y\n backgroundCircle.setAttribute('r', '15'); // Radius 15 (30px diameter) - smaller to prevent cutoff\n\n // Progress circle - same smaller radius\n var progressCircle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n progressCircle.setAttribute('class', 'progress-ring-fill');\n progressCircle.setAttribute('cx', '20'); // Center X\n progressCircle.setAttribute('cy', '20'); // Center Y\n progressCircle.setAttribute('r', '15'); // Radius 15 (30px diameter) - smaller to prevent cutoff\n\n svg.appendChild(backgroundCircle);\n svg.appendChild(progressCircle);\n progressContainer.appendChild(svg);\n this.selectionLoadingOverlay.appendChild(progressContainer);\n\n // Append to the map container's parent (the actual map div) to ensure it covers everything\n var mapElement = document.getElementById(this.options.container);\n if (mapElement) {\n mapElement.appendChild(this.selectionLoadingOverlay);\n } else {\n // Fallback to mapContainer if parent not found\n this.mapContainer.appendChild(this.selectionLoadingOverlay);\n }\n }\n }, {\n key: \"_showSelectionLoadingOverlay\",\n value: function _showSelectionLoadingOverlay() {\n if (this.selectionLoadingOverlay) {\n this.selectionLoadingOverlay.style.display = 'flex';\n\n // Start the circular progress animation\n var progressCircle = this.selectionLoadingOverlay.querySelector('.progress-ring-fill');\n if (progressCircle) {\n // Reset animation\n progressCircle.classList.remove('animating');\n progressCircle.style.strokeDashoffset = '94.2';\n\n // Start animation after a small delay to ensure it's visible\n setTimeout(function () {\n progressCircle.classList.add('animating');\n }, 50);\n }\n }\n }\n }, {\n key: \"_hideSelectionLoadingOverlay\",\n value: function _hideSelectionLoadingOverlay() {\n if (this.selectionLoadingOverlay) {\n this.selectionLoadingOverlay.classList.add('hidden');\n var progressCircle = this.selectionLoadingOverlay.querySelector('.progress-ring-fill');\n if (progressCircle) {\n progressCircle.classList.remove('animating');\n progressCircle.style.strokeDashoffset = '188.4';\n }\n // setTimeout(() => {\n // if (this.selectionLoadingOverlay) {\n // this.selectionLoadingOverlay.style.display = 'none';\n // this.selectionLoadingOverlay.classList.remove('hidden');\n\n // // Reset progress animation for next time\n // const progressCircle = this.selectionLoadingOverlay.querySelector('.progress-ring-fill');\n // if (progressCircle) {\n // progressCircle.classList.remove('animating');\n // progressCircle.style.strokeDashoffset = '188.4';\n // }\n // }\n // }, 100); // Match the CSS transition duration\n }\n }\n }, {\n key: \"_initializeKioskReset\",\n value: function _initializeKioskReset() {\n var _this12 = this;\n // Reset the timer when any state changes\n this.on('state:default', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:search', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:selectedContent', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:directions', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:setup', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:selection', function () {\n return _this12._resetKioskTimer();\n });\n\n // Reset the timer when camera changes (user interaction with map)\n this.on('moveend', function () {\n return _this12._resetKioskTimer();\n });\n this.on('zoomend', function () {\n return _this12._resetKioskTimer();\n });\n this.on('pitchend', function () {\n return _this12._resetKioskTimer();\n });\n this.on('rotateend', function () {\n return _this12._resetKioskTimer();\n });\n this.on('dragend', function () {\n return _this12._resetKioskTimer();\n });\n\n // Start the timer - delay slightly to ensure listeners are attached\n setTimeout(function () {\n _this12._startKioskTimer();\n }, 100);\n }\n }, {\n key: \"_startKioskTimer\",\n value: function _startKioskTimer() {\n var _this13 = this;\n var resetTimeSeconds = KIOSK_RESET_TIME / 1000;\n var timeRemaining = resetTimeSeconds;\n\n // Clear any existing countdown interval first\n if (this.kioskCountdownInterval) {\n clearInterval(this.kioskCountdownInterval);\n }\n\n // Start countdown logging\n this.kioskCountdownInterval = setInterval(function () {\n timeRemaining--;\n if (timeRemaining <= 0) {\n clearInterval(_this13.kioskCountdownInterval);\n }\n }, 1000);\n\n // Set the actual reset timer\n this.kioskResetTimer = setTimeout(function () {\n var currentState = _this13._stateCoordinator.state;\n var currentFloor = _this13._currentFloorIndex;\n var defaultFloor = _this13._defaultFloorIndex;\n var defaultBearing = _this13._defaultBearing;\n var defaultPitch = _this13._defaultPitch;\n\n // Close any open modals (e.g., QR code modal)\n _this13.hideModal();\n\n // Reset to default floor with default camera settings\n _this13.updateFloor(defaultFloor, true, defaultBearing, defaultPitch);\n\n // Reset state to default if not already\n if (currentState !== 'default') {\n _this13.setToDefaultState();\n }\n\n // Clear the countdown interval\n if (_this13.kioskCountdownInterval) {\n clearInterval(_this13.kioskCountdownInterval);\n }\n }, KIOSK_RESET_TIME);\n }\n }, {\n key: \"_resetKioskTimer\",\n value: function _resetKioskTimer() {\n var currentState = this._stateCoordinator.state;\n\n // Clear existing timer\n if (this.kioskResetTimer) {\n clearTimeout(this.kioskResetTimer);\n }\n\n // Clear any existing countdown interval\n if (this.kioskCountdownInterval) {\n clearInterval(this.kioskCountdownInterval);\n }\n\n // Restart the timer\n this._startKioskTimer();\n }\n }, {\n key: \"_destroyKioskTimer\",\n value: function _destroyKioskTimer() {\n if (this.kioskResetTimer) {\n clearTimeout(this.kioskResetTimer);\n this.kioskResetTimer = null;\n }\n if (this.kioskCountdownInterval) {\n clearInterval(this.kioskCountdownInterval);\n this.kioskCountdownInterval = null;\n }\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n//# sourceURL=webpack://waygomaps/./src/components/MapView/MapView.js?");
815
+ 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\");\n/* harmony import */ var _assets_loading_spinner_1_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/loading-spinner 1.svg */ \"./src/assets/loading-spinner 1.svg\");\n/* harmony import */ var _utils_outdoorMapIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/outdoorMapIds */ \"./src/utils/outdoorMapIds.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\n/* harmony import */ var _utils_geolocationManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/geolocationManager */ \"./src/utils/geolocationManager.js\");\nvar _defaultMapOptions;\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 _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 _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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure 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 _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 _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\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 _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 _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); }\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 _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); }\n\n\n\n\n\n\n\n\n\n\n// import WaygoLogoUrl from \"../../assets/WaygoLogoWhite.svg\";\n// import WaygoLogoUrl from \"../../assets/WaygoIconWhite.svg\";\n\n\n\nvar MAPBOX_VERSIONS = {\n \"default\": '3.5.1',\n 'johnson-controls-roadshow-2026': '3.17.0',\n 'usbank-del-coronado-2026': '3.17.0'\n};\nvar GPS_MAP_IDS = ['usbank-del-coronado-2026'];\nvar GPS_MAX_START_DISTANCE_METERS = 150;\nfunction getMapboxUrls(mapId) {\n var version = MAPBOX_VERSIONS[mapId] || MAPBOX_VERSIONS[\"default\"];\n return {\n css: \"https://api.mapbox.com/mapbox-gl-js/v\".concat(version, \"/mapbox-gl.css\"),\n js: \"https://api.mapbox.com/mapbox-gl-js/v\".concat(version, \"/mapbox-gl.js\")\n };\n}\nvar accessToken = 'pk.eyJ1Ijoid2F5Z28tbWFwcyIsImEiOiJjbGtxYzZ1N3QxdG43M210bXFuYmJ4a3gxIn0.tlbznj_fRJ8La6s2UUMO6A';\nvar KIOSK_RESET_TIME = 90000;\nvar MAP_BOUNDS_OVERRIDES = {\n 'johnson-controls-roadshow-2026': {\n bounds: [[-25, 27], [30, 68]],\n maxBounds: [[-25, 27], [30, 68]]\n }\n};\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 = (_defaultMapOptions = {\n container: 'map',\n sourceId: '2024.2xw_YUXYS8GoDTB2AQgN3A',\n center: [0, 0],\n floor: 0,\n zoom: 13,\n bearing: 0,\n // 46.15762290134818,-25.60000000000025\n // pitch: 30,\n pitch: 46\n}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defaultMapOptions, \"bearing\", 0), \"minPitch\", 0), \"maxPitch\", 60), \"minZoom\", 0.0), \"maxZoom\", 19.5), \"bounds\", null), \"doubleClickZoom\", true), \"dragPan\", true), \"dragRotate\", true), \"scrollZoom\", true), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defaultMapOptions, \"touchPitch\", true), \"touchZoomRotate\", true), \"interactive\", true), \"trackResize\", true), \"keyboard\", true), \"defaultControls\", false), \"setup\", false), \"selectionCriteria\", null), \"initialState\", 'default'), \"initialStateData\", null), _defineProperty(_defaultMapOptions, \"showQRCodeInKioskMode\", true));\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\n // Store initial state configuration BEFORE calling _initialize\n _this.initialState = options.initialState || 'default';\n _this.initialStateData = options.initialStateData || null;\n\n // If initializing in selection state, show loading overlay immediately\n if (_this.initialState === 'selection') {\n _this._createSelectionLoadingOverlay();\n _this._showSelectionLoadingOverlay();\n }\n _this.ready = _this._initialize(options);\n _this.initialLoad = false;\n _this.originalFilters = {};\n _this._currentFloorIndex = options.floor;\n // Store default values from merged options (after super call)\n _this._defaultFloorIndex = _this.options.floor || 0;\n _this._defaultZoom = _this.options.zoom || 13;\n _this._defaultBearing = _this.options.bearing || 0;\n _this._defaultPitch = _this.options.pitch || 0;\n _this.mapData = null;\n _this._stateCoordinator = new _StateCoordinator__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_this);\n _this.defaultControls = options.defaultControls;\n _this.setupControl = null;\n _this.location = options.location || null;\n _this.modalContainer = null;\n _this.selectionCriteria = options.selectionCriteria || null;\n _this.multiSelect = true;\n _this.confirmedSelection = null;\n\n // Initialize kiosk auto-reset timer if in kiosk mode\n _this.kioskResetTimer = null;\n _this.kioskCountdownInterval = null;\n _this.isKioskMode = _this.location !== null;\n\n // GPS state — populated after mapData loads in _initializeGps\n _this.gpsEnabled = false;\n _this.gpsPermissionState = 'prompt';\n if (_this.isKioskMode) {\n _this._initializeKioskReset();\n } else {\n console.log('📍 Not in kiosk mode - no auto-reset timer');\n }\n return _this;\n }\n _inherits(MapView, _Component);\n return _createClass(MapView, [{\n key: \"showModal\",\n value: function showModal(content) {\n var _this2 = this;\n // Create modal container if it doesn't exist\n if (!this.modalContainer) {\n this.modalContainer = document.createElement('div');\n this.modalContainer.className = 'waygo-map-modal-container';\n this.mapContainer.appendChild(this.modalContainer);\n\n // Add click handler to close modal when clicking outside\n this.modalContainer.addEventListener('click', function (e) {\n if (e.target === _this2.modalContainer) {\n _this2.hideModal();\n }\n });\n }\n\n // Create modal content\n var modalContent = document.createElement('div');\n modalContent.className = 'waygo-map-modal-content';\n\n // Can accept HTML string or DOM element\n if (typeof content === 'string') {\n modalContent.innerHTML = content;\n } else {\n modalContent.appendChild(content);\n }\n\n // Clear existing content and add new\n this.modalContainer.innerHTML = '';\n this.modalContainer.appendChild(modalContent);\n this.modalContainer.style.display = 'flex';\n }\n }, {\n key: \"hideModal\",\n value: function hideModal() {\n if (this.modalContainer) {\n this.modalContainer.style.display = 'none';\n }\n }\n }, {\n key: \"_initialize\",\n value: function () {\n var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this3 = this;\n var mapId, styleId, boundsOverride;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n mapId = this.options.sourceId.split('.')[0];\n _context.next = 4;\n return this._loadMapLibraries(mapId);\n case 4:\n mapboxgl.clearStorage();\n this.render();\n _context.next = 8;\n return this._initializeMapData();\n case 8:\n if (this.mapData) {\n _context.next = 11;\n break;\n }\n console.error(\"Error initializing map data.\");\n return _context.abrupt(\"return\");\n case 11:\n styleId = this.mapData.style_id;\n boundsOverride = MAP_BOUNDS_OVERRIDES[this.mapData.map_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 // maxBounds: boundsOverride?.maxBounds || undefined,\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 (!_this3.initialLoad) {\n _this3._initializeOriginalFilters();\n _this3.updateFloor(_this3.options.floor, false);\n _this3.initialLoad = true;\n }\n });\n this.map.on('style.load', function () {\n console.log(mapboxgl.version);\n // this.map.setConfigProperty('basemap', 'theme', 'monochrome');\n // this.map.setConfigProperty('basemap', 'lightPreset', 'dusk');\n });\n this.map.on('load', function () {\n if (_this3.defaultControls) {\n _this3._addLogoImage();\n _this3._addDefaultControls();\n _this3.updateFloor(_this3.options.floor, false);\n }\n\n // Initialize the specified state after map loads\n _this3._initializeState();\n _this3.fire('load', {\n mapData: _this3.mapData\n });\n });\n this._initializeEventListeners();\n } else {\n console.error('Mapbox GL JS is not loaded.');\n }\n _context.next = 19;\n break;\n case 16:\n _context.prev = 16;\n _context.t0 = _context[\"catch\"](0);\n console.error('Failed to initialize the map:', _context.t0);\n case 19:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[0, 16]]);\n }));\n function _initialize() {\n return _initialize2.apply(this, arguments);\n }\n return _initialize;\n }()\n }, {\n key: \"_addLogoImage\",\n value: function _addLogoImage() {\n if (this.mapData.map_id === 'johnson-controls-roadshow-2026') {\n return;\n }\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\n // const websiteContainer = document.createElement('div');\n // websiteContainer.className = 'website-container';\n // websiteContainer.textContent = '© Waygo Maps';\n // // websiteContainer.textContent = 'waygomaps.com';\n\n // websiteContainer.addEventListener('click', () => {\n // window.open(linkUrl, '_blank'); // Open link in a new tab\n // });\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 _this4 = this;\n var currentState = this._stateCoordinator.state;\n var controls = [];\n if (currentState === 'selection') {\n // In selection mode, only add essential controls\n controls = [new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].FloorSelectorControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ContentPlacementControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].InteractionControl()];\n } else {\n // Default controls for other states\n 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 }\n controls.forEach(function (control) {\n return _this4.addControl(control);\n });\n }\n }, {\n key: \"_initializeOriginalFilters\",\n value: function _initializeOriginalFilters() {\n var _this5 = 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 _this5.originalFilters[layer.id] = _this5.map.getFilter(layer.id) || null;\n }\n });\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n var _this6 = this;\n var passive = {\n passive: true\n };\n this.mapContainer.addEventListener('mousedown', function (event) {\n return _this6.fire('mousedown', {\n originalEvent: event\n });\n });\n // preclick\n this.mapContainer.addEventListener('click', function (event) {\n return _this6.fire('click', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mouseover', function (event) {\n return _this6.fire('mouseover', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mousemove', function (event) {\n return _this6.fire('mousemove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('dblclick', function (event) {\n return _this6.fire('dblclick', {\n originalEvent: event\n });\n });\n // mouseenter\n // mouseleave\n this.mapContainer.addEventListener('mouseout', function (event) {\n return _this6.fire('mouseout', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('contextmenu', function (event) {\n return _this6.fire('contextmenu', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('wheel', function (event) {\n return _this6.fire('wheel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchstart', function (event) {\n return _this6.fire('touchstart', {\n originalEvent: event\n });\n }, passive);\n this.mapContainer.addEventListener('touchend', function (event) {\n return _this6.fire('touchend', {\n originalEvent: event\n });\n }, passive);\n this.mapContainer.addEventListener('touchmove', function (event) {\n return _this6.fire('touchmove', {\n originalEvent: event\n });\n }, passive);\n this.mapContainer.addEventListener('touchcancel', function (event) {\n return _this6.fire('touchcancel', {\n originalEvent: event\n });\n }, passive);\n this.mapContainer.addEventListener('move', function (event) {\n return _this6.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 _this6.map.on(eventName, function (event) {\n _this6.fire(eventName, {\n originalEvent: event\n });\n });\n });\n\n // Add selection confirmation event listener\n this.on('selection:confirmed', function (data) {\n _this6.confirmedSelection = data.feature;\n });\n }\n }, {\n key: \"_initializeMapData\",\n value: function () {\n var _initializeMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var parts, 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 < 1 || parts.length > 2)) {\n _context2.next = 4;\n break;\n }\n console.error('The sourceId format is incorrect. It should be in the format \"mapId\" or \"mapId.mapViewId\".');\n return _context2.abrupt(\"return\");\n case 4:\n // let accountId = parts[0] || '';\n // let mapId = parts[1] || '';\n // let mapViewId = parts[2] || '';\n mapId = parts[0];\n mapViewId = parts[1]; // Set account id in WaygoMaps\n // waygoMaps.setAccountId(accountId);\n _context2.prev = 6;\n _context2.next = 9;\n return this.mapViewApi.loadMapView(mapId, mapViewId);\n case 9:\n data = _context2.sent;\n this.mapData = data;\n _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setAccountId(data.account_id);\n _context2.next = 14;\n return this._initializeGps();\n case 14:\n _context2.next = 19;\n break;\n case 16:\n _context2.prev = 16;\n _context2.t0 = _context2[\"catch\"](6);\n console.error('Error fetching map style:', _context2.t0);\n case 19:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[6, 16]]);\n }));\n function _initializeMapData() {\n return _initializeMapData2.apply(this, arguments);\n }\n return _initializeMapData;\n }()\n }, {\n key: \"_initializeGps\",\n value: function () {\n var _initializeGps2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var isGpsMap, isSetup, eligible;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n if (this.mapData) {\n _context3.next = 2;\n break;\n }\n return _context3.abrupt(\"return\");\n case 2:\n isGpsMap = GPS_MAP_IDS.includes(this.mapData.map_id);\n isSetup = !!this.options.setup;\n eligible = isGpsMap && !this.isKioskMode && !isSetup && (0,_utils_geolocationManager__WEBPACK_IMPORTED_MODULE_10__.isGeolocationAvailable)();\n this.gpsEnabled = eligible;\n if (!eligible) {\n _context3.next = 10;\n break;\n }\n _context3.next = 9;\n return (0,_utils_geolocationManager__WEBPACK_IMPORTED_MODULE_10__.getPermissionState)();\n case 9:\n this.gpsPermissionState = _context3.sent;\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function _initializeGps() {\n return _initializeGps2.apply(this, arguments);\n }\n return _initializeGps;\n }()\n }, {\n key: \"shouldShowGpsCell\",\n value: function shouldShowGpsCell() {\n return this.gpsEnabled && this.gpsPermissionState !== 'denied';\n }\n }, {\n key: \"_loadMapLibraries\",\n value: function () {\n var _loadMapLibraries2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(mapId) {\n var _getMapboxUrls, css, js;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _getMapboxUrls = getMapboxUrls(mapId), css = _getMapboxUrls.css, js = _getMapboxUrls.js;\n _context4.next = 3;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadCSS)(css);\n case 3:\n _context4.next = 5;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadScript)(js);\n case 5:\n mapboxgl.clearStorage();\n case 6:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n function _loadMapLibraries(_x) {\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 _this7 = this;\n var zoomOut = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var customBearing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var customPitch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\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 = _this7.originalFilters[layer.id];\n _this7.map.setFilter(layer.id, originalFilter);\n var floorFilter = ['==', ['get', '_floor'], floorIndex];\n if (originalFilter) {\n var combinedFilter = ['all', floorFilter, originalFilter];\n _this7.map.setFilter(layer.id, combinedFilter);\n } else {\n _this7.map.setFilter(layer.id, floorFilter);\n }\n }\n });\n this._currentFloorIndex = floorIndex;\n\n // Use custom bearing/pitch if provided, otherwise use current values\n var pitch = customPitch !== null ? customPitch : this.map.getPitch();\n var bearing = customBearing !== null ? customBearing : this.map.getBearing();\n if (zoomOut) {\n var style = this.map.getStyle();\n var sources = Object.keys(style.sources);\n var allFeatures = [];\n sources.forEach(function (sourceId) {\n var floorSourceLayer = \"\".concat(floorIndex, \"-feature\");\n var features = _this7.map.querySourceFeatures(sourceId, {\n sourceLayer: floorSourceLayer\n });\n allFeatures = allFeatures.concat(features);\n });\n\n // If we have features, calculate their bounds\n if (allFeatures.length > 0) {\n var bounds = new mapboxgl.LngLatBounds();\n allFeatures.forEach(function (feature) {\n var geom = feature.geometry;\n // Handle different geometry types:\n if (geom.type === 'Point') {\n bounds.extend(geom.coordinates);\n } else if (geom.type === 'LineString') {\n geom.coordinates.forEach(function (coord) {\n return bounds.extend(coord);\n });\n } else if (geom.type === 'Polygon') {\n // For a Polygon, iterate through the outer ring (and inner rings if needed)\n geom.coordinates[0].forEach(function (coord) {\n return bounds.extend(coord);\n });\n }\n // Add cases for MultiPoint, MultiLineString, MultiPolygon as needed\n });\n\n // Fit the map to these bounds with some padding\n this.map.fitBounds(bounds, {\n padding: {\n top: 50,\n bottom: 150,\n left: 50,\n right: 50\n },\n duration: 1300,\n maxZoom: 15.5,\n pitch: pitch,\n bearing: bearing\n });\n } else {\n // If no features found, zoom out from current center\n this.map.once('moveend', function () {\n var allFeaturesAgain = [];\n sources.forEach(function (sourceId) {\n var floorSourceLayer = \"\".concat(floorIndex, \"-feature\");\n var features = _this7.map.querySourceFeatures(sourceId, {\n sourceLayer: floorSourceLayer\n });\n allFeaturesAgain = allFeaturesAgain.concat(features);\n });\n if (allFeaturesAgain.length > 0) {\n var _bounds = new mapboxgl.LngLatBounds();\n allFeaturesAgain.forEach(function (feature) {\n var geom = feature.geometry;\n // Handle different geometry types:\n if (geom.type === 'Point') {\n _bounds.extend(geom.coordinates);\n } else if (geom.type === 'LineString') {\n geom.coordinates.forEach(function (coord) {\n return _bounds.extend(coord);\n });\n } else if (geom.type === 'Polygon') {\n // For a Polygon, iterate through the outer ring (and inner rings if needed)\n geom.coordinates[0].forEach(function (coord) {\n return _bounds.extend(coord);\n });\n }\n // Add cases for MultiPoint, MultiLineString, MultiPolygon as needed\n });\n\n // Fit the map to these bounds with some padding\n _this7.map.fitBounds(_bounds, {\n padding: 50,\n duration: 1300,\n maxZoom: 15.5,\n pitch: pitch,\n bearing: bearing\n });\n }\n });\n this.map.flyTo({\n zoom: this.map.getZoom() - 3,\n duration: 500,\n essential: true\n });\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 // console.log(\"SET TO DEFAULT STATE\", this.location);\n this._stateCoordinator.transitionTo('default');\n }\n }, {\n key: \"setToSearchState\",\n value: function () {\n var _setToSearchState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(query) {\n var skip,\n limit,\n floor,\n results,\n _args5 = arguments;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n skip = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : 0;\n limit = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : 30;\n floor = _args5.length > 3 && _args5[3] !== undefined ? _args5[3] : null;\n // Set loading state\n this._stateCoordinator.setLoading(true, 'search');\n _context5.prev = 4;\n _context5.next = 7;\n return this.search(query, skip, limit, floor);\n case 7:\n results = _context5.sent;\n this._stateCoordinator.transitionTo('search', {\n query: query,\n results: results\n });\n // Loading state will be reset in the transitionTo method\n _context5.next = 15;\n break;\n case 11:\n _context5.prev = 11;\n _context5.t0 = _context5[\"catch\"](4);\n console.error(\"\\u274C MapView: Search error occurred:\", _context5.t0);\n this._stateCoordinator.setLoading(false, 'search');\n // Handle error appropriately\n case 15:\n _context5.prev = 15;\n this._stateCoordinator.setLoading(false, 'search');\n return _context5.finish(15);\n case 18:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this, [[4, 11, 15, 18]]);\n }));\n function setToSearchState(_x2) {\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 _callee6(contentPlacementIds) {\n var lastContentPlacementId, selectedContentPlacement;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n // console.log(`📄 MapView: setToSelectedContentState called with IDs:`, contentPlacementIds);\n\n // Set loading state\n this._stateCoordinator.setLoading(true, 'content');\n _context6.prev = 1;\n lastContentPlacementId = contentPlacementIds[contentPlacementIds.length - 1];\n _context6.next = 5;\n return this.getContentPlacementDetails(lastContentPlacementId);\n case 5:\n selectedContentPlacement = _context6.sent;\n this.updateFloor(selectedContentPlacement.floor);\n this._stateCoordinator.transitionTo('selectedContent', {\n contentPlacementIds: contentPlacementIds,\n selectedContentPlacement: selectedContentPlacement\n });\n // Loading state will be reset in the transitionTo method\n _context6.next = 14;\n break;\n case 10:\n _context6.prev = 10;\n _context6.t0 = _context6[\"catch\"](1);\n console.error(\"\\u274C MapView: Content loading error occurred:\", _context6.t0);\n this._stateCoordinator.setLoading(false, 'content');\n // Handle error appropriately\n case 14:\n _context6.prev = 14;\n this._stateCoordinator.setLoading(false, 'content');\n return _context6.finish(14);\n case 17:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this, [[1, 10, 14, 17]]);\n }));\n function setToSelectedContentState(_x3) {\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 _callee7() {\n var startContentPlacementId,\n endContentPlacementId,\n options,\n _this$initialStateDat,\n startContentPlacement,\n startNodeId,\n fromLocation,\n endContentPlacement,\n _args7 = arguments;\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n startContentPlacementId = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : null;\n endContentPlacementId = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : null;\n options = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : {};\n _context7.prev = 3;\n startContentPlacement = null;\n startNodeId = null;\n fromLocation = !!options.fromLocation; // Handle empty string as null (from URL parsing when start is empty)\n if (startContentPlacementId === '' || startContentPlacementId === null || startContentPlacementId === undefined) {\n startContentPlacementId = null;\n }\n\n // Runtime-provided startNodeId (e.g. from the GPS \"Use current location\" flow) wins.\n if (!options.startNodeId) {\n _context7.next = 13;\n break;\n }\n startNodeId = options.startNodeId;\n console.log(\"\\uD83D\\uDD35 MapView: Using startNodeId from options: \".concat(startNodeId));\n _context7.next = 33;\n break;\n case 13:\n if (!(!startContentPlacementId && (_this$initialStateDat = this.initialStateData) !== null && _this$initialStateDat !== void 0 && _this$initialStateDat.startNodeId)) {\n _context7.next = 18;\n break;\n }\n startNodeId = this.initialStateData.startNodeId;\n console.log(\"\\uD83D\\uDD35 MapView: Using startNodeId from initialStateData: \".concat(startNodeId));\n _context7.next = 33;\n break;\n case 18:\n if (!startContentPlacementId) {\n _context7.next = 33;\n break;\n }\n console.log(\"\\uD83D\\uDD35 MapView: Attempting to fetch startContentPlacement for ID: \".concat(startContentPlacementId));\n _context7.prev = 20;\n _context7.next = 23;\n return this.getContentPlacementDetails(startContentPlacementId);\n case 23:\n startContentPlacement = _context7.sent;\n console.log(\"\\uD83D\\uDD35 MapView: getContentPlacementDetails returned:\", startContentPlacement);\n\n // Check if we got a valid content placement (must have placement_id property)\n if (!startContentPlacement || !startContentPlacement.placement_id) {\n // If fetching returns null/undefined or invalid object, assume startContentPlacementId is a node ID\n console.log(\"\\uD83D\\uDD35 MapView: startContentPlacementId is a node ID (fetch returned invalid result): \".concat(startContentPlacementId));\n startNodeId = startContentPlacementId;\n startContentPlacement = null;\n } else {\n console.log(\"\\uD83D\\uDD35 MapView: Successfully fetched startContentPlacement with placement_id: \".concat(startContentPlacement.placement_id));\n }\n _context7.next = 33;\n break;\n case 28:\n _context7.prev = 28;\n _context7.t0 = _context7[\"catch\"](20);\n // If the API call fails (e.g., 500 error for node ID), treat it as a node ID\n console.log(\"\\uD83D\\uDD35 MapView: Error fetching startContentPlacement (likely a node ID): \".concat(startContentPlacementId), _context7.t0);\n startNodeId = startContentPlacementId;\n startContentPlacement = null;\n case 33:\n endContentPlacement = null;\n if (!endContentPlacementId) {\n _context7.next = 38;\n break;\n }\n _context7.next = 37;\n return this.getContentPlacementDetails(endContentPlacementId);\n case 37:\n endContentPlacement = _context7.sent;\n case 38:\n console.log(\"\\uD83D\\uDD35 MapView: Transitioning to directions state with:\", {\n startContentPlacement: !!startContentPlacement,\n endContentPlacement: !!endContentPlacement,\n startNodeId: startNodeId\n });\n this._stateCoordinator.transitionTo('directions', {\n startContentPlacement: startContentPlacement,\n endContentPlacement: endContentPlacement,\n startNodeId: startNodeId,\n fromLocation: fromLocation\n });\n // Loading state will be reset in the transitionTo method\n _context7.next = 45;\n break;\n case 42:\n _context7.prev = 42;\n _context7.t1 = _context7[\"catch\"](3);\n console.error(\"\\u274C MapView: Directions state error occurred:\", _context7.t1);\n // console.log(`�� MapView: Resetting loading state due to error`);\n // this._stateCoordinator.setLoading(false, 'directions');\n // Handle error appropriately\n case 45:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this, [[3, 42], [20, 28]]);\n }));\n function setToDirectionsState() {\n return _setToDirectionsState.apply(this, arguments);\n }\n return setToDirectionsState;\n }()\n }, {\n key: \"setToSetupState\",\n value: function () {\n var _setToSetupState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n // console.log(\"SET TO SETUP STATE\");\n\n // Reset map view to default top-down perspective\n if (this.map) {\n this.map.easeTo({\n pitch: 0,\n bearing: 0,\n duration: 0\n });\n }\n if (!this.setupControl) {\n this.setupControl = new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SetupControl();\n this.addControl(this.setupControl);\n }\n this._stateCoordinator.transitionTo('setup');\n case 3:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function setToSetupState() {\n return _setToSetupState.apply(this, arguments);\n }\n return setToSetupState;\n }()\n }, {\n key: \"setToSelectionState\",\n value: function () {\n var _setToSelectionState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(criteria) {\n var multiSelect,\n _selectionStateData$f,\n _selectionStateData$f2,\n _selectionStateData$f3,\n selectionStateData,\n bounds,\n _args9 = arguments;\n return _regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n multiSelect = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : true;\n this.selectionCriteria = criteria;\n this.multiSelect = multiSelect;\n\n // Set loading state for selection features\n this._stateCoordinator.setLoading(true, 'selection');\n\n // Call the loadMapViewSelectionState endpoint\n _context9.prev = 4;\n _context9.next = 7;\n return this.mapViewApi.loadMapViewSelectionState(this.mapData.map_id, this.mapData.map_view_id, criteria);\n case 7:\n selectionStateData = _context9.sent;\n // Store the GeoJSON data for creating selectable layers\n this.selectionGeoJSON = selectionStateData;\n console.log('✅ Selection GeoJSON loaded:', {\n type: selectionStateData === null || selectionStateData === void 0 ? void 0 : selectionStateData.type,\n featureCount: selectionStateData === null || selectionStateData === void 0 || (_selectionStateData$f = selectionStateData.features) === null || _selectionStateData$f === void 0 ? void 0 : _selectionStateData$f.length,\n firstFeature: selectionStateData === null || selectionStateData === void 0 || (_selectionStateData$f2 = selectionStateData.features) === null || _selectionStateData$f2 === void 0 ? void 0 : _selectionStateData$f2[0],\n fullData: selectionStateData\n });\n\n // Transition to selection state WITH the GeoJSON data\n this._stateCoordinator.transitionTo('selection', {\n criteria: criteria,\n geojson: selectionStateData,\n multiSelect: multiSelect\n });\n\n // After transition, animate to fit bounds and lock to bird's eye view\n if ((selectionStateData === null || selectionStateData === void 0 || (_selectionStateData$f3 = selectionStateData.features) === null || _selectionStateData$f3 === void 0 ? void 0 : _selectionStateData$f3.length) > 0) {\n // Lock to bird's eye view first\n this.map.easeTo({\n pitch: 0,\n bearing: 0,\n duration: 500\n });\n\n // Calculate bounds from converted GeoJSON features\n bounds = new mapboxgl.LngLatBounds(); // Add null check here\n if (selectionStateData && selectionStateData.features) {\n selectionStateData.features.forEach(function (feature) {\n // Add bounds calculation logic here\n // Make sure feature.geometry.coordinates exists\n if (feature.geometry && feature.geometry.coordinates) {\n // Calculate bounds based on geometry type\n if (feature.geometry.type === 'Point') {\n bounds.extend(feature.geometry.coordinates);\n } else if (feature.geometry.type === 'LineString') {\n feature.geometry.coordinates.forEach(function (coord) {\n return bounds.extend(coord);\n });\n } else if (feature.geometry.type === 'Polygon') {\n // For a Polygon, iterate through the outer ring (and inner rings if needed)\n feature.geometry.coordinates[0].forEach(function (coord) {\n return bounds.extend(coord);\n });\n }\n }\n });\n\n // Only call fitBounds if bounds is valid\n if (bounds.isEmpty() === false) {\n this.map.fitBounds(bounds, {\n padding: 80,\n duration: 1000,\n maxZoom: 16\n });\n }\n }\n }\n _context9.next = 19;\n break;\n case 14:\n _context9.prev = 14;\n _context9.t0 = _context9[\"catch\"](4);\n console.error('❌ Error loading map view selection state:', _context9.t0);\n this.selectionGeoJSON = null;\n // Still transition but without data\n this._stateCoordinator.transitionTo('selection', {\n criteria: criteria,\n geojson: null,\n multiSelect: multiSelect\n });\n case 19:\n _context9.prev = 19;\n // Reset loading state\n this._stateCoordinator.setLoading(false, 'selection');\n return _context9.finish(19);\n case 22:\n case \"end\":\n return _context9.stop();\n }\n }, _callee9, this, [[4, 14, 19, 22]]);\n }));\n function setToSelectionState(_x4) {\n return _setToSelectionState.apply(this, arguments);\n }\n return setToSelectionState;\n }()\n }, {\n key: \"getConfirmedSelection\",\n value: function getConfirmedSelection() {\n return this.confirmedSelection;\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: \"initiateFindPath\",\n value: function initiateFindPath(startContentPlacementId, endContentPlacementId) {\n this.fire('initiate:findPath', {\n startContentPlacementId: startContentPlacementId,\n endContentPlacementId: endContentPlacementId\n });\n }\n }, {\n key: \"initiateFindPathFromLocation\",\n value: function initiateFindPathFromLocation(endContentPlacement) {\n this.fire('initiate:findPathFromLocation', {\n location: this.location,\n endContentPlacement: endContentPlacement\n });\n }\n }, {\n key: \"findPath\",\n value: function () {\n var _findPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(startContentPlacementId, endContentPlacementId) {\n var response_data;\n return _regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n this._stateCoordinator.setLoading(true, 'directions');\n _context10.prev = 1;\n _context10.next = 4;\n return this.routesApi.findPath(this.mapData.map_id, startContentPlacementId, endContentPlacementId);\n case 4:\n response_data = _context10.sent;\n if (!response_data) {\n _context10.next = 9;\n break;\n }\n return _context10.abrupt(\"return\", response_data);\n case 9:\n console.error('Failed to find path.');\n case 10:\n _context10.prev = 10;\n this._stateCoordinator.setLoading(false, 'directions');\n return _context10.finish(10);\n case 13:\n case \"end\":\n return _context10.stop();\n }\n }, _callee10, this, [[1,, 10, 13]]);\n }));\n function findPath(_x5, _x6) {\n return _findPath.apply(this, arguments);\n }\n return findPath;\n }()\n }, {\n key: \"findPathFromNodeToPlacement\",\n value: function () {\n var _findPathFromNodeToPlacement = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(startNodeId, endPlacementId) {\n var response_data;\n return _regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n this._stateCoordinator.setLoading(true, 'directions');\n _context11.prev = 1;\n _context11.next = 4;\n return this.routesApi.findPathFromNodeToPlacement(this.mapData.map_id, startNodeId, endPlacementId);\n case 4:\n response_data = _context11.sent;\n if (!response_data) {\n _context11.next = 9;\n break;\n }\n return _context11.abrupt(\"return\", response_data);\n case 9:\n console.error('Failed to find path.');\n case 10:\n _context11.prev = 10;\n this._stateCoordinator.setLoading(false, 'directions');\n return _context11.finish(10);\n case 13:\n case \"end\":\n return _context11.stop();\n }\n }, _callee11, this, [[1,, 10, 13]]);\n }));\n function findPathFromNodeToPlacement(_x7, _x8) {\n return _findPathFromNodeToPlacement.apply(this, arguments);\n }\n return findPathFromNodeToPlacement;\n }()\n }, {\n key: \"useCurrentLocation\",\n value: function () {\n var _useCurrentLocation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(endPlacementId) {\n var position, referenceCoordinate, scaleFactor, vertex, floor, node, dx, dy, distance;\n return _regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n if (!(!this.gpsEnabled || !this.mapData)) {\n _context12.next = 3;\n break;\n }\n this.fire('gps:fallback', {\n reason: 'UNAVAILABLE'\n });\n return _context12.abrupt(\"return\");\n case 3:\n this._stateCoordinator.setLoading(true, 'directions');\n _context12.prev = 4;\n _context12.prev = 5;\n _context12.next = 8;\n return (0,_utils_geolocationManager__WEBPACK_IMPORTED_MODULE_10__.getCurrentPositionAsync)();\n case 8:\n position = _context12.sent;\n this.gpsPermissionState = 'granted';\n _context12.next = 17;\n break;\n case 12:\n _context12.prev = 12;\n _context12.t0 = _context12[\"catch\"](5);\n if (_context12.t0 && _context12.t0.code === 'DENIED') {\n this.gpsPermissionState = 'denied';\n }\n this.fire('gps:fallback', {\n reason: _context12.t0 && _context12.t0.code || 'UNAVAILABLE'\n });\n return _context12.abrupt(\"return\");\n case 17:\n referenceCoordinate = this.mapData.reference_coordinate || [0.0, 0.0];\n scaleFactor = this.mapData.coordinate_scaling_multiplier || 1.0;\n vertex = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__.convertCoordinateToVertex)(position.coordinate, referenceCoordinate, scaleFactor);\n floor = this.mapData.default_floor != null ? this.mapData.default_floor : 0;\n _context12.next = 23;\n return this.routesApi.findClosestNode(this.mapData.map_id, vertex, floor);\n case 23:\n node = _context12.sent;\n if (!(!node || !node.node_id)) {\n _context12.next = 27;\n break;\n }\n this.fire('gps:fallback', {\n reason: 'NO_NODE'\n });\n return _context12.abrupt(\"return\");\n case 27:\n dx = node.position_x - vertex[0];\n dy = node.position_y - vertex[1];\n distance = Math.sqrt(dx * dx + dy * dy);\n if (!(distance > GPS_MAX_START_DISTANCE_METERS)) {\n _context12.next = 34;\n break;\n }\n console.log(\"\\uD83D\\uDD35 MapView: GPS too far from nearest node (\".concat(distance.toFixed(1), \"m > \").concat(GPS_MAX_START_DISTANCE_METERS, \"m)\"));\n this.fire('gps:fallback', {\n reason: 'TOO_FAR'\n });\n return _context12.abrupt(\"return\");\n case 34:\n _context12.next = 36;\n return this.setToDirectionsState(null, endPlacementId, {\n startNodeId: node.node_id,\n fromLocation: true\n });\n case 36:\n _context12.next = 42;\n break;\n case 38:\n _context12.prev = 38;\n _context12.t1 = _context12[\"catch\"](4);\n console.error('❌ MapView: useCurrentLocation error:', _context12.t1);\n this.fire('gps:fallback', {\n reason: 'UNAVAILABLE'\n });\n case 42:\n _context12.prev = 42;\n this._stateCoordinator.setLoading(false, 'directions');\n return _context12.finish(42);\n case 45:\n case \"end\":\n return _context12.stop();\n }\n }, _callee12, this, [[4, 38, 42, 45], [5, 12]]);\n }));\n function useCurrentLocation(_x9) {\n return _useCurrentLocation.apply(this, arguments);\n }\n return useCurrentLocation;\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 _callee13(query) {\n var skip,\n limit,\n floor,\n _args13 = arguments;\n return _regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n skip = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : 0;\n limit = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : 30;\n floor = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : null;\n if (!(query === '')) {\n _context13.next = 5;\n break;\n }\n return _context13.abrupt(\"return\");\n case 5:\n if (this.mapData) {\n _context13.next = 7;\n break;\n }\n return _context13.abrupt(\"return\");\n case 7:\n _context13.prev = 7;\n _context13.next = 10;\n return this.searchApi.search(this.mapData.map_id, this.mapData.map_view_id, query, skip, limit, floor);\n case 10:\n return _context13.abrupt(\"return\", _context13.sent);\n case 13:\n _context13.prev = 13;\n _context13.t0 = _context13[\"catch\"](7);\n if (axios.isCancel(_context13.t0)) {\n console.error('Request canceled:', _context13.t0.message);\n } else {\n console.error('Search error:', _context13.t0);\n }\n case 16:\n case \"end\":\n return _context13.stop();\n }\n }, _callee13, this, [[7, 13]]);\n }));\n function search(_x10) {\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 _callee14(contentPlacementId) {\n var details;\n return _regeneratorRuntime().wrap(function _callee14$(_context14) {\n while (1) switch (_context14.prev = _context14.next) {\n case 0:\n _context14.prev = 0;\n _context14.next = 3;\n return this.searchApi.fetchContentPlacementDetails(contentPlacementId);\n case 3:\n details = _context14.sent;\n return _context14.abrupt(\"return\", details);\n case 7:\n _context14.prev = 7;\n _context14.t0 = _context14[\"catch\"](0);\n if (axios.isCancel(_context14.t0)) {\n console.error('Request canceled:', _context14.t0.message);\n } else {\n console.error('Fetching content placement details error:', _context14.t0);\n }\n case 10:\n case \"end\":\n return _context14.stop();\n }\n }, _callee14, this, [[0, 7]]);\n }));\n function getContentPlacementDetails(_x11) {\n return _getContentPlacementDetails.apply(this, arguments);\n }\n return getContentPlacementDetails;\n }()\n }, {\n key: \"flyTo\",\n value: function flyTo(options) {\n // console.log('flyTo', options);\n this.map.flyTo(options);\n }\n }, {\n key: \"removeMatchingFeaturesFromExistingLayers\",\n value: function removeMatchingFeaturesFromExistingLayers(criteria) {\n var _this8 = 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 var layerId = layer.id;\n\n // Skip our own selectable layers\n if (layerId.includes('selectable-') || layerId.includes('booked-') || layerId.includes('selected-feature') || layerId.includes('confirmed-selection')) {\n return;\n }\n\n // Get current filter\n var currentFilter = _this8.map.getFilter(layerId);\n\n // Create a filter to exclude features that match ALL criteria\n var matchingCondition = null;\n var _loop = function _loop() {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n property = _Object$entries$_i[0],\n value = _Object$entries$_i[1];\n var condition;\n if (Array.isArray(value)) {\n // Handle multiple values (e.g., size: ['10x10', '20x10'])\n var conditions = value.map(function (v) {\n return ['==', ['get', property], v];\n });\n condition = ['any'].concat(_toConsumableArray(conditions));\n } else {\n // Handle single value\n condition = ['==', ['get', property], value];\n }\n if (matchingCondition === null) {\n matchingCondition = condition;\n } else {\n // Combine with AND logic - feature must match ALL criteria\n matchingCondition = ['all', matchingCondition, condition];\n }\n };\n for (var _i = 0, _Object$entries = Object.entries(criteria); _i < _Object$entries.length; _i++) {\n _loop();\n }\n\n // Create exclusion filter - hide features that match ALL criteria\n var exclusionFilter = ['!', matchingCondition];\n\n // Apply the exclusion filter\n if (exclusionFilter) {\n if (currentFilter) {\n // Combine with existing filter\n var combinedFilter = ['all', currentFilter, exclusionFilter];\n _this8.map.setFilter(layerId, combinedFilter);\n } else {\n // Apply only the exclusion filter\n _this8.map.setFilter(layerId, exclusionFilter);\n }\n }\n }\n });\n }\n }, {\n key: \"_getLabelGeometry\",\n value: function _getLabelGeometry(feature) {\n var _this$mapData, _this$mapData2, _this$mapData3;\n var refCoordinate = ((_this$mapData = this.mapData) === null || _this$mapData === void 0 ? void 0 : _this$mapData.reference_coordinate) || [0.0, 0.0];\n var scalingFactor = ((_this$mapData2 = this.mapData) === null || _this$mapData2 === void 0 ? void 0 : _this$mapData2.coordinate_scaling_multiplier) || 30.0;\n var mapId = ((_this$mapData3 = this.mapData) === null || _this$mapData3 === void 0 ? void 0 : _this$mapData3.map_id) || null;\n console.log('🔵 MapView: mapId:', mapId);\n if (_utils_outdoorMapIds__WEBPACK_IMPORTED_MODULE_8__.outdoorMapIdTemplates.includes(mapId)) {\n console.log('🔵 MapId:', mapId);\n return feature.geometry;\n }\n if (feature.properties.label_location) {\n var labelLocation = feature.properties.label_location;\n\n // Parse JSON string if label_location is a string\n if (typeof labelLocation === 'string') {\n try {\n labelLocation = JSON.parse(labelLocation);\n } catch (error) {\n console.warn('Failed to parse label_location JSON:', error);\n return feature.geometry;\n }\n }\n if (labelLocation && labelLocation.coordinates && Array.isArray(labelLocation.coordinates) && labelLocation.coordinates.length >= 2) {\n var labelCoords = labelLocation.coordinates;\n if (typeof labelCoords[0] === 'number' && typeof labelCoords[1] === 'number') {\n var convertedLabelCoords = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__.convertVerticesToCoordinates)([labelCoords], refCoordinate, scalingFactor);\n\n // Round coordinates to reduce precision issues\n var roundedCoords = [Math.round(convertedLabelCoords[0][0] * 1000000) / 1000000,\n // ~6 decimal places\n Math.round(convertedLabelCoords[0][1] * 1000000) / 1000000];\n return {\n type: 'Point',\n coordinates: roundedCoords\n };\n }\n }\n }\n return feature.geometry;\n }\n }, {\n key: \"_findOriginalFeature\",\n value: function _findOriginalFeature(featureId) {\n if (!this.selectionGeoJSON || !this.selectionGeoJSON.features) {\n return null;\n }\n return this.selectionGeoJSON.features.find(function (feature) {\n return feature.properties.feature_id === featureId;\n });\n }\n }, {\n key: \"createSelectableContentLayers\",\n value: function createSelectableContentLayers() {\n var _this9 = this;\n var geojsonData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var dataToUse = geojsonData || this.selectionGeoJSON;\n if (!dataToUse || !dataToUse.features) {\n console.error('❌ NO DATA TO CREATE LAYERS');\n return;\n }\n try {\n var _this$mapData4, _this$mapData5;\n // Remove old layers if they exist\n if (this.map.getLayer('selectable-label-layer')) this.map.removeLayer('selectable-label-layer');\n if (this.map.getLayer('selectable-outline-layer')) this.map.removeLayer('selectable-outline-layer');\n if (this.map.getLayer('selectable-fill-layer')) this.map.removeLayer('selectable-fill-layer');\n if (this.map.getLayer('booked-label-layer')) this.map.removeLayer('booked-label-layer');\n // if (this.map.getLayer('booked-outline-layer')) this.map.removeLayer('booked-outline-layer');\n if (this.map.getLayer('booked-fill-layer')) this.map.removeLayer('booked-fill-layer');\n if (this.map.getSource('selectable-labels')) this.map.removeSource('selectable-labels');\n if (this.map.getSource('selectable-content')) this.map.removeSource('selectable-content');\n if (this.map.getSource('booked-labels')) this.map.removeSource('booked-labels');\n if (this.map.getSource('booked-content')) this.map.removeSource('booked-content');\n var refCoordinate = ((_this$mapData4 = this.mapData) === null || _this$mapData4 === void 0 ? void 0 : _this$mapData4.reference_coordinate) || [0.0, 0.0];\n var scalingFactor = ((_this$mapData5 = this.mapData) === null || _this$mapData5 === void 0 ? void 0 : _this$mapData5.coordinate_scaling_multiplier) || 30.0;\n var convertedFeatures = dataToUse.features;\n\n // Separate features into selectable and booked\n var selectableFeatures = convertedFeatures.filter(function (feature) {\n return feature.properties.booking_status !== 'booked';\n });\n var bookedFeatures = convertedFeatures.filter(function (feature) {\n return feature.properties.booking_status === 'booked';\n });\n\n // Create selectable GeoJSON\n var selectableGeoJSON = {\n type: 'FeatureCollection',\n features: selectableFeatures\n };\n\n // Create booked GeoJSON\n var bookedGeoJSON = {\n type: 'FeatureCollection',\n features: bookedFeatures\n };\n\n // Add selectable content source\n this.map.addSource('selectable-content', {\n type: 'geojson',\n data: selectableGeoJSON,\n promoteId: 'feature_id'\n });\n\n // Add booked content source\n this.map.addSource('booked-content', {\n type: 'geojson',\n data: bookedGeoJSON,\n // promoteId: 'placement_id'\n promoteId: 'feature_id'\n });\n\n // Create label features for selectable content\n var selectableLabelFeatures = selectableFeatures.map(function (feature) {\n var labelGeometry;\n if (feature.properties.label_location) {\n var labelCoords = feature.properties.label_location.coordinates;\n var convertedLabelCoords = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__.convertVerticesToCoordinates)([labelCoords], refCoordinate, scalingFactor);\n labelGeometry = {\n type: 'Point',\n coordinates: convertedLabelCoords[0]\n };\n } else {\n labelGeometry = feature.geometry;\n }\n return {\n type: 'Feature',\n geometry: labelGeometry,\n properties: feature.properties\n };\n });\n\n // Create label features for booked content\n var bookedLabelFeatures = bookedFeatures.map(function (feature) {\n var labelGeometry;\n if (feature.properties.label_location) {\n var labelCoords = feature.properties.label_location.coordinates;\n var convertedLabelCoords = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_9__.convertVerticesToCoordinates)([labelCoords], refCoordinate, scalingFactor);\n labelGeometry = {\n type: 'Point',\n coordinates: convertedLabelCoords[0]\n };\n } else {\n labelGeometry = feature.geometry;\n }\n return {\n type: 'Feature',\n geometry: labelGeometry,\n properties: feature.properties\n };\n });\n this.map.addSource('selectable-labels', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: selectableLabelFeatures\n }\n });\n this.map.addSource('booked-labels', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: bookedLabelFeatures\n }\n });\n\n // Create canvas-based checkmark icon for confirmed selections\n var canvas = document.createElement('canvas');\n var baseSize = 48;\n var scaleFactor = 1;\n canvas.width = baseSize * scaleFactor;\n canvas.height = baseSize * scaleFactor;\n var ctx = canvas.getContext('2d');\n ctx.scale(scaleFactor, scaleFactor);\n\n // Draw white circle background\n ctx.fillStyle = 'white';\n ctx.beginPath();\n ctx.arc(24, 24, 20, 0, Math.PI * 2);\n ctx.fill();\n\n // Draw green circle border\n ctx.strokeStyle = '#00C853';\n ctx.lineWidth = 3;\n ctx.stroke();\n\n // Draw green checkmark\n ctx.strokeStyle = '#00C853';\n ctx.lineWidth = 4;\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n ctx.beginPath();\n ctx.moveTo(14, 24);\n ctx.lineTo(20, 30);\n ctx.lineTo(34, 16);\n ctx.stroke();\n var pngDataUri = canvas.toDataURL('image/png');\n this.map.loadImage(pngDataUri, function (error, image) {\n if (error) {\n console.error('❌ Error loading canvas checkmark icon:', error);\n } else {\n _this9.map.addImage('checkmark-icon', image);\n if (!_this9.map.getLayer('confirmed-selection-icon-layer')) {\n _this9.map.addLayer({\n id: 'confirmed-selection-icon-layer',\n type: 'symbol',\n source: 'confirmed-selection-labels',\n layout: {\n 'icon-image': 'checkmark-icon',\n 'icon-size': 0.60,\n 'icon-anchor': 'center',\n 'icon-allow-overlap': true\n }\n });\n }\n }\n });\n\n // Create confirmed selection label source\n this.map.addSource('confirmed-selection-labels', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: []\n }\n });\n\n // Add confirmed selection label layer\n this.map.addLayer({\n id: 'confirmed-selection-label-layer',\n type: 'symbol',\n source: 'confirmed-selection-labels',\n layout: {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium', 'Arial Unicode MS Regular'],\n 'text-size': ['interpolate', ['exponential', 1.99], ['zoom'], 12, 1.5, 22, 1000]\n },\n paint: {\n 'text-color': '#00C853',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n this.map.addSource('confirmed-selection', {\n type: 'geojson',\n data: {\n type: 'FeatureCollection',\n features: []\n }\n });\n\n // Add layers in correct order (bottom to top)\n // 1. Booked fill layer (light grey) - bottom layer\n this.map.addLayer({\n id: 'booked-fill-layer',\n type: 'fill',\n source: 'booked-content',\n paint: {\n 'fill-color': '#f2f2f2',\n 'fill-opacity': 1.0\n }\n });\n\n // 2. Booked outline layer (grey outline)\n // this.map.addLayer({\n // id: 'booked-outline-layer',\n // type: 'line',\n // source: 'booked-content',\n // paint: {\n // 'line-color': '#999999',\n // 'line-width': 1\n // }\n // });\n // console.log('✅ BOOKED OUTLINE LAYER ADDED');\n\n // 3. Booked label layer (grey text)\n this.map.addLayer({\n id: 'booked-label-layer',\n type: 'symbol',\n source: 'booked-labels',\n layout: {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium', 'Arial Unicode MS Regular'],\n 'text-size': ['interpolate', ['exponential', 1.99], ['zoom'], 12, 1.5, 22, 1000]\n },\n paint: {\n 'text-color': '#666666',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n\n // 4. Base selectable fill layer (white)\n this.map.addLayer({\n id: 'selectable-fill-layer',\n type: 'fill',\n source: 'selectable-content',\n paint: {\n 'fill-color': '#FFFFFF',\n 'fill-opacity': 0.8\n }\n });\n\n // 5. Selectable outline layer (blue outline)\n this.map.addLayer({\n id: 'selectable-outline-layer',\n type: 'line',\n source: 'selectable-content',\n paint: {\n 'line-color': '#1987ff',\n 'line-width': 2\n }\n });\n\n // 6. Confirmed selection fill layer (light green fill)\n this.map.addLayer({\n id: 'confirmed-selection-fill-layer',\n type: 'fill',\n source: 'confirmed-selection',\n paint: {\n 'fill-color': '#d1fae2',\n 'fill-opacity': ['interpolate', ['linear'], ['zoom'], 10, 0.6, 16, 0.8]\n }\n });\n\n // 7. Confirmed selection outline layer (green outline)\n this.map.addLayer({\n id: 'confirmed-selection-outline-layer',\n type: 'line',\n source: 'confirmed-selection',\n paint: {\n 'line-color': '#00C853',\n 'line-width': 2,\n 'line-opacity': ['interpolate', ['linear'], ['zoom'], 10, 0.7, 16, 1.0]\n }\n });\n\n // 8. Selectable label layer (blue text)\n this.map.addLayer({\n id: 'selectable-label-layer',\n type: 'symbol',\n source: 'selectable-labels',\n layout: {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium', 'Arial Unicode MS Regular'],\n 'text-size': ['interpolate', ['exponential', 1.99], ['zoom'], 12, 1.5, 22, 1000]\n },\n paint: {\n 'text-color': '#0263ca',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n\n // Verify layer order and existence\n var allLayers = this.map.getStyle().layers;\n var ourLayers = allLayers.filter(function (layer) {\n return layer.id.includes('selectable-') || layer.id.includes('booked-') || layer.id.includes('confirmed-selection');\n });\n } catch (error) {\n console.error('❌ ERROR:', error);\n console.error('Stack:', error.stack);\n }\n }\n }, {\n key: \"removeSelectableContentLayers\",\n value: function removeSelectableContentLayers() {\n var _this10 = this;\n // Remove layers if they exist\n var layerIds = ['selectable-label-layer', 'selectable-outline-layer', 'selectable-fill-layer', 'booked-label-layer',\n // 'booked-outline-layer', \n 'booked-fill-layer', 'confirmed-selection-fill-layer', 'confirmed-selection-outline-layer', 'confirmed-selection-icon-layer', 'confirmed-selection-label-layer'];\n layerIds.forEach(function (layerId) {\n if (_this10.map.getLayer(layerId)) {\n _this10.map.removeLayer(layerId);\n }\n });\n\n // Remove sources if they exist\n if (this.map.getSource('selectable-content')) {\n this.map.removeSource('selectable-content');\n }\n if (this.map.getSource('selectable-labels')) {\n this.map.removeSource('selectable-labels');\n }\n if (this.map.getSource('booked-content')) {\n this.map.removeSource('booked-content');\n }\n if (this.map.getSource('booked-labels')) {\n this.map.removeSource('booked-labels');\n }\n if (this.map.getSource('confirmed-selection')) {\n this.map.removeSource('confirmed-selection');\n }\n if (this.map.getSource('confirmed-selection-labels')) {\n this.map.removeSource('confirmed-selection-labels');\n }\n\n // Remove checkmark icon\n if (this.map.hasImage('checkmark-icon')) {\n this.map.removeImage('checkmark-icon');\n }\n }\n\n // Clear confirmed selection layers\n }, {\n key: \"clearSelectionLayers\",\n value: function clearSelectionLayers() {\n var confirmedSource = this.map.getSource('confirmed-selection');\n var confirmedLabelsSource = this.map.getSource('confirmed-selection-labels');\n if (confirmedSource) {\n confirmedSource.setData({\n type: 'FeatureCollection',\n features: []\n });\n }\n if (confirmedLabelsSource) {\n confirmedLabelsSource.setData({\n type: 'FeatureCollection',\n features: []\n });\n }\n }\n\n // Add feature directly to confirmed selection (immediate selection)\n }, {\n key: \"addConfirmedSelectionFeature\",\n value: function addConfirmedSelectionFeature(feature) {\n var _this11 = this;\n var clearExisting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var confirmedSource = this.map.getSource('confirmed-selection');\n var confirmedLabelsSource = this.map.getSource('confirmed-selection-labels');\n var selectableSource = this.map.getSource('selectable-content');\n var selectableLabelsSource = this.map.getSource('selectable-labels');\n if (!confirmedSource || !confirmedLabelsSource || !selectableSource || !selectableLabelsSource) {\n console.error('❌ Required sources not found for confirmed selection');\n return;\n }\n var confirmedData = confirmedSource._data;\n var confirmedLabelsData = confirmedLabelsSource._data;\n var selectableData = selectableSource._data;\n var selectableLabelsData = selectableLabelsSource._data;\n\n // Use feature_id as the primary identifier since it's guaranteed to exist\n var featureId = feature.properties.feature_id;\n\n // Clear existing selections if requested (single-select mode)\n if (clearExisting) {\n // Move all confirmed features back to selectable layers using original geometry\n confirmedData.features.forEach(function (confirmedFeature) {\n var confirmedFeatureId = confirmedFeature.properties.feature_id;\n\n // Get original feature geometry\n var originalFeature = _this11._findOriginalFeature(confirmedFeatureId);\n if (originalFeature) {\n // Use original geometry\n selectableData.features.push(originalFeature);\n selectableLabelsData.features.push({\n type: 'Feature',\n geometry: _this11._getLabelGeometry(originalFeature),\n properties: originalFeature.properties\n });\n } else {\n // Fallback to current geometry\n console.warn('⚠️ Original feature not found for feature:', confirmedFeatureId);\n selectableData.features.push(confirmedFeature);\n selectableLabelsData.features.push({\n type: 'Feature',\n geometry: _this11._getLabelGeometry(confirmedFeature),\n properties: confirmedFeature.properties\n });\n }\n });\n\n // Clear confirmed layers\n confirmedData.features = [];\n confirmedLabelsData.features = [];\n }\n\n // Add new feature to confirmed layers\n // CHECK: Don't add if feature already exists\n var alreadyExists = confirmedData.features.some(function (f) {\n return f.properties.feature_id === featureId;\n });\n if (!alreadyExists) {\n confirmedData.features.push(feature);\n confirmedSource.setData(confirmedData);\n\n // Create and add label feature\n var labelFeature = {\n type: 'Feature',\n geometry: this._getLabelGeometry(feature),\n properties: feature.properties\n };\n confirmedLabelsData.features.push(labelFeature);\n confirmedLabelsSource.setData(confirmedLabelsData);\n\n // Remove from selectable layers using feature_id\n selectableData.features = selectableData.features.filter(function (f) {\n return f.properties.feature_id !== featureId;\n });\n selectableSource.setData(selectableData);\n selectableLabelsData.features = selectableLabelsData.features.filter(function (f) {\n return f.properties.feature_id !== featureId;\n });\n selectableLabelsSource.setData(selectableLabelsData);\n }\n }\n\n // Remove feature from confirmed selection (deselect)\n }, {\n key: \"removeConfirmedSelectionFeature\",\n value: function removeConfirmedSelectionFeature(featureId) {\n var confirmedSource = this.map.getSource('confirmed-selection');\n var confirmedLabelsSource = this.map.getSource('confirmed-selection-labels');\n var selectableSource = this.map.getSource('selectable-content');\n var selectableLabelsSource = this.map.getSource('selectable-labels');\n if (!confirmedSource || !confirmedLabelsSource || !selectableSource || !selectableLabelsSource) {\n console.error('❌ Required sources not found for confirmed selection');\n return;\n }\n var confirmedData = confirmedSource._data;\n var confirmedLabelsData = confirmedLabelsSource._data;\n var selectableData = selectableSource._data;\n var selectableLabelsData = selectableLabelsSource._data;\n\n // Find and remove feature from confirmed layers using feature_id\n var featureToRemove = confirmedData.features.find(function (f) {\n return f.properties.feature_id === featureId;\n });\n if (!featureToRemove) {\n return;\n }\n\n // Get the original feature geometry from the original GeoJSON\n var originalFeature = this._findOriginalFeature(featureId);\n if (!originalFeature) {\n console.warn('⚠️ Original feature not found for feature:', featureId);\n // Fallback to using the current geometry\n var fallbackFeature = featureToRemove;\n selectableData.features.push(fallbackFeature);\n selectableSource.setData(selectableData);\n var labelFeature = {\n type: 'Feature',\n geometry: this._getLabelGeometry(fallbackFeature),\n properties: fallbackFeature.properties\n };\n selectableLabelsData.features.push(labelFeature);\n selectableLabelsSource.setData(selectableLabelsData);\n } else {\n // Use original geometry - this ensures high quality geometry\n selectableData.features.push(originalFeature);\n selectableSource.setData(selectableData);\n var _labelFeature = {\n type: 'Feature',\n geometry: this._getLabelGeometry(originalFeature),\n properties: originalFeature.properties\n };\n selectableLabelsData.features.push(_labelFeature);\n selectableLabelsSource.setData(selectableLabelsData);\n }\n\n // Remove from confirmed layers\n confirmedData.features = confirmedData.features.filter(function (f) {\n return f.properties.feature_id !== featureId;\n });\n confirmedSource.setData(confirmedData);\n confirmedLabelsData.features = confirmedLabelsData.features.filter(function (f) {\n return f.properties.feature_id !== featureId;\n });\n confirmedLabelsSource.setData(confirmedLabelsData);\n }\n\n // Update _findOriginalFeature to use feature_id instead of placement_id\n // _findOriginalFeature(featureId) {\n // if (!this.selectionGeoJSON || !this.selectionGeoJSON.features) {\n // return null;\n // }\n\n // return this.selectionGeoJSON.features.find(feature => \n // feature.properties.feature_id === featureId\n // );\n // }\n\n // Get all currently confirmed selection features\n }, {\n key: \"getConfirmedSelectionFeatures\",\n value: function getConfirmedSelectionFeatures() {\n var confirmedSource = this.map.getSource('confirmed-selection');\n if (!confirmedSource) {\n return [];\n }\n return confirmedSource._data.features || [];\n }\n\n // Check if a feature is currently selected\n }, {\n key: \"isFeatureSelected\",\n value: function isFeatureSelected(placementId) {\n var confirmedFeatures = this.getConfirmedSelectionFeatures();\n return confirmedFeatures.some(function (f) {\n return f.properties.placement_id === placementId || f.properties.feature_id === placementId;\n });\n }\n }, {\n key: \"_initializeState\",\n value: function () {\n var _initializeState2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {\n var _this$initialStateDat2, _this$initialStateDat3;\n return _regeneratorRuntime().wrap(function _callee15$(_context15) {\n while (1) switch (_context15.prev = _context15.next) {\n case 0:\n _context15.prev = 0;\n _context15.t0 = this.initialState;\n _context15.next = _context15.t0 === 'default' ? 4 : _context15.t0 === 'search' ? 6 : _context15.t0 === 'selectedContent' ? 13 : _context15.t0 === 'directions' ? 20 : _context15.t0 === 'selection' ? 23 : _context15.t0 === 'setup' ? 32 : 35;\n break;\n case 4:\n // Default state - explicitly fire the state:default event\n this._stateCoordinator.transitionTo('default');\n return _context15.abrupt(\"break\", 38);\n case 6:\n if (!(this.initialStateData && this.initialStateData.query)) {\n _context15.next = 11;\n break;\n }\n _context15.next = 9;\n return this.setToSearchState(this.initialStateData.query, this.initialStateData.skip || 0, this.initialStateData.limit || 30, this.initialStateData.floor || null);\n case 9:\n _context15.next = 12;\n break;\n case 11:\n console.warn('⚠️ Search state requires initialStateData with query property');\n case 12:\n return _context15.abrupt(\"break\", 38);\n case 13:\n if (!(this.initialStateData && this.initialStateData.contentPlacementIds)) {\n _context15.next = 18;\n break;\n }\n _context15.next = 16;\n return this.setToSelectedContentState(this.initialStateData.contentPlacementIds);\n case 16:\n _context15.next = 19;\n break;\n case 18:\n console.warn('⚠️ SelectedContent state requires initialStateData with contentPlacementIds property');\n case 19:\n return _context15.abrupt(\"break\", 38);\n case 20:\n _context15.next = 22;\n return this.setToDirectionsState(((_this$initialStateDat2 = this.initialStateData) === null || _this$initialStateDat2 === void 0 ? void 0 : _this$initialStateDat2.startContentPlacementId) || null, ((_this$initialStateDat3 = this.initialStateData) === null || _this$initialStateDat3 === void 0 ? void 0 : _this$initialStateDat3.endContentPlacementId) || null);\n case 22:\n return _context15.abrupt(\"break\", 38);\n case 23:\n if (!(this.initialStateData && this.initialStateData.criteria)) {\n _context15.next = 29;\n break;\n }\n _context15.next = 26;\n return this.setToSelectionState(this.initialStateData.criteria, this.initialStateData.multiSelect !== false // Default to true\n );\n case 26:\n // Hide loading overlay after selection state is loaded\n this._hideSelectionLoadingOverlay();\n _context15.next = 31;\n break;\n case 29:\n console.warn('⚠️ Selection state requires initialStateData with criteria property');\n // Hide loading overlay on invalid data\n this._hideSelectionLoadingOverlay();\n case 31:\n return _context15.abrupt(\"break\", 38);\n case 32:\n _context15.next = 34;\n return this.setToSetupState();\n case 34:\n return _context15.abrupt(\"break\", 38);\n case 35:\n console.warn('⚠️ Unknown initial state:', this.initialState);\n // Hide loading overlay on unknown state\n this._hideSelectionLoadingOverlay();\n return _context15.abrupt(\"break\", 38);\n case 38:\n _context15.next = 45;\n break;\n case 40:\n _context15.prev = 40;\n _context15.t1 = _context15[\"catch\"](0);\n console.error('❌ Error initializing state:', _context15.t1);\n // Hide loading overlay on error\n this._hideSelectionLoadingOverlay();\n // Fall back to default state\n this._stateCoordinator.transitionTo('default');\n case 45:\n case \"end\":\n return _context15.stop();\n }\n }, _callee15, this, [[0, 40]]);\n }));\n function _initializeState() {\n return _initializeState2.apply(this, arguments);\n }\n return _initializeState;\n }()\n }, {\n key: \"_createSelectionLoadingOverlay\",\n value: function _createSelectionLoadingOverlay() {\n this.selectionLoadingOverlay = document.createElement('div');\n this.selectionLoadingOverlay.className = 'selection-loading-overlay';\n\n // Option 2: NEW Circular progress loader - FIXED SIZE\n var progressContainer = document.createElement('div');\n progressContainer.className = 'selection-circular-progress';\n\n // Create SVG for circular progress with smaller circle to prevent cutoff\n var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('viewBox', '0 0 40 40'); // Keep viewBox at 40x40\n\n // Background circle - smaller radius to fit within container\n var backgroundCircle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n backgroundCircle.setAttribute('class', 'progress-ring');\n backgroundCircle.setAttribute('cx', '20'); // Center X\n backgroundCircle.setAttribute('cy', '20'); // Center Y\n backgroundCircle.setAttribute('r', '15'); // Radius 15 (30px diameter) - smaller to prevent cutoff\n\n // Progress circle - same smaller radius\n var progressCircle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');\n progressCircle.setAttribute('class', 'progress-ring-fill');\n progressCircle.setAttribute('cx', '20'); // Center X\n progressCircle.setAttribute('cy', '20'); // Center Y\n progressCircle.setAttribute('r', '15'); // Radius 15 (30px diameter) - smaller to prevent cutoff\n\n svg.appendChild(backgroundCircle);\n svg.appendChild(progressCircle);\n progressContainer.appendChild(svg);\n this.selectionLoadingOverlay.appendChild(progressContainer);\n\n // Append to the map container's parent (the actual map div) to ensure it covers everything\n var mapElement = document.getElementById(this.options.container);\n if (mapElement) {\n mapElement.appendChild(this.selectionLoadingOverlay);\n } else {\n // Fallback to mapContainer if parent not found\n this.mapContainer.appendChild(this.selectionLoadingOverlay);\n }\n }\n }, {\n key: \"_showSelectionLoadingOverlay\",\n value: function _showSelectionLoadingOverlay() {\n if (this.selectionLoadingOverlay) {\n this.selectionLoadingOverlay.style.display = 'flex';\n\n // Start the circular progress animation\n var progressCircle = this.selectionLoadingOverlay.querySelector('.progress-ring-fill');\n if (progressCircle) {\n // Reset animation\n progressCircle.classList.remove('animating');\n progressCircle.style.strokeDashoffset = '94.2';\n\n // Start animation after a small delay to ensure it's visible\n setTimeout(function () {\n progressCircle.classList.add('animating');\n }, 50);\n }\n }\n }\n }, {\n key: \"_hideSelectionLoadingOverlay\",\n value: function _hideSelectionLoadingOverlay() {\n if (this.selectionLoadingOverlay) {\n this.selectionLoadingOverlay.classList.add('hidden');\n var progressCircle = this.selectionLoadingOverlay.querySelector('.progress-ring-fill');\n if (progressCircle) {\n progressCircle.classList.remove('animating');\n progressCircle.style.strokeDashoffset = '188.4';\n }\n // setTimeout(() => {\n // if (this.selectionLoadingOverlay) {\n // this.selectionLoadingOverlay.style.display = 'none';\n // this.selectionLoadingOverlay.classList.remove('hidden');\n\n // // Reset progress animation for next time\n // const progressCircle = this.selectionLoadingOverlay.querySelector('.progress-ring-fill');\n // if (progressCircle) {\n // progressCircle.classList.remove('animating');\n // progressCircle.style.strokeDashoffset = '188.4';\n // }\n // }\n // }, 100); // Match the CSS transition duration\n }\n }\n }, {\n key: \"_initializeKioskReset\",\n value: function _initializeKioskReset() {\n var _this12 = this;\n // Reset the timer when any state changes\n this.on('state:default', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:search', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:selectedContent', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:directions', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:setup', function () {\n return _this12._resetKioskTimer();\n });\n this.on('state:selection', function () {\n return _this12._resetKioskTimer();\n });\n\n // Reset the timer when camera changes (user interaction with map)\n this.on('moveend', function () {\n return _this12._resetKioskTimer();\n });\n this.on('zoomend', function () {\n return _this12._resetKioskTimer();\n });\n this.on('pitchend', function () {\n return _this12._resetKioskTimer();\n });\n this.on('rotateend', function () {\n return _this12._resetKioskTimer();\n });\n this.on('dragend', function () {\n return _this12._resetKioskTimer();\n });\n\n // Start the timer - delay slightly to ensure listeners are attached\n setTimeout(function () {\n _this12._startKioskTimer();\n }, 100);\n }\n }, {\n key: \"_startKioskTimer\",\n value: function _startKioskTimer() {\n var _this13 = this;\n var resetTimeSeconds = KIOSK_RESET_TIME / 1000;\n var timeRemaining = resetTimeSeconds;\n\n // Clear any existing countdown interval first\n if (this.kioskCountdownInterval) {\n clearInterval(this.kioskCountdownInterval);\n }\n\n // Start countdown logging\n this.kioskCountdownInterval = setInterval(function () {\n timeRemaining--;\n if (timeRemaining <= 0) {\n clearInterval(_this13.kioskCountdownInterval);\n }\n }, 1000);\n\n // Set the actual reset timer\n this.kioskResetTimer = setTimeout(function () {\n var currentState = _this13._stateCoordinator.state;\n var currentFloor = _this13._currentFloorIndex;\n var defaultFloor = _this13._defaultFloorIndex;\n var defaultBearing = _this13._defaultBearing;\n var defaultPitch = _this13._defaultPitch;\n\n // Close any open modals (e.g., QR code modal)\n _this13.hideModal();\n\n // Reset to default floor with default camera settings\n _this13.updateFloor(defaultFloor, true, defaultBearing, defaultPitch);\n\n // Reset state to default if not already\n if (currentState !== 'default') {\n _this13.setToDefaultState();\n }\n\n // Clear the countdown interval\n if (_this13.kioskCountdownInterval) {\n clearInterval(_this13.kioskCountdownInterval);\n }\n }, KIOSK_RESET_TIME);\n }\n }, {\n key: \"_resetKioskTimer\",\n value: function _resetKioskTimer() {\n var currentState = this._stateCoordinator.state;\n\n // Clear existing timer\n if (this.kioskResetTimer) {\n clearTimeout(this.kioskResetTimer);\n }\n\n // Clear any existing countdown interval\n if (this.kioskCountdownInterval) {\n clearInterval(this.kioskCountdownInterval);\n }\n\n // Restart the timer\n this._startKioskTimer();\n }\n }, {\n key: \"_destroyKioskTimer\",\n value: function _destroyKioskTimer() {\n if (this.kioskResetTimer) {\n clearTimeout(this.kioskResetTimer);\n this.kioskResetTimer = null;\n }\n if (this.kioskCountdownInterval) {\n clearInterval(this.kioskCountdownInterval);\n this.kioskCountdownInterval = null;\n }\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n//# sourceURL=webpack://waygomaps/./src/components/MapView/MapView.js?");
805
816
 
806
817
  /***/ }),
807
818
 
@@ -845,7 +856,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
845
856
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
846
857
 
847
858
  "use strict";
848
- 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 _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchBarSuggestionsViewCell */ \"./src/components/SearchBox/SearchBarSuggestionsViewCell.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _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\nvar SearchBarSuggestionsView = /*#__PURE__*/function (_Component) {\n function SearchBarSuggestionsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBarSuggestionsView);\n _this = _callSuper(this, SearchBarSuggestionsView, [options]);\n _this._initialize();\n return _this;\n }\n _inherits(SearchBarSuggestionsView, _Component);\n return _createClass(SearchBarSuggestionsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.results = [];\n this.element = document.createElement('div');\n this.element.className = 'search-bar-suggestions-view';\n }\n }, {\n key: \"updateResults\",\n value: function updateResults(results) {\n this.results = results;\n this.render();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n this.element.innerHTML = ''; // Clear previous results\n\n this.results.forEach(function (r) {\n var cell = new _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__[\"default\"](r);\n cell.on('click', function () {\n return _this2.fire('selectCell', {\n result: r\n });\n });\n _this2.element.appendChild(cell.getElement());\n });\n }\n }, {\n key: \"clearResults\",\n value: function clearResults() {\n this.updateResults([]);\n }\n }, {\n key: \"show\",\n value: function show() {\n this.element.classList.add('visible');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.element.classList.remove('visible');\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n return;\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n return;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBarSuggestionsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBarSuggestionsView.js?");
859
+ 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 _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchBarSuggestionsViewCell */ \"./src/components/SearchBox/SearchBarSuggestionsViewCell.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _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\nvar SearchBarSuggestionsView = /*#__PURE__*/function (_Component) {\n function SearchBarSuggestionsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBarSuggestionsView);\n _this = _callSuper(this, SearchBarSuggestionsView, [options]);\n _this._initialize();\n return _this;\n }\n _inherits(SearchBarSuggestionsView, _Component);\n return _createClass(SearchBarSuggestionsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.results = [];\n this.pinnedResults = [];\n this.element = document.createElement('div');\n this.element.className = 'search-bar-suggestions-view';\n }\n }, {\n key: \"updateResults\",\n value: function updateResults(results) {\n this.results = results;\n this.render();\n }\n }, {\n key: \"setPinnedResults\",\n value: function setPinnedResults(pinnedResults) {\n this.pinnedResults = pinnedResults || [];\n this.render();\n }\n }, {\n key: \"hasPinnedResults\",\n value: function hasPinnedResults() {\n return this.pinnedResults.length > 0;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n this.element.innerHTML = ''; // Clear previous results\n\n this.pinnedResults.forEach(function (r) {\n var cell = new _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__[\"default\"](r);\n cell.on('click', function () {\n return _this2.fire('selectCell', {\n result: r\n });\n });\n _this2.element.appendChild(cell.getElement());\n });\n this.results.forEach(function (r) {\n var cell = new _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__[\"default\"](r);\n cell.on('click', function () {\n return _this2.fire('selectCell', {\n result: r\n });\n });\n _this2.element.appendChild(cell.getElement());\n });\n }\n }, {\n key: \"clearResults\",\n value: function clearResults() {\n this.updateResults([]);\n }\n }, {\n key: \"show\",\n value: function show() {\n this.element.classList.add('visible');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.element.classList.remove('visible');\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n return;\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n return;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBarSuggestionsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBarSuggestionsView.js?");
849
860
 
850
861
  /***/ }),
851
862
 
@@ -856,7 +867,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
856
867
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
857
868
 
858
869
  "use strict";
859
- 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_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _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\nvar SearchBarSuggestionsViewCell = /*#__PURE__*/function (_Component) {\n function SearchBarSuggestionsViewCell(result) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, SearchBarSuggestionsViewCell);\n _this = _callSuper(this, SearchBarSuggestionsViewCell, [options]);\n _this.result = result;\n _this._initialize();\n return _this;\n }\n _inherits(SearchBarSuggestionsViewCell, _Component);\n return _createClass(SearchBarSuggestionsViewCell, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('div');\n this.element.className = 'search-bar-suggestions-view-cell';\n this.render();\n this._setupEventListeners();\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.element.addEventListener('click', function () {\n return _this2.fire('click', {\n result: _this2.result\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var titleKey = this.result.catalog.content_title_key;\n this.element.innerHTML = \"\\n <div class=\\\"suggestion-title\\\">\".concat(this.result.content.data[titleKey], \"</div>\\n <div class=\\\"suggestion-subtitle\\\">\").concat(this.result.contextual_location, \"</div>\\n \");\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBarSuggestionsViewCell);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBarSuggestionsViewCell.js?");
870
+ 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_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _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\nvar SearchBarSuggestionsViewCell = /*#__PURE__*/function (_Component) {\n function SearchBarSuggestionsViewCell(result) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, SearchBarSuggestionsViewCell);\n _this = _callSuper(this, SearchBarSuggestionsViewCell, [options]);\n _this.result = result;\n _this._initialize();\n return _this;\n }\n _inherits(SearchBarSuggestionsViewCell, _Component);\n return _createClass(SearchBarSuggestionsViewCell, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('div');\n this.element.className = 'search-bar-suggestions-view-cell';\n if (this.result && this.result.type === 'gps-current-location') {\n this.element.classList.add('search-bar-suggestions-view-cell--gps');\n }\n this.render();\n this._setupEventListeners();\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.element.addEventListener('click', function () {\n return _this2.fire('click', {\n result: _this2.result\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.result && this.result.type === 'gps-current-location') {\n this.element.innerHTML = \"\\n <div class=\\\"suggestion-gps-icon\\\" aria-hidden=\\\"true\\\">\\n <svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"20\\\" height=\\\"20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\">\\n <circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"3\\\"></circle>\\n <line x1=\\\"12\\\" y1=\\\"2\\\" x2=\\\"12\\\" y2=\\\"5\\\"></line>\\n <line x1=\\\"12\\\" y1=\\\"19\\\" x2=\\\"12\\\" y2=\\\"22\\\"></line>\\n <line x1=\\\"2\\\" y1=\\\"12\\\" x2=\\\"5\\\" y2=\\\"12\\\"></line>\\n <line x1=\\\"19\\\" y1=\\\"12\\\" x2=\\\"22\\\" y2=\\\"12\\\"></line>\\n </svg>\\n </div>\\n <div class=\\\"suggestion-title\\\">Use current location</div>\\n \";\n return;\n }\n var titleKey = this.result.catalog.content_title_key;\n this.element.innerHTML = \"\\n <div class=\\\"suggestion-title\\\">\".concat(this.result.content.data[titleKey], \"</div>\\n <div class=\\\"suggestion-subtitle\\\">\").concat(this.result.contextual_location, \"</div>\\n \");\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBarSuggestionsViewCell);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBarSuggestionsViewCell.js?");
860
871
 
861
872
  /***/ }),
862
873
 
@@ -867,7 +878,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
867
878
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
868
879
 
869
880
  "use strict";
870
- 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 _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _SearchBar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SearchBar */ \"./src/components/SearchBox/SearchBar.js\");\n/* harmony import */ var _SearchBarSuggestionsView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SearchBarSuggestionsView */ \"./src/components/SearchBox/SearchBarSuggestionsView.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _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 _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// import axios from \"axios\";\nvar SearchBox = /*#__PURE__*/function (_Component) {\n function SearchBox() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBox);\n _this = _callSuper(this, SearchBox, [options]);\n // this.searchApi = waygoMaps.getSearchApi();\n\n _this.element = document.createElement('div');\n _this.element.className = 'search-box';\n _this.searchBar = new _SearchBar__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n _this.searchBarSuggestionsView = new _SearchBarSuggestionsView__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n _this.searchCount = 0; // Allows us to invalidate outdated searches\n\n _this.initializeHandlers();\n _this._render();\n return _this;\n }\n _inherits(SearchBox, _Component);\n return _createClass(SearchBox, [{\n key: \"initializeHandlers\",\n value: function initializeHandlers() {\n this.searchBar.on('input', this._handleSearchBarInput.bind(this));\n this.searchBar.on('focus', this._handleSearchBarFocus.bind(this));\n this.searchBar.on('blur', this._handleSearchBarBlur.bind(this));\n this.searchBar.on('search', this._handleSearchBarSearch.bind(this));\n this.searchBar.on('back', this._handleSearchBarBack.bind(this));\n this.searchBarSuggestionsView.on('selectCell', this._handleSearchResultSelect.bind(this));\n window.addEventListener('resize', function (event) {\n event.preventDefault(); // Prevent viewport from resizing\n });\n }\n }, {\n key: \"_handleSearchBarBack\",\n value: function _handleSearchBarBack() {\n this.fire('selectBack');\n }\n }, {\n key: \"_handleSearchBarSearch\",\n value: function _handleSearchBarSearch(data) {\n var query = data.query,\n event = data.event;\n this.fire('search', {\n query: query\n });\n }\n }, {\n key: \"_handleSearchResultSelect\",\n value: function _handleSearchResultSelect(data) {\n var result = data.result;\n }\n }, {\n key: \"_handleSearchBarFocus\",\n value: function () {\n var _handleSearchBarFocus2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var query;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n query = this.searchBar.getText();\n if (!(query.length > 2)) {\n _context.next = 5;\n break;\n }\n _context.next = 4;\n return this.getSearchBarSuggestions(query);\n case 4:\n this.openSuggestionsView();\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleSearchBarFocus() {\n return _handleSearchBarFocus2.apply(this, arguments);\n }\n return _handleSearchBarFocus;\n }()\n }, {\n key: \"_handleSearchBarBlur\",\n value: function _handleSearchBarBlur() {\n // this.searchBarSuggestionsView.hide();\n this.closeSuggestionsView();\n }\n }, {\n key: \"_handleSearchBarInput\",\n value: function () {\n var _handleSearchBarInput2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var query;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n query = data.query;\n if (!(query.length !== 0)) {\n _context2.next = 7;\n break;\n }\n this.openSuggestionsView();\n _context2.next = 5;\n return this.getSearchBarSuggestions(query);\n case 5:\n _context2.next = 8;\n break;\n case 7:\n this.closeSuggestionsView();\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleSearchBarInput(_x) {\n return _handleSearchBarInput2.apply(this, arguments);\n }\n return _handleSearchBarInput;\n }()\n }, {\n key: \"_render\",\n value: function _render() {\n this.element.appendChild(this.searchBar.getElement());\n this.element.appendChild(this.searchBarSuggestionsView.getElement());\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n this.searchBar.setViewForDesktop();\n this.searchBarSuggestionsView.setViewForDesktop();\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n this.searchBar.setViewForMobile();\n this.searchBarSuggestionsView.setViewForMobile();\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"openSuggestionsView\",\n value: function openSuggestionsView() {\n this.searchBarSuggestionsView.show();\n this.searchBar.updateStyleWithSuggestions();\n }\n }, {\n key: \"closeSuggestionsView\",\n value: function closeSuggestionsView() {\n this.searchBarSuggestionsView.hide();\n this.searchBar.updateStyleWithoutSuggestions();\n }\n }, {\n key: \"getSearchBarSuggestions\",\n value: function () {\n var _getSearchBarSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n this.fire('getSearchBarSuggestions', {\n query: query\n });\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function getSearchBarSuggestions(_x2) {\n return _getSearchBarSuggestions.apply(this, arguments);\n }\n return getSearchBarSuggestions;\n }()\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBox);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBox.js?");
881
+ 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 _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _SearchBar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SearchBar */ \"./src/components/SearchBox/SearchBar.js\");\n/* harmony import */ var _SearchBarSuggestionsView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SearchBarSuggestionsView */ \"./src/components/SearchBox/SearchBarSuggestionsView.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.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 _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 _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// import axios from \"axios\";\nvar SearchBox = /*#__PURE__*/function (_Component) {\n function SearchBox() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBox);\n _this = _callSuper(this, SearchBox, [options]);\n // this.searchApi = waygoMaps.getSearchApi();\n\n _this.element = document.createElement('div');\n _this.element.className = 'search-box';\n _this.searchBar = new _SearchBar__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n _this.searchBarSuggestionsView = new _SearchBarSuggestionsView__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n _this.searchCount = 0; // Allows us to invalidate outdated searches\n\n _this.showSuggestionsOnEmptyFocus = false;\n _this.initializeHandlers();\n _this._render();\n return _this;\n }\n _inherits(SearchBox, _Component);\n return _createClass(SearchBox, [{\n key: \"initializeHandlers\",\n value: function initializeHandlers() {\n this.searchBar.on('input', this._handleSearchBarInput.bind(this));\n this.searchBar.on('focus', this._handleSearchBarFocus.bind(this));\n this.searchBar.on('blur', this._handleSearchBarBlur.bind(this));\n this.searchBar.on('search', this._handleSearchBarSearch.bind(this));\n this.searchBar.on('back', this._handleSearchBarBack.bind(this));\n this.searchBarSuggestionsView.on('selectCell', this._handleSearchResultSelect.bind(this));\n window.addEventListener('resize', function (event) {\n event.preventDefault(); // Prevent viewport from resizing\n });\n }\n }, {\n key: \"_handleSearchBarBack\",\n value: function _handleSearchBarBack() {\n this.fire('selectBack');\n }\n }, {\n key: \"_handleSearchBarSearch\",\n value: function _handleSearchBarSearch(data) {\n var query = data.query,\n event = data.event;\n this.fire('search', {\n query: query\n });\n }\n }, {\n key: \"_handleSearchResultSelect\",\n value: function _handleSearchResultSelect(data) {\n var result = data.result;\n }\n }, {\n key: \"_handleSearchBarFocus\",\n value: function () {\n var _handleSearchBarFocus2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var query;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n query = this.searchBar.getText();\n if (!(query.length > 2)) {\n _context.next = 7;\n break;\n }\n _context.next = 4;\n return this.getSearchBarSuggestions(query);\n case 4:\n this.openSuggestionsView();\n _context.next = 8;\n break;\n case 7:\n if (this.showSuggestionsOnEmptyFocus && this.searchBarSuggestionsView.hasPinnedResults()) {\n this.openSuggestionsView();\n }\n case 8:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleSearchBarFocus() {\n return _handleSearchBarFocus2.apply(this, arguments);\n }\n return _handleSearchBarFocus;\n }()\n }, {\n key: \"_handleSearchBarBlur\",\n value: function _handleSearchBarBlur() {\n // this.searchBarSuggestionsView.hide();\n this.closeSuggestionsView();\n }\n }, {\n key: \"_handleSearchBarInput\",\n value: function () {\n var _handleSearchBarInput2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var query;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n query = data.query;\n if (!(query.length !== 0)) {\n _context2.next = 7;\n break;\n }\n this.openSuggestionsView();\n _context2.next = 5;\n return this.getSearchBarSuggestions(query);\n case 5:\n _context2.next = 8;\n break;\n case 7:\n if (this.showSuggestionsOnEmptyFocus && this.searchBarSuggestionsView.hasPinnedResults()) {\n this.searchBarSuggestionsView.updateResults([]);\n this.openSuggestionsView();\n } else {\n this.closeSuggestionsView();\n }\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleSearchBarInput(_x) {\n return _handleSearchBarInput2.apply(this, arguments);\n }\n return _handleSearchBarInput;\n }()\n }, {\n key: \"_render\",\n value: function _render() {\n this.element.appendChild(this.searchBar.getElement());\n this.element.appendChild(this.searchBarSuggestionsView.getElement());\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n this.searchBar.setViewForDesktop();\n this.searchBarSuggestionsView.setViewForDesktop();\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n this.searchBar.setViewForMobile();\n this.searchBarSuggestionsView.setViewForMobile();\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"openSuggestionsView\",\n value: function openSuggestionsView() {\n this.searchBarSuggestionsView.show();\n this.searchBar.updateStyleWithSuggestions();\n }\n }, {\n key: \"closeSuggestionsView\",\n value: function closeSuggestionsView() {\n this.searchBarSuggestionsView.hide();\n this.searchBar.updateStyleWithoutSuggestions();\n }\n }, {\n key: \"setPinnedResults\",\n value: function setPinnedResults(results) {\n this.searchBarSuggestionsView.setPinnedResults(results);\n }\n }, {\n key: \"clearPinnedResults\",\n value: function clearPinnedResults() {\n this.searchBarSuggestionsView.setPinnedResults([]);\n }\n }, {\n key: \"setShowSuggestionsOnEmptyFocus\",\n value: function setShowSuggestionsOnEmptyFocus(enabled) {\n this.showSuggestionsOnEmptyFocus = !!enabled;\n }\n }, {\n key: \"getSearchBarSuggestions\",\n value: function () {\n var _getSearchBarSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n this.fire('getSearchBarSuggestions', {\n query: query\n });\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function getSearchBarSuggestions(_x2) {\n return _getSearchBarSuggestions.apply(this, arguments);\n }\n return getSearchBarSuggestions;\n }()\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBox);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBox.js?");
871
882
 
872
883
  /***/ }),
873
884
 
@@ -1014,6 +1025,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1014
1025
 
1015
1026
  /***/ }),
1016
1027
 
1028
+ /***/ "./src/utils/geolocationManager.js":
1029
+ /*!*****************************************!*\
1030
+ !*** ./src/utils/geolocationManager.js ***!
1031
+ \*****************************************/
1032
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1033
+
1034
+ "use strict";
1035
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ clearCachedPosition: () => (/* binding */ clearCachedPosition),\n/* harmony export */ getCachedPosition: () => (/* binding */ getCachedPosition),\n/* harmony export */ getCurrentPositionAsync: () => (/* binding */ getCurrentPositionAsync),\n/* harmony export */ getPermissionState: () => (/* binding */ getPermissionState),\n/* harmony export */ isGeolocationAvailable: () => (/* binding */ isGeolocationAvailable)\n/* harmony export */ });\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); }); }; }\nvar CACHE_TTL_MS = 30000;\nvar _cachedPosition = null;\nfunction isGeolocationAvailable() {\n return typeof navigator !== 'undefined' && typeof navigator.geolocation !== 'undefined' && typeof navigator.geolocation.getCurrentPosition === 'function';\n}\nfunction getPermissionState() {\n return _getPermissionState.apply(this, arguments);\n}\nfunction _getPermissionState() {\n _getPermissionState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var status;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (isGeolocationAvailable()) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\", 'unsupported');\n case 2:\n if (!(typeof navigator.permissions === 'undefined' || typeof navigator.permissions.query !== 'function')) {\n _context.next = 4;\n break;\n }\n return _context.abrupt(\"return\", 'prompt');\n case 4:\n _context.prev = 4;\n _context.next = 7;\n return navigator.permissions.query({\n name: 'geolocation'\n });\n case 7:\n status = _context.sent;\n return _context.abrupt(\"return\", status.state);\n case 11:\n _context.prev = 11;\n _context.t0 = _context[\"catch\"](4);\n return _context.abrupt(\"return\", 'prompt');\n case 14:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[4, 11]]);\n }));\n return _getPermissionState.apply(this, arguments);\n}\nfunction getCachedPosition() {\n if (!_cachedPosition) return null;\n if (Date.now() - _cachedPosition.timestamp > CACHE_TTL_MS) {\n _cachedPosition = null;\n return null;\n }\n return _cachedPosition;\n}\nfunction getCurrentPositionAsync() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$enableHighAc = options.enableHighAccuracy,\n enableHighAccuracy = _options$enableHighAc === void 0 ? true : _options$enableHighAc,\n _options$timeout = options.timeout,\n timeout = _options$timeout === void 0 ? 10000 : _options$timeout,\n _options$maximumAge = options.maximumAge,\n maximumAge = _options$maximumAge === void 0 ? 30000 : _options$maximumAge;\n return new Promise(function (resolve, reject) {\n if (!isGeolocationAvailable()) {\n reject({\n code: 'UNAVAILABLE',\n message: 'Geolocation is not supported by this browser.'\n });\n return;\n }\n var cached = getCachedPosition();\n if (cached) {\n resolve(cached);\n return;\n }\n navigator.geolocation.getCurrentPosition(function (position) {\n var result = {\n coordinate: [position.coords.longitude, position.coords.latitude],\n accuracy: position.coords.accuracy,\n timestamp: Date.now()\n };\n _cachedPosition = result;\n resolve(result);\n }, function (err) {\n var code;\n switch (err.code) {\n case 1:\n code = 'DENIED';\n break;\n case 2:\n code = 'UNAVAILABLE';\n break;\n case 3:\n code = 'TIMEOUT';\n break;\n default:\n code = 'UNAVAILABLE';\n }\n reject({\n code: code,\n message: err.message\n });\n }, {\n enableHighAccuracy: enableHighAccuracy,\n timeout: timeout,\n maximumAge: maximumAge\n });\n });\n}\nfunction clearCachedPosition() {\n _cachedPosition = null;\n}\n\n//# sourceURL=webpack://waygomaps/./src/utils/geolocationManager.js?");
1036
+
1037
+ /***/ }),
1038
+
1017
1039
  /***/ "./src/utils/outdoorMapIds.js":
1018
1040
  /*!************************************!*\
1019
1041
  !*** ./src/utils/outdoorMapIds.js ***!