@telia-ace/widget-components-widget-header-flamingo 1.0.0 → 1.0.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.
@@ -11,7 +11,7 @@ const F = (t, e, s, ...n) => {
11
11
  console.error(r, ...n);
12
12
  break;
13
13
  }
14
- }, Te = (t) => {
14
+ }, _e = (t) => {
15
15
  const e = t.container || t;
16
16
  return {
17
17
  info: (s, ...n) => F(e, "info", s, ...n),
@@ -19,8 +19,8 @@ const F = (t, e, s, ...n) => {
19
19
  error: (s, ...n) => F(e, "error", s, ...n)
20
20
  };
21
21
  };
22
- var T = /* @__PURE__ */ ((t) => (t.Implementation = "implementation", t.Widget = "widget", t))(T || {}), C = /* @__PURE__ */ ((t) => (t.Pre = "pre", t.Post = "post", t))(C || {});
23
- const _e = (t, e, s, n) => {
22
+ var _ = /* @__PURE__ */ ((t) => (t.Implementation = "implementation", t.Widget = "widget", t))(_ || {}), C = /* @__PURE__ */ ((t) => (t.Pre = "pre", t.Post = "post", t))(C || {});
23
+ const Te = (t, e, s, n) => {
24
24
  try {
25
25
  const r = new e(s, n);
26
26
  return {
@@ -54,12 +54,12 @@ let Ie = class {
54
54
  createCommand(t, e, s) {
55
55
  let n;
56
56
  typeof e == "function" ? n = {
57
- scope: T.Widget,
57
+ scope: _.Widget,
58
58
  stage: C.Post,
59
59
  defaultArgs: void 0,
60
60
  handlerResolver: e
61
61
  } : n = {
62
- scope: pe(e.scope, T.Widget),
62
+ scope: pe(e.scope, _.Widget),
63
63
  stage: pe(e.stage, C.Post),
64
64
  defaultArgs: e.defaultArgs,
65
65
  handlerResolver: s
@@ -74,14 +74,14 @@ let Ie = class {
74
74
  return this.part;
75
75
  }
76
76
  };
77
- const Q = (t) => {
77
+ const Y = (t) => {
78
78
  const e = new Ie({});
79
79
  return t(e), e.get();
80
80
  };
81
- Q((t) => {
81
+ Y((t) => {
82
82
  t.createCommand(
83
83
  "types.register",
84
- { scope: T.Implementation, stage: C.Pre },
84
+ { scope: _.Implementation, stage: C.Pre },
85
85
  (e) => (s, n) => {
86
86
  e.container.get("$types")[s] = n;
87
87
  }
@@ -116,7 +116,7 @@ Q((t) => {
116
116
  a
117
117
  ) : n;
118
118
  try {
119
- const u = _e(
119
+ const u = Te(
120
120
  i,
121
121
  a,
122
122
  o,
@@ -124,7 +124,7 @@ Q((t) => {
124
124
  );
125
125
  o.get("$plugins").push(u), h && u.invoke("initialize", null);
126
126
  } catch (u) {
127
- Te(e).warn("Error when initializing plugin", u);
127
+ _e(e).warn("Error when initializing plugin", u);
128
128
  }
129
129
  };
130
130
  e.container.get("$instance") ? p(!0) : e.events.subscribeOnce("widget:instance-created", () => p(!1));
@@ -232,14 +232,14 @@ const w = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1
232
232
  function Z() {
233
233
  return w() + w() + "-" + w() + "-" + w() + "-" + w() + "-" + w() + w() + w();
234
234
  }
235
- var Je = Object.defineProperty, Me = Object.defineProperties, ze = Object.getOwnPropertyDescriptors, ue = Object.getOwnPropertySymbols, Ve = Object.prototype.hasOwnProperty, Fe = Object.prototype.propertyIsEnumerable, de = (t, e, s) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, Re = (t, e) => {
235
+ var Je = Object.defineProperty, Ve = Object.defineProperties, ze = Object.getOwnPropertyDescriptors, ue = Object.getOwnPropertySymbols, Me = Object.prototype.hasOwnProperty, Fe = Object.prototype.propertyIsEnumerable, de = (t, e, s) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, Re = (t, e) => {
236
236
  for (var s in e || (e = {}))
237
- Ve.call(e, s) && de(t, s, e[s]);
237
+ Me.call(e, s) && de(t, s, e[s]);
238
238
  if (ue)
239
239
  for (var s of ue(e))
240
240
  Fe.call(e, s) && de(t, s, e[s]);
241
241
  return t;
242
- }, Le = (t, e) => Me(t, ze(e));
242
+ }, Le = (t, e) => Ve(t, ze(e));
243
243
  const qe = (t) => {
244
244
  const e = [];
245
245
  return [
@@ -346,7 +346,7 @@ class He {
346
346
  }), this.actions.dispose();
347
347
  }
348
348
  }
349
- const Ke = (t, e, s) => {
349
+ const Be = (t, e, s) => {
350
350
  const n = t.concat(), r = (o, i, a) => {
351
351
  let c = !0;
352
352
  if (n.length) {
@@ -396,7 +396,7 @@ let te = class {
396
396
  c,
397
397
  this.ns
398
398
  );
399
- return Ke(a, e, p).then((h) => {
399
+ return Be(a, e, p).then((h) => {
400
400
  const { data: l = {}, options: d, cancelled: u } = h;
401
401
  return Promise.resolve(
402
402
  u ? {} : o.fn(l, d, p)
@@ -430,7 +430,7 @@ let te = class {
430
430
  this.subscriptions.forEach((t) => t());
431
431
  }
432
432
  };
433
- Q((t) => {
433
+ Y((t) => {
434
434
  t.createCommand("components", (e) => (s) => {
435
435
  e.events.subscribeOnce("components:platform-created", (n, { platform: r }) => {
436
436
  s.handlers && s.handlers.forEach(([o, i]) => {
@@ -539,14 +539,14 @@ const Ce = (t, e, s) => {
539
539
  return se(t, e, (n) => {
540
540
  s.push(n);
541
541
  }), s;
542
- }, Be = (t, e, s) => {
542
+ }, Ue = (t, e, s) => {
543
543
  let n;
544
544
  return se(t, e, (r) => {
545
545
  if (s(r))
546
546
  return n = r, !0;
547
547
  }), n;
548
548
  };
549
- let Ue = class {
549
+ let Ke = class {
550
550
  constructor(t, e, s) {
551
551
  this.root = t, this.switches = e, this.all = [], this.visible = [], this.detached = [], s.subscribe("components:node-appended", (n, r) => {
552
552
  this.all.push(r.node), this.visible = R(t, e);
@@ -564,9 +564,9 @@ let Ue = class {
564
564
  }), e;
565
565
  }
566
566
  get(t) {
567
- return Be(this.root, this.switches, (e) => e.id === t) || this.detached.find((e) => e.id === t);
567
+ return Ue(this.root, this.switches, (e) => e.id === t) || this.detached.find((e) => e.id === t);
568
568
  }
569
- }, Xe = class {
569
+ }, Ge = class {
570
570
  constructor() {
571
571
  this.handlers = /* @__PURE__ */ new Map();
572
572
  }
@@ -577,12 +577,12 @@ let Ue = class {
577
577
  return this.handlers.get(t);
578
578
  }
579
579
  };
580
- const Ge = (t) => {
580
+ const Qe = (t) => {
581
581
  let e = t, s = 0;
582
582
  for (; e.parent; )
583
583
  s = s + 1, e = e.parent;
584
584
  return s;
585
- }, Ye = (t) => t.map(([e, s]) => [Ge(e), e, s]).sort(([e], [s]) => e - s).map(([, e, s]) => [e, s]), L = (t) => t instanceof Date ? !1 : t && typeof t == "object" && !Array.isArray(t), v = (t, ...e) => {
585
+ }, Xe = (t) => t.map(([e, s]) => [Qe(e), e, s]).sort(([e], [s]) => e - s).map(([, e, s]) => [e, s]), L = (t) => t instanceof Date ? !1 : t && typeof t == "object" && !Array.isArray(t), v = (t, ...e) => {
586
586
  if (!e.length)
587
587
  return t;
588
588
  const s = e.shift();
@@ -590,22 +590,22 @@ const Ge = (t) => {
590
590
  for (const n in s)
591
591
  L(s[n]) ? (t[n] || Object.assign(t, { [n]: {} }), v(t[n], s[n])) : Object.assign(t, { [n]: s[n] });
592
592
  return v(t, ...e);
593
- }, Qe = (t, e) => !t || t === "all" ? !0 : t.some((s) => e.indexOf(s) > -1), Ze = (t, e) => {
593
+ }, Ye = (t, e) => !t || t === "all" ? !0 : t.some((s) => e.indexOf(s) > -1), Ze = (t, e) => {
594
594
  let s = [], n = [], r;
595
595
  const o = () => {
596
596
  process.env.NODE_ENV !== "production" && console.time("state-processor.flush");
597
- const a = /* @__PURE__ */ new Map(), c = Ye(s.map((h, l) => [h, n[l]])), p = (h, l) => {
597
+ const a = /* @__PURE__ */ new Map(), c = Xe(s.map((h, l) => [h, n[l]])), p = (h, l) => {
598
598
  var d;
599
- const u = a.get(h) || {}, P = l.context && !u.context, M = l.properties && !u.properties, z = l.layout && !u.layout;
599
+ const u = a.get(h) || {}, P = l.context && !u.context, V = l.properties && !u.properties, z = l.layout && !u.layout;
600
600
  a.set(h, {
601
601
  context: u.context || P,
602
- properties: u.properties || M,
602
+ properties: u.properties || V,
603
603
  layout: u.layout || z
604
- }), M && (h.attributes.properties = {}), z && (h.attributes.layout = {}), P && (h.attributes.context = v({}, (d = h.parent) == null ? void 0 : d.attributes.context));
604
+ }), V && (h.attributes.properties = {}), z && (h.attributes.layout = {}), P && (h.attributes.context = v({}, (d = h.parent) == null ? void 0 : d.attributes.context));
605
605
  const ae = [], ce = [], he = [];
606
606
  if (h.changesets.forEach((y) => {
607
- const [f, V] = y;
608
- Qe(V.breakpoints, t.breakpoints) && (M && (typeof f.properties == "function" ? ae.push(
607
+ const [f, M] = y;
608
+ Ye(M.breakpoints, t.breakpoints) && (V && (typeof f.properties == "function" ? ae.push(
609
609
  f.properties
610
610
  ) : v(h.attributes.properties, f.properties)), z && (typeof f.layout == "function" ? ce.push(f.layout) : v(h.attributes.layout, f.layout)), P && (typeof f.context == "function" ? he.push(f.context) : v(h.attributes.context, f.context)));
611
611
  }), ae.forEach((y) => {
@@ -618,8 +618,8 @@ const Ge = (t) => {
618
618
  const y = t.getBranch(h), f = l.recursive ? l : {
619
619
  context: !!P
620
620
  };
621
- h.getChildren(y).forEach((V) => {
622
- p(V, f);
621
+ h.getChildren(y).forEach((M) => {
622
+ p(M, f);
623
623
  });
624
624
  }
625
625
  };
@@ -640,9 +640,9 @@ const Ge = (t) => {
640
640
  };
641
641
  let et = class {
642
642
  constructor(t, e = {}) {
643
- this.providers = e, this.breakpoints = [], this.actionsState = { handlers: [], watchers: [] }, this.switches = {}, this.changesets = [], this.subscriptions = [], this.customComponentHandler = new Xe(), this.events = t.events.createChild(this);
643
+ this.providers = e, this.breakpoints = [], this.actionsState = { handlers: [], watchers: [] }, this.switches = {}, this.changesets = [], this.subscriptions = [], this.customComponentHandler = new Ge(), this.events = t.events.createChild(this);
644
644
  const s = new me(this.events, "root");
645
- s.name = `root-${t.name}`, this.nodes = new Ue(s, this.switches, this.events);
645
+ s.name = `root-${t.name}`, this.nodes = new Ke(s, this.switches, this.events);
646
646
  const n = this.processNode = Ze(this, (r) => {
647
647
  const o = Array.from(r.keys());
648
648
  process.env.NODE_ENV !== "production" && console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
@@ -851,7 +851,7 @@ const ot = (t, e, s, n = {}) => ye(t, s).then((r) => (process.env.NODE_ENV !== "
851
851
  duration: p
852
852
  } = n, h = ct();
853
853
  return h[a][e] = Ee(o, s, p), c === b.Cookie ? dt(t, h) : gt(t, c, h);
854
- })))), it = (t, e, s = b.Session) => (oe(t), typeof e == "undefined" ? (process.env.NODE_ENV !== "production" && g.warn("readStorage: Undefined key passed when reading storage. ", e, s), Promise.resolve(void 0)) : s === b.Cookie ? ut(t).then((n) => Y(n, e)) : mt(t, s).then((n) => Y(n, e))), E = (t) => !!Object.entries(t).filter(([e, s]) => typeof s != "undefined").length, q = (t) => Object.entries(t).filter(([e, s]) => typeof s != "undefined").forEach(([e, { value: s }]) => {
854
+ })))), it = (t, e, s = b.Session) => (oe(t), typeof e == "undefined" ? (process.env.NODE_ENV !== "production" && g.warn("readStorage: Undefined key passed when reading storage. ", e, s), Promise.resolve(void 0)) : s === b.Cookie ? ut(t).then((n) => X(n, e)) : mt(t, s).then((n) => X(n, e))), E = (t) => !!Object.entries(t).filter(([e, s]) => typeof s != "undefined").length, q = (t) => Object.entries(t).filter(([e, s]) => typeof s != "undefined").forEach(([e, { value: s }]) => {
855
855
  typeof s == "undefined" && delete t[e];
856
856
  }), xe = (t, e) => {
857
857
  const s = {
@@ -879,7 +879,7 @@ const ot = (t, e, s, n = {}) => ye(t, s).then((r) => (process.env.NODE_ENV !== "
879
879
  }, H = (t) => {
880
880
  const e = new RegExp(`(?:^|;)\\s?${t}=(.*?)(?:;|$)`, "i"), s = document.cookie.match(e);
881
881
  return s && s[1] && JSON.parse(s[1]) || void 0;
882
- }, K = (t, e, s) => {
882
+ }, B = (t, e, s) => {
883
883
  const n = `${t}=${JSON.stringify(e).trim()}`, r = `expires=${new Date(s).toUTCString()}`, o = "path=/", i = "SameSite=None;Secure";
884
884
  return document.cookie = `${n}; ${r}; ${o}; ${i}`;
885
885
  }, re = (t) => {
@@ -891,22 +891,22 @@ const ot = (t, e, s, n = {}) => ye(t, s).then((r) => (process.env.NODE_ENV !== "
891
891
  };
892
892
  }, ke = (t, e) => {
893
893
  const s = re(t), n = xe(s, e), [r, o, i] = J(t), { tenant: a, implementation: c, widget: p } = n, h = at(e), l = ie({ days: -1 });
894
- K(r, a, E(a) ? h : l), K(
894
+ B(r, a, E(a) ? h : l), B(
895
895
  o,
896
896
  c,
897
897
  E(c) ? h : l
898
- ), K(i, p, E(p) ? h : l);
899
- }, _ = (t, e) => {
898
+ ), B(i, p, E(p) ? h : l);
899
+ }, T = (t, e) => {
900
900
  const [s, n, r] = J(t), o = e.getItem(s) || "{}", i = e.getItem(n) || "{}", a = e.getItem(r) || "{}";
901
901
  return {
902
902
  tenant: JSON.parse(o),
903
903
  implementation: JSON.parse(i),
904
904
  widget: JSON.parse(a)
905
905
  };
906
- }, G = (t, e, s) => {
907
- const n = _(t, e), r = xe(n, s), [o, i, a] = J(t), { tenant: c, implementation: p, widget: h } = r;
906
+ }, Q = (t, e, s) => {
907
+ const n = T(t, e), r = xe(n, s), [o, i, a] = J(t), { tenant: c, implementation: p, widget: h } = r;
908
908
  E(c) ? e.setItem(o, JSON.stringify(c)) : e.removeItem(o), E(p) ? e.setItem(i, JSON.stringify(p)) : e.removeItem(i), E(h) ? e.setItem(a, JSON.stringify(h)) : e.removeItem(a);
909
- }, ct = () => ({ tenant: {}, implementation: {}, widget: {} }), ht = (t) => t ? !!t && /* @__PURE__ */ new Date() > new Date(t) : !1, Y = (t, e) => {
909
+ }, ct = () => ({ tenant: {}, implementation: {}, widget: {} }), ht = (t) => t ? !!t && /* @__PURE__ */ new Date() > new Date(t) : !1, X = (t, e) => {
910
910
  const s = t.widget[e] || t.implementation[e] || t.tenant[e];
911
911
  return s == null ? void 0 : s.value;
912
912
  }, Ee = (t, e, s) => s ? {
@@ -927,22 +927,22 @@ const ot = (t, e, s, n = {}) => ye(t, s).then((r) => (process.env.NODE_ENV !== "
927
927
  }, ye = (t, e) => it(t, "storagePolicy", b.Cookie).then(
928
928
  (s = [m.Necessary]) => !!e && s.indexOf(e) === -1
929
929
  ), lt = (t = [m.Necessary], e) => !!e && t.indexOf(e) === -1, oe = (t) => {
930
- const e = re(t), s = _(t, window.localStorage), n = _(t, sessionStorage), r = Y(e, "storagePolicy"), [o, i, a] = [
930
+ const e = re(t), s = T(t, window.localStorage), n = T(t, sessionStorage), r = X(e, "storagePolicy"), [o, i, a] = [
931
931
  e,
932
932
  s,
933
933
  n
934
934
  ].map((c) => pt(c, r));
935
- ke(t, o), G(t, window.localStorage, i), G(t, window.sessionStorage, a);
935
+ ke(t, o), Q(t, window.localStorage, i), Q(t, window.sessionStorage, a);
936
936
  }, ie = (t = { days: 30 }) => {
937
937
  const { days: e = 0, hours: s = 0, minutes: n = 0, seconds: r = 0 } = t, o = /* @__PURE__ */ new Date();
938
938
  return o.setTime(o.getTime() + s * 60 * 60 * 1e3), o.setTime(o.getTime() + e * 24 * 60 * 60 * 1e3), o.setTime(o.getTime() + n * 60 * 1e3), o.setTime(o.getTime() + r * 1e3), o.toISOString();
939
939
  }, ut = (t) => W(document)(() => re(t)), dt = (t, e) => W(document)(() => ke(t, e)), mt = (t, e) => {
940
940
  const s = e === b.Local ? window.localStorage : window.sessionStorage;
941
- return W(s)(() => _(t, s));
941
+ return W(s)(() => T(t, s));
942
942
  }, gt = (t, e, s) => {
943
943
  const n = e === b.Local ? window.localStorage : window.sessionStorage;
944
- return W(n)(() => G(t, n, s));
945
- }, B = (t, e, s, ...n) => {
944
+ return W(n)(() => Q(t, n, s));
945
+ }, U = (t, e, s, ...n) => {
946
946
  const r = `[${t.get("$environment").name || "webprovisions"}] ${s}`;
947
947
  switch (e) {
948
948
  case "info":
@@ -958,9 +958,9 @@ const ot = (t, e, s, n = {}) => ye(t, s).then((r) => (process.env.NODE_ENV !== "
958
958
  }, ft = (t) => {
959
959
  const e = t.container || t;
960
960
  return {
961
- info: (s, ...n) => B(e, "info", s, ...n),
962
- warn: (s, ...n) => B(e, "warning", s, ...n),
963
- error: (s, ...n) => B(e, "error", s, ...n)
961
+ info: (s, ...n) => U(e, "info", s, ...n),
962
+ warn: (s, ...n) => U(e, "warning", s, ...n),
963
+ error: (s, ...n) => U(e, "error", s, ...n)
964
964
  };
965
965
  };
966
966
  var I = /* @__PURE__ */ ((t) => (t.Implementation = "implementation", t.Widget = "widget", t))(I || {}), x = /* @__PURE__ */ ((t) => (t.Pre = "pre", t.Post = "post", t))(x || {});
@@ -1206,7 +1206,7 @@ function Ot(t) {
1206
1206
  function A(t) {
1207
1207
  return t.charAt(0) === "/";
1208
1208
  }
1209
- function U(t, e) {
1209
+ function K(t, e) {
1210
1210
  for (var s = e, n = s + 1, r = t.length; n < r; s += 1, n += 1)
1211
1211
  t[s] = t[n];
1212
1212
  t.pop();
@@ -1223,7 +1223,7 @@ function Pt(t) {
1223
1223
  a = !1;
1224
1224
  for (var p = 0, h = n.length; h >= 0; h--) {
1225
1225
  var l = n[h];
1226
- l === "." ? U(n, h) : l === ".." ? (U(n, h), p++) : p && (U(n, h), p--);
1226
+ l === "." ? K(n, h) : l === ".." ? (K(n, h), p++) : p && (K(n, h), p--);
1227
1227
  }
1228
1228
  if (!i)
1229
1229
  for (; p--; p)
@@ -1275,7 +1275,7 @@ Ae($t);
1275
1275
  function Ae(t) {
1276
1276
  return t && t.__esModule ? t : { default: t };
1277
1277
  }
1278
- Q((t) => {
1278
+ Y((t) => {
1279
1279
  t.createCommand("routing", (e) => (s) => {
1280
1280
  const n = {
1281
1281
  mode: s.mode
@@ -1283,7 +1283,7 @@ Q((t) => {
1283
1283
  s.basePath && (n.basePath = s.basePath), e.container.register("routingSettings", n);
1284
1284
  });
1285
1285
  });
1286
- const X = (t, e, s, ...n) => {
1286
+ const G = (t, e, s, ...n) => {
1287
1287
  const r = `[${t.get("$environment").name || "webprovisions"}] ${s}`;
1288
1288
  switch (e) {
1289
1289
  case "info":
@@ -1299,9 +1299,9 @@ const X = (t, e, s, ...n) => {
1299
1299
  }, Nt = (t) => {
1300
1300
  const e = t.container || t;
1301
1301
  return {
1302
- info: (s, ...n) => X(e, "info", s, ...n),
1303
- warn: (s, ...n) => X(e, "warning", s, ...n),
1304
- error: (s, ...n) => X(e, "error", s, ...n)
1302
+ info: (s, ...n) => G(e, "info", s, ...n),
1303
+ warn: (s, ...n) => G(e, "warning", s, ...n),
1304
+ error: (s, ...n) => G(e, "error", s, ...n)
1305
1305
  };
1306
1306
  };
1307
1307
  var $ = /* @__PURE__ */ ((t) => (t.Implementation = "implementation", t.Widget = "widget", t))($ || {}), O = /* @__PURE__ */ ((t) => (t.Pre = "pre", t.Post = "post", t))(O || {});
@@ -1454,16 +1454,16 @@ je((t) => {
1454
1454
  }
1455
1455
  );
1456
1456
  });
1457
- const Tt = (t, e, s, n, r) => t.getAsync("componentResolver").then((o) => (o.registerComponent(e, s), tt(t, e, n || (() => {
1458
- }), e, r))), _t = "properties", It = (t) => Tt(
1457
+ const Tt = "properties", _t = (t, e, s, n, r) => t.getAsync("componentResolver").then((o) => (o.registerComponent(e, s), tt(t, e, n || (() => {
1458
+ }), e, r))), It = (t) => _t(
1459
1459
  t,
1460
1460
  "widget-header",
1461
- import("./widget-header-af48b22f.js"),
1461
+ import("./widget-header-a3816d4c.js"),
1462
1462
  (e) => {
1463
1463
  }
1464
1464
  );
1465
1465
  export {
1466
- _t as T,
1467
- It as W
1466
+ It as W,
1467
+ Tt as j
1468
1468
  };
1469
- //# sourceMappingURL=index-f9e4773a.js.map
1469
+ //# sourceMappingURL=index-76d2ab21.js.map