waygo-maps 1.0.18 → 1.0.19
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 +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see bundle.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.waygomaps=e():t.waygomaps=e()}(this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var e;t.g.importScripts&&(e=t.g.location+"");var n=t.g.document;if(!e&&n&&(n.currentScript&&"SCRIPT"===n.currentScript.tagName.toUpperCase()&&(e=n.currentScript.src),!e)){var r=n.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=e})();var e={};t.d(e,{default:()=>ua});var n={};function r(t,e){return function(){return t.apply(e,arguments)}}t.r(n),t.d(n,{hasBrowserEnv:()=>ht,hasStandardBrowserEnv:()=>yt,hasStandardBrowserWebWorkerEnv:()=>dt,navigator:()=>pt,origin:()=>mt});const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,a=(c=Object.create(null),t=>{const e=o.call(t);return c[e]||(c[e]=e.slice(8,-1).toLowerCase())});var c;const s=t=>(t=t.toLowerCase(),e=>a(e)===t),u=t=>e=>typeof e===t,{isArray:l}=Array,f=u("undefined"),h=s("ArrayBuffer"),p=u("string"),y=u("function"),d=u("number"),m=t=>null!==t&&"object"==typeof t,v=t=>{if("object"!==a(t))return!1;const e=i(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},g=s("Date"),b=s("File"),w=s("Blob"),E=s("FileList"),j=s("URLSearchParams"),[M,S,O,x]=["ReadableStream","Request","Response","Headers"].map(s);function T(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),l(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(r=0;r<i;r++)a=o[r],e.call(null,t[a],a,t)}}function D(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,N=t=>!f(t)&&t!==L,k=(_="undefined"!=typeof Uint8Array&&i(Uint8Array),t=>_&&t instanceof _);var _;const I=s("HTMLFormElement"),C=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),P=s("RegExp"),A=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};T(n,((n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)})),Object.defineProperties(t,r)},B="abcdefghijklmnopqrstuvwxyz",z="0123456789",R={DIGIT:z,ALPHA:B,ALPHA_DIGIT:B+B.toUpperCase()+z},U=s("AsyncFunction"),V=(F="function"==typeof setImmediate,Q=y(L.postMessage),F?setImmediate:Q?(Y=`axios@${Math.random()}`,H=[],L.addEventListener("message",(({source:t,data:e})=>{t===L&&e===Y&&H.length&&H.shift()()}),!1),t=>{H.push(t),L.postMessage(Y,"*")}):t=>setTimeout(t));var F,Q,Y,H;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(L):"undefined"!=typeof process&&process.nextTick||V,Z={isArray:l,isArrayBuffer:h,isBuffer:function(t){return null!==t&&!f(t)&&null!==t.constructor&&!f(t.constructor)&&y(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||y(t.append)&&("formdata"===(e=a(t))||"object"===e&&y(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&h(t.buffer),e},isString:p,isNumber:d,isBoolean:t=>!0===t||!1===t,isObject:m,isPlainObject:v,isReadableStream:M,isRequest:S,isResponse:O,isHeaders:x,isUndefined:f,isDate:g,isFile:b,isBlob:w,isRegExp:P,isFunction:y,isStream:t=>m(t)&&y(t.pipe),isURLSearchParams:j,isTypedArray:k,isFileList:E,forEach:T,merge:function t(){const{caseless:e}=N(this)&&this||{},n={},r=(r,o)=>{const i=e&&D(n,o)||o;v(n[i])&&v(r)?n[i]=t(n[i],r):v(r)?n[i]=t({},r):l(r)?n[i]=r.slice():n[i]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&T(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:o}={})=>(T(e,((e,o)=>{n&&y(e)?t[o]=r(e,n):t[o]=e}),{allOwnKeys:o}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,a,c;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),a=o.length;a-- >0;)c=o[a],r&&!r(c,t,e)||s[c]||(e[c]=t[c],s[c]=!0);t=!1!==n&&i(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:a,kindOfTest:s,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(l(t))return t;let e=t.length;if(!d(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:I,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:A,freezeMethods:t=>{A(t,((e,n)=>{if(y(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];y(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return l(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:D,global:L,isContextDefined:N,ALPHABET:R,generateString:(t=16,e=R.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&y(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(m(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const o=l(t)?[]:{};return T(t,((t,e)=>{const i=n(t,r+1);!f(i)&&(o[e]=i)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:U,isThenable:t=>t&&(m(t)||y(t))&&y(t.then)&&y(t.catch),setImmediate:V,asap:G};function W(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Z.inherits(W,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.status}}});const q=W.prototype,J={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{J[t]={value:t}})),Object.defineProperties(W,J),Object.defineProperty(q,"isAxiosError",{value:!0}),W.from=(t,e,n,r,o,i)=>{const a=Object.create(q);return Z.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),W.call(a,t.message,e,n,r,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const K=W;function X(t){return Z.isPlainObject(t)||Z.isArray(t)}function $(t){return Z.endsWith(t,"[]")?t.slice(0,-2):t}function tt(t,e,n){return t?t.concat(e).map((function(t,e){return t=$(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const et=Z.toFlatObject(Z,{},null,(function(t){return/^is[A-Z]/.test(t)})),nt=function(t,e,n){if(!Z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=Z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Z.isUndefined(e[t])}))).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,c=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Z.isSpecCompliantForm(e);if(!Z.isFunction(o))throw new TypeError("visitor must be a function");function s(t){if(null===t)return"";if(Z.isDate(t))return t.toISOString();if(!c&&Z.isBlob(t))throw new K("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(t)||Z.isTypedArray(t)?c&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,n,o){let c=t;if(t&&!o&&"object"==typeof t)if(Z.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Z.isArray(t)&&function(t){return Z.isArray(t)&&!t.some(X)}(t)||(Z.isFileList(t)||Z.endsWith(n,"[]"))&&(c=Z.toArray(t)))return n=$(n),c.forEach((function(t,r){!Z.isUndefined(t)&&null!==t&&e.append(!0===a?tt([n],r,i):null===a?n:n+"[]",s(t))})),!1;return!!X(t)||(e.append(tt(o,n,i),s(t)),!1)}const l=[],f=Object.assign(et,{defaultVisitor:u,convertValue:s,isVisitable:X});if(!Z.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Z.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Z.forEach(n,(function(n,i){!0===(!(Z.isUndefined(n)||null===n)&&o.call(e,n,Z.isString(i)?i.trim():i,r,f))&&t(n,r?r.concat(i):[i])})),l.pop()}}(t),e};function rt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function ot(t,e){this._pairs=[],t&&nt(t,this,e)}const it=ot.prototype;it.append=function(t,e){this._pairs.push([t,e])},it.toString=function(t){const e=t?function(e){return t.call(this,e,rt)}:rt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const at=ot;function ct(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function st(t,e,n){if(!e)return t;const r=n&&n.encode||ct,o=n&&n.serialize;let i;if(i=o?o(e,n):Z.isURLSearchParams(e)?e.toString():new at(e,n).toString(r),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const ut=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},lt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ft={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:at,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ht="undefined"!=typeof window&&"undefined"!=typeof document,pt="object"==typeof navigator&&navigator||void 0,yt=ht&&(!pt||["ReactNative","NativeScript","NS"].indexOf(pt.product)<0),dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,mt=ht&&window.location.href||"http://localhost",vt={...n,...ft},gt=function(t){function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),c=o>=t.length;return i=!i&&Z.isArray(r)?r.length:i,c?(Z.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&Z.isObject(r[i])||(r[i]=[]),e(t,n,r[i],o)&&Z.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}(r[i])),!a)}if(Z.isFormData(t)&&Z.isFunction(t.entries)){const n={};return Z.forEachEntry(t,((t,r)=>{e(function(t){return Z.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null},bt={transitional:lt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=Z.isObject(t);if(o&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return r?JSON.stringify(gt(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return nt(t,new vt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return vt.isNode&&Z.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=Z.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return nt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t){if(Z.isString(t))try{return(0,JSON.parse)(t),Z.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||bt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw K.from(t,K.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vt.classes.FormData,Blob:vt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch"],(t=>{bt.headers[t]={}}));const wt=bt,Et=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),jt=Symbol("internals");function Mt(t){return t&&String(t).trim().toLowerCase()}function St(t){return!1===t||null==t?t:Z.isArray(t)?t.map(St):String(t)}function Ot(t,e,n,r,o){return Z.isFunction(r)?r.call(this,e,n):(o&&(e=n),Z.isString(e)?Z.isString(r)?-1!==e.indexOf(r):Z.isRegExp(r)?r.test(e):void 0:void 0)}class xt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=Mt(e);if(!o)throw new Error("header name must be a non-empty string");const i=Z.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=St(t))}const i=(t,e)=>Z.forEach(t,((t,n)=>o(t,n,e)));if(Z.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(Z.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&Et[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(Z.isHeaders(t))for(const[e,r]of t.entries())o(r,e,n);else null!=t&&o(e,t,n);return this}get(t,e){if(t=Mt(t)){const n=Z.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(Z.isFunction(e))return e.call(this,t,n);if(Z.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Mt(t)){const n=Z.findKey(this,t);return!(!n||void 0===this[n]||e&&!Ot(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=Mt(t)){const o=Z.findKey(n,t);!o||e&&!Ot(0,n[o],o,e)||(delete n[o],r=!0)}}return Z.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!Ot(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return Z.forEach(this,((r,o)=>{const i=Z.findKey(n,o);if(i)return e[i]=St(r),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete e[o],e[a]=St(r),n[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Z.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&Z.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[jt]=this[jt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Mt(t);e[r]||(function(t,e){const n=Z.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return Z.isArray(t)?t.forEach(r):r(t),this}}xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(xt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),Z.freezeMethods(xt);const Tt=xt;function Dt(t,e){const n=this||wt,r=e||n,o=Tt.from(r.headers);let i=r.data;return Z.forEach(t,(function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Lt(t){return!(!t||!t.__CANCEL__)}function Nt(t,e,n){K.call(this,null==t?"canceled":t,K.ERR_CANCELED,e,n),this.name="CanceledError"}Z.inherits(Nt,K,{__CANCEL__:!0});const kt=Nt;function _t(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new K("Request failed with status code "+n.status,[K.ERR_BAD_REQUEST,K.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}const It=(t,e,n=3)=>{let r=0;const o=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(c){const s=Date.now(),u=r[a];o||(o=s),n[i]=c,r[i]=s;let l=a,f=0;for(;l!==i;)f+=n[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),s-o<e)return;const h=u&&s-u;return h?Math.round(1e3*f/h):void 0}}(50,250);return function(t,e){let n,r,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),c=e-o;c>=i?a(t,e):(n=t,r||(r=setTimeout((()=>{r=null,a(n)}),i-c)))},()=>n&&a(n)]}((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,c=i-r,s=o(c);r=i,t({loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:n,lengthComputable:null!=a,[e?"download":"upload"]:!0})}),n)},Ct=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Pt=t=>(...e)=>Z.asap((()=>t(...e))),At=vt.hasStandardBrowserEnv?function(){const t=vt.navigator&&/(msie|trident)/i.test(vt.navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=Z.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0},Bt=vt.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const a=[t+"="+encodeURIComponent(e)];Z.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Z.isString(r)&&a.push("path="+r),Z.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function zt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Rt=t=>t instanceof Tt?{...t}:t;function Ut(t,e){e=e||{};const n={};function r(t,e,n){return Z.isPlainObject(t)&&Z.isPlainObject(e)?Z.merge.call({caseless:n},t,e):Z.isPlainObject(e)?Z.merge({},e):Z.isArray(e)?e.slice():e}function o(t,e,n){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function i(t,e){if(!Z.isUndefined(e))return r(void 0,e)}function a(t,e){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function c(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(t,e)=>o(Rt(t),Rt(e),!0)};return Z.forEach(Object.keys(Object.assign({},t,e)),(function(r){const i=s[r]||o,a=i(t[r],e[r],r);Z.isUndefined(a)&&i!==c||(n[r]=a)})),n}const Vt=t=>{const e=Ut({},t);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:c,auth:s}=e;if(e.headers=c=Tt.from(c),e.url=st(zt(e.baseURL,e.url),t.params,t.paramsSerializer),s&&c.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Z.isFormData(r))if(vt.hasStandardBrowserEnv||vt.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(!1!==(n=c.getContentType())){const[t,...e]=n?n.split(";").map((t=>t.trim())).filter(Boolean):[];c.setContentType([t||"multipart/form-data",...e].join("; "))}if(vt.hasStandardBrowserEnv&&(o&&Z.isFunction(o)&&(o=o(e)),o||!1!==o&&At(e.url))){const t=i&&a&&Bt.read(a);t&&c.set(i,t)}return e},Ft="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=Vt(t);let o=r.data;const i=Tt.from(r.headers).normalize();let a,c,s,u,l,{responseType:f,onUploadProgress:h,onDownloadProgress:p}=r;function y(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let d=new XMLHttpRequest;function m(){if(!d)return;const r=Tt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());_t((function(t){e(t),y()}),(function(t){n(t),y()}),{data:f&&"text"!==f&&"json"!==f?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:t,request:d}),d=null}d.open(r.method.toUpperCase(),r.url,!0),d.timeout=r.timeout,"onloadend"in d?d.onloadend=m:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(m)},d.onabort=function(){d&&(n(new K("Request aborted",K.ECONNABORTED,t,d)),d=null)},d.onerror=function(){n(new K("Network Error",K.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||lt;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new K(e,o.clarifyTimeoutError?K.ETIMEDOUT:K.ECONNABORTED,t,d)),d=null},void 0===o&&i.setContentType(null),"setRequestHeader"in d&&Z.forEach(i.toJSON(),(function(t,e){d.setRequestHeader(e,t)})),Z.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),f&&"json"!==f&&(d.responseType=r.responseType),p&&([s,l]=It(p,!0),d.addEventListener("progress",s)),h&&d.upload&&([c,u]=It(h),d.upload.addEventListener("progress",c),d.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=e=>{d&&(n(!e||e.type?new kt(null,t,d):e),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const v=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);v&&-1===vt.protocols.indexOf(v)?n(new K("Unsupported protocol "+v+":",K.ERR_BAD_REQUEST,t)):d.send(o||null)}))},Qt=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const o=function(t){if(!n){n=!0,a();const e=t instanceof Error?t:this.reason;r.abort(e instanceof K?e:new kt(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new K(`timeout ${e} of ms exceeded`,K.ETIMEDOUT))}),e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:c}=r;return c.unsubscribe=()=>Z.asap(a),c}},Yt=function*(t,e){let n=t.byteLength;if(!e||n<e)return void(yield t);let r,o=0;for(;o<n;)r=o+e,yield t.slice(o,r),o=r},Ht=(t,e,n,r)=>{const o=async function*(t,e){for await(const n of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}}(t))yield*Yt(n,e)}(t,e);let i,a=0,c=t=>{i||(i=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e)return c(),void t.close();let i=r.byteLength;if(n){let t=a+=i;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw c(t),t}},cancel:t=>(c(t),o.return())},{highWaterMark:2})},Gt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Zt=Gt&&"function"==typeof ReadableStream,Wt=Gt&&("function"==typeof TextEncoder?(qt=new TextEncoder,t=>qt.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var qt;const Jt=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Kt=Zt&&Jt((()=>{let t=!1;const e=new Request(vt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Xt=Zt&&Jt((()=>Z.isReadableStream(new Response("").body))),$t={stream:Xt&&(t=>t.body)};var te;Gt&&(te=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!$t[t]&&($t[t]=Z.isFunction(te[t])?e=>e[t]():(e,n)=>{throw new K(`Response type '${t}' is not supported`,K.ERR_NOT_SUPPORT,n)})})));const ee={http:null,xhr:Ft,fetch:Gt&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:c,onUploadProgress:s,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:h}=Vt(t);u=u?(u+"").toLowerCase():"text";let p,y=Qt([o,i&&i.toAbortSignal()],a);const d=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let m;try{if(s&&Kt&&"get"!==n&&"head"!==n&&0!==(m=await(async(t,e)=>{const n=Z.toFiniteNumber(t.getContentLength());return null==n?(async t=>{if(null==t)return 0;if(Z.isBlob(t))return t.size;if(Z.isSpecCompliantForm(t)){const e=new Request(vt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Z.isArrayBufferView(t)||Z.isArrayBuffer(t)?t.byteLength:(Z.isURLSearchParams(t)&&(t+=""),Z.isString(t)?(await Wt(t)).byteLength:void 0)})(e):n})(l,r))){let t,n=new Request(e,{method:"POST",body:r,duplex:"half"});if(Z.isFormData(r)&&(t=n.headers.get("content-type"))&&l.setContentType(t),n.body){const[t,e]=Ct(m,It(Pt(s)));r=Ht(n.body,65536,t,e)}}Z.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(e,{...h,signal:y,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:o?f:void 0});let i=await fetch(p);const a=Xt&&("stream"===u||"response"===u);if(Xt&&(c||a&&d)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=Z.toFiniteNumber(i.headers.get("content-length")),[n,r]=c&&Ct(e,It(Pt(c),!0))||[];i=new Response(Ht(i.body,65536,n,(()=>{r&&r(),d&&d()})),t)}u=u||"text";let v=await $t[Z.findKey($t,u)||"text"](i,t);return!a&&d&&d(),await new Promise(((e,n)=>{_t(e,n,{data:v,headers:Tt.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:p})}))}catch(e){if(d&&d(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new K("Network Error",K.ERR_NETWORK,t,p),{cause:e.cause||e});throw K.from(e,e&&e.code,t,p)}})};Z.forEach(ee,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ne=t=>`- ${t}`,re=t=>Z.isFunction(t)||null===t||!1===t,oe=t=>{t=Z.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){let e;if(n=t[i],r=n,!re(n)&&(r=ee[(e=String(n)).toLowerCase()],void 0===r))throw new K(`Unknown adapter '${e}'`);if(r)break;o[e||"#"+i]=r}if(!r){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(ne).join("\n"):" "+ne(t[0]):"as no adapter specified";throw new K("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function ie(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new kt(null,t)}function ae(t){return ie(t),t.headers=Tt.from(t.headers),t.data=Dt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),oe(t.adapter||wt.adapter)(t).then((function(e){return ie(t),e.data=Dt.call(t,t.transformResponse,e),e.headers=Tt.from(e.headers),e}),(function(e){return Lt(e)||(ie(t),e&&e.response&&(e.response.data=Dt.call(t,t.transformResponse,e.response),e.response.headers=Tt.from(e.response.headers))),Promise.reject(e)}))}const ce={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{ce[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const se={};ce.transitional=function(t,e,n){function r(t,e){return"[Axios v1.7.7] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,i)=>{if(!1===t)throw new K(r(o," has been removed"+(e?" in "+e:"")),K.ERR_DEPRECATED);return e&&!se[o]&&(se[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,o,i)}};const ue={assertOptions:function(t,e,n){if("object"!=typeof t)throw new K("options must be an object",K.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],a=e[i];if(a){const e=t[i],n=void 0===e||a(e,i,t);if(!0!==n)throw new K("option "+i+" must be "+n,K.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new K("Unknown option "+i,K.ERR_BAD_OPTION)}},validators:ce},le=ue.validators;class fe{constructor(t){this.defaults=t,this.interceptors={request:new ut,response:new ut}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Ut(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&ue.assertOptions(n,{silentJSONParsing:le.transitional(le.boolean),forcedJSONParsing:le.transitional(le.boolean),clarifyTimeoutError:le.transitional(le.boolean)},!1),null!=r&&(Z.isFunction(r)?e.paramsSerializer={serialize:r}:ue.assertOptions(r,{encode:le.function,serialize:le.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&Z.merge(o.common,o[e.method]);o&&Z.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Tt.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(c=c&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const s=[];let u;this.interceptors.response.forEach((function(t){s.push(t.fulfilled,t.rejected)}));let l,f=0;if(!c){const t=[ae.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,s),l=t.length,u=Promise.resolve(e);f<l;)u=u.then(t[f++],t[f++]);return u}l=a.length;let h=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{h=t(h)}catch(t){e.call(this,t);break}}try{u=ae.call(this,h)}catch(t){return Promise.reject(t)}for(f=0,l=s.length;f<l;)u=u.then(s[f++],s[f++]);return u}getUri(t){return st(zt((t=Ut(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}Z.forEach(["delete","get","head","options"],(function(t){fe.prototype[t]=function(e,n){return this.request(Ut(n||{},{method:t,url:e,data:(n||{}).data}))}})),Z.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,o){return this.request(Ut(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}fe.prototype[t]=e(),fe.prototype[t+"Form"]=e(!0)}));const he=fe;class pe{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new kt(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new pe((function(e){t=e})),cancel:t}}}const ye=pe,de={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(de).forEach((([t,e])=>{de[e]=t}));const me=de,ve=function t(e){const n=new he(e),o=r(he.prototype.request,n);return Z.extend(o,he.prototype,n,{allOwnKeys:!0}),Z.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return t(Ut(e,n))},o}(wt);ve.Axios=he,ve.CanceledError=kt,ve.CancelToken=ye,ve.isCancel=Lt,ve.VERSION="1.7.7",ve.toFormData=nt,ve.AxiosError=K,ve.Cancel=ve.CanceledError,ve.all=function(t){return Promise.all(t)},ve.spread=function(t){return function(e){return t.apply(null,e)}},ve.isAxiosError=function(t){return Z.isObject(t)&&!0===t.isAxiosError},ve.mergeConfig=Ut,ve.AxiosHeaders=Tt,ve.formToJSON=t=>gt(Z.isHTMLForm(t)?new FormData(t):t),ve.getAdapter=oe,ve.HttpStatusCode=me,ve.default=ve;const ge=ve;function be(t){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},be(t)}function we(){we=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==be(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=T(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function D(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(be(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Ee(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function je(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ee(i,r,o,a,c,"next",t)}function c(t){Ee(i,r,o,a,c,"throw",t)}a(void 0)}))}}function Me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Se(r.key),r)}}function Se(t){var e=function(t){if("object"!=be(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==be(e)?e:e+""}var Oe=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.client=ge.create({baseURL:e})},e=[{key:"get",value:function(){var t=je(we().mark((function t(e,n){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.get(e,{params:n});case 3:return r=t.sent,t.abrupt("return",r.data);case 7:throw t.prev=7,t.t0=t.catch(0),new Error("GET ".concat(e," failed: ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,this,[[0,7]])})));return function(e,n){return t.apply(this,arguments)}}()},{key:"post",value:(o=je(we().mark((function t(e,n){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.post(e,n);case 3:return r=t.sent,t.abrupt("return",r.data);case 7:throw t.prev=7,t.t0=t.catch(0),new Error("POST ".concat(e," failed: ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e){return o.apply(this,arguments)})},{key:"put",value:(r=je(we().mark((function t(e,n){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.put(e,n);case 3:return r=t.sent,t.abrupt("return",r.data);case 7:throw t.prev=7,t.t0=t.catch(0),new Error("PUT ".concat(e," failed: ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e){return r.apply(this,arguments)})},{key:"delete",value:(n=je(we().mark((function t(e,n){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.delete(e,{params:n});case 3:return r=t.sent,t.abrupt("return",r.data);case 7:throw t.prev=7,t.t0=t.catch(0),new Error("DELETE ".concat(e," failed: ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e){return n.apply(this,arguments)})}],e&&Me(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r,o}();const xe=Oe;function Te(t){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Te(t)}function De(){De=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Te(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=T(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function D(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Te(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Le(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Ne(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ke(r.key),r)}}function ke(t){var e=function(t){if("object"!=Te(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Te(e)?e:e+""}var _e=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.apiManager=e},e=[{key:"fetchMapStyle",value:(n=De().mark((function t(e,n,r){return De().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.apiManager.get("/map-views/v1/".concat(e,"/").concat(n,"/").concat(r,"/style"));case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),console.error("Error fetching map data:",t.t0),t.abrupt("return",null);case 10:case"end":return t.stop()}}),t,this,[[0,6]])})),r=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){Le(i,r,o,a,c,"next",t)}function c(t){Le(i,r,o,a,c,"throw",t)}a(void 0)}))},function(t,e,n){return r.apply(this,arguments)})}],e&&Ne(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r}();const Ie=_e;function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Pe(){Pe=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Ce(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=T(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function D(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Ce(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Ae(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Be(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ae(i,r,o,a,c,"next",t)}function c(t){Ae(i,r,o,a,c,"throw",t)}a(void 0)}))}}function ze(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Re(r.key),r)}}function Re(t){var e=function(t){if("object"!=Ce(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ce(e)?e:e+""}var Ue=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.apiManager=e},e=[{key:"search",value:(r=Be(Pe().mark((function t(e,n,r,o){var i;return Pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.apiManager.get("/search/v1/".concat(e,"/").concat(n,"/").concat(r),{q:o});case 3:return i=t.sent,t.abrupt("return",i);case 7:return t.prev=7,t.t0=t.catch(0),console.error("Error searching query:",t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e,n,o){return r.apply(this,arguments)})},{key:"fetchContentPlacementDetails",value:(n=Be(Pe().mark((function t(e){var n;return Pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.apiManager.get("/search/v1/details/".concat(e));case 3:return n=t.sent,t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),console.error("Error fetching content placment details:",t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t){return n.apply(this,arguments)})}],e&&ze(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r}();const Ve=Ue;function Fe(t){return Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(t)}function Qe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ye(r.key),r)}}function Ye(t){var e=function(t){if("object"!=Fe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fe(e)?e:e+""}const He=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.apiKey=null,this.apiManager=new xe("https://api.waygomaps.com"),this.mapViewApi=new Ie(this.apiManager),this.SearchApi=new Ve(this.apiManager)},(e=[{key:"setApiKey",value:function(t){this.apiKey=t}},{key:"getMapViewApi",value:function(){return this.mapViewApi}},{key:"getSearchApi",value:function(){return this.SearchApi}}])&&Qe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}());function Ge(t){return new Promise((function(e,n){var r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=function(){return e()},r.onerror=function(){return n(new Error("Failed to load script: ".concat(t)))},document.head.appendChild(r)}))}function Ze(t){return new Promise((function(e,n){var r=document.createElement("link");r.rel="stylesheet",r.href=t,r.onload=function(){return e()},r.onerror=function(){return n(new Error("Failed to load CSS: ".concat(t)))},document.head.appendChild(r)}))}function We(t){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(t)}function qe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Je(r.key),r)}}function Je(t){var e=function(t){if("object"!=We(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=We(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==We(e)?e:e+""}const Ke=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._listeners={}},e=[{key:"on",value:function(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}},{key:"off",value:function(t,e){if(!this._listeners[t])return this;var n=this._listeners[t].indexOf(e);return-1!==n&&this._listeners[t].splice(n,1),this}},{key:"fire",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._listeners[t]?(e.type=t,this._listeners[t].forEach((function(t){return t(e)})),this):this}}],e&&qe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Xe(t){return Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(t)}function $e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tn(r.key),r)}}function tn(t){var e=function(t){if("object"!=Xe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xe(e)?e:e+""}function en(t,e,n){return e=rn(e),function(t,e){if(e&&("object"==Xe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,nn()?Reflect.construct(e,n||[],rn(t).constructor):e.apply(t,n))}function nn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nn=function(){return!!t})()}function rn(t){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rn(t)}function on(t,e){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},on(t,e)}const an=new(function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),en(this,e)}return function(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&&on(t,e)}(e,t),n=e,r=[{key:"emit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fire(t,e)}}],r&&$e(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ke));function cn(t){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cn(t)}function sn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,un(r.key),r)}}function un(t){var e=function(t){if("object"!=cn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=cn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cn(e)?e:e+""}function ln(t,e,n){return e=hn(e),function(t,e){if(e&&("object"==cn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,fn()?Reflect.construct(e,n||[],hn(t).constructor):e.apply(t,n))}function fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(fn=function(){return!!t})()}function hn(t){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hn(t)}function pn(t,e){return pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pn(t,e)}const yn=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ln(this,e)).options=n,t.globalHandlers={},t.stateSubscriptions=[],t}return function(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&&pn(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){}},{key:"render",value:function(){}},{key:"destroy",value:function(){this.removeAllGlobalHandlers(),this.unsubscribeAllState()}},{key:"addGlobalHandler",value:function(t,e){this.globalHandlers[t]||(this.globalHandlers[t]=[]),this.globalHandlers[t].push(e),an.on(t,e)}},{key:"removeGlobalHandler",value:function(t,e){this.globalHandlers[t]&&(this.globalHandlers[t]=this.globalHandlers[t].filter((function(t){return t!==e})),an.off(t,e))}},{key:"removeAllGlobalHandlers",value:function(){var t=this,e=function(e){t.globalHandlers[e].forEach((function(t){return an.off(e,t)}))};for(var n in this.globalHandlers)e(n);this.globalHandlers={}}},{key:"subscribeToState",value:function(t){this.stateSubscriptions.push(t),StateStore.subscribe(t)}},{key:"unsubscribeFromState",value:function(t){this.stateSubscriptions=this.stateSubscriptions.filter((function(e){return e!==t})),StateStore.unsubscribe(t)}},{key:"unsubscribeAllState",value:function(){this.stateSubscriptions.forEach((function(t){return StateStore.unsubscribe(t)})),this.stateSubscriptions=[]}}])&&sn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ke);function dn(t){return dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(t)}function mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vn(r.key),r)}}function vn(t){var e=function(t){if("object"!=dn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dn(e)?e:e+""}const gn=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.mapView=e,this.state="default",this.stateHistory=["default"]},e=[{key:"transitionTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.state=t;var n=this.stateHistory[this.stateHistory.length-1];"default"==t?this.stateHistory=["default"]:t!==n&&this.stateHistory.push(t),console.log("STATE LENGTH PROPER",this.stateHistory.length,this.stateHistory),this.mapView.fire("state:".concat(t),e)}}],e&&mn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function bn(t){return bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bn(t)}function wn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,En(r.key),r)}}function En(t){var e=function(t){if("object"!=bn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bn(e)?e:e+""}function jn(t,e,n){return e=Sn(e),function(t,e){if(e&&("object"==bn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Mn()?Reflect.construct(e,n||[],Sn(t).constructor):e.apply(t,n))}function Mn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mn=function(){return!!t})()}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}function On(t,e){return On=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},On(t,e)}const xn=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=jn(this,e,[r])).result=t,n._initialize(),n}return function(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&&On(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="search-results-view-cell",this.render(),this._setupEventListeners()}},{key:"_setupEventListeners",value:function(){var t=this;this.element.addEventListener("click",(function(){return t.fire("click",{result:t.result})}))}},{key:"render",value:function(){this.element.innerHTML='\n <div class="result-title">'.concat(this.result.name,'</div>\n <div class="result-subtitle">').concat(this.result.contextual_location,"</div>\n ")}},{key:"getElement",value:function(){return this.element}}])&&wn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Tn(t){return Tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tn(t)}function Dn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ln(r.key),r)}}function Ln(t){var e=function(t){if("object"!=Tn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tn(e)?e:e+""}function Nn(t,e,n){return e=_n(e),function(t,e){if(e&&("object"==Tn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,kn()?Reflect.construct(e,n||[],_n(t).constructor):e.apply(t,n))}function kn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(kn=function(){return!!t})()}function _n(t){return _n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_n(t)}function In(t,e){return In=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},In(t,e)}const Cn=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Nn(this,e,[n]))._initialize(),t}return function(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&&In(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.results=[],this.element=document.createElement("div"),this.element.className="search-results-view",this.titleElement=document.createElement("h3"),this.titleElement.className="search-results-title",this.element.appendChild(this.titleElement)}},{key:"updateView",value:function(t,e){this.results=t,t.length>1&&this.setTitle("".concat(t.length," results found for '").concat(e,"'")),1===t.length&&this.setTitle("".concat(t.length," result found for '").concat(e,"'")),0===t.length&&this.setTitle("No matching results for '".concat(e,"'")),this.render()}},{key:"updateResults",value:function(t){this.results=t,this.render()}},{key:"render",value:function(){for(var t=this;this.element.children.length>1;)this.element.removeChild(this.element.lastChild);this.results.forEach((function(e){var n=new xn(e);n.on("click",(function(){return t.fire("selectCell",{result:e})})),t.element.appendChild(n.getElement())}))}},{key:"setTitle",value:function(t){this.titleElement.innerText=t}},{key:"show",value:function(){this.element.classList.add("visible")}},{key:"hide",value:function(){this.element.classList.remove("visible")}},{key:"getElement",value:function(){return this.element}}])&&Dn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Pn(t){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pn(t)}function An(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bn(r.key),r)}}function Bn(t){var e=function(t){if("object"!=Pn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pn(e)?e:e+""}const zn=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.map=null,this.currentViewType=null},(e=[{key:"onAdd",value:function(t){this.map=t}},{key:"onRemove",value:function(){this.container&&(this.container.parentNode.removeChild(this.container),this.map=void 0)}},{key:"_attachResizeListener",value:function(){var t=this;window.addEventListener("resize",(function(){var e=t.map.mapContainer.offsetWidth;t._configureView(e)}))}},{key:"_initialize",value:function(){if(this.map){var t=this.map.mapContainer.offsetWidth;this._configureView(t)}}},{key:"_configureView",value:function(t){t>767?this._setViewForDesktop():this._setViewForMobile()}},{key:"_setViewForDesktop",value:function(){this.currentViewType="desktop",this._updateContentView()}},{key:"_setViewForMobile",value:function(){this.currentViewType="mobile",this._updateContentView()}},{key:"_updateContentView",value:function(){this._clearViews(),"desktop"===this.currentViewType?this._renderDesktopView():this._renderMobileView()}},{key:"_clearViews",value:function(){for(;this.container.firstChild;)this.container.removeChild(this.container.firstChild),this.container.classList.remove("mobile-view"),this.container.classList.remove("desktop-view")}},{key:"show",value:function(){this.container&&(this.container.style.display="block")}},{key:"hide",value:function(){this.container&&(this.container.style.display="none")}},{key:"_renderDesktopView",value:function(){console.log("main control")}},{key:"_renderMobileView",value:function(){}}])&&An(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Rn(t){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rn(t)}function Un(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vn(r.key),r)}}function Vn(t){var e=function(t){if("object"!=Rn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rn(e)?e:e+""}function Fn(t,e,n){return e=Hn(e),function(t,e){if(e&&("object"==Rn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qn()?Reflect.construct(e,n||[],Hn(t).constructor):e.apply(t,n))}function Qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qn=function(){return!!t})()}function Yn(){return Yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Hn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Yn.apply(null,arguments)}function Hn(t){return Hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hn(t)}function Gn(t,e){return Gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gn(t,e)}const Zn=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Fn(this,e,[n])).searchResultsView=new Cn,t.searchedQuery=null,t.map=null,t}return function(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&&Gn(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){this.map=t,this.container=document.createElement("div"),this.container.className="search-results-control-container";var e=this.searchResultsView.getElement();return this.container.appendChild(e),this.hide(),this.initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=Yn(Hn(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"initializeEventListeners",value:function(){this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("initiate:search",this._handleInitiateSearchState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this)),this.searchResultsView.on("closeView",this._handleCloseSearchResultsView.bind(this)),this.searchResultsView.on("selectCell",this._handleSearchResultSelect.bind(this))}},{key:"_renderDesktopView",value:function(){var t=this.searchResultsView.getElement();this.container.appendChild(t),this.container.classList.remove("mobile-view"),this.container.classList.add("desktop-view"),console.log("rendering search results DESKTOP")}},{key:"_renderMobileView",value:function(){var t=this.searchResultsView.getElement();this.container.appendChild(t),this.container.classList.remove("desktop-view"),this.container.classList.add("mobile-view"),console.log("rendering search results MOBILE")}},{key:"_handleInitiateSearchState",value:function(){this.map.setToSearchState(this.searchedQuery)}},{key:"_handleSearchResultSelect",value:function(t){var e=t.result.placement_id;this.map.setToSelectedContentState([e])}},{key:"_handleCloseSearchResultsView",value:function(){this.map.setToDefaultState()}},{key:"_handleDefaultState",value:function(){this.searchedQuery=null,this.searchResultsView.updateResults([]),console.log("hiding search results"),this.hide()}},{key:"_handleSearchState",value:function(t){var e=t.query,n=t.results;this.searchedQuery=e,this.searchResultsView.updateResults([]),this.searchResultsView.updateView(n,e),this.show()}},{key:"_handleSelectedContentState",value:function(t){this.searchResultsView.updateResults([]),this.hide()}},{key:"_handleDirectionsState",value:function(t){console.log("handling directions state in search results control")}}],r&&Un(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);function Wn(t){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(t)}function qn(){qn=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Wn(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=T(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function D(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Wn(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Jn(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Kn(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Jn(i,r,o,a,c,"next",t)}function c(t){Jn(i,r,o,a,c,"throw",t)}a(void 0)}))}}function Xn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xn(Object(n),!0).forEach((function(e){tr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function tr(t,e,n){return(e=nr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function er(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nr(r.key),r)}}function nr(t){var e=function(t){if("object"!=Wn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Wn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wn(e)?e:e+""}function rr(t,e,n){return e=ir(e),function(t,e){if(e&&("object"==Wn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,or()?Reflect.construct(e,n||[],ir(t).constructor):e.apply(t,n))}function or(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(or=function(){return!!t})()}function ir(t){return ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ir(t)}function ar(t,e){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ar(t,e)}var cr={"c66d7e2c3ebd4a8fa60efa5bf3b5b301:2d4911eda2ef4950b307e51cd0ccf35e":{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"],path:[[-81.55730801074388,-195.68687504906683],[-66.79352848318483,-195.68687504906688],[-66.79352848318483,-136.30367294932935],[-6.7541584044446665,-136.30367294932955],[-6.7541584044446195,-106.92078820451393],[81.82851876090972,-106.92078820451393],[81.82851876090972,-47.20950211527508],[140.88363687114594,-47.20950211527508]]}},sr={container:"map",sourceId:"collision-conference.2024.2xw_YUXYS8GoDTB2AQgN3A",center:[0,0],zoom:12,bearing:0,pitch:0,minPitch:0,maxPitch:75,minZoom:0,maxZoom:22,bounds:null,doubleClickZoom:!0,dragPan:!0,dragRotate:!0,scrollZoom:!0,touchPitch:!0,touchZoomRotate:!0,interactive:!0,trackResize:!0,keyboard:!0},ur=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=rr(this,e,[$n($n({},sr),n)])).mapViewApi=He.getMapViewApi(),t.searchApi=He.getSearchApi(),t.mapContainer=document.createElement("div"),t.mapContainer.className="inner-map-container",t.ready=t._initialize(n),t._stateCoordinator=new gn(t),t}return function(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&&ar(t,e)}(e,t),n=e,r=[{key:"_initialize",value:(f=Kn(qn().mark((function t(){var e,n=this;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Initializing map view component.."),t.prev=1,t.next=4,this._loadMapLibraries();case 4:return this.render(),t.next=7,this._fetchMapStyle();case 7:e=t.sent,"undefined"!=typeof mapboxgl&&e?(mapboxgl.accessToken="pk.eyJ1Ijoid2F5Z28tbWFwcyIsImEiOiJjbGtxYzZ1N3QxdG43M210bXFuYmJ4a3gxIn0.tlbznj_fRJ8La6s2UUMO6A",this.map=new mapboxgl.Map({container:this.mapContainer,style:"mapbox://styles/waygo-maps/".concat(e),center:this.options.center,zoom:this.options.zoom,bearing:this.options.bearing,pitch:this.options.pitch,minPitch:this.options.minPitch,maxPitch:this.options.maxPitch,minZoom:this.options.minZoom,maxZoom:this.options.maxZoom,bounds:this.options.bounds,doubleClickZoom:this.options.doubleClickZoom,dragPan:this.options.dragPan,dragRotate:this.options.dragRotate,scrollZoom:this.options.scrollZoom,touchPitch:this.options.touchPitch,touchZoomRotate:this.options.touchZoomRotate,interactive:this.options.interactive,trackResize:this.options.trackResize,keyboard:this.options.keyboard}),this.map.on("load",(function(){return n.fire("load")})),this._initializeEventListeners()):console.error("Mapbox GL JS is not loaded."),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),console.error("Failed to initialize the map:",t.t0);case 14:case"end":return t.stop()}}),t,this,[[1,11]])}))),function(){return f.apply(this,arguments)})},{key:"_initializeEventListeners",value:function(){var t=this;this.mapContainer.addEventListener("mousedown",(function(e){return t.fire("mousedown",{originalEvent:e})})),this.mapContainer.addEventListener("click",(function(e){return t.fire("click",{originalEvent:e})})),this.mapContainer.addEventListener("mouseover",(function(e){return t.fire("mouseover",{originalEvent:e})})),this.mapContainer.addEventListener("mousemove",(function(e){return t.fire("mousemove",{originalEvent:e})})),this.mapContainer.addEventListener("dblclick",(function(e){return t.fire("dblclick",{originalEvent:e})})),this.mapContainer.addEventListener("mouseout",(function(e){return t.fire("mouseout",{originalEvent:e})})),this.mapContainer.addEventListener("contextmenu",(function(e){return t.fire("contextmenu",{originalEvent:e})})),this.mapContainer.addEventListener("wheel",(function(e){return t.fire("wheel",{originalEvent:e})})),this.mapContainer.addEventListener("touchstart",(function(e){return t.fire("touchstart",{originalEvent:e})})),this.mapContainer.addEventListener("touchend",(function(e){return t.fire("touchend",{originalEvent:e})})),this.mapContainer.addEventListener("touchmove",(function(e){return t.fire("touchmove",{originalEvent:e})})),this.mapContainer.addEventListener("touchcancel",(function(e){return t.fire("touchcancel",{originalEvent:e})})),this.mapContainer.addEventListener("move",(function(e){return t.fire("move",{originalEvent:e})})),["movestart","move","moveend","dragstart","drag","dragend","zoomstart","zoom","zoomend","rotatestart","rotate","rotateend","pitchstart","pitch","pitchend","boxzoomstart","boxzoomend","boxzoomcancel"].forEach((function(e){t.map.on(e,(function(n){t.fire(e,{originalEvent:n})}))}))}},{key:"_fetchMapStyle",value:(l=Kn(qn().mark((function t(){var e,n,r,o,i;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(3===(e=this.options.sourceId.split(".")).length){t.next=4;break}return console.error('The mapViewId format is incorrect. It should be in the format "businessId.mapId.mapViewId".'),t.abrupt("return");case 4:return n=e[0]||"",r=e[1]||"",o=e[2]||"",t.prev=7,t.next=10,this.mapViewApi.fetchMapStyle(n,r,o);case 10:return i=t.sent,console.log("Fetched map style:",i.style_id),t.abrupt("return",i.style_id);case 15:t.prev=15,t.t0=t.catch(7),console.error("Error fetching map style:",t.t0);case 18:case"end":return t.stop()}}),t,this,[[7,15]])}))),function(){return l.apply(this,arguments)})},{key:"_loadMapLibraries",value:(u=Kn(qn().mark((function t(){return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Loading map libraries"),t.next=3,Ze("https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css");case 3:return t.next=5,Ge("https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js");case 5:console.log("Map libraries loaded");case 6:case"end":return t.stop()}}),t)}))),function(){return u.apply(this,arguments)})},{key:"render",value:function(){var t=document.getElementById(this.options.container);t?(t.appendChild(this.mapContainer),this.mapContainer.style.width="100%",this.mapContainer.style.height="100%",this.mapContainer.style.position="relative"):console.error('Container element with id "'.concat(this.containerId,'" not found.'))}},{key:"addControl",value:function(t){var e=t.onAdd(this);this.mapContainer.appendChild(e)}},{key:"removeControl",value:function(t){this.map.removeControl(t)}},{key:"setToDefaultState",value:function(){this._stateCoordinator.transitionTo("default")}},{key:"setToSearchState",value:(s=Kn(qn().mark((function t(e){var n;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.search(e);case 2:n=t.sent,this._stateCoordinator.transitionTo("search",{query:e,results:n});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"setToSelectedContentState",value:(c=Kn(qn().mark((function t(e){var n,r;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e[e.length-1],t.next=3,this.getContentPlacementDetails(n);case 3:r=t.sent,this._stateCoordinator.transitionTo("selectedContent",{contentPlacementIds:e,selectedContentPlacement:r});case 5:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"setToDirectionsState",value:(a=Kn(qn().mark((function t(){var e,n,r,o,i=arguments;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:null,r=null,!(e=i.length>0&&void 0!==i[0]?i[0]:null)){t.next=7;break}return t.next=6,this.getContentPlacementDetails(e);case 6:r=t.sent;case 7:if(o=null,!n){t.next=12;break}return t.next=11,this.getContentPlacementDetails(n);case 11:o=t.sent;case 12:this._stateCoordinator.transitionTo("directions",{startContentPlacement:r,endContentPlacement:o});case 13:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"initiateBack",value:function(){this.fire("initiate:back")}},{key:"initiateSetToSearchState",value:function(){this.fire("initiate:search")}},{key:"findPath",value:function(t,e){console.log("finding path",t,e);var n=cr["".concat(t,":").concat(e)];console.log("DATA",n);var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;null===e&&(e=[0,0]),console.log("CHECK1",e);var r=[],o=function(t){console.log("CHECK3");var e=t*Math.PI/180,n=6378137,r=6356752.314;console.log("CHECK4",e,n,r);var o=(Math.pow(n,.5)-Math.pow(r,.5))/Math.pow(n,.5);console.log("CHECK5",o);var i=1/(111132.954-559.822*Math.cos(2*e)+1.175*Math.cos(4*e));console.log("CHECK6",i);var a=1/(Math.PI*n*Math.cos(e)/(180*Math.pow(1-Math.pow(o,2)*Math.pow(Math.sin(e),2),.5)));return console.log("CHECK7",a),{meterToLat:i,meterToLon:a}}(e[1]),i=o.meterToLat,a=o.meterToLon;return console.log("CHECK2",i,a),t.forEach((function(t){var o=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=t[0],a=t[1],c=e[0];return{lat:e[1]+a*o*n,lon:c+i*o*r}}(t,e,i,a,n),c=o.lat,s=o.lon;r.push([s,c])})),r}(n.path,null,10);return console.log("COORDINATES:",r),{coordinates:r,steps:n.steps}}},{key:"_findFeatureByPlacementId",value:function(t){var e=this.map.queryRenderedFeatures({filter:["==",["get","placement_id"],t]});return e.length>0?e[0]:null}},{key:"getCenter",value:function(){if(this.map)return this.map.getCenter();console.error("Map is not initialized.")}},{key:"setCenter",value:function(t){this.map?this.map.setCenter(t):console.error("Map is not initialized.")}},{key:"search",value:(i=Kn(qn().mark((function t(e){return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""!==e){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,this.searchApi.search("e9df990cbd084934973a87fc2f3b0e74","move-america-2024","FTdsy9btTs6qumoZ6E8Z2Q",e);case 5:return t.abrupt("return",t.sent);case 8:t.prev=8,t.t0=t.catch(2),axios.isCancel(t.t0)?console.log("Request canceled:",t.t0.message):console.error("Search error:",t.t0);case 11:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return i.apply(this,arguments)})},{key:"getContentPlacementDetails",value:(o=Kn(qn().mark((function t(e){return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.searchApi.fetchContentPlacementDetails(e);case 3:return t.abrupt("return",t.sent);case 6:t.prev=6,t.t0=t.catch(0),axios.isCancel(t.t0)?console.log("Request canceled:",t.t0.message):console.error("Fetching content placement details error:",t.t0);case 9:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(t){return o.apply(this,arguments)})}],r&&er(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i,a,c,s,u,l,f}(yn);function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function fr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hr(r.key),r)}}function hr(t){var e=function(t){if("object"!=lr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lr(e)?e:e+""}function pr(t,e,n){return e=dr(e),function(t,e){if(e&&("object"==lr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yr()?Reflect.construct(e,n||[],dr(t).constructor):e.apply(t,n))}function yr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yr=function(){return!!t})()}function dr(t){return dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dr(t)}function mr(t,e){return mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mr(t,e)}const vr=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=pr(this,e,[n]))._initialize(),t}return function(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&&mr(t,e)}(e,t),n=e,r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="search-bar-container",this.input=document.createElement("input"),this.input.type="text",this.input.placeholder="Search MOVE America 2024",this.input.className="search-bar",this.rightButton=document.createElement("button"),this.rightButton.className="search-bar-button-right",this.updateRightButtonIcon("search"),this.leftButton=document.createElement("button"),this.leftButton.className="search-bar-button-left",this.updateLeftButtonIcon("none"),this.element.appendChild(this.leftButton),this.element.appendChild(this.input),this.element.appendChild(this.rightButton),this._setupEventListeners()}},{key:"_setupEventListeners",value:function(){var t=this;this.input.addEventListener("input",(function(e){return t._handleInput(e)})),this.input.addEventListener("focus",this._handleFocus.bind(this)),this.input.addEventListener("blur",this._handleBlur.bind(this)),this.input.addEventListener("keydown",(function(e){"Enter"===e.key&&t._handleEnterSelect(e)})),this.rightButton.addEventListener("click",(function(e){return t._handleRightButtonSelect(e)})),this.leftButton.addEventListener("click",(function(e){return t._handleLeftButtonSelect(e)}))}},{key:"_handleInput",value:function(t){this.fire("input",{event:t,query:this.getText()})}},{key:"_handleFocus",value:function(){this.fire("focus")}},{key:"_handleBlur",value:function(){var t=this;setTimeout((function(){var e=document.activeElement;e===t.rightButton?(t.updateStyleWithoutSuggestions(),t.fire("blur")):e===t.input||(t.updateStyleWithoutSuggestions(),t.fire("blur"))}),150)}},{key:"_handleEnterSelect",value:function(t){var e=this.getText();e.length>0&&(this.fire("search",{query:e,event:t}),this.input.blur())}},{key:"_handleRightButtonSelect",value:function(t){if("search"===this.rightButtonState){var e=this.getText();e.length>0&&(this.fire("search",{query:e,event:t}),this.input.blur())}else"cancel"===this.rightButtonState&&this.fire("cancel",{event:t})}},{key:"_handleLeftButtonSelect",value:function(t){"logo"===this.leftButtonState?this.input.focus():"back"===this.leftButtonState&&this.fire("back")}},{key:"updateStyleWithSuggestions",value:function(){this.element.classList.add("with-results")}},{key:"updateStyleWithoutSuggestions",value:function(){this.element.classList.remove("with-results")}},{key:"updateRightButtonIcon",value:function(t){this.rightButtonState=t,"search"===t?(this.rightButton.innerHTML='<img src="'.concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIgc3Ryb2tlPSIjMTcxNzE3IiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTIwIDIwTDE3IDE3IiBzdHJva2U9IiMxNzE3MTciIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPgo=",'" alt="Search" />'),this.rightButton.style.display="flex"):"cancel"===t?(this.rightButton.innerHTML='<img src="'.concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE4IDZMNiAxOCIgc3Ryb2tlPSIjMTcxNzE3IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNNiA2TDE4IDE4IiBzdHJva2U9IiMxNzE3MTciIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=",'" alt="Cancel" />'),this.rightButton.style.display="flex"):"none"===t&&(this.rightButton.style.display="none")}},{key:"updateLeftButtonIcon",value:function(t){if(this.leftButtonState=t,"logo"===t){this.leftButton.innerHTML='<img src="'.concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQ5IiBoZWlnaHQ9IjExNyIgdmlld0JveD0iMCAwIDE0OSAxMTciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0yMC41IDk2LjgwOVY1Mi42ODIxTDYwLjE5NzIgMjYuMTI5NEM2OS45MzMyIDIwLjg1OTIgNzMuMzM3MiAyMC4yNTM5IDc1LjIwMjEgMjAuMjU1MUM3Ny4wMzg2IDIwLjI1NjQgODAuMzU4MSAyMC44NDU0IDg5LjkwMzEgMjYuMDUyOEwxMDEuNSAzNC4wMDg2VjkuNzU1MTJMMTAyLjA5OCAxMC4xNjVMMTAwLjQgOC45OTk5OUM3OS4zMzc2IC0yLjYzOTk3IDcxLjE1OTUgLTIuNjc5NjYgNDkuODMzMyA4Ljk5OTk5TDkuMzgwNTIgMzYuMDU4MkMzLjgzMTI2IDM5Ljc3IDAuNSA0Ni4wMDU5IDAuNSA1Mi42ODIxVjk2LjgwOUMwLjUgMTEwLjY1OCAxNC4yMzU4IDEyMC4zMTYgMjcuMjY3OSAxMTUuNjI5TDY3LjczMiAxMDEuMDc4QzcyLjEwNjkgOTkuNTA0MyA3Ni44OTMxIDk5LjUwNDMgODEuMjY4IDEwMS4wNzhMMTIxLjczMiAxMTUuNjI5QzEzNC43NjQgMTIwLjMxNiAxNDguNSAxMTAuNjU4IDE0OC41IDk2LjgwOVY1Mi41MzE1QzE0OC41IDQ1LjkzODUgMTQ1LjI1MSAzOS43NjkxIDEzOS44MTQgMzYuMDM5NEwxMjguNSAyOC4yNzc1Vjk2LjgwOUw4OC4wMzU5IDgyLjI1NzVDNzkuMjg2MiA3OS4xMTEgNjkuNzEzOCA3OS4xMTEgNjAuOTY0MSA4Mi4yNTc1TDIwLjUgOTYuODA5WiIgZmlsbD0iIzFFMUUxRSIvPgo8L3N2Zz4K",'" alt="').concat(t,'" />');var e=this.leftButton.querySelector("img");e.style.width="16px",e.style.height="16px",this.leftButton.style.display="flex"}else if("back"===t){this.leftButton.innerHTML='<img src="'.concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTguNDYwMDIgMTEuMjg5NUwxNC4xMiA1LjYzOTU1QzE0LjIxMyA1LjU0NTgyIDE0LjMyMzYgNS40NzE0MyAxNC40NDU0IDUuNDIwNjZDMTQuNTY3MyA1LjM2OTg5IDE0LjY5OCA1LjM0Mzc1IDE0LjgzIDUuMzQzNzVDMTQuOTYyIDUuMzQzNzUgMTUuMDkyNyA1LjM2OTg5IDE1LjIxNDYgNS40MjA2NkMxNS4zMzY1IDUuNDcxNDMgMTUuNDQ3MSA1LjU0NTgyIDE1LjU0IDUuNjM5NTVDMTUuNzI2MyA1LjgyNjkxIDE1LjgzMDggNi4wODAzNiAxNS44MzA4IDYuMzQ0NTVDMTUuODMwOCA2LjYwODczIDE1LjcyNjMgNi44NjIxOSAxNS41NCA3LjA0OTU1TDEwLjU5IDEyLjA0OTVMMTUuNTQgMTYuOTk5NUMxNS43MjYzIDE3LjE4NjkgMTUuODMwOCAxNy40NDA0IDE1LjgzMDggMTcuNzA0NUMxNS44MzA4IDE3Ljk2ODcgMTUuNzI2MyAxOC4yMjIyIDE1LjU0IDE4LjQwOTVDMTUuNDQ3NCAxOC41MDQgMTUuMzM3IDE4LjU3OTIgMTUuMjE1MSAxOC42MzA3QzE1LjA5MzIgMTguNjgyMiAxNC45NjIzIDE4LjcwOSAxNC44MyAxOC43MDk1QzE0LjY5NzcgMTguNzA5IDE0LjU2NjggMTguNjgyMiAxNC40NDUgMTguNjMwN0MxNC4zMjMxIDE4LjU3OTIgMTQuMjEyNiAxOC41MDQgMTQuMTIgMTguNDA5NUw4LjQ2MDAyIDEyLjc1OTVDOC4zNTg1MSAxMi42NjU5IDguMjc3NSAxMi41NTIzIDguMjIyMSAxMi40MjU4QzguMTY2NjkgMTIuMjk5MyA4LjEzODA5IDEyLjE2MjYgOC4xMzgwOSAxMi4wMjQ1QzguMTM4MDkgMTEuODg2NCA4LjE2NjY5IDExLjc0OTggOC4yMjIxIDExLjYyMzNDOC4yNzc1IDExLjQ5NjggOC4zNTg1MSAxMS4zODMyIDguNDYwMDIgMTEuMjg5NVYxMS4yODk1WiIgZmlsbD0iIzFFMUUxRSIvPgo8L3N2Zz4K",'" alt="').concat(t,'" />');var n=this.leftButton.querySelector("img");n.style.width="20px",n.style.height="20px",this.leftButton.style.display="flex"}else"none"===t&&(this.leftButton.style.display="none")}},{key:"getText",value:function(){return this.input.value}},{key:"setText",value:function(t){this.input.value=t}},{key:"setPlaceholderText",value:function(t){this.input.placeholder=t}},{key:"getElement",value:function(){return this.element}},{key:"setViewForDesktop",value:function(){this.element.classList.remove("mobile-view"),this.input.classList.remove("mobile-view")}},{key:"setViewForMobile",value:function(){this.element.classList.add("mobile-view"),this.input.classList.add("mobile-view")}}],r&&fr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function gr(t){return gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gr(t)}function br(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wr(r.key),r)}}function wr(t){var e=function(t){if("object"!=gr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gr(e)?e:e+""}function Er(t,e,n){return e=Mr(e),function(t,e){if(e&&("object"==gr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,jr()?Reflect.construct(e,n||[],Mr(t).constructor):e.apply(t,n))}function jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jr=function(){return!!t})()}function Mr(t){return Mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mr(t)}function Sr(t,e){return Sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sr(t,e)}const Or=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Er(this,e,[r])).result=t,n._initialize(),n}return function(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&&Sr(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="search-bar-suggestions-view-cell",this.render(),this._setupEventListeners()}},{key:"_setupEventListeners",value:function(){var t=this;this.element.addEventListener("click",(function(){return t.fire("click",{result:t.result})}))}},{key:"render",value:function(){this.element.innerHTML='\n <div class="suggestion-title">'.concat(this.result.name,'</div>\n <div class="suggestion-subtitle">').concat(this.result.contextual_location,"</div>\n ")}},{key:"getElement",value:function(){return this.element}}])&&br(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function xr(t){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xr(t)}function Tr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dr(r.key),r)}}function Dr(t){var e=function(t){if("object"!=xr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xr(e)?e:e+""}function Lr(t,e,n){return e=kr(e),function(t,e){if(e&&("object"==xr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Nr()?Reflect.construct(e,n||[],kr(t).constructor):e.apply(t,n))}function Nr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nr=function(){return!!t})()}function kr(t){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kr(t)}function _r(t,e){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_r(t,e)}const Ir=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Lr(this,e,[n]))._initialize(),t}return function(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&&_r(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.results=[],this.element=document.createElement("div"),this.element.className="search-bar-suggestions-view"}},{key:"updateResults",value:function(t){this.results=t,this.render()}},{key:"render",value:function(){var t=this;this.element.innerHTML="",this.results.forEach((function(e){var n=new Or(e);n.on("click",(function(){return t.fire("selectCell",{result:e})})),t.element.appendChild(n.getElement())}))}},{key:"clearResults",value:function(){this.updateResults([])}},{key:"show",value:function(){this.element.classList.add("visible")}},{key:"hide",value:function(){this.element.classList.remove("visible")}},{key:"getElement",value:function(){return this.element}},{key:"setViewForDesktop",value:function(){console.log("HERE")}},{key:"setViewForMobile",value:function(){console.log("HERE")}}])&&Tr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Cr(t){return Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(t)}function Pr(){Pr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Cr(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=T(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function D(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Cr(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Ar(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Br(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ar(i,r,o,a,c,"next",t)}function c(t){Ar(i,r,o,a,c,"throw",t)}a(void 0)}))}}function zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rr(r.key),r)}}function Rr(t){var e=function(t){if("object"!=Cr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cr(e)?e:e+""}function Ur(t,e,n){return e=Fr(e),function(t,e){if(e&&("object"==Cr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vr()?Reflect.construct(e,n||[],Fr(t).constructor):e.apply(t,n))}function Vr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Vr=function(){return!!t})()}function Fr(t){return Fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fr(t)}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}const Yr=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Ur(this,e,[n])).searchApi=He.getSearchApi(),t.element=document.createElement("div"),t.element.className="search-box",t.searchBar=new vr,t.searchBarSuggestionsView=new Ir,t.searchCount=0,t.initializeHandlers(),t._render(),t}return function(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&&Qr(t,e)}(e,t),n=e,r=[{key:"initializeHandlers",value:function(){this.searchBar.on("input",this._handleSearchBarInput.bind(this)),this.searchBar.on("focus",this._handleSearchBarFocus.bind(this)),this.searchBar.on("blur",this._handleSearchBarBlur.bind(this)),this.searchBar.on("search",this._handleSearchBarSearch.bind(this)),this.searchBar.on("back",this._handleSearchBarBack.bind(this)),this.searchBarSuggestionsView.on("selectCell",this._handleSearchResultSelect.bind(this))}},{key:"_handleSearchBarBack",value:function(){this.fire("selectBack")}},{key:"_handleSearchBarSearch",value:function(t){var e=t.query;t.event,console.log("Handling search",e),this.fire("search",{query:e})}},{key:"_handleSearchResultSelect",value:function(t){t.result}},{key:"_handleSearchBarFocus",value:(a=Br(Pr().mark((function t(){var e;return Pr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!((e=this.searchBar.getText()).length>0)){t.next=5;break}return t.next=4,this.getSearchBarSuggestions(e);case 4:this.openSuggestionsView();case 5:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"_handleSearchBarBlur",value:function(){this.searchBarSuggestionsView.hide()}},{key:"_handleSearchBarInput",value:(i=Br(Pr().mark((function t(e){var n;return Pr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.query,this.openSuggestionsView(),t.next=4,this.getSearchBarSuggestions(n);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"_render",value:function(){this.element.appendChild(this.searchBar.getElement()),this.element.appendChild(this.searchBarSuggestionsView.getElement())}},{key:"setViewForDesktop",value:function(){console.log("Setting view for desktop"),this.searchBar.setViewForDesktop(),this.searchBarSuggestionsView.setViewForDesktop()}},{key:"setViewForMobile",value:function(){console.log("Setting view for mobile"),this.searchBar.setViewForMobile(),this.searchBarSuggestionsView.setViewForMobile()}},{key:"getElement",value:function(){return this.element}},{key:"openSuggestionsView",value:function(){this.searchBarSuggestionsView.show(),this.searchBar.updateStyleWithSuggestions()}},{key:"closeSuggestionsView",value:function(){this.searchBarSuggestionsView.hide(),this.searchBar.updateStyleWithoutSuggestions()}},{key:"getSearchBarSuggestions",value:(o=Br(Pr().mark((function t(e){var n,r;return Pr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=++this.searchCount,""!==e){t.next=5;break}return this.searchBarSuggestionsView.updateResults([]),this.closeSuggestionsView(),t.abrupt("return");case 5:return t.prev=5,t.next=8,this.searchApi.search("e9df990cbd084934973a87fc2f3b0e74","move-america-2024","FTdsy9btTs6qumoZ6E8Z2Q",e);case 8:r=t.sent,n===this.searchCount&&this.searchBarSuggestionsView.updateResults(r),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),ge.isCancel(t.t0)?console.log("Request canceled:",t.t0.message):console.error("Search error:",t.t0);case 15:case"end":return t.stop()}}),t,this,[[5,12]])}))),function(t){return o.apply(this,arguments)})}],r&&zr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i,a}(yn);function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function Gr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zr(r.key),r)}}function Zr(t){var e=function(t){if("object"!=Hr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hr(e)?e:e+""}function Wr(t,e,n){return e=Kr(e),function(t,e){if(e&&("object"==Hr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qr()?Reflect.construct(e,n||[],Kr(t).constructor):e.apply(t,n))}function qr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qr=function(){return!!t})()}function Jr(){return Jr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Kr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Jr.apply(null,arguments)}function Kr(t){return Kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kr(t)}function Xr(t,e){return Xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xr(t,e)}const $r=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Wr(this,e,[n])).searchBox=new Yr,t}return function(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&&Xr(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){this.map=t,this.container=document.createElement("div"),this.container.className="search-box-control-container";var e=this.searchBox.getElement();return this.container.appendChild(e),this._initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.show(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=Jr(Kr(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"_initializeEventListeners",value:function(){this.searchBox.searchBarSuggestionsView.on("selectCell",this._handleSuggestionSelect.bind(this)),this.searchBox.searchBar.on("cancel",this._handleSearchBarCancel.bind(this)),this.searchBox.on("search",this._handleSearchBoxSearch.bind(this)),this.searchBox.on("selectBack",this._handleSearchBoxSelectBack.bind(this)),this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this))}},{key:"_renderDesktopView",value:function(){var t=this.searchBox.getElement();this.container.appendChild(t),this.container.classList.add("desktop-view"),this.container.classList.remove("mobile-view"),t&&this.searchBox.setViewForDesktop()}},{key:"_renderMobileView",value:function(){var t=this.searchBox.getElement();this.container.appendChild(t),this.container.classList.add("mobile-view"),this.container.classList.remove("desktop-view"),t&&this.searchBox.setViewForMobile()}},{key:"_handleSearchBoxSelectBack",value:function(){this.map.initiateBack()}},{key:"_handleSearchBarCancel",value:function(t){this.map.setToDefaultState()}},{key:"_handleSearchBoxSearch",value:function(t){var e=t.query;this.map.setToSearchState(e)}},{key:"_handleSuggestionSelect",value:function(t){var e=t.result;this.map.setToSelectedContentState([e.placement_id])}},{key:"_handleDefaultState",value:function(){this.searchBox.searchBarSuggestionsView.clearResults(),this.searchBox.closeSuggestionsView(),this.searchBox.searchBar.setText(""),this.searchBox.searchBar.updateRightButtonIcon("search"),this.searchBox.searchBar.updateLeftButtonIcon("none"),this.show()}},{key:"_handleSearchState",value:function(t){var e=t.query,n=t.results;console.log("SEARC",e,n),this.searchBox.searchBar.setText(e),this.searchBox.searchBar.updateRightButtonIcon("cancel"),this.searchBox.searchBar.updateLeftButtonIcon("none"),this.show()}},{key:"_handleSelectedContentState",value:function(t){var e=t.contentPlacementIds,n=t.selectedContentPlacement;this.show();var r=n.content.title_key,o=n.content.data[r];this.searchBox.searchBar.setText(o),this.searchBox.searchBar.updateRightButtonIcon("cancel"),this.map._stateCoordinator.stateHistory.length>2||e.length>1?this.searchBox.searchBar.updateLeftButtonIcon("back"):this.searchBox.searchBar.updateLeftButtonIcon("none")}},{key:"_handleDirectionsState",value:function(t){console.log("handling directions state in search box control"),this.map._stateCoordinator.stateHistory.length>2?this.searchBox.searchBar.updateLeftButtonIcon("back"):this.searchBox.searchBar.updateLeftButtonIcon("none")}}],r&&Gr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);function to(t){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},to(t)}function eo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,no(r.key),r)}}function no(t){var e=function(t){if("object"!=to(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=to(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==to(e)?e:e+""}function ro(t,e,n){return e=io(e),function(t,e){if(e&&("object"==to(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,oo()?Reflect.construct(e,n||[],io(t).constructor):e.apply(t,n))}function oo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(oo=function(){return!!t})()}function io(t){return io=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},io(t)}function ao(t,e){return ao=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ao(t,e)}const co=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ro(this,e,[r])).items=n,t.containerClass=r.container,t.element=document.createElement("div"),t.element.className="slider-bar-container ".concat(t.containerClass),t.sliderBar=document.createElement("div"),t.sliderBar.className="slider-bar ".concat(t.containerClass,"-bar"),t.leftButton=document.createElement("button"),t.leftButton.className="scroll-button left ".concat(t.containerClass,"-scroll-button"),t.leftButton.style.backgroundImage="url(".concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTExLjI4OTkgMTEuOTk5N0wxNC44Mjk5IDguNDU5N0MxNS4wMTYyIDguMjcyMzQgMTUuMTIwNyA4LjAxODg5IDE1LjEyMDcgNy43NTQ3QzE1LjEyMDcgNy40OTA1MiAxNS4wMTYyIDcuMjM3MDcgMTQuODI5OSA3LjA0OTdDMTQuNzM3IDYuOTU1OTggMTQuNjI2NCA2Ljg4MTU4IDE0LjUwNDUgNi44MzA4MUMxNC4zODI3IDYuNzgwMDQgMTQuMjUyIDYuNzUzOTEgMTQuMTE5OSA2Ljc1MzkxQzEzLjk4NzkgNi43NTM5MSAxMy44NTcyIDYuNzgwMDQgMTMuNzM1NCA2LjgzMDgxQzEzLjYxMzUgNi44ODE1OCAxMy41MDI5IDYuOTU1OTggMTMuNDA5OSA3LjA0OTdMOS4xNjk5NCAxMS4yODk3QzkuMDc2MjIgMTEuMzgyNyA5LjAwMTgyIDExLjQ5MzMgOC45NTEwNSAxMS42MTUxQzguOTAwMjggMTEuNzM3IDguODc0MTUgMTEuODY3NyA4Ljg3NDE1IDExLjk5OTdDOC44NzQxNSAxMi4xMzE3IDguOTAwMjggMTIuMjYyNCA4Ljk1MTA1IDEyLjM4NDNDOS4wMDE4MiAxMi41MDYxIDkuMDc2MjIgMTIuNjE2NyA5LjE2OTk0IDEyLjcwOTdMMTMuNDA5OSAxNi45OTk3QzEzLjUwMzQgMTcuMDkyNCAxMy42MTQyIDE3LjE2NTcgMTMuNzM2IDE3LjIxNTVDMTMuODU3OSAxNy4yNjUyIDEzLjk4ODMgMTcuMjkwNSAxNC4xMTk5IDE3LjI4OTdDMTQuMjUxNiAxNy4yOTA1IDE0LjM4MiAxNy4yNjUyIDE0LjUwMzggMTcuMjE1NUMxNC42MjU3IDE3LjE2NTcgMTQuNzM2NSAxNy4wOTI0IDE0LjgyOTkgMTYuOTk5N0MxNS4wMTYyIDE2LjgxMjMgMTUuMTIwNyAxNi41NTg5IDE1LjEyMDcgMTYuMjk0N0MxNS4xMjA3IDE2LjAzMDUgMTUuMDE2MiAxNS43NzcxIDE0LjgyOTkgMTUuNTg5N0wxMS4yODk5IDExLjk5OTdaIiBmaWxsPSIjMTcxNzE3Ii8+Cjwvc3ZnPgo=",")"),t.leftButton.addEventListener("click",(function(){return t._scrollSliderBar("left")})),t.rightButton=document.createElement("button"),t.rightButton.className="scroll-button right ".concat(t.containerClass,"-scroll-button"),t.rightButton.style.backgroundImage="url(".concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0LjgyOTkgMTEuMjg5N0wxMC41ODk5IDcuMDQ5N0MxMC40OTcgNi45NTU5OCAxMC4zODY0IDYuODgxNTggMTAuMjY0NSA2LjgzMDgxQzEwLjE0MjcgNi43ODAwNCAxMC4wMTIgNi43NTM5MSA5Ljg3OTk0IDYuNzUzOTFDOS43NDc5MyA2Ljc1MzkxIDkuNjE3MjMgNi43ODAwNCA5LjQ5NTM3IDYuODMwODFDOS4zNzM1MSA2Ljg4MTU4IDkuMjYyOTEgNi45NTU5OCA5LjE2OTk0IDcuMDQ5N0M4Ljk4MzY5IDcuMjM3MDcgOC44NzkxNSA3LjQ5MDUyIDguODc5MTUgNy43NTQ3QzguODc5MTUgOC4wMTg4OSA4Ljk4MzY5IDguMjcyMzQgOS4xNjk5NCA4LjQ1OTdMMTIuNzA5OSAxMS45OTk3TDkuMTY5OTQgMTUuNTM5N0M4Ljk4MzY5IDE1LjcyNzEgOC44NzkxNSAxNS45ODA1IDguODc5MTUgMTYuMjQ0N0M4Ljg3OTE1IDE2LjUwODkgOC45ODM2OSAxNi43NjIzIDkuMTY5OTQgMTYuOTQ5N0M5LjI2MzM4IDE3LjA0MjQgOS4zNzQyIDE3LjExNTcgOS40OTYwNCAxNy4xNjU1QzkuNjE3ODcgMTcuMjE1MiA5Ljc0ODM0IDE3LjI0MDUgOS44Nzk5NCAxNy4yMzk3QzEwLjAxMTUgMTcuMjQwNSAxMC4xNDIgMTcuMjE1MiAxMC4yNjM4IDE3LjE2NTVDMTAuMzg1NyAxNy4xMTU3IDEwLjQ5NjUgMTcuMDQyNCAxMC41ODk5IDE2Ljk0OTdMMTQuODI5OSAxMi43MDk3QzE0LjkyMzcgMTIuNjE2NyAxNC45OTgxIDEyLjUwNjEgMTUuMDQ4OCAxMi4zODQzQzE1LjA5OTYgMTIuMjYyNCAxNS4xMjU3IDEyLjEzMTcgMTUuMTI1NyAxMS45OTk3QzE1LjEyNTcgMTEuODY3NyAxNS4wOTk2IDExLjczNyAxNS4wNDg4IDExLjYxNTFDMTQuOTk4MSAxMS40OTMzIDE0LjkyMzcgMTEuMzgyNyAxNC44Mjk5IDExLjI4OTdaIiBmaWxsPSIjMTcxNzE3Ii8+Cjwvc3ZnPgo=",")"),t.rightButton.addEventListener("click",(function(){return t._scrollSliderBar("right")})),t.buttonElements=[],t._render(),t.sliderBar.addEventListener("scroll",(function(){return t._updateScrollButtons()})),setTimeout((function(){return t._updateScrollButtons()}),.8),t}return function(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&&ao(t,e)}(e,t),n=e,r=[{key:"_render",value:function(){var t=this;this.items.forEach((function(e){var n=e.title,r=e.imageUrl,o=document.createElement("button");if(o.addEventListener("click",t._handleSliderButtonSelect.bind(t)),o.className="slider-bar-button ".concat(t.containerClass,"-button"),r){var i=document.createElement("img");i.src=r,i.alt=n,i.className="slider-bar-button-image ".concat(t.containerClass,"-button-image"),o.appendChild(i)}else console.log("No image found for slider bar button.");var a=document.createElement("span");a.textContent=n,o.appendChild(a),t.buttonElements.push(o),t.sliderBar.appendChild(o)})),this.element.appendChild(this.leftButton),this.element.appendChild(this.sliderBar),this.element.appendChild(this.rightButton)}},{key:"setViewForDesktop",value:function(){console.log("SLIDER DESKTOP"),this.buttonElements.forEach((function(t){t&&(console.log("BUTTON",t),t.classList.remove("mobile-view"))}))}},{key:"setViewForMobile",value:function(){console.log("SLIDER MOBILE",this.buttonElements),this.buttonElements.forEach((function(t){console.log("FOUND BUTTON",t),t&&(console.log("BUTTON",t),t.classList.add("mobile-view"))}))}},{key:"_handleSliderButtonSelect",value:function(t){var e=t.currentTarget,n=e.querySelector("span").textContent;if(e.classList.contains("selected"))e.classList.remove("selected"),this.fire("deselect");else{var r=document.querySelector(".slider-bar-button.selected");r&&r.classList.remove("selected"),e.classList.add("selected"),this.fire("selectNew",{query:n})}}},{key:"_scrollSliderBar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:275,n=this.sliderBar.scrollWidth-this.sliderBar.clientWidth,r=this.sliderBar.scrollLeft,o=e;if("right"===t){var i=n-r;i<e&&(o=i)}"left"===t?this.sliderBar.scrollBy({left:-e,behavior:"smooth"}):"right"===t&&this.sliderBar.scrollBy({left:o,behavior:"smooth"})}},{key:"_updateScrollButtons",value:function(){var t=this.sliderBar.scrollLeft,e=this.sliderBar.scrollWidth-this.sliderBar.clientWidth;this.leftButton.style.display=t<=0?"none":"block";var n=Math.abs(e-t);this.rightButton.style.display=n<=1?"none":"block"}},{key:"deselectAll",value:function(){this.sliderBar.querySelectorAll(".slider-bar-button.selected").forEach((function(t){return t.classList.remove("selected")}))}},{key:"deselectAllNotMatchingQuery",value:function(t){this.sliderBar.querySelectorAll(".slider-bar-button.selected").forEach((function(e){e.textContent!==t&&e.classList.remove("selected")}))}},{key:"invertButtonAtIndex",value:function(t){var e=this.buttonElements[t];e?e.classList.toggle("inverted"):console.error("Button at index ".concat(t," does not exist."))}},{key:"getElement",value:function(){return this.element}},{key:"show",value:function(){this.element.classList.add("visible")}},{key:"hide",value:function(){this.element.classList.remove("visible")}}],r&&eo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function so(t){return so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},so(t)}function uo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lo(r.key),r)}}function lo(t){var e=function(t){if("object"!=so(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=so(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==so(e)?e:e+""}function fo(t,e,n){return e=yo(e),function(t,e){if(e&&("object"==so(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ho()?Reflect.construct(e,n||[],yo(t).constructor):e.apply(t,n))}function ho(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ho=function(){return!!t})()}function po(){return po="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=yo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},po.apply(null,arguments)}function yo(t){return yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yo(t)}function mo(t,e){return mo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mo(t,e)}const vo=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=fo(this,e,[n])).categoryBar=new co([{title:"Energy & charging"},{title:"Mobility"},{title:"Automotive"},{title:"Indoor mapping"},{title:"Supply chain"},{title:"Tech data"},{title:"Insurance"},{title:"Rideshare"},{title:"Manufacturing"},{title:"Autonomous vehicles"},{title:"Human resources"},{title:"Battery tech"},{title:"Renewable energy"}],{container:"category-bar"}),t}return function(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&&mo(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){this.map=t,this.container=document.createElement("div"),this.container.className="category-bar-control-container";var e=this.categoryBar.getElement();return this.container.appendChild(e),this.initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.show(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=po(yo(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"initializeEventListeners",value:function(){this.categoryBar.on("selectNew",this._handleNewCategoryButtonSelect.bind(this)),this.categoryBar.on("deselect",this._handleCategoryButtonDeselect.bind(this)),this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this))}},{key:"_renderDesktopView",value:function(){var t=this.categoryBar.getElement();this.container.appendChild(t),this.container.classList.remove("mobile-view"),this.container.classList.add("desktop-view");var e=this.map.mapContainer.offsetWidth;console.log("DESKTOP WIDTH",e),this.categoryBar.setViewForDesktop()}},{key:"_renderMobileView",value:function(){var t=this.categoryBar.getElement();this.container.appendChild(t);var e=this.map.mapContainer.offsetWidth;this.container.classList.remove("desktop-view"),this.container.classList.add("mobile-view"),console.log("MOBILE WIDTH22",e,this.map.map.getCanvasContainer().offsetWidth),console.log("THEE",this.categoryBar),this.categoryBar.setViewForMobile()}},{key:"_handleDefaultState",value:function(){this.show(),this.categoryBar.deselectAll()}},{key:"_handleSelectedContentState",value:function(t){this.hide()}},{key:"_handleDirectionsState",value:function(t){this.hide()}},{key:"_handleNewCategoryButtonSelect",value:function(t){var e=t.query;this.map.setToSearchState(e)}},{key:"_handleCategoryButtonDeselect",value:function(){this.map.setToDefaultState()}},{key:"_handleSearchState",value:function(t){var e=t.query;t.results,this.show(),this.categoryBar.deselectAllNotMatchingQuery(e)}}],r&&uo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);function go(t){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},go(t)}function bo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wo(r.key),r)}}function wo(t){var e=function(t){if("object"!=go(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=go(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==go(e)?e:e+""}function Eo(t,e,n){return e=Mo(e),function(t,e){if(e&&("object"==go(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,jo()?Reflect.construct(e,n||[],Mo(t).constructor):e.apply(t,n))}function jo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jo=function(){return!!t})()}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}function So(t,e){return So=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},So(t,e)}const Oo=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Eo(this,e,[r])).contentPlacement=t,n._initialize(),n}return function(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&&So(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){var t=this.contentPlacement.content;this.element=document.createElement("div"),this.element.className="content-placement-header",this.textContainer=document.createElement("div"),this.textContainer.className="header-text-container",this.nameElement=document.createElement("div"),this.nameElement.className="header-content-name",this.nameElement.textContent=t.data[t.title_key],this.catalogNameElement=document.createElement("div"),this.catalogNameElement.className="header-catalog-name",this.catalogNameElement.textContent=this.contentPlacement.catalog.title,this.textContainer.appendChild(this.nameElement),this.textContainer.appendChild(this.catalogNameElement),this.imageViewElement=document.createElement("div"),this.imageViewElement.className="header-image-view",this.element.appendChild(this.imageViewElement),this.element.appendChild(this.textContainer)}},{key:"getElement",value:function(){return this.element}}])&&bo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function xo(t){return xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xo(t)}function To(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Do(r.key),r)}}function Do(t){var e=function(t){if("object"!=xo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xo(e)?e:e+""}function Lo(t,e,n){return e=ko(e),function(t,e){if(e&&("object"==xo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,No()?Reflect.construct(e,n||[],ko(t).constructor):e.apply(t,n))}function No(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(No=function(){return!!t})()}function ko(t){return ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ko(t)}function _o(t,e){return _o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_o(t,e)}const Io=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Lo(this,e,[o])).icon=t,r.text=n,r._initialize(),r}return function(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&&_o(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="contextual-location-view",this.imageViewElement=document.createElement("img"),this.imageViewElement.className="contextual-location-image",this.imageViewElement.src=this.icon,this.textElement=document.createElement("span"),this.textElement.textContent=this.text,this.textElement.className="contextual-location-text",this.element.appendChild(this.imageViewElement),this.element.appendChild(this.textElement)}},{key:"getElement",value:function(){return this.element}}])&&To(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Co(t){return Co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Co(t)}function Po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ao(r.key),r)}}function Ao(t){var e=function(t){if("object"!=Co(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Co(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Co(e)?e:e+""}function Bo(t,e,n){return e=Ro(e),function(t,e){if(e&&("object"==Co(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zo()?Reflect.construct(e,n||[],Ro(t).constructor):e.apply(t,n))}function zo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zo=function(){return!!t})()}function Ro(t){return Ro=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ro(t)}function Uo(t,e){return Uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uo(t,e)}const Vo=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Bo(this,e,[r])).data=t,n._initialize(),n}return function(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&&Uo(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){var t=this;this.element=document.createElement("div"),this.element.className="content-placement-details-view",this.titleView=document.createElement("div"),this.titleView.className="content-details-section-title",this.titleView.textContent="Additional details",this.element.appendChild(this.titleView);var e=Object.keys(this.data);e.forEach((function(n,r){var o=t.data[n],i=document.createElement("div");i.className="details-view-item";var a=document.createElement("div");a.className="details-view-key",a.textContent=n;var c=document.createElement("span");if(c.className="details-view-value",c.textContent=o,i.appendChild(a),i.appendChild(c),r<e.length-1){var s=document.createElement("hr");s.className="details-view-line",i.append(s)}t.element.appendChild(i)}))}},{key:"getElement",value:function(){return this.element}}])&&Po(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Fo(t){return Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fo(t)}function Qo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yo(r.key),r)}}function Yo(t){var e=function(t){if("object"!=Fo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fo(e)?e:e+""}function Ho(t,e,n){return e=Zo(e),function(t,e){if(e&&("object"==Fo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Go()?Reflect.construct(e,n||[],Zo(t).constructor):e.apply(t,n))}function Go(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Go=function(){return!!t})()}function Zo(t){return Zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zo(t)}function Wo(t,e){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wo(t,e)}const qo=function(t){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=Ho(this,e,[i])).title=t,o.subtitle=n,o.placementId=r,o._initialize(),o}return function(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&&Wo(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("button"),this.element.className="content-details-child-view",this.titleElement=document.createElement("div"),this.titleElement.className="content-details-child-view-title",this.titleElement.textContent=this.title+" --\x3e",this.subtitleElement=document.createElement("div"),this.subtitleElement.className="content-details-child-view-subtitle",this.subtitleElement.textContent=this.subtitle,this._render()}},{key:"_render",value:function(){this.element.appendChild(this.titleElement),this.element.appendChild(this.subtitleElement)}},{key:"getElement",value:function(){return this.element}}])&&Qo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Jo(t){return Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(t)}function Ko(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xo(r.key),r)}}function Xo(t){var e=function(t){if("object"!=Jo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jo(e)?e:e+""}function $o(t,e,n){return e=ei(e),function(t,e){if(e&&("object"==Jo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ti()?Reflect.construct(e,n||[],ei(t).constructor):e.apply(t,n))}function ti(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ti=function(){return!!t})()}function ei(t){return ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ei(t)}function ni(t,e){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ni(t,e)}const ri=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=$o(this,e,[o])).title=t,r.children=n,r._initialize(),r}return function(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&&ni(t,e)}(e,t),n=e,r=[{key:"_initialize",value:function(){var t=this;this.element=document.createElement("div"),this.element.className="content-children-view",this.titleView=document.createElement("div"),this.titleView.className="content-details-section-title",this.titleView.textContent=this.title,this.element.appendChild(this.titleView),this.childrenElements=[],this.childrenListView=document.createElement("div"),this.childrenListView.className="content-details-children-list-view",this.children.forEach((function(e){var n=new qo(e.name,e.contextual_location,e.placement_id);t.childrenListView.appendChild(n.getElement()),t.childrenElements.push(n)})),this.element.appendChild(this.childrenListView),this._setupEventListeners()}},{key:"_setupEventListeners",value:function(){var t=this;this.childrenElements.forEach((function(e){e.getElement().addEventListener("click",(function(n){return t._handleChildSelect(n,e)}))}))}},{key:"_handleChildSelect",value:function(t,e){this.fire("selectChildContentPlacement",{placementId:e.placementId})}},{key:"getElement",value:function(){return this.element}}],r&&Ko(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function oi(t){return oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oi(t)}function ii(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],s=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);s=!0);}catch(t){u=!0,o=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ai(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ai(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ai(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ci(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,si(r.key),r)}}function si(t){var e=function(t){if("object"!=oi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oi(e)?e:e+""}function ui(t,e,n){return e=fi(e),function(t,e){if(e&&("object"==oi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,li()?Reflect.construct(e,n||[],fi(t).constructor):e.apply(t,n))}function li(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(li=function(){return!!t})()}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}function hi(t,e){return hi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hi(t,e)}const pi=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ui(this,e,[n])).contentPlacement=null,t.element=document.createElement("div"),t.element.className="content-details",t.header=document.createElement("div"),t.header.className="content-details-header",t.contentPlacementHeader=null,t.actionsView=document.createElement("div"),t.actionsView.className="content-details-section",t.actionButtons=document.createElement("div"),t.actionButtons.className="content-details-action-buttons",t.directionsButton=document.createElement("button"),t.directionsButton.className="content-details-directions-button",t.directionsButton.textContent="Directions",t.shareButton=document.createElement("button"),t.shareButton.className="content-details-share-button",t.shareButton.textContent="Share",t.locationButton=null,t.websiteButton=null,t.detailsView=null,t.childrenComponents=[],t}return function(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&&hi(t,e)}(e,t),n=e,(r=[{key:"_setupEventListeners",value:function(){var t=this;this.childrenComponents.forEach((function(e){e.on("selectChildContentPlacement",t._handleSelectChildContentPlacement.bind(t))})),this.directionsButton.addEventListener("click",this._handleDirectionsButtonSelect.bind(this))}},{key:"_render",value:function(){var t=this;this.element.innerHTML="",this.header.innerHTML="",this.actionsView.innerHTML="",this.contentPlacementHeader&&this.header.appendChild(this.contentPlacementHeader.getElement()),this.actionButtons.appendChild(this.directionsButton),this.actionButtons.appendChild(this.shareButton),this.header.appendChild(this.actionButtons),this.locationButton&&this.actionsView.appendChild(this.locationButton.getElement()),this.websiteButton&&this.actionsView.appendChild(this.websiteButton.getElement()),this.header.appendChild(this.actionsView),this.element.appendChild(this.header),this.detailsView&&(this.detailsView.innerHTML="",this.element.appendChild(this.detailsView.getElement())),this.childrenComponents.forEach((function(e){t.element.appendChild(e.getElement())}))}},{key:"_handleDirectionsButtonSelect",value:function(){this.fire("selectDirectionsButton",{placementId:this.contentPlacement.placement_id})}},{key:"_handleBackArrowClick",value:function(){this.fire("selectBackButton")}},{key:"_handleSelectChildContentPlacement",value:function(t){var e=t.placementId;this.fire("selectChildContentPlacement",{placementId:e})}},{key:"findViableAdditionalData",value:function(t){var e=t.content.data,n=Object.keys(e),r=[t.content.title_key,"Feature","Features","Feature ID","feature_id","Website","Website URL","LinkedIn","Files & media"],o={};return n.forEach((function(t){var n=e[t];r.includes(t)||null==n||""===n||(o[t]=n)})),o}},{key:"updateView",value:function(t){this.contentPlacement=t,this.contentPlacementHeader=new Oo(t),this.locationButton=new Io("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDOS44NzgyNyAyIDcuODQzNDQgMi44NDI4NSA2LjM0MzE1IDQuMzQzMTVDNC44NDI4NSA1Ljg0MzQ0IDQgNy44NzgyNyA0IDEwQzQgMTUuNCAxMS4wNSAyMS41IDExLjM1IDIxLjc2QzExLjUzMTEgMjEuOTE0OSAxMS43NjE2IDIyLjAwMDEgMTIgMjIuMDAwMUMxMi4yMzg0IDIyLjAwMDEgMTIuNDY4OSAyMS45MTQ5IDEyLjY1IDIxLjc2QzEzIDIxLjUgMjAgMTUuNCAyMCAxMEMyMCA3Ljg3ODI3IDE5LjE1NzEgNS44NDM0NCAxNy42NTY5IDQuMzQzMTVDMTYuMTU2NiAyLjg0Mjg1IDE0LjEyMTcgMiAxMiAyWk0xMiAxOS42NUM5Ljg3IDE3LjY1IDYgMTMuMzQgNiAxMEM2IDguNDA4NyA2LjYzMjE0IDYuODgyNTggNy43NTczNiA1Ljc1NzM2QzguODgyNTggNC42MzIxNCAxMC40MDg3IDQgMTIgNEMxMy41OTEzIDQgMTUuMTE3NCA0LjYzMjE0IDE2LjI0MjYgNS43NTczNkMxNy4zNjc5IDYuODgyNTggMTggOC40MDg3IDE4IDEwQzE4IDEzLjM0IDE0LjEzIDE3LjY2IDEyIDE5LjY1Wk0xMiA2QzExLjIwODkgNiAxMC40MzU1IDYuMjM0NiA5Ljc3NzcyIDYuNjc0MTJDOS4xMTk5MiA3LjExMzY1IDguNjA3MjMgNy43MzgzNiA4LjMwNDQ4IDguNDY5MjdDOC4wMDE3MyA5LjIwMDE3IDcuOTIyNTIgMTAuMDA0NCA4LjA3Njg2IDEwLjc4MDRDOC4yMzEyIDExLjU1NjMgOC42MTIxNiAxMi4yNjkgOS4xNzE1NyAxMi44Mjg0QzkuNzMwOTggMTMuMzg3OCAxMC40NDM3IDEzLjc2ODggMTEuMjE5NiAxMy45MjMxQzExLjk5NTYgMTQuMDc3NSAxMi43OTk4IDEzLjk5ODMgMTMuNTMwNyAxMy42OTU1QzE0LjI2MTYgMTMuMzkyOCAxNC44ODY0IDEyLjg4MDEgMTUuMzI1OSAxMi4yMjIzQzE1Ljc2NTQgMTEuNTY0NSAxNiAxMC43OTExIDE2IDEwQzE2IDguOTM5MTMgMTUuNTc4NiA3LjkyMTcyIDE0LjgyODQgNy4xNzE1N0MxNC4wNzgzIDYuNDIxNDMgMTMuMDYwOSA2IDEyIDZaTTEyIDEyQzExLjYwNDQgMTIgMTEuMjE3OCAxMS44ODI3IDEwLjg4ODkgMTEuNjYyOUMxMC41NiAxMS40NDMyIDEwLjMwMzYgMTEuMTMwOCAxMC4xNTIyIDEwLjc2NTRDMTAuMDAwOSAxMC4zOTk5IDkuOTYxMjYgOS45OTc3OCAxMC4wMzg0IDkuNjA5ODJDMTAuMTE1NiA5LjIyMTg2IDEwLjMwNjEgOC44NjU0OSAxMC41ODU4IDguNTg1NzlDMTAuODY1NSA4LjMwNjA4IDExLjIyMTkgOC4xMTU2IDExLjYwOTggOC4wMzg0M0MxMS45OTc4IDcuOTYxMjYgMTIuMzk5OSA4LjAwMDg3IDEyLjc2NTQgOC4xNTIyNEMxMy4xMzA4IDguMzAzNjIgMTMuNDQzMiA4LjU1OTk2IDEzLjY2MjkgOC44ODg4NkMxMy44ODI3IDkuMjE3NzYgMTQgOS42MDQ0NCAxNCAxMEMxNCAxMC41MzA0IDEzLjc4OTMgMTEuMDM5MSAxMy40MTQyIDExLjQxNDJDMTMuMDM5MSAxMS43ODkzIDEyLjUzMDQgMTIgMTIgMTJaIiBmaWxsPSIjMTcxNzE3Ii8+Cjwvc3ZnPgo=",t.contextual_location);var e=t.content.data.Website||t.content.data.LinkedIn||t.content.data["Website URL"];this.websiteButton=e?new Io("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIxLjQxIDguNjQwMTNDMjEuNDEgOC42NDAxMyAyMS40MSA4LjY0MDEzIDIxLjQxIDguNTkwMTNDMjAuNzA1MyA2LjY2NjM1IDE5LjQyNjkgNS4wMDU0MSAxNy43NDc0IDMuODMxOTlDMTYuMDY4IDIuNjU4NTcgMTQuMDY4NyAyLjAyOTMgMTIuMDIgMi4wMjkzQzkuOTcxMiAyLjAyOTMgNy45NzE4OSAyLjY1ODU3IDYuMjkyNDYgMy44MzE5OUM0LjYxMzA0IDUuMDA1NDEgMy4zMzQ1NSA2LjY2NjM1IDIuNjI5OTUgOC41OTAxM0MyLjYyOTk1IDguNTkwMTMgMi42Mjk5NSA4LjU5MDEzIDIuNjI5OTUgOC42NDAxM0MxLjg0MzA4IDEwLjgxMSAxLjg0MzA4IDEzLjE4OTIgMi42Mjk5NSAxNS4zNjAxQzIuNjI5OTUgMTUuMzYwMSAyLjYyOTk1IDE1LjM2MDEgMi42Mjk5NSAxNS40MTAxQzMuMzM0NTUgMTcuMzMzOSA0LjYxMzA0IDE4Ljk5NDggNi4yOTI0NiAyMC4xNjgzQzcuOTcxODkgMjEuMzQxNyA5Ljk3MTIgMjEuOTcxIDEyLjAyIDIxLjk3MUMxNC4wNjg3IDIxLjk3MSAxNi4wNjggMjEuMzQxNyAxNy43NDc0IDIwLjE2ODNDMTkuNDI2OSAxOC45OTQ4IDIwLjcwNTMgMTcuMzMzOSAyMS40MSAxNS40MTAxQzIxLjQxIDE1LjQxMDEgMjEuNDEgMTUuNDEwMSAyMS40MSAxNS4zNjAxQzIyLjE5NjggMTMuMTg5MiAyMi4xOTY4IDEwLjgxMSAyMS40MSA4LjY0MDEzWk00LjI1OTk1IDE0LjAwMDFDMy45MTMxOCAxMi42ODkzIDMuOTEzMTggMTEuMzEwOSA0LjI1OTk1IDEwLjAwMDFINi4xMTk5NUM1Ljk1OTk4IDExLjMyODcgNS45NTk5OCAxMi42NzE2IDYuMTE5OTUgMTQuMDAwMUg0LjI1OTk1Wk01LjA3OTk1IDE2LjAwMDFINi40Nzk5NUM2LjcxNDY3IDE2Ljg5MiA3LjA1MDE2IDE3Ljc1NDIgNy40Nzk5NSAxOC41NzAxQzYuNDk5MjUgMTcuOTAyMSA1LjY3OTQ1IDE3LjAyNDIgNS4wNzk5NSAxNi4wMDAxWk02LjQ3OTk1IDguMDAwMTNINS4wNzk5NUM1LjY3MDgyIDYuOTc5MjEgNi40ODAxNCA2LjEwMTU5IDcuNDQ5OTUgNS40MzAxM0M3LjAzMDUxIDYuMjQ3MzcgNi43MDUwOSA3LjEwOTU0IDYuNDc5OTUgOC4wMDAxM1pNMTEgMTkuNzAwMUM5Ljc3MTcyIDE4Ljc5ODggOC45MDkxIDE3LjQ4NTQgOC41Njk5NSAxNi4wMDAxSDExVjE5LjcwMDFaTTExIDE0LjAwMDFIOC4xMzk5NUM3Ljk1MzM0IDEyLjY3MzMgNy45NTMzNCAxMS4zMjY5IDguMTM5OTUgMTAuMDAwMUgxMVYxNC4wMDAxWk0xMSA4LjAwMDEzSDguNTY5OTVDOC45MDkxIDYuNTE0ODkgOS43NzE3MiA1LjIwMTQ0IDExIDQuMzAwMTNWOC4wMDAxM1pNMTguOTIgOC4wMDAxM0gxNy41MkMxNy4yODUyIDcuMTA4MjggMTYuOTQ5NyA2LjI0NjA2IDE2LjUyIDUuNDMwMTNDMTcuNTAwNyA2LjA5ODIgMTguMzIwNSA2Ljk3NjA3IDE4LjkyIDguMDAwMTNaTTEzIDQuMzAwMTNDMTQuMjI4MiA1LjIwMTQ0IDE1LjA5MDggNi41MTQ4OSAxNS40MyA4LjAwMDEzSDEzVjQuMzAwMTNaTTEzIDE5LjcwMDFWMTYuMDAwMUgxNS40M0MxNS4wOTA4IDE3LjQ4NTQgMTQuMjI4MiAxOC43OTg4IDEzIDE5LjcwMDFaTTE1Ljg2IDE0LjAwMDFIMTNWMTAuMDAwMUgxNS44NkMxNi4wNDY2IDExLjMyNjkgMTYuMDQ2NiAxMi42NzMzIDE1Ljg2IDE0LjAwMDFaTTE2LjU1IDE4LjU3MDFDMTYuOTc5NyAxNy43NTQyIDE3LjMxNTIgMTYuODkyIDE3LjU1IDE2LjAwMDFIMTguOTVDMTguMzUwNSAxNy4wMjQyIDE3LjUzMDcgMTcuOTAyMSAxNi41NSAxOC41NzAxWk0xOS43NCAxNC4wMDAxSDE3Ljg4QzE3Ljk2MTMgMTMuMzM2NiAxOC4wMDE0IDEyLjY2ODYgMTggMTIuMDAwMUMxOC4wMDExIDExLjMzMTYgMTcuOTYxIDEwLjY2MzcgMTcuODggMTAuMDAwMUgxOS43NEMyMC4wODY3IDExLjMxMDkgMjAuMDg2NyAxMi42ODkzIDE5Ljc0IDE0LjAwMDFaIiBmaWxsPSIjMTcxNzE3Ii8+Cjwvc3ZnPgo=",e):null;var n=this.findViableAdditionalData(t),r=Object.keys(n);this.detailsView=r.length>0?new Vo(n):null,this.childrenComponents=[];for(var o=0,i=Object.entries(t.children);o<i.length;o++){var a=ii(i[o],2),c=a[0],s=a[1],u=new ri(c,s);this.childrenComponents.push(u)}this._setupEventListeners(),this._render()}},{key:"getElement",value:function(){return this.element}}])&&ci(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function yi(t){return yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yi(t)}function di(){di=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==yi(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=T(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function D(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(yi(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function mi(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function vi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gi(r.key),r)}}function gi(t){var e=function(t){if("object"!=yi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yi(e)?e:e+""}function bi(t,e,n){return e=ji(e),function(t,e){if(e&&("object"==yi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wi()?Reflect.construct(e,n||[],ji(t).constructor):e.apply(t,n))}function wi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wi=function(){return!!t})()}function Ei(){return Ei="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ji(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ei.apply(null,arguments)}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}function Mi(t,e){return Mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mi(t,e)}const Si=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=bi(this,e,[n])).map=null,t.contentPlacementIds=[],t.currentContentPlacement=null,t.contentPlacementView=null,t}return function(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&&Mi(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){return this.map=t,this.container=document.createElement("div"),this.container.className="content-details-control-container",this.initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.hide(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=Ei(ji(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"initializeEventListeners",value:function(){this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this)),this.map.on("initiate:back",this._handleMapInitiateBack.bind(this))}},{key:"_renderDesktopView",value:function(){if(this.contentPlacementView){var t=this.contentPlacementView.getElement();this.container.appendChild(t),this.container.classList.remove("mobile-view"),this.container.classList.add("desktop-view"),console.log("rendering search results DESKTOP")}}},{key:"_renderMobileView",value:function(){if(this.contentPlacementView){var t=this.contentPlacementView.getElement();this.container.appendChild(t),this.container.classList.remove("desktop-view"),this.container.classList.add("mobile-view"),console.log("rendering search results MOBILE")}}},{key:"_handleMapInitiateBack",value:function(){var t=this.map._stateCoordinator.state;if("selectedContent"===t){if(0===this.contentPlacementIds.length)return;if(1===this.contentPlacementIds.length){var e=this.map._stateCoordinator.stateHistory,n=e[e.length-2];e.pop(),e.pop(),"search"===n?this.map.initiateSetToSearchState():this.map.setToDefaultState()}else this.contentPlacementIds.pop(),this.map.setToSelectedContentState(this.contentPlacementIds)}else"directions"===t&&(console.log("THIS IS BACK IN DIRECTIONS STATE:",this.contentPlacementIds.length),this.map.setToSelectedContentState(this.contentPlacementIds))}},{key:"_handleSelectChildContentPlacement",value:function(t){console.log("SELECT CHILD",t);var e=t.placementId;this.contentPlacementIds.push(e),this.map.setToSelectedContentState(this.contentPlacementIds)}},{key:"_handleDefaultState",value:function(){this.hide(),this.contentPlacementIds=[],this.currentContentPlacement=null,this._clearViews()}},{key:"_handleSearchState",value:function(t){this.hide(),this.contentPlacementIds=[],this.currentContentPlacement=null,this._clearViews()}},{key:"_handleSelectedContentState",value:function(t){var e=t.contentPlacementIds,n=t.selectedContentPlacement;this.contentPlacementIds=e,this.currentContentPlacement=n,console.log("SELECTED",n),this._updateContentViews(),this.show()}},{key:"_handleDirectionsState",value:function(t){this.hide()}},{key:"_handleSelectDirectionsButton",value:(o=di().mark((function t(e){var n;return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.placementId,t.next=3,this.map.setToDirectionsState(null,n);case 3:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){mi(i,n,r,a,c,"next",t)}function c(t){mi(i,n,r,a,c,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})},{key:"_updateContentViews",value:function(){this._clearViews(),this._render()}},{key:"_render",value:function(){console.log("HERE IS NUMBER OF CONTENT PLACEMENTS:",this.contentPlacementIds.length),0!==this.contentPlacementIds.length&&null!==this.currentContentPlacement&&(this.contentPlacementView=new pi,this.contentPlacementView.updateView(this.currentContentPlacement),this.contentPlacementView.on("selectChildContentPlacement",this._handleSelectChildContentPlacement.bind(this)),this.contentPlacementView.on("selectDirectionsButton",this._handleSelectDirectionsButton.bind(this)),this._initialize())}}],r&&vi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(zn);function Oi(t){return Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oi(t)}function xi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ti(r.key),r)}}function Ti(t){var e=function(t){if("object"!=Oi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oi(e)?e:e+""}function Di(t,e,n){return e=ki(e),function(t,e){if(e&&("object"==Oi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Li()?Reflect.construct(e,n||[],ki(t).constructor):e.apply(t,n))}function Li(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Li=function(){return!!t})()}function Ni(){return Ni="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ki(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ni.apply(null,arguments)}function ki(t){return ki=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ki(t)}function _i(t,e){return _i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_i(t,e)}const Ii=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Di(this,e,[n])).map=null,t.previouslySelectedFeature=null,t.previouslySelectedIcon=null,t.previouslySelectedTextColor=null,t.previouslySelectedTextOffset=null,t.previouslyHoveredFeature=null,t.originalTextColor=null,t.textColorReference={},t.currentView=null,t.selectedTextColor="#BE2E28",t}return function(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&&_i(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){return this.map=t,this.container=document.createElement("div"),this.container.className="interaction-control-container",this.initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.createHighlightedContentLayer(),this.createSelectedContentLayer(),this.storeTextColorReferences(),this.applyHoverEffectToAllSymbolLayers(),this.container}},{key:"_initialize",value:function(){var t=this.map.mapContainer.offsetWidth;this._configureView(t)}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=Ni(ki(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"_attachResizeListener",value:function(){var t=this;window.addEventListener("resize",(function(){var e=t.map.mapContainer.offsetWidth;t._configureView(e)}))}},{key:"_configureView",value:function(t){t>767?this._setViewForDesktop():this._setViewForMobile()}},{key:"_setViewForDesktop",value:function(){this.currentView="desktop"}},{key:"_setViewForMobile",value:function(){this.currentView="mobile"}},{key:"initializeEventListeners",value:function(){var t=this;this.map.map.on("styleimagemissing",(function(t){var e=t.id;console.warn('Image "'.concat(e,'" could not be loaded.'))})),this.map.map.on("click",(function(e){t._handleClick(e)})),this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this))}},{key:"storeTextColorReferences",value:function(){var t=this;this.map.map.getStyle().layers.forEach((function(e){if("symbol"===e.type){var n=t.map.map.getPaintProperty(e.id,"text-color");void 0!==n&&(t.textColorReference[e.id]=n)}}))}},{key:"createSelectedContentLayer",value:function(){this.map.map.addSource("selected-content",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.map.addLayer({id:"selected-content-layer",type:"symbol",source:"selected-content",layout:{"text-field":["get","title"],"text-font":["Inter Medium"],"text-size":14,"text-justify":"left","text-anchor":"bottom-left","text-offset":[1.3,-1],"icon-image":"selected-pin","icon-size":.5,"icon-offset":[0,-5],"icon-anchor":"bottom","symbol-z-elevate":!0,"text-padding":10,"icon-padding":5},paint:{"text-color":"#BE2E28","text-halo-color":"#ffffff","text-halo-width":1}})}},{key:"createHighlightedContentLayer",value:function(){this.map.map.addSource("highlighted-content",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.map.addLayer({id:"highlighted-content-layer",type:"symbol",source:"highlighted-content",layout:{"text-field":["get","title"],"text-font":["Inter Medium"],"text-size":14,"text-justify":"left","text-anchor":"bottom-left","text-offset":[1.2,-.6],"icon-image":"highlightedPin","icon-size":.5,"icon-offset":[0,-5],"icon-anchor":"bottom","symbol-z-elevate":!0,"text-padding":5,"icon-padding":5},paint:{"text-color":"#1E1E1E","text-halo-color":"#ffffff","text-halo-width":1}})}},{key:"clearSelectedContentLayer",value:function(){this.map.map.getSource("selected-content").setData({type:"FeatureCollection",features:[]})}},{key:"clearHighlightedContentLayer",value:function(){this.map.map.getSource("highlighted-content").setData({type:"FeatureCollection",features:[]})}},{key:"addSelectedFeature",value:function(t,e){var n=this.map.map.getSource("selected-content"),r=n._data,o={type:"Feature",geometry:{type:"Point",coordinates:t},properties:e};r.features.push(o),n.setData(r)}},{key:"addHighlightedFeature",value:function(t,e){var n=this.map.map.getSource("highlighted-content"),r=n._data,o={type:"Feature",geometry:{type:"Point",coordinates:t},properties:e};r.features.push(o),n.setData(r)}},{key:"_handleDefaultState",value:function(){this.clearHighlightedContentLayer(),this.clearSelectedContentLayer(),this.showSymbolLayers()}},{key:"_handleSearchState",value:function(t){t.query;var e=t.results;this.hideSymbolLayers(),this.clearSelectedContentLayer(),this.updateLabelsForSearchResults(e)}},{key:"_handleSelectedContentState",value:function(t){t.contentPlacementIds;var e=t.selectedContentPlacement;this.updateLabelForSelectedContentPlacement(e)}},{key:"_handleDirectionsState",value:function(t){console.log("handling directions state in interaction control")}},{key:"hideSymbolLayers",value:function(){var t=this;this.map.map.getStyle().layers.forEach((function(e){"symbol"===e.type&&"selected-content-layer"!==e.id&&"highlighted-content-layer"!==e.id&&t.map.map.setLayoutProperty(e.id,"visibility","none")}))}},{key:"showSymbolLayers",value:function(){var t=this;this.map.map.getStyle().layers.forEach((function(e){"symbol"===e.type&&t.map.map.setLayoutProperty(e.id,"visibility","visible")}))}},{key:"updateLabelsForSearchResults",value:function(t){var e=this;this.clearHighlightedContentLayer();var n=[];if(t.forEach((function(t){var r=t.placement_id,o=e.map._findFeatureByPlacementId(r);if(o){var i=o.geometry.coordinates,a=o.properties;e.addHighlightedFeature(i,a),n.push(o)}})),n.length){var r=new mapboxgl.LngLatBounds;if(n.forEach((function(t){r.extend(t.geometry.coordinates)})),"desktop"===this.currentView)this.map.map.fitBounds(r,{padding:{top:200,bottom:200,left:550,right:200},maxZoom:15,duration:1e3});else if("mobile"===this.currentView){var o=.55*this.map.mapContainer.offsetHeight,i=.2*this.map.mapContainer.offsetWidth;this.map.map.fitBounds(r,{padding:{top:200,bottom:o,left:i,right:i},maxZoom:15,duration:1e3})}}}},{key:"updateLabelForSelectedContentPlacement",value:function(t){var e=t.placement_id;this.clearSelectedContentLayer();var n=this.map.map.queryRenderedFeatures({filter:["==",["get","placement_id"],e]});if(0!==n.length){var r=n[0],o=r.geometry.coordinates,i=r.properties;if(this.addSelectedFeature(o,i),"desktop"===this.currentView)this.map.map.easeTo({center:o,padding:{top:0,bottom:0,left:330,right:0},duration:1e3});else if("mobile"===this.currentView){var a=.35*this.map.mapContainer.offsetHeight;this.map.map.easeTo({center:o,padding:{top:0,bottom:a,left:0,right:0},duration:1e3})}}}},{key:"applyHoverEffectToAllSymbolLayers",value:function(){var t=this;this.map.map.getStyle().layers.forEach((function(e){if("symbol"===e.type){var n=e.id,r=t.textColorReference[n];t.map.map.on("mouseenter",n,(function(e){var o=e.features[0],i=o.properties.placement_id;if(t.previouslySelectedFeature&&t.previouslySelectedFeature.layer.id===o.layer.id){t.originalTextColor=t.previouslySelectedTextColor;var a=t.previouslySelectedFeature.properties.placement_id;t.map.map.setPaintProperty(n,"text-color",["case",["==",["get","placement_id"],i],"#4B90F7",["==",["get","placement_id"],a],t.selectedTextColor,r])}else t.originalTextColor=t.map.map.getPaintProperty(n,"text-color"),t.map.map.setPaintProperty(n,"text-color",["case",["==",["get","placement_id"],i],"#4B90F7",r]);t.map.map.getCanvas().style.cursor="pointer"})),t.map.map.on("mouseleave",n,(function(){if(t.previouslySelectedFeature){var e=t.previouslySelectedFeature.properties.placement_id;t.map.map.setPaintProperty(n,"text-color",["case",["==",["get","placement_id"],e],t.selectedTextColor,r])}else t.map.map.setPaintProperty(n,"text-color",r);t.map.map.getCanvas().style.cursor="default"}))}}))}},{key:"_handleClick",value:function(t){var e=this.map.map.queryRenderedFeatures(t.point).filter((function(t){return"symbol"===t.layer.type}));if(e.length>0){var n=e[0].properties.placement_id;this.map.setToSelectedContentState([n])}}}],r&&xi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);function Ci(t){return Ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ci(t)}function Pi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ai(r.key),r)}}function Ai(t){var e=function(t){if("object"!=Ci(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ci(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ci(e)?e:e+""}function Bi(t,e,n){return e=Ri(e),function(t,e){if(e&&("object"==Ci(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zi()?Reflect.construct(e,n||[],Ri(t).constructor):e.apply(t,n))}function zi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zi=function(){return!!t})()}function Ri(t){return Ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ri(t)}function Ui(t,e){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ui(t,e)}const Vi=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Bi(this,e,[r])).steps=t,n._initialize(),n}return function(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&&Ui(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="steps-view",this._render(this.steps)}},{key:"_render",value:function(t){console.log("HERE ARE STEPSSS",t);var e=document.createElement("h2");e.textContent="Steps",this.element.appendChild(e);var n=document.createElement("ul");t.forEach((function(t){var e=document.createElement("li");e.textContent=t,n.appendChild(e)})),this.element.appendChild(n)}},{key:"getElement",value:function(){return this.element}}])&&Pi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Fi(t){return Fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(t)}function Qi(){Qi=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:x(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Fi(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=T(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function D(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Fi(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,N.prototype={constructor:N,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Yi(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Hi(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Yi(i,r,o,a,c,"next",t)}function c(t){Yi(i,r,o,a,c,"throw",t)}a(void 0)}))}}function Gi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zi(r.key),r)}}function Zi(t){var e=function(t){if("object"!=Fi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fi(e)?e:e+""}function Wi(t,e,n){return e=Ji(e),function(t,e){if(e&&("object"==Fi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qi()?Reflect.construct(e,n||[],Ji(t).constructor):e.apply(t,n))}function qi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qi=function(){return!!t})()}function Ji(t){return Ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ji(t)}function Ki(t,e){return Ki=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ki(t,e)}const Xi=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Wi(this,e,[n])).startSearchBox=new Yr,t.endSearchBox=new Yr,t.startContentPlacement=null,t.endContentPlacement=null,t.steps=null,t.searchApi=He.getSearchApi(),t._initialize(),t}return function(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&&Ki(t,e)}(e,t),n=e,r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="directions-view",this.directionsViewHeader=document.createElement("div"),this.directionsViewHeader.className="directions-view-header",this.searchBoxesContainer=document.createElement("div"),this.searchBoxesContainer.className="directions-search-boxes-container",this.circlesAndSearchWrapper=document.createElement("div"),this.circlesAndSearchWrapper.className="directions-circles-search-wrapper";var t=this._createCirclesContainer();this.circlesAndSearchWrapper.appendChild(t),this.startSearchBox.searchBar.updateLeftButtonIcon("none"),this.startSearchBox.searchBar.updateRightButtonIcon("none"),this.endSearchBox.searchBar.updateLeftButtonIcon("none"),this.endSearchBox.searchBar.updateRightButtonIcon("none"),this.startSearchBox.searchBar.setPlaceholderText("Choose starting point"),this.endSearchBox.searchBar.setPlaceholderText("Choose destination"),this.searchBoxesContainer.appendChild(this.startSearchBox.getElement()),this.searchBoxesContainer.appendChild(this.endSearchBox.getElement()),this.circlesAndSearchWrapper.appendChild(this.searchBoxesContainer),this.directionsViewHeader.appendChild(this.circlesAndSearchWrapper),this._render(),this._setupEventListeners()}},{key:"_createCirclesContainer",value:function(){var t=document.createElement("div");t.className="directions-circles-container";var e=document.createElement("div");e.className="large-circle";var n=document.createElement("div");n.className="end-circle";var r=document.createElement("div");r.className="small-circle";var o=document.createElement("div");o.className="small-circle";var i=document.createElement("div");return i.className="small-circle",t.appendChild(e),t.appendChild(r),t.appendChild(o),t.appendChild(i),t.appendChild(n),t}},{key:"_render",value:function(){if(this.element.appendChild(this.directionsViewHeader),this.steps){var t=new Vi(this.steps);this.element.appendChild(t.getElement())}}},{key:"_setupEventListeners",value:function(){this.startSearchBox.searchBar.on("focus",this._handleStartSearchBarFocus.bind(this)),this.startSearchBox.searchBar.on("blur",this._handleStartSearchBarBlur.bind(this)),this.endSearchBox.searchBar.on("focus",this._handleEndSearchBarFocus.bind(this)),this.endSearchBox.searchBar.on("blur",this._handleEndSearchBarBlur.bind(this)),this.startSearchBox.searchBarSuggestionsView.on("selectCell",this._handleStartContentPlacementSelect.bind(this)),this.endSearchBox.searchBarSuggestionsView.on("selectCell",this._handleEndContentPlacementSelect.bind(this))}},{key:"_handleStartContentPlacementSelect",value:(i=Hi(Qi().mark((function t(e){var n,r,o;return Qi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.result,r=n.placement_id,this.startSearchBox.searchBar.setText(n.name),t.next=5,this.searchApi.fetchContentPlacementDetails(r);case 5:o=t.sent,this.updateView(o,this.endContentPlacement);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"_handleEndContentPlacementSelect",value:(o=Hi(Qi().mark((function t(e){var n,r,o;return Qi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.result,r=n.placement_id,this.endSearchBox.searchBar.setText(n.name),t.next=5,this.searchApi.fetchContentPlacementDetails(r);case 5:o=t.sent,this.updateView(this.startContentPlacement,o);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"_handleStartSearchBarFocus",value:function(){this.startSearchBox.searchBar.updateRightButtonIcon("search")}},{key:"_handleEndSearchBarFocus",value:function(){this.endSearchBox.searchBar.updateRightButtonIcon("search")}},{key:"_handleStartSearchBarBlur",value:function(){this.startSearchBox.searchBar.updateRightButtonIcon("none")}},{key:"_handleEndSearchBarBlur",value:function(){this.endSearchBox.searchBar.updateRightButtonIcon("none")}},{key:"updateView",value:function(t,e){if(this.startContentPlacement=t,this.endContentPlacement=e,t&&e)console.log("BOTH ARE THERE, LETS FIRE PATH"),this.fire("initiate:findPath",{startContentPlacementId:t.placement_id,endContentPlacementId:e.placement_id});else if(t){var n=t.content.data[t.content.title_key];this.startSearchBox.searchBar.setText(n),this.endSearchBox.searchBar.setText(""),this.endSearchBox.searchBar.input.focus(),this.clearSteps()}else if(e){var r=e.content.data[e.content.title_key];this.endSearchBox.searchBar.setText(r),this.startSearchBox.searchBar.setText(""),this.startSearchBox.searchBar.input.focus(),this.clearSteps()}}},{key:"setSteps",value:function(t){this.steps=t,this._render()}},{key:"clearSteps",value:function(){var t=this.element.querySelector(".steps-view");t&&t.remove()}},{key:"getElement",value:function(){return this.element}}],r&&Gi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(yn);function $i(t){return $i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(t)}function ta(t,e,n){return(e=na(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ea(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,na(r.key),r)}}function na(t){var e=function(t){if("object"!=$i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$i(e)?e:e+""}function ra(t,e,n){return e=aa(e),function(t,e){if(e&&("object"==$i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,oa()?Reflect.construct(e,n||[],aa(t).constructor):e.apply(t,n))}function oa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(oa=function(){return!!t})()}function ia(){return ia="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=aa(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ia.apply(null,arguments)}function aa(t){return aa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},aa(t)}function ca(t,e){return ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ca(t,e)}const sa=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ra(this,e,[n])).directionsView=null,t.map=null,t}return function(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&&ca(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){return this.map=t,this.container=document.createElement("div"),this.container.className="directions-control-container",this.directionsView=new Xi,this.container.appendChild(this.directionsView.getElement()),this.initializeEventListeners(),this.createDirectionsLineLayer(),this._attachResizeListener(),this._initialize(),this.hide(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=ia(aa(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"initializeEventListeners",value:function(){this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this)),this.directionsView.on("initiate:findPath",this._handleIntiateFindPath.bind(this))}},{key:"_renderDesktopView",value:function(){if(this.directionsView){var t=this.directionsView.getElement();this.container.appendChild(t),this.container.classList.remove("mobile-view"),this.container.classList.add("desktop-view"),console.log("rendering search results DESKTOP")}}},{key:"_renderMobileView",value:function(){if(this.directionsView){var t=this.directionsView.getElement();this.container.appendChild(t),this.container.classList.remove("desktop-view"),this.container.classList.add("mobile-view"),console.log("rendering search results MOBILE")}}},{key:"createDirectionsLineLayer",value:function(){this.map.map.addSource("directionsLineSource",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[]}}}),this.map.map.addLayer({id:"directionsLineLayer",type:"line",source:"directionsLineSource",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#1e1e1e","line-width":8}}),this.map.map.moveLayer("directionsLineLayer","special-areas")}},{key:"updateLineData",value:function(t){this.map.map.getSource("directionsLineSource").setData({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:t}});var e=new mapboxgl.LngLatBounds;t.forEach((function(t){e.extend(t)})),this.map.map.fitBounds(e,ta(ta(ta({padding:200},"padding",{top:200,bottom:200,left:500,right:150}),"maxZoom",15),"duration",1e3))}},{key:"clearLineData",value:function(){this.map.map.getSource("directionsLineSource").setData({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[]}})}},{key:"_handleDefaultState",value:function(){this.hide()}},{key:"_handleSearchState",value:function(t){t.query,t.results,this.hide()}},{key:"_handleSelectedContentState",value:function(t){t.contentPlacementIds,t.selectedContentPlacement,this.hide(),this.directionsView.updateView(null,null),this.clearLineData()}},{key:"_handleDirectionsState",value:function(t){var e=t.startContentPlacement,n=t.endContentPlacement;console.log("handling directions state in directions control",t),this.show(),this.clearLineData(),this.directionsView.updateView(e,n)}},{key:"_handleIntiateFindPath",value:function(t){var e=t.startContentPlacementId,n=t.endContentPlacementId;this.clearLineData();var r=this.map.findPath(e,n);console.log("HERE IS PATH RESPONSEEE",r);var o=r.coordinates,i=r.steps;this.updateLineData(o),this.directionsView.setSteps(i)}},{key:"_handleSelectDirectionsButton",value:function(t){t.placementId}},{key:"_render",value:function(){console.log("render")}}],r&&ea(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);"undefined"!=typeof window&&(t.p=window.location.origin+"/");const ua={MapView:ur,SearchBox:Yr,SearchBoxControl:$r,CategoryBarControl:vo,SearchResultsControl:Zn,ContentPlacementControl:Si,InteractionControl:Ii,DirectionsControl:sa,setApiKey:He.setApiKey.bind(He)};return e.default})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.waygomaps=e():t.waygomaps=e()}(this,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var e;t.g.importScripts&&(e=t.g.location+"");var n=t.g.document;if(!e&&n&&(n.currentScript&&"SCRIPT"===n.currentScript.tagName.toUpperCase()&&(e=n.currentScript.src),!e)){var r=n.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t.p=e})();var e={};t.d(e,{default:()=>ua});var n={};function r(t,e){return function(){return t.apply(e,arguments)}}t.r(n),t.d(n,{hasBrowserEnv:()=>ht,hasStandardBrowserEnv:()=>yt,hasStandardBrowserWebWorkerEnv:()=>dt,navigator:()=>pt,origin:()=>mt});const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,a=(c=Object.create(null),t=>{const e=o.call(t);return c[e]||(c[e]=e.slice(8,-1).toLowerCase())});var c;const s=t=>(t=t.toLowerCase(),e=>a(e)===t),u=t=>e=>typeof e===t,{isArray:l}=Array,f=u("undefined"),h=s("ArrayBuffer"),p=u("string"),y=u("function"),d=u("number"),m=t=>null!==t&&"object"==typeof t,v=t=>{if("object"!==a(t))return!1;const e=i(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},g=s("Date"),b=s("File"),w=s("Blob"),E=s("FileList"),j=s("URLSearchParams"),[M,S,O,T]=["ReadableStream","Request","Response","Headers"].map(s);function x(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),l(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(r=0;r<i;r++)a=o[r],e.call(null,t[a],a,t)}}function N(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,D=t=>!f(t)&&t!==L,k=(I="undefined"!=typeof Uint8Array&&i(Uint8Array),t=>I&&t instanceof I);var I;const _=s("HTMLFormElement"),C=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),P=s("RegExp"),A=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};x(n,((n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)})),Object.defineProperties(t,r)},B="abcdefghijklmnopqrstuvwxyz",z="0123456789",R={DIGIT:z,ALPHA:B,ALPHA_DIGIT:B+B.toUpperCase()+z},U=s("AsyncFunction"),V=(F="function"==typeof setImmediate,Q=y(L.postMessage),F?setImmediate:Q?(Y=`axios@${Math.random()}`,H=[],L.addEventListener("message",(({source:t,data:e})=>{t===L&&e===Y&&H.length&&H.shift()()}),!1),t=>{H.push(t),L.postMessage(Y,"*")}):t=>setTimeout(t));var F,Q,Y,H;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(L):"undefined"!=typeof process&&process.nextTick||V,Z={isArray:l,isArrayBuffer:h,isBuffer:function(t){return null!==t&&!f(t)&&null!==t.constructor&&!f(t.constructor)&&y(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||y(t.append)&&("formdata"===(e=a(t))||"object"===e&&y(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&h(t.buffer),e},isString:p,isNumber:d,isBoolean:t=>!0===t||!1===t,isObject:m,isPlainObject:v,isReadableStream:M,isRequest:S,isResponse:O,isHeaders:T,isUndefined:f,isDate:g,isFile:b,isBlob:w,isRegExp:P,isFunction:y,isStream:t=>m(t)&&y(t.pipe),isURLSearchParams:j,isTypedArray:k,isFileList:E,forEach:x,merge:function t(){const{caseless:e}=D(this)&&this||{},n={},r=(r,o)=>{const i=e&&N(n,o)||o;v(n[i])&&v(r)?n[i]=t(n[i],r):v(r)?n[i]=t({},r):l(r)?n[i]=r.slice():n[i]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&x(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:o}={})=>(x(e,((e,o)=>{n&&y(e)?t[o]=r(e,n):t[o]=e}),{allOwnKeys:o}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,a,c;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),a=o.length;a-- >0;)c=o[a],r&&!r(c,t,e)||s[c]||(e[c]=t[c],s[c]=!0);t=!1!==n&&i(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:a,kindOfTest:s,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(l(t))return t;let e=t.length;if(!d(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:_,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:A,freezeMethods:t=>{A(t,((e,n)=>{if(y(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];y(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return l(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:N,global:L,isContextDefined:D,ALPHABET:R,generateString:(t=16,e=R.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&y(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(m(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const o=l(t)?[]:{};return x(t,((t,e)=>{const i=n(t,r+1);!f(i)&&(o[e]=i)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:U,isThenable:t=>t&&(m(t)||y(t))&&y(t.then)&&y(t.catch),setImmediate:V,asap:G};function W(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Z.inherits(W,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.status}}});const q=W.prototype,J={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{J[t]={value:t}})),Object.defineProperties(W,J),Object.defineProperty(q,"isAxiosError",{value:!0}),W.from=(t,e,n,r,o,i)=>{const a=Object.create(q);return Z.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),W.call(a,t.message,e,n,r,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const K=W;function X(t){return Z.isPlainObject(t)||Z.isArray(t)}function $(t){return Z.endsWith(t,"[]")?t.slice(0,-2):t}function tt(t,e,n){return t?t.concat(e).map((function(t,e){return t=$(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const et=Z.toFlatObject(Z,{},null,(function(t){return/^is[A-Z]/.test(t)})),nt=function(t,e,n){if(!Z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=Z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Z.isUndefined(e[t])}))).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,c=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Z.isSpecCompliantForm(e);if(!Z.isFunction(o))throw new TypeError("visitor must be a function");function s(t){if(null===t)return"";if(Z.isDate(t))return t.toISOString();if(!c&&Z.isBlob(t))throw new K("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(t)||Z.isTypedArray(t)?c&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,n,o){let c=t;if(t&&!o&&"object"==typeof t)if(Z.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Z.isArray(t)&&function(t){return Z.isArray(t)&&!t.some(X)}(t)||(Z.isFileList(t)||Z.endsWith(n,"[]"))&&(c=Z.toArray(t)))return n=$(n),c.forEach((function(t,r){!Z.isUndefined(t)&&null!==t&&e.append(!0===a?tt([n],r,i):null===a?n:n+"[]",s(t))})),!1;return!!X(t)||(e.append(tt(o,n,i),s(t)),!1)}const l=[],f=Object.assign(et,{defaultVisitor:u,convertValue:s,isVisitable:X});if(!Z.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Z.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Z.forEach(n,(function(n,i){!0===(!(Z.isUndefined(n)||null===n)&&o.call(e,n,Z.isString(i)?i.trim():i,r,f))&&t(n,r?r.concat(i):[i])})),l.pop()}}(t),e};function rt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function ot(t,e){this._pairs=[],t&&nt(t,this,e)}const it=ot.prototype;it.append=function(t,e){this._pairs.push([t,e])},it.toString=function(t){const e=t?function(e){return t.call(this,e,rt)}:rt;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const at=ot;function ct(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function st(t,e,n){if(!e)return t;const r=n&&n.encode||ct,o=n&&n.serialize;let i;if(i=o?o(e,n):Z.isURLSearchParams(e)?e.toString():new at(e,n).toString(r),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const ut=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},lt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ft={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:at,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ht="undefined"!=typeof window&&"undefined"!=typeof document,pt="object"==typeof navigator&&navigator||void 0,yt=ht&&(!pt||["ReactNative","NativeScript","NS"].indexOf(pt.product)<0),dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,mt=ht&&window.location.href||"http://localhost",vt={...n,...ft},gt=function(t){function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),c=o>=t.length;return i=!i&&Z.isArray(r)?r.length:i,c?(Z.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&Z.isObject(r[i])||(r[i]=[]),e(t,n,r[i],o)&&Z.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}(r[i])),!a)}if(Z.isFormData(t)&&Z.isFunction(t.entries)){const n={};return Z.forEachEntry(t,((t,r)=>{e(function(t){return Z.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null},bt={transitional:lt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=Z.isObject(t);if(o&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return r?JSON.stringify(gt(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return nt(t,new vt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return vt.isNode&&Z.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=Z.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return nt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t){if(Z.isString(t))try{return(0,JSON.parse)(t),Z.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||bt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw K.from(t,K.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:vt.classes.FormData,Blob:vt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch"],(t=>{bt.headers[t]={}}));const wt=bt,Et=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),jt=Symbol("internals");function Mt(t){return t&&String(t).trim().toLowerCase()}function St(t){return!1===t||null==t?t:Z.isArray(t)?t.map(St):String(t)}function Ot(t,e,n,r,o){return Z.isFunction(r)?r.call(this,e,n):(o&&(e=n),Z.isString(e)?Z.isString(r)?-1!==e.indexOf(r):Z.isRegExp(r)?r.test(e):void 0:void 0)}class Tt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=Mt(e);if(!o)throw new Error("header name must be a non-empty string");const i=Z.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=St(t))}const i=(t,e)=>Z.forEach(t,((t,n)=>o(t,n,e)));if(Z.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(Z.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&Et[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(Z.isHeaders(t))for(const[e,r]of t.entries())o(r,e,n);else null!=t&&o(e,t,n);return this}get(t,e){if(t=Mt(t)){const n=Z.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(Z.isFunction(e))return e.call(this,t,n);if(Z.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Mt(t)){const n=Z.findKey(this,t);return!(!n||void 0===this[n]||e&&!Ot(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=Mt(t)){const o=Z.findKey(n,t);!o||e&&!Ot(0,n[o],o,e)||(delete n[o],r=!0)}}return Z.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!Ot(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return Z.forEach(this,((r,o)=>{const i=Z.findKey(n,o);if(i)return e[i]=St(r),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete e[o],e[a]=St(r),n[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Z.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&Z.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[jt]=this[jt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Mt(t);e[r]||(function(t,e){const n=Z.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return Z.isArray(t)?t.forEach(r):r(t),this}}Tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(Tt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),Z.freezeMethods(Tt);const xt=Tt;function Nt(t,e){const n=this||wt,r=e||n,o=xt.from(r.headers);let i=r.data;return Z.forEach(t,(function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Lt(t){return!(!t||!t.__CANCEL__)}function Dt(t,e,n){K.call(this,null==t?"canceled":t,K.ERR_CANCELED,e,n),this.name="CanceledError"}Z.inherits(Dt,K,{__CANCEL__:!0});const kt=Dt;function It(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new K("Request failed with status code "+n.status,[K.ERR_BAD_REQUEST,K.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}const _t=(t,e,n=3)=>{let r=0;const o=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(c){const s=Date.now(),u=r[a];o||(o=s),n[i]=c,r[i]=s;let l=a,f=0;for(;l!==i;)f+=n[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),s-o<e)return;const h=u&&s-u;return h?Math.round(1e3*f/h):void 0}}(50,250);return function(t,e){let n,r,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),c=e-o;c>=i?a(t,e):(n=t,r||(r=setTimeout((()=>{r=null,a(n)}),i-c)))},()=>n&&a(n)]}((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,c=i-r,s=o(c);r=i,t({loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:n,lengthComputable:null!=a,[e?"download":"upload"]:!0})}),n)},Ct=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Pt=t=>(...e)=>Z.asap((()=>t(...e))),At=vt.hasStandardBrowserEnv?function(){const t=vt.navigator&&/(msie|trident)/i.test(vt.navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=Z.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0},Bt=vt.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const a=[t+"="+encodeURIComponent(e)];Z.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Z.isString(r)&&a.push("path="+r),Z.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function zt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Rt=t=>t instanceof xt?{...t}:t;function Ut(t,e){e=e||{};const n={};function r(t,e,n){return Z.isPlainObject(t)&&Z.isPlainObject(e)?Z.merge.call({caseless:n},t,e):Z.isPlainObject(e)?Z.merge({},e):Z.isArray(e)?e.slice():e}function o(t,e,n){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function i(t,e){if(!Z.isUndefined(e))return r(void 0,e)}function a(t,e){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function c(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const s={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(t,e)=>o(Rt(t),Rt(e),!0)};return Z.forEach(Object.keys(Object.assign({},t,e)),(function(r){const i=s[r]||o,a=i(t[r],e[r],r);Z.isUndefined(a)&&i!==c||(n[r]=a)})),n}const Vt=t=>{const e=Ut({},t);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:c,auth:s}=e;if(e.headers=c=xt.from(c),e.url=st(zt(e.baseURL,e.url),t.params,t.paramsSerializer),s&&c.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Z.isFormData(r))if(vt.hasStandardBrowserEnv||vt.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(!1!==(n=c.getContentType())){const[t,...e]=n?n.split(";").map((t=>t.trim())).filter(Boolean):[];c.setContentType([t||"multipart/form-data",...e].join("; "))}if(vt.hasStandardBrowserEnv&&(o&&Z.isFunction(o)&&(o=o(e)),o||!1!==o&&At(e.url))){const t=i&&a&&Bt.read(a);t&&c.set(i,t)}return e},Ft="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=Vt(t);let o=r.data;const i=xt.from(r.headers).normalize();let a,c,s,u,l,{responseType:f,onUploadProgress:h,onDownloadProgress:p}=r;function y(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let d=new XMLHttpRequest;function m(){if(!d)return;const r=xt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());It((function(t){e(t),y()}),(function(t){n(t),y()}),{data:f&&"text"!==f&&"json"!==f?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:t,request:d}),d=null}d.open(r.method.toUpperCase(),r.url,!0),d.timeout=r.timeout,"onloadend"in d?d.onloadend=m:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(m)},d.onabort=function(){d&&(n(new K("Request aborted",K.ECONNABORTED,t,d)),d=null)},d.onerror=function(){n(new K("Network Error",K.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||lt;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new K(e,o.clarifyTimeoutError?K.ETIMEDOUT:K.ECONNABORTED,t,d)),d=null},void 0===o&&i.setContentType(null),"setRequestHeader"in d&&Z.forEach(i.toJSON(),(function(t,e){d.setRequestHeader(e,t)})),Z.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),f&&"json"!==f&&(d.responseType=r.responseType),p&&([s,l]=_t(p,!0),d.addEventListener("progress",s)),h&&d.upload&&([c,u]=_t(h),d.upload.addEventListener("progress",c),d.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=e=>{d&&(n(!e||e.type?new kt(null,t,d):e),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const v=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);v&&-1===vt.protocols.indexOf(v)?n(new K("Unsupported protocol "+v+":",K.ERR_BAD_REQUEST,t)):d.send(o||null)}))},Qt=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const o=function(t){if(!n){n=!0,a();const e=t instanceof Error?t:this.reason;r.abort(e instanceof K?e:new kt(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new K(`timeout ${e} of ms exceeded`,K.ETIMEDOUT))}),e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:c}=r;return c.unsubscribe=()=>Z.asap(a),c}},Yt=function*(t,e){let n=t.byteLength;if(!e||n<e)return void(yield t);let r,o=0;for(;o<n;)r=o+e,yield t.slice(o,r),o=r},Ht=(t,e,n,r)=>{const o=async function*(t,e){for await(const n of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}}(t))yield*Yt(n,e)}(t,e);let i,a=0,c=t=>{i||(i=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e)return c(),void t.close();let i=r.byteLength;if(n){let t=a+=i;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw c(t),t}},cancel:t=>(c(t),o.return())},{highWaterMark:2})},Gt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Zt=Gt&&"function"==typeof ReadableStream,Wt=Gt&&("function"==typeof TextEncoder?(qt=new TextEncoder,t=>qt.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var qt;const Jt=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Kt=Zt&&Jt((()=>{let t=!1;const e=new Request(vt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Xt=Zt&&Jt((()=>Z.isReadableStream(new Response("").body))),$t={stream:Xt&&(t=>t.body)};var te;Gt&&(te=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!$t[t]&&($t[t]=Z.isFunction(te[t])?e=>e[t]():(e,n)=>{throw new K(`Response type '${t}' is not supported`,K.ERR_NOT_SUPPORT,n)})})));const ee={http:null,xhr:Ft,fetch:Gt&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:c,onUploadProgress:s,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:h}=Vt(t);u=u?(u+"").toLowerCase():"text";let p,y=Qt([o,i&&i.toAbortSignal()],a);const d=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let m;try{if(s&&Kt&&"get"!==n&&"head"!==n&&0!==(m=await(async(t,e)=>{const n=Z.toFiniteNumber(t.getContentLength());return null==n?(async t=>{if(null==t)return 0;if(Z.isBlob(t))return t.size;if(Z.isSpecCompliantForm(t)){const e=new Request(vt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Z.isArrayBufferView(t)||Z.isArrayBuffer(t)?t.byteLength:(Z.isURLSearchParams(t)&&(t+=""),Z.isString(t)?(await Wt(t)).byteLength:void 0)})(e):n})(l,r))){let t,n=new Request(e,{method:"POST",body:r,duplex:"half"});if(Z.isFormData(r)&&(t=n.headers.get("content-type"))&&l.setContentType(t),n.body){const[t,e]=Ct(m,_t(Pt(s)));r=Ht(n.body,65536,t,e)}}Z.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(e,{...h,signal:y,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:o?f:void 0});let i=await fetch(p);const a=Xt&&("stream"===u||"response"===u);if(Xt&&(c||a&&d)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=Z.toFiniteNumber(i.headers.get("content-length")),[n,r]=c&&Ct(e,_t(Pt(c),!0))||[];i=new Response(Ht(i.body,65536,n,(()=>{r&&r(),d&&d()})),t)}u=u||"text";let v=await $t[Z.findKey($t,u)||"text"](i,t);return!a&&d&&d(),await new Promise(((e,n)=>{It(e,n,{data:v,headers:xt.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:p})}))}catch(e){if(d&&d(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new K("Network Error",K.ERR_NETWORK,t,p),{cause:e.cause||e});throw K.from(e,e&&e.code,t,p)}})};Z.forEach(ee,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ne=t=>`- ${t}`,re=t=>Z.isFunction(t)||null===t||!1===t,oe=t=>{t=Z.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){let e;if(n=t[i],r=n,!re(n)&&(r=ee[(e=String(n)).toLowerCase()],void 0===r))throw new K(`Unknown adapter '${e}'`);if(r)break;o[e||"#"+i]=r}if(!r){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(ne).join("\n"):" "+ne(t[0]):"as no adapter specified";throw new K("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function ie(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new kt(null,t)}function ae(t){return ie(t),t.headers=xt.from(t.headers),t.data=Nt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),oe(t.adapter||wt.adapter)(t).then((function(e){return ie(t),e.data=Nt.call(t,t.transformResponse,e),e.headers=xt.from(e.headers),e}),(function(e){return Lt(e)||(ie(t),e&&e.response&&(e.response.data=Nt.call(t,t.transformResponse,e.response),e.response.headers=xt.from(e.response.headers))),Promise.reject(e)}))}const ce={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{ce[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const se={};ce.transitional=function(t,e,n){function r(t,e){return"[Axios v1.7.7] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,i)=>{if(!1===t)throw new K(r(o," has been removed"+(e?" in "+e:"")),K.ERR_DEPRECATED);return e&&!se[o]&&(se[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,o,i)}};const ue={assertOptions:function(t,e,n){if("object"!=typeof t)throw new K("options must be an object",K.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],a=e[i];if(a){const e=t[i],n=void 0===e||a(e,i,t);if(!0!==n)throw new K("option "+i+" must be "+n,K.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new K("Unknown option "+i,K.ERR_BAD_OPTION)}},validators:ce},le=ue.validators;class fe{constructor(t){this.defaults=t,this.interceptors={request:new ut,response:new ut}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Ut(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&ue.assertOptions(n,{silentJSONParsing:le.transitional(le.boolean),forcedJSONParsing:le.transitional(le.boolean),clarifyTimeoutError:le.transitional(le.boolean)},!1),null!=r&&(Z.isFunction(r)?e.paramsSerializer={serialize:r}:ue.assertOptions(r,{encode:le.function,serialize:le.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&Z.merge(o.common,o[e.method]);o&&Z.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=xt.concat(i,o);const a=[];let c=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(c=c&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const s=[];let u;this.interceptors.response.forEach((function(t){s.push(t.fulfilled,t.rejected)}));let l,f=0;if(!c){const t=[ae.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,s),l=t.length,u=Promise.resolve(e);f<l;)u=u.then(t[f++],t[f++]);return u}l=a.length;let h=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{h=t(h)}catch(t){e.call(this,t);break}}try{u=ae.call(this,h)}catch(t){return Promise.reject(t)}for(f=0,l=s.length;f<l;)u=u.then(s[f++],s[f++]);return u}getUri(t){return st(zt((t=Ut(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}Z.forEach(["delete","get","head","options"],(function(t){fe.prototype[t]=function(e,n){return this.request(Ut(n||{},{method:t,url:e,data:(n||{}).data}))}})),Z.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,o){return this.request(Ut(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}fe.prototype[t]=e(),fe.prototype[t+"Form"]=e(!0)}));const he=fe;class pe{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new kt(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new pe((function(e){t=e})),cancel:t}}}const ye=pe,de={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(de).forEach((([t,e])=>{de[e]=t}));const me=de,ve=function t(e){const n=new he(e),o=r(he.prototype.request,n);return Z.extend(o,he.prototype,n,{allOwnKeys:!0}),Z.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return t(Ut(e,n))},o}(wt);ve.Axios=he,ve.CanceledError=kt,ve.CancelToken=ye,ve.isCancel=Lt,ve.VERSION="1.7.7",ve.toFormData=nt,ve.AxiosError=K,ve.Cancel=ve.CanceledError,ve.all=function(t){return Promise.all(t)},ve.spread=function(t){return function(e){return t.apply(null,e)}},ve.isAxiosError=function(t){return Z.isObject(t)&&!0===t.isAxiosError},ve.mergeConfig=Ut,ve.AxiosHeaders=xt,ve.formToJSON=t=>gt(Z.isHTMLForm(t)?new FormData(t):t),ve.getAdapter=oe,ve.HttpStatusCode=me,ve.default=ve;const ge=ve;function be(t){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},be(t)}function we(){we=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new D(r||[]);return o(a,"_invoke",{value:T(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==be(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=x(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(be(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,D.prototype={constructor:D,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Ee(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function je(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ee(i,r,o,a,c,"next",t)}function c(t){Ee(i,r,o,a,c,"throw",t)}a(void 0)}))}}function Me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Se(r.key),r)}}function Se(t){var e=function(t){if("object"!=be(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==be(e)?e:e+""}var Oe=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.client=ge.create({baseURL:e})},e=[{key:"get",value:function(){var t=je(we().mark((function t(e,n){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.get(e,{params:n});case 3:return r=t.sent,t.abrupt("return",r.data);case 7:throw t.prev=7,t.t0=t.catch(0),new Error("GET ".concat(e," failed: ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,this,[[0,7]])})));return function(e,n){return t.apply(this,arguments)}}()},{key:"post",value:(o=je(we().mark((function t(e,n){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.post(e,n);case 3:return r=t.sent,t.abrupt("return",r.data);case 7:throw t.prev=7,t.t0=t.catch(0),new Error("POST ".concat(e," failed: ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e){return o.apply(this,arguments)})},{key:"put",value:(r=je(we().mark((function t(e,n){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.put(e,n);case 3:return r=t.sent,t.abrupt("return",r.data);case 7:throw t.prev=7,t.t0=t.catch(0),new Error("PUT ".concat(e," failed: ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e){return r.apply(this,arguments)})},{key:"delete",value:(n=je(we().mark((function t(e,n){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.delete(e,{params:n});case 3:return r=t.sent,t.abrupt("return",r.data);case 7:throw t.prev=7,t.t0=t.catch(0),new Error("DELETE ".concat(e," failed: ").concat(t.t0.message));case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e){return n.apply(this,arguments)})}],e&&Me(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r,o}();const Te=Oe;function xe(t){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(t)}function Ne(){Ne=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new D(r||[]);return o(a,"_invoke",{value:T(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==xe(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=x(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(xe(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,D.prototype={constructor:D,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Le(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function De(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ke(r.key),r)}}function ke(t){var e=function(t){if("object"!=xe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xe(e)?e:e+""}var Ie=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.apiManager=e},e=[{key:"fetchMapStyle",value:(n=Ne().mark((function t(e,n,r){return Ne().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.apiManager.get("/map-views/v1/".concat(e,"/").concat(n,"/").concat(r,"/style"));case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),console.error("Error fetching map data:",t.t0),t.abrupt("return",null);case 10:case"end":return t.stop()}}),t,this,[[0,6]])})),r=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){Le(i,r,o,a,c,"next",t)}function c(t){Le(i,r,o,a,c,"throw",t)}a(void 0)}))},function(t,e,n){return r.apply(this,arguments)})}],e&&De(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r}();const _e=Ie;function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Pe(){Pe=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new D(r||[]);return o(a,"_invoke",{value:T(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Ce(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=x(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Ce(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,D.prototype={constructor:D,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Ae(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Be(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ae(i,r,o,a,c,"next",t)}function c(t){Ae(i,r,o,a,c,"throw",t)}a(void 0)}))}}function ze(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Re(r.key),r)}}function Re(t){var e=function(t){if("object"!=Ce(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ce(e)?e:e+""}var Ue=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.apiManager=e},e=[{key:"search",value:(r=Be(Pe().mark((function t(e,n,r,o){var i;return Pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.apiManager.get("/search/v1/".concat(e,"/").concat(n,"/").concat(r),{q:o});case 3:return i=t.sent,t.abrupt("return",i);case 7:return t.prev=7,t.t0=t.catch(0),console.error("Error searching query:",t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e,n,o){return r.apply(this,arguments)})},{key:"fetchContentPlacementDetails",value:(n=Be(Pe().mark((function t(e){var n;return Pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.apiManager.get("/search/v1/details/".concat(e));case 3:return n=t.sent,t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),console.error("Error fetching content placment details:",t.t0),t.abrupt("return",null);case 11:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t){return n.apply(this,arguments)})}],e&&ze(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r}();const Ve=Ue;function Fe(t){return Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(t)}function Qe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ye(r.key),r)}}function Ye(t){var e=function(t){if("object"!=Fe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fe(e)?e:e+""}const He=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.apiKey=null,this.apiManager=new Te("https://api.waygomaps.com"),this.mapViewApi=new _e(this.apiManager),this.SearchApi=new Ve(this.apiManager)},(e=[{key:"setApiKey",value:function(t){this.apiKey=t}},{key:"getMapViewApi",value:function(){return this.mapViewApi}},{key:"getSearchApi",value:function(){return this.SearchApi}}])&&Qe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}());function Ge(t){return new Promise((function(e,n){var r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=function(){return e()},r.onerror=function(){return n(new Error("Failed to load script: ".concat(t)))},document.head.appendChild(r)}))}function Ze(t){return new Promise((function(e,n){var r=document.createElement("link");r.rel="stylesheet",r.href=t,r.onload=function(){return e()},r.onerror=function(){return n(new Error("Failed to load CSS: ".concat(t)))},document.head.appendChild(r)}))}function We(t){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(t)}function qe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Je(r.key),r)}}function Je(t){var e=function(t){if("object"!=We(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=We(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==We(e)?e:e+""}const Ke=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._listeners={}},e=[{key:"on",value:function(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}},{key:"off",value:function(t,e){if(!this._listeners[t])return this;var n=this._listeners[t].indexOf(e);return-1!==n&&this._listeners[t].splice(n,1),this}},{key:"fire",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._listeners[t]?(e.type=t,this._listeners[t].forEach((function(t){return t(e)})),this):this}}],e&&qe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Xe(t){return Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(t)}function $e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tn(r.key),r)}}function tn(t){var e=function(t){if("object"!=Xe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xe(e)?e:e+""}function en(t,e,n){return e=rn(e),function(t,e){if(e&&("object"==Xe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,nn()?Reflect.construct(e,n||[],rn(t).constructor):e.apply(t,n))}function nn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nn=function(){return!!t})()}function rn(t){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rn(t)}function on(t,e){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},on(t,e)}const an=new(function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),en(this,e)}return function(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&&on(t,e)}(e,t),n=e,r=[{key:"emit",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fire(t,e)}}],r&&$e(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ke));function cn(t){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cn(t)}function sn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,un(r.key),r)}}function un(t){var e=function(t){if("object"!=cn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=cn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cn(e)?e:e+""}function ln(t,e,n){return e=hn(e),function(t,e){if(e&&("object"==cn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,fn()?Reflect.construct(e,n||[],hn(t).constructor):e.apply(t,n))}function fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(fn=function(){return!!t})()}function hn(t){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hn(t)}function pn(t,e){return pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pn(t,e)}const yn=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ln(this,e)).options=n,t.globalHandlers={},t.stateSubscriptions=[],t}return function(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&&pn(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){}},{key:"render",value:function(){}},{key:"destroy",value:function(){this.removeAllGlobalHandlers(),this.unsubscribeAllState()}},{key:"addGlobalHandler",value:function(t,e){this.globalHandlers[t]||(this.globalHandlers[t]=[]),this.globalHandlers[t].push(e),an.on(t,e)}},{key:"removeGlobalHandler",value:function(t,e){this.globalHandlers[t]&&(this.globalHandlers[t]=this.globalHandlers[t].filter((function(t){return t!==e})),an.off(t,e))}},{key:"removeAllGlobalHandlers",value:function(){var t=this,e=function(e){t.globalHandlers[e].forEach((function(t){return an.off(e,t)}))};for(var n in this.globalHandlers)e(n);this.globalHandlers={}}},{key:"subscribeToState",value:function(t){this.stateSubscriptions.push(t),StateStore.subscribe(t)}},{key:"unsubscribeFromState",value:function(t){this.stateSubscriptions=this.stateSubscriptions.filter((function(e){return e!==t})),StateStore.unsubscribe(t)}},{key:"unsubscribeAllState",value:function(){this.stateSubscriptions.forEach((function(t){return StateStore.unsubscribe(t)})),this.stateSubscriptions=[]}}])&&sn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ke);function dn(t){return dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(t)}function mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vn(r.key),r)}}function vn(t){var e=function(t){if("object"!=dn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dn(e)?e:e+""}const gn=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.mapView=e,this.state="default",this.stateHistory=["default"]},e=[{key:"transitionTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.state=t;var n=this.stateHistory[this.stateHistory.length-1];"default"==t?this.stateHistory=["default"]:t!==n&&this.stateHistory.push(t),console.log("STATE LENGTH PROPER",this.stateHistory.length,this.stateHistory),this.mapView.fire("state:".concat(t),e)}}],e&&mn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function bn(t){return bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bn(t)}function wn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,En(r.key),r)}}function En(t){var e=function(t){if("object"!=bn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bn(e)?e:e+""}function jn(t,e,n){return e=Sn(e),function(t,e){if(e&&("object"==bn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Mn()?Reflect.construct(e,n||[],Sn(t).constructor):e.apply(t,n))}function Mn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mn=function(){return!!t})()}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}function On(t,e){return On=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},On(t,e)}const Tn=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=jn(this,e,[r])).result=t,n._initialize(),n}return function(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&&On(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="search-results-view-cell",this.render(),this._setupEventListeners()}},{key:"_setupEventListeners",value:function(){var t=this;this.element.addEventListener("click",(function(){return t.fire("click",{result:t.result})}))}},{key:"render",value:function(){this.element.innerHTML='\n <div class="result-title">'.concat(this.result.name,'</div>\n <div class="result-subtitle">').concat(this.result.contextual_location,"</div>\n ")}},{key:"getElement",value:function(){return this.element}}])&&wn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function xn(t){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xn(t)}function Nn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ln(r.key),r)}}function Ln(t){var e=function(t){if("object"!=xn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xn(e)?e:e+""}function Dn(t,e,n){return e=In(e),function(t,e){if(e&&("object"==xn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,kn()?Reflect.construct(e,n||[],In(t).constructor):e.apply(t,n))}function kn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(kn=function(){return!!t})()}function In(t){return In=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},In(t)}function _n(t,e){return _n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_n(t,e)}const Cn=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Dn(this,e,[n]))._initialize(),t}return function(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&&_n(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.results=[],this.element=document.createElement("div"),this.element.className="search-results-view",this.titleElement=document.createElement("h3"),this.titleElement.className="search-results-title",this.element.appendChild(this.titleElement)}},{key:"updateView",value:function(t,e){this.results=t,t.length>1&&this.setTitle("".concat(t.length," results found for '").concat(e,"'")),1===t.length&&this.setTitle("".concat(t.length," result found for '").concat(e,"'")),0===t.length&&this.setTitle("No matching results for '".concat(e,"'")),this.render()}},{key:"updateResults",value:function(t){this.results=t,this.render()}},{key:"render",value:function(){for(var t=this;this.element.children.length>1;)this.element.removeChild(this.element.lastChild);this.results.forEach((function(e){var n=new Tn(e);n.on("click",(function(){return t.fire("selectCell",{result:e})})),t.element.appendChild(n.getElement())}))}},{key:"setTitle",value:function(t){this.titleElement.innerText=t}},{key:"show",value:function(){this.element.classList.add("visible")}},{key:"hide",value:function(){this.element.classList.remove("visible")}},{key:"getElement",value:function(){return this.element}}])&&Nn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Pn(t){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pn(t)}function An(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bn(r.key),r)}}function Bn(t){var e=function(t){if("object"!=Pn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pn(e)?e:e+""}const zn=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.map=null,this.currentViewType=null},(e=[{key:"onAdd",value:function(t){this.map=t}},{key:"onRemove",value:function(){this.container&&(this.container.parentNode.removeChild(this.container),this.map=void 0)}},{key:"_attachResizeListener",value:function(){var t=this;window.addEventListener("resize",(function(){var e=t.map.mapContainer.offsetWidth;t._configureView(e)}))}},{key:"_initialize",value:function(){if(this.map){var t=this.map.mapContainer.offsetWidth;this._configureView(t)}}},{key:"_configureView",value:function(t){t>767?this._setViewForDesktop():this._setViewForMobile()}},{key:"_setViewForDesktop",value:function(){this.currentViewType="desktop",this._updateContentView()}},{key:"_setViewForMobile",value:function(){this.currentViewType="mobile",this._updateContentView()}},{key:"_updateContentView",value:function(){this._clearViews(),"desktop"===this.currentViewType?this._renderDesktopView():this._renderMobileView()}},{key:"_clearViews",value:function(){for(;this.container.firstChild;)this.container.removeChild(this.container.firstChild),this.container.classList.remove("mobile-view"),this.container.classList.remove("desktop-view")}},{key:"show",value:function(){this.container&&(this.container.style.display="block")}},{key:"hide",value:function(){this.container&&(this.container.style.display="none")}},{key:"_renderDesktopView",value:function(){console.log("main control")}},{key:"_renderMobileView",value:function(){}}])&&An(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Rn(t){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rn(t)}function Un(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vn(r.key),r)}}function Vn(t){var e=function(t){if("object"!=Rn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rn(e)?e:e+""}function Fn(t,e,n){return e=Hn(e),function(t,e){if(e&&("object"==Rn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qn()?Reflect.construct(e,n||[],Hn(t).constructor):e.apply(t,n))}function Qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qn=function(){return!!t})()}function Yn(){return Yn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Hn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Yn.apply(null,arguments)}function Hn(t){return Hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hn(t)}function Gn(t,e){return Gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gn(t,e)}const Zn=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Fn(this,e,[n])).searchResultsView=new Cn,t.searchedQuery=null,t.map=null,t}return function(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&&Gn(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){this.map=t,this.container=document.createElement("div"),this.container.className="search-results-control-container";var e=this.searchResultsView.getElement();return this.container.appendChild(e),this.hide(),this.initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=Yn(Hn(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"initializeEventListeners",value:function(){this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("initiate:search",this._handleInitiateSearchState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this)),this.searchResultsView.on("closeView",this._handleCloseSearchResultsView.bind(this)),this.searchResultsView.on("selectCell",this._handleSearchResultSelect.bind(this))}},{key:"_renderDesktopView",value:function(){var t=this.searchResultsView.getElement();this.container.appendChild(t),this.container.classList.remove("mobile-view"),this.container.classList.add("desktop-view"),console.log("rendering search results DESKTOP")}},{key:"_renderMobileView",value:function(){var t=this.searchResultsView.getElement();this.container.appendChild(t),this.container.classList.remove("desktop-view"),this.container.classList.add("mobile-view"),console.log("rendering search results MOBILE")}},{key:"_handleInitiateSearchState",value:function(){this.map.setToSearchState(this.searchedQuery)}},{key:"_handleSearchResultSelect",value:function(t){var e=t.result.placement_id;this.map.setToSelectedContentState([e])}},{key:"_handleCloseSearchResultsView",value:function(){this.map.setToDefaultState()}},{key:"_handleDefaultState",value:function(){this.searchedQuery=null,this.searchResultsView.updateResults([]),console.log("hiding search results"),this.hide()}},{key:"_handleSearchState",value:function(t){var e=t.query,n=t.results;this.searchedQuery=e,this.searchResultsView.updateResults([]),this.searchResultsView.updateView(n,e),this.show()}},{key:"_handleSelectedContentState",value:function(t){this.searchResultsView.updateResults([]),this.hide()}},{key:"_handleDirectionsState",value:function(t){console.log("handling directions state in search results control")}}],r&&Un(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);function Wn(t){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(t)}function qn(){qn=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new D(r||[]);return o(a,"_invoke",{value:T(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Wn(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=x(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Wn(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,D.prototype={constructor:D,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Jn(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Kn(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Jn(i,r,o,a,c,"next",t)}function c(t){Jn(i,r,o,a,c,"throw",t)}a(void 0)}))}}function Xn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xn(Object(n),!0).forEach((function(e){tr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function tr(t,e,n){return(e=nr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function er(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nr(r.key),r)}}function nr(t){var e=function(t){if("object"!=Wn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Wn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wn(e)?e:e+""}function rr(t,e,n){return e=ir(e),function(t,e){if(e&&("object"==Wn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,or()?Reflect.construct(e,n||[],ir(t).constructor):e.apply(t,n))}function or(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(or=function(){return!!t})()}function ir(t){return ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ir(t)}function ar(t,e){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ar(t,e)}var cr={"c66d7e2c3ebd4a8fa60efa5bf3b5b301:2d4911eda2ef4950b307e51cd0ccf35e":{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"],path:[[-81.55730801074388,-195.68687504906683],[-66.79352848318483,-195.68687504906688],[-66.79352848318483,-136.30367294932935],[-6.7541584044446665,-136.30367294932955],[-6.7541584044446195,-106.92078820451393],[81.82851876090972,-106.92078820451393],[81.82851876090972,-47.20950211527508],[140.88363687114594,-47.20950211527508]]}},sr={container:"map",sourceId:"collision-conference.2024.2xw_YUXYS8GoDTB2AQgN3A",center:[0,0],zoom:12,bearing:0,pitch:0,minPitch:0,maxPitch:75,minZoom:0,maxZoom:22,bounds:null,doubleClickZoom:!0,dragPan:!0,dragRotate:!0,scrollZoom:!0,touchPitch:!0,touchZoomRotate:!0,interactive:!0,trackResize:!0,keyboard:!0},ur=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=rr(this,e,[$n($n({},sr),n)])).mapViewApi=He.getMapViewApi(),t.searchApi=He.getSearchApi(),t.mapContainer=document.createElement("div"),t.mapContainer.className="inner-map-container",t.ready=t._initialize(n),t._stateCoordinator=new gn(t),t}return function(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&&ar(t,e)}(e,t),n=e,r=[{key:"_initialize",value:(f=Kn(qn().mark((function t(){var e,n=this;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Initializing map view component.."),t.prev=1,t.next=4,this._loadMapLibraries();case 4:return this.render(),t.next=7,this._fetchMapStyle();case 7:e=t.sent,"undefined"!=typeof mapboxgl&&e?(mapboxgl.accessToken="pk.eyJ1Ijoid2F5Z28tbWFwcyIsImEiOiJjbGtxYzZ1N3QxdG43M210bXFuYmJ4a3gxIn0.tlbznj_fRJ8La6s2UUMO6A",this.map=new mapboxgl.Map({container:this.mapContainer,style:"mapbox://styles/waygo-maps/".concat(e),center:this.options.center,zoom:this.options.zoom,bearing:this.options.bearing,pitch:this.options.pitch,minPitch:this.options.minPitch,maxPitch:this.options.maxPitch,minZoom:this.options.minZoom,maxZoom:this.options.maxZoom,bounds:this.options.bounds,doubleClickZoom:this.options.doubleClickZoom,dragPan:this.options.dragPan,dragRotate:this.options.dragRotate,scrollZoom:this.options.scrollZoom,touchPitch:this.options.touchPitch,touchZoomRotate:this.options.touchZoomRotate,interactive:this.options.interactive,trackResize:this.options.trackResize,keyboard:this.options.keyboard}),this.map.on("load",(function(){return n.fire("load")})),this._initializeEventListeners()):console.error("Mapbox GL JS is not loaded."),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),console.error("Failed to initialize the map:",t.t0);case 14:case"end":return t.stop()}}),t,this,[[1,11]])}))),function(){return f.apply(this,arguments)})},{key:"_initializeEventListeners",value:function(){var t=this;this.mapContainer.addEventListener("mousedown",(function(e){return t.fire("mousedown",{originalEvent:e})})),this.mapContainer.addEventListener("click",(function(e){return t.fire("click",{originalEvent:e})})),this.mapContainer.addEventListener("mouseover",(function(e){return t.fire("mouseover",{originalEvent:e})})),this.mapContainer.addEventListener("mousemove",(function(e){return t.fire("mousemove",{originalEvent:e})})),this.mapContainer.addEventListener("dblclick",(function(e){return t.fire("dblclick",{originalEvent:e})})),this.mapContainer.addEventListener("mouseout",(function(e){return t.fire("mouseout",{originalEvent:e})})),this.mapContainer.addEventListener("contextmenu",(function(e){return t.fire("contextmenu",{originalEvent:e})})),this.mapContainer.addEventListener("wheel",(function(e){return t.fire("wheel",{originalEvent:e})})),this.mapContainer.addEventListener("touchstart",(function(e){return t.fire("touchstart",{originalEvent:e})})),this.mapContainer.addEventListener("touchend",(function(e){return t.fire("touchend",{originalEvent:e})})),this.mapContainer.addEventListener("touchmove",(function(e){return t.fire("touchmove",{originalEvent:e})})),this.mapContainer.addEventListener("touchcancel",(function(e){return t.fire("touchcancel",{originalEvent:e})})),this.mapContainer.addEventListener("move",(function(e){return t.fire("move",{originalEvent:e})})),["movestart","move","moveend","dragstart","drag","dragend","zoomstart","zoom","zoomend","rotatestart","rotate","rotateend","pitchstart","pitch","pitchend","boxzoomstart","boxzoomend","boxzoomcancel"].forEach((function(e){t.map.on(e,(function(n){t.fire(e,{originalEvent:n})}))}))}},{key:"_fetchMapStyle",value:(l=Kn(qn().mark((function t(){var e,n,r,o,i;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(3===(e=this.options.sourceId.split(".")).length){t.next=4;break}return console.error('The mapViewId format is incorrect. It should be in the format "businessId.mapId.mapViewId".'),t.abrupt("return");case 4:return n=e[0]||"",r=e[1]||"",o=e[2]||"",t.prev=7,t.next=10,this.mapViewApi.fetchMapStyle(n,r,o);case 10:return i=t.sent,console.log("Fetched map style:",i.style_id),t.abrupt("return",i.style_id);case 15:t.prev=15,t.t0=t.catch(7),console.error("Error fetching map style:",t.t0);case 18:case"end":return t.stop()}}),t,this,[[7,15]])}))),function(){return l.apply(this,arguments)})},{key:"_loadMapLibraries",value:(u=Kn(qn().mark((function t(){return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Loading map libraries"),t.next=3,Ze("https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css");case 3:return t.next=5,Ge("https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js");case 5:console.log("Map libraries loaded");case 6:case"end":return t.stop()}}),t)}))),function(){return u.apply(this,arguments)})},{key:"render",value:function(){var t=document.getElementById(this.options.container);t?(t.appendChild(this.mapContainer),this.mapContainer.style.width="100%",this.mapContainer.style.height="100%",this.mapContainer.style.position="relative"):console.error('Container element with id "'.concat(this.containerId,'" not found.'))}},{key:"addControl",value:function(t){var e=t.onAdd(this);this.mapContainer.appendChild(e)}},{key:"removeControl",value:function(t){this.map.removeControl(t)}},{key:"setToDefaultState",value:function(){this._stateCoordinator.transitionTo("default")}},{key:"setToSearchState",value:(s=Kn(qn().mark((function t(e){var n;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.search(e);case 2:n=t.sent,this._stateCoordinator.transitionTo("search",{query:e,results:n});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return s.apply(this,arguments)})},{key:"setToSelectedContentState",value:(c=Kn(qn().mark((function t(e){var n,r;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e[e.length-1],t.next=3,this.getContentPlacementDetails(n);case 3:r=t.sent,this._stateCoordinator.transitionTo("selectedContent",{contentPlacementIds:e,selectedContentPlacement:r});case 5:case"end":return t.stop()}}),t,this)}))),function(t){return c.apply(this,arguments)})},{key:"setToDirectionsState",value:(a=Kn(qn().mark((function t(){var e,n,r,o,i=arguments;return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:null,r=null,!(e=i.length>0&&void 0!==i[0]?i[0]:null)){t.next=7;break}return t.next=6,this.getContentPlacementDetails(e);case 6:r=t.sent;case 7:if(o=null,!n){t.next=12;break}return t.next=11,this.getContentPlacementDetails(n);case 11:o=t.sent;case 12:this._stateCoordinator.transitionTo("directions",{startContentPlacement:r,endContentPlacement:o});case 13:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"initiateBack",value:function(){this.fire("initiate:back")}},{key:"initiateSetToSearchState",value:function(){this.fire("initiate:search")}},{key:"findPath",value:function(t,e){console.log("finding path",t,e);var n=cr["".concat(t,":").concat(e)];console.log("DATA",n);var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;null===e&&(e=[0,0]),console.log("CHECK1",e);var r=[],o=function(t){console.log("CHECK3");var e=t*Math.PI/180,n=6378137,r=6356752.314;console.log("CHECK4",e,n,r);var o=(Math.pow(n,.5)-Math.pow(r,.5))/Math.pow(n,.5);console.log("CHECK5",o);var i=1/(111132.954-559.822*Math.cos(2*e)+1.175*Math.cos(4*e));console.log("CHECK6",i);var a=1/(Math.PI*n*Math.cos(e)/(180*Math.pow(1-Math.pow(o,2)*Math.pow(Math.sin(e),2),.5)));return console.log("CHECK7",a),{meterToLat:i,meterToLon:a}}(e[1]),i=o.meterToLat,a=o.meterToLon;return console.log("CHECK2",i,a),t.forEach((function(t){var o=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=t[0],a=t[1],c=e[0];return{lat:e[1]+a*o*n,lon:c+i*o*r}}(t,e,i,a,n),c=o.lat,s=o.lon;r.push([s,c])})),r}(n.path,null,10);return console.log("COORDINATES:",r),{coordinates:r,steps:n.steps}}},{key:"_findFeatureByPlacementId",value:function(t){var e=this.map.queryRenderedFeatures({filter:["==",["get","placement_id"],t]});return e.length>0?e[0]:null}},{key:"getCenter",value:function(){if(this.map)return this.map.getCenter();console.error("Map is not initialized.")}},{key:"setCenter",value:function(t){this.map?this.map.setCenter(t):console.error("Map is not initialized.")}},{key:"search",value:(i=Kn(qn().mark((function t(e){return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""!==e){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,this.searchApi.search("e9df990cbd084934973a87fc2f3b0e74","move-america-2024","FTdsy9btTs6qumoZ6E8Z2Q",e);case 5:return t.abrupt("return",t.sent);case 8:t.prev=8,t.t0=t.catch(2),axios.isCancel(t.t0)?console.log("Request canceled:",t.t0.message):console.error("Search error:",t.t0);case 11:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return i.apply(this,arguments)})},{key:"getContentPlacementDetails",value:(o=Kn(qn().mark((function t(e){return qn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.searchApi.fetchContentPlacementDetails(e);case 3:return t.abrupt("return",t.sent);case 6:t.prev=6,t.t0=t.catch(0),axios.isCancel(t.t0)?console.log("Request canceled:",t.t0.message):console.error("Fetching content placement details error:",t.t0);case 9:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(t){return o.apply(this,arguments)})}],r&&er(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i,a,c,s,u,l,f}(yn);function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function fr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hr(r.key),r)}}function hr(t){var e=function(t){if("object"!=lr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lr(e)?e:e+""}function pr(t,e,n){return e=dr(e),function(t,e){if(e&&("object"==lr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yr()?Reflect.construct(e,n||[],dr(t).constructor):e.apply(t,n))}function yr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yr=function(){return!!t})()}function dr(t){return dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dr(t)}function mr(t,e){return mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mr(t,e)}const vr=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=pr(this,e,[n]))._initialize(),t}return function(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&&mr(t,e)}(e,t),n=e,r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="search-bar-container",this.input=document.createElement("input"),this.input.type="text",this.input.placeholder="Search MOVE America 2024",this.input.className="search-bar",this.rightButton=document.createElement("button"),this.rightButton.className="search-bar-button-right",this.updateRightButtonIcon("search"),this.leftButton=document.createElement("button"),this.leftButton.className="search-bar-button-left",this.updateLeftButtonIcon("none"),this.element.appendChild(this.leftButton),this.element.appendChild(this.input),this.element.appendChild(this.rightButton),this._setupEventListeners()}},{key:"_setupEventListeners",value:function(){var t=this;this.input.addEventListener("input",(function(e){return t._handleInput(e)})),this.input.addEventListener("focus",this._handleFocus.bind(this)),this.input.addEventListener("blur",this._handleBlur.bind(this)),this.input.addEventListener("keydown",(function(e){"Enter"===e.key&&t._handleEnterSelect(e)})),this.rightButton.addEventListener("click",(function(e){return t._handleRightButtonSelect(e)})),this.leftButton.addEventListener("click",(function(e){return t._handleLeftButtonSelect(e)}))}},{key:"_handleInput",value:function(t){this.fire("input",{event:t,query:this.getText()})}},{key:"_handleFocus",value:function(){this.fire("focus")}},{key:"_handleBlur",value:function(){var t=this;setTimeout((function(){var e=document.activeElement;e===t.rightButton?(t.updateStyleWithoutSuggestions(),t.fire("blur")):e===t.input||(t.updateStyleWithoutSuggestions(),t.fire("blur"))}),150)}},{key:"_handleEnterSelect",value:function(t){var e=this.getText();e.length>0&&(this.fire("search",{query:e,event:t}),this.input.blur())}},{key:"_handleRightButtonSelect",value:function(t){if("search"===this.rightButtonState){var e=this.getText();e.length>0&&(this.fire("search",{query:e,event:t}),this.input.blur())}else"cancel"===this.rightButtonState&&this.fire("cancel",{event:t})}},{key:"_handleLeftButtonSelect",value:function(t){"logo"===this.leftButtonState?this.input.focus():"back"===this.leftButtonState&&this.fire("back")}},{key:"updateStyleWithSuggestions",value:function(){this.element.classList.add("with-results")}},{key:"updateStyleWithoutSuggestions",value:function(){this.element.classList.remove("with-results")}},{key:"updateRightButtonIcon",value:function(t){this.rightButtonState=t,"search"===t?(this.rightButton.innerHTML='<img src="'.concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIgc3Ryb2tlPSIjMTcxNzE3IiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTIwIDIwTDE3IDE3IiBzdHJva2U9IiMxNzE3MTciIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPgo=",'" alt="Search" />'),this.rightButton.style.display="flex"):"cancel"===t?(this.rightButton.innerHTML='<img src="'.concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE4IDZMNiAxOCIgc3Ryb2tlPSIjMTcxNzE3IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNNiA2TDE4IDE4IiBzdHJva2U9IiMxNzE3MTciIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=",'" alt="Cancel" />'),this.rightButton.style.display="flex"):"none"===t&&(this.rightButton.style.display="none")}},{key:"updateLeftButtonIcon",value:function(t){if(console.log("UPDATING LEFT BAR BUTTON TO STATE:",t),this.leftButtonState=t,"logo"===t){this.leftButton.innerHTML='<img src="'.concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQ5IiBoZWlnaHQ9IjExNyIgdmlld0JveD0iMCAwIDE0OSAxMTciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0yMC41IDk2LjgwOVY1Mi42ODIxTDYwLjE5NzIgMjYuMTI5NEM2OS45MzMyIDIwLjg1OTIgNzMuMzM3MiAyMC4yNTM5IDc1LjIwMjEgMjAuMjU1MUM3Ny4wMzg2IDIwLjI1NjQgODAuMzU4MSAyMC44NDU0IDg5LjkwMzEgMjYuMDUyOEwxMDEuNSAzNC4wMDg2VjkuNzU1MTJMMTAyLjA5OCAxMC4xNjVMMTAwLjQgOC45OTk5OUM3OS4zMzc2IC0yLjYzOTk3IDcxLjE1OTUgLTIuNjc5NjYgNDkuODMzMyA4Ljk5OTk5TDkuMzgwNTIgMzYuMDU4MkMzLjgzMTI2IDM5Ljc3IDAuNSA0Ni4wMDU5IDAuNSA1Mi42ODIxVjk2LjgwOUMwLjUgMTEwLjY1OCAxNC4yMzU4IDEyMC4zMTYgMjcuMjY3OSAxMTUuNjI5TDY3LjczMiAxMDEuMDc4QzcyLjEwNjkgOTkuNTA0MyA3Ni44OTMxIDk5LjUwNDMgODEuMjY4IDEwMS4wNzhMMTIxLjczMiAxMTUuNjI5QzEzNC43NjQgMTIwLjMxNiAxNDguNSAxMTAuNjU4IDE0OC41IDk2LjgwOVY1Mi41MzE1QzE0OC41IDQ1LjkzODUgMTQ1LjI1MSAzOS43NjkxIDEzOS44MTQgMzYuMDM5NEwxMjguNSAyOC4yNzc1Vjk2LjgwOUw4OC4wMzU5IDgyLjI1NzVDNzkuMjg2MiA3OS4xMTEgNjkuNzEzOCA3OS4xMTEgNjAuOTY0MSA4Mi4yNTc1TDIwLjUgOTYuODA5WiIgZmlsbD0iIzFFMUUxRSIvPgo8L3N2Zz4K",'" alt="').concat(t,'" />');var e=this.leftButton.querySelector("img");e.style.width="16px",e.style.height="16px",this.leftButton.style.display="flex"}else if("back"===t){this.leftButton.innerHTML='<img src="'.concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTguNDYwMDIgMTEuMjg5NUwxNC4xMiA1LjYzOTU1QzE0LjIxMyA1LjU0NTgyIDE0LjMyMzYgNS40NzE0MyAxNC40NDU0IDUuNDIwNjZDMTQuNTY3MyA1LjM2OTg5IDE0LjY5OCA1LjM0Mzc1IDE0LjgzIDUuMzQzNzVDMTQuOTYyIDUuMzQzNzUgMTUuMDkyNyA1LjM2OTg5IDE1LjIxNDYgNS40MjA2NkMxNS4zMzY1IDUuNDcxNDMgMTUuNDQ3MSA1LjU0NTgyIDE1LjU0IDUuNjM5NTVDMTUuNzI2MyA1LjgyNjkxIDE1LjgzMDggNi4wODAzNiAxNS44MzA4IDYuMzQ0NTVDMTUuODMwOCA2LjYwODczIDE1LjcyNjMgNi44NjIxOSAxNS41NCA3LjA0OTU1TDEwLjU5IDEyLjA0OTVMMTUuNTQgMTYuOTk5NUMxNS43MjYzIDE3LjE4NjkgMTUuODMwOCAxNy40NDA0IDE1LjgzMDggMTcuNzA0NUMxNS44MzA4IDE3Ljk2ODcgMTUuNzI2MyAxOC4yMjIyIDE1LjU0IDE4LjQwOTVDMTUuNDQ3NCAxOC41MDQgMTUuMzM3IDE4LjU3OTIgMTUuMjE1MSAxOC42MzA3QzE1LjA5MzIgMTguNjgyMiAxNC45NjIzIDE4LjcwOSAxNC44MyAxOC43MDk1QzE0LjY5NzcgMTguNzA5IDE0LjU2NjggMTguNjgyMiAxNC40NDUgMTguNjMwN0MxNC4zMjMxIDE4LjU3OTIgMTQuMjEyNiAxOC41MDQgMTQuMTIgMTguNDA5NUw4LjQ2MDAyIDEyLjc1OTVDOC4zNTg1MSAxMi42NjU5IDguMjc3NSAxMi41NTIzIDguMjIyMSAxMi40MjU4QzguMTY2NjkgMTIuMjk5MyA4LjEzODA5IDEyLjE2MjYgOC4xMzgwOSAxMi4wMjQ1QzguMTM4MDkgMTEuODg2NCA4LjE2NjY5IDExLjc0OTggOC4yMjIxIDExLjYyMzNDOC4yNzc1IDExLjQ5NjggOC4zNTg1MSAxMS4zODMyIDguNDYwMDIgMTEuMjg5NVYxMS4yODk1WiIgZmlsbD0iIzFFMUUxRSIvPgo8L3N2Zz4K",'" alt="').concat(t,'" />');var n=this.leftButton.querySelector("img");n.style.width="20px",n.style.height="20px",this.leftButton.style.display="flex"}else"none"===t&&(this.leftButton.style.display="none")}},{key:"getText",value:function(){return this.input.value}},{key:"setText",value:function(t){this.input.value=t}},{key:"setPlaceholderText",value:function(t){this.input.placeholder=t}},{key:"getElement",value:function(){return this.element}},{key:"setViewForDesktop",value:function(){this.element.classList.remove("mobile-view"),this.input.classList.remove("mobile-view")}},{key:"setViewForMobile",value:function(){this.element.classList.add("mobile-view"),this.input.classList.add("mobile-view")}}],r&&fr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function gr(t){return gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gr(t)}function br(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wr(r.key),r)}}function wr(t){var e=function(t){if("object"!=gr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gr(e)?e:e+""}function Er(t,e,n){return e=Mr(e),function(t,e){if(e&&("object"==gr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,jr()?Reflect.construct(e,n||[],Mr(t).constructor):e.apply(t,n))}function jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jr=function(){return!!t})()}function Mr(t){return Mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mr(t)}function Sr(t,e){return Sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sr(t,e)}const Or=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Er(this,e,[r])).result=t,n._initialize(),n}return function(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&&Sr(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="search-bar-suggestions-view-cell",this.render(),this._setupEventListeners()}},{key:"_setupEventListeners",value:function(){var t=this;this.element.addEventListener("click",(function(){return t.fire("click",{result:t.result})}))}},{key:"render",value:function(){this.element.innerHTML='\n <div class="suggestion-title">'.concat(this.result.name,'</div>\n <div class="suggestion-subtitle">').concat(this.result.contextual_location,"</div>\n ")}},{key:"getElement",value:function(){return this.element}}])&&br(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Tr(t){return Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tr(t)}function xr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Nr(r.key),r)}}function Nr(t){var e=function(t){if("object"!=Tr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tr(e)?e:e+""}function Lr(t,e,n){return e=kr(e),function(t,e){if(e&&("object"==Tr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Dr()?Reflect.construct(e,n||[],kr(t).constructor):e.apply(t,n))}function Dr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Dr=function(){return!!t})()}function kr(t){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kr(t)}function Ir(t,e){return Ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ir(t,e)}const _r=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Lr(this,e,[n]))._initialize(),t}return function(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&&Ir(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.results=[],this.element=document.createElement("div"),this.element.className="search-bar-suggestions-view"}},{key:"updateResults",value:function(t){this.results=t,this.render()}},{key:"render",value:function(){var t=this;this.element.innerHTML="",this.results.forEach((function(e){var n=new Or(e);n.on("click",(function(){return t.fire("selectCell",{result:e})})),t.element.appendChild(n.getElement())}))}},{key:"clearResults",value:function(){this.updateResults([])}},{key:"show",value:function(){this.element.classList.add("visible")}},{key:"hide",value:function(){this.element.classList.remove("visible")}},{key:"getElement",value:function(){return this.element}},{key:"setViewForDesktop",value:function(){console.log("HERE")}},{key:"setViewForMobile",value:function(){console.log("HERE")}}])&&xr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Cr(t){return Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(t)}function Pr(){Pr=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new D(r||[]);return o(a,"_invoke",{value:T(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Cr(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=x(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Cr(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,D.prototype={constructor:D,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Ar(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Br(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ar(i,r,o,a,c,"next",t)}function c(t){Ar(i,r,o,a,c,"throw",t)}a(void 0)}))}}function zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rr(r.key),r)}}function Rr(t){var e=function(t){if("object"!=Cr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cr(e)?e:e+""}function Ur(t,e,n){return e=Fr(e),function(t,e){if(e&&("object"==Cr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Vr()?Reflect.construct(e,n||[],Fr(t).constructor):e.apply(t,n))}function Vr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Vr=function(){return!!t})()}function Fr(t){return Fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fr(t)}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}const Yr=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Ur(this,e,[n])).searchApi=He.getSearchApi(),t.element=document.createElement("div"),t.element.className="search-box",t.searchBar=new vr,t.searchBarSuggestionsView=new _r,t.searchCount=0,t.initializeHandlers(),t._render(),t}return function(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&&Qr(t,e)}(e,t),n=e,r=[{key:"initializeHandlers",value:function(){this.searchBar.on("input",this._handleSearchBarInput.bind(this)),this.searchBar.on("focus",this._handleSearchBarFocus.bind(this)),this.searchBar.on("blur",this._handleSearchBarBlur.bind(this)),this.searchBar.on("search",this._handleSearchBarSearch.bind(this)),this.searchBar.on("back",this._handleSearchBarBack.bind(this)),this.searchBarSuggestionsView.on("selectCell",this._handleSearchResultSelect.bind(this))}},{key:"_handleSearchBarBack",value:function(){this.fire("selectBack")}},{key:"_handleSearchBarSearch",value:function(t){var e=t.query;t.event,console.log("Handling search",e),this.fire("search",{query:e})}},{key:"_handleSearchResultSelect",value:function(t){t.result}},{key:"_handleSearchBarFocus",value:(a=Br(Pr().mark((function t(){var e;return Pr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!((e=this.searchBar.getText()).length>0)){t.next=5;break}return t.next=4,this.getSearchBarSuggestions(e);case 4:this.openSuggestionsView();case 5:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"_handleSearchBarBlur",value:function(){this.searchBarSuggestionsView.hide()}},{key:"_handleSearchBarInput",value:(i=Br(Pr().mark((function t(e){var n;return Pr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.query,this.openSuggestionsView(),t.next=4,this.getSearchBarSuggestions(n);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"_render",value:function(){this.element.appendChild(this.searchBar.getElement()),this.element.appendChild(this.searchBarSuggestionsView.getElement())}},{key:"setViewForDesktop",value:function(){console.log("Setting view for desktop"),this.searchBar.setViewForDesktop(),this.searchBarSuggestionsView.setViewForDesktop()}},{key:"setViewForMobile",value:function(){console.log("Setting view for mobile"),this.searchBar.setViewForMobile(),this.searchBarSuggestionsView.setViewForMobile()}},{key:"getElement",value:function(){return this.element}},{key:"openSuggestionsView",value:function(){this.searchBarSuggestionsView.show(),this.searchBar.updateStyleWithSuggestions()}},{key:"closeSuggestionsView",value:function(){this.searchBarSuggestionsView.hide(),this.searchBar.updateStyleWithoutSuggestions()}},{key:"getSearchBarSuggestions",value:(o=Br(Pr().mark((function t(e){var n,r;return Pr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=++this.searchCount,""!==e){t.next=5;break}return this.searchBarSuggestionsView.updateResults([]),this.closeSuggestionsView(),t.abrupt("return");case 5:return t.prev=5,t.next=8,this.searchApi.search("e9df990cbd084934973a87fc2f3b0e74","move-america-2024","FTdsy9btTs6qumoZ6E8Z2Q",e);case 8:r=t.sent,n===this.searchCount&&this.searchBarSuggestionsView.updateResults(r),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),ge.isCancel(t.t0)?console.log("Request canceled:",t.t0.message):console.error("Search error:",t.t0);case 15:case"end":return t.stop()}}),t,this,[[5,12]])}))),function(t){return o.apply(this,arguments)})}],r&&zr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i,a}(yn);function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function Gr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zr(r.key),r)}}function Zr(t){var e=function(t){if("object"!=Hr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hr(e)?e:e+""}function Wr(t,e,n){return e=Kr(e),function(t,e){if(e&&("object"==Hr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qr()?Reflect.construct(e,n||[],Kr(t).constructor):e.apply(t,n))}function qr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qr=function(){return!!t})()}function Jr(){return Jr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Kr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Jr.apply(null,arguments)}function Kr(t){return Kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kr(t)}function Xr(t,e){return Xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xr(t,e)}const $r=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Wr(this,e,[n])).searchBox=new Yr,t}return function(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&&Xr(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){this.map=t,this.container=document.createElement("div"),this.container.className="search-box-control-container";var e=this.searchBox.getElement();return this.container.appendChild(e),this._initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.show(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=Jr(Kr(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"_initializeEventListeners",value:function(){this.searchBox.searchBarSuggestionsView.on("selectCell",this._handleSuggestionSelect.bind(this)),this.searchBox.searchBar.on("cancel",this._handleSearchBarCancel.bind(this)),this.searchBox.on("search",this._handleSearchBoxSearch.bind(this)),this.searchBox.on("selectBack",this._handleSearchBoxSelectBack.bind(this)),this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this))}},{key:"_renderDesktopView",value:function(){var t=this.searchBox.getElement();this.container.appendChild(t),this.container.classList.add("desktop-view"),this.container.classList.remove("mobile-view"),t&&this.searchBox.setViewForDesktop()}},{key:"_renderMobileView",value:function(){var t=this.searchBox.getElement();this.container.appendChild(t),this.container.classList.add("mobile-view"),this.container.classList.remove("desktop-view"),t&&this.searchBox.setViewForMobile()}},{key:"_handleSearchBoxSelectBack",value:function(){this.map.initiateBack()}},{key:"_handleSearchBarCancel",value:function(t){this.map.setToDefaultState()}},{key:"_handleSearchBoxSearch",value:function(t){var e=t.query;this.map.setToSearchState(e)}},{key:"_handleSuggestionSelect",value:function(t){var e=t.result;this.map.setToSelectedContentState([e.placement_id])}},{key:"_handleDefaultState",value:function(){this.searchBox.searchBarSuggestionsView.clearResults(),this.searchBox.closeSuggestionsView(),this.searchBox.searchBar.setText(""),this.searchBox.searchBar.updateRightButtonIcon("search"),console.log("-------\x3e SETTING LEFT ICON: none"),this.searchBox.searchBar.updateLeftButtonIcon("none"),this.show()}},{key:"_handleSearchState",value:function(t){var e=t.query,n=t.results;console.log("SEARC",e,n),this.searchBox.searchBar.setText(e),this.searchBox.searchBar.updateRightButtonIcon("cancel"),this.searchBox.searchBar.updateLeftButtonIcon("none"),this.show()}},{key:"_handleSelectedContentState",value:function(t){var e=t.contentPlacementIds,n=t.selectedContentPlacement;this.show();var r=n.content.title_key,o=n.content.data[r];this.searchBox.searchBar.setText(o),this.searchBox.searchBar.updateRightButtonIcon("cancel");var i=this.map._stateCoordinator.stateHistory.length;i>2||e.length>1?(console.log("-------\x3e :SETTING LEFT ICON: back",i,e),this.searchBox.searchBar.updateLeftButtonIcon("back")):(console.log("-------\x3e :SETTING LEFT ICON: none",i,e),this.searchBox.searchBar.updateLeftButtonIcon("none"))}},{key:"_handleDirectionsState",value:function(t){console.log("handling directions state in search box control"),this.map._stateCoordinator.stateHistory.length>2?this.searchBox.searchBar.updateLeftButtonIcon("back"):this.searchBox.searchBar.updateLeftButtonIcon("none")}}],r&&Gr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);function to(t){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},to(t)}function eo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,no(r.key),r)}}function no(t){var e=function(t){if("object"!=to(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=to(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==to(e)?e:e+""}function ro(t,e,n){return e=io(e),function(t,e){if(e&&("object"==to(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,oo()?Reflect.construct(e,n||[],io(t).constructor):e.apply(t,n))}function oo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(oo=function(){return!!t})()}function io(t){return io=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},io(t)}function ao(t,e){return ao=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ao(t,e)}const co=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ro(this,e,[r])).items=n,t.containerClass=r.container,t.element=document.createElement("div"),t.element.className="slider-bar-container ".concat(t.containerClass),t.sliderBar=document.createElement("div"),t.sliderBar.className="slider-bar ".concat(t.containerClass,"-bar"),t.leftButton=document.createElement("button"),t.leftButton.className="scroll-button left ".concat(t.containerClass,"-scroll-button"),t.leftButton.style.backgroundImage="url(".concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTExLjI4OTkgMTEuOTk5N0wxNC44Mjk5IDguNDU5N0MxNS4wMTYyIDguMjcyMzQgMTUuMTIwNyA4LjAxODg5IDE1LjEyMDcgNy43NTQ3QzE1LjEyMDcgNy40OTA1MiAxNS4wMTYyIDcuMjM3MDcgMTQuODI5OSA3LjA0OTdDMTQuNzM3IDYuOTU1OTggMTQuNjI2NCA2Ljg4MTU4IDE0LjUwNDUgNi44MzA4MUMxNC4zODI3IDYuNzgwMDQgMTQuMjUyIDYuNzUzOTEgMTQuMTE5OSA2Ljc1MzkxQzEzLjk4NzkgNi43NTM5MSAxMy44NTcyIDYuNzgwMDQgMTMuNzM1NCA2LjgzMDgxQzEzLjYxMzUgNi44ODE1OCAxMy41MDI5IDYuOTU1OTggMTMuNDA5OSA3LjA0OTdMOS4xNjk5NCAxMS4yODk3QzkuMDc2MjIgMTEuMzgyNyA5LjAwMTgyIDExLjQ5MzMgOC45NTEwNSAxMS42MTUxQzguOTAwMjggMTEuNzM3IDguODc0MTUgMTEuODY3NyA4Ljg3NDE1IDExLjk5OTdDOC44NzQxNSAxMi4xMzE3IDguOTAwMjggMTIuMjYyNCA4Ljk1MTA1IDEyLjM4NDNDOS4wMDE4MiAxMi41MDYxIDkuMDc2MjIgMTIuNjE2NyA5LjE2OTk0IDEyLjcwOTdMMTMuNDA5OSAxNi45OTk3QzEzLjUwMzQgMTcuMDkyNCAxMy42MTQyIDE3LjE2NTcgMTMuNzM2IDE3LjIxNTVDMTMuODU3OSAxNy4yNjUyIDEzLjk4ODMgMTcuMjkwNSAxNC4xMTk5IDE3LjI4OTdDMTQuMjUxNiAxNy4yOTA1IDE0LjM4MiAxNy4yNjUyIDE0LjUwMzggMTcuMjE1NUMxNC42MjU3IDE3LjE2NTcgMTQuNzM2NSAxNy4wOTI0IDE0LjgyOTkgMTYuOTk5N0MxNS4wMTYyIDE2LjgxMjMgMTUuMTIwNyAxNi41NTg5IDE1LjEyMDcgMTYuMjk0N0MxNS4xMjA3IDE2LjAzMDUgMTUuMDE2MiAxNS43NzcxIDE0LjgyOTkgMTUuNTg5N0wxMS4yODk5IDExLjk5OTdaIiBmaWxsPSIjMTcxNzE3Ii8+Cjwvc3ZnPgo=",")"),t.leftButton.addEventListener("click",(function(){return t._scrollSliderBar("left")})),t.rightButton=document.createElement("button"),t.rightButton.className="scroll-button right ".concat(t.containerClass,"-scroll-button"),t.rightButton.style.backgroundImage="url(".concat("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0LjgyOTkgMTEuMjg5N0wxMC41ODk5IDcuMDQ5N0MxMC40OTcgNi45NTU5OCAxMC4zODY0IDYuODgxNTggMTAuMjY0NSA2LjgzMDgxQzEwLjE0MjcgNi43ODAwNCAxMC4wMTIgNi43NTM5MSA5Ljg3OTk0IDYuNzUzOTFDOS43NDc5MyA2Ljc1MzkxIDkuNjE3MjMgNi43ODAwNCA5LjQ5NTM3IDYuODMwODFDOS4zNzM1MSA2Ljg4MTU4IDkuMjYyOTEgNi45NTU5OCA5LjE2OTk0IDcuMDQ5N0M4Ljk4MzY5IDcuMjM3MDcgOC44NzkxNSA3LjQ5MDUyIDguODc5MTUgNy43NTQ3QzguODc5MTUgOC4wMTg4OSA4Ljk4MzY5IDguMjcyMzQgOS4xNjk5NCA4LjQ1OTdMMTIuNzA5OSAxMS45OTk3TDkuMTY5OTQgMTUuNTM5N0M4Ljk4MzY5IDE1LjcyNzEgOC44NzkxNSAxNS45ODA1IDguODc5MTUgMTYuMjQ0N0M4Ljg3OTE1IDE2LjUwODkgOC45ODM2OSAxNi43NjIzIDkuMTY5OTQgMTYuOTQ5N0M5LjI2MzM4IDE3LjA0MjQgOS4zNzQyIDE3LjExNTcgOS40OTYwNCAxNy4xNjU1QzkuNjE3ODcgMTcuMjE1MiA5Ljc0ODM0IDE3LjI0MDUgOS44Nzk5NCAxNy4yMzk3QzEwLjAxMTUgMTcuMjQwNSAxMC4xNDIgMTcuMjE1MiAxMC4yNjM4IDE3LjE2NTVDMTAuMzg1NyAxNy4xMTU3IDEwLjQ5NjUgMTcuMDQyNCAxMC41ODk5IDE2Ljk0OTdMMTQuODI5OSAxMi43MDk3QzE0LjkyMzcgMTIuNjE2NyAxNC45OTgxIDEyLjUwNjEgMTUuMDQ4OCAxMi4zODQzQzE1LjA5OTYgMTIuMjYyNCAxNS4xMjU3IDEyLjEzMTcgMTUuMTI1NyAxMS45OTk3QzE1LjEyNTcgMTEuODY3NyAxNS4wOTk2IDExLjczNyAxNS4wNDg4IDExLjYxNTFDMTQuOTk4MSAxMS40OTMzIDE0LjkyMzcgMTEuMzgyNyAxNC44Mjk5IDExLjI4OTdaIiBmaWxsPSIjMTcxNzE3Ii8+Cjwvc3ZnPgo=",")"),t.rightButton.addEventListener("click",(function(){return t._scrollSliderBar("right")})),t.buttonElements=[],t._render(),t.sliderBar.addEventListener("scroll",(function(){return t._updateScrollButtons()})),setTimeout((function(){return t._updateScrollButtons()}),.8),t}return function(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&&ao(t,e)}(e,t),n=e,r=[{key:"_render",value:function(){var t=this;this.items.forEach((function(e){var n=e.title,r=e.imageUrl,o=document.createElement("button");if(o.addEventListener("click",t._handleSliderButtonSelect.bind(t)),o.className="slider-bar-button ".concat(t.containerClass,"-button"),r){var i=document.createElement("img");i.src=r,i.alt=n,i.className="slider-bar-button-image ".concat(t.containerClass,"-button-image"),o.appendChild(i)}else console.log("No image found for slider bar button.");var a=document.createElement("span");a.textContent=n,o.appendChild(a),t.buttonElements.push(o),t.sliderBar.appendChild(o)})),this.element.appendChild(this.leftButton),this.element.appendChild(this.sliderBar),this.element.appendChild(this.rightButton)}},{key:"setViewForDesktop",value:function(){console.log("SLIDER DESKTOP"),this.buttonElements.forEach((function(t){t&&(console.log("BUTTON",t),t.classList.remove("mobile-view"))}))}},{key:"setViewForMobile",value:function(){console.log("SLIDER MOBILE",this.buttonElements),this.buttonElements.forEach((function(t){console.log("FOUND BUTTON",t),t&&(console.log("BUTTON",t),t.classList.add("mobile-view"))}))}},{key:"_handleSliderButtonSelect",value:function(t){var e=t.currentTarget,n=e.querySelector("span").textContent;if(e.classList.contains("selected"))e.classList.remove("selected"),this.fire("deselect");else{var r=document.querySelector(".slider-bar-button.selected");r&&r.classList.remove("selected"),e.classList.add("selected"),this.fire("selectNew",{query:n})}}},{key:"_scrollSliderBar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:275,n=this.sliderBar.scrollWidth-this.sliderBar.clientWidth,r=this.sliderBar.scrollLeft,o=e;if("right"===t){var i=n-r;i<e&&(o=i)}"left"===t?this.sliderBar.scrollBy({left:-e,behavior:"smooth"}):"right"===t&&this.sliderBar.scrollBy({left:o,behavior:"smooth"})}},{key:"_updateScrollButtons",value:function(){var t=this.sliderBar.scrollLeft,e=this.sliderBar.scrollWidth-this.sliderBar.clientWidth;this.leftButton.style.display=t<=0?"none":"block";var n=Math.abs(e-t);this.rightButton.style.display=n<=1?"none":"block"}},{key:"deselectAll",value:function(){this.sliderBar.querySelectorAll(".slider-bar-button.selected").forEach((function(t){return t.classList.remove("selected")}))}},{key:"deselectAllNotMatchingQuery",value:function(t){this.sliderBar.querySelectorAll(".slider-bar-button.selected").forEach((function(e){e.textContent!==t&&e.classList.remove("selected")}))}},{key:"invertButtonAtIndex",value:function(t){var e=this.buttonElements[t];e?e.classList.toggle("inverted"):console.error("Button at index ".concat(t," does not exist."))}},{key:"getElement",value:function(){return this.element}},{key:"show",value:function(){this.element.classList.add("visible")}},{key:"hide",value:function(){this.element.classList.remove("visible")}}],r&&eo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function so(t){return so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},so(t)}function uo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lo(r.key),r)}}function lo(t){var e=function(t){if("object"!=so(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=so(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==so(e)?e:e+""}function fo(t,e,n){return e=yo(e),function(t,e){if(e&&("object"==so(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ho()?Reflect.construct(e,n||[],yo(t).constructor):e.apply(t,n))}function ho(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ho=function(){return!!t})()}function po(){return po="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=yo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},po.apply(null,arguments)}function yo(t){return yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yo(t)}function mo(t,e){return mo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mo(t,e)}const vo=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=fo(this,e,[n])).categoryBar=new co([{title:"Energy & charging"},{title:"Mobility"},{title:"Automotive"},{title:"Indoor mapping"},{title:"Supply chain"},{title:"Tech data"},{title:"Insurance"},{title:"Rideshare"},{title:"Manufacturing"},{title:"Autonomous vehicles"},{title:"Human resources"},{title:"Battery tech"},{title:"Renewable energy"}],{container:"category-bar"}),t}return function(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&&mo(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){this.map=t,this.container=document.createElement("div"),this.container.className="category-bar-control-container";var e=this.categoryBar.getElement();return this.container.appendChild(e),this.initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.show(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=po(yo(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"initializeEventListeners",value:function(){this.categoryBar.on("selectNew",this._handleNewCategoryButtonSelect.bind(this)),this.categoryBar.on("deselect",this._handleCategoryButtonDeselect.bind(this)),this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this))}},{key:"_renderDesktopView",value:function(){var t=this.categoryBar.getElement();this.container.appendChild(t),this.container.classList.remove("mobile-view"),this.container.classList.add("desktop-view");var e=this.map.mapContainer.offsetWidth;console.log("DESKTOP WIDTH",e),this.categoryBar.setViewForDesktop()}},{key:"_renderMobileView",value:function(){var t=this.categoryBar.getElement();this.container.appendChild(t);var e=this.map.mapContainer.offsetWidth;this.container.classList.remove("desktop-view"),this.container.classList.add("mobile-view"),console.log("MOBILE WIDTH22",e,this.map.map.getCanvasContainer().offsetWidth),console.log("THEE",this.categoryBar),this.categoryBar.setViewForMobile()}},{key:"_handleDefaultState",value:function(){this.show(),this.categoryBar.deselectAll()}},{key:"_handleSelectedContentState",value:function(t){this.hide()}},{key:"_handleDirectionsState",value:function(t){this.hide()}},{key:"_handleNewCategoryButtonSelect",value:function(t){var e=t.query;this.map.setToSearchState(e)}},{key:"_handleCategoryButtonDeselect",value:function(){this.map.setToDefaultState()}},{key:"_handleSearchState",value:function(t){var e=t.query;t.results,this.show(),this.categoryBar.deselectAllNotMatchingQuery(e)}}],r&&uo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);function go(t){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},go(t)}function bo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wo(r.key),r)}}function wo(t){var e=function(t){if("object"!=go(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=go(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==go(e)?e:e+""}function Eo(t,e,n){return e=Mo(e),function(t,e){if(e&&("object"==go(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,jo()?Reflect.construct(e,n||[],Mo(t).constructor):e.apply(t,n))}function jo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jo=function(){return!!t})()}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}function So(t,e){return So=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},So(t,e)}const Oo=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Eo(this,e,[r])).contentPlacement=t,n._initialize(),n}return function(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&&So(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){var t=this.contentPlacement.content;this.element=document.createElement("div"),this.element.className="content-placement-header",this.textContainer=document.createElement("div"),this.textContainer.className="header-text-container",this.nameElement=document.createElement("div"),this.nameElement.className="header-content-name",this.nameElement.textContent=t.data[t.title_key],this.catalogNameElement=document.createElement("div"),this.catalogNameElement.className="header-catalog-name",this.catalogNameElement.textContent=this.contentPlacement.catalog.title,this.textContainer.appendChild(this.nameElement),this.textContainer.appendChild(this.catalogNameElement),this.imageViewElement=document.createElement("div"),this.imageViewElement.className="header-image-view",this.element.appendChild(this.imageViewElement),this.element.appendChild(this.textContainer)}},{key:"getElement",value:function(){return this.element}}])&&bo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function To(t){return To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},To(t)}function xo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,No(r.key),r)}}function No(t){var e=function(t){if("object"!=To(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=To(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==To(e)?e:e+""}function Lo(t,e,n){return e=ko(e),function(t,e){if(e&&("object"==To(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Do()?Reflect.construct(e,n||[],ko(t).constructor):e.apply(t,n))}function Do(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Do=function(){return!!t})()}function ko(t){return ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ko(t)}function Io(t,e){return Io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Io(t,e)}const _o=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Lo(this,e,[o])).icon=t,r.text=n,r._initialize(),r}return function(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&&Io(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="contextual-location-view",this.imageViewElement=document.createElement("img"),this.imageViewElement.className="contextual-location-image",this.imageViewElement.src=this.icon,this.textElement=document.createElement("span"),this.textElement.textContent=this.text,this.textElement.className="contextual-location-text",this.element.appendChild(this.imageViewElement),this.element.appendChild(this.textElement)}},{key:"getElement",value:function(){return this.element}}])&&xo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Co(t){return Co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Co(t)}function Po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ao(r.key),r)}}function Ao(t){var e=function(t){if("object"!=Co(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Co(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Co(e)?e:e+""}function Bo(t,e,n){return e=Ro(e),function(t,e){if(e&&("object"==Co(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zo()?Reflect.construct(e,n||[],Ro(t).constructor):e.apply(t,n))}function zo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zo=function(){return!!t})()}function Ro(t){return Ro=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ro(t)}function Uo(t,e){return Uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uo(t,e)}const Vo=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Bo(this,e,[r])).data=t,n._initialize(),n}return function(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&&Uo(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){var t=this;this.element=document.createElement("div"),this.element.className="content-placement-details-view",this.titleView=document.createElement("div"),this.titleView.className="content-details-section-title",this.titleView.textContent="Additional details",this.element.appendChild(this.titleView);var e=Object.keys(this.data);e.forEach((function(n,r){var o=t.data[n],i=document.createElement("div");i.className="details-view-item";var a=document.createElement("div");a.className="details-view-key",a.textContent=n;var c=document.createElement("span");if(c.className="details-view-value",c.textContent=o,i.appendChild(a),i.appendChild(c),r<e.length-1){var s=document.createElement("hr");s.className="details-view-line",i.append(s)}t.element.appendChild(i)}))}},{key:"getElement",value:function(){return this.element}}])&&Po(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Fo(t){return Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fo(t)}function Qo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yo(r.key),r)}}function Yo(t){var e=function(t){if("object"!=Fo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fo(e)?e:e+""}function Ho(t,e,n){return e=Zo(e),function(t,e){if(e&&("object"==Fo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Go()?Reflect.construct(e,n||[],Zo(t).constructor):e.apply(t,n))}function Go(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Go=function(){return!!t})()}function Zo(t){return Zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zo(t)}function Wo(t,e){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wo(t,e)}const qo=function(t){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=Ho(this,e,[i])).title=t,o.subtitle=n,o.placementId=r,o._initialize(),o}return function(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&&Wo(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("button"),this.element.className="content-details-child-view",this.titleElement=document.createElement("div"),this.titleElement.className="content-details-child-view-title",this.titleElement.textContent=this.title+" --\x3e",this.subtitleElement=document.createElement("div"),this.subtitleElement.className="content-details-child-view-subtitle",this.subtitleElement.textContent=this.subtitle,this._render()}},{key:"_render",value:function(){this.element.appendChild(this.titleElement),this.element.appendChild(this.subtitleElement)}},{key:"getElement",value:function(){return this.element}}])&&Qo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Jo(t){return Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(t)}function Ko(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xo(r.key),r)}}function Xo(t){var e=function(t){if("object"!=Jo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jo(e)?e:e+""}function $o(t,e,n){return e=ei(e),function(t,e){if(e&&("object"==Jo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ti()?Reflect.construct(e,n||[],ei(t).constructor):e.apply(t,n))}function ti(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ti=function(){return!!t})()}function ei(t){return ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ei(t)}function ni(t,e){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ni(t,e)}const ri=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=$o(this,e,[o])).title=t,r.children=n,r._initialize(),r}return function(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&&ni(t,e)}(e,t),n=e,r=[{key:"_initialize",value:function(){var t=this;this.element=document.createElement("div"),this.element.className="content-children-view",this.titleView=document.createElement("div"),this.titleView.className="content-details-section-title",this.titleView.textContent=this.title,this.element.appendChild(this.titleView),this.childrenElements=[],this.childrenListView=document.createElement("div"),this.childrenListView.className="content-details-children-list-view",this.children.forEach((function(e){var n=new qo(e.name,e.contextual_location,e.placement_id);t.childrenListView.appendChild(n.getElement()),t.childrenElements.push(n)})),this.element.appendChild(this.childrenListView),this._setupEventListeners()}},{key:"_setupEventListeners",value:function(){var t=this;this.childrenElements.forEach((function(e){e.getElement().addEventListener("click",(function(n){return t._handleChildSelect(n,e)}))}))}},{key:"_handleChildSelect",value:function(t,e){this.fire("selectChildContentPlacement",{placementId:e.placementId})}},{key:"getElement",value:function(){return this.element}}],r&&Ko(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function oi(t){return oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oi(t)}function ii(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],s=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);s=!0);}catch(t){u=!0,o=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ai(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ai(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ai(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ci(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,si(r.key),r)}}function si(t){var e=function(t){if("object"!=oi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oi(e)?e:e+""}function ui(t,e,n){return e=fi(e),function(t,e){if(e&&("object"==oi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,li()?Reflect.construct(e,n||[],fi(t).constructor):e.apply(t,n))}function li(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(li=function(){return!!t})()}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}function hi(t,e){return hi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hi(t,e)}const pi=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ui(this,e,[n])).contentPlacement=null,t.element=document.createElement("div"),t.element.className="content-details",t.header=document.createElement("div"),t.header.className="content-details-header",t.contentPlacementHeader=null,t.actionsView=document.createElement("div"),t.actionsView.className="content-details-section",t.actionButtons=document.createElement("div"),t.actionButtons.className="content-details-action-buttons",t.directionsButton=document.createElement("button"),t.directionsButton.className="content-details-directions-button",t.directionsButton.textContent="Directions",t.shareButton=document.createElement("button"),t.shareButton.className="content-details-share-button",t.shareButton.textContent="Share",t.locationButton=null,t.websiteButton=null,t.detailsView=null,t.childrenComponents=[],t}return function(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&&hi(t,e)}(e,t),n=e,(r=[{key:"_setupEventListeners",value:function(){var t=this;this.childrenComponents.forEach((function(e){e.on("selectChildContentPlacement",t._handleSelectChildContentPlacement.bind(t))})),this.directionsButton.addEventListener("click",this._handleDirectionsButtonSelect.bind(this))}},{key:"_render",value:function(){var t=this;this.element.innerHTML="",this.header.innerHTML="",this.actionsView.innerHTML="",this.contentPlacementHeader&&this.header.appendChild(this.contentPlacementHeader.getElement()),this.actionButtons.appendChild(this.directionsButton),this.actionButtons.appendChild(this.shareButton),this.header.appendChild(this.actionButtons),this.locationButton&&this.actionsView.appendChild(this.locationButton.getElement()),this.websiteButton&&this.actionsView.appendChild(this.websiteButton.getElement()),this.header.appendChild(this.actionsView),this.element.appendChild(this.header),this.detailsView&&(this.detailsView.innerHTML="",this.element.appendChild(this.detailsView.getElement())),this.childrenComponents.forEach((function(e){t.element.appendChild(e.getElement())}))}},{key:"_handleDirectionsButtonSelect",value:function(){this.fire("selectDirectionsButton",{placementId:this.contentPlacement.placement_id})}},{key:"_handleBackArrowClick",value:function(){this.fire("selectBackButton")}},{key:"_handleSelectChildContentPlacement",value:function(t){var e=t.placementId;this.fire("selectChildContentPlacement",{placementId:e})}},{key:"findViableAdditionalData",value:function(t){var e=t.content.data,n=Object.keys(e),r=[t.content.title_key,"Feature","Features","Feature ID","feature_id","Website","Website URL","LinkedIn","Files & media"],o={};return n.forEach((function(t){var n=e[t];r.includes(t)||null==n||""===n||(o[t]=n)})),o}},{key:"updateView",value:function(t){this.contentPlacement=t,this.contentPlacementHeader=new Oo(t),this.locationButton=new _o("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDOS44NzgyNyAyIDcuODQzNDQgMi44NDI4NSA2LjM0MzE1IDQuMzQzMTVDNC44NDI4NSA1Ljg0MzQ0IDQgNy44NzgyNyA0IDEwQzQgMTUuNCAxMS4wNSAyMS41IDExLjM1IDIxLjc2QzExLjUzMTEgMjEuOTE0OSAxMS43NjE2IDIyLjAwMDEgMTIgMjIuMDAwMUMxMi4yMzg0IDIyLjAwMDEgMTIuNDY4OSAyMS45MTQ5IDEyLjY1IDIxLjc2QzEzIDIxLjUgMjAgMTUuNCAyMCAxMEMyMCA3Ljg3ODI3IDE5LjE1NzEgNS44NDM0NCAxNy42NTY5IDQuMzQzMTVDMTYuMTU2NiAyLjg0Mjg1IDE0LjEyMTcgMiAxMiAyWk0xMiAxOS42NUM5Ljg3IDE3LjY1IDYgMTMuMzQgNiAxMEM2IDguNDA4NyA2LjYzMjE0IDYuODgyNTggNy43NTczNiA1Ljc1NzM2QzguODgyNTggNC42MzIxNCAxMC40MDg3IDQgMTIgNEMxMy41OTEzIDQgMTUuMTE3NCA0LjYzMjE0IDE2LjI0MjYgNS43NTczNkMxNy4zNjc5IDYuODgyNTggMTggOC40MDg3IDE4IDEwQzE4IDEzLjM0IDE0LjEzIDE3LjY2IDEyIDE5LjY1Wk0xMiA2QzExLjIwODkgNiAxMC40MzU1IDYuMjM0NiA5Ljc3NzcyIDYuNjc0MTJDOS4xMTk5MiA3LjExMzY1IDguNjA3MjMgNy43MzgzNiA4LjMwNDQ4IDguNDY5MjdDOC4wMDE3MyA5LjIwMDE3IDcuOTIyNTIgMTAuMDA0NCA4LjA3Njg2IDEwLjc4MDRDOC4yMzEyIDExLjU1NjMgOC42MTIxNiAxMi4yNjkgOS4xNzE1NyAxMi44Mjg0QzkuNzMwOTggMTMuMzg3OCAxMC40NDM3IDEzLjc2ODggMTEuMjE5NiAxMy45MjMxQzExLjk5NTYgMTQuMDc3NSAxMi43OTk4IDEzLjk5ODMgMTMuNTMwNyAxMy42OTU1QzE0LjI2MTYgMTMuMzkyOCAxNC44ODY0IDEyLjg4MDEgMTUuMzI1OSAxMi4yMjIzQzE1Ljc2NTQgMTEuNTY0NSAxNiAxMC43OTExIDE2IDEwQzE2IDguOTM5MTMgMTUuNTc4NiA3LjkyMTcyIDE0LjgyODQgNy4xNzE1N0MxNC4wNzgzIDYuNDIxNDMgMTMuMDYwOSA2IDEyIDZaTTEyIDEyQzExLjYwNDQgMTIgMTEuMjE3OCAxMS44ODI3IDEwLjg4ODkgMTEuNjYyOUMxMC41NiAxMS40NDMyIDEwLjMwMzYgMTEuMTMwOCAxMC4xNTIyIDEwLjc2NTRDMTAuMDAwOSAxMC4zOTk5IDkuOTYxMjYgOS45OTc3OCAxMC4wMzg0IDkuNjA5ODJDMTAuMTE1NiA5LjIyMTg2IDEwLjMwNjEgOC44NjU0OSAxMC41ODU4IDguNTg1NzlDMTAuODY1NSA4LjMwNjA4IDExLjIyMTkgOC4xMTU2IDExLjYwOTggOC4wMzg0M0MxMS45OTc4IDcuOTYxMjYgMTIuMzk5OSA4LjAwMDg3IDEyLjc2NTQgOC4xNTIyNEMxMy4xMzA4IDguMzAzNjIgMTMuNDQzMiA4LjU1OTk2IDEzLjY2MjkgOC44ODg4NkMxMy44ODI3IDkuMjE3NzYgMTQgOS42MDQ0NCAxNCAxMEMxNCAxMC41MzA0IDEzLjc4OTMgMTEuMDM5MSAxMy40MTQyIDExLjQxNDJDMTMuMDM5MSAxMS43ODkzIDEyLjUzMDQgMTIgMTIgMTJaIiBmaWxsPSIjMTcxNzE3Ii8+Cjwvc3ZnPgo=",t.contextual_location);var e=t.content.data.Website||t.content.data.LinkedIn||t.content.data["Website URL"];this.websiteButton=e?new _o("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIxLjQxIDguNjQwMTNDMjEuNDEgOC42NDAxMyAyMS40MSA4LjY0MDEzIDIxLjQxIDguNTkwMTNDMjAuNzA1MyA2LjY2NjM1IDE5LjQyNjkgNS4wMDU0MSAxNy43NDc0IDMuODMxOTlDMTYuMDY4IDIuNjU4NTcgMTQuMDY4NyAyLjAyOTMgMTIuMDIgMi4wMjkzQzkuOTcxMiAyLjAyOTMgNy45NzE4OSAyLjY1ODU3IDYuMjkyNDYgMy44MzE5OUM0LjYxMzA0IDUuMDA1NDEgMy4zMzQ1NSA2LjY2NjM1IDIuNjI5OTUgOC41OTAxM0MyLjYyOTk1IDguNTkwMTMgMi42Mjk5NSA4LjU5MDEzIDIuNjI5OTUgOC42NDAxM0MxLjg0MzA4IDEwLjgxMSAxLjg0MzA4IDEzLjE4OTIgMi42Mjk5NSAxNS4zNjAxQzIuNjI5OTUgMTUuMzYwMSAyLjYyOTk1IDE1LjM2MDEgMi42Mjk5NSAxNS40MTAxQzMuMzM0NTUgMTcuMzMzOSA0LjYxMzA0IDE4Ljk5NDggNi4yOTI0NiAyMC4xNjgzQzcuOTcxODkgMjEuMzQxNyA5Ljk3MTIgMjEuOTcxIDEyLjAyIDIxLjk3MUMxNC4wNjg3IDIxLjk3MSAxNi4wNjggMjEuMzQxNyAxNy43NDc0IDIwLjE2ODNDMTkuNDI2OSAxOC45OTQ4IDIwLjcwNTMgMTcuMzMzOSAyMS40MSAxNS40MTAxQzIxLjQxIDE1LjQxMDEgMjEuNDEgMTUuNDEwMSAyMS40MSAxNS4zNjAxQzIyLjE5NjggMTMuMTg5MiAyMi4xOTY4IDEwLjgxMSAyMS40MSA4LjY0MDEzWk00LjI1OTk1IDE0LjAwMDFDMy45MTMxOCAxMi42ODkzIDMuOTEzMTggMTEuMzEwOSA0LjI1OTk1IDEwLjAwMDFINi4xMTk5NUM1Ljk1OTk4IDExLjMyODcgNS45NTk5OCAxMi42NzE2IDYuMTE5OTUgMTQuMDAwMUg0LjI1OTk1Wk01LjA3OTk1IDE2LjAwMDFINi40Nzk5NUM2LjcxNDY3IDE2Ljg5MiA3LjA1MDE2IDE3Ljc1NDIgNy40Nzk5NSAxOC41NzAxQzYuNDk5MjUgMTcuOTAyMSA1LjY3OTQ1IDE3LjAyNDIgNS4wNzk5NSAxNi4wMDAxWk02LjQ3OTk1IDguMDAwMTNINS4wNzk5NUM1LjY3MDgyIDYuOTc5MjEgNi40ODAxNCA2LjEwMTU5IDcuNDQ5OTUgNS40MzAxM0M3LjAzMDUxIDYuMjQ3MzcgNi43MDUwOSA3LjEwOTU0IDYuNDc5OTUgOC4wMDAxM1pNMTEgMTkuNzAwMUM5Ljc3MTcyIDE4Ljc5ODggOC45MDkxIDE3LjQ4NTQgOC41Njk5NSAxNi4wMDAxSDExVjE5LjcwMDFaTTExIDE0LjAwMDFIOC4xMzk5NUM3Ljk1MzM0IDEyLjY3MzMgNy45NTMzNCAxMS4zMjY5IDguMTM5OTUgMTAuMDAwMUgxMVYxNC4wMDAxWk0xMSA4LjAwMDEzSDguNTY5OTVDOC45MDkxIDYuNTE0ODkgOS43NzE3MiA1LjIwMTQ0IDExIDQuMzAwMTNWOC4wMDAxM1pNMTguOTIgOC4wMDAxM0gxNy41MkMxNy4yODUyIDcuMTA4MjggMTYuOTQ5NyA2LjI0NjA2IDE2LjUyIDUuNDMwMTNDMTcuNTAwNyA2LjA5ODIgMTguMzIwNSA2Ljk3NjA3IDE4LjkyIDguMDAwMTNaTTEzIDQuMzAwMTNDMTQuMjI4MiA1LjIwMTQ0IDE1LjA5MDggNi41MTQ4OSAxNS40MyA4LjAwMDEzSDEzVjQuMzAwMTNaTTEzIDE5LjcwMDFWMTYuMDAwMUgxNS40M0MxNS4wOTA4IDE3LjQ4NTQgMTQuMjI4MiAxOC43OTg4IDEzIDE5LjcwMDFaTTE1Ljg2IDE0LjAwMDFIMTNWMTAuMDAwMUgxNS44NkMxNi4wNDY2IDExLjMyNjkgMTYuMDQ2NiAxMi42NzMzIDE1Ljg2IDE0LjAwMDFaTTE2LjU1IDE4LjU3MDFDMTYuOTc5NyAxNy43NTQyIDE3LjMxNTIgMTYuODkyIDE3LjU1IDE2LjAwMDFIMTguOTVDMTguMzUwNSAxNy4wMjQyIDE3LjUzMDcgMTcuOTAyMSAxNi41NSAxOC41NzAxWk0xOS43NCAxNC4wMDAxSDE3Ljg4QzE3Ljk2MTMgMTMuMzM2NiAxOC4wMDE0IDEyLjY2ODYgMTggMTIuMDAwMUMxOC4wMDExIDExLjMzMTYgMTcuOTYxIDEwLjY2MzcgMTcuODggMTAuMDAwMUgxOS43NEMyMC4wODY3IDExLjMxMDkgMjAuMDg2NyAxMi42ODkzIDE5Ljc0IDE0LjAwMDFaIiBmaWxsPSIjMTcxNzE3Ii8+Cjwvc3ZnPgo=",e):null;var n=this.findViableAdditionalData(t),r=Object.keys(n);this.detailsView=r.length>0?new Vo(n):null,this.childrenComponents=[];for(var o=0,i=Object.entries(t.children);o<i.length;o++){var a=ii(i[o],2),c=a[0],s=a[1],u=new ri(c,s);this.childrenComponents.push(u)}this._setupEventListeners(),this._render()}},{key:"getElement",value:function(){return this.element}}])&&ci(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function yi(t){return yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yi(t)}function di(){di=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new D(r||[]);return o(a,"_invoke",{value:T(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==yi(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=x(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(yi(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,D.prototype={constructor:D,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function mi(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function vi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,gi(r.key),r)}}function gi(t){var e=function(t){if("object"!=yi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yi(e)?e:e+""}function bi(t,e,n){return e=ji(e),function(t,e){if(e&&("object"==yi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wi()?Reflect.construct(e,n||[],ji(t).constructor):e.apply(t,n))}function wi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wi=function(){return!!t})()}function Ei(){return Ei="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ji(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ei.apply(null,arguments)}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}function Mi(t,e){return Mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mi(t,e)}const Si=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=bi(this,e,[n])).map=null,t.contentPlacementIds=[],t.currentContentPlacement=null,t.contentPlacementView=null,t}return function(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&&Mi(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){return this.map=t,this.container=document.createElement("div"),this.container.className="content-details-control-container",this.initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.hide(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=Ei(ji(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"initializeEventListeners",value:function(){this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this)),this.map.on("initiate:back",this._handleMapInitiateBack.bind(this))}},{key:"_renderDesktopView",value:function(){if(this.contentPlacementView){var t=this.contentPlacementView.getElement();this.container.appendChild(t),this.container.classList.remove("mobile-view"),this.container.classList.add("desktop-view"),console.log("rendering search results DESKTOP")}}},{key:"_renderMobileView",value:function(){if(this.contentPlacementView){var t=this.contentPlacementView.getElement();this.container.appendChild(t),this.container.classList.remove("desktop-view"),this.container.classList.add("mobile-view"),console.log("rendering search results MOBILE")}}},{key:"_handleMapInitiateBack",value:function(){var t=this.map._stateCoordinator.state;if("selectedContent"===t){if(0===this.contentPlacementIds.length)return;if(1===this.contentPlacementIds.length){var e=this.map._stateCoordinator.stateHistory,n=e[e.length-2];e.pop(),e.pop(),"search"===n?this.map.initiateSetToSearchState():this.map.setToDefaultState()}else this.contentPlacementIds.pop(),this.map.setToSelectedContentState(this.contentPlacementIds)}else"directions"===t&&(console.log("THIS IS BACK IN DIRECTIONS STATE:",this.contentPlacementIds.length),this.map.setToSelectedContentState(this.contentPlacementIds))}},{key:"_handleSelectChildContentPlacement",value:function(t){console.log("SELECT CHILD",t);var e=t.placementId;this.contentPlacementIds.push(e),this.map.setToSelectedContentState(this.contentPlacementIds)}},{key:"_handleDefaultState",value:function(){this.hide(),this.contentPlacementIds=[],this.currentContentPlacement=null,this._clearViews()}},{key:"_handleSearchState",value:function(t){this.hide(),this.contentPlacementIds=[],this.currentContentPlacement=null,this._clearViews()}},{key:"_handleSelectedContentState",value:function(t){var e=t.contentPlacementIds,n=t.selectedContentPlacement;this.contentPlacementIds=e,this.currentContentPlacement=n,console.log("SELECTED",n),this._updateContentViews(),this.show()}},{key:"_handleDirectionsState",value:function(t){this.hide()}},{key:"_handleSelectDirectionsButton",value:(o=di().mark((function t(e){var n;return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.placementId,t.next=3,this.map.setToDirectionsState(null,n);case 3:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){mi(i,n,r,a,c,"next",t)}function c(t){mi(i,n,r,a,c,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})},{key:"_updateContentViews",value:function(){this._clearViews(),this._render()}},{key:"_render",value:function(){console.log("HERE IS NUMBER OF CONTENT PLACEMENTS:",this.contentPlacementIds.length),0!==this.contentPlacementIds.length&&null!==this.currentContentPlacement&&(this.contentPlacementView=new pi,this.contentPlacementView.updateView(this.currentContentPlacement),this.contentPlacementView.on("selectChildContentPlacement",this._handleSelectChildContentPlacement.bind(this)),this.contentPlacementView.on("selectDirectionsButton",this._handleSelectDirectionsButton.bind(this)),this._initialize())}}],r&&vi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(zn);function Oi(t){return Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oi(t)}function Ti(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xi(r.key),r)}}function xi(t){var e=function(t){if("object"!=Oi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oi(e)?e:e+""}function Ni(t,e,n){return e=ki(e),function(t,e){if(e&&("object"==Oi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Li()?Reflect.construct(e,n||[],ki(t).constructor):e.apply(t,n))}function Li(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Li=function(){return!!t})()}function Di(){return Di="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ki(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Di.apply(null,arguments)}function ki(t){return ki=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ki(t)}function Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}const _i=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Ni(this,e,[n])).map=null,t.previouslySelectedFeature=null,t.previouslySelectedIcon=null,t.previouslySelectedTextColor=null,t.previouslySelectedTextOffset=null,t.previouslyHoveredFeature=null,t.originalTextColor=null,t.textColorReference={},t.currentView=null,t.selectedTextColor="#BE2E28",t}return function(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&&Ii(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){return this.map=t,this.container=document.createElement("div"),this.container.className="interaction-control-container",this.initializeEventListeners(),this._attachResizeListener(),this._initialize(),this.createHighlightedContentLayer(),this.createSelectedContentLayer(),this.storeTextColorReferences(),this.applyHoverEffectToAllSymbolLayers(),this.container}},{key:"_initialize",value:function(){var t=this.map.mapContainer.offsetWidth;this._configureView(t)}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=Di(ki(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"_attachResizeListener",value:function(){var t=this;window.addEventListener("resize",(function(){var e=t.map.mapContainer.offsetWidth;t._configureView(e)}))}},{key:"_configureView",value:function(t){t>767?this._setViewForDesktop():this._setViewForMobile()}},{key:"_setViewForDesktop",value:function(){this.currentView="desktop"}},{key:"_setViewForMobile",value:function(){this.currentView="mobile"}},{key:"initializeEventListeners",value:function(){var t=this;this.map.map.on("styleimagemissing",(function(t){var e=t.id;console.warn('Image "'.concat(e,'" could not be loaded.'))})),this.map.map.on("click",(function(e){t._handleClick(e)})),this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this))}},{key:"storeTextColorReferences",value:function(){var t=this;this.map.map.getStyle().layers.forEach((function(e){if("symbol"===e.type){var n=t.map.map.getPaintProperty(e.id,"text-color");void 0!==n&&(t.textColorReference[e.id]=n)}}))}},{key:"createSelectedContentLayer",value:function(){this.map.map.addSource("selected-content",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.map.addLayer({id:"selected-content-layer",type:"symbol",source:"selected-content",layout:{"text-field":["get","title"],"text-font":["Inter Medium"],"text-size":14,"text-justify":"left","text-anchor":"bottom-left","text-offset":[1.3,-1],"icon-image":"selected-pin","icon-size":.5,"icon-offset":[0,-5],"icon-anchor":"bottom","symbol-z-elevate":!0,"text-padding":10,"icon-padding":5},paint:{"text-color":"#BE2E28","text-halo-color":"#ffffff","text-halo-width":1}})}},{key:"createHighlightedContentLayer",value:function(){this.map.map.addSource("highlighted-content",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.map.addLayer({id:"highlighted-content-layer",type:"symbol",source:"highlighted-content",layout:{"text-field":["get","title"],"text-font":["Inter Medium"],"text-size":14,"text-justify":"left","text-anchor":"bottom-left","text-offset":[1.2,-.6],"icon-image":"highlightedPin","icon-size":.5,"icon-offset":[0,-5],"icon-anchor":"bottom","symbol-z-elevate":!0,"text-padding":5,"icon-padding":5},paint:{"text-color":"#1E1E1E","text-halo-color":"#ffffff","text-halo-width":1}})}},{key:"clearSelectedContentLayer",value:function(){this.map.map.getSource("selected-content").setData({type:"FeatureCollection",features:[]})}},{key:"clearHighlightedContentLayer",value:function(){this.map.map.getSource("highlighted-content").setData({type:"FeatureCollection",features:[]})}},{key:"addSelectedFeature",value:function(t,e){var n=this.map.map.getSource("selected-content"),r=n._data,o={type:"Feature",geometry:{type:"Point",coordinates:t},properties:e};r.features.push(o),n.setData(r)}},{key:"addHighlightedFeature",value:function(t,e){var n=this.map.map.getSource("highlighted-content"),r=n._data,o={type:"Feature",geometry:{type:"Point",coordinates:t},properties:e};r.features.push(o),n.setData(r)}},{key:"_handleDefaultState",value:function(){this.clearHighlightedContentLayer(),this.clearSelectedContentLayer(),this.showSymbolLayers()}},{key:"_handleSearchState",value:function(t){t.query;var e=t.results;this.hideSymbolLayers(),this.clearSelectedContentLayer(),this.updateLabelsForSearchResults(e)}},{key:"_handleSelectedContentState",value:function(t){t.contentPlacementIds;var e=t.selectedContentPlacement;this.updateLabelForSelectedContentPlacement(e)}},{key:"_handleDirectionsState",value:function(t){console.log("handling directions state in interaction control")}},{key:"hideSymbolLayers",value:function(){var t=this;this.map.map.getStyle().layers.forEach((function(e){"symbol"===e.type&&"selected-content-layer"!==e.id&&"highlighted-content-layer"!==e.id&&t.map.map.setLayoutProperty(e.id,"visibility","none")}))}},{key:"showSymbolLayers",value:function(){var t=this;this.map.map.getStyle().layers.forEach((function(e){"symbol"===e.type&&t.map.map.setLayoutProperty(e.id,"visibility","visible")}))}},{key:"updateLabelsForSearchResults",value:function(t){var e=this;this.clearHighlightedContentLayer();var n=[];if(t.forEach((function(t){var r=t.placement_id,o=e.map._findFeatureByPlacementId(r);if(o){var i=o.geometry.coordinates,a=o.properties;e.addHighlightedFeature(i,a),n.push(o)}})),n.length){var r=new mapboxgl.LngLatBounds;if(n.forEach((function(t){r.extend(t.geometry.coordinates)})),"desktop"===this.currentView)this.map.map.fitBounds(r,{padding:{top:200,bottom:200,left:550,right:200},maxZoom:15,duration:1e3});else if("mobile"===this.currentView){var o=.55*this.map.mapContainer.offsetHeight,i=.2*this.map.mapContainer.offsetWidth;this.map.map.fitBounds(r,{padding:{top:200,bottom:o,left:i,right:i},maxZoom:15,duration:1e3})}}}},{key:"updateLabelForSelectedContentPlacement",value:function(t){var e=t.placement_id;this.clearSelectedContentLayer();var n=this.map.map.queryRenderedFeatures({filter:["==",["get","placement_id"],e]});if(0!==n.length){var r=n[0],o=r.geometry.coordinates,i=r.properties;if(this.addSelectedFeature(o,i),"desktop"===this.currentView)this.map.map.easeTo({center:o,padding:{top:0,bottom:0,left:330,right:0},duration:1e3});else if("mobile"===this.currentView){var a=.35*this.map.mapContainer.offsetHeight;this.map.map.easeTo({center:o,padding:{top:0,bottom:a,left:0,right:0},duration:1e3})}}}},{key:"applyHoverEffectToAllSymbolLayers",value:function(){var t=this;this.map.map.getStyle().layers.forEach((function(e){if("symbol"===e.type){var n=e.id,r=t.textColorReference[n];t.map.map.on("mouseenter",n,(function(e){var o=e.features[0],i=o.properties.placement_id;if(t.previouslySelectedFeature&&t.previouslySelectedFeature.layer.id===o.layer.id){t.originalTextColor=t.previouslySelectedTextColor;var a=t.previouslySelectedFeature.properties.placement_id;t.map.map.setPaintProperty(n,"text-color",["case",["==",["get","placement_id"],i],"#4B90F7",["==",["get","placement_id"],a],t.selectedTextColor,r])}else t.originalTextColor=t.map.map.getPaintProperty(n,"text-color"),t.map.map.setPaintProperty(n,"text-color",["case",["==",["get","placement_id"],i],"#4B90F7",r]);t.map.map.getCanvas().style.cursor="pointer"})),t.map.map.on("mouseleave",n,(function(){if(t.previouslySelectedFeature){var e=t.previouslySelectedFeature.properties.placement_id;t.map.map.setPaintProperty(n,"text-color",["case",["==",["get","placement_id"],e],t.selectedTextColor,r])}else t.map.map.setPaintProperty(n,"text-color",r);t.map.map.getCanvas().style.cursor="default"}))}}))}},{key:"_handleClick",value:function(t){var e=this.map.map.queryRenderedFeatures(t.point).filter((function(t){return"symbol"===t.layer.type}));if(e.length>0){var n=e[0].properties.placement_id;this.map.setToSelectedContentState([n])}}}],r&&Ti(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);function Ci(t){return Ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ci(t)}function Pi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ai(r.key),r)}}function Ai(t){var e=function(t){if("object"!=Ci(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ci(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ci(e)?e:e+""}function Bi(t,e,n){return e=Ri(e),function(t,e){if(e&&("object"==Ci(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,zi()?Reflect.construct(e,n||[],Ri(t).constructor):e.apply(t,n))}function zi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zi=function(){return!!t})()}function Ri(t){return Ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ri(t)}function Ui(t,e){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ui(t,e)}const Vi=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Bi(this,e,[r])).steps=t,n._initialize(),n}return function(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&&Ui(t,e)}(e,t),n=e,(r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="steps-view",this._render(this.steps)}},{key:"_render",value:function(t){console.log("HERE ARE STEPSSS",t);var e=document.createElement("h2");e.textContent="Steps",this.element.appendChild(e);var n=document.createElement("ul");t.forEach((function(t){var e=document.createElement("li");e.textContent=t,n.appendChild(e)})),this.element.appendChild(n)}},{key:"getElement",value:function(){return this.element}}])&&Pi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yn);function Fi(t){return Fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(t)}function Qi(){Qi=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),c=new D(r||[]);return o(a,"_invoke",{value:T(t,n,c)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",m={};function v(){}function g(){}function b(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(k([])));j&&j!==n&&r.call(j,a)&&(w=j);var M=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,i,a,c){var s=f(t[o],t,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==Fi(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=x(c,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var u=f(e,n,r);if("normal"===u.type){if(o=r.done?d:p,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=d,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Fi(e)+" is not iterable")}return g.prototype=b,o(M,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,s,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},S(O.prototype),u(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new O(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(M),u(M,s,"Generator"),u(M,a,(function(){return this})),u(M,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,D.prototype={constructor:D,reset:function(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(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,m):this.complete(a)},complete:function(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),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}function Yi(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function Hi(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Yi(i,r,o,a,c,"next",t)}function c(t){Yi(i,r,o,a,c,"throw",t)}a(void 0)}))}}function Gi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zi(r.key),r)}}function Zi(t){var e=function(t){if("object"!=Fi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fi(e)?e:e+""}function Wi(t,e,n){return e=Ji(e),function(t,e){if(e&&("object"==Fi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qi()?Reflect.construct(e,n||[],Ji(t).constructor):e.apply(t,n))}function qi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qi=function(){return!!t})()}function Ji(t){return Ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ji(t)}function Ki(t,e){return Ki=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ki(t,e)}const Xi=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=Wi(this,e,[n])).startSearchBox=new Yr,t.endSearchBox=new Yr,t.startContentPlacement=null,t.endContentPlacement=null,t.steps=null,t.searchApi=He.getSearchApi(),t._initialize(),t}return function(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&&Ki(t,e)}(e,t),n=e,r=[{key:"_initialize",value:function(){this.element=document.createElement("div"),this.element.className="directions-view",this.directionsViewHeader=document.createElement("div"),this.directionsViewHeader.className="directions-view-header",this.searchBoxesContainer=document.createElement("div"),this.searchBoxesContainer.className="directions-search-boxes-container",this.circlesAndSearchWrapper=document.createElement("div"),this.circlesAndSearchWrapper.className="directions-circles-search-wrapper";var t=this._createCirclesContainer();this.circlesAndSearchWrapper.appendChild(t),this.startSearchBox.searchBar.updateLeftButtonIcon("none"),this.startSearchBox.searchBar.updateRightButtonIcon("none"),this.endSearchBox.searchBar.updateLeftButtonIcon("none"),this.endSearchBox.searchBar.updateRightButtonIcon("none"),this.startSearchBox.searchBar.setPlaceholderText("Choose starting point"),this.endSearchBox.searchBar.setPlaceholderText("Choose destination"),this.searchBoxesContainer.appendChild(this.startSearchBox.getElement()),this.searchBoxesContainer.appendChild(this.endSearchBox.getElement()),this.circlesAndSearchWrapper.appendChild(this.searchBoxesContainer),this.directionsViewHeader.appendChild(this.circlesAndSearchWrapper),this._render(),this._setupEventListeners()}},{key:"_createCirclesContainer",value:function(){var t=document.createElement("div");t.className="directions-circles-container";var e=document.createElement("div");e.className="large-circle";var n=document.createElement("div");n.className="end-circle";var r=document.createElement("div");r.className="small-circle";var o=document.createElement("div");o.className="small-circle";var i=document.createElement("div");return i.className="small-circle",t.appendChild(e),t.appendChild(r),t.appendChild(o),t.appendChild(i),t.appendChild(n),t}},{key:"_render",value:function(){if(this.element.appendChild(this.directionsViewHeader),this.steps){var t=new Vi(this.steps);this.element.appendChild(t.getElement())}}},{key:"_setupEventListeners",value:function(){this.startSearchBox.searchBar.on("focus",this._handleStartSearchBarFocus.bind(this)),this.startSearchBox.searchBar.on("blur",this._handleStartSearchBarBlur.bind(this)),this.endSearchBox.searchBar.on("focus",this._handleEndSearchBarFocus.bind(this)),this.endSearchBox.searchBar.on("blur",this._handleEndSearchBarBlur.bind(this)),this.startSearchBox.searchBarSuggestionsView.on("selectCell",this._handleStartContentPlacementSelect.bind(this)),this.endSearchBox.searchBarSuggestionsView.on("selectCell",this._handleEndContentPlacementSelect.bind(this))}},{key:"_handleStartContentPlacementSelect",value:(i=Hi(Qi().mark((function t(e){var n,r,o;return Qi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.result,r=n.placement_id,this.startSearchBox.searchBar.setText(n.name),t.next=5,this.searchApi.fetchContentPlacementDetails(r);case 5:o=t.sent,this.updateView(o,this.endContentPlacement);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"_handleEndContentPlacementSelect",value:(o=Hi(Qi().mark((function t(e){var n,r,o;return Qi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.result,r=n.placement_id,this.endSearchBox.searchBar.setText(n.name),t.next=5,this.searchApi.fetchContentPlacementDetails(r);case 5:o=t.sent,this.updateView(this.startContentPlacement,o);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"_handleStartSearchBarFocus",value:function(){this.startSearchBox.searchBar.updateRightButtonIcon("search")}},{key:"_handleEndSearchBarFocus",value:function(){this.endSearchBox.searchBar.updateRightButtonIcon("search")}},{key:"_handleStartSearchBarBlur",value:function(){this.startSearchBox.searchBar.updateRightButtonIcon("none")}},{key:"_handleEndSearchBarBlur",value:function(){this.endSearchBox.searchBar.updateRightButtonIcon("none")}},{key:"updateView",value:function(t,e){if(this.startContentPlacement=t,this.endContentPlacement=e,t&&e)console.log("BOTH ARE THERE, LETS FIRE PATH"),this.fire("initiate:findPath",{startContentPlacementId:t.placement_id,endContentPlacementId:e.placement_id});else if(t){var n=t.content.data[t.content.title_key];this.startSearchBox.searchBar.setText(n),this.endSearchBox.searchBar.setText(""),this.endSearchBox.searchBar.input.focus(),this.clearSteps()}else if(e){var r=e.content.data[e.content.title_key];this.endSearchBox.searchBar.setText(r),this.startSearchBox.searchBar.setText(""),this.startSearchBox.searchBar.input.focus(),this.clearSteps()}}},{key:"setSteps",value:function(t){this.steps=t,this._render()}},{key:"clearSteps",value:function(){var t=this.element.querySelector(".steps-view");t&&t.remove()}},{key:"getElement",value:function(){return this.element}}],r&&Gi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(yn);function $i(t){return $i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$i(t)}function ta(t,e,n){return(e=na(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ea(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,na(r.key),r)}}function na(t){var e=function(t){if("object"!=$i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$i(e)?e:e+""}function ra(t,e,n){return e=aa(e),function(t,e){if(e&&("object"==$i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,oa()?Reflect.construct(e,n||[],aa(t).constructor):e.apply(t,n))}function oa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(oa=function(){return!!t})()}function ia(){return ia="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=aa(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ia.apply(null,arguments)}function aa(t){return aa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},aa(t)}function ca(t,e){return ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ca(t,e)}const sa=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ra(this,e,[n])).directionsView=null,t.map=null,t}return function(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&&ca(t,e)}(e,t),n=e,r=[{key:"onAdd",value:function(t){return this.map=t,this.container=document.createElement("div"),this.container.className="directions-control-container",this.directionsView=new Xi,this.container.appendChild(this.directionsView.getElement()),this.initializeEventListeners(),this.createDirectionsLineLayer(),this._attachResizeListener(),this._initialize(),this.hide(),this.container}},{key:"onRemove",value:function(){var t,n,r;(t=e,n=this,r=ia(aa(1&3?t.prototype:t),"onRemove",n),function(t){return r.apply(n,t)})([])}},{key:"initializeEventListeners",value:function(){this.map.on("state:default",this._handleDefaultState.bind(this)),this.map.on("state:search",this._handleSearchState.bind(this)),this.map.on("state:selectedContent",this._handleSelectedContentState.bind(this)),this.map.on("state:directions",this._handleDirectionsState.bind(this)),this.directionsView.on("initiate:findPath",this._handleIntiateFindPath.bind(this))}},{key:"_renderDesktopView",value:function(){if(this.directionsView){var t=this.directionsView.getElement();this.container.appendChild(t),this.container.classList.remove("mobile-view"),this.container.classList.add("desktop-view"),console.log("rendering search results DESKTOP")}}},{key:"_renderMobileView",value:function(){if(this.directionsView){var t=this.directionsView.getElement();this.container.appendChild(t),this.container.classList.remove("desktop-view"),this.container.classList.add("mobile-view"),console.log("rendering search results MOBILE")}}},{key:"createDirectionsLineLayer",value:function(){this.map.map.addSource("directionsLineSource",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[]}}}),this.map.map.addLayer({id:"directionsLineLayer",type:"line",source:"directionsLineSource",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#1e1e1e","line-width":8}}),this.map.map.moveLayer("directionsLineLayer","special-areas")}},{key:"updateLineData",value:function(t){this.map.map.getSource("directionsLineSource").setData({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:t}});var e=new mapboxgl.LngLatBounds;t.forEach((function(t){e.extend(t)})),this.map.map.fitBounds(e,ta(ta(ta({padding:200},"padding",{top:200,bottom:200,left:500,right:150}),"maxZoom",15),"duration",1e3))}},{key:"clearLineData",value:function(){this.map.map.getSource("directionsLineSource").setData({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[]}})}},{key:"_handleDefaultState",value:function(){this.hide()}},{key:"_handleSearchState",value:function(t){t.query,t.results,this.hide()}},{key:"_handleSelectedContentState",value:function(t){t.contentPlacementIds,t.selectedContentPlacement,this.hide(),this.directionsView.updateView(null,null),this.clearLineData()}},{key:"_handleDirectionsState",value:function(t){var e=t.startContentPlacement,n=t.endContentPlacement;console.log("handling directions state in directions control",t),this.show(),this.clearLineData(),this.directionsView.updateView(e,n)}},{key:"_handleIntiateFindPath",value:function(t){var e=t.startContentPlacementId,n=t.endContentPlacementId;this.clearLineData();var r=this.map.findPath(e,n);console.log("HERE IS PATH RESPONSEEE",r);var o=r.coordinates,i=r.steps;this.updateLineData(o),this.directionsView.setSteps(i)}},{key:"_handleSelectDirectionsButton",value:function(t){t.placementId}},{key:"_render",value:function(){console.log("render")}}],r&&ea(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(zn);"undefined"!=typeof window&&(t.p=window.location.origin+"/");const ua={MapView:ur,SearchBox:Yr,SearchBoxControl:$r,CategoryBarControl:vo,SearchResultsControl:Zn,ContentPlacementControl:Si,InteractionControl:_i,DirectionsControl:sa,setApiKey:He.setApiKey.bind(He)};return e.default})()));
|