@telia-ace/widget-types-grid 1.0.25-next.8 → 1.0.25
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/dist/index.js +296 -318
- package/dist/index.js.map +1 -1
- package/dist/{render.f2d6da89.js → render.95f13e79.js} +1 -1
- package/dist/render.95f13e79.js.map +1 -0
- package/dist/services.d.ts +0 -1
- package/dist/ui/styles.d.ts +1 -1
- package/package.json +60 -59
- package/dist/render.f2d6da89.js.map +0 -1
- package/dist/site-provider.d.ts +0 -5
package/dist/index.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
var ve = Object.defineProperty, Ee = Object.defineProperties;
|
|
2
2
|
var Ce = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var H = Object.getOwnPropertySymbols;
|
|
4
4
|
var re = Object.prototype.hasOwnProperty, ae = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var Z = (t, n, e) => n in t ? ve(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e, m = (t, n) => {
|
|
6
6
|
for (var e in n || (n = {}))
|
|
7
7
|
re.call(n, e) && Z(t, e, n[e]);
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
8
|
+
if (H)
|
|
9
|
+
for (var e of H(n))
|
|
10
10
|
ae.call(n, e) && Z(t, e, n[e]);
|
|
11
11
|
return t;
|
|
12
12
|
}, C = (t, n) => Ee(t, Ce(n));
|
|
13
13
|
var N = (t, n) => {
|
|
14
14
|
var e = {};
|
|
15
|
-
for (var
|
|
16
|
-
re.call(t,
|
|
17
|
-
if (t != null &&
|
|
18
|
-
for (var
|
|
19
|
-
n.indexOf(
|
|
15
|
+
for (var s in t)
|
|
16
|
+
re.call(t, s) && n.indexOf(s) < 0 && (e[s] = t[s]);
|
|
17
|
+
if (t != null && H)
|
|
18
|
+
for (var s of H(t))
|
|
19
|
+
n.indexOf(s) < 0 && ae.call(t, s) && (e[s] = t[s]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var L = (t, n, e) => (Z(t, typeof n != "symbol" ? n + "" : n, e), e);
|
|
23
23
|
import { css as de, ThemeProvider as Oe, useTheme as Se } from "@emotion/react";
|
|
24
|
-
import { asDescriptor as ce, ComponentPlatform as Ae, createComponentModel as
|
|
25
|
-
import { Grid as he, useRouteData as Me, useRouter as Ne, useProperties as pe, useContext as ne, useContainer as
|
|
26
|
-
import d, { useState as B, forwardRef as ge, useMemo as Ge, Suspense as
|
|
24
|
+
import { asDescriptor as ce, ComponentPlatform as Ae, createComponentModel as De, ComponentQuery as xe, WidgetRenderState as O } from "@telia-ace/widget-core";
|
|
25
|
+
import { Grid as he, useRouteData as Me, useRouter as Ne, useProperties as pe, useContext as ne, useContainer as j, useComponentNode as se, useScroll as me, transitionComposer as $e, paddedBorderTabStyle as Le, useComponent as ke, useComponentDescriptor as Pe, filterCssPropsStyle as Re, Typography as Ve, useComponentPlatform as fe, useIsMounted as _e, useColumns as Ie, useLayout as ze, ComponentNodeContext as Be, ComponentPropertyContext as Te, filterCssProps as je } from "@telia-ace/widget-ui";
|
|
26
|
+
import d, { useState as B, forwardRef as ge, useMemo as Ge, Suspense as We, useEffect as T } from "react";
|
|
27
27
|
import P from "@emotion/styled";
|
|
28
|
-
import { appendClassNames as Y, notifyDataLoaded as
|
|
28
|
+
import { appendClassNames as Y, notifyDataLoaded as Fe, lock as J, removeNullAndUndefinedValues as le, uuid as He } from "@telia-ace/widget-utilities";
|
|
29
29
|
import { TransitionGroup as Ke, Transition as Ue } from "react-transition-group";
|
|
30
30
|
import { Switch as Ye, Route as X } from "react-router";
|
|
31
31
|
import { onWidgetUrl as qe } from "@telia-ace/widget-routing";
|
|
32
|
-
import { readStorage as
|
|
32
|
+
import { readStorage as $, StorageMedium as E, createStorageWriter as _, StorageCategory as I, StorageScope as Qe } from "@telia-ace/widget-services";
|
|
33
33
|
import { supportBootstrapping as Ze } from "@webprovisions/bootstrapping";
|
|
34
34
|
import { WidgetState as Je, WidgetType as Xe } from "@webprovisions/platform";
|
|
35
35
|
var te = /* @__PURE__ */ ((t) => (t.back = "back", t.forth = "forth", t))(te || {});
|
|
36
|
-
const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[t] > e[n] ? "back" : "forth",
|
|
36
|
+
const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[t] > e[n] ? "back" : "forth", tt = ({ views: t, location: n, render: e }) => /* @__PURE__ */ d.createElement(Ye, {
|
|
37
37
|
location: n && C(m({}, n), {
|
|
38
38
|
pathname: n.pathname.split("?")[0]
|
|
39
39
|
})
|
|
40
40
|
}, [
|
|
41
|
-
...Object.keys(t).filter((
|
|
42
|
-
...Object.keys(t).filter((
|
|
43
|
-
].map((
|
|
44
|
-
const { path:
|
|
45
|
-
return
|
|
46
|
-
key:
|
|
41
|
+
...Object.keys(t).filter((s) => !!t[s].path),
|
|
42
|
+
...Object.keys(t).filter((s) => !t[s].path)
|
|
43
|
+
].map((s) => {
|
|
44
|
+
const { path: i } = t[s];
|
|
45
|
+
return i ? Array.isArray(i) ? i.map((o) => /* @__PURE__ */ d.createElement(X, {
|
|
46
|
+
key: s,
|
|
47
47
|
exact: !0,
|
|
48
48
|
path: o,
|
|
49
|
-
render: () => e(
|
|
49
|
+
render: () => e(s)
|
|
50
50
|
})) : /* @__PURE__ */ d.createElement(X, {
|
|
51
|
-
key:
|
|
51
|
+
key: s,
|
|
52
52
|
exact: !0,
|
|
53
|
-
path:
|
|
54
|
-
render: () => e(
|
|
53
|
+
path: i,
|
|
54
|
+
render: () => e(s)
|
|
55
55
|
}) : /* @__PURE__ */ d.createElement(X, {
|
|
56
|
-
key:
|
|
57
|
-
render: () => e(
|
|
56
|
+
key: s,
|
|
57
|
+
render: () => e(s)
|
|
58
58
|
});
|
|
59
|
-
})), tt = P.div`
|
|
59
|
+
})), ye = tt, nt = P.div`
|
|
60
60
|
position: relative;
|
|
61
61
|
width: 100%;
|
|
62
62
|
flex: 1;
|
|
63
|
-
`,
|
|
63
|
+
`, st = P(he)`
|
|
64
64
|
position: absolute;
|
|
65
65
|
left: 0;
|
|
66
66
|
right: 0;
|
|
@@ -74,33 +74,33 @@ const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[
|
|
|
74
74
|
contact: 5,
|
|
75
75
|
"contact-method": 6,
|
|
76
76
|
conversation: 7
|
|
77
|
-
},
|
|
78
|
-
var
|
|
79
|
-
const [
|
|
77
|
+
}, ot = (e) => {
|
|
78
|
+
var s = e, { className: t = "" } = s, n = N(s, ["className"]);
|
|
79
|
+
const [i, o] = B("index"), [r, a] = B(te.forth), c = Me(), h = Ne(), u = pe(), l = ne(), p = j(), f = se(), { gap: w = "0" } = l, F = u, { columns: y = 1, animation: g = "none", scrollable: b = !1 } = F, S = N(F, ["columns", "animation", "scrollable"]), [G, R] = me(b);
|
|
80
80
|
if (!f || !h)
|
|
81
81
|
return null;
|
|
82
|
-
const { location:
|
|
83
|
-
c.name !==
|
|
84
|
-
const { views:
|
|
85
|
-
if (!Object.keys(
|
|
82
|
+
const { location: W } = h;
|
|
83
|
+
c.name !== i && c.name !== "" && g && (a(et(i, c.name, it)), o(c.name));
|
|
84
|
+
const { views: D } = p.get("$settings");
|
|
85
|
+
if (!Object.keys(D).length)
|
|
86
86
|
return null;
|
|
87
|
-
const
|
|
87
|
+
const x = (v, M, V) => {
|
|
88
88
|
const A = Q(M, V), z = f.getChildren(v)[0];
|
|
89
|
-
return /* @__PURE__ */ d.createElement(
|
|
89
|
+
return /* @__PURE__ */ d.createElement(st, C(m(C(m(m({}, n), S), {
|
|
90
90
|
scrollableCss: G,
|
|
91
91
|
ref: R,
|
|
92
92
|
columns: y,
|
|
93
93
|
gap: w
|
|
94
94
|
}), A), {
|
|
95
95
|
className: Y(t, "humany-view")
|
|
96
|
-
}), /* @__PURE__ */ d.createElement(
|
|
96
|
+
}), /* @__PURE__ */ d.createElement(ie, {
|
|
97
97
|
id: z.id,
|
|
98
98
|
branch: "default"
|
|
99
99
|
}));
|
|
100
100
|
}, Q = (v, M) => {
|
|
101
101
|
if (g === "slide" || g === "fade")
|
|
102
102
|
return {
|
|
103
|
-
animationCss:
|
|
103
|
+
animationCss: $e.composeViewTransition(
|
|
104
104
|
v,
|
|
105
105
|
g,
|
|
106
106
|
M
|
|
@@ -108,45 +108,45 @@ const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[
|
|
|
108
108
|
["data-state"]: v
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
-
return /* @__PURE__ */ d.createElement(
|
|
111
|
+
return /* @__PURE__ */ d.createElement(nt, {
|
|
112
112
|
className: "humany-animated-view"
|
|
113
113
|
}, /* @__PURE__ */ d.createElement(Ke, {
|
|
114
114
|
component: null,
|
|
115
115
|
childFactory: (v) => d.cloneElement(v, { direction: r })
|
|
116
116
|
}, /* @__PURE__ */ d.createElement(Ue, {
|
|
117
|
-
key:
|
|
117
|
+
key: i,
|
|
118
118
|
timeout: { enter: 500, exit: 500 },
|
|
119
119
|
onEnter: (v) => v == null ? void 0 : v.clientHeight,
|
|
120
120
|
unmountOnExit: !0,
|
|
121
121
|
direction: te.forth
|
|
122
122
|
}, (v, { direction: M }) => /* @__PURE__ */ d.createElement(ye, {
|
|
123
|
-
views:
|
|
124
|
-
location:
|
|
125
|
-
render: (V) =>
|
|
123
|
+
views: D,
|
|
124
|
+
location: W,
|
|
125
|
+
render: (V) => x(V, v, M)
|
|
126
126
|
}))));
|
|
127
|
-
}, ot = P(he)`
|
|
127
|
+
}, rt = ot, at = P(he)`
|
|
128
128
|
${(t) => !!t.scrollableCss && t.scrollableCss}
|
|
129
|
-
`,
|
|
130
|
-
var
|
|
131
|
-
const
|
|
132
|
-
return a ? /* @__PURE__ */ d.createElement(
|
|
129
|
+
`, ct = (e) => {
|
|
130
|
+
var s = e, { className: t = "" } = s, n = N(s, ["className"]);
|
|
131
|
+
const i = pe(), o = ne(), r = j(), a = se(), { views: c } = r.get("$settings"), { gap: h = "0" } = o, g = i, { columns: u = 1, animation: l = "none", scrollable: p = !1 } = g, f = N(g, ["columns", "animation", "scrollable"]), [w, y] = me(p);
|
|
132
|
+
return a ? /* @__PURE__ */ d.createElement(at, C(m(m({}, n), f), {
|
|
133
133
|
scrollableCss: w,
|
|
134
134
|
ref: y,
|
|
135
|
-
columns:
|
|
135
|
+
columns: u,
|
|
136
136
|
gap: h,
|
|
137
137
|
className: Y(t, "humany-view")
|
|
138
138
|
}), /* @__PURE__ */ d.createElement(ye, {
|
|
139
139
|
views: c,
|
|
140
140
|
render: (b) => {
|
|
141
141
|
const S = a.getChildren(b)[0];
|
|
142
|
-
return /* @__PURE__ */ d.createElement(
|
|
142
|
+
return /* @__PURE__ */ d.createElement(ie, {
|
|
143
143
|
id: S.id,
|
|
144
144
|
node: S,
|
|
145
145
|
branch: "default"
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
})) : null;
|
|
149
|
-
}, q = (t) => {
|
|
149
|
+
}, lt = ct, q = (t) => {
|
|
150
150
|
var n, e;
|
|
151
151
|
return de`
|
|
152
152
|
outline: none;
|
|
@@ -171,40 +171,40 @@ const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[
|
|
|
171
171
|
`}
|
|
172
172
|
|
|
173
173
|
&:focus-visible {
|
|
174
|
-
${
|
|
174
|
+
${Le(t)};
|
|
175
175
|
}
|
|
176
176
|
`;
|
|
177
|
-
},
|
|
177
|
+
}, ut = P(lt)`
|
|
178
178
|
${(t) => q(t)}
|
|
179
|
-
`,
|
|
179
|
+
`, dt = P(rt)`
|
|
180
180
|
${(t) => q(t)}
|
|
181
|
-
`,
|
|
181
|
+
`, ht = P.div`
|
|
182
182
|
text-align: center;
|
|
183
183
|
${(t) => {
|
|
184
|
-
var n, e,
|
|
184
|
+
var n, e, s;
|
|
185
185
|
return typeof ((n = t.theme.colors) == null ? void 0 : n.warning) != "undefined" && de`
|
|
186
186
|
color: ${(e = t.theme.colors) == null ? void 0 : e.warning};
|
|
187
|
-
border: 2px dashed ${(
|
|
187
|
+
border: 2px dashed ${(s = t.theme.colors) == null ? void 0 : s.warning};
|
|
188
188
|
`;
|
|
189
189
|
}}
|
|
190
190
|
${(t) => typeof t.theme.borderRadius != "undefined" && `border-radius: ${t.theme.borderRadius};`}
|
|
191
191
|
${(t) => q(t)}
|
|
192
|
-
`,
|
|
193
|
-
(
|
|
194
|
-
var o =
|
|
195
|
-
const r = ke(), { name: a, type: c, id: h } = Pe(),
|
|
192
|
+
`, pt = ge(
|
|
193
|
+
(i, s) => {
|
|
194
|
+
var o = i, { className: t = "", children: n } = o, e = N(o, ["className", "children"]);
|
|
195
|
+
const r = ke(), { name: a, type: c, id: h } = Pe(), u = Ge(() => r ? P(r)`
|
|
196
196
|
${q}
|
|
197
197
|
${Re}
|
|
198
198
|
` : null, [r]);
|
|
199
|
-
return typeof r == "undefined" ? null : r === null ||
|
|
199
|
+
return typeof r == "undefined" ? null : r === null || u === null ? process.env.NODE_ENV !== "production" ? /* @__PURE__ */ d.createElement(ht, C(m({}, e), {
|
|
200
200
|
title: `type: ${c}, definition-id: ${a}, instance-id: ${h}`,
|
|
201
201
|
className: Y(t, "humany-non-resolved-component")
|
|
202
202
|
}), /* @__PURE__ */ d.createElement(Ve, {
|
|
203
203
|
variant: "h5"
|
|
204
|
-
}, "Non Resolved Component Type")) : null : /* @__PURE__ */ d.createElement(
|
|
204
|
+
}, "Non Resolved Component Type")) : null : /* @__PURE__ */ d.createElement(We, {
|
|
205
205
|
fallback: null
|
|
206
|
-
}, /* @__PURE__ */ d.createElement(
|
|
207
|
-
ref:
|
|
206
|
+
}, /* @__PURE__ */ d.createElement(u, C(m({
|
|
207
|
+
ref: s
|
|
208
208
|
}, e), {
|
|
209
209
|
className: Y(
|
|
210
210
|
t,
|
|
@@ -213,78 +213,78 @@ const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[
|
|
|
213
213
|
)
|
|
214
214
|
}), n));
|
|
215
215
|
}
|
|
216
|
-
),
|
|
217
|
-
const n =
|
|
218
|
-
return
|
|
219
|
-
n && o.current &&
|
|
220
|
-
}, [n, t, o]),
|
|
216
|
+
), mt = pt, ft = (t) => {
|
|
217
|
+
const n = se(t), e = fe(), [s, i] = B({}), o = _e();
|
|
218
|
+
return T(() => {
|
|
219
|
+
n && o.current && i(n.attributes.properties);
|
|
220
|
+
}, [n, t, o]), T(() => {
|
|
221
221
|
if (e) {
|
|
222
222
|
const r = e.events.subscribe(
|
|
223
223
|
"components:properties-changed",
|
|
224
224
|
(a, c) => {
|
|
225
|
-
n === c.node && o.current &&
|
|
225
|
+
n === c.node && o.current && i(c.node.attributes.properties);
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
228
|
return () => {
|
|
229
229
|
r();
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
}, [e, o, t, n]),
|
|
233
|
-
},
|
|
232
|
+
}, [e, o, t, n]), s;
|
|
233
|
+
}, gt = (t, n) => n ? !0 : typeof t == "string" ? t === "full" : t > 0, yt = ge(
|
|
234
234
|
(h, c) => {
|
|
235
|
-
var
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
if (
|
|
239
|
-
if (n && !
|
|
240
|
-
const A =
|
|
235
|
+
var u = h, { className: t = "", id: n, branch: e, node: s, ariaLabel: i, tabIndex: o, context: r } = u, a = N(u, ["className", "id", "branch", "node", "ariaLabel", "tabIndex", "context"]);
|
|
236
|
+
const l = fe(), p = j(), [f, w] = B(), y = Ie(), g = ne(n), b = ft(n), { size: S = "none", indent: G = 0 } = ze(n), R = gt(S, s);
|
|
237
|
+
if (T(() => {
|
|
238
|
+
if (l) {
|
|
239
|
+
if (n && !s) {
|
|
240
|
+
const A = l.nodes.get(n);
|
|
241
241
|
if (A && (w(ce(A, e)), R)) {
|
|
242
242
|
const z = A.mount(p);
|
|
243
243
|
return () => {
|
|
244
244
|
z();
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
} else if (
|
|
248
|
-
w(ce(
|
|
249
|
-
const A =
|
|
247
|
+
} else if (s) {
|
|
248
|
+
w(ce(s, e));
|
|
249
|
+
const A = s.mount(p);
|
|
250
250
|
return () => {
|
|
251
251
|
A();
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
}, [
|
|
255
|
+
}, [l, n, s, R]), !f || !R)
|
|
256
256
|
return null;
|
|
257
257
|
const V = m(m({}, g), r || {}), {
|
|
258
|
-
cardinal:
|
|
259
|
-
fonts:
|
|
258
|
+
cardinal: D,
|
|
259
|
+
fonts: x = {},
|
|
260
260
|
accessibility: Q = {}
|
|
261
|
-
} = V,
|
|
261
|
+
} = V, F = N(V, [
|
|
262
262
|
"cardinal",
|
|
263
263
|
"fonts",
|
|
264
264
|
"accessibility"
|
|
265
265
|
]), v = {
|
|
266
|
-
type:
|
|
267
|
-
base:
|
|
268
|
-
small:
|
|
269
|
-
normal:
|
|
270
|
-
medium:
|
|
271
|
-
large:
|
|
272
|
-
huge:
|
|
273
|
-
}, M = C(m({},
|
|
266
|
+
type: x.type,
|
|
267
|
+
base: x.base || "16px",
|
|
268
|
+
small: x.small || "0.8em",
|
|
269
|
+
normal: x.normal || "1em",
|
|
270
|
+
medium: x.medium || "1.2em",
|
|
271
|
+
large: x.large || "1.6em",
|
|
272
|
+
huge: x.huge || "2.5em"
|
|
273
|
+
}, M = C(m({}, F), {
|
|
274
274
|
fonts: v,
|
|
275
275
|
accessibility: m({}, Q)
|
|
276
276
|
});
|
|
277
|
-
return typeof
|
|
278
|
-
cardinal:
|
|
279
|
-
small: `${
|
|
280
|
-
normal: `${
|
|
281
|
-
medium: `${
|
|
282
|
-
large: `${
|
|
277
|
+
return typeof D == "number" && (M.sizes = {
|
|
278
|
+
cardinal: D,
|
|
279
|
+
small: `${D}px`,
|
|
280
|
+
normal: `${D * 3}px`,
|
|
281
|
+
medium: `${D * 5}px`,
|
|
282
|
+
large: `${D * 8}px`
|
|
283
283
|
}), /* @__PURE__ */ d.createElement(Oe, {
|
|
284
284
|
theme: M
|
|
285
285
|
}, /* @__PURE__ */ d.createElement(Be.Provider, {
|
|
286
286
|
value: f
|
|
287
|
-
}, /* @__PURE__ */ d.createElement(
|
|
287
|
+
}, /* @__PURE__ */ d.createElement(Te.Provider, {
|
|
288
288
|
value: b
|
|
289
289
|
}, (() => {
|
|
290
290
|
const A = m({
|
|
@@ -293,21 +293,21 @@ const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[
|
|
|
293
293
|
"data-name": f.name,
|
|
294
294
|
"data-node-id": f.id,
|
|
295
295
|
"data-component-type": f.type,
|
|
296
|
-
"aria-label":
|
|
296
|
+
"aria-label": i,
|
|
297
297
|
tabIndex: o,
|
|
298
298
|
id: f.id,
|
|
299
299
|
role: b && b.role
|
|
300
300
|
}, a);
|
|
301
301
|
switch (f.type) {
|
|
302
302
|
case "view":
|
|
303
|
-
return typeof b.animation == "string" && b.animation !== "none" ? /* @__PURE__ */ d.createElement(
|
|
303
|
+
return typeof b.animation == "string" && b.animation !== "none" ? /* @__PURE__ */ d.createElement(dt, C(m({}, A), {
|
|
304
304
|
className: t
|
|
305
|
-
})) : /* @__PURE__ */ d.createElement(
|
|
305
|
+
})) : /* @__PURE__ */ d.createElement(ut, C(m({}, A), {
|
|
306
306
|
className: t
|
|
307
307
|
}));
|
|
308
308
|
default: {
|
|
309
|
-
const z =
|
|
310
|
-
return /* @__PURE__ */ d.createElement(
|
|
309
|
+
const z = je(b);
|
|
310
|
+
return /* @__PURE__ */ d.createElement(mt, C(m(m({
|
|
311
311
|
ref: c
|
|
312
312
|
}, A), z), {
|
|
313
313
|
className: t
|
|
@@ -316,55 +316,55 @@ const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[
|
|
|
316
316
|
}
|
|
317
317
|
})())));
|
|
318
318
|
}
|
|
319
|
-
),
|
|
320
|
-
const n =
|
|
321
|
-
return
|
|
322
|
-
n.getAsync("components").then((
|
|
323
|
-
|
|
319
|
+
), ie = yt, bt = ({ builder: t }) => {
|
|
320
|
+
const n = j(), [e, s] = B(null);
|
|
321
|
+
return T(() => {
|
|
322
|
+
n.getAsync("components").then((i) => t(i).then((o) => {
|
|
323
|
+
s(o);
|
|
324
324
|
}));
|
|
325
|
-
}, []),
|
|
326
|
-
e && n.getAsync("components").then((
|
|
327
|
-
|
|
325
|
+
}, []), T(() => () => {
|
|
326
|
+
e && n.getAsync("components").then((i) => {
|
|
327
|
+
i.nodes.detached = i.nodes.detached.filter(
|
|
328
328
|
(o) => o.id !== e.id
|
|
329
329
|
);
|
|
330
330
|
});
|
|
331
|
-
}, [e]), e ? /* @__PURE__ */ d.createElement(
|
|
331
|
+
}, [e]), e ? /* @__PURE__ */ d.createElement(ie, {
|
|
332
332
|
id: e.id,
|
|
333
333
|
node: e,
|
|
334
334
|
branch: "default"
|
|
335
335
|
}) : null;
|
|
336
|
-
},
|
|
336
|
+
}, wt = bt, vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
337
337
|
__proto__: null,
|
|
338
|
-
default:
|
|
339
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
340
|
-
const n = Se(), e =
|
|
338
|
+
default: wt
|
|
339
|
+
}, Symbol.toStringTag, { value: "Module" })), Et = d.lazy(() => Promise.resolve().then(() => vt)), Ct = ({ showSearch: t = !1 }) => {
|
|
340
|
+
const n = Se(), e = j();
|
|
341
341
|
return /* @__PURE__ */ d.createElement(d.Suspense, {
|
|
342
342
|
fallback: null
|
|
343
|
-
}, /* @__PURE__ */ d.createElement(
|
|
344
|
-
builder: (
|
|
343
|
+
}, /* @__PURE__ */ d.createElement(Et, {
|
|
344
|
+
builder: (s) => e.get("settings").then((i) => {
|
|
345
345
|
var h;
|
|
346
|
-
const { properties: o, context: r } = Object.keys(
|
|
347
|
-
(
|
|
346
|
+
const { properties: o, context: r } = Object.keys(i.components).reduce(
|
|
347
|
+
(u, l) => (i.components[l].type === "not-found" && (u.properties = i.components[l].properties, u.context = i.components[l].context), u),
|
|
348
348
|
{ properties: {}, context: {} }
|
|
349
349
|
);
|
|
350
350
|
o.showSearch = t;
|
|
351
|
-
const a =
|
|
351
|
+
const a = s.createNode("area", { detached: !0 });
|
|
352
352
|
if (a.name = "not-found-area", a.writeLayout({
|
|
353
353
|
size: "full"
|
|
354
354
|
}), t) {
|
|
355
|
-
const
|
|
356
|
-
(p, f) =>
|
|
355
|
+
const u = Object.keys(i.components).reduce(
|
|
356
|
+
(p, f) => i.components[f].type === "search" ? i.components[f].properties : p,
|
|
357
357
|
{}
|
|
358
|
-
),
|
|
359
|
-
|
|
358
|
+
), l = s.createNode("search", { detached: !0 });
|
|
359
|
+
l.writeLayout({ size: "full" }), l.writeProperties(m({
|
|
360
360
|
"css-margin-bottom": ((h = n == null ? void 0 : n.sizes) == null ? void 0 : h.normal) || "15px"
|
|
361
|
-
},
|
|
361
|
+
}, u)), a.appendChild(l);
|
|
362
362
|
}
|
|
363
|
-
const c =
|
|
363
|
+
const c = s.createNode("not-found", { detached: !0 });
|
|
364
364
|
return c.writeLayout({ size: "full" }), c.writeProperties(o), c.writeContext(r), a.appendChild(c), a;
|
|
365
365
|
})
|
|
366
366
|
}));
|
|
367
|
-
},
|
|
367
|
+
}, Jt = Ct, Ot = (t) => {
|
|
368
368
|
if (t) {
|
|
369
369
|
const { type: n, content: e } = t;
|
|
370
370
|
switch (n) {
|
|
@@ -376,22 +376,22 @@ const et = (t, n, e) => typeof e[t] == "number" && typeof e[n] == "number" && e[
|
|
|
376
376
|
return "";
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
},
|
|
380
|
-
const n = (
|
|
381
|
-
!
|
|
382
|
-
}, e = (
|
|
383
|
-
|
|
384
|
-
},
|
|
379
|
+
}, St = (t) => {
|
|
380
|
+
const n = (i, o) => {
|
|
381
|
+
!i || (o ? i.classList.add("humany-tabbing") : i.classList.remove("humany-tabbing"));
|
|
382
|
+
}, e = (i) => {
|
|
383
|
+
i.key === "Tab" ? n(t, !0) : i.key === "Enter" && document.activeElement && document.activeElement.classList.contains("humany-trigger") || n(t, !1);
|
|
384
|
+
}, s = (i) => {
|
|
385
385
|
document.activeElement && document.activeElement.classList.contains("humany-trigger") && document.activeElement.classList.contains("humany-tabbing") || n(t, !1);
|
|
386
386
|
};
|
|
387
|
-
return document.addEventListener("keydown", e), document.addEventListener("click",
|
|
388
|
-
document.removeEventListener("keydown", e), document.removeEventListener("click",
|
|
387
|
+
return document.addEventListener("keydown", e), document.addEventListener("click", s), () => {
|
|
388
|
+
document.removeEventListener("keydown", e), document.removeEventListener("click", s);
|
|
389
389
|
};
|
|
390
390
|
};
|
|
391
|
-
function
|
|
392
|
-
const { symbol: e, widgetName:
|
|
393
|
-
t.classList.add("humany-trigger"), t.classList.add(`humany_${
|
|
394
|
-
const a =
|
|
391
|
+
function At(t, n) {
|
|
392
|
+
const { symbol: e, widgetName: s, label: i = "", ariaLabel: o = "", tooltip: r = "" } = n;
|
|
393
|
+
t.classList.add("humany-trigger"), t.classList.add(`humany_${s}`), i.length && t.classList.add("humany-has-text"), o.length && !t.getAttribute("aria-label") && t.setAttribute("aria-label", o), o.length && !t.getAttribute("tabindex") && t.setAttribute("tabindex", "0"), r.length && !t.getAttribute("title") && t.setAttribute("title", r);
|
|
394
|
+
const a = Ot(e) || "";
|
|
395
395
|
return t.innerHTML = `${a}
|
|
396
396
|
<span class="humany-close">
|
|
397
397
|
<svg width="18" height="9" viewBox="0 0 18 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -410,14 +410,14 @@ function bt(t, n) {
|
|
|
410
410
|
stroke-miterlimit="10" />
|
|
411
411
|
</svg>
|
|
412
412
|
</span>
|
|
413
|
-
${
|
|
413
|
+
${i.length ? `<span>${i}</span>` : ""}`, setTimeout(() => t && t.classList.add("humany-rendered")), St(t);
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Dt(t, n) {
|
|
416
416
|
t instanceof HTMLElement ? (n && t.setAttribute("title", n), t.classList.remove("humany-active"), t.classList.remove("humany-loading")) : t instanceof Array && t.forEach((e) => {
|
|
417
417
|
n && e.setAttribute("title", n), e.classList.remove("humany-active"), e.classList.remove("humany-loading");
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function xt(t) {
|
|
421
421
|
t instanceof HTMLElement ? (t.classList.remove("humany-active"), t.classList.add("humany-loading")) : t instanceof Array && t.forEach((n) => {
|
|
422
422
|
n.classList.remove("humany-active"), n.classList.add("humany-loading");
|
|
423
423
|
});
|
|
@@ -428,12 +428,12 @@ function be(t, n) {
|
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
430
|
var k = /* @__PURE__ */ ((t) => (t.Inline = "inline", t.Link = "link", t.Badge = "badge", t.Unsupported = "unsupported", t))(k || {});
|
|
431
|
-
const
|
|
432
|
-
var h,
|
|
433
|
-
const o =
|
|
431
|
+
const Mt = (t, n) => t && n ? "both" : t ? "widgetDOM" : n ? "triggerDOM" : "none", we = (t) => t ? typeof t == "boolean" && t ? "link" : typeof t == "object" && !Array.isArray(t) ? "badge" : "unsupported" : "inline", Nt = (t, n, e, s, i = !1) => {
|
|
432
|
+
var h, u;
|
|
433
|
+
const o = Mt(
|
|
434
434
|
n,
|
|
435
435
|
e
|
|
436
|
-
), r = we(
|
|
436
|
+
), r = we(s), a = {
|
|
437
437
|
widgetDOMElement: n ? n.cloneNode(!0) : void 0,
|
|
438
438
|
triggerDOMElement: e ? e.cloneNode(!0) : void 0
|
|
439
439
|
}, c = {
|
|
@@ -448,28 +448,28 @@ const Et = (t, n) => t && n ? "both" : t ? "widgetDOM" : n ? "triggerDOM" : "non
|
|
|
448
448
|
}
|
|
449
449
|
case "widgetDOM": {
|
|
450
450
|
if (c.widgetDOMElement = n || document.createElement("div"), r !== "inline") {
|
|
451
|
-
const
|
|
452
|
-
r === "link" && (
|
|
451
|
+
const l = document.body.appendChild(document.createElement("a"));
|
|
452
|
+
r === "link" && (l.innerText = t), c.triggerDOMElement = l;
|
|
453
453
|
}
|
|
454
454
|
break;
|
|
455
455
|
}
|
|
456
456
|
case "triggerDOM": {
|
|
457
|
-
const
|
|
458
|
-
c.widgetDOMElement =
|
|
457
|
+
const l = document.createElement("div");
|
|
458
|
+
c.widgetDOMElement = l, r === "inline" ? (l.id = (e == null ? void 0 : e.id) || "", i ? (l.style.display = "none", (h = e == null ? void 0 : e.parentNode) == null || h.appendChild(l), c.callback = () => {
|
|
459
459
|
var p;
|
|
460
460
|
(p = e == null ? void 0 : e.parentNode) == null || p.replaceChild(
|
|
461
|
-
|
|
461
|
+
l,
|
|
462
462
|
e
|
|
463
|
-
),
|
|
464
|
-
}) : (
|
|
465
|
-
|
|
463
|
+
), l.style.display = (e == null ? void 0 : e.style.display) || "block";
|
|
464
|
+
}) : (u = e == null ? void 0 : e.parentNode) == null || u.replaceChild(
|
|
465
|
+
l,
|
|
466
466
|
e
|
|
467
|
-
), c.cachedOriginals.widgetDOMElement = e, c.cachedOriginals.triggerDOMElement = void 0) : (c.widgetDOMElement = document.body.appendChild(
|
|
467
|
+
), c.cachedOriginals.widgetDOMElement = e, c.cachedOriginals.triggerDOMElement = void 0) : (c.widgetDOMElement = document.body.appendChild(l), c.triggerDOMElement = e);
|
|
468
468
|
break;
|
|
469
469
|
}
|
|
470
470
|
case "none": {
|
|
471
|
-
const
|
|
472
|
-
if (c.widgetDOMElement =
|
|
471
|
+
const l = document.body.appendChild(document.createElement("div"));
|
|
472
|
+
if (c.widgetDOMElement = l, r !== "inline") {
|
|
473
473
|
const p = document.body.appendChild(document.createElement("a"));
|
|
474
474
|
r === "link" && (p.innerText = t), c.triggerDOMElement = p;
|
|
475
475
|
}
|
|
@@ -477,38 +477,38 @@ const Et = (t, n) => t && n ? "both" : t ? "widgetDOM" : n ? "triggerDOM" : "non
|
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
return c;
|
|
480
|
-
},
|
|
481
|
-
class
|
|
480
|
+
}, $t = "modals";
|
|
481
|
+
class Lt {
|
|
482
482
|
constructor(n, e) {
|
|
483
|
-
|
|
484
|
-
|
|
483
|
+
L(this, "container");
|
|
484
|
+
L(this, "unsubscribe", []);
|
|
485
485
|
this.options = e, this.container = n.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register("triggerDOMElement", this.options.triggerDOMElement);
|
|
486
|
-
const
|
|
487
|
-
this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${
|
|
488
|
-
const
|
|
486
|
+
const s = this.container.get("$widget");
|
|
487
|
+
this.options.widgetDOMElement.classList.add("humany-widget"), this.options.widgetDOMElement.classList.add(`humany_${s.name}`);
|
|
488
|
+
const i = n.get("widgetDOMElements") || [];
|
|
489
489
|
n.register("widgetDOMElements", [
|
|
490
|
-
...
|
|
490
|
+
...i,
|
|
491
491
|
this.options.widgetDOMElement
|
|
492
492
|
]);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
const { widgetDOMElement: n, triggerDOMElement: e } = this.options,
|
|
496
|
-
return n.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === k.Badge &&
|
|
495
|
+
const { widgetDOMElement: n, triggerDOMElement: e } = this.options, s = this.container.get("$widget");
|
|
496
|
+
return n.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === k.Badge && xt(e), import("./render.95f13e79.js").then((i) => i.default(this.container, n)).then(() => {
|
|
497
497
|
if (n.setAttribute("data-rendered", "true"), e && this.options.triggerType === k.Badge) {
|
|
498
498
|
const o = this.options.triggerOptions.openTooltip;
|
|
499
499
|
be(e, o);
|
|
500
500
|
}
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
|
|
501
|
+
Fe(this.container, n);
|
|
502
|
+
const i = this.container.get("$environment").widgets.all();
|
|
503
|
+
$(
|
|
504
504
|
this.container,
|
|
505
|
-
|
|
505
|
+
$t,
|
|
506
506
|
E.Session
|
|
507
507
|
).then((o) => {
|
|
508
508
|
o && o.forEach((r) => {
|
|
509
|
-
|
|
509
|
+
i.find(
|
|
510
510
|
(a) => a.name === r.name && a.state === "activated"
|
|
511
|
-
) &&
|
|
511
|
+
) && s.events.dispatch("widget:modal-opened", r);
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
514
|
}));
|
|
@@ -518,34 +518,34 @@ class St {
|
|
|
518
518
|
if (!e)
|
|
519
519
|
return;
|
|
520
520
|
e.getAttribute("role") || e.setAttribute("role", "button");
|
|
521
|
-
const { name:
|
|
521
|
+
const { name: s } = this.container.get("$widget"), { label: i, symbol: o, ariaLabel: r, closedTooltip: a, openTooltip: c } = n, h = { closedTooltip: a, openTooltip: c };
|
|
522
522
|
this.options.triggerOptions = h;
|
|
523
|
-
const
|
|
524
|
-
label:
|
|
523
|
+
const u = At(e, {
|
|
524
|
+
label: i,
|
|
525
525
|
symbol: o,
|
|
526
526
|
ariaLabel: r,
|
|
527
|
-
widgetName:
|
|
527
|
+
widgetName: s,
|
|
528
528
|
tooltip: a
|
|
529
529
|
});
|
|
530
|
-
this.unsubscribe.push(
|
|
530
|
+
this.unsubscribe.push(u);
|
|
531
531
|
}
|
|
532
532
|
dispose() {
|
|
533
533
|
return import("./unmount.b0816844.js").then((n) => {
|
|
534
|
-
var
|
|
535
|
-
const { triggerDOMElement: e, widgetDOMElement:
|
|
536
|
-
n.default(
|
|
534
|
+
var i, o, r, a;
|
|
535
|
+
const { triggerDOMElement: e, widgetDOMElement: s } = this.options;
|
|
536
|
+
n.default(s), this.options.cachedOriginals.widgetDOMElement && s && ((i = s.parentNode) == null || i.replaceChild(
|
|
537
537
|
this.options.cachedOriginals.widgetDOMElement,
|
|
538
|
-
|
|
538
|
+
s
|
|
539
539
|
)), this.options.cachedOriginals.triggerDOMElement && e && ((o = e.parentNode) == null || o.replaceChild(
|
|
540
540
|
this.options.cachedOriginals.triggerDOMElement,
|
|
541
541
|
e
|
|
542
542
|
)), this.unsubscribe.forEach((c) => {
|
|
543
543
|
c();
|
|
544
|
-
}), (r =
|
|
544
|
+
}), (r = s.parentNode) == null || r.removeChild(s), (a = e == null ? void 0 : e.parentNode) == null || a.removeChild(e);
|
|
545
545
|
});
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
const K = "changesets",
|
|
548
|
+
const K = "changesets", kt = (t) => {
|
|
549
549
|
const n = { tags: t.tags };
|
|
550
550
|
return t.context && typeof t.context != "function" && (n.context = t.context), t.properties && typeof t.properties != "function" && (n.properties = t.properties), t.layout && typeof t.layout != "function" && (n.layout = t.layout), n;
|
|
551
551
|
};
|
|
@@ -558,74 +558,67 @@ class oe {
|
|
|
558
558
|
medium: E.Local
|
|
559
559
|
}).then((e) => new oe(n, e));
|
|
560
560
|
}
|
|
561
|
-
write(n, e,
|
|
562
|
-
return J(this)(() =>
|
|
561
|
+
write(n, e, s, i) {
|
|
562
|
+
return J(this)(() => $(
|
|
563
563
|
this.container,
|
|
564
564
|
K,
|
|
565
565
|
E.Local
|
|
566
566
|
).then((o = {}) => {
|
|
567
567
|
const { keys: r = [], items: a = {} } = o, c = r.indexOf(n);
|
|
568
568
|
return c > -1 && r.splice(c, 1), r.push(n), a[n] = {
|
|
569
|
-
options:
|
|
570
|
-
attributes:
|
|
569
|
+
options: i,
|
|
570
|
+
attributes: kt(s),
|
|
571
571
|
rules: e.rules
|
|
572
572
|
}, this.storageWriter({ keys: r, items: a });
|
|
573
573
|
}));
|
|
574
574
|
}
|
|
575
575
|
remove(n) {
|
|
576
|
-
return J(this)(() =>
|
|
576
|
+
return J(this)(() => $(
|
|
577
577
|
this.container,
|
|
578
578
|
K,
|
|
579
579
|
E.Local
|
|
580
580
|
).then((e = {}) => {
|
|
581
|
-
const { keys:
|
|
581
|
+
const { keys: s = [], items: i = {} } = e, o = s.indexOf(n);
|
|
582
582
|
if (o > -1)
|
|
583
|
-
return
|
|
583
|
+
return s.splice(o, 1), delete i[n], this.storageWriter(e);
|
|
584
584
|
}));
|
|
585
585
|
}
|
|
586
586
|
load(n) {
|
|
587
|
-
return J(this)(() =>
|
|
587
|
+
return J(this)(() => $(
|
|
588
588
|
this.container,
|
|
589
589
|
K,
|
|
590
590
|
E.Local
|
|
591
591
|
).then((e = {}) => {
|
|
592
|
-
const { keys:
|
|
593
|
-
|
|
594
|
-
const r =
|
|
592
|
+
const { keys: s = [], items: i = {} } = e;
|
|
593
|
+
s.forEach((o) => {
|
|
594
|
+
const r = i[o];
|
|
595
595
|
if (r) {
|
|
596
596
|
const { rules: a, attributes: c, options: h } = r;
|
|
597
597
|
n.write({
|
|
598
598
|
attributes: c,
|
|
599
599
|
options: h,
|
|
600
|
-
target: new
|
|
600
|
+
target: new xe(n, a)
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
603
|
});
|
|
604
604
|
}));
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
const
|
|
607
|
+
const Pt = (t) => {
|
|
608
608
|
const { container: n } = t;
|
|
609
609
|
return oe.create(n).then((e) => {
|
|
610
|
-
const
|
|
610
|
+
const s = n.get("$settings"), i = { localStorage: e }, o = new Ae(t, i), r = De(o, s);
|
|
611
611
|
return t.events.subscribe("widget:state-change", (a, c) => {
|
|
612
612
|
c.state === Je.Deactivating && r();
|
|
613
613
|
}), o;
|
|
614
614
|
});
|
|
615
|
-
},
|
|
616
|
-
const e = (s) => {
|
|
617
|
-
const o = document.createElement("a");
|
|
618
|
-
return o.href = s, o;
|
|
619
|
-
};
|
|
620
|
-
let i = window.location;
|
|
621
|
-
return t === "referrer" && document.referrer && (i = e(document.referrer)), [n ? "https:" : "", "//", i.host, i.pathname].join("");
|
|
622
|
-
}, Mt = (t) => import("@telia-ace/widget-routing").then(({ RoutingService: n, HistoryMode: e }) => t.get("settings").then((i) => {
|
|
615
|
+
}, Rt = (t) => import("@telia-ace/widget-routing").then(({ RoutingService: n, HistoryMode: e }) => t.get("settings").then((s) => {
|
|
623
616
|
const {
|
|
624
|
-
routing: { initialPath:
|
|
617
|
+
routing: { initialPath: i = "/", mode: o = e.scopedHash, basePath: r },
|
|
625
618
|
views: a
|
|
626
|
-
} =
|
|
619
|
+
} = s;
|
|
627
620
|
return new n(t, {
|
|
628
|
-
initialPath:
|
|
621
|
+
initialPath: i,
|
|
629
622
|
mode: o,
|
|
630
623
|
routes: Object.keys(a).map((h) => ({
|
|
631
624
|
name: h,
|
|
@@ -633,48 +626,33 @@ const xt = (t) => {
|
|
|
633
626
|
})),
|
|
634
627
|
basePath: r
|
|
635
628
|
});
|
|
636
|
-
})),
|
|
637
|
-
|
|
638
|
-
data: { projection: r = "", site: a = "current", forceHttps: c = !1 }
|
|
639
|
-
} = i, h = new e(r, { credentials: "same-origin" }), l = new n(
|
|
640
|
-
h,
|
|
641
|
-
{
|
|
642
|
-
funnel: s.replace("_contact-method", "").replace("_contact", ""),
|
|
643
|
-
site: Dt(a, c)
|
|
644
|
-
},
|
|
645
|
-
null,
|
|
646
|
-
t
|
|
647
|
-
);
|
|
648
|
-
return o.subscribe("widget:settings-updated", (u, { data: p }) => {
|
|
649
|
-
p && p.projection !== r && l.proxy.setBaseUrl(p.projection);
|
|
650
|
-
}), l;
|
|
651
|
-
})), $t = (t) => import("@telia-ace/widget-core").then(({ ActionResolver: n }) => new n(t)), kt = (t) => import("@telia-ace/widget-core").then(({ ComponentResolver: n }) => new n(t)), Pt = (t) => import("@telia-ace/widget-core").then(({ ComponentPlatform: n, createComponentModel: e }) => xt(t.get("$widget"))), ee = "$settings", U = "open", ue = "activeStickyWidget";
|
|
652
|
-
class Yt extends Xe {
|
|
629
|
+
})), Vt = (t) => import("@telia-ace/widget-services").then(({ StorageProvider: n }) => new n()), _t = (t) => import("@telia-ace/widget-core").then(({ ActionResolver: n }) => new n(t)), It = (t) => import("@telia-ace/widget-core").then(({ ComponentResolver: n }) => new n(t)), zt = (t) => import("@telia-ace/widget-core").then(({ ComponentPlatform: n, createComponentModel: e }) => Pt(t.get("$widget"))), ee = "$settings", U = "open", ue = "activeStickyWidget";
|
|
630
|
+
class Xt extends Xe {
|
|
653
631
|
constructor(e) {
|
|
654
632
|
super(e);
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
const
|
|
633
|
+
L(this, "outlets", /* @__PURE__ */ new Map());
|
|
634
|
+
L(this, "activated");
|
|
635
|
+
L(this, "subs", []);
|
|
636
|
+
L(this, "handleBootstrapping", (e) => {
|
|
637
|
+
const s = {
|
|
660
638
|
triggerDOMElement: e.sourceDOMElement,
|
|
661
639
|
withRenderState: "storage"
|
|
662
640
|
};
|
|
663
|
-
this.container.get("settings").then((
|
|
664
|
-
const { activate: o } =
|
|
641
|
+
this.container.get("settings").then((i) => {
|
|
642
|
+
const { activate: o } = i;
|
|
665
643
|
(typeof o == "undefined" || o === null || o === !0) && (this.activated = (this.activated || this.widget.activate()).then(
|
|
666
|
-
() => this.attach(
|
|
644
|
+
() => this.attach(s)
|
|
667
645
|
));
|
|
668
646
|
});
|
|
669
647
|
});
|
|
670
|
-
this.container.registerAsync("storage", () =>
|
|
648
|
+
this.container.registerAsync("storage", () => Vt(this.container)), this.container.registerFactory("settings", () => $(
|
|
671
649
|
this.container,
|
|
672
650
|
ee,
|
|
673
651
|
E.Local
|
|
674
|
-
).then((
|
|
652
|
+
).then((s = {}) => m(m({}, this.container.get("$settings")), s))), Ze(this, "load", this.handleBootstrapping), this.container.registerAsync(
|
|
675
653
|
"componentResolver",
|
|
676
|
-
() =>
|
|
677
|
-
), this.container.registerAsync("
|
|
654
|
+
() => It(this.container)
|
|
655
|
+
), this.container.registerAsync("router", () => Rt(this.container)), this.container.registerAsync("actionResolver", () => _t(this.container)), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync("components", () => zt(this.container));
|
|
678
656
|
}
|
|
679
657
|
initialize() {
|
|
680
658
|
const e = this.container.getManyAsync(
|
|
@@ -683,25 +661,25 @@ class Yt extends Xe {
|
|
|
683
661
|
"components"
|
|
684
662
|
);
|
|
685
663
|
return Promise.all([e, this.container.get("settings")]).then(
|
|
686
|
-
([{ actionResolver:
|
|
664
|
+
([{ actionResolver: s, router: i, components: o }, r]) => {
|
|
687
665
|
var h;
|
|
688
|
-
|
|
666
|
+
s.subscribe(
|
|
689
667
|
this.widget.name,
|
|
690
|
-
(
|
|
668
|
+
(u, l, p) => this.onAction(l, p)
|
|
691
669
|
);
|
|
692
|
-
const a = (
|
|
693
|
-
o.nodes.query({ type: "view" }).forEach((
|
|
694
|
-
o.setSwitch(
|
|
670
|
+
const a = (u) => {
|
|
671
|
+
o.nodes.query({ type: "view" }).forEach((l) => {
|
|
672
|
+
o.setSwitch(l, u);
|
|
695
673
|
});
|
|
696
|
-
}, c = ((h =
|
|
697
|
-
return a(c), this.events.subscribe("widget:data-loaded", (
|
|
674
|
+
}, c = ((h = i.getInitialRoute()) == null ? void 0 : h.name) || "index";
|
|
675
|
+
return a(c), this.events.subscribe("widget:data-loaded", (u, { element: l }) => {
|
|
698
676
|
this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
|
|
699
|
-
element:
|
|
677
|
+
element: l
|
|
700
678
|
});
|
|
701
679
|
}), this.events.subscribe(
|
|
702
680
|
"router:change",
|
|
703
|
-
(
|
|
704
|
-
const { routeData: f } =
|
|
681
|
+
(u, { previous: l = { routeData: {} }, next: p = { routeData: {} } }) => {
|
|
682
|
+
const { routeData: f } = l, { routeData: w } = p, y = Object.keys(r.views).reduce((g, b) => typeof r.views[b].path == "undefined" ? b : g, "");
|
|
705
683
|
!w.name && y ? a(y) : a(w.name), le(f && f.params), le(w && w.params), this.container.getAsync("actionResolver").then((g) => {
|
|
706
684
|
g.action(this.widget.name, "routeChange", {
|
|
707
685
|
next: w,
|
|
@@ -709,43 +687,43 @@ class Yt extends Xe {
|
|
|
709
687
|
});
|
|
710
688
|
});
|
|
711
689
|
}
|
|
712
|
-
),
|
|
690
|
+
), i.initialize();
|
|
713
691
|
}
|
|
714
692
|
);
|
|
715
693
|
}
|
|
716
694
|
attach(e = {}) {
|
|
717
|
-
return this.container.get("settings").then(({ trigger:
|
|
695
|
+
return this.container.get("settings").then(({ trigger: s }) => {
|
|
718
696
|
var f, w;
|
|
719
697
|
const {
|
|
720
|
-
widgetDOMElement:
|
|
721
|
-
key: o =
|
|
698
|
+
widgetDOMElement: i,
|
|
699
|
+
key: o = He(),
|
|
722
700
|
triggerDOMElement: r,
|
|
723
701
|
withRenderState: a
|
|
724
|
-
} = e, h = we(
|
|
702
|
+
} = e, h = we(s) === k.Inline && ((r == null ? void 0 : r.childElementCount) || 0) > 0, u = Nt(
|
|
725
703
|
this.widget.name,
|
|
726
|
-
s,
|
|
727
|
-
r,
|
|
728
704
|
i,
|
|
705
|
+
r,
|
|
706
|
+
s,
|
|
729
707
|
h
|
|
730
708
|
);
|
|
731
709
|
this.outlets.size < 1 && !a && this.setRenderState("unset");
|
|
732
|
-
const
|
|
733
|
-
const y = () => g.querySelectorAll("[data-loading=true]").length === 0, [g] = this.widget.container.get("widgetDOMElements"), b = (R,
|
|
734
|
-
y() && (
|
|
710
|
+
const l = () => {
|
|
711
|
+
const y = () => g.querySelectorAll("[data-loading=true]").length === 0, [g] = this.widget.container.get("widgetDOMElements"), b = (R, W) => {
|
|
712
|
+
y() && (u.callback && u.callback(), W.disconnect());
|
|
735
713
|
}, S = {
|
|
736
714
|
attributes: !0,
|
|
737
715
|
subtree: !0,
|
|
738
716
|
childList: !0
|
|
739
717
|
};
|
|
740
|
-
y() &&
|
|
718
|
+
y() && u.callback && u.callback(), new MutationObserver(b).observe(g, S);
|
|
741
719
|
};
|
|
742
720
|
h && this.widget.container.getAsync("dataClient").then(({ events: y }) => {
|
|
743
721
|
y.subscribe("data-client:fetched", (g, b) => {
|
|
744
|
-
b.unresolvedQueries === 0 &&
|
|
722
|
+
b.unresolvedQueries === 0 && l();
|
|
745
723
|
});
|
|
746
724
|
});
|
|
747
|
-
const p = this.getOrCreateViewOutlet(o,
|
|
748
|
-
if (this.outlets.set(o, p), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }),
|
|
725
|
+
const p = this.getOrCreateViewOutlet(o, u);
|
|
726
|
+
if (this.outlets.set(o, p), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), u.triggerType === k.Badge && s && ((f = u.triggerDOMElement) == null || f.setAttribute("aria-expanded", "false"), p == null || p.renderBadge(s)), u.triggerType !== k.Inline && ((w = u.triggerDOMElement) == null || w.addEventListener("click", (y) => {
|
|
749
727
|
y.preventDefault(), this.container.get("settings").then(({ trigger: g }) => {
|
|
750
728
|
p.render().then(() => this.renderState()).then((b) => g && g.action && g.action === "hide" ? b === O.open ? this.hide() : this.open() : b === O.open ? this.close() : this.open());
|
|
751
729
|
});
|
|
@@ -755,7 +733,7 @@ class Yt extends Xe {
|
|
|
755
733
|
});
|
|
756
734
|
if (a)
|
|
757
735
|
return a === "storage" ? this.renderState().then((y) => {
|
|
758
|
-
if (
|
|
736
|
+
if (u.triggerType === k.Inline) {
|
|
759
737
|
this.triggerStateIfApplicable("open");
|
|
760
738
|
return;
|
|
761
739
|
}
|
|
@@ -766,19 +744,19 @@ class Yt extends Xe {
|
|
|
766
744
|
detach(e) {
|
|
767
745
|
if (e) {
|
|
768
746
|
if (this.outlets.has(e)) {
|
|
769
|
-
const
|
|
770
|
-
|
|
747
|
+
const s = this.outlets.get(e);
|
|
748
|
+
s == null || s.dispose(), this.outlets.delete(e);
|
|
771
749
|
return;
|
|
772
750
|
}
|
|
773
751
|
process.env.NODE_ENV !== "production" && console.warn(`detach(): Could not find View Outlet with key ${e}`);
|
|
774
752
|
return;
|
|
775
753
|
}
|
|
776
|
-
this.outlets.forEach((
|
|
777
|
-
|
|
754
|
+
this.outlets.forEach((s) => {
|
|
755
|
+
s.dispose();
|
|
778
756
|
}), this.outlets.clear();
|
|
779
757
|
}
|
|
780
758
|
triggerStateIfApplicable(e) {
|
|
781
|
-
return this.container.getAsync("router").then((
|
|
759
|
+
return this.container.getAsync("router").then((s) => {
|
|
782
760
|
switch (e) {
|
|
783
761
|
case "closed":
|
|
784
762
|
this.close();
|
|
@@ -787,22 +765,22 @@ class Yt extends Xe {
|
|
|
787
765
|
this.open();
|
|
788
766
|
break;
|
|
789
767
|
case "hidden":
|
|
790
|
-
this.hide(),
|
|
768
|
+
this.hide(), s.start();
|
|
791
769
|
break;
|
|
792
770
|
default:
|
|
793
771
|
return;
|
|
794
772
|
}
|
|
795
773
|
});
|
|
796
774
|
}
|
|
797
|
-
getOrCreateViewOutlet(e,
|
|
798
|
-
return this.outlets.has(e) ? this.outlets.get(e) : new
|
|
775
|
+
getOrCreateViewOutlet(e, s) {
|
|
776
|
+
return this.outlets.has(e) ? this.outlets.get(e) : new Lt(this.container, s);
|
|
799
777
|
}
|
|
800
778
|
render(e = {}) {
|
|
801
779
|
if (process.env.NODE_ENV !== "production" && console.warn("widget.render() is deprecated. Use widget.attach() instead."), e.open) {
|
|
802
|
-
const
|
|
780
|
+
const s = C(m({}, e), {
|
|
803
781
|
withRenderState: "open"
|
|
804
782
|
});
|
|
805
|
-
return this.attach(
|
|
783
|
+
return this.attach(s);
|
|
806
784
|
}
|
|
807
785
|
return this.attach(e);
|
|
808
786
|
}
|
|
@@ -815,8 +793,8 @@ class Yt extends Xe {
|
|
|
815
793
|
_(this.container, ee, I.Necessary, {
|
|
816
794
|
medium: E.Local
|
|
817
795
|
})
|
|
818
|
-
]).then(([
|
|
819
|
-
const r = m(m({},
|
|
796
|
+
]).then(([s, i]) => Promise.resolve(e(s)).then((o) => i(o).then(() => {
|
|
797
|
+
const r = m(m({}, s), o);
|
|
820
798
|
return this.widget.events.dispatch("widget:settings-updated", r), r;
|
|
821
799
|
})));
|
|
822
800
|
}
|
|
@@ -830,24 +808,24 @@ class Yt extends Xe {
|
|
|
830
808
|
this.widget.events.dispatch("widget:settings-updated", e);
|
|
831
809
|
});
|
|
832
810
|
}
|
|
833
|
-
action({ action: e, value:
|
|
834
|
-
return this.container.getAsync("actionResolver").then((
|
|
835
|
-
|
|
811
|
+
action({ action: e, value: s }) {
|
|
812
|
+
return this.container.getAsync("actionResolver").then((i) => {
|
|
813
|
+
i.action(this.widget.name, e, s);
|
|
836
814
|
});
|
|
837
815
|
}
|
|
838
816
|
renderState() {
|
|
839
817
|
if (qe(this.container))
|
|
840
818
|
return Promise.resolve(O.open);
|
|
841
|
-
const e = () =>
|
|
819
|
+
const e = () => $(
|
|
842
820
|
this.container,
|
|
843
821
|
U,
|
|
844
822
|
E.Session
|
|
845
|
-
).then((
|
|
823
|
+
).then((i = O.closed) => i), s = () => $(
|
|
846
824
|
this.container,
|
|
847
825
|
U,
|
|
848
826
|
E.Session
|
|
849
|
-
).then((
|
|
850
|
-
return this.container.getAsync("router").then((
|
|
827
|
+
).then((i = O.closed) => i);
|
|
828
|
+
return this.container.getAsync("router").then((i) => i.isSticky() ? s().then((o) => o === O.open ? o : e()) : e());
|
|
851
829
|
}
|
|
852
830
|
hide() {
|
|
853
831
|
return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
|
|
@@ -871,14 +849,14 @@ class Yt extends Xe {
|
|
|
871
849
|
"show(): Command is deprecated and will be removed in the future. Use open() instead."
|
|
872
850
|
), this.open();
|
|
873
851
|
}
|
|
874
|
-
onAction(e,
|
|
852
|
+
onAction(e, s) {
|
|
875
853
|
switch (e) {
|
|
876
854
|
case "close":
|
|
877
855
|
case "open":
|
|
878
856
|
case "hide":
|
|
879
|
-
const
|
|
880
|
-
return this.setRenderState(
|
|
881
|
-
this.setTriggerState(
|
|
857
|
+
const i = e === "open" ? O.open : e === "close" ? O.closed : O.hidden;
|
|
858
|
+
return this.setRenderState(i).then(() => {
|
|
859
|
+
this.setTriggerState(i === O.open), i !== O.hidden ? i === O.open ? this.onOpen() : this.onClose() : this.outlets.forEach(
|
|
882
860
|
(o) => {
|
|
883
861
|
var r;
|
|
884
862
|
return (r = o.options.triggerDOMElement) == null ? void 0 : r.setAttribute("aria-expanded", "false");
|
|
@@ -888,7 +866,7 @@ class Yt extends Xe {
|
|
|
888
866
|
}
|
|
889
867
|
}
|
|
890
868
|
setRenderState(e) {
|
|
891
|
-
const { invoke:
|
|
869
|
+
const { invoke: s, events: i } = this.container.get("$widget");
|
|
892
870
|
return Promise.all([
|
|
893
871
|
_(this.container, U, I.Necessary, {
|
|
894
872
|
medium: E.Session
|
|
@@ -898,9 +876,9 @@ class Yt extends Xe {
|
|
|
898
876
|
duration: { minutes: 5 }
|
|
899
877
|
}),
|
|
900
878
|
this.container.getAsync("router"),
|
|
901
|
-
|
|
879
|
+
s("renderState")
|
|
902
880
|
]).then(([o, r, a, c]) => {
|
|
903
|
-
e === "unset" || !e ? (r(), o()) : (a.isSticky() && r(e), o(e)),
|
|
881
|
+
e === "unset" || !e ? (r(), o()) : (a.isSticky() && r(e), o(e)), i.dispatch("widget:render-state-changed", {
|
|
904
882
|
previous: c,
|
|
905
883
|
next: e
|
|
906
884
|
});
|
|
@@ -908,20 +886,20 @@ class Yt extends Xe {
|
|
|
908
886
|
}
|
|
909
887
|
onOpen() {
|
|
910
888
|
return this.container.getAsync("router").then((e) => (this.outlets.forEach(
|
|
911
|
-
(
|
|
912
|
-
var
|
|
913
|
-
return (
|
|
889
|
+
(s) => {
|
|
890
|
+
var i;
|
|
891
|
+
return (i = s.options.triggerDOMElement) == null ? void 0 : i.setAttribute("aria-expanded", "true");
|
|
914
892
|
}
|
|
915
893
|
), e.start()));
|
|
916
894
|
}
|
|
917
895
|
onClose() {
|
|
918
896
|
const e = this.container.getManyAsync("router", "components");
|
|
919
|
-
return (() => this.container.get("settings").then((
|
|
897
|
+
return (() => this.container.get("settings").then((i) => {
|
|
920
898
|
const { activate: o } = this.container.get("$settings");
|
|
921
|
-
return
|
|
899
|
+
return i.activate !== o ? this.setSettings(() => Promise.resolve({ activate: o })) : Promise.resolve();
|
|
922
900
|
}))().then(() => e).then(
|
|
923
901
|
({
|
|
924
|
-
router:
|
|
902
|
+
router: i,
|
|
925
903
|
components: o
|
|
926
904
|
}) => {
|
|
927
905
|
const r = o.nodes.visible;
|
|
@@ -934,28 +912,28 @@ class Yt extends Xe {
|
|
|
934
912
|
(a) => a.attributes.properties.animation && a.attributes.properties.animation !== "none"
|
|
935
913
|
).length ? new Promise((a) => {
|
|
936
914
|
setTimeout(() => {
|
|
937
|
-
a(
|
|
915
|
+
a(i);
|
|
938
916
|
}, 200);
|
|
939
|
-
}) : Promise.resolve(
|
|
917
|
+
}) : Promise.resolve(i);
|
|
940
918
|
}
|
|
941
|
-
).then((
|
|
919
|
+
).then((i) => i.stop());
|
|
942
920
|
}
|
|
943
921
|
setTriggerState(e) {
|
|
944
|
-
this.outlets.forEach((
|
|
922
|
+
this.outlets.forEach((s) => {
|
|
945
923
|
const {
|
|
946
|
-
options: { triggerDOMElement:
|
|
947
|
-
} =
|
|
948
|
-
|
|
924
|
+
options: { triggerDOMElement: i, triggerOptions: o }
|
|
925
|
+
} = s, { openTooltip: r, closedTooltip: a } = o || {};
|
|
926
|
+
i && (e ? be(i, r) : Dt(i, a));
|
|
949
927
|
});
|
|
950
928
|
}
|
|
951
929
|
deactivate() {
|
|
952
|
-
this.subs.forEach((
|
|
930
|
+
this.subs.forEach((s) => s());
|
|
953
931
|
const e = [];
|
|
954
|
-
return this.outlets.forEach((
|
|
932
|
+
return this.outlets.forEach((s) => e.push(s.dispose())), $(
|
|
955
933
|
this.container,
|
|
956
934
|
ue,
|
|
957
935
|
E.Local
|
|
958
|
-
).then((
|
|
936
|
+
).then((s) => s === this.widget.name ? _(
|
|
959
937
|
this.container,
|
|
960
938
|
ue,
|
|
961
939
|
I.Necessary,
|
|
@@ -963,15 +941,15 @@ class Yt extends Xe {
|
|
|
963
941
|
medium: E.Local,
|
|
964
942
|
scope: Qe.Implementation
|
|
965
943
|
}
|
|
966
|
-
).then((
|
|
944
|
+
).then((i) => i()).then(() => Promise.all(e)) : Promise.all(e));
|
|
967
945
|
}
|
|
968
946
|
}
|
|
969
947
|
export {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
948
|
+
ie as Component,
|
|
949
|
+
wt as DetachedComponent,
|
|
950
|
+
Xt as GridWidget,
|
|
951
|
+
Jt as NotFound,
|
|
952
|
+
Xt as Widget,
|
|
975
953
|
q as genericComponentStyling
|
|
976
954
|
};
|
|
977
955
|
//# sourceMappingURL=index.js.map
|