@haiilo/catalyst 6.2.2 → 6.3.0

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.
Files changed (147) hide show
  1. package/dist/catalyst/catalyst.css +57 -23
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/index.esm.js +2 -2
  5. package/dist/catalyst/index.esm.js.map +1 -1
  6. package/dist/catalyst/p-90e9d18f.entry.js +10 -0
  7. package/dist/catalyst/p-90e9d18f.entry.js.map +1 -0
  8. package/dist/catalyst/p-dd8ae83e.js +2 -0
  9. package/dist/catalyst/p-dd8ae83e.js.map +1 -0
  10. package/dist/catalyst/scss/_mixins.scss +2 -1
  11. package/dist/catalyst/scss/_variables.scss +1 -8
  12. package/dist/catalyst/scss/core/_nav.scss +2 -3
  13. package/dist/catalyst/scss/utils/_layout.scss +7 -3
  14. package/dist/catalyst/scss/utils/_z-index.mixins.scss +7 -0
  15. package/dist/catalyst/scss/vendor/_flatpickr.scss +62 -14
  16. package/dist/cjs/{cat-alert_25.cjs.entry.js → cat-alert_26.cjs.entry.js} +7190 -8001
  17. package/dist/cjs/cat-alert_26.cjs.entry.js.map +1 -0
  18. package/dist/cjs/catalyst.cjs.js +1 -1
  19. package/dist/cjs/index.cjs.js +28 -8
  20. package/dist/cjs/index.cjs.js.map +1 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/cjs/of-d9fa1990.js +1435 -0
  23. package/dist/cjs/of-d9fa1990.js.map +1 -0
  24. package/dist/collection/collection-manifest.json +1 -0
  25. package/dist/collection/components/cat-button/cat-button.css +21 -5
  26. package/dist/collection/components/cat-button/cat-button.js +18 -2
  27. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  28. package/dist/collection/components/cat-button/cat-button.spec.js +3 -1
  29. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  30. package/dist/collection/components/cat-button-group/cat-button-group.js +4 -0
  31. package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
  32. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +41 -20
  33. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -1
  34. package/dist/collection/components/cat-datepicker/cat-datepicker.format.js +22 -0
  35. package/dist/collection/components/cat-datepicker/cat-datepicker.format.js.map +1 -0
  36. package/dist/collection/components/cat-datepicker/cat-datepicker.js +53 -51
  37. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  38. package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js.map +1 -1
  39. package/dist/collection/components/cat-datepicker/cat-datepicker.mode.js +2 -0
  40. package/dist/collection/components/cat-datepicker/cat-datepicker.mode.js.map +1 -0
  41. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.css +1146 -0
  42. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js +10 -0
  43. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js.map +1 -0
  44. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +236 -0
  45. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -0
  46. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +20 -0
  47. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -0
  48. package/dist/collection/components/cat-dropdown/cat-dropdown.css +34 -11
  49. package/dist/collection/components/cat-form-group/cat-form-group.js +6 -6
  50. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  51. package/dist/collection/components/cat-input/cat-input.css +8 -0
  52. package/dist/collection/components/cat-input/cat-input.js +6 -5
  53. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  54. package/dist/collection/components/cat-select/cat-select.css +1 -1
  55. package/dist/collection/components/cat-select/cat-select.js +9 -9
  56. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  57. package/dist/collection/components/cat-select/connectors.js +20 -0
  58. package/dist/collection/components/cat-select/connectors.js.map +1 -0
  59. package/dist/collection/components/cat-tab/cat-tab.js +16 -0
  60. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  61. package/dist/collection/components/cat-tabs/cat-tabs.css +24 -2
  62. package/dist/collection/components/cat-tabs/cat-tabs.js +3 -3
  63. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  64. package/dist/collection/components/cat-textarea/cat-textarea.css +4 -0
  65. package/dist/collection/components/cat-textarea/cat-textarea.js +4 -3
  66. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  67. package/dist/collection/components/cat-tooltip/cat-tooltip.css +1 -1
  68. package/dist/collection/index.js +4 -3
  69. package/dist/collection/index.js.map +1 -1
  70. package/dist/collection/scss/_mixins.scss +2 -1
  71. package/dist/collection/scss/_variables.scss +1 -8
  72. package/dist/collection/scss/core/_nav.scss +2 -3
  73. package/dist/collection/scss/utils/_layout.scss +7 -3
  74. package/dist/collection/scss/utils/_z-index.mixins.scss +7 -0
  75. package/dist/collection/scss/vendor/_flatpickr.scss +62 -14
  76. package/dist/components/cat-button-group.js.map +1 -1
  77. package/dist/components/cat-button2.js +5 -3
  78. package/dist/components/cat-button2.js.map +1 -1
  79. package/dist/components/cat-datepicker-inline.d.ts +11 -0
  80. package/dist/components/cat-datepicker-inline.js +100 -0
  81. package/dist/components/cat-datepicker-inline.js.map +1 -0
  82. package/dist/components/cat-datepicker.js +39 -2770
  83. package/dist/components/cat-datepicker.js.map +1 -1
  84. package/dist/components/cat-datepicker.locale.js +2768 -0
  85. package/dist/components/cat-datepicker.locale.js.map +1 -0
  86. package/dist/components/cat-dropdown2.js +1 -1
  87. package/dist/components/cat-dropdown2.js.map +1 -1
  88. package/dist/components/cat-form-group.js +6 -6
  89. package/dist/components/cat-form-group.js.map +1 -1
  90. package/dist/components/cat-input2.js +7 -6
  91. package/dist/components/cat-input2.js.map +1 -1
  92. package/dist/components/cat-scrollable2.js +2 -910
  93. package/dist/components/cat-scrollable2.js.map +1 -1
  94. package/dist/components/cat-select-demo.js +4 -2
  95. package/dist/components/cat-select-demo.js.map +1 -1
  96. package/dist/components/cat-select2.js +14 -17
  97. package/dist/components/cat-select2.js.map +1 -1
  98. package/dist/components/cat-tab.js +3 -1
  99. package/dist/components/cat-tab.js.map +1 -1
  100. package/dist/components/cat-tabs.js +4 -4
  101. package/dist/components/cat-tabs.js.map +1 -1
  102. package/dist/components/cat-textarea.js +5 -4
  103. package/dist/components/cat-textarea.js.map +1 -1
  104. package/dist/components/cat-tooltip.js +1 -1
  105. package/dist/components/cat-tooltip.js.map +1 -1
  106. package/dist/components/from.js +912 -0
  107. package/dist/components/from.js.map +1 -0
  108. package/dist/components/index.js +21 -1
  109. package/dist/components/index.js.map +1 -1
  110. package/dist/components/of.js +10 -0
  111. package/dist/components/of.js.map +1 -0
  112. package/dist/esm/{cat-alert_25.entry.js → cat-alert_26.entry.js} +7199 -8011
  113. package/dist/esm/cat-alert_26.entry.js.map +1 -0
  114. package/dist/esm/catalyst.js +1 -1
  115. package/dist/esm/index.js +22 -3
  116. package/dist/esm/index.js.map +1 -1
  117. package/dist/esm/loader.js +1 -1
  118. package/dist/esm/of-5472d434.js +1408 -0
  119. package/dist/esm/of-5472d434.js.map +1 -0
  120. package/dist/types/components/cat-button/cat-button.d.ts +6 -0
  121. package/dist/types/components/cat-button-group/cat-button-group.d.ts +4 -0
  122. package/dist/types/components/cat-datepicker/cat-datepicker.config.d.ts +13 -1
  123. package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +6 -2
  124. package/dist/types/components/cat-datepicker/cat-datepicker.format.d.ts +2 -0
  125. package/dist/types/components/cat-datepicker/cat-datepicker.locale.d.ts +2 -2
  126. package/dist/types/components/cat-datepicker/cat-datepicker.mode.d.ts +1 -0
  127. package/dist/types/components/cat-datepicker-inline/cat-datepicker-inline.d.ts +43 -0
  128. package/dist/types/components/cat-form-group/cat-form-group.d.ts +2 -2
  129. package/dist/types/components/cat-input/cat-input.d.ts +1 -1
  130. package/dist/types/components/cat-select/cat-select.d.ts +4 -4
  131. package/dist/types/components/cat-select/connectors.d.ts +8 -0
  132. package/dist/types/components/cat-tab/cat-tab.d.ts +6 -0
  133. package/dist/types/components/cat-tabs/cat-tabs.d.ts +1 -1
  134. package/dist/types/components/cat-textarea/cat-textarea.d.ts +1 -1
  135. package/dist/types/components.d.ts +113 -2
  136. package/dist/types/index.d.ts +4 -3
  137. package/package.json +3 -3
  138. package/dist/catalyst/p-42e63e08.js +0 -2
  139. package/dist/catalyst/p-42e63e08.js.map +0 -1
  140. package/dist/catalyst/p-cd1f4492.entry.js +0 -10
  141. package/dist/catalyst/p-cd1f4492.entry.js.map +0 -1
  142. package/dist/cjs/cat-alert_25.cjs.entry.js.map +0 -1
  143. package/dist/cjs/cat-icon-registry-5c292d3f.js +0 -502
  144. package/dist/cjs/cat-icon-registry-5c292d3f.js.map +0 -1
  145. package/dist/esm/cat-alert_25.entry.js.map +0 -1
  146. package/dist/esm/cat-icon-registry-4fc73466.js +0 -494
  147. package/dist/esm/cat-icon-registry-4fc73466.js.map +0 -1
@@ -0,0 +1,1435 @@
1
+ 'use strict';
2
+
3
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
+
5
+ function createCommonjsModule(fn, basedir, module) {
6
+ return module = {
7
+ path: basedir,
8
+ exports: {},
9
+ require: function (path, base) {
10
+ return commonjsRequire();
11
+ }
12
+ }, fn(module, module.exports), module.exports;
13
+ }
14
+
15
+ function commonjsRequire () {
16
+ throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
17
+ }
18
+
19
+ var loglevel = createCommonjsModule(function (module) {
20
+ /*
21
+ * loglevel - https://github.com/pimterry/loglevel
22
+ *
23
+ * Copyright (c) 2013 Tim Perry
24
+ * Licensed under the MIT license.
25
+ */
26
+ (function (root, definition) {
27
+ if (module.exports) {
28
+ module.exports = definition();
29
+ } else {
30
+ root.log = definition();
31
+ }
32
+ }(commonjsGlobal, function () {
33
+
34
+ // Slightly dubious tricks to cut down minimized file size
35
+ var noop = function() {};
36
+ var undefinedType = "undefined";
37
+ var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (
38
+ /Trident\/|MSIE /.test(window.navigator.userAgent)
39
+ );
40
+
41
+ var logMethods = [
42
+ "trace",
43
+ "debug",
44
+ "info",
45
+ "warn",
46
+ "error"
47
+ ];
48
+
49
+ // Cross-browser bind equivalent that works at least back to IE6
50
+ function bindMethod(obj, methodName) {
51
+ var method = obj[methodName];
52
+ if (typeof method.bind === 'function') {
53
+ return method.bind(obj);
54
+ } else {
55
+ try {
56
+ return Function.prototype.bind.call(method, obj);
57
+ } catch (e) {
58
+ // Missing bind shim or IE8 + Modernizr, fallback to wrapping
59
+ return function() {
60
+ return Function.prototype.apply.apply(method, [obj, arguments]);
61
+ };
62
+ }
63
+ }
64
+ }
65
+
66
+ // Trace() doesn't print the message in IE, so for that case we need to wrap it
67
+ function traceForIE() {
68
+ if (console.log) {
69
+ if (console.log.apply) {
70
+ console.log.apply(console, arguments);
71
+ } else {
72
+ // In old IE, native console methods themselves don't have apply().
73
+ Function.prototype.apply.apply(console.log, [console, arguments]);
74
+ }
75
+ }
76
+ if (console.trace) console.trace();
77
+ }
78
+
79
+ // Build the best logging method possible for this env
80
+ // Wherever possible we want to bind, not wrap, to preserve stack traces
81
+ function realMethod(methodName) {
82
+ if (methodName === 'debug') {
83
+ methodName = 'log';
84
+ }
85
+
86
+ if (typeof console === undefinedType) {
87
+ return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives
88
+ } else if (methodName === 'trace' && isIE) {
89
+ return traceForIE;
90
+ } else if (console[methodName] !== undefined) {
91
+ return bindMethod(console, methodName);
92
+ } else if (console.log !== undefined) {
93
+ return bindMethod(console, 'log');
94
+ } else {
95
+ return noop;
96
+ }
97
+ }
98
+
99
+ // These private functions always need `this` to be set properly
100
+
101
+ function replaceLoggingMethods(level, loggerName) {
102
+ /*jshint validthis:true */
103
+ for (var i = 0; i < logMethods.length; i++) {
104
+ var methodName = logMethods[i];
105
+ this[methodName] = (i < level) ?
106
+ noop :
107
+ this.methodFactory(methodName, level, loggerName);
108
+ }
109
+
110
+ // Define log.log as an alias for log.debug
111
+ this.log = this.debug;
112
+ }
113
+
114
+ // In old IE versions, the console isn't present until you first open it.
115
+ // We build realMethod() replacements here that regenerate logging methods
116
+ function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {
117
+ return function () {
118
+ if (typeof console !== undefinedType) {
119
+ replaceLoggingMethods.call(this, level, loggerName);
120
+ this[methodName].apply(this, arguments);
121
+ }
122
+ };
123
+ }
124
+
125
+ // By default, we use closely bound real methods wherever possible, and
126
+ // otherwise we wait for a console to appear, and then try again.
127
+ function defaultMethodFactory(methodName, level, loggerName) {
128
+ /*jshint validthis:true */
129
+ return realMethod(methodName) ||
130
+ enableLoggingWhenConsoleArrives.apply(this, arguments);
131
+ }
132
+
133
+ function Logger(name, defaultLevel, factory) {
134
+ var self = this;
135
+ var currentLevel;
136
+ defaultLevel = defaultLevel == null ? "WARN" : defaultLevel;
137
+
138
+ var storageKey = "loglevel";
139
+ if (typeof name === "string") {
140
+ storageKey += ":" + name;
141
+ } else if (typeof name === "symbol") {
142
+ storageKey = undefined;
143
+ }
144
+
145
+ function persistLevelIfPossible(levelNum) {
146
+ var levelName = (logMethods[levelNum] || 'silent').toUpperCase();
147
+
148
+ if (typeof window === undefinedType || !storageKey) return;
149
+
150
+ // Use localStorage if available
151
+ try {
152
+ window.localStorage[storageKey] = levelName;
153
+ return;
154
+ } catch (ignore) {}
155
+
156
+ // Use session cookie as fallback
157
+ try {
158
+ window.document.cookie =
159
+ encodeURIComponent(storageKey) + "=" + levelName + ";";
160
+ } catch (ignore) {}
161
+ }
162
+
163
+ function getPersistedLevel() {
164
+ var storedLevel;
165
+
166
+ if (typeof window === undefinedType || !storageKey) return;
167
+
168
+ try {
169
+ storedLevel = window.localStorage[storageKey];
170
+ } catch (ignore) {}
171
+
172
+ // Fallback to cookies if local storage gives us nothing
173
+ if (typeof storedLevel === undefinedType) {
174
+ try {
175
+ var cookie = window.document.cookie;
176
+ var location = cookie.indexOf(
177
+ encodeURIComponent(storageKey) + "=");
178
+ if (location !== -1) {
179
+ storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];
180
+ }
181
+ } catch (ignore) {}
182
+ }
183
+
184
+ // If the stored level is not valid, treat it as if nothing was stored.
185
+ if (self.levels[storedLevel] === undefined) {
186
+ storedLevel = undefined;
187
+ }
188
+
189
+ return storedLevel;
190
+ }
191
+
192
+ function clearPersistedLevel() {
193
+ if (typeof window === undefinedType || !storageKey) return;
194
+
195
+ // Use localStorage if available
196
+ try {
197
+ window.localStorage.removeItem(storageKey);
198
+ return;
199
+ } catch (ignore) {}
200
+
201
+ // Use session cookie as fallback
202
+ try {
203
+ window.document.cookie =
204
+ encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
205
+ } catch (ignore) {}
206
+ }
207
+
208
+ /*
209
+ *
210
+ * Public logger API - see https://github.com/pimterry/loglevel for details
211
+ *
212
+ */
213
+
214
+ self.name = name;
215
+
216
+ self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3,
217
+ "ERROR": 4, "SILENT": 5};
218
+
219
+ self.methodFactory = factory || defaultMethodFactory;
220
+
221
+ self.getLevel = function () {
222
+ return currentLevel;
223
+ };
224
+
225
+ self.setLevel = function (level, persist) {
226
+ if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {
227
+ level = self.levels[level.toUpperCase()];
228
+ }
229
+ if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {
230
+ currentLevel = level;
231
+ if (persist !== false) { // defaults to true
232
+ persistLevelIfPossible(level);
233
+ }
234
+ replaceLoggingMethods.call(self, level, name);
235
+ if (typeof console === undefinedType && level < self.levels.SILENT) {
236
+ return "No console available for logging";
237
+ }
238
+ } else {
239
+ throw "log.setLevel() called with invalid level: " + level;
240
+ }
241
+ };
242
+
243
+ self.setDefaultLevel = function (level) {
244
+ defaultLevel = level;
245
+ if (!getPersistedLevel()) {
246
+ self.setLevel(level, false);
247
+ }
248
+ };
249
+
250
+ self.resetLevel = function () {
251
+ self.setLevel(defaultLevel, false);
252
+ clearPersistedLevel();
253
+ };
254
+
255
+ self.enableAll = function(persist) {
256
+ self.setLevel(self.levels.TRACE, persist);
257
+ };
258
+
259
+ self.disableAll = function(persist) {
260
+ self.setLevel(self.levels.SILENT, persist);
261
+ };
262
+
263
+ // Initialize with the right level
264
+ var initialLevel = getPersistedLevel();
265
+ if (initialLevel == null) {
266
+ initialLevel = defaultLevel;
267
+ }
268
+ self.setLevel(initialLevel, false);
269
+ }
270
+
271
+ /*
272
+ *
273
+ * Top-level API
274
+ *
275
+ */
276
+
277
+ var defaultLogger = new Logger();
278
+
279
+ var _loggersByName = {};
280
+ defaultLogger.getLogger = function getLogger(name) {
281
+ if ((typeof name !== "symbol" && typeof name !== "string") || name === "") {
282
+ throw new TypeError("You must supply a name when creating a logger.");
283
+ }
284
+
285
+ var logger = _loggersByName[name];
286
+ if (!logger) {
287
+ logger = _loggersByName[name] = new Logger(
288
+ name, defaultLogger.getLevel(), defaultLogger.methodFactory);
289
+ }
290
+ return logger;
291
+ };
292
+
293
+ // Grab the current global log variable in case of overwrite
294
+ var _log = (typeof window !== undefinedType) ? window.log : undefined;
295
+ defaultLogger.noConflict = function() {
296
+ if (typeof window !== undefinedType &&
297
+ window.log === defaultLogger) {
298
+ window.log = _log;
299
+ }
300
+
301
+ return defaultLogger;
302
+ };
303
+
304
+ defaultLogger.getLoggers = function getLoggers() {
305
+ return _loggersByName;
306
+ };
307
+
308
+ // ES6 default export, for compatibility
309
+ defaultLogger['default'] = defaultLogger;
310
+
311
+ return defaultLogger;
312
+ }));
313
+ });
314
+
315
+ class CatI18nRegistry {
316
+ constructor() {
317
+ // hide constructor
318
+ this.id = (Math.random() + 1).toString(36).substring(2);
319
+ this.i18n = new Map();
320
+ // In rare cases, the registry can be initialized twice. This can happen in
321
+ // a micro frontend architecture where the registry is initialized in the
322
+ // host application and in the micro frontend. To prevent the registry in
323
+ // one application from overwriting the registry in the other, we listen for
324
+ // events that are dispatched when messages are added or removed in other
325
+ // applications and add or remove messages if the event was not dispatched
326
+ // by this registry.
327
+ window.addEventListener('cat-i18n-set', event => {
328
+ const { detail } = event || {};
329
+ if (detail && detail.id !== this.id) {
330
+ this.set(detail.i18n, true);
331
+ }
332
+ });
333
+ window.addEventListener('cat-i18n-clear', event => {
334
+ const { detail } = event || {};
335
+ if (detail && detail.id !== this.id) {
336
+ this.clear(true);
337
+ }
338
+ });
339
+ }
340
+ static getInstance() {
341
+ if (!CatI18nRegistry.instance) {
342
+ CatI18nRegistry.instance = new CatI18nRegistry();
343
+ }
344
+ return CatI18nRegistry.instance;
345
+ }
346
+ getLocale() {
347
+ return this._locale ?? window?.navigator?.language ?? 'en';
348
+ }
349
+ setLocale(locale) {
350
+ try {
351
+ this._locale = Intl.getCanonicalLocales(locale)[0];
352
+ loglevel.info(`[CatI18nRegistry] Set locale: ${this._locale}`);
353
+ }
354
+ catch (err) {
355
+ loglevel.error(`[CatI18nRegistry] Invalid locale: ${locale}`);
356
+ }
357
+ }
358
+ set(i18n, silent = false) {
359
+ const i18nEntries = Object.entries(i18n);
360
+ i18nEntries.forEach(([key, message]) => this.i18n.set(key, message));
361
+ loglevel.info(`[CatI18nRegistry] Registered ${i18nEntries.length !== 1 ? 'messages' : 'message'}`);
362
+ !silent && window.dispatchEvent(this.buildEvent('cat-i18n-set', { i18n, id: this.id }));
363
+ }
364
+ clear(silent = false) {
365
+ this.i18n.clear();
366
+ loglevel.info(`[CatI18nRegistry] Cleared messages`);
367
+ !silent && window.dispatchEvent(this.buildEvent('cat-i18n-clear'));
368
+ }
369
+ t(key, params) {
370
+ const message = this.i18n.get(key);
371
+ if (message === undefined) {
372
+ loglevel.error(`[CatI18nRegistry] Unknown message key: ${key}`);
373
+ return key;
374
+ }
375
+ return message.replace(/{{\s*([-a-zA-Z._]+)\s*}}/g, (_match, key) => `${params?.[key] ?? ''}`);
376
+ }
377
+ buildEvent(name, detail) {
378
+ return new CustomEvent(name, {
379
+ bubbles: true,
380
+ composed: true,
381
+ detail
382
+ });
383
+ }
384
+ }
385
+ const catI18nRegistry = CatI18nRegistry.getInstance();
386
+
387
+ const cross16 = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4.53 3.47a.75.75 0 0 0-1.06 1.06L6.94 8l-3.47 3.47a.75.75 0 1 0 1.06 1.06L8 9.06l3.47 3.47a.75.75 0 1 0 1.06-1.06L9.06 8l3.47-3.47a.75.75 0 0 0-1.06-1.06L8 6.94 4.53 3.47Z"/></svg>`;
388
+
389
+ const alertCircleOutlined = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 16a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.25-8a.75.75 0 0 0-1.5 0v4.5a.75.75 0 0 0 1.5 0V8Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM12 3.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5Z"/></svg>
390
+ `;
391
+
392
+ const checkCircleFilled = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.768-12.36a1 1 0 1 0-1.536-1.28l-4.3 5.159-2.225-2.226a1 1 0 0 0-1.414 1.414l3 3a1 1 0 0 0 1.475-.067l5-6Z"/></svg>`;
393
+
394
+ const chevronDownOutlined = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.47 9.47a.75.75 0 0 1 1.06 0L12 13.94l4.47-4.47a.75.75 0 1 1 1.06 1.06l-5 5a.75.75 0 0 1-1.06 0l-5-5a.75.75 0 0 1 0-1.06Z"/></svg>`;
395
+
396
+ const chevronLeftOutlined = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 6.47a.75.75 0 0 1 0 1.06L10.06 12l4.47 4.47a.75.75 0 1 1-1.06 1.06l-5-5a.75.75 0 0 1 0-1.06l5-5a.75.75 0 0 1 1.06 0Z"/></svg>`;
397
+
398
+ const chevronRightOutlined = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.47 6.47a.75.75 0 0 1 1.06 0l5 5a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 1 1-1.06-1.06L13.94 12 9.47 7.53a.75.75 0 0 1 0-1.06Z"/></svg>`;
399
+
400
+ const clockFilled = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm1-15a1 1 0 1 0-2 0v5a1 1 0 0 0 1 1h5a1 1 0 1 0 0-2h-4V7Z"/></svg>`;
401
+
402
+ const crossCircleFilled = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z"/></svg>`;
403
+
404
+ const crossCircleOutlined = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8.47 8.47a.75.75 0 0 1 1.06 0L12 10.94l2.47-2.47a.75.75 0 1 1 1.06 1.06L13.06 12l2.47 2.47a.75.75 0 1 1-1.06 1.06L12 13.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L10.94 12 8.47 9.53a.75.75 0 0 1 0-1.06Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0Z"/></svg>`;
405
+
406
+ const crossOutlined = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.53 6.47a.75.75 0 0 0-1.06 1.06L10.94 12l-4.47 4.47a.75.75 0 1 0 1.06 1.06L12 13.06l4.47 4.47a.75.75 0 1 0 1.06-1.06L13.06 12l4.47-4.47a.75.75 0 0 0-1.06-1.06L12 10.94 7.53 6.47Z"/></svg>`;
407
+
408
+ const dangerFilled = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 3.25c-.429 0-.85.113-1.22.328a2.5 2.5 0 0 0-.899.891L2.577 16.981a2.554 2.554 0 0 0-.007 2.491c.212.381.519.7.891.926a2.44 2.44 0 0 0 1.234.352h14.61a2.44 2.44 0 0 0 1.233-.352 2.5 2.5 0 0 0 .892-.926 2.553 2.553 0 0 0-.007-2.491L14.119 4.469a2.494 2.494 0 0 0-.899-.891A2.439 2.439 0 0 0 12 3.25ZM12 8a1 1 0 0 1 1 1v3.5a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1Zm1 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/></svg>`;
409
+
410
+ const starCircleFilled = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-7.82-3.001L12 5 9.82 8.999l-4.477.838 3.129 3.31-.587 4.516L12 15.71l4.114 1.953-.586-4.517 3.13-3.31L14.18 9Z"/></svg>`;
411
+
412
+ class CatIconRegistry {
413
+ constructor() {
414
+ // hide constructor
415
+ this.id = (Math.random() + 1).toString(36).substring(2);
416
+ this.icons = new Map();
417
+ // register default icons that are used in the framework by other components
418
+ this.addIcons({
419
+ 'alert-danger': crossCircleFilled,
420
+ 'alert-primary': starCircleFilled,
421
+ 'alert-secondary': clockFilled,
422
+ 'alert-success': checkCircleFilled,
423
+ 'alert-warning': dangerFilled,
424
+ 'dialog-close': crossOutlined,
425
+ 'input-close': crossCircleOutlined,
426
+ 'input-error': alertCircleOutlined,
427
+ 'notification-close': crossCircleOutlined,
428
+ 'pagination-left': chevronLeftOutlined,
429
+ 'pagination-right': chevronRightOutlined,
430
+ 'select-clear': cross16,
431
+ 'select-open': chevronDownOutlined
432
+ }, '$cat', true);
433
+ // In rare cases, the registry can be initialized twice. This can happen in
434
+ // a micro frontend architecture where the registry is initialized in the
435
+ // host application and in the micro frontend. To prevent the registry in
436
+ // one application from overwriting the registry in the other, we listen for
437
+ // events that are dispatched when icons are added or removed in other
438
+ // applications and add or remove icons if the event was not dispatched by
439
+ // this registry.
440
+ window.addEventListener('cat-icons-added', event => {
441
+ const { detail } = event || {};
442
+ if (detail && detail.id !== this.id) {
443
+ this.addIcons(detail.icons, detail.setName, true);
444
+ }
445
+ });
446
+ window.addEventListener('cat-icons-removed', event => {
447
+ const { detail } = event || {};
448
+ if (detail && detail.id !== this.id) {
449
+ this.removeIcons(detail.names, detail.setName, true);
450
+ }
451
+ });
452
+ }
453
+ static getInstance() {
454
+ if (!CatIconRegistry.instance) {
455
+ CatIconRegistry.instance = new CatIconRegistry();
456
+ }
457
+ return CatIconRegistry.instance;
458
+ }
459
+ getIcon(name, setName) {
460
+ const icon = this.icons.get(this.buildName(name, setName));
461
+ if (!icon) {
462
+ loglevel.error(`[CatIconRegistry] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);
463
+ }
464
+ return icon;
465
+ }
466
+ addIcons(icons, setName, silent = false) {
467
+ const iconEntries = Object.entries(icons);
468
+ const iconSize = iconEntries.length;
469
+ iconEntries.forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));
470
+ loglevel.info(`[CatIconRegistry] Added ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` to set ${setName}` : ''}`);
471
+ !silent && window.dispatchEvent(this.buildEvent('cat-icons-added', { id: this.id, icons, setName }));
472
+ return this;
473
+ }
474
+ removeIcons(names, setName, silent = false) {
475
+ const iconSize = names.length;
476
+ names.forEach(name => this.icons.delete(this.buildName(name, setName)));
477
+ loglevel.info(`[CatIconRegistry] Removed ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` from set ${setName}` : ''}`);
478
+ !silent && window.dispatchEvent(this.buildEvent('cat-icons-removed', { id: this.id, names, setName }));
479
+ return this;
480
+ }
481
+ buildName(name, setName) {
482
+ return setName ? `${setName}:${name}` : name;
483
+ }
484
+ buildEvent(name, detail) {
485
+ return new CustomEvent(name, {
486
+ bubbles: true,
487
+ composed: true,
488
+ detail
489
+ });
490
+ }
491
+ }
492
+ const catIconRegistry = CatIconRegistry.getInstance();
493
+
494
+ function isFunction(value) {
495
+ return typeof value === 'function';
496
+ }
497
+
498
+ function createErrorClass(createImpl) {
499
+ const _super = (instance) => {
500
+ Error.call(instance);
501
+ instance.stack = new Error().stack;
502
+ };
503
+ const ctorFunc = createImpl(_super);
504
+ ctorFunc.prototype = Object.create(Error.prototype);
505
+ ctorFunc.prototype.constructor = ctorFunc;
506
+ return ctorFunc;
507
+ }
508
+
509
+ const UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {
510
+ _super(this);
511
+ this.message = errors
512
+ ? `${errors.length} errors occurred during unsubscription:
513
+ ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}`
514
+ : '';
515
+ this.name = 'UnsubscriptionError';
516
+ this.errors = errors;
517
+ });
518
+
519
+ function arrRemove(arr, item) {
520
+ if (arr) {
521
+ const index = arr.indexOf(item);
522
+ 0 <= index && arr.splice(index, 1);
523
+ }
524
+ }
525
+
526
+ class Subscription {
527
+ constructor(initialTeardown) {
528
+ this.initialTeardown = initialTeardown;
529
+ this.closed = false;
530
+ this._parentage = null;
531
+ this._finalizers = null;
532
+ }
533
+ unsubscribe() {
534
+ let errors;
535
+ if (!this.closed) {
536
+ this.closed = true;
537
+ const { _parentage } = this;
538
+ if (_parentage) {
539
+ this._parentage = null;
540
+ if (Array.isArray(_parentage)) {
541
+ for (const parent of _parentage) {
542
+ parent.remove(this);
543
+ }
544
+ }
545
+ else {
546
+ _parentage.remove(this);
547
+ }
548
+ }
549
+ const { initialTeardown: initialFinalizer } = this;
550
+ if (isFunction(initialFinalizer)) {
551
+ try {
552
+ initialFinalizer();
553
+ }
554
+ catch (e) {
555
+ errors = e instanceof UnsubscriptionError ? e.errors : [e];
556
+ }
557
+ }
558
+ const { _finalizers } = this;
559
+ if (_finalizers) {
560
+ this._finalizers = null;
561
+ for (const finalizer of _finalizers) {
562
+ try {
563
+ execFinalizer(finalizer);
564
+ }
565
+ catch (err) {
566
+ errors = errors !== null && errors !== void 0 ? errors : [];
567
+ if (err instanceof UnsubscriptionError) {
568
+ errors = [...errors, ...err.errors];
569
+ }
570
+ else {
571
+ errors.push(err);
572
+ }
573
+ }
574
+ }
575
+ }
576
+ if (errors) {
577
+ throw new UnsubscriptionError(errors);
578
+ }
579
+ }
580
+ }
581
+ add(teardown) {
582
+ var _a;
583
+ if (teardown && teardown !== this) {
584
+ if (this.closed) {
585
+ execFinalizer(teardown);
586
+ }
587
+ else {
588
+ if (teardown instanceof Subscription) {
589
+ if (teardown.closed || teardown._hasParent(this)) {
590
+ return;
591
+ }
592
+ teardown._addParent(this);
593
+ }
594
+ (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
595
+ }
596
+ }
597
+ }
598
+ _hasParent(parent) {
599
+ const { _parentage } = this;
600
+ return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
601
+ }
602
+ _addParent(parent) {
603
+ const { _parentage } = this;
604
+ this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
605
+ }
606
+ _removeParent(parent) {
607
+ const { _parentage } = this;
608
+ if (_parentage === parent) {
609
+ this._parentage = null;
610
+ }
611
+ else if (Array.isArray(_parentage)) {
612
+ arrRemove(_parentage, parent);
613
+ }
614
+ }
615
+ remove(teardown) {
616
+ const { _finalizers } = this;
617
+ _finalizers && arrRemove(_finalizers, teardown);
618
+ if (teardown instanceof Subscription) {
619
+ teardown._removeParent(this);
620
+ }
621
+ }
622
+ }
623
+ Subscription.EMPTY = (() => {
624
+ const empty = new Subscription();
625
+ empty.closed = true;
626
+ return empty;
627
+ })();
628
+ const EMPTY_SUBSCRIPTION = Subscription.EMPTY;
629
+ function isSubscription(value) {
630
+ return (value instanceof Subscription ||
631
+ (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
632
+ }
633
+ function execFinalizer(finalizer) {
634
+ if (isFunction(finalizer)) {
635
+ finalizer();
636
+ }
637
+ else {
638
+ finalizer.unsubscribe();
639
+ }
640
+ }
641
+
642
+ const config = {
643
+ onUnhandledError: null,
644
+ onStoppedNotification: null,
645
+ Promise: undefined,
646
+ useDeprecatedSynchronousErrorHandling: false,
647
+ useDeprecatedNextContext: false,
648
+ };
649
+
650
+ const timeoutProvider = {
651
+ setTimeout(handler, timeout, ...args) {
652
+ const { delegate } = timeoutProvider;
653
+ if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
654
+ return delegate.setTimeout(handler, timeout, ...args);
655
+ }
656
+ return setTimeout(handler, timeout, ...args);
657
+ },
658
+ clearTimeout(handle) {
659
+ const { delegate } = timeoutProvider;
660
+ return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
661
+ },
662
+ delegate: undefined,
663
+ };
664
+
665
+ function reportUnhandledError(err) {
666
+ timeoutProvider.setTimeout(() => {
667
+ const { onUnhandledError } = config;
668
+ if (onUnhandledError) {
669
+ onUnhandledError(err);
670
+ }
671
+ else {
672
+ throw err;
673
+ }
674
+ });
675
+ }
676
+
677
+ function noop() { }
678
+
679
+ const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))();
680
+ function errorNotification(error) {
681
+ return createNotification('E', undefined, error);
682
+ }
683
+ function nextNotification(value) {
684
+ return createNotification('N', value, undefined);
685
+ }
686
+ function createNotification(kind, value, error) {
687
+ return {
688
+ kind,
689
+ value,
690
+ error,
691
+ };
692
+ }
693
+
694
+ function errorContext(cb) {
695
+ {
696
+ cb();
697
+ }
698
+ }
699
+
700
+ class Subscriber extends Subscription {
701
+ constructor(destination) {
702
+ super();
703
+ this.isStopped = false;
704
+ if (destination) {
705
+ this.destination = destination;
706
+ if (isSubscription(destination)) {
707
+ destination.add(this);
708
+ }
709
+ }
710
+ else {
711
+ this.destination = EMPTY_OBSERVER;
712
+ }
713
+ }
714
+ static create(next, error, complete) {
715
+ return new SafeSubscriber(next, error, complete);
716
+ }
717
+ next(value) {
718
+ if (this.isStopped) {
719
+ handleStoppedNotification(nextNotification(value), this);
720
+ }
721
+ else {
722
+ this._next(value);
723
+ }
724
+ }
725
+ error(err) {
726
+ if (this.isStopped) {
727
+ handleStoppedNotification(errorNotification(err), this);
728
+ }
729
+ else {
730
+ this.isStopped = true;
731
+ this._error(err);
732
+ }
733
+ }
734
+ complete() {
735
+ if (this.isStopped) {
736
+ handleStoppedNotification(COMPLETE_NOTIFICATION, this);
737
+ }
738
+ else {
739
+ this.isStopped = true;
740
+ this._complete();
741
+ }
742
+ }
743
+ unsubscribe() {
744
+ if (!this.closed) {
745
+ this.isStopped = true;
746
+ super.unsubscribe();
747
+ this.destination = null;
748
+ }
749
+ }
750
+ _next(value) {
751
+ this.destination.next(value);
752
+ }
753
+ _error(err) {
754
+ try {
755
+ this.destination.error(err);
756
+ }
757
+ finally {
758
+ this.unsubscribe();
759
+ }
760
+ }
761
+ _complete() {
762
+ try {
763
+ this.destination.complete();
764
+ }
765
+ finally {
766
+ this.unsubscribe();
767
+ }
768
+ }
769
+ }
770
+ const _bind = Function.prototype.bind;
771
+ function bind(fn, thisArg) {
772
+ return _bind.call(fn, thisArg);
773
+ }
774
+ class ConsumerObserver {
775
+ constructor(partialObserver) {
776
+ this.partialObserver = partialObserver;
777
+ }
778
+ next(value) {
779
+ const { partialObserver } = this;
780
+ if (partialObserver.next) {
781
+ try {
782
+ partialObserver.next(value);
783
+ }
784
+ catch (error) {
785
+ handleUnhandledError(error);
786
+ }
787
+ }
788
+ }
789
+ error(err) {
790
+ const { partialObserver } = this;
791
+ if (partialObserver.error) {
792
+ try {
793
+ partialObserver.error(err);
794
+ }
795
+ catch (error) {
796
+ handleUnhandledError(error);
797
+ }
798
+ }
799
+ else {
800
+ handleUnhandledError(err);
801
+ }
802
+ }
803
+ complete() {
804
+ const { partialObserver } = this;
805
+ if (partialObserver.complete) {
806
+ try {
807
+ partialObserver.complete();
808
+ }
809
+ catch (error) {
810
+ handleUnhandledError(error);
811
+ }
812
+ }
813
+ }
814
+ }
815
+ class SafeSubscriber extends Subscriber {
816
+ constructor(observerOrNext, error, complete) {
817
+ super();
818
+ let partialObserver;
819
+ if (isFunction(observerOrNext) || !observerOrNext) {
820
+ partialObserver = {
821
+ next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,
822
+ error: error !== null && error !== void 0 ? error : undefined,
823
+ complete: complete !== null && complete !== void 0 ? complete : undefined,
824
+ };
825
+ }
826
+ else {
827
+ let context;
828
+ if (this && config.useDeprecatedNextContext) {
829
+ context = Object.create(observerOrNext);
830
+ context.unsubscribe = () => this.unsubscribe();
831
+ partialObserver = {
832
+ next: observerOrNext.next && bind(observerOrNext.next, context),
833
+ error: observerOrNext.error && bind(observerOrNext.error, context),
834
+ complete: observerOrNext.complete && bind(observerOrNext.complete, context),
835
+ };
836
+ }
837
+ else {
838
+ partialObserver = observerOrNext;
839
+ }
840
+ }
841
+ this.destination = new ConsumerObserver(partialObserver);
842
+ }
843
+ }
844
+ function handleUnhandledError(error) {
845
+ {
846
+ reportUnhandledError(error);
847
+ }
848
+ }
849
+ function defaultErrorHandler(err) {
850
+ throw err;
851
+ }
852
+ function handleStoppedNotification(notification, subscriber) {
853
+ const { onStoppedNotification } = config;
854
+ onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));
855
+ }
856
+ const EMPTY_OBSERVER = {
857
+ closed: true,
858
+ next: noop,
859
+ error: defaultErrorHandler,
860
+ complete: noop,
861
+ };
862
+
863
+ const observable = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();
864
+
865
+ function identity(x) {
866
+ return x;
867
+ }
868
+
869
+ function pipeFromArray(fns) {
870
+ if (fns.length === 0) {
871
+ return identity;
872
+ }
873
+ if (fns.length === 1) {
874
+ return fns[0];
875
+ }
876
+ return function piped(input) {
877
+ return fns.reduce((prev, fn) => fn(prev), input);
878
+ };
879
+ }
880
+
881
+ class Observable {
882
+ constructor(subscribe) {
883
+ if (subscribe) {
884
+ this._subscribe = subscribe;
885
+ }
886
+ }
887
+ lift(operator) {
888
+ const observable = new Observable();
889
+ observable.source = this;
890
+ observable.operator = operator;
891
+ return observable;
892
+ }
893
+ subscribe(observerOrNext, error, complete) {
894
+ const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
895
+ errorContext(() => {
896
+ const { operator, source } = this;
897
+ subscriber.add(operator
898
+ ?
899
+ operator.call(subscriber, source)
900
+ : source
901
+ ?
902
+ this._subscribe(subscriber)
903
+ :
904
+ this._trySubscribe(subscriber));
905
+ });
906
+ return subscriber;
907
+ }
908
+ _trySubscribe(sink) {
909
+ try {
910
+ return this._subscribe(sink);
911
+ }
912
+ catch (err) {
913
+ sink.error(err);
914
+ }
915
+ }
916
+ forEach(next, promiseCtor) {
917
+ promiseCtor = getPromiseCtor(promiseCtor);
918
+ return new promiseCtor((resolve, reject) => {
919
+ const subscriber = new SafeSubscriber({
920
+ next: (value) => {
921
+ try {
922
+ next(value);
923
+ }
924
+ catch (err) {
925
+ reject(err);
926
+ subscriber.unsubscribe();
927
+ }
928
+ },
929
+ error: reject,
930
+ complete: resolve,
931
+ });
932
+ this.subscribe(subscriber);
933
+ });
934
+ }
935
+ _subscribe(subscriber) {
936
+ var _a;
937
+ return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
938
+ }
939
+ [observable]() {
940
+ return this;
941
+ }
942
+ pipe(...operations) {
943
+ return pipeFromArray(operations)(this);
944
+ }
945
+ toPromise(promiseCtor) {
946
+ promiseCtor = getPromiseCtor(promiseCtor);
947
+ return new promiseCtor((resolve, reject) => {
948
+ let value;
949
+ this.subscribe((x) => (value = x), (err) => reject(err), () => resolve(value));
950
+ });
951
+ }
952
+ }
953
+ Observable.create = (subscribe) => {
954
+ return new Observable(subscribe);
955
+ };
956
+ function getPromiseCtor(promiseCtor) {
957
+ var _a;
958
+ return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
959
+ }
960
+ function isObserver(value) {
961
+ return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
962
+ }
963
+ function isSubscriber(value) {
964
+ return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
965
+ }
966
+
967
+ function hasLift(source) {
968
+ return isFunction(source === null || source === void 0 ? void 0 : source.lift);
969
+ }
970
+ function operate(init) {
971
+ return (source) => {
972
+ if (hasLift(source)) {
973
+ return source.lift(function (liftedSource) {
974
+ try {
975
+ return init(liftedSource, this);
976
+ }
977
+ catch (err) {
978
+ this.error(err);
979
+ }
980
+ });
981
+ }
982
+ throw new TypeError('Unable to lift unknown Observable type');
983
+ };
984
+ }
985
+
986
+ function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
987
+ return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
988
+ }
989
+ class OperatorSubscriber extends Subscriber {
990
+ constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {
991
+ super(destination);
992
+ this.onFinalize = onFinalize;
993
+ this.shouldUnsubscribe = shouldUnsubscribe;
994
+ this._next = onNext
995
+ ? function (value) {
996
+ try {
997
+ onNext(value);
998
+ }
999
+ catch (err) {
1000
+ destination.error(err);
1001
+ }
1002
+ }
1003
+ : super._next;
1004
+ this._error = onError
1005
+ ? function (err) {
1006
+ try {
1007
+ onError(err);
1008
+ }
1009
+ catch (err) {
1010
+ destination.error(err);
1011
+ }
1012
+ finally {
1013
+ this.unsubscribe();
1014
+ }
1015
+ }
1016
+ : super._error;
1017
+ this._complete = onComplete
1018
+ ? function () {
1019
+ try {
1020
+ onComplete();
1021
+ }
1022
+ catch (err) {
1023
+ destination.error(err);
1024
+ }
1025
+ finally {
1026
+ this.unsubscribe();
1027
+ }
1028
+ }
1029
+ : super._complete;
1030
+ }
1031
+ unsubscribe() {
1032
+ var _a;
1033
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
1034
+ const { closed } = this;
1035
+ super.unsubscribe();
1036
+ !closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));
1037
+ }
1038
+ }
1039
+ }
1040
+
1041
+ function isScheduler(value) {
1042
+ return value && isFunction(value.schedule);
1043
+ }
1044
+
1045
+ function last(arr) {
1046
+ return arr[arr.length - 1];
1047
+ }
1048
+ function popScheduler(args) {
1049
+ return isScheduler(last(args)) ? args.pop() : undefined;
1050
+ }
1051
+ function popNumber(args, defaultValue) {
1052
+ return typeof last(args) === 'number' ? args.pop() : defaultValue;
1053
+ }
1054
+
1055
+ /******************************************************************************
1056
+ Copyright (c) Microsoft Corporation.
1057
+
1058
+ Permission to use, copy, modify, and/or distribute this software for any
1059
+ purpose with or without fee is hereby granted.
1060
+
1061
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1062
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1063
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1064
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1065
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1066
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1067
+ PERFORMANCE OF THIS SOFTWARE.
1068
+ ***************************************************************************** */
1069
+
1070
+ function __awaiter(thisArg, _arguments, P, generator) {
1071
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1072
+ return new (P || (P = Promise))(function (resolve, reject) {
1073
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1074
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1075
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1076
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1077
+ });
1078
+ }
1079
+
1080
+ function __values(o) {
1081
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1082
+ if (m) return m.call(o);
1083
+ if (o && typeof o.length === "number") return {
1084
+ next: function () {
1085
+ if (o && i >= o.length) o = void 0;
1086
+ return { value: o && o[i++], done: !o };
1087
+ }
1088
+ };
1089
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1090
+ }
1091
+
1092
+ function __await(v) {
1093
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
1094
+ }
1095
+
1096
+ function __asyncGenerator(thisArg, _arguments, generator) {
1097
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1098
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
1099
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1100
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1101
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
1102
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1103
+ function fulfill(value) { resume("next", value); }
1104
+ function reject(value) { resume("throw", value); }
1105
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
1106
+ }
1107
+
1108
+ function __asyncValues(o) {
1109
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1110
+ var m = o[Symbol.asyncIterator], i;
1111
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1112
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1113
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
1114
+ }
1115
+
1116
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
1117
+ var e = new Error(message);
1118
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1119
+ };
1120
+
1121
+ const isArrayLike = ((x) => x && typeof x.length === 'number' && typeof x !== 'function');
1122
+
1123
+ function isPromise(value) {
1124
+ return isFunction(value === null || value === void 0 ? void 0 : value.then);
1125
+ }
1126
+
1127
+ function isInteropObservable(input) {
1128
+ return isFunction(input[observable]);
1129
+ }
1130
+
1131
+ function isAsyncIterable(obj) {
1132
+ return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
1133
+ }
1134
+
1135
+ function createInvalidObservableTypeError(input) {
1136
+ return new TypeError(`You provided ${input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`);
1137
+ }
1138
+
1139
+ function getSymbolIterator() {
1140
+ if (typeof Symbol !== 'function' || !Symbol.iterator) {
1141
+ return '@@iterator';
1142
+ }
1143
+ return Symbol.iterator;
1144
+ }
1145
+ const iterator = getSymbolIterator();
1146
+
1147
+ function isIterable(input) {
1148
+ return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
1149
+ }
1150
+
1151
+ function readableStreamLikeToAsyncGenerator(readableStream) {
1152
+ return __asyncGenerator(this, arguments, function* readableStreamLikeToAsyncGenerator_1() {
1153
+ const reader = readableStream.getReader();
1154
+ try {
1155
+ while (true) {
1156
+ const { value, done } = yield __await(reader.read());
1157
+ if (done) {
1158
+ return yield __await(void 0);
1159
+ }
1160
+ yield yield __await(value);
1161
+ }
1162
+ }
1163
+ finally {
1164
+ reader.releaseLock();
1165
+ }
1166
+ });
1167
+ }
1168
+ function isReadableStreamLike(obj) {
1169
+ return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
1170
+ }
1171
+
1172
+ function innerFrom(input) {
1173
+ if (input instanceof Observable) {
1174
+ return input;
1175
+ }
1176
+ if (input != null) {
1177
+ if (isInteropObservable(input)) {
1178
+ return fromInteropObservable(input);
1179
+ }
1180
+ if (isArrayLike(input)) {
1181
+ return fromArrayLike(input);
1182
+ }
1183
+ if (isPromise(input)) {
1184
+ return fromPromise(input);
1185
+ }
1186
+ if (isAsyncIterable(input)) {
1187
+ return fromAsyncIterable(input);
1188
+ }
1189
+ if (isIterable(input)) {
1190
+ return fromIterable(input);
1191
+ }
1192
+ if (isReadableStreamLike(input)) {
1193
+ return fromReadableStreamLike(input);
1194
+ }
1195
+ }
1196
+ throw createInvalidObservableTypeError(input);
1197
+ }
1198
+ function fromInteropObservable(obj) {
1199
+ return new Observable((subscriber) => {
1200
+ const obs = obj[observable]();
1201
+ if (isFunction(obs.subscribe)) {
1202
+ return obs.subscribe(subscriber);
1203
+ }
1204
+ throw new TypeError('Provided object does not correctly implement Symbol.observable');
1205
+ });
1206
+ }
1207
+ function fromArrayLike(array) {
1208
+ return new Observable((subscriber) => {
1209
+ for (let i = 0; i < array.length && !subscriber.closed; i++) {
1210
+ subscriber.next(array[i]);
1211
+ }
1212
+ subscriber.complete();
1213
+ });
1214
+ }
1215
+ function fromPromise(promise) {
1216
+ return new Observable((subscriber) => {
1217
+ promise
1218
+ .then((value) => {
1219
+ if (!subscriber.closed) {
1220
+ subscriber.next(value);
1221
+ subscriber.complete();
1222
+ }
1223
+ }, (err) => subscriber.error(err))
1224
+ .then(null, reportUnhandledError);
1225
+ });
1226
+ }
1227
+ function fromIterable(iterable) {
1228
+ return new Observable((subscriber) => {
1229
+ for (const value of iterable) {
1230
+ subscriber.next(value);
1231
+ if (subscriber.closed) {
1232
+ return;
1233
+ }
1234
+ }
1235
+ subscriber.complete();
1236
+ });
1237
+ }
1238
+ function fromAsyncIterable(asyncIterable) {
1239
+ return new Observable((subscriber) => {
1240
+ process(asyncIterable, subscriber).catch((err) => subscriber.error(err));
1241
+ });
1242
+ }
1243
+ function fromReadableStreamLike(readableStream) {
1244
+ return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));
1245
+ }
1246
+ function process(asyncIterable, subscriber) {
1247
+ var asyncIterable_1, asyncIterable_1_1;
1248
+ var e_1, _a;
1249
+ return __awaiter(this, void 0, void 0, function* () {
1250
+ try {
1251
+ for (asyncIterable_1 = __asyncValues(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done;) {
1252
+ const value = asyncIterable_1_1.value;
1253
+ subscriber.next(value);
1254
+ if (subscriber.closed) {
1255
+ return;
1256
+ }
1257
+ }
1258
+ }
1259
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1260
+ finally {
1261
+ try {
1262
+ if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)) yield _a.call(asyncIterable_1);
1263
+ }
1264
+ finally { if (e_1) throw e_1.error; }
1265
+ }
1266
+ subscriber.complete();
1267
+ });
1268
+ }
1269
+
1270
+ function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat = false) {
1271
+ const scheduleSubscription = scheduler.schedule(function () {
1272
+ work();
1273
+ if (repeat) {
1274
+ parentSubscription.add(this.schedule(null, delay));
1275
+ }
1276
+ else {
1277
+ this.unsubscribe();
1278
+ }
1279
+ }, delay);
1280
+ parentSubscription.add(scheduleSubscription);
1281
+ if (!repeat) {
1282
+ return scheduleSubscription;
1283
+ }
1284
+ }
1285
+
1286
+ function observeOn(scheduler, delay = 0) {
1287
+ return operate((source, subscriber) => {
1288
+ source.subscribe(createOperatorSubscriber(subscriber, (value) => executeSchedule(subscriber, scheduler, () => subscriber.next(value), delay), () => executeSchedule(subscriber, scheduler, () => subscriber.complete(), delay), (err) => executeSchedule(subscriber, scheduler, () => subscriber.error(err), delay)));
1289
+ });
1290
+ }
1291
+
1292
+ function subscribeOn(scheduler, delay = 0) {
1293
+ return operate((source, subscriber) => {
1294
+ subscriber.add(scheduler.schedule(() => source.subscribe(subscriber), delay));
1295
+ });
1296
+ }
1297
+
1298
+ function scheduleObservable(input, scheduler) {
1299
+ return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
1300
+ }
1301
+
1302
+ function schedulePromise(input, scheduler) {
1303
+ return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));
1304
+ }
1305
+
1306
+ function scheduleArray(input, scheduler) {
1307
+ return new Observable((subscriber) => {
1308
+ let i = 0;
1309
+ return scheduler.schedule(function () {
1310
+ if (i === input.length) {
1311
+ subscriber.complete();
1312
+ }
1313
+ else {
1314
+ subscriber.next(input[i++]);
1315
+ if (!subscriber.closed) {
1316
+ this.schedule();
1317
+ }
1318
+ }
1319
+ });
1320
+ });
1321
+ }
1322
+
1323
+ function scheduleIterable(input, scheduler) {
1324
+ return new Observable((subscriber) => {
1325
+ let iterator$1;
1326
+ executeSchedule(subscriber, scheduler, () => {
1327
+ iterator$1 = input[iterator]();
1328
+ executeSchedule(subscriber, scheduler, () => {
1329
+ let value;
1330
+ let done;
1331
+ try {
1332
+ ({ value, done } = iterator$1.next());
1333
+ }
1334
+ catch (err) {
1335
+ subscriber.error(err);
1336
+ return;
1337
+ }
1338
+ if (done) {
1339
+ subscriber.complete();
1340
+ }
1341
+ else {
1342
+ subscriber.next(value);
1343
+ }
1344
+ }, 0, true);
1345
+ });
1346
+ return () => isFunction(iterator$1 === null || iterator$1 === void 0 ? void 0 : iterator$1.return) && iterator$1.return();
1347
+ });
1348
+ }
1349
+
1350
+ function scheduleAsyncIterable(input, scheduler) {
1351
+ if (!input) {
1352
+ throw new Error('Iterable cannot be null');
1353
+ }
1354
+ return new Observable((subscriber) => {
1355
+ executeSchedule(subscriber, scheduler, () => {
1356
+ const iterator = input[Symbol.asyncIterator]();
1357
+ executeSchedule(subscriber, scheduler, () => {
1358
+ iterator.next().then((result) => {
1359
+ if (result.done) {
1360
+ subscriber.complete();
1361
+ }
1362
+ else {
1363
+ subscriber.next(result.value);
1364
+ }
1365
+ });
1366
+ }, 0, true);
1367
+ });
1368
+ });
1369
+ }
1370
+
1371
+ function scheduleReadableStreamLike(input, scheduler) {
1372
+ return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);
1373
+ }
1374
+
1375
+ function scheduled(input, scheduler) {
1376
+ if (input != null) {
1377
+ if (isInteropObservable(input)) {
1378
+ return scheduleObservable(input, scheduler);
1379
+ }
1380
+ if (isArrayLike(input)) {
1381
+ return scheduleArray(input, scheduler);
1382
+ }
1383
+ if (isPromise(input)) {
1384
+ return schedulePromise(input, scheduler);
1385
+ }
1386
+ if (isAsyncIterable(input)) {
1387
+ return scheduleAsyncIterable(input, scheduler);
1388
+ }
1389
+ if (isIterable(input)) {
1390
+ return scheduleIterable(input, scheduler);
1391
+ }
1392
+ if (isReadableStreamLike(input)) {
1393
+ return scheduleReadableStreamLike(input, scheduler);
1394
+ }
1395
+ }
1396
+ throw createInvalidObservableTypeError(input);
1397
+ }
1398
+
1399
+ function from(input, scheduler) {
1400
+ return scheduler ? scheduled(input, scheduler) : innerFrom(input);
1401
+ }
1402
+
1403
+ function of(...args) {
1404
+ const scheduler = popScheduler(args);
1405
+ return from(args, scheduler);
1406
+ }
1407
+
1408
+ exports.CatI18nRegistry = CatI18nRegistry;
1409
+ exports.CatIconRegistry = CatIconRegistry;
1410
+ exports.EMPTY_SUBSCRIPTION = EMPTY_SUBSCRIPTION;
1411
+ exports.Observable = Observable;
1412
+ exports.Subscription = Subscription;
1413
+ exports.arrRemove = arrRemove;
1414
+ exports.catI18nRegistry = catI18nRegistry;
1415
+ exports.catIconRegistry = catIconRegistry;
1416
+ exports.commonjsGlobal = commonjsGlobal;
1417
+ exports.createCommonjsModule = createCommonjsModule;
1418
+ exports.createErrorClass = createErrorClass;
1419
+ exports.createOperatorSubscriber = createOperatorSubscriber;
1420
+ exports.errorContext = errorContext;
1421
+ exports.executeSchedule = executeSchedule;
1422
+ exports.from = from;
1423
+ exports.identity = identity;
1424
+ exports.innerFrom = innerFrom;
1425
+ exports.isArrayLike = isArrayLike;
1426
+ exports.isFunction = isFunction;
1427
+ exports.isScheduler = isScheduler;
1428
+ exports.loglevel = loglevel;
1429
+ exports.noop = noop;
1430
+ exports.of = of;
1431
+ exports.operate = operate;
1432
+ exports.popNumber = popNumber;
1433
+ exports.popScheduler = popScheduler;
1434
+
1435
+ //# sourceMappingURL=of-d9fa1990.js.map