@telia-ace/widget-runtime-flamingo 1.1.111-rc.8 → 1.1.111
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.
|
@@ -74,11 +74,11 @@ let We = class {
|
|
|
74
74
|
return this.part;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
const
|
|
77
|
+
const xe = (i) => {
|
|
78
78
|
const t = new We({});
|
|
79
79
|
return i(t), t.get();
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
xe((i) => {
|
|
82
82
|
i.createCommand(
|
|
83
83
|
"types.register",
|
|
84
84
|
{ scope: Q.Implementation, stage: N.Pre },
|
|
@@ -190,7 +190,7 @@ function Fe(i, t, e) {
|
|
|
190
190
|
e
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
xe((i) => {
|
|
194
194
|
i.createCommand(
|
|
195
195
|
"ready",
|
|
196
196
|
{ scope: Q.Implementation, stage: N.Pre },
|
|
@@ -361,7 +361,7 @@ Jt((i) => {
|
|
|
361
361
|
}
|
|
362
362
|
);
|
|
363
363
|
});
|
|
364
|
-
var
|
|
364
|
+
var Ae = /* @__PURE__ */ ((i) => (i.Activating = "activating", i.Loading = "loading", i.Activated = "activated", i.Deactivating = "deactivating", i.Deactivated = "deactivated", i))(Ae || {});
|
|
365
365
|
class Ze {
|
|
366
366
|
/**
|
|
367
367
|
* Creates a new `Widget` instance.
|
|
@@ -436,7 +436,7 @@ let Qe = class {
|
|
|
436
436
|
}
|
|
437
437
|
};
|
|
438
438
|
const ct = /* @__PURE__ */ new WeakMap();
|
|
439
|
-
function
|
|
439
|
+
function A(i, t = 5e3, e = 1e3) {
|
|
440
440
|
return ct.has(i) || ct.set(i, new Qe(t, e)), (s) => new Promise((n, r) => {
|
|
441
441
|
const o = ct.get(i);
|
|
442
442
|
o.add(s, n, r, () => {
|
|
@@ -550,7 +550,7 @@ let W = class {
|
|
|
550
550
|
}
|
|
551
551
|
}, Ft = class {
|
|
552
552
|
constructor(t, e, s) {
|
|
553
|
-
this.platform = t, this.node = e, this.actions = new
|
|
553
|
+
this.platform = t, this.node = e, this.actions = new xt(
|
|
554
554
|
t,
|
|
555
555
|
new W(t).withId(e.id),
|
|
556
556
|
s
|
|
@@ -588,7 +588,7 @@ let W = class {
|
|
|
588
588
|
};
|
|
589
589
|
class ss {
|
|
590
590
|
constructor(t, e, s = !0) {
|
|
591
|
-
this.platform = t, this.target = e, this.clearOnDispose = s, this.removes = [], this.actions = new
|
|
591
|
+
this.platform = t, this.target = e, this.clearOnDispose = s, this.removes = [], this.actions = new xt(this.platform, this.target);
|
|
592
592
|
}
|
|
593
593
|
writeProperties(t, e) {
|
|
594
594
|
this.removes.push(
|
|
@@ -646,7 +646,7 @@ const is = (i, t, e) => {
|
|
|
646
646
|
};
|
|
647
647
|
return n(t, {}, e);
|
|
648
648
|
};
|
|
649
|
-
let
|
|
649
|
+
let xt = class {
|
|
650
650
|
constructor(t, e, s) {
|
|
651
651
|
this.platform = t, this.target = e, this.ns = s, this.subscriptions = [], this.create = this.create.bind(this);
|
|
652
652
|
}
|
|
@@ -829,19 +829,19 @@ const Oe = (i, t, e) => {
|
|
|
829
829
|
const r = t[i[s].id] || "default", o = i[s].getChildren(r);
|
|
830
830
|
Oe(o, t, e);
|
|
831
831
|
}
|
|
832
|
-
},
|
|
832
|
+
}, At = (i, t, e) => {
|
|
833
833
|
if (e(i) !== !0) {
|
|
834
834
|
const s = t[i.id] || "default", n = i.children[s];
|
|
835
835
|
Oe(n, t, e);
|
|
836
836
|
}
|
|
837
837
|
}, ut = (i, t) => {
|
|
838
838
|
const e = [];
|
|
839
|
-
return
|
|
839
|
+
return At(i, t, (s) => {
|
|
840
840
|
e.push(s);
|
|
841
841
|
}), e;
|
|
842
842
|
}, Se = (i, t, e) => {
|
|
843
843
|
let s;
|
|
844
|
-
return
|
|
844
|
+
return At(i, t, (n) => {
|
|
845
845
|
if (e(n))
|
|
846
846
|
return s = n, !0;
|
|
847
847
|
}), s;
|
|
@@ -868,7 +868,7 @@ let ns = class {
|
|
|
868
868
|
}
|
|
869
869
|
query(t = {}) {
|
|
870
870
|
const e = [];
|
|
871
|
-
return
|
|
871
|
+
return At(this.root, this.switches, (s) => {
|
|
872
872
|
Object.keys(t).every((n) => t[n] === s[n]) && e.push(s);
|
|
873
873
|
}), e;
|
|
874
874
|
}
|
|
@@ -910,12 +910,12 @@ const os = (i) => {
|
|
|
910
910
|
e.map((l, d) => [l, s[d]])
|
|
911
911
|
), c = (l, d) => {
|
|
912
912
|
var u;
|
|
913
|
-
const p = a.get(l) || {}, g = d.context && !p.context, b = d.properties && !p.properties,
|
|
913
|
+
const p = a.get(l) || {}, g = d.context && !p.context, b = d.properties && !p.properties, x = d.layout && !p.layout;
|
|
914
914
|
a.set(l, {
|
|
915
915
|
context: p.context || g,
|
|
916
916
|
properties: p.properties || b,
|
|
917
|
-
layout: p.layout ||
|
|
918
|
-
}), b && (l.attributes.properties = {}),
|
|
917
|
+
layout: p.layout || x
|
|
918
|
+
}), b && (l.attributes.properties = {}), x && (l.attributes.layout = {}), g && (l.attributes.context = E(
|
|
919
919
|
{},
|
|
920
920
|
(u = l.parent) == null ? void 0 : u.attributes.context
|
|
921
921
|
));
|
|
@@ -924,7 +924,7 @@ const os = (i) => {
|
|
|
924
924
|
const [$, kt] = w;
|
|
925
925
|
cs(kt.breakpoints, i.breakpoints) && (b && (typeof $.properties == "function" ? at.push(
|
|
926
926
|
$.properties
|
|
927
|
-
) : E(l.attributes.properties, $.properties)),
|
|
927
|
+
) : E(l.attributes.properties, $.properties)), x && (typeof $.layout == "function" ? St.push($.layout) : E(l.attributes.layout, $.layout)), g && (typeof $.context == "function" ? Pt.push(
|
|
928
928
|
$.context
|
|
929
929
|
) : E(l.attributes.context, $.context)));
|
|
930
930
|
}), at.forEach((w) => {
|
|
@@ -1092,7 +1092,7 @@ class nt {
|
|
|
1092
1092
|
return new W(this);
|
|
1093
1093
|
}
|
|
1094
1094
|
actions(t, e) {
|
|
1095
|
-
return new
|
|
1095
|
+
return new xt(this, t, e);
|
|
1096
1096
|
}
|
|
1097
1097
|
write(t) {
|
|
1098
1098
|
const {
|
|
@@ -1290,7 +1290,7 @@ var _ = /* @__PURE__ */ ((i) => (i.open = "open", i.closed = "closed", i.hidden
|
|
|
1290
1290
|
const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1291
1291
|
__proto__: null,
|
|
1292
1292
|
ActionResolver: es,
|
|
1293
|
-
ActionsController:
|
|
1293
|
+
ActionsController: xt,
|
|
1294
1294
|
ComponentNode: Bt,
|
|
1295
1295
|
ComponentNodeController: Ft,
|
|
1296
1296
|
ComponentPlatform: nt,
|
|
@@ -1304,7 +1304,7 @@ const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1304
1304
|
extendComponent: ke,
|
|
1305
1305
|
findComponent: Se,
|
|
1306
1306
|
findVisibleComponents: ut,
|
|
1307
|
-
traverseComponents:
|
|
1307
|
+
traverseComponents: At
|
|
1308
1308
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1309
1309
|
var f = /* @__PURE__ */ ((i) => (i.Cookie = "cookie", i.Local = "local", i.Session = "session", i))(f || {}), q = /* @__PURE__ */ ((i) => (i.Tenant = "tenant", i.Implementation = "implementation", i.Widget = "widget", i))(q || {}), m = /* @__PURE__ */ ((i) => (i.Necessary = "necessary", i.Functional = "functional", i.Analytical = "analytical", i.Marketing = "marketing", i))(m || {});
|
|
1310
1310
|
const S = (i, t, e, s = {}) => ce(i, e).then((n) => (process.env.NODE_ENV !== "production" && n && v.warn(
|
|
@@ -1444,12 +1444,12 @@ const S = (i, t, e, s = {}) => ce(i, e).then((n) => (process.env.NODE_ENV !== "p
|
|
|
1444
1444
|
}, Ct = (i = { days: 30 }) => {
|
|
1445
1445
|
const { days: t = 0, hours: e = 0, minutes: s = 0, seconds: n = 0 } = i, r = /* @__PURE__ */ new Date();
|
|
1446
1446
|
return r.setTime(r.getTime() + e * 60 * 60 * 1e3), r.setTime(r.getTime() + t * 24 * 60 * 60 * 1e3), r.setTime(r.getTime() + s * 60 * 1e3), r.setTime(r.getTime() + n * 1e3), r.toISOString();
|
|
1447
|
-
}, fs = (i) =>
|
|
1447
|
+
}, fs = (i) => A(document)(() => Gt(i)), ys = (i, t) => A(document)(() => Me(i, t)), vs = (i, t) => {
|
|
1448
1448
|
const e = t === f.Local ? window.localStorage : window.sessionStorage;
|
|
1449
|
-
return
|
|
1449
|
+
return A(e)(() => vt(i, e));
|
|
1450
1450
|
}, bs = (i, t, e) => {
|
|
1451
1451
|
const s = t === f.Local ? window.localStorage : window.sessionStorage;
|
|
1452
|
-
return
|
|
1452
|
+
return A(s)(() => qt(i, s, e));
|
|
1453
1453
|
};
|
|
1454
1454
|
let gt = class {
|
|
1455
1455
|
constructor() {
|
|
@@ -1460,7 +1460,7 @@ let gt = class {
|
|
|
1460
1460
|
};
|
|
1461
1461
|
}
|
|
1462
1462
|
async setItem(t, e, s = {}) {
|
|
1463
|
-
return
|
|
1463
|
+
return A(this)(() => {
|
|
1464
1464
|
const n = pt(this.memory, [
|
|
1465
1465
|
m.Necessary
|
|
1466
1466
|
]), { scope: r = q.Tenant, expiration: o } = s;
|
|
@@ -1478,7 +1478,7 @@ let gt = class {
|
|
|
1478
1478
|
});
|
|
1479
1479
|
}
|
|
1480
1480
|
async getItem(t) {
|
|
1481
|
-
return
|
|
1481
|
+
return A(this)(() => {
|
|
1482
1482
|
const e = pt(this.memory, [
|
|
1483
1483
|
m.Necessary
|
|
1484
1484
|
]);
|
|
@@ -1492,7 +1492,7 @@ let gt = class {
|
|
|
1492
1492
|
});
|
|
1493
1493
|
}
|
|
1494
1494
|
async removeItem(t) {
|
|
1495
|
-
return
|
|
1495
|
+
return A(this)(() => {
|
|
1496
1496
|
const e = pt(this.memory, [
|
|
1497
1497
|
m.Necessary
|
|
1498
1498
|
]);
|
|
@@ -1579,7 +1579,7 @@ const $s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1579
1579
|
document.removeEventListener("keydown", e), document.removeEventListener("click", s);
|
|
1580
1580
|
};
|
|
1581
1581
|
};
|
|
1582
|
-
function
|
|
1582
|
+
function xs(i, t) {
|
|
1583
1583
|
const {
|
|
1584
1584
|
// symbol,
|
|
1585
1585
|
widgetName: e,
|
|
@@ -1589,7 +1589,7 @@ function As(i, t) {
|
|
|
1589
1589
|
} = t;
|
|
1590
1590
|
return i.classList.add("ace-widget-trigger"), i.classList.add(`ace-widget_${e}`), s.length && i.classList.add("trigger-has-text"), n.length && !i.getAttribute("aria-label") && i.setAttribute("aria-label", n), n.length && !i.getAttribute("tabindex") && i.setAttribute("tabindex", "0"), r.length && !i.getAttribute("title") && i.setAttribute("title", r), _s(i);
|
|
1591
1591
|
}
|
|
1592
|
-
function
|
|
1592
|
+
function As(i, t) {
|
|
1593
1593
|
i instanceof HTMLElement ? (t && i.setAttribute("title", t), i.classList.remove("ace-trigger-active"), i.classList.remove("ace-trigger-loading")) : i instanceof Array && i.forEach((e) => {
|
|
1594
1594
|
t && e.setAttribute("title", t), e.classList.remove("ace-trigger-active"), e.classList.remove("ace-trigger-loading");
|
|
1595
1595
|
});
|
|
@@ -2504,7 +2504,7 @@ class si {
|
|
|
2504
2504
|
*/
|
|
2505
2505
|
render() {
|
|
2506
2506
|
const { widgetDOMElement: t, triggerDOMElement: e } = this.options, s = this.container.get("$widget");
|
|
2507
|
-
return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === U.Badge && Es(e), import("./render-
|
|
2507
|
+
return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === U.Badge && Es(e), import("./render-eH_r3UNl.mjs").then((n) => n.default(this.container, t)).then(() => {
|
|
2508
2508
|
if (t.setAttribute("data-rendered", "true"), e && this.options.triggerType === U.Badge) {
|
|
2509
2509
|
const r = this.options.triggerOptions.openTooltip;
|
|
2510
2510
|
De(e, r);
|
|
@@ -2531,7 +2531,7 @@ class si {
|
|
|
2531
2531
|
e.getAttribute("role") || e.setAttribute("role", "button");
|
|
2532
2532
|
const { name: s } = this.container.get("$widget"), { label: n, symbol: r, ariaLabel: o, closedTooltip: a, openTooltip: h } = t, c = { closedTooltip: a, openTooltip: h };
|
|
2533
2533
|
this.options.triggerOptions = c;
|
|
2534
|
-
const l =
|
|
2534
|
+
const l = xs(e, {
|
|
2535
2535
|
label: n,
|
|
2536
2536
|
ariaLabel: o,
|
|
2537
2537
|
widgetName: s,
|
|
@@ -2574,7 +2574,7 @@ class se {
|
|
|
2574
2574
|
);
|
|
2575
2575
|
}
|
|
2576
2576
|
write(t, e, s, n) {
|
|
2577
|
-
return
|
|
2577
|
+
return A(this)(() => C(
|
|
2578
2578
|
this.container,
|
|
2579
2579
|
dt,
|
|
2580
2580
|
f.Local
|
|
@@ -2588,7 +2588,7 @@ class se {
|
|
|
2588
2588
|
}));
|
|
2589
2589
|
}
|
|
2590
2590
|
remove(t) {
|
|
2591
|
-
return
|
|
2591
|
+
return A(this)(() => C(
|
|
2592
2592
|
this.container,
|
|
2593
2593
|
dt,
|
|
2594
2594
|
f.Local
|
|
@@ -2599,7 +2599,7 @@ class se {
|
|
|
2599
2599
|
}));
|
|
2600
2600
|
}
|
|
2601
2601
|
load(t) {
|
|
2602
|
-
return
|
|
2602
|
+
return A(this)(() => C(
|
|
2603
2603
|
this.container,
|
|
2604
2604
|
dt,
|
|
2605
2605
|
f.Local
|
|
@@ -2627,7 +2627,7 @@ const ni = (i) => {
|
|
|
2627
2627
|
return i.events.subscribe(
|
|
2628
2628
|
"widget:state-change",
|
|
2629
2629
|
(a, h) => {
|
|
2630
|
-
h.state ===
|
|
2630
|
+
h.state === Ae.Deactivating && o();
|
|
2631
2631
|
}
|
|
2632
2632
|
), r;
|
|
2633
2633
|
}
|
|
@@ -2706,20 +2706,20 @@ class Ui extends Ze {
|
|
|
2706
2706
|
);
|
|
2707
2707
|
this.outlets.size < 1 && !o && this.setRenderState("unset");
|
|
2708
2708
|
const l = () => {
|
|
2709
|
-
const g = () => b.querySelectorAll("[data-loading=true]").length === 0, [b] = this.widget.container.get("widgetDOMElements"),
|
|
2709
|
+
const g = () => b.querySelectorAll("[data-loading=true]").length === 0, [b] = this.widget.container.get("widgetDOMElements"), x = (Pt, w) => {
|
|
2710
2710
|
g() && (c.callback && c.callback(), w.disconnect());
|
|
2711
2711
|
}, at = {
|
|
2712
2712
|
attributes: !0,
|
|
2713
2713
|
subtree: !0,
|
|
2714
2714
|
childList: !0
|
|
2715
2715
|
};
|
|
2716
|
-
g() && c.callback && c.callback(), new MutationObserver(
|
|
2716
|
+
g() && c.callback && c.callback(), new MutationObserver(x).observe(b, at);
|
|
2717
2717
|
};
|
|
2718
2718
|
h && this.widget.container.getAsync("dataClient").then(({ events: g }) => {
|
|
2719
2719
|
g.subscribe(
|
|
2720
2720
|
"data-client:fetched",
|
|
2721
|
-
(b,
|
|
2722
|
-
|
|
2721
|
+
(b, x) => {
|
|
2722
|
+
x.unresolvedQueries === 0 && l();
|
|
2723
2723
|
}
|
|
2724
2724
|
);
|
|
2725
2725
|
});
|
|
@@ -2731,7 +2731,7 @@ class Ui extends Ze {
|
|
|
2731
2731
|
"click",
|
|
2732
2732
|
(g) => {
|
|
2733
2733
|
g.preventDefault(), this.container.get("settings").then(({ trigger: b }) => {
|
|
2734
|
-
d.render().then(() => this.renderState()).then((
|
|
2734
|
+
d.render().then(() => this.renderState()).then((x) => b && b.action && b.action === "hide" ? x === _.open ? this.hide() : this.open() : x === _.open ? this.close() : this.open());
|
|
2735
2735
|
});
|
|
2736
2736
|
}
|
|
2737
2737
|
)), this.outlets.size > 1)
|
|
@@ -2938,7 +2938,7 @@ class Ui extends Ze {
|
|
|
2938
2938
|
const {
|
|
2939
2939
|
options: { triggerDOMElement: s, triggerOptions: n }
|
|
2940
2940
|
} = e, { openTooltip: r, closedTooltip: o } = n || {};
|
|
2941
|
-
s && (t ? De(s, r) :
|
|
2941
|
+
s && (t ? De(s, r) : As(s, o));
|
|
2942
2942
|
});
|
|
2943
2943
|
}
|
|
2944
2944
|
deactivate() {
|
|
@@ -2965,8 +2965,8 @@ class Ui extends Ze {
|
|
|
2965
2965
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2966
2966
|
*/
|
|
2967
2967
|
let He = class extends Event {
|
|
2968
|
-
constructor(t, e, s) {
|
|
2969
|
-
super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.
|
|
2968
|
+
constructor(t, e, s, n) {
|
|
2969
|
+
super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.contextTarget = e, this.callback = s, this.subscribe = n ?? !1;
|
|
2970
2970
|
}
|
|
2971
2971
|
};
|
|
2972
2972
|
/**
|
|
@@ -2996,7 +2996,7 @@ let we = class {
|
|
|
2996
2996
|
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
2997
2997
|
}
|
|
2998
2998
|
dispatchRequest() {
|
|
2999
|
-
this.host.dispatchEvent(new He(this.context, this.t, this.subscribe));
|
|
2999
|
+
this.host.dispatchEvent(new He(this.context, this.host, this.t, this.subscribe));
|
|
3000
3000
|
}
|
|
3001
3001
|
};
|
|
3002
3002
|
/**
|
|
@@ -3038,21 +3038,21 @@ class hi {
|
|
|
3038
3038
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
3039
3039
|
*/
|
|
3040
3040
|
class li extends Event {
|
|
3041
|
-
constructor(t) {
|
|
3042
|
-
super("context-provider", { bubbles: !0, composed: !0 }), this.context = t;
|
|
3041
|
+
constructor(t, e) {
|
|
3042
|
+
super("context-provider", { bubbles: !0, composed: !0 }), this.context = t, this.contextTarget = e;
|
|
3043
3043
|
}
|
|
3044
3044
|
}
|
|
3045
3045
|
class F extends hi {
|
|
3046
3046
|
constructor(t, e, s) {
|
|
3047
3047
|
var n, r;
|
|
3048
3048
|
super(e.context !== void 0 ? e.initialValue : s), this.onContextRequest = (o) => {
|
|
3049
|
-
|
|
3050
|
-
|
|
3049
|
+
if (o.context !== this.context) return;
|
|
3050
|
+
const a = o.contextTarget ?? o.composedPath()[0];
|
|
3051
|
+
a !== this.host && (o.stopPropagation(), this.addCallback(o.callback, a, o.subscribe));
|
|
3051
3052
|
}, this.onProviderRequest = (o) => {
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
const h
|
|
3055
|
-
for (const [c, { consumerHost: l }] of this.subscriptions) h.has(c) || (h.add(c), l.dispatchEvent(new He(this.context, c, !0)));
|
|
3053
|
+
if (o.context !== this.context || (o.contextTarget ?? o.composedPath()[0]) === this.host) return;
|
|
3054
|
+
const a = /* @__PURE__ */ new Set();
|
|
3055
|
+
for (const [h, { consumerHost: c }] of this.subscriptions) a.has(h) || (a.add(h), c.dispatchEvent(new He(this.context, c, h, !0)));
|
|
3056
3056
|
o.stopPropagation();
|
|
3057
3057
|
}, this.host = t, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), (r = (n = this.host).addController) == null || r.call(n, this);
|
|
3058
3058
|
}
|
|
@@ -3060,7 +3060,7 @@ class F extends hi {
|
|
|
3060
3060
|
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
3061
3061
|
}
|
|
3062
3062
|
hostConnected() {
|
|
3063
|
-
this.host.dispatchEvent(new li(this.context));
|
|
3063
|
+
this.host.dispatchEvent(new li(this.context, this.host));
|
|
3064
3064
|
}
|
|
3065
3065
|
}
|
|
3066
3066
|
/**
|
|
@@ -3178,16 +3178,16 @@ const zi = async (i) => {
|
|
|
3178
3178
|
return Object.keys(i).forEach((e) => {
|
|
3179
3179
|
e.indexOf("css-") > -1 && (t[e] = i[e]);
|
|
3180
3180
|
}), t;
|
|
3181
|
-
},
|
|
3181
|
+
}, xi = (i, t) => {
|
|
3182
3182
|
const e = _i(t);
|
|
3183
3183
|
Object.entries(e).forEach(([s, n]) => {
|
|
3184
3184
|
i.style.setProperty(s.replace("css-", ""), n);
|
|
3185
3185
|
});
|
|
3186
3186
|
};
|
|
3187
|
-
var
|
|
3187
|
+
var Ai = Object.defineProperty, I = (i, t, e, s) => {
|
|
3188
3188
|
for (var n = void 0, r = i.length - 1, o; r >= 0; r--)
|
|
3189
3189
|
(o = i[r]) && (n = o(t, e, n) || n);
|
|
3190
|
-
return n &&
|
|
3190
|
+
return n && Ai(t, e, n), n;
|
|
3191
3191
|
};
|
|
3192
3192
|
const Wi = (i) => {
|
|
3193
3193
|
const e = class e extends i {
|
|
@@ -3244,7 +3244,7 @@ const Wi = (i) => {
|
|
|
3244
3244
|
this.container && this.actions.setContainer(this.container), this.renderRoot.host.style.setProperty(
|
|
3245
3245
|
"--width",
|
|
3246
3246
|
this.layout.size === "full" ? "var(--columns, 1)" : `min(${this.layout.size || "var(--columns)"}, var(--columns))`
|
|
3247
|
-
),
|
|
3247
|
+
), xi(this.renderRoot.host, this.properties);
|
|
3248
3248
|
}
|
|
3249
3249
|
_setProperties(n) {
|
|
3250
3250
|
this._propertiesProvider.setValue(n), this.properties = n;
|
|
@@ -3306,7 +3306,7 @@ export {
|
|
|
3306
3306
|
Ie as d,
|
|
3307
3307
|
Ks as e,
|
|
3308
3308
|
k as f,
|
|
3309
|
-
|
|
3309
|
+
xi as g,
|
|
3310
3310
|
Ui as h,
|
|
3311
3311
|
Gs as i,
|
|
3312
3312
|
ui as j,
|
|
@@ -159,11 +159,11 @@
|
|
|
159
159
|
align-items: center;
|
|
160
160
|
fill: var(--trigger-text-color, var(--text-on-primary-background));
|
|
161
161
|
}
|
|
162
|
-
`];let L=ne;at([J({attribute:!1})],L.prototype,"symbol");at([J({attribute:!1})],L.prototype,"container");at([C()],L.prototype,"active");at([C()],L.prototype,"loaded");at([C()],L.prototype,"icon");var j=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(j||{});const ci=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",We=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",hi=async(i,t,e,s,n,r=!1)=>{var l,d;const o=ci(e,s),a=We(n),h={widgetDOMElement:e?e.cloneNode(!0):void 0,triggerDOMElement:s?s.cloneNode(!0):void 0},c={triggerType:a,cachedOriginals:h,widgetDOMElement:document.createElement("div")};switch(o){case"both":{c.widgetDOMElement=e||document.createElement("div"),a!=="inline"&&(c.triggerDOMElement=s);break}case"widgetDOM":{if(c.widgetDOMElement=e||document.createElement("div"),a!=="inline"){const u=document.body.appendChild(document.createElement("a"));a==="link"&&(u.innerText=t),c.triggerDOMElement=u}break}case"triggerDOM":{const u=document.createElement("div");c.widgetDOMElement=u,a==="inline"?(u.id=(s==null?void 0:s.id)||"",r?(u.style.display="none",(l=s==null?void 0:s.parentNode)==null||l.appendChild(u),c.callback=()=>{var p;(p=s==null?void 0:s.parentNode)==null||p.replaceChild(u,s),u.style.display=(s==null?void 0:s.style.display)||"block"}):(d=s==null?void 0:s.parentNode)==null||d.replaceChild(u,s),c.cachedOriginals.widgetDOMElement=s,c.cachedOriginals.triggerDOMElement=void 0):(c.widgetDOMElement=document.body.appendChild(u),c.triggerDOMElement=s);break}case"none":{const u=document.body.appendChild(document.createElement("div"));if(c.widgetDOMElement=u,a!=="inline"){customElements.get("ace-widget-trigger")||customElements.define("ace-widget-trigger",L);const p=document.createElement("ace-widget-trigger");p.symbol=n.symbol,p.container=i,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},li="modals";class di{constructor(t,e){this.options=e,this.unsubscribe=[],this.container=t.createChild(this),this.container.register("widgetDOMElement",this.options.widgetDOMElement),this.container.register("triggerDOMElement",this.options.triggerDOMElement);const s=this.container.get("$widget");this.options.widgetDOMElement.classList.add("ace-widget"),this.options.widgetDOMElement.classList.add(`ace-widget_${s.name}`);const n=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...n,this.options.widgetDOMElement])}render(){const{widgetDOMElement:t,triggerDOMElement:e}=this.options,s=this.container.get("$widget");return t.getAttribute("data-rendered")==="true"?Promise.resolve():(e&&this.options.triggerType===j.Badge&&Us(e),Promise.resolve().then(()=>require("./render-BWvHPAsL.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===j.Badge){const r=this.options.triggerOptions.openTooltip;Le(e,r)}ps(this.container,t);const n=this.container.get("$environment").widgets.all();O(this.container,li,f.Session).then(r=>{r&&r.forEach(o=>{n.find(a=>a.name===o.name&&a.state==="activated")&&s.events.dispatch("widget:modal-opened",o)})})}))}renderBadge(t){const{triggerDOMElement:e}=this.options;if(!e)return;e.getAttribute("role")||e.setAttribute("role","button");const{name:s}=this.container.get("$widget"),{label:n,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=Rs(e,{label:n,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,n,r,o;const{triggerDOMElement:t,widgetDOMElement:e}=this.options;this.options.cachedOriginals.widgetDOMElement&&e&&((s=e.parentNode)==null||s.replaceChild(this.options.cachedOriginals.widgetDOMElement,e)),this.options.cachedOriginals.triggerDOMElement&&t&&((n=t.parentNode)==null||n.replaceChild(this.options.cachedOriginals.triggerDOMElement,t)),this.unsubscribe.forEach(a=>{a()}),(r=e.parentNode)==null||r.removeChild(e),(o=t==null?void 0:t.parentNode)==null||o.removeChild(t)}}const dt="changesets",ui=i=>{const t={tags:i.tags};return i.context&&typeof i.context!="function"&&(t.context=i.context),i.properties&&typeof i.properties!="function"&&(t.properties=i.properties),i.layout&&typeof i.layout!="function"&&(t.layout=i.layout),t};class ie{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,dt,m.Necessary,{medium:f.Local}).then(e=>new ie(t,e))}write(t,e,s,n){return A(this)(()=>O(this.container,dt,f.Local).then((r={})=>{const{keys:o=[],items:a={}}=r,h=o.indexOf(t);return h>-1&&o.splice(h,1),o.push(t),a[t]={options:n,attributes:ui(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,dt,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete n[t],this.storageWriter(e)}))}load(t){return A(this)(()=>O(this.container,dt,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e;s.forEach(r=>{const o=n[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new F(t,a)})}})}))}}const pi=i=>{const{container:t}=i;return ie.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new K(i,n),o=ke(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Ee.Deactivating&&o()}),r})},gi=i=>Promise.resolve().then(()=>Ls).then(({StorageProvider:t})=>new t),mi=i=>Promise.resolve().then(()=>Kt).then(({ActionResolver:t})=>new t(i)),fi=i=>Promise.resolve().then(()=>Kt).then(({ComponentResolver:t})=>new t(i)),yi=i=>Promise.resolve().then(()=>Kt).then(()=>pi(i.get("$widget"))),Ht="$settings",zt="open",we="activeStickyWidget";class vi extends ls{constructor(t){super(t),this.outlets=new Map,this.activated=void 0,this.subs=[],this.handleBootstrapping=e=>{const s={triggerDOMElement:e.sourceDOMElement,withRenderState:"storage"};this.container.get("settings").then(n=>{const{activate:r}=n;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>gi(this.container)),this.container.registerFactory("settings",()=>O(this.container,Ht,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),os(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>fi(this.container)),this.container.registerAsync("actionResolver",()=>mi(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>yi(this.container))}initialize(){const t=this.container.getManyAsync("actionResolver","components"),e=this.container.get("csp");return e&&(window.webprovisionsEnvironmentVariables||(window.webprovisionsEnvironmentVariables={}),window.webprovisionsEnvironmentVariables.cspNonce=e.nonce),Promise.all([t,this.container.get("settings")]).then(([{actionResolver:s,components:n},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{n.nodes.query({type:"view"}).forEach(c=>{n.setSwitch(c,h)})})("index"),this.events.subscribe("widget:data-loaded",(h,{element:c})=>{this.widget.container.get("seoConfiguration")&&this.events.dispatch("widget:preloaded-replaced",{element:c})}),Promise.resolve()))}attach(t={}){return this.container.get("settings").then(async({trigger:e})=>{var u,p;const{widgetDOMElement:s,key:n=rt(),triggerDOMElement:r,withRenderState:o}=t,h=We(e)===j.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await hi(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>b.querySelectorAll("[data-loading=true]").length===0,[b]=this.widget.container.get("widgetDOMElements"),x=(Pt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},ct={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(b,ct)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(b,x)=>{x.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(n,c);if(this.outlets.set(n,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===j.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==j.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:b})=>{d.render().then(()=>this.renderState()).then(x=>b&&b.action&&b.action==="hide"?x===w.open?this.hide():this.open():x===w.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(g=>{this.triggerStateIfApplicable(g)});if(o)return o==="storage"?this.renderState().then(g=>{if(c.triggerType===j.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(g)}):this.triggerStateIfApplicable(o)})}detach(t){if(t){if(this.outlets.has(t)){const e=this.outlets.get(t);e==null||e.dispose(),this.outlets.delete(t);return}process.env.NODE_ENV!=="production"&&console.warn(`detach(): Could not find View Outlet with key ${t}`);return}this.outlets.forEach(e=>{e.dispose()}),this.outlets.clear()}triggerStateIfApplicable(t){switch(t){case"closed":this.close();break;case"open":this.open();break;case"hidden":this.hide();break;default:return}}getOrCreateViewOutlet(t,e){return this.outlets.has(t)?this.outlets.get(t):new di(this.container,e)}render(t={}){if(process.env.NODE_ENV!=="production"&&console.warn("widget.render() is deprecated. Use widget.attach() instead."),t.open){const e={...t,withRenderState:"open"};return this.attach(e)}return this.attach(t)}activate(t){t!=null&&t.override&&this.setSettings(()=>t.override),t!=null&&t.apiNotificationPriorityBy&&this.container.register("apiNotificationPriorityBy",t.apiNotificationPriorityBy)}setSettings(t){return Promise.all([this.container.get("settings"),P(this.container,Ht,m.Necessary,{medium:f.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(n=>s(n).then(()=>{const r={...e,...n};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return P(this.container,Ht,m.Necessary,{medium:f.Local}).then(t=>t()).then(()=>this.container.get("settings")).then(t=>{this.widget.events.dispatch("widget:settings-updated",t)})}action({action:t,value:e}){return this.container.getAsync("actionResolver").then(s=>{s.action(this.widget.name,t,e)})}renderState(){return O(this.container,zt,f.Session).then((e=w.closed)=>e)}hide(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"hide"}).then(()=>{this.setTriggerState(!1)}))}open(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"open"}).then(()=>(this.widget.events.dispatch("tracking:widget-rendered",{}),this.onOpen())))}close(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):this.action({action:"close"}).then(()=>this.onClose())}show(){return process.env.NODE_ENV!=="production"&&console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."),this.open()}onAction(t,e){switch(t){case"close":case"open":case"hide":const s=t==="open"?w.open:t==="close"?w.closed:w.hidden;return this.setRenderState(s).then(()=>{this.setTriggerState(s===w.open),s!==w.hidden?s===w.open?this.onOpen():this.onClose():this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([P(this.container,zt,m.Necessary,{medium:f.Session}),P(this.container,zt,m.Necessary,{medium:f.Local,duration:{minutes:5}}),e("renderState")]).then(([n,r,o])=>{t==="unset"||!t?(r(),n()):n(t),s.dispatch("widget:render-state-changed",{previous:o,next:t})})}onOpen(){return this.outlets.forEach(t=>{var e;return(e=t.options.triggerDOMElement)==null?void 0:e.setAttribute("aria-expanded","true")}),Promise.resolve()}onClose(){const t=this.container.getManyAsync("components");return this.container.get("settings").then(s=>{const{activate:n}=this.container.get("$settings");return s.activate!==n?this.setSettings(()=>Promise.resolve({activate:n})):Promise.resolve()}).then(()=>t).then(({components:s})=>{this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:n}}=e,{openTooltip:r,closedTooltip:o}=n||{};s&&(t?Le(s,r):Ts(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,we,f.Local).then(e=>e===this.widget.name?P(this.container,we,m.Necessary,{medium:f.Local,scope:G.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
|
|
162
|
+
`];let L=ne;at([J({attribute:!1})],L.prototype,"symbol");at([J({attribute:!1})],L.prototype,"container");at([C()],L.prototype,"active");at([C()],L.prototype,"loaded");at([C()],L.prototype,"icon");var j=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(j||{});const ci=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",We=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",hi=async(i,t,e,s,n,r=!1)=>{var l,d;const o=ci(e,s),a=We(n),h={widgetDOMElement:e?e.cloneNode(!0):void 0,triggerDOMElement:s?s.cloneNode(!0):void 0},c={triggerType:a,cachedOriginals:h,widgetDOMElement:document.createElement("div")};switch(o){case"both":{c.widgetDOMElement=e||document.createElement("div"),a!=="inline"&&(c.triggerDOMElement=s);break}case"widgetDOM":{if(c.widgetDOMElement=e||document.createElement("div"),a!=="inline"){const u=document.body.appendChild(document.createElement("a"));a==="link"&&(u.innerText=t),c.triggerDOMElement=u}break}case"triggerDOM":{const u=document.createElement("div");c.widgetDOMElement=u,a==="inline"?(u.id=(s==null?void 0:s.id)||"",r?(u.style.display="none",(l=s==null?void 0:s.parentNode)==null||l.appendChild(u),c.callback=()=>{var p;(p=s==null?void 0:s.parentNode)==null||p.replaceChild(u,s),u.style.display=(s==null?void 0:s.style.display)||"block"}):(d=s==null?void 0:s.parentNode)==null||d.replaceChild(u,s),c.cachedOriginals.widgetDOMElement=s,c.cachedOriginals.triggerDOMElement=void 0):(c.widgetDOMElement=document.body.appendChild(u),c.triggerDOMElement=s);break}case"none":{const u=document.body.appendChild(document.createElement("div"));if(c.widgetDOMElement=u,a!=="inline"){customElements.get("ace-widget-trigger")||customElements.define("ace-widget-trigger",L);const p=document.createElement("ace-widget-trigger");p.symbol=n.symbol,p.container=i,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},li="modals";class di{constructor(t,e){this.options=e,this.unsubscribe=[],this.container=t.createChild(this),this.container.register("widgetDOMElement",this.options.widgetDOMElement),this.container.register("triggerDOMElement",this.options.triggerDOMElement);const s=this.container.get("$widget");this.options.widgetDOMElement.classList.add("ace-widget"),this.options.widgetDOMElement.classList.add(`ace-widget_${s.name}`);const n=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...n,this.options.widgetDOMElement])}render(){const{widgetDOMElement:t,triggerDOMElement:e}=this.options,s=this.container.get("$widget");return t.getAttribute("data-rendered")==="true"?Promise.resolve():(e&&this.options.triggerType===j.Badge&&Us(e),Promise.resolve().then(()=>require("./render-DLEyw4or.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===j.Badge){const r=this.options.triggerOptions.openTooltip;Le(e,r)}ps(this.container,t);const n=this.container.get("$environment").widgets.all();O(this.container,li,f.Session).then(r=>{r&&r.forEach(o=>{n.find(a=>a.name===o.name&&a.state==="activated")&&s.events.dispatch("widget:modal-opened",o)})})}))}renderBadge(t){const{triggerDOMElement:e}=this.options;if(!e)return;e.getAttribute("role")||e.setAttribute("role","button");const{name:s}=this.container.get("$widget"),{label:n,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=Rs(e,{label:n,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,n,r,o;const{triggerDOMElement:t,widgetDOMElement:e}=this.options;this.options.cachedOriginals.widgetDOMElement&&e&&((s=e.parentNode)==null||s.replaceChild(this.options.cachedOriginals.widgetDOMElement,e)),this.options.cachedOriginals.triggerDOMElement&&t&&((n=t.parentNode)==null||n.replaceChild(this.options.cachedOriginals.triggerDOMElement,t)),this.unsubscribe.forEach(a=>{a()}),(r=e.parentNode)==null||r.removeChild(e),(o=t==null?void 0:t.parentNode)==null||o.removeChild(t)}}const dt="changesets",ui=i=>{const t={tags:i.tags};return i.context&&typeof i.context!="function"&&(t.context=i.context),i.properties&&typeof i.properties!="function"&&(t.properties=i.properties),i.layout&&typeof i.layout!="function"&&(t.layout=i.layout),t};class ie{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,dt,m.Necessary,{medium:f.Local}).then(e=>new ie(t,e))}write(t,e,s,n){return A(this)(()=>O(this.container,dt,f.Local).then((r={})=>{const{keys:o=[],items:a={}}=r,h=o.indexOf(t);return h>-1&&o.splice(h,1),o.push(t),a[t]={options:n,attributes:ui(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,dt,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete n[t],this.storageWriter(e)}))}load(t){return A(this)(()=>O(this.container,dt,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e;s.forEach(r=>{const o=n[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new F(t,a)})}})}))}}const pi=i=>{const{container:t}=i;return ie.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new K(i,n),o=ke(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Ee.Deactivating&&o()}),r})},gi=i=>Promise.resolve().then(()=>Ls).then(({StorageProvider:t})=>new t),mi=i=>Promise.resolve().then(()=>Kt).then(({ActionResolver:t})=>new t(i)),fi=i=>Promise.resolve().then(()=>Kt).then(({ComponentResolver:t})=>new t(i)),yi=i=>Promise.resolve().then(()=>Kt).then(()=>pi(i.get("$widget"))),Ht="$settings",zt="open",we="activeStickyWidget";class vi extends ls{constructor(t){super(t),this.outlets=new Map,this.activated=void 0,this.subs=[],this.handleBootstrapping=e=>{const s={triggerDOMElement:e.sourceDOMElement,withRenderState:"storage"};this.container.get("settings").then(n=>{const{activate:r}=n;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>gi(this.container)),this.container.registerFactory("settings",()=>O(this.container,Ht,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),os(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>fi(this.container)),this.container.registerAsync("actionResolver",()=>mi(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>yi(this.container))}initialize(){const t=this.container.getManyAsync("actionResolver","components"),e=this.container.get("csp");return e&&(window.webprovisionsEnvironmentVariables||(window.webprovisionsEnvironmentVariables={}),window.webprovisionsEnvironmentVariables.cspNonce=e.nonce),Promise.all([t,this.container.get("settings")]).then(([{actionResolver:s,components:n},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{n.nodes.query({type:"view"}).forEach(c=>{n.setSwitch(c,h)})})("index"),this.events.subscribe("widget:data-loaded",(h,{element:c})=>{this.widget.container.get("seoConfiguration")&&this.events.dispatch("widget:preloaded-replaced",{element:c})}),Promise.resolve()))}attach(t={}){return this.container.get("settings").then(async({trigger:e})=>{var u,p;const{widgetDOMElement:s,key:n=rt(),triggerDOMElement:r,withRenderState:o}=t,h=We(e)===j.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await hi(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>b.querySelectorAll("[data-loading=true]").length===0,[b]=this.widget.container.get("widgetDOMElements"),x=(Pt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},ct={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(b,ct)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(b,x)=>{x.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(n,c);if(this.outlets.set(n,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===j.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==j.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:b})=>{d.render().then(()=>this.renderState()).then(x=>b&&b.action&&b.action==="hide"?x===w.open?this.hide():this.open():x===w.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(g=>{this.triggerStateIfApplicable(g)});if(o)return o==="storage"?this.renderState().then(g=>{if(c.triggerType===j.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(g)}):this.triggerStateIfApplicable(o)})}detach(t){if(t){if(this.outlets.has(t)){const e=this.outlets.get(t);e==null||e.dispose(),this.outlets.delete(t);return}process.env.NODE_ENV!=="production"&&console.warn(`detach(): Could not find View Outlet with key ${t}`);return}this.outlets.forEach(e=>{e.dispose()}),this.outlets.clear()}triggerStateIfApplicable(t){switch(t){case"closed":this.close();break;case"open":this.open();break;case"hidden":this.hide();break;default:return}}getOrCreateViewOutlet(t,e){return this.outlets.has(t)?this.outlets.get(t):new di(this.container,e)}render(t={}){if(process.env.NODE_ENV!=="production"&&console.warn("widget.render() is deprecated. Use widget.attach() instead."),t.open){const e={...t,withRenderState:"open"};return this.attach(e)}return this.attach(t)}activate(t){t!=null&&t.override&&this.setSettings(()=>t.override),t!=null&&t.apiNotificationPriorityBy&&this.container.register("apiNotificationPriorityBy",t.apiNotificationPriorityBy)}setSettings(t){return Promise.all([this.container.get("settings"),P(this.container,Ht,m.Necessary,{medium:f.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(n=>s(n).then(()=>{const r={...e,...n};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return P(this.container,Ht,m.Necessary,{medium:f.Local}).then(t=>t()).then(()=>this.container.get("settings")).then(t=>{this.widget.events.dispatch("widget:settings-updated",t)})}action({action:t,value:e}){return this.container.getAsync("actionResolver").then(s=>{s.action(this.widget.name,t,e)})}renderState(){return O(this.container,zt,f.Session).then((e=w.closed)=>e)}hide(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"hide"}).then(()=>{this.setTriggerState(!1)}))}open(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"open"}).then(()=>(this.widget.events.dispatch("tracking:widget-rendered",{}),this.onOpen())))}close(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):this.action({action:"close"}).then(()=>this.onClose())}show(){return process.env.NODE_ENV!=="production"&&console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."),this.open()}onAction(t,e){switch(t){case"close":case"open":case"hide":const s=t==="open"?w.open:t==="close"?w.closed:w.hidden;return this.setRenderState(s).then(()=>{this.setTriggerState(s===w.open),s!==w.hidden?s===w.open?this.onOpen():this.onClose():this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([P(this.container,zt,m.Necessary,{medium:f.Session}),P(this.container,zt,m.Necessary,{medium:f.Local,duration:{minutes:5}}),e("renderState")]).then(([n,r,o])=>{t==="unset"||!t?(r(),n()):n(t),s.dispatch("widget:render-state-changed",{previous:o,next:t})})}onOpen(){return this.outlets.forEach(t=>{var e;return(e=t.options.triggerDOMElement)==null?void 0:e.setAttribute("aria-expanded","true")}),Promise.resolve()}onClose(){const t=this.container.getManyAsync("components");return this.container.get("settings").then(s=>{const{activate:n}=this.container.get("$settings");return s.activate!==n?this.setSettings(()=>Promise.resolve({activate:n})):Promise.resolve()}).then(()=>t).then(({components:s})=>{this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:n}}=e,{openTooltip:r,closedTooltip:o}=n||{};s&&(t?Le(s,r):Ts(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,we,f.Local).then(e=>e===this.widget.name?P(this.container,we,m.Necessary,{medium:f.Local,scope:G.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
|
|
163
163
|
* @license
|
|
164
164
|
* Copyright 2021 Google LLC
|
|
165
165
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
166
|
-
*/let qe=class extends Event{constructor(t,e,s){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.
|
|
166
|
+
*/let qe=class extends Event{constructor(t,e,s,n){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=s,this.subscribe=n??!1}};/**
|
|
167
167
|
* @license
|
|
168
168
|
* Copyright 2021 Google LLC
|
|
169
169
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
* @license
|
|
172
172
|
* Copyright 2021 Google LLC
|
|
173
173
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
174
|
-
*/let $e=class{constructor(t,e,s,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const r=e;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new qe(this.context,this.t,this.subscribe))}};/**
|
|
174
|
+
*/let $e=class{constructor(t,e,s,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const r=e;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new qe(this.context,this.host,this.t,this.subscribe))}};/**
|
|
175
175
|
* @license
|
|
176
176
|
* Copyright 2021 Google LLC
|
|
177
177
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
* @license
|
|
180
180
|
* Copyright 2021 Google LLC
|
|
181
181
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
182
|
-
*/class wi extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}}class z extends bi{constructor(t,e,s){var n,r;super(e.context!==void 0?e.initialValue:s),this.onContextRequest=o=>{const a=o.composedPath()[0];
|
|
182
|
+
*/class wi extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}}class z extends bi{constructor(t,e,s){var n,r;super(e.context!==void 0?e.initialValue:s),this.onContextRequest=o=>{if(o.context!==this.context)return;const a=o.contextTarget??o.composedPath()[0];a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{if(o.context!==this.context||(o.contextTarget??o.composedPath()[0])===this.host)return;const a=new Set;for(const[h,{consumerHost:c}]of this.subscriptions)a.has(h)||(a.add(h),c.dispatchEvent(new qe(this.context,c,h,!0)));o.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(r=(n=this.host).addController)==null||r.call(n,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new wi(this.context,this.host))}}/**
|
|
183
183
|
* @license
|
|
184
184
|
* Copyright 2022 Google LLC
|
|
185
185
|
* SPDX-License-Identifier: BSD-3-Clause
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-C4YLyWNb.js");exports.ActionsController=t.ActionsController;exports.DataProvider=t.DataProvider;exports.GridWidget=t.Widget;exports.GuideProviderPlugin=t.GuideProviderPlugin;exports.Widget=t.Widget;exports.WidgetComponent=t.WidgetComponent;exports.childrenContext=t.childrenContext;exports.containerContext=t.containerContext;exports.contextCtx=t.contextCtx;exports.createDataProvider=t.createDataProvider;exports.createWebComponent=t.createLitComponent;exports.descriptorContext=t.descriptorContext;exports.layoutCtx=t.layoutCtx;exports.propertiesCtx=t.propertiesCtx;
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as a, D as o, h as r, G as s, h as i, W as n, j as d, c as C, l as c, s as x, u as p, k as l, p as W, q as g } from "./index-
|
|
1
|
+
import { A as a, D as o, h as r, G as s, h as i, W as n, j as d, c as C, l as c, s as x, u as p, k as l, p as W, q as g } from "./index-B1Q3-FOo.mjs";
|
|
2
2
|
export {
|
|
3
3
|
a as ActionsController,
|
|
4
4
|
o as DataProvider,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-runtime-flamingo",
|
|
3
|
-
"version": "1.1.111
|
|
3
|
+
"version": "1.1.111",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@teliads/icons": "^8.4.0",
|
|
13
13
|
"@telia-ace/widget-core": "^1.0.27",
|
|
14
14
|
"@webprovisions/bootstrapping": "^1.0.13",
|
|
15
|
-
"@lit/context": "^1.
|
|
15
|
+
"@lit/context": "^1.1.4"
|
|
16
16
|
},
|
|
17
17
|
"main": "./index.js",
|
|
18
18
|
"module": "./index.mjs",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-C4YLyWNb.js");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as L, t as D, e as A, E as b, r as P, a as z, c as E, b as M, m as N, o as f, x as g, d as R, n as T, f as u, T as w, W as j, g as W } from "./index-
|
|
1
|
+
import { i as L, t as D, e as A, E as b, r as P, a as z, c as E, b as M, m as N, o as f, x as g, d as R, n as T, f as u, T as w, W as j, g as W } from "./index-B1Q3-FOo.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|