@entur-partner/micro-frontend 2.2.0 → 2.3.1

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.
@@ -4,12 +4,47 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var util = require('@entur-partner/util');
7
- var reactQuery = require('react-query');
8
7
 
9
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
9
 
11
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
11
 
12
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
+ try {
14
+ var info = gen[key](arg);
15
+ var value = info.value;
16
+ } catch (error) {
17
+ reject(error);
18
+ return;
19
+ }
20
+
21
+ if (info.done) {
22
+ resolve(value);
23
+ } else {
24
+ Promise.resolve(value).then(_next, _throw);
25
+ }
26
+ }
27
+
28
+ function _asyncToGenerator(fn) {
29
+ return function () {
30
+ var self = this,
31
+ args = arguments;
32
+ return new Promise(function (resolve, reject) {
33
+ var gen = fn.apply(self, args);
34
+
35
+ function _next(value) {
36
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
37
+ }
38
+
39
+ function _throw(err) {
40
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
41
+ }
42
+
43
+ _next(undefined);
44
+ });
45
+ };
46
+ }
47
+
13
48
  function _extends() {
14
49
  _extends = Object.assign || function (target) {
15
50
  for (var i = 1; i < arguments.length; i++) {
@@ -177,6 +212,736 @@ function registerMicroFrontend(config) {
177
212
  });
178
213
  }
179
214
 
215
+ var runtime = {exports: {}};
216
+
217
+ /**
218
+ * Copyright (c) 2014-present, Facebook, Inc.
219
+ *
220
+ * This source code is licensed under the MIT license found in the
221
+ * LICENSE file in the root directory of this source tree.
222
+ */
223
+
224
+ (function (module) {
225
+ var runtime = /*#__PURE__*/function (exports) {
226
+
227
+ var Op = Object.prototype;
228
+ var hasOwn = Op.hasOwnProperty;
229
+ var undefined$1; // More compressible than void 0.
230
+
231
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
232
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
233
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
234
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
235
+
236
+ function define(obj, key, value) {
237
+ Object.defineProperty(obj, key, {
238
+ value: value,
239
+ enumerable: true,
240
+ configurable: true,
241
+ writable: true
242
+ });
243
+ return obj[key];
244
+ }
245
+
246
+ try {
247
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
248
+ define({}, "");
249
+ } catch (err) {
250
+ define = function define(obj, key, value) {
251
+ return obj[key] = value;
252
+ };
253
+ }
254
+
255
+ function wrap(innerFn, outerFn, self, tryLocsList) {
256
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
257
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
258
+ var generator = Object.create(protoGenerator.prototype);
259
+ var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
260
+ // .throw, and .return methods.
261
+
262
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
263
+ return generator;
264
+ }
265
+
266
+ exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
267
+ // record like context.tryEntries[i].completion. This interface could
268
+ // have been (and was previously) designed to take a closure to be
269
+ // invoked without arguments, but in all the cases we care about we
270
+ // already have an existing method we want to call, so there's no need
271
+ // to create a new function object. We can even get away with assuming
272
+ // the method takes exactly one argument, since that happens to be true
273
+ // in every case, so we don't have to touch the arguments object. The
274
+ // only additional allocation required is the completion record, which
275
+ // has a stable shape and so hopefully should be cheap to allocate.
276
+
277
+ function tryCatch(fn, obj, arg) {
278
+ try {
279
+ return {
280
+ type: "normal",
281
+ arg: fn.call(obj, arg)
282
+ };
283
+ } catch (err) {
284
+ return {
285
+ type: "throw",
286
+ arg: err
287
+ };
288
+ }
289
+ }
290
+
291
+ var GenStateSuspendedStart = "suspendedStart";
292
+ var GenStateSuspendedYield = "suspendedYield";
293
+ var GenStateExecuting = "executing";
294
+ var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
295
+ // breaking out of the dispatch switch statement.
296
+
297
+ var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
298
+ // .constructor.prototype properties for functions that return Generator
299
+ // objects. For full spec compliance, you may wish to configure your
300
+ // minifier not to mangle the names of these two functions.
301
+
302
+ function Generator() {}
303
+
304
+ function GeneratorFunction() {}
305
+
306
+ function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
307
+ // don't natively support it.
308
+
309
+
310
+ var IteratorPrototype = {};
311
+ define(IteratorPrototype, iteratorSymbol, function () {
312
+ return this;
313
+ });
314
+ var getProto = Object.getPrototypeOf;
315
+ var NativeIteratorPrototype = getProto && /*#__PURE__*/getProto( /*#__PURE__*/getProto( /*#__PURE__*/values([])));
316
+
317
+ if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
318
+ // This environment has a native %IteratorPrototype%; use it instead
319
+ // of the polyfill.
320
+ IteratorPrototype = NativeIteratorPrototype;
321
+ }
322
+
323
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = /*#__PURE__*/Object.create(IteratorPrototype);
324
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
325
+ define(Gp, "constructor", GeneratorFunctionPrototype);
326
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
327
+ GeneratorFunction.displayName = /*#__PURE__*/define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
328
+ // Iterator interface in terms of a single ._invoke method.
329
+
330
+ function defineIteratorMethods(prototype) {
331
+ ["next", "throw", "return"].forEach(function (method) {
332
+ define(prototype, method, function (arg) {
333
+ return this._invoke(method, arg);
334
+ });
335
+ });
336
+ }
337
+
338
+ exports.isGeneratorFunction = function (genFun) {
339
+ var ctor = typeof genFun === "function" && genFun.constructor;
340
+ return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
341
+ // do is to check its .name property.
342
+ (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
343
+ };
344
+
345
+ exports.mark = function (genFun) {
346
+ if (Object.setPrototypeOf) {
347
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
348
+ } else {
349
+ genFun.__proto__ = GeneratorFunctionPrototype;
350
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
351
+ }
352
+
353
+ genFun.prototype = Object.create(Gp);
354
+ return genFun;
355
+ }; // Within the body of any async function, `await x` is transformed to
356
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
357
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
358
+ // meant to be awaited.
359
+
360
+
361
+ exports.awrap = function (arg) {
362
+ return {
363
+ __await: arg
364
+ };
365
+ };
366
+
367
+ function AsyncIterator(generator, PromiseImpl) {
368
+ function invoke(method, arg, resolve, reject) {
369
+ var record = tryCatch(generator[method], generator, arg);
370
+
371
+ if (record.type === "throw") {
372
+ reject(record.arg);
373
+ } else {
374
+ var result = record.arg;
375
+ var value = result.value;
376
+
377
+ if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
378
+ return PromiseImpl.resolve(value.__await).then(function (value) {
379
+ invoke("next", value, resolve, reject);
380
+ }, function (err) {
381
+ invoke("throw", err, resolve, reject);
382
+ });
383
+ }
384
+
385
+ return PromiseImpl.resolve(value).then(function (unwrapped) {
386
+ // When a yielded Promise is resolved, its final value becomes
387
+ // the .value of the Promise<{value,done}> result for the
388
+ // current iteration.
389
+ result.value = unwrapped;
390
+ resolve(result);
391
+ }, function (error) {
392
+ // If a rejected Promise was yielded, throw the rejection back
393
+ // into the async generator function so it can be handled there.
394
+ return invoke("throw", error, resolve, reject);
395
+ });
396
+ }
397
+ }
398
+
399
+ var previousPromise;
400
+
401
+ function enqueue(method, arg) {
402
+ function callInvokeWithMethodAndArg() {
403
+ return new PromiseImpl(function (resolve, reject) {
404
+ invoke(method, arg, resolve, reject);
405
+ });
406
+ }
407
+
408
+ return previousPromise = // If enqueue has been called before, then we want to wait until
409
+ // all previous Promises have been resolved before calling invoke,
410
+ // so that results are always delivered in the correct order. If
411
+ // enqueue has not been called before, then it is important to
412
+ // call invoke immediately, without waiting on a callback to fire,
413
+ // so that the async generator function has the opportunity to do
414
+ // any necessary setup in a predictable way. This predictability
415
+ // is why the Promise constructor synchronously invokes its
416
+ // executor callback, and why async functions synchronously
417
+ // execute code before the first await. Since we implement simple
418
+ // async functions in terms of async generators, it is especially
419
+ // important to get this right, even though it requires care.
420
+ previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
421
+ // invocations of the iterator.
422
+ callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
423
+ } // Define the unified helper method that is used to implement .next,
424
+ // .throw, and .return (see defineIteratorMethods).
425
+
426
+
427
+ this._invoke = enqueue;
428
+ }
429
+
430
+ defineIteratorMethods(AsyncIterator.prototype);
431
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
432
+ return this;
433
+ });
434
+ exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
435
+ // AsyncIterator objects; they just return a Promise for the value of
436
+ // the final result produced by the iterator.
437
+
438
+ exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
439
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
440
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
441
+ return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
442
+ : iter.next().then(function (result) {
443
+ return result.done ? result.value : iter.next();
444
+ });
445
+ };
446
+
447
+ function makeInvokeMethod(innerFn, self, context) {
448
+ var state = GenStateSuspendedStart;
449
+ return function invoke(method, arg) {
450
+ if (state === GenStateExecuting) {
451
+ throw new Error("Generator is already running");
452
+ }
453
+
454
+ if (state === GenStateCompleted) {
455
+ if (method === "throw") {
456
+ throw arg;
457
+ } // Be forgiving, per 25.3.3.3.3 of the spec:
458
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
459
+
460
+
461
+ return doneResult();
462
+ }
463
+
464
+ context.method = method;
465
+ context.arg = arg;
466
+
467
+ while (true) {
468
+ var delegate = context.delegate;
469
+
470
+ if (delegate) {
471
+ var delegateResult = maybeInvokeDelegate(delegate, context);
472
+
473
+ if (delegateResult) {
474
+ if (delegateResult === ContinueSentinel) continue;
475
+ return delegateResult;
476
+ }
477
+ }
478
+
479
+ if (context.method === "next") {
480
+ // Setting context._sent for legacy support of Babel's
481
+ // function.sent implementation.
482
+ context.sent = context._sent = context.arg;
483
+ } else if (context.method === "throw") {
484
+ if (state === GenStateSuspendedStart) {
485
+ state = GenStateCompleted;
486
+ throw context.arg;
487
+ }
488
+
489
+ context.dispatchException(context.arg);
490
+ } else if (context.method === "return") {
491
+ context.abrupt("return", context.arg);
492
+ }
493
+
494
+ state = GenStateExecuting;
495
+ var record = tryCatch(innerFn, self, context);
496
+
497
+ if (record.type === "normal") {
498
+ // If an exception is thrown from innerFn, we leave state ===
499
+ // GenStateExecuting and loop back for another invocation.
500
+ state = context.done ? GenStateCompleted : GenStateSuspendedYield;
501
+
502
+ if (record.arg === ContinueSentinel) {
503
+ continue;
504
+ }
505
+
506
+ return {
507
+ value: record.arg,
508
+ done: context.done
509
+ };
510
+ } else if (record.type === "throw") {
511
+ state = GenStateCompleted; // Dispatch the exception by looping back around to the
512
+ // context.dispatchException(context.arg) call above.
513
+
514
+ context.method = "throw";
515
+ context.arg = record.arg;
516
+ }
517
+ }
518
+ };
519
+ } // Call delegate.iterator[context.method](context.arg) and handle the
520
+ // result, either by returning a { value, done } result from the
521
+ // delegate iterator, or by modifying context.method and context.arg,
522
+ // setting context.delegate to null, and returning the ContinueSentinel.
523
+
524
+
525
+ function maybeInvokeDelegate(delegate, context) {
526
+ var method = delegate.iterator[context.method];
527
+
528
+ if (method === undefined$1) {
529
+ // A .throw or .return when the delegate iterator has no .throw
530
+ // method always terminates the yield* loop.
531
+ context.delegate = null;
532
+
533
+ if (context.method === "throw") {
534
+ // Note: ["return"] must be used for ES3 parsing compatibility.
535
+ if (delegate.iterator["return"]) {
536
+ // If the delegate iterator has a return method, give it a
537
+ // chance to clean up.
538
+ context.method = "return";
539
+ context.arg = undefined$1;
540
+ maybeInvokeDelegate(delegate, context);
541
+
542
+ if (context.method === "throw") {
543
+ // If maybeInvokeDelegate(context) changed context.method from
544
+ // "return" to "throw", let that override the TypeError below.
545
+ return ContinueSentinel;
546
+ }
547
+ }
548
+
549
+ context.method = "throw";
550
+ context.arg = new TypeError("The iterator does not provide a 'throw' method");
551
+ }
552
+
553
+ return ContinueSentinel;
554
+ }
555
+
556
+ var record = tryCatch(method, delegate.iterator, context.arg);
557
+
558
+ if (record.type === "throw") {
559
+ context.method = "throw";
560
+ context.arg = record.arg;
561
+ context.delegate = null;
562
+ return ContinueSentinel;
563
+ }
564
+
565
+ var info = record.arg;
566
+
567
+ if (!info) {
568
+ context.method = "throw";
569
+ context.arg = new TypeError("iterator result is not an object");
570
+ context.delegate = null;
571
+ return ContinueSentinel;
572
+ }
573
+
574
+ if (info.done) {
575
+ // Assign the result of the finished delegate to the temporary
576
+ // variable specified by delegate.resultName (see delegateYield).
577
+ context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
578
+
579
+ context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
580
+ // exception, let the outer generator proceed normally. If
581
+ // context.method was "next", forget context.arg since it has been
582
+ // "consumed" by the delegate iterator. If context.method was
583
+ // "return", allow the original .return call to continue in the
584
+ // outer generator.
585
+
586
+ if (context.method !== "return") {
587
+ context.method = "next";
588
+ context.arg = undefined$1;
589
+ }
590
+ } else {
591
+ // Re-yield the result returned by the delegate method.
592
+ return info;
593
+ } // The delegate iterator is finished, so forget it and continue with
594
+ // the outer generator.
595
+
596
+
597
+ context.delegate = null;
598
+ return ContinueSentinel;
599
+ } // Define Generator.prototype.{next,throw,return} in terms of the
600
+ // unified ._invoke helper method.
601
+
602
+
603
+ defineIteratorMethods(Gp);
604
+ define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
605
+ // @@iterator function is called on it. Some browsers' implementations of the
606
+ // iterator prototype chain incorrectly implement this, causing the Generator
607
+ // object to not be returned from this call. This ensures that doesn't happen.
608
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
609
+
610
+ define(Gp, iteratorSymbol, function () {
611
+ return this;
612
+ });
613
+ define(Gp, "toString", function () {
614
+ return "[object Generator]";
615
+ });
616
+
617
+ function pushTryEntry(locs) {
618
+ var entry = {
619
+ tryLoc: locs[0]
620
+ };
621
+
622
+ if (1 in locs) {
623
+ entry.catchLoc = locs[1];
624
+ }
625
+
626
+ if (2 in locs) {
627
+ entry.finallyLoc = locs[2];
628
+ entry.afterLoc = locs[3];
629
+ }
630
+
631
+ this.tryEntries.push(entry);
632
+ }
633
+
634
+ function resetTryEntry(entry) {
635
+ var record = entry.completion || {};
636
+ record.type = "normal";
637
+ delete record.arg;
638
+ entry.completion = record;
639
+ }
640
+
641
+ function Context(tryLocsList) {
642
+ // The root entry object (effectively a try statement without a catch
643
+ // or a finally block) gives us a place to store values thrown from
644
+ // locations where there is no enclosing try statement.
645
+ this.tryEntries = [{
646
+ tryLoc: "root"
647
+ }];
648
+ tryLocsList.forEach(pushTryEntry, this);
649
+ this.reset(true);
650
+ }
651
+
652
+ exports.keys = function (object) {
653
+ var keys = [];
654
+
655
+ for (var key in object) {
656
+ keys.push(key);
657
+ }
658
+
659
+ keys.reverse(); // Rather than returning an object with a next method, we keep
660
+ // things simple and return the next function itself.
661
+
662
+ return function next() {
663
+ while (keys.length) {
664
+ var key = keys.pop();
665
+
666
+ if (key in object) {
667
+ next.value = key;
668
+ next.done = false;
669
+ return next;
670
+ }
671
+ } // To avoid creating an additional object, we just hang the .value
672
+ // and .done properties off the next function object itself. This
673
+ // also ensures that the minifier will not anonymize the function.
674
+
675
+
676
+ next.done = true;
677
+ return next;
678
+ };
679
+ };
680
+
681
+ function values(iterable) {
682
+ if (iterable) {
683
+ var iteratorMethod = iterable[iteratorSymbol];
684
+
685
+ if (iteratorMethod) {
686
+ return iteratorMethod.call(iterable);
687
+ }
688
+
689
+ if (typeof iterable.next === "function") {
690
+ return iterable;
691
+ }
692
+
693
+ if (!isNaN(iterable.length)) {
694
+ var i = -1,
695
+ next = function next() {
696
+ while (++i < iterable.length) {
697
+ if (hasOwn.call(iterable, i)) {
698
+ next.value = iterable[i];
699
+ next.done = false;
700
+ return next;
701
+ }
702
+ }
703
+
704
+ next.value = undefined$1;
705
+ next.done = true;
706
+ return next;
707
+ };
708
+
709
+ return next.next = next;
710
+ }
711
+ } // Return an iterator with no values.
712
+
713
+
714
+ return {
715
+ next: doneResult
716
+ };
717
+ }
718
+
719
+ exports.values = values;
720
+
721
+ function doneResult() {
722
+ return {
723
+ value: undefined$1,
724
+ done: true
725
+ };
726
+ }
727
+
728
+ Context.prototype = {
729
+ constructor: Context,
730
+ reset: function reset(skipTempReset) {
731
+ this.prev = 0;
732
+ this.next = 0; // Resetting context._sent for legacy support of Babel's
733
+ // function.sent implementation.
734
+
735
+ this.sent = this._sent = undefined$1;
736
+ this.done = false;
737
+ this.delegate = null;
738
+ this.method = "next";
739
+ this.arg = undefined$1;
740
+ this.tryEntries.forEach(resetTryEntry);
741
+
742
+ if (!skipTempReset) {
743
+ for (var name in this) {
744
+ // Not sure about the optimal order of these conditions:
745
+ if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
746
+ this[name] = undefined$1;
747
+ }
748
+ }
749
+ }
750
+ },
751
+ stop: function stop() {
752
+ this.done = true;
753
+ var rootEntry = this.tryEntries[0];
754
+ var rootRecord = rootEntry.completion;
755
+
756
+ if (rootRecord.type === "throw") {
757
+ throw rootRecord.arg;
758
+ }
759
+
760
+ return this.rval;
761
+ },
762
+ dispatchException: function dispatchException(exception) {
763
+ if (this.done) {
764
+ throw exception;
765
+ }
766
+
767
+ var context = this;
768
+
769
+ function handle(loc, caught) {
770
+ record.type = "throw";
771
+ record.arg = exception;
772
+ context.next = loc;
773
+
774
+ if (caught) {
775
+ // If the dispatched exception was caught by a catch block,
776
+ // then let that catch block handle the exception normally.
777
+ context.method = "next";
778
+ context.arg = undefined$1;
779
+ }
780
+
781
+ return !!caught;
782
+ }
783
+
784
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
785
+ var entry = this.tryEntries[i];
786
+ var record = entry.completion;
787
+
788
+ if (entry.tryLoc === "root") {
789
+ // Exception thrown outside of any try block that could handle
790
+ // it, so set the completion value of the entire function to
791
+ // throw the exception.
792
+ return handle("end");
793
+ }
794
+
795
+ if (entry.tryLoc <= this.prev) {
796
+ var hasCatch = hasOwn.call(entry, "catchLoc");
797
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
798
+
799
+ if (hasCatch && hasFinally) {
800
+ if (this.prev < entry.catchLoc) {
801
+ return handle(entry.catchLoc, true);
802
+ } else if (this.prev < entry.finallyLoc) {
803
+ return handle(entry.finallyLoc);
804
+ }
805
+ } else if (hasCatch) {
806
+ if (this.prev < entry.catchLoc) {
807
+ return handle(entry.catchLoc, true);
808
+ }
809
+ } else if (hasFinally) {
810
+ if (this.prev < entry.finallyLoc) {
811
+ return handle(entry.finallyLoc);
812
+ }
813
+ } else {
814
+ throw new Error("try statement without catch or finally");
815
+ }
816
+ }
817
+ }
818
+ },
819
+ abrupt: function abrupt(type, arg) {
820
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
821
+ var entry = this.tryEntries[i];
822
+
823
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
824
+ var finallyEntry = entry;
825
+ break;
826
+ }
827
+ }
828
+
829
+ if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
830
+ // Ignore the finally entry if control is not jumping to a
831
+ // location outside the try/catch block.
832
+ finallyEntry = null;
833
+ }
834
+
835
+ var record = finallyEntry ? finallyEntry.completion : {};
836
+ record.type = type;
837
+ record.arg = arg;
838
+
839
+ if (finallyEntry) {
840
+ this.method = "next";
841
+ this.next = finallyEntry.finallyLoc;
842
+ return ContinueSentinel;
843
+ }
844
+
845
+ return this.complete(record);
846
+ },
847
+ complete: function complete(record, afterLoc) {
848
+ if (record.type === "throw") {
849
+ throw record.arg;
850
+ }
851
+
852
+ if (record.type === "break" || record.type === "continue") {
853
+ this.next = record.arg;
854
+ } else if (record.type === "return") {
855
+ this.rval = this.arg = record.arg;
856
+ this.method = "return";
857
+ this.next = "end";
858
+ } else if (record.type === "normal" && afterLoc) {
859
+ this.next = afterLoc;
860
+ }
861
+
862
+ return ContinueSentinel;
863
+ },
864
+ finish: function finish(finallyLoc) {
865
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
866
+ var entry = this.tryEntries[i];
867
+
868
+ if (entry.finallyLoc === finallyLoc) {
869
+ this.complete(entry.completion, entry.afterLoc);
870
+ resetTryEntry(entry);
871
+ return ContinueSentinel;
872
+ }
873
+ }
874
+ },
875
+ "catch": function _catch(tryLoc) {
876
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
877
+ var entry = this.tryEntries[i];
878
+
879
+ if (entry.tryLoc === tryLoc) {
880
+ var record = entry.completion;
881
+
882
+ if (record.type === "throw") {
883
+ var thrown = record.arg;
884
+ resetTryEntry(entry);
885
+ }
886
+
887
+ return thrown;
888
+ }
889
+ } // The context.catch method must only be called with a location
890
+ // argument that corresponds to a known catch block.
891
+
892
+
893
+ throw new Error("illegal catch attempt");
894
+ },
895
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
896
+ this.delegate = {
897
+ iterator: values(iterable),
898
+ resultName: resultName,
899
+ nextLoc: nextLoc
900
+ };
901
+
902
+ if (this.method === "next") {
903
+ // Deliberately forget the last sent value so that we don't
904
+ // accidentally pass it on to the delegate.
905
+ this.arg = undefined$1;
906
+ }
907
+
908
+ return ContinueSentinel;
909
+ }
910
+ }; // Regardless of whether this script is executing as a CommonJS module
911
+ // or not, return the runtime object so that we can declare the variable
912
+ // regeneratorRuntime in the outer scope, which allows this module to be
913
+ // injected easily by `bin/regenerator --include-runtime script.js`.
914
+
915
+ return exports;
916
+ }( // If this script is executing as a CommonJS module, use module.exports
917
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
918
+ // object. Either way, the resulting object will be used to initialize
919
+ // the regeneratorRuntime variable at the top of this file.
920
+ module.exports );
921
+
922
+ try {
923
+ regeneratorRuntime = runtime;
924
+ } catch (accidentalStrictMode) {
925
+ // This module should not be running in strict mode, so the above
926
+ // assignment should always work unless something is misconfigured. Just
927
+ // in case runtime.js accidentally runs in strict mode, in modern engines
928
+ // we can explicitly access globalThis. In older engines we can escape
929
+ // strict mode using a global Function call. This could conceivably fail
930
+ // if a Content Security Policy forbids using Function, but in that case
931
+ // the proper solution is to fix the accidental strict mode problem. If
932
+ // you've misconfigured your bundler to force strict mode and applied a
933
+ // CSP to forbid Function, and you're not willing to fix either of those
934
+ // problems, please detail your unique predicament in a GitHub issue.
935
+ if (typeof globalThis === "object") {
936
+ globalThis.regeneratorRuntime = runtime;
937
+ } else {
938
+ Function("r", "regeneratorRuntime = r")(runtime);
939
+ }
940
+ }
941
+ })(runtime);
942
+
943
+ var _regeneratorRuntime = runtime.exports;
944
+
180
945
  var _excluded = ["children", "organisationId", "getPermissions"];
181
946
  var AppContext = /*#__PURE__*/React__default["default"].createContext(undefined);
182
947
  var useUser = function useUser() {
@@ -200,11 +965,53 @@ var AppProvider = function AppProvider(_ref) {
200
965
  getPermissions = _ref.getPermissions,
201
966
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
202
967
 
203
- var permissionsQuery = reactQuery.useQuery(['permissions'], getPermissions);
968
+ var _useState = React.useState([]),
969
+ permissions = _useState[0],
970
+ setPermissions = _useState[1];
971
+
972
+ React.useEffect(function () {
973
+ function fetchData() {
974
+ return _fetchData.apply(this, arguments);
975
+ }
976
+
977
+ function _fetchData() {
978
+ _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
979
+ var fetchedPermissions;
980
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
981
+ while (1) {
982
+ switch (_context.prev = _context.next) {
983
+ case 0:
984
+ _context.prev = 0;
985
+ _context.next = 3;
986
+ return getPermissions();
987
+
988
+ case 3:
989
+ fetchedPermissions = _context.sent;
990
+ setPermissions(fetchedPermissions);
991
+ _context.next = 10;
992
+ break;
993
+
994
+ case 7:
995
+ _context.prev = 7;
996
+ _context.t0 = _context["catch"](0);
997
+ console.error('Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:', _context.t0);
998
+
999
+ case 10:
1000
+ case "end":
1001
+ return _context.stop();
1002
+ }
1003
+ }
1004
+ }, _callee, null, [[0, 7]]);
1005
+ }));
1006
+ return _fetchData.apply(this, arguments);
1007
+ }
1008
+
1009
+ fetchData();
1010
+ }, [getPermissions]);
204
1011
  return React__default["default"].createElement(AppContext.Provider, {
205
1012
  value: _extends({}, rest, {
206
1013
  user: _extends({}, rest.user, {
207
- permissions: permissionsQuery.data || []
1014
+ permissions: permissions
208
1015
  }),
209
1016
  activeOrgId: Number(organisationId)
210
1017
  })