@telia-ace/knowledge-data-client-flamingo 1.0.22 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/create-serviceclient.d.ts → create-serviceclient.d.ts} +0 -1
- package/{dist/data-client.d.ts → data-client.d.ts} +0 -1
- package/index-373df3a5.js +6 -0
- package/{dist/index-d70f1e69.js → index-5c9c2abf.mjs} +13 -14
- package/{dist/index.d.ts → index.d.ts} +0 -1
- package/index.js +1 -0
- package/{dist/index.js → index.mjs} +361 -391
- package/{dist/legacy-conversion.d.ts → legacy-conversion.d.ts} +0 -1
- package/package.json +7 -31
- package/{dist/plugin.d.ts → plugin.d.ts} +0 -1
- package/LICENSE.txt +0 -0
- package/README.md +0 -3
- package/dist/create-serviceclient.d.ts.map +0 -1
- package/dist/data-client.d.ts.map +0 -1
- package/dist/index-d70f1e69.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/legacy-conversion.d.ts.map +0 -1
- package/dist/plugin.d.ts.map +0 -1
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var We = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var ue = Object.getOwnPropertySymbols;
|
|
4
|
-
var He = Object.prototype.hasOwnProperty, Ve = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var ge = (n, e, t) => e in n ? Be(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, pe = (n, e) => {
|
|
6
|
-
for (var t in e || (e = {}))
|
|
7
|
-
He.call(e, t) && ge(n, t, e[t]);
|
|
8
|
-
if (ue)
|
|
9
|
-
for (var t of ue(e))
|
|
10
|
-
Ve.call(e, t) && ge(n, t, e[t]);
|
|
11
|
-
return n;
|
|
12
|
-
}, me = (n, e) => Fe(n, We(e));
|
|
13
|
-
var M = (n, e, t) => new Promise((i, s) => {
|
|
14
|
-
var r = (c) => {
|
|
15
|
-
try {
|
|
16
|
-
o(t.next(c));
|
|
17
|
-
} catch (h) {
|
|
18
|
-
s(h);
|
|
19
|
-
}
|
|
20
|
-
}, a = (c) => {
|
|
21
|
-
try {
|
|
22
|
-
o(t.throw(c));
|
|
23
|
-
} catch (h) {
|
|
24
|
-
s(h);
|
|
25
|
-
}
|
|
26
|
-
}, o = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(r, a);
|
|
27
|
-
o((t = t.apply(n, e)).next());
|
|
28
|
-
});
|
|
29
|
-
const Z = (n, e, t, ...i) => {
|
|
1
|
+
const K = (n, e, t, ...i) => {
|
|
30
2
|
const s = `[${n.get("$environment").name || "webprovisions"}] ${t}`;
|
|
31
3
|
switch (e) {
|
|
32
4
|
case "info":
|
|
@@ -39,16 +11,16 @@ const Z = (n, e, t, ...i) => {
|
|
|
39
11
|
console.error(s, ...i);
|
|
40
12
|
break;
|
|
41
13
|
}
|
|
42
|
-
},
|
|
14
|
+
}, De = (n) => {
|
|
43
15
|
const e = n.container || n;
|
|
44
16
|
return {
|
|
45
|
-
info: (t, ...i) =>
|
|
46
|
-
warn: (t, ...i) =>
|
|
47
|
-
error: (t, ...i) =>
|
|
17
|
+
info: (t, ...i) => K(e, "info", t, ...i),
|
|
18
|
+
warn: (t, ...i) => K(e, "warning", t, ...i),
|
|
19
|
+
error: (t, ...i) => K(e, "error", t, ...i)
|
|
48
20
|
};
|
|
49
21
|
};
|
|
50
|
-
var
|
|
51
|
-
const
|
|
22
|
+
var D = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(D || {}), x = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(x || {});
|
|
23
|
+
const Ge = (n, e, t, i) => {
|
|
52
24
|
try {
|
|
53
25
|
const s = new e(t, i);
|
|
54
26
|
return {
|
|
@@ -72,23 +44,23 @@ const Ye = (n, e, t, i) => {
|
|
|
72
44
|
throw s;
|
|
73
45
|
}
|
|
74
46
|
};
|
|
75
|
-
function
|
|
76
|
-
return typeof n
|
|
47
|
+
function de(n, e) {
|
|
48
|
+
return typeof n > "u" ? e : n;
|
|
77
49
|
}
|
|
78
|
-
let
|
|
50
|
+
let Te = class {
|
|
79
51
|
constructor(e = {}) {
|
|
80
52
|
this.part = e;
|
|
81
53
|
}
|
|
82
54
|
createCommand(e, t, i) {
|
|
83
55
|
let s;
|
|
84
56
|
typeof t == "function" ? s = {
|
|
85
|
-
scope:
|
|
57
|
+
scope: D.Widget,
|
|
86
58
|
stage: x.Post,
|
|
87
59
|
defaultArgs: void 0,
|
|
88
60
|
handlerResolver: t
|
|
89
61
|
} : s = {
|
|
90
|
-
scope:
|
|
91
|
-
stage:
|
|
62
|
+
scope: de(t.scope, D.Widget),
|
|
63
|
+
stage: de(t.stage, x.Post),
|
|
92
64
|
defaultArgs: t.defaultArgs,
|
|
93
65
|
handlerResolver: i
|
|
94
66
|
};
|
|
@@ -102,14 +74,14 @@ let Ke = class {
|
|
|
102
74
|
return this.part;
|
|
103
75
|
}
|
|
104
76
|
};
|
|
105
|
-
const
|
|
106
|
-
const e = new
|
|
77
|
+
const Ae = (n) => {
|
|
78
|
+
const e = new Te({});
|
|
107
79
|
return n(e), e.get();
|
|
108
80
|
};
|
|
109
|
-
|
|
81
|
+
Ae((n) => {
|
|
110
82
|
n.createCommand(
|
|
111
83
|
"types.register",
|
|
112
|
-
{ scope:
|
|
84
|
+
{ scope: D.Implementation, stage: x.Pre },
|
|
113
85
|
(e) => (t, i) => {
|
|
114
86
|
e.container.get("$types")[t] = i;
|
|
115
87
|
}
|
|
@@ -144,7 +116,7 @@ Me((n) => {
|
|
|
144
116
|
o
|
|
145
117
|
) : i;
|
|
146
118
|
try {
|
|
147
|
-
const p =
|
|
119
|
+
const p = Ge(
|
|
148
120
|
a,
|
|
149
121
|
o,
|
|
150
122
|
r,
|
|
@@ -152,7 +124,7 @@ Me((n) => {
|
|
|
152
124
|
);
|
|
153
125
|
r.get("$plugins").push(p), d && p.invoke("initialize", null);
|
|
154
126
|
} catch (p) {
|
|
155
|
-
|
|
127
|
+
De(e).warn("Error when initializing plugin", p);
|
|
156
128
|
}
|
|
157
129
|
};
|
|
158
130
|
e.container.get("$instance") ? h(!0) : e.events.subscribeOnce("widget:instance-created", () => h(!1));
|
|
@@ -185,10 +157,10 @@ Me((n) => {
|
|
|
185
157
|
}
|
|
186
158
|
);
|
|
187
159
|
});
|
|
188
|
-
const
|
|
160
|
+
const ze = Ae((n) => {
|
|
189
161
|
n.createCommand(
|
|
190
162
|
"ready",
|
|
191
|
-
{ scope:
|
|
163
|
+
{ scope: D.Implementation, stage: x.Pre },
|
|
192
164
|
(e) => (t) => {
|
|
193
165
|
const { container: i } = e, s = i.owner;
|
|
194
166
|
i.get("bootstrapping").ready ? t(s) : s.events.subscribeOnce("bootstrap:ready", () => {
|
|
@@ -196,11 +168,11 @@ const Ze = Me((n) => {
|
|
|
196
168
|
});
|
|
197
169
|
}
|
|
198
170
|
);
|
|
199
|
-
}),
|
|
200
|
-
function
|
|
201
|
-
return (n) => (
|
|
171
|
+
}), Z = /* @__PURE__ */ new WeakMap();
|
|
172
|
+
function R() {
|
|
173
|
+
return (n) => (Z.has(n) || Z.set(n, {}), Z.get(n));
|
|
202
174
|
}
|
|
203
|
-
const
|
|
175
|
+
const J = (n, e, t, ...i) => {
|
|
204
176
|
const s = `[${n.get("$environment").name || "webprovisions"}] ${t}`;
|
|
205
177
|
switch (e) {
|
|
206
178
|
case "info":
|
|
@@ -216,46 +188,46 @@ const X = (n, e, t, ...i) => {
|
|
|
216
188
|
}, v = (n) => {
|
|
217
189
|
const e = n.container || n;
|
|
218
190
|
return {
|
|
219
|
-
info: (t, ...i) =>
|
|
220
|
-
warn: (t, ...i) =>
|
|
221
|
-
error: (t, ...i) =>
|
|
191
|
+
info: (t, ...i) => J(e, "info", t, ...i),
|
|
192
|
+
warn: (t, ...i) => J(e, "warning", t, ...i),
|
|
193
|
+
error: (t, ...i) => J(e, "error", t, ...i)
|
|
222
194
|
};
|
|
223
|
-
}, m =
|
|
195
|
+
}, m = R(), se = (() => {
|
|
224
196
|
let n = 0;
|
|
225
197
|
return () => ++n;
|
|
226
|
-
})(),
|
|
198
|
+
})(), re = (n, e, t) => {
|
|
227
199
|
const i = m(n).touchQueue.get(e);
|
|
228
200
|
i && i.forEach((s) => {
|
|
229
201
|
s(t, n);
|
|
230
202
|
});
|
|
231
203
|
};
|
|
232
|
-
class
|
|
204
|
+
class Ue {
|
|
233
205
|
constructor(e, t, i, s) {
|
|
234
|
-
this.key = e, this.factory = t, this.parent = i, this.container = s, this.id =
|
|
206
|
+
this.key = e, this.factory = t, this.parent = i, this.container = s, this.id = se(), this.resolved = !1, this.constructed = !1, this.async = !0;
|
|
235
207
|
}
|
|
236
208
|
resolve() {
|
|
237
209
|
if (!this.constructed) {
|
|
238
210
|
const e = this.factory(this.parent, this.container);
|
|
239
|
-
return this.constructed = !0, this.value = Promise.resolve(e).then((t) => (this.resolved = !0,
|
|
211
|
+
return this.constructed = !0, this.value = Promise.resolve(e).then((t) => (this.resolved = !0, re(this.container, this.key, t), t));
|
|
240
212
|
}
|
|
241
213
|
return this.value;
|
|
242
214
|
}
|
|
243
215
|
}
|
|
244
|
-
class
|
|
216
|
+
class Be {
|
|
245
217
|
constructor(e, t, i, s) {
|
|
246
|
-
this.key = e, this.value = t, this.parent = i, this.container = s, this.id =
|
|
218
|
+
this.key = e, this.value = t, this.parent = i, this.container = s, this.id = se(), this.async = !1, this.resolved = !1, this.constructed = !0, this.resolve = () => (this.resolved = !0, re(this.container, this.key, this.value), this.value);
|
|
247
219
|
}
|
|
248
220
|
}
|
|
249
|
-
class
|
|
221
|
+
class Fe {
|
|
250
222
|
constructor(e, t, i, s) {
|
|
251
|
-
this.key = e, this.value = t, this.parent = i, this.container = s, this.id =
|
|
223
|
+
this.key = e, this.value = t, this.parent = i, this.container = s, this.id = se(), this.async = !1, this.resolved = !1, this.constructed = !1, this.resolve = () => {
|
|
252
224
|
this.resolved = !0, this.constructed = !0;
|
|
253
225
|
const r = this.value(this.parent, this.container);
|
|
254
|
-
return
|
|
226
|
+
return re(this.container, this.key, this.value), r;
|
|
255
227
|
};
|
|
256
228
|
}
|
|
257
229
|
}
|
|
258
|
-
class
|
|
230
|
+
class oe {
|
|
259
231
|
/**
|
|
260
232
|
* Creates a new instance of `Container`.
|
|
261
233
|
* @param owner The object owning this inctance.
|
|
@@ -323,7 +295,7 @@ class ae {
|
|
|
323
295
|
registerAsync(e, t) {
|
|
324
296
|
const i = m(this).resolvers.get(e);
|
|
325
297
|
i && !i.async && process.env.NODE_ENV !== "production" && v(this).warn(`Mismatching resolver type. You are registering an async resolver with a key ('${e}') previously used by a non-async resolver.`);
|
|
326
|
-
const s = new
|
|
298
|
+
const s = new Ue(e, t, i, this);
|
|
327
299
|
return m(this).resolvers.set(e, s), s.id;
|
|
328
300
|
}
|
|
329
301
|
/**
|
|
@@ -334,7 +306,7 @@ class ae {
|
|
|
334
306
|
registerFactory(e, t) {
|
|
335
307
|
const i = m(this).resolvers.get(e);
|
|
336
308
|
i && i.async && process.env.NODE_ENV !== "production" && v(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${e}') previously used by an async resolver.`);
|
|
337
|
-
const s = new
|
|
309
|
+
const s = new Fe(e, t, i, this);
|
|
338
310
|
return m(this).resolvers.set(e, s), s.id;
|
|
339
311
|
}
|
|
340
312
|
/**
|
|
@@ -345,7 +317,7 @@ class ae {
|
|
|
345
317
|
register(e, t) {
|
|
346
318
|
const i = m(this).resolvers.get(e);
|
|
347
319
|
i && i.async && process.env.NODE_ENV !== "production" && v(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${e}') previously used by an async resolver.`);
|
|
348
|
-
const s = new
|
|
320
|
+
const s = new Be(e, t, i, this);
|
|
349
321
|
return m(this).resolvers.set(e, s), s.id;
|
|
350
322
|
}
|
|
351
323
|
/**
|
|
@@ -381,11 +353,11 @@ class ae {
|
|
|
381
353
|
return Promise.all(e.map((i) => this.getAsync(i).then((s) => t[i] = s))).then(() => t);
|
|
382
354
|
}
|
|
383
355
|
createChild(e, t) {
|
|
384
|
-
const i = new
|
|
356
|
+
const i = new oe(e, t, this);
|
|
385
357
|
return m(this).children.push(i), i;
|
|
386
358
|
}
|
|
387
359
|
}
|
|
388
|
-
class
|
|
360
|
+
class ue {
|
|
389
361
|
/**
|
|
390
362
|
*
|
|
391
363
|
* @param type Type of event.
|
|
@@ -403,14 +375,14 @@ class ve {
|
|
|
403
375
|
this.cancelable && (this.defaultPrevented = !0);
|
|
404
376
|
}
|
|
405
377
|
}
|
|
406
|
-
const $ =
|
|
378
|
+
const $ = R(), ge = (n, e) => [].concat(
|
|
407
379
|
$(n).listenerLookup.get(e.toLowerCase()) || [],
|
|
408
380
|
$(n).listenerLookup.get("*") || []
|
|
409
|
-
),
|
|
381
|
+
), pe = (n, e, t, i) => {
|
|
410
382
|
let s, r;
|
|
411
|
-
return e instanceof
|
|
383
|
+
return e instanceof ue ? (s = e, r = e.type) : (s = new ue(e, n.target, !!t.cancelable, !!t.bubbles), r = e), { event: s, type: r, async: i };
|
|
412
384
|
};
|
|
413
|
-
let
|
|
385
|
+
let We = class Ne {
|
|
414
386
|
/**
|
|
415
387
|
* Creates a new Event Manager instance.
|
|
416
388
|
* @param target The target of events dispatched from this Event Manager instance.
|
|
@@ -470,7 +442,7 @@ let tt = class Re {
|
|
|
470
442
|
* @param options Optional event options used if first parameter is an event type.
|
|
471
443
|
*/
|
|
472
444
|
dispatchAsync(e, t, i = {}) {
|
|
473
|
-
const { event: s, type: r } =
|
|
445
|
+
const { event: s, type: r } = pe(this, e, i, !0), a = ge(this, r);
|
|
474
446
|
let o = 0;
|
|
475
447
|
const c = a.length;
|
|
476
448
|
let h = Promise.resolve();
|
|
@@ -487,7 +459,7 @@ let tt = class Re {
|
|
|
487
459
|
* @param options Optional event options used if first parameter is an event type.
|
|
488
460
|
*/
|
|
489
461
|
dispatch(e, t, i = {}) {
|
|
490
|
-
const { event: s, type: r } =
|
|
462
|
+
const { event: s, type: r } = pe(this, e, i, !1), a = ge(this, r);
|
|
491
463
|
let o = 0;
|
|
492
464
|
const c = a.length;
|
|
493
465
|
let h = !1;
|
|
@@ -502,11 +474,11 @@ let tt = class Re {
|
|
|
502
474
|
* Creates a child instance to the current Event manager.
|
|
503
475
|
*/
|
|
504
476
|
createChild(e) {
|
|
505
|
-
const t = new
|
|
477
|
+
const t = new Ne(e, this);
|
|
506
478
|
return $(this).children.push(t), t;
|
|
507
479
|
}
|
|
508
480
|
};
|
|
509
|
-
const
|
|
481
|
+
const z = (n, e, t) => {
|
|
510
482
|
const i = n.get("$plugins").map((s) => {
|
|
511
483
|
try {
|
|
512
484
|
return s.invoke(e, t);
|
|
@@ -516,7 +488,7 @@ const U = (n, e, t) => {
|
|
|
516
488
|
});
|
|
517
489
|
return Promise.all(i);
|
|
518
490
|
};
|
|
519
|
-
let
|
|
491
|
+
let He = class {
|
|
520
492
|
constructor(e) {
|
|
521
493
|
this.widget = e.get("$widget"), this.events = this.widget.events, this.container = this.widget.container, this.initialized = null, this.activated = null, this.initialize = this.initialize.bind(this), this.activate = this.activate.bind(this), this.deactivate = this.deactivate.bind(this), this.invoke = this.invoke.bind(this), this.createInstance();
|
|
522
494
|
}
|
|
@@ -547,7 +519,7 @@ let nt = class {
|
|
|
547
519
|
return this.initialized = this.initialized || (() => {
|
|
548
520
|
const t = this.container.get("$instance"), i = t.initialize || (() => {
|
|
549
521
|
});
|
|
550
|
-
return this.initialized = Promise.resolve(i.call(t, e)).then(() =>
|
|
522
|
+
return this.initialized = Promise.resolve(i.call(t, e)).then(() => z(this.container, "initialize", e)).then(() => {
|
|
551
523
|
});
|
|
552
524
|
})();
|
|
553
525
|
}
|
|
@@ -559,7 +531,7 @@ let nt = class {
|
|
|
559
531
|
*/
|
|
560
532
|
activate(e) {
|
|
561
533
|
return (this.initialized || this.initialize()).then(() => {
|
|
562
|
-
this.activated = this.activated || (() =>
|
|
534
|
+
this.activated = this.activated || (() => z(this.container, "activate").then(() => {
|
|
563
535
|
const t = this.container.get("$instance");
|
|
564
536
|
return this.activated = t.activate(e);
|
|
565
537
|
}))();
|
|
@@ -568,7 +540,7 @@ let nt = class {
|
|
|
568
540
|
deactivate() {
|
|
569
541
|
const e = this.container.get("$instance"), t = e.deactivate || (() => {
|
|
570
542
|
});
|
|
571
|
-
return
|
|
543
|
+
return z(this.container, "deactivate").then(() => Promise.resolve(t.call(e))).then(() => {
|
|
572
544
|
this.initialized = null, this.activated = null;
|
|
573
545
|
}).then(() => {
|
|
574
546
|
});
|
|
@@ -579,7 +551,7 @@ let nt = class {
|
|
|
579
551
|
* @param args Command arguments
|
|
580
552
|
*/
|
|
581
553
|
invoke(e, ...t) {
|
|
582
|
-
return
|
|
554
|
+
return z(this.container, "invoke", { command: e, args: t }).then(() => {
|
|
583
555
|
const i = this.container.get("$instance");
|
|
584
556
|
if (i[e])
|
|
585
557
|
return i[e].apply(i, t);
|
|
@@ -589,7 +561,7 @@ let nt = class {
|
|
|
589
561
|
});
|
|
590
562
|
}
|
|
591
563
|
};
|
|
592
|
-
const
|
|
564
|
+
const M = (n, e) => {
|
|
593
565
|
if (!e)
|
|
594
566
|
return !0;
|
|
595
567
|
if (typeof e == "string") {
|
|
@@ -601,34 +573,34 @@ const R = (n, e) => {
|
|
|
601
573
|
}
|
|
602
574
|
}
|
|
603
575
|
return e instanceof Array ? e.indexOf(n) > -1 : !1;
|
|
604
|
-
},
|
|
576
|
+
}, Ve = (n, e) => {
|
|
605
577
|
if (typeof e == "function")
|
|
606
578
|
return e(n);
|
|
607
|
-
const t = typeof e == "string" ?
|
|
608
|
-
return !(!
|
|
609
|
-
},
|
|
579
|
+
const t = typeof e == "string" ? Ke(e) : e;
|
|
580
|
+
return !(!M(n.implementation.tenant || "", t.tenant || "") || !M(n.implementation.name, t.implementation || "") || !M(n.name, t.widget || "") || !M(n.container.get("$type"), t.type || ""));
|
|
581
|
+
}, Qe = (n, e) => {
|
|
610
582
|
if (typeof e == "function")
|
|
611
583
|
return e(n);
|
|
612
|
-
const t = typeof e == "string" ?
|
|
613
|
-
return !(!
|
|
614
|
-
},
|
|
584
|
+
const t = typeof e == "string" ? Ze(e) : e;
|
|
585
|
+
return !(!M(n.tenant || "", t.tenant || "") || !M(n.name, t.implementation || ""));
|
|
586
|
+
}, xe = (n) => (e) => Ve(e, n), Ye = (n) => (e) => Qe(e, n), E = (n) => n instanceof Array && n.length === 1 ? n[0] : n, Ke = (n) => {
|
|
615
587
|
const e = {}, t = n.split(":");
|
|
616
588
|
return t.length === 1 ? e.widget = E(t[0].split(",")) : t.length === 2 ? (e.implementation = E(t[0].split(",")), e.widget = E(t[1].split(","))) : (e.tenant = E(t[0].split(",")), e.implementation = E(t[1].split(",")), e.widget = E(t[2].split(","))), e;
|
|
617
|
-
},
|
|
589
|
+
}, Ze = (n) => {
|
|
618
590
|
const e = {}, t = n.split(":");
|
|
619
591
|
return t.length === 1 ? e.implementation = E(t[0].split(",")) : (e.tenant = E(t[0].split(",")), e.implementation = E(t[1].split(","))), e;
|
|
620
|
-
},
|
|
621
|
-
function
|
|
592
|
+
}, W = R(), me = (n, e, t) => n.filter((i) => i.stage === e && xe(i.selector)(t));
|
|
593
|
+
function Je(n) {
|
|
622
594
|
const e = n.container.get("$environment");
|
|
623
|
-
let t =
|
|
624
|
-
t && (t = t.filter((i) => i[0] !== n),
|
|
595
|
+
let t = W(e).configurationCache;
|
|
596
|
+
t && (t = t.filter((i) => i[0] !== n), W(e).configurationCache = t);
|
|
625
597
|
}
|
|
626
|
-
var
|
|
627
|
-
const
|
|
598
|
+
var H = /* @__PURE__ */ ((n) => (n.Implementation = "implementation", n.Widget = "widget", n))(H || {}), A = /* @__PURE__ */ ((n) => (n.Pre = "pre", n.Post = "post", n))(A || {});
|
|
599
|
+
const Oe = (n, e, t) => (Object.keys(e).forEach((i) => {
|
|
628
600
|
const s = e[i];
|
|
629
601
|
if (typeof s == "function") {
|
|
630
602
|
const r = s();
|
|
631
|
-
typeof r.defaultArgs
|
|
603
|
+
typeof r.defaultArgs < "u" && t(r, ...r.defaultArgs), n[i] = (...a) => {
|
|
632
604
|
const o = Object.assign(
|
|
633
605
|
{},
|
|
634
606
|
r,
|
|
@@ -637,20 +609,20 @@ const Se = (n, e, t) => (Object.keys(e).forEach((i) => {
|
|
|
637
609
|
return t(o, ...a), n;
|
|
638
610
|
};
|
|
639
611
|
} else
|
|
640
|
-
n[i] =
|
|
612
|
+
n[i] = Oe(
|
|
641
613
|
{},
|
|
642
614
|
s,
|
|
643
615
|
t
|
|
644
616
|
);
|
|
645
|
-
}), n),
|
|
617
|
+
}), n), Xe = (n, e) => {
|
|
646
618
|
switch (e) {
|
|
647
619
|
case "implementation":
|
|
648
620
|
return n.implementation;
|
|
649
621
|
case "widget":
|
|
650
622
|
return n;
|
|
651
623
|
}
|
|
652
|
-
},
|
|
653
|
-
|
|
624
|
+
}, fe = (n, e, t, i) => (i.forEach((s) => {
|
|
625
|
+
Oe(
|
|
654
626
|
n,
|
|
655
627
|
s,
|
|
656
628
|
(r, ...a) => {
|
|
@@ -658,32 +630,32 @@ const Se = (n, e, t) => (Object.keys(e).forEach((i) => {
|
|
|
658
630
|
selector: e,
|
|
659
631
|
stage: r.stage,
|
|
660
632
|
handler: (c) => {
|
|
661
|
-
const h =
|
|
662
|
-
let p =
|
|
663
|
-
return p || (p =
|
|
633
|
+
const h = Xe(c, r.scope), d = { container: h.container, events: h.events }, g = r.handlerResolver, u = g(d);
|
|
634
|
+
let p = W(t.environment).configurationCache;
|
|
635
|
+
return p || (p = W(t.environment).configurationCache = []), p.find((b) => b.indexOf(h) > -1 && b.indexOf(g) > -1) ? Promise.resolve() : (p.push([h, g]), Promise.resolve(u(...a)));
|
|
664
636
|
}
|
|
665
637
|
};
|
|
666
638
|
t.instructions.push(o);
|
|
667
639
|
}
|
|
668
640
|
);
|
|
669
641
|
}), n);
|
|
670
|
-
function
|
|
642
|
+
function et(n, e) {
|
|
671
643
|
function t(i) {
|
|
672
|
-
return
|
|
644
|
+
return fe(
|
|
673
645
|
{},
|
|
674
646
|
i,
|
|
675
647
|
n,
|
|
676
648
|
e
|
|
677
649
|
);
|
|
678
650
|
}
|
|
679
|
-
return
|
|
651
|
+
return fe(
|
|
680
652
|
t,
|
|
681
653
|
"*",
|
|
682
654
|
n,
|
|
683
655
|
e
|
|
684
656
|
);
|
|
685
657
|
}
|
|
686
|
-
const
|
|
658
|
+
const tt = (n, e, t, i) => {
|
|
687
659
|
try {
|
|
688
660
|
const s = new e(t, i);
|
|
689
661
|
return {
|
|
@@ -707,23 +679,23 @@ const dt = (n, e, t, i) => {
|
|
|
707
679
|
throw s;
|
|
708
680
|
}
|
|
709
681
|
};
|
|
710
|
-
function
|
|
711
|
-
return typeof n
|
|
682
|
+
function ve(n, e) {
|
|
683
|
+
return typeof n > "u" ? e : n;
|
|
712
684
|
}
|
|
713
|
-
let
|
|
685
|
+
let nt = class {
|
|
714
686
|
constructor(e = {}) {
|
|
715
687
|
this.part = e;
|
|
716
688
|
}
|
|
717
689
|
createCommand(e, t, i) {
|
|
718
690
|
let s;
|
|
719
691
|
typeof t == "function" ? s = {
|
|
720
|
-
scope:
|
|
692
|
+
scope: H.Widget,
|
|
721
693
|
stage: A.Post,
|
|
722
694
|
defaultArgs: void 0,
|
|
723
695
|
handlerResolver: t
|
|
724
696
|
} : s = {
|
|
725
|
-
scope:
|
|
726
|
-
stage:
|
|
697
|
+
scope: ve(t.scope, H.Widget),
|
|
698
|
+
stage: ve(t.stage, A.Post),
|
|
727
699
|
defaultArgs: t.defaultArgs,
|
|
728
700
|
handlerResolver: i
|
|
729
701
|
};
|
|
@@ -737,13 +709,13 @@ let ut = class {
|
|
|
737
709
|
return this.part;
|
|
738
710
|
}
|
|
739
711
|
};
|
|
740
|
-
const
|
|
741
|
-
const e = new
|
|
712
|
+
const Ie = (n) => {
|
|
713
|
+
const e = new nt({});
|
|
742
714
|
return n(e), e.get();
|
|
743
|
-
},
|
|
715
|
+
}, it = Ie((n) => {
|
|
744
716
|
n.createCommand(
|
|
745
717
|
"types.register",
|
|
746
|
-
{ scope:
|
|
718
|
+
{ scope: H.Implementation, stage: A.Pre },
|
|
747
719
|
(e) => (t, i) => {
|
|
748
720
|
e.container.get("$types")[t] = i;
|
|
749
721
|
}
|
|
@@ -778,7 +750,7 @@ const Le = (n) => {
|
|
|
778
750
|
o
|
|
779
751
|
) : i;
|
|
780
752
|
try {
|
|
781
|
-
const p =
|
|
753
|
+
const p = tt(
|
|
782
754
|
a,
|
|
783
755
|
o,
|
|
784
756
|
r,
|
|
@@ -818,15 +790,15 @@ const Le = (n) => {
|
|
|
818
790
|
e.container.register("csp", t);
|
|
819
791
|
}
|
|
820
792
|
);
|
|
821
|
-
}),
|
|
822
|
-
function
|
|
823
|
-
const i = [
|
|
793
|
+
}), st = it;
|
|
794
|
+
function rt(n, e, t = []) {
|
|
795
|
+
const i = [st].concat(t), s = et(
|
|
824
796
|
e,
|
|
825
797
|
i
|
|
826
798
|
);
|
|
827
799
|
n(s, e);
|
|
828
800
|
}
|
|
829
|
-
class
|
|
801
|
+
class ot {
|
|
830
802
|
constructor() {
|
|
831
803
|
this.tasks = [], this.current = Promise.resolve(), this.next = this.next.bind(this);
|
|
832
804
|
}
|
|
@@ -846,22 +818,22 @@ class ft {
|
|
|
846
818
|
});
|
|
847
819
|
}
|
|
848
820
|
}
|
|
849
|
-
const
|
|
850
|
-
function
|
|
851
|
-
return
|
|
852
|
-
const s =
|
|
821
|
+
const U = /* @__PURE__ */ new WeakMap();
|
|
822
|
+
function at(n) {
|
|
823
|
+
return U.has(n) || U.set(n, new ot()), (e) => new Promise((t, i) => {
|
|
824
|
+
const s = U.get(n);
|
|
853
825
|
s.add(e, t, i, () => {
|
|
854
|
-
s.tasks.length ||
|
|
826
|
+
s.tasks.length || U.delete(n);
|
|
855
827
|
});
|
|
856
828
|
});
|
|
857
829
|
}
|
|
858
|
-
const
|
|
830
|
+
const ye = (n) => typeof n < "u", S = (n, e) => {
|
|
859
831
|
n.events.dispatch("widget:state-change", { state: e }, { bubbles: !0 }), n.state = e, n.events.dispatch("widget:state-changed", {}, { bubbles: !0 });
|
|
860
|
-
}, y =
|
|
832
|
+
}, y = R(), ct = (n) => {
|
|
861
833
|
const { container: e, events: t } = n;
|
|
862
|
-
e.get("$controller") || (e.register("$controller", new
|
|
834
|
+
e.get("$controller") || (e.register("$controller", new He(e)), t.dispatch("widget:controller-created", {}, { bubbles: !0 }));
|
|
863
835
|
};
|
|
864
|
-
let
|
|
836
|
+
let ht = class {
|
|
865
837
|
/**
|
|
866
838
|
* Creates a new `Widget` instance.
|
|
867
839
|
* @param name Name of widget.
|
|
@@ -871,7 +843,7 @@ let bt = class {
|
|
|
871
843
|
constructor(e, t, i) {
|
|
872
844
|
this.state = "deactivated", this.name = e, this.implementation = t, this.container = t.container.createChild(this, e), this.events = t.events.createChild(this), y(this).subscriptions = [], i && t.configure((s) => {
|
|
873
845
|
const r = s(e);
|
|
874
|
-
|
|
846
|
+
ye(i.type) && r.type(i.type), ye(i.settings) && r.settings(i.settings), i.plugins && Object.keys(i.plugins).forEach((a) => {
|
|
875
847
|
var o;
|
|
876
848
|
const c = (o = i.plugins) == null ? void 0 : o[a];
|
|
877
849
|
r.plugin(a, c);
|
|
@@ -883,26 +855,26 @@ let bt = class {
|
|
|
883
855
|
* pending configuration.
|
|
884
856
|
*/
|
|
885
857
|
load() {
|
|
886
|
-
return
|
|
858
|
+
return at(this)(() => {
|
|
887
859
|
y(this).deactivatedPromise = null;
|
|
888
860
|
const e = this.state === "deactivated";
|
|
889
|
-
e && (
|
|
861
|
+
e && (S(
|
|
890
862
|
this,
|
|
891
863
|
"activating"
|
|
892
864
|
/* Activating */
|
|
893
|
-
), this.container.register("$widget", this), this.container.register("$controller", null), this.container.register("$plugins", []), this.container.register("$type", null), this.container.register("$instance", null)),
|
|
865
|
+
), this.container.register("$widget", this), this.container.register("$controller", null), this.container.register("$plugins", []), this.container.register("$type", null), this.container.register("$instance", null)), S(
|
|
894
866
|
this,
|
|
895
867
|
"loading"
|
|
896
868
|
/* Loading */
|
|
897
869
|
);
|
|
898
|
-
const t = this.implementation.instructions, i =
|
|
870
|
+
const t = this.implementation.instructions, i = me(t, A.Pre, this);
|
|
899
871
|
return Promise.all(i.map((s) => s.handler(this))).then(() => {
|
|
900
|
-
|
|
901
|
-
const s =
|
|
872
|
+
ct(this);
|
|
873
|
+
const s = me(t, A.Post, this);
|
|
902
874
|
return Promise.all(s.map((r) => r.handler(this))).then(() => {
|
|
903
875
|
e && this.container.get("$controller").initialize();
|
|
904
876
|
});
|
|
905
|
-
}).then(() => (
|
|
877
|
+
}).then(() => (S(
|
|
906
878
|
this,
|
|
907
879
|
"activated"
|
|
908
880
|
/* Activated */
|
|
@@ -946,12 +918,12 @@ let bt = class {
|
|
|
946
918
|
* `EventManager`.
|
|
947
919
|
*/
|
|
948
920
|
deactivate() {
|
|
949
|
-
return y(this).deactivatedPromise || (this.state === "deactivated" ? Promise.resolve() : (
|
|
921
|
+
return y(this).deactivatedPromise || (this.state === "deactivated" ? Promise.resolve() : (S(
|
|
950
922
|
this,
|
|
951
923
|
"deactivating"
|
|
952
924
|
/* Deactivating */
|
|
953
925
|
), y(this).deactivatedPromise = this.container.get("$controller").deactivate().then(() => (y(this).activatedPromise = null, y(this).subscriptions.forEach((t) => t()), y(this).subscriptions = [], this.container.clear().then(() => {
|
|
954
|
-
this.events.clear(),
|
|
926
|
+
this.events.clear(), Je(this), S(
|
|
955
927
|
this,
|
|
956
928
|
"deactivated"
|
|
957
929
|
/* Deactivated */
|
|
@@ -959,8 +931,8 @@ let bt = class {
|
|
|
959
931
|
})))));
|
|
960
932
|
}
|
|
961
933
|
};
|
|
962
|
-
const
|
|
963
|
-
class
|
|
934
|
+
const be = R();
|
|
935
|
+
class lt {
|
|
964
936
|
/**
|
|
965
937
|
* Creates a new Implementation instance.
|
|
966
938
|
* @param configuration Configuration for the implementation.
|
|
@@ -968,7 +940,7 @@ class wt {
|
|
|
968
940
|
* @param configurationApiExtensions Optional configuration API extensions.
|
|
969
941
|
*/
|
|
970
942
|
constructor(e, t, i = []) {
|
|
971
|
-
this.instructions = [], this.widgets = /* @__PURE__ */ new Map(), this.name = e.name, this.tenant = e.tenant, this.environment = t, this.container = t.container.createChild(this, this.name), this.events = t.events.createChild(this), this.container.register("$types", {}),
|
|
943
|
+
this.instructions = [], this.widgets = /* @__PURE__ */ new Map(), this.name = e.name, this.tenant = e.tenant, this.environment = t, this.container = t.container.createChild(this, this.name), this.events = t.events.createChild(this), this.container.register("$types", {}), be(this).configurationApiExtensions = i;
|
|
972
944
|
}
|
|
973
945
|
/**
|
|
974
946
|
* Loads all widgets in the implementation.
|
|
@@ -982,7 +954,7 @@ class wt {
|
|
|
982
954
|
* @param configFn Callback function for configuration.
|
|
983
955
|
*/
|
|
984
956
|
configure(e) {
|
|
985
|
-
return
|
|
957
|
+
return rt(e, this, be(this).configurationApiExtensions), this.events.dispatch(
|
|
986
958
|
"implementation:configured",
|
|
987
959
|
{ implementation: this },
|
|
988
960
|
{ bubbles: !0 }
|
|
@@ -994,25 +966,25 @@ class wt {
|
|
|
994
966
|
* @param configuration Widget configuration.
|
|
995
967
|
*/
|
|
996
968
|
createWidget(e, t) {
|
|
997
|
-
const i = new
|
|
969
|
+
const i = new ht(e, this, t);
|
|
998
970
|
return this.widgets.set(i.name, i), i;
|
|
999
971
|
}
|
|
1000
972
|
}
|
|
1001
|
-
function
|
|
1002
|
-
const i = new
|
|
973
|
+
function dt(n, e, t) {
|
|
974
|
+
const i = new lt(n, e, t);
|
|
1003
975
|
return n.widgets && Object.keys(n.widgets).forEach((s) => {
|
|
1004
976
|
var r;
|
|
1005
977
|
const a = (r = n.widgets) == null ? void 0 : r[s];
|
|
1006
978
|
i.createWidget(s, a);
|
|
1007
979
|
}), i;
|
|
1008
980
|
}
|
|
1009
|
-
let
|
|
981
|
+
let we = class Me {
|
|
1010
982
|
constructor(e, t) {
|
|
1011
983
|
this.selectorFactory = t, typeof e == "function" ? this.resolver = e : this.resolver = () => e;
|
|
1012
984
|
}
|
|
1013
985
|
append(e) {
|
|
1014
986
|
const t = typeof e == "function" ? e : () => e;
|
|
1015
|
-
return new
|
|
987
|
+
return new Me(
|
|
1016
988
|
() => this.all().concat(t()),
|
|
1017
989
|
this.selectorFactory
|
|
1018
990
|
);
|
|
@@ -1029,29 +1001,29 @@ let Ee = class je {
|
|
|
1029
1001
|
return t[0];
|
|
1030
1002
|
}
|
|
1031
1003
|
};
|
|
1032
|
-
const
|
|
1004
|
+
const ae = "#____version____#", X = R(), ut = (n) => n.tenant ? `${n.name}:${n.tenant}` : n.name, Re = class {
|
|
1033
1005
|
constructor(e, t = [], i = {}) {
|
|
1034
|
-
this.widgets = new
|
|
1006
|
+
this.widgets = new we(
|
|
1035
1007
|
() => {
|
|
1036
1008
|
let s = [];
|
|
1037
1009
|
return this.implementations.all().forEach((r) => {
|
|
1038
1010
|
s = s.concat(Array.from(r.widgets.values()));
|
|
1039
1011
|
}), s;
|
|
1040
1012
|
},
|
|
1041
|
-
|
|
1042
|
-
), this.implementations = new
|
|
1013
|
+
xe
|
|
1014
|
+
), this.implementations = new we([], Ye), this.name = e, this.container = new oe(this, e), this.events = new We(this), this.container.register("$version", ae), this.container.register("$environment", this), this.container.register("$environmentOptions", i), X(this).configurationApiExtensions = t;
|
|
1043
1015
|
}
|
|
1044
1016
|
/**
|
|
1045
1017
|
* Creates an implementation based on the provided configuration.
|
|
1046
1018
|
* @param config Implementation configuration.
|
|
1047
1019
|
*/
|
|
1048
1020
|
createImplementation(e) {
|
|
1049
|
-
const t =
|
|
1021
|
+
const t = ut(e);
|
|
1050
1022
|
let i = this.implementations.find(t);
|
|
1051
1023
|
if (i)
|
|
1052
1024
|
return process.env.NODE_ENV !== "production" && v(i).warn(`Implementation "${t}" already exist on current environment.`), i;
|
|
1053
|
-
const s =
|
|
1054
|
-
return i =
|
|
1025
|
+
const s = X(this).configurationApiExtensions;
|
|
1026
|
+
return i = dt(
|
|
1055
1027
|
e,
|
|
1056
1028
|
this,
|
|
1057
1029
|
s
|
|
@@ -1063,9 +1035,9 @@ const ce = "#____version____#", ee = _(), Ct = (n) => n.tenant ? `${n.name}:${n.
|
|
|
1063
1035
|
*/
|
|
1064
1036
|
patch(e = {}) {
|
|
1065
1037
|
const { name: t, configurationApiExtensions: i } = e;
|
|
1066
|
-
typeof t
|
|
1038
|
+
typeof t < "u" && t !== null && (this.name = t), i && i.forEach(
|
|
1067
1039
|
(s) => {
|
|
1068
|
-
|
|
1040
|
+
X(this).configurationApiExtensions.push(s);
|
|
1069
1041
|
}
|
|
1070
1042
|
);
|
|
1071
1043
|
}
|
|
@@ -1074,38 +1046,38 @@ const ce = "#____version____#", ee = _(), Ct = (n) => n.tenant ? `${n.name}:${n.
|
|
|
1074
1046
|
* @param configuration Environment configuration.
|
|
1075
1047
|
*/
|
|
1076
1048
|
static create(e = {}) {
|
|
1077
|
-
return new
|
|
1049
|
+
return new Re(
|
|
1078
1050
|
e.name || "",
|
|
1079
1051
|
e.configurationApiExtensions,
|
|
1080
1052
|
e.options
|
|
1081
1053
|
);
|
|
1082
1054
|
}
|
|
1083
1055
|
};
|
|
1084
|
-
let
|
|
1085
|
-
|
|
1086
|
-
const
|
|
1056
|
+
let _e = Re;
|
|
1057
|
+
_e.version = ae;
|
|
1058
|
+
const Q = (n, e, ...t) => typeof e == "string" ? n(`[humany] ${e}`, ...t) : n(e, ...t), L = class {
|
|
1087
1059
|
constructor() {
|
|
1088
|
-
this.keys = [], this.log = (e, ...t) => this.lookup(e, () =>
|
|
1060
|
+
this.keys = [], this.log = (e, ...t) => this.lookup(e, () => L.log(...t)), this.warn = (e, ...t) => this.lookup(e, () => L.warn(...t)), this.error = (e, ...t) => this.lookup(e, () => L.error(...t)), this.info = (e, ...t) => this.lookup(e, () => L.info(...t));
|
|
1089
1061
|
}
|
|
1090
1062
|
lookup(e, t) {
|
|
1091
1063
|
this.keys.indexOf(e) === -1 && (this.keys.push(e), t());
|
|
1092
1064
|
}
|
|
1093
1065
|
};
|
|
1094
|
-
let
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
const
|
|
1066
|
+
let G = L;
|
|
1067
|
+
G.log = (...n) => Q(console.log, ...n);
|
|
1068
|
+
G.warn = (...n) => Q(console.warn, ...n);
|
|
1069
|
+
G.error = (...n) => Q(console.error, ...n);
|
|
1070
|
+
G.info = (...n) => Q(console.info, ...n);
|
|
1071
|
+
const Se = (n) => {
|
|
1100
1072
|
let e = {}, t, i;
|
|
1101
1073
|
if (typeof n != "object" || n === null)
|
|
1102
1074
|
return n;
|
|
1103
1075
|
e = Array.isArray(n) ? [] : {};
|
|
1104
1076
|
for (i in n)
|
|
1105
|
-
t = n[i], e[i] = typeof t == "object" && t !== null ?
|
|
1077
|
+
t = n[i], e[i] = typeof t == "object" && t !== null ? Se(t) : t;
|
|
1106
1078
|
return e;
|
|
1107
|
-
},
|
|
1108
|
-
class
|
|
1079
|
+
}, gt = Se;
|
|
1080
|
+
class pt {
|
|
1109
1081
|
constructor(e, t) {
|
|
1110
1082
|
this.lockWarningTime = e, this.lockErrorTime = t, this.tasks = [], this.current = Promise.resolve(), this.next = this.next.bind(this);
|
|
1111
1083
|
}
|
|
@@ -1118,7 +1090,7 @@ class Pt {
|
|
|
1118
1090
|
if (e) {
|
|
1119
1091
|
let t;
|
|
1120
1092
|
const i = setTimeout(() => {
|
|
1121
|
-
process.env.NODE_ENV !== "production" &&
|
|
1093
|
+
process.env.NODE_ENV !== "production" && G.warn(
|
|
1122
1094
|
`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,
|
|
1123
1095
|
e
|
|
1124
1096
|
), t = setTimeout(() => {
|
|
@@ -1135,35 +1107,35 @@ class Pt {
|
|
|
1135
1107
|
});
|
|
1136
1108
|
}
|
|
1137
1109
|
}
|
|
1138
|
-
const
|
|
1139
|
-
function
|
|
1140
|
-
return
|
|
1141
|
-
const a =
|
|
1110
|
+
const B = /* @__PURE__ */ new WeakMap();
|
|
1111
|
+
function mt(n, e = 5e3, t = 1e3) {
|
|
1112
|
+
return B.has(n) || B.set(n, new pt(e, t)), (i) => new Promise((s, r) => {
|
|
1113
|
+
const a = B.get(n);
|
|
1142
1114
|
a.add(i, s, r, () => {
|
|
1143
|
-
a.tasks.length ||
|
|
1115
|
+
a.tasks.length || B.delete(n);
|
|
1144
1116
|
});
|
|
1145
1117
|
});
|
|
1146
1118
|
}
|
|
1147
|
-
const
|
|
1148
|
-
(n[e] === null || typeof n[e]
|
|
1149
|
-
}), n),
|
|
1119
|
+
const ft = (n = {}) => (Object.keys(n).forEach((e) => {
|
|
1120
|
+
(n[e] === null || typeof n[e] > "u") && delete n[e];
|
|
1121
|
+
}), n), vt = ft, F = (n, e) => {
|
|
1150
1122
|
let t = !0;
|
|
1151
1123
|
return Object.keys(n).length !== Object.keys(e).length || Object.keys(n).some((i) => !Object.keys(e).some((s) => i === s)) ? !1 : (Object.keys(n).forEach((i) => {
|
|
1152
1124
|
if (t) {
|
|
1153
|
-
const s = typeof n[i]
|
|
1125
|
+
const s = typeof n[i] > "u" ? "" : n[i], r = typeof e[i] > "u" ? "" : e[i];
|
|
1154
1126
|
t = s.toString() === r.toString();
|
|
1155
1127
|
}
|
|
1156
1128
|
}), t);
|
|
1157
1129
|
};
|
|
1158
|
-
var
|
|
1130
|
+
var yt = Object.defineProperty, ke = Object.getOwnPropertySymbols, bt = Object.prototype.hasOwnProperty, wt = Object.prototype.propertyIsEnumerable, Ce = (n, e, t) => e in n ? yt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, $e = (n, e) => {
|
|
1159
1131
|
for (var t in e || (e = {}))
|
|
1160
|
-
|
|
1161
|
-
if (
|
|
1162
|
-
for (var t of
|
|
1163
|
-
|
|
1132
|
+
bt.call(e, t) && Ce(n, t, e[t]);
|
|
1133
|
+
if (ke)
|
|
1134
|
+
for (var t of ke(e))
|
|
1135
|
+
wt.call(e, t) && Ce(n, t, e[t]);
|
|
1164
1136
|
return n;
|
|
1165
1137
|
};
|
|
1166
|
-
|
|
1138
|
+
Ie((n) => {
|
|
1167
1139
|
n.createCommand("components", (e) => (t) => {
|
|
1168
1140
|
e.events.subscribeOnce("components:platform-created", (i, { platform: s }) => {
|
|
1169
1141
|
t.handlers && t.handlers.forEach(([r, a]) => {
|
|
@@ -1172,12 +1144,12 @@ Le((n) => {
|
|
|
1172
1144
|
});
|
|
1173
1145
|
});
|
|
1174
1146
|
});
|
|
1175
|
-
const
|
|
1147
|
+
const kt = "#____version____#", Le = class extends _e {
|
|
1176
1148
|
constructor(n, e = []) {
|
|
1177
1149
|
super(n, e, {
|
|
1178
1150
|
transformPluginSettings: (t, i, s) => {
|
|
1179
1151
|
const r = s.get("$settings"), a = r.plugins && i ? r.plugins[i] || {} : {};
|
|
1180
|
-
return
|
|
1152
|
+
return $e($e({}, a), t);
|
|
1181
1153
|
}
|
|
1182
1154
|
});
|
|
1183
1155
|
}
|
|
@@ -1200,10 +1172,10 @@ const Mt = "#____version____#", Te = class extends De {
|
|
|
1200
1172
|
* @param configuration Runtime configuration.
|
|
1201
1173
|
*/
|
|
1202
1174
|
static create(n = {}) {
|
|
1203
|
-
const e = [
|
|
1175
|
+
const e = [ze].concat(
|
|
1204
1176
|
n.configurationApiExtensions || []
|
|
1205
1177
|
);
|
|
1206
|
-
return new
|
|
1178
|
+
return new Le("humany", e);
|
|
1207
1179
|
}
|
|
1208
1180
|
/**
|
|
1209
1181
|
* Creates a widget runtime based on provided configuration and retains configuration handlers
|
|
@@ -1228,10 +1200,10 @@ const Mt = "#____version____#", Te = class extends De {
|
|
|
1228
1200
|
return !!(n && typeof n == "object" && n.container && typeof n.container.get == "function" && n.container.get("$environment") === n && n.container.owner === n);
|
|
1229
1201
|
}
|
|
1230
1202
|
};
|
|
1231
|
-
let
|
|
1232
|
-
|
|
1233
|
-
var
|
|
1234
|
-
const
|
|
1203
|
+
let Ct = Le;
|
|
1204
|
+
Ct.version = `${kt} (${ae})`;
|
|
1205
|
+
var V = /* @__PURE__ */ ((n) => (n.open = "open", n.closed = "closed", n.hidden = "hidden", n))(V || {});
|
|
1206
|
+
const Pe = (n) => import("./index-5c9c2abf.mjs").then(
|
|
1235
1207
|
({ ServiceClient: e, ServiceProxy: t }) => n.get("settings").then((i) => {
|
|
1236
1208
|
const { name: s, events: r } = n.get("$widget"), {
|
|
1237
1209
|
data: { projection: a = "", site: o = "current", forceHttps: c = !1 }
|
|
@@ -1241,7 +1213,7 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1241
1213
|
h,
|
|
1242
1214
|
{
|
|
1243
1215
|
funnel: s.replace("_contact-method", "").replace("_contact", ""),
|
|
1244
|
-
site:
|
|
1216
|
+
site: $t(o, c)
|
|
1245
1217
|
},
|
|
1246
1218
|
null,
|
|
1247
1219
|
n
|
|
@@ -1250,7 +1222,7 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1250
1222
|
u && u.projection !== a && d.proxy.setBaseUrl(u.projection);
|
|
1251
1223
|
}), d;
|
|
1252
1224
|
})
|
|
1253
|
-
),
|
|
1225
|
+
), $t = (n, e) => () => {
|
|
1254
1226
|
const t = (s) => {
|
|
1255
1227
|
const r = document.createElement("a");
|
|
1256
1228
|
return r.href = s, r;
|
|
@@ -1268,7 +1240,7 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1268
1240
|
if (e && t)
|
|
1269
1241
|
return { type: e, content: t };
|
|
1270
1242
|
}
|
|
1271
|
-
},
|
|
1243
|
+
}, ie = (n) => n.map((e) => {
|
|
1272
1244
|
const t = {
|
|
1273
1245
|
id: e.Id.toString(),
|
|
1274
1246
|
title: e.Name,
|
|
@@ -1277,12 +1249,12 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1277
1249
|
description: e.Description || e.Attributes && e.Attributes.description || "",
|
|
1278
1250
|
matches: e.GuidesCount
|
|
1279
1251
|
};
|
|
1280
|
-
return e.Children && e.Children.length && (t.items =
|
|
1252
|
+
return e.Children && e.Children.length && (t.items = ie(e.Children)), t;
|
|
1281
1253
|
}), P = (n, e) => n.filter(({ Type: t }) => t === e).map(({ Id: t, Title: i, Body: s }) => ({
|
|
1282
1254
|
id: t.toString(),
|
|
1283
1255
|
title: i,
|
|
1284
1256
|
body: s
|
|
1285
|
-
})),
|
|
1257
|
+
})), ee = (n) => n.map(({ Id: e, Title: t, DefaultIcon: i, ListNotices: s, Notices: r }) => ({
|
|
1286
1258
|
id: e.toString(),
|
|
1287
1259
|
title: t,
|
|
1288
1260
|
symbol: O(i),
|
|
@@ -1296,7 +1268,7 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1296
1268
|
modified: d,
|
|
1297
1269
|
expandable: h === "listNotice"
|
|
1298
1270
|
}))
|
|
1299
|
-
})),
|
|
1271
|
+
})), te = ({
|
|
1300
1272
|
Id: n,
|
|
1301
1273
|
Title: e,
|
|
1302
1274
|
DefaultIcon: t,
|
|
@@ -1320,7 +1292,7 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1320
1292
|
p === "true" && (u.expanded = !1, u.title = b), h.indexOf("phone.text") > -1 ? u.body.phoneNumber = d.phoneNumber : u.body.freetext = d.freetext;
|
|
1321
1293
|
}
|
|
1322
1294
|
return (h.indexOf("chat.popup") > -1 || h.indexOf("link") > -1 || h === "custom.adapter" && s === "custom") && (u.body = d, u.body.confirmationFallback = r), h.indexOf("ace") > -1 && (u.body = d), u;
|
|
1323
|
-
},
|
|
1295
|
+
}, j = (n = []) => n.map(
|
|
1324
1296
|
({ Id: e, Title: t, TotalMatches: i, Symbol: s, DefaultIcon: r, ActiveIcon: a }) => ({
|
|
1325
1297
|
id: e.toString(),
|
|
1326
1298
|
title: t,
|
|
@@ -1329,13 +1301,13 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1329
1301
|
defaultIcon: O(r),
|
|
1330
1302
|
activeIcon: O(a)
|
|
1331
1303
|
})
|
|
1332
|
-
),
|
|
1304
|
+
), ne = (n) => n.map(({ Id: e, Title: t, Tags: i, FirstPublishedDate: s, Modified: r }) => ({
|
|
1333
1305
|
id: e.toString(),
|
|
1334
1306
|
title: t,
|
|
1335
|
-
tags:
|
|
1307
|
+
tags: j(i),
|
|
1336
1308
|
published: s,
|
|
1337
1309
|
modified: r
|
|
1338
|
-
})),
|
|
1310
|
+
})), Pt = (n, e) => {
|
|
1339
1311
|
switch (n) {
|
|
1340
1312
|
case C.MatchByCategory:
|
|
1341
1313
|
case C.Match: {
|
|
@@ -1356,18 +1328,18 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1356
1328
|
Tags: o,
|
|
1357
1329
|
ByCategory: c
|
|
1358
1330
|
} = e;
|
|
1359
|
-
return t.guides =
|
|
1331
|
+
return t.guides = ne(i), t.matches = s, t.byCategory = (c || []).map(
|
|
1360
1332
|
({ Id: h, Matches: d, TotalMatches: g }) => ({
|
|
1361
1333
|
id: h,
|
|
1362
|
-
guides:
|
|
1334
|
+
guides: ne(d),
|
|
1363
1335
|
matches: g
|
|
1364
1336
|
})
|
|
1365
|
-
), t.tags =
|
|
1337
|
+
), t.tags = j(o), t.notificationLists = ee(a || []), t.topNotifications = P(r || [], "noticeRowTop"), t.middleNotifications = P(r || [], "noticeRowMiddle"), t.bottomNotifications = P(r || [], "footerNotice"), t;
|
|
1366
1338
|
}
|
|
1367
1339
|
case C.Categories: {
|
|
1368
1340
|
const { Children: t, GuidesCountTotal: i } = e;
|
|
1369
1341
|
return {
|
|
1370
|
-
categories:
|
|
1342
|
+
categories: ie(t || []),
|
|
1371
1343
|
matches: i
|
|
1372
1344
|
};
|
|
1373
1345
|
}
|
|
@@ -1389,13 +1361,13 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1389
1361
|
Categories: w,
|
|
1390
1362
|
Tags: l,
|
|
1391
1363
|
SeoMetaDescription: f,
|
|
1392
|
-
SeoAllowIndex:
|
|
1393
|
-
Perspectives:
|
|
1394
|
-
PerspectiveKey:
|
|
1395
|
-
Translations:
|
|
1396
|
-
} = e,
|
|
1364
|
+
SeoAllowIndex: Y,
|
|
1365
|
+
Perspectives: _,
|
|
1366
|
+
PerspectiveKey: ce,
|
|
1367
|
+
Translations: he
|
|
1368
|
+
} = e, je = ce || Object.values(_).find(
|
|
1397
1369
|
(N) => N === o
|
|
1398
|
-
) ||
|
|
1370
|
+
) || _.Default || null, le = {
|
|
1399
1371
|
guide: {
|
|
1400
1372
|
id: t.toString(),
|
|
1401
1373
|
title: i,
|
|
@@ -1409,32 +1381,32 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1409
1381
|
hasHandover: d,
|
|
1410
1382
|
allowFeedback: h,
|
|
1411
1383
|
seoMetaDescription: f,
|
|
1412
|
-
seoAllowIndex:
|
|
1413
|
-
perspectives:
|
|
1414
|
-
perspective:
|
|
1415
|
-
translations: Object.keys(
|
|
1384
|
+
seoAllowIndex: Y,
|
|
1385
|
+
perspectives: _,
|
|
1386
|
+
perspective: je,
|
|
1387
|
+
translations: Object.keys(he || {}).reduce((N, T) => (N[T] = he[T].toString(), N), {})
|
|
1416
1388
|
},
|
|
1417
|
-
related:
|
|
1389
|
+
related: ne(r || []),
|
|
1418
1390
|
dialog: [],
|
|
1419
1391
|
contactMethods: (c || []).map(
|
|
1420
|
-
(N) =>
|
|
1392
|
+
(N) => te(N)
|
|
1421
1393
|
),
|
|
1422
|
-
tags:
|
|
1394
|
+
tags: j(l)
|
|
1423
1395
|
};
|
|
1424
1396
|
return (a || []).forEach(
|
|
1425
|
-
({ CanAccess: N, Description:
|
|
1397
|
+
({ CanAccess: N, Description: T, ConnectionId: qe, Properties: k }) => {
|
|
1426
1398
|
if (!N)
|
|
1427
1399
|
return;
|
|
1428
1400
|
const I = {
|
|
1429
1401
|
id: t.toString(),
|
|
1430
|
-
title:
|
|
1431
|
-
connection:
|
|
1402
|
+
title: T,
|
|
1403
|
+
connection: qe,
|
|
1432
1404
|
connectionKey: k.ConnectionKey,
|
|
1433
1405
|
type: "default",
|
|
1434
1406
|
parent: {
|
|
1435
1407
|
id: t.toString(),
|
|
1436
1408
|
title: i,
|
|
1437
|
-
tags:
|
|
1409
|
+
tags: j(l)
|
|
1438
1410
|
}
|
|
1439
1411
|
};
|
|
1440
1412
|
if (k.Type === "Guide" || k.Type === "Link")
|
|
@@ -1446,9 +1418,9 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1446
1418
|
I.type = "link";
|
|
1447
1419
|
break;
|
|
1448
1420
|
}
|
|
1449
|
-
|
|
1421
|
+
le.dialog.push(I);
|
|
1450
1422
|
}
|
|
1451
|
-
),
|
|
1423
|
+
), le;
|
|
1452
1424
|
}
|
|
1453
1425
|
case C.Contacts: {
|
|
1454
1426
|
const {
|
|
@@ -1459,37 +1431,37 @@ const Oe = (n) => import("./index-d70f1e69.js").then(
|
|
|
1459
1431
|
} = e;
|
|
1460
1432
|
return {
|
|
1461
1433
|
contactMethods: (i || []).map(
|
|
1462
|
-
(o) =>
|
|
1434
|
+
(o) => te(o)
|
|
1463
1435
|
),
|
|
1464
|
-
categories:
|
|
1436
|
+
categories: ie(t || []),
|
|
1465
1437
|
topNotifications: P(s || [], "noticeRowTop"),
|
|
1466
1438
|
middleNotifications: P(s || [], "noticeRowMiddle"),
|
|
1467
1439
|
bottomNotifications: P(s || [], "footerNotice"),
|
|
1468
|
-
notificationLists:
|
|
1440
|
+
notificationLists: ee(r || [])
|
|
1469
1441
|
};
|
|
1470
1442
|
}
|
|
1471
1443
|
case C.ContactMethod: {
|
|
1472
1444
|
const { ContactMethod: t } = e;
|
|
1473
|
-
return
|
|
1445
|
+
return te(t || {});
|
|
1474
1446
|
}
|
|
1475
1447
|
case C.Tags:
|
|
1476
1448
|
case C.TagsOnGuides:
|
|
1477
|
-
return
|
|
1449
|
+
return j(e || []);
|
|
1478
1450
|
case C.Notifications: {
|
|
1479
1451
|
const { Notices: t, NoticeLists: i } = e;
|
|
1480
1452
|
return {
|
|
1481
1453
|
topNotifications: P(t || [], "noticeRowTop"),
|
|
1482
1454
|
middleNotifications: P(t || [], "noticeRowMiddle"),
|
|
1483
1455
|
bottomNotifications: P(t || [], "footerNotice"),
|
|
1484
|
-
notificationLists:
|
|
1456
|
+
notificationLists: ee(i || [])
|
|
1485
1457
|
};
|
|
1486
1458
|
}
|
|
1487
1459
|
default:
|
|
1488
1460
|
return {};
|
|
1489
1461
|
}
|
|
1490
1462
|
};
|
|
1491
|
-
var
|
|
1492
|
-
const
|
|
1463
|
+
var Et = /* @__PURE__ */ ((n) => (n.Guide = "guide", n.Guides = "guides", n.GuidesByCategory = "guides-by-category", n.RowNotifications = "row-notices", n.NotificationLists = "notification-lists", n.GuideCategories = "guide-categories", n.ContactMethodCategories = "contact-method-categories", n.ContactMethod = "contact-method", n.ContactMethods = "contact-methods", n.Tags = "tags", n.TagsOnGuides = "tagsonguides", n))(Et || {}), C = /* @__PURE__ */ ((n) => (n.Match = "match", n.Categories = "categories", n.Guide = "guide", n.Contacts = "contacts", n.ContactMethod = "contact-method", n.MatchByCategory = "match-by-category", n.Tags = "tags", n.TagsOnGuides = "tagsonguides", n.Notifications = "notifications", n))(C || {}), At = /* @__PURE__ */ ((n) => (n.Positive = "Positive", n.Negative = "Negative", n))(At || {}), Nt = /* @__PURE__ */ ((n) => (n.POPULARITY_DESCENDING = "popularity-descending", n.ALPHABETIC_ASCENDING = "alphabetic-ascending", n.ALPHABETIC_DESCENDING = "alphabetic-descending", n.MODIFIED_ASCENDING = "modified-ascending", n.MODIFIED_DESCENDING = "modified-descending", n.PUBLISHED_ASCENDING = "published-ascending", n.PUBLISHED_DESCENDING = "published-descending", n))(Nt || {});
|
|
1464
|
+
const Ee = (n) => {
|
|
1493
1465
|
switch (n) {
|
|
1494
1466
|
case "guides":
|
|
1495
1467
|
return "match";
|
|
@@ -1514,11 +1486,11 @@ const Ie = (n) => {
|
|
|
1514
1486
|
default:
|
|
1515
1487
|
throw "error";
|
|
1516
1488
|
}
|
|
1517
|
-
},
|
|
1489
|
+
}, xt = async (n) => {
|
|
1518
1490
|
const { invoke: e } = n.get("$widget");
|
|
1519
|
-
return
|
|
1520
|
-
}
|
|
1521
|
-
class
|
|
1491
|
+
return await e("renderState") === V.hidden;
|
|
1492
|
+
};
|
|
1493
|
+
class q {
|
|
1522
1494
|
constructor(e, t) {
|
|
1523
1495
|
this.container = e, this.matchingClient = t, this.queries = /* @__PURE__ */ new Map(), this.getUnresolvedQueries = () => {
|
|
1524
1496
|
let i = 0;
|
|
@@ -1531,26 +1503,26 @@ class D {
|
|
|
1531
1503
|
), this.events.subscribe(
|
|
1532
1504
|
"widget:render-state-changed",
|
|
1533
1505
|
(i, { next: s, previous: r }) => {
|
|
1534
|
-
r ===
|
|
1506
|
+
r === V.hidden && s === V.open && this.fetchAllUnresolvedQueries();
|
|
1535
1507
|
}
|
|
1536
1508
|
);
|
|
1537
1509
|
}
|
|
1538
1510
|
static getInstance(e, t = "dataClient") {
|
|
1539
|
-
return
|
|
1540
|
-
let s =
|
|
1541
|
-
s || (s =
|
|
1511
|
+
return mt(this)(() => e.getAsync(t).then(async (i) => {
|
|
1512
|
+
let s = await e.getAsync("matchingClient");
|
|
1513
|
+
s || (s = await Pe(e), e.registerAsync("matchingClient", () => s));
|
|
1542
1514
|
let r = i;
|
|
1543
|
-
return r || (r = new
|
|
1544
|
-
}))
|
|
1515
|
+
return r || (r = new q(e, s), e.registerAsync(t, () => r)), r;
|
|
1516
|
+
}));
|
|
1545
1517
|
}
|
|
1546
1518
|
fetch(e, t, i) {
|
|
1547
1519
|
return new Promise((s, r) => {
|
|
1548
|
-
t.take,
|
|
1549
|
-
const a =
|
|
1550
|
-
let o = this.queries.get(a) || [], c = o.find((h) =>
|
|
1520
|
+
t.take, vt(t);
|
|
1521
|
+
const a = Ee(e);
|
|
1522
|
+
let o = this.queries.get(a) || [], c = o.find((h) => F(h.params, t)) || null;
|
|
1551
1523
|
if (c && (i != null && i.noCache)) {
|
|
1552
1524
|
const h = o.findIndex(
|
|
1553
|
-
(d) =>
|
|
1525
|
+
(d) => F(d.params, t)
|
|
1554
1526
|
);
|
|
1555
1527
|
o = [...o.slice(0, h), ...o.slice(h + 1)], c = null;
|
|
1556
1528
|
}
|
|
@@ -1571,11 +1543,11 @@ class D {
|
|
|
1571
1543
|
data: {},
|
|
1572
1544
|
resolvers: [{ resolve: s, reject: r }]
|
|
1573
1545
|
}), this.queries.set(a, o), this.runQuery(a, t);
|
|
1574
|
-
}).then((s) =>
|
|
1546
|
+
}).then((s) => gt(s));
|
|
1575
1547
|
}
|
|
1576
1548
|
// query the cached data
|
|
1577
1549
|
read(e, t) {
|
|
1578
|
-
const { select: i } = t, s =
|
|
1550
|
+
const { select: i } = t, s = Ee(e);
|
|
1579
1551
|
return (this.queries.get(s) || []).reduce((o, c) => {
|
|
1580
1552
|
if (typeof i == "function") {
|
|
1581
1553
|
const h = i(c.data);
|
|
@@ -1589,139 +1561,138 @@ class D {
|
|
|
1589
1561
|
return this.matchingClient.giveFeedback(e, t, i);
|
|
1590
1562
|
}
|
|
1591
1563
|
setLoadingStatus(e, t, i) {
|
|
1592
|
-
const s = this.queries.get(e) || [], r = s.find((a) =>
|
|
1564
|
+
const s = this.queries.get(e) || [], r = s.find((a) => F(a.params, t));
|
|
1593
1565
|
r && (r.loading = i), this.queries.set(e, s);
|
|
1594
1566
|
}
|
|
1595
|
-
runQuery(e, t) {
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
direction: S
|
|
1625
|
-
};
|
|
1567
|
+
async runQuery(e, t) {
|
|
1568
|
+
const {
|
|
1569
|
+
searchPhrase: i = "",
|
|
1570
|
+
categories: s = "0",
|
|
1571
|
+
contactMethodCategoryId: r = "0",
|
|
1572
|
+
contactMethodId: a = "0",
|
|
1573
|
+
tagId: o = void 0,
|
|
1574
|
+
take: c = 5,
|
|
1575
|
+
connection: h = "",
|
|
1576
|
+
guideId: d,
|
|
1577
|
+
expandCategories: g = "descendants",
|
|
1578
|
+
currentCategory: u,
|
|
1579
|
+
sorting: p = "popularity-descending",
|
|
1580
|
+
guideIds: b = []
|
|
1581
|
+
} = t, w = i.toString().trim();
|
|
1582
|
+
if (await xt(this.container))
|
|
1583
|
+
return Promise.resolve();
|
|
1584
|
+
switch (e) {
|
|
1585
|
+
case "match": {
|
|
1586
|
+
const l = (f) => {
|
|
1587
|
+
const [Y, _] = f.split("-");
|
|
1588
|
+
return {
|
|
1589
|
+
type: (/* @__PURE__ */ new Map([
|
|
1590
|
+
["popularity", "popularity"],
|
|
1591
|
+
["alphabetic", "title"],
|
|
1592
|
+
["modified", "lastModified"],
|
|
1593
|
+
["published", "firstPublished"]
|
|
1594
|
+
])).get(Y),
|
|
1595
|
+
direction: _
|
|
1626
1596
|
};
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
)
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
)
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1597
|
+
};
|
|
1598
|
+
return b.length ? this.matchingClient.customRequest("guides", "POST", {
|
|
1599
|
+
configuration: { ids: b, take: +c }
|
|
1600
|
+
}).then(
|
|
1601
|
+
(f) => f && this.handleResponse(f, e, t)
|
|
1602
|
+
) : this.matchingClient.match(w, {
|
|
1603
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
1604
|
+
take: +c,
|
|
1605
|
+
tags: o,
|
|
1606
|
+
sorting: l(p),
|
|
1607
|
+
ids: b
|
|
1608
|
+
}).then(
|
|
1609
|
+
(f) => f && this.handleResponse(f, e, t)
|
|
1610
|
+
);
|
|
1611
|
+
}
|
|
1612
|
+
case "match-by-category":
|
|
1613
|
+
return this.matchingClient.match(w, {
|
|
1614
|
+
groupByCategory: !0,
|
|
1615
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
1616
|
+
take: +c,
|
|
1617
|
+
tags: o
|
|
1618
|
+
}).then(
|
|
1619
|
+
(l) => l && this.handleResponse(l, e, t)
|
|
1620
|
+
);
|
|
1621
|
+
case "guide":
|
|
1622
|
+
return this.matchingClient.getGuide(d, { connectionId: h }).then((l) => {
|
|
1623
|
+
l && this.handleResponse(l, e, t);
|
|
1624
|
+
}).catch((l) => {
|
|
1625
|
+
const f = {
|
|
1626
|
+
message: "Something went wrong.",
|
|
1627
|
+
status: l.status || 400
|
|
1628
|
+
};
|
|
1629
|
+
f.status === 404 && (f.message = "The guide could not be found."), this.handleResponse({}, e, t, f);
|
|
1630
|
+
});
|
|
1631
|
+
case "categories":
|
|
1632
|
+
return this.matchingClient.getCategories({
|
|
1633
|
+
phrase: w,
|
|
1634
|
+
expand: g,
|
|
1635
|
+
tags: o
|
|
1636
|
+
}).then(
|
|
1637
|
+
(l) => l && this.handleResponse(l, e, t)
|
|
1638
|
+
);
|
|
1639
|
+
case "contacts":
|
|
1640
|
+
return d ? this.matchingClient.contactMethods(+d, { phrase: w }).then(
|
|
1641
|
+
(l) => l && this.handleResponse(l, e, t)
|
|
1642
|
+
) : this.matchingClient.contacts(+r, { phrase: w }).then(
|
|
1643
|
+
(l) => l && this.handleResponse(l, e, t)
|
|
1644
|
+
);
|
|
1645
|
+
case "contact-method":
|
|
1646
|
+
return this.matchingClient.getContactMethod(+a, { guideId: d, currentCategory: u }).then(
|
|
1647
|
+
(l) => l && this.handleResponse(l, e, t)
|
|
1648
|
+
);
|
|
1649
|
+
case "tags":
|
|
1650
|
+
return this.matchingClient.customRequest("tags", "GET", {
|
|
1651
|
+
configuration: {
|
|
1652
|
+
take: 999999,
|
|
1653
|
+
phrase: w,
|
|
1654
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s]
|
|
1655
|
+
}
|
|
1656
|
+
}).then(
|
|
1657
|
+
(l) => l && this.handleResponse(l, e, t)
|
|
1658
|
+
);
|
|
1659
|
+
case "tagsonguides":
|
|
1660
|
+
return this.matchingClient.customRequest("tagsonguides", "GET", {
|
|
1661
|
+
configuration: {
|
|
1662
|
+
take: 999999,
|
|
1663
|
+
phrase: w,
|
|
1644
1664
|
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
1645
|
-
take: +c,
|
|
1646
1665
|
tags: o
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
)
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
const f = {
|
|
1655
|
-
message: "Something went wrong.",
|
|
1656
|
-
status: l.status || 400
|
|
1657
|
-
};
|
|
1658
|
-
f.status === 404 && (f.message = "The guide could not be found."), this.handleResponse({}, e, t, f);
|
|
1659
|
-
});
|
|
1660
|
-
case "categories":
|
|
1661
|
-
return this.matchingClient.getCategories({
|
|
1666
|
+
}
|
|
1667
|
+
}).then(
|
|
1668
|
+
(l) => l && this.handleResponse(l, e, t)
|
|
1669
|
+
);
|
|
1670
|
+
case "notifications":
|
|
1671
|
+
return this.matchingClient.customRequest("notices", "GET", {
|
|
1672
|
+
configuration: {
|
|
1662
1673
|
phrase: w,
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
return d ? this.matchingClient.contactMethods(+d, { phrase: w }).then(
|
|
1670
|
-
(l) => l && this.handleResponse(l, e, t)
|
|
1671
|
-
) : this.matchingClient.contacts(+r, { phrase: w }).then(
|
|
1672
|
-
(l) => l && this.handleResponse(l, e, t)
|
|
1673
|
-
);
|
|
1674
|
-
case "contact-method":
|
|
1675
|
-
return this.matchingClient.getContactMethod(+a, { guideId: d, currentCategory: u }).then(
|
|
1676
|
-
(l) => l && this.handleResponse(l, e, t)
|
|
1677
|
-
);
|
|
1678
|
-
case "tags":
|
|
1679
|
-
return this.matchingClient.customRequest("tags", "GET", {
|
|
1680
|
-
configuration: {
|
|
1681
|
-
take: 999999,
|
|
1682
|
-
phrase: w,
|
|
1683
|
-
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s]
|
|
1684
|
-
}
|
|
1685
|
-
}).then(
|
|
1686
|
-
(l) => l && this.handleResponse(l, e, t)
|
|
1687
|
-
);
|
|
1688
|
-
case "tagsonguides":
|
|
1689
|
-
return this.matchingClient.customRequest("tagsonguides", "GET", {
|
|
1690
|
-
configuration: {
|
|
1691
|
-
take: 999999,
|
|
1692
|
-
phrase: w,
|
|
1693
|
-
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
1694
|
-
tags: o
|
|
1695
|
-
}
|
|
1696
|
-
}).then(
|
|
1697
|
-
(l) => l && this.handleResponse(l, e, t)
|
|
1698
|
-
);
|
|
1699
|
-
case "notifications":
|
|
1700
|
-
return this.matchingClient.customRequest("notices", "GET", {
|
|
1701
|
-
configuration: {
|
|
1702
|
-
phrase: w,
|
|
1703
|
-
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s]
|
|
1704
|
-
}
|
|
1705
|
-
}).then(
|
|
1706
|
-
(l) => l && this.handleResponse(l, e, t)
|
|
1707
|
-
);
|
|
1708
|
-
}
|
|
1709
|
-
});
|
|
1674
|
+
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s]
|
|
1675
|
+
}
|
|
1676
|
+
}).then(
|
|
1677
|
+
(l) => l && this.handleResponse(l, e, t)
|
|
1678
|
+
);
|
|
1679
|
+
}
|
|
1710
1680
|
}
|
|
1711
1681
|
handleResponse(e = {}, t, i, s) {
|
|
1712
|
-
const r = this.queries.get(t) || [], a = r.find((o) =>
|
|
1682
|
+
const r = this.queries.get(t) || [], a = r.find((o) => F(o.params, i));
|
|
1713
1683
|
if (a) {
|
|
1714
|
-
const o = s ||
|
|
1684
|
+
const o = s || Pt(t, e);
|
|
1715
1685
|
this.track(o, t, s), a.resolvers.forEach((h) => {
|
|
1716
1686
|
s ? h.reject({ error: o }) : h.resolve(o);
|
|
1717
1687
|
});
|
|
1718
1688
|
const c = r.indexOf(a);
|
|
1719
|
-
c > -1 && r.splice(c, 1), r.push(
|
|
1689
|
+
c > -1 && r.splice(c, 1), r.push({
|
|
1690
|
+
...a,
|
|
1720
1691
|
error: s,
|
|
1721
1692
|
resolvers: [],
|
|
1722
1693
|
data: o,
|
|
1723
1694
|
resolved: !0
|
|
1724
|
-
})
|
|
1695
|
+
}), this.setLoadingStatus(t, i, !1), this.queries.set(t, r), s || this.events.dispatch("data-client:fetched", {
|
|
1725
1696
|
type: t,
|
|
1726
1697
|
params: i,
|
|
1727
1698
|
response: o,
|
|
@@ -1746,28 +1717,27 @@ class D {
|
|
|
1746
1717
|
});
|
|
1747
1718
|
}
|
|
1748
1719
|
static create(e) {
|
|
1749
|
-
return e.getAsync("matchingClient").then((t) =>
|
|
1720
|
+
return e.getAsync("matchingClient").then(async (t) => {
|
|
1750
1721
|
if (t)
|
|
1751
|
-
return new
|
|
1752
|
-
const i =
|
|
1753
|
-
return e.registerAsync("matchingClient", () => i), new
|
|
1754
|
-
})
|
|
1722
|
+
return new q(e, t);
|
|
1723
|
+
const i = await Pe(e);
|
|
1724
|
+
return e.registerAsync("matchingClient", () => i), new q(e, i);
|
|
1725
|
+
});
|
|
1755
1726
|
}
|
|
1756
1727
|
getClient() {
|
|
1757
1728
|
return this.matchingClient;
|
|
1758
1729
|
}
|
|
1759
1730
|
}
|
|
1760
|
-
const
|
|
1761
|
-
n.registerAsync("dataClient", () =>
|
|
1762
|
-
}
|
|
1731
|
+
const Lt = async (n) => {
|
|
1732
|
+
n.registerAsync("dataClient", () => q.create(n));
|
|
1733
|
+
};
|
|
1763
1734
|
export {
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1735
|
+
q as DataClient,
|
|
1736
|
+
Et as DataType,
|
|
1737
|
+
At as FeedbackType,
|
|
1738
|
+
Lt as KnowledgeDataClientPlugin,
|
|
1768
1739
|
C as ServiceClientQueryType,
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1740
|
+
Nt as SortingType,
|
|
1741
|
+
Ee as determineServiceClientQueryType,
|
|
1742
|
+
Pt as formatLegacyData
|
|
1772
1743
|
};
|
|
1773
|
-
//# sourceMappingURL=index.js.map
|