@telia-ace/widget-components-area-flamingo 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2561 @@
1
+ var Wt = Object.defineProperty, Bt = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, Ye = Object.getOwnPropertySymbols, Jt = Object.getPrototypeOf, Ft = Object.prototype.hasOwnProperty, Kt = Object.prototype.propertyIsEnumerable, qt = Reflect.get, Ze = (n, e, t) => e in n ? Wt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, At = (n, e) => {
2
+ for (var t in e || (e = {}))
3
+ Ft.call(e, t) && Ze(n, t, e[t]);
4
+ if (Ye)
5
+ for (var t of Ye(e))
6
+ Kt.call(e, t) && Ze(n, t, e[t]);
7
+ return n;
8
+ }, Ct = (n, e) => Bt(n, Vt(e)), Gt = (n, e, t) => qt(Jt(n), t, e), Q = (n, e, t) => new Promise((s, r) => {
9
+ var i = (c) => {
10
+ try {
11
+ a(t.next(c));
12
+ } catch (l) {
13
+ r(l);
14
+ }
15
+ }, o = (c) => {
16
+ try {
17
+ a(t.throw(c));
18
+ } catch (l) {
19
+ r(l);
20
+ }
21
+ }, a = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(i, o);
22
+ a((t = t.apply(n, e)).next());
23
+ }), Xt = Object.defineProperty, Yt = Object.defineProperties, Zt = Object.getOwnPropertyDescriptors, Qe = Object.getOwnPropertySymbols, Qt = Object.prototype.hasOwnProperty, en = Object.prototype.propertyIsEnumerable, et = (n, e, t) => e in n ? Xt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, tn = (n, e) => {
24
+ for (var t in e || (e = {}))
25
+ Qt.call(e, t) && et(n, t, e[t]);
26
+ if (Qe)
27
+ for (var t of Qe(e))
28
+ en.call(e, t) && et(n, t, e[t]);
29
+ return n;
30
+ }, nn = (n, e) => Yt(n, Zt(e));
31
+ const me = (n, e, t, ...s) => {
32
+ const r = `[${n.get("$environment").name || "webprovisions"}] ${t}`;
33
+ switch (e) {
34
+ case "info":
35
+ console.info(r, ...s);
36
+ break;
37
+ case "warning":
38
+ console.warn(r, ...s);
39
+ break;
40
+ case "error":
41
+ console.error(r, ...s);
42
+ break;
43
+ }
44
+ }, sn = (n) => {
45
+ const e = n.container || n;
46
+ return {
47
+ info: (t, ...s) => me(e, "info", t, ...s),
48
+ warn: (t, ...s) => me(e, "warning", t, ...s),
49
+ error: (t, ...s) => me(e, "error", t, ...s)
50
+ };
51
+ };
52
+ var V = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(V || {}), E = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(E || {});
53
+ const rn = (n, e, t, s) => {
54
+ try {
55
+ const r = new e(t, s);
56
+ return {
57
+ name: n,
58
+ invoke: (i, o) => {
59
+ let a;
60
+ return r[i] && (a = r[i].call(r, o)), Promise.resolve(a);
61
+ },
62
+ getInstance: () => r
63
+ };
64
+ } catch (r) {
65
+ if (r.message && r.message.indexOf("is not a constructor") >= 0)
66
+ return {
67
+ name: n,
68
+ invoke: (i) => {
69
+ let o;
70
+ return i === "initialize" && (o = e(t, s)), Promise.resolve(o);
71
+ },
72
+ getInstance: () => e
73
+ };
74
+ throw r;
75
+ }
76
+ };
77
+ function tt(n, e) {
78
+ return typeof n == "undefined" ? e : n;
79
+ }
80
+ let on = class {
81
+ constructor(n = {}) {
82
+ this.part = n;
83
+ }
84
+ createCommand(n, e, t) {
85
+ let s;
86
+ typeof e == "function" ? s = {
87
+ scope: V.Widget,
88
+ stage: E.Post,
89
+ defaultArgs: void 0,
90
+ handlerResolver: e
91
+ } : s = {
92
+ scope: tt(e.scope, V.Widget),
93
+ stage: tt(e.stage, E.Post),
94
+ defaultArgs: e.defaultArgs,
95
+ handlerResolver: t
96
+ };
97
+ let r = this.part;
98
+ const i = n.split(".");
99
+ return i.forEach((o, a) => {
100
+ a === i.length - 1 ? r[o] || (r[o] = () => s) : r = this.part[o] = this.part[o] || {};
101
+ }), this;
102
+ }
103
+ get() {
104
+ return this.part;
105
+ }
106
+ };
107
+ const Et = (n) => {
108
+ const e = new on({});
109
+ return n(e), e.get();
110
+ };
111
+ Et((n) => {
112
+ n.createCommand(
113
+ "types.register",
114
+ { scope: V.Implementation, stage: E.Pre },
115
+ (e) => (t, s) => {
116
+ e.container.get("$types")[t] = s;
117
+ }
118
+ ).createCommand(
119
+ "type",
120
+ { stage: E.Pre },
121
+ (e) => (t) => {
122
+ e.container.register("$type", t);
123
+ }
124
+ ).createCommand(
125
+ "settings",
126
+ { stage: E.Pre, defaultArgs: [null] },
127
+ (e) => (t) => {
128
+ e.events.dispatch(
129
+ "settings:change",
130
+ t,
131
+ { bubbles: !0 }
132
+ ), e.container.register("$settings", t);
133
+ }
134
+ ).createCommand(
135
+ "plugin",
136
+ { stage: E.Pre },
137
+ (e) => (t, s, r) => {
138
+ const { container: i } = e;
139
+ let o = null, a = t, c = s;
140
+ typeof t == "string" && (o = t, a = s, c = r);
141
+ const l = (h) => {
142
+ const { transformPluginSettings: p } = e.container.get("$environmentOptions"), u = p ? p(
143
+ c || {},
144
+ o,
145
+ e.container,
146
+ a
147
+ ) : s;
148
+ try {
149
+ const d = rn(
150
+ o,
151
+ a,
152
+ i,
153
+ u
154
+ );
155
+ i.get("$plugins").push(d), h && d.invoke("initialize", null);
156
+ } catch (d) {
157
+ sn(e).warn("Error when initializing plugin", d);
158
+ }
159
+ };
160
+ e.container.get("$instance") ? l(!0) : e.events.subscribeOnce("widget:instance-created", () => l(!1));
161
+ }
162
+ ).createCommand(
163
+ "container.register",
164
+ (e) => (t, s) => {
165
+ e.container.register(t, s);
166
+ }
167
+ ).createCommand(
168
+ "container.registerAsync",
169
+ (e) => (t, s) => {
170
+ e.container.registerAsync(t, s);
171
+ }
172
+ ).createCommand(
173
+ "container.registerFactory",
174
+ (e) => (t, s) => {
175
+ e.container.registerFactory(t, s);
176
+ }
177
+ ).createCommand(
178
+ "container.touch",
179
+ (e) => (t, s) => {
180
+ e.container.touch(t, s);
181
+ }
182
+ ).createCommand(
183
+ "csp",
184
+ {},
185
+ (e) => (t) => {
186
+ e.container.register("csp", t);
187
+ }
188
+ );
189
+ });
190
+ Et((n) => {
191
+ n.createCommand(
192
+ "ready",
193
+ { scope: V.Implementation, stage: E.Pre },
194
+ (e) => (t) => {
195
+ const { container: s } = e, r = s.owner;
196
+ s.get("bootstrapping").ready ? t(r) : r.events.subscribeOnce("bootstrap:ready", () => {
197
+ t(r);
198
+ });
199
+ }
200
+ );
201
+ });
202
+ const fe = (n, e, t, ...s) => {
203
+ const r = `[${n.get("$environment").name || "webprovisions"}] ${t}`;
204
+ switch (e) {
205
+ case "info":
206
+ console.info(r, ...s);
207
+ break;
208
+ case "warning":
209
+ console.warn(r, ...s);
210
+ break;
211
+ case "error":
212
+ console.error(r, ...s);
213
+ break;
214
+ }
215
+ }, an = (n) => {
216
+ const e = n.container || n;
217
+ return {
218
+ info: (t, ...s) => fe(e, "info", t, ...s),
219
+ warn: (t, ...s) => fe(e, "warning", t, ...s),
220
+ error: (t, ...s) => fe(e, "error", t, ...s)
221
+ };
222
+ };
223
+ var te = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(te || {}), O = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(O || {});
224
+ const cn = (n, e, t, s) => {
225
+ try {
226
+ const r = new e(t, s);
227
+ return {
228
+ name: n,
229
+ invoke: (i, o) => {
230
+ let a;
231
+ return r[i] && (a = r[i].call(r, o)), Promise.resolve(a);
232
+ },
233
+ getInstance: () => r
234
+ };
235
+ } catch (r) {
236
+ if (r.message && r.message.indexOf("is not a constructor") >= 0)
237
+ return {
238
+ name: n,
239
+ invoke: (i) => {
240
+ let o;
241
+ return i === "initialize" && (o = e(t, s)), Promise.resolve(o);
242
+ },
243
+ getInstance: () => e
244
+ };
245
+ throw r;
246
+ }
247
+ };
248
+ function nt(n, e) {
249
+ return typeof n == "undefined" ? e : n;
250
+ }
251
+ class ln {
252
+ constructor(e = {}) {
253
+ this.part = e;
254
+ }
255
+ createCommand(e, t, s) {
256
+ let r;
257
+ typeof t == "function" ? r = {
258
+ scope: te.Widget,
259
+ stage: O.Post,
260
+ defaultArgs: void 0,
261
+ handlerResolver: t
262
+ } : r = {
263
+ scope: nt(t.scope, te.Widget),
264
+ stage: nt(t.stage, O.Post),
265
+ defaultArgs: t.defaultArgs,
266
+ handlerResolver: s
267
+ };
268
+ let i = this.part;
269
+ const o = e.split(".");
270
+ return o.forEach((a, c) => {
271
+ c === o.length - 1 ? i[a] || (i[a] = () => r) : i = this.part[a] = this.part[a] || {};
272
+ }), this;
273
+ }
274
+ get() {
275
+ return this.part;
276
+ }
277
+ }
278
+ const xt = (n) => {
279
+ const e = new ln({});
280
+ return n(e), e.get();
281
+ };
282
+ xt((n) => {
283
+ n.createCommand(
284
+ "types.register",
285
+ { scope: te.Implementation, stage: O.Pre },
286
+ (e) => (t, s) => {
287
+ e.container.get("$types")[t] = s;
288
+ }
289
+ ).createCommand(
290
+ "type",
291
+ { stage: O.Pre },
292
+ (e) => (t) => {
293
+ e.container.register("$type", t);
294
+ }
295
+ ).createCommand(
296
+ "settings",
297
+ { stage: O.Pre, defaultArgs: [null] },
298
+ (e) => (t) => {
299
+ e.events.dispatch(
300
+ "settings:change",
301
+ t,
302
+ { bubbles: !0 }
303
+ ), e.container.register("$settings", t);
304
+ }
305
+ ).createCommand(
306
+ "plugin",
307
+ { stage: O.Pre },
308
+ (e) => (t, s, r) => {
309
+ const { container: i } = e;
310
+ let o = null, a = t, c = s;
311
+ typeof t == "string" && (o = t, a = s, c = r);
312
+ const l = (h) => {
313
+ const { transformPluginSettings: p } = e.container.get("$environmentOptions"), u = p ? p(
314
+ c || {},
315
+ o,
316
+ e.container,
317
+ a
318
+ ) : s;
319
+ try {
320
+ const d = cn(
321
+ o,
322
+ a,
323
+ i,
324
+ u
325
+ );
326
+ i.get("$plugins").push(d), h && d.invoke("initialize", null);
327
+ } catch (d) {
328
+ an(e).warn("Error when initializing plugin", d);
329
+ }
330
+ };
331
+ e.container.get("$instance") ? l(!0) : e.events.subscribeOnce("widget:instance-created", () => l(!1));
332
+ }
333
+ ).createCommand(
334
+ "container.register",
335
+ (e) => (t, s) => {
336
+ e.container.register(t, s);
337
+ }
338
+ ).createCommand(
339
+ "container.registerAsync",
340
+ (e) => (t, s) => {
341
+ e.container.registerAsync(t, s);
342
+ }
343
+ ).createCommand(
344
+ "container.registerFactory",
345
+ (e) => (t, s) => {
346
+ e.container.registerFactory(t, s);
347
+ }
348
+ ).createCommand(
349
+ "container.touch",
350
+ (e) => (t, s) => {
351
+ e.container.touch(t, s);
352
+ }
353
+ ).createCommand(
354
+ "csp",
355
+ {},
356
+ (e) => (t) => {
357
+ e.container.register("csp", t);
358
+ }
359
+ );
360
+ });
361
+ const hn = (n) => {
362
+ const e = [];
363
+ return [
364
+ (t, s) => {
365
+ e.push(n.subscribe(t, s));
366
+ },
367
+ () => {
368
+ e.forEach((t) => {
369
+ t();
370
+ });
371
+ }
372
+ ];
373
+ };
374
+ let He = class {
375
+ constructor(n, e = []) {
376
+ this.platform = n, this.rules = e;
377
+ }
378
+ match(n) {
379
+ return this.rules.every((e) => !(e.id && e.id !== n.id || e.type && e.type !== n.type));
380
+ }
381
+ ofType(n) {
382
+ return this.rules.push({ type: n }), this;
383
+ }
384
+ withId(n) {
385
+ return this.rules.push({ id: n }), this;
386
+ }
387
+ select() {
388
+ return new pn(this.platform, this);
389
+ }
390
+ };
391
+ class Pt {
392
+ constructor(e, t, s) {
393
+ this.platform = e, this.node = t, this.actions = new Me(
394
+ e,
395
+ new He(e).withId(t.id),
396
+ s
397
+ );
398
+ const [r, i] = hn(
399
+ this.platform.events
400
+ );
401
+ this.subscribe = r, this.unsubscribe = i;
402
+ }
403
+ properties(e) {
404
+ return e && this.node.touchProperties((t) => e(t)), this.node.attributes.properties;
405
+ }
406
+ context(e) {
407
+ return e && this.subscribe("components:context-changed", (t, { node: s }) => {
408
+ s === this.node && e(this.node.attributes.context);
409
+ }), this.node.attributes.context;
410
+ }
411
+ layout(e) {
412
+ return e && this.subscribe("components:layout-changed", (t, { node: s }) => {
413
+ s === this.node && e(this.node.attributes.layout);
414
+ }), this.node.attributes.layout;
415
+ }
416
+ writeProperties(e, t) {
417
+ this.node.writeProperties(e, t);
418
+ }
419
+ writeContext(e, t) {
420
+ this.node.writeProperties(e, t);
421
+ }
422
+ writeLayout(e, t) {
423
+ this.node.writeLayout(e, t);
424
+ }
425
+ dispose() {
426
+ this.unsubscribe(), this.actions.dispose();
427
+ }
428
+ }
429
+ class pn {
430
+ constructor(e, t, s = !0) {
431
+ this.platform = e, this.target = t, this.clearOnDispose = s, this.removes = [], this.actions = new Me(this.platform, this.target);
432
+ }
433
+ writeProperties(e, t) {
434
+ this.removes.push(
435
+ this.platform.write({
436
+ options: t,
437
+ attributes: { properties: e },
438
+ target: this.target,
439
+ removable: this.clearOnDispose
440
+ })
441
+ );
442
+ }
443
+ writeContext(e, t) {
444
+ this.removes.push(
445
+ this.platform.write({
446
+ options: t,
447
+ attributes: { context: e },
448
+ target: this.target,
449
+ removable: this.clearOnDispose
450
+ })
451
+ );
452
+ }
453
+ writeLayout(e, t) {
454
+ this.removes.push(
455
+ this.platform.write({
456
+ options: t,
457
+ attributes: { layout: e },
458
+ target: this.target,
459
+ removable: this.clearOnDispose
460
+ })
461
+ );
462
+ }
463
+ dispose() {
464
+ this.removes.forEach((e) => {
465
+ e();
466
+ }), this.actions.dispose();
467
+ }
468
+ }
469
+ const dn = (n, e, t) => {
470
+ const s = n.concat(), r = (i, o, a) => {
471
+ let c = !0;
472
+ if (s.length) {
473
+ const l = s.shift(), h = (p, u) => (c = !1, r(p, Object.assign({}, o, u), a));
474
+ return Promise.resolve(l(i, h, a)).then((p) => nn(tn({}, p), {
475
+ cancelled: c
476
+ }));
477
+ }
478
+ return Promise.resolve({ data: i, cancelled: !1, options: o });
479
+ };
480
+ return r(e, {}, t);
481
+ };
482
+ class Me {
483
+ constructor(e, t, s) {
484
+ this.platform = e, this.target = t, this.ns = s, this.subscriptions = [], this.create = this.create.bind(this);
485
+ }
486
+ create(e, t = () => {
487
+ }) {
488
+ const s = {
489
+ key: e,
490
+ fn: t,
491
+ target: this.target,
492
+ ns: this.ns
493
+ };
494
+ this.platform.actionsState.handlers.push(s);
495
+ const r = () => {
496
+ const i = this.platform.actionsState.handlers.indexOf(s);
497
+ i > -1 && this.platform.actionsState.handlers.splice(i, 1);
498
+ };
499
+ return this.subscriptions.push(r), r;
500
+ }
501
+ dispatch(e, t) {
502
+ const s = this.platform.nodes.all.concat(
503
+ this.platform.nodes.detached
504
+ ), r = {}, i = this.platform.actionsState.handlers.filter(
505
+ (o) => o.key === e && (!o.ns || !this.ns || o.ns === this.ns)
506
+ );
507
+ return Promise.all(
508
+ i.map((o) => {
509
+ const a = s.filter(
510
+ (l) => o.target.match(l) && this.target.match(l)
511
+ ), c = this.platform.actionsState.watchers.filter((l) => l.key === e && (!l.ns || !this.ns || l.ns === this.ns) && a.some((h) => l.target.match(h))).map((l) => l.fn);
512
+ return Promise.all(
513
+ a.map((l) => {
514
+ const h = new Pt(
515
+ this.platform,
516
+ l,
517
+ this.ns
518
+ );
519
+ return dn(c, t, h).then((p) => {
520
+ const { data: u = {}, options: d, cancelled: b } = p;
521
+ return Promise.resolve(
522
+ b ? {} : o.fn(u, d, h)
523
+ ).then((y) => {
524
+ r[l.id] = y;
525
+ });
526
+ });
527
+ })
528
+ );
529
+ })
530
+ ).then(() => r);
531
+ }
532
+ watch(e, t) {
533
+ let s = e, r = this.ns;
534
+ const i = e.split(".");
535
+ i.length > 1 && (r = i[0], s = i.splice(1).join("."));
536
+ const o = {
537
+ fn: t,
538
+ target: this.target,
539
+ key: s,
540
+ ns: r
541
+ };
542
+ this.platform.actionsState.watchers.push(o);
543
+ const a = () => {
544
+ const c = this.platform.actionsState.watchers.indexOf(o);
545
+ c > -1 && this.platform.actionsState.watchers.splice(c, 1);
546
+ };
547
+ return this.subscriptions.push(a), a;
548
+ }
549
+ dispose() {
550
+ this.subscriptions.forEach((e) => e());
551
+ }
552
+ }
553
+ xt((n) => {
554
+ n.createCommand("components", (e) => (t) => {
555
+ e.events.subscribeOnce(
556
+ "components:platform-created",
557
+ (s, { platform: r }) => {
558
+ t.handlers && t.handlers.forEach(([i, o]) => {
559
+ r.addComponentHandler(i, o);
560
+ });
561
+ }
562
+ );
563
+ });
564
+ });
565
+ const ae = (n, e, ...t) => typeof e == "string" ? n(`[humany] ${e}`, ...t) : n(e, ...t), L = class {
566
+ constructor() {
567
+ this.keys = [], this.log = (n, ...e) => this.lookup(n, () => L.log(...e)), this.warn = (n, ...e) => this.lookup(n, () => L.warn(...e)), this.error = (n, ...e) => this.lookup(n, () => L.error(...e)), this.info = (n, ...e) => this.lookup(n, () => L.info(...e));
568
+ }
569
+ lookup(n, e) {
570
+ this.keys.indexOf(n) === -1 && (this.keys.push(n), e());
571
+ }
572
+ };
573
+ let G = L;
574
+ G.log = (...n) => ae(console.log, ...n);
575
+ G.warn = (...n) => ae(console.warn, ...n);
576
+ G.error = (...n) => ae(console.error, ...n);
577
+ G.info = (...n) => ae(console.info, ...n);
578
+ const A = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
579
+ function ze() {
580
+ return A() + A() + "-" + A() + "-" + A() + "-" + A() + "-" + A() + A() + A();
581
+ }
582
+ class st {
583
+ constructor(e, t) {
584
+ this.events = e, this.tags = [], this.children = {}, this.changesets = [], this.mountCount = 0, this.id = ze(), this.type = t, this.attributes = {
585
+ context: {},
586
+ properties: {},
587
+ layout: {},
588
+ tags: []
589
+ }, this.writeLayout({ size: "full", indent: 0 });
590
+ }
591
+ mount(e, t) {
592
+ let s = e.get("mounted-nodes");
593
+ return s || (s = /* @__PURE__ */ new Map(), e.register("mounted-nodes", s)), s.has(this) ? (process.env.NODE_ENV !== "production" && G.error(
594
+ "Trying to mount an already mounted component node.",
595
+ this
596
+ ), () => {
597
+ }) : (this.events.dispatch("components:node-mounted", { node: this }), this.mountCount === 0 && (this.mountCount = this.mountCount + 1, this.events.dispatch("components:node-enter", { node: this })), () => {
598
+ s.delete(this), this.events.dispatch("components:node-unmounted", { node: this }), this.mountCount = this.mountCount - 1, this.mountCount === 0 && this.events.dispatch("components:node-exit", { node: this });
599
+ });
600
+ }
601
+ appendChild(e, t = "default") {
602
+ if (e.parent) {
603
+ if (e.parent === this)
604
+ return;
605
+ e.parent.removeChild(e);
606
+ }
607
+ e.parent = this, this.children[t] || (this.children[t] = []), this.children[t].push(e), this.events.dispatch("components:node-appended", { node: e });
608
+ }
609
+ prependChild(e, t = "default") {
610
+ if (e.parent) {
611
+ if (e.parent === this)
612
+ return;
613
+ e.parent.removeChild(e);
614
+ }
615
+ e.parent = this, this.children[t] || (this.children[t] = []), this.children[t].unshift(e), this.events.dispatch("components:node-appended", { node: e });
616
+ }
617
+ touchProperties(e, t = {}, s) {
618
+ const r = [{ properties: e }, t];
619
+ return this.changesets.push(r), this.events.dispatch("components:set-properties", { node: this }), () => {
620
+ if (s) {
621
+ const i = this.changesets.indexOf(r);
622
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-properties", { node: this }));
623
+ }
624
+ };
625
+ }
626
+ writeProperties(e, t = {}, s) {
627
+ const r = [{ properties: e }, t];
628
+ return this.changesets.push(r), this.events.dispatch("components:set-properties", { node: this }), () => {
629
+ if (s) {
630
+ const i = this.changesets.indexOf(r);
631
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-properties", { node: this }));
632
+ }
633
+ };
634
+ }
635
+ writeLayout(e, t = {}, s) {
636
+ const r = [{ layout: e }, t];
637
+ return this.changesets.push(r), this.events.dispatch("components:set-layout", { node: this }), () => {
638
+ if (!s)
639
+ return;
640
+ const i = this.changesets.indexOf(r);
641
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-layout", { node: this }));
642
+ };
643
+ }
644
+ writeContext(e, t = {}, s) {
645
+ const r = [{ context: e }, t];
646
+ return this.changesets.push(r), this.events.dispatch("components:set-context", { node: this }), () => {
647
+ if (!s)
648
+ return;
649
+ const i = this.changesets.indexOf(r);
650
+ i > -1 && (this.changesets.splice(i, 1), this.events.dispatch("components:set-context", { node: this }));
651
+ };
652
+ }
653
+ getChildren(e = "default") {
654
+ const t = this.children[e] || [];
655
+ return t.reduce((s, r, i) => {
656
+ const { order: o = i } = r.attributes.layout;
657
+ return s[o] ? s.splice(o, 0, r) : s[o] = r, s;
658
+ }, Array(t.length));
659
+ }
660
+ remove() {
661
+ this.parent && this.parent.removeChild(this);
662
+ }
663
+ removeChild(e) {
664
+ Object.keys(this.children).forEach((t) => {
665
+ const s = this.children[t], r = s.indexOf(e);
666
+ r > -1 && (s.splice(r, 1), this.events.dispatch("components:node-removed", {
667
+ node: e,
668
+ parentNode: this
669
+ }));
670
+ }), delete e.parent;
671
+ }
672
+ }
673
+ const Ot = (n, e, t) => {
674
+ for (let s = 0, r = n.length; s < r && t(n[s]) !== !0; s++) {
675
+ const i = e[n[s].id] || "default", o = n[s].getChildren(i);
676
+ Ot(o, e, t);
677
+ }
678
+ }, De = (n, e, t) => {
679
+ if (t(n) !== !0) {
680
+ const s = e[n.id] || "default", r = n.children[s];
681
+ Ot(r, e, t);
682
+ }
683
+ }, ve = (n, e) => {
684
+ const t = [];
685
+ return De(n, e, (s) => {
686
+ t.push(s);
687
+ }), t;
688
+ }, un = (n, e, t) => {
689
+ let s;
690
+ return De(n, e, (r) => {
691
+ if (t(r))
692
+ return s = r, !0;
693
+ }), s;
694
+ };
695
+ class gn {
696
+ constructor(e, t, s) {
697
+ this.root = e, this.switches = t, this.all = [], this.visible = [], this.detached = [], s.subscribe(
698
+ "components:node-appended",
699
+ (r, i) => {
700
+ this.all.push(i.node), this.visible = ve(e, t);
701
+ }
702
+ ), s.subscribe(
703
+ "components:node-removed",
704
+ (r, i) => {
705
+ let o = this.all.indexOf(i.node);
706
+ o > -1 && this.all.splice(o, 1), o = this.visible.indexOf(i.node), o > -1 && this.visible.splice(o, 1), this.visible = ve(e, t);
707
+ }
708
+ ), s.subscribe(
709
+ "components:node-switched",
710
+ (r, i) => {
711
+ this.visible = ve(e, t);
712
+ }
713
+ );
714
+ }
715
+ query(e = {}) {
716
+ const t = [];
717
+ return De(this.root, this.switches, (s) => {
718
+ Object.keys(e).every((r) => e[r] === s[r]) && t.push(s);
719
+ }), t;
720
+ }
721
+ get(e) {
722
+ return un(this.root, this.switches, (t) => t.id === e) || this.detached.find((t) => t.id === e);
723
+ }
724
+ }
725
+ class mn {
726
+ constructor() {
727
+ this.handlers = /* @__PURE__ */ new Map();
728
+ }
729
+ add(e, t) {
730
+ this.handlers.set(e, t);
731
+ }
732
+ get(e) {
733
+ return this.handlers.get(e);
734
+ }
735
+ }
736
+ const fn = (n) => {
737
+ let e = n, t = 0;
738
+ for (; e.parent; )
739
+ t = t + 1, e = e.parent;
740
+ return t;
741
+ }, vn = (n) => n.map(([e, t]) => [fn(e), e, t]).sort(([e], [t]) => e - t).map(([, e, t]) => [e, t]), ye = (n) => n instanceof Date ? !1 : n && typeof n == "object" && !Array.isArray(n), w = (n, ...e) => {
742
+ if (!e.length)
743
+ return n;
744
+ const t = e.shift();
745
+ if (ye(n) && ye(t))
746
+ for (const s in t)
747
+ ye(t[s]) ? (n[s] || Object.assign(n, { [s]: {} }), w(n[s], t[s])) : Object.assign(n, { [s]: t[s] });
748
+ return w(n, ...e);
749
+ }, yn = (n, e) => !n || n === "all" ? !0 : n.some((t) => e.indexOf(t) > -1), bn = (n, e) => {
750
+ let t = [], s = [], r;
751
+ const i = () => {
752
+ process.env.NODE_ENV !== "production" && console.time("state-processor.flush");
753
+ const a = /* @__PURE__ */ new Map(), c = vn(t.map((h, p) => [h, s[p]])), l = (h, p) => {
754
+ var u;
755
+ const d = a.get(h) || {}, b = p.context && !d.context, y = p.properties && !d.properties, ue = p.layout && !d.layout;
756
+ a.set(h, {
757
+ context: d.context || b,
758
+ properties: d.properties || y,
759
+ layout: d.layout || ue
760
+ }), y && (h.attributes.properties = {}), ue && (h.attributes.layout = {}), b && (h.attributes.context = w({}, (u = h.parent) == null ? void 0 : u.attributes.context));
761
+ const qe = [], Ge = [], Xe = [];
762
+ if (h.changesets.forEach(($) => {
763
+ const [f, ge] = $;
764
+ yn(ge.breakpoints, n.breakpoints) && (y && (typeof f.properties == "function" ? qe.push(
765
+ f.properties
766
+ ) : w(h.attributes.properties, f.properties)), ue && (typeof f.layout == "function" ? Ge.push(f.layout) : w(h.attributes.layout, f.layout)), b && (typeof f.context == "function" ? Xe.push(f.context) : w(h.attributes.context, f.context)));
767
+ }), qe.forEach(($) => {
768
+ w(h.attributes.properties, $(h.attributes.properties));
769
+ }), Ge.forEach(($) => {
770
+ w(h.attributes.layout, $(h.attributes.layout));
771
+ }), Xe.forEach(($) => {
772
+ w(h.attributes.context, $(h.attributes.context));
773
+ }), b || p.recursive) {
774
+ const $ = n.getBranch(h), f = p.recursive ? p : {
775
+ context: !!b
776
+ };
777
+ h.getChildren($).forEach((ge) => {
778
+ l(ge, f);
779
+ });
780
+ }
781
+ };
782
+ process.env.NODE_ENV !== "production" && console.timeEnd("state-processor.flush"), c.forEach(([h, p]) => {
783
+ l(h, p);
784
+ }), t = [], s = [], e(a);
785
+ }, o = () => {
786
+ clearTimeout(r), r = setTimeout(i, 0);
787
+ };
788
+ return (a, c) => {
789
+ const l = t.indexOf(a);
790
+ if (l > -1) {
791
+ const h = s[l];
792
+ return c.context && (h.context = !0), c.properties && (h.properties = !0), c.layout && (h.layout = !0), c.recursive && (h.recursive = !0), o();
793
+ }
794
+ return t.push(a), s.push(c), o();
795
+ };
796
+ };
797
+ class $n {
798
+ constructor(e, t = {}) {
799
+ this.providers = t, this.breakpoints = [], this.actionsState = { handlers: [], watchers: [] }, this.switches = {}, this.changesets = [], this.subscriptions = [], this.customComponentHandler = new mn(), this.events = e.events.createChild(this);
800
+ const s = new st(this.events, "root");
801
+ s.name = `root-${e.name}`, this.nodes = new gn(s, this.switches, this.events);
802
+ const r = this.processNode = bn(
803
+ this,
804
+ (i) => {
805
+ const o = Array.from(i.keys());
806
+ process.env.NODE_ENV !== "production" && console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
807
+ ${o.map(
808
+ (a) => `${a.name || "<no name>"} (${a.id})
809
+ `
810
+ )}`), o.forEach((a) => {
811
+ const c = i.get(a);
812
+ 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 });
813
+ }), this.events.dispatch(
814
+ "components:component-model-initialized",
815
+ {},
816
+ { bubbles: !0 }
817
+ );
818
+ }
819
+ );
820
+ Promise.all(
821
+ Object.keys(t).map((i) => t[i].load(this))
822
+ ), this.subscriptions.push(
823
+ this.events.subscribe(
824
+ "components:node-appended",
825
+ (i, o) => {
826
+ const { node: a } = o;
827
+ this.changesets.forEach((c) => {
828
+ const { changeset: l, target: h, removes: p } = c, [u, d] = l;
829
+ h.match(o.node) && (u.properties && p.push(a.writeProperties(u.properties, d)), u.context && p.push(a.writeContext(u.context, d)), u.layout && p.push(a.writeLayout(u.layout, d)));
830
+ });
831
+ }
832
+ )
833
+ ), this.subscriptions.push(
834
+ this.events.subscribe(
835
+ "components:node-appended",
836
+ (i, o) => {
837
+ r(o.node, { properties: !0, context: !0 });
838
+ }
839
+ )
840
+ ), this.subscriptions.push(
841
+ this.events.subscribe(
842
+ "components:set-properties",
843
+ (i, o) => {
844
+ r(o.node, { properties: !0 });
845
+ }
846
+ )
847
+ ), this.subscriptions.push(
848
+ this.events.subscribe(
849
+ "components:set-context",
850
+ (i, o) => {
851
+ r(o.node, { properties: !0, context: !0 });
852
+ }
853
+ )
854
+ ), this.subscriptions.push(
855
+ this.events.subscribe(
856
+ "components:set-indent",
857
+ (i, o) => {
858
+ r(o.node, { layout: !0 });
859
+ }
860
+ )
861
+ ), this.subscriptions.push(
862
+ this.events.subscribe(
863
+ "components:set-layout",
864
+ (i, o) => {
865
+ r(o.node, { layout: !0 });
866
+ }
867
+ )
868
+ ), this.subscriptions.push(
869
+ this.events.subscribe(
870
+ "components:node-switched",
871
+ (i, { node: o, branch: a }) => {
872
+ r(o, {
873
+ layout: !0,
874
+ recursive: !0,
875
+ properties: !0,
876
+ context: !0
877
+ });
878
+ }
879
+ )
880
+ ), this.subscriptions.push(
881
+ this.events.subscribe(
882
+ "components:node-removed",
883
+ (i, { parentNode: o }) => {
884
+ r(o, { properties: !0 });
885
+ }
886
+ )
887
+ ), this.events.parent && this.events.parent.dispatch("components:platform-created", {
888
+ platform: this
889
+ });
890
+ }
891
+ static getInstance(e) {
892
+ return e.getAsync("components");
893
+ }
894
+ addBreakpoint(e) {
895
+ this.breakpoints.indexOf(e) === -1 && (this.breakpoints.push(e), this.processNode(this.nodes.root, {
896
+ context: !0,
897
+ properties: !0,
898
+ layout: !0,
899
+ recursive: !0
900
+ }));
901
+ }
902
+ removeBreakpoint(e) {
903
+ const t = this.breakpoints.indexOf(e);
904
+ t > -1 && (this.breakpoints.splice(t, 1), this.processNode(this.nodes.root, {
905
+ context: !0,
906
+ properties: !0,
907
+ layout: !0,
908
+ recursive: !0
909
+ }));
910
+ }
911
+ setSwitch(e, t) {
912
+ this.switches[e.id] = t, this.events.dispatch("components:node-switched", { node: e, branch: t });
913
+ }
914
+ getBranch(e) {
915
+ return this.switches[e.id];
916
+ }
917
+ /**
918
+ * Creates a `ComponentNode` of the specified type.
919
+ * @param type Type of node.
920
+ */
921
+ createNode(e, t = {}) {
922
+ const s = new st(this.events, e);
923
+ return t.detached && this.nodes.detached.push(s), s;
924
+ }
925
+ components() {
926
+ return new He(this);
927
+ }
928
+ actions(e, t) {
929
+ return new Me(this, e, t);
930
+ }
931
+ write(e) {
932
+ const {
933
+ provider: t,
934
+ target: s,
935
+ attributes: r,
936
+ options: i = {},
937
+ removable: o
938
+ } = e, a = e.key || ze(), c = { changeset: [r, i], target: s, removes: [] };
939
+ if (t) {
940
+ const l = this.providers[t];
941
+ l.write(a, s, r, i), c.removes.push(() => {
942
+ l.remove(a);
943
+ });
944
+ }
945
+ return this.changesets.push(c), this.nodes.all.forEach((l) => {
946
+ if (s.match(l)) {
947
+ let h = () => {
948
+ };
949
+ r.properties && (h = l.writeProperties(
950
+ r.properties,
951
+ i,
952
+ o
953
+ )), r.context && (h = l.writeContext(r.context, i, o)), r.layout && (h = l.writeContext(r.layout, i, o)), c.removes.push(h);
954
+ }
955
+ }), () => {
956
+ if (o) {
957
+ c.removes.forEach((h) => h());
958
+ const l = this.changesets.indexOf(c);
959
+ l > -1 && this.changesets.splice(l, 1);
960
+ }
961
+ };
962
+ }
963
+ addComponentHandler(e, t) {
964
+ this.customComponentHandler.add(e, t);
965
+ }
966
+ getComponentHandler(e) {
967
+ return this.customComponentHandler.get(e);
968
+ }
969
+ dispose() {
970
+ this.subscriptions.forEach((e) => e());
971
+ }
972
+ }
973
+ const wn = (n, e, t, s = ze(), r = {}) => n.getAsync("components").then((i) => {
974
+ let o;
975
+ if (typeof e == "string") {
976
+ const l = new He(i);
977
+ l.ofType(e), o = l;
978
+ } else
979
+ o = e;
980
+ const a = {}, c = (l) => {
981
+ const h = a[l.id];
982
+ return h ? Promise.resolve(h.controller) : $n.getInstance(n).then((p) => new Pt(p, l, s));
983
+ };
984
+ i.events.subscribe(
985
+ "components:node-enter",
986
+ (l, { node: h }) => {
987
+ o.match(h) && c(h).then((p) => {
988
+ Promise.resolve(t(p)).then((u) => {
989
+ a[h.id] = {
990
+ dispose: u,
991
+ controller: p
992
+ };
993
+ });
994
+ });
995
+ }
996
+ ), i.events.subscribe(
997
+ "components:node-exit",
998
+ (l, { node: h }) => {
999
+ const p = a[h.id];
1000
+ p && (p.dispose && p.dispose(), r.reuseController || (p.controller.dispose(), delete a[h.id]));
1001
+ }
1002
+ );
1003
+ }), ce = (n, e, ...t) => typeof e == "string" ? n(`[humany] ${e}`, ...t) : n(e, ...t), W = class {
1004
+ constructor() {
1005
+ this.keys = [], this.log = (n, ...e) => this.lookup(n, () => W.log(...e)), this.warn = (n, ...e) => this.lookup(n, () => W.warn(...e)), this.error = (n, ...e) => this.lookup(n, () => W.error(...e)), this.info = (n, ...e) => this.lookup(n, () => W.info(...e));
1006
+ }
1007
+ lookup(n, e) {
1008
+ this.keys.indexOf(n) === -1 && (this.keys.push(n), e());
1009
+ }
1010
+ };
1011
+ let v = W;
1012
+ v.log = (...n) => ce(console.log, ...n);
1013
+ v.warn = (...n) => ce(console.warn, ...n);
1014
+ v.error = (...n) => ce(console.error, ...n);
1015
+ v.info = (...n) => ce(console.info, ...n);
1016
+ const St = (n) => {
1017
+ let e = {}, t, s;
1018
+ if (typeof n != "object" || n === null)
1019
+ return n;
1020
+ e = Array.isArray(n) ? [] : {};
1021
+ for (s in n)
1022
+ t = n[s], e[s] = typeof t == "object" && t !== null ? St(t) : t;
1023
+ return e;
1024
+ }, _n = St;
1025
+ function rt(n) {
1026
+ let e = 0;
1027
+ if (n.length === 0)
1028
+ return e.toString();
1029
+ for (let t = 0; t < n.length; t++) {
1030
+ const s = n.charCodeAt(t);
1031
+ e = (e << 5) - e + s, e = e & e;
1032
+ }
1033
+ return e.toString();
1034
+ }
1035
+ let An = class {
1036
+ constructor(n, e) {
1037
+ this.lockWarningTime = n, this.lockErrorTime = e, this.tasks = [], this.current = Promise.resolve(), this.next = this.next.bind(this);
1038
+ }
1039
+ add(n, e, t, s) {
1040
+ this.tasks.push({ task: n, resolve: e, reject: t, done: s }), this.next();
1041
+ }
1042
+ next() {
1043
+ this.current = this.current.then(() => {
1044
+ const n = this.tasks.shift();
1045
+ if (n) {
1046
+ let e;
1047
+ const t = setTimeout(() => {
1048
+ process.env.NODE_ENV !== "production" && v.warn(
1049
+ `A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,
1050
+ n
1051
+ ), e = setTimeout(() => {
1052
+ n.reject("lock timeout exceeded");
1053
+ }, this.lockErrorTime);
1054
+ }, this.lockWarningTime), s = Promise.resolve(n.task()).then((r) => (clearTimeout(t), clearTimeout(e), r));
1055
+ return Promise.resolve(s).then(this.next).then(
1056
+ () => s.then((r) => {
1057
+ n.done(), n.resolve(r);
1058
+ })
1059
+ ).catch((r) => (n.done(), n.reject(r), this.next()));
1060
+ }
1061
+ return Promise.resolve();
1062
+ });
1063
+ }
1064
+ };
1065
+ const Y = /* @__PURE__ */ new WeakMap();
1066
+ function le(n, e = 5e3, t = 1e3) {
1067
+ return Y.has(n) || Y.set(n, new An(e, t)), (s) => new Promise((r, i) => {
1068
+ const o = Y.get(n);
1069
+ o.add(s, r, i, () => {
1070
+ o.tasks.length || Y.delete(n);
1071
+ });
1072
+ });
1073
+ }
1074
+ var Cn = Object.defineProperty, it = Object.getOwnPropertySymbols, En = Object.prototype.hasOwnProperty, xn = Object.prototype.propertyIsEnumerable, ot = (n, e, t) => e in n ? Cn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, U = (n, e) => {
1075
+ for (var t in e || (e = {}))
1076
+ En.call(e, t) && ot(n, t, e[t]);
1077
+ if (it)
1078
+ for (var t of it(e))
1079
+ xn.call(e, t) && ot(n, t, e[t]);
1080
+ return n;
1081
+ }, _ = /* @__PURE__ */ ((n) => (n.Cookie = "cookie", n.Local = "local", n.Session = "session", n))(_ || {}), Le = /* @__PURE__ */ ((n) => (n.Tenant = "tenant", n.Implementation = "implementation", n.Widget = "widget", n))(Le || {}), m = /* @__PURE__ */ ((n) => (n.Necessary = "necessary", n.Functional = "functional", n.Analytical = "analytical", n.Marketing = "marketing", n))(m || {});
1082
+ const Pn = (n, e, t, s = {}) => at(n, t).then((r) => (process.env.NODE_ENV !== "production" && r && v.warn(
1083
+ `createStorageWriter: Attempted to create storage writer using unallowed category.
1084
+ Key: ${e}
1085
+ Category: ${JSON.stringify(t)}
1086
+ Options: ${JSON.stringify(s)}`
1087
+ ), (i) => (Be(n), at(n, t).then((o) => {
1088
+ if (o) {
1089
+ process.env.NODE_ENV !== "production" && v.warn(
1090
+ `storageWriter: Attempted to write to storage using unallowed category.
1091
+ Key: ${e}
1092
+ Category: ${JSON.stringify(t)}
1093
+ Value: ${JSON.stringify(i)}
1094
+ Options: ${JSON.stringify(s)}`
1095
+ );
1096
+ return;
1097
+ }
1098
+ const {
1099
+ scope: a = Le.Widget,
1100
+ medium: c = _.Session,
1101
+ duration: l
1102
+ } = s, h = kn();
1103
+ return h[a][e] = Tt(i, t, l), c === _.Cookie ? Un(n, h) : Hn(n, c, h);
1104
+ })))), On = (n, e, t = _.Session) => (Be(n), typeof e == "undefined" ? (process.env.NODE_ENV !== "production" && v.warn("readStorage: Undefined key passed when reading storage. ", e, t), Promise.resolve(void 0)) : t === _.Cookie ? In(n).then((s) => je(s, e)) : Rn(n, t).then((s) => je(s, e))), H = (n) => !!Object.entries(n).filter(([e, t]) => typeof t != "undefined").length, be = (n) => Object.entries(n).filter(([e, t]) => typeof t != "undefined").forEach(([e, { value: t }]) => {
1105
+ typeof t == "undefined" && delete n[e];
1106
+ }), kt = (n, e) => {
1107
+ const t = {
1108
+ tenant: U(U({}, n.tenant), e.tenant),
1109
+ implementation: U(U({}, n.implementation), e.implementation),
1110
+ widget: U(U({}, n.widget), e.widget)
1111
+ };
1112
+ return be(t.tenant), be(t.implementation), be(t.widget), t;
1113
+ }, Sn = (n) => Object.entries(n).reduce((e, t) => {
1114
+ const [s, r] = t;
1115
+ return Object.entries(r).forEach((i) => {
1116
+ const [o, { expiration: a }] = i;
1117
+ a && e.push(a);
1118
+ }), e;
1119
+ }, []).slice().sort((e, t) => new Date(t).valueOf() - new Date(e).valueOf()).shift() || Ve(), he = (n) => {
1120
+ const {
1121
+ name: e,
1122
+ implementation: { name: t, tenant: s }
1123
+ } = n.get("$widget");
1124
+ return [
1125
+ `humany_${s}`,
1126
+ `humany_${rt(s + t)}`,
1127
+ `humany_${rt(s + t + e)}`
1128
+ ];
1129
+ }, $e = (n) => {
1130
+ const e = new RegExp(`(?:^|;)\\s?${n}=(.*?)(?:;|$)`, "i"), t = document.cookie.match(e);
1131
+ return t && t[1] && JSON.parse(t[1]) || void 0;
1132
+ }, we = (n, e, t) => {
1133
+ const s = `${n}=${JSON.stringify(e).trim()}`, r = `expires=${new Date(t).toUTCString()}`, i = "path=/", o = "SameSite=None;Secure";
1134
+ return document.cookie = `${s}; ${r}; ${i}; ${o}`;
1135
+ }, We = (n) => {
1136
+ const [e, t, s] = he(n), r = $e(e) || {}, i = $e(t) || {}, o = $e(s) || {};
1137
+ return {
1138
+ tenant: r,
1139
+ implementation: i,
1140
+ widget: o
1141
+ };
1142
+ }, Nt = (n, e) => {
1143
+ const t = We(n), s = kt(t, e), [r, i, o] = he(n), { tenant: a, implementation: c, widget: l } = s, h = Sn(e), p = Ve({ days: -1 });
1144
+ we(r, a, H(a) ? h : p), we(
1145
+ i,
1146
+ c,
1147
+ H(c) ? h : p
1148
+ ), we(o, l, H(l) ? h : p);
1149
+ }, ne = (n, e) => {
1150
+ const [t, s, r] = he(n), i = e.getItem(t) || "{}", o = e.getItem(s) || "{}", a = e.getItem(r) || "{}";
1151
+ return {
1152
+ tenant: JSON.parse(i),
1153
+ implementation: JSON.parse(o),
1154
+ widget: JSON.parse(a)
1155
+ };
1156
+ }, Te = (n, e, t) => {
1157
+ const s = ne(n, e), r = kt(s, t), [i, o, a] = he(n), { tenant: c, implementation: l, widget: h } = r;
1158
+ H(c) ? e.setItem(i, JSON.stringify(c)) : e.removeItem(i), H(l) ? e.setItem(o, JSON.stringify(l)) : e.removeItem(o), H(h) ? e.setItem(a, JSON.stringify(h)) : e.removeItem(a);
1159
+ }, kn = () => ({ tenant: {}, implementation: {}, widget: {} }), Nn = (n) => n ? !!n && /* @__PURE__ */ new Date() > new Date(n) : !1, je = (n, e) => {
1160
+ const t = n.widget[e] || n.implementation[e] || n.tenant[e];
1161
+ return t == null ? void 0 : t.value;
1162
+ }, Tt = (n, e, t) => t ? {
1163
+ value: n,
1164
+ category: e,
1165
+ expiration: typeof t == "object" ? Ve(t) : t
1166
+ } : {
1167
+ value: n,
1168
+ category: e
1169
+ }, Tn = (n, e) => {
1170
+ const t = _n(n);
1171
+ return Object.entries(t).forEach(([s, r]) => {
1172
+ Object.entries(r).forEach(([i, o]) => {
1173
+ const { expiration: a, category: c } = o;
1174
+ (Nn(a) || jn(e, c)) && (r[i] = Tt(void 0, c, a));
1175
+ });
1176
+ }), t;
1177
+ }, at = (n, e) => On(n, "storagePolicy", _.Cookie).then(
1178
+ (t = [m.Necessary]) => !!e && t.indexOf(e) === -1
1179
+ ), jn = (n = [m.Necessary], e) => !!e && n.indexOf(e) === -1, Be = (n) => {
1180
+ const e = We(n), t = ne(n, window.localStorage), s = ne(n, sessionStorage), r = je(e, "storagePolicy"), [i, o, a] = [
1181
+ e,
1182
+ t,
1183
+ s
1184
+ ].map((c) => Tn(c, r));
1185
+ Nt(n, i), Te(n, window.localStorage, o), Te(n, window.sessionStorage, a);
1186
+ }, Ve = (n = { days: 30 }) => {
1187
+ const { days: e = 0, hours: t = 0, minutes: s = 0, seconds: r = 0 } = n, i = /* @__PURE__ */ new Date();
1188
+ return i.setTime(i.getTime() + t * 60 * 60 * 1e3), i.setTime(i.getTime() + e * 24 * 60 * 60 * 1e3), i.setTime(i.getTime() + s * 60 * 1e3), i.setTime(i.getTime() + r * 1e3), i.toISOString();
1189
+ }, In = (n) => le(document)(() => We(n)), Un = (n, e) => le(document)(() => Nt(n, e)), Rn = (n, e) => {
1190
+ const t = e === _.Local ? window.localStorage : window.sessionStorage;
1191
+ return le(t)(() => ne(n, t));
1192
+ }, Hn = (n, e, t) => {
1193
+ const s = e === _.Local ? window.localStorage : window.sessionStorage;
1194
+ return le(s)(() => Te(n, s, t));
1195
+ }, _e = (n, e, t, ...s) => {
1196
+ const r = `[${n.get("$environment").name || "webprovisions"}] ${t}`;
1197
+ switch (e) {
1198
+ case "info":
1199
+ console.info(r, ...s);
1200
+ break;
1201
+ case "warning":
1202
+ console.warn(r, ...s);
1203
+ break;
1204
+ case "error":
1205
+ console.error(r, ...s);
1206
+ break;
1207
+ }
1208
+ }, Mn = (n) => {
1209
+ const e = n.container || n;
1210
+ return {
1211
+ info: (t, ...s) => _e(e, "info", t, ...s),
1212
+ warn: (t, ...s) => _e(e, "warning", t, ...s),
1213
+ error: (t, ...s) => _e(e, "error", t, ...s)
1214
+ };
1215
+ };
1216
+ var se = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(se || {}), S = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(S || {});
1217
+ const zn = (n, e, t, s) => {
1218
+ try {
1219
+ const r = new e(t, s);
1220
+ return {
1221
+ name: n,
1222
+ invoke: (i, o) => {
1223
+ let a;
1224
+ return r[i] && (a = r[i].call(r, o)), Promise.resolve(a);
1225
+ },
1226
+ getInstance: () => r
1227
+ };
1228
+ } catch (r) {
1229
+ if (r.message && r.message.indexOf("is not a constructor") >= 0)
1230
+ return {
1231
+ name: n,
1232
+ invoke: (i) => {
1233
+ let o;
1234
+ return i === "initialize" && (o = e(t, s)), Promise.resolve(o);
1235
+ },
1236
+ getInstance: () => e
1237
+ };
1238
+ throw r;
1239
+ }
1240
+ };
1241
+ function ct(n, e) {
1242
+ return typeof n == "undefined" ? e : n;
1243
+ }
1244
+ class Dn {
1245
+ constructor(e = {}) {
1246
+ this.part = e;
1247
+ }
1248
+ createCommand(e, t, s) {
1249
+ let r;
1250
+ typeof t == "function" ? r = {
1251
+ scope: se.Widget,
1252
+ stage: S.Post,
1253
+ defaultArgs: void 0,
1254
+ handlerResolver: t
1255
+ } : r = {
1256
+ scope: ct(t.scope, se.Widget),
1257
+ stage: ct(t.stage, S.Post),
1258
+ defaultArgs: t.defaultArgs,
1259
+ handlerResolver: s
1260
+ };
1261
+ let i = this.part;
1262
+ const o = e.split(".");
1263
+ return o.forEach((a, c) => {
1264
+ c === o.length - 1 ? i[a] || (i[a] = () => r) : i = this.part[a] = this.part[a] || {};
1265
+ }), this;
1266
+ }
1267
+ get() {
1268
+ return this.part;
1269
+ }
1270
+ }
1271
+ const jt = (n) => {
1272
+ const e = new Dn({});
1273
+ return n(e), e.get();
1274
+ };
1275
+ jt((n) => {
1276
+ n.createCommand(
1277
+ "types.register",
1278
+ { scope: se.Implementation, stage: S.Pre },
1279
+ (e) => (t, s) => {
1280
+ e.container.get("$types")[t] = s;
1281
+ }
1282
+ ).createCommand(
1283
+ "type",
1284
+ { stage: S.Pre },
1285
+ (e) => (t) => {
1286
+ e.container.register("$type", t);
1287
+ }
1288
+ ).createCommand(
1289
+ "settings",
1290
+ { stage: S.Pre, defaultArgs: [null] },
1291
+ (e) => (t) => {
1292
+ e.events.dispatch(
1293
+ "settings:change",
1294
+ t,
1295
+ { bubbles: !0 }
1296
+ ), e.container.register("$settings", t);
1297
+ }
1298
+ ).createCommand(
1299
+ "plugin",
1300
+ { stage: S.Pre },
1301
+ (e) => (t, s, r) => {
1302
+ const { container: i } = e;
1303
+ let o = null, a = t, c = s;
1304
+ typeof t == "string" && (o = t, a = s, c = r);
1305
+ const l = (h) => {
1306
+ const { transformPluginSettings: p } = e.container.get("$environmentOptions"), u = p ? p(
1307
+ c || {},
1308
+ o,
1309
+ e.container,
1310
+ a
1311
+ ) : s;
1312
+ try {
1313
+ const d = zn(
1314
+ o,
1315
+ a,
1316
+ i,
1317
+ u
1318
+ );
1319
+ i.get("$plugins").push(d), h && d.invoke("initialize", null);
1320
+ } catch (d) {
1321
+ Mn(e).warn("Error when initializing plugin", d);
1322
+ }
1323
+ };
1324
+ e.container.get("$instance") ? l(!0) : e.events.subscribeOnce("widget:instance-created", () => l(!1));
1325
+ }
1326
+ ).createCommand(
1327
+ "container.register",
1328
+ (e) => (t, s) => {
1329
+ e.container.register(t, s);
1330
+ }
1331
+ ).createCommand(
1332
+ "container.registerAsync",
1333
+ (e) => (t, s) => {
1334
+ e.container.registerAsync(t, s);
1335
+ }
1336
+ ).createCommand(
1337
+ "container.registerFactory",
1338
+ (e) => (t, s) => {
1339
+ e.container.registerFactory(t, s);
1340
+ }
1341
+ ).createCommand(
1342
+ "container.touch",
1343
+ (e) => (t, s) => {
1344
+ e.container.touch(t, s);
1345
+ }
1346
+ ).createCommand(
1347
+ "csp",
1348
+ {},
1349
+ (e) => (t) => {
1350
+ e.container.register("csp", t);
1351
+ }
1352
+ );
1353
+ });
1354
+ jt((n) => {
1355
+ n.createCommand("storage", (e) => (t = {}) => {
1356
+ const { consent: s } = t;
1357
+ if (typeof s != "undefined") {
1358
+ if (typeof s != "number" && typeof s != "string" && !Array.isArray(s)) {
1359
+ process.env.NODE_ENV !== "production" && v.warn(
1360
+ `storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
1361
+ Passed consent: ${JSON.stringify(s)}`
1362
+ );
1363
+ return;
1364
+ }
1365
+ if (Array.isArray(s) && !s.every(
1366
+ (i) => typeof i == "number" || typeof i == "string"
1367
+ )) {
1368
+ process.env.NODE_ENV !== "production" && v.warn(
1369
+ `storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
1370
+ Passed consent: ${JSON.stringify(s)}`
1371
+ );
1372
+ return;
1373
+ }
1374
+ const r = [
1375
+ m.Necessary,
1376
+ m.Functional,
1377
+ m.Analytical,
1378
+ m.Marketing
1379
+ ].filter((i, o, a) => typeof s == "number" ? s > o : typeof s == "string" ? a.indexOf(s) + 1 > o : Array.isArray(s) ? s.findIndex((c) => c === o + 1 || c === i) > -1 : !0);
1380
+ return r.indexOf(m.Necessary) === -1 && (process.env.NODE_ENV !== "production" && v.warn(
1381
+ `storagePolicyConfigurationApi: passed consent does not include category: '${m.Necessary}'. Consent has to atleast include the '${m.Necessary}' category.
1382
+ Passed consent: ${JSON.stringify(s)}`
1383
+ ), r.unshift(m.Necessary)), Pn(
1384
+ e.container,
1385
+ "storagePolicy",
1386
+ m.Necessary,
1387
+ {
1388
+ medium: _.Cookie,
1389
+ scope: Le.Tenant,
1390
+ duration: { days: 365 }
1391
+ }
1392
+ ).then((i) => i(r)).then(() => {
1393
+ Be(e.container), e.events.dispatch("storage:policy-changed", r);
1394
+ });
1395
+ }
1396
+ });
1397
+ });
1398
+ const Ae = (n, e, t, ...s) => {
1399
+ const r = `[${n.get("$environment").name || "webprovisions"}] ${t}`;
1400
+ switch (e) {
1401
+ case "info":
1402
+ console.info(r, ...s);
1403
+ break;
1404
+ case "warning":
1405
+ console.warn(r, ...s);
1406
+ break;
1407
+ case "error":
1408
+ console.error(r, ...s);
1409
+ break;
1410
+ }
1411
+ }, Ln = (n) => {
1412
+ const e = n.container || n;
1413
+ return {
1414
+ info: (t, ...s) => Ae(e, "info", t, ...s),
1415
+ warn: (t, ...s) => Ae(e, "warning", t, ...s),
1416
+ error: (t, ...s) => Ae(e, "error", t, ...s)
1417
+ };
1418
+ };
1419
+ var J = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(J || {}), x = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(x || {});
1420
+ const Wn = (n, e, t, s) => {
1421
+ try {
1422
+ const r = new e(t, s);
1423
+ return {
1424
+ name: n,
1425
+ invoke: (i, o) => {
1426
+ let a;
1427
+ return r[i] && (a = r[i].call(r, o)), Promise.resolve(a);
1428
+ },
1429
+ getInstance: () => r
1430
+ };
1431
+ } catch (r) {
1432
+ if (r.message && r.message.indexOf("is not a constructor") >= 0)
1433
+ return {
1434
+ name: n,
1435
+ invoke: (i) => {
1436
+ let o;
1437
+ return i === "initialize" && (o = e(t, s)), Promise.resolve(o);
1438
+ },
1439
+ getInstance: () => e
1440
+ };
1441
+ throw r;
1442
+ }
1443
+ };
1444
+ function lt(n, e) {
1445
+ return typeof n == "undefined" ? e : n;
1446
+ }
1447
+ class Bn {
1448
+ constructor(e = {}) {
1449
+ this.part = e;
1450
+ }
1451
+ createCommand(e, t, s) {
1452
+ let r;
1453
+ typeof t == "function" ? r = {
1454
+ scope: J.Widget,
1455
+ stage: x.Post,
1456
+ defaultArgs: void 0,
1457
+ handlerResolver: t
1458
+ } : r = {
1459
+ scope: lt(t.scope, J.Widget),
1460
+ stage: lt(t.stage, x.Post),
1461
+ defaultArgs: t.defaultArgs,
1462
+ handlerResolver: s
1463
+ };
1464
+ let i = this.part;
1465
+ const o = e.split(".");
1466
+ return o.forEach((a, c) => {
1467
+ c === o.length - 1 ? i[a] || (i[a] = () => r) : i = this.part[a] = this.part[a] || {};
1468
+ }), this;
1469
+ }
1470
+ get() {
1471
+ return this.part;
1472
+ }
1473
+ }
1474
+ const It = (n) => {
1475
+ const e = new Bn({});
1476
+ return n(e), e.get();
1477
+ };
1478
+ It((n) => {
1479
+ n.createCommand(
1480
+ "types.register",
1481
+ { scope: J.Implementation, stage: x.Pre },
1482
+ (e) => (t, s) => {
1483
+ e.container.get("$types")[t] = s;
1484
+ }
1485
+ ).createCommand(
1486
+ "type",
1487
+ { stage: x.Pre },
1488
+ (e) => (t) => {
1489
+ e.container.register("$type", t);
1490
+ }
1491
+ ).createCommand(
1492
+ "settings",
1493
+ { stage: x.Pre, defaultArgs: [null] },
1494
+ (e) => (t) => {
1495
+ e.events.dispatch(
1496
+ "settings:change",
1497
+ t,
1498
+ { bubbles: !0 }
1499
+ ), e.container.register("$settings", t);
1500
+ }
1501
+ ).createCommand(
1502
+ "plugin",
1503
+ { stage: x.Pre },
1504
+ (e) => (t, s, r) => {
1505
+ const { container: i } = e;
1506
+ let o = null, a = t, c = s;
1507
+ typeof t == "string" && (o = t, a = s, c = r);
1508
+ const l = (h) => {
1509
+ const { transformPluginSettings: p } = e.container.get("$environmentOptions"), u = p ? p(
1510
+ c || {},
1511
+ o,
1512
+ e.container,
1513
+ a
1514
+ ) : s;
1515
+ try {
1516
+ const d = Wn(
1517
+ o,
1518
+ a,
1519
+ i,
1520
+ u
1521
+ );
1522
+ i.get("$plugins").push(d), h && d.invoke("initialize", null);
1523
+ } catch (d) {
1524
+ Ln(e).warn("Error when initializing plugin", d);
1525
+ }
1526
+ };
1527
+ e.container.get("$instance") ? l(!0) : e.events.subscribeOnce("widget:instance-created", () => l(!1));
1528
+ }
1529
+ ).createCommand(
1530
+ "container.register",
1531
+ (e) => (t, s) => {
1532
+ e.container.register(t, s);
1533
+ }
1534
+ ).createCommand(
1535
+ "container.registerAsync",
1536
+ (e) => (t, s) => {
1537
+ e.container.registerAsync(t, s);
1538
+ }
1539
+ ).createCommand(
1540
+ "container.registerFactory",
1541
+ (e) => (t, s) => {
1542
+ e.container.registerFactory(t, s);
1543
+ }
1544
+ ).createCommand(
1545
+ "container.touch",
1546
+ (e) => (t, s) => {
1547
+ e.container.touch(t, s);
1548
+ }
1549
+ ).createCommand(
1550
+ "csp",
1551
+ {},
1552
+ (e) => (t) => {
1553
+ e.container.register("csp", t);
1554
+ }
1555
+ );
1556
+ });
1557
+ It((n) => {
1558
+ n.createCommand(
1559
+ "ready",
1560
+ { scope: J.Implementation, stage: x.Pre },
1561
+ (e) => (t) => {
1562
+ const { container: s } = e, r = s.owner;
1563
+ s.get("bootstrapping").ready ? t(r) : r.events.subscribeOnce("bootstrap:ready", () => {
1564
+ t(r);
1565
+ });
1566
+ }
1567
+ );
1568
+ });
1569
+ const Ce = (n, e, t, ...s) => {
1570
+ const r = `[${n.get("$environment").name || "webprovisions"}] ${t}`;
1571
+ switch (e) {
1572
+ case "info":
1573
+ console.info(r, ...s);
1574
+ break;
1575
+ case "warning":
1576
+ console.warn(r, ...s);
1577
+ break;
1578
+ case "error":
1579
+ console.error(r, ...s);
1580
+ break;
1581
+ }
1582
+ }, Vn = (n) => {
1583
+ const e = n.container || n;
1584
+ return {
1585
+ info: (t, ...s) => Ce(e, "info", t, ...s),
1586
+ warn: (t, ...s) => Ce(e, "warning", t, ...s),
1587
+ error: (t, ...s) => Ce(e, "error", t, ...s)
1588
+ };
1589
+ };
1590
+ var re = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(re || {}), k = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(k || {});
1591
+ const Jn = (n, e, t, s) => {
1592
+ try {
1593
+ const r = new e(t, s);
1594
+ return {
1595
+ name: n,
1596
+ invoke: (i, o) => {
1597
+ let a;
1598
+ return r[i] && (a = r[i].call(r, o)), Promise.resolve(a);
1599
+ },
1600
+ getInstance: () => r
1601
+ };
1602
+ } catch (r) {
1603
+ if (r.message && r.message.indexOf("is not a constructor") >= 0)
1604
+ return {
1605
+ name: n,
1606
+ invoke: (i) => {
1607
+ let o;
1608
+ return i === "initialize" && (o = e(t, s)), Promise.resolve(o);
1609
+ },
1610
+ getInstance: () => e
1611
+ };
1612
+ throw r;
1613
+ }
1614
+ };
1615
+ function ht(n, e) {
1616
+ return typeof n == "undefined" ? e : n;
1617
+ }
1618
+ class Fn {
1619
+ constructor(e = {}) {
1620
+ this.part = e;
1621
+ }
1622
+ createCommand(e, t, s) {
1623
+ let r;
1624
+ typeof t == "function" ? r = {
1625
+ scope: re.Widget,
1626
+ stage: k.Post,
1627
+ defaultArgs: void 0,
1628
+ handlerResolver: t
1629
+ } : r = {
1630
+ scope: ht(t.scope, re.Widget),
1631
+ stage: ht(t.stage, k.Post),
1632
+ defaultArgs: t.defaultArgs,
1633
+ handlerResolver: s
1634
+ };
1635
+ let i = this.part;
1636
+ const o = e.split(".");
1637
+ return o.forEach((a, c) => {
1638
+ c === o.length - 1 ? i[a] || (i[a] = () => r) : i = this.part[a] = this.part[a] || {};
1639
+ }), this;
1640
+ }
1641
+ get() {
1642
+ return this.part;
1643
+ }
1644
+ }
1645
+ const Kn = (n) => {
1646
+ const e = new Fn({});
1647
+ return n(e), e.get();
1648
+ };
1649
+ Kn((n) => {
1650
+ n.createCommand(
1651
+ "types.register",
1652
+ { scope: re.Implementation, stage: k.Pre },
1653
+ (e) => (t, s) => {
1654
+ e.container.get("$types")[t] = s;
1655
+ }
1656
+ ).createCommand(
1657
+ "type",
1658
+ { stage: k.Pre },
1659
+ (e) => (t) => {
1660
+ e.container.register("$type", t);
1661
+ }
1662
+ ).createCommand(
1663
+ "settings",
1664
+ { stage: k.Pre, defaultArgs: [null] },
1665
+ (e) => (t) => {
1666
+ e.events.dispatch(
1667
+ "settings:change",
1668
+ t,
1669
+ { bubbles: !0 }
1670
+ ), e.container.register("$settings", t);
1671
+ }
1672
+ ).createCommand(
1673
+ "plugin",
1674
+ { stage: k.Pre },
1675
+ (e) => (t, s, r) => {
1676
+ const { container: i } = e;
1677
+ let o = null, a = t, c = s;
1678
+ typeof t == "string" && (o = t, a = s, c = r);
1679
+ const l = (h) => {
1680
+ const { transformPluginSettings: p } = e.container.get("$environmentOptions"), u = p ? p(
1681
+ c || {},
1682
+ o,
1683
+ e.container,
1684
+ a
1685
+ ) : s;
1686
+ try {
1687
+ const d = Jn(
1688
+ o,
1689
+ a,
1690
+ i,
1691
+ u
1692
+ );
1693
+ i.get("$plugins").push(d), h && d.invoke("initialize", null);
1694
+ } catch (d) {
1695
+ Vn(e).warn("Error when initializing plugin", d);
1696
+ }
1697
+ };
1698
+ e.container.get("$instance") ? l(!0) : e.events.subscribeOnce("widget:instance-created", () => l(!1));
1699
+ }
1700
+ ).createCommand(
1701
+ "container.register",
1702
+ (e) => (t, s) => {
1703
+ e.container.register(t, s);
1704
+ }
1705
+ ).createCommand(
1706
+ "container.registerAsync",
1707
+ (e) => (t, s) => {
1708
+ e.container.registerAsync(t, s);
1709
+ }
1710
+ ).createCommand(
1711
+ "container.registerFactory",
1712
+ (e) => (t, s) => {
1713
+ e.container.registerFactory(t, s);
1714
+ }
1715
+ ).createCommand(
1716
+ "container.touch",
1717
+ (e) => (t, s) => {
1718
+ e.container.touch(t, s);
1719
+ }
1720
+ ).createCommand(
1721
+ "csp",
1722
+ {},
1723
+ (e) => (t) => {
1724
+ e.container.register("csp", t);
1725
+ }
1726
+ );
1727
+ });
1728
+ /**
1729
+ * @license
1730
+ * Copyright 2019 Google LLC
1731
+ * SPDX-License-Identifier: BSD-3-Clause
1732
+ */
1733
+ const ee = window, Je = ee.ShadowRoot && (ee.ShadyCSS === void 0 || ee.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Fe = Symbol(), pt = /* @__PURE__ */ new WeakMap();
1734
+ let Ut = class {
1735
+ constructor(n, e, t) {
1736
+ if (this._$cssResult$ = !0, t !== Fe)
1737
+ throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
1738
+ this.cssText = n, this.t = e;
1739
+ }
1740
+ get styleSheet() {
1741
+ let n = this.o;
1742
+ const e = this.t;
1743
+ if (Je && n === void 0) {
1744
+ const t = e !== void 0 && e.length === 1;
1745
+ t && (n = pt.get(e)), n === void 0 && ((this.o = n = new CSSStyleSheet()).replaceSync(this.cssText), t && pt.set(e, n));
1746
+ }
1747
+ return n;
1748
+ }
1749
+ toString() {
1750
+ return this.cssText;
1751
+ }
1752
+ };
1753
+ const qn = (n) => new Ut(typeof n == "string" ? n : n + "", void 0, Fe), Gn = (n, ...e) => {
1754
+ const t = n.length === 1 ? n[0] : e.reduce((s, r, i) => s + ((o) => {
1755
+ if (o._$cssResult$ === !0)
1756
+ return o.cssText;
1757
+ if (typeof o == "number")
1758
+ return o;
1759
+ 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.");
1760
+ })(r) + n[i + 1], n[0]);
1761
+ return new Ut(t, n, Fe);
1762
+ }, Xn = (n, e) => {
1763
+ Je ? n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet) : e.forEach((t) => {
1764
+ const s = document.createElement("style"), r = ee.litNonce;
1765
+ r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, n.appendChild(s);
1766
+ });
1767
+ }, dt = Je ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
1768
+ let t = "";
1769
+ for (const s of e.cssRules)
1770
+ t += s.cssText;
1771
+ return qn(t);
1772
+ })(n) : n;
1773
+ /**
1774
+ * @license
1775
+ * Copyright 2017 Google LLC
1776
+ * SPDX-License-Identifier: BSD-3-Clause
1777
+ */
1778
+ var Ee;
1779
+ const ie = window, ut = ie.trustedTypes, Yn = ut ? ut.emptyScript : "", gt = ie.reactiveElementPolyfillSupport, Ie = { toAttribute(n, e) {
1780
+ switch (e) {
1781
+ case Boolean:
1782
+ n = n ? Yn : null;
1783
+ break;
1784
+ case Object:
1785
+ case Array:
1786
+ n = n == null ? n : JSON.stringify(n);
1787
+ }
1788
+ return n;
1789
+ }, fromAttribute(n, e) {
1790
+ let t = n;
1791
+ switch (e) {
1792
+ case Boolean:
1793
+ t = n !== null;
1794
+ break;
1795
+ case Number:
1796
+ t = n === null ? null : Number(n);
1797
+ break;
1798
+ case Object:
1799
+ case Array:
1800
+ try {
1801
+ t = JSON.parse(n);
1802
+ } catch (s) {
1803
+ t = null;
1804
+ }
1805
+ }
1806
+ return t;
1807
+ } }, Rt = (n, e) => e !== n && (e == e || n == n), xe = { attribute: !0, type: String, converter: Ie, reflect: !1, hasChanged: Rt }, Ue = "finalized";
1808
+ let R = class extends HTMLElement {
1809
+ constructor() {
1810
+ super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this._$Eu();
1811
+ }
1812
+ static addInitializer(n) {
1813
+ var e;
1814
+ this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(n);
1815
+ }
1816
+ static get observedAttributes() {
1817
+ this.finalize();
1818
+ const n = [];
1819
+ return this.elementProperties.forEach((e, t) => {
1820
+ const s = this._$Ep(t, e);
1821
+ s !== void 0 && (this._$Ev.set(s, t), n.push(s));
1822
+ }), n;
1823
+ }
1824
+ static createProperty(n, e = xe) {
1825
+ if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(n, e), !e.noAccessor && !this.prototype.hasOwnProperty(n)) {
1826
+ const t = typeof n == "symbol" ? Symbol() : "__" + n, s = this.getPropertyDescriptor(n, t, e);
1827
+ s !== void 0 && Object.defineProperty(this.prototype, n, s);
1828
+ }
1829
+ }
1830
+ static getPropertyDescriptor(n, e, t) {
1831
+ return { get() {
1832
+ return this[e];
1833
+ }, set(s) {
1834
+ const r = this[n];
1835
+ this[e] = s, this.requestUpdate(n, r, t);
1836
+ }, configurable: !0, enumerable: !0 };
1837
+ }
1838
+ static getPropertyOptions(n) {
1839
+ return this.elementProperties.get(n) || xe;
1840
+ }
1841
+ static finalize() {
1842
+ if (this.hasOwnProperty(Ue))
1843
+ return !1;
1844
+ this[Ue] = !0;
1845
+ const n = Object.getPrototypeOf(this);
1846
+ if (n.finalize(), n.h !== void 0 && (this.h = [...n.h]), this.elementProperties = new Map(n.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
1847
+ const e = this.properties, t = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
1848
+ for (const s of t)
1849
+ this.createProperty(s, e[s]);
1850
+ }
1851
+ return this.elementStyles = this.finalizeStyles(this.styles), !0;
1852
+ }
1853
+ static finalizeStyles(n) {
1854
+ const e = [];
1855
+ if (Array.isArray(n)) {
1856
+ const t = new Set(n.flat(1 / 0).reverse());
1857
+ for (const s of t)
1858
+ e.unshift(dt(s));
1859
+ } else
1860
+ n !== void 0 && e.push(dt(n));
1861
+ return e;
1862
+ }
1863
+ static _$Ep(n, e) {
1864
+ const t = e.attribute;
1865
+ return t === !1 ? void 0 : typeof t == "string" ? t : typeof n == "string" ? n.toLowerCase() : void 0;
1866
+ }
1867
+ _$Eu() {
1868
+ var n;
1869
+ this._$E_ = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (n = this.constructor.h) === null || n === void 0 || n.forEach((e) => e(this));
1870
+ }
1871
+ addController(n) {
1872
+ var e, t;
1873
+ ((e = this._$ES) !== null && e !== void 0 ? e : this._$ES = []).push(n), this.renderRoot !== void 0 && this.isConnected && ((t = n.hostConnected) === null || t === void 0 || t.call(n));
1874
+ }
1875
+ removeController(n) {
1876
+ var e;
1877
+ (e = this._$ES) === null || e === void 0 || e.splice(this._$ES.indexOf(n) >>> 0, 1);
1878
+ }
1879
+ _$Eg() {
1880
+ this.constructor.elementProperties.forEach((n, e) => {
1881
+ this.hasOwnProperty(e) && (this._$Ei.set(e, this[e]), delete this[e]);
1882
+ });
1883
+ }
1884
+ createRenderRoot() {
1885
+ var n;
1886
+ const e = (n = this.shadowRoot) !== null && n !== void 0 ? n : this.attachShadow(this.constructor.shadowRootOptions);
1887
+ return Xn(e, this.constructor.elementStyles), e;
1888
+ }
1889
+ connectedCallback() {
1890
+ var n;
1891
+ this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (n = this._$ES) === null || n === void 0 || n.forEach((e) => {
1892
+ var t;
1893
+ return (t = e.hostConnected) === null || t === void 0 ? void 0 : t.call(e);
1894
+ });
1895
+ }
1896
+ enableUpdating(n) {
1897
+ }
1898
+ disconnectedCallback() {
1899
+ var n;
1900
+ (n = this._$ES) === null || n === void 0 || n.forEach((e) => {
1901
+ var t;
1902
+ return (t = e.hostDisconnected) === null || t === void 0 ? void 0 : t.call(e);
1903
+ });
1904
+ }
1905
+ attributeChangedCallback(n, e, t) {
1906
+ this._$AK(n, t);
1907
+ }
1908
+ _$EO(n, e, t = xe) {
1909
+ var s;
1910
+ const r = this.constructor._$Ep(n, t);
1911
+ if (r !== void 0 && t.reflect === !0) {
1912
+ const i = (((s = t.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? t.converter : Ie).toAttribute(e, t.type);
1913
+ this._$El = n, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$El = null;
1914
+ }
1915
+ }
1916
+ _$AK(n, e) {
1917
+ var t;
1918
+ const s = this.constructor, r = s._$Ev.get(n);
1919
+ if (r !== void 0 && this._$El !== r) {
1920
+ const i = s.getPropertyOptions(r), o = typeof i.converter == "function" ? { fromAttribute: i.converter } : ((t = i.converter) === null || t === void 0 ? void 0 : t.fromAttribute) !== void 0 ? i.converter : Ie;
1921
+ this._$El = r, this[r] = o.fromAttribute(e, i.type), this._$El = null;
1922
+ }
1923
+ }
1924
+ requestUpdate(n, e, t) {
1925
+ let s = !0;
1926
+ n !== void 0 && (((t = t || this.constructor.getPropertyOptions(n)).hasChanged || Rt)(this[n], e) ? (this._$AL.has(n) || this._$AL.set(n, e), t.reflect === !0 && this._$El !== n && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(n, t))) : s = !1), !this.isUpdatePending && s && (this._$E_ = this._$Ej());
1927
+ }
1928
+ _$Ej() {
1929
+ return Q(this, null, function* () {
1930
+ this.isUpdatePending = !0;
1931
+ try {
1932
+ yield this._$E_;
1933
+ } catch (e) {
1934
+ Promise.reject(e);
1935
+ }
1936
+ const n = this.scheduleUpdate();
1937
+ return n != null && (yield n), !this.isUpdatePending;
1938
+ });
1939
+ }
1940
+ scheduleUpdate() {
1941
+ return this.performUpdate();
1942
+ }
1943
+ performUpdate() {
1944
+ var n;
1945
+ if (!this.isUpdatePending)
1946
+ return;
1947
+ this.hasUpdated, this._$Ei && (this._$Ei.forEach((s, r) => this[r] = s), this._$Ei = void 0);
1948
+ let e = !1;
1949
+ const t = this._$AL;
1950
+ try {
1951
+ e = this.shouldUpdate(t), e ? (this.willUpdate(t), (n = this._$ES) === null || n === void 0 || n.forEach((s) => {
1952
+ var r;
1953
+ return (r = s.hostUpdate) === null || r === void 0 ? void 0 : r.call(s);
1954
+ }), this.update(t)) : this._$Ek();
1955
+ } catch (s) {
1956
+ throw e = !1, this._$Ek(), s;
1957
+ }
1958
+ e && this._$AE(t);
1959
+ }
1960
+ willUpdate(n) {
1961
+ }
1962
+ _$AE(n) {
1963
+ var e;
1964
+ (e = this._$ES) === null || e === void 0 || e.forEach((t) => {
1965
+ var s;
1966
+ return (s = t.hostUpdated) === null || s === void 0 ? void 0 : s.call(t);
1967
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(n)), this.updated(n);
1968
+ }
1969
+ _$Ek() {
1970
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
1971
+ }
1972
+ get updateComplete() {
1973
+ return this.getUpdateComplete();
1974
+ }
1975
+ getUpdateComplete() {
1976
+ return this._$E_;
1977
+ }
1978
+ shouldUpdate(n) {
1979
+ return !0;
1980
+ }
1981
+ update(n) {
1982
+ this._$EC !== void 0 && (this._$EC.forEach((e, t) => this._$EO(t, this[t], e)), this._$EC = void 0), this._$Ek();
1983
+ }
1984
+ updated(n) {
1985
+ }
1986
+ firstUpdated(n) {
1987
+ }
1988
+ };
1989
+ R[Ue] = !0, R.elementProperties = /* @__PURE__ */ new Map(), R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, gt == null || gt({ ReactiveElement: R }), ((Ee = ie.reactiveElementVersions) !== null && Ee !== void 0 ? Ee : ie.reactiveElementVersions = []).push("1.6.3");
1990
+ /**
1991
+ * @license
1992
+ * Copyright 2017 Google LLC
1993
+ * SPDX-License-Identifier: BSD-3-Clause
1994
+ */
1995
+ var Pe;
1996
+ const oe = window, M = oe.trustedTypes, mt = M ? M.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Re = "$lit$", C = `lit$${(Math.random() + "").slice(9)}$`, Ht = "?" + C, Zn = `<${Ht}>`, T = document, F = () => T.createComment(""), K = (n) => n === null || typeof n != "object" && typeof n != "function", Mt = Array.isArray, Qn = (n) => Mt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Oe = `[
1997
+ \f\r]`, D = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ft = /-->/g, vt = />/g, P = RegExp(`>|${Oe}(?:([^\\s"'>=/]+)(${Oe}*=${Oe}*(?:[^
1998
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), yt = /'/g, bt = /"/g, zt = /^(?:script|style|textarea|title)$/i, es = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), Z = es(1), j = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), $t = /* @__PURE__ */ new WeakMap(), N = T.createTreeWalker(T, 129, null, !1);
1999
+ function Dt(n, e) {
2000
+ if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
2001
+ throw Error("invalid template strings array");
2002
+ return mt !== void 0 ? mt.createHTML(e) : e;
2003
+ }
2004
+ const ts = (n, e) => {
2005
+ const t = n.length - 1, s = [];
2006
+ let r, i = e === 2 ? "<svg>" : "", o = D;
2007
+ for (let a = 0; a < t; a++) {
2008
+ const c = n[a];
2009
+ let l, h, p = -1, u = 0;
2010
+ for (; u < c.length && (o.lastIndex = u, h = o.exec(c), h !== null); )
2011
+ u = o.lastIndex, o === D ? h[1] === "!--" ? o = ft : h[1] !== void 0 ? o = vt : h[2] !== void 0 ? (zt.test(h[2]) && (r = RegExp("</" + h[2], "g")), o = P) : h[3] !== void 0 && (o = P) : o === P ? h[0] === ">" ? (o = r != null ? r : D, p = -1) : h[1] === void 0 ? p = -2 : (p = o.lastIndex - h[2].length, l = h[1], o = h[3] === void 0 ? P : h[3] === '"' ? bt : yt) : o === bt || o === yt ? o = P : o === ft || o === vt ? o = D : (o = P, r = void 0);
2012
+ const d = o === P && n[a + 1].startsWith("/>") ? " " : "";
2013
+ i += o === D ? c + Zn : p >= 0 ? (s.push(l), c.slice(0, p) + Re + c.slice(p) + C + d) : c + C + (p === -2 ? (s.push(void 0), a) : d);
2014
+ }
2015
+ return [Dt(n, i + (n[t] || "<?>") + (e === 2 ? "</svg>" : "")), s];
2016
+ };
2017
+ class q {
2018
+ constructor({ strings: e, _$litType$: t }, s) {
2019
+ let r;
2020
+ this.parts = [];
2021
+ let i = 0, o = 0;
2022
+ const a = e.length - 1, c = this.parts, [l, h] = ts(e, t);
2023
+ if (this.el = q.createElement(l, s), N.currentNode = this.el.content, t === 2) {
2024
+ const p = this.el.content, u = p.firstChild;
2025
+ u.remove(), p.append(...u.childNodes);
2026
+ }
2027
+ for (; (r = N.nextNode()) !== null && c.length < a; ) {
2028
+ if (r.nodeType === 1) {
2029
+ if (r.hasAttributes()) {
2030
+ const p = [];
2031
+ for (const u of r.getAttributeNames())
2032
+ if (u.endsWith(Re) || u.startsWith(C)) {
2033
+ const d = h[o++];
2034
+ if (p.push(u), d !== void 0) {
2035
+ const b = r.getAttribute(d.toLowerCase() + Re).split(C), y = /([.?@])?(.*)/.exec(d);
2036
+ c.push({ type: 1, index: i, name: y[2], strings: b, ctor: y[1] === "." ? ss : y[1] === "?" ? is : y[1] === "@" ? os : pe });
2037
+ } else
2038
+ c.push({ type: 6, index: i });
2039
+ }
2040
+ for (const u of p)
2041
+ r.removeAttribute(u);
2042
+ }
2043
+ if (zt.test(r.tagName)) {
2044
+ const p = r.textContent.split(C), u = p.length - 1;
2045
+ if (u > 0) {
2046
+ r.textContent = M ? M.emptyScript : "";
2047
+ for (let d = 0; d < u; d++)
2048
+ r.append(p[d], F()), N.nextNode(), c.push({ type: 2, index: ++i });
2049
+ r.append(p[u], F());
2050
+ }
2051
+ }
2052
+ } else if (r.nodeType === 8)
2053
+ if (r.data === Ht)
2054
+ c.push({ type: 2, index: i });
2055
+ else {
2056
+ let p = -1;
2057
+ for (; (p = r.data.indexOf(C, p + 1)) !== -1; )
2058
+ c.push({ type: 7, index: i }), p += C.length - 1;
2059
+ }
2060
+ i++;
2061
+ }
2062
+ }
2063
+ static createElement(e, t) {
2064
+ const s = T.createElement("template");
2065
+ return s.innerHTML = e, s;
2066
+ }
2067
+ }
2068
+ function z(n, e, t = n, s) {
2069
+ var r, i, o, a;
2070
+ if (e === j)
2071
+ return e;
2072
+ let c = s !== void 0 ? (r = t._$Co) === null || r === void 0 ? void 0 : r[s] : t._$Cl;
2073
+ const l = K(e) ? void 0 : e._$litDirective$;
2074
+ return (c == null ? void 0 : c.constructor) !== l && ((i = c == null ? void 0 : c._$AO) === null || i === void 0 || i.call(c, !1), l === void 0 ? c = void 0 : (c = new l(n), c._$AT(n, t, s)), s !== void 0 ? ((o = (a = t)._$Co) !== null && o !== void 0 ? o : a._$Co = [])[s] = c : t._$Cl = c), c !== void 0 && (e = z(n, c._$AS(n, e.values), c, s)), e;
2075
+ }
2076
+ class ns {
2077
+ constructor(e, t) {
2078
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
2079
+ }
2080
+ get parentNode() {
2081
+ return this._$AM.parentNode;
2082
+ }
2083
+ get _$AU() {
2084
+ return this._$AM._$AU;
2085
+ }
2086
+ u(e) {
2087
+ var t;
2088
+ const { el: { content: s }, parts: r } = this._$AD, i = ((t = e == null ? void 0 : e.creationScope) !== null && t !== void 0 ? t : T).importNode(s, !0);
2089
+ N.currentNode = i;
2090
+ let o = N.nextNode(), a = 0, c = 0, l = r[0];
2091
+ for (; l !== void 0; ) {
2092
+ if (a === l.index) {
2093
+ let h;
2094
+ l.type === 2 ? h = new X(o, o.nextSibling, this, e) : l.type === 1 ? h = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (h = new as(o, this, e)), this._$AV.push(h), l = r[++c];
2095
+ }
2096
+ a !== (l == null ? void 0 : l.index) && (o = N.nextNode(), a++);
2097
+ }
2098
+ return N.currentNode = T, i;
2099
+ }
2100
+ v(e) {
2101
+ let t = 0;
2102
+ for (const s of this._$AV)
2103
+ s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
2104
+ }
2105
+ }
2106
+ class X {
2107
+ constructor(e, t, s, r) {
2108
+ var i;
2109
+ this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = r, this._$Cp = (i = r == null ? void 0 : r.isConnected) === null || i === void 0 || i;
2110
+ }
2111
+ get _$AU() {
2112
+ var e, t;
2113
+ return (t = (e = this._$AM) === null || e === void 0 ? void 0 : e._$AU) !== null && t !== void 0 ? t : this._$Cp;
2114
+ }
2115
+ get parentNode() {
2116
+ let e = this._$AA.parentNode;
2117
+ const t = this._$AM;
2118
+ return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
2119
+ }
2120
+ get startNode() {
2121
+ return this._$AA;
2122
+ }
2123
+ get endNode() {
2124
+ return this._$AB;
2125
+ }
2126
+ _$AI(e, t = this) {
2127
+ e = z(this, e, t), K(e) ? e === g || e == null || e === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : e !== this._$AH && e !== j && this._(e) : e._$litType$ !== void 0 ? this.g(e) : e.nodeType !== void 0 ? this.$(e) : Qn(e) ? this.T(e) : this._(e);
2128
+ }
2129
+ k(e) {
2130
+ return this._$AA.parentNode.insertBefore(e, this._$AB);
2131
+ }
2132
+ $(e) {
2133
+ this._$AH !== e && (this._$AR(), this._$AH = this.k(e));
2134
+ }
2135
+ _(e) {
2136
+ this._$AH !== g && K(this._$AH) ? this._$AA.nextSibling.data = e : this.$(T.createTextNode(e)), this._$AH = e;
2137
+ }
2138
+ g(e) {
2139
+ var t;
2140
+ const { values: s, _$litType$: r } = e, i = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = q.createElement(Dt(r.h, r.h[0]), this.options)), r);
2141
+ if (((t = this._$AH) === null || t === void 0 ? void 0 : t._$AD) === i)
2142
+ this._$AH.v(s);
2143
+ else {
2144
+ const o = new ns(i, this), a = o.u(this.options);
2145
+ o.v(s), this.$(a), this._$AH = o;
2146
+ }
2147
+ }
2148
+ _$AC(e) {
2149
+ let t = $t.get(e.strings);
2150
+ return t === void 0 && $t.set(e.strings, t = new q(e)), t;
2151
+ }
2152
+ T(e) {
2153
+ Mt(this._$AH) || (this._$AH = [], this._$AR());
2154
+ const t = this._$AH;
2155
+ let s, r = 0;
2156
+ for (const i of e)
2157
+ r === t.length ? t.push(s = new X(this.k(F()), this.k(F()), this, this.options)) : s = t[r], s._$AI(i), r++;
2158
+ r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
2159
+ }
2160
+ _$AR(e = this._$AA.nextSibling, t) {
2161
+ var s;
2162
+ for ((s = this._$AP) === null || s === void 0 || s.call(this, !1, !0, t); e && e !== this._$AB; ) {
2163
+ const r = e.nextSibling;
2164
+ e.remove(), e = r;
2165
+ }
2166
+ }
2167
+ setConnected(e) {
2168
+ var t;
2169
+ this._$AM === void 0 && (this._$Cp = e, (t = this._$AP) === null || t === void 0 || t.call(this, e));
2170
+ }
2171
+ }
2172
+ class pe {
2173
+ constructor(e, t, s, r, i) {
2174
+ this.type = 1, this._$AH = g, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = g;
2175
+ }
2176
+ get tagName() {
2177
+ return this.element.tagName;
2178
+ }
2179
+ get _$AU() {
2180
+ return this._$AM._$AU;
2181
+ }
2182
+ _$AI(e, t = this, s, r) {
2183
+ const i = this.strings;
2184
+ let o = !1;
2185
+ if (i === void 0)
2186
+ e = z(this, e, t, 0), o = !K(e) || e !== this._$AH && e !== j, o && (this._$AH = e);
2187
+ else {
2188
+ const a = e;
2189
+ let c, l;
2190
+ for (e = i[0], c = 0; c < i.length - 1; c++)
2191
+ l = z(this, a[s + c], t, c), l === j && (l = this._$AH[c]), o || (o = !K(l) || l !== this._$AH[c]), l === g ? e = g : e !== g && (e += (l != null ? l : "") + i[c + 1]), this._$AH[c] = l;
2192
+ }
2193
+ o && !r && this.j(e);
2194
+ }
2195
+ j(e) {
2196
+ e === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e != null ? e : "");
2197
+ }
2198
+ }
2199
+ class ss extends pe {
2200
+ constructor() {
2201
+ super(...arguments), this.type = 3;
2202
+ }
2203
+ j(e) {
2204
+ this.element[this.name] = e === g ? void 0 : e;
2205
+ }
2206
+ }
2207
+ const rs = M ? M.emptyScript : "";
2208
+ class is extends pe {
2209
+ constructor() {
2210
+ super(...arguments), this.type = 4;
2211
+ }
2212
+ j(e) {
2213
+ e && e !== g ? this.element.setAttribute(this.name, rs) : this.element.removeAttribute(this.name);
2214
+ }
2215
+ }
2216
+ class os extends pe {
2217
+ constructor(e, t, s, r, i) {
2218
+ super(e, t, s, r, i), this.type = 5;
2219
+ }
2220
+ _$AI(e, t = this) {
2221
+ var s;
2222
+ if ((e = (s = z(this, e, t, 0)) !== null && s !== void 0 ? s : g) === j)
2223
+ return;
2224
+ const r = this._$AH, i = e === g && r !== g || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== g && (r === g || i);
2225
+ i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
2226
+ }
2227
+ handleEvent(e) {
2228
+ var t, s;
2229
+ typeof this._$AH == "function" ? this._$AH.call((s = (t = this.options) === null || t === void 0 ? void 0 : t.host) !== null && s !== void 0 ? s : this.element, e) : this._$AH.handleEvent(e);
2230
+ }
2231
+ }
2232
+ class as {
2233
+ constructor(e, t, s) {
2234
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
2235
+ }
2236
+ get _$AU() {
2237
+ return this._$AM._$AU;
2238
+ }
2239
+ _$AI(e) {
2240
+ z(this, e);
2241
+ }
2242
+ }
2243
+ const wt = oe.litHtmlPolyfillSupport;
2244
+ wt == null || wt(q, X), ((Pe = oe.litHtmlVersions) !== null && Pe !== void 0 ? Pe : oe.litHtmlVersions = []).push("2.8.0");
2245
+ const cs = (n, e, t) => {
2246
+ var s, r;
2247
+ const i = (s = t == null ? void 0 : t.renderBefore) !== null && s !== void 0 ? s : e;
2248
+ let o = i._$litPart$;
2249
+ if (o === void 0) {
2250
+ const a = (r = t == null ? void 0 : t.renderBefore) !== null && r !== void 0 ? r : null;
2251
+ i._$litPart$ = o = new X(e.insertBefore(F(), a), a, void 0, t != null ? t : {});
2252
+ }
2253
+ return o._$AI(n), o;
2254
+ };
2255
+ /**
2256
+ * @license
2257
+ * Copyright 2017 Google LLC
2258
+ * SPDX-License-Identifier: BSD-3-Clause
2259
+ */
2260
+ var Se, ke;
2261
+ let B = class extends R {
2262
+ constructor() {
2263
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
2264
+ }
2265
+ createRenderRoot() {
2266
+ var n, e;
2267
+ const t = super.createRenderRoot();
2268
+ return (n = (e = this.renderOptions).renderBefore) !== null && n !== void 0 || (e.renderBefore = t.firstChild), t;
2269
+ }
2270
+ update(n) {
2271
+ const e = this.render();
2272
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(n), this._$Do = cs(e, this.renderRoot, this.renderOptions);
2273
+ }
2274
+ connectedCallback() {
2275
+ var n;
2276
+ super.connectedCallback(), (n = this._$Do) === null || n === void 0 || n.setConnected(!0);
2277
+ }
2278
+ disconnectedCallback() {
2279
+ var n;
2280
+ super.disconnectedCallback(), (n = this._$Do) === null || n === void 0 || n.setConnected(!1);
2281
+ }
2282
+ render() {
2283
+ return j;
2284
+ }
2285
+ };
2286
+ B.finalized = !0, B._$litElement$ = !0, (Se = globalThis.litElementHydrateSupport) === null || Se === void 0 || Se.call(globalThis, { LitElement: B });
2287
+ const _t = globalThis.litElementPolyfillSupport;
2288
+ _t == null || _t({ LitElement: B });
2289
+ ((ke = globalThis.litElementVersions) !== null && ke !== void 0 ? ke : globalThis.litElementVersions = []).push("3.3.3");
2290
+ /**
2291
+ * @license
2292
+ * Copyright 2017 Google LLC
2293
+ * SPDX-License-Identifier: BSD-3-Clause
2294
+ */
2295
+ const ls = (n, e) => e.kind === "method" && e.descriptor && !("value" in e.descriptor) ? Ct(At({}, e), { finisher(t) {
2296
+ t.createProperty(e.key, n);
2297
+ } }) : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: e.key, initializer() {
2298
+ typeof e.initializer == "function" && (this[e.key] = e.initializer.call(this));
2299
+ }, finisher(t) {
2300
+ t.createProperty(e.key, n);
2301
+ } }, hs = (n, e, t) => {
2302
+ e.constructor.createProperty(t, n);
2303
+ };
2304
+ function Lt(n) {
2305
+ return (e, t) => t !== void 0 ? hs(n, e, t) : ls(n, e);
2306
+ }
2307
+ /**
2308
+ * @license
2309
+ * Copyright 2017 Google LLC
2310
+ * SPDX-License-Identifier: BSD-3-Clause
2311
+ */
2312
+ function Ke(n) {
2313
+ return Lt(Ct(At({}, n), { state: !0 }));
2314
+ }
2315
+ /**
2316
+ * @license
2317
+ * Copyright 2021 Google LLC
2318
+ * SPDX-License-Identifier: BSD-3-Clause
2319
+ */
2320
+ var Ne;
2321
+ ((Ne = window.HTMLSlotElement) === null || Ne === void 0 ? void 0 : Ne.prototype.assignedElements) != null;
2322
+ /**
2323
+ * @license
2324
+ * Copyright 2017 Google LLC
2325
+ * SPDX-License-Identifier: BSD-3-Clause
2326
+ */
2327
+ const ps = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, ds = (n) => (...e) => ({ _$litDirective$: n, values: e });
2328
+ let us = class {
2329
+ constructor(n) {
2330
+ }
2331
+ get _$AU() {
2332
+ return this._$AM._$AU;
2333
+ }
2334
+ _$AT(n, e, t) {
2335
+ this._$Ct = n, this._$AM = e, this._$Ci = t;
2336
+ }
2337
+ _$AS(n, e) {
2338
+ return this.update(n, e);
2339
+ }
2340
+ update(n, e) {
2341
+ return this.render(...e);
2342
+ }
2343
+ };
2344
+ /**
2345
+ * @license
2346
+ * Copyright 2018 Google LLC
2347
+ * SPDX-License-Identifier: BSD-3-Clause
2348
+ */
2349
+ const gs = ds(class extends us {
2350
+ constructor(n) {
2351
+ var e;
2352
+ if (super(n), n.type !== ps.ATTRIBUTE || n.name !== "class" || ((e = n.strings) === null || e === void 0 ? void 0 : e.length) > 2)
2353
+ throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
2354
+ }
2355
+ render(n) {
2356
+ return " " + Object.keys(n).filter((e) => n[e]).join(" ") + " ";
2357
+ }
2358
+ update(n, [e]) {
2359
+ var t, s;
2360
+ if (this.it === void 0) {
2361
+ this.it = /* @__PURE__ */ new Set(), n.strings !== void 0 && (this.nt = new Set(n.strings.join(" ").split(/\s/).filter((i) => i !== "")));
2362
+ for (const i in e)
2363
+ e[i] && !(!((t = this.nt) === null || t === void 0) && t.has(i)) && this.it.add(i);
2364
+ return this.render(e);
2365
+ }
2366
+ const r = n.element.classList;
2367
+ this.it.forEach((i) => {
2368
+ i in e || (r.remove(i), this.it.delete(i));
2369
+ });
2370
+ for (const i in e) {
2371
+ const o = !!e[i];
2372
+ o === this.it.has(i) || !((s = this.nt) === null || s === void 0) && s.has(i) || (o ? (r.add(i), this.it.add(i)) : (r.remove(i), this.it.delete(i)));
2373
+ }
2374
+ return j;
2375
+ }
2376
+ });
2377
+ var ms = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, de = (n, e, t, s) => {
2378
+ for (var r = s > 1 ? void 0 : s ? fs(e, t) : e, i = n.length - 1, o; i >= 0; i--)
2379
+ (o = n[i]) && (r = (s ? o(e, t, r) : o(r)) || r);
2380
+ return s && r && ms(e, t, r), r;
2381
+ };
2382
+ class I extends B {
2383
+ constructor() {
2384
+ super(...arguments), this.active = !1, this.loaded = !1;
2385
+ }
2386
+ connectedCallback() {
2387
+ return Q(this, null, function* () {
2388
+ Gt(I.prototype, this, "connectedCallback").call(this), this.icon = yield this._renderSymbol(this.symbol), this.loaded = !0;
2389
+ });
2390
+ }
2391
+ _toggleActive() {
2392
+ this.active = !this.active;
2393
+ }
2394
+ _renderSymbol(e) {
2395
+ return Q(this, null, function* () {
2396
+ const t = (s) => Q(this, null, function* () {
2397
+ return yield import("./index-9688347a-02584d39.js").then((r) => r[s]);
2398
+ });
2399
+ if (e) {
2400
+ const { type: s, content: r } = e;
2401
+ switch (s) {
2402
+ case "Telia": {
2403
+ const i = yield t(r);
2404
+ return i ? Z`<telia-icon
2405
+ class="trigger-icon"
2406
+ svg=${i.svg}
2407
+ size="lg"
2408
+ ></telia-icon>` : g;
2409
+ }
2410
+ case "FontAwesome":
2411
+ return Z`<i class="trigger-fa-icon fa fa-${r}"></i>`;
2412
+ case "Uri":
2413
+ return Z`<i
2414
+ class="trigger-custom-icon"
2415
+ style="background: url(${r}) no-repeat center center;background-size: contain;"
2416
+ ></i>`;
2417
+ default:
2418
+ return g;
2419
+ }
2420
+ }
2421
+ });
2422
+ }
2423
+ render() {
2424
+ return Z`<button
2425
+ class=${gs({
2426
+ trigger: !0,
2427
+ active: this.active,
2428
+ rendered: this.loaded
2429
+ })}
2430
+ @click=${this._toggleActive}
2431
+ >
2432
+ ${this.icon}
2433
+ <span class="trigger-close">
2434
+ <svg
2435
+ width="18"
2436
+ height="9"
2437
+ viewBox="0 0 18 9"
2438
+ fill="none"
2439
+ xmlns="http://www.w3.org/2000/svg"
2440
+ >
2441
+ <path
2442
+ 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"
2443
+ fill="white"
2444
+ />
2445
+ </svg>
2446
+ </span>
2447
+ <span class="trigger-loader">
2448
+ <svg viewBox="25 25 50 50">
2449
+ <circle
2450
+ cx="50"
2451
+ cy="50"
2452
+ r="20"
2453
+ fill="none"
2454
+ stroke="#000"
2455
+ stroke-width="2"
2456
+ stroke-miterlimit="10"
2457
+ />
2458
+ </svg>
2459
+ </span>
2460
+ </button>`;
2461
+ }
2462
+ }
2463
+ I.styles = [
2464
+ Gn`
2465
+ :host {
2466
+ --voca-rem-multiplier: 0.625;
2467
+ display: block;
2468
+ box-sizing: border-box;
2469
+ }
2470
+
2471
+ .trigger {
2472
+ position: fixed;
2473
+ transform: scale(0);
2474
+ box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
2475
+ bottom: 20px;
2476
+ right: 20px;
2477
+ z-index: 5;
2478
+ display: flex;
2479
+ align-items: center;
2480
+ justify-content: center;
2481
+ border: none;
2482
+ line-height: 55px;
2483
+ height: 55px;
2484
+ width: 55px;
2485
+ border-radius: 55px;
2486
+ cursor: pointer;
2487
+ background-color: #990ae3;
2488
+ font-family: Lato;
2489
+ text-decoration: none;
2490
+ border: 3px dashed transparent;
2491
+ box-sizing: border-box;
2492
+ transition: transform 200ms ease-out;
2493
+ }
2494
+ .trigger:hover {
2495
+ transform: scale(1.1) !important;
2496
+ }
2497
+ .trigger.rendered {
2498
+ transform: scale(1);
2499
+ }
2500
+ .trigger.active .trigger-icon {
2501
+ opacity: 0;
2502
+ transform: rotate(-180deg) scale(0);
2503
+ }
2504
+ .trigger.active .trigger-close {
2505
+ opacity: 1;
2506
+ transform: rotate(0deg) scale(1);
2507
+ }
2508
+
2509
+ .trigger-icon {
2510
+ display: inline-block;
2511
+ line-height: inherit;
2512
+ text-align: center;
2513
+ opacity: 1;
2514
+ transform: rotate(0deg) scale(1);
2515
+ transition:
2516
+ opacity 200ms ease-out,
2517
+ transform 200ms ease-out;
2518
+ color: #ffffff;
2519
+ }
2520
+ .trigger-close {
2521
+ opacity: 0;
2522
+ transition: transform 200ms ease-out;
2523
+ transform: rotate(180deg) scale(0);
2524
+ position: absolute;
2525
+ top: 0;
2526
+ bottom: 0;
2527
+ left: 0;
2528
+ right: 0;
2529
+ display: flex;
2530
+ justify-content: center;
2531
+ align-items: center;
2532
+ fill: #ffffff;
2533
+ }
2534
+ `
2535
+ ];
2536
+ de([
2537
+ Lt({ attribute: !1 })
2538
+ ], I.prototype, "symbol", 2);
2539
+ de([
2540
+ Ke()
2541
+ ], I.prototype, "active", 2);
2542
+ de([
2543
+ Ke()
2544
+ ], I.prototype, "loaded", 2);
2545
+ de([
2546
+ Ke()
2547
+ ], I.prototype, "icon", 2);
2548
+ const ys = "children", bs = "properties", vs = (n, e, t, s, r) => n.getAsync("componentResolver").then((i) => (i.registerComponent(e, t), wn(n, e, s || (() => {
2549
+ }), e, r))), $s = (n) => vs(
2550
+ n,
2551
+ "area",
2552
+ import("./area-9cd4a2a2.js"),
2553
+ (e) => {
2554
+ }
2555
+ );
2556
+ export {
2557
+ $s as A,
2558
+ bs as C,
2559
+ ys as y
2560
+ };
2561
+ //# sourceMappingURL=index-40a90aa7.js.map