@telia-ace/widget-runtime-flamingo 1.1.140-rc.1 → 1.1.140-rc.3
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.
- package/{index-DZER-AuM.mjs → index-BqoIt4Pd.mjs} +99 -103
- package/{index-C1sPcyp0.js → index-XZDlBrO0.js} +17 -17
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/{render-BfN1PL2V.mjs → render-BX1UUv22.mjs} +3 -3
- package/{render-DLT1GGkd.js → render-BrvK4n7z.js} +2 -2
|
@@ -19,7 +19,7 @@ const Dt = (i, t, e, ...s) => {
|
|
|
19
19
|
error: (e, ...s) => Dt(t, "error", e, ...s)
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var tt = /* @__PURE__ */ ((i) => (i.Implementation = "implementation", i.Widget = "widget", i))(tt || {}), N = /* @__PURE__ */ ((i) => (i.Pre = "pre", i.Post = "post", i))(N || {});
|
|
23
23
|
const Je = (i, t, e, s) => {
|
|
24
24
|
try {
|
|
25
25
|
const n = new t(e, s);
|
|
@@ -54,12 +54,12 @@ let Ke = class {
|
|
|
54
54
|
createCommand(t, e, s) {
|
|
55
55
|
let n;
|
|
56
56
|
typeof e == "function" ? n = {
|
|
57
|
-
scope:
|
|
57
|
+
scope: tt.Widget,
|
|
58
58
|
stage: N.Post,
|
|
59
59
|
defaultArgs: void 0,
|
|
60
60
|
handlerResolver: e
|
|
61
61
|
} : n = {
|
|
62
|
-
scope: oe(e.scope,
|
|
62
|
+
scope: oe(e.scope, tt.Widget),
|
|
63
63
|
stage: oe(e.stage, N.Post),
|
|
64
64
|
defaultArgs: e.defaultArgs,
|
|
65
65
|
handlerResolver: s
|
|
@@ -81,7 +81,7 @@ const Ce = (i) => {
|
|
|
81
81
|
Ce((i) => {
|
|
82
82
|
i.createCommand(
|
|
83
83
|
"types.register",
|
|
84
|
-
{ scope:
|
|
84
|
+
{ scope: tt.Implementation, stage: N.Pre },
|
|
85
85
|
(t) => (e, s) => {
|
|
86
86
|
t.container.get("$types")[e] = s;
|
|
87
87
|
}
|
|
@@ -193,7 +193,7 @@ function Ye(i, t, e) {
|
|
|
193
193
|
Ce((i) => {
|
|
194
194
|
i.createCommand(
|
|
195
195
|
"ready",
|
|
196
|
-
{ scope:
|
|
196
|
+
{ scope: tt.Implementation, stage: N.Pre },
|
|
197
197
|
(t) => (e) => {
|
|
198
198
|
const { container: s } = t, n = s.owner;
|
|
199
199
|
s.get("bootstrapping").ready ? e(n) : n.events.subscribeOnce("bootstrap:ready", () => {
|
|
@@ -223,7 +223,7 @@ const Lt = (i, t, e, ...s) => {
|
|
|
223
223
|
error: (e, ...s) => Lt(t, "error", e, ...s)
|
|
224
224
|
};
|
|
225
225
|
};
|
|
226
|
-
var
|
|
226
|
+
var bt = /* @__PURE__ */ ((i) => (i.Implementation = "implementation", i.Widget = "widget", i))(bt || {}), R = /* @__PURE__ */ ((i) => (i.Pre = "pre", i.Post = "post", i))(R || {});
|
|
227
227
|
const Qe = (i, t, e, s) => {
|
|
228
228
|
try {
|
|
229
229
|
const n = new t(e, s);
|
|
@@ -258,12 +258,12 @@ class Xe {
|
|
|
258
258
|
createCommand(t, e, s) {
|
|
259
259
|
let n;
|
|
260
260
|
typeof e == "function" ? n = {
|
|
261
|
-
scope:
|
|
261
|
+
scope: bt.Widget,
|
|
262
262
|
stage: R.Post,
|
|
263
263
|
defaultArgs: void 0,
|
|
264
264
|
handlerResolver: e
|
|
265
265
|
} : n = {
|
|
266
|
-
scope: ce(e.scope,
|
|
266
|
+
scope: ce(e.scope, bt.Widget),
|
|
267
267
|
stage: ce(e.stage, R.Post),
|
|
268
268
|
defaultArgs: e.defaultArgs,
|
|
269
269
|
handlerResolver: s
|
|
@@ -285,7 +285,7 @@ const Ft = (i) => {
|
|
|
285
285
|
Ft((i) => {
|
|
286
286
|
i.createCommand(
|
|
287
287
|
"types.register",
|
|
288
|
-
{ scope:
|
|
288
|
+
{ scope: bt.Implementation, stage: R.Pre },
|
|
289
289
|
(t) => (e, s) => {
|
|
290
290
|
t.container.get("$types")[e] = s;
|
|
291
291
|
}
|
|
@@ -373,19 +373,16 @@ class ts {
|
|
|
373
373
|
});
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
const
|
|
376
|
+
const lt = (i, t, ...e) => typeof t == "string" ? i(`[humany] ${t}`, ...e) : i(t, ...e), G = class Y {
|
|
377
377
|
constructor() {
|
|
378
|
-
this.keys = [], this.log = (t, ...e) => this.lookup(t, () =>
|
|
378
|
+
this.keys = [], this.log = (t, ...e) => this.lookup(t, () => Y.log(...e)), this.warn = (t, ...e) => this.lookup(t, () => Y.warn(...e)), this.error = (t, ...e) => this.lookup(t, () => Y.error(...e)), this.info = (t, ...e) => this.lookup(t, () => Y.info(...e));
|
|
379
379
|
}
|
|
380
380
|
lookup(t, e) {
|
|
381
381
|
this.keys.indexOf(t) === -1 && (this.keys.push(t), e());
|
|
382
382
|
}
|
|
383
383
|
};
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
nt.error = (...i) => At(console.error, ...i);
|
|
387
|
-
nt.info = (...i) => At(console.info, ...i);
|
|
388
|
-
let b = nt;
|
|
384
|
+
G.log = (...i) => lt(console.log, ...i), G.warn = (...i) => lt(console.warn, ...i), G.error = (...i) => lt(console.error, ...i), G.info = (...i) => lt(console.info, ...i);
|
|
385
|
+
let b = G;
|
|
389
386
|
const Se = (i) => {
|
|
390
387
|
let t = {}, e, s;
|
|
391
388
|
if (typeof i != "object" || i === null)
|
|
@@ -435,12 +432,12 @@ let es = class {
|
|
|
435
432
|
});
|
|
436
433
|
}
|
|
437
434
|
};
|
|
438
|
-
const
|
|
435
|
+
const dt = /* @__PURE__ */ new WeakMap();
|
|
439
436
|
function A(i, t = 5e3, e = 1e3) {
|
|
440
|
-
return
|
|
441
|
-
const o =
|
|
437
|
+
return dt.has(i) || dt.set(i, new es(t, e)), (s) => new Promise((n, r) => {
|
|
438
|
+
const o = dt.get(i);
|
|
442
439
|
o.add(s, n, r, () => {
|
|
443
|
-
o.tasks.length ||
|
|
440
|
+
o.tasks.length || dt.delete(i);
|
|
444
441
|
});
|
|
445
442
|
});
|
|
446
443
|
}
|
|
@@ -833,7 +830,7 @@ const ke = (i, t, e) => {
|
|
|
833
830
|
const s = t[i.id] || "default", n = i.children[s];
|
|
834
831
|
ke(n, t, e);
|
|
835
832
|
}
|
|
836
|
-
},
|
|
833
|
+
}, mt = (i, t) => {
|
|
837
834
|
const e = [];
|
|
838
835
|
return Ct(i, t, (s) => {
|
|
839
836
|
e.push(s);
|
|
@@ -850,18 +847,18 @@ class as {
|
|
|
850
847
|
this.root = t, this.switches = e, this.all = [], this.visible = [], this.detached = [], s.subscribe(
|
|
851
848
|
"components:node-appended",
|
|
852
849
|
(n, r) => {
|
|
853
|
-
this.all.push(r.node), this.visible =
|
|
850
|
+
this.all.push(r.node), this.visible = mt(t, e);
|
|
854
851
|
}
|
|
855
852
|
), s.subscribe(
|
|
856
853
|
"components:node-removed",
|
|
857
854
|
(n, r) => {
|
|
858
855
|
let o = this.all.indexOf(r.node);
|
|
859
|
-
o > -1 && this.all.splice(o, 1), o = this.visible.indexOf(r.node), o > -1 && this.visible.splice(o, 1), this.visible =
|
|
856
|
+
o > -1 && this.all.splice(o, 1), o = this.visible.indexOf(r.node), o > -1 && this.visible.splice(o, 1), this.visible = mt(t, e);
|
|
860
857
|
}
|
|
861
858
|
), s.subscribe(
|
|
862
859
|
"components:node-switched",
|
|
863
860
|
(n, r) => {
|
|
864
|
-
this.visible =
|
|
861
|
+
this.visible = mt(t, e);
|
|
865
862
|
}
|
|
866
863
|
);
|
|
867
864
|
}
|
|
@@ -894,8 +891,7 @@ const hs = (i) => {
|
|
|
894
891
|
}, ls = (i) => i.map(
|
|
895
892
|
([t, e]) => [hs(t), t, e]
|
|
896
893
|
).sort(([t], [e]) => t - e).map(([, t, e]) => [t, e]), It = (i) => i instanceof Date ? !1 : i && typeof i == "object" && !Array.isArray(i), E = (i, ...t) => {
|
|
897
|
-
if (!t.length)
|
|
898
|
-
return i;
|
|
894
|
+
if (!t.length) return i;
|
|
899
895
|
const e = t.shift();
|
|
900
896
|
if (It(i) && It(e))
|
|
901
897
|
for (const s in e)
|
|
@@ -1147,14 +1143,14 @@ const ps = (i) => {
|
|
|
1147
1143
|
definitionId: i,
|
|
1148
1144
|
overrides: []
|
|
1149
1145
|
};
|
|
1150
|
-
},
|
|
1146
|
+
}, wt = (i, t, e, s, n, r) => {
|
|
1151
1147
|
e.forEach((o) => {
|
|
1152
1148
|
const a = ps(o), h = s[a.definitionId];
|
|
1153
1149
|
if (a.definitionId === "view") {
|
|
1154
1150
|
const c = i.createNode("view");
|
|
1155
1151
|
c.name = "view", Object.keys(n).forEach((l) => {
|
|
1156
1152
|
const d = n[l];
|
|
1157
|
-
|
|
1153
|
+
wt(
|
|
1158
1154
|
i,
|
|
1159
1155
|
c,
|
|
1160
1156
|
[d.entry],
|
|
@@ -1193,7 +1189,7 @@ const ps = (i) => {
|
|
|
1193
1189
|
l.name = a.definitionId, l.tags = c.tags || [], c.properties && l.writeProperties(c.properties), c.context && l.writeContext(c.context), c.layout && l.writeLayout(c.layout), t.appendChild(l, r), a.overrides.forEach((d) => {
|
|
1194
1190
|
const u = { breakpoints: d.breakpoints };
|
|
1195
1191
|
d.properties && l.writeProperties(d.properties, u), d.context && l.writeContext(d.context, u), d.layout && l.writeLayout(d.layout, u);
|
|
1196
|
-
}), c.children &&
|
|
1192
|
+
}), c.children && wt(
|
|
1197
1193
|
i,
|
|
1198
1194
|
l,
|
|
1199
1195
|
c.children,
|
|
@@ -1211,7 +1207,7 @@ const ps = (i) => {
|
|
|
1211
1207
|
d.matches ? i.addBreakpoint(a) : i.removeBreakpoint(a);
|
|
1212
1208
|
};
|
|
1213
1209
|
c.addListener(l), o.push(() => c.removeListener(l));
|
|
1214
|
-
}),
|
|
1210
|
+
}), wt(i, i.nodes.root, [e], s, r), () => o.forEach((a) => {
|
|
1215
1211
|
a();
|
|
1216
1212
|
});
|
|
1217
1213
|
}, Jt = (i, t) => ({
|
|
@@ -1297,12 +1293,12 @@ const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1297
1293
|
ComponentResolver: gs,
|
|
1298
1294
|
WidgetRenderState: _,
|
|
1299
1295
|
asDescriptor: Jt,
|
|
1300
|
-
createChildren:
|
|
1296
|
+
createChildren: wt,
|
|
1301
1297
|
createComponentModel: Me,
|
|
1302
1298
|
createEventSubscriber: Pe,
|
|
1303
1299
|
extendComponent: De,
|
|
1304
1300
|
findComponent: Ne,
|
|
1305
|
-
findVisibleComponents:
|
|
1301
|
+
findVisibleComponents: mt,
|
|
1306
1302
|
traverseComponents: Ct
|
|
1307
1303
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1308
1304
|
var f = /* @__PURE__ */ ((i) => (i.Cookie = "cookie", i.Local = "local", i.Session = "session", i))(f || {}), J = /* @__PURE__ */ ((i) => (i.Tenant = "tenant", i.Implementation = "implementation", i.Widget = "widget", i))(J || {}), m = /* @__PURE__ */ ((i) => (i.Necessary = "necessary", i.Functional = "functional", i.Analytical = "analytical", i.Marketing = "marketing", i))(m || {});
|
|
@@ -1332,8 +1328,8 @@ const S = (i, t, e, s = {}) => le(i, e).then((n) => (process.env.NODE_ENV !== "p
|
|
|
1332
1328
|
"readStorage: Undefined key passed when reading storage. ",
|
|
1333
1329
|
t,
|
|
1334
1330
|
e
|
|
1335
|
-
), Promise.resolve(void 0)) : e === f.Cookie ? bs(i).then((s) =>
|
|
1336
|
-
(s) =>
|
|
1331
|
+
), Promise.resolve(void 0)) : e === f.Cookie ? bs(i).then((s) => _t(s, t)) : $s(i, e).then(
|
|
1332
|
+
(s) => _t(s, t)
|
|
1337
1333
|
)), B = (i) => !!Object.entries(i).filter(([t, e]) => typeof e < "u").length, Rt = (i) => Object.entries(i).filter(([t, e]) => typeof e < "u").forEach(([t, { value: e }]) => {
|
|
1338
1334
|
typeof e > "u" && delete i[t];
|
|
1339
1335
|
}), Le = (i, t) => {
|
|
@@ -1390,7 +1386,7 @@ const S = (i, t, e, s = {}) => le(i, e).then((n) => (process.env.NODE_ENV !== "p
|
|
|
1390
1386
|
c,
|
|
1391
1387
|
B(c) ? l : d
|
|
1392
1388
|
);
|
|
1393
|
-
},
|
|
1389
|
+
}, $t = (i, t) => {
|
|
1394
1390
|
const [e, s, n] = Ot(i), r = t.getItem(e) || "{}", o = t.getItem(s) || "{}", a = t.getItem(n) || "{}";
|
|
1395
1391
|
return {
|
|
1396
1392
|
tenant: JSON.parse(r),
|
|
@@ -1398,7 +1394,7 @@ const S = (i, t, e, s = {}) => le(i, e).then((n) => (process.env.NODE_ENV !== "p
|
|
|
1398
1394
|
widget: JSON.parse(a)
|
|
1399
1395
|
};
|
|
1400
1396
|
}, Kt = (i, t, e) => {
|
|
1401
|
-
const s =
|
|
1397
|
+
const s = $t(i, t), n = Le(s, e), [r, o, a] = Ot(i), { tenant: h, implementation: c, widget: l } = n;
|
|
1402
1398
|
B(h) ? t.setItem(r, JSON.stringify(h)) : t.removeItem(r), B(c) ? t.setItem(
|
|
1403
1399
|
o,
|
|
1404
1400
|
JSON.stringify(c)
|
|
@@ -1409,7 +1405,7 @@ const S = (i, t, e, s = {}) => le(i, e).then((n) => (process.env.NODE_ENV !== "p
|
|
|
1409
1405
|
tenant: {},
|
|
1410
1406
|
implementation: {},
|
|
1411
1407
|
widget: {}
|
|
1412
|
-
}), ys = (i) => i ? !!i && /* @__PURE__ */ new Date() > new Date(i) : !1,
|
|
1408
|
+
}), ys = (i) => i ? !!i && /* @__PURE__ */ new Date() > new Date(i) : !1, _t = (i, t) => {
|
|
1413
1409
|
const e = i.widget[t] || i.implementation[t] || i.tenant[t];
|
|
1414
1410
|
return e == null ? void 0 : e.value;
|
|
1415
1411
|
}, Qt = (i, t, e) => e ? {
|
|
@@ -1419,7 +1415,7 @@ const S = (i, t, e, s = {}) => le(i, e).then((n) => (process.env.NODE_ENV !== "p
|
|
|
1419
1415
|
} : {
|
|
1420
1416
|
value: i,
|
|
1421
1417
|
category: t
|
|
1422
|
-
},
|
|
1418
|
+
}, ft = (i, t) => {
|
|
1423
1419
|
const e = Se(i);
|
|
1424
1420
|
return Object.entries(e).forEach(([s, n]) => {
|
|
1425
1421
|
Object.entries(n).forEach(([r, o]) => {
|
|
@@ -1434,23 +1430,23 @@ const S = (i, t, e, s = {}) => le(i, e).then((n) => (process.env.NODE_ENV !== "p
|
|
|
1434
1430
|
).then(
|
|
1435
1431
|
(e = [m.Necessary]) => !!t && e.indexOf(t) === -1
|
|
1436
1432
|
), vs = (i = [m.Necessary], t) => !!t && i.indexOf(t) === -1, Xt = (i) => {
|
|
1437
|
-
const t = Zt(i), e =
|
|
1433
|
+
const t = Zt(i), e = $t(i, window.localStorage), s = $t(i, sessionStorage), n = _t(t, "storagePolicy"), [r, o, a] = [
|
|
1438
1434
|
t,
|
|
1439
1435
|
e,
|
|
1440
1436
|
s
|
|
1441
|
-
].map((h) =>
|
|
1437
|
+
].map((h) => ft(h, n));
|
|
1442
1438
|
Ie(i, r), Kt(i, window.localStorage, o), Kt(i, window.sessionStorage, a);
|
|
1443
1439
|
}, St = (i = { days: 30 }) => {
|
|
1444
1440
|
const { days: t = 0, hours: e = 0, minutes: s = 0, seconds: n = 0 } = i, r = /* @__PURE__ */ new Date();
|
|
1445
1441
|
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();
|
|
1446
1442
|
}, bs = (i) => A(document)(() => Zt(i)), ws = (i, t) => A(document)(() => Ie(i, t)), $s = (i, t) => {
|
|
1447
1443
|
const e = t === f.Local ? window.localStorage : window.sessionStorage;
|
|
1448
|
-
return A(e)(() =>
|
|
1444
|
+
return A(e)(() => $t(i, e));
|
|
1449
1445
|
}, _s = (i, t, e) => {
|
|
1450
1446
|
const s = t === f.Local ? window.localStorage : window.sessionStorage;
|
|
1451
1447
|
return A(s)(() => Kt(i, s, e));
|
|
1452
1448
|
};
|
|
1453
|
-
let
|
|
1449
|
+
let yt = class {
|
|
1454
1450
|
constructor() {
|
|
1455
1451
|
this.memory = {
|
|
1456
1452
|
tenant: {},
|
|
@@ -1460,7 +1456,7 @@ let ft = class {
|
|
|
1460
1456
|
}
|
|
1461
1457
|
async setItem(t, e, s = {}) {
|
|
1462
1458
|
return A(this)(() => {
|
|
1463
|
-
const n =
|
|
1459
|
+
const n = ft(this.memory, [
|
|
1464
1460
|
m.Necessary
|
|
1465
1461
|
]), { scope: r = J.Tenant, expiration: o } = s;
|
|
1466
1462
|
n[r][t] = Qt(
|
|
@@ -1478,7 +1474,7 @@ let ft = class {
|
|
|
1478
1474
|
}
|
|
1479
1475
|
async getItem(t) {
|
|
1480
1476
|
return A(this)(() => {
|
|
1481
|
-
const e =
|
|
1477
|
+
const e = ft(this.memory, [
|
|
1482
1478
|
m.Necessary
|
|
1483
1479
|
]);
|
|
1484
1480
|
process.env.NODE_ENV !== "production" && b.warn(
|
|
@@ -1486,13 +1482,13 @@ let ft = class {
|
|
|
1486
1482
|
Key: ${t}
|
|
1487
1483
|
Memory: ${JSON.stringify(e)}`
|
|
1488
1484
|
);
|
|
1489
|
-
const s =
|
|
1485
|
+
const s = _t(e, t);
|
|
1490
1486
|
return this.memory = e, s;
|
|
1491
1487
|
});
|
|
1492
1488
|
}
|
|
1493
1489
|
async removeItem(t) {
|
|
1494
1490
|
return A(this)(() => {
|
|
1495
|
-
const e =
|
|
1491
|
+
const e = ft(this.memory, [
|
|
1496
1492
|
m.Necessary
|
|
1497
1493
|
]);
|
|
1498
1494
|
delete e.tenant[t], delete e.implementation[t], delete e.widget[t], this.memory = e, process.env.NODE_ENV !== "production" && b.warn(
|
|
@@ -1507,7 +1503,7 @@ let ft = class {
|
|
|
1507
1503
|
}
|
|
1508
1504
|
}, xs = class {
|
|
1509
1505
|
constructor() {
|
|
1510
|
-
this.cookies = new
|
|
1506
|
+
this.cookies = new yt(), this.session = new yt(), this.local = new yt();
|
|
1511
1507
|
}
|
|
1512
1508
|
};
|
|
1513
1509
|
Ft((i) => {
|
|
@@ -1563,7 +1559,7 @@ const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1563
1559
|
StorageMedium: f,
|
|
1564
1560
|
StorageProvider: xs,
|
|
1565
1561
|
StorageScope: J,
|
|
1566
|
-
StorageService:
|
|
1562
|
+
StorageService: yt,
|
|
1567
1563
|
createStorageWriter: S,
|
|
1568
1564
|
readStorage: C
|
|
1569
1565
|
}, Symbol.toStringTag, { value: "Module" })), Es = (i) => {
|
|
@@ -1608,7 +1604,7 @@ function Re(i, t) {
|
|
|
1608
1604
|
* Copyright 2019 Google LLC
|
|
1609
1605
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1610
1606
|
*/
|
|
1611
|
-
const
|
|
1607
|
+
const vt = globalThis, te = vt.ShadowRoot && (vt.ShadyCSS === void 0 || vt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ee = Symbol(), de = /* @__PURE__ */ new WeakMap();
|
|
1612
1608
|
let Te = class {
|
|
1613
1609
|
constructor(t, e, s) {
|
|
1614
1610
|
if (this._$cssResult$ = !0, s !== ee) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -1637,7 +1633,7 @@ const Ps = (i) => new Te(typeof i == "string" ? i : i + "", void 0, ee), je = (i
|
|
|
1637
1633
|
}, ks = (i, t) => {
|
|
1638
1634
|
if (te) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
1639
1635
|
else for (const e of t) {
|
|
1640
|
-
const s = document.createElement("style"), n =
|
|
1636
|
+
const s = document.createElement("style"), n = vt.litNonce;
|
|
1641
1637
|
n !== void 0 && s.setAttribute("nonce", n), s.textContent = e.cssText, i.appendChild(s);
|
|
1642
1638
|
}
|
|
1643
1639
|
}, ue = te ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
|
|
@@ -1650,7 +1646,7 @@ const Ps = (i) => new Te(typeof i == "string" ? i : i + "", void 0, ee), je = (i
|
|
|
1650
1646
|
* Copyright 2017 Google LLC
|
|
1651
1647
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1652
1648
|
*/
|
|
1653
|
-
const { is: Ns, defineProperty: Ms, getOwnPropertyDescriptor: Ds, getOwnPropertyNames: Ls, getOwnPropertySymbols: Is, getPrototypeOf: Rs } = Object, M = globalThis, pe = M.trustedTypes, Ts = pe ? pe.emptyScript : "", Ut = M.reactiveElementPolyfillSupport,
|
|
1649
|
+
const { is: Ns, defineProperty: Ms, getOwnPropertyDescriptor: Ds, getOwnPropertyNames: Ls, getOwnPropertySymbols: Is, getPrototypeOf: Rs } = Object, M = globalThis, pe = M.trustedTypes, Ts = pe ? pe.emptyScript : "", Ut = M.reactiveElementPolyfillSupport, Z = (i, t) => i, xt = { toAttribute(i, t) {
|
|
1654
1650
|
switch (t) {
|
|
1655
1651
|
case Boolean:
|
|
1656
1652
|
i = i ? Ts : null;
|
|
@@ -1678,7 +1674,7 @@ const { is: Ns, defineProperty: Ms, getOwnPropertyDescriptor: Ds, getOwnProperty
|
|
|
1678
1674
|
}
|
|
1679
1675
|
}
|
|
1680
1676
|
return e;
|
|
1681
|
-
} }, se = (i, t) => !Ns(i, t), ge = { attribute: !0, type: String, converter:
|
|
1677
|
+
} }, se = (i, t) => !Ns(i, t), ge = { attribute: !0, type: String, converter: xt, reflect: !1, useDefault: !1, hasChanged: se };
|
|
1682
1678
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), M.litPropertyMetadata ?? (M.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
1683
1679
|
let z = class extends HTMLElement {
|
|
1684
1680
|
static addInitializer(t) {
|
|
@@ -1708,13 +1704,13 @@ let z = class extends HTMLElement {
|
|
|
1708
1704
|
return this.elementProperties.get(t) ?? ge;
|
|
1709
1705
|
}
|
|
1710
1706
|
static _$Ei() {
|
|
1711
|
-
if (this.hasOwnProperty(
|
|
1707
|
+
if (this.hasOwnProperty(Z("elementProperties"))) return;
|
|
1712
1708
|
const t = Rs(this);
|
|
1713
1709
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
1714
1710
|
}
|
|
1715
1711
|
static finalize() {
|
|
1716
|
-
if (this.hasOwnProperty(
|
|
1717
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
1712
|
+
if (this.hasOwnProperty(Z("finalized"))) return;
|
|
1713
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(Z("properties"))) {
|
|
1718
1714
|
const e = this.properties, s = [...Ls(e), ...Is(e)];
|
|
1719
1715
|
for (const n of s) this.createProperty(n, e[n]);
|
|
1720
1716
|
}
|
|
@@ -1789,7 +1785,7 @@ let z = class extends HTMLElement {
|
|
|
1789
1785
|
var r;
|
|
1790
1786
|
const s = this.constructor.elementProperties.get(t), n = this.constructor._$Eu(t, s);
|
|
1791
1787
|
if (n !== void 0 && s.reflect === !0) {
|
|
1792
|
-
const o = (((r = s.converter) == null ? void 0 : r.toAttribute) !== void 0 ? s.converter :
|
|
1788
|
+
const o = (((r = s.converter) == null ? void 0 : r.toAttribute) !== void 0 ? s.converter : xt).toAttribute(e, s.type);
|
|
1793
1789
|
this._$Em = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$Em = null;
|
|
1794
1790
|
}
|
|
1795
1791
|
}
|
|
@@ -1797,7 +1793,7 @@ let z = class extends HTMLElement {
|
|
|
1797
1793
|
var r, o;
|
|
1798
1794
|
const s = this.constructor, n = s._$Eh.get(t);
|
|
1799
1795
|
if (n !== void 0 && this._$Em !== n) {
|
|
1800
|
-
const a = s.getPropertyOptions(n), h = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((r = a.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? a.converter :
|
|
1796
|
+
const a = s.getPropertyOptions(n), h = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((r = a.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? a.converter : xt;
|
|
1801
1797
|
this._$Em = n;
|
|
1802
1798
|
const c = h.fromAttribute(e, a.type);
|
|
1803
1799
|
this[n] = c ?? ((o = this._$Ej) == null ? void 0 : o.get(n)) ?? c, this._$Em = null;
|
|
@@ -1883,15 +1879,15 @@ let z = class extends HTMLElement {
|
|
|
1883
1879
|
firstUpdated(t) {
|
|
1884
1880
|
}
|
|
1885
1881
|
};
|
|
1886
|
-
z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, z[
|
|
1882
|
+
z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, z[Z("elementProperties")] = /* @__PURE__ */ new Map(), z[Z("finalized")] = /* @__PURE__ */ new Map(), Ut == null || Ut({ ReactiveElement: z }), (M.reactiveElementVersions ?? (M.reactiveElementVersions = [])).push("2.1.2");
|
|
1887
1883
|
/**
|
|
1888
1884
|
* @license
|
|
1889
1885
|
* Copyright 2017 Google LLC
|
|
1890
1886
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1891
1887
|
*/
|
|
1892
|
-
const
|
|
1888
|
+
const Q = globalThis, me = (i) => i, At = Q.trustedTypes, fe = At ? At.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, Ue = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, He = "?" + P, js = `<${He}>`, H = document, et = () => H.createComment(""), st = (i) => i === null || typeof i != "object" && typeof i != "function", ie = Array.isArray, Us = (i) => ie(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", Ht = `[
|
|
1893
1889
|
\f\r]`, K = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ye = /-->/g, ve = />/g, L = RegExp(`>|${Ht}(?:([^\\s"'>=/]+)(${Ht}*=${Ht}*(?:[^
|
|
1894
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), be = /'/g, we = /"/g, Ve = /^(?:script|style|textarea|title)$/i, Hs = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }),
|
|
1890
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), be = /'/g, we = /"/g, Ve = /^(?:script|style|textarea|title)$/i, Hs = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), ut = Hs(1), V = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), $e = /* @__PURE__ */ new WeakMap(), T = H.createTreeWalker(H, 129);
|
|
1895
1891
|
function ze(i, t) {
|
|
1896
1892
|
if (!ie(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
1897
1893
|
return fe !== void 0 ? fe.createHTML(t) : t;
|
|
@@ -1908,13 +1904,13 @@ const Vs = (i, t) => {
|
|
|
1908
1904
|
}
|
|
1909
1905
|
return [ze(i, r + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
1910
1906
|
};
|
|
1911
|
-
class
|
|
1907
|
+
class it {
|
|
1912
1908
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
1913
1909
|
let n;
|
|
1914
1910
|
this.parts = [];
|
|
1915
1911
|
let r = 0, o = 0;
|
|
1916
1912
|
const a = t.length - 1, h = this.parts, [c, l] = Vs(t, e);
|
|
1917
|
-
if (this.el =
|
|
1913
|
+
if (this.el = it.createElement(c, s), T.currentNode = this.el.content, e === 2 || e === 3) {
|
|
1918
1914
|
const d = this.el.content.firstChild;
|
|
1919
1915
|
d.replaceWith(...d.childNodes);
|
|
1920
1916
|
}
|
|
@@ -1927,9 +1923,9 @@ class st {
|
|
|
1927
1923
|
if (Ve.test(n.tagName)) {
|
|
1928
1924
|
const d = n.textContent.split(P), u = d.length - 1;
|
|
1929
1925
|
if (u > 0) {
|
|
1930
|
-
n.textContent =
|
|
1931
|
-
for (let p = 0; p < u; p++) n.append(d[p],
|
|
1932
|
-
n.append(d[u],
|
|
1926
|
+
n.textContent = At ? At.emptyScript : "";
|
|
1927
|
+
for (let p = 0; p < u; p++) n.append(d[p], et()), T.nextNode(), h.push({ type: 2, index: ++r });
|
|
1928
|
+
n.append(d[u], et());
|
|
1933
1929
|
}
|
|
1934
1930
|
}
|
|
1935
1931
|
} else if (n.nodeType === 8) if (n.data === He) h.push({ type: 2, index: r });
|
|
@@ -1949,7 +1945,7 @@ function W(i, t, e = i, s) {
|
|
|
1949
1945
|
var o, a;
|
|
1950
1946
|
if (t === V) return t;
|
|
1951
1947
|
let n = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
|
|
1952
|
-
const r =
|
|
1948
|
+
const r = st(t) ? void 0 : t._$litDirective$;
|
|
1953
1949
|
return (n == null ? void 0 : n.constructor) !== r && ((a = n == null ? void 0 : n._$AO) == null || a.call(n, !1), r === void 0 ? n = void 0 : (n = new r(i), n._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = n : e._$Cl = n), n !== void 0 && (t = W(i, n._$AS(i, t.values), n, s)), t;
|
|
1954
1950
|
}
|
|
1955
1951
|
class zs {
|
|
@@ -2000,7 +1996,7 @@ class at {
|
|
|
2000
1996
|
return this._$AB;
|
|
2001
1997
|
}
|
|
2002
1998
|
_$AI(t, e = this) {
|
|
2003
|
-
t = W(this, t, e),
|
|
1999
|
+
t = W(this, t, e), st(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== V && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Us(t) ? this.k(t) : this._(t);
|
|
2004
2000
|
}
|
|
2005
2001
|
O(t) {
|
|
2006
2002
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -2009,11 +2005,11 @@ class at {
|
|
|
2009
2005
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
2010
2006
|
}
|
|
2011
2007
|
_(t) {
|
|
2012
|
-
this._$AH !== y &&
|
|
2008
|
+
this._$AH !== y && st(this._$AH) ? this._$AA.nextSibling.data = t : this.T(H.createTextNode(t)), this._$AH = t;
|
|
2013
2009
|
}
|
|
2014
2010
|
$(t) {
|
|
2015
2011
|
var r;
|
|
2016
|
-
const { values: e, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el =
|
|
2012
|
+
const { values: e, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = it.createElement(ze(s.h, s.h[0]), this.options)), s);
|
|
2017
2013
|
if (((r = this._$AH) == null ? void 0 : r._$AD) === n) this._$AH.p(e);
|
|
2018
2014
|
else {
|
|
2019
2015
|
const o = new zs(n, this), a = o.u(this.options);
|
|
@@ -2022,13 +2018,13 @@ class at {
|
|
|
2022
2018
|
}
|
|
2023
2019
|
_$AC(t) {
|
|
2024
2020
|
let e = $e.get(t.strings);
|
|
2025
|
-
return e === void 0 && $e.set(t.strings, e = new
|
|
2021
|
+
return e === void 0 && $e.set(t.strings, e = new it(t)), e;
|
|
2026
2022
|
}
|
|
2027
2023
|
k(t) {
|
|
2028
2024
|
ie(this._$AH) || (this._$AH = [], this._$AR());
|
|
2029
2025
|
const e = this._$AH;
|
|
2030
2026
|
let s, n = 0;
|
|
2031
|
-
for (const r of t) n === e.length ? e.push(s = new at(this.O(
|
|
2027
|
+
for (const r of t) n === e.length ? e.push(s = new at(this.O(et()), this.O(et()), this, this.options)) : s = e[n], s._$AI(r), n++;
|
|
2032
2028
|
n < e.length && (this._$AR(s && s._$AB.nextSibling, n), e.length = n);
|
|
2033
2029
|
}
|
|
2034
2030
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
@@ -2056,11 +2052,11 @@ class Pt {
|
|
|
2056
2052
|
_$AI(t, e = this, s, n) {
|
|
2057
2053
|
const r = this.strings;
|
|
2058
2054
|
let o = !1;
|
|
2059
|
-
if (r === void 0) t = W(this, t, e, 0), o = !
|
|
2055
|
+
if (r === void 0) t = W(this, t, e, 0), o = !st(t) || t !== this._$AH && t !== V, o && (this._$AH = t);
|
|
2060
2056
|
else {
|
|
2061
2057
|
const a = t;
|
|
2062
2058
|
let h, c;
|
|
2063
|
-
for (t = r[0], h = 0; h < r.length - 1; h++) c = W(this, a[s + h], e, h), c === V && (c = this._$AH[h]), o || (o = !
|
|
2059
|
+
for (t = r[0], h = 0; h < r.length - 1; h++) c = W(this, a[s + h], e, h), c === V && (c = this._$AH[h]), o || (o = !st(c) || c !== this._$AH[h]), c === y ? t = y : t !== y && (t += (c ?? "") + r[h + 1]), this._$AH[h] = c;
|
|
2064
2060
|
}
|
|
2065
2061
|
o && !n && this.j(t);
|
|
2066
2062
|
}
|
|
@@ -2109,14 +2105,14 @@ class Js {
|
|
|
2109
2105
|
W(this, t);
|
|
2110
2106
|
}
|
|
2111
2107
|
}
|
|
2112
|
-
const Vt =
|
|
2113
|
-
Vt == null || Vt(
|
|
2108
|
+
const Vt = Q.litHtmlPolyfillSupport;
|
|
2109
|
+
Vt == null || Vt(it, at), (Q.litHtmlVersions ?? (Q.litHtmlVersions = [])).push("3.3.3");
|
|
2114
2110
|
const Ks = (i, t, e) => {
|
|
2115
2111
|
const s = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
2116
2112
|
let n = s._$litPart$;
|
|
2117
2113
|
if (n === void 0) {
|
|
2118
2114
|
const r = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
2119
|
-
s._$litPart$ = n = new at(t.insertBefore(
|
|
2115
|
+
s._$litPart$ = n = new at(t.insertBefore(et(), r), r, void 0, e ?? {});
|
|
2120
2116
|
}
|
|
2121
2117
|
return n._$AI(i), n;
|
|
2122
2118
|
};
|
|
@@ -2126,7 +2122,7 @@ const Ks = (i, t, e) => {
|
|
|
2126
2122
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2127
2123
|
*/
|
|
2128
2124
|
const U = globalThis;
|
|
2129
|
-
let
|
|
2125
|
+
let X = class extends z {
|
|
2130
2126
|
constructor() {
|
|
2131
2127
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
2132
2128
|
}
|
|
@@ -2152,16 +2148,16 @@ let Q = class extends z {
|
|
|
2152
2148
|
}
|
|
2153
2149
|
};
|
|
2154
2150
|
var Ee;
|
|
2155
|
-
|
|
2151
|
+
X._$litElement$ = !0, X.finalized = !0, (Ee = U.litElementHydrateSupport) == null || Ee.call(U, { LitElement: X });
|
|
2156
2152
|
const zt = U.litElementPolyfillSupport;
|
|
2157
|
-
zt == null || zt({ LitElement:
|
|
2153
|
+
zt == null || zt({ LitElement: X });
|
|
2158
2154
|
(U.litElementVersions ?? (U.litElementVersions = [])).push("4.2.2");
|
|
2159
2155
|
/**
|
|
2160
2156
|
* @license
|
|
2161
2157
|
* Copyright 2017 Google LLC
|
|
2162
2158
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2163
2159
|
*/
|
|
2164
|
-
const Fs = { attribute: !0, type: String, converter:
|
|
2160
|
+
const Fs = { attribute: !0, type: String, converter: xt, reflect: !1, hasChanged: se }, Gs = (i = Fs, t, e) => {
|
|
2165
2161
|
const { kind: s, metadata: n } = e;
|
|
2166
2162
|
let r = globalThis.litPropertyMetadata.get(n);
|
|
2167
2163
|
if (r === void 0 && globalThis.litPropertyMetadata.set(n, r = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), r.set(e.name, i), s === "accessor") {
|
|
@@ -2182,7 +2178,7 @@ const Fs = { attribute: !0, type: String, converter: _t, reflect: !1, hasChanged
|
|
|
2182
2178
|
}
|
|
2183
2179
|
throw Error("Unsupported decorator location: " + s);
|
|
2184
2180
|
};
|
|
2185
|
-
function
|
|
2181
|
+
function nt(i) {
|
|
2186
2182
|
return (t, e) => typeof e == "object" ? Gs(i, t, e) : ((s, n, r) => {
|
|
2187
2183
|
const o = n.hasOwnProperty(r);
|
|
2188
2184
|
return n.constructor.createProperty(r, s), o ? Object.getOwnPropertyDescriptor(n, r) : void 0;
|
|
@@ -2194,7 +2190,7 @@ function it(i) {
|
|
|
2194
2190
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2195
2191
|
*/
|
|
2196
2192
|
function k(i) {
|
|
2197
|
-
return
|
|
2193
|
+
return nt({ ...i, state: !0, attribute: !1 });
|
|
2198
2194
|
}
|
|
2199
2195
|
/**
|
|
2200
2196
|
* @license
|
|
@@ -2246,15 +2242,15 @@ const Xs = Zs(class extends Qs {
|
|
|
2246
2242
|
}
|
|
2247
2243
|
return V;
|
|
2248
2244
|
}
|
|
2249
|
-
}),
|
|
2245
|
+
}), pt = (i, t, e) => {
|
|
2250
2246
|
i && e.style.setProperty(t, i);
|
|
2251
2247
|
}, ti = (i, t) => {
|
|
2252
2248
|
var e, s, n, r;
|
|
2253
|
-
|
|
2249
|
+
pt((e = i.colors) == null ? void 0 : e.primaryBackground, "--primary-background", t), pt(
|
|
2254
2250
|
(s = i.colors) == null ? void 0 : s.textOnPrimaryBackground,
|
|
2255
2251
|
"--text-on-primary-background",
|
|
2256
2252
|
t
|
|
2257
|
-
),
|
|
2253
|
+
), pt((n = i.colors) == null ? void 0 : n.secondaryBackground, "--secondary-background", t), pt(
|
|
2258
2254
|
(r = i.colors) == null ? void 0 : r.textOnSecondaryBackground,
|
|
2259
2255
|
"--text-on-secondary-background",
|
|
2260
2256
|
t
|
|
@@ -2265,7 +2261,7 @@ var ei = Object.defineProperty, ct = (i, t, e, s) => {
|
|
|
2265
2261
|
(o = i[r]) && (n = o(t, e, n) || n);
|
|
2266
2262
|
return n && ei(t, e, n), n;
|
|
2267
2263
|
};
|
|
2268
|
-
const re = class re extends
|
|
2264
|
+
const re = class re extends X {
|
|
2269
2265
|
constructor() {
|
|
2270
2266
|
super(...arguments), this.active = !1, this.loaded = !1;
|
|
2271
2267
|
}
|
|
@@ -2289,16 +2285,16 @@ const re = class re extends Q {
|
|
|
2289
2285
|
switch (s) {
|
|
2290
2286
|
case "Telia": {
|
|
2291
2287
|
const r = await e(n);
|
|
2292
|
-
return r ?
|
|
2288
|
+
return r ? ut`<telia-icon
|
|
2293
2289
|
class="trigger-icon"
|
|
2294
2290
|
svg=${r.svg}
|
|
2295
2291
|
size="lg"
|
|
2296
2292
|
></telia-icon>` : y;
|
|
2297
2293
|
}
|
|
2298
2294
|
case "FontAwesome":
|
|
2299
|
-
return
|
|
2295
|
+
return ut`<i class="trigger-fa-icon fa fa-${n}"></i>`;
|
|
2300
2296
|
case "Uri":
|
|
2301
|
-
return
|
|
2297
|
+
return ut`<i
|
|
2302
2298
|
class="trigger-custom-icon"
|
|
2303
2299
|
style="background: url(${n}) no-repeat center center;background-size: contain;"
|
|
2304
2300
|
></i>`;
|
|
@@ -2308,7 +2304,7 @@ const re = class re extends Q {
|
|
|
2308
2304
|
}
|
|
2309
2305
|
}
|
|
2310
2306
|
render() {
|
|
2311
|
-
return
|
|
2307
|
+
return ut`<button
|
|
2312
2308
|
class=${Xs({
|
|
2313
2309
|
trigger: !0,
|
|
2314
2310
|
active: this.active,
|
|
@@ -2420,10 +2416,10 @@ re.styles = [
|
|
|
2420
2416
|
];
|
|
2421
2417
|
let D = re;
|
|
2422
2418
|
ct([
|
|
2423
|
-
|
|
2419
|
+
nt({ attribute: !1 })
|
|
2424
2420
|
], D.prototype, "symbol");
|
|
2425
2421
|
ct([
|
|
2426
|
-
|
|
2422
|
+
nt({ attribute: !1 })
|
|
2427
2423
|
], D.prototype, "container");
|
|
2428
2424
|
ct([
|
|
2429
2425
|
k()
|
|
@@ -2509,7 +2505,7 @@ class ri {
|
|
|
2509
2505
|
*/
|
|
2510
2506
|
render() {
|
|
2511
2507
|
const { widgetDOMElement: t, triggerDOMElement: e } = this.options, s = this.container.get("$widget");
|
|
2512
|
-
return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === j.Badge && Ss(e), import("./render-
|
|
2508
|
+
return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === j.Badge && Ss(e), import("./render-BX1UUv22.mjs").then((n) => n.default(this.container, t)).then(() => {
|
|
2513
2509
|
if (t.setAttribute("data-rendered", "true"), e && this.options.triggerType === j.Badge) {
|
|
2514
2510
|
const r = this.options.triggerOptions.openTooltip;
|
|
2515
2511
|
Re(e, r);
|
|
@@ -2558,7 +2554,7 @@ class ri {
|
|
|
2558
2554
|
}), (r = e.parentNode) == null || r.removeChild(e), (o = t == null ? void 0 : t.parentNode) == null || o.removeChild(t);
|
|
2559
2555
|
}
|
|
2560
2556
|
}
|
|
2561
|
-
const
|
|
2557
|
+
const gt = "changesets", oi = (i) => {
|
|
2562
2558
|
const t = { tags: i.tags };
|
|
2563
2559
|
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;
|
|
2564
2560
|
};
|
|
@@ -2569,7 +2565,7 @@ class ne {
|
|
|
2569
2565
|
static create(t) {
|
|
2570
2566
|
return S(
|
|
2571
2567
|
t,
|
|
2572
|
-
|
|
2568
|
+
gt,
|
|
2573
2569
|
m.Necessary,
|
|
2574
2570
|
{
|
|
2575
2571
|
medium: f.Local
|
|
@@ -2581,7 +2577,7 @@ class ne {
|
|
|
2581
2577
|
write(t, e, s, n) {
|
|
2582
2578
|
return A(this)(() => C(
|
|
2583
2579
|
this.container,
|
|
2584
|
-
|
|
2580
|
+
gt,
|
|
2585
2581
|
f.Local
|
|
2586
2582
|
).then((r = {}) => {
|
|
2587
2583
|
const { keys: o = [], items: a = {} } = r, h = o.indexOf(t);
|
|
@@ -2595,7 +2591,7 @@ class ne {
|
|
|
2595
2591
|
remove(t) {
|
|
2596
2592
|
return A(this)(() => C(
|
|
2597
2593
|
this.container,
|
|
2598
|
-
|
|
2594
|
+
gt,
|
|
2599
2595
|
f.Local
|
|
2600
2596
|
).then((e = {}) => {
|
|
2601
2597
|
const { keys: s = [], items: n = {} } = e, r = s.indexOf(t);
|
|
@@ -2606,7 +2602,7 @@ class ne {
|
|
|
2606
2602
|
load(t) {
|
|
2607
2603
|
return A(this)(() => C(
|
|
2608
2604
|
this.container,
|
|
2609
|
-
|
|
2605
|
+
gt,
|
|
2610
2606
|
f.Local
|
|
2611
2607
|
).then((e = {}) => {
|
|
2612
2608
|
const { keys: s = [], items: n = {} } = e;
|
|
@@ -3283,9 +3279,9 @@ const Fi = (i) => {
|
|
|
3283
3279
|
let t = e;
|
|
3284
3280
|
return I([
|
|
3285
3281
|
gi({ context: yi }),
|
|
3286
|
-
|
|
3282
|
+
nt({ attribute: !1 })
|
|
3287
3283
|
], t.prototype, "container"), I([
|
|
3288
|
-
|
|
3284
|
+
nt()
|
|
3289
3285
|
], t.prototype, "entry"), I([
|
|
3290
3286
|
k()
|
|
3291
3287
|
], t.prototype, "descriptor"), I([
|
|
@@ -3304,10 +3300,10 @@ export {
|
|
|
3304
3300
|
V as E,
|
|
3305
3301
|
Ji as G,
|
|
3306
3302
|
Fi as W,
|
|
3307
|
-
|
|
3303
|
+
X as a,
|
|
3308
3304
|
F as b,
|
|
3309
3305
|
yi as c,
|
|
3310
|
-
|
|
3306
|
+
ut as d,
|
|
3311
3307
|
Zs as e,
|
|
3312
3308
|
je as f,
|
|
3313
3309
|
Ci as g,
|
|
@@ -3317,7 +3313,7 @@ export {
|
|
|
3317
3313
|
mi as k,
|
|
3318
3314
|
vi as l,
|
|
3319
3315
|
ti as m,
|
|
3320
|
-
|
|
3316
|
+
nt as n,
|
|
3321
3317
|
_ as o,
|
|
3322
3318
|
qi as p,
|
|
3323
3319
|
Ki as q,
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";const Dt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},ns=i=>{const t=i.container||i;return{info:(e,...s)=>Dt(t,"info",e,...s),warn:(e,...s)=>Dt(t,"warning",e,...s),error:(e,...s)=>Dt(t,"error",e,...s)}};var st=(i=>(i.Implementation="implementation",i.Widget="widget",i))(st||{}),N=(i=>(i.Pre="pre",i.Post="post",i))(N||{});const rs=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function ae(i,t){return typeof i>"u"?t:i}let os=class{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:st.Widget,stage:N.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:ae(e.scope,st.Widget),stage:ae(e.stage,N.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Oe=i=>{const t=new os({});return i(t),t.get()};Oe(i=>{i.createCommand("types.register",{scope:st.Implementation,stage:N.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:N.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:N.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:N.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=rs(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){ns(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});function as(i){const t={};return[].filter.call(i.attributes,e=>/^data-/.test(e.name)).map(e=>e.name).forEach(e=>t[e.substr(5)]=i.getAttribute(e)),t}const cs=(i,t,e)=>{const s=as(i);e({sourceDOMElement:i,eventType:t,data:s})};function ce(i,t,e){i.forEach(s=>{s.dataset.attached!=="true"&&(cs(s,t,e),s.dataset.monitored="true")})}function hs(i,t,e){const s=i.container.get("bootstrapping.monitor");s&&s.events.subscribe("bootstrap:trigger-elements-updated",(r,o)=>{ce(o.triggerElements,t,e)});const n=i.container.get("triggerElements");n&&ce(n,t,e)}Oe(i=>{i.createCommand("ready",{scope:st.Implementation,stage:N.Pre},t=>e=>{const{container:s}=t,n=s.owner;s.get("bootstrapping").ready?e(n):n.events.subscribeOnce("bootstrap:ready",()=>{e(n)})})});const Lt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},ls=i=>{const t=i.container||i;return{info:(e,...s)=>Lt(t,"info",e,...s),warn:(e,...s)=>Lt(t,"warning",e,...s),error:(e,...s)=>Lt(t,"error",e,...s)}};var vt=(i=>(i.Implementation="implementation",i.Widget="widget",i))(vt||{}),T=(i=>(i.Pre="pre",i.Post="post",i))(T||{});const ds=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function he(i,t){return typeof i>"u"?t:i}class us{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:vt.Widget,stage:T.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:he(e.scope,vt.Widget),stage:he(e.stage,T.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}}const Ft=i=>{const t=new us({});return i(t),t.get()};Ft(i=>{i.createCommand("types.register",{scope:vt.Implementation,stage:T.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:T.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:T.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:T.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=ds(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){ls(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});var Se=(i=>(i.Activating="activating",i.Loading="loading",i.Activated="activated",i.Deactivating="deactivating",i.Deactivated="deactivated",i))(Se||{});class ps{constructor(t){this.container=t,this.widget=t.get("$widget"),this.settings=t.get("$settings"),this.events=this.widget.events,this.widget.events.subscribe("settings:change",(e,s)=>{this.settings=s})}}const At=(i,t,...e)=>typeof t=="string"?i(`[humany] ${t}`,...e):i(t,...e),ot=class Q{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>Q.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>Q.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>Q.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>Q.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};ot.log=(...i)=>At(console.log,...i);ot.warn=(...i)=>At(console.warn,...i);ot.error=(...i)=>At(console.error,...i);ot.info=(...i)=>At(console.info,...i);let b=ot;const Pe=i=>{let t={},e,s;if(typeof i!="object"||i===null)return i;t=Array.isArray(i)?[]:{};for(s in i)e=i[s],t[s]=typeof e=="object"&&e!==null?Pe(e):e;return t};function le(i){let t=0;if(i.length===0)return t.toString();for(let e=0;e<i.length;e++){const s=i.charCodeAt(e);t=(t<<5)-t+s,t=t&t}return t.toString()}let gs=class{constructor(t,e){this.lockWarningTime=t,this.lockErrorTime=e,this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){let e;const s=setTimeout(()=>{process.env.NODE_ENV!=="production"&&b.warn(`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,t),e=setTimeout(()=>{t.reject("lock timeout exceeded")},this.lockErrorTime)},this.lockWarningTime),n=Promise.resolve(t.task()).then(r=>(clearTimeout(s),clearTimeout(e),r));return Promise.resolve(n).then(this.next).then(()=>n.then(r=>{t.done(),t.resolve(r)})).catch(r=>(t.done(),t.reject(r),this.next()))}return Promise.resolve()})}};const dt=new WeakMap;function A(i,t=5e3,e=1e3){return dt.has(i)||dt.set(i,new gs(t,e)),s=>new Promise((n,r)=>{const o=dt.get(i);o.add(s,n,r,()=>{o.tasks.length||dt.delete(i)})})}const ms=(i,t)=>{const e=()=>t.querySelectorAll("[data-loading=true]").length>0,s=(()=>{let n=!1;return()=>{n||(i.get("$widget").events.dispatch("widget:data-loaded",{element:t}),n=!0)}})();if(!e())return s();new MutationObserver((n,r)=>{n.find(o=>o.type==="attributes"&&o.attributeName==="data-loading")&&!e()&&(r.disconnect(),s())}).observe(t,{attributes:!0,childList:!0,subtree:!0})},fs=(i,t)=>{i.get("$widget").container.getAsync("components").then(e=>{e.events.subscribeOnce("components:component-model-initialized",()=>{let s=e.nodes.visible.reduce((r,o)=>(!o.name||!o.type||o.type==="view"||o.type==="root"||o.attributes.layout.size==="none"||t.querySelector(`[data-name="${o.name}"]`)||r.push(o.name),r),[]),n=!1;new MutationObserver((r,o)=>{r.forEach(a=>{if(a.addedNodes){const h=Array.from(a.addedNodes).reduce((c,l)=>{const d=l.getAttribute&&l.getAttribute("data-name");return d&&s.indexOf(d)>-1&&c.push(d),c},[]);s=s.filter(c=>h.indexOf(c)===-1),!n&&s.length===0&&(n=!0,ms(i,t),o.disconnect())}})}).observe(t,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})})})},S=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function at(){return S()+S()+"-"+S()+"-"+S()+"-"+S()+"-"+S()+S()+S()}class ys{constructor(t){const{events:e}=t.get("$widget");this.events=e.createChild(this)}action(t,e,s){this.events.dispatch("data:action",{action:e,value:s,target:t},{bubbles:!0})}subscribe(t,e){return this.events.subscribe("data:action",(s,{action:n,value:r,target:o})=>t===o&&e(t,n,r))}}const ke=i=>{const t=[];return[(e,s)=>{t.push(i.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let F=class{constructor(t,e=[]){this.platform=t,this.rules=e}match(t){return this.rules.every(e=>!(e.id&&e.id!==t.id||e.type&&e.type!==t.type))}ofType(t){return this.rules.push({type:t}),this}withId(t){return this.rules.push({id:t}),this}select(){return new vs(this.platform,this)}},Gt=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new Et(t,new F(t).withId(e.id),s);const[n,r]=ke(this.platform.events);this.subscribe=n,this.unsubscribe=r}properties(t){return t&&this.node.touchProperties(e=>t(e)),this.node.attributes.properties}context(t){return t&&this.subscribe("components:context-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.context)}),this.node.attributes.context}layout(t){return t&&this.subscribe("components:layout-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(t,e){this.node.writeProperties(t,e)}writeContext(t,e){this.node.writeProperties(t,e)}writeLayout(t,e){this.node.writeLayout(t,e)}dispose(){this.unsubscribe(),this.actions.dispose()}},vs=class{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new Et(this.platform,this.target)}writeProperties(t,e){this.removes.push(this.platform.write({options:e,attributes:{properties:t},target:this.target,removable:this.clearOnDispose}))}writeContext(t,e){this.removes.push(this.platform.write({options:e,attributes:{context:t},target:this.target,removable:this.clearOnDispose}))}writeLayout(t,e){this.removes.push(this.platform.write({options:e,attributes:{layout:t},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(t=>{t()}),this.actions.dispose()}};const bs=(i,t,e)=>{const s=i.concat(),n=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),l=(d,u)=>(h=!1,n(d,Object.assign({},o,u),a));return Promise.resolve(c(r,l,a)).then(d=>({...d,cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return n(t,{},e)};let Et=class{constructor(t,e,s){this.platform=t,this.target=e,this.ns=s,this.subscriptions=[],this.create=this.create.bind(this)}create(t,e=()=>{}){const s={key:t,fn:e,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(s);const n=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(n),n}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),n={},r=this.platform.actionsState.handlers.filter(o=>o.key===t&&(!o.ns||!this.ns||o.ns===this.ns));return Promise.all(r.map(o=>{const a=s.filter(c=>o.target.match(c)&&this.target.match(c)),h=this.platform.actionsState.watchers.filter(c=>c.key===t&&(!c.ns||!this.ns||c.ns===this.ns)&&a.some(l=>c.target.match(l))).map(c=>c.fn);return Promise.all(a.map(c=>{const l=new Gt(this.platform,c,this.ns);return bs(h,e,l).then(d=>{const{data:u={},options:p,cancelled:g}=d;return Promise.resolve(g?{}:o.fn(u,p,l)).then(v=>{n[c.id]=v})})}))})).then(()=>n)}watch(t,e){let s=t,n=this.ns;const r=t.split(".");r.length>1&&(n=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:n};this.platform.actionsState.watchers.push(o);const a=()=>{const h=this.platform.actionsState.watchers.indexOf(o);h>-1&&this.platform.actionsState.watchers.splice(h,1)};return this.subscriptions.push(a),a}dispose(){this.subscriptions.forEach(t=>t())}};Ft(i=>{i.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:n})=>{e.handlers&&e.handlers.forEach(([r,o])=>{n.addComponentHandler(r,o)})})})});let qt=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=at(),this.type=e,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(t,e){let s=t.get("mounted-nodes");return s||(s=new Map,t.register("mounted-nodes",s)),s.has(this)?(process.env.NODE_ENV!=="production"&&b.error("Trying to mount an already mounted component node.",this),()=>{}):(this.events.dispatch("components:node-mounted",{node:this}),this.mountCount===0&&(this.mountCount=this.mountCount+1,this.events.dispatch("components:node-enter",{node:this})),()=>{s.delete(this),this.events.dispatch("components:node-unmounted",{node:this}),this.mountCount=this.mountCount-1,this.mountCount===0&&this.events.dispatch("components:node-exit",{node:this})})}appendChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].push(t),this.events.dispatch("components:node-appended",{node:t})}prependChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].unshift(t),this.events.dispatch("components:node-appended",{node:t})}touchProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const n=[{layout:t},e];return this.changesets.push(n),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const n=[{context:t},e];return this.changesets.push(n),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(t="default"){const e=this.children[t]||[];return e.reduce((s,n,r)=>{const{order:o=r}=n.attributes.layout;return s[o]?s.splice(o,0,n):s[o]=n,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],n=s.indexOf(t);n>-1&&(s.splice(n,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const Ne=(i,t,e)=>{for(let s=0,n=i.length;s<n&&e(i[s])!==!0;s++){const r=t[i[s].id]||"default",o=i[s].getChildren(r);Ne(o,t,e)}},Ct=(i,t,e)=>{if(e(i)!==!0){const s=t[i.id]||"default",n=i.children[s];Ne(n,t,e)}},gt=(i,t)=>{const e=[];return Ct(i,t,s=>{e.push(s)}),e},Me=(i,t,e)=>{let s;return Ct(i,t,n=>{if(e(n))return s=n,!0}),s};class ws{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(n,r)=>{this.all.push(r.node),this.visible=gt(t,e)}),s.subscribe("components:node-removed",(n,r)=>{let o=this.all.indexOf(r.node);o>-1&&this.all.splice(o,1),o=this.visible.indexOf(r.node),o>-1&&this.visible.splice(o,1),this.visible=gt(t,e)}),s.subscribe("components:node-switched",(n,r)=>{this.visible=gt(t,e)})}query(t={}){const e=[];return Ct(this.root,this.switches,s=>{Object.keys(t).every(n=>t[n]===s[n])&&e.push(s)}),e}get(t){return Me(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}}let $s=class{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}};const _s=i=>{let t=i,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},xs=i=>i.map(([t,e])=>[_s(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),It=i=>i instanceof Date?!1:i&&typeof i=="object"&&!Array.isArray(i),E=(i,...t)=>{if(!t.length)return i;const e=t.shift();if(It(i)&&It(e))for(const s in e)It(e[s])?(i[s]||Object.assign(i,{[s]:{}}),E(i[s],e[s])):Object.assign(i,{[s]:e[s]});return E(i,...t)},As=(i,t)=>!i||i==="all"?!0:i.some(e=>t.indexOf(e)>-1),Es=(i,t)=>{let e=[],s=[],n;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=xs(e.map((l,d)=>[l,s[d]])),c=(l,d)=>{var u;const p=a.get(l)||{},g=d.context&&!p.context,v=d.properties&&!p.properties,x=d.layout&&!p.layout;a.set(l,{context:p.context||g,properties:p.properties||v,layout:p.layout||x}),v&&(l.attributes.properties={}),x&&(l.attributes.layout={}),g&&(l.attributes.context=E({},(u=l.parent)==null?void 0:u.attributes.context));const lt=[],kt=[],Nt=[];if(l.changesets.forEach($=>{const[_,Mt]=$;As(Mt.breakpoints,i.breakpoints)&&(v&&(typeof _.properties=="function"?lt.push(_.properties):E(l.attributes.properties,_.properties)),x&&(typeof _.layout=="function"?kt.push(_.layout):E(l.attributes.layout,_.layout)),g&&(typeof _.context=="function"?Nt.push(_.context):E(l.attributes.context,_.context)))}),lt.forEach($=>{E(l.attributes.properties,$(l.attributes.properties))}),kt.forEach($=>{E(l.attributes.layout,$(l.attributes.layout))}),Nt.forEach($=>{E(l.attributes.context,$(l.attributes.context))}),g||d.recursive){const $=i.getBranch(l),_=d.recursive?d:{context:!!g};l.getChildren($).forEach(Mt=>{c(Mt,_)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([l,d])=>{c(l,d)}),e=[],s=[],t(a)},o=()=>{clearTimeout(n),n=setTimeout(r,0)};return(a,h)=>{const c=e.indexOf(a);if(c>-1){const l=s[c];return h.context&&(l.context=!0),h.properties&&(l.properties=!0),h.layout&&(l.layout=!0),h.recursive&&(l.recursive=!0),o()}return e.push(a),s.push(h),o()}};class G{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new $s,this.events=t.events.createChild(this);const s=new qt(this.events,"root");s.name=`root-${t.name}`,this.nodes=new ws(s,this.switches,this.events);const n=this.processNode=Es(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
|
|
1
|
+
"use strict";const Dt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},ns=i=>{const t=i.container||i;return{info:(e,...s)=>Dt(t,"info",e,...s),warn:(e,...s)=>Dt(t,"warning",e,...s),error:(e,...s)=>Dt(t,"error",e,...s)}};var it=(i=>(i.Implementation="implementation",i.Widget="widget",i))(it||{}),N=(i=>(i.Pre="pre",i.Post="post",i))(N||{});const rs=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function ae(i,t){return typeof i>"u"?t:i}let os=class{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:it.Widget,stage:N.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:ae(e.scope,it.Widget),stage:ae(e.stage,N.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Oe=i=>{const t=new os({});return i(t),t.get()};Oe(i=>{i.createCommand("types.register",{scope:it.Implementation,stage:N.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:N.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:N.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:N.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=rs(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){ns(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});function as(i){const t={};return[].filter.call(i.attributes,e=>/^data-/.test(e.name)).map(e=>e.name).forEach(e=>t[e.substr(5)]=i.getAttribute(e)),t}const cs=(i,t,e)=>{const s=as(i);e({sourceDOMElement:i,eventType:t,data:s})};function ce(i,t,e){i.forEach(s=>{s.dataset.attached!=="true"&&(cs(s,t,e),s.dataset.monitored="true")})}function hs(i,t,e){const s=i.container.get("bootstrapping.monitor");s&&s.events.subscribe("bootstrap:trigger-elements-updated",(r,o)=>{ce(o.triggerElements,t,e)});const n=i.container.get("triggerElements");n&&ce(n,t,e)}Oe(i=>{i.createCommand("ready",{scope:it.Implementation,stage:N.Pre},t=>e=>{const{container:s}=t,n=s.owner;s.get("bootstrapping").ready?e(n):n.events.subscribeOnce("bootstrap:ready",()=>{e(n)})})});const Lt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},ls=i=>{const t=i.container||i;return{info:(e,...s)=>Lt(t,"info",e,...s),warn:(e,...s)=>Lt(t,"warning",e,...s),error:(e,...s)=>Lt(t,"error",e,...s)}};var bt=(i=>(i.Implementation="implementation",i.Widget="widget",i))(bt||{}),T=(i=>(i.Pre="pre",i.Post="post",i))(T||{});const ds=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function he(i,t){return typeof i>"u"?t:i}class us{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:bt.Widget,stage:T.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:he(e.scope,bt.Widget),stage:he(e.stage,T.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}}const Ft=i=>{const t=new us({});return i(t),t.get()};Ft(i=>{i.createCommand("types.register",{scope:bt.Implementation,stage:T.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:T.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:T.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:T.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=ds(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){ls(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});var Se=(i=>(i.Activating="activating",i.Loading="loading",i.Activated="activated",i.Deactivating="deactivating",i.Deactivated="deactivated",i))(Se||{});class ps{constructor(t){this.container=t,this.widget=t.get("$widget"),this.settings=t.get("$settings"),this.events=this.widget.events,this.widget.events.subscribe("settings:change",(e,s)=>{this.settings=s})}}const dt=(i,t,...e)=>typeof t=="string"?i(`[humany] ${t}`,...e):i(t,...e),Q=class X{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>X.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>X.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>X.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>X.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};Q.log=(...i)=>dt(console.log,...i),Q.warn=(...i)=>dt(console.warn,...i),Q.error=(...i)=>dt(console.error,...i),Q.info=(...i)=>dt(console.info,...i);let b=Q;const Pe=i=>{let t={},e,s;if(typeof i!="object"||i===null)return i;t=Array.isArray(i)?[]:{};for(s in i)e=i[s],t[s]=typeof e=="object"&&e!==null?Pe(e):e;return t};function le(i){let t=0;if(i.length===0)return t.toString();for(let e=0;e<i.length;e++){const s=i.charCodeAt(e);t=(t<<5)-t+s,t=t&t}return t.toString()}let gs=class{constructor(t,e){this.lockWarningTime=t,this.lockErrorTime=e,this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){let e;const s=setTimeout(()=>{process.env.NODE_ENV!=="production"&&b.warn(`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,t),e=setTimeout(()=>{t.reject("lock timeout exceeded")},this.lockErrorTime)},this.lockWarningTime),n=Promise.resolve(t.task()).then(r=>(clearTimeout(s),clearTimeout(e),r));return Promise.resolve(n).then(this.next).then(()=>n.then(r=>{t.done(),t.resolve(r)})).catch(r=>(t.done(),t.reject(r),this.next()))}return Promise.resolve()})}};const ut=new WeakMap;function A(i,t=5e3,e=1e3){return ut.has(i)||ut.set(i,new gs(t,e)),s=>new Promise((n,r)=>{const o=ut.get(i);o.add(s,n,r,()=>{o.tasks.length||ut.delete(i)})})}const ms=(i,t)=>{const e=()=>t.querySelectorAll("[data-loading=true]").length>0,s=(()=>{let n=!1;return()=>{n||(i.get("$widget").events.dispatch("widget:data-loaded",{element:t}),n=!0)}})();if(!e())return s();new MutationObserver((n,r)=>{n.find(o=>o.type==="attributes"&&o.attributeName==="data-loading")&&!e()&&(r.disconnect(),s())}).observe(t,{attributes:!0,childList:!0,subtree:!0})},fs=(i,t)=>{i.get("$widget").container.getAsync("components").then(e=>{e.events.subscribeOnce("components:component-model-initialized",()=>{let s=e.nodes.visible.reduce((r,o)=>(!o.name||!o.type||o.type==="view"||o.type==="root"||o.attributes.layout.size==="none"||t.querySelector(`[data-name="${o.name}"]`)||r.push(o.name),r),[]),n=!1;new MutationObserver((r,o)=>{r.forEach(a=>{if(a.addedNodes){const h=Array.from(a.addedNodes).reduce((c,l)=>{const d=l.getAttribute&&l.getAttribute("data-name");return d&&s.indexOf(d)>-1&&c.push(d),c},[]);s=s.filter(c=>h.indexOf(c)===-1),!n&&s.length===0&&(n=!0,ms(i,t),o.disconnect())}})}).observe(t,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})})})},S=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function at(){return S()+S()+"-"+S()+"-"+S()+"-"+S()+"-"+S()+S()+S()}class ys{constructor(t){const{events:e}=t.get("$widget");this.events=e.createChild(this)}action(t,e,s){this.events.dispatch("data:action",{action:e,value:s,target:t},{bubbles:!0})}subscribe(t,e){return this.events.subscribe("data:action",(s,{action:n,value:r,target:o})=>t===o&&e(t,n,r))}}const ke=i=>{const t=[];return[(e,s)=>{t.push(i.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let F=class{constructor(t,e=[]){this.platform=t,this.rules=e}match(t){return this.rules.every(e=>!(e.id&&e.id!==t.id||e.type&&e.type!==t.type))}ofType(t){return this.rules.push({type:t}),this}withId(t){return this.rules.push({id:t}),this}select(){return new vs(this.platform,this)}},Gt=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new Et(t,new F(t).withId(e.id),s);const[n,r]=ke(this.platform.events);this.subscribe=n,this.unsubscribe=r}properties(t){return t&&this.node.touchProperties(e=>t(e)),this.node.attributes.properties}context(t){return t&&this.subscribe("components:context-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.context)}),this.node.attributes.context}layout(t){return t&&this.subscribe("components:layout-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(t,e){this.node.writeProperties(t,e)}writeContext(t,e){this.node.writeProperties(t,e)}writeLayout(t,e){this.node.writeLayout(t,e)}dispose(){this.unsubscribe(),this.actions.dispose()}},vs=class{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new Et(this.platform,this.target)}writeProperties(t,e){this.removes.push(this.platform.write({options:e,attributes:{properties:t},target:this.target,removable:this.clearOnDispose}))}writeContext(t,e){this.removes.push(this.platform.write({options:e,attributes:{context:t},target:this.target,removable:this.clearOnDispose}))}writeLayout(t,e){this.removes.push(this.platform.write({options:e,attributes:{layout:t},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(t=>{t()}),this.actions.dispose()}};const bs=(i,t,e)=>{const s=i.concat(),n=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),l=(d,u)=>(h=!1,n(d,Object.assign({},o,u),a));return Promise.resolve(c(r,l,a)).then(d=>({...d,cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return n(t,{},e)};let Et=class{constructor(t,e,s){this.platform=t,this.target=e,this.ns=s,this.subscriptions=[],this.create=this.create.bind(this)}create(t,e=()=>{}){const s={key:t,fn:e,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(s);const n=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(n),n}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),n={},r=this.platform.actionsState.handlers.filter(o=>o.key===t&&(!o.ns||!this.ns||o.ns===this.ns));return Promise.all(r.map(o=>{const a=s.filter(c=>o.target.match(c)&&this.target.match(c)),h=this.platform.actionsState.watchers.filter(c=>c.key===t&&(!c.ns||!this.ns||c.ns===this.ns)&&a.some(l=>c.target.match(l))).map(c=>c.fn);return Promise.all(a.map(c=>{const l=new Gt(this.platform,c,this.ns);return bs(h,e,l).then(d=>{const{data:u={},options:p,cancelled:g}=d;return Promise.resolve(g?{}:o.fn(u,p,l)).then(v=>{n[c.id]=v})})}))})).then(()=>n)}watch(t,e){let s=t,n=this.ns;const r=t.split(".");r.length>1&&(n=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:n};this.platform.actionsState.watchers.push(o);const a=()=>{const h=this.platform.actionsState.watchers.indexOf(o);h>-1&&this.platform.actionsState.watchers.splice(h,1)};return this.subscriptions.push(a),a}dispose(){this.subscriptions.forEach(t=>t())}};Ft(i=>{i.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:n})=>{e.handlers&&e.handlers.forEach(([r,o])=>{n.addComponentHandler(r,o)})})})});let qt=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=at(),this.type=e,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(t,e){let s=t.get("mounted-nodes");return s||(s=new Map,t.register("mounted-nodes",s)),s.has(this)?(process.env.NODE_ENV!=="production"&&b.error("Trying to mount an already mounted component node.",this),()=>{}):(this.events.dispatch("components:node-mounted",{node:this}),this.mountCount===0&&(this.mountCount=this.mountCount+1,this.events.dispatch("components:node-enter",{node:this})),()=>{s.delete(this),this.events.dispatch("components:node-unmounted",{node:this}),this.mountCount=this.mountCount-1,this.mountCount===0&&this.events.dispatch("components:node-exit",{node:this})})}appendChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].push(t),this.events.dispatch("components:node-appended",{node:t})}prependChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].unshift(t),this.events.dispatch("components:node-appended",{node:t})}touchProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const n=[{layout:t},e];return this.changesets.push(n),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const n=[{context:t},e];return this.changesets.push(n),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(t="default"){const e=this.children[t]||[];return e.reduce((s,n,r)=>{const{order:o=r}=n.attributes.layout;return s[o]?s.splice(o,0,n):s[o]=n,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],n=s.indexOf(t);n>-1&&(s.splice(n,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const Ne=(i,t,e)=>{for(let s=0,n=i.length;s<n&&e(i[s])!==!0;s++){const r=t[i[s].id]||"default",o=i[s].getChildren(r);Ne(o,t,e)}},Ct=(i,t,e)=>{if(e(i)!==!0){const s=t[i.id]||"default",n=i.children[s];Ne(n,t,e)}},mt=(i,t)=>{const e=[];return Ct(i,t,s=>{e.push(s)}),e},Me=(i,t,e)=>{let s;return Ct(i,t,n=>{if(e(n))return s=n,!0}),s};class ws{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(n,r)=>{this.all.push(r.node),this.visible=mt(t,e)}),s.subscribe("components:node-removed",(n,r)=>{let o=this.all.indexOf(r.node);o>-1&&this.all.splice(o,1),o=this.visible.indexOf(r.node),o>-1&&this.visible.splice(o,1),this.visible=mt(t,e)}),s.subscribe("components:node-switched",(n,r)=>{this.visible=mt(t,e)})}query(t={}){const e=[];return Ct(this.root,this.switches,s=>{Object.keys(t).every(n=>t[n]===s[n])&&e.push(s)}),e}get(t){return Me(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}}let $s=class{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}};const _s=i=>{let t=i,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},xs=i=>i.map(([t,e])=>[_s(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),It=i=>i instanceof Date?!1:i&&typeof i=="object"&&!Array.isArray(i),E=(i,...t)=>{if(!t.length)return i;const e=t.shift();if(It(i)&&It(e))for(const s in e)It(e[s])?(i[s]||Object.assign(i,{[s]:{}}),E(i[s],e[s])):Object.assign(i,{[s]:e[s]});return E(i,...t)},As=(i,t)=>!i||i==="all"?!0:i.some(e=>t.indexOf(e)>-1),Es=(i,t)=>{let e=[],s=[],n;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=xs(e.map((l,d)=>[l,s[d]])),c=(l,d)=>{var u;const p=a.get(l)||{},g=d.context&&!p.context,v=d.properties&&!p.properties,x=d.layout&&!p.layout;a.set(l,{context:p.context||g,properties:p.properties||v,layout:p.layout||x}),v&&(l.attributes.properties={}),x&&(l.attributes.layout={}),g&&(l.attributes.context=E({},(u=l.parent)==null?void 0:u.attributes.context));const lt=[],kt=[],Nt=[];if(l.changesets.forEach($=>{const[_,Mt]=$;As(Mt.breakpoints,i.breakpoints)&&(v&&(typeof _.properties=="function"?lt.push(_.properties):E(l.attributes.properties,_.properties)),x&&(typeof _.layout=="function"?kt.push(_.layout):E(l.attributes.layout,_.layout)),g&&(typeof _.context=="function"?Nt.push(_.context):E(l.attributes.context,_.context)))}),lt.forEach($=>{E(l.attributes.properties,$(l.attributes.properties))}),kt.forEach($=>{E(l.attributes.layout,$(l.attributes.layout))}),Nt.forEach($=>{E(l.attributes.context,$(l.attributes.context))}),g||d.recursive){const $=i.getBranch(l),_=d.recursive?d:{context:!!g};l.getChildren($).forEach(Mt=>{c(Mt,_)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([l,d])=>{c(l,d)}),e=[],s=[],t(a)},o=()=>{clearTimeout(n),n=setTimeout(r,0)};return(a,h)=>{const c=e.indexOf(a);if(c>-1){const l=s[c];return h.context&&(l.context=!0),h.properties&&(l.properties=!0),h.layout&&(l.layout=!0),h.recursive&&(l.recursive=!0),o()}return e.push(a),s.push(h),o()}};class G{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new $s,this.events=t.events.createChild(this);const s=new qt(this.events,"root");s.name=`root-${t.name}`,this.nodes=new ws(s,this.switches,this.events);const n=this.processNode=Es(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
|
|
2
2
|
${o.map(a=>`${a.name||"<no name>"} (${a.id})
|
|
3
|
-
`)}`),o.forEach(a=>{const h=r.get(a);a.parent&&a.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:a}),h!=null&&h.context&&this.events.dispatch("components:context-changed",{node:a}),h!=null&&h.properties&&this.events.dispatch("components:properties-changed",{node:a}),h!=null&&h.layout&&this.events.dispatch("components:layout-changed",{node:a})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(e).map(r=>e[r].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{const{node:a}=o;this.changesets.forEach(h=>{const{changeset:c,target:l,removes:d}=h,[u,p]=c;l.match(o.node)&&(u.properties&&d.push(a.writeProperties(u.properties,p)),u.context&&d.push(a.writeContext(u.context,p)),u.layout&&d.push(a.writeLayout(u.layout,p)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{n(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{n(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{n(o,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(t){return t.getAsync("components")}addBreakpoint(t){this.breakpoints.indexOf(t)===-1&&(this.breakpoints.push(t),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(t){const e=this.breakpoints.indexOf(t);e>-1&&(this.breakpoints.splice(e,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(t,e){this.switches[t.id]=e,this.events.dispatch("components:node-switched",{node:t,branch:e})}getBranch(t){return this.switches[t.id]}createNode(t,e={}){const s=new qt(this.events,t);return e.detached&&this.nodes.detached.push(s),s}components(){return new F(this)}actions(t,e){return new Et(this,t,e)}write(t){const{provider:e,target:s,attributes:n,options:r={},removable:o}=t,a=t.key||at(),h={changeset:[n,r],target:s,removes:[]};if(e){const c=this.providers[e];c.write(a,s,n,r),h.removes.push(()=>{c.remove(a)})}return this.changesets.push(h),this.nodes.all.forEach(c=>{if(s.match(c)){let l=()=>{};n.properties&&(l=c.writeProperties(n.properties,r,o)),n.context&&(l=c.writeContext(n.context,r,o)),n.layout&&(l=c.writeContext(n.layout,r,o)),h.removes.push(l)}}),()=>{if(o){h.removes.forEach(l=>l());const c=this.changesets.indexOf(h);c>-1&&this.changesets.splice(c,1)}}}addComponentHandler(t,e){this.customComponentHandler.add(t,e)}getComponentHandler(t){return this.customComponentHandler.get(t)}dispose(){this.subscriptions.forEach(t=>t())}}const Cs=i=>{if(Array.isArray(i)){const[t,...e]=i;return{definitionId:t,overrides:e}}return{definitionId:i,overrides:[]}},
|
|
3
|
+
`)}`),o.forEach(a=>{const h=r.get(a);a.parent&&a.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:a}),h!=null&&h.context&&this.events.dispatch("components:context-changed",{node:a}),h!=null&&h.properties&&this.events.dispatch("components:properties-changed",{node:a}),h!=null&&h.layout&&this.events.dispatch("components:layout-changed",{node:a})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(e).map(r=>e[r].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{const{node:a}=o;this.changesets.forEach(h=>{const{changeset:c,target:l,removes:d}=h,[u,p]=c;l.match(o.node)&&(u.properties&&d.push(a.writeProperties(u.properties,p)),u.context&&d.push(a.writeContext(u.context,p)),u.layout&&d.push(a.writeLayout(u.layout,p)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{n(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{n(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{n(o,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(t){return t.getAsync("components")}addBreakpoint(t){this.breakpoints.indexOf(t)===-1&&(this.breakpoints.push(t),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(t){const e=this.breakpoints.indexOf(t);e>-1&&(this.breakpoints.splice(e,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(t,e){this.switches[t.id]=e,this.events.dispatch("components:node-switched",{node:t,branch:e})}getBranch(t){return this.switches[t.id]}createNode(t,e={}){const s=new qt(this.events,t);return e.detached&&this.nodes.detached.push(s),s}components(){return new F(this)}actions(t,e){return new Et(this,t,e)}write(t){const{provider:e,target:s,attributes:n,options:r={},removable:o}=t,a=t.key||at(),h={changeset:[n,r],target:s,removes:[]};if(e){const c=this.providers[e];c.write(a,s,n,r),h.removes.push(()=>{c.remove(a)})}return this.changesets.push(h),this.nodes.all.forEach(c=>{if(s.match(c)){let l=()=>{};n.properties&&(l=c.writeProperties(n.properties,r,o)),n.context&&(l=c.writeContext(n.context,r,o)),n.layout&&(l=c.writeContext(n.layout,r,o)),h.removes.push(l)}}),()=>{if(o){h.removes.forEach(l=>l());const c=this.changesets.indexOf(h);c>-1&&this.changesets.splice(c,1)}}}addComponentHandler(t,e){this.customComponentHandler.add(t,e)}getComponentHandler(t){return this.customComponentHandler.get(t)}dispose(){this.subscriptions.forEach(t=>t())}}const Cs=i=>{if(Array.isArray(i)){const[t,...e]=i;return{definitionId:t,overrides:e}}return{definitionId:i,overrides:[]}},wt=(i,t,e,s,n,r)=>{e.forEach(o=>{const a=Cs(o),h=s[a.definitionId];if(a.definitionId==="view"){const c=i.createNode("view");c.name="view",Object.keys(n).forEach(l=>{const d=n[l];wt(i,c,[d.entry],s,n,l)}),t.appendChild(c),a.overrides.forEach(l=>{l.properties&&c.writeProperties(l.properties,{breakpoints:l.breakpoints}),l.context&&c.writeContext(l.context,{breakpoints:l.breakpoints}),l.layout&&c.writeLayout(l.layout,{breakpoints:l.breakpoints})})}else if(i.getComponentHandler(h.type)){const c=i.getComponentHandler(h.type);c&&c(a,{platform:i,node:t,references:e,definitions:s,views:n,branch:r})}else{const c=s[a.definitionId];if(process.env.NODE_ENV!=="production"&&!c){b.error(`No definition found for component type '${a.definitionId}'.`);return}const l=i.createNode(c.type);l.name=a.definitionId,l.tags=c.tags||[],c.properties&&l.writeProperties(c.properties),c.context&&l.writeContext(c.context),c.layout&&l.writeLayout(c.layout),t.appendChild(l,r),a.overrides.forEach(d=>{const u={breakpoints:d.breakpoints};d.properties&&l.writeProperties(d.properties,u),d.context&&l.writeContext(d.context,u),d.layout&&l.writeLayout(d.layout,u)}),c.children&&wt(i,l,c.children,s,n)}})},De=(i,t)=>{const{entry:e,components:s,breakpoints:n,views:r}=t,o=[];return Object.keys(n).forEach(a=>{const h=n[a],c=window.matchMedia(h);c.matches&&i.breakpoints.push(a);const l=d=>{d.matches?i.addBreakpoint(a):i.removeBreakpoint(a)};c.addListener(l),o.push(()=>c.removeListener(l))}),wt(i,i.nodes.root,[e],s,r),()=>o.forEach(a=>{a()})},Jt=(i,t)=>({id:i.id,type:i.type,name:i.name,branch:t||"default"}),Le=(i,t,e,s=at(),n={})=>i.getAsync("components").then(r=>{let o;if(typeof t=="string"){const c=new F(r);c.ofType(t),o=c}else o=t;const a={},h=c=>{const l=a[c.id];return l?Promise.resolve(l.controller):G.getInstance(i).then(d=>new Gt(d,c,s))};r.events.subscribe("components:node-enter",(c,{node:l})=>{o.match(l)&&h(l).then(d=>{Promise.resolve(e(d)).then(u=>{a[l.id]={dispose:u,controller:d}})})}),r.events.subscribe("components:node-exit",(c,{node:l})=>{const d=a[l.id];d&&(d.dispose&&d.dispose(),n.reuseController||(d.controller.dispose(),delete a[l.id]))})});class Os{constructor(t){this.aliases=new Map,this.components=new Map,this.logger=new b;const{events:e}=t.get("$widget");this.events=e}getComponent(t){const e=this.aliases.get(t),s=this.components.get(e||t)||null;return process.env.NODE_ENV!=="production"&&(s||this.logger.warn(e||t,`Unable to resolve component: "${e||t}". You most likely forgot to register the required plugin for: ${e||t}.`)),s}registerComponent(t,e){return this.components.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.components.delete(t)}}registerResolver(t,e){return this.events.subscribe("component-resolver:resolve",(s,n)=>{if(n===t){const r=this.getComponent(t);e(r)}})}registerAlias(t,e){return this.aliases.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.aliases.delete(t)}}}var w=(i=>(i.open="open",i.closed="closed",i.hidden="hidden",i))(w||{});const Yt=Object.freeze(Object.defineProperty({__proto__:null,ActionResolver:ys,ActionsController:Et,ComponentNode:qt,ComponentNodeController:Gt,ComponentPlatform:G,ComponentQuery:F,ComponentResolver:Os,WidgetRenderState:w,asDescriptor:Jt,createChildren:wt,createComponentModel:De,createEventSubscriber:ke,extendComponent:Le,findComponent:Me,findVisibleComponents:mt,traverseComponents:Ct},Symbol.toStringTag,{value:"Module"}));var f=(i=>(i.Cookie="cookie",i.Local="local",i.Session="session",i))(f||{}),Y=(i=>(i.Tenant="tenant",i.Implementation="implementation",i.Widget="widget",i))(Y||{}),m=(i=>(i.Necessary="necessary",i.Functional="functional",i.Analytical="analytical",i.Marketing="marketing",i))(m||{});const P=(i,t,e,s={})=>de(i,e).then(n=>(process.env.NODE_ENV!=="production"&&n&&b.warn(`createStorageWriter: Attempted to create storage writer using unallowed category.
|
|
4
4
|
Key: ${t}
|
|
5
5
|
Category: ${JSON.stringify(e)}
|
|
6
6
|
Options: ${JSON.stringify(s)}`),r=>(Xt(i),de(i,e).then(o=>{if(o){process.env.NODE_ENV!=="production"&&b.warn(`storageWriter: Attempted to write to storage using unallowed category.
|
|
7
7
|
Key: ${t}
|
|
8
8
|
Category: ${JSON.stringify(e)}
|
|
9
9
|
Value: ${JSON.stringify(r)}
|
|
10
|
-
Options: ${JSON.stringify(s)}`);return}const{scope:a=Y.Widget,medium:h=f.Session,duration:c}=s,l=Ps();return l[a][t]=Qt(r,e,c),h===f.Cookie?Ds(i,l):Is(i,h,l)})))),O=(i,t,e=f.Session)=>(Xt(i),typeof t>"u"?(process.env.NODE_ENV!=="production"&&b.warn("readStorage: Undefined key passed when reading storage. ",t,e),Promise.resolve(void 0)):e===f.Cookie?Ms(i).then(s
|
|
10
|
+
Options: ${JSON.stringify(s)}`);return}const{scope:a=Y.Widget,medium:h=f.Session,duration:c}=s,l=Ps();return l[a][t]=Qt(r,e,c),h===f.Cookie?Ds(i,l):Is(i,h,l)})))),O=(i,t,e=f.Session)=>(Xt(i),typeof t>"u"?(process.env.NODE_ENV!=="production"&&b.warn("readStorage: Undefined key passed when reading storage. ",t,e),Promise.resolve(void 0)):e===f.Cookie?Ms(i).then(s=>_t(s,t)):Ls(i,e).then(s=>_t(s,t))),W=i=>!!Object.entries(i).filter(([t,e])=>typeof e<"u").length,Rt=i=>Object.entries(i).filter(([t,e])=>typeof e<"u").forEach(([t,{value:e}])=>{typeof e>"u"&&delete i[t]}),Ie=(i,t)=>{const e={tenant:{...i.tenant,...t.tenant},implementation:{...i.implementation,...t.implementation},widget:{...i.widget,...t.widget}};return Rt(e.tenant),Rt(e.implementation),Rt(e.widget),e},Ss=i=>Object.entries(i).reduce((t,e)=>{const[s,n]=e;return Object.entries(n).forEach(r=>{const[o,{expiration:a}]=r;a&&t.push(a)}),t},[]).slice().sort((t,e)=>new Date(e).valueOf()-new Date(t).valueOf()).shift()||St(),Ot=i=>{const{name:t,implementation:{name:e,tenant:s}}=i.get("$widget");return[`humany_${s}`,`humany_${le(s+e)}`,`humany_${le(s+e+t)}`]},Tt=i=>{const t=new RegExp(`(?:^|;)\\s?${i}=(.*?)(?:;|$)`,"i"),e=document.cookie.match(t);return e&&e[1]&&JSON.parse(e[1])||void 0},jt=(i,t,e)=>{const s=`${i}=${JSON.stringify(t).trim()}`,n=`expires=${new Date(e).toUTCString()}`,r="path=/",o="SameSite=None;Secure";return document.cookie=`${s}; ${n}; ${r}; ${o}`},Zt=i=>{const[t,e,s]=Ot(i),n=Tt(t)||{},r=Tt(e)||{},o=Tt(s)||{};return{tenant:n,implementation:r,widget:o}},Re=(i,t)=>{const e=Zt(i),s=Ie(e,t),[n,r,o]=Ot(i),{tenant:a,implementation:h,widget:c}=s,l=Ss(t),d=St({days:-1});jt(n,a,W(a)?l:d),jt(r,h,W(h)?l:d),jt(o,c,W(c)?l:d)},$t=(i,t)=>{const[e,s,n]=Ot(i),r=t.getItem(e)||"{}",o=t.getItem(s)||"{}",a=t.getItem(n)||"{}";return{tenant:JSON.parse(r),implementation:JSON.parse(o),widget:JSON.parse(a)}},Kt=(i,t,e)=>{const s=$t(i,t),n=Ie(s,e),[r,o,a]=Ot(i),{tenant:h,implementation:c,widget:l}=n;W(h)?t.setItem(r,JSON.stringify(h)):t.removeItem(r),W(c)?t.setItem(o,JSON.stringify(c)):t.removeItem(o),W(l)?t.setItem(a,JSON.stringify(l)):t.removeItem(a);const{events:d}=i.get("$widget");d.dispatch("storage:changed",{})},Ps=()=>({tenant:{},implementation:{},widget:{}}),ks=i=>i?!!i&&new Date>new Date(i):!1,_t=(i,t)=>{const e=i.widget[t]||i.implementation[t]||i.tenant[t];return e==null?void 0:e.value},Qt=(i,t,e)=>e?{value:i,category:t,expiration:typeof e=="object"?St(e):e}:{value:i,category:t},ft=(i,t)=>{const e=Pe(i);return Object.entries(e).forEach(([s,n])=>{Object.entries(n).forEach(([r,o])=>{const{expiration:a,category:h}=o;(ks(a)||Ns(t,h))&&(n[r]=Qt(void 0,h,a))})}),e},de=(i,t)=>O(i,"storagePolicy",f.Cookie).then((e=[m.Necessary])=>!!t&&e.indexOf(t)===-1),Ns=(i=[m.Necessary],t)=>!!t&&i.indexOf(t)===-1,Xt=i=>{const t=Zt(i),e=$t(i,window.localStorage),s=$t(i,sessionStorage),n=_t(t,"storagePolicy"),[r,o,a]=[t,e,s].map(h=>ft(h,n));Re(i,r),Kt(i,window.localStorage,o),Kt(i,window.sessionStorage,a)},St=(i={days:30})=>{const{days:t=0,hours:e=0,minutes:s=0,seconds:n=0}=i,r=new Date;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()},Ms=i=>A(document)(()=>Zt(i)),Ds=(i,t)=>A(document)(()=>Re(i,t)),Ls=(i,t)=>{const e=t===f.Local?window.localStorage:window.sessionStorage;return A(e)(()=>$t(i,e))},Is=(i,t,e)=>{const s=t===f.Local?window.localStorage:window.sessionStorage;return A(s)(()=>Kt(i,s,e))};let yt=class{constructor(){this.memory={tenant:{},implementation:{},widget:{}}}async setItem(t,e,s={}){return A(this)(()=>{const n=ft(this.memory,[m.Necessary]),{scope:r=Y.Tenant,expiration:o}=s;n[r][t]=Qt(e,m.Necessary,(o==null?void 0:o.toISOString())||St()),this.memory=n,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value stored temporarily in memory.
|
|
11
11
|
Key: ${t}
|
|
12
12
|
Value: ${JSON.stringify(e)}
|
|
13
13
|
Options: ${JSON.stringify(s)}
|
|
14
|
-
Memory: ${JSON.stringify(n)}`)})}async getItem(t){return A(this)(()=>{const e=
|
|
14
|
+
Memory: ${JSON.stringify(n)}`)})}async getItem(t){return A(this)(()=>{const e=ft(this.memory,[m.Necessary]);process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value fetched from legacy memory storage.
|
|
15
15
|
Key: ${t}
|
|
16
|
-
Memory: ${JSON.stringify(e)}`);const s
|
|
16
|
+
Memory: ${JSON.stringify(e)}`);const s=_t(e,t);return this.memory=e,s})}async removeItem(t){return A(this)(()=>{const e=ft(this.memory,[m.Necessary]);delete e.tenant[t],delete e.implementation[t],delete e.widget[t],this.memory=e,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value removed from memory.
|
|
17
17
|
Key: ${t}
|
|
18
|
-
Memory: ${JSON.stringify(e)}`)})}async clear(){return Promise.resolve()}},Rs=class{constructor(){this.cookies=new
|
|
18
|
+
Memory: ${JSON.stringify(e)}`)})}async clear(){return Promise.resolve()}},Rs=class{constructor(){this.cookies=new yt,this.session=new yt,this.local=new yt}};Ft(i=>{i.createCommand("storage",t=>(e={})=>{const{consent:s}=e;if(typeof s<"u"){if(typeof s!="number"&&typeof s!="string"&&!Array.isArray(s)){process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
|
|
19
19
|
Passed consent: ${JSON.stringify(s)}`);return}if(Array.isArray(s)&&!s.every(r=>typeof r=="number"||typeof r=="string")){process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
|
|
20
20
|
Passed consent: ${JSON.stringify(s)}`);return}const n=[m.Necessary,m.Functional,m.Analytical,m.Marketing].filter((r,o,a)=>typeof s=="number"?s>o:typeof s=="string"?a.indexOf(s)+1>o:Array.isArray(s)?s.findIndex(h=>h===o+1||h===r)>-1:!0);return n.indexOf(m.Necessary)===-1&&(process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent does not include category: '${m.Necessary}'. Consent has to atleast include the '${m.Necessary}' category.
|
|
21
|
-
Passed consent: ${JSON.stringify(s)}`),n.unshift(m.Necessary)),P(t.container,"storagePolicy",m.Necessary,{medium:f.Cookie,scope:Y.Tenant,duration:{days:365}}).then(r=>r(n)).then(()=>{Xt(t.container),t.events.dispatch("storage:policy-changed",n)})}})});const Ts=Object.freeze(Object.defineProperty({__proto__:null,StorageCategory:m,StorageMedium:f,StorageProvider:Rs,StorageScope:Y,StorageService:
|
|
21
|
+
Passed consent: ${JSON.stringify(s)}`),n.unshift(m.Necessary)),P(t.container,"storagePolicy",m.Necessary,{medium:f.Cookie,scope:Y.Tenant,duration:{days:365}}).then(r=>r(n)).then(()=>{Xt(t.container),t.events.dispatch("storage:policy-changed",n)})}})});const Ts=Object.freeze(Object.defineProperty({__proto__:null,StorageCategory:m,StorageMedium:f,StorageProvider:Rs,StorageScope:Y,StorageService:yt,createStorageWriter:P,readStorage:O},Symbol.toStringTag,{value:"Module"})),js=i=>{const t=(n,r)=>{n&&(r?n.classList.add("ace-tabbing"):n.classList.remove("ace-tabbing"))},e=n=>{n.key==="Tab"?t(i,!0):n.key==="Enter"&&document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")||t(i,!1)},s=n=>{document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")&&document.activeElement.classList.contains("ace-tabbing")||t(i,!1)};return document.addEventListener("keydown",e),document.addEventListener("click",s),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",s)}};function Us(i,t){const{widgetName:e,label:s="",ariaLabel:n="",tooltip:r=""}=t;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),js(i)}function Hs(i,t){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=>{t&&e.setAttribute("title",t),e.classList.remove("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}function Vs(i){i instanceof HTMLElement?(i.classList.remove("ace-trigger-active"),i.classList.add("ace-trigger-loading")):i instanceof Array&&i.forEach(t=>{t.classList.remove("ace-trigger-active"),t.classList.add("ace-trigger-loading")})}function Te(i,t){i instanceof HTMLElement?(t&&i.setAttribute("title",t),i.classList.add("ace-trigger-active"),i.classList.remove("ace-trigger-loading")):i instanceof Array&&i.forEach(e=>{t&&e.setAttribute("title",t),e.classList.add("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2019 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/const
|
|
25
|
+
*/const vt=globalThis,te=vt.ShadowRoot&&(vt.ShadyCSS===void 0||vt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ee=Symbol(),ue=new WeakMap;let je=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ee)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(te&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=ue.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&ue.set(e,t))}return t}toString(){return this.cssText}};const zs=i=>new je(typeof i=="string"?i:i+"",void 0,ee),se=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,n,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[r+1],i[0]);return new je(e,i,ee)},Bs=(i,t)=>{if(te)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),n=vt.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)}},pe=te?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return zs(e)})(i):i;/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/const{is:Ws,defineProperty:qs,getOwnPropertyDescriptor:Js,getOwnPropertyNames:Ks,getOwnPropertySymbols:Fs,getPrototypeOf:Gs}=Object,M=globalThis,ge=M.trustedTypes,Ys=ge?ge.emptyScript:"",Ut=M.reactiveElementPolyfillSupport,
|
|
29
|
+
*/const{is:Ws,defineProperty:qs,getOwnPropertyDescriptor:Js,getOwnPropertyNames:Ks,getOwnPropertySymbols:Fs,getPrototypeOf:Gs}=Object,M=globalThis,ge=M.trustedTypes,Ys=ge?ge.emptyScript:"",Ut=M.reactiveElementPolyfillSupport,et=(i,t)=>i,xt={toAttribute(i,t){switch(t){case Boolean:i=i?Ys:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},ie=(i,t)=>!Ws(i,t),me={attribute:!0,type:String,converter:xt,reflect:!1,useDefault:!1,hasChanged:ie};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),M.litPropertyMetadata??(M.litPropertyMetadata=new WeakMap);let z=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=me){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&qs(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:r}=Js(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:n,set(o){const a=n==null?void 0:n.call(this);r==null||r.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??me}static _$Ei(){if(this.hasOwnProperty(et("elementProperties")))return;const t=Gs(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(et("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(et("properties"))){const e=this.properties,s=[...Ks(e),...Fs(e)];for(const n of s)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const n of s)e.unshift(pe(n))}else t!==void 0&&e.push(pe(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Bs(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var r;const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:xt).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r,o;const s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const a=s.getPropertyOptions(n),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:xt;this._$Em=n;const c=h.fromAttribute(e,a.type);this[n]=c??((o=this._$Ej)==null?void 0:o.get(n))??c,this._$Em=null}}requestUpdate(t,e,s,n=!1,r){var o;if(t!==void 0){const a=this.constructor;if(n===!1&&(r=this[t]),s??(s=a.getPropertyOptions(t)),!((s.hasChanged??ie)(r,e)||s.useDefault&&s.reflect&&r===((o=this._$Ej)==null?void 0:o.get(t))&&!this.hasAttribute(a._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:r},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),r!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n){const{wrapped:a}=o,h=this[r];a!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(e)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var n;return(n=s.hostUpdated)==null?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[et("elementProperties")]=new Map,z[et("finalized")]=new Map,Ut==null||Ut({ReactiveElement:z}),(M.reactiveElementVersions??(M.reactiveElementVersions=[])).push("2.1.2");/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/const
|
|
33
|
+
*/const st=globalThis,fe=i=>i,At=st.trustedTypes,ye=At?At.createPolicy("lit-html",{createHTML:i=>i}):void 0,Ue="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,He="?"+k,Zs=`<${He}>`,V=document,nt=()=>V.createComment(""),rt=i=>i===null||typeof i!="object"&&typeof i!="function",ne=Array.isArray,Qs=i=>ne(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Ht=`[
|
|
34
34
|
\f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ve=/-->/g,be=/>/g,I=RegExp(`>|${Ht}(?:([^\\s"'>=/]+)(${Ht}*=${Ht}*(?:[^
|
|
35
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),we=/'/g,$e=/"/g,Ve=/^(?:script|style|textarea|title)$/i,Xs=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),
|
|
35
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),we=/'/g,$e=/"/g,Ve=/^(?:script|style|textarea|title)$/i,Xs=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),tt=Xs(1),D=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),_e=new WeakMap,j=V.createTreeWalker(V,129);function ze(i,t){if(!ne(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ye!==void 0?ye.createHTML(t):t}const ti=(i,t)=>{const e=i.length-1,s=[];let n,r=t===2?"<svg>":t===3?"<math>":"",o=Z;for(let a=0;a<e;a++){const h=i[a];let c,l,d=-1,u=0;for(;u<h.length&&(o.lastIndex=u,l=o.exec(h),l!==null);)u=o.lastIndex,o===Z?l[1]==="!--"?o=ve:l[1]!==void 0?o=be:l[2]!==void 0?(Ve.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=I):l[3]!==void 0&&(o=I):o===I?l[0]===">"?(o=n??Z,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?I:l[3]==='"'?$e:we):o===$e||o===we?o=I:o===ve||o===be?o=Z:(o=I,n=void 0);const p=o===I&&i[a+1].startsWith("/>")?" ":"";r+=o===Z?h+Zs:d>=0?(s.push(c),h.slice(0,d)+Ue+h.slice(d)+k+p):h+k+(d===-2?a:p)}return[ze(i,r+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class ot{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let r=0,o=0;const a=t.length-1,h=this.parts,[c,l]=ti(t,e);if(this.el=ot.createElement(c,s),j.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(n=j.nextNode())!==null&&h.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const d of n.getAttributeNames())if(d.endsWith(Ue)){const u=l[o++],p=n.getAttribute(d).split(k),g=/([.?@])?(.*)/.exec(u);h.push({type:1,index:r,name:g[2],strings:p,ctor:g[1]==="."?si:g[1]==="?"?ii:g[1]==="@"?ni:Pt}),n.removeAttribute(d)}else d.startsWith(k)&&(h.push({type:6,index:r}),n.removeAttribute(d));if(Ve.test(n.tagName)){const d=n.textContent.split(k),u=d.length-1;if(u>0){n.textContent=At?At.emptyScript:"";for(let p=0;p<u;p++)n.append(d[p],nt()),j.nextNode(),h.push({type:2,index:++r});n.append(d[u],nt())}}}else if(n.nodeType===8)if(n.data===He)h.push({type:2,index:r});else{let d=-1;for(;(d=n.data.indexOf(k,d+1))!==-1;)h.push({type:7,index:r}),d+=k.length-1}r++}}static createElement(t,e){const s=V.createElement("template");return s.innerHTML=t,s}}function J(i,t,e=i,s){var o,a;if(t===D)return t;let n=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=rt(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==r&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),r===void 0?n=void 0:(n=new r(i),n._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=n:e._$Cl=n),n!==void 0&&(t=J(i,n._$AS(i,t.values),n,s)),t}class ei{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=((t==null?void 0:t.creationScope)??V).importNode(e,!0);j.currentNode=n;let r=j.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new ct(r,r.nextSibling,this,t):h.type===1?c=new h.ctor(r,h.name,h.strings,this,t):h.type===6&&(c=new ri(r,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(r=j.nextNode(),o++)}return j.currentNode=V,n}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class ct{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=J(this,t,e),rt(t)?t===y||t==null||t===""?(this._$AH!==y&&this._$AR(),this._$AH=y):t!==this._$AH&&t!==D&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Qs(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==y&&rt(this._$AH)?this._$AA.nextSibling.data=t:this.T(V.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=ot.createElement(ze(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===n)this._$AH.p(e);else{const o=new ei(n,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=_e.get(t.strings);return e===void 0&&_e.set(t.strings,e=new ot(t)),e}k(t){ne(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const r of t)n===e.length?e.push(s=new ct(this.O(nt()),this.O(nt()),this,this.options)):s=e[n],s._$AI(r),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const n=fe(t).nextSibling;fe(t).remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Pt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,n){const r=this.strings;let o=!1;if(r===void 0)t=J(this,t,e,0),o=!rt(t)||t!==this._$AH&&t!==D,o&&(this._$AH=t);else{const a=t;let h,c;for(t=r[0],h=0;h<r.length-1;h++)c=J(this,a[s+h],e,h),c===D&&(c=this._$AH[h]),o||(o=!rt(c)||c!==this._$AH[h]),c===y?t=y:t!==y&&(t+=(c??"")+r[h+1]),this._$AH[h]=c}o&&!n&&this.j(t)}j(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class si extends Pt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===y?void 0:t}}class ii extends Pt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==y)}}class ni extends Pt{constructor(t,e,s,n,r){super(t,e,s,n,r),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??y)===D)return;const s=this._$AH,n=t===y&&s!==y||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==y&&(s===y||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ri{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const Vt=st.litHtmlPolyfillSupport;Vt==null||Vt(ot,ct),(st.litHtmlVersions??(st.litHtmlVersions=[])).push("3.3.3");const oi=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let n=s._$litPart$;if(n===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=n=new ct(t.insertBefore(nt(),r),r,void 0,e??{})}return n._$AI(i),n};/**
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2017 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2017 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/const ai={attribute:!0,type:String,converter:
|
|
43
|
+
*/const ai={attribute:!0,type:String,converter:xt,reflect:!1,hasChanged:ie},ci=(i=ai,t,e)=>{const{kind:s,metadata:n}=e;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),r.set(e.name,i),s==="accessor"){const{name:o}=e;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,i,!0,a)},init(a){return a!==void 0&&this.C(o,void 0,i,a),a}}}if(s==="setter"){const{name:o}=e;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,i,!0,a)}}throw Error("Unsupported decorator location: "+s)};function K(i){return(t,e)=>typeof e=="object"?ci(i,t,e):((s,n,r)=>{const o=n.hasOwnProperty(r);return n.constructor.createProperty(r,s),o?Object.getOwnPropertyDescriptor(n,r):void 0})(i,t,e)}/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2018 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
-
*/const hi=We(class extends qe{constructor(i){var t;if(super(i),i.type!==Be.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var s,n;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(t)}const e=i.element.classList;for(const r of this.st)r in t||(e.remove(r),this.st.delete(r));for(const r in t){const o=!!t[r];o===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(o?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return D}}),
|
|
55
|
+
*/const hi=We(class extends qe{constructor(i){var t;if(super(i),i.type!==Be.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var s,n;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(t)}const e=i.element.classList;for(const r of this.st)r in t||(e.remove(r),this.st.delete(r));for(const r in t){const o=!!t[r];o===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(o?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return D}}),pt=(i,t,e)=>{i&&e.style.setProperty(t,i)},Je=(i,t)=>{var e,s,n,r;pt((e=i.colors)==null?void 0:e.primaryBackground,"--primary-background",t),pt((s=i.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",t),pt((n=i.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),pt((r=i.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var li=Object.defineProperty,ht=(i,t,e,s)=>{for(var n=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=o(t,e,n)||n);return n&&li(t,e,n),n};const oe=class oe extends q{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var e;const t=((e=this.container)==null?void 0:e.get("$settings"))??{};t!=null&&t.branding&&Je(t.branding,this)}async _renderSymbol(t){const e=async s=>await Promise.resolve().then(()=>require("./index-BG1RS3tz.js")).then(r=>r[s]);if(t){const{type:s,content:n}=t;switch(s){case"Telia":{const r=await e(n);return r?tt`<telia-icon
|
|
56
56
|
class="trigger-icon"
|
|
57
57
|
svg=${r.svg}
|
|
58
58
|
size="lg"
|
|
59
|
-
></telia-icon>`:y}case"FontAwesome":return
|
|
59
|
+
></telia-icon>`:y}case"FontAwesome":return tt`<i class="trigger-fa-icon fa fa-${n}"></i>`;case"Uri":return tt`<i
|
|
60
60
|
class="trigger-custom-icon"
|
|
61
61
|
style="background: url(${n}) no-repeat center center;background-size: contain;"
|
|
62
|
-
></i>`;default:return y}}}render(){return
|
|
62
|
+
></i>`;default:return y}}}render(){return tt`<button
|
|
63
63
|
class=${hi({trigger:!0,active:this.active,rendered:this.loaded})}
|
|
64
64
|
@click=${this._toggleActive}
|
|
65
65
|
>
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
align-items: center;
|
|
160
160
|
fill: var(--trigger-text-color, var(--text-on-primary-background));
|
|
161
161
|
}
|
|
162
|
-
`];let L=oe;ht([K({attribute:!1})],L.prototype,"symbol");ht([K({attribute:!1})],L.prototype,"container");ht([C()],L.prototype,"active");ht([C()],L.prototype,"loaded");ht([C()],L.prototype,"icon");var U=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(U||{});const di=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",Ke=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",ui=async(i,t,e,s,n,r=!1)=>{var l,d;const o=di(e,s),a=Ke(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},pi="modals";class gi{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===U.Badge&&Vs(e),Promise.resolve().then(()=>require("./render-DLT1GGkd.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===U.Badge){const r=this.options.triggerOptions.openTooltip;Te(e,r)}fs(this.container,t);const n=this.container.get("$environment").widgets.all();O(this.container,pi,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=Us(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 pt="changesets",mi=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 re{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,pt,m.Necessary,{medium:f.Local}).then(e=>new re(t,e))}write(t,e,s,n){return A(this)(()=>O(this.container,pt,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:mi(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,pt,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,pt,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 fi=i=>{const{container:t}=i;return re.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new G(i,n),o=De(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Se.Deactivating&&o()}),r})},yi=i=>Promise.resolve().then(()=>Ts).then(({StorageProvider:t})=>new t),vi=i=>Promise.resolve().then(()=>Yt).then(({ActionResolver:t})=>new t(i)),bi=i=>Promise.resolve().then(()=>Yt).then(({ComponentResolver:t})=>new t(i)),wi=i=>Promise.resolve().then(()=>Yt).then(()=>fi(i.get("$widget"))),Bt="$settings",Wt="open",xe="activeStickyWidget";class $i extends ps{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",()=>yi(this.container)),this.container.registerFactory("settings",()=>O(this.container,Bt,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),hs(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>bi(this.container)),this.container.registerAsync("actionResolver",()=>vi(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>wi(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=at(),triggerDOMElement:r,withRenderState:o}=t,h=Ke(e)===U.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await ui(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>v.querySelectorAll("[data-loading=true]").length===0,[v]=this.widget.container.get("widgetDOMElements"),x=(Nt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},lt={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(v,lt)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(v,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===U.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==U.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:v})=>{d.render().then(()=>this.renderState()).then(x=>v&&v.action&&v.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===U.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 gi(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,Bt,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,Bt,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,Wt,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,Wt,m.Necessary,{medium:f.Session}),P(this.container,Wt,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?Te(s,r):Hs(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,xe,f.Local).then(e=>e===this.widget.name?P(this.container,xe,m.Necessary,{medium:f.Local,scope:Y.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
|
|
162
|
+
`];let L=oe;ht([K({attribute:!1})],L.prototype,"symbol");ht([K({attribute:!1})],L.prototype,"container");ht([C()],L.prototype,"active");ht([C()],L.prototype,"loaded");ht([C()],L.prototype,"icon");var U=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(U||{});const di=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",Ke=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",ui=async(i,t,e,s,n,r=!1)=>{var l,d;const o=di(e,s),a=Ke(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},pi="modals";class gi{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===U.Badge&&Vs(e),Promise.resolve().then(()=>require("./render-BrvK4n7z.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===U.Badge){const r=this.options.triggerOptions.openTooltip;Te(e,r)}fs(this.container,t);const n=this.container.get("$environment").widgets.all();O(this.container,pi,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=Us(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 gt="changesets",mi=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 re{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,gt,m.Necessary,{medium:f.Local}).then(e=>new re(t,e))}write(t,e,s,n){return A(this)(()=>O(this.container,gt,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:mi(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,gt,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,gt,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 fi=i=>{const{container:t}=i;return re.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new G(i,n),o=De(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Se.Deactivating&&o()}),r})},yi=i=>Promise.resolve().then(()=>Ts).then(({StorageProvider:t})=>new t),vi=i=>Promise.resolve().then(()=>Yt).then(({ActionResolver:t})=>new t(i)),bi=i=>Promise.resolve().then(()=>Yt).then(({ComponentResolver:t})=>new t(i)),wi=i=>Promise.resolve().then(()=>Yt).then(()=>fi(i.get("$widget"))),Bt="$settings",Wt="open",xe="activeStickyWidget";class $i extends ps{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",()=>yi(this.container)),this.container.registerFactory("settings",()=>O(this.container,Bt,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),hs(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>bi(this.container)),this.container.registerAsync("actionResolver",()=>vi(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>wi(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=at(),triggerDOMElement:r,withRenderState:o}=t,h=Ke(e)===U.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await ui(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>v.querySelectorAll("[data-loading=true]").length===0,[v]=this.widget.container.get("widgetDOMElements"),x=(Nt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},lt={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(v,lt)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(v,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===U.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==U.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:v})=>{d.render().then(()=>this.renderState()).then(x=>v&&v.action&&v.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===U.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 gi(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,Bt,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,Bt,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,Wt,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,Wt,m.Necessary,{medium:f.Session}),P(this.container,Wt,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?Te(s,r):Hs(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,xe,f.Local).then(e=>e===this.widget.name?P(this.container,xe,m.Necessary,{medium:f.Local,scope:Y.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
|
|
@@ -195,4 +195,4 @@
|
|
|
195
195
|
* {
|
|
196
196
|
box-sizing: border-box;
|
|
197
197
|
}
|
|
198
|
-
`];let t=e;return R([Ai({context:Ze}),K({attribute:!1})],t.prototype,"container"),R([K()],t.prototype,"entry"),R([C()],t.prototype,"descriptor"),R([C()],t.prototype,"component"),R([C()],t.prototype,"context"),R([C()],t.prototype,"layout"),R([C()],t.prototype,"properties"),t};exports.A=y;exports.ActionsController=es;exports.DataProvider=ss;exports.E=D;exports.GuideProviderPlugin=Si;exports.Widget=$i;exports.WidgetComponent=Mi;exports.appendStyleFromProperties=is;exports.b=
|
|
198
|
+
`];let t=e;return R([Ai({context:Ze}),K({attribute:!1})],t.prototype,"container"),R([K()],t.prototype,"entry"),R([C()],t.prototype,"descriptor"),R([C()],t.prototype,"component"),R([C()],t.prototype,"context"),R([C()],t.prototype,"layout"),R([C()],t.prototype,"properties"),t};exports.A=y;exports.ActionsController=es;exports.DataProvider=ss;exports.E=D;exports.GuideProviderPlugin=Si;exports.Widget=$i;exports.WidgetComponent=Mi;exports.appendStyleFromProperties=is;exports.b=tt;exports.childrenContext=Ge;exports.containerContext=Ze;exports.contextCtx=Qe;exports.createDataProvider=Ci;exports.createLitComponent=Pi;exports.descriptorContext=Ye;exports.e=We;exports.i=qe;exports.i$1=q;exports.i$2=B;exports.i$3=se;exports.layoutCtx=Xe;exports.mapBranding=Je;exports.n=K;exports.ot=w;exports.propertiesCtx=ts;exports.r=C;exports.st=G;exports.t=Be;
|
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-XZDlBrO0.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 { h as a, D as o, j as r, G as s, j as i, W as n, k as d, c as C, l as c, p as x, q as p, u as l, v as W, w as g } from "./index-
|
|
1
|
+
import { h as a, D as o, j as r, G as s, j as i, W as n, k as d, c as C, l as c, p as x, q as p, u as l, v as W, w as g } from "./index-BqoIt4Pd.mjs";
|
|
2
2
|
export {
|
|
3
3
|
a as ActionsController,
|
|
4
4
|
o as DataProvider,
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as L, t as D, e as A, A as b, a as P, b as z, c as E, s as M, m as Y, o as f, d as g, f as R, n as N, r as u, E as w, W as j, g as T } from "./index-
|
|
1
|
+
import { i as L, t as D, e as A, A as b, a as P, b as z, c as E, s as M, m as Y, o as f, d as g, f as R, n as N, r as u, E as w, W as j, g as T } from "./index-BqoIt4Pd.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
@@ -90,10 +90,10 @@ const $ = /* @__PURE__ */ new WeakMap(), U = A(class extends G {
|
|
|
90
90
|
update(t, [e]) {
|
|
91
91
|
var n;
|
|
92
92
|
const s = e !== this.G;
|
|
93
|
-
return s && this.
|
|
93
|
+
return s && this.rt(void 0), (s || this.lt !== this.ct) && (this.G = e, this.ht = (n = t.options) == null ? void 0 : n.host, this.rt(this.ct = t.element)), b;
|
|
94
94
|
}
|
|
95
95
|
rt(t) {
|
|
96
|
-
if (this.isConnected || (t = void 0), typeof this.G == "function") {
|
|
96
|
+
if (this.G !== void 0) if (this.isConnected || (t = void 0), typeof this.G == "function") {
|
|
97
97
|
const e = this.ht ?? globalThis;
|
|
98
98
|
let s = $.get(e);
|
|
99
99
|
s === void 0 && (s = /* @__PURE__ */ new WeakMap(), $.set(e, s)), s.get(this.G) !== void 0 && this.G.call(this.ht, void 0), s.set(this.G, t), t !== void 0 && this.G.call(this.ht, t);
|
|
@@ -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-XZDlBrO0.js");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2020 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/const G=()=>new O;let O=class{};const v=new WeakMap,L=r.e(class extends C{render(t){return r.A}update(t,[e]){var n;const s=e!==this.G;return s&&this.
|
|
17
|
+
*/const G=()=>new O;let O=class{};const v=new WeakMap,L=r.e(class extends C{render(t){return r.A}update(t,[e]){var n;const s=e!==this.G;return s&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.G=e,this.ht=(n=t.options)==null?void 0:n.host,this.rt(this.ct=t.element)),r.A}rt(t){if(this.G!==void 0)if(this.isConnected||(t=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let s=v.get(e);s===void 0&&(s=new WeakMap,v.set(e,s)),s.get(this.G)!==void 0&&this.G.call(this.ht,void 0),s.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){var t,e;return typeof this.G=="function"?(t=v.get(this.ht??globalThis))==null?void 0:t.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),D=async t=>await t.get("$widget").invoke("renderState"),E=async(t,e)=>{const s=t.get("$widget");return(await t.getAsync("actionResolver")).subscribe(s.name,e)},M=(t,e,s=!1)=>{const n=t.reduce((a,{breakpoints:c=[],values:l})=>c.length?e.some(g=>c.includes(g))?{...a,...l}:a:{...a,...l},{}),i={},o=n.type;return i.height=n.height||"",i.width=n.width||"",n.type==="floating"||n.type==="inline"&&s&&(i.height="calc(100vh - 120px)"),{type:o,styles:i}};var z=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,d=(t,e,s,n)=>{for(var i=n>1?void 0:n?Y(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(i=(n?a(e,s,i):a(i))||i);return n&&i&&z(e,s,i),i};let h=class extends r.i$1{constructor(){super(),this._provider=new r.i$2(this,r.containerContext,void 0),this.wrapperRef=G(),this.breakpoints=[],this.breakpointsSet=!1}connectedCallback(){super.connectedCallback(),this._provider.setValue(this.container),this.container&&(D(this.container).then(t=>{this.renderState=t}),E(this.container,(t,e)=>{switch(e){case"close":case"open":this.renderState=e==="open"?r.ot.open:r.ot.closed;break;case"hide":this.renderState=r.ot.hidden}}).then(t=>{this._unsubscribeRenderState=t}),r.st.getInstance(this.container).then(t=>{this.componentPlatform=t,this.breakpoints=this.componentPlatform.breakpoints,this.breakpointsSet=!0,this._unsubscribePropChange=this.componentPlatform.events.subscribe("components:properties-changed",(e,s)=>{var n,i;((n=s==null?void 0:s.node)==null?void 0:n.type)==="root"&&(this.breakpoints=(i=this.componentPlatform)!=null&&i.breakpoints?[...this.componentPlatform.breakpoints]:[])}),this.entry=this.componentPlatform.nodes.root.children.default[0].id||void 0}))}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeRenderState&&this._unsubscribeRenderState(),this._unsubscribePropChange&&this._unsubscribePropChange()}applyBranding(){var t;if(this.wrapperRef.value){const e=(t=this.container)==null?void 0:t.get("$settings");e!=null&&e.branding&&r.mapBranding(e.branding,this.wrapperRef.value)}}render(){var e,s,n,i;let t;if(!this.entry||!this.breakpointsSet)return r.A;if(this.container&&this.renderState){const[o]=this.container.get("widgetDOMElements");o&&o.setAttribute("data-state",this.renderState)}if(this.container){const o=this.container.get("$settings");o!=null&&o.layout&&(t=M(o.layout,this.breakpoints,!!o.trigger),t.type==="floating"?(this.renderRoot.host.classList.add("floating"),this.renderRoot.host.classList.remove("inline")):(this.renderRoot.host.classList.add("inline"),this.renderRoot.host.classList.remove("floating")),Object.entries(t.styles).forEach(([a,c])=>{this.renderRoot.host.style.setProperty(a,c)}))}return this.renderState&&(this.renderState===r.ot.hidden?((e=this.wrapperRef.value)==null||e.classList.add("ace-hidden"),(s=this.wrapperRef.value)==null||s.classList.remove("ace-expanded")):((n=this.wrapperRef.value)==null||n.classList.remove("ace-hidden"),(i=this.wrapperRef.value)==null||i.classList.add("ace-expanded"))),this.applyBranding(),r.b`
|
|
18
18
|
<div class="widget-container" ${L(this.wrapperRef)}>
|
|
19
19
|
<ace-area entry=${this.entry}></ace-area>
|
|
20
20
|
</div>
|