var __awaiter=this&&this.__awaiter||function(t,i,r,n){function e(t){return t instanceof r?t:new r((function(i){i(t)}))}return new(r||(r=Promise))((function(r,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n["throw"](t))}catch(t){a(t)}}function u(t){t.done?r(t.value):e(t.value).then(o,c)}u((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,e,a,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(t){return function(i){return u([t,i])}}function u(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(r=0)),r)try{if(n=1,e&&(a=c[0]&2?e["return"]:c[0]?e["throw"]||((a=e["return"])&&a.call(e),0):e.next)&&!(a=a.call(e,c[1])).done)return a;if(e=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;e=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1];a=c;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(c);break}if(a[2])r.ops.pop();r.trys.pop();continue}c=i.call(t,r)}catch(t){c=[6,t];e=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};
/*!
 * Copyright (c) what3words http://what3words.com
 */import{g as getScriptInitOptions,a as sdk,u as utilisation,S as ScriptInitParameter,c as SESSION_ID_KEY}from"./utilisation-BtTtF6d2.js";function appGlobalScript(){return __awaiter(this,void 0,void 0,(function(){var t,i,r,n,e,a,o,c,u,s,f,l;return __generator(this,(function(p){switch(p.label){case 0:i=window;r=i.w3w,n=r===void 0?{}:r;e=n.callback,a=n.key,o=n.host,c=n.version,u=n.headers;s=getScriptInitOptions();f=a!==null&&a!==void 0?a:s[ScriptInitParameter.KEY];if(f){sdk.api.setApiKey(f);utilisation.setApiKey(f)}if(o||s[ScriptInitParameter.BASEURL]){sdk.api.setConfig({host:o!==null&&o!==void 0?o:s[ScriptInitParameter.BASEURL]})}if(c||s[ScriptInitParameter.VERSION]){sdk.api.setConfig({apiVersion:c!==null&&c!==void 0?c:s[ScriptInitParameter.VERSION]})}if(u){sdk.api.setConfig({headers:u})}i.what3words=sdk;if(!!i.sessionStorage.getItem(SESSION_ID_KEY))return[3,2];return[4,import("./index-4ePKl-vU.js")];case 1:l=p.sent().v4;i.sessionStorage.setItem(SESSION_ID_KEY,l({rng:function(){var t=[];for(var i=0;i<16;i++){t.push(Math.round(Math.random()*255))}return t}}));p.label=2;case 2:i.what3words_session_id=i.sessionStorage.getItem(SESSION_ID_KEY);if(e&&typeof i[e]==="function"){i[e](sdk)}if(s[ScriptInitParameter.CALLBACK]&&typeof i[s[ScriptInitParameter.CALLBACK]]==="function"){(t=i[s[ScriptInitParameter.CALLBACK]])===null||t===void 0?void 0:t.call(i)}return[2]}}))}))}var globalScripts=appGlobalScript;export{globalScripts as g};