@entur-partner/micro-frontend 2.4.4 → 2.4.5

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.
@@ -9,296 +9,321 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
+ function _construct(t, e, r) {
13
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
14
+ var o = [null];
15
+ o.push.apply(o, e);
16
+ var p = new (t.bind.apply(t, o))();
17
+ return r && _setPrototypeOf(p, r.prototype), p;
18
+ }
19
+ function _isNativeReflectConstruct() {
20
+ try {
21
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
22
+ } catch (t) {}
23
+ return (_isNativeReflectConstruct = function () {
24
+ return !!t;
25
+ })();
26
+ }
12
27
  function _regeneratorRuntime() {
13
28
  _regeneratorRuntime = function () {
14
- return exports;
29
+ return e;
15
30
  };
16
- var exports = {},
17
- Op = Object.prototype,
18
- hasOwn = Op.hasOwnProperty,
19
- $Symbol = "function" == typeof Symbol ? Symbol : {},
20
- iteratorSymbol = $Symbol.iterator || "@@iterator",
21
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
22
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
23
- function define(obj, key, value) {
24
- return Object.defineProperty(obj, key, {
25
- value: value,
31
+ var t,
32
+ e = {},
33
+ r = Object.prototype,
34
+ n = r.hasOwnProperty,
35
+ o = Object.defineProperty || function (t, e, r) {
36
+ t[e] = r.value;
37
+ },
38
+ i = "function" == typeof Symbol ? Symbol : {},
39
+ a = i.iterator || "@@iterator",
40
+ c = i.asyncIterator || "@@asyncIterator",
41
+ u = i.toStringTag || "@@toStringTag";
42
+ function define(t, e, r) {
43
+ return Object.defineProperty(t, e, {
44
+ value: r,
26
45
  enumerable: !0,
27
46
  configurable: !0,
28
47
  writable: !0
29
- }), obj[key];
48
+ }), t[e];
30
49
  }
31
50
  try {
32
51
  define({}, "");
33
- } catch (err) {
34
- define = function (obj, key, value) {
35
- return obj[key] = value;
52
+ } catch (t) {
53
+ define = function (t, e, r) {
54
+ return t[e] = r;
36
55
  };
37
56
  }
38
- function wrap(innerFn, outerFn, self, tryLocsList) {
39
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
40
- generator = Object.create(protoGenerator.prototype),
41
- context = new Context(tryLocsList || []);
42
- return generator._invoke = function (innerFn, self, context) {
43
- var state = "suspendedStart";
44
- return function (method, arg) {
45
- if ("executing" === state) throw new Error("Generator is already running");
46
- if ("completed" === state) {
47
- if ("throw" === method) throw arg;
48
- return doneResult();
49
- }
50
- for (context.method = method, context.arg = arg;;) {
51
- var delegate = context.delegate;
52
- if (delegate) {
53
- var delegateResult = maybeInvokeDelegate(delegate, context);
54
- if (delegateResult) {
55
- if (delegateResult === ContinueSentinel) continue;
56
- return delegateResult;
57
- }
58
- }
59
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
60
- if ("suspendedStart" === state) throw state = "completed", context.arg;
61
- context.dispatchException(context.arg);
62
- } else "return" === context.method && context.abrupt("return", context.arg);
63
- state = "executing";
64
- var record = tryCatch(innerFn, self, context);
65
- if ("normal" === record.type) {
66
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
67
- return {
68
- value: record.arg,
69
- done: context.done
70
- };
71
- }
72
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
73
- }
74
- };
75
- }(innerFn, self, context), generator;
57
+ function wrap(t, e, r, n) {
58
+ var i = e && e.prototype instanceof Generator ? e : Generator,
59
+ a = Object.create(i.prototype),
60
+ c = new Context(n || []);
61
+ return o(a, "_invoke", {
62
+ value: makeInvokeMethod(t, r, c)
63
+ }), a;
76
64
  }
77
- function tryCatch(fn, obj, arg) {
65
+ function tryCatch(t, e, r) {
78
66
  try {
79
67
  return {
80
68
  type: "normal",
81
- arg: fn.call(obj, arg)
69
+ arg: t.call(e, r)
82
70
  };
83
- } catch (err) {
71
+ } catch (t) {
84
72
  return {
85
73
  type: "throw",
86
- arg: err
74
+ arg: t
87
75
  };
88
76
  }
89
77
  }
90
- exports.wrap = wrap;
91
- var ContinueSentinel = {};
78
+ e.wrap = wrap;
79
+ var h = "suspendedStart",
80
+ l = "suspendedYield",
81
+ f = "executing",
82
+ s = "completed",
83
+ y = {};
92
84
  function Generator() {}
93
85
  function GeneratorFunction() {}
94
86
  function GeneratorFunctionPrototype() {}
95
- var IteratorPrototype = {};
96
- define(IteratorPrototype, iteratorSymbol, function () {
87
+ var p = {};
88
+ define(p, a, function () {
97
89
  return this;
98
90
  });
99
- var getProto = Object.getPrototypeOf,
100
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
101
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
102
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
103
- function defineIteratorMethods(prototype) {
104
- ["next", "throw", "return"].forEach(function (method) {
105
- define(prototype, method, function (arg) {
106
- return this._invoke(method, arg);
91
+ var d = Object.getPrototypeOf,
92
+ v = d && d(d(values([])));
93
+ v && v !== r && n.call(v, a) && (p = v);
94
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
95
+ function defineIteratorMethods(t) {
96
+ ["next", "throw", "return"].forEach(function (e) {
97
+ define(t, e, function (t) {
98
+ return this._invoke(e, t);
107
99
  });
108
100
  });
109
101
  }
110
- function AsyncIterator(generator, PromiseImpl) {
111
- function invoke(method, arg, resolve, reject) {
112
- var record = tryCatch(generator[method], generator, arg);
113
- if ("throw" !== record.type) {
114
- var result = record.arg,
115
- value = result.value;
116
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
117
- invoke("next", value, resolve, reject);
118
- }, function (err) {
119
- invoke("throw", err, resolve, reject);
120
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
121
- result.value = unwrapped, resolve(result);
122
- }, function (error) {
123
- return invoke("throw", error, resolve, reject);
102
+ function AsyncIterator(t, e) {
103
+ function invoke(r, o, i, a) {
104
+ var c = tryCatch(t[r], t, o);
105
+ if ("throw" !== c.type) {
106
+ var u = c.arg,
107
+ h = u.value;
108
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
109
+ invoke("next", t, i, a);
110
+ }, function (t) {
111
+ invoke("throw", t, i, a);
112
+ }) : e.resolve(h).then(function (t) {
113
+ u.value = t, i(u);
114
+ }, function (t) {
115
+ return invoke("throw", t, i, a);
124
116
  });
125
117
  }
126
- reject(record.arg);
118
+ a(c.arg);
127
119
  }
128
- var previousPromise;
129
- this._invoke = function (method, arg) {
130
- function callInvokeWithMethodAndArg() {
131
- return new PromiseImpl(function (resolve, reject) {
132
- invoke(method, arg, resolve, reject);
133
- });
120
+ var r;
121
+ o(this, "_invoke", {
122
+ value: function (t, n) {
123
+ function callInvokeWithMethodAndArg() {
124
+ return new e(function (e, r) {
125
+ invoke(t, n, e, r);
126
+ });
127
+ }
128
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
134
129
  }
135
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
136
- };
130
+ });
137
131
  }
138
- function maybeInvokeDelegate(delegate, context) {
139
- var method = delegate.iterator[context.method];
140
- if (undefined === method) {
141
- if (context.delegate = null, "throw" === context.method) {
142
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
143
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
132
+ function makeInvokeMethod(e, r, n) {
133
+ var o = h;
134
+ return function (i, a) {
135
+ if (o === f) throw Error("Generator is already running");
136
+ if (o === s) {
137
+ if ("throw" === i) throw a;
138
+ return {
139
+ value: t,
140
+ done: !0
141
+ };
144
142
  }
145
- return ContinueSentinel;
146
- }
147
- var record = tryCatch(method, delegate.iterator, context.arg);
148
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
149
- var info = record.arg;
150
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
143
+ for (n.method = i, n.arg = a;;) {
144
+ var c = n.delegate;
145
+ if (c) {
146
+ var u = maybeInvokeDelegate(c, n);
147
+ if (u) {
148
+ if (u === y) continue;
149
+ return u;
150
+ }
151
+ }
152
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
153
+ if (o === h) throw o = s, n.arg;
154
+ n.dispatchException(n.arg);
155
+ } else "return" === n.method && n.abrupt("return", n.arg);
156
+ o = f;
157
+ var p = tryCatch(e, r, n);
158
+ if ("normal" === p.type) {
159
+ if (o = n.done ? s : l, p.arg === y) continue;
160
+ return {
161
+ value: p.arg,
162
+ done: n.done
163
+ };
164
+ }
165
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
166
+ }
167
+ };
168
+ }
169
+ function maybeInvokeDelegate(e, r) {
170
+ var n = r.method,
171
+ o = e.iterator[n];
172
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
173
+ var i = tryCatch(o, e.iterator, r.arg);
174
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
175
+ var a = i.arg;
176
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
151
177
  }
152
- function pushTryEntry(locs) {
153
- var entry = {
154
- tryLoc: locs[0]
178
+ function pushTryEntry(t) {
179
+ var e = {
180
+ tryLoc: t[0]
155
181
  };
156
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
182
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
157
183
  }
158
- function resetTryEntry(entry) {
159
- var record = entry.completion || {};
160
- record.type = "normal", delete record.arg, entry.completion = record;
184
+ function resetTryEntry(t) {
185
+ var e = t.completion || {};
186
+ e.type = "normal", delete e.arg, t.completion = e;
161
187
  }
162
- function Context(tryLocsList) {
188
+ function Context(t) {
163
189
  this.tryEntries = [{
164
190
  tryLoc: "root"
165
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
191
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
166
192
  }
167
- function values(iterable) {
168
- if (iterable) {
169
- var iteratorMethod = iterable[iteratorSymbol];
170
- if (iteratorMethod) return iteratorMethod.call(iterable);
171
- if ("function" == typeof iterable.next) return iterable;
172
- if (!isNaN(iterable.length)) {
173
- var i = -1,
174
- next = function next() {
175
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
176
- return next.value = undefined, next.done = !0, next;
193
+ function values(e) {
194
+ if (e || "" === e) {
195
+ var r = e[a];
196
+ if (r) return r.call(e);
197
+ if ("function" == typeof e.next) return e;
198
+ if (!isNaN(e.length)) {
199
+ var o = -1,
200
+ i = function next() {
201
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
202
+ return next.value = t, next.done = !0, next;
177
203
  };
178
- return next.next = next;
204
+ return i.next = i;
179
205
  }
180
206
  }
181
- return {
182
- next: doneResult
183
- };
207
+ throw new TypeError(typeof e + " is not iterable");
184
208
  }
185
- function doneResult() {
209
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
210
+ value: GeneratorFunctionPrototype,
211
+ configurable: !0
212
+ }), o(GeneratorFunctionPrototype, "constructor", {
213
+ value: GeneratorFunction,
214
+ configurable: !0
215
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
216
+ var e = "function" == typeof t && t.constructor;
217
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
218
+ }, e.mark = function (t) {
219
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
220
+ }, e.awrap = function (t) {
186
221
  return {
187
- value: undefined,
188
- done: !0
222
+ __await: t
189
223
  };
190
- }
191
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
192
- var ctor = "function" == typeof genFun && genFun.constructor;
193
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
194
- }, exports.mark = function (genFun) {
195
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
196
- }, exports.awrap = function (arg) {
197
- return {
198
- __await: arg
199
- };
200
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
224
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
201
225
  return this;
202
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
203
- void 0 === PromiseImpl && (PromiseImpl = Promise);
204
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
205
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
206
- return result.done ? result.value : iter.next();
226
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
227
+ void 0 === i && (i = Promise);
228
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
229
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
230
+ return t.done ? t.value : a.next();
207
231
  });
208
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
232
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
209
233
  return this;
210
- }), define(Gp, "toString", function () {
234
+ }), define(g, "toString", function () {
211
235
  return "[object Generator]";
212
- }), exports.keys = function (object) {
213
- var keys = [];
214
- for (var key in object) keys.push(key);
215
- return keys.reverse(), function next() {
216
- for (; keys.length;) {
217
- var key = keys.pop();
218
- if (key in object) return next.value = key, next.done = !1, next;
236
+ }), e.keys = function (t) {
237
+ var e = Object(t),
238
+ r = [];
239
+ for (var n in e) r.push(n);
240
+ return r.reverse(), function next() {
241
+ for (; r.length;) {
242
+ var t = r.pop();
243
+ if (t in e) return next.value = t, next.done = !1, next;
219
244
  }
220
245
  return next.done = !0, next;
221
246
  };
222
- }, exports.values = values, Context.prototype = {
247
+ }, e.values = values, Context.prototype = {
223
248
  constructor: Context,
224
- reset: function (skipTempReset) {
225
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
249
+ reset: function (e) {
250
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
226
251
  },
227
252
  stop: function () {
228
253
  this.done = !0;
229
- var rootRecord = this.tryEntries[0].completion;
230
- if ("throw" === rootRecord.type) throw rootRecord.arg;
254
+ var t = this.tryEntries[0].completion;
255
+ if ("throw" === t.type) throw t.arg;
231
256
  return this.rval;
232
257
  },
233
- dispatchException: function (exception) {
234
- if (this.done) throw exception;
235
- var context = this;
236
- function handle(loc, caught) {
237
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
258
+ dispatchException: function (e) {
259
+ if (this.done) throw e;
260
+ var r = this;
261
+ function handle(n, o) {
262
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
238
263
  }
239
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
240
- var entry = this.tryEntries[i],
241
- record = entry.completion;
242
- if ("root" === entry.tryLoc) return handle("end");
243
- if (entry.tryLoc <= this.prev) {
244
- var hasCatch = hasOwn.call(entry, "catchLoc"),
245
- hasFinally = hasOwn.call(entry, "finallyLoc");
246
- if (hasCatch && hasFinally) {
247
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
248
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
249
- } else if (hasCatch) {
250
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
264
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
265
+ var i = this.tryEntries[o],
266
+ a = i.completion;
267
+ if ("root" === i.tryLoc) return handle("end");
268
+ if (i.tryLoc <= this.prev) {
269
+ var c = n.call(i, "catchLoc"),
270
+ u = n.call(i, "finallyLoc");
271
+ if (c && u) {
272
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
273
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
274
+ } else if (c) {
275
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
251
276
  } else {
252
- if (!hasFinally) throw new Error("try statement without catch or finally");
253
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
277
+ if (!u) throw Error("try statement without catch or finally");
278
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
254
279
  }
255
280
  }
256
281
  }
257
282
  },
258
- abrupt: function (type, arg) {
259
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
260
- var entry = this.tryEntries[i];
261
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
262
- var finallyEntry = entry;
283
+ abrupt: function (t, e) {
284
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
285
+ var o = this.tryEntries[r];
286
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
287
+ var i = o;
263
288
  break;
264
289
  }
265
290
  }
266
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
267
- var record = finallyEntry ? finallyEntry.completion : {};
268
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
291
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
292
+ var a = i ? i.completion : {};
293
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
269
294
  },
270
- complete: function (record, afterLoc) {
271
- if ("throw" === record.type) throw record.arg;
272
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
295
+ complete: function (t, e) {
296
+ if ("throw" === t.type) throw t.arg;
297
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
273
298
  },
274
- finish: function (finallyLoc) {
275
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
276
- var entry = this.tryEntries[i];
277
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
299
+ finish: function (t) {
300
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
301
+ var r = this.tryEntries[e];
302
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
278
303
  }
279
304
  },
280
- catch: function (tryLoc) {
281
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
282
- var entry = this.tryEntries[i];
283
- if (entry.tryLoc === tryLoc) {
284
- var record = entry.completion;
285
- if ("throw" === record.type) {
286
- var thrown = record.arg;
287
- resetTryEntry(entry);
305
+ catch: function (t) {
306
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
307
+ var r = this.tryEntries[e];
308
+ if (r.tryLoc === t) {
309
+ var n = r.completion;
310
+ if ("throw" === n.type) {
311
+ var o = n.arg;
312
+ resetTryEntry(r);
288
313
  }
289
- return thrown;
314
+ return o;
290
315
  }
291
316
  }
292
- throw new Error("illegal catch attempt");
317
+ throw Error("illegal catch attempt");
293
318
  },
294
- delegateYield: function (iterable, resultName, nextLoc) {
319
+ delegateYield: function (e, r, n) {
295
320
  return this.delegate = {
296
- iterator: values(iterable),
297
- resultName: resultName,
298
- nextLoc: nextLoc
299
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
321
+ iterator: values(e),
322
+ resultName: r,
323
+ nextLoc: n
324
+ }, "next" === this.method && (this.arg = t), y;
300
325
  }
301
- }, exports;
326
+ }, e;
302
327
  }
303
328
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
304
329
  try {
@@ -362,34 +387,12 @@ function _setPrototypeOf(o, p) {
362
387
  };
363
388
  return _setPrototypeOf(o, p);
364
389
  }
365
- function _isNativeReflectConstruct() {
366
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
367
- if (Reflect.construct.sham) return false;
368
- if (typeof Proxy === "function") return true;
390
+ function _isNativeFunction(fn) {
369
391
  try {
370
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
371
- return true;
392
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
372
393
  } catch (e) {
373
- return false;
374
- }
375
- }
376
- function _construct(Parent, args, Class) {
377
- if (_isNativeReflectConstruct()) {
378
- _construct = Reflect.construct.bind();
379
- } else {
380
- _construct = function _construct(Parent, args, Class) {
381
- var a = [null];
382
- a.push.apply(a, args);
383
- var Constructor = Function.bind.apply(Parent, a);
384
- var instance = new Constructor();
385
- if (Class) _setPrototypeOf(instance, Class.prototype);
386
- return instance;
387
- };
394
+ return typeof fn === "function";
388
395
  }
389
- return _construct.apply(null, arguments);
390
- }
391
- function _isNativeFunction(fn) {
392
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
393
396
  }
394
397
  function _wrapNativeSuper(Class) {
395
398
  var _cache = typeof Map === "function" ? new Map() : undefined;
@@ -444,10 +447,10 @@ function createUnmountEvent(detail) {
444
447
  }
445
448
  var ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';
446
449
  var RouteChangeEvent = /*#__PURE__*/function (_CustomEvent) {
447
- _inheritsLoose(RouteChangeEvent, _CustomEvent);
448
450
  function RouteChangeEvent() {
449
451
  return _CustomEvent.apply(this, arguments) || this;
450
452
  }
453
+ _inheritsLoose(RouteChangeEvent, _CustomEvent);
451
454
  return RouteChangeEvent;
452
455
  }( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
453
456
 
@@ -1 +1 @@
1
- {"version":3,"file":"micro-frontend.cjs.development.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx","../src/AppProvider.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","/*global EventListener*/\nimport { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n","import React, { FC, ReactNode, useContext, useEffect, useState } from 'react';\nimport { assertIsDefined } from '@entur-partner/util';\nimport { Permission } from '@entur-partner/permission-client-node';\n\nimport { User } from './User';\n\ninterface AppContextType {\n getToken: () => Promise<string>;\n user: User;\n logout?: () => void;\n activeOrgId: number;\n navigate: (path: string) => void;\n}\n\nexport const AppContext = React.createContext<AppContextType | undefined>(\n undefined\n);\n\nexport const useUser = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.user;\n};\n\nexport const useActiveOrgId = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.activeOrgId;\n};\n\nexport interface AppProviderProps {\n children: ReactNode;\n getToken: () => Promise<string>;\n user: User;\n getPermissions: () => Promise<Permission[]>;\n organisationId: string;\n navigate: (path: string) => void;\n}\n\nexport const useNavigate = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.navigate;\n};\n\nexport const AppProvider: FC<AppProviderProps> = ({\n children,\n organisationId,\n getPermissions,\n ...rest\n}) => {\n const [permissions, setPermissions] = useState<Permission[]>([]);\n\n useEffect(() => {\n async function fetchData() {\n try {\n const fetchedPermissions = await getPermissions();\n setPermissions(fetchedPermissions);\n } catch (error) {\n console.error(\n 'Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:',\n error\n );\n }\n }\n\n fetchData();\n }, [getPermissions]);\n\n return (\n <AppContext.Provider\n value={{\n ...rest,\n user: { ...rest.user, permissions: permissions },\n activeOrgId: Number(organisationId),\n }}\n >\n {children}\n </AppContext.Provider>\n );\n};\n"],"names":["MOUNT_EVENT_TYPE","UNMOUNT_EVENT_TYPE","createMountEvent","detail","CustomEvent","createUnmountEvent","ROUTE_CHANGE_EVENT_TYPE","RouteChangeEvent","_CustomEvent","_inheritsLoose","apply","arguments","_wrapNativeSuper","registerMicroFrontend","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload","AppContext","React","createContext","undefined","useUser","context","useContext","assertIsDefined","user","useActiveOrgId","activeOrgId","useNavigate","navigate","AppProvider","_ref","children","organisationId","getPermissions","rest","_objectWithoutPropertiesLoose","_excluded","_useState","useState","permissions","setPermissions","useEffect","fetchData","_fetchData","_asyncToGenerator","_regeneratorRuntime","mark","_callee","fetchedPermissions","wrap","_callee$","_context","prev","next","sent","t0","console","error","stop","createElement","Provider","value","_extends","Number"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAMA,gBAAgB,GAAG,uBAAsB;AAC/C,IAAMC,kBAAkB,GAAG,yBAAwB;AAKpD,SAAUC,gBAAgBA,CAACC,MAAwB,EAAA;AACvD,EAAA,OAAO,IAAIC,WAAW,CAAmBJ,gBAAgB,EAAE;AAAEG,IAAAA,MAAM,EAANA,MAAAA;AAAQ,GAAA,CAAC,CAAA;AACxE,CAAA;AAEM,SAAUE,kBAAkBA,CAACF,MAA0B,EAAA;AAC3D,EAAA,OAAO,IAAIC,WAAW,CAAqBH,kBAAkB,EAAE;AAAEE,IAAAA,MAAM,EAANA,MAAAA;AAAQ,GAAA,CAAC,CAAA;AAC5E,CAAA;AAEO,IAAMG,uBAAuB,GAAG,oCAAmC;AAS7DC,I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A,OACEhB,yBAAC,CAAA0C,aAAA,CAAA3C,UAAU,CAAC4C,QAAQ,EAAA;IAClBC,KAAK,EAAAC,QAAA,CAAA,EAAA,EACA5B,IAAI,EAAA;AACPV,MAAAA,IAAI,EAAAsC,QAAA,CAAO5B,EAAAA,EAAAA,IAAI,CAACV,IAAI,EAAA;AAAEe,QAAAA,WAAW,EAAEA,WAAAA;OAAa,CAAA;MAChDb,WAAW,EAAEqC,MAAM,CAAC/B,cAAc,CAAA;AAAC,KAAA,CAAA;GAGpC,EAAAD,QAAQ,CACW,CAAA;AAE1B;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"micro-frontend.cjs.development.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx","../src/AppProvider.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","/*global EventListener*/\nimport { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n","import React, { FC, ReactNode, useContext, useEffect, useState } from 'react';\nimport { assertIsDefined } from '@entur-partner/util';\nimport { Permission } from '@entur-partner/permission-client-node';\n\nimport { User } from './User';\n\ninterface AppContextType {\n getToken: () => Promise<string>;\n user: User;\n logout?: () => void;\n activeOrgId: number;\n navigate: (path: string) => void;\n}\n\nexport const AppContext = React.createContext<AppContextType | undefined>(\n undefined\n);\n\nexport const useUser = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.user;\n};\n\nexport const useActiveOrgId = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.activeOrgId;\n};\n\nexport interface AppProviderProps {\n children: ReactNode;\n getToken: () => Promise<string>;\n user: User;\n getPermissions: () => Promise<Permission[]>;\n organisationId: string;\n navigate: (path: string) => void;\n}\n\nexport const useNavigate = () => {\n const context = useContext(AppContext);\n assertIsDefined(context);\n return context.navigate;\n};\n\nexport const AppProvider: FC<AppProviderProps> = ({\n children,\n organisationId,\n getPermissions,\n ...rest\n}) => {\n const [permissions, setPermissions] = useState<Permission[]>([]);\n\n useEffect(() => {\n async function fetchData() {\n try {\n const fetchedPermissions = await getPermissions();\n setPermissions(fetchedPermissions);\n } catch (error) {\n console.error(\n 'Fetching permissions with the provided getPermissions function failed in AppProvider with the following error:',\n error\n );\n }\n }\n\n fetchData();\n }, [getPermissions]);\n\n return (\n <AppContext.Provider\n value={{\n ...rest,\n user: { ...rest.user, permissions: permissions },\n activeOrgId: Number(organisationId),\n }}\n >\n {children}\n </AppContext.Provider>\n );\n};\n"],"names":["MOUNT_EVENT_TYPE","UNMOUNT_EVENT_TYPE","createMountEvent","detail","CustomEvent","createUnmountEvent","ROUTE_CHANGE_EVENT_TYPE","RouteChangeEvent","_CustomEvent","apply","arguments","_inheritsLoose","_wrapNativeSuper","registerMicroFrontend","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload","AppContext","React","createContext","undefined","useUser","context","useContext","assertIsDefined","user","useActiveOrgId","activeOrgId","useNavigate","navigate","AppProvider","_ref","children","organisationId","getPermissions","rest","_objectWithoutPropertiesLoose","_excluded","_useState","useState","permissions","setPermissions","useEffect","fetchData","_fetchData","_asyncToGenerator","_regeneratorRuntime","mark","_callee","fetchedPermissions","wrap","_callee$","_context","prev","next","sent","t0","console","error","stop","createElement","Provider","value","_extends","Number"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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