@telia-ace/widget-runtime-flamingo 1.0.4 → 1.0.6

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.
@@ -0,0 +1,4640 @@
1
+ var Br = Object.defineProperty, Vr = Object.defineProperties;
2
+ var zr = Object.getOwnPropertyDescriptors;
3
+ var on = Object.getOwnPropertySymbols, Wr = Object.getPrototypeOf, Fr = Object.prototype.hasOwnProperty, qr = Object.prototype.propertyIsEnumerable, Jr = Reflect.get;
4
+ var an = (n, t, e) => t in n ? Br(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, st = (n, t) => {
5
+ for (var e in t || (t = {}))
6
+ Fr.call(t, e) && an(n, e, t[e]);
7
+ if (on)
8
+ for (var e of on(t))
9
+ qr.call(t, e) && an(n, e, t[e]);
10
+ return n;
11
+ }, zt = (n, t) => Vr(n, zr(t));
12
+ var cn = (n, t, e) => Jr(Wr(n), e, t);
13
+ var z = (n, t, e) => new Promise((r, s) => {
14
+ var i = (c) => {
15
+ try {
16
+ a(e.next(c));
17
+ } catch (h) {
18
+ s(h);
19
+ }
20
+ }, o = (c) => {
21
+ try {
22
+ a(e.throw(c));
23
+ } catch (h) {
24
+ s(h);
25
+ }
26
+ }, a = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(i, o);
27
+ a((e = e.apply(n, t)).next());
28
+ });
29
+ const Ee = (n, t, e, ...r) => {
30
+ const s = `[${n.get("$environment").name || "webprovisions"}] ${e}`;
31
+ switch (t) {
32
+ case "info":
33
+ console.info(s, ...r);
34
+ break;
35
+ case "warning":
36
+ console.warn(s, ...r);
37
+ break;
38
+ case "error":
39
+ console.error(s, ...r);
40
+ break;
41
+ }
42
+ }, Kr = (n) => {
43
+ const t = n.container || n;
44
+ return {
45
+ info: (e, ...r) => Ee(t, "info", e, ...r),
46
+ warn: (e, ...r) => Ee(t, "warning", e, ...r),
47
+ error: (e, ...r) => Ee(t, "error", e, ...r)
48
+ };
49
+ };
50
+ var se = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(se || {}), pt = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(pt || {});
51
+ const Gr = (n, t, e, r) => {
52
+ try {
53
+ const s = new t(e, r);
54
+ return {
55
+ name: n,
56
+ invoke: (i, o) => {
57
+ let a;
58
+ return s[i] && (a = s[i].call(s, o)), Promise.resolve(a);
59
+ },
60
+ getInstance: () => s
61
+ };
62
+ } catch (s) {
63
+ if (s.message && s.message.indexOf("is not a constructor") >= 0)
64
+ return {
65
+ name: n,
66
+ invoke: (i) => {
67
+ let o;
68
+ return i === "initialize" && (o = t(e, r)), Promise.resolve(o);
69
+ },
70
+ getInstance: () => t
71
+ };
72
+ throw s;
73
+ }
74
+ };
75
+ function hn(n, t) {
76
+ return typeof n == "undefined" ? t : n;
77
+ }
78
+ let Yr = class {
79
+ constructor(t = {}) {
80
+ this.part = t;
81
+ }
82
+ createCommand(t, e, r) {
83
+ let s;
84
+ typeof e == "function" ? s = {
85
+ scope: se.Widget,
86
+ stage: pt.Post,
87
+ defaultArgs: void 0,
88
+ handlerResolver: e
89
+ } : s = {
90
+ scope: hn(e.scope, se.Widget),
91
+ stage: hn(e.stage, pt.Post),
92
+ defaultArgs: e.defaultArgs,
93
+ handlerResolver: r
94
+ };
95
+ let i = this.part;
96
+ const o = t.split(".");
97
+ return o.forEach((a, c) => {
98
+ c === o.length - 1 ? i[a] || (i[a] = () => s) : i = this.part[a] = this.part[a] || {};
99
+ }), this;
100
+ }
101
+ get() {
102
+ return this.part;
103
+ }
104
+ };
105
+ const Je = (n) => {
106
+ const t = new Yr({});
107
+ return n(t), t.get();
108
+ };
109
+ Je((n) => {
110
+ n.createCommand(
111
+ "types.register",
112
+ { scope: se.Implementation, stage: pt.Pre },
113
+ (t) => (e, r) => {
114
+ t.container.get("$types")[e] = r;
115
+ }
116
+ ).createCommand(
117
+ "type",
118
+ { stage: pt.Pre },
119
+ (t) => (e) => {
120
+ t.container.register("$type", e);
121
+ }
122
+ ).createCommand(
123
+ "settings",
124
+ { stage: pt.Pre, defaultArgs: [null] },
125
+ (t) => (e) => {
126
+ t.events.dispatch(
127
+ "settings:change",
128
+ e,
129
+ { bubbles: !0 }
130
+ ), t.container.register("$settings", e);
131
+ }
132
+ ).createCommand(
133
+ "plugin",
134
+ { stage: pt.Pre },
135
+ (t) => (e, r, s) => {
136
+ const { container: i } = t;
137
+ let o = null, a = e, c = r;
138
+ typeof e == "string" && (o = e, a = r, c = s);
139
+ const h = (l) => {
140
+ const { transformPluginSettings: u } = t.container.get("$environmentOptions"), d = u ? u(
141
+ c || {},
142
+ o,
143
+ t.container,
144
+ a
145
+ ) : r;
146
+ try {
147
+ const p = Gr(
148
+ o,
149
+ a,
150
+ i,
151
+ d
152
+ );
153
+ i.get("$plugins").push(p), l && p.invoke("initialize", null);
154
+ } catch (p) {
155
+ Kr(t).warn("Error when initializing plugin", p);
156
+ }
157
+ };
158
+ t.container.get("$instance") ? h(!0) : t.events.subscribeOnce("widget:instance-created", () => h(!1));
159
+ }
160
+ ).createCommand(
161
+ "container.register",
162
+ (t) => (e, r) => {
163
+ t.container.register(e, r);
164
+ }
165
+ ).createCommand(
166
+ "container.registerAsync",
167
+ (t) => (e, r) => {
168
+ t.container.registerAsync(e, r);
169
+ }
170
+ ).createCommand(
171
+ "container.registerFactory",
172
+ (t) => (e, r) => {
173
+ t.container.registerFactory(e, r);
174
+ }
175
+ ).createCommand(
176
+ "container.touch",
177
+ (t) => (e, r) => {
178
+ t.container.touch(e, r);
179
+ }
180
+ ).createCommand(
181
+ "csp",
182
+ {},
183
+ (t) => (e) => {
184
+ t.container.register("csp", e);
185
+ }
186
+ );
187
+ });
188
+ var Qn = /* @__PURE__ */ ((n) => (n.Activating = "activating", n.Loading = "loading", n.Activated = "activated", n.Deactivating = "deactivating", n.Deactivated = "deactivated", n))(Qn || {});
189
+ let Zr = class {
190
+ /**
191
+ * Creates a new `Widget` instance.
192
+ * @param container The `Container` instance to base the widget upon.
193
+ */
194
+ constructor(t) {
195
+ 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, r) => {
196
+ this.settings = r;
197
+ });
198
+ }
199
+ };
200
+ var ln = Object.getOwnPropertySymbols, Qr = Object.prototype.hasOwnProperty, Xr = Object.prototype.propertyIsEnumerable, ts = (n, t) => {
201
+ var e = {};
202
+ for (var r in n)
203
+ Qr.call(n, r) && t.indexOf(r) < 0 && (e[r] = n[r]);
204
+ if (n != null && ln)
205
+ for (var r of ln(n))
206
+ t.indexOf(r) < 0 && Xr.call(n, r) && (e[r] = n[r]);
207
+ return e;
208
+ };
209
+ function es(n = {}) {
210
+ const t = n, {
211
+ phrase: e = "",
212
+ category: r,
213
+ guideCategory: s,
214
+ contactCategory: i,
215
+ take: o,
216
+ connectionKey: a,
217
+ accordion: c,
218
+ id: h,
219
+ uriName: l,
220
+ sorting: u,
221
+ tag: d,
222
+ tagId: p,
223
+ tagTitle: b
224
+ } = t, v = ts(t, [
225
+ "phrase",
226
+ "category",
227
+ "guideCategory",
228
+ "contactCategory",
229
+ "take",
230
+ "connectionKey",
231
+ "accordion",
232
+ "id",
233
+ "uriName",
234
+ "sorting",
235
+ "tag",
236
+ "tagId",
237
+ "tagTitle"
238
+ ]), g = {};
239
+ return Object.keys(v).forEach((O) => {
240
+ typeof n[O] == "string" && (g[O] = n[O]);
241
+ }), typeof e == "string" && e.length && (g.phrase = e), e === null && (g.phrase = e), typeof s == "string" && s !== "0" && (g.guideCategory = s), typeof s == "number" && s !== 0 && (g.guideCategory = s), typeof s == "object" && s !== null && (typeof s.id == "string" && s.id !== "0" && (g.guideCategory = s.id), typeof s.id == "number" && s.id !== 0 && (g.guideCategory = s.id)), typeof i == "string" && i !== "0" && (g.contactCategory = i), typeof i == "number" && i !== 0 && (g.contactCategory = i), typeof i == "object" && i !== null && (typeof i.id == "string" && i.id !== "0" && (g.contactCategory = i.id), typeof i.id == "number" && i.id !== 0 && (g.contactCategory = i.id)), typeof r == "string" && r !== "0" && (g.category = r), typeof r == "number" && r !== 0 && (g.category = r), typeof r == "object" && r !== null && (typeof r.id == "string" && r.id !== "0" && (g.category = r.id), typeof r.id == "number" && r.id !== 0 && (g.category = r.id)), h && (g.id = h), l && (+g.category || +g.guideCategory || +g.guide || +g.contactCategory || +g.contactMethod) && (g.uriName = l), a && (g.connectionKey = a), o && (g.take = o), u && (g.sorting = u), typeof c == "string" && c.length > 0 && (g.accordion = c), typeof d == "string" && d !== "0" && (g.tag = d), typeof d == "number" && d !== 0 && (g.tag = d), Array.isArray(d) && d.length && (g.tag = d), (typeof p == "string" || typeof p == "number") && (g.tagId = p), typeof b == "string" && (g.tagTitle = b), typeof g.tag == "string" && (g.tag = g.tag.split(",")), g;
242
+ }
243
+ const pe = (n, t, ...e) => typeof t == "string" ? n(`[humany] ${t}`, ...e) : n(t, ...e), Nt = class {
244
+ constructor() {
245
+ this.keys = [], this.log = (t, ...e) => this.lookup(t, () => Nt.log(...e)), this.warn = (t, ...e) => this.lookup(t, () => Nt.warn(...e)), this.error = (t, ...e) => this.lookup(t, () => Nt.error(...e)), this.info = (t, ...e) => this.lookup(t, () => Nt.info(...e));
246
+ }
247
+ lookup(t, e) {
248
+ this.keys.indexOf(t) === -1 && (this.keys.push(t), e());
249
+ }
250
+ };
251
+ let I = Nt;
252
+ I.log = (...n) => pe(console.log, ...n);
253
+ I.warn = (...n) => pe(console.warn, ...n);
254
+ I.error = (...n) => pe(console.error, ...n);
255
+ I.info = (...n) => pe(console.info, ...n);
256
+ const Xn = (n) => {
257
+ let t = {}, e, r;
258
+ if (typeof n != "object" || n === null)
259
+ return n;
260
+ t = Array.isArray(n) ? [] : {};
261
+ for (r in n)
262
+ e = n[r], t[r] = typeof e == "object" && e !== null ? Xn(e) : e;
263
+ return t;
264
+ }, ns = Xn;
265
+ function un(n) {
266
+ let t = 0;
267
+ if (n.length === 0)
268
+ return t.toString();
269
+ for (let e = 0; e < n.length; e++) {
270
+ const r = n.charCodeAt(e);
271
+ t = (t << 5) - t + r, t = t & t;
272
+ }
273
+ return t.toString();
274
+ }
275
+ let rs = class {
276
+ constructor(t, e) {
277
+ this.lockWarningTime = t, this.lockErrorTime = e, this.tasks = [], this.current = Promise.resolve(), this.next = this.next.bind(this);
278
+ }
279
+ add(t, e, r, s) {
280
+ this.tasks.push({ task: t, resolve: e, reject: r, done: s }), this.next();
281
+ }
282
+ next() {
283
+ this.current = this.current.then(() => {
284
+ const t = this.tasks.shift();
285
+ if (t) {
286
+ let e;
287
+ const r = setTimeout(() => {
288
+ process.env.NODE_ENV !== "production" && I.warn(
289
+ `A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,
290
+ t
291
+ ), e = setTimeout(() => {
292
+ t.reject("lock timeout exceeded");
293
+ }, this.lockErrorTime);
294
+ }, this.lockWarningTime), s = Promise.resolve(t.task()).then((i) => (clearTimeout(r), clearTimeout(e), i));
295
+ return Promise.resolve(s).then(this.next).then(
296
+ () => s.then((i) => {
297
+ t.done(), t.resolve(i);
298
+ })
299
+ ).catch((i) => (t.done(), t.reject(i), this.next()));
300
+ }
301
+ return Promise.resolve();
302
+ });
303
+ }
304
+ };
305
+ const Wt = /* @__PURE__ */ new WeakMap();
306
+ function Q(n, t = 5e3, e = 1e3) {
307
+ return Wt.has(n) || Wt.set(n, new rs(t, e)), (r) => new Promise((s, i) => {
308
+ const o = Wt.get(n);
309
+ o.add(r, s, i, () => {
310
+ o.tasks.length || Wt.delete(n);
311
+ });
312
+ });
313
+ }
314
+ const ss = (n, t) => {
315
+ const e = () => t.querySelectorAll("[data-loading=true]").length > 0, r = (() => {
316
+ let s = !1;
317
+ return () => {
318
+ s || (n.get("$widget").events.dispatch("widget:data-loaded", {
319
+ element: t
320
+ }), s = !0);
321
+ };
322
+ })();
323
+ if (!e())
324
+ return r();
325
+ new MutationObserver((s, i) => {
326
+ s.find(
327
+ (o) => o.type === "attributes" && o.attributeName === "data-loading"
328
+ ) && !e() && (i.disconnect(), r());
329
+ }).observe(t, {
330
+ attributes: !0,
331
+ childList: !0,
332
+ subtree: !0
333
+ });
334
+ }, is = (n, t) => {
335
+ n.get("$widget").container.getAsync("components").then((e) => {
336
+ e.events.subscribeOnce("components:component-model-initialized", () => {
337
+ let r = e.nodes.visible.reduce(
338
+ (i, o) => (!o.name || !o.type || o.type === "view" || o.type === "root" || o.attributes.layout.size === "none" || t.querySelector(`[data-name="${o.name}"]`) || i.push(o.name), i),
339
+ []
340
+ ), s = !1;
341
+ new MutationObserver((i, o) => {
342
+ i.forEach((a) => {
343
+ if (a.addedNodes) {
344
+ const c = Array.from(
345
+ a.addedNodes
346
+ ).reduce((h, l) => {
347
+ const u = l.getAttribute && l.getAttribute("data-name");
348
+ return u && r.indexOf(u) > -1 && h.push(u), h;
349
+ }, []);
350
+ r = r.filter((h) => c.indexOf(h) === -1), !s && r.length === 0 && (s = !0, ss(n, t), o.disconnect());
351
+ }
352
+ });
353
+ }).observe(t, {
354
+ attributes: !1,
355
+ characterData: !1,
356
+ childList: !0,
357
+ subtree: !0,
358
+ attributeOldValue: !1,
359
+ characterDataOldValue: !1
360
+ });
361
+ });
362
+ });
363
+ }, os = is, as = (n = {}) => (Object.keys(n).forEach((t) => {
364
+ (n[t] === null || typeof n[t] == "undefined") && delete n[t];
365
+ }), n), yt = as, dn = (n, t) => {
366
+ let e = !0;
367
+ return Object.keys(n).length !== Object.keys(t).length || Object.keys(n).some((r) => !Object.keys(t).some((s) => r === s)) ? !1 : (Object.keys(n).forEach((r) => {
368
+ if (e) {
369
+ const s = typeof n[r] == "undefined" ? "" : n[r], i = typeof t[r] == "undefined" ? "" : t[r];
370
+ e = s.toString() === i.toString();
371
+ }
372
+ }), e);
373
+ }, it = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
374
+ function Bt() {
375
+ return it() + it() + "-" + it() + "-" + it() + "-" + it() + "-" + it() + it() + it();
376
+ }
377
+ var cs = Object.defineProperty, hs = Object.defineProperties, ls = Object.getOwnPropertyDescriptors, pn = Object.getOwnPropertySymbols, us = Object.prototype.hasOwnProperty, ds = Object.prototype.propertyIsEnumerable, gn = (n, t, e) => t in n ? cs(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, ps = (n, t) => {
378
+ for (var e in t || (t = {}))
379
+ us.call(t, e) && gn(n, e, t[e]);
380
+ if (pn)
381
+ for (var e of pn(t))
382
+ ds.call(t, e) && gn(n, e, t[e]);
383
+ return n;
384
+ }, gs = (n, t) => hs(n, ls(t));
385
+ class fs {
386
+ constructor(t) {
387
+ const { events: e } = t.get("$widget");
388
+ this.events = e.createChild(this);
389
+ }
390
+ action(t, e, r) {
391
+ this.events.dispatch("data:action", { action: e, value: r, target: t }, { bubbles: !0 });
392
+ }
393
+ subscribe(t, e) {
394
+ return this.events.subscribe(
395
+ "data:action",
396
+ (r, { action: s, value: i, target: o }) => t === o && e(t, s, i)
397
+ );
398
+ }
399
+ }
400
+ const tr = (n) => {
401
+ const t = [];
402
+ return [
403
+ (e, r) => {
404
+ t.push(n.subscribe(e, r));
405
+ },
406
+ () => {
407
+ t.forEach((e) => {
408
+ e();
409
+ });
410
+ }
411
+ ];
412
+ };
413
+ let Pt = class {
414
+ constructor(t, e = []) {
415
+ this.platform = t, this.rules = e;
416
+ }
417
+ match(t) {
418
+ return this.rules.every((e) => !(e.id && e.id !== t.id || e.type && e.type !== t.type));
419
+ }
420
+ ofType(t) {
421
+ return this.rules.push({ type: t }), this;
422
+ }
423
+ withId(t) {
424
+ return this.rules.push({ id: t }), this;
425
+ }
426
+ select() {
427
+ return new ms(this.platform, this);
428
+ }
429
+ }, Ke = class {
430
+ constructor(t, e, r) {
431
+ this.platform = t, this.node = e, this.actions = new ge(
432
+ t,
433
+ new Pt(t).withId(e.id),
434
+ r
435
+ );
436
+ const [s, i] = tr(this.platform.events);
437
+ this.subscribe = s, this.unsubscribe = i;
438
+ }
439
+ properties(t) {
440
+ return t && this.node.touchProperties((e) => t(e)), this.node.attributes.properties;
441
+ }
442
+ context(t) {
443
+ return t && this.subscribe("components:context-changed", (e, { node: r }) => {
444
+ r === this.node && t(this.node.attributes.context);
445
+ }), this.node.attributes.context;
446
+ }
447
+ layout(t) {
448
+ return t && this.subscribe("components:layout-changed", (e, { node: r }) => {
449
+ r === this.node && t(this.node.attributes.layout);
450
+ }), this.node.attributes.layout;
451
+ }
452
+ writeProperties(t, e) {
453
+ this.node.writeProperties(t, e);
454
+ }
455
+ writeContext(t, e) {
456
+ this.node.writeProperties(t, e);
457
+ }
458
+ writeLayout(t, e) {
459
+ this.node.writeLayout(t, e);
460
+ }
461
+ dispose() {
462
+ this.unsubscribe(), this.actions.dispose();
463
+ }
464
+ };
465
+ class ms {
466
+ constructor(t, e, r = !0) {
467
+ this.platform = t, this.target = e, this.clearOnDispose = r, this.removes = [], this.actions = new ge(this.platform, this.target);
468
+ }
469
+ writeProperties(t, e) {
470
+ this.removes.push(
471
+ this.platform.write({
472
+ options: e,
473
+ attributes: { properties: t },
474
+ target: this.target,
475
+ removable: this.clearOnDispose
476
+ })
477
+ );
478
+ }
479
+ writeContext(t, e) {
480
+ this.removes.push(
481
+ this.platform.write({
482
+ options: e,
483
+ attributes: { context: t },
484
+ target: this.target,
485
+ removable: this.clearOnDispose
486
+ })
487
+ );
488
+ }
489
+ writeLayout(t, e) {
490
+ this.removes.push(
491
+ this.platform.write({
492
+ options: e,
493
+ attributes: { layout: t },
494
+ target: this.target,
495
+ removable: this.clearOnDispose
496
+ })
497
+ );
498
+ }
499
+ dispose() {
500
+ this.removes.forEach((t) => {
501
+ t();
502
+ }), this.actions.dispose();
503
+ }
504
+ }
505
+ const vs = (n, t, e) => {
506
+ const r = n.concat(), s = (i, o, a) => {
507
+ let c = !0;
508
+ if (r.length) {
509
+ const h = r.shift(), l = (u, d) => (c = !1, s(u, Object.assign({}, o, d), a));
510
+ return Promise.resolve(h(i, l, a)).then((u) => gs(ps({}, u), {
511
+ cancelled: c
512
+ }));
513
+ }
514
+ return Promise.resolve({ data: i, cancelled: !1, options: o });
515
+ };
516
+ return s(t, {}, e);
517
+ };
518
+ let ge = class {
519
+ constructor(t, e, r) {
520
+ this.platform = t, this.target = e, this.ns = r, this.subscriptions = [], this.create = this.create.bind(this);
521
+ }
522
+ create(t, e = () => {
523
+ }) {
524
+ const r = {
525
+ key: t,
526
+ fn: e,
527
+ target: this.target,
528
+ ns: this.ns
529
+ };
530
+ this.platform.actionsState.handlers.push(r);
531
+ const s = () => {
532
+ const i = this.platform.actionsState.handlers.indexOf(r);
533
+ i > -1 && this.platform.actionsState.handlers.splice(i, 1);
534
+ };
535
+ return this.subscriptions.push(s), s;
536
+ }
537
+ dispatch(t, e) {
538
+ const r = this.platform.nodes.all.concat(
539
+ this.platform.nodes.detached
540
+ ), s = {}, i = this.platform.actionsState.handlers.filter(
541
+ (o) => o.key === t && (!o.ns || !this.ns || o.ns === this.ns)
542
+ );
543
+ return Promise.all(
544
+ i.map((o) => {
545
+ const a = r.filter(
546
+ (h) => o.target.match(h) && this.target.match(h)
547
+ ), c = this.platform.actionsState.watchers.filter((h) => h.key === t && (!h.ns || !this.ns || h.ns === this.ns) && a.some((l) => h.target.match(l))).map((h) => h.fn);
548
+ return Promise.all(
549
+ a.map((h) => {
550
+ const l = new Ke(
551
+ this.platform,
552
+ h,
553
+ this.ns
554
+ );
555
+ return vs(c, e, l).then((u) => {
556
+ const { data: d = {}, options: p, cancelled: b } = u;
557
+ return Promise.resolve(
558
+ b ? {} : o.fn(d, p, l)
559
+ ).then((v) => {
560
+ s[h.id] = v;
561
+ });
562
+ });
563
+ })
564
+ );
565
+ })
566
+ ).then(() => s);
567
+ }
568
+ watch(t, e) {
569
+ let r = t, s = this.ns;
570
+ const i = t.split(".");
571
+ i.length > 1 && (s = i[0], r = i.splice(1).join("."));
572
+ const o = {
573
+ fn: e,
574
+ target: this.target,
575
+ key: r,
576
+ ns: s
577
+ };
578
+ this.platform.actionsState.watchers.push(o);
579
+ const a = () => {
580
+ const c = this.platform.actionsState.watchers.indexOf(o);
581
+ c > -1 && this.platform.actionsState.watchers.splice(c, 1);
582
+ };
583
+ return this.subscriptions.push(a), a;
584
+ }
585
+ dispose() {
586
+ this.subscriptions.forEach((t) => t());
587
+ }
588
+ };
589
+ Je((n) => {
590
+ n.createCommand("components", (t) => (e) => {
591
+ t.events.subscribeOnce("components:platform-created", (r, { platform: s }) => {
592
+ e.handlers && e.handlers.forEach(([i, o]) => {
593
+ s.addComponentHandler(i, o);
594
+ });
595
+ });
596
+ });
597
+ });
598
+ let Be = class {
599
+ constructor(t, e) {
600
+ this.events = t, this.tags = [], this.children = {}, this.changesets = [], this.mountCount = 0, this.id = Bt(), this.type = e, this.attributes = {
601
+ context: {},
602
+ properties: {},
603
+ layout: {},
604
+ tags: []
605
+ }, this.writeLayout({ size: "full", indent: 0 });
606
+ }
607
+ mount(t, e) {
608
+ let r = t.get("mounted-nodes");
609
+ return r || (r = /* @__PURE__ */ new Map(), t.register("mounted-nodes", r)), r.has(this) ? (process.env.NODE_ENV !== "production" && I.error("Trying to mount an already mounted component node.", this), () => {
610
+ }) : (this.events.dispatch("components:node-mounted", { node: this }), this.mountCount === 0 && (this.mountCount = this.mountCount + 1, this.events.dispatch("components:node-enter", { node: this })), () => {
611
+ r.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 });
612
+ });
613
+ }
614
+ appendChild(t, e = "default") {
615
+ if (t.parent) {
616
+ if (t.parent === this)
617
+ return;
618
+ t.parent.removeChild(t);
619
+ }
620
+ t.parent = this, this.children[e] || (this.children[e] = []), this.children[e].push(t), this.events.dispatch("components:node-appended", { node: t });
621
+ }
622
+ prependChild(t, e = "default") {
623
+ if (t.parent) {
624
+ if (t.parent === this)
625
+ return;
626
+ t.parent.removeChild(t);
627
+ }
628
+ t.parent = this, this.children[e] || (this.children[e] = []), this.children[e].unshift(t), this.events.dispatch("components:node-appended", { node: t });
629
+ }
630
+ touchProperties(t, e = {}, r) {
631
+ const s = [{ properties: t }, e];
632
+ return this.changesets.push(s), this.events.dispatch("components:set-properties", { node: this }), () => {
633
+ if (r) {
634
+ const i = this.changesets.indexOf(s);
635
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-properties", { node: this }));
636
+ }
637
+ };
638
+ }
639
+ writeProperties(t, e = {}, r) {
640
+ const s = [{ properties: t }, e];
641
+ return this.changesets.push(s), this.events.dispatch("components:set-properties", { node: this }), () => {
642
+ if (r) {
643
+ const i = this.changesets.indexOf(s);
644
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-properties", { node: this }));
645
+ }
646
+ };
647
+ }
648
+ writeLayout(t, e = {}, r) {
649
+ const s = [{ layout: t }, e];
650
+ return this.changesets.push(s), this.events.dispatch("components:set-layout", { node: this }), () => {
651
+ if (!r)
652
+ return;
653
+ const i = this.changesets.indexOf(s);
654
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-layout", { node: this }));
655
+ };
656
+ }
657
+ writeContext(t, e = {}, r) {
658
+ const s = [{ context: t }, e];
659
+ return this.changesets.push(s), this.events.dispatch("components:set-context", { node: this }), () => {
660
+ if (!r)
661
+ return;
662
+ const i = this.changesets.indexOf(s);
663
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-context", { node: this }));
664
+ };
665
+ }
666
+ getChildren(t = "default") {
667
+ const e = this.children[t] || [];
668
+ return e.reduce((r, s, i) => {
669
+ const { order: o = i } = s.attributes.layout;
670
+ return r[o] ? r.splice(o, 0, s) : r[o] = s, r;
671
+ }, Array(e.length));
672
+ }
673
+ remove() {
674
+ this.parent && this.parent.removeChild(this);
675
+ }
676
+ removeChild(t) {
677
+ Object.keys(this.children).forEach((e) => {
678
+ const r = this.children[e], s = r.indexOf(t);
679
+ s > -1 && (r.splice(s, 1), this.events.dispatch("components:node-removed", { node: t, parentNode: this }));
680
+ }), delete t.parent;
681
+ }
682
+ };
683
+ const er = (n, t, e) => {
684
+ for (let r = 0, s = n.length; r < s && e(n[r]) !== !0; r++) {
685
+ const i = t[n[r].id] || "default", o = n[r].getChildren(i);
686
+ er(o, t, e);
687
+ }
688
+ }, fe = (n, t, e) => {
689
+ if (e(n) !== !0) {
690
+ const r = t[n.id] || "default", s = n.children[r];
691
+ er(s, t, e);
692
+ }
693
+ }, Zt = (n, t) => {
694
+ const e = [];
695
+ return fe(n, t, (r) => {
696
+ e.push(r);
697
+ }), e;
698
+ }, nr = (n, t, e) => {
699
+ let r;
700
+ return fe(n, t, (s) => {
701
+ if (e(s))
702
+ return r = s, !0;
703
+ }), r;
704
+ };
705
+ let ys = class {
706
+ constructor(t, e, r) {
707
+ this.root = t, this.switches = e, this.all = [], this.visible = [], this.detached = [], r.subscribe("components:node-appended", (s, i) => {
708
+ this.all.push(i.node), this.visible = Zt(t, e);
709
+ }), r.subscribe("components:node-removed", (s, i) => {
710
+ let o = this.all.indexOf(i.node);
711
+ o > -1 && this.all.splice(o, 1), o = this.visible.indexOf(i.node), o > -1 && this.visible.splice(o, 1), this.visible = Zt(t, e);
712
+ }), r.subscribe("components:node-switched", (s, i) => {
713
+ this.visible = Zt(t, e);
714
+ });
715
+ }
716
+ query(t = {}) {
717
+ const e = [];
718
+ return fe(this.root, this.switches, (r) => {
719
+ Object.keys(t).every((s) => t[s] === r[s]) && e.push(r);
720
+ }), e;
721
+ }
722
+ get(t) {
723
+ return nr(this.root, this.switches, (e) => e.id === t) || this.detached.find((e) => e.id === t);
724
+ }
725
+ }, bs = class {
726
+ constructor() {
727
+ this.handlers = /* @__PURE__ */ new Map();
728
+ }
729
+ add(t, e) {
730
+ this.handlers.set(t, e);
731
+ }
732
+ get(t) {
733
+ return this.handlers.get(t);
734
+ }
735
+ };
736
+ const ws = (n) => {
737
+ let t = n, e = 0;
738
+ for (; t.parent; )
739
+ e = e + 1, t = t.parent;
740
+ return e;
741
+ }, $s = (n) => n.map(([t, e]) => [ws(t), t, e]).sort(([t], [e]) => t - e).map(([, t, e]) => [t, e]), Oe = (n) => n instanceof Date ? !1 : n && typeof n == "object" && !Array.isArray(n), X = (n, ...t) => {
742
+ if (!t.length)
743
+ return n;
744
+ const e = t.shift();
745
+ if (Oe(n) && Oe(e))
746
+ for (const r in e)
747
+ Oe(e[r]) ? (n[r] || Object.assign(n, { [r]: {} }), X(n[r], e[r])) : Object.assign(n, { [r]: e[r] });
748
+ return X(n, ...t);
749
+ }, Es = (n, t) => !n || n === "all" ? !0 : n.some((e) => t.indexOf(e) > -1), Os = (n, t) => {
750
+ let e = [], r = [], s;
751
+ const i = () => {
752
+ process.env.NODE_ENV !== "production" && console.time("state-processor.flush");
753
+ const a = /* @__PURE__ */ new Map(), c = $s(e.map((l, u) => [l, r[u]])), h = (l, u) => {
754
+ var d;
755
+ const p = a.get(l) || {}, b = u.context && !p.context, v = u.properties && !p.properties, g = u.layout && !p.layout;
756
+ a.set(l, {
757
+ context: p.context || b,
758
+ properties: p.properties || v,
759
+ layout: p.layout || g
760
+ }), v && (l.attributes.properties = {}), g && (l.attributes.layout = {}), b && (l.attributes.context = X({}, (d = l.parent) == null ? void 0 : d.attributes.context));
761
+ const O = [], j = [], W = [];
762
+ if (l.changesets.forEach((H) => {
763
+ const [k, U] = H;
764
+ Es(U.breakpoints, n.breakpoints) && (v && (typeof k.properties == "function" ? O.push(
765
+ k.properties
766
+ ) : X(l.attributes.properties, k.properties)), g && (typeof k.layout == "function" ? j.push(k.layout) : X(l.attributes.layout, k.layout)), b && (typeof k.context == "function" ? W.push(k.context) : X(l.attributes.context, k.context)));
767
+ }), O.forEach((H) => {
768
+ X(l.attributes.properties, H(l.attributes.properties));
769
+ }), j.forEach((H) => {
770
+ X(l.attributes.layout, H(l.attributes.layout));
771
+ }), W.forEach((H) => {
772
+ X(l.attributes.context, H(l.attributes.context));
773
+ }), b || u.recursive) {
774
+ const H = n.getBranch(l), k = u.recursive ? u : {
775
+ context: !!b
776
+ };
777
+ l.getChildren(H).forEach((U) => {
778
+ h(U, k);
779
+ });
780
+ }
781
+ };
782
+ process.env.NODE_ENV !== "production" && console.timeEnd("state-processor.flush"), c.forEach(([l, u]) => {
783
+ h(l, u);
784
+ }), e = [], r = [], t(a);
785
+ }, o = () => {
786
+ clearTimeout(s), s = setTimeout(i, 0);
787
+ };
788
+ return (a, c) => {
789
+ const h = e.indexOf(a);
790
+ if (h > -1) {
791
+ const l = r[h];
792
+ return c.context && (l.context = !0), c.properties && (l.properties = !0), c.layout && (l.layout = !0), c.recursive && (l.recursive = !0), o();
793
+ }
794
+ return e.push(a), r.push(c), o();
795
+ };
796
+ };
797
+ let me = class {
798
+ constructor(t, e = {}) {
799
+ this.providers = e, this.breakpoints = [], this.actionsState = { handlers: [], watchers: [] }, this.switches = {}, this.changesets = [], this.subscriptions = [], this.customComponentHandler = new bs(), this.events = t.events.createChild(this);
800
+ const r = new Be(this.events, "root");
801
+ r.name = `root-${t.name}`, this.nodes = new ys(r, this.switches, this.events);
802
+ const s = this.processNode = Os(this, (i) => {
803
+ const o = Array.from(i.keys());
804
+ process.env.NODE_ENV !== "production" && console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
805
+ ${o.map(
806
+ (a) => `${a.name || "<no name>"} (${a.id})
807
+ `
808
+ )}`), o.forEach((a) => {
809
+ const c = i.get(a);
810
+ a.parent && a.parent.type === "root" && this.events.dispatch("components:root-children-changed", { node: a }), c != null && c.context && this.events.dispatch("components:context-changed", { node: a }), c != null && c.properties && this.events.dispatch("components:properties-changed", { node: a }), c != null && c.layout && this.events.dispatch("components:layout-changed", { node: a });
811
+ }), this.events.dispatch("components:component-model-initialized", {}, { bubbles: !0 });
812
+ });
813
+ Promise.all(
814
+ Object.keys(e).map((i) => e[i].load(this))
815
+ ), this.subscriptions.push(
816
+ this.events.subscribe(
817
+ "components:node-appended",
818
+ (i, o) => {
819
+ const { node: a } = o;
820
+ this.changesets.forEach((c) => {
821
+ const { changeset: h, target: l, removes: u } = c, [d, p] = h;
822
+ l.match(o.node) && (d.properties && u.push(a.writeProperties(d.properties, p)), d.context && u.push(a.writeContext(d.context, p)), d.layout && u.push(a.writeLayout(d.layout, p)));
823
+ });
824
+ }
825
+ )
826
+ ), this.subscriptions.push(
827
+ this.events.subscribe(
828
+ "components:node-appended",
829
+ (i, o) => {
830
+ s(o.node, { properties: !0, context: !0 });
831
+ }
832
+ )
833
+ ), this.subscriptions.push(
834
+ this.events.subscribe(
835
+ "components:set-properties",
836
+ (i, o) => {
837
+ s(o.node, { properties: !0 });
838
+ }
839
+ )
840
+ ), this.subscriptions.push(
841
+ this.events.subscribe(
842
+ "components:set-context",
843
+ (i, o) => {
844
+ s(o.node, { properties: !0, context: !0 });
845
+ }
846
+ )
847
+ ), this.subscriptions.push(
848
+ this.events.subscribe(
849
+ "components:set-indent",
850
+ (i, o) => {
851
+ s(o.node, { layout: !0 });
852
+ }
853
+ )
854
+ ), this.subscriptions.push(
855
+ this.events.subscribe(
856
+ "components:set-layout",
857
+ (i, o) => {
858
+ s(o.node, { layout: !0 });
859
+ }
860
+ )
861
+ ), this.subscriptions.push(
862
+ this.events.subscribe("components:node-switched", (i, { node: o, branch: a }) => {
863
+ s(o, {
864
+ layout: !0,
865
+ recursive: !0,
866
+ properties: !0,
867
+ context: !0
868
+ });
869
+ })
870
+ ), this.subscriptions.push(
871
+ this.events.subscribe("components:node-removed", (i, { parentNode: o }) => {
872
+ s(o, { properties: !0 });
873
+ })
874
+ ), this.events.parent && this.events.parent.dispatch("components:platform-created", { platform: this });
875
+ }
876
+ static getInstance(t) {
877
+ return t.getAsync("components");
878
+ }
879
+ addBreakpoint(t) {
880
+ this.breakpoints.indexOf(t) === -1 && (this.breakpoints.push(t), this.processNode(this.nodes.root, {
881
+ context: !0,
882
+ properties: !0,
883
+ layout: !0,
884
+ recursive: !0
885
+ }));
886
+ }
887
+ removeBreakpoint(t) {
888
+ const e = this.breakpoints.indexOf(t);
889
+ e > -1 && (this.breakpoints.splice(e, 1), this.processNode(this.nodes.root, {
890
+ context: !0,
891
+ properties: !0,
892
+ layout: !0,
893
+ recursive: !0
894
+ }));
895
+ }
896
+ setSwitch(t, e) {
897
+ this.switches[t.id] = e, this.events.dispatch("components:node-switched", { node: t, branch: e });
898
+ }
899
+ getBranch(t) {
900
+ return this.switches[t.id];
901
+ }
902
+ /**
903
+ * Creates a `ComponentNode` of the specified type.
904
+ * @param type Type of node.
905
+ */
906
+ createNode(t, e = {}) {
907
+ const r = new Be(this.events, t);
908
+ return e.detached && this.nodes.detached.push(r), r;
909
+ }
910
+ components() {
911
+ return new Pt(this);
912
+ }
913
+ actions(t, e) {
914
+ return new ge(this, t, e);
915
+ }
916
+ write(t) {
917
+ const { provider: e, target: r, attributes: s, options: i = {}, removable: o } = t, a = t.key || Bt(), c = { changeset: [s, i], target: r, removes: [] };
918
+ if (e) {
919
+ const h = this.providers[e];
920
+ h.write(a, r, s, i), c.removes.push(() => {
921
+ h.remove(a);
922
+ });
923
+ }
924
+ return this.changesets.push(c), this.nodes.all.forEach((h) => {
925
+ if (r.match(h)) {
926
+ let l = () => {
927
+ };
928
+ s.properties && (l = h.writeProperties(s.properties, i, o)), s.context && (l = h.writeContext(s.context, i, o)), s.layout && (l = h.writeContext(s.layout, i, o)), c.removes.push(l);
929
+ }
930
+ }), () => {
931
+ if (o) {
932
+ c.removes.forEach((l) => l());
933
+ const h = this.changesets.indexOf(c);
934
+ h > -1 && this.changesets.splice(h, 1);
935
+ }
936
+ };
937
+ }
938
+ addComponentHandler(t, e) {
939
+ this.customComponentHandler.add(t, e);
940
+ }
941
+ getComponentHandler(t) {
942
+ return this.customComponentHandler.get(t);
943
+ }
944
+ dispose() {
945
+ this.subscriptions.forEach((t) => t());
946
+ }
947
+ };
948
+ const As = (n) => {
949
+ if (Array.isArray(n)) {
950
+ const [t, ...e] = n;
951
+ return {
952
+ definitionId: t,
953
+ overrides: e
954
+ };
955
+ }
956
+ return {
957
+ definitionId: n,
958
+ overrides: []
959
+ };
960
+ }, ie = (n, t, e, r, s, i) => {
961
+ e.forEach((o) => {
962
+ const a = As(o), c = r[a.definitionId];
963
+ if (a.definitionId === "view") {
964
+ const h = n.createNode("view");
965
+ h.name = "view", Object.keys(s).forEach((l) => {
966
+ const u = s[l];
967
+ ie(n, h, [u.entry], r, s, l);
968
+ }), t.appendChild(h), a.overrides.forEach((l) => {
969
+ l.properties && h.writeProperties(l.properties, {
970
+ breakpoints: l.breakpoints
971
+ }), l.context && h.writeContext(l.context, { breakpoints: l.breakpoints }), l.layout && h.writeLayout(l.layout, { breakpoints: l.breakpoints });
972
+ });
973
+ } else if (n.getComponentHandler(c.type)) {
974
+ const h = n.getComponentHandler(c.type);
975
+ h && h(a, {
976
+ platform: n,
977
+ node: t,
978
+ references: e,
979
+ definitions: r,
980
+ views: s,
981
+ branch: i
982
+ });
983
+ } else {
984
+ const h = r[a.definitionId];
985
+ if (process.env.NODE_ENV !== "production" && !h) {
986
+ I.error(
987
+ `No definition found for component type '${a.definitionId}'.`
988
+ );
989
+ return;
990
+ }
991
+ const l = n.createNode(h.type);
992
+ l.name = a.definitionId, l.tags = h.tags || [], h.properties && l.writeProperties(h.properties), h.context && l.writeContext(h.context), h.layout && l.writeLayout(h.layout), t.appendChild(l, i), a.overrides.forEach((u) => {
993
+ const d = { breakpoints: u.breakpoints };
994
+ u.properties && l.writeProperties(u.properties, d), u.context && l.writeContext(u.context, d), u.layout && l.writeLayout(u.layout, d);
995
+ }), h.children && ie(n, l, h.children, r, s);
996
+ }
997
+ });
998
+ }, rr = (n, t) => {
999
+ const { entry: e, components: r, breakpoints: s, views: i } = t, o = [];
1000
+ return Object.keys(s).forEach((a) => {
1001
+ const c = s[a], h = window.matchMedia(c);
1002
+ h.matches && n.breakpoints.push(a);
1003
+ const l = (u) => {
1004
+ u.matches ? n.addBreakpoint(a) : n.removeBreakpoint(a);
1005
+ };
1006
+ h.addListener(l), o.push(() => h.removeListener(l));
1007
+ }), ie(n, n.nodes.root, [e], r, i), () => o.forEach((a) => {
1008
+ a();
1009
+ });
1010
+ }, xs = (n, t) => ({
1011
+ id: n.id,
1012
+ type: n.type,
1013
+ name: n.name,
1014
+ branch: t || "default"
1015
+ }), sr = (n, t, e, r = Bt(), s = {}) => n.getAsync("components").then((i) => {
1016
+ let o;
1017
+ if (typeof t == "string") {
1018
+ const h = new Pt(i);
1019
+ h.ofType(t), o = h;
1020
+ } else
1021
+ o = t;
1022
+ const a = {}, c = (h) => {
1023
+ const l = a[h.id];
1024
+ return l ? Promise.resolve(l.controller) : me.getInstance(n).then((u) => new Ke(u, h, r));
1025
+ };
1026
+ i.events.subscribe(
1027
+ "components:node-enter",
1028
+ (h, { node: l }) => {
1029
+ o.match(l) && c(l).then((u) => {
1030
+ Promise.resolve(e(u)).then((d) => {
1031
+ a[l.id] = {
1032
+ dispose: d,
1033
+ controller: u
1034
+ };
1035
+ });
1036
+ });
1037
+ }
1038
+ ), i.events.subscribe(
1039
+ "components:node-exit",
1040
+ (h, { node: l }) => {
1041
+ const u = a[l.id];
1042
+ u && (u.dispose && u.dispose(), s.reuseController || (u.controller.dispose(), delete a[l.id]));
1043
+ }
1044
+ );
1045
+ });
1046
+ class _s {
1047
+ constructor(t) {
1048
+ this.aliases = /* @__PURE__ */ new Map(), this.components = /* @__PURE__ */ new Map(), this.logger = new I();
1049
+ const { events: e } = t.get("$widget");
1050
+ this.events = e;
1051
+ }
1052
+ getComponent(t) {
1053
+ const e = this.aliases.get(t), r = this.components.get(e || t) || null;
1054
+ return process.env.NODE_ENV !== "production" && (r || this.logger.warn(
1055
+ e || t,
1056
+ `Unable to resolve component: "${e || t}". You most likely forgot to register the required plugin for: ${e || t}.`
1057
+ )), r;
1058
+ }
1059
+ registerComponent(t, e) {
1060
+ return this.components.set(t, e), this.events.dispatch("component-resolver:resolve", t), () => {
1061
+ this.components.delete(t);
1062
+ };
1063
+ }
1064
+ registerResolver(t, e) {
1065
+ return this.events.subscribe("component-resolver:resolve", (r, s) => {
1066
+ if (s === t) {
1067
+ const i = this.getComponent(t);
1068
+ e(i);
1069
+ }
1070
+ });
1071
+ }
1072
+ registerAlias(t, e) {
1073
+ return this.aliases.set(t, e), this.events.dispatch("component-resolver:resolve", t), () => {
1074
+ this.aliases.delete(t);
1075
+ };
1076
+ }
1077
+ }
1078
+ var q = /* @__PURE__ */ ((n) => (n.open = "open", n.closed = "closed", n.hidden = "hidden", n))(q || {});
1079
+ const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1080
+ __proto__: null,
1081
+ ActionResolver: fs,
1082
+ ActionsController: ge,
1083
+ ComponentNode: Be,
1084
+ ComponentNodeController: Ke,
1085
+ ComponentPlatform: me,
1086
+ ComponentQuery: Pt,
1087
+ ComponentResolver: _s,
1088
+ WidgetRenderState: q,
1089
+ asDescriptor: xs,
1090
+ createChildren: ie,
1091
+ createComponentModel: rr,
1092
+ createEventSubscriber: tr,
1093
+ extendComponent: sr,
1094
+ findComponent: nr,
1095
+ findVisibleComponents: Zt,
1096
+ traverseComponents: fe
1097
+ }, Symbol.toStringTag, { value: "Module" }));
1098
+ function ir(n) {
1099
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
1100
+ }
1101
+ var or = function() {
1102
+ };
1103
+ process.env.NODE_ENV !== "production" && (or = function(n, t, e) {
1104
+ var r = arguments.length;
1105
+ e = new Array(r > 2 ? r - 2 : 0);
1106
+ for (var s = 2; s < r; s++)
1107
+ e[s - 2] = arguments[s];
1108
+ if (t === void 0)
1109
+ throw new Error(
1110
+ "`warning(condition, format, ...args)` requires a warning message argument"
1111
+ );
1112
+ if (t.length < 10 || /^[s\W]*$/.test(t))
1113
+ throw new Error(
1114
+ "The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: " + t
1115
+ );
1116
+ if (!n) {
1117
+ var i = 0, o = "Warning: " + t.replace(/%s/g, function() {
1118
+ return e[i++];
1119
+ });
1120
+ typeof console != "undefined" && console.error(o);
1121
+ try {
1122
+ throw new Error(o);
1123
+ } catch (a) {
1124
+ }
1125
+ }
1126
+ });
1127
+ var Ss = or;
1128
+ const tt = /* @__PURE__ */ ir(Ss);
1129
+ var Ps = function(n, t, e, r, s, i, o, a) {
1130
+ if (process.env.NODE_ENV !== "production" && t === void 0)
1131
+ throw new Error("invariant requires an error message argument");
1132
+ if (!n) {
1133
+ var c;
1134
+ if (t === void 0)
1135
+ c = new Error(
1136
+ "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
1137
+ );
1138
+ else {
1139
+ var h = [e, r, s, i, o, a], l = 0;
1140
+ c = new Error(
1141
+ t.replace(/%s/g, function() {
1142
+ return h[l++];
1143
+ })
1144
+ ), c.name = "Invariant Violation";
1145
+ }
1146
+ throw c.framesToPop = 1, c;
1147
+ }
1148
+ }, Cs = Ps;
1149
+ const ks = /* @__PURE__ */ ir(Cs);
1150
+ function Ft(n) {
1151
+ return n.charAt(0) === "/";
1152
+ }
1153
+ function Ae(n, t) {
1154
+ for (var e = t, r = e + 1, s = n.length; r < s; e += 1, r += 1)
1155
+ n[e] = n[r];
1156
+ n.pop();
1157
+ }
1158
+ function Ns(n) {
1159
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", e = n && n.split("/") || [], r = t && t.split("/") || [], s = n && Ft(n), i = t && Ft(t), o = s || i;
1160
+ if (n && Ft(n) ? r = e : e.length && (r.pop(), r = r.concat(e)), !r.length)
1161
+ return "/";
1162
+ var a = void 0;
1163
+ if (r.length) {
1164
+ var c = r[r.length - 1];
1165
+ a = c === "." || c === ".." || c === "";
1166
+ } else
1167
+ a = !1;
1168
+ for (var h = 0, l = r.length; l >= 0; l--) {
1169
+ var u = r[l];
1170
+ u === "." ? Ae(r, l) : u === ".." ? (Ae(r, l), h++) : h && (Ae(r, l), h--);
1171
+ }
1172
+ if (!o)
1173
+ for (; h--; h)
1174
+ r.unshift("..");
1175
+ o && r[0] !== "" && (!r[0] || !Ft(r[0])) && r.unshift("");
1176
+ var d = r.join("/");
1177
+ return a && d.substr(-1) !== "/" && (d += "/"), d;
1178
+ }
1179
+ var Ms = function(t) {
1180
+ return t.charAt(0) === "/" ? t : "/" + t;
1181
+ }, ar = function(t, e) {
1182
+ return new RegExp("^" + e + "(\\/|\\?|#|$)", "i").test(t);
1183
+ }, Ls = function(t, e) {
1184
+ return ar(t, e) ? t.substr(e.length) : t;
1185
+ }, Ds = function(t) {
1186
+ return t.charAt(t.length - 1) === "/" ? t.slice(0, -1) : t;
1187
+ }, Ts = function(t) {
1188
+ var e = t || "/", r = "", s = "", i = e.indexOf("#");
1189
+ i !== -1 && (s = e.substr(i), e = e.substr(0, i));
1190
+ var o = e.indexOf("?");
1191
+ return o !== -1 && (r = e.substr(o), e = e.substr(0, o)), {
1192
+ pathname: e,
1193
+ search: r === "?" ? "" : r,
1194
+ hash: s === "#" ? "" : s
1195
+ };
1196
+ }, cr = function(t) {
1197
+ var e = t.pathname, r = t.search, s = t.hash, i = e || "/";
1198
+ return r && r !== "?" && (i += r.charAt(0) === "?" ? r : "?" + r), s && s !== "#" && (i += s.charAt(0) === "#" ? s : "#" + s), i;
1199
+ }, js = Object.assign || function(n) {
1200
+ for (var t = 1; t < arguments.length; t++) {
1201
+ var e = arguments[t];
1202
+ for (var r in e)
1203
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
1204
+ }
1205
+ return n;
1206
+ }, gt = function(t, e, r, s) {
1207
+ var i = void 0;
1208
+ typeof t == "string" ? (i = Ts(t), i.state = e) : (i = js({}, t), i.pathname === void 0 && (i.pathname = ""), i.search ? i.search.charAt(0) !== "?" && (i.search = "?" + i.search) : i.search = "", i.hash ? i.hash.charAt(0) !== "#" && (i.hash = "#" + i.hash) : i.hash = "", e !== void 0 && i.state === void 0 && (i.state = e));
1209
+ try {
1210
+ i.pathname = decodeURI(i.pathname);
1211
+ } catch (o) {
1212
+ throw o instanceof URIError ? new URIError('Pathname "' + i.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.') : o;
1213
+ }
1214
+ return r && (i.key = r), s ? i.pathname ? i.pathname.charAt(0) !== "/" && (i.pathname = Ns(i.pathname, s.pathname)) : i.pathname = s.pathname : i.pathname || (i.pathname = "/"), i;
1215
+ }, hr = function() {
1216
+ var t = null, e = function(c) {
1217
+ return tt(t == null, "A history supports only one prompt at a time"), t = c, function() {
1218
+ t === c && (t = null);
1219
+ };
1220
+ }, r = function(c, h, l, u) {
1221
+ if (t != null) {
1222
+ var d = typeof t == "function" ? t(c, h) : t;
1223
+ typeof d == "string" ? typeof l == "function" ? l(d, u) : (tt(!1, "A history needs a getUserConfirmation function in order to use a prompt message"), u(!0)) : u(d !== !1);
1224
+ } else
1225
+ u(!0);
1226
+ }, s = [], i = function(c) {
1227
+ var h = !0, l = function() {
1228
+ h && c.apply(void 0, arguments);
1229
+ };
1230
+ return s.push(l), function() {
1231
+ h = !1, s = s.filter(function(u) {
1232
+ return u !== l;
1233
+ });
1234
+ };
1235
+ }, o = function() {
1236
+ for (var c = arguments.length, h = Array(c), l = 0; l < c; l++)
1237
+ h[l] = arguments[l];
1238
+ s.forEach(function(u) {
1239
+ return u.apply(void 0, h);
1240
+ });
1241
+ };
1242
+ return {
1243
+ setPrompt: e,
1244
+ confirmTransitionTo: r,
1245
+ appendListener: i,
1246
+ notifyListeners: o
1247
+ };
1248
+ }, Rs = !!(typeof window != "undefined" && window.document && window.document.createElement), fn = function(t, e, r) {
1249
+ return t.addEventListener ? t.addEventListener(e, r, !1) : t.attachEvent("on" + e, r);
1250
+ }, mn = function(t, e, r) {
1251
+ return t.removeEventListener ? t.removeEventListener(e, r, !1) : t.detachEvent("on" + e, r);
1252
+ }, Is = function(t, e) {
1253
+ return e(window.confirm(t));
1254
+ }, Hs = function() {
1255
+ var t = window.navigator.userAgent;
1256
+ return (t.indexOf("Android 2.") !== -1 || t.indexOf("Android 4.0") !== -1) && t.indexOf("Mobile Safari") !== -1 && t.indexOf("Chrome") === -1 && t.indexOf("Windows Phone") === -1 ? !1 : window.history && "pushState" in window.history;
1257
+ }, Us = function() {
1258
+ return window.navigator.userAgent.indexOf("Trident") === -1;
1259
+ }, Bs = function(t) {
1260
+ return t.state === void 0 && navigator.userAgent.indexOf("CriOS") === -1;
1261
+ }, vn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1262
+ return typeof n;
1263
+ } : function(n) {
1264
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1265
+ }, Vs = Object.assign || function(n) {
1266
+ for (var t = 1; t < arguments.length; t++) {
1267
+ var e = arguments[t];
1268
+ for (var r in e)
1269
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
1270
+ }
1271
+ return n;
1272
+ }, yn = "popstate", bn = "hashchange", wn = function() {
1273
+ try {
1274
+ return window.history.state || {};
1275
+ } catch (t) {
1276
+ return {};
1277
+ }
1278
+ }, zs = function() {
1279
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1280
+ ks(Rs, "Browser history needs a DOM");
1281
+ var e = window.history, r = Hs(), s = !Us(), i = t.forceRefresh, o = i === void 0 ? !1 : i, a = t.getUserConfirmation, c = a === void 0 ? Is : a, h = t.keyLength, l = h === void 0 ? 6 : h, u = t.basename ? Ds(Ms(t.basename)) : "", d = function(m) {
1282
+ var E = m || {}, M = E.key, L = E.state, J = window.location, K = J.pathname, rt = J.search, Z = J.hash, F = K + rt + Z;
1283
+ return tt(!u || ar(F, u), 'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "' + F + '" to begin with "' + u + '".'), u && (F = Ls(F, u)), gt(F, L, M);
1284
+ }, p = function() {
1285
+ return Math.random().toString(36).substr(2, l);
1286
+ }, b = hr(), v = function(m) {
1287
+ Vs(_, m), _.length = e.length, b.notifyListeners(_.location, _.action);
1288
+ }, g = function(m) {
1289
+ Bs(m) || W(d(m.state));
1290
+ }, O = function() {
1291
+ W(d(wn()));
1292
+ }, j = !1, W = function(m) {
1293
+ if (j)
1294
+ j = !1, v();
1295
+ else {
1296
+ var E = "POP";
1297
+ b.confirmTransitionTo(m, E, c, function(M) {
1298
+ M ? v({ action: E, location: m }) : H(m);
1299
+ });
1300
+ }
1301
+ }, H = function(m) {
1302
+ var E = _.location, M = U.indexOf(E.key);
1303
+ M === -1 && (M = 0);
1304
+ var L = U.indexOf(m.key);
1305
+ L === -1 && (L = 0);
1306
+ var J = M - L;
1307
+ J && (j = !0, D(J));
1308
+ }, k = d(wn()), U = [k.key], A = function(m) {
1309
+ return u + cr(m);
1310
+ }, N = function(m, E) {
1311
+ tt(!((typeof m == "undefined" ? "undefined" : vn(m)) === "object" && m.state !== void 0 && E !== void 0), "You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");
1312
+ var M = "PUSH", L = gt(m, E, p(), _.location);
1313
+ b.confirmTransitionTo(L, M, c, function(J) {
1314
+ if (J) {
1315
+ var K = A(L), rt = L.key, Z = L.state;
1316
+ if (r)
1317
+ if (e.pushState({ key: rt, state: Z }, null, K), o)
1318
+ window.location.href = K;
1319
+ else {
1320
+ var F = U.indexOf(_.location.key), sn = U.slice(0, F === -1 ? 0 : F + 1);
1321
+ sn.push(L.key), U = sn, v({ action: M, location: L });
1322
+ }
1323
+ else
1324
+ tt(Z === void 0, "Browser history cannot push state in browsers that do not support HTML5 history"), window.location.href = K;
1325
+ }
1326
+ });
1327
+ }, C = function(m, E) {
1328
+ tt(!((typeof m == "undefined" ? "undefined" : vn(m)) === "object" && m.state !== void 0 && E !== void 0), "You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");
1329
+ var M = "REPLACE", L = gt(m, E, p(), _.location);
1330
+ b.confirmTransitionTo(L, M, c, function(J) {
1331
+ if (J) {
1332
+ var K = A(L), rt = L.key, Z = L.state;
1333
+ if (r)
1334
+ if (e.replaceState({ key: rt, state: Z }, null, K), o)
1335
+ window.location.replace(K);
1336
+ else {
1337
+ var F = U.indexOf(_.location.key);
1338
+ F !== -1 && (U[F] = L.key), v({ action: M, location: L });
1339
+ }
1340
+ else
1341
+ tt(Z === void 0, "Browser history cannot replace state in browsers that do not support HTML5 history"), window.location.replace(K);
1342
+ }
1343
+ });
1344
+ }, D = function(m) {
1345
+ e.go(m);
1346
+ }, V = function() {
1347
+ return D(-1);
1348
+ }, B = function() {
1349
+ return D(1);
1350
+ }, R = 0, f = function(m) {
1351
+ R += m, R === 1 ? (fn(window, yn, g), s && fn(window, bn, O)) : R === 0 && (mn(window, yn, g), s && mn(window, bn, O));
1352
+ }, w = !1, y = function() {
1353
+ var m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, E = b.setPrompt(m);
1354
+ return w || (f(1), w = !0), function() {
1355
+ return w && (w = !1, f(-1)), E();
1356
+ };
1357
+ }, $ = function(m) {
1358
+ var E = b.appendListener(m);
1359
+ return f(1), function() {
1360
+ f(-1), E();
1361
+ };
1362
+ }, _ = {
1363
+ length: e.length,
1364
+ action: "POP",
1365
+ location: k,
1366
+ createHref: A,
1367
+ push: N,
1368
+ replace: C,
1369
+ go: D,
1370
+ goBack: V,
1371
+ goForward: B,
1372
+ block: y,
1373
+ listen: $
1374
+ };
1375
+ return _;
1376
+ }, $n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1377
+ return typeof n;
1378
+ } : function(n) {
1379
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1380
+ }, Ws = Object.assign || function(n) {
1381
+ for (var t = 1; t < arguments.length; t++) {
1382
+ var e = arguments[t];
1383
+ for (var r in e)
1384
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
1385
+ }
1386
+ return n;
1387
+ }, En = function(t, e, r) {
1388
+ return Math.min(Math.max(t, e), r);
1389
+ }, Fs = function() {
1390
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.getUserConfirmation, r = t.initialEntries, s = r === void 0 ? ["/"] : r, i = t.initialIndex, o = i === void 0 ? 0 : i, a = t.keyLength, c = a === void 0 ? 6 : a, h = hr(), l = function(C) {
1391
+ Ws(A, C), A.length = A.entries.length, h.notifyListeners(A.location, A.action);
1392
+ }, u = function() {
1393
+ return Math.random().toString(36).substr(2, c);
1394
+ }, d = En(o, 0, s.length - 1), p = s.map(function(N) {
1395
+ return typeof N == "string" ? gt(N, void 0, u()) : gt(N, void 0, N.key || u());
1396
+ }), b = cr, v = function(C, D) {
1397
+ tt(!((typeof C == "undefined" ? "undefined" : $n(C)) === "object" && C.state !== void 0 && D !== void 0), "You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");
1398
+ var V = "PUSH", B = gt(C, D, u(), A.location);
1399
+ h.confirmTransitionTo(B, V, e, function(R) {
1400
+ if (R) {
1401
+ var f = A.index, w = f + 1, y = A.entries.slice(0);
1402
+ y.length > w ? y.splice(w, y.length - w, B) : y.push(B), l({
1403
+ action: V,
1404
+ location: B,
1405
+ index: w,
1406
+ entries: y
1407
+ });
1408
+ }
1409
+ });
1410
+ }, g = function(C, D) {
1411
+ tt(!((typeof C == "undefined" ? "undefined" : $n(C)) === "object" && C.state !== void 0 && D !== void 0), "You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");
1412
+ var V = "REPLACE", B = gt(C, D, u(), A.location);
1413
+ h.confirmTransitionTo(B, V, e, function(R) {
1414
+ R && (A.entries[A.index] = B, l({ action: V, location: B }));
1415
+ });
1416
+ }, O = function(C) {
1417
+ var D = En(A.index + C, 0, A.entries.length - 1), V = "POP", B = A.entries[D];
1418
+ h.confirmTransitionTo(B, V, e, function(R) {
1419
+ R ? l({
1420
+ action: V,
1421
+ location: B,
1422
+ index: D
1423
+ }) : l();
1424
+ });
1425
+ }, j = function() {
1426
+ return O(-1);
1427
+ }, W = function() {
1428
+ return O(1);
1429
+ }, H = function(C) {
1430
+ var D = A.index + C;
1431
+ return D >= 0 && D < A.entries.length;
1432
+ }, k = function() {
1433
+ var C = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1434
+ return h.setPrompt(C);
1435
+ }, U = function(C) {
1436
+ return h.appendListener(C);
1437
+ }, A = {
1438
+ length: p.length,
1439
+ action: "POP",
1440
+ location: p[d],
1441
+ index: d,
1442
+ entries: p,
1443
+ createHref: b,
1444
+ push: v,
1445
+ replace: g,
1446
+ go: O,
1447
+ goBack: j,
1448
+ goForward: W,
1449
+ canGo: H,
1450
+ block: k,
1451
+ listen: U
1452
+ };
1453
+ return A;
1454
+ }, qs = Object.defineProperty, On = Object.getOwnPropertySymbols, Js = Object.prototype.hasOwnProperty, Ks = Object.prototype.propertyIsEnumerable, An = (n, t, e) => t in n ? qs(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, $t = (n, t) => {
1455
+ for (var e in t || (t = {}))
1456
+ Js.call(t, e) && An(n, e, t[e]);
1457
+ if (On)
1458
+ for (var e of On(t))
1459
+ Ks.call(t, e) && An(n, e, t[e]);
1460
+ return n;
1461
+ }, qt = (n, t, e) => new Promise((r, s) => {
1462
+ var i = (c) => {
1463
+ try {
1464
+ a(e.next(c));
1465
+ } catch (h) {
1466
+ s(h);
1467
+ }
1468
+ }, o = (c) => {
1469
+ try {
1470
+ a(e.throw(c));
1471
+ } catch (h) {
1472
+ s(h);
1473
+ }
1474
+ }, a = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(i, o);
1475
+ a((e = e.apply(n, t)).next());
1476
+ }), S = /* @__PURE__ */ ((n) => (n.Cookie = "cookie", n.Local = "local", n.Session = "session", n))(S || {}), Ct = /* @__PURE__ */ ((n) => (n.Tenant = "tenant", n.Implementation = "implementation", n.Widget = "widget", n))(Ct || {}), P = /* @__PURE__ */ ((n) => (n.Necessary = "necessary", n.Functional = "functional", n.Analytical = "analytical", n.Marketing = "marketing", n))(P || {});
1477
+ const et = (n, t, e, r = {}) => xn(n, e).then((s) => (process.env.NODE_ENV !== "production" && s && I.warn(
1478
+ `createStorageWriter: Attempted to create storage writer using unallowed category.
1479
+ Key: ${t}
1480
+ Category: ${JSON.stringify(e)}
1481
+ Options: ${JSON.stringify(r)}`
1482
+ ), (i) => (Qe(n), xn(n, e).then((o) => {
1483
+ if (o) {
1484
+ process.env.NODE_ENV !== "production" && I.warn(
1485
+ `storageWriter: Attempted to write to storage using unallowed category.
1486
+ Key: ${t}
1487
+ Category: ${JSON.stringify(e)}
1488
+ Value: ${JSON.stringify(i)}
1489
+ Options: ${JSON.stringify(r)}`
1490
+ );
1491
+ return;
1492
+ }
1493
+ const {
1494
+ scope: a = Ct.Widget,
1495
+ medium: c = S.Session,
1496
+ duration: h
1497
+ } = r, l = Ys();
1498
+ return l[a][t] = Ze(i, e, h), c === S.Cookie ? ti(n, l) : ni(n, c, l);
1499
+ })))), Y = (n, t, e = S.Session) => (Qe(n), typeof t == "undefined" ? (process.env.NODE_ENV !== "production" && I.warn("readStorage: Undefined key passed when reading storage. ", t, e), Promise.resolve(void 0)) : e === S.Cookie ? Xs(n).then((r) => ae(r, t)) : ei(n, e).then((r) => ae(r, t))), xt = (n) => !!Object.entries(n).filter(([t, e]) => typeof e != "undefined").length, xe = (n) => Object.entries(n).filter(([t, e]) => typeof e != "undefined").forEach(([t, { value: e }]) => {
1500
+ typeof e == "undefined" && delete n[t];
1501
+ }), lr = (n, t) => {
1502
+ const e = {
1503
+ tenant: $t($t({}, n.tenant), t.tenant),
1504
+ implementation: $t($t({}, n.implementation), t.implementation),
1505
+ widget: $t($t({}, n.widget), t.widget)
1506
+ };
1507
+ return xe(e.tenant), xe(e.implementation), xe(e.widget), e;
1508
+ }, Gs = (n) => Object.entries(n).reduce((t, e) => {
1509
+ const [r, s] = e;
1510
+ return Object.entries(s).forEach((i) => {
1511
+ const [o, { expiration: a }] = i;
1512
+ a && t.push(a);
1513
+ }), t;
1514
+ }, []).slice().sort((t, e) => new Date(e).valueOf() - new Date(t).valueOf()).shift() || ye(), ve = (n) => {
1515
+ const {
1516
+ name: t,
1517
+ implementation: { name: e, tenant: r }
1518
+ } = n.get("$widget");
1519
+ return [
1520
+ `humany_${r}`,
1521
+ `humany_${un(r + e)}`,
1522
+ `humany_${un(r + e + t)}`
1523
+ ];
1524
+ }, _e = (n) => {
1525
+ const t = new RegExp(`(?:^|;)\\s?${n}=(.*?)(?:;|$)`, "i"), e = document.cookie.match(t);
1526
+ return e && e[1] && JSON.parse(e[1]) || void 0;
1527
+ }, Se = (n, t, e) => {
1528
+ const r = `${n}=${JSON.stringify(t).trim()}`, s = `expires=${new Date(e).toUTCString()}`, i = "path=/", o = "SameSite=None;Secure";
1529
+ return document.cookie = `${r}; ${s}; ${i}; ${o}`;
1530
+ }, Ye = (n) => {
1531
+ const [t, e, r] = ve(n), s = _e(t) || {}, i = _e(e) || {}, o = _e(r) || {};
1532
+ return {
1533
+ tenant: s,
1534
+ implementation: i,
1535
+ widget: o
1536
+ };
1537
+ }, ur = (n, t) => {
1538
+ const e = Ye(n), r = lr(e, t), [s, i, o] = ve(n), { tenant: a, implementation: c, widget: h } = r, l = Gs(t), u = ye({ days: -1 });
1539
+ Se(s, a, xt(a) ? l : u), Se(
1540
+ i,
1541
+ c,
1542
+ xt(c) ? l : u
1543
+ ), Se(o, h, xt(h) ? l : u);
1544
+ }, oe = (n, t) => {
1545
+ const [e, r, s] = ve(n), i = t.getItem(e) || "{}", o = t.getItem(r) || "{}", a = t.getItem(s) || "{}";
1546
+ return {
1547
+ tenant: JSON.parse(i),
1548
+ implementation: JSON.parse(o),
1549
+ widget: JSON.parse(a)
1550
+ };
1551
+ }, Ve = (n, t, e) => {
1552
+ const r = oe(n, t), s = lr(r, e), [i, o, a] = ve(n), { tenant: c, implementation: h, widget: l } = s;
1553
+ xt(c) ? t.setItem(i, JSON.stringify(c)) : t.removeItem(i), xt(h) ? t.setItem(o, JSON.stringify(h)) : t.removeItem(o), xt(l) ? t.setItem(a, JSON.stringify(l)) : t.removeItem(a);
1554
+ }, Ys = () => ({ tenant: {}, implementation: {}, widget: {} }), Zs = (n) => n ? !!n && /* @__PURE__ */ new Date() > new Date(n) : !1, ae = (n, t) => {
1555
+ const e = n.widget[t] || n.implementation[t] || n.tenant[t];
1556
+ return e == null ? void 0 : e.value;
1557
+ }, Ze = (n, t, e) => e ? {
1558
+ value: n,
1559
+ category: t,
1560
+ expiration: typeof e == "object" ? ye(e) : e
1561
+ } : {
1562
+ value: n,
1563
+ category: t
1564
+ }, Qt = (n, t) => {
1565
+ const e = ns(n);
1566
+ return Object.entries(e).forEach(([r, s]) => {
1567
+ Object.entries(s).forEach(([i, o]) => {
1568
+ const { expiration: a, category: c } = o;
1569
+ (Zs(a) || Qs(t, c)) && (s[i] = Ze(void 0, c, a));
1570
+ });
1571
+ }), e;
1572
+ }, xn = (n, t) => Y(n, "storagePolicy", S.Cookie).then(
1573
+ (e = [P.Necessary]) => !!t && e.indexOf(t) === -1
1574
+ ), Qs = (n = [P.Necessary], t) => !!t && n.indexOf(t) === -1, Qe = (n) => {
1575
+ const t = Ye(n), e = oe(n, window.localStorage), r = oe(n, sessionStorage), s = ae(t, "storagePolicy"), [i, o, a] = [
1576
+ t,
1577
+ e,
1578
+ r
1579
+ ].map((c) => Qt(c, s));
1580
+ ur(n, i), Ve(n, window.localStorage, o), Ve(n, window.sessionStorage, a);
1581
+ }, ye = (n = { days: 30 }) => {
1582
+ const { days: t = 0, hours: e = 0, minutes: r = 0, seconds: s = 0 } = n, i = /* @__PURE__ */ new Date();
1583
+ return i.setTime(i.getTime() + e * 60 * 60 * 1e3), i.setTime(i.getTime() + t * 24 * 60 * 60 * 1e3), i.setTime(i.getTime() + r * 60 * 1e3), i.setTime(i.getTime() + s * 1e3), i.toISOString();
1584
+ }, Xs = (n) => Q(document)(() => Ye(n)), ti = (n, t) => Q(document)(() => ur(n, t)), ei = (n, t) => {
1585
+ const e = t === S.Local ? window.localStorage : window.sessionStorage;
1586
+ return Q(e)(() => oe(n, e));
1587
+ }, ni = (n, t, e) => {
1588
+ const r = t === S.Local ? window.localStorage : window.sessionStorage;
1589
+ return Q(r)(() => Ve(n, r, e));
1590
+ };
1591
+ let Xt = class {
1592
+ constructor() {
1593
+ this.memory = {
1594
+ tenant: {},
1595
+ implementation: {},
1596
+ widget: {}
1597
+ };
1598
+ }
1599
+ setItem(t, e) {
1600
+ return qt(this, arguments, function* (r, s, i = {}) {
1601
+ return Q(this)(() => {
1602
+ const o = Qt(this.memory, [P.Necessary]), { scope: a = Ct.Tenant, expiration: c } = i;
1603
+ o[a][r] = Ze(
1604
+ s,
1605
+ P.Necessary,
1606
+ (c == null ? void 0 : c.toISOString()) || ye()
1607
+ ), this.memory = o, process.env.NODE_ENV !== "production" && I.warn(
1608
+ `StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value stored temporarily in memory.
1609
+ Key: ${r}
1610
+ Value: ${JSON.stringify(s)}
1611
+ Options: ${JSON.stringify(i)}
1612
+ Memory: ${JSON.stringify(o)}`
1613
+ );
1614
+ });
1615
+ });
1616
+ }
1617
+ getItem(t) {
1618
+ return qt(this, null, function* () {
1619
+ return Q(this)(() => {
1620
+ const e = Qt(this.memory, [P.Necessary]);
1621
+ process.env.NODE_ENV !== "production" && I.warn(
1622
+ `StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value fetched from legacy memory storage.
1623
+ Key: ${t}
1624
+ Memory: ${JSON.stringify(e)}`
1625
+ );
1626
+ const r = ae(e, t);
1627
+ return this.memory = e, r;
1628
+ });
1629
+ });
1630
+ }
1631
+ removeItem(t) {
1632
+ return qt(this, null, function* () {
1633
+ return Q(this)(() => {
1634
+ const e = Qt(this.memory, [P.Necessary]);
1635
+ delete e.tenant[t], delete e.implementation[t], delete e.widget[t], this.memory = e, process.env.NODE_ENV !== "production" && I.warn(
1636
+ `StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value removed from memory.
1637
+ Key: ${t}
1638
+ Memory: ${JSON.stringify(e)}`
1639
+ );
1640
+ });
1641
+ });
1642
+ }
1643
+ clear() {
1644
+ return qt(this, null, function* () {
1645
+ return Promise.resolve();
1646
+ });
1647
+ }
1648
+ }, ri = class {
1649
+ constructor() {
1650
+ this.cookies = new Xt(), this.session = new Xt(), this.local = new Xt();
1651
+ }
1652
+ };
1653
+ const Pe = (n, t, e, ...r) => {
1654
+ const s = `[${n.get("$environment").name || "webprovisions"}] ${e}`;
1655
+ switch (t) {
1656
+ case "info":
1657
+ console.info(s, ...r);
1658
+ break;
1659
+ case "warning":
1660
+ console.warn(s, ...r);
1661
+ break;
1662
+ case "error":
1663
+ console.error(s, ...r);
1664
+ break;
1665
+ }
1666
+ }, si = (n) => {
1667
+ const t = n.container || n;
1668
+ return {
1669
+ info: (e, ...r) => Pe(t, "info", e, ...r),
1670
+ warn: (e, ...r) => Pe(t, "warning", e, ...r),
1671
+ error: (e, ...r) => Pe(t, "error", e, ...r)
1672
+ };
1673
+ };
1674
+ var ce = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(ce || {}), ft = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(ft || {});
1675
+ const ii = (n, t, e, r) => {
1676
+ try {
1677
+ const s = new t(e, r);
1678
+ return {
1679
+ name: n,
1680
+ invoke: (i, o) => {
1681
+ let a;
1682
+ return s[i] && (a = s[i].call(s, o)), Promise.resolve(a);
1683
+ },
1684
+ getInstance: () => s
1685
+ };
1686
+ } catch (s) {
1687
+ if (s.message && s.message.indexOf("is not a constructor") >= 0)
1688
+ return {
1689
+ name: n,
1690
+ invoke: (i) => {
1691
+ let o;
1692
+ return i === "initialize" && (o = t(e, r)), Promise.resolve(o);
1693
+ },
1694
+ getInstance: () => t
1695
+ };
1696
+ throw s;
1697
+ }
1698
+ };
1699
+ function _n(n, t) {
1700
+ return typeof n == "undefined" ? t : n;
1701
+ }
1702
+ let oi = class {
1703
+ constructor(t = {}) {
1704
+ this.part = t;
1705
+ }
1706
+ createCommand(t, e, r) {
1707
+ let s;
1708
+ typeof e == "function" ? s = {
1709
+ scope: ce.Widget,
1710
+ stage: ft.Post,
1711
+ defaultArgs: void 0,
1712
+ handlerResolver: e
1713
+ } : s = {
1714
+ scope: _n(e.scope, ce.Widget),
1715
+ stage: _n(e.stage, ft.Post),
1716
+ defaultArgs: e.defaultArgs,
1717
+ handlerResolver: r
1718
+ };
1719
+ let i = this.part;
1720
+ const o = t.split(".");
1721
+ return o.forEach((a, c) => {
1722
+ c === o.length - 1 ? i[a] || (i[a] = () => s) : i = this.part[a] = this.part[a] || {};
1723
+ }), this;
1724
+ }
1725
+ get() {
1726
+ return this.part;
1727
+ }
1728
+ };
1729
+ const dr = (n) => {
1730
+ const t = new oi({});
1731
+ return n(t), t.get();
1732
+ };
1733
+ dr((n) => {
1734
+ n.createCommand(
1735
+ "types.register",
1736
+ { scope: ce.Implementation, stage: ft.Pre },
1737
+ (t) => (e, r) => {
1738
+ t.container.get("$types")[e] = r;
1739
+ }
1740
+ ).createCommand(
1741
+ "type",
1742
+ { stage: ft.Pre },
1743
+ (t) => (e) => {
1744
+ t.container.register("$type", e);
1745
+ }
1746
+ ).createCommand(
1747
+ "settings",
1748
+ { stage: ft.Pre, defaultArgs: [null] },
1749
+ (t) => (e) => {
1750
+ t.events.dispatch(
1751
+ "settings:change",
1752
+ e,
1753
+ { bubbles: !0 }
1754
+ ), t.container.register("$settings", e);
1755
+ }
1756
+ ).createCommand(
1757
+ "plugin",
1758
+ { stage: ft.Pre },
1759
+ (t) => (e, r, s) => {
1760
+ const { container: i } = t;
1761
+ let o = null, a = e, c = r;
1762
+ typeof e == "string" && (o = e, a = r, c = s);
1763
+ const h = (l) => {
1764
+ const { transformPluginSettings: u } = t.container.get("$environmentOptions"), d = u ? u(
1765
+ c || {},
1766
+ o,
1767
+ t.container,
1768
+ a
1769
+ ) : r;
1770
+ try {
1771
+ const p = ii(
1772
+ o,
1773
+ a,
1774
+ i,
1775
+ d
1776
+ );
1777
+ i.get("$plugins").push(p), l && p.invoke("initialize", null);
1778
+ } catch (p) {
1779
+ si(t).warn("Error when initializing plugin", p);
1780
+ }
1781
+ };
1782
+ t.container.get("$instance") ? h(!0) : t.events.subscribeOnce("widget:instance-created", () => h(!1));
1783
+ }
1784
+ ).createCommand(
1785
+ "container.register",
1786
+ (t) => (e, r) => {
1787
+ t.container.register(e, r);
1788
+ }
1789
+ ).createCommand(
1790
+ "container.registerAsync",
1791
+ (t) => (e, r) => {
1792
+ t.container.registerAsync(e, r);
1793
+ }
1794
+ ).createCommand(
1795
+ "container.registerFactory",
1796
+ (t) => (e, r) => {
1797
+ t.container.registerFactory(e, r);
1798
+ }
1799
+ ).createCommand(
1800
+ "container.touch",
1801
+ (t) => (e, r) => {
1802
+ t.container.touch(e, r);
1803
+ }
1804
+ ).createCommand(
1805
+ "csp",
1806
+ {},
1807
+ (t) => (e) => {
1808
+ t.container.register("csp", e);
1809
+ }
1810
+ );
1811
+ });
1812
+ dr((n) => {
1813
+ n.createCommand("storage", (t) => (e = {}) => {
1814
+ const { consent: r } = e;
1815
+ if (typeof r != "undefined") {
1816
+ if (typeof r != "number" && typeof r != "string" && !Array.isArray(r)) {
1817
+ process.env.NODE_ENV !== "production" && I.warn(
1818
+ `storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
1819
+ Passed consent: ${JSON.stringify(r)}`
1820
+ );
1821
+ return;
1822
+ }
1823
+ if (Array.isArray(r) && !r.every(
1824
+ (i) => typeof i == "number" || typeof i == "string"
1825
+ )) {
1826
+ process.env.NODE_ENV !== "production" && I.warn(
1827
+ `storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
1828
+ Passed consent: ${JSON.stringify(r)}`
1829
+ );
1830
+ return;
1831
+ }
1832
+ const s = [
1833
+ P.Necessary,
1834
+ P.Functional,
1835
+ P.Analytical,
1836
+ P.Marketing
1837
+ ].filter((i, o, a) => typeof r == "number" ? r > o : typeof r == "string" ? a.indexOf(r) + 1 > o : Array.isArray(r) ? r.findIndex((c) => c === o + 1 || c === i) > -1 : !0);
1838
+ return s.indexOf(P.Necessary) === -1 && (process.env.NODE_ENV !== "production" && I.warn(
1839
+ `storagePolicyConfigurationApi: passed consent does not include category: '${P.Necessary}'. Consent has to atleast include the '${P.Necessary}' category.
1840
+ Passed consent: ${JSON.stringify(r)}`
1841
+ ), s.unshift(P.Necessary)), et(
1842
+ t.container,
1843
+ "storagePolicy",
1844
+ P.Necessary,
1845
+ {
1846
+ medium: S.Cookie,
1847
+ scope: Ct.Tenant,
1848
+ duration: { days: 365 }
1849
+ }
1850
+ ).then((i) => i(s)).then(() => {
1851
+ Qe(t.container), t.events.dispatch("storage:policy-changed", s);
1852
+ });
1853
+ }
1854
+ });
1855
+ });
1856
+ const ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1857
+ __proto__: null,
1858
+ StorageCategory: P,
1859
+ StorageMedium: S,
1860
+ StorageProvider: ri,
1861
+ StorageScope: Ct,
1862
+ StorageService: Xt,
1863
+ createStorageWriter: et,
1864
+ readStorage: Y
1865
+ }, Symbol.toStringTag, { value: "Module" }));
1866
+ var ci = Object.defineProperty, hi = Object.defineProperties, li = Object.getOwnPropertyDescriptors, he = Object.getOwnPropertySymbols, pr = Object.prototype.hasOwnProperty, gr = Object.prototype.propertyIsEnumerable, Sn = (n, t, e) => t in n ? ci(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, Ot = (n, t) => {
1867
+ for (var e in t || (t = {}))
1868
+ pr.call(t, e) && Sn(n, e, t[e]);
1869
+ if (he)
1870
+ for (var e of he(t))
1871
+ gr.call(t, e) && Sn(n, e, t[e]);
1872
+ return n;
1873
+ }, fr = (n, t) => hi(n, li(t)), ui = (n, t) => {
1874
+ var e = {};
1875
+ for (var r in n)
1876
+ pr.call(n, r) && t.indexOf(r) < 0 && (e[r] = n[r]);
1877
+ if (n != null && he)
1878
+ for (var r of he(n))
1879
+ t.indexOf(r) < 0 && gr.call(n, r) && (e[r] = n[r]);
1880
+ return e;
1881
+ };
1882
+ function mr(n) {
1883
+ if (n.__esModule)
1884
+ return n;
1885
+ var t = n.default;
1886
+ if (typeof t == "function") {
1887
+ var e = function r() {
1888
+ if (this instanceof r) {
1889
+ var s = [null];
1890
+ s.push.apply(s, arguments);
1891
+ var i = Function.bind.apply(t, s);
1892
+ return new i();
1893
+ }
1894
+ return t.apply(this, arguments);
1895
+ };
1896
+ e.prototype = t.prototype;
1897
+ } else
1898
+ e = {};
1899
+ return Object.defineProperty(e, "__esModule", { value: !0 }), Object.keys(n).forEach(function(r) {
1900
+ var s = Object.getOwnPropertyDescriptor(n, r);
1901
+ Object.defineProperty(e, r, s.get ? s : {
1902
+ enumerable: !0,
1903
+ get: function() {
1904
+ return n[r];
1905
+ }
1906
+ });
1907
+ }), e;
1908
+ }
1909
+ var vr = function() {
1910
+ };
1911
+ process.env.NODE_ENV !== "production" && (vr = function(n, t, e) {
1912
+ var r = arguments.length;
1913
+ e = new Array(r > 2 ? r - 2 : 0);
1914
+ for (var s = 2; s < r; s++)
1915
+ e[s - 2] = arguments[s];
1916
+ if (t === void 0)
1917
+ throw new Error(
1918
+ "`warning(condition, format, ...args)` requires a warning message argument"
1919
+ );
1920
+ if (t.length < 10 || /^[s\W]*$/.test(t))
1921
+ throw new Error(
1922
+ "The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: " + t
1923
+ );
1924
+ if (!n) {
1925
+ var i = 0, o = "Warning: " + t.replace(/%s/g, function() {
1926
+ return e[i++];
1927
+ });
1928
+ typeof console != "undefined" && console.error(o);
1929
+ try {
1930
+ throw new Error(o);
1931
+ } catch (a) {
1932
+ }
1933
+ }
1934
+ });
1935
+ var di = vr, pi = di, Pn = gi(pi);
1936
+ function gi(n) {
1937
+ return n && n.__esModule ? n : { default: n };
1938
+ }
1939
+ var fi = function() {
1940
+ var n = null, t = function(o) {
1941
+ return (0, Pn.default)(n == null, "A history supports only one prompt at a time"), n = o, function() {
1942
+ n === o && (n = null);
1943
+ };
1944
+ }, e = function(o, a, c, h) {
1945
+ if (n != null) {
1946
+ var l = typeof n == "function" ? n(o, a) : n;
1947
+ typeof l == "string" ? typeof c == "function" ? c(l, h) : ((0, Pn.default)(!1, "A history needs a getUserConfirmation function in order to use a prompt message"), h(!0)) : h(l !== !1);
1948
+ } else
1949
+ h(!0);
1950
+ }, r = [], s = function(o) {
1951
+ var a = !0, c = function() {
1952
+ a && o.apply(void 0, arguments);
1953
+ };
1954
+ return r.push(c), function() {
1955
+ a = !1, r = r.filter(function(h) {
1956
+ return h !== c;
1957
+ });
1958
+ };
1959
+ }, i = function() {
1960
+ for (var o = arguments.length, a = Array(o), c = 0; c < o; c++)
1961
+ a[c] = arguments[c];
1962
+ r.forEach(function(h) {
1963
+ return h.apply(void 0, a);
1964
+ });
1965
+ };
1966
+ return {
1967
+ setPrompt: t,
1968
+ confirmTransitionTo: e,
1969
+ appendListener: s,
1970
+ notifyListeners: i
1971
+ };
1972
+ }, yr = fi, br;
1973
+ br = function(n, t) {
1974
+ return t(window.confirm(n));
1975
+ };
1976
+ function Jt(n) {
1977
+ return n.charAt(0) === "/";
1978
+ }
1979
+ function Ce(n, t) {
1980
+ for (var e = t, r = e + 1, s = n.length; r < s; e += 1, r += 1)
1981
+ n[e] = n[r];
1982
+ n.pop();
1983
+ }
1984
+ function mi(n) {
1985
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", e = n && n.split("/") || [], r = t && t.split("/") || [], s = n && Jt(n), i = t && Jt(t), o = s || i;
1986
+ if (n && Jt(n) ? r = e : e.length && (r.pop(), r = r.concat(e)), !r.length)
1987
+ return "/";
1988
+ var a = void 0;
1989
+ if (r.length) {
1990
+ var c = r[r.length - 1];
1991
+ a = c === "." || c === ".." || c === "";
1992
+ } else
1993
+ a = !1;
1994
+ for (var h = 0, l = r.length; l >= 0; l--) {
1995
+ var u = r[l];
1996
+ u === "." ? Ce(r, l) : u === ".." ? (Ce(r, l), h++) : h && (Ce(r, l), h--);
1997
+ }
1998
+ if (!o)
1999
+ for (; h--; h)
2000
+ r.unshift("..");
2001
+ o && r[0] !== "" && (!r[0] || !Jt(r[0])) && r.unshift("");
2002
+ var d = r.join("/");
2003
+ return a && d.substr(-1) !== "/" && (d += "/"), d;
2004
+ }
2005
+ const vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2006
+ __proto__: null,
2007
+ default: mi
2008
+ }, Symbol.toStringTag, { value: "Module" })), yi = /* @__PURE__ */ mr(vi);
2009
+ var Cn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
2010
+ return typeof n;
2011
+ } : function(n) {
2012
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
2013
+ };
2014
+ function te(n, t) {
2015
+ if (n === t)
2016
+ return !0;
2017
+ if (n == null || t == null)
2018
+ return !1;
2019
+ if (Array.isArray(n))
2020
+ return Array.isArray(t) && n.length === t.length && n.every(function(c, h) {
2021
+ return te(c, t[h]);
2022
+ });
2023
+ var e = typeof n == "undefined" ? "undefined" : Cn(n), r = typeof t == "undefined" ? "undefined" : Cn(t);
2024
+ if (e !== r)
2025
+ return !1;
2026
+ if (e === "object") {
2027
+ var s = n.valueOf(), i = t.valueOf();
2028
+ if (s !== n || i !== t)
2029
+ return te(s, i);
2030
+ var o = Object.keys(n), a = Object.keys(t);
2031
+ return o.length !== a.length ? !1 : o.every(function(c) {
2032
+ return te(n[c], t[c]);
2033
+ });
2034
+ }
2035
+ return !1;
2036
+ }
2037
+ const bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2038
+ __proto__: null,
2039
+ default: te
2040
+ }, Symbol.toStringTag, { value: "Module" })), wi = /* @__PURE__ */ mr(bi);
2041
+ var nt = {}, ot, wr, ze, Tt;
2042
+ nt.__esModule = !0;
2043
+ Tt = nt.addLeadingSlash = function(n) {
2044
+ return n.charAt(0) === "/" ? n : "/" + n;
2045
+ };
2046
+ ze = nt.stripLeadingSlash = function(n) {
2047
+ return n.charAt(0) === "/" ? n.substr(1) : n;
2048
+ };
2049
+ var $i = nt.hasBasename = function(n, t) {
2050
+ return new RegExp("^" + t + "(\\/|\\?|#|$)", "i").test(n);
2051
+ };
2052
+ nt.stripBasename = function(n, t) {
2053
+ return $i(n, t) ? n.substr(t.length) : n;
2054
+ };
2055
+ wr = nt.stripTrailingSlash = function(n) {
2056
+ return n.charAt(n.length - 1) === "/" ? n.slice(0, -1) : n;
2057
+ };
2058
+ nt.parsePath = function(n) {
2059
+ var t = n || "/", e = "", r = "", s = t.indexOf("#");
2060
+ s !== -1 && (r = t.substr(s), t = t.substr(0, s));
2061
+ var i = t.indexOf("?");
2062
+ return i !== -1 && (e = t.substr(i), t = t.substr(0, i)), {
2063
+ pathname: t,
2064
+ search: e === "?" ? "" : e,
2065
+ hash: r === "#" ? "" : r
2066
+ };
2067
+ };
2068
+ ot = nt.createPath = function(n) {
2069
+ var t = n.pathname, e = n.search, r = n.hash, s = t || "/";
2070
+ return e && e !== "?" && (s += e.charAt(0) === "?" ? e : "?" + e), r && r !== "#" && (s += r.charAt(0) === "#" ? r : "#" + r), s;
2071
+ };
2072
+ var be, $r = be = void 0, Ei = Object.assign || function(n) {
2073
+ for (var t = 1; t < arguments.length; t++) {
2074
+ var e = arguments[t];
2075
+ for (var r in e)
2076
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
2077
+ }
2078
+ return n;
2079
+ }, Oi = yi, Ai = Er(Oi), xi = wi, _i = Er(xi), Si = nt;
2080
+ function Er(n) {
2081
+ return n && n.__esModule ? n : { default: n };
2082
+ }
2083
+ be = function(n, t, e, r) {
2084
+ var s = void 0;
2085
+ typeof n == "string" ? (s = (0, Si.parsePath)(n), s.state = t) : (s = Ei({}, n), s.pathname === void 0 && (s.pathname = ""), s.search ? s.search.charAt(0) !== "?" && (s.search = "?" + s.search) : s.search = "", s.hash ? s.hash.charAt(0) !== "#" && (s.hash = "#" + s.hash) : s.hash = "", t !== void 0 && s.state === void 0 && (s.state = t));
2086
+ try {
2087
+ s.pathname = decodeURI(s.pathname);
2088
+ } catch (i) {
2089
+ throw i instanceof URIError ? new URIError('Pathname "' + s.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.') : i;
2090
+ }
2091
+ return e && (s.key = e), r ? s.pathname ? s.pathname.charAt(0) !== "/" && (s.pathname = (0, Ai.default)(s.pathname, r.pathname)) : s.pathname = r.pathname : s.pathname || (s.pathname = "/"), s;
2092
+ };
2093
+ $r = function(n, t) {
2094
+ return n.pathname === t.pathname && n.search === t.search && n.hash === t.hash && n.key === t.key && (0, _i.default)(n.state, t.state);
2095
+ };
2096
+ const Or = "/", Ar = "./", Pi = new RegExp(
2097
+ [
2098
+ // Match escaped characters that would otherwise appear in future matches.
2099
+ // This allows the user to escape special characters that won't transform.
2100
+ "(\\\\.)",
2101
+ // Match Express-style parameters and un-named parameters with a prefix
2102
+ // and optional suffixes. Matches appear as:
2103
+ //
2104
+ // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?"]
2105
+ // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined]
2106
+ "(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"
2107
+ ].join("|"),
2108
+ "g"
2109
+ ), xr = (n, t) => {
2110
+ const e = [];
2111
+ let r = 0, s = 0, i = "";
2112
+ const o = t && t.delimiter || Or, a = t && t.delimiters || Ar;
2113
+ let c = !1, h;
2114
+ for (; (h = Pi.exec(n)) !== null; ) {
2115
+ const l = h[0], u = h[1], d = h.index;
2116
+ if (i += n.slice(s, d), s = d + l.length, u) {
2117
+ i += u[1], c = !0;
2118
+ continue;
2119
+ }
2120
+ let p = "";
2121
+ const b = n[s], v = h[2], g = h[3], O = h[4], j = h[5];
2122
+ if (!c && i.length) {
2123
+ const N = i.length - 1;
2124
+ a.indexOf(i[N]) > -1 && (p = i[N], i = i.slice(0, N));
2125
+ }
2126
+ i && (e.push(i), i = "", c = !1);
2127
+ const W = p !== "" && b !== void 0 && b !== p, H = j === "+" || j === "*", k = j === "?" || j === "*", U = p || o, A = g || O;
2128
+ e.push({
2129
+ delimiter: U,
2130
+ optional: k,
2131
+ repeat: H,
2132
+ partial: W,
2133
+ name: v || r++,
2134
+ // tslint:disable-line:no-increment-decrement
2135
+ prefix: p,
2136
+ pattern: A ? Ni(A) : "[^" + Mt(U) + "]+?"
2137
+ });
2138
+ }
2139
+ return (i || s < n.length) && e.push(i + n.substr(s)), e;
2140
+ }, Ci = (n, t) => ki(xr(n, t)), ki = (n) => {
2141
+ const t = new Array(n.length);
2142
+ for (let e = 0; e < n.length; e++)
2143
+ typeof n[e] == "object" && (t[e] = new RegExp("^(?:" + n[e].pattern + ")$"));
2144
+ return function(e, r) {
2145
+ let s = "";
2146
+ const i = r && r.encode || encodeURIComponent;
2147
+ for (let o = 0; o < n.length; o++) {
2148
+ const a = n[o];
2149
+ if (typeof a == "string") {
2150
+ s += a;
2151
+ continue;
2152
+ }
2153
+ const c = e ? e[a.name] : void 0;
2154
+ let h;
2155
+ if (Array.isArray(c)) {
2156
+ if (!a.repeat)
2157
+ throw new TypeError(
2158
+ 'Expected "' + a.name + '" to not repeat, but got array'
2159
+ );
2160
+ if (c.length === 0) {
2161
+ if (a.optional)
2162
+ continue;
2163
+ throw new TypeError('Expected "' + a.name + '" to not be empty');
2164
+ }
2165
+ for (let l = 0; l < c.length; l++) {
2166
+ if (h = i(c[l], a), !t[o].test(h))
2167
+ throw new TypeError(
2168
+ 'Expected all "' + a.name + '" to match "' + a.pattern + '"'
2169
+ );
2170
+ s += (l === 0 ? a.prefix : a.delimiter) + h;
2171
+ }
2172
+ continue;
2173
+ }
2174
+ if (typeof c == "string" || typeof c == "number" || typeof c == "boolean") {
2175
+ if (h = i(String(c), a), !t[o].test(h))
2176
+ throw new TypeError(
2177
+ 'Expected "' + a.name + '" to match "' + a.pattern + '", but got "' + h + '"'
2178
+ );
2179
+ s += a.prefix + h;
2180
+ continue;
2181
+ }
2182
+ if (a.optional) {
2183
+ a.partial && (s += a.prefix);
2184
+ continue;
2185
+ }
2186
+ throw new TypeError(
2187
+ 'Expected "' + a.name + '" to be ' + (a.repeat ? "an array" : "a string")
2188
+ );
2189
+ }
2190
+ return s;
2191
+ };
2192
+ }, Mt = (n) => n.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"), Ni = (n) => n.replace(/([=!:$/()])/g, "\\$1"), _r = (n) => n && n.sensitive ? "" : "i", Mi = (n, t) => {
2193
+ if (!t)
2194
+ return n;
2195
+ const e = n.source.match(/\((?!\?)/g);
2196
+ if (e)
2197
+ for (let r = 0; r < e.length; r++)
2198
+ t.push({
2199
+ name: r,
2200
+ prefix: "",
2201
+ delimiter: "",
2202
+ optional: !1,
2203
+ repeat: !1,
2204
+ partial: !1,
2205
+ pattern: ""
2206
+ });
2207
+ return n;
2208
+ }, Li = (n, t, e) => {
2209
+ const r = [];
2210
+ for (let s = 0; s < n.length; s++)
2211
+ r.push(Sr(n[s], t, e).source);
2212
+ return new RegExp("(?:" + r.join("|") + ")", _r(e));
2213
+ }, Di = (n, t, e) => Ti(xr(n, e), t, e), Ti = (n, t, e) => {
2214
+ e = e || {};
2215
+ const r = e.strict, s = e.end !== !1, i = Mt(e.delimiter || Or), o = e.delimiters || Ar, a = [].concat(e.endsWith || []).map(Mt).concat("$").join("|");
2216
+ let c = "", h = !1;
2217
+ for (let l = 0; l < n.length; l++) {
2218
+ const u = n[l];
2219
+ if (typeof u == "string")
2220
+ c += Mt(u), h = l === n.length - 1 && o.indexOf(u[u.length - 1]) > -1;
2221
+ else {
2222
+ const d = Mt(u.prefix), p = u.repeat ? "(?:" + u.pattern + ")(?:" + d + "(?:" + u.pattern + "))*" : u.pattern;
2223
+ t && t.push(u), u.optional ? u.partial ? c += d + "(" + p + ")?" : c += "(?:" + d + "(" + p + "))?" : c += d + "(" + p + ")";
2224
+ }
2225
+ }
2226
+ return s ? (r || (c += "(?:" + i + ")?"), c += a === "$" ? "$" : "(?=" + a + ")") : (r || (c += "(?:" + i + "(?=" + a + "))?"), h || (c += "(?=" + i + "|" + a + ")")), new RegExp("^" + c, _r(e));
2227
+ }, Sr = (n, t, e) => n instanceof RegExp ? Mi(n, t || []) : Array.isArray(n) ? Li(n, t, e) : Di(n, t, e), le = Sr;
2228
+ var G = /* @__PURE__ */ ((n) => (n.scopedHash = "scopedHash", n.hash = "hash", n.browser = "browser", n.memory = "memory", n))(G || {}), dt = /* @__PURE__ */ ((n) => (n.storage = "storage", n.path = "path", n.initialPath = "initial", n))(dt || {});
2229
+ const Lt = (n, t) => {
2230
+ const e = [], r = le(t, e).exec(n);
2231
+ if (!r)
2232
+ return {};
2233
+ const [s, ...i] = r;
2234
+ return e.reduce((o, a, c) => (o[a.name] = i[c], o), {});
2235
+ }, ji = (n) => Object.keys(n).reduce((t, e) => {
2236
+ const r = typeof n[e] == "string" ? n[e].replace("&", "%20") : n[e];
2237
+ let s = `${e}=${r}`;
2238
+ return t.length > 1 && (s = "&".concat(s)), t.concat(s);
2239
+ }, "?"), ke = (n, t) => {
2240
+ const e = t.find((r) => r.name === n);
2241
+ if (!e) {
2242
+ process.env.NODE_ENV !== "production" && I.warn(`Unable to find route with specified name: ${n}`);
2243
+ return;
2244
+ }
2245
+ return e;
2246
+ }, Pr = (n) => n.length ? n.slice(1).split("&").map((t) => t.split("=")).reduce((t, e) => {
2247
+ const [r, s] = e.map(encodeURI).map(decodeURIComponent);
2248
+ return fr(Ot({}, t), { [r]: decodeURIComponent(s).replace("%20", "&") });
2249
+ }, {}) : {}, Ri = (n, t) => {
2250
+ const e = t.map((r) => ee(n, r)).reduce(
2251
+ (r, s) => {
2252
+ if (s === null)
2253
+ return r;
2254
+ const i = s.split("?")[1];
2255
+ let o = 0;
2256
+ if (i) {
2257
+ const a = Pr(`?${i}`);
2258
+ o = Object.keys(a).length;
2259
+ }
2260
+ return !r.path || r.count && o < r.count ? {
2261
+ count: o,
2262
+ path: s
2263
+ } : r;
2264
+ },
2265
+ { count: void 0, path: void 0 }
2266
+ );
2267
+ return e ? e.path : t[0];
2268
+ }, ee = (n, t) => {
2269
+ const e = yt(n);
2270
+ if (Array.isArray(t)) {
2271
+ const c = Ri(e, t);
2272
+ if (!c)
2273
+ throw new Error("Unable to match path.");
2274
+ return c;
2275
+ }
2276
+ const r = Ci(t);
2277
+ let s = t;
2278
+ try {
2279
+ s = r(e);
2280
+ } catch (c) {
2281
+ return null;
2282
+ }
2283
+ const i = [];
2284
+ le(t, i);
2285
+ const o = Object.keys(e).reduce((c, h) => (i.find((l) => l.name === h) || c.push(h), c), []), a = {};
2286
+ return o.forEach((c) => a[c] = e[c]), Object.keys(a).forEach((c) => a[c] === null && delete a[c]), Object.keys(a).length > 0 ? `${s}${ji(a)}` : s;
2287
+ }, Et = (n, t) => {
2288
+ let e = n;
2289
+ return e.indexOf("?") > -1 && (e = e.substring(0, e.indexOf("?"))), e.indexOf(";") > -1 && (e = e.substring(0, e.indexOf(";"))), e === "" && (e = "/"), t.reduce((r, s) => {
2290
+ if (Array.isArray(s.path))
2291
+ return s.path.reduce((o, a) => le(a, []).exec(e || "") && !o ? e : o, void 0) && !r ? s : r;
2292
+ if (!s.path)
2293
+ return r;
2294
+ const i = [];
2295
+ return le(s.path, i).exec(e || "") && !r ? s : r;
2296
+ }, void 0);
2297
+ }, Ii = (n) => {
2298
+ let t = n.get("historyTransitionManager");
2299
+ return t || (t = yr(), n.parent && n.parent.register("historyTransitionManager", t)), t;
2300
+ }, Dt = (n, t = null) => n ? be(t ? t(n) : n) : {
2301
+ pathname: "",
2302
+ search: "",
2303
+ hash: ""
2304
+ }, Hi = (n, t) => {
2305
+ if (yt(n), yt(t), Object.keys(n).length !== Object.keys(t).length)
2306
+ return !1;
2307
+ if (Object.keys(n).length === 0 && Object.keys(t).length === 0)
2308
+ return !0;
2309
+ let e = !0;
2310
+ return Object.keys(t).forEach((r) => {
2311
+ t[r] !== n[r] && (e = !1);
2312
+ }), e;
2313
+ }, Ui = (n) => {
2314
+ if (typeof n.mode == "string") {
2315
+ if (n.mode === G.memory)
2316
+ return !0;
2317
+ } else if (n.mode[1]) {
2318
+ const [t, { sticky: e }] = n.mode;
2319
+ if (t === G.memory)
2320
+ return typeof e == "undefined" ? !0 : e;
2321
+ }
2322
+ return !1;
2323
+ }, Ne = (n) => {
2324
+ const { views: t } = n.get("$settings"), e = Object.keys(t).reduce((r, s) => typeof t[s].path == "undefined" ? s : r, void 0);
2325
+ return e ? {
2326
+ name: e,
2327
+ params: {}
2328
+ } : null;
2329
+ }, kn = "hashchange", Bi = {
2330
+ hashbang: {
2331
+ encodePath: (n) => n.charAt(0) === "!" ? n : "!/" + ze(n),
2332
+ decodePath: (n) => n.charAt(0) === "!" ? n.substr(1) : n
2333
+ },
2334
+ noslash: {
2335
+ encodePath: ze,
2336
+ decodePath: Tt
2337
+ },
2338
+ slash: {
2339
+ encodePath: Tt,
2340
+ decodePath: Tt
2341
+ }
2342
+ }, at = () => {
2343
+ const n = window.location.href, t = n.indexOf("#");
2344
+ return t === -1 ? "" : n.substring(t + 1);
2345
+ }, Nn = (n) => window.location.hash = n, Mn = (n) => {
2346
+ const t = window.location.href.indexOf("#");
2347
+ window.location.replace(
2348
+ window.location.href.slice(0, t >= 0 ? t : 0) + "#" + n
2349
+ );
2350
+ }, ne = (n = "") => {
2351
+ const t = n.replace(";", "?"), e = [
2352
+ { from: /\;+/gi, to: "&" },
2353
+ { from: /:+/gi, to: "=" }
2354
+ ];
2355
+ let r = t;
2356
+ return e.forEach(({ to: s, from: i }) => {
2357
+ r = r.replace(i, s);
2358
+ }), r;
2359
+ }, Vi = (n = {}) => {
2360
+ const t = window.history, { getUserConfirmation: e = br, hashType: r = "slash" } = n, s = n.basename ? wr(Tt(n.basename)) : "", { encodePath: i } = Bi[r], o = () => {
2361
+ const f = at(), w = l(f);
2362
+ return Dt(w, ne);
2363
+ }, a = n.transitionManager || yr(), c = (f) => {
2364
+ Object.assign(R, f), R.length = t.length, a.notifyListeners(R.location, R.action, n.widgetName);
2365
+ };
2366
+ let h = !1;
2367
+ const l = (f) => {
2368
+ const w = ($) => {
2369
+ function _(x, m) {
2370
+ const E = {};
2371
+ let M;
2372
+ for (; M = m.exec(x); )
2373
+ E[M[1]] = M[2];
2374
+ return E;
2375
+ }
2376
+ return _($, /([^#?&=]+)=([^&#]*)(?!.*?\#)/gi) || null;
2377
+ }, y = "humany-" + n.widgetName;
2378
+ return w(f)[y];
2379
+ }, u = () => {
2380
+ const f = o(), w = R.location;
2381
+ !h && $r(w, f) || d(f);
2382
+ }, d = (f) => {
2383
+ if (h)
2384
+ h = !1, c();
2385
+ else {
2386
+ const w = "POP";
2387
+ a.confirmTransitionTo(
2388
+ f,
2389
+ w,
2390
+ e,
2391
+ (y) => {
2392
+ y ? c({ action: w, location: f }) : p(f);
2393
+ }
2394
+ );
2395
+ }
2396
+ }, p = (f) => {
2397
+ const w = R.location;
2398
+ let y = g.lastIndexOf(ot(w));
2399
+ y === -1 && (y = 0);
2400
+ let $ = g.lastIndexOf(ot(f));
2401
+ $ === -1 && ($ = 0);
2402
+ const _ = y - $;
2403
+ _ && (h = !0, A(_));
2404
+ }, b = at(), v = i(b);
2405
+ b !== v && Mn(v);
2406
+ let g = [];
2407
+ const O = o();
2408
+ O.pathname !== null && g.push(ot(O));
2409
+ const j = (f = "") => {
2410
+ const w = [
2411
+ { from: /\?+/gi, to: ";" },
2412
+ { from: /\&amp;+/gi, to: ";" },
2413
+ { from: /\&+/gi, to: ";" },
2414
+ { from: /=+/gi, to: ":" }
2415
+ ];
2416
+ let y = f;
2417
+ return w.forEach(({ to: $, from: _ }) => {
2418
+ y = y.replace(_, $);
2419
+ }), y;
2420
+ }, W = (f, w, y) => {
2421
+ let $ = "", _ = !1;
2422
+ return f.split("&").forEach((x) => {
2423
+ const m = x.split("="), E = m[0], M = m[1];
2424
+ if (E === w) {
2425
+ if (_ = !0, y === null)
2426
+ return;
2427
+ $.length > 0 && ($ += "&"), typeof y != "undefined" ? $ += E + "=" + y : $ += E;
2428
+ } else
2429
+ E && ($.length > 0 && ($ += "&"), $ += E + "=" + M);
2430
+ }), !_ && y !== null && ($.length > 0 && ($ += "&"), typeof y != "undefined" ? $ += w + "=" + y : $ += w), $;
2431
+ }, H = (f) => {
2432
+ const w = f.pathname, y = j(f.search), $ = w + (y ? `;${y}` : ""), _ = `humany-${n.widgetName}`, x = at();
2433
+ return `#${W(x, _, $).replace(";;", ";")}`;
2434
+ }, k = (f, w) => {
2435
+ const y = "PUSH", $ = Dt(f, ne), _ = $.pathname, x = j($.search), m = _ + (x ? `${x}` : ""), E = `humany-${n.widgetName}`, M = at(), L = W(M, E, m);
2436
+ a.confirmTransitionTo($, y, e, (J) => {
2437
+ if (!J)
2438
+ return;
2439
+ const K = ot($), rt = i(L);
2440
+ if (at() !== rt) {
2441
+ Nn(rt);
2442
+ const Z = g.lastIndexOf(ot(R.location)), F = g.slice(0, Z === -1 ? 0 : Z + 1);
2443
+ F.push(K), g = F, c({ action: y, location: $ });
2444
+ } else
2445
+ c();
2446
+ });
2447
+ }, U = (f, w) => {
2448
+ const y = "REPLACE", $ = Dt(f, ne);
2449
+ a.confirmTransitionTo($, y, e, (_) => {
2450
+ if (!_)
2451
+ return;
2452
+ const x = ot($), m = i(s + x);
2453
+ at() !== m && Mn(m);
2454
+ const E = g.indexOf(ot(R.location));
2455
+ E !== -1 && (g[E] = x), c({ action: y, location: $ });
2456
+ });
2457
+ }, A = (f) => {
2458
+ t.go(f);
2459
+ }, N = () => A(-1), C = () => A(1);
2460
+ let D = 0;
2461
+ const V = (f) => {
2462
+ D += f, D === 1 ? window.addEventListener(kn, u) : D === 0 && window.removeEventListener(kn, u);
2463
+ };
2464
+ let B = !1;
2465
+ const R = {
2466
+ createHref: H,
2467
+ createLocation: Dt,
2468
+ push: k,
2469
+ replace: U,
2470
+ go: A,
2471
+ goBack: N,
2472
+ goForward: C,
2473
+ block: (f = !1) => {
2474
+ const w = a.setPrompt(f);
2475
+ return B || (V(1), B = !0), () => (B && (B = !1, V(-1)), w());
2476
+ },
2477
+ listen: (f) => {
2478
+ const w = a.appendListener(f);
2479
+ return V(1), () => {
2480
+ V(-1), w();
2481
+ };
2482
+ },
2483
+ stop: () => {
2484
+ const f = at(), w = W(f, `humany-${n.widgetName}`, null), y = i(w);
2485
+ Nn(y);
2486
+ },
2487
+ length: t.length,
2488
+ action: "POP",
2489
+ location: O
2490
+ };
2491
+ return R;
2492
+ }, Cr = Vi, zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2493
+ __proto__: null,
2494
+ decodeSearch: ne,
2495
+ default: Cr,
2496
+ getHashPath: at
2497
+ }, Symbol.toStringTag, { value: "Module" })), Wi = (n, t) => {
2498
+ const e = (s) => {
2499
+ function i(o, a) {
2500
+ const c = {};
2501
+ let h;
2502
+ for (; h = a.exec(o); )
2503
+ c[h[1]] = h[2];
2504
+ return c;
2505
+ }
2506
+ return i(s, /([^#?&=]+)=([^&#]*)(?!.*?\#)/gi) || null;
2507
+ }, r = `humany-${t}`;
2508
+ return e(n)[r];
2509
+ }, Fi = () => {
2510
+ const n = window.location.href, t = n.indexOf("#");
2511
+ return t === -1 ? "" : n.substring(t + 1);
2512
+ }, qi = (n = "") => {
2513
+ const t = n.replace(";", "?"), e = [
2514
+ { from: /\;+/gi, to: "&" },
2515
+ { from: /:+/gi, to: "=" }
2516
+ ];
2517
+ let r = t;
2518
+ return e.forEach(({ to: s, from: i }) => {
2519
+ r = r.replace(i, s);
2520
+ }), r;
2521
+ }, Ji = (n, t = null) => n ? be(t ? t(n) : n) : {
2522
+ pathname: "",
2523
+ search: "",
2524
+ hash: ""
2525
+ }, kr = (n) => {
2526
+ const t = Fi(), e = Wi(t, n);
2527
+ return Ji(e, qi);
2528
+ }, Xe = (n) => {
2529
+ const { name: t } = n.get("$widget");
2530
+ return !!kr(t).pathname;
2531
+ };
2532
+ Je((n) => {
2533
+ n.createCommand("routing", (t) => (e) => {
2534
+ const r = {
2535
+ mode: e.mode
2536
+ };
2537
+ e.basePath && (r.basePath = e.basePath), t.container.register("routingSettings", r);
2538
+ });
2539
+ });
2540
+ const Ln = "routeData";
2541
+ class Ki {
2542
+ constructor(t, e) {
2543
+ this.container = t, this.steps = [], this.historyListenSubscription = () => {
2544
+ }, this.sticky = !1, this.storageWriter = null, this.widget = t.get("$widget");
2545
+ const r = e, { routes: s } = r, i = ui(r, ["routes"]);
2546
+ this.settings = Ot(Ot({}, i), t.get("routingSettings")), this.sticky = Ui(this.settings), this.storageMedium = this.sticky ? S.Local : S.Session, et(t, Ln, P.Necessary, {
2547
+ medium: this.storageMedium
2548
+ }).then((o) => this.storageWriter = o), this.routes = s;
2549
+ }
2550
+ initialize() {
2551
+ return this.initialized = this.initialized || this.createHistory().then((t) => {
2552
+ this.history = t, this.location = t.location, this.historyListenSubscription = t.listen(
2553
+ (e, r, s) => this.handleLocationChange(e, s)
2554
+ );
2555
+ });
2556
+ }
2557
+ setMatch(t) {
2558
+ if (this.match = t, this.location) {
2559
+ const e = this.getRouteData(), r = {
2560
+ routeData: e,
2561
+ location: this.location
2562
+ }, s = this.steps[0], i = e.name === (s == null ? void 0 : s.routeData.name), o = dn(
2563
+ e.params,
2564
+ (s == null ? void 0 : s.routeData.params) || {}
2565
+ );
2566
+ (!i || !o) && (this.widget.events.dispatch("router:change", { next: r, previous: s }), this.steps.unshift(r), this.storageWriter && this.storageWriter(r.routeData), this.widget.events.dispatch("router:changed", { previous: s, current: r }));
2567
+ }
2568
+ }
2569
+ onRouteChange(t) {
2570
+ return this.widget.events.subscribe("router:change", t);
2571
+ }
2572
+ isSticky() {
2573
+ return this.sticky;
2574
+ }
2575
+ /**
2576
+ * Generate a formatted path from string
2577
+ * @param routeName Name of route to generate path for
2578
+ * @param params Optional: route params
2579
+ */
2580
+ generate(t, e = {}) {
2581
+ const r = ke(t, this.routes);
2582
+ if (!r || !this.history)
2583
+ throw `No route found for ${t}`;
2584
+ const s = ee(e, r.path);
2585
+ if (!s)
2586
+ throw `Unable to generate path for "${t}".`;
2587
+ const i = Dt(s, this.settings.decodeSearch);
2588
+ let o = this.history.createHref(i);
2589
+ const { mode: a, basePath: c } = this.settings;
2590
+ return a === "browser" && c && (o = o.replace(c, "")), o.charAt(0) !== "/" && (o = `/${o}`), o;
2591
+ }
2592
+ /**
2593
+ * Navigate to path
2594
+ * @param routeName Route to navigate to
2595
+ * @param params Optional: route params
2596
+ */
2597
+ navigate(t, e = {}) {
2598
+ const r = ke(t, this.routes);
2599
+ if (!r || !this.history)
2600
+ return;
2601
+ const s = ee(e, r.path);
2602
+ if (!s)
2603
+ return;
2604
+ const i = this.getRouteData(), o = i && i.name === t && Hi(i.params, e);
2605
+ if (this.steps[0] && o)
2606
+ return;
2607
+ const { decodeSearch: a } = this.settings, c = a ? a(s) : s;
2608
+ this.widget.events.dispatch("router:navigate", {
2609
+ decodedPath: c
2610
+ }), c.charAt(0) !== "/" ? this.history.push(`/${c}`) : this.history.push(c);
2611
+ }
2612
+ /**
2613
+ * Return true or false depending
2614
+ * on whether it is possible to navigate backwards
2615
+ */
2616
+ hasBack() {
2617
+ if (this.steps.length > 1)
2618
+ return !0;
2619
+ const t = this.getRouteData(this.settings.initialPath), e = this.getRouteData(), r = e.name === t.name, s = dn(e.params, t.params);
2620
+ return !r || !s;
2621
+ }
2622
+ /**
2623
+ * Navigate to previous route
2624
+ */
2625
+ goBack(t = 1) {
2626
+ if (this.steps.length < 2) {
2627
+ const e = this.getRouteData(this.settings.initialPath);
2628
+ e && e.name && (this.navigate(e.name, e.params), this.steps = []);
2629
+ } else {
2630
+ const e = t >= this.steps.length ? this.steps.length - 1 : t, { routeData: r } = this.steps[e];
2631
+ this.steps = [...this.steps.slice(e + 1)], this.navigate(r.name, es(r.params));
2632
+ }
2633
+ }
2634
+ /**
2635
+ * Navigate to next route
2636
+ */
2637
+ goForward() {
2638
+ this.history && this.history.goForward();
2639
+ }
2640
+ /**
2641
+ * Get the current location
2642
+ */
2643
+ current() {
2644
+ return this.location;
2645
+ }
2646
+ /**
2647
+ * Get the initial route. If the defined initial route does not exist,
2648
+ * return the first defined route
2649
+ */
2650
+ getInitialRoute() {
2651
+ const { name: t } = this.getRouteData(this.settings.initialPath);
2652
+ return this.routes.find((r) => r.name === t) || (this.routes.length > 0 ? this.routes[0] : (process.env.NODE_ENV !== "production" && I.warn("Unable to get initial route as no routes are defined."), null));
2653
+ }
2654
+ getRouteData(t) {
2655
+ const e = Ne(this.container);
2656
+ if (t) {
2657
+ const r = Et(t, this.routes);
2658
+ return r ? {
2659
+ params: yt(Lt(t, r.path)),
2660
+ name: r.name
2661
+ } : e || {
2662
+ name: "",
2663
+ params: {}
2664
+ };
2665
+ }
2666
+ if (this.location) {
2667
+ const { pathname: r, search: s } = this.location;
2668
+ if (this.currentRoute = this.currentRoute || Et(r, this.routes), this.currentRoute) {
2669
+ const { path: i, name: o } = this.currentRoute;
2670
+ this.match || (this.match = {
2671
+ params: Lt(r, i),
2672
+ isExact: !0,
2673
+ path: i,
2674
+ url: r
2675
+ });
2676
+ const a = yt(Ot(Ot({}, this.match.params), s.length > 0 && Pr(s)));
2677
+ return {
2678
+ name: o,
2679
+ params: a
2680
+ };
2681
+ }
2682
+ }
2683
+ return e || {
2684
+ name: "",
2685
+ params: {}
2686
+ };
2687
+ }
2688
+ dispose() {
2689
+ return this.historyListenSubscription(), this.stop();
2690
+ }
2691
+ /**
2692
+ * Setup and load the initial route based on router configuration
2693
+ */
2694
+ setupInitialRoute() {
2695
+ return Y(this.container, Ln, this.storageMedium).then(
2696
+ (t) => {
2697
+ if (!this.location || !this.history)
2698
+ return;
2699
+ const { initialPath: e, mode: r } = this.settings;
2700
+ switch ((() => {
2701
+ const s = Xe(this.container);
2702
+ return r === G.browser || s ? dt.path : r === G.memory && t ? dt.storage : dt.initialPath;
2703
+ })()) {
2704
+ case dt.initialPath: {
2705
+ const s = this.getRouteData(e);
2706
+ return s && s.name ? this.navigate(s.name, s.params) : void 0;
2707
+ }
2708
+ case dt.path: {
2709
+ const { pathname: s } = this.location;
2710
+ if (this.currentRoute = Et(s, this.routes), this.currentRoute) {
2711
+ const { path: o } = this.currentRoute;
2712
+ return this.setMatch({
2713
+ params: Lt(s, o),
2714
+ isExact: !0,
2715
+ path: o,
2716
+ url: s
2717
+ });
2718
+ }
2719
+ const i = Ne(this.container);
2720
+ return i ? this.setMatch({
2721
+ params: {},
2722
+ isExact: !0,
2723
+ path: i.name,
2724
+ url: s
2725
+ }) : void 0;
2726
+ }
2727
+ case dt.storage: {
2728
+ const { pathname: s } = this.location;
2729
+ this.currentRoute = Et(s, this.routes);
2730
+ const { name: i = "", params: o = {} } = t || {}, a = ke(i, this.routes);
2731
+ if (a) {
2732
+ const c = ee(o, a.path);
2733
+ if (c)
2734
+ return this.history.push(c), this.location = fr(Ot({}, this.location), { pathname: c }), this.currentRoute = Et(c, this.routes), this.setMatch({
2735
+ params: o,
2736
+ isExact: !0,
2737
+ path: a.path,
2738
+ url: c
2739
+ });
2740
+ }
2741
+ return;
2742
+ }
2743
+ }
2744
+ }
2745
+ );
2746
+ }
2747
+ start() {
2748
+ return this.setupInitialRoute();
2749
+ }
2750
+ stop() {
2751
+ return this.history && (this.settings.mode === G.scopedHash && this.history.stop(), this.steps = [], this.storageWriter) ? this.storageWriter() : Promise.resolve();
2752
+ }
2753
+ handleLocationChange(t, e) {
2754
+ const { pathname: r } = t, { mode: s } = this.settings;
2755
+ if (r.indexOf("?") > -1 || r.indexOf(";") > -1 || s === G.scopedHash && e !== this.widget.name)
2756
+ return;
2757
+ this.location = t, this.currentRoute = Et(r, this.routes);
2758
+ const i = Ne(this.container);
2759
+ if (this.currentRoute) {
2760
+ const { path: o } = this.currentRoute;
2761
+ this.setMatch({
2762
+ params: Lt(r, o),
2763
+ isExact: !0,
2764
+ path: o,
2765
+ url: r
2766
+ });
2767
+ } else
2768
+ i && this.setMatch({
2769
+ params: {},
2770
+ isExact: !0,
2771
+ path: i.name,
2772
+ url: r
2773
+ });
2774
+ }
2775
+ createHistory() {
2776
+ return new Promise((t) => {
2777
+ const { mode: e, basePath: r } = this.settings;
2778
+ if (e === G.scopedHash) {
2779
+ const s = this.widget.name, i = Ii(this.container);
2780
+ return Promise.resolve().then(() => zi).then((o) => {
2781
+ const a = o.default({
2782
+ widgetName: s,
2783
+ transitionManager: i,
2784
+ hashType: "noslash"
2785
+ });
2786
+ return t(a);
2787
+ });
2788
+ }
2789
+ if (e === G.memory)
2790
+ return t(Fs());
2791
+ if (e === G.browser)
2792
+ return t(zs({ basename: r }));
2793
+ throw "RoutingService: History could not be created.";
2794
+ });
2795
+ }
2796
+ }
2797
+ const Gi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2798
+ __proto__: null,
2799
+ HistoryMode: G,
2800
+ RoutingService: Ki,
2801
+ createHashHistory: Cr,
2802
+ getScopedHashDOMLocation: kr,
2803
+ matchParams: Lt,
2804
+ onWidgetUrl: Xe
2805
+ }, Symbol.toStringTag, { value: "Module" })), Me = (n, t, e, ...r) => {
2806
+ const s = `[${n.get("$environment").name || "webprovisions"}] ${e}`;
2807
+ switch (t) {
2808
+ case "info":
2809
+ console.info(s, ...r);
2810
+ break;
2811
+ case "warning":
2812
+ console.warn(s, ...r);
2813
+ break;
2814
+ case "error":
2815
+ console.error(s, ...r);
2816
+ break;
2817
+ }
2818
+ }, Yi = (n) => {
2819
+ const t = n.container || n;
2820
+ return {
2821
+ info: (e, ...r) => Me(t, "info", e, ...r),
2822
+ warn: (e, ...r) => Me(t, "warning", e, ...r),
2823
+ error: (e, ...r) => Me(t, "error", e, ...r)
2824
+ };
2825
+ };
2826
+ var Rt = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(Rt || {}), ht = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(ht || {});
2827
+ const Zi = (n, t, e, r) => {
2828
+ try {
2829
+ const s = new t(e, r);
2830
+ return {
2831
+ name: n,
2832
+ invoke: (i, o) => {
2833
+ let a;
2834
+ return s[i] && (a = s[i].call(s, o)), Promise.resolve(a);
2835
+ },
2836
+ getInstance: () => s
2837
+ };
2838
+ } catch (s) {
2839
+ if (s.message && s.message.indexOf("is not a constructor") >= 0)
2840
+ return {
2841
+ name: n,
2842
+ invoke: (i) => {
2843
+ let o;
2844
+ return i === "initialize" && (o = t(e, r)), Promise.resolve(o);
2845
+ },
2846
+ getInstance: () => t
2847
+ };
2848
+ throw s;
2849
+ }
2850
+ };
2851
+ function Dn(n, t) {
2852
+ return typeof n == "undefined" ? t : n;
2853
+ }
2854
+ class Qi {
2855
+ constructor(t = {}) {
2856
+ this.part = t;
2857
+ }
2858
+ createCommand(t, e, r) {
2859
+ let s;
2860
+ typeof e == "function" ? s = {
2861
+ scope: Rt.Widget,
2862
+ stage: ht.Post,
2863
+ defaultArgs: void 0,
2864
+ handlerResolver: e
2865
+ } : s = {
2866
+ scope: Dn(e.scope, Rt.Widget),
2867
+ stage: Dn(e.stage, ht.Post),
2868
+ defaultArgs: e.defaultArgs,
2869
+ handlerResolver: r
2870
+ };
2871
+ let i = this.part;
2872
+ const o = t.split(".");
2873
+ return o.forEach((a, c) => {
2874
+ c === o.length - 1 ? i[a] || (i[a] = () => s) : i = this.part[a] = this.part[a] || {};
2875
+ }), this;
2876
+ }
2877
+ get() {
2878
+ return this.part;
2879
+ }
2880
+ }
2881
+ const Nr = (n) => {
2882
+ const t = new Qi({});
2883
+ return n(t), t.get();
2884
+ };
2885
+ Nr((n) => {
2886
+ n.createCommand(
2887
+ "types.register",
2888
+ { scope: Rt.Implementation, stage: ht.Pre },
2889
+ (t) => (e, r) => {
2890
+ t.container.get("$types")[e] = r;
2891
+ }
2892
+ ).createCommand(
2893
+ "type",
2894
+ { stage: ht.Pre },
2895
+ (t) => (e) => {
2896
+ t.container.register("$type", e);
2897
+ }
2898
+ ).createCommand(
2899
+ "settings",
2900
+ { stage: ht.Pre, defaultArgs: [null] },
2901
+ (t) => (e) => {
2902
+ t.events.dispatch(
2903
+ "settings:change",
2904
+ e,
2905
+ { bubbles: !0 }
2906
+ ), t.container.register("$settings", e);
2907
+ }
2908
+ ).createCommand(
2909
+ "plugin",
2910
+ { stage: ht.Pre },
2911
+ (t) => (e, r, s) => {
2912
+ const { container: i } = t;
2913
+ let o = null, a = e, c = r;
2914
+ typeof e == "string" && (o = e, a = r, c = s);
2915
+ const h = (l) => {
2916
+ const { transformPluginSettings: u } = t.container.get("$environmentOptions"), d = u ? u(
2917
+ c || {},
2918
+ o,
2919
+ t.container,
2920
+ a
2921
+ ) : r;
2922
+ try {
2923
+ const p = Zi(
2924
+ o,
2925
+ a,
2926
+ i,
2927
+ d
2928
+ );
2929
+ i.get("$plugins").push(p), l && p.invoke("initialize", null);
2930
+ } catch (p) {
2931
+ Yi(t).warn("Error when initializing plugin", p);
2932
+ }
2933
+ };
2934
+ t.container.get("$instance") ? h(!0) : t.events.subscribeOnce("widget:instance-created", () => h(!1));
2935
+ }
2936
+ ).createCommand(
2937
+ "container.register",
2938
+ (t) => (e, r) => {
2939
+ t.container.register(e, r);
2940
+ }
2941
+ ).createCommand(
2942
+ "container.registerAsync",
2943
+ (t) => (e, r) => {
2944
+ t.container.registerAsync(e, r);
2945
+ }
2946
+ ).createCommand(
2947
+ "container.registerFactory",
2948
+ (t) => (e, r) => {
2949
+ t.container.registerFactory(e, r);
2950
+ }
2951
+ ).createCommand(
2952
+ "container.touch",
2953
+ (t) => (e, r) => {
2954
+ t.container.touch(e, r);
2955
+ }
2956
+ ).createCommand(
2957
+ "csp",
2958
+ {},
2959
+ (t) => (e) => {
2960
+ t.container.register("csp", e);
2961
+ }
2962
+ );
2963
+ });
2964
+ function Xi(n) {
2965
+ const t = {};
2966
+ return [].filter.call(n.attributes, (e) => /^data-/.test(e.name)).map((e) => e.name).forEach((e) => t[e.substr(5)] = n.getAttribute(e)), t;
2967
+ }
2968
+ const Tn = (n, t, e) => {
2969
+ const r = Xi(n);
2970
+ e({
2971
+ sourceDOMElement: n,
2972
+ eventType: t,
2973
+ data: r
2974
+ });
2975
+ };
2976
+ function jn(n, t, e) {
2977
+ n.forEach((r) => {
2978
+ r.dataset.attached !== "true" && (t === "load" ? Tn(r, t, e) : r.addEventListener(t, (s) => {
2979
+ s.preventDefault(), Tn(r, t, e);
2980
+ }), r.dataset.monitored = "true");
2981
+ });
2982
+ }
2983
+ function to(n, t, e) {
2984
+ const r = n.container.get("bootstrapping.monitor");
2985
+ r && r.events.subscribe("bootstrap:trigger-elements-updated", (i, o) => {
2986
+ jn(
2987
+ o.triggerElements,
2988
+ t,
2989
+ e
2990
+ );
2991
+ });
2992
+ const s = n.container.get("triggerElements");
2993
+ s && jn(
2994
+ s,
2995
+ t,
2996
+ e
2997
+ );
2998
+ }
2999
+ Nr((n) => {
3000
+ n.createCommand(
3001
+ "ready",
3002
+ { scope: Rt.Implementation, stage: ht.Pre },
3003
+ (t) => (e) => {
3004
+ const { container: r } = t, s = r.owner;
3005
+ r.get("bootstrapping").ready ? e(s) : s.events.subscribeOnce("bootstrap:ready", () => {
3006
+ e(s);
3007
+ });
3008
+ }
3009
+ );
3010
+ });
3011
+ const eo = (n) => {
3012
+ const t = (s, i) => {
3013
+ s && (i ? s.classList.add("ace-tabbing") : s.classList.remove("ace-tabbing"));
3014
+ }, e = (s) => {
3015
+ s.key === "Tab" ? t(n, !0) : s.key === "Enter" && document.activeElement && document.activeElement.classList.contains("ace-widget-trigger") || t(n, !1);
3016
+ }, r = (s) => {
3017
+ document.activeElement && document.activeElement.classList.contains("ace-widget-trigger") && document.activeElement.classList.contains("ace-tabbing") || t(n, !1);
3018
+ };
3019
+ return document.addEventListener("keydown", e), document.addEventListener("click", r), () => {
3020
+ document.removeEventListener("keydown", e), document.removeEventListener("click", r);
3021
+ };
3022
+ };
3023
+ function no(n, t) {
3024
+ const {
3025
+ // symbol,
3026
+ widgetName: e,
3027
+ label: r = "",
3028
+ ariaLabel: s = "",
3029
+ tooltip: i = ""
3030
+ } = t;
3031
+ return n.classList.add("ace-widget-trigger"), n.classList.add(`ace-widget_${e}`), r.length && n.classList.add("trigger-has-text"), s.length && !n.getAttribute("aria-label") && n.setAttribute("aria-label", s), s.length && !n.getAttribute("tabindex") && n.setAttribute("tabindex", "0"), i.length && !n.getAttribute("title") && n.setAttribute("title", i), eo(n);
3032
+ }
3033
+ function ro(n, t) {
3034
+ n instanceof HTMLElement ? (t && n.setAttribute("title", t), n.classList.remove("ace-trigger-active"), n.classList.remove("ace-trigger-loading")) : n instanceof Array && n.forEach((e) => {
3035
+ t && e.setAttribute("title", t), e.classList.remove("ace-trigger-active"), e.classList.remove("ace-trigger-loading");
3036
+ });
3037
+ }
3038
+ function so(n) {
3039
+ n instanceof HTMLElement ? (n.classList.remove("ace-trigger-active"), n.classList.add("ace-trigger-loading")) : n instanceof Array && n.forEach((t) => {
3040
+ t.classList.remove("ace-trigger-active"), t.classList.add("ace-trigger-loading");
3041
+ });
3042
+ }
3043
+ function Mr(n, t) {
3044
+ n instanceof HTMLElement ? (t && n.setAttribute("title", t), n.classList.add("ace-trigger-active"), n.classList.remove("ace-trigger-loading")) : n instanceof Array && n.forEach((e) => {
3045
+ t && e.setAttribute("title", t), e.classList.add("ace-trigger-active"), e.classList.remove("ace-trigger-loading");
3046
+ });
3047
+ }
3048
+ /**
3049
+ * @license
3050
+ * Copyright 2019 Google LLC
3051
+ * SPDX-License-Identifier: BSD-3-Clause
3052
+ */
3053
+ const re = window, tn = re.ShadowRoot && (re.ShadyCSS === void 0 || re.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, en = Symbol(), Rn = /* @__PURE__ */ new WeakMap();
3054
+ let Lr = class {
3055
+ constructor(t, e, r) {
3056
+ if (this._$cssResult$ = !0, r !== en)
3057
+ throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
3058
+ this.cssText = t, this.t = e;
3059
+ }
3060
+ get styleSheet() {
3061
+ let t = this.o;
3062
+ const e = this.t;
3063
+ if (tn && t === void 0) {
3064
+ const r = e !== void 0 && e.length === 1;
3065
+ r && (t = Rn.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && Rn.set(e, t));
3066
+ }
3067
+ return t;
3068
+ }
3069
+ toString() {
3070
+ return this.cssText;
3071
+ }
3072
+ };
3073
+ const io = (n) => new Lr(typeof n == "string" ? n : n + "", void 0, en), oo = (n, ...t) => {
3074
+ const e = n.length === 1 ? n[0] : t.reduce((r, s, i) => r + ((o) => {
3075
+ if (o._$cssResult$ === !0)
3076
+ return o.cssText;
3077
+ if (typeof o == "number")
3078
+ return o;
3079
+ 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.");
3080
+ })(s) + n[i + 1], n[0]);
3081
+ return new Lr(e, n, en);
3082
+ }, ao = (n, t) => {
3083
+ tn ? n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
3084
+ const r = document.createElement("style"), s = re.litNonce;
3085
+ s !== void 0 && r.setAttribute("nonce", s), r.textContent = e.cssText, n.appendChild(r);
3086
+ });
3087
+ }, In = tn ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
3088
+ let e = "";
3089
+ for (const r of t.cssRules)
3090
+ e += r.cssText;
3091
+ return io(e);
3092
+ })(n) : n;
3093
+ /**
3094
+ * @license
3095
+ * Copyright 2017 Google LLC
3096
+ * SPDX-License-Identifier: BSD-3-Clause
3097
+ */
3098
+ var Le;
3099
+ const ue = window, Hn = ue.trustedTypes, co = Hn ? Hn.emptyScript : "", Un = ue.reactiveElementPolyfillSupport, We = { toAttribute(n, t) {
3100
+ switch (t) {
3101
+ case Boolean:
3102
+ n = n ? co : null;
3103
+ break;
3104
+ case Object:
3105
+ case Array:
3106
+ n = n == null ? n : JSON.stringify(n);
3107
+ }
3108
+ return n;
3109
+ }, fromAttribute(n, t) {
3110
+ let e = n;
3111
+ switch (t) {
3112
+ case Boolean:
3113
+ e = n !== null;
3114
+ break;
3115
+ case Number:
3116
+ e = n === null ? null : Number(n);
3117
+ break;
3118
+ case Object:
3119
+ case Array:
3120
+ try {
3121
+ e = JSON.parse(n);
3122
+ } catch (r) {
3123
+ e = null;
3124
+ }
3125
+ }
3126
+ return e;
3127
+ } }, Dr = (n, t) => t !== n && (t == t || n == n), De = { attribute: !0, type: String, converter: We, reflect: !1, hasChanged: Dr }, Fe = "finalized";
3128
+ let At = class extends HTMLElement {
3129
+ constructor() {
3130
+ super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this._$Eu();
3131
+ }
3132
+ static addInitializer(t) {
3133
+ var e;
3134
+ this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t);
3135
+ }
3136
+ static get observedAttributes() {
3137
+ this.finalize();
3138
+ const t = [];
3139
+ return this.elementProperties.forEach((e, r) => {
3140
+ const s = this._$Ep(r, e);
3141
+ s !== void 0 && (this._$Ev.set(s, r), t.push(s));
3142
+ }), t;
3143
+ }
3144
+ static createProperty(t, e = De) {
3145
+ if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
3146
+ const r = typeof t == "symbol" ? Symbol() : "__" + t, s = this.getPropertyDescriptor(t, r, e);
3147
+ s !== void 0 && Object.defineProperty(this.prototype, t, s);
3148
+ }
3149
+ }
3150
+ static getPropertyDescriptor(t, e, r) {
3151
+ return { get() {
3152
+ return this[e];
3153
+ }, set(s) {
3154
+ const i = this[t];
3155
+ this[e] = s, this.requestUpdate(t, i, r);
3156
+ }, configurable: !0, enumerable: !0 };
3157
+ }
3158
+ static getPropertyOptions(t) {
3159
+ return this.elementProperties.get(t) || De;
3160
+ }
3161
+ static finalize() {
3162
+ if (this.hasOwnProperty(Fe))
3163
+ return !1;
3164
+ this[Fe] = !0;
3165
+ const t = Object.getPrototypeOf(this);
3166
+ if (t.finalize(), t.h !== void 0 && (this.h = [...t.h]), this.elementProperties = new Map(t.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
3167
+ const e = this.properties, r = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
3168
+ for (const s of r)
3169
+ this.createProperty(s, e[s]);
3170
+ }
3171
+ return this.elementStyles = this.finalizeStyles(this.styles), !0;
3172
+ }
3173
+ static finalizeStyles(t) {
3174
+ const e = [];
3175
+ if (Array.isArray(t)) {
3176
+ const r = new Set(t.flat(1 / 0).reverse());
3177
+ for (const s of r)
3178
+ e.unshift(In(s));
3179
+ } else
3180
+ t !== void 0 && e.push(In(t));
3181
+ return e;
3182
+ }
3183
+ static _$Ep(t, e) {
3184
+ const r = e.attribute;
3185
+ return r === !1 ? void 0 : typeof r == "string" ? r : typeof t == "string" ? t.toLowerCase() : void 0;
3186
+ }
3187
+ _$Eu() {
3188
+ var t;
3189
+ this._$E_ = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (t = this.constructor.h) === null || t === void 0 || t.forEach((e) => e(this));
3190
+ }
3191
+ addController(t) {
3192
+ var e, r;
3193
+ ((e = this._$ES) !== null && e !== void 0 ? e : this._$ES = []).push(t), this.renderRoot !== void 0 && this.isConnected && ((r = t.hostConnected) === null || r === void 0 || r.call(t));
3194
+ }
3195
+ removeController(t) {
3196
+ var e;
3197
+ (e = this._$ES) === null || e === void 0 || e.splice(this._$ES.indexOf(t) >>> 0, 1);
3198
+ }
3199
+ _$Eg() {
3200
+ this.constructor.elementProperties.forEach((t, e) => {
3201
+ this.hasOwnProperty(e) && (this._$Ei.set(e, this[e]), delete this[e]);
3202
+ });
3203
+ }
3204
+ createRenderRoot() {
3205
+ var t;
3206
+ const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions);
3207
+ return ao(e, this.constructor.elementStyles), e;
3208
+ }
3209
+ connectedCallback() {
3210
+ var t;
3211
+ this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
3212
+ var r;
3213
+ return (r = e.hostConnected) === null || r === void 0 ? void 0 : r.call(e);
3214
+ });
3215
+ }
3216
+ enableUpdating(t) {
3217
+ }
3218
+ disconnectedCallback() {
3219
+ var t;
3220
+ (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
3221
+ var r;
3222
+ return (r = e.hostDisconnected) === null || r === void 0 ? void 0 : r.call(e);
3223
+ });
3224
+ }
3225
+ attributeChangedCallback(t, e, r) {
3226
+ this._$AK(t, r);
3227
+ }
3228
+ _$EO(t, e, r = De) {
3229
+ var s;
3230
+ const i = this.constructor._$Ep(t, r);
3231
+ if (i !== void 0 && r.reflect === !0) {
3232
+ const o = (((s = r.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? r.converter : We).toAttribute(e, r.type);
3233
+ this._$El = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$El = null;
3234
+ }
3235
+ }
3236
+ _$AK(t, e) {
3237
+ var r;
3238
+ const s = this.constructor, i = s._$Ev.get(t);
3239
+ if (i !== void 0 && this._$El !== i) {
3240
+ const o = s.getPropertyOptions(i), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((r = o.converter) === null || r === void 0 ? void 0 : r.fromAttribute) !== void 0 ? o.converter : We;
3241
+ this._$El = i, this[i] = a.fromAttribute(e, o.type), this._$El = null;
3242
+ }
3243
+ }
3244
+ requestUpdate(t, e, r) {
3245
+ let s = !0;
3246
+ t !== void 0 && (((r = r || this.constructor.getPropertyOptions(t)).hasChanged || Dr)(this[t], e) ? (this._$AL.has(t) || this._$AL.set(t, e), r.reflect === !0 && this._$El !== t && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t, r))) : s = !1), !this.isUpdatePending && s && (this._$E_ = this._$Ej());
3247
+ }
3248
+ _$Ej() {
3249
+ return z(this, null, function* () {
3250
+ this.isUpdatePending = !0;
3251
+ try {
3252
+ yield this._$E_;
3253
+ } catch (e) {
3254
+ Promise.reject(e);
3255
+ }
3256
+ const t = this.scheduleUpdate();
3257
+ return t != null && (yield t), !this.isUpdatePending;
3258
+ });
3259
+ }
3260
+ scheduleUpdate() {
3261
+ return this.performUpdate();
3262
+ }
3263
+ performUpdate() {
3264
+ var t;
3265
+ if (!this.isUpdatePending)
3266
+ return;
3267
+ this.hasUpdated, this._$Ei && (this._$Ei.forEach((s, i) => this[i] = s), this._$Ei = void 0);
3268
+ let e = !1;
3269
+ const r = this._$AL;
3270
+ try {
3271
+ e = this.shouldUpdate(r), e ? (this.willUpdate(r), (t = this._$ES) === null || t === void 0 || t.forEach((s) => {
3272
+ var i;
3273
+ return (i = s.hostUpdate) === null || i === void 0 ? void 0 : i.call(s);
3274
+ }), this.update(r)) : this._$Ek();
3275
+ } catch (s) {
3276
+ throw e = !1, this._$Ek(), s;
3277
+ }
3278
+ e && this._$AE(r);
3279
+ }
3280
+ willUpdate(t) {
3281
+ }
3282
+ _$AE(t) {
3283
+ var e;
3284
+ (e = this._$ES) === null || e === void 0 || e.forEach((r) => {
3285
+ var s;
3286
+ return (s = r.hostUpdated) === null || s === void 0 ? void 0 : s.call(r);
3287
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
3288
+ }
3289
+ _$Ek() {
3290
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
3291
+ }
3292
+ get updateComplete() {
3293
+ return this.getUpdateComplete();
3294
+ }
3295
+ getUpdateComplete() {
3296
+ return this._$E_;
3297
+ }
3298
+ shouldUpdate(t) {
3299
+ return !0;
3300
+ }
3301
+ update(t) {
3302
+ this._$EC !== void 0 && (this._$EC.forEach((e, r) => this._$EO(r, this[r], e)), this._$EC = void 0), this._$Ek();
3303
+ }
3304
+ updated(t) {
3305
+ }
3306
+ firstUpdated(t) {
3307
+ }
3308
+ };
3309
+ At[Fe] = !0, At.elementProperties = /* @__PURE__ */ new Map(), At.elementStyles = [], At.shadowRootOptions = { mode: "open" }, Un == null || Un({ ReactiveElement: At }), ((Le = ue.reactiveElementVersions) !== null && Le !== void 0 ? Le : ue.reactiveElementVersions = []).push("1.6.3");
3310
+ /**
3311
+ * @license
3312
+ * Copyright 2017 Google LLC
3313
+ * SPDX-License-Identifier: BSD-3-Clause
3314
+ */
3315
+ var Te;
3316
+ const de = window, _t = de.trustedTypes, Bn = _t ? _t.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, qe = "$lit$", ct = `lit$${(Math.random() + "").slice(9)}$`, Tr = "?" + ct, ho = `<${Tr}>`, bt = document, It = () => bt.createComment(""), Ht = (n) => n === null || typeof n != "object" && typeof n != "function", jr = Array.isArray, lo = (n) => jr(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", je = `[
3317
+ \f\r]`, kt = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Vn = /-->/g, zn = />/g, ut = RegExp(`>|${je}(?:([^\\s"'>=/]+)(${je}*=${je}*(?:[^
3318
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Wn = /'/g, Fn = /"/g, Rr = /^(?:script|style|textarea|title)$/i, uo = (n) => (t, ...e) => ({ _$litType$: n, strings: t, values: e }), Kt = uo(1), wt = Symbol.for("lit-noChange"), T = Symbol.for("lit-nothing"), qn = /* @__PURE__ */ new WeakMap(), mt = bt.createTreeWalker(bt, 129, null, !1);
3319
+ function Ir(n, t) {
3320
+ if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
3321
+ throw Error("invalid template strings array");
3322
+ return Bn !== void 0 ? Bn.createHTML(t) : t;
3323
+ }
3324
+ const po = (n, t) => {
3325
+ const e = n.length - 1, r = [];
3326
+ let s, i = t === 2 ? "<svg>" : "", o = kt;
3327
+ for (let a = 0; a < e; a++) {
3328
+ const c = n[a];
3329
+ let h, l, u = -1, d = 0;
3330
+ for (; d < c.length && (o.lastIndex = d, l = o.exec(c), l !== null); )
3331
+ d = o.lastIndex, o === kt ? l[1] === "!--" ? o = Vn : l[1] !== void 0 ? o = zn : l[2] !== void 0 ? (Rr.test(l[2]) && (s = RegExp("</" + l[2], "g")), o = ut) : l[3] !== void 0 && (o = ut) : o === ut ? l[0] === ">" ? (o = s != null ? s : kt, u = -1) : l[1] === void 0 ? u = -2 : (u = o.lastIndex - l[2].length, h = l[1], o = l[3] === void 0 ? ut : l[3] === '"' ? Fn : Wn) : o === Fn || o === Wn ? o = ut : o === Vn || o === zn ? o = kt : (o = ut, s = void 0);
3332
+ const p = o === ut && n[a + 1].startsWith("/>") ? " " : "";
3333
+ i += o === kt ? c + ho : u >= 0 ? (r.push(h), c.slice(0, u) + qe + c.slice(u) + ct + p) : c + ct + (u === -2 ? (r.push(void 0), a) : p);
3334
+ }
3335
+ return [Ir(n, i + (n[e] || "<?>") + (t === 2 ? "</svg>" : "")), r];
3336
+ };
3337
+ class Ut {
3338
+ constructor({ strings: t, _$litType$: e }, r) {
3339
+ let s;
3340
+ this.parts = [];
3341
+ let i = 0, o = 0;
3342
+ const a = t.length - 1, c = this.parts, [h, l] = po(t, e);
3343
+ if (this.el = Ut.createElement(h, r), mt.currentNode = this.el.content, e === 2) {
3344
+ const u = this.el.content, d = u.firstChild;
3345
+ d.remove(), u.append(...d.childNodes);
3346
+ }
3347
+ for (; (s = mt.nextNode()) !== null && c.length < a; ) {
3348
+ if (s.nodeType === 1) {
3349
+ if (s.hasAttributes()) {
3350
+ const u = [];
3351
+ for (const d of s.getAttributeNames())
3352
+ if (d.endsWith(qe) || d.startsWith(ct)) {
3353
+ const p = l[o++];
3354
+ if (u.push(d), p !== void 0) {
3355
+ const b = s.getAttribute(p.toLowerCase() + qe).split(ct), v = /([.?@])?(.*)/.exec(p);
3356
+ c.push({ type: 1, index: i, name: v[2], strings: b, ctor: v[1] === "." ? fo : v[1] === "?" ? vo : v[1] === "@" ? yo : we });
3357
+ } else
3358
+ c.push({ type: 6, index: i });
3359
+ }
3360
+ for (const d of u)
3361
+ s.removeAttribute(d);
3362
+ }
3363
+ if (Rr.test(s.tagName)) {
3364
+ const u = s.textContent.split(ct), d = u.length - 1;
3365
+ if (d > 0) {
3366
+ s.textContent = _t ? _t.emptyScript : "";
3367
+ for (let p = 0; p < d; p++)
3368
+ s.append(u[p], It()), mt.nextNode(), c.push({ type: 2, index: ++i });
3369
+ s.append(u[d], It());
3370
+ }
3371
+ }
3372
+ } else if (s.nodeType === 8)
3373
+ if (s.data === Tr)
3374
+ c.push({ type: 2, index: i });
3375
+ else {
3376
+ let u = -1;
3377
+ for (; (u = s.data.indexOf(ct, u + 1)) !== -1; )
3378
+ c.push({ type: 7, index: i }), u += ct.length - 1;
3379
+ }
3380
+ i++;
3381
+ }
3382
+ }
3383
+ static createElement(t, e) {
3384
+ const r = bt.createElement("template");
3385
+ return r.innerHTML = t, r;
3386
+ }
3387
+ }
3388
+ function St(n, t, e = n, r) {
3389
+ var s, i, o, a;
3390
+ if (t === wt)
3391
+ return t;
3392
+ let c = r !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[r] : e._$Cl;
3393
+ const h = Ht(t) ? void 0 : t._$litDirective$;
3394
+ return (c == null ? void 0 : c.constructor) !== h && ((i = c == null ? void 0 : c._$AO) === null || i === void 0 || i.call(c, !1), h === void 0 ? c = void 0 : (c = new h(n), c._$AT(n, e, r)), r !== void 0 ? ((o = (a = e)._$Co) !== null && o !== void 0 ? o : a._$Co = [])[r] = c : e._$Cl = c), c !== void 0 && (t = St(n, c._$AS(n, t.values), c, r)), t;
3395
+ }
3396
+ class go {
3397
+ constructor(t, e) {
3398
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
3399
+ }
3400
+ get parentNode() {
3401
+ return this._$AM.parentNode;
3402
+ }
3403
+ get _$AU() {
3404
+ return this._$AM._$AU;
3405
+ }
3406
+ u(t) {
3407
+ var e;
3408
+ const { el: { content: r }, parts: s } = this._$AD, i = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : bt).importNode(r, !0);
3409
+ mt.currentNode = i;
3410
+ let o = mt.nextNode(), a = 0, c = 0, h = s[0];
3411
+ for (; h !== void 0; ) {
3412
+ if (a === h.index) {
3413
+ let l;
3414
+ h.type === 2 ? l = new Vt(o, o.nextSibling, this, t) : h.type === 1 ? l = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (l = new bo(o, this, t)), this._$AV.push(l), h = s[++c];
3415
+ }
3416
+ a !== (h == null ? void 0 : h.index) && (o = mt.nextNode(), a++);
3417
+ }
3418
+ return mt.currentNode = bt, i;
3419
+ }
3420
+ v(t) {
3421
+ let e = 0;
3422
+ for (const r of this._$AV)
3423
+ r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, e), e += r.strings.length - 2) : r._$AI(t[e])), e++;
3424
+ }
3425
+ }
3426
+ class Vt {
3427
+ constructor(t, e, r, s) {
3428
+ var i;
3429
+ this.type = 2, this._$AH = T, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = r, this.options = s, this._$Cp = (i = s == null ? void 0 : s.isConnected) === null || i === void 0 || i;
3430
+ }
3431
+ get _$AU() {
3432
+ var t, e;
3433
+ return (e = (t = this._$AM) === null || t === void 0 ? void 0 : t._$AU) !== null && e !== void 0 ? e : this._$Cp;
3434
+ }
3435
+ get parentNode() {
3436
+ let t = this._$AA.parentNode;
3437
+ const e = this._$AM;
3438
+ return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
3439
+ }
3440
+ get startNode() {
3441
+ return this._$AA;
3442
+ }
3443
+ get endNode() {
3444
+ return this._$AB;
3445
+ }
3446
+ _$AI(t, e = this) {
3447
+ t = St(this, t, e), Ht(t) ? t === T || t == null || t === "" ? (this._$AH !== T && this._$AR(), this._$AH = T) : t !== this._$AH && t !== wt && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : lo(t) ? this.T(t) : this._(t);
3448
+ }
3449
+ k(t) {
3450
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
3451
+ }
3452
+ $(t) {
3453
+ this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
3454
+ }
3455
+ _(t) {
3456
+ this._$AH !== T && Ht(this._$AH) ? this._$AA.nextSibling.data = t : this.$(bt.createTextNode(t)), this._$AH = t;
3457
+ }
3458
+ g(t) {
3459
+ var e;
3460
+ const { values: r, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = Ut.createElement(Ir(s.h, s.h[0]), this.options)), s);
3461
+ if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === i)
3462
+ this._$AH.v(r);
3463
+ else {
3464
+ const o = new go(i, this), a = o.u(this.options);
3465
+ o.v(r), this.$(a), this._$AH = o;
3466
+ }
3467
+ }
3468
+ _$AC(t) {
3469
+ let e = qn.get(t.strings);
3470
+ return e === void 0 && qn.set(t.strings, e = new Ut(t)), e;
3471
+ }
3472
+ T(t) {
3473
+ jr(this._$AH) || (this._$AH = [], this._$AR());
3474
+ const e = this._$AH;
3475
+ let r, s = 0;
3476
+ for (const i of t)
3477
+ s === e.length ? e.push(r = new Vt(this.k(It()), this.k(It()), this, this.options)) : r = e[s], r._$AI(i), s++;
3478
+ s < e.length && (this._$AR(r && r._$AB.nextSibling, s), e.length = s);
3479
+ }
3480
+ _$AR(t = this._$AA.nextSibling, e) {
3481
+ var r;
3482
+ for ((r = this._$AP) === null || r === void 0 || r.call(this, !1, !0, e); t && t !== this._$AB; ) {
3483
+ const s = t.nextSibling;
3484
+ t.remove(), t = s;
3485
+ }
3486
+ }
3487
+ setConnected(t) {
3488
+ var e;
3489
+ this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
3490
+ }
3491
+ }
3492
+ class we {
3493
+ constructor(t, e, r, s, i) {
3494
+ this.type = 1, this._$AH = T, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = i, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = T;
3495
+ }
3496
+ get tagName() {
3497
+ return this.element.tagName;
3498
+ }
3499
+ get _$AU() {
3500
+ return this._$AM._$AU;
3501
+ }
3502
+ _$AI(t, e = this, r, s) {
3503
+ const i = this.strings;
3504
+ let o = !1;
3505
+ if (i === void 0)
3506
+ t = St(this, t, e, 0), o = !Ht(t) || t !== this._$AH && t !== wt, o && (this._$AH = t);
3507
+ else {
3508
+ const a = t;
3509
+ let c, h;
3510
+ for (t = i[0], c = 0; c < i.length - 1; c++)
3511
+ h = St(this, a[r + c], e, c), h === wt && (h = this._$AH[c]), o || (o = !Ht(h) || h !== this._$AH[c]), h === T ? t = T : t !== T && (t += (h != null ? h : "") + i[c + 1]), this._$AH[c] = h;
3512
+ }
3513
+ o && !s && this.j(t);
3514
+ }
3515
+ j(t) {
3516
+ t === T ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t != null ? t : "");
3517
+ }
3518
+ }
3519
+ class fo extends we {
3520
+ constructor() {
3521
+ super(...arguments), this.type = 3;
3522
+ }
3523
+ j(t) {
3524
+ this.element[this.name] = t === T ? void 0 : t;
3525
+ }
3526
+ }
3527
+ const mo = _t ? _t.emptyScript : "";
3528
+ class vo extends we {
3529
+ constructor() {
3530
+ super(...arguments), this.type = 4;
3531
+ }
3532
+ j(t) {
3533
+ t && t !== T ? this.element.setAttribute(this.name, mo) : this.element.removeAttribute(this.name);
3534
+ }
3535
+ }
3536
+ class yo extends we {
3537
+ constructor(t, e, r, s, i) {
3538
+ super(t, e, r, s, i), this.type = 5;
3539
+ }
3540
+ _$AI(t, e = this) {
3541
+ var r;
3542
+ if ((t = (r = St(this, t, e, 0)) !== null && r !== void 0 ? r : T) === wt)
3543
+ return;
3544
+ const s = this._$AH, i = t === T && s !== T || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== T && (s === T || i);
3545
+ i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
3546
+ }
3547
+ handleEvent(t) {
3548
+ var e, r;
3549
+ typeof this._$AH == "function" ? this._$AH.call((r = (e = this.options) === null || e === void 0 ? void 0 : e.host) !== null && r !== void 0 ? r : this.element, t) : this._$AH.handleEvent(t);
3550
+ }
3551
+ }
3552
+ class bo {
3553
+ constructor(t, e, r) {
3554
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
3555
+ }
3556
+ get _$AU() {
3557
+ return this._$AM._$AU;
3558
+ }
3559
+ _$AI(t) {
3560
+ St(this, t);
3561
+ }
3562
+ }
3563
+ const Jn = de.litHtmlPolyfillSupport;
3564
+ Jn == null || Jn(Ut, Vt), ((Te = de.litHtmlVersions) !== null && Te !== void 0 ? Te : de.litHtmlVersions = []).push("2.8.0");
3565
+ const wo = (n, t, e) => {
3566
+ var r, s;
3567
+ const i = (r = e == null ? void 0 : e.renderBefore) !== null && r !== void 0 ? r : t;
3568
+ let o = i._$litPart$;
3569
+ if (o === void 0) {
3570
+ const a = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : null;
3571
+ i._$litPart$ = o = new Vt(t.insertBefore(It(), a), a, void 0, e != null ? e : {});
3572
+ }
3573
+ return o._$AI(n), o;
3574
+ };
3575
+ /**
3576
+ * @license
3577
+ * Copyright 2017 Google LLC
3578
+ * SPDX-License-Identifier: BSD-3-Clause
3579
+ */
3580
+ var Re, Ie;
3581
+ let jt = class extends At {
3582
+ constructor() {
3583
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
3584
+ }
3585
+ createRenderRoot() {
3586
+ var t, e;
3587
+ const r = super.createRenderRoot();
3588
+ return (t = (e = this.renderOptions).renderBefore) !== null && t !== void 0 || (e.renderBefore = r.firstChild), r;
3589
+ }
3590
+ update(t) {
3591
+ const e = this.render();
3592
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = wo(e, this.renderRoot, this.renderOptions);
3593
+ }
3594
+ connectedCallback() {
3595
+ var t;
3596
+ super.connectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!0);
3597
+ }
3598
+ disconnectedCallback() {
3599
+ var t;
3600
+ super.disconnectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!1);
3601
+ }
3602
+ render() {
3603
+ return wt;
3604
+ }
3605
+ };
3606
+ jt.finalized = !0, jt._$litElement$ = !0, (Re = globalThis.litElementHydrateSupport) === null || Re === void 0 || Re.call(globalThis, { LitElement: jt });
3607
+ const Kn = globalThis.litElementPolyfillSupport;
3608
+ Kn == null || Kn({ LitElement: jt });
3609
+ ((Ie = globalThis.litElementVersions) !== null && Ie !== void 0 ? Ie : globalThis.litElementVersions = []).push("3.3.3");
3610
+ /**
3611
+ * @license
3612
+ * Copyright 2017 Google LLC
3613
+ * SPDX-License-Identifier: BSD-3-Clause
3614
+ */
3615
+ const $o = (n, t) => t.kind === "method" && t.descriptor && !("value" in t.descriptor) ? zt(st({}, t), { finisher(e) {
3616
+ e.createProperty(t.key, n);
3617
+ } }) : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: t.key, initializer() {
3618
+ typeof t.initializer == "function" && (this[t.key] = t.initializer.call(this));
3619
+ }, finisher(e) {
3620
+ e.createProperty(t.key, n);
3621
+ } }, Eo = (n, t, e) => {
3622
+ t.constructor.createProperty(e, n);
3623
+ };
3624
+ function Hr(n) {
3625
+ return (t, e) => e !== void 0 ? Eo(n, t, e) : $o(n, t);
3626
+ }
3627
+ /**
3628
+ * @license
3629
+ * Copyright 2017 Google LLC
3630
+ * SPDX-License-Identifier: BSD-3-Clause
3631
+ */
3632
+ function nn(n) {
3633
+ return Hr(zt(st({}, n), { state: !0 }));
3634
+ }
3635
+ /**
3636
+ * @license
3637
+ * Copyright 2021 Google LLC
3638
+ * SPDX-License-Identifier: BSD-3-Clause
3639
+ */
3640
+ var He;
3641
+ ((He = window.HTMLSlotElement) === null || He === void 0 ? void 0 : He.prototype.assignedElements) != null;
3642
+ /**
3643
+ * @license
3644
+ * Copyright 2017 Google LLC
3645
+ * SPDX-License-Identifier: BSD-3-Clause
3646
+ */
3647
+ const Oo = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, Ao = (n) => (...t) => ({ _$litDirective$: n, values: t });
3648
+ class xo {
3649
+ constructor(t) {
3650
+ }
3651
+ get _$AU() {
3652
+ return this._$AM._$AU;
3653
+ }
3654
+ _$AT(t, e, r) {
3655
+ this._$Ct = t, this._$AM = e, this._$Ci = r;
3656
+ }
3657
+ _$AS(t, e) {
3658
+ return this.update(t, e);
3659
+ }
3660
+ update(t, e) {
3661
+ return this.render(...e);
3662
+ }
3663
+ }
3664
+ /**
3665
+ * @license
3666
+ * Copyright 2018 Google LLC
3667
+ * SPDX-License-Identifier: BSD-3-Clause
3668
+ */
3669
+ const _o = Ao(class extends xo {
3670
+ constructor(n) {
3671
+ var t;
3672
+ if (super(n), n.type !== Oo.ATTRIBUTE || n.name !== "class" || ((t = n.strings) === null || t === void 0 ? void 0 : t.length) > 2)
3673
+ throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
3674
+ }
3675
+ render(n) {
3676
+ return " " + Object.keys(n).filter((t) => n[t]).join(" ") + " ";
3677
+ }
3678
+ update(n, [t]) {
3679
+ var e, r;
3680
+ if (this.it === void 0) {
3681
+ this.it = /* @__PURE__ */ new Set(), n.strings !== void 0 && (this.nt = new Set(n.strings.join(" ").split(/\s/).filter((i) => i !== "")));
3682
+ for (const i in t)
3683
+ t[i] && !(!((e = this.nt) === null || e === void 0) && e.has(i)) && this.it.add(i);
3684
+ return this.render(t);
3685
+ }
3686
+ const s = n.element.classList;
3687
+ this.it.forEach((i) => {
3688
+ i in t || (s.remove(i), this.it.delete(i));
3689
+ });
3690
+ for (const i in t) {
3691
+ const o = !!t[i];
3692
+ o === this.it.has(i) || !((r = this.nt) === null || r === void 0) && r.has(i) || (o ? (s.add(i), this.it.add(i)) : (s.remove(i), this.it.delete(i)));
3693
+ }
3694
+ return wt;
3695
+ }
3696
+ });
3697
+ var So = Object.defineProperty, Po = Object.getOwnPropertyDescriptor, $e = (n, t, e, r) => {
3698
+ for (var s = r > 1 ? void 0 : r ? Po(t, e) : t, i = n.length - 1, o; i >= 0; i--)
3699
+ (o = n[i]) && (s = (r ? o(t, e, s) : o(s)) || s);
3700
+ return r && s && So(t, e, s), s;
3701
+ };
3702
+ class lt extends jt {
3703
+ constructor() {
3704
+ super(...arguments), this.active = !1, this.loaded = !1;
3705
+ }
3706
+ connectedCallback() {
3707
+ return z(this, null, function* () {
3708
+ cn(lt.prototype, this, "connectedCallback").call(this), this.icon = yield this._renderSymbol(this.symbol), this.loaded = !0;
3709
+ });
3710
+ }
3711
+ _toggleActive() {
3712
+ this.active = !this.active;
3713
+ }
3714
+ _renderSymbol(t) {
3715
+ return z(this, null, function* () {
3716
+ const e = (r) => z(this, null, function* () {
3717
+ return yield import("./index-9688347a.js").then((i) => i[r]);
3718
+ });
3719
+ if (t) {
3720
+ const { type: r, content: s } = t;
3721
+ switch (r) {
3722
+ case "Telia": {
3723
+ const i = yield e(s);
3724
+ return i ? Kt`<telia-icon
3725
+ class="trigger-icon"
3726
+ svg=${i.svg}
3727
+ size="lg"
3728
+ ></telia-icon>` : T;
3729
+ }
3730
+ case "FontAwesome":
3731
+ return Kt`<i class="trigger-fa-icon fa fa-${s}"></i>`;
3732
+ case "Uri":
3733
+ return Kt`<i
3734
+ class="trigger-custom-icon"
3735
+ style="background: url(${s}) no-repeat center center;background-size: contain;"
3736
+ ></i>`;
3737
+ default:
3738
+ return T;
3739
+ }
3740
+ }
3741
+ });
3742
+ }
3743
+ render() {
3744
+ return Kt`<button
3745
+ class=${_o({
3746
+ trigger: !0,
3747
+ active: this.active,
3748
+ rendered: this.loaded
3749
+ })}
3750
+ @click=${this._toggleActive}
3751
+ >
3752
+ ${this.icon}
3753
+ <span class="trigger-close">
3754
+ <svg
3755
+ width="18"
3756
+ height="9"
3757
+ viewBox="0 0 18 9"
3758
+ fill="none"
3759
+ xmlns="http://www.w3.org/2000/svg"
3760
+ >
3761
+ <path
3762
+ d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z"
3763
+ fill="white"
3764
+ />
3765
+ </svg>
3766
+ </span>
3767
+ <span class="trigger-loader">
3768
+ <svg viewBox="25 25 50 50">
3769
+ <circle
3770
+ cx="50"
3771
+ cy="50"
3772
+ r="20"
3773
+ fill="none"
3774
+ stroke="#000"
3775
+ stroke-width="2"
3776
+ stroke-miterlimit="10"
3777
+ />
3778
+ </svg>
3779
+ </span>
3780
+ </button>`;
3781
+ }
3782
+ }
3783
+ lt.styles = [
3784
+ oo`
3785
+ :host {
3786
+ --voca-rem-multiplier: 0.625;
3787
+ display: block;
3788
+ box-sizing: border-box;
3789
+ }
3790
+
3791
+ .trigger {
3792
+ position: fixed;
3793
+ transform: scale(0);
3794
+ box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
3795
+ bottom: 20px;
3796
+ right: 20px;
3797
+ z-index: 5;
3798
+ display: flex;
3799
+ align-items: center;
3800
+ justify-content: center;
3801
+ border: none;
3802
+ line-height: 55px;
3803
+ height: 55px;
3804
+ width: 55px;
3805
+ border-radius: 55px;
3806
+ cursor: pointer;
3807
+ background-color: #990ae3;
3808
+ font-family: Lato;
3809
+ text-decoration: none;
3810
+ border: 3px dashed transparent;
3811
+ box-sizing: border-box;
3812
+ transition: transform 200ms ease-out;
3813
+ }
3814
+ .trigger:hover {
3815
+ transform: scale(1.1) !important;
3816
+ }
3817
+ .trigger.rendered {
3818
+ transform: scale(1);
3819
+ }
3820
+ .trigger.active .trigger-icon {
3821
+ opacity: 0;
3822
+ transform: rotate(-180deg) scale(0);
3823
+ }
3824
+ .trigger.active .trigger-close {
3825
+ opacity: 1;
3826
+ transform: rotate(0deg) scale(1);
3827
+ }
3828
+
3829
+ .trigger-icon {
3830
+ display: inline-block;
3831
+ line-height: inherit;
3832
+ text-align: center;
3833
+ opacity: 1;
3834
+ transform: rotate(0deg) scale(1);
3835
+ transition:
3836
+ opacity 200ms ease-out,
3837
+ transform 200ms ease-out;
3838
+ color: #ffffff;
3839
+ }
3840
+ .trigger-close {
3841
+ opacity: 0;
3842
+ transition: transform 200ms ease-out;
3843
+ transform: rotate(180deg) scale(0);
3844
+ position: absolute;
3845
+ top: 0;
3846
+ bottom: 0;
3847
+ left: 0;
3848
+ right: 0;
3849
+ display: flex;
3850
+ justify-content: center;
3851
+ align-items: center;
3852
+ fill: #ffffff;
3853
+ }
3854
+ `
3855
+ ];
3856
+ $e([
3857
+ Hr({ attribute: !1 })
3858
+ ], lt.prototype, "symbol", 2);
3859
+ $e([
3860
+ nn()
3861
+ ], lt.prototype, "active", 2);
3862
+ $e([
3863
+ nn()
3864
+ ], lt.prototype, "loaded", 2);
3865
+ $e([
3866
+ nn()
3867
+ ], lt.prototype, "icon", 2);
3868
+ var vt = /* @__PURE__ */ ((n) => (n.Inline = "inline", n.Link = "link", n.Badge = "badge", n.Unsupported = "unsupported", n))(vt || {});
3869
+ const Co = (n, t) => n && t ? "both" : n ? "widgetDOM" : t ? "triggerDOM" : "none", Ur = (n) => n ? typeof n == "boolean" && n ? "link" : typeof n == "object" && !Array.isArray(n) ? "badge" : "unsupported" : "inline", ko = (n, t, e, r, s = !1) => z(void 0, null, function* () {
3870
+ var h, l;
3871
+ const i = Co(
3872
+ t,
3873
+ e
3874
+ ), o = Ur(r), a = {
3875
+ widgetDOMElement: t ? t.cloneNode(!0) : void 0,
3876
+ triggerDOMElement: e ? e.cloneNode(!0) : void 0
3877
+ }, c = {
3878
+ triggerType: o,
3879
+ cachedOriginals: a,
3880
+ widgetDOMElement: document.createElement("div")
3881
+ };
3882
+ switch (i) {
3883
+ case "both": {
3884
+ c.widgetDOMElement = t || document.createElement("div"), o !== "inline" && (c.triggerDOMElement = e);
3885
+ break;
3886
+ }
3887
+ case "widgetDOM": {
3888
+ if (c.widgetDOMElement = t || document.createElement("div"), o !== "inline") {
3889
+ const u = document.body.appendChild(
3890
+ document.createElement("a")
3891
+ );
3892
+ o === "link" && (u.innerText = n), c.triggerDOMElement = u;
3893
+ }
3894
+ break;
3895
+ }
3896
+ case "triggerDOM": {
3897
+ const u = document.createElement("div");
3898
+ c.widgetDOMElement = u, o === "inline" ? (u.id = (e == null ? void 0 : e.id) || "", s ? (u.style.display = "none", (h = e == null ? void 0 : e.parentNode) == null || h.appendChild(u), c.callback = () => {
3899
+ var d;
3900
+ (d = e == null ? void 0 : e.parentNode) == null || d.replaceChild(
3901
+ u,
3902
+ e
3903
+ ), u.style.display = (e == null ? void 0 : e.style.display) || "block";
3904
+ }) : (l = e == null ? void 0 : e.parentNode) == null || l.replaceChild(
3905
+ u,
3906
+ e
3907
+ ), c.cachedOriginals.widgetDOMElement = e, c.cachedOriginals.triggerDOMElement = void 0) : (c.widgetDOMElement = document.body.appendChild(u), c.triggerDOMElement = e);
3908
+ break;
3909
+ }
3910
+ case "none": {
3911
+ const u = document.body.appendChild(
3912
+ document.createElement("div")
3913
+ );
3914
+ if (c.widgetDOMElement = u, o !== "inline") {
3915
+ customElements.get("ace-widget-trigger") || customElements.define("ace-widget-trigger", lt);
3916
+ const d = document.createElement("ace-widget-trigger");
3917
+ d.symbol = r.symbol, document.body.appendChild(d), console.log("Created trigger"), c.triggerDOMElement = d;
3918
+ }
3919
+ break;
3920
+ }
3921
+ }
3922
+ return c;
3923
+ }), No = "modals";
3924
+ class Mo {
3925
+ constructor(t, e) {
3926
+ this.options = e, this.unsubscribe = [], this.container = t.createChild(this), this.container.register("widgetDOMElement", this.options.widgetDOMElement), this.container.register(
3927
+ "triggerDOMElement",
3928
+ this.options.triggerDOMElement
3929
+ );
3930
+ const r = this.container.get("$widget");
3931
+ this.options.widgetDOMElement.classList.add("ace-widget"), this.options.widgetDOMElement.classList.add(`ace-widget_${r.name}`);
3932
+ const s = t.get("widgetDOMElements") || [];
3933
+ t.register("widgetDOMElements", [
3934
+ ...s,
3935
+ this.options.widgetDOMElement
3936
+ ]);
3937
+ }
3938
+ /**
3939
+ * Renders the view outlet to the DOM.
3940
+ */
3941
+ render() {
3942
+ const { widgetDOMElement: t, triggerDOMElement: e } = this.options, r = this.container.get("$widget");
3943
+ return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === vt.Badge && so(e), import("./render-fd368868.js").then((s) => s.default(this.container, t)).then(() => {
3944
+ if (t.setAttribute("data-rendered", "true"), e && this.options.triggerType === vt.Badge) {
3945
+ const i = this.options.triggerOptions.openTooltip;
3946
+ Mr(e, i);
3947
+ }
3948
+ os(this.container, t);
3949
+ const s = this.container.get("$environment").widgets.all();
3950
+ Y(
3951
+ this.container,
3952
+ No,
3953
+ S.Session
3954
+ ).then((i) => {
3955
+ i && i.forEach((o) => {
3956
+ s.find(
3957
+ (a) => a.name === o.name && a.state === "activated"
3958
+ ) && r.events.dispatch("widget:modal-opened", o);
3959
+ });
3960
+ });
3961
+ }));
3962
+ }
3963
+ renderBadge(t) {
3964
+ const { triggerDOMElement: e } = this.options;
3965
+ if (!e)
3966
+ return;
3967
+ e.getAttribute("role") || e.setAttribute("role", "button");
3968
+ const { name: r } = this.container.get("$widget"), { label: s, symbol: i, ariaLabel: o, closedTooltip: a, openTooltip: c } = t, h = { closedTooltip: a, openTooltip: c };
3969
+ this.options.triggerOptions = h;
3970
+ const l = no(e, {
3971
+ label: s,
3972
+ symbol: i,
3973
+ ariaLabel: o,
3974
+ widgetName: r,
3975
+ tooltip: a
3976
+ });
3977
+ this.unsubscribe.push(l);
3978
+ }
3979
+ dispose() {
3980
+ return z(this, null, function* () {
3981
+ var r, s, i, o;
3982
+ const { triggerDOMElement: t, widgetDOMElement: e } = this.options;
3983
+ this.options.cachedOriginals.widgetDOMElement && e && ((r = e.parentNode) == null || r.replaceChild(
3984
+ this.options.cachedOriginals.widgetDOMElement,
3985
+ e
3986
+ )), this.options.cachedOriginals.triggerDOMElement && t && ((s = t.parentNode) == null || s.replaceChild(
3987
+ this.options.cachedOriginals.triggerDOMElement,
3988
+ t
3989
+ )), this.unsubscribe.forEach((a) => {
3990
+ a();
3991
+ }), (i = e.parentNode) == null || i.removeChild(e), (o = t == null ? void 0 : t.parentNode) == null || o.removeChild(t);
3992
+ });
3993
+ }
3994
+ }
3995
+ const Gt = "changesets", Lo = (n) => {
3996
+ const t = { tags: n.tags };
3997
+ return n.context && typeof n.context != "function" && (t.context = n.context), n.properties && typeof n.properties != "function" && (t.properties = n.properties), n.layout && typeof n.layout != "function" && (t.layout = n.layout), t;
3998
+ };
3999
+ class rn {
4000
+ constructor(t, e) {
4001
+ this.container = t, this.storageWriter = e;
4002
+ }
4003
+ static create(t) {
4004
+ return et(
4005
+ t,
4006
+ Gt,
4007
+ P.Necessary,
4008
+ {
4009
+ medium: S.Local
4010
+ }
4011
+ ).then(
4012
+ (e) => new rn(t, e)
4013
+ );
4014
+ }
4015
+ write(t, e, r, s) {
4016
+ return Q(this)(() => Y(
4017
+ this.container,
4018
+ Gt,
4019
+ S.Local
4020
+ ).then((i = {}) => {
4021
+ const { keys: o = [], items: a = {} } = i, c = o.indexOf(t);
4022
+ return c > -1 && o.splice(c, 1), o.push(t), a[t] = {
4023
+ options: s,
4024
+ attributes: Lo(r),
4025
+ rules: e.rules
4026
+ }, this.storageWriter({ keys: o, items: a });
4027
+ }));
4028
+ }
4029
+ remove(t) {
4030
+ return Q(this)(() => Y(
4031
+ this.container,
4032
+ Gt,
4033
+ S.Local
4034
+ ).then((e = {}) => {
4035
+ const { keys: r = [], items: s = {} } = e, i = r.indexOf(t);
4036
+ if (i > -1)
4037
+ return r.splice(i, 1), delete s[t], this.storageWriter(e);
4038
+ }));
4039
+ }
4040
+ load(t) {
4041
+ return Q(this)(() => Y(
4042
+ this.container,
4043
+ Gt,
4044
+ S.Local
4045
+ ).then((e = {}) => {
4046
+ const { keys: r = [], items: s = {} } = e;
4047
+ r.forEach((i) => {
4048
+ const o = s[i];
4049
+ if (o) {
4050
+ const { rules: a, attributes: c, options: h } = o;
4051
+ t.write({
4052
+ attributes: c,
4053
+ options: h,
4054
+ target: new Pt(t, a)
4055
+ });
4056
+ }
4057
+ });
4058
+ }));
4059
+ }
4060
+ }
4061
+ const Do = (n) => {
4062
+ const { container: t } = n;
4063
+ return rn.create(t).then(
4064
+ (e) => {
4065
+ const r = t.get("$settings"), s = { localStorage: e }, i = new me(n, s), o = rr(i, r);
4066
+ return n.events.subscribe(
4067
+ "widget:state-change",
4068
+ (a, c) => {
4069
+ c.state === Qn.Deactivating && o();
4070
+ }
4071
+ ), i;
4072
+ }
4073
+ );
4074
+ }, To = (n) => Promise.resolve().then(() => Gi).then(
4075
+ ({ RoutingService: t, HistoryMode: e }) => n.get("settings").then((r) => {
4076
+ const {
4077
+ routing: {
4078
+ initialPath: s = "/",
4079
+ mode: i = e.scopedHash,
4080
+ basePath: o
4081
+ },
4082
+ views: a
4083
+ } = r;
4084
+ return new t(n, {
4085
+ initialPath: s,
4086
+ mode: i,
4087
+ routes: Object.keys(a).map((h) => ({
4088
+ name: h,
4089
+ path: a[h].path
4090
+ })),
4091
+ basePath: o
4092
+ });
4093
+ })
4094
+ ), jo = (n) => Promise.resolve().then(() => ai).then(({ StorageProvider: t }) => new t()), Ro = (n) => Promise.resolve().then(() => Ge).then(({ ActionResolver: t }) => new t(n)), Io = (n) => Promise.resolve().then(() => Ge).then(({ ComponentResolver: t }) => new t(n)), Ho = (n) => Promise.resolve().then(() => Ge).then(() => Do(n.get("$widget"))), Ue = "$settings", Yt = "open", Gn = "activeStickyWidget";
4095
+ class la extends Zr {
4096
+ constructor(t) {
4097
+ super(t), this.outlets = /* @__PURE__ */ new Map(), this.activated = void 0, this.subs = [], this.handleBootstrapping = (e) => {
4098
+ const r = {
4099
+ triggerDOMElement: e.sourceDOMElement,
4100
+ withRenderState: "storage"
4101
+ /* Storage */
4102
+ };
4103
+ this.container.get("settings").then((s) => {
4104
+ const { activate: i } = s;
4105
+ (typeof i == "undefined" || i === null || i === !0) && (this.activated = (this.activated || this.widget.activate()).then(
4106
+ () => this.attach(r)
4107
+ ));
4108
+ });
4109
+ }, this.container.registerAsync(
4110
+ "storage",
4111
+ () => jo(this.container)
4112
+ ), this.container.registerFactory("settings", () => Y(
4113
+ this.container,
4114
+ Ue,
4115
+ S.Local
4116
+ ).then((e = {}) => st(st({}, this.container.get("$settings")), e))), to(this, "load", this.handleBootstrapping), this.container.registerAsync(
4117
+ "componentResolver",
4118
+ () => Io(this.container)
4119
+ ), this.container.registerAsync(
4120
+ "router",
4121
+ () => To(this.container)
4122
+ ), this.container.registerAsync(
4123
+ "actionResolver",
4124
+ () => Ro(this.container)
4125
+ ), this.container.register("matchMedia", window.matchMedia), this.container.registerAsync(
4126
+ "components",
4127
+ () => Ho(this.container)
4128
+ );
4129
+ }
4130
+ initialize() {
4131
+ const t = this.container.getManyAsync(
4132
+ "actionResolver",
4133
+ "router",
4134
+ "components"
4135
+ ), e = this.container.get("csp");
4136
+ return e && (window.webprovisionsEnvironmentVariables || (window.webprovisionsEnvironmentVariables = {}), window.webprovisionsEnvironmentVariables.cspNonce = e.nonce), Promise.all([t, this.container.get("settings")]).then(
4137
+ ([{ actionResolver: r, router: s, components: i }, o]) => {
4138
+ var h;
4139
+ r.subscribe(
4140
+ this.widget.name,
4141
+ (l, u, d) => this.onAction(u, d)
4142
+ );
4143
+ const a = (l) => {
4144
+ i.nodes.query({ type: "view" }).forEach((u) => {
4145
+ i.setSwitch(u, l);
4146
+ });
4147
+ }, c = ((h = s.getInitialRoute()) == null ? void 0 : h.name) || "index";
4148
+ return a(c), this.events.subscribe("widget:data-loaded", (l, { element: u }) => {
4149
+ this.widget.container.get("seoConfiguration") && this.events.dispatch("widget:preloaded-replaced", {
4150
+ element: u
4151
+ });
4152
+ }), this.events.subscribe(
4153
+ "router:change",
4154
+ (l, { previous: u = { routeData: {} }, next: d = { routeData: {} } }) => {
4155
+ const { routeData: p } = u, { routeData: b } = d, v = Object.keys(o.views).reduce(
4156
+ (g, O) => typeof o.views[O].path == "undefined" ? O : g,
4157
+ ""
4158
+ );
4159
+ !b.name && v ? a(v) : a(b.name), yt(p && p.params), yt(b && b.params), this.container.getAsync("actionResolver").then((g) => {
4160
+ g.action(this.widget.name, "routeChange", {
4161
+ next: b,
4162
+ previous: p
4163
+ });
4164
+ });
4165
+ }
4166
+ ), s.initialize();
4167
+ }
4168
+ );
4169
+ }
4170
+ attach(t = {}) {
4171
+ return this.container.get("settings").then((r) => z(this, [r], function* ({ trigger: e }) {
4172
+ var p, b;
4173
+ const {
4174
+ widgetDOMElement: s,
4175
+ key: i = Bt(),
4176
+ triggerDOMElement: o,
4177
+ withRenderState: a
4178
+ } = t, h = Ur(e) === vt.Inline && ((o == null ? void 0 : o.childElementCount) || 0) > 0, l = yield ko(
4179
+ this.widget.name,
4180
+ s,
4181
+ o,
4182
+ e,
4183
+ h
4184
+ );
4185
+ this.outlets.size < 1 && !a && this.setRenderState("unset");
4186
+ const u = () => {
4187
+ const v = () => g.querySelectorAll("[data-loading=true]").length === 0, [g] = this.widget.container.get("widgetDOMElements"), O = (H, k) => {
4188
+ v() && (l.callback && l.callback(), k.disconnect());
4189
+ }, j = {
4190
+ attributes: !0,
4191
+ subtree: !0,
4192
+ childList: !0
4193
+ };
4194
+ v() && l.callback && l.callback(), new MutationObserver(O).observe(g, j);
4195
+ };
4196
+ h && this.widget.container.getAsync("dataClient").then(({ events: v }) => {
4197
+ v.subscribe(
4198
+ "data-client:fetched",
4199
+ (g, O) => {
4200
+ O.unresolvedQueries === 0 && u();
4201
+ }
4202
+ );
4203
+ });
4204
+ const d = this.getOrCreateViewOutlet(i, l);
4205
+ if (this.outlets.set(i, d), this.widget.events.dispatch("widget:attached", {}, { bubbles: !0 }), l.triggerType === vt.Badge && e && ((p = l.triggerDOMElement) == null || p.setAttribute(
4206
+ "aria-expanded",
4207
+ "false"
4208
+ ), d == null || d.renderBadge(e)), l.triggerType !== vt.Inline && ((b = l.triggerDOMElement) == null || b.addEventListener(
4209
+ "click",
4210
+ (v) => {
4211
+ v.preventDefault(), this.container.get("settings").then(({ trigger: g }) => {
4212
+ d.render().then(() => this.renderState()).then((O) => g && g.action && g.action === "hide" ? O === q.open ? this.hide() : this.open() : O === q.open ? this.close() : this.open());
4213
+ });
4214
+ }
4215
+ )), this.outlets.size > 1)
4216
+ return this.renderState().then((v) => {
4217
+ this.triggerStateIfApplicable(v);
4218
+ });
4219
+ if (a)
4220
+ return a === "storage" ? this.renderState().then((v) => {
4221
+ if (l.triggerType === vt.Inline) {
4222
+ this.triggerStateIfApplicable("open");
4223
+ return;
4224
+ }
4225
+ this.triggerStateIfApplicable(v);
4226
+ }) : this.triggerStateIfApplicable(a);
4227
+ }));
4228
+ }
4229
+ detach(t) {
4230
+ if (t) {
4231
+ if (this.outlets.has(t)) {
4232
+ const e = this.outlets.get(t);
4233
+ e == null || e.dispose(), this.outlets.delete(t);
4234
+ return;
4235
+ }
4236
+ process.env.NODE_ENV !== "production" && console.warn(`detach(): Could not find View Outlet with key ${t}`);
4237
+ return;
4238
+ }
4239
+ this.outlets.forEach((e) => {
4240
+ e.dispose();
4241
+ }), this.outlets.clear();
4242
+ }
4243
+ triggerStateIfApplicable(t) {
4244
+ return this.container.getAsync("router").then((e) => {
4245
+ switch (t) {
4246
+ case "closed":
4247
+ this.close();
4248
+ break;
4249
+ case "open":
4250
+ this.open();
4251
+ break;
4252
+ case "hidden":
4253
+ this.hide(), e.start();
4254
+ break;
4255
+ default:
4256
+ return;
4257
+ }
4258
+ });
4259
+ }
4260
+ getOrCreateViewOutlet(t, e) {
4261
+ return this.outlets.has(t) ? this.outlets.get(t) : new Mo(this.container, e);
4262
+ }
4263
+ render(t = {}) {
4264
+ if (process.env.NODE_ENV !== "production" && console.warn(
4265
+ "widget.render() is deprecated. Use widget.attach() instead."
4266
+ ), t.open) {
4267
+ const e = zt(st({}, t), {
4268
+ withRenderState: "open"
4269
+ /* Open */
4270
+ });
4271
+ return this.attach(e);
4272
+ }
4273
+ return this.attach(t);
4274
+ }
4275
+ activate(t) {
4276
+ t != null && t.override && this.setSettings(() => t.override), t != null && t.apiNotificationPriorityBy && this.container.register(
4277
+ "apiNotificationPriorityBy",
4278
+ t.apiNotificationPriorityBy
4279
+ );
4280
+ }
4281
+ setSettings(t) {
4282
+ return Promise.all([
4283
+ this.container.get("settings"),
4284
+ et(
4285
+ this.container,
4286
+ Ue,
4287
+ P.Necessary,
4288
+ {
4289
+ medium: S.Local
4290
+ }
4291
+ )
4292
+ ]).then(([e, r]) => Promise.resolve(t(e)).then((s) => r(s).then(() => {
4293
+ const i = st(st({}, e), s);
4294
+ return this.widget.events.dispatch("widget:settings-updated", i), i;
4295
+ })));
4296
+ }
4297
+ clearSettings() {
4298
+ return et(
4299
+ this.container,
4300
+ Ue,
4301
+ P.Necessary,
4302
+ { medium: S.Local }
4303
+ ).then((t) => t()).then(() => this.container.get("settings")).then((t) => {
4304
+ this.widget.events.dispatch("widget:settings-updated", t);
4305
+ });
4306
+ }
4307
+ action({ action: t, value: e }) {
4308
+ return this.container.getAsync("actionResolver").then((r) => {
4309
+ r.action(this.widget.name, t, e);
4310
+ });
4311
+ }
4312
+ renderState() {
4313
+ if (Xe(this.container))
4314
+ return Promise.resolve(q.open);
4315
+ const t = () => Y(
4316
+ this.container,
4317
+ Yt,
4318
+ S.Session
4319
+ ).then((r = q.closed) => r), e = () => Y(
4320
+ this.container,
4321
+ Yt,
4322
+ S.Session
4323
+ ).then((r = q.closed) => r);
4324
+ return this.container.getAsync("router").then((r) => r.isSticky() ? e().then((s) => s === q.open ? s : t()) : t());
4325
+ }
4326
+ hide() {
4327
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
4328
+ "hide(): No-op as no view outlets are registered. Invoke the attach() command first."
4329
+ ), Promise.resolve()) : (this.outlets.forEach((t) => t.render()), this.action({ action: "hide" }).then(() => {
4330
+ this.setTriggerState(!1);
4331
+ }));
4332
+ }
4333
+ open() {
4334
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
4335
+ "open(): No-op as no view outlets are registered. Invoke the attach() command first."
4336
+ ), Promise.resolve()) : (this.outlets.forEach((t) => t.render()), this.action({ action: "open" }).then(() => (this.widget.events.dispatch("tracking:widget-rendered", {}), this.onOpen())));
4337
+ }
4338
+ close() {
4339
+ return this.outlets.size < 1 ? (process.env.NODE_ENV !== "production" && console.warn(
4340
+ "close(): No-op as no view outlets are registered. Invoke the attach() command first."
4341
+ ), Promise.resolve()) : this.action({ action: "close" }).then(() => this.onClose());
4342
+ }
4343
+ show() {
4344
+ return process.env.NODE_ENV !== "production" && console.warn(
4345
+ "show(): Command is deprecated and will be removed in the future. Use open() instead."
4346
+ ), this.open();
4347
+ }
4348
+ onAction(t, e) {
4349
+ switch (t) {
4350
+ case "close":
4351
+ case "open":
4352
+ case "hide":
4353
+ const r = t === "open" ? q.open : t === "close" ? q.closed : q.hidden;
4354
+ return this.setRenderState(r).then(() => {
4355
+ this.setTriggerState(r === q.open), r !== q.hidden ? r === q.open ? this.onOpen() : this.onClose() : this.outlets.forEach(
4356
+ (s) => {
4357
+ var i;
4358
+ return (i = s.options.triggerDOMElement) == null ? void 0 : i.setAttribute(
4359
+ "aria-expanded",
4360
+ "false"
4361
+ );
4362
+ }
4363
+ );
4364
+ });
4365
+ }
4366
+ }
4367
+ setRenderState(t) {
4368
+ const { invoke: e, events: r } = this.container.get("$widget");
4369
+ return Promise.all([
4370
+ et(
4371
+ this.container,
4372
+ Yt,
4373
+ P.Necessary,
4374
+ {
4375
+ medium: S.Session
4376
+ }
4377
+ ),
4378
+ et(
4379
+ this.container,
4380
+ Yt,
4381
+ P.Necessary,
4382
+ {
4383
+ medium: S.Local,
4384
+ duration: { minutes: 5 }
4385
+ }
4386
+ ),
4387
+ this.container.getAsync("router"),
4388
+ e("renderState")
4389
+ ]).then(
4390
+ ([s, i, o, a]) => {
4391
+ t === "unset" || !t ? (i(), s()) : (o.isSticky() && i(t), s(t)), r.dispatch("widget:render-state-changed", {
4392
+ previous: a,
4393
+ next: t
4394
+ });
4395
+ }
4396
+ );
4397
+ }
4398
+ onOpen() {
4399
+ return this.container.getAsync("router").then((t) => (this.outlets.forEach(
4400
+ (e) => {
4401
+ var r;
4402
+ return (r = e.options.triggerDOMElement) == null ? void 0 : r.setAttribute(
4403
+ "aria-expanded",
4404
+ "true"
4405
+ );
4406
+ }
4407
+ ), t.start()));
4408
+ }
4409
+ onClose() {
4410
+ const t = this.container.getManyAsync(
4411
+ "router",
4412
+ "components"
4413
+ );
4414
+ return (() => this.container.get("settings").then((r) => {
4415
+ const { activate: s } = this.container.get("$settings");
4416
+ return r.activate !== s ? this.setSettings(() => Promise.resolve({ activate: s })) : Promise.resolve();
4417
+ }))().then(() => t).then(
4418
+ ({
4419
+ router: r,
4420
+ components: s
4421
+ }) => {
4422
+ const i = s.nodes.visible;
4423
+ return this.outlets.forEach(
4424
+ (o) => {
4425
+ var a;
4426
+ return (a = o.options.triggerDOMElement) == null ? void 0 : a.setAttribute(
4427
+ "aria-expanded",
4428
+ "false"
4429
+ );
4430
+ }
4431
+ ), i.filter(
4432
+ (o) => o.attributes.properties.animation && o.attributes.properties.animation !== "none"
4433
+ ).length ? new Promise((o) => {
4434
+ setTimeout(() => {
4435
+ o(r);
4436
+ }, 200);
4437
+ }) : Promise.resolve(r);
4438
+ }
4439
+ ).then((r) => r.stop());
4440
+ }
4441
+ setTriggerState(t) {
4442
+ this.outlets.forEach((e) => {
4443
+ const {
4444
+ options: { triggerDOMElement: r, triggerOptions: s }
4445
+ } = e, { openTooltip: i, closedTooltip: o } = s || {};
4446
+ r && (t ? Mr(r, i) : ro(r, o));
4447
+ });
4448
+ }
4449
+ deactivate() {
4450
+ this.subs.forEach((e) => e());
4451
+ const t = [];
4452
+ return this.outlets.forEach((e) => t.push(e.dispose())), Y(
4453
+ this.container,
4454
+ Gn,
4455
+ S.Local
4456
+ ).then((e) => e === this.widget.name ? et(
4457
+ this.container,
4458
+ Gn,
4459
+ P.Necessary,
4460
+ {
4461
+ medium: S.Local,
4462
+ scope: Ct.Implementation
4463
+ }
4464
+ ).then((r) => r()).then(() => Promise.all(t)) : Promise.all(t));
4465
+ }
4466
+ }
4467
+ /**
4468
+ * @license
4469
+ * Copyright 2021 Google LLC
4470
+ * SPDX-License-Identifier: BSD-3-Clause
4471
+ */
4472
+ let Uo = class extends Event {
4473
+ constructor(t, e, r) {
4474
+ super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = e, this.subscribe = r != null && r;
4475
+ }
4476
+ };
4477
+ /**
4478
+ * @license
4479
+ * Copyright 2021 Google LLC
4480
+ * SPDX-License-Identifier: BSD-3-Clause
4481
+ */
4482
+ /**
4483
+ * @license
4484
+ * Copyright 2021 Google LLC
4485
+ * SPDX-License-Identifier: BSD-3-Clause
4486
+ */
4487
+ class Yn {
4488
+ constructor(t, e, r, s) {
4489
+ var i;
4490
+ if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, a) => {
4491
+ this.unsubscribe && (this.unsubscribe !== a && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, a)), this.unsubscribe = a;
4492
+ }, this.host = t, e.context !== void 0) {
4493
+ const o = e;
4494
+ this.context = o.context, this.callback = o.callback, this.subscribe = (i = o.subscribe) !== null && i !== void 0 && i;
4495
+ } else
4496
+ this.context = e, this.callback = r, this.subscribe = s != null && s;
4497
+ this.host.addController(this);
4498
+ }
4499
+ hostConnected() {
4500
+ this.dispatchRequest();
4501
+ }
4502
+ hostDisconnected() {
4503
+ this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
4504
+ }
4505
+ dispatchRequest() {
4506
+ this.host.dispatchEvent(new Uo(this.context, this.t, this.subscribe));
4507
+ }
4508
+ }
4509
+ const da = "children", Bo = "descriptor", Vo = "container", pa = "context", ga = "layout", fa = "properties";
4510
+ class ma {
4511
+ constructor(t) {
4512
+ (this.host = t).addController(this), new Yn(
4513
+ t,
4514
+ Vo,
4515
+ (e) => {
4516
+ this._container = e, this.host.requestUpdate();
4517
+ },
4518
+ !0
4519
+ ), new Yn(
4520
+ t,
4521
+ Bo,
4522
+ (e) => {
4523
+ this._descriptor = e, this.host.requestUpdate();
4524
+ },
4525
+ !0
4526
+ );
4527
+ }
4528
+ hostConnected() {
4529
+ }
4530
+ hostDisconnected() {
4531
+ }
4532
+ dispatch(t, e) {
4533
+ return z(this, null, function* () {
4534
+ if (!this._container || !this._descriptor)
4535
+ return;
4536
+ const r = yield me.getInstance(
4537
+ this._container
4538
+ ), s = new Pt(r).withId(
4539
+ this._descriptor.id
4540
+ );
4541
+ yield r.actions(
4542
+ s,
4543
+ this._descriptor.type || Bt()
4544
+ ).dispatch(t, e);
4545
+ });
4546
+ }
4547
+ }
4548
+ const zo = (n, t) => z(void 0, null, function* () {
4549
+ const e = n.properties().provider;
4550
+ let r = {}, s = "";
4551
+ Array.isArray(e) ? (s = e[0], r = e[1]) : s = e || "";
4552
+ const i = yield t.getAsync(s);
4553
+ if (!i)
4554
+ throw new Error("No provider defined in ListComponent");
4555
+ return i.applyComponentNodeSettings(n.node.id, r), { provider: i, settings: r };
4556
+ }), va = (n, t) => z(void 0, null, function* () {
4557
+ const { provider: e, settings: r = {} } = yield zo(n, t);
4558
+ return {
4559
+ addResource: (s, i) => e.addResource(s, i),
4560
+ getData: (s, i) => e.getData(s, i, r)
4561
+ };
4562
+ });
4563
+ class Wo {
4564
+ constructor(t) {
4565
+ this.container = t, this.resources = /* @__PURE__ */ new Map(), this.nodeConfiguration = /* @__PURE__ */ new Map();
4566
+ }
4567
+ getData(t, e, r) {
4568
+ return z(this, null, function* () {
4569
+ const s = this.resources.get(t);
4570
+ if (!s)
4571
+ throw new Error(`Unable to get EntityProvider for "${t}"`);
4572
+ return yield s.query(e, r);
4573
+ });
4574
+ }
4575
+ addResource(t, e) {
4576
+ this.resources.set(t, e);
4577
+ }
4578
+ applyComponentNodeSettings(t, e) {
4579
+ this.nodeConfiguration.set(t, e);
4580
+ }
4581
+ }
4582
+ const Zn = (n) => ({
4583
+ title: n.Title,
4584
+ id: n.Id.toString()
4585
+ });
4586
+ class Fo extends Wo {
4587
+ constructor(t) {
4588
+ super(t), this.addResource("item", {
4589
+ query: (e, r) => z(this, null, function* () {
4590
+ const s = e.itemId, i = "78aacc09-ae6f-5485-5ca3-9dacebb95825", o = t.get("$widget").name, a = r.projection || "", h = yield (yield fetch(
4591
+ `${a}/guides/${s}?client=${i}&funnel=${o}&site=%2F%2Fdemo.humany.cc%2Fadmin%2Finterfaces&phrase=&connectionId=&p.LastGuideId=2857`
4592
+ )).json();
4593
+ return h ? Zn(h) : null;
4594
+ })
4595
+ }), this.addResource("items", {
4596
+ query: (e, r) => z(this, null, function* () {
4597
+ const s = "", i = t.get("$widget").name, o = r.projection || "", u = yield (yield fetch(
4598
+ `${o}/guides?client=${s}&funnel=${i}&site=&phrase=&skip=0&take=10&sorting.type=popularity&sorting.direction=descending`
4599
+ )).json();
4600
+ return {
4601
+ items: (u.Matches || []).map((d) => Zn(d)),
4602
+ totalItems: (u == null ? void 0 : u.TotalMatches) || 0
4603
+ };
4604
+ })
4605
+ });
4606
+ }
4607
+ }
4608
+ const ya = (n) => z(void 0, null, function* () {
4609
+ n.registerAsync("guideProvider", () => new Fo(n));
4610
+ }), ba = (n, t, e, r, s) => n.getAsync("componentResolver").then((i) => (i.registerComponent(t, e), sr(n, t, r || (() => {
4611
+ }), t, s)));
4612
+ export {
4613
+ T as A,
4614
+ Wo as D,
4615
+ xs as E,
4616
+ ya as G,
4617
+ la as W,
4618
+ Yn as a,
4619
+ jt as b,
4620
+ Vo as c,
4621
+ oo as d,
4622
+ Ao as e,
4623
+ nn as f,
4624
+ Bo as g,
4625
+ da as h,
4626
+ xo as i,
4627
+ fa as j,
4628
+ pa as k,
4629
+ ga as l,
4630
+ q as m,
4631
+ Hr as n,
4632
+ ma as o,
4633
+ me as p,
4634
+ va as q,
4635
+ ba as r,
4636
+ Uo as s,
4637
+ Oo as t,
4638
+ Kt as x
4639
+ };
4640
+ //# sourceMappingURL=index-e248f756.js.map