@entur-partner/app-shell 2.1.0 → 2.2.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"app-shell.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/authReducer.tsx","../src/Auth.tsx","../src/AppShell.tsx","../src/MenuProvider.tsx","../src/storage.ts","../src/OrganisationProvider.tsx","../src/LanguageProvider.tsx","../src/MicroFrontendLink.tsx","../src/OrganisationSelector.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import { User } from '@entur-partner/micro-frontend';\n\nexport type AuthStatus =\n | 'AUTHENTICATING'\n | 'AUTHENTICATED'\n | 'NOT_AUTHENTICATED'\n | 'ERROR';\n\nexport type AuthState =\n | {\n status: AuthStatus;\n user?: User;\n error?: Error;\n }\n | {\n status: 'AUTHENTICATED';\n user: User;\n }\n | {\n status: 'ERROR';\n error: Error;\n };\n\ntype AuthEvent =\n | {\n type: 'AUTHENTICATED';\n data: {\n user: User;\n };\n }\n | {\n type: 'LOGOUT';\n }\n | {\n type: 'ERROR';\n error: Error;\n }\n | {\n type: 'NOT_AUTHENTICATED';\n };\n\nconst initialState: AuthState = {\n status: 'AUTHENTICATING',\n};\n\nexport function authReducer(state: AuthState, event: AuthEvent): AuthState {\n switch (event.type) {\n case 'AUTHENTICATED':\n return {\n status: 'AUTHENTICATED',\n user: event.data.user,\n };\n case 'LOGOUT':\n return initialState;\n case 'ERROR':\n return {\n error: event.error,\n status: 'ERROR',\n };\n case 'NOT_AUTHENTICATED':\n return {\n ...state,\n status: 'NOT_AUTHENTICATED',\n };\n default:\n return state;\n }\n}\n","import React, { FC, useState, useEffect, useContext, useReducer } from 'react';\nimport createAuth0Client, {\n Auth0ClientOptions,\n Auth0Client,\n GetTokenSilentlyOptions,\n} from '@auth0/auth0-spa-js';\nimport { User } from '@entur-partner/micro-frontend';\nimport { assertIsDefined } from '@entur-partner/util';\n\nimport { authReducer, AuthState, AuthStatus } from './authReducer';\nimport { Auth0User, DecorateUserFn } from './UserTypes';\n\nconst POST_LOGIN_ROUTE_KEY = '@entur-partner:post-login-route';\n\nconst redirect = (pathname = '/') =>\n window.history.replaceState({}, document.title, pathname); // TODO: replace with react-router history\n\ninterface AuthContextType {\n status: AuthStatus;\n user?: User;\n error?: Error;\n logout: () => void;\n login: (redirectUri?: string) => void;\n getToken: () => Promise<string>;\n auth0Client?: Auth0Client;\n}\n\nexport const Auth0Context = React.createContext<AuthContextType | undefined>(\n undefined\n);\n\nexport const useAuth = () => {\n const auth = useContext(Auth0Context);\n assertIsDefined(\n auth,\n 'A `<Auth0Provider>` component needs to be higher up in the component hierarchy.'\n );\n return auth;\n};\n\nconst initialState: AuthState = {\n status: 'AUTHENTICATING',\n};\n\ninterface AuthProviderProps extends Auth0ClientOptions {\n decorateUser: DecorateUserFn;\n}\nexport const AuthProvider: FC<AuthProviderProps> = ({\n children,\n decorateUser,\n ...initOptions\n}) => {\n const [state, dispatch] = useReducer(authReducer, initialState);\n const [auth0Client, setAuth0] = useState<Auth0Client | undefined>();\n\n useEffect(() => {\n const initAuth0 = async () => {\n const client = await createAuth0Client(initOptions);\n setAuth0(client);\n\n if (window.location.search.includes('code=')) {\n await client.handleRedirectCallback();\n const route = localStorage.getItem(POST_LOGIN_ROUTE_KEY);\n localStorage.removeItem(POST_LOGIN_ROUTE_KEY);\n const postLoginRoute = route || '/';\n redirect(postLoginRoute);\n }\n\n const isAuthenticated = await client.isAuthenticated();\n\n if (isAuthenticated) {\n const auth0User = (await client.getUser()) as Auth0User;\n const token = await client.getTokenSilently();\n const user = await decorateUser(auth0User, token);\n\n dispatch({ type: 'AUTHENTICATED', data: { user } });\n } else {\n dispatch({ type: 'NOT_AUTHENTICATED' });\n }\n };\n\n initAuth0().catch((error) => {\n dispatch({ type: 'ERROR', error });\n });\n // eslint-disable-next-line\n }, []);\n\n const logout = () => {\n assertIsDefined(auth0Client);\n const { protocol, hostname, port } = window.location;\n auth0Client.logout({\n returnTo: `${protocol}//${hostname}:${port}`,\n });\n };\n\n const login = async (redirectUri = window.location.origin) => {\n assertIsDefined(auth0Client);\n\n const { location } = window;\n localStorage.setItem(\n POST_LOGIN_ROUTE_KEY,\n `${location.pathname}${location.search}`\n );\n auth0Client.loginWithRedirect({\n redirect_uri: redirectUri,\n });\n };\n\n const getToken = async (options?: GetTokenSilentlyOptions) => {\n assertIsDefined(auth0Client);\n return auth0Client.getTokenSilently(options);\n };\n\n return (\n <Auth0Context.Provider\n value={{\n ...state,\n auth0Client,\n logout,\n getToken,\n login,\n }}\n >\n {children}\n </Auth0Context.Provider>\n );\n};\n","import React, { FC, ReactNode, useEffect } from 'react';\nimport { Loader } from '@entur/loader';\nimport { BannerAlertBox } from '@entur/alert';\nimport { space } from '@entur/tokens';\nimport { GetTokenSilentlyOptions } from '@auth0/auth0-spa-js';\nimport { User } from '@entur-partner/micro-frontend';\nimport { assertIsDefined } from '@entur-partner/util';\n\nimport { AuthProvider, useAuth } from './Auth';\nimport { DecorateUserFn } from './UserTypes';\n\nexport interface AppShellValues {\n logout: () => void;\n user: User;\n getToken(options?: GetTokenSilentlyOptions): Promise<string>;\n}\n\ninterface AuthenticateProps {\n redirectUri?: string;\n children: (options: AppShellValues) => ReactNode;\n}\n\nconst Login: FC<{ redirectUri?: string }> = ({ redirectUri }) => {\n const { login } = useAuth();\n useEffect(() => {\n login(redirectUri);\n }, [login, redirectUri]);\n return null;\n};\n\nconst Authenticate: FC<AuthenticateProps> = ({ children, redirectUri }) => {\n const { status, user, error, logout, getToken } = useAuth();\n\n switch (status) {\n case 'NOT_AUTHENTICATED':\n return <Login redirectUri={redirectUri} />;\n case 'AUTHENTICATED':\n assertIsDefined(user);\n return (\n <>\n {children({\n user,\n logout,\n getToken,\n })}\n </>\n );\n case 'AUTHENTICATING':\n return (\n <Loader style={{ marginTop: space.extraLarge9 }}>Authenticating</Loader>\n );\n case 'ERROR':\n process.env.NODE_ENV !== 'production' && console.error(error);\n return (\n <BannerAlertBox\n variant=\"error\"\n title=\"Authentication failed\"\n style={{ maxWidth: '600px', margin: '0 auto' }}\n >\n Authentication failed with: {error?.toString()}\n </BannerAlertBox>\n );\n default:\n return null;\n }\n};\n\nexport interface AppShellProps {\n children: (options: AppShellValues) => ReactNode;\n audience: string;\n domain: string;\n clientId: string;\n decorateUser: DecorateUserFn;\n redirectUri?: string;\n}\n\nexport const AppShell = ({\n children,\n audience,\n domain,\n clientId,\n redirectUri,\n decorateUser,\n}: AppShellProps) => {\n return (\n <AuthProvider\n audience={audience}\n domain={domain}\n client_id={clientId}\n decorateUser={decorateUser}\n >\n <Authenticate redirectUri={redirectUri}>\n {(params) => children(params)}\n </Authenticate>\n </AuthProvider>\n );\n};\n","import React, { FC, ReactNode, useCallback, useContext, useState } from 'react';\nimport { MenuItem, NavigationFunction } from '@entur-partner/micro-frontend';\n\ninterface MenuGroups {\n [path: string]: MenuItem[];\n}\n\ninterface MenuContextType {\n getItemsForPath: (path: string) => MenuItem[];\n addItems: (items: MenuItem[], path: string) => void;\n getMFNavigate: (path: string) => NavigationFunction | undefined;\n setMFNavigate: (path: string, navigation: NavigationFunction) => void;\n}\n\nexport const MenuContext = React.createContext<MenuContextType>({\n addItems: () => {},\n getItemsForPath: () => [],\n getMFNavigate: () => undefined,\n setMFNavigate: () => {},\n});\n\nexport const useMenuGroupItems = (path: string) => {\n const context = useContext(MenuContext);\n return context.getItemsForPath(path);\n};\n\nexport const useMenu = () => {\n return useContext(MenuContext);\n};\n\nexport const useMFNavigation = (path: string) => {\n const { getMFNavigate } = useMenu();\n return getMFNavigate(path);\n};\n\ninterface MenuProviderProps {\n children: ReactNode;\n}\n\nexport const MenuProvider: FC<MenuProviderProps> = ({ children }) => {\n const [groups, setGroups] = useState<MenuGroups>({});\n const [navFuncs, setNavFuncs] = useState<Record<string, NavigationFunction>>(\n {}\n );\n\n const addItems = useCallback(\n (newItems: MenuItem[], path: string) => {\n setGroups((prevState) => ({\n ...prevState,\n [path]: newItems,\n }));\n },\n [setGroups]\n );\n\n const getMFNavigate = (path: string) => navFuncs[path];\n const setMFNavigate = (path: string, navigation: NavigationFunction) =>\n setNavFuncs((prev) => ({ ...prev, [path]: navigation }));\n\n return (\n <MenuContext.Provider\n value={{\n addItems,\n getItemsForPath: (path) => groups[path] ?? [],\n getMFNavigate,\n setMFNavigate,\n }}\n >\n {children}\n </MenuContext.Provider>\n );\n};\n","export const ORGANISATION_STORAGE_KEY = 'EP::activeOrgId';\n\nexport const organisationStorage = {\n get: () => localStorage.getItem(ORGANISATION_STORAGE_KEY),\n set: (value: string) => localStorage.setItem(ORGANISATION_STORAGE_KEY, value),\n};\n\nexport const LANGUAGE_STORAGE_KEY = 'EP::locale';\n\nexport const languageStorage = {\n get: () => localStorage.getItem(LANGUAGE_STORAGE_KEY),\n set: (value: string) => localStorage.setItem(LANGUAGE_STORAGE_KEY, value),\n};\n","import React, {\n FC,\n ReactNode,\n useContext,\n useState,\n useEffect,\n SetStateAction,\n Dispatch,\n} from 'react';\nimport { assertIsDefined } from '@entur-partner/util';\n\nimport { organisationStorage } from './storage';\n\ninterface OrganisationContextType {\n organisationId: number;\n setOrganisationId: (organisationId: number) => void;\n}\n\nconst OrganisationContext = React.createContext<\n OrganisationContextType | undefined\n>(undefined);\n\nexport const useOrganisation = () => {\n const context = useContext(OrganisationContext);\n assertIsDefined(context);\n return context;\n};\n\nexport const useOrganisationId = () => {\n const context = useContext(OrganisationContext);\n assertIsDefined(context);\n return context.organisationId;\n};\n\nconst useOrganisationState = (\n initialOrganisationId: string\n): [number, Dispatch<SetStateAction<number>>] => {\n const [organisationId, setOrganisationId] = useState<number>(\n Number(initialOrganisationId)\n );\n\n useEffect(() => {\n organisationStorage.set(organisationId.toString());\n }, [organisationId]);\n\n return [organisationId, setOrganisationId];\n};\n\ninterface OrganisationProviderProps {\n children: ReactNode;\n organisationId: string;\n}\n\nexport const OrganisationProvider: FC<OrganisationProviderProps> = ({\n children,\n organisationId,\n}) => {\n const [orgId, setOrganisationId] = useOrganisationState(organisationId);\n return (\n <OrganisationContext.Provider\n value={{ organisationId: orgId, setOrganisationId }}\n >\n {children}\n </OrganisationContext.Provider>\n );\n};\n","import React, {\n FC,\n ReactNode,\n useContext,\n useState,\n useEffect,\n SetStateAction,\n Dispatch,\n} from 'react';\nimport { assertIsDefined } from '@entur-partner/util';\n\nimport { languageStorage } from './storage';\n\ninterface LanguageContextType {\n language: string;\n setLanguage: (language: string) => void;\n}\n\nconst LanguageContext = React.createContext<LanguageContextType | undefined>(\n undefined\n);\n\nconst useLanguageState = (\n language: string\n): [string, Dispatch<SetStateAction<string>>] => {\n const [activeLanguage, setLanguage] = useState(language);\n\n useEffect(() => {\n languageStorage.set(activeLanguage);\n }, [activeLanguage]);\n\n return [activeLanguage, setLanguage];\n};\n\nexport const useLanguage = () => {\n const context = useContext(LanguageContext);\n assertIsDefined(context);\n return context;\n};\n\ninterface LanguageProviderProps {\n children: ReactNode;\n language: string;\n}\n\nexport const LanguageProvider: FC<LanguageProviderProps> = ({\n children,\n language,\n}) => {\n const [activeLanguage, setLanguage] = useLanguageState(language);\n return (\n <LanguageContext.Provider value={{ language: activeLanguage, setLanguage }}>\n {children}\n </LanguageContext.Provider>\n );\n};\n","import React, { FC, MouseEvent, ReactNode, AnchorHTMLAttributes } from 'react';\n\ninterface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n href: string;\n navigate: () => void;\n children: ReactNode;\n}\n\nfunction isModifiedEvent(event: MouseEvent) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nexport const MicroFrontendLink: FC<LinkProps> = ({\n navigate,\n children,\n onClick,\n target,\n ...rest\n}) => {\n return (\n <a\n onClick={(event) => {\n try {\n if (onClick) onClick(event);\n } catch (ex) {\n event.preventDefault();\n throw ex;\n }\n\n if (\n !event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore everything but right clicks\n (!target || target === '_self') && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n navigate();\n }\n }}\n target={target}\n {...rest}\n >\n {children}\n </a>\n );\n};\n","import React, { FC, useEffect, useState } from 'react';\nimport { OrganisationDropDown } from '@entur-partner/common';\nimport { SkeletonRectangle } from '@entur/loader';\nimport { GetTokenSilentlyOptions } from '@auth0/auth0-spa-js';\n\nimport { useLanguage } from './LanguageProvider';\n\nexport type GetOrganisationsFn = (token: string) => Promise<Organisation[]>;\n\nexport interface Organisation {\n name: string;\n id: string;\n}\n\nexport interface OrganisationSelectorProps {\n getToken: (options?: GetTokenSilentlyOptions) => Promise<string>;\n getOrganisations: GetOrganisationsFn;\n value: string;\n onChange: (id: string) => void;\n [key: string]: any;\n}\n\nexport const OrganisationSelector: FC<OrganisationSelectorProps> = ({\n getToken,\n getOrganisations,\n value,\n onChange,\n ...rest\n}) => {\n const [organisations, setOrganisations] = useState<Organisation[]>([]);\n\n const { language } = useLanguage();\n\n const [status, setStatus] = useState<'LOADING' | 'ERROR' | 'SUCCESS'>(\n 'LOADING'\n );\n\n useEffect(() => {\n const fetchOrganisations = async () => {\n const token = await getToken();\n const organisations = await getOrganisations(token);\n setOrganisations(organisations);\n setStatus('SUCCESS');\n };\n\n fetchOrganisations().catch((error) => {\n if (process.env.NODE_ENV === 'development') {\n console.error(error);\n }\n setStatus('ERROR');\n });\n }, [getOrganisations, getToken]);\n\n switch (status) {\n case 'LOADING':\n return (\n <div className=\"eds-contrast\">\n <SkeletonRectangle style={{ height: '2.4rem' }} />\n </div>\n );\n case 'SUCCESS':\n return (\n <OrganisationDropDown\n label={language === 'nb' ? 'Organisasjon' : 'Organisation'}\n selectedOrganisationId={value}\n organisations={organisations}\n onChange={onChange}\n {...rest}\n />\n );\n case 'ERROR':\n throw new Error('Failed fetching organisations');\n default:\n return null;\n }\n};\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","Function","initialState","status","authReducer","event","user","data","Auth0Context","React","createContext","useAuth","auth","useContext","assertIsDefined","AuthProvider","children","decorateUser","initOptions","useReducer","dispatch","useState","auth0Client","setAuth0","useEffect","createAuth0Client","client","window","location","search","includes","handleRedirectCallback","route","localStorage","getItem","removeItem","pathname","history","replaceState","document","title","isAuthenticated","getUser","auth0User","getTokenSilently","token","initAuth0","login","redirectUri","origin","setItem","loginWithRedirect","redirect_uri","getToken","options","Provider","logout","returnTo","protocol","hostname","port","Login","Authenticate","Loader","style","marginTop","space","extraLarge9","BannerAlertBox","variant","maxWidth","margin","MenuContext","addItems","getItemsForPath","getMFNavigate","setMFNavigate","useMenu","organisationStorage","get","set","languageStorage","OrganisationContext","LanguageContext","useLanguage","audience","domain","client_id","clientId","params","activeLanguage","setLanguage","language","groups","setGroups","navFuncs","setNavFuncs","useCallback","newItems","path","prevState","navigation","navigate","onClick","target","rest","ex","preventDefault","defaultPrevented","button","metaKey","altKey","ctrlKey","shiftKey","isModifiedEvent","organisationId","setOrganisationId","Number","getOrganisations","onChange","organisations","setOrganisations","setStatus","fetchOrganisations","className","SkeletonRectangle","height","OrganisationDropDown","label","selectedOrganisationId"],"mappings":"qkCAOIA,EAAW,SAAUC,OAGnBC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,yBAEtCC,EAAOC,EAAKC,EAAKC,UACxBf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,OAIXF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,UACnBF,EAAIC,GAAOC,YAIbM,EAAKC,EAASC,EAASC,EAAMC,OAGhCC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,WAIzCC,EAAUK,iBAsMcT,EAASE,EAAMK,OACnCG,EA/KuB,wBAiLpB,SAAgBC,EAAQC,MA/KT,cAgLhBF,QACI,IAAIG,MAAM,mCAhLE,cAmLhBH,EAA6B,IAChB,UAAXC,QACIC,QAyQL,CAAEnB,WAzfPqB,EAyfyBC,MAAM,OAjQ/BR,EAAQI,OAASA,EACjBJ,EAAQK,IAAMA,IAED,KACPI,EAAWT,EAAQS,YACnBA,EAAU,KACRC,EAAiBC,EAAoBF,EAAUT,MAC/CU,EAAgB,IACdA,IAAmBE,EAAkB,gBAClCF,MAIY,SAAnBV,EAAQI,OAGVJ,EAAQa,KAAOb,EAAQc,MAAQd,EAAQK,SAElC,GAAuB,UAAnBL,EAAQI,OAAoB,IAlNhB,mBAmNjBD,QACFA,EAjNc,YAkNRH,EA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IAAAA,YAjBuBoG,KAAqB/F,WAC1CgG,SAiBFF,qBAdA3F,aAAU,WACRsD,EAAoBE,IAAImC,EAAe5I,cACtC,CANI4I,SAQA,CAACA,EAAgBC,WActB3G,gBAACyE,EAAoB3B,UACnBhL,MAAO,CAAE4O,oBAAuBC,yBAE/BpG,iCGxC4D,gBACjEqC,IAAAA,SACAiE,IAAAA,iBACA/O,IAAAA,MACAgP,IAAAA,SACGd,4DAEuCpF,WAAyB,IAA5DmG,OAAeC,OAEd7B,EAAaR,IAAbQ,WAEoBvE,WAC1B,WADKlB,OAAQuH,cAIflG,aAAU,uCACmB,kGACL6B,kBAAdR,kBACsByE,EAAiBzE,UAC7C4E,UACAC,EAAU,2GAGZC,UAA2B,SAACzL,GAI1BwL,EAAU,cAEX,CAACJ,EAAkBjE,IAEdlD,OACD,iBAEDM,uBAAKmH,UAAU,gBACbnH,gBAACoH,qBAAkB7D,MAAO,CAAE8D,OAAQ,iBAGrC,iBAEDrH,gBAACsH,sCACCC,MAAoB,OAAbpC,EAAoB,eAAiB,eAC5CqC,uBAAwB1P,EACxBiP,cAAeA,EACfD,SAAUA,GACNd,QAGL,cACG,IAAI9M,MAAM,gDAET,6GL3CkB,SAACwM,UAEvBxB,EADmBE,IAAlBF,eACawB,gDAXU,SAACA,UAChBtF,aAAW2D,GACZE,gBAAgByB,4BEDF,eACvB9M,EAAUwH,aAAWqE,UAC3BpE,kBAAgBzH,GACTA,6BAGwB,eACzBA,EAAUwH,aAAWqE,UAC3BpE,kBAAgBzH,GACTA,EAAQ8N"}
1
+ {"version":3,"file":"app-shell.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/authReducer.tsx","../src/Auth.tsx","../src/AppShell.tsx","../src/MenuProvider.tsx","../src/storage.ts","../src/OrganisationProvider.tsx","../src/LanguageProvider.tsx","../src/MicroFrontendLink.tsx","../src/OrganisationSelector.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import { User } from '@entur-partner/micro-frontend';\n\nexport type AuthStatus =\n | 'AUTHENTICATING'\n | 'AUTHENTICATED'\n | 'NOT_AUTHENTICATED'\n | 'ERROR';\n\nexport type AuthState =\n | {\n status: AuthStatus;\n user?: User;\n error?: Error;\n }\n | {\n status: 'AUTHENTICATED';\n user: User;\n }\n | {\n status: 'ERROR';\n error: Error;\n };\n\ntype AuthEvent =\n | {\n type: 'AUTHENTICATED';\n data: {\n user: User;\n };\n }\n | {\n type: 'LOGOUT';\n }\n | {\n type: 'ERROR';\n error: Error;\n }\n | {\n type: 'NOT_AUTHENTICATED';\n };\n\nconst initialState: AuthState = {\n status: 'AUTHENTICATING',\n};\n\nexport function authReducer(state: AuthState, event: AuthEvent): AuthState {\n switch (event.type) {\n case 'AUTHENTICATED':\n return {\n status: 'AUTHENTICATED',\n user: event.data.user,\n };\n case 'LOGOUT':\n return initialState;\n case 'ERROR':\n return {\n error: event.error,\n status: 'ERROR',\n };\n case 'NOT_AUTHENTICATED':\n return {\n ...state,\n status: 'NOT_AUTHENTICATED',\n };\n default:\n return state;\n }\n}\n","import React, { FC, useState, useEffect, useContext, useReducer } from 'react';\nimport createAuth0Client, {\n Auth0ClientOptions,\n Auth0Client,\n GetTokenSilentlyOptions,\n} from '@auth0/auth0-spa-js';\nimport { User } from '@entur-partner/micro-frontend';\nimport { assertIsDefined } from '@entur-partner/util';\n\nimport { authReducer, AuthState, AuthStatus } from './authReducer';\nimport { Auth0User, DecorateUserFn } from './UserTypes';\n\nconst POST_LOGIN_ROUTE_KEY = '@entur-partner:post-login-route';\n\nconst redirect = (pathname = '/') =>\n window.history.replaceState({}, document.title, pathname); // TODO: replace with react-router history\n\ninterface AuthContextType {\n status: AuthStatus;\n user?: User;\n error?: Error;\n logout: () => void;\n login: (redirectUri?: string) => void;\n getToken: () => Promise<string>;\n auth0Client?: Auth0Client;\n}\n\nexport const Auth0Context = React.createContext<AuthContextType | undefined>(\n undefined\n);\n\nexport const useAuth = () => {\n const auth = useContext(Auth0Context);\n assertIsDefined(\n auth,\n 'A `<Auth0Provider>` component needs to be higher up in the component hierarchy.'\n );\n return auth;\n};\n\nconst initialState: AuthState = {\n status: 'AUTHENTICATING',\n};\n\ninterface AuthProviderProps extends Auth0ClientOptions {\n decorateUser: DecorateUserFn;\n}\nexport const AuthProvider: FC<AuthProviderProps> = ({\n children,\n decorateUser,\n ...initOptions\n}) => {\n const [state, dispatch] = useReducer(authReducer, initialState);\n const [auth0Client, setAuth0] = useState<Auth0Client | undefined>();\n\n useEffect(() => {\n const initAuth0 = async () => {\n const client = await createAuth0Client(initOptions);\n setAuth0(client);\n\n if (window.location.search.includes('code=')) {\n await client.handleRedirectCallback();\n const route = localStorage.getItem(POST_LOGIN_ROUTE_KEY);\n localStorage.removeItem(POST_LOGIN_ROUTE_KEY);\n const postLoginRoute = route || '/';\n redirect(postLoginRoute);\n }\n\n const isAuthenticated = await client.isAuthenticated();\n\n if (isAuthenticated) {\n const auth0User = (await client.getUser()) as Auth0User;\n const token = await client.getTokenSilently();\n const user = await decorateUser(auth0User, token);\n\n dispatch({ type: 'AUTHENTICATED', data: { user } });\n } else {\n dispatch({ type: 'NOT_AUTHENTICATED' });\n }\n };\n\n initAuth0().catch((error) => {\n dispatch({ type: 'ERROR', error });\n });\n // eslint-disable-next-line\n }, []);\n\n const logout = () => {\n assertIsDefined(auth0Client);\n const { protocol, hostname, port } = window.location;\n auth0Client.logout({\n returnTo: `${protocol}//${hostname}:${port}`,\n });\n };\n\n const login = async (redirectUri = window.location.origin) => {\n assertIsDefined(auth0Client);\n\n const { location } = window;\n localStorage.setItem(\n POST_LOGIN_ROUTE_KEY,\n `${location.pathname}${location.search}`\n );\n auth0Client.loginWithRedirect({\n redirect_uri: redirectUri,\n });\n };\n\n const getToken = async (options?: GetTokenSilentlyOptions) => {\n assertIsDefined(auth0Client);\n return auth0Client.getTokenSilently(options);\n };\n\n return (\n <Auth0Context.Provider\n value={{\n ...state,\n auth0Client,\n logout,\n getToken,\n login,\n }}\n >\n {children}\n </Auth0Context.Provider>\n );\n};\n","import React, { FC, ReactNode, useEffect } from 'react';\nimport { Loader } from '@entur/loader';\nimport { BannerAlertBox } from '@entur/alert';\nimport { space } from '@entur/tokens';\nimport { GetTokenSilentlyOptions } from '@auth0/auth0-spa-js';\nimport { User } from '@entur-partner/micro-frontend';\nimport { assertIsDefined } from '@entur-partner/util';\n\nimport { AuthProvider, useAuth } from './Auth';\nimport { DecorateUserFn } from './UserTypes';\n\nexport interface AppShellValues {\n logout: () => void;\n user: User;\n getToken(options?: GetTokenSilentlyOptions): Promise<string>;\n}\n\ninterface AuthenticateProps {\n redirectUri?: string;\n children: (options: AppShellValues) => ReactNode;\n}\n\nconst Login: FC<{ redirectUri?: string }> = ({ redirectUri }) => {\n const { login } = useAuth();\n useEffect(() => {\n login(redirectUri);\n }, [login, redirectUri]);\n return null;\n};\n\nconst Authenticate: FC<AuthenticateProps> = ({ children, redirectUri }) => {\n const { status, user, error, logout, getToken } = useAuth();\n\n switch (status) {\n case 'NOT_AUTHENTICATED':\n return <Login redirectUri={redirectUri} />;\n case 'AUTHENTICATED':\n assertIsDefined(user);\n return (\n <>\n {children({\n user,\n logout,\n getToken,\n })}\n </>\n );\n case 'AUTHENTICATING':\n return (\n <Loader style={{ marginTop: space.extraLarge9 }}>Authenticating</Loader>\n );\n case 'ERROR':\n process.env.NODE_ENV !== 'production' && console.error(error);\n return (\n <BannerAlertBox\n variant=\"error\"\n title=\"Authentication failed\"\n style={{ maxWidth: '600px', margin: '0 auto' }}\n >\n Authentication failed with: {error?.toString()}\n </BannerAlertBox>\n );\n default:\n return null;\n }\n};\n\nexport interface AppShellProps {\n children: (options: AppShellValues) => ReactNode;\n audience: string;\n domain: string;\n clientId: string;\n decorateUser: DecorateUserFn;\n redirectUri?: string;\n}\n\nexport const AppShell = ({\n children,\n audience,\n domain,\n clientId,\n redirectUri,\n decorateUser,\n}: AppShellProps) => {\n return (\n <AuthProvider\n audience={audience}\n domain={domain}\n client_id={clientId}\n decorateUser={decorateUser}\n >\n <Authenticate redirectUri={redirectUri}>\n {(params) => children(params)}\n </Authenticate>\n </AuthProvider>\n );\n};\n","import React, { FC, ReactNode, useCallback, useContext, useState } from 'react';\nimport { MenuItem, NavigationFunction } from '@entur-partner/micro-frontend';\n\ninterface MenuGroups {\n [path: string]: MenuItem[];\n}\n\ninterface MenuContextType {\n getItemsForPath: (path: string) => MenuItem[];\n addItems: (items: MenuItem[], path: string) => void;\n getMFNavigate: (path: string) => NavigationFunction | undefined;\n setMFNavigate: (path: string, navigation: NavigationFunction) => void;\n}\n\nexport const MenuContext = React.createContext<MenuContextType>({\n addItems: () => {},\n getItemsForPath: () => [],\n getMFNavigate: () => undefined,\n setMFNavigate: () => {},\n});\n\nexport const useMenuGroupItems = (path: string) => {\n const context = useContext(MenuContext);\n return context.getItemsForPath(path);\n};\n\nexport const useMenu = () => {\n return useContext(MenuContext);\n};\n\nexport const useMFNavigation = (path: string) => {\n const { getMFNavigate } = useMenu();\n return getMFNavigate(path);\n};\n\ninterface MenuProviderProps {\n children: ReactNode;\n}\n\nexport const MenuProvider: FC<MenuProviderProps> = ({ children }) => {\n const [groups, setGroups] = useState<MenuGroups>({});\n const [navFuncs, setNavFuncs] = useState<Record<string, NavigationFunction>>(\n {}\n );\n\n const addItems = useCallback(\n (newItems: MenuItem[], path: string) => {\n setGroups((prevState) => ({\n ...prevState,\n [path]: newItems,\n }));\n },\n [setGroups]\n );\n\n const getMFNavigate = (path: string) => navFuncs[path];\n const setMFNavigate = (path: string, navigation: NavigationFunction) =>\n setNavFuncs((prev) => ({ ...prev, [path]: navigation }));\n\n return (\n <MenuContext.Provider\n value={{\n addItems,\n getItemsForPath: (path) => groups[path] ?? [],\n getMFNavigate,\n setMFNavigate,\n }}\n >\n {children}\n </MenuContext.Provider>\n );\n};\n","export const ORGANISATION_STORAGE_KEY = 'EP::activeOrgId';\n\nexport const organisationStorage = {\n get: () => localStorage.getItem(ORGANISATION_STORAGE_KEY),\n set: (value: string) => localStorage.setItem(ORGANISATION_STORAGE_KEY, value),\n};\n\nexport const LANGUAGE_STORAGE_KEY = 'EP::locale';\n\nexport const languageStorage = {\n get: () => localStorage.getItem(LANGUAGE_STORAGE_KEY),\n set: (value: string) => localStorage.setItem(LANGUAGE_STORAGE_KEY, value),\n};\n","import React, {\n FC,\n ReactNode,\n useContext,\n useState,\n useEffect,\n SetStateAction,\n Dispatch,\n} from 'react';\nimport { assertIsDefined } from '@entur-partner/util';\n\nimport { organisationStorage } from './storage';\n\ninterface OrganisationContextType {\n organisationId: number;\n setOrganisationId: (organisationId: number) => void;\n}\n\nconst OrganisationContext = React.createContext<\n OrganisationContextType | undefined\n>(undefined);\n\nexport const useOrganisation = () => {\n const context = useContext(OrganisationContext);\n assertIsDefined(context);\n return context;\n};\n\nexport const useOrganisationId = () => {\n const context = useContext(OrganisationContext);\n assertIsDefined(context);\n return context.organisationId;\n};\n\nconst useOrganisationState = (\n initialOrganisationId: string\n): [number, Dispatch<SetStateAction<number>>] => {\n const [organisationId, setOrganisationId] = useState<number>(\n Number(initialOrganisationId)\n );\n\n useEffect(() => {\n organisationStorage.set(organisationId.toString());\n }, [organisationId]);\n\n return [organisationId, setOrganisationId];\n};\n\ninterface OrganisationProviderProps {\n children: ReactNode;\n organisationId: string;\n}\n\nexport const OrganisationProvider: FC<OrganisationProviderProps> = ({\n children,\n organisationId,\n}) => {\n const [orgId, setOrganisationId] = useOrganisationState(organisationId);\n return (\n <OrganisationContext.Provider\n value={{ organisationId: orgId, setOrganisationId }}\n >\n {children}\n </OrganisationContext.Provider>\n );\n};\n","import React, {\n FC,\n ReactNode,\n useContext,\n useState,\n useEffect,\n SetStateAction,\n Dispatch,\n} from 'react';\nimport { assertIsDefined } from '@entur-partner/util';\n\nimport { languageStorage } from './storage';\n\ninterface LanguageContextType {\n language: string;\n setLanguage: (language: string) => void;\n}\n\nconst LanguageContext = React.createContext<LanguageContextType | undefined>(\n undefined\n);\n\nconst useLanguageState = (\n language: string\n): [string, Dispatch<SetStateAction<string>>] => {\n const [activeLanguage, setLanguage] = useState(language);\n\n useEffect(() => {\n languageStorage.set(activeLanguage);\n }, [activeLanguage]);\n\n return [activeLanguage, setLanguage];\n};\n\nexport const useLanguage = () => {\n const context = useContext(LanguageContext);\n assertIsDefined(context);\n return context;\n};\n\ninterface LanguageProviderProps {\n children: ReactNode;\n language: string;\n}\n\nexport const LanguageProvider: FC<LanguageProviderProps> = ({\n children,\n language,\n}) => {\n const [activeLanguage, setLanguage] = useLanguageState(language);\n return (\n <LanguageContext.Provider value={{ language: activeLanguage, setLanguage }}>\n {children}\n </LanguageContext.Provider>\n );\n};\n","import React, { FC, MouseEvent, ReactNode, AnchorHTMLAttributes } from 'react';\n\ninterface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n href: string;\n navigate: () => void;\n children: ReactNode;\n}\n\nfunction isModifiedEvent(event: MouseEvent) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nexport const MicroFrontendLink: FC<LinkProps> = ({\n navigate,\n children,\n onClick,\n target,\n ...rest\n}) => {\n return (\n <a\n onClick={(event) => {\n try {\n if (onClick) onClick(event);\n } catch (ex) {\n event.preventDefault();\n throw ex;\n }\n\n if (\n !event.defaultPrevented && // onClick prevented default\n event.button === 0 && // ignore everything but right clicks\n (!target || target === '_self') && // let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // ignore clicks with modifier keys\n ) {\n event.preventDefault();\n navigate();\n }\n }}\n target={target}\n {...rest}\n >\n {children}\n </a>\n );\n};\n","import React, { FC, useEffect, useState } from 'react';\nimport { OrganisationDropDown } from '@entur-partner/common';\nimport { SkeletonRectangle } from '@entur/loader';\nimport { GetTokenSilentlyOptions } from '@auth0/auth0-spa-js';\n\nimport { useLanguage } from './LanguageProvider';\n\nexport type GetOrganisationsFn = (token: string) => Promise<Organisation[]>;\n\nexport interface Organisation {\n name: string;\n id: string;\n}\n\nexport interface OrganisationSelectorProps {\n getToken: (options?: GetTokenSilentlyOptions) => Promise<string>;\n getOrganisations: GetOrganisationsFn | string;\n value: string;\n onChange: (id: string) => void;\n [key: string]: any;\n}\n\nexport const OrganisationSelector: FC<OrganisationSelectorProps> = ({\n getToken,\n getOrganisations,\n value,\n onChange,\n ...rest\n}) => {\n const [organisations, setOrganisations] = useState<Organisation[]>([]);\n\n const { language } = useLanguage();\n\n const [status, setStatus] = useState<'LOADING' | 'ERROR' | 'SUCCESS'>(\n 'LOADING'\n );\n\n useEffect(() => {\n const fetchOrganisations = async () => {\n const token = await getToken();\n let organisations: Organisation[];\n if (typeof getOrganisations === 'string') {\n organisations = await fetch(getOrganisations, {\n headers: {\n Authorization: `Bearer ${token}`,\n Accept: 'application/json',\n },\n }).then((response) => response.json());\n } else {\n organisations = await getOrganisations(token);\n }\n setOrganisations(organisations);\n setStatus('SUCCESS');\n };\n\n fetchOrganisations().catch((error) => {\n if (process.env.NODE_ENV === 'development') {\n console.error(error);\n }\n setStatus('ERROR');\n });\n }, [getOrganisations, getToken]);\n\n switch (status) {\n case 'LOADING':\n return (\n <div className=\"eds-contrast\">\n <SkeletonRectangle style={{ height: '2.4rem' }} />\n </div>\n );\n case 'SUCCESS':\n return (\n <OrganisationDropDown\n label={language === 'nb' ? 'Organisasjon' : 'Organisation'}\n selectedOrganisationId={value}\n organisations={organisations}\n onChange={onChange}\n {...rest}\n />\n );\n case 'ERROR':\n throw new Error('Failed fetching organisations');\n default:\n return null;\n }\n};\n"],"names":["runtime","exports","undefined","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","done","GenStateSuspendedYield","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","result","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","initialState","status","authReducer","event","user","data","_extends","Auth0Context","React","createContext","useAuth","auth","useContext","assertIsDefined","AuthProvider","_ref","children","decorateUser","initOptions","_objectWithoutPropertiesLoose","_excluded","_useReducer","useReducer","dispatch","_useState","useState","auth0Client","setAuth0","useEffect","initAuth0","_ref2","_asyncToGenerator","_regeneratorRuntime","_callee","client","route","auth0User","token","_context","createAuth0Client","window","location","search","includes","handleRedirectCallback","localStorage","getItem","removeItem","pathname","history","replaceState","document","title","isAuthenticated","getUser","getTokenSilently","apply","arguments","login","_ref3","redirectUri","_window","_context2","origin","setItem","loginWithRedirect","redirect_uri","_callee2","_x","getToken","_ref4","options","_context3","_callee3","_x2","createElement","Provider","logout","returnTo","protocol","hostname","port","Login","Authenticate","_useAuth2","Fragment","Loader","style","marginTop","space","extraLarge9","BannerAlertBox","variant","maxWidth","margin","toString","MenuContext","addItems","getItemsForPath","getMFNavigate","setMFNavigate","useMenu","organisationStorage","get","set","languageStorage","OrganisationContext","LanguageContext","useLanguage","audience","domain","client_id","clientId","params","activeLanguage","setLanguage","useLanguageState","language","_useLanguageState","groups","setGroups","navFuncs","_useState2","setNavFuncs","useCallback","newItems","path","prevState","_extends2","_groups$path","navigation","_extends3","navigate","onClick","target","rest","ex","preventDefault","defaultPrevented","button","metaKey","altKey","ctrlKey","shiftKey","isModifiedEvent","organisationId","setOrganisationId","useOrganisationState","Number","_useOrganisationState","getOrganisations","onChange","organisations","setOrganisations","setStatus","fetchOrganisations","fetch","headers","Authorization","Accept","response","json","className","SkeletonRectangle","height","OrganisationDropDown","label","selectedOrganisationId"],"mappings":"0hCAOA,IAAIA,EAAW,SAAUC,GAGvB,IAEIC,EAFAC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,gBAE/C,SAASC,EAAOC,EAAKC,EAAKC,GAOjBF,OANPb,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,GAET,IAEFF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,GAC1B,OAAOF,EAAIC,GAAOC,GAIbM,SAAAA,EAAKC,EAASC,EAASC,EAAMC,GAEpC,IACIC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,IAMzC,OAFAC,EAAUK,QAuMZ,SAA0BT,EAASE,EAAMK,GACnCG,IAAAA,EAAQC,EAEZ,OAAO,SAAgBC,EAAQC,GACzBH,GAAAA,IAAUI,EACZ,MAAM,IAAIC,MAAM,gCAGdL,GAAAA,IAAUM,EAAmB,CAC3BJ,GAAW,UAAXA,EACF,MAAMC,EAKR,OAAOI,IAMT,IAHAV,EAAQK,OAASA,EACjBL,EAAQM,IAAMA,IAED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AAlG,KAAA,EAIDwN,MAAMN,EAAkB,CAC5CO,QAAS,CACPC,wBAAyBzH,EACzB0H,OAAQ,sBAETnO,MAAK,SAACoO,GAAaA,OAAAA,EAASC,UATR,KAAA,EAIvBT,EAJuBlH,EAAAxI,KAAAwI,EAAAlG,KAAA,GAAA,MAAA,KAAA,EAWDkN,OAXChH,EAAAlG,KAAA,GAWDkN,EAAiBjH,GAXhB,KAAA,GAWvBmH,EAXuBlH,EAAAxI,KAAA,KAAA,GAazB2P,EAAiBD,GACjBE,EAAU,WAde,KAAA,GAAA,IAAA,MAAA,OAAApH,EAAA1D,UAAAqD,OAAH,OAAA,WAAA,OAAAH,EAAA0B,MAAA3I,KAAA4I,YAAA,GAiBxBkG,IAAkB,OAAS,SAAC7N,GAI1B4N,EAAU,cAEX,CAACJ,EAAkBjF,IAEdpE,GACN,IAAK,UACH,OACEO,EAAA,QAAAmE,cAAA,MAAA,CAAKuF,UAAU,gBACb1J,EAAA,QAAAmE,cAACwF,oBAAiB,CAAC5E,MAAO,CAAE6E,OAAQ,aAG1C,IAAK,UACH,OACE5J,UAAAmE,cAAC0F,EAADA,qBAAA/J,EAAA,CACEgK,MAAoB,OAAbjD,EAAoB,eAAiB,eAC5CkD,uBAAwBtS,EACxBuR,cAAeA,EACfD,SAAUA,GACNhB,IAGV,IAAK,QACH,MAAM,IAAIhP,MAAM,iCAClB,QACE,OAAO,6GLrDkB,SAACuO,GAEvB3B,OAAAA,EADmBE,IAAlBF,eACa2B,gDAXU,SAACA,GAEhC,OADgBlH,aAAWoF,GACZE,gBAAgB4B,4BEDF,WAC7B,IAAM/O,EAAU6H,aAAW8F,GAE3B,OADA7F,EAAeA,gBAAC9H,GACTA,6BAGwB,WAC/B,IAAMA,EAAU6H,aAAW8F,GAEpB3N,OADP8H,EAAeA,gBAAC9H,GACTA,EAAQkQ"}
@@ -75,18 +75,17 @@ function _objectWithoutPropertiesLoose(source, excluded) {
75
75
  return target;
76
76
  }
77
77
 
78
- function createCommonjsModule(fn, module) {
79
- return module = { exports: {} }, fn(module, module.exports), module.exports;
80
- }
78
+ var runtime = {exports: {}};
79
+
80
+ /**
81
+ * Copyright (c) 2014-present, Facebook, Inc.
82
+ *
83
+ * This source code is licensed under the MIT license found in the
84
+ * LICENSE file in the root directory of this source tree.
85
+ */
81
86
 
82
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
83
- /**
84
- * Copyright (c) 2014-present, Facebook, Inc.
85
- *
86
- * This source code is licensed under the MIT license found in the
87
- * LICENSE file in the root directory of this source tree.
88
- */
89
- var runtime = function (exports) {
87
+ (function (module) {
88
+ var runtime = /*#__PURE__*/function (exports) {
90
89
 
91
90
  var Op = Object.prototype;
92
91
  var hasOwn = Op.hasOwnProperty;
@@ -172,13 +171,11 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
172
171
 
173
172
 
174
173
  var IteratorPrototype = {};
175
-
176
- IteratorPrototype[iteratorSymbol] = function () {
174
+ define(IteratorPrototype, iteratorSymbol, function () {
177
175
  return this;
178
- };
179
-
176
+ });
180
177
  var getProto = Object.getPrototypeOf;
181
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
178
+ var NativeIteratorPrototype = getProto && /*#__PURE__*/getProto( /*#__PURE__*/getProto( /*#__PURE__*/values([])));
182
179
 
183
180
  if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
184
181
  // This environment has a native %IteratorPrototype%; use it instead
@@ -186,10 +183,11 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
186
183
  IteratorPrototype = NativeIteratorPrototype;
187
184
  }
188
185
 
189
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
190
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
191
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
192
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
186
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = /*#__PURE__*/Object.create(IteratorPrototype);
187
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
188
+ define(Gp, "constructor", GeneratorFunctionPrototype);
189
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
190
+ GeneratorFunction.displayName = /*#__PURE__*/define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
193
191
  // Iterator interface in terms of a single ._invoke method.
194
192
 
195
193
  function defineIteratorMethods(prototype) {
@@ -293,11 +291,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
293
291
  }
294
292
 
295
293
  defineIteratorMethods(AsyncIterator.prototype);
296
-
297
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
294
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
298
295
  return this;
299
- };
300
-
296
+ });
301
297
  exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
302
298
  // AsyncIterator objects; they just return a Promise for the value of
303
299
  // the final result produced by the iterator.
@@ -474,13 +470,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
474
470
  // object to not be returned from this call. This ensures that doesn't happen.
475
471
  // See https://github.com/facebook/regenerator/issues/274 for more details.
476
472
 
477
- Gp[iteratorSymbol] = function () {
473
+ define(Gp, iteratorSymbol, function () {
478
474
  return this;
479
- };
480
-
481
- Gp.toString = function () {
475
+ });
476
+ define(Gp, "toString", function () {
482
477
  return "[object Generator]";
483
- };
478
+ });
484
479
 
485
480
  function pushTryEntry(locs) {
486
481
  var entry = {
@@ -785,25 +780,32 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
785
780
  // as the regeneratorRuntime namespace. Otherwise create a new empty
786
781
  // object. Either way, the resulting object will be used to initialize
787
782
  // the regeneratorRuntime variable at the top of this file.
788
- module.exports );
783
+ module.exports );
789
784
 
790
785
  try {
791
786
  regeneratorRuntime = runtime;
792
787
  } catch (accidentalStrictMode) {
793
788
  // This module should not be running in strict mode, so the above
794
789
  // assignment should always work unless something is misconfigured. Just
795
- // in case runtime.js accidentally runs in strict mode, we can escape
790
+ // in case runtime.js accidentally runs in strict mode, in modern engines
791
+ // we can explicitly access globalThis. In older engines we can escape
796
792
  // strict mode using a global Function call. This could conceivably fail
797
793
  // if a Content Security Policy forbids using Function, but in that case
798
794
  // the proper solution is to fix the accidental strict mode problem. If
799
795
  // you've misconfigured your bundler to force strict mode and applied a
800
796
  // CSP to forbid Function, and you're not willing to fix either of those
801
797
  // problems, please detail your unique predicament in a GitHub issue.
802
- Function("r", "regeneratorRuntime = r")(runtime);
798
+ if (typeof globalThis === "object") {
799
+ globalThis.regeneratorRuntime = runtime;
800
+ } else {
801
+ Function("r", "regeneratorRuntime = r")(runtime);
802
+ }
803
803
  }
804
- });
804
+ })(runtime);
805
805
 
806
- var initialState = {
806
+ var _regeneratorRuntime = runtime.exports;
807
+
808
+ var initialState$1 = {
807
809
  status: 'AUTHENTICATING'
808
810
  };
809
811
  function authReducer(state, event) {
@@ -815,7 +817,7 @@ function authReducer(state, event) {
815
817
  };
816
818
 
817
819
  case 'LOGOUT':
818
- return initialState;
820
+ return initialState$1;
819
821
 
820
822
  case 'ERROR':
821
823
  return {
@@ -833,6 +835,7 @@ function authReducer(state, event) {
833
835
  }
834
836
  }
835
837
 
838
+ var _excluded$2 = ["children", "decorateUser"];
836
839
  var POST_LOGIN_ROUTE_KEY = '@entur-partner:post-login-route';
837
840
 
838
841
  var redirect = function redirect(pathname) {
@@ -850,15 +853,15 @@ var useAuth = function useAuth() {
850
853
  assertIsDefined(auth, 'A `<Auth0Provider>` component needs to be higher up in the component hierarchy.');
851
854
  return auth;
852
855
  };
853
- var initialState$1 = {
856
+ var initialState = {
854
857
  status: 'AUTHENTICATING'
855
858
  };
856
859
  var AuthProvider = function AuthProvider(_ref) {
857
860
  var children = _ref.children,
858
861
  decorateUser = _ref.decorateUser,
859
- initOptions = _objectWithoutPropertiesLoose(_ref, ["children", "decorateUser"]);
862
+ initOptions = _objectWithoutPropertiesLoose(_ref, _excluded$2);
860
863
 
861
- var _useReducer = useReducer(authReducer, initialState$1),
864
+ var _useReducer = useReducer(authReducer, initialState),
862
865
  state = _useReducer[0],
863
866
  dispatch = _useReducer[1];
864
867
 
@@ -868,9 +871,9 @@ var AuthProvider = function AuthProvider(_ref) {
868
871
 
869
872
  useEffect(function () {
870
873
  var initAuth0 = /*#__PURE__*/function () {
871
- var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
874
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
872
875
  var client, route, postLoginRoute, isAuthenticated, auth0User, token, user;
873
- return runtime_1.wrap(function _callee$(_context) {
876
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
874
877
  while (1) {
875
878
  switch (_context.prev = _context.next) {
876
879
  case 0:
@@ -969,10 +972,10 @@ var AuthProvider = function AuthProvider(_ref) {
969
972
  };
970
973
 
971
974
  var login = /*#__PURE__*/function () {
972
- var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(redirectUri) {
975
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(redirectUri) {
973
976
  var _window, location;
974
977
 
975
- return runtime_1.wrap(function _callee2$(_context2) {
978
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
976
979
  while (1) {
977
980
  switch (_context2.prev = _context2.next) {
978
981
  case 0:
@@ -1001,8 +1004,8 @@ var AuthProvider = function AuthProvider(_ref) {
1001
1004
  }();
1002
1005
 
1003
1006
  var getToken = /*#__PURE__*/function () {
1004
- var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(options) {
1005
- return runtime_1.wrap(function _callee3$(_context3) {
1007
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
1008
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
1006
1009
  while (1) {
1007
1010
  switch (_context3.prev = _context3.next) {
1008
1011
  case 0:
@@ -1111,6 +1114,8 @@ var AppShell = function AppShell(_ref3) {
1111
1114
  }));
1112
1115
  };
1113
1116
 
1117
+ var _excluded$1 = ["navigate", "children", "onClick", "target"];
1118
+
1114
1119
  function isModifiedEvent(event) {
1115
1120
  return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
1116
1121
  }
@@ -1120,9 +1125,9 @@ var MicroFrontendLink = function MicroFrontendLink(_ref) {
1120
1125
  children = _ref.children,
1121
1126
  _onClick = _ref.onClick,
1122
1127
  target = _ref.target,
1123
- rest = _objectWithoutPropertiesLoose(_ref, ["navigate", "children", "onClick", "target"]);
1128
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
1124
1129
 
1125
- return React.createElement("a", Object.assign({
1130
+ return React.createElement("a", _extends({
1126
1131
  onClick: function onClick(event) {
1127
1132
  try {
1128
1133
  if (_onClick) _onClick(event);
@@ -1136,9 +1141,9 @@ var MicroFrontendLink = function MicroFrontendLink(_ref) {
1136
1141
  !target || target === '_self') && // let browser handle "target=_blank" etc.
1137
1142
  !isModifiedEvent(event) // ignore clicks with modifier keys
1138
1143
  ) {
1139
- event.preventDefault();
1140
- navigate();
1141
- }
1144
+ event.preventDefault();
1145
+ navigate();
1146
+ }
1142
1147
  },
1143
1148
  target: target
1144
1149
  }, rest), children);
@@ -1304,12 +1309,13 @@ var LanguageProvider = function LanguageProvider(_ref) {
1304
1309
  }, children);
1305
1310
  };
1306
1311
 
1312
+ var _excluded = ["getToken", "getOrganisations", "value", "onChange"];
1307
1313
  var OrganisationSelector = function OrganisationSelector(_ref) {
1308
1314
  var getToken = _ref.getToken,
1309
1315
  getOrganisations = _ref.getOrganisations,
1310
1316
  value = _ref.value,
1311
1317
  onChange = _ref.onChange,
1312
- rest = _objectWithoutPropertiesLoose(_ref, ["getToken", "getOrganisations", "value", "onChange"]);
1318
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
1313
1319
 
1314
1320
  var _useState = useState([]),
1315
1321
  organisations = _useState[0],
@@ -1324,9 +1330,9 @@ var OrganisationSelector = function OrganisationSelector(_ref) {
1324
1330
 
1325
1331
  useEffect(function () {
1326
1332
  var fetchOrganisations = /*#__PURE__*/function () {
1327
- var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1333
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
1328
1334
  var token, organisations;
1329
- return runtime_1.wrap(function _callee$(_context) {
1335
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1330
1336
  while (1) {
1331
1337
  switch (_context.prev = _context.next) {
1332
1338
  case 0:
@@ -1335,15 +1341,39 @@ var OrganisationSelector = function OrganisationSelector(_ref) {
1335
1341
 
1336
1342
  case 2:
1337
1343
  token = _context.sent;
1338
- _context.next = 5;
1344
+
1345
+ if (!(typeof getOrganisations === 'string')) {
1346
+ _context.next = 9;
1347
+ break;
1348
+ }
1349
+
1350
+ _context.next = 6;
1351
+ return fetch(getOrganisations, {
1352
+ headers: {
1353
+ Authorization: "Bearer " + token,
1354
+ Accept: 'application/json'
1355
+ }
1356
+ }).then(function (response) {
1357
+ return response.json();
1358
+ });
1359
+
1360
+ case 6:
1361
+ organisations = _context.sent;
1362
+ _context.next = 12;
1363
+ break;
1364
+
1365
+ case 9:
1366
+ _context.next = 11;
1339
1367
  return getOrganisations(token);
1340
1368
 
1341
- case 5:
1369
+ case 11:
1342
1370
  organisations = _context.sent;
1371
+
1372
+ case 12:
1343
1373
  setOrganisations(organisations);
1344
1374
  setStatus('SUCCESS');
1345
1375
 
1346
- case 8:
1376
+ case 14:
1347
1377
  case "end":
1348
1378
  return _context.stop();
1349
1379
  }
@@ -1376,7 +1406,7 @@ var OrganisationSelector = function OrganisationSelector(_ref) {
1376
1406
  }));
1377
1407
 
1378
1408
  case 'SUCCESS':
1379
- return React.createElement(OrganisationDropDown, Object.assign({
1409
+ return React.createElement(OrganisationDropDown, _extends({
1380
1410
  label: language === 'nb' ? 'Organisasjon' : 'Organisation',
1381
1411
  selectedOrganisationId: value,
1382
1412
  organisations: organisations,