@onecx/integration-interface 8.0.0-rc.7 → 8.0.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,1076 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // libs/integration-interface/src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ ConfigurationTopic: () => ConfigurationTopic,
34
+ CurrentLocationTopic: () => CurrentLocationTopic,
35
+ CurrentMfeTopic: () => CurrentMfeTopic,
36
+ CurrentPageTopic: () => CurrentPageTopic,
37
+ CurrentThemeTopic: () => CurrentThemeTopic,
38
+ CurrentWorkspaceTopic: () => CurrentWorkspaceTopic,
39
+ DynamicTranslationService: () => DynamicTranslationService,
40
+ DynamicTranslationsMessageType: () => DynamicTranslationsMessageType,
41
+ DynamicTranslationsTopic: () => DynamicTranslationsTopic,
42
+ EventType: () => EventType,
43
+ EventsTopic: () => EventsTopic,
44
+ GlobalErrorTopic: () => GlobalErrorTopic,
45
+ GlobalLoadingTopic: () => GlobalLoadingTopic,
46
+ IconService: () => IconService,
47
+ IconTopic: () => IconTopic,
48
+ ImageRepositoryService: () => ImageRepositoryService,
49
+ ImageRepositoryTopic: () => ImageRepositoryTopic,
50
+ IsAuthenticatedTopic: () => IsAuthenticatedTopic,
51
+ MessageTopic: () => MessageTopic,
52
+ OverrideType: () => OverrideType,
53
+ ParametersTopic: () => ParametersTopic,
54
+ PermissionsRpcTopic: () => PermissionsRpcTopic,
55
+ PermissionsTopic: () => PermissionsTopic,
56
+ PhoneType: () => PhoneType,
57
+ RemoteComponentsTopic: () => RemoteComponentsTopic,
58
+ ResizedEventType: () => ResizedEventType,
59
+ ResizedEventsTopic: () => ResizedEventsTopic,
60
+ ShellCapability: () => ShellCapability,
61
+ Technologies: () => Technologies,
62
+ UNVERSIONED_KEY: () => UNVERSIONED_KEY,
63
+ UserProfileTopic: () => UserProfileTopic,
64
+ ensureIconCache: () => ensureIconCache,
65
+ generateClassName: () => generateClassName,
66
+ getDynamicTranslationsCache: () => getDynamicTranslationsCache,
67
+ hasShellCapability: () => hasShellCapability,
68
+ normalizeIconName: () => normalizeIconName
69
+ });
70
+ module.exports = __toCommonJS(index_exports);
71
+
72
+ // libs/accelerator/src/lib/topic/topic.ts
73
+ var import_operators = require("rxjs/operators");
74
+ var import_rxjs = require("rxjs");
75
+
76
+ // libs/accelerator/src/lib/declarations.ts
77
+ window["@onecx/accelerator"] ??= {};
78
+ window["@onecx/accelerator"].gatherer ??= {};
79
+ window["@onecx/accelerator"].gatherer.promises ??= {};
80
+ window["@onecx/accelerator"].topic ??= {};
81
+ window["@onecx/accelerator"].topic.useBroadcastChannel ??= "V2";
82
+ window["@onecx/accelerator"].topic.initDate ??= Date.now();
83
+ window["@onecx/accelerator"].topic.tabId ??= Math.ceil(globalThis.performance.now());
84
+
85
+ // libs/accelerator/src/lib/utils/logs.utils.ts
86
+ function isStatsEnabled() {
87
+ return window["@onecx/accelerator"]?.topic?.statsEnabled === true;
88
+ }
89
+ function increaseMessageCount(topicName, messageType) {
90
+ window["@onecx/accelerator"].topic ??= {};
91
+ window["@onecx/accelerator"].topic.stats ??= {};
92
+ window["@onecx/accelerator"].topic.stats.messagesPublished ??= {};
93
+ if (isStatsEnabled()) {
94
+ const messageStats = window["@onecx/accelerator"].topic.stats.messagesPublished;
95
+ if (!messageStats[topicName]) {
96
+ messageStats[topicName] = {
97
+ TopicNext: 0,
98
+ TopicGet: 0,
99
+ TopicResolve: 0
100
+ };
101
+ }
102
+ messageStats[topicName][messageType]++;
103
+ }
104
+ }
105
+ function increaseInstanceCount(topicName) {
106
+ window["@onecx/accelerator"].topic ??= {};
107
+ window["@onecx/accelerator"].topic.stats ??= {};
108
+ window["@onecx/accelerator"].topic.stats.instancesCreated ??= {};
109
+ if (isStatsEnabled()) {
110
+ const instanceStats = window["@onecx/accelerator"].topic.stats.instancesCreated;
111
+ if (!instanceStats[topicName]) {
112
+ instanceStats[topicName] = 0;
113
+ }
114
+ instanceStats[topicName]++;
115
+ }
116
+ }
117
+
118
+ // libs/accelerator/src/lib/topic/message.ts
119
+ window["onecxMessageId"] ??= 1;
120
+ var Message = class {
121
+ // id can be undefined while used via old implementation
122
+ constructor(type) {
123
+ this.type = type;
124
+ this.timestamp = window.performance.now();
125
+ this.id = window["onecxMessageId"]++;
126
+ }
127
+ timestamp;
128
+ id;
129
+ };
130
+
131
+ // libs/accelerator/src/lib/topic/topic-message.ts
132
+ var TopicMessage = class extends Message {
133
+ constructor(type, name, version) {
134
+ super(type);
135
+ this.name = name;
136
+ this.version = version;
137
+ if (isStatsEnabled()) {
138
+ increaseMessageCount(this.name, type);
139
+ }
140
+ }
141
+ };
142
+
143
+ // libs/accelerator/src/lib/topic/topic-data-message.ts
144
+ var TopicDataMessage = class extends TopicMessage {
145
+ constructor(type, name, version, data) {
146
+ super(type, name, version);
147
+ this.data = data;
148
+ }
149
+ };
150
+
151
+ // libs/accelerator/src/lib/topic/topic-resolve-message.ts
152
+ var TopicResolveMessage = class extends TopicMessage {
153
+ constructor(type, name, version, resolveId) {
154
+ super(type, name, version);
155
+ this.resolveId = resolveId;
156
+ }
157
+ };
158
+
159
+ // libs/accelerator/src/lib/utils/create-logger.utils.ts
160
+ var import_debug = __toESM(require("debug"), 1);
161
+ import_debug.default.log = console.log.bind(console);
162
+ function createLoggerFactory(libOrAppName) {
163
+ const prefix = libOrAppName.trim();
164
+ if (!prefix) throw new Error("createLoggerFactory(libOrAppName): libOrAppName must be a non-empty string.");
165
+ const createLogger3 = (location) => {
166
+ const trimmedLocation = location.trim();
167
+ if (!trimmedLocation) throw new Error("createLogger(location): location must be a non-empty string.");
168
+ const ns = (level) => `${prefix}:${trimmedLocation}:${level}`;
169
+ return {
170
+ debug: (0, import_debug.default)(ns("debug")),
171
+ info: (0, import_debug.default)(ns("info")),
172
+ warn: (0, import_debug.default)(ns("warn")),
173
+ error: (0, import_debug.default)(ns("error"))
174
+ };
175
+ };
176
+ return createLogger3;
177
+ }
178
+
179
+ // libs/accelerator/src/lib/utils/logger.utils.ts
180
+ var createLogger = createLoggerFactory("@onecx/accelerator");
181
+
182
+ // libs/accelerator/src/lib/topic/topic-publisher.ts
183
+ var TopicPublisher = class {
184
+ constructor(name, version) {
185
+ this.name = name;
186
+ this.version = version;
187
+ this.baseLogger = createLogger(`TopicPublisher:${this.name}`);
188
+ }
189
+ publishPromiseResolver = {};
190
+ publishBroadcastChannel;
191
+ publishBroadcastChannelV2;
192
+ baseLogger;
193
+ publish(value) {
194
+ const message = new TopicDataMessage("TopicNext" /* TopicNext */, this.name, this.version, value);
195
+ this.sendMessage(message);
196
+ const resolveMessage = new TopicResolveMessage("TopicResolve" /* TopicResolve */, this.name, this.version, message.id);
197
+ const promise = new Promise((resolve) => {
198
+ this.publishPromiseResolver[message.id] = resolve;
199
+ });
200
+ this.sendMessage(resolveMessage);
201
+ return promise;
202
+ }
203
+ createBroadcastChannel() {
204
+ if (this.publishBroadcastChannel && this.publishBroadcastChannelV2) {
205
+ return;
206
+ }
207
+ if (window["@onecx/accelerator"]?.topic?.useBroadcastChannel) {
208
+ if (typeof BroadcastChannel === "undefined") {
209
+ this.baseLogger.info("BroadcastChannel not supported. Disabling BroadcastChannel for topic publisher");
210
+ window["@onecx/accelerator"] ??= {};
211
+ window["@onecx/accelerator"].topic ??= {};
212
+ window["@onecx/accelerator"].topic.useBroadcastChannel = false;
213
+ } else {
214
+ this.publishBroadcastChannel = new BroadcastChannel(`Topic-${this.name}|${this.version}`);
215
+ this.publishBroadcastChannelV2 = new BroadcastChannel(`TopicV2-${this.name}|${this.version}-${window["@onecx/accelerator"].topic.tabId}`);
216
+ }
217
+ }
218
+ }
219
+ sendMessage(message) {
220
+ this.createBroadcastChannel();
221
+ if (window["@onecx/accelerator"]?.topic?.useBroadcastChannel === "V2") {
222
+ this.publishBroadcastChannelV2?.postMessage(message);
223
+ } else if (window["@onecx/accelerator"]?.topic?.useBroadcastChannel) {
224
+ this.publishBroadcastChannel?.postMessage(message);
225
+ } else {
226
+ window.postMessage(message, "*");
227
+ }
228
+ }
229
+ };
230
+
231
+ // libs/accelerator/src/lib/topic/topic.ts
232
+ var Topic = class extends TopicPublisher {
233
+ logger = createLogger(`Topic:${this.name}`);
234
+ isInitializedPromise;
235
+ data = new import_rxjs.BehaviorSubject(void 0);
236
+ isInit = false;
237
+ resolveInitPromise;
238
+ windowEventListener = (m) => this.onWindowMessage(m);
239
+ readBroadcastChannel;
240
+ readBroadcastChannelV2;
241
+ constructor(name, version, sendGetMessage = true) {
242
+ super(name, version);
243
+ window["@onecx/accelerator"] ??= {};
244
+ window["@onecx/accelerator"].topic ??= {};
245
+ window["@onecx/accelerator"].topic.initDate ??= Date.now();
246
+ if (window["@onecx/accelerator"]?.topic?.useBroadcastChannel) {
247
+ if (typeof BroadcastChannel === "undefined") {
248
+ this.logger.info("BroadcastChannel not supported. Disabling BroadcastChannel for topic");
249
+ window["@onecx/accelerator"] ??= {};
250
+ window["@onecx/accelerator"].topic ??= {};
251
+ window["@onecx/accelerator"].topic.useBroadcastChannel = false;
252
+ } else {
253
+ this.readBroadcastChannel = new BroadcastChannel(`Topic-${this.name}|${this.version}`);
254
+ this.readBroadcastChannelV2 = new BroadcastChannel(`TopicV2-${this.name}|${this.version}-${window["@onecx/accelerator"].topic.tabId}`);
255
+ }
256
+ }
257
+ if (isStatsEnabled()) {
258
+ increaseInstanceCount(this.name);
259
+ }
260
+ this.isInitializedPromise = new Promise((resolve) => {
261
+ this.resolveInitPromise = resolve;
262
+ });
263
+ window.addEventListener("message", this.windowEventListener);
264
+ this.readBroadcastChannel?.addEventListener("message", (m) => this.onBroadcastChannelMessage(m));
265
+ this.readBroadcastChannelV2?.addEventListener("message", (m) => this.onBroadcastChannelMessageV2(m));
266
+ if (sendGetMessage) {
267
+ if (window["@onecx/accelerator"].topic.initDate && Date.now() - window["@onecx/accelerator"].topic.initDate < 2e3) {
268
+ setTimeout(() => {
269
+ if (!this.isInit) {
270
+ const message = new TopicMessage("TopicGet" /* TopicGet */, this.name, this.version);
271
+ this.sendMessage(message);
272
+ }
273
+ }, 100);
274
+ } else {
275
+ const message = new TopicMessage("TopicGet" /* TopicGet */, this.name, this.version);
276
+ this.sendMessage(message);
277
+ }
278
+ }
279
+ }
280
+ get isInitialized() {
281
+ return this.isInitializedPromise;
282
+ }
283
+ asObservable() {
284
+ return this.data.asObservable().pipe(
285
+ (0, import_operators.filter)(() => this.isInit),
286
+ (0, import_operators.map)((d) => d.data)
287
+ );
288
+ }
289
+ subscribe(observerOrNext, error, complete) {
290
+ return this.asObservable().subscribe(observerOrNext, error, complete);
291
+ }
292
+ pipe(...operations) {
293
+ return this.asObservable().pipe(...operations);
294
+ }
295
+ /**
296
+ * @deprecated source is deprecated in rxjs. This is only here to be compatible with the interface.
297
+ */
298
+ get source() {
299
+ return this.asObservable().source;
300
+ }
301
+ /**
302
+ * @deprecated operator is deprecated in rxjs. This is only here to be compatible with the interface.
303
+ */
304
+ get operator() {
305
+ return this.asObservable().operator;
306
+ }
307
+ /**
308
+ * @deprecated lift is deprecated in rxjs. This is only here to be compatible with the interface.
309
+ */
310
+ lift(operator) {
311
+ return this.asObservable().lift(operator);
312
+ }
313
+ /**
314
+ * @deprecated foreach is deprecated in rxjs. This is only here to be compatible with the interface.
315
+ */
316
+ forEach(next, thisArg) {
317
+ return this.asObservable().forEach(next, thisArg);
318
+ }
319
+ /**
320
+ * @deprecated toPromise is deprecated in rxjs. This is only here to be compatible with the interface.
321
+ */
322
+ toPromise() {
323
+ return this.asObservable().toPromise();
324
+ }
325
+ destroy() {
326
+ window.removeEventListener("message", this.windowEventListener, true);
327
+ this.readBroadcastChannel?.close();
328
+ this.publishBroadcastChannel?.close();
329
+ this.readBroadcastChannelV2?.close();
330
+ this.publishBroadcastChannelV2?.close();
331
+ }
332
+ onWindowMessage(m) {
333
+ if (m.data?.name === this.name && m.data?.version === this.version) {
334
+ this.logger.debug("received message via window", m.data);
335
+ }
336
+ switch (m.data.type) {
337
+ case "TopicNext" /* TopicNext */: {
338
+ this.disableBroadcastChannel();
339
+ if (m.data.name === this.name && m.data.version === this.version) {
340
+ this.handleTopicNextMessage(m);
341
+ }
342
+ break;
343
+ }
344
+ case "TopicGet" /* TopicGet */: {
345
+ this.disableBroadcastChannel();
346
+ if (m.data.name === this.name && m.data.version === this.version && this.isInit && this.data.value) {
347
+ this.handleTopicGetMessage(m);
348
+ }
349
+ break;
350
+ }
351
+ case "TopicResolve" /* TopicResolve */: {
352
+ this.disableBroadcastChannel();
353
+ this.handleTopicResolveMessage(m);
354
+ break;
355
+ }
356
+ }
357
+ }
358
+ onBroadcastChannelMessage(m) {
359
+ this.disableBroadcastChannelV2();
360
+ this.onBroadcastChannelMessageV2(m);
361
+ }
362
+ onBroadcastChannelMessageV2(m) {
363
+ this.logger.debug("received message", m.data);
364
+ switch (m.data.type) {
365
+ case "TopicNext" /* TopicNext */: {
366
+ this.handleTopicNextMessage(m);
367
+ break;
368
+ }
369
+ case "TopicGet" /* TopicGet */: {
370
+ if (this.isInit && this.data.value) {
371
+ this.handleTopicGetMessage(m);
372
+ }
373
+ break;
374
+ }
375
+ case "TopicResolve" /* TopicResolve */: {
376
+ this.handleTopicResolveMessage(m);
377
+ break;
378
+ }
379
+ }
380
+ }
381
+ disableBroadcastChannel() {
382
+ window["@onecx/accelerator"] ??= {};
383
+ window["@onecx/accelerator"].topic ??= {};
384
+ if (window["@onecx/accelerator"].topic.useBroadcastChannel === true) {
385
+ this.logger.info("Disabling BroadcastChannel for topic");
386
+ }
387
+ window["@onecx/accelerator"].topic.useBroadcastChannel = false;
388
+ }
389
+ disableBroadcastChannelV2() {
390
+ window["@onecx/accelerator"] ??= {};
391
+ window["@onecx/accelerator"].topic ??= {};
392
+ if (window["@onecx/accelerator"].topic.useBroadcastChannel === "V2") {
393
+ this.logger.info("Disabling BroadcastChannel V2 for topic");
394
+ }
395
+ window["@onecx/accelerator"].topic.useBroadcastChannel = true;
396
+ }
397
+ handleTopicResolveMessage(m) {
398
+ const publishPromiseResolver = this.publishPromiseResolver[m.data.resolveId];
399
+ if (publishPromiseResolver) {
400
+ try {
401
+ publishPromiseResolver();
402
+ m.stopImmediatePropagation();
403
+ m.stopPropagation();
404
+ delete this.publishPromiseResolver[m.data.resolveId];
405
+ } catch (error) {
406
+ this.logger.error("Error handling TopicResolveMessage:", error);
407
+ }
408
+ }
409
+ }
410
+ handleTopicGetMessage(m) {
411
+ if (this.data.value) {
412
+ this.sendMessage(this.data.value);
413
+ m.stopImmediatePropagation();
414
+ m.stopPropagation();
415
+ }
416
+ }
417
+ handleTopicNextMessage(m) {
418
+ if (!this.data.value || this.isInit && m.data.id !== void 0 && this.data.value.id !== void 0 && m.data.id > this.data.value.id || this.isInit && m.data.timestamp > this.data.value.timestamp) {
419
+ this.isInit = true;
420
+ this.data.next(m.data);
421
+ this.resolveInitPromise();
422
+ } else if (this.data.value && this.isInit && m.data.timestamp === this.data.value.timestamp && (m.data.id && !this.data.value.id || !m.data.id && this.data.value.id)) {
423
+ this.logger.warn(
424
+ "Message was dropped because of equal timestamps, because there was an old style message in the system. Please upgrade all libraries to the latest version."
425
+ );
426
+ }
427
+ }
428
+ };
429
+
430
+ // libs/accelerator/src/lib/topic/mocks/fake-topic.ts
431
+ var import_rxjs2 = require("rxjs");
432
+
433
+ // libs/accelerator/src/lib/utils/ensure-property.utils.ts
434
+ function ensureProperty(obj, path, initialValue) {
435
+ let current = obj;
436
+ for (let i = 0; i < path.length - 1; i++) {
437
+ const key = path[i];
438
+ if (current[key] == null || typeof current[key] !== "object") {
439
+ current[key] = {};
440
+ }
441
+ current = current[key];
442
+ }
443
+ const lastKey = path.at(-1);
444
+ if (lastKey === void 0) {
445
+ return obj;
446
+ }
447
+ current[lastKey] ??= initialValue;
448
+ return obj;
449
+ }
450
+
451
+ // libs/integration-interface/src/lib/topics/current-mfe/v1/current-mfe.topic.ts
452
+ var CurrentMfeTopic = class extends Topic {
453
+ constructor() {
454
+ super("currentMfe", 1);
455
+ }
456
+ };
457
+
458
+ // libs/integration-interface/src/lib/topics/current-page/v1/current-page.topic.ts
459
+ var import_rxjs3 = require("rxjs");
460
+ var import_BehaviorSubject = require("rxjs/internal/BehaviorSubject");
461
+
462
+ // libs/integration-interface/src/lib/utils/logger.utils.ts
463
+ var createLogger2 = createLoggerFactory("@onecx/integration-interface");
464
+
465
+ // libs/integration-interface/src/lib/topics/current-page/v1/current-page.topic.ts
466
+ var logger = createLogger2("CurrentPageTopic");
467
+ var CurrentPageTopic = class extends Topic {
468
+ currentPath$ = new import_BehaviorSubject.BehaviorSubject(document.location.pathname);
469
+ constructor() {
470
+ super("currentPage", 1);
471
+ this.watchForPathChanges();
472
+ }
473
+ asObservable() {
474
+ return (0, import_rxjs3.combineLatest)([super.asObservable(), this.currentPath$.pipe((0, import_rxjs3.distinctUntilChanged)())]).pipe(
475
+ (0, import_rxjs3.map)(([v, path]) => v.path === path ? v : void 0)
476
+ );
477
+ }
478
+ watchForPathChanges() {
479
+ const body = document.querySelector("body");
480
+ if (body === null) {
481
+ logger.error("could not listen to location changes");
482
+ throw new Error("could not listen to location changes");
483
+ }
484
+ const observer = new MutationObserver(() => {
485
+ this.currentPath$.next(document.location.pathname);
486
+ });
487
+ observer.observe(body, { childList: true, subtree: true });
488
+ }
489
+ };
490
+
491
+ // libs/integration-interface/src/lib/topics/global-error/v1/global-error.topic.ts
492
+ var GlobalErrorTopic = class extends Topic {
493
+ constructor() {
494
+ super("globalError", 1);
495
+ }
496
+ };
497
+
498
+ // libs/integration-interface/src/lib/topics/global-loading/v1/global-loading.topic.ts
499
+ var GlobalLoadingTopic = class extends Topic {
500
+ constructor() {
501
+ super("globalLoading", 1);
502
+ }
503
+ };
504
+
505
+ // libs/integration-interface/src/lib/topics/current-theme/v1/current-theme.topic.ts
506
+ var CurrentThemeTopic = class extends Topic {
507
+ constructor() {
508
+ super("currentTheme", 1);
509
+ }
510
+ };
511
+
512
+ // libs/integration-interface/src/lib/topics/current-theme/v1/theme-override.model.ts
513
+ var OverrideType = /* @__PURE__ */ ((OverrideType2) => {
514
+ OverrideType2["PRIMENG"] = "PRIMENG";
515
+ OverrideType2["CSS"] = "CSS";
516
+ return OverrideType2;
517
+ })(OverrideType || {});
518
+
519
+ // libs/integration-interface/src/lib/topics/user-profile/v1/user-profile.model.ts
520
+ var PhoneType = /* @__PURE__ */ ((PhoneType2) => {
521
+ PhoneType2["MOBILE"] = "MOBILE";
522
+ PhoneType2["LANDLINE"] = "LANDLINE";
523
+ return PhoneType2;
524
+ })(PhoneType || {});
525
+
526
+ // libs/integration-interface/src/lib/topics/user-profile/v1/user-profile.topic.ts
527
+ var UserProfileTopic = class extends Topic {
528
+ constructor() {
529
+ super("userProfile", 1);
530
+ }
531
+ };
532
+
533
+ // libs/integration-interface/src/lib/topics/configuration/v1/configuration.topic.ts
534
+ var ConfigurationTopic = class extends Topic {
535
+ constructor() {
536
+ super("configuration", 1);
537
+ }
538
+ };
539
+
540
+ // libs/integration-interface/src/lib/topics/current-workspace/v1/current-workspace.topic.ts
541
+ var CurrentWorkspaceTopic = class extends Topic {
542
+ constructor() {
543
+ super("currentPortal", 1);
544
+ }
545
+ };
546
+
547
+ // libs/integration-interface/src/lib/topics/is-authenticated/v1/isAuthenticated.topic.ts
548
+ var IsAuthenticatedTopic = class extends Topic {
549
+ constructor() {
550
+ super("isAuthenticated", 1);
551
+ }
552
+ };
553
+
554
+ // libs/integration-interface/src/lib/topics/message/v1/message.topic.ts
555
+ var MessageTopic = class extends Topic {
556
+ constructor() {
557
+ super("message", 1);
558
+ }
559
+ };
560
+
561
+ // libs/integration-interface/src/lib/topics/remote-components/v1/remote-component.model.ts
562
+ var Technologies = /* @__PURE__ */ ((Technologies2) => {
563
+ Technologies2["Angular"] = "Angular";
564
+ Technologies2["WebComponentScript"] = "WebComponentScript";
565
+ Technologies2["WebComponentModule"] = "WebComponentModule";
566
+ return Technologies2;
567
+ })(Technologies || {});
568
+
569
+ // libs/integration-interface/src/lib/topics/remote-components/v1/remote-components.topic.ts
570
+ var RemoteComponentsTopic = class extends Topic {
571
+ constructor() {
572
+ super("remoteComponentsInfo", 1);
573
+ }
574
+ };
575
+
576
+ // libs/integration-interface/src/lib/topics/permissions/v1/permissions.topic.ts
577
+ var PermissionsTopic = class extends Topic {
578
+ constructor() {
579
+ super("permissions", 1);
580
+ }
581
+ };
582
+
583
+ // libs/integration-interface/src/lib/topics/permissions-rpc/v1/permissions-rpc.topic.ts
584
+ var PermissionsRpcTopic = class extends Topic {
585
+ constructor() {
586
+ super("permissionsRpc", 1, false);
587
+ }
588
+ };
589
+
590
+ // libs/integration-interface/src/lib/topics/events/v1/events-topic.ts
591
+ var EventsTopic = class extends Topic {
592
+ constructor() {
593
+ super("events", 1, false);
594
+ }
595
+ };
596
+
597
+ // libs/integration-interface/src/lib/topics/events/v1/event-type.ts
598
+ var EventType = /* @__PURE__ */ ((EventType2) => {
599
+ EventType2["NAVIGATED"] = "navigated";
600
+ EventType2["AUTH_LOGOUT_BUTTON_CLICKED"] = "authentication#logoutButtonClicked";
601
+ return EventType2;
602
+ })(EventType || {});
603
+
604
+ // libs/integration-interface/src/lib/topics/resized-events/v1/resized-event-type.ts
605
+ var ResizedEventType = /* @__PURE__ */ ((ResizedEventType2) => {
606
+ ResizedEventType2["SLOT_RESIZED"] = "slot_resized";
607
+ ResizedEventType2["SLOT_GROUP_RESIZED"] = "slot_group_resized";
608
+ ResizedEventType2["REQUESTED_EVENTS_CHANGED"] = "requested_events_changed";
609
+ return ResizedEventType2;
610
+ })(ResizedEventType || {});
611
+
612
+ // libs/integration-interface/src/lib/topics/resized-events/v1/resized-events.topic.ts
613
+ var ResizedEventsPublisher = class extends TopicPublisher {
614
+ constructor() {
615
+ super("resizedEvents", 1);
616
+ }
617
+ //NOSONAR
618
+ publish(event) {
619
+ if (!["slot_group_resized" /* SLOT_GROUP_RESIZED */, "slot_resized" /* SLOT_RESIZED */].includes(event.type)) {
620
+ return super.publish(event);
621
+ }
622
+ const resizedEvent = event;
623
+ const entityName = eventToEntityName(resizedEvent);
624
+ if (window["@onecx/integration-interface"]["resizedEvents"]?.[resizedEvent.type]?.includes(entityName)) {
625
+ return super.publish(event);
626
+ }
627
+ return Promise.resolve();
628
+ }
629
+ };
630
+ var ResizedEventsTopic = class extends Topic {
631
+ constructor() {
632
+ super("resizedEvents", 1, false);
633
+ window["@onecx/integration-interface"] ??= {};
634
+ window["@onecx/integration-interface"]["resizedEvents"] ??= {};
635
+ }
636
+ /**
637
+ * Request resized update events for a specific entity
638
+ * @param eventType - The type of resized event to request
639
+ * @param entityName - The name of the entity (slot or slot group) to request events for
640
+ */
641
+ static requestEvent(eventType, entityName) {
642
+ window["@onecx/integration-interface"] ??= {};
643
+ window["@onecx/integration-interface"]["resizedEvents"] ??= {};
644
+ window["@onecx/integration-interface"]["resizedEvents"][eventType] ??= [];
645
+ window["@onecx/integration-interface"]["resizedEvents"][eventType].push(entityName);
646
+ new ResizedEventsPublisher().publish({
647
+ type: "requested_events_changed" /* REQUESTED_EVENTS_CHANGED */,
648
+ payload: {
649
+ type: eventType,
650
+ name: entityName
651
+ }
652
+ });
653
+ }
654
+ //NOSONAR
655
+ publish(event) {
656
+ if (!["slot_group_resized" /* SLOT_GROUP_RESIZED */, "slot_resized" /* SLOT_RESIZED */].includes(event.type)) {
657
+ return super.publish(event);
658
+ }
659
+ const resizedEvent = event;
660
+ const entityName = eventToEntityName(resizedEvent);
661
+ if (window["@onecx/integration-interface"]["resizedEvents"]?.[resizedEvent.type]?.includes(entityName)) {
662
+ return super.publish(event);
663
+ }
664
+ return Promise.resolve();
665
+ }
666
+ };
667
+ function eventToEntityName(event) {
668
+ switch (event.type) {
669
+ case "slot_resized" /* SLOT_RESIZED */:
670
+ return event.payload.slotName;
671
+ case "slot_group_resized" /* SLOT_GROUP_RESIZED */:
672
+ return event.payload.slotGroupName;
673
+ }
674
+ }
675
+
676
+ // libs/integration-interface/src/lib/topics/current-location/v1/current-location.topic.ts
677
+ var CurrentLocationTopic = class extends Topic {
678
+ constructor() {
679
+ super("currentLocation", 1);
680
+ }
681
+ };
682
+
683
+ // libs/integration-interface/src/lib/topics/parameters/v1/parameters.topic.ts
684
+ var ParametersTopic = class extends Topic {
685
+ constructor() {
686
+ super("parameters", 1);
687
+ }
688
+ };
689
+
690
+ // libs/integration-interface/src/lib/topics/image-repository/image-repository.topic.ts
691
+ var ImageRepositoryTopic = class extends Topic {
692
+ constructor() {
693
+ super("imageRepository", 1);
694
+ }
695
+ };
696
+
697
+ // libs/integration-interface/src/lib/services/image-repository.service.ts
698
+ var import_rxjs4 = require("rxjs");
699
+ var ImageRepositoryService = class {
700
+ _imageRepositoryTopic$;
701
+ get imageRepositoryTopic() {
702
+ this._imageRepositoryTopic$ ??= new ImageRepositoryTopic();
703
+ return this._imageRepositoryTopic$;
704
+ }
705
+ set imageRepositoryTopic(source) {
706
+ this._imageRepositoryTopic$ = source;
707
+ }
708
+ async getUrl(names, fallbackUrl) {
709
+ if (!names || names.length === 0) {
710
+ return fallbackUrl;
711
+ }
712
+ const imagePaths = await (0, import_rxjs4.firstValueFrom)(this.imageRepositoryTopic.asObservable());
713
+ const urls = imagePaths.images || {};
714
+ const isUrlListEmpty = Object.entries(urls).length === 0;
715
+ if (isUrlListEmpty) {
716
+ return fallbackUrl;
717
+ }
718
+ for (const name of names) {
719
+ if (name in urls) {
720
+ return urls[name];
721
+ }
722
+ }
723
+ return fallbackUrl;
724
+ }
725
+ destroy() {
726
+ this.imageRepositoryTopic.destroy();
727
+ }
728
+ };
729
+
730
+ // libs/integration-interface/src/lib/topics/icons/v1/icon.topic.ts
731
+ var IconTopic = class extends Topic {
732
+ constructor() {
733
+ super("icon", 1, false);
734
+ }
735
+ };
736
+
737
+ // libs/integration-interface/src/lib/services/icon.service.ts
738
+ var import_rxjs5 = require("rxjs");
739
+ var DEFAULT_CLASS_TYPE = "background-before";
740
+ function ensureIconCache() {
741
+ ensureProperty(globalThis, ["onecxIcons"], {});
742
+ }
743
+ function generateClassName(name, classType) {
744
+ const safeName = normalizeIconName(name);
745
+ return `onecx-theme-icon-${classType}-${safeName}`;
746
+ }
747
+ function normalizeIconName(name) {
748
+ return name.replaceAll(/[^a-zA-Z0-9_-]+/g, "-");
749
+ }
750
+ var IconService = class {
751
+ _iconTopic$;
752
+ get iconTopic() {
753
+ this._iconTopic$ ??= new IconTopic();
754
+ return this._iconTopic$;
755
+ }
756
+ set iconTopic(source) {
757
+ this._iconTopic$ = source;
758
+ }
759
+ constructor() {
760
+ ensureIconCache();
761
+ }
762
+ requestIcon(name, classType = DEFAULT_CLASS_TYPE) {
763
+ const className = generateClassName(name, classType);
764
+ if (globalThis.onecxIcons && !(name in globalThis.onecxIcons)) {
765
+ ensureProperty(globalThis, ["onecxIcons", name], void 0);
766
+ this.iconTopic.publish({ type: "IconRequested", name });
767
+ }
768
+ return className;
769
+ }
770
+ async requestIconAsync(name, classType = DEFAULT_CLASS_TYPE) {
771
+ const className = this.requestIcon(name, classType);
772
+ const cached = globalThis.onecxIcons?.[name];
773
+ if (cached === null) return null;
774
+ if (cached) return className;
775
+ await (0, import_rxjs5.firstValueFrom)(
776
+ this.iconTopic.pipe(
777
+ (0, import_rxjs5.filter)((e) => e.type === "IconsReceived"),
778
+ (0, import_rxjs5.map)(() => globalThis.onecxIcons?.[name]),
779
+ (0, import_rxjs5.filter)((v) => v !== void 0)
780
+ )
781
+ );
782
+ return globalThis.onecxIcons?.[name] ? className : null;
783
+ }
784
+ destroy() {
785
+ this.iconTopic.destroy();
786
+ }
787
+ };
788
+
789
+ // libs/integration-interface/src/lib/topics/dynamic-translations/v1/dynamic-translations.model.ts
790
+ var DynamicTranslationsMessageType = /* @__PURE__ */ ((DynamicTranslationsMessageType2) => {
791
+ DynamicTranslationsMessageType2["REQUESTED"] = "REQUESTED";
792
+ DynamicTranslationsMessageType2["RECEIVED"] = "RECEIVED";
793
+ return DynamicTranslationsMessageType2;
794
+ })(DynamicTranslationsMessageType || {});
795
+
796
+ // libs/integration-interface/src/lib/topics/dynamic-translations/v1/dynamic-translations.topic.ts
797
+ var DynamicTranslationsTopic = class extends Topic {
798
+ constructor() {
799
+ super("dynamicTranslations", 1, false);
800
+ }
801
+ };
802
+
803
+ // libs/integration-interface/src/lib/services/dynamic-translation.service.ts
804
+ var import_rxjs6 = require("rxjs");
805
+ var import_semver = require("semver");
806
+
807
+ // libs/integration-interface/src/version.ts
808
+ var LIB_NAME = "@onecx/integration-interface";
809
+
810
+ // libs/integration-interface/src/lib/models/shell-capability.model.ts
811
+ var ShellCapability = /* @__PURE__ */ ((ShellCapability2) => {
812
+ ShellCapability2["CURRENT_LOCATION_TOPIC"] = "currentLocationTopic";
813
+ ShellCapability2["PARAMETERS_TOPIC"] = "parametersTopic";
814
+ ShellCapability2["ACTIVENESS_AWARE_MENUS"] = "activenessAwareMenus";
815
+ ShellCapability2["DYNAMIC_TRANSLATIONS_TOPIC"] = "dynamicTranslationsTopic";
816
+ return ShellCapability2;
817
+ })(ShellCapability || {});
818
+
819
+ // libs/integration-interface/src/lib/utils/shell-capability.utils.ts
820
+ function hasShellCapability(capability) {
821
+ return window["onecx-shell-capabilities"]?.includes(capability) ?? false;
822
+ }
823
+
824
+ // libs/integration-interface/src/lib/services/dynamic-translation.service.ts
825
+ var UNVERSIONED_KEY = "undefined";
826
+ function getDynamicTranslationsCache() {
827
+ const global = ensureProperty(globalThis, [LIB_NAME, "dynamicTranslationsCache"], {});
828
+ return global[LIB_NAME].dynamicTranslationsCache;
829
+ }
830
+ var DynamicTranslationService = class {
831
+ logger = createLogger2("DynamicTranslationService");
832
+ _dynamicTranslationsTopic$;
833
+ /**
834
+ * Topic used to request and receive dynamic translations.
835
+ */
836
+ get dynamicTranslationsTopic$() {
837
+ this._dynamicTranslationsTopic$ ??= new DynamicTranslationsTopic();
838
+ return this._dynamicTranslationsTopic$;
839
+ }
840
+ set dynamicTranslationsTopic$(source) {
841
+ this._dynamicTranslationsTopic$ = source;
842
+ }
843
+ /**
844
+ * Returns translations for the given locale and contexts.
845
+ *
846
+ * The method first attempts to resolve from cache, requests missing entries,
847
+ * and waits for a `RECEIVED` message when data is still pending.
848
+ *
849
+ * @param locale Target locale (for example `en`, `de`).
850
+ * @param contexts Translation contexts to resolve.
851
+ * @returns An observable emitting a context-keyed translation map.
852
+ */
853
+ getTranslations(locale, contexts) {
854
+ this.logger.debug("getTranslations", { locale, contexts });
855
+ const safeContexts = contexts.filter((context) => this.isSafeContext(context));
856
+ if (safeContexts.length !== contexts.length) {
857
+ this.logger.debug("Skipping unsafe translation contexts", { locale, contexts });
858
+ }
859
+ if (!this.isSafeCacheKey(locale)) {
860
+ this.logger.debug("Skipping dynamic translation resolution for unsafe locale key", { locale });
861
+ return (0, import_rxjs6.of)(this.createEmptyRecords(safeContexts));
862
+ }
863
+ if (!hasShellCapability("dynamicTranslationsTopic" /* DYNAMIC_TRANSLATIONS_TOPIC */)) {
864
+ this.logger.debug("Shell does not support dynamic translations, returning empty records");
865
+ return (0, import_rxjs6.of)(this.createEmptyRecords(safeContexts));
866
+ }
867
+ const cache = getDynamicTranslationsCache();
868
+ ensureProperty(cache, [locale], {});
869
+ const { missing, pending } = this.categorizeContexts(locale, safeContexts);
870
+ this.logger.debug("Categorized contexts", { missing, pending });
871
+ if (missing.length > 0) {
872
+ this.logger.debug("Marking contexts as requested and publishing request", { missing });
873
+ this.markContextsAsRequested(cache, locale, missing);
874
+ this.requestTranslations(locale, missing);
875
+ }
876
+ if (this.hasIncompleteContexts(missing, pending)) {
877
+ this.logger.debug("Waiting for translations", { missing, pending });
878
+ return this.waitForTranslations(locale, safeContexts);
879
+ }
880
+ const result = this.collectTranslations(locale, safeContexts);
881
+ this.logger.debug("Collected translations", { translations: result.translations });
882
+ return (0, import_rxjs6.of)(result.translations);
883
+ }
884
+ createEmptyRecords(contexts) {
885
+ const emptyRecords = {};
886
+ for (const context of contexts) {
887
+ const contextKey = this.getContextKey(context);
888
+ emptyRecords[contextKey] = {};
889
+ }
890
+ return emptyRecords;
891
+ }
892
+ categorizeContexts(locale, contexts) {
893
+ const missing = [];
894
+ const pending = [];
895
+ for (const context of contexts) {
896
+ const cachedVersion = this.findMatchingVersion(locale, context.name, context.version);
897
+ this.logger.debug("Context version match result", { context, cachedVersion });
898
+ if (cachedVersion === null) {
899
+ this.logger.debug("Context marked as null (no translations)", { context });
900
+ continue;
901
+ }
902
+ if (cachedVersion === void 0) {
903
+ this.logger.debug("Context missing in cache", { context });
904
+ missing.push(context);
905
+ } else if (cachedVersion.value === void 0) {
906
+ this.logger.debug("Context pending (requested but not received)", { context });
907
+ pending.push(context);
908
+ }
909
+ }
910
+ return { missing, pending };
911
+ }
912
+ findMatchingVersion(locale, contextName, requestedVersion) {
913
+ const contextCache = this.getContextCache(locale, contextName);
914
+ if (!contextCache) {
915
+ return void 0;
916
+ }
917
+ const versions = Object.keys(contextCache);
918
+ if (versions.length === 0) {
919
+ return void 0;
920
+ }
921
+ const normalizedVersion = requestedVersion || UNVERSIONED_KEY;
922
+ if (!requestedVersion || requestedVersion === UNVERSIONED_KEY) {
923
+ return this.getFirstAvailableVersion(contextCache, versions);
924
+ }
925
+ return this.findBestMatchingVersion(contextCache, versions, normalizedVersion);
926
+ }
927
+ getContextCache(locale, contextName) {
928
+ if (!this.isSafeCacheKey(locale) || !this.isSafeCacheKey(contextName)) {
929
+ return void 0;
930
+ }
931
+ const cache = getDynamicTranslationsCache();
932
+ const localeCache = cache[locale];
933
+ if (!localeCache || !Object.hasOwn(localeCache, contextName)) {
934
+ return void 0;
935
+ }
936
+ return localeCache[contextName];
937
+ }
938
+ getFirstAvailableVersion(contextCache, versions) {
939
+ const firstVersion = versions[0];
940
+ return { value: contextCache[firstVersion], version: firstVersion };
941
+ }
942
+ findBestMatchingVersion(contextCache, versions, requestedVersion) {
943
+ if (contextCache[requestedVersion] !== void 0) {
944
+ this.logger.debug("Exact version match found in cache", { requestedVersion });
945
+ return { value: contextCache[requestedVersion], version: requestedVersion };
946
+ }
947
+ const semanticMatch = this.findSemanticVersionMatch(contextCache, versions, requestedVersion);
948
+ if (semanticMatch) {
949
+ this.logger.debug("Semantic version match found", { requestedVersion, matchedVersion: semanticMatch.version });
950
+ return semanticMatch;
951
+ }
952
+ const nullCheck = this.checkForNullTranslations(contextCache, versions);
953
+ const hasNullMatch = nullCheck === null;
954
+ if (hasNullMatch) {
955
+ this.logger.debug("Found null translations check result", { requestedVersion });
956
+ } else {
957
+ this.logger.debug("No match found", { requestedVersion });
958
+ }
959
+ return nullCheck;
960
+ }
961
+ findSemanticVersionMatch(contextCache, versions, requestedVersion) {
962
+ const satisfyingVersions = versions.filter((v) => v !== UNVERSIONED_KEY && (0, import_semver.valid)(v) !== null && this.satisfiesVersion(v, requestedVersion)).sort(import_semver.rcompare);
963
+ if (satisfyingVersions.length > 0) {
964
+ const bestMatch = satisfyingVersions[0];
965
+ return { value: contextCache[bestMatch], version: bestMatch };
966
+ }
967
+ return void 0;
968
+ }
969
+ satisfiesVersion(availableVersion, requestedVersion) {
970
+ try {
971
+ return (0, import_semver.satisfies)(availableVersion, requestedVersion, { includePrerelease: true });
972
+ } catch {
973
+ return false;
974
+ }
975
+ }
976
+ checkForNullTranslations(contextCache, versions) {
977
+ const hasNullTranslation = versions.some((version) => contextCache[version] === null);
978
+ return hasNullTranslation ? null : void 0;
979
+ }
980
+ markContextsAsRequested(cache, locale, contexts) {
981
+ this.logger.debug("Marking contexts as requested", { locale, contexts });
982
+ for (const context of contexts) {
983
+ if (!this.isSafeContext(context)) {
984
+ this.logger.debug("Skipping unsafe context key while marking as requested", { locale, context });
985
+ continue;
986
+ }
987
+ ensureProperty(cache, [locale, context.name], {});
988
+ cache[locale][context.name][context.version ?? UNVERSIONED_KEY] = void 0;
989
+ this.logger.debug("Marked context as requested", { locale, context });
990
+ }
991
+ }
992
+ isSafeContext(context) {
993
+ return this.isSafeCacheKey(context.name) && this.isSafeCacheKey(context.version);
994
+ }
995
+ isSafeCacheKey(key) {
996
+ if (!key) {
997
+ return true;
998
+ }
999
+ return key !== "__proto__" && key !== "prototype" && key !== "constructor";
1000
+ }
1001
+ requestTranslations(locale, contexts) {
1002
+ const message = {
1003
+ type: "REQUESTED" /* REQUESTED */,
1004
+ locale,
1005
+ contexts: contexts.map(({ name, version }) => ({ name, version }))
1006
+ };
1007
+ this.logger.debug("Publishing translation request message", { message });
1008
+ this.dynamicTranslationsTopic$.publish(message);
1009
+ }
1010
+ hasIncompleteContexts(missing, pending) {
1011
+ return missing.length > 0 || pending.length > 0;
1012
+ }
1013
+ waitForTranslations(locale, contexts) {
1014
+ this.logger.debug("Starting to wait for translations", { locale, contexts });
1015
+ return this.dynamicTranslationsTopic$.pipe(
1016
+ (0, import_rxjs6.filter)((msg) => {
1017
+ const isReceived = msg.type === "RECEIVED" /* RECEIVED */;
1018
+ this.logger.debug("Received message", { type: msg.type, isReceived });
1019
+ return isReceived;
1020
+ }),
1021
+ (0, import_rxjs6.map)(() => {
1022
+ const result = this.collectTranslations(locale, contexts);
1023
+ this.logger.debug("Collected after message", { complete: result.complete });
1024
+ return result;
1025
+ }),
1026
+ (0, import_rxjs6.filter)((result) => result.complete),
1027
+ (0, import_rxjs6.map)((result) => {
1028
+ this.logger.debug("Translations complete, returning", { contextCount: Object.keys(result.translations).length });
1029
+ return result.translations;
1030
+ }),
1031
+ (0, import_rxjs6.first)()
1032
+ );
1033
+ }
1034
+ collectTranslations(locale, contexts) {
1035
+ const translations = {};
1036
+ let complete = true;
1037
+ for (const context of contexts) {
1038
+ const match = this.findMatchingVersion(locale, context.name, context.version);
1039
+ if (this.shouldSkipContext(match)) {
1040
+ this.logger.debug("Skipping context (null)", { context });
1041
+ continue;
1042
+ }
1043
+ if (this.isContextIncomplete(match)) {
1044
+ this.logger.debug("Context incomplete", { context });
1045
+ complete = false;
1046
+ continue;
1047
+ }
1048
+ this.addContextTranslations(translations, context, match);
1049
+ }
1050
+ this.logger.debug("Collection complete", { complete, contextCount: Object.keys(translations).length });
1051
+ return { translations, complete };
1052
+ }
1053
+ shouldSkipContext(match) {
1054
+ return match === null;
1055
+ }
1056
+ isContextIncomplete(match) {
1057
+ return match?.value === void 0;
1058
+ }
1059
+ addContextTranslations(target, context, match) {
1060
+ const matchedValue = match?.value;
1061
+ if (matchedValue !== null && matchedValue !== void 0) {
1062
+ const contextKey = this.getContextKey(context);
1063
+ target[contextKey] = matchedValue;
1064
+ this.logger.debug("Added context translations", { contextKey, translationKeys: Object.keys(matchedValue) });
1065
+ }
1066
+ }
1067
+ getContextKey(context) {
1068
+ return context.version ? `${context.name}@${context.version}` : context.name;
1069
+ }
1070
+ /**
1071
+ * Releases topic resources held by this service instance.
1072
+ */
1073
+ destroy() {
1074
+ this.dynamicTranslationsTopic$.destroy();
1075
+ }
1076
+ };