@sixbell-telco/sdk 1.4.0 → 1.6.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.
- package/CHANGELOG.md +76 -0
- package/README.md +410 -472
- package/_index.css +26 -0
- package/components/dropdown/dropdown-chevron/dropdown-chevron.component.d.ts +6 -1
- package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +1 -1
- package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +6 -1
- package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +7 -1
- package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +7 -1
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +30 -0
- package/components/dropdown/public-api.d.ts +0 -1
- package/components/dropdown/src/dropdown.component.d.ts +31 -7
- package/components/forms/combobox/src/combobox.component.d.ts +24 -0
- package/components/forms/select/src/select.component.d.ts +24 -0
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +472 -341
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +58 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +52 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-logger.mjs +578 -0
- package/fesm2022/sixbell-telco-sdk-utils-logger.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-resource-loader.mjs +1222 -0
- package/fesm2022/sixbell-telco-sdk-utils-resource-loader.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +1434 -180
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +734 -182
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/package.json +54 -46
- package/utils/logger/README.md +539 -0
- package/utils/logger/index.d.ts +5 -0
- package/utils/logger/public-api.d.ts +3 -0
- package/utils/logger/src/constants.d.ts +15 -0
- package/utils/logger/src/logger.service.d.ts +123 -0
- package/utils/logger/src/models/logger.d.ts +25 -0
- package/utils/logger/src/providers/logger.provider.d.ts +3 -0
- package/utils/resource-loader/README.md +460 -0
- package/utils/resource-loader/index.d.ts +5 -0
- package/utils/resource-loader/public-api.d.ts +1 -0
- package/utils/resource-loader/src/cache/index.d.ts +2 -0
- package/utils/resource-loader/src/cache/layers/factory.d.ts +38 -0
- package/utils/resource-loader/src/cache/layers/index.d.ts +3 -0
- package/utils/resource-loader/src/cache/layers/indexed-db-cache.d.ts +118 -0
- package/utils/resource-loader/src/cache/layers/local-storage-cache.d.ts +86 -0
- package/utils/resource-loader/src/cache/layers/memory-cache.d.ts +76 -0
- package/utils/resource-loader/src/cache/types.d.ts +107 -0
- package/utils/resource-loader/src/config/index.d.ts +1 -0
- package/utils/resource-loader/src/config/load-config.d.ts +32 -0
- package/utils/resource-loader/src/constants.d.ts +38 -0
- package/utils/resource-loader/src/http/index.d.ts +1 -0
- package/utils/resource-loader/src/http/retryable-client.d.ts +43 -0
- package/utils/resource-loader/src/index.d.ts +1 -0
- package/utils/resource-loader/src/resource-loader.d.ts +67 -0
- package/utils/resource-loader/src/types.d.ts +152 -0
- package/utils/resource-loader/src/utils/cache-validator.d.ts +72 -0
- package/utils/resource-loader/src/utils/helpers.d.ts +15 -0
- package/utils/resource-loader/src/utils/index.d.ts +2 -0
- package/utils/theme/README.md +1054 -109
- package/utils/theme/public-api.d.ts +9 -1
- package/utils/theme/src/constants.d.ts +74 -0
- package/utils/theme/src/models/theme.d.ts +288 -0
- package/utils/theme/src/providers/constants.d.ts +7 -0
- package/utils/theme/src/providers/theme.provider.d.ts +13 -0
- package/utils/theme/src/providers/theme.provider.types.d.ts +29 -0
- package/utils/theme/src/theme-assets/theme-assets.service.d.ts +214 -0
- package/utils/theme/src/theme-assets/theme-assets.types.d.ts +10 -0
- package/utils/theme/src/theme-dom/theme-dom.service.d.ts +87 -0
- package/utils/theme/src/theme-scheme/theme-scheme.service.d.ts +44 -0
- package/utils/theme/src/theme-storage/theme-storage.service.d.ts +47 -0
- package/utils/theme/src/theme.service.d.ts +40 -186
- package/utils/theme/src/utils/utils.d.ts +86 -0
- package/utils/translation/README.md +1414 -176
- package/utils/translation/public-api.d.ts +6 -0
- package/utils/translation/src/constants.d.ts +52 -0
- package/utils/translation/src/models/translation.d.ts +59 -0
- package/utils/translation/src/providers/constants.d.ts +11 -0
- package/utils/translation/src/providers/translation.provider.d.ts +73 -0
- package/utils/translation/src/providers/translation.provider.types.d.ts +26 -0
- package/utils/translation/src/translation-dom/translation-dom.service.d.ts +26 -0
- package/utils/translation/src/translation-storage/translation-storage.service.d.ts +34 -0
- package/utils/translation/src/translation.service.d.ts +19 -166
- package/components/dropdown/src/services/dropdown.service.d.ts +0 -22
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Logger Constants
|
|
6
|
+
* Color schemes, log levels, and configuration defaults
|
|
7
|
+
*/
|
|
8
|
+
const LOG_LEVELS = {
|
|
9
|
+
trace: 0,
|
|
10
|
+
debug: 1,
|
|
11
|
+
info: 2,
|
|
12
|
+
warn: 3,
|
|
13
|
+
error: 4,
|
|
14
|
+
fatal: 5,
|
|
15
|
+
};
|
|
16
|
+
// Light mode colors
|
|
17
|
+
const LOG_COLORS_LIGHT = {
|
|
18
|
+
trace: 'color: #666666; font-weight: bold;', // Dark Gray
|
|
19
|
+
debug: 'color: #0052a3; font-weight: bold;', // Dark Blue
|
|
20
|
+
info: 'color: #006600; font-weight: bold;', // Dark Green
|
|
21
|
+
warn: 'color: #cc7700; font-weight: bold;', // Dark Orange
|
|
22
|
+
error: 'color: #cc0000; font-weight: bold;', // Dark Red
|
|
23
|
+
fatal: 'color: #ffffff; background-color: #cc0000; font-weight: bold; padding: 2px 4px;', // White on Red
|
|
24
|
+
};
|
|
25
|
+
// Dark mode colors
|
|
26
|
+
const LOG_COLORS_DARK = {
|
|
27
|
+
trace: 'color: #aaaaaa; font-weight: bold;', // Light Gray
|
|
28
|
+
debug: 'color: #66b3ff; font-weight: bold;', // Light Blue
|
|
29
|
+
info: 'color: #66ff66; font-weight: bold;', // Light Green
|
|
30
|
+
warn: 'color: #ffcc66; font-weight: bold;', // Light Orange
|
|
31
|
+
error: 'color: #ff6666; font-weight: bold;', // Light Red
|
|
32
|
+
fatal: 'color: #ffffff; background-color: #ff4444; font-weight: bold; padding: 2px 4px;', // White on Light Red
|
|
33
|
+
};
|
|
34
|
+
// Component/context color - Light mode (dark purple) / Dark mode (light purple)
|
|
35
|
+
const CONTEXT_COLOR_LIGHT = 'color: #5500aa; font-weight: bold;'; // Dark Purple
|
|
36
|
+
const CONTEXT_COLOR_DARK = 'color: #dd99ff; font-weight: bold;'; // Light Purple
|
|
37
|
+
// Timestamp color - Light mode (dark teal) / Dark mode (light teal)
|
|
38
|
+
const TIMESTAMP_COLOR_LIGHT = 'color: #006666; font-weight: bold;'; // Dark Teal
|
|
39
|
+
const TIMESTAMP_COLOR_DARK = 'color: #66ffff; font-weight: bold;'; // Light Teal
|
|
40
|
+
// IndexedDB defaults
|
|
41
|
+
const IDB_STORE_NAME = 'sixbell-logs';
|
|
42
|
+
const IDB_DB_NAME = 'sixbell-ui-kit';
|
|
43
|
+
const MAX_STORED_LOGS = 1000; // Prevent memory bloat
|
|
44
|
+
|
|
45
|
+
class LoggerService {
|
|
46
|
+
config = {
|
|
47
|
+
enableLogging: false,
|
|
48
|
+
logLevel: 'error',
|
|
49
|
+
showTimestamp: false,
|
|
50
|
+
showDate: false,
|
|
51
|
+
silentMode: false,
|
|
52
|
+
persistToIndexedDB: false,
|
|
53
|
+
idbRetentionDays: 7, // Default: keep logs for 7 days
|
|
54
|
+
idbMaxLogs: 5000, // Default: store max 5000 logs in IndexedDB
|
|
55
|
+
isDarkMode: false,
|
|
56
|
+
};
|
|
57
|
+
logStore = [];
|
|
58
|
+
darkModeMediaQuery = null;
|
|
59
|
+
darkModeListenerInitialized = false;
|
|
60
|
+
idbReady = Promise.resolve(null);
|
|
61
|
+
/**
|
|
62
|
+
* Initialize automatic dark mode detection based on system preferences
|
|
63
|
+
* Only called when logging is enabled to minimize performance impact
|
|
64
|
+
*/
|
|
65
|
+
initializeDarkModeDetection() {
|
|
66
|
+
// Skip if already initialized or not needed
|
|
67
|
+
if (this.darkModeListenerInitialized || this.config.silentMode) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (typeof window !== 'undefined' && window.matchMedia) {
|
|
71
|
+
this.darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
72
|
+
// Set initial value based on system preference
|
|
73
|
+
this.config.isDarkMode = this.darkModeMediaQuery.matches;
|
|
74
|
+
// Listen for changes in system preference with both addEventListener and addListener for better browser support
|
|
75
|
+
const handleChange = (e) => {
|
|
76
|
+
const isDark = 'matches' in e ? e.matches : false;
|
|
77
|
+
this.config.isDarkMode = isDark;
|
|
78
|
+
// Log the theme change for debugging
|
|
79
|
+
if (this.config.enableLogging) {
|
|
80
|
+
console.log(`%c[THEME CHANGED] Theme switched to ${isDark ? 'dark' : 'light'} mode`, isDark ? LOG_COLORS_DARK.info : LOG_COLORS_LIGHT.info);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
this.darkModeMediaQuery.addEventListener('change', handleChange);
|
|
84
|
+
// Fallback for older browsers
|
|
85
|
+
if (this.darkModeMediaQuery.addListener) {
|
|
86
|
+
this.darkModeMediaQuery.addListener(handleChange);
|
|
87
|
+
}
|
|
88
|
+
this.darkModeListenerInitialized = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
configure(config) {
|
|
92
|
+
this.config = { ...this.config, ...config };
|
|
93
|
+
// Only initialize dark mode detection when logging is enabled and not in silent mode
|
|
94
|
+
if (this.config.enableLogging && !this.config.silentMode) {
|
|
95
|
+
this.initializeDarkModeDetection();
|
|
96
|
+
}
|
|
97
|
+
// Initialize IndexedDB if persistence is enabled
|
|
98
|
+
if (this.config.persistToIndexedDB) {
|
|
99
|
+
this.idbReady = this.initializeIndexedDB();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get all stored logs (useful for sending to external services)
|
|
104
|
+
*/
|
|
105
|
+
getStoredLogs() {
|
|
106
|
+
return [...this.logStore];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Clear stored logs
|
|
110
|
+
*/
|
|
111
|
+
clearStoredLogs() {
|
|
112
|
+
this.logStore = [];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Initialize IndexedDB for persistent log storage
|
|
116
|
+
* Only called when persistToIndexedDB is enabled
|
|
117
|
+
*/
|
|
118
|
+
initializeIndexedDB() {
|
|
119
|
+
if (!this.config.persistToIndexedDB || typeof indexedDB === 'undefined') {
|
|
120
|
+
return Promise.resolve(null);
|
|
121
|
+
}
|
|
122
|
+
return new Promise((resolve) => {
|
|
123
|
+
const request = indexedDB.open(IDB_DB_NAME, 1);
|
|
124
|
+
request.onerror = () => {
|
|
125
|
+
console.error('IndexedDB open error:', request.error);
|
|
126
|
+
resolve(null);
|
|
127
|
+
};
|
|
128
|
+
request.onsuccess = () => {
|
|
129
|
+
resolve(request.result);
|
|
130
|
+
};
|
|
131
|
+
request.onupgradeneeded = (event) => {
|
|
132
|
+
const db = event.target.result;
|
|
133
|
+
if (!db.objectStoreNames.contains(IDB_STORE_NAME)) {
|
|
134
|
+
const store = db.createObjectStore(IDB_STORE_NAME, { keyPath: 'id', autoIncrement: true });
|
|
135
|
+
store.createIndex('timestamp', 'timestamp', { unique: false });
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Persist a log entry to IndexedDB
|
|
142
|
+
*/
|
|
143
|
+
persistLogToIndexedDB(logEntry) {
|
|
144
|
+
if (!this.config.persistToIndexedDB)
|
|
145
|
+
return;
|
|
146
|
+
this.idbReady.then((db) => {
|
|
147
|
+
if (!db)
|
|
148
|
+
return;
|
|
149
|
+
try {
|
|
150
|
+
const transaction = db.transaction([IDB_STORE_NAME], 'readwrite');
|
|
151
|
+
const store = transaction.objectStore(IDB_STORE_NAME);
|
|
152
|
+
// Don't persist Error objects directly (they don't serialize well)
|
|
153
|
+
const sanitizedEntry = {
|
|
154
|
+
...logEntry,
|
|
155
|
+
error: logEntry.error
|
|
156
|
+
? {
|
|
157
|
+
name: logEntry.error.name,
|
|
158
|
+
message: logEntry.error.message,
|
|
159
|
+
stack: logEntry.error.stack,
|
|
160
|
+
}
|
|
161
|
+
: undefined,
|
|
162
|
+
};
|
|
163
|
+
store.add(sanitizedEntry);
|
|
164
|
+
// Clean up old logs based on retention policy
|
|
165
|
+
this.cleanupOldLogs(db);
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
console.error('Error persisting log to IndexedDB:', error);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Clean up old logs based on retention policy (days and max count)
|
|
174
|
+
*/
|
|
175
|
+
cleanupOldLogs(db) {
|
|
176
|
+
try {
|
|
177
|
+
const transaction = db.transaction([IDB_STORE_NAME], 'readwrite');
|
|
178
|
+
const store = transaction.objectStore(IDB_STORE_NAME);
|
|
179
|
+
const index = store.index('timestamp');
|
|
180
|
+
// Calculate cutoff time (now - retention days)
|
|
181
|
+
const retentionMs = (this.config.idbRetentionDays || 7) * 24 * 60 * 60 * 1000;
|
|
182
|
+
const cutoffTime = Date.now() - retentionMs;
|
|
183
|
+
// Delete logs older than retention period
|
|
184
|
+
const range = IDBKeyRange.upperBound(cutoffTime, true);
|
|
185
|
+
const cursorRequest = index.openCursor(range);
|
|
186
|
+
cursorRequest.onsuccess = (event) => {
|
|
187
|
+
const target = event.target;
|
|
188
|
+
const cursor = target.result;
|
|
189
|
+
if (cursor) {
|
|
190
|
+
cursor.delete();
|
|
191
|
+
cursor.continue();
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
// Also check max log count and delete oldest if exceeded
|
|
195
|
+
const getAllRequest = store.getAll();
|
|
196
|
+
getAllRequest.onsuccess = () => {
|
|
197
|
+
const allLogs = getAllRequest.result;
|
|
198
|
+
const maxLogs = this.config.idbMaxLogs || 5000;
|
|
199
|
+
if (allLogs.length > maxLogs) {
|
|
200
|
+
// Sort by timestamp and delete oldest ones
|
|
201
|
+
allLogs.sort((a, b) => a.timestamp - b.timestamp);
|
|
202
|
+
const logsToDelete = allLogs.slice(0, allLogs.length - maxLogs);
|
|
203
|
+
logsToDelete.forEach((log) => {
|
|
204
|
+
store.delete(log.id);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
console.error('Error cleaning up old logs:', error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Retrieve logs from IndexedDB
|
|
215
|
+
*/
|
|
216
|
+
async getPersistedLogs() {
|
|
217
|
+
const db = await this.idbReady;
|
|
218
|
+
if (!db)
|
|
219
|
+
return [];
|
|
220
|
+
return new Promise((resolve) => {
|
|
221
|
+
try {
|
|
222
|
+
const transaction = db.transaction([IDB_STORE_NAME], 'readonly');
|
|
223
|
+
const store = transaction.objectStore(IDB_STORE_NAME);
|
|
224
|
+
const request = store.getAll();
|
|
225
|
+
request.onsuccess = () => {
|
|
226
|
+
resolve(request.result);
|
|
227
|
+
};
|
|
228
|
+
request.onerror = () => {
|
|
229
|
+
console.error('Error retrieving logs from IndexedDB:', request.error);
|
|
230
|
+
resolve([]);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
console.error('Error reading IndexedDB:', error);
|
|
235
|
+
resolve([]);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Clear persisted logs from IndexedDB
|
|
241
|
+
*/
|
|
242
|
+
async clearPersistedLogs() {
|
|
243
|
+
const db = await this.idbReady;
|
|
244
|
+
if (!db)
|
|
245
|
+
return;
|
|
246
|
+
return new Promise((resolve, reject) => {
|
|
247
|
+
try {
|
|
248
|
+
const transaction = db.transaction([IDB_STORE_NAME], 'readwrite');
|
|
249
|
+
const store = transaction.objectStore(IDB_STORE_NAME);
|
|
250
|
+
const request = store.clear();
|
|
251
|
+
request.onsuccess = () => resolve();
|
|
252
|
+
request.onerror = () => reject(request.error);
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
reject(error);
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Download logs as a JSON file
|
|
261
|
+
* Combines in-memory logs with persisted IndexedDB logs
|
|
262
|
+
*/
|
|
263
|
+
async downloadLogs(filename = `logs-${Date.now()}.json`) {
|
|
264
|
+
try {
|
|
265
|
+
// Get all logs (memory + IndexedDB)
|
|
266
|
+
const memoryLogs = this.getStoredLogs();
|
|
267
|
+
const persistedLogs = await this.getPersistedLogs();
|
|
268
|
+
const allLogs = [...memoryLogs, ...persistedLogs];
|
|
269
|
+
// Create JSON blob
|
|
270
|
+
const jsonStr = JSON.stringify(allLogs, null, 2);
|
|
271
|
+
const blob = new Blob([jsonStr], { type: 'application/json' });
|
|
272
|
+
// Create download link and trigger
|
|
273
|
+
const url = URL.createObjectURL(blob);
|
|
274
|
+
const link = document.createElement('a');
|
|
275
|
+
link.href = url;
|
|
276
|
+
link.download = filename;
|
|
277
|
+
document.body.appendChild(link);
|
|
278
|
+
link.click();
|
|
279
|
+
document.body.removeChild(link);
|
|
280
|
+
URL.revokeObjectURL(url);
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
console.error('Error downloading logs:', error);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Update theme mode for color adjustment
|
|
288
|
+
* If you want to restore automatic detection, pass undefined
|
|
289
|
+
*
|
|
290
|
+
* @param isDark true for dark mode, false for light mode, undefined to use system preference
|
|
291
|
+
*/
|
|
292
|
+
setDarkMode(isDark) {
|
|
293
|
+
if (isDark === undefined) {
|
|
294
|
+
// Restore automatic detection - initialize listener if needed
|
|
295
|
+
if (this.config.enableLogging && !this.config.silentMode) {
|
|
296
|
+
this.initializeDarkModeDetection();
|
|
297
|
+
}
|
|
298
|
+
if (this.darkModeMediaQuery) {
|
|
299
|
+
this.config.isDarkMode = this.darkModeMediaQuery.matches;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
this.config.isDarkMode = isDark;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Get current dark mode status
|
|
308
|
+
*/
|
|
309
|
+
isDarkMode() {
|
|
310
|
+
return this.config.isDarkMode || false;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Create a temporary logger with override configuration.
|
|
314
|
+
* Useful for local use-case-specific logging without global provider changes.
|
|
315
|
+
*
|
|
316
|
+
* @param overrideConfig Configuration that overrides current logger settings
|
|
317
|
+
* @returns A new LoggerService instance with merged config
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```typescript
|
|
321
|
+
* // In theme service:
|
|
322
|
+
* private readonly logger = inject(LoggerService);
|
|
323
|
+
*
|
|
324
|
+
* // For this specific operation, use debug level:
|
|
325
|
+
* const debugLogger = this.logger.withConfig({ logLevel: 'debug' });
|
|
326
|
+
* debugLogger.debug('Detailed operation trace');
|
|
327
|
+
*
|
|
328
|
+
* // Back to global config:
|
|
329
|
+
* this.logger.debug('This respects global config');
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
withConfig(overrideConfig) {
|
|
333
|
+
const logger = new LoggerService();
|
|
334
|
+
logger.configure({ ...this.config, ...overrideConfig });
|
|
335
|
+
return logger;
|
|
336
|
+
}
|
|
337
|
+
shouldLog(level) {
|
|
338
|
+
if (!this.config.enableLogging)
|
|
339
|
+
return false;
|
|
340
|
+
const currentLevel = LOG_LEVELS[this.config.logLevel || 'error'];
|
|
341
|
+
const messageLevel = LOG_LEVELS[level];
|
|
342
|
+
return messageLevel >= currentLevel;
|
|
343
|
+
}
|
|
344
|
+
getColors() {
|
|
345
|
+
return this.config.isDarkMode ? LOG_COLORS_DARK : LOG_COLORS_LIGHT;
|
|
346
|
+
}
|
|
347
|
+
getContextColor() {
|
|
348
|
+
return this.config.isDarkMode ? CONTEXT_COLOR_DARK : CONTEXT_COLOR_LIGHT;
|
|
349
|
+
}
|
|
350
|
+
getTimestampColor() {
|
|
351
|
+
return this.config.isDarkMode ? TIMESTAMP_COLOR_DARK : TIMESTAMP_COLOR_LIGHT;
|
|
352
|
+
}
|
|
353
|
+
storeLog(level, message, context, error) {
|
|
354
|
+
this.logStore.push({
|
|
355
|
+
timestamp: Date.now(),
|
|
356
|
+
level,
|
|
357
|
+
message,
|
|
358
|
+
context,
|
|
359
|
+
error,
|
|
360
|
+
});
|
|
361
|
+
// Prevent memory bloat
|
|
362
|
+
if (this.logStore.length > MAX_STORED_LOGS) {
|
|
363
|
+
this.logStore.shift();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Extract component name from message pattern like "[ComponentName] message"
|
|
368
|
+
* and return formatted parts for colored logging
|
|
369
|
+
*/
|
|
370
|
+
formatMessageWithContext(message) {
|
|
371
|
+
const componentMatch = message.match(/^\[([^\]]+)\]\s(.*)$/);
|
|
372
|
+
const contextColor = this.getContextColor();
|
|
373
|
+
if (componentMatch) {
|
|
374
|
+
const componentName = componentMatch[1];
|
|
375
|
+
const restOfMessage = componentMatch[2];
|
|
376
|
+
return {
|
|
377
|
+
formatted: `%c[${componentName}]%c ${restOfMessage}`,
|
|
378
|
+
styles: [contextColor, ''],
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
formatted: `%c${message}`,
|
|
383
|
+
styles: [''],
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Format complete log output with level, timestamp, context, and message
|
|
388
|
+
* Returns array of format string and all styles for console output
|
|
389
|
+
*/
|
|
390
|
+
formatCompleteLogOutput(level, message, context) {
|
|
391
|
+
const colors = this.getColors();
|
|
392
|
+
const levelStyle = colors[level];
|
|
393
|
+
const contextColor = this.getContextColor();
|
|
394
|
+
const timestampColor = this.getTimestampColor();
|
|
395
|
+
let format = `%c[${level.toUpperCase()}]`;
|
|
396
|
+
const styles = [levelStyle];
|
|
397
|
+
// Add timestamp if enabled
|
|
398
|
+
if (this.config.showTimestamp || this.config.showDate) {
|
|
399
|
+
const now = new Date();
|
|
400
|
+
const isoString = now.toISOString();
|
|
401
|
+
let timeStr;
|
|
402
|
+
if (this.config.showDate) {
|
|
403
|
+
const date = isoString.split('T')[0];
|
|
404
|
+
const time = isoString.split('T')[1].slice(0, 12);
|
|
405
|
+
timeStr = `${date} ${time}`;
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
timeStr = isoString.split('T')[1].slice(0, 12);
|
|
409
|
+
}
|
|
410
|
+
format += `%c [${timeStr}]`;
|
|
411
|
+
styles.push(timestampColor);
|
|
412
|
+
}
|
|
413
|
+
// Add context if provided
|
|
414
|
+
if (context?.component) {
|
|
415
|
+
format += `%c [${context.component}]`;
|
|
416
|
+
styles.push(contextColor);
|
|
417
|
+
}
|
|
418
|
+
// Add message
|
|
419
|
+
format += `%c ${message}`;
|
|
420
|
+
styles.push('');
|
|
421
|
+
return { format, styles };
|
|
422
|
+
}
|
|
423
|
+
trace(message, context) {
|
|
424
|
+
if (this.shouldLog('trace')) {
|
|
425
|
+
const logEntry = { level: 'trace', message, context, timestamp: Date.now(), error: undefined };
|
|
426
|
+
this.storeLog('trace', message, context);
|
|
427
|
+
if (!this.config.silentMode) {
|
|
428
|
+
const { format, styles } = this.formatCompleteLogOutput('trace', message, context);
|
|
429
|
+
if (context && Object.keys(context).length > 1) {
|
|
430
|
+
console.debug(format, ...styles, context);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
console.debug(format, ...styles);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
this.persistLogToIndexedDB(logEntry);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
debug(message, context) {
|
|
440
|
+
if (this.shouldLog('debug')) {
|
|
441
|
+
const logEntry = { level: 'debug', message, context, timestamp: Date.now(), error: undefined };
|
|
442
|
+
this.storeLog('debug', message, context);
|
|
443
|
+
if (!this.config.silentMode) {
|
|
444
|
+
const { format, styles } = this.formatCompleteLogOutput('debug', message, context);
|
|
445
|
+
if (context && Object.keys(context).length > 1) {
|
|
446
|
+
console.debug(format, ...styles, context);
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
console.debug(format, ...styles);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
this.persistLogToIndexedDB(logEntry);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
info(message, context) {
|
|
456
|
+
if (this.shouldLog('info')) {
|
|
457
|
+
const logEntry = { level: 'info', message, context, timestamp: Date.now(), error: undefined };
|
|
458
|
+
this.storeLog('info', message, context);
|
|
459
|
+
if (!this.config.silentMode) {
|
|
460
|
+
const { format, styles } = this.formatCompleteLogOutput('info', message, context);
|
|
461
|
+
if (context && Object.keys(context).length > 1) {
|
|
462
|
+
console.info(format, ...styles, context);
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
console.info(format, ...styles);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
this.persistLogToIndexedDB(logEntry);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
warn(message, context) {
|
|
472
|
+
if (this.shouldLog('warn')) {
|
|
473
|
+
const logEntry = { level: 'warn', message, context, timestamp: Date.now(), error: undefined };
|
|
474
|
+
this.storeLog('warn', message, context);
|
|
475
|
+
if (!this.config.silentMode) {
|
|
476
|
+
const { format, styles } = this.formatCompleteLogOutput('warn', message, context);
|
|
477
|
+
if (context && Object.keys(context).length > 1) {
|
|
478
|
+
console.warn(format, ...styles, context);
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
console.warn(format, ...styles);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
this.persistLogToIndexedDB(logEntry);
|
|
485
|
+
}
|
|
486
|
+
this.reportToExternal('warn', message, context);
|
|
487
|
+
}
|
|
488
|
+
error(message, error, context) {
|
|
489
|
+
if (this.shouldLog('error')) {
|
|
490
|
+
const logEntry = { level: 'error', message, context, timestamp: Date.now(), error };
|
|
491
|
+
this.storeLog('error', message, context, error);
|
|
492
|
+
if (!this.config.silentMode) {
|
|
493
|
+
const { format, styles } = this.formatCompleteLogOutput('error', message, context);
|
|
494
|
+
if (error && context && Object.keys(context).length > 1) {
|
|
495
|
+
console.error(format, ...styles, error, context);
|
|
496
|
+
}
|
|
497
|
+
else if (error) {
|
|
498
|
+
console.error(format, ...styles, error);
|
|
499
|
+
}
|
|
500
|
+
else if (context && Object.keys(context).length > 1) {
|
|
501
|
+
console.error(format, ...styles, context);
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
console.error(format, ...styles);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
this.persistLogToIndexedDB(logEntry);
|
|
508
|
+
}
|
|
509
|
+
this.reportToExternal('error', message, context, error);
|
|
510
|
+
}
|
|
511
|
+
fatal(message, error, context) {
|
|
512
|
+
if (this.shouldLog('fatal')) {
|
|
513
|
+
const logEntry = { level: 'fatal', message, context, timestamp: Date.now(), error };
|
|
514
|
+
this.storeLog('fatal', message, context, error);
|
|
515
|
+
if (!this.config.silentMode) {
|
|
516
|
+
const { format, styles } = this.formatCompleteLogOutput('fatal', message, context);
|
|
517
|
+
if (error && context && Object.keys(context).length > 1) {
|
|
518
|
+
console.error(format, ...styles, error, context);
|
|
519
|
+
}
|
|
520
|
+
else if (error) {
|
|
521
|
+
console.error(format, ...styles, error);
|
|
522
|
+
}
|
|
523
|
+
else if (context && Object.keys(context).length > 1) {
|
|
524
|
+
console.error(format, ...styles, context);
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
console.error(format, ...styles);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
this.persistLogToIndexedDB(logEntry);
|
|
531
|
+
}
|
|
532
|
+
this.reportToExternal('fatal', message, context, error);
|
|
533
|
+
}
|
|
534
|
+
reportToExternal(level, message, context, error) {
|
|
535
|
+
// Only report warn, error, and fatal to external services
|
|
536
|
+
if (this.config.onError && error) {
|
|
537
|
+
this.config.onError(error, context || this.createContext('unknown'));
|
|
538
|
+
}
|
|
539
|
+
if (this.config.errorReporter && error) {
|
|
540
|
+
this.config.errorReporter.captureException(error, context);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
createContext(component) {
|
|
544
|
+
return {
|
|
545
|
+
component,
|
|
546
|
+
action: 'unknown',
|
|
547
|
+
timestamp: Date.now(),
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: LoggerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
551
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: LoggerService, providedIn: 'root' });
|
|
552
|
+
}
|
|
553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: LoggerService, decorators: [{
|
|
554
|
+
type: Injectable,
|
|
555
|
+
args: [{
|
|
556
|
+
providedIn: 'root',
|
|
557
|
+
}]
|
|
558
|
+
}] });
|
|
559
|
+
|
|
560
|
+
function provideLogger(config) {
|
|
561
|
+
return makeEnvironmentProviders([
|
|
562
|
+
{
|
|
563
|
+
provide: LoggerService,
|
|
564
|
+
useFactory: () => {
|
|
565
|
+
const logger = new LoggerService();
|
|
566
|
+
logger.configure(config || {});
|
|
567
|
+
return logger;
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
]);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Generated bundle index. Do not edit.
|
|
575
|
+
*/
|
|
576
|
+
|
|
577
|
+
export { LoggerService, provideLogger };
|
|
578
|
+
//# sourceMappingURL=sixbell-telco-sdk-utils-logger.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-utils-logger.mjs","sources":["../../../projects/sdk/utils/logger/src/constants.ts","../../../projects/sdk/utils/logger/src/logger.service.ts","../../../projects/sdk/utils/logger/src/providers/logger.provider.ts","../../../projects/sdk/utils/logger/sixbell-telco-sdk-utils-logger.ts"],"sourcesContent":["/**\n * Logger Constants\n * Color schemes, log levels, and configuration defaults\n */\n\nimport type { LogLevel } from './models/logger';\n\nexport const LOG_LEVELS: Record<LogLevel, number> = {\n\ttrace: 0,\n\tdebug: 1,\n\tinfo: 2,\n\twarn: 3,\n\terror: 4,\n\tfatal: 5,\n} as const;\n\n// Light mode colors\nexport const LOG_COLORS_LIGHT: Record<LogLevel, string> = {\n\ttrace: 'color: #666666; font-weight: bold;', // Dark Gray\n\tdebug: 'color: #0052a3; font-weight: bold;', // Dark Blue\n\tinfo: 'color: #006600; font-weight: bold;', // Dark Green\n\twarn: 'color: #cc7700; font-weight: bold;', // Dark Orange\n\terror: 'color: #cc0000; font-weight: bold;', // Dark Red\n\tfatal: 'color: #ffffff; background-color: #cc0000; font-weight: bold; padding: 2px 4px;', // White on Red\n} as const;\n\n// Dark mode colors\nexport const LOG_COLORS_DARK: Record<LogLevel, string> = {\n\ttrace: 'color: #aaaaaa; font-weight: bold;', // Light Gray\n\tdebug: 'color: #66b3ff; font-weight: bold;', // Light Blue\n\tinfo: 'color: #66ff66; font-weight: bold;', // Light Green\n\twarn: 'color: #ffcc66; font-weight: bold;', // Light Orange\n\terror: 'color: #ff6666; font-weight: bold;', // Light Red\n\tfatal: 'color: #ffffff; background-color: #ff4444; font-weight: bold; padding: 2px 4px;', // White on Light Red\n} as const;\n\n// Component/context color - Light mode (dark purple) / Dark mode (light purple)\nexport const CONTEXT_COLOR_LIGHT = 'color: #5500aa; font-weight: bold;' as const; // Dark Purple\nexport const CONTEXT_COLOR_DARK = 'color: #dd99ff; font-weight: bold;' as const; // Light Purple\n\n// Timestamp color - Light mode (dark teal) / Dark mode (light teal)\nexport const TIMESTAMP_COLOR_LIGHT = 'color: #006666; font-weight: bold;' as const; // Dark Teal\nexport const TIMESTAMP_COLOR_DARK = 'color: #66ffff; font-weight: bold;' as const; // Light Teal\n\n// IndexedDB defaults\nexport const IDB_STORE_NAME = 'sixbell-logs' as const;\nexport const IDB_DB_NAME = 'sixbell-ui-kit' as const;\nexport const MAX_STORED_LOGS = 1000 as const; // Prevent memory bloat\n","import { Injectable } from '@angular/core';\nimport {\n\tCONTEXT_COLOR_DARK,\n\tCONTEXT_COLOR_LIGHT,\n\tIDB_DB_NAME,\n\tIDB_STORE_NAME,\n\tLOG_COLORS_DARK,\n\tLOG_COLORS_LIGHT,\n\tLOG_LEVELS,\n\tMAX_STORED_LOGS,\n\tTIMESTAMP_COLOR_DARK,\n\tTIMESTAMP_COLOR_LIGHT,\n} from './constants';\nimport type { LoggerConfig, LoggerContext, LogLevel } from './models/logger';\n\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class LoggerService {\n\tprivate config: LoggerConfig = {\n\t\tenableLogging: false,\n\t\tlogLevel: 'error',\n\t\tshowTimestamp: false,\n\t\tshowDate: false,\n\t\tsilentMode: false,\n\t\tpersistToIndexedDB: false,\n\t\tidbRetentionDays: 7, // Default: keep logs for 7 days\n\t\tidbMaxLogs: 5000, // Default: store max 5000 logs in IndexedDB\n\t\tisDarkMode: false,\n\t};\n\n\tprivate logStore: Array<{\n\t\ttimestamp: number;\n\t\tlevel: LogLevel;\n\t\tmessage: string;\n\t\tcontext?: LoggerContext;\n\t\terror?: Error;\n\t}> = [];\n\n\tprivate darkModeMediaQuery: MediaQueryList | null = null;\n\tprivate darkModeListenerInitialized = false;\n\tprivate idbReady: Promise<IDBDatabase | null> = Promise.resolve(null);\n\n\t/**\n\t * Initialize automatic dark mode detection based on system preferences\n\t * Only called when logging is enabled to minimize performance impact\n\t */\n\tprivate initializeDarkModeDetection(): void {\n\t\t// Skip if already initialized or not needed\n\t\tif (this.darkModeListenerInitialized || this.config.silentMode) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof window !== 'undefined' && window.matchMedia) {\n\t\t\tthis.darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n\n\t\t\t// Set initial value based on system preference\n\t\t\tthis.config.isDarkMode = this.darkModeMediaQuery.matches;\n\n\t\t\t// Listen for changes in system preference with both addEventListener and addListener for better browser support\n\t\t\tconst handleChange = (e: MediaQueryListEvent | MediaQueryList) => {\n\t\t\t\tconst isDark = 'matches' in e ? e.matches : false;\n\t\t\t\tthis.config.isDarkMode = isDark;\n\n\t\t\t\t// Log the theme change for debugging\n\t\t\t\tif (this.config.enableLogging) {\n\t\t\t\t\tconsole.log(`%c[THEME CHANGED] Theme switched to ${isDark ? 'dark' : 'light'} mode`, isDark ? LOG_COLORS_DARK.info : LOG_COLORS_LIGHT.info);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.darkModeMediaQuery.addEventListener('change', handleChange as EventListener);\n\t\t\t// Fallback for older browsers\n\t\t\tif ((this.darkModeMediaQuery as unknown as { addListener?: (listener: (e: MediaQueryListEvent) => void) => void }).addListener) {\n\t\t\t\t(this.darkModeMediaQuery as unknown as { addListener: (listener: (e: MediaQueryListEvent) => void) => void }).addListener(\n\t\t\t\t\thandleChange as (e: MediaQueryListEvent) => void,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthis.darkModeListenerInitialized = true;\n\t\t}\n\t}\n\n\tconfigure(config: Partial<LoggerConfig>): void {\n\t\tthis.config = { ...this.config, ...config };\n\n\t\t// Only initialize dark mode detection when logging is enabled and not in silent mode\n\t\tif (this.config.enableLogging && !this.config.silentMode) {\n\t\t\tthis.initializeDarkModeDetection();\n\t\t}\n\n\t\t// Initialize IndexedDB if persistence is enabled\n\t\tif (this.config.persistToIndexedDB) {\n\t\t\tthis.idbReady = this.initializeIndexedDB();\n\t\t}\n\t}\n\n\t/**\n\t * Get all stored logs (useful for sending to external services)\n\t */\n\tgetStoredLogs() {\n\t\treturn [...this.logStore];\n\t}\n\n\t/**\n\t * Clear stored logs\n\t */\n\tclearStoredLogs() {\n\t\tthis.logStore = [];\n\t}\n\n\t/**\n\t * Initialize IndexedDB for persistent log storage\n\t * Only called when persistToIndexedDB is enabled\n\t */\n\tprivate initializeIndexedDB(): Promise<IDBDatabase | null> {\n\t\tif (!this.config.persistToIndexedDB || typeof indexedDB === 'undefined') {\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tconst request = indexedDB.open(IDB_DB_NAME, 1);\n\n\t\t\trequest.onerror = () => {\n\t\t\t\tconsole.error('IndexedDB open error:', request.error);\n\t\t\t\tresolve(null);\n\t\t\t};\n\n\t\t\trequest.onsuccess = () => {\n\t\t\t\tresolve(request.result);\n\t\t\t};\n\n\t\t\trequest.onupgradeneeded = (event) => {\n\t\t\t\tconst db = (event.target as IDBOpenDBRequest).result;\n\t\t\t\tif (!db.objectStoreNames.contains(IDB_STORE_NAME)) {\n\t\t\t\t\tconst store = db.createObjectStore(IDB_STORE_NAME, { keyPath: 'id', autoIncrement: true });\n\t\t\t\t\tstore.createIndex('timestamp', 'timestamp', { unique: false });\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\t}\n\n\t/**\n\t * Persist a log entry to IndexedDB\n\t */\n\tprivate persistLogToIndexedDB(logEntry: { timestamp: number; level: LogLevel; message: string; context?: LoggerContext; error?: Error }): void {\n\t\tif (!this.config.persistToIndexedDB) return;\n\n\t\tthis.idbReady.then((db) => {\n\t\t\tif (!db) return;\n\n\t\t\ttry {\n\t\t\t\tconst transaction = db.transaction([IDB_STORE_NAME], 'readwrite');\n\t\t\t\tconst store = transaction.objectStore(IDB_STORE_NAME);\n\n\t\t\t\t// Don't persist Error objects directly (they don't serialize well)\n\t\t\t\tconst sanitizedEntry = {\n\t\t\t\t\t...logEntry,\n\t\t\t\t\terror: logEntry.error\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tname: logEntry.error.name,\n\t\t\t\t\t\t\t\tmessage: logEntry.error.message,\n\t\t\t\t\t\t\t\tstack: logEntry.error.stack,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\t};\n\n\t\t\t\tstore.add(sanitizedEntry);\n\n\t\t\t\t// Clean up old logs based on retention policy\n\t\t\t\tthis.cleanupOldLogs(db);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Error persisting log to IndexedDB:', error);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Clean up old logs based on retention policy (days and max count)\n\t */\n\tprivate cleanupOldLogs(db: IDBDatabase): void {\n\t\ttry {\n\t\t\tconst transaction = db.transaction([IDB_STORE_NAME], 'readwrite');\n\t\t\tconst store = transaction.objectStore(IDB_STORE_NAME);\n\t\t\tconst index = store.index('timestamp');\n\n\t\t\t// Calculate cutoff time (now - retention days)\n\t\t\tconst retentionMs = (this.config.idbRetentionDays || 7) * 24 * 60 * 60 * 1000;\n\t\t\tconst cutoffTime = Date.now() - retentionMs;\n\n\t\t\t// Delete logs older than retention period\n\t\t\tconst range = IDBKeyRange.upperBound(cutoffTime, true);\n\t\t\tconst cursorRequest = index.openCursor(range);\n\t\t\tcursorRequest.onsuccess = (event: Event) => {\n\t\t\t\tconst target = event.target as IDBRequest<IDBCursorWithValue | null>;\n\t\t\t\tconst cursor = target.result;\n\t\t\t\tif (cursor) {\n\t\t\t\t\tcursor.delete();\n\t\t\t\t\tcursor.continue();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Also check max log count and delete oldest if exceeded\n\t\t\tconst getAllRequest = store.getAll();\n\t\t\tgetAllRequest.onsuccess = () => {\n\t\t\t\tconst allLogs = getAllRequest.result as Array<{ id: number; timestamp: number }>;\n\t\t\t\tconst maxLogs = this.config.idbMaxLogs || 5000;\n\n\t\t\t\tif (allLogs.length > maxLogs) {\n\t\t\t\t\t// Sort by timestamp and delete oldest ones\n\t\t\t\t\tallLogs.sort((a, b) => a.timestamp - b.timestamp);\n\t\t\t\t\tconst logsToDelete = allLogs.slice(0, allLogs.length - maxLogs);\n\n\t\t\t\t\tlogsToDelete.forEach((log: { id: number }) => {\n\t\t\t\t\t\tstore.delete(log.id);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconsole.error('Error cleaning up old logs:', error);\n\t\t}\n\t}\n\n\t/**\n\t * Retrieve logs from IndexedDB\n\t */\n\tasync getPersistedLogs(): Promise<\n\t\tArray<{\n\t\t\tid?: number;\n\t\t\ttimestamp: number;\n\t\t\tlevel: LogLevel;\n\t\t\tmessage: string;\n\t\t\tcontext?: LoggerContext;\n\t\t\terror?: { name: string; message: string; stack?: string };\n\t\t}>\n\t> {\n\t\tconst db = await this.idbReady;\n\t\tif (!db) return [];\n\n\t\treturn new Promise((resolve) => {\n\t\t\ttry {\n\t\t\t\tconst transaction = db.transaction([IDB_STORE_NAME], 'readonly');\n\t\t\t\tconst store = transaction.objectStore(IDB_STORE_NAME);\n\t\t\t\tconst request = store.getAll();\n\n\t\t\t\trequest.onsuccess = () => {\n\t\t\t\t\tresolve(request.result);\n\t\t\t\t};\n\n\t\t\t\trequest.onerror = () => {\n\t\t\t\t\tconsole.error('Error retrieving logs from IndexedDB:', request.error);\n\t\t\t\t\tresolve([]);\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Error reading IndexedDB:', error);\n\t\t\t\tresolve([]);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Clear persisted logs from IndexedDB\n\t */\n\tasync clearPersistedLogs(): Promise<void> {\n\t\tconst db = await this.idbReady;\n\t\tif (!db) return;\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst transaction = db.transaction([IDB_STORE_NAME], 'readwrite');\n\t\t\t\tconst store = transaction.objectStore(IDB_STORE_NAME);\n\t\t\t\tconst request = store.clear();\n\n\t\t\t\trequest.onsuccess = () => resolve();\n\t\t\t\trequest.onerror = () => reject(request.error);\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Download logs as a JSON file\n\t * Combines in-memory logs with persisted IndexedDB logs\n\t */\n\tasync downloadLogs(filename: string = `logs-${Date.now()}.json`): Promise<void> {\n\t\ttry {\n\t\t\t// Get all logs (memory + IndexedDB)\n\t\t\tconst memoryLogs = this.getStoredLogs();\n\t\t\tconst persistedLogs = await this.getPersistedLogs();\n\t\t\tconst allLogs = [...memoryLogs, ...persistedLogs];\n\n\t\t\t// Create JSON blob\n\t\t\tconst jsonStr = JSON.stringify(allLogs, null, 2);\n\t\t\tconst blob = new Blob([jsonStr], { type: 'application/json' });\n\n\t\t\t// Create download link and trigger\n\t\t\tconst url = URL.createObjectURL(blob);\n\t\t\tconst link = document.createElement('a');\n\t\t\tlink.href = url;\n\t\t\tlink.download = filename;\n\t\t\tdocument.body.appendChild(link);\n\t\t\tlink.click();\n\t\t\tdocument.body.removeChild(link);\n\t\t\tURL.revokeObjectURL(url);\n\t\t} catch (error) {\n\t\t\tconsole.error('Error downloading logs:', error);\n\t\t}\n\t}\n\n\t/**\n\t * Update theme mode for color adjustment\n\t * If you want to restore automatic detection, pass undefined\n\t *\n\t * @param isDark true for dark mode, false for light mode, undefined to use system preference\n\t */\n\tsetDarkMode(isDark: boolean | undefined): void {\n\t\tif (isDark === undefined) {\n\t\t\t// Restore automatic detection - initialize listener if needed\n\t\t\tif (this.config.enableLogging && !this.config.silentMode) {\n\t\t\t\tthis.initializeDarkModeDetection();\n\t\t\t}\n\t\t\tif (this.darkModeMediaQuery) {\n\t\t\t\tthis.config.isDarkMode = this.darkModeMediaQuery.matches;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.config.isDarkMode = isDark;\n\t\t}\n\t}\n\n\t/**\n\t * Get current dark mode status\n\t */\n\tisDarkMode(): boolean {\n\t\treturn this.config.isDarkMode || false;\n\t}\n\n\t/**\n\t * Create a temporary logger with override configuration.\n\t * Useful for local use-case-specific logging without global provider changes.\n\t *\n\t * @param overrideConfig Configuration that overrides current logger settings\n\t * @returns A new LoggerService instance with merged config\n\t *\n\t * @example\n\t * ```typescript\n\t * // In theme service:\n\t * private readonly logger = inject(LoggerService);\n\t *\n\t * // For this specific operation, use debug level:\n\t * const debugLogger = this.logger.withConfig({ logLevel: 'debug' });\n\t * debugLogger.debug('Detailed operation trace');\n\t *\n\t * // Back to global config:\n\t * this.logger.debug('This respects global config');\n\t * ```\n\t */\n\twithConfig(overrideConfig: Partial<LoggerConfig>): LoggerService {\n\t\tconst logger = new LoggerService();\n\t\tlogger.configure({ ...this.config, ...overrideConfig });\n\t\treturn logger;\n\t}\n\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\tif (!this.config.enableLogging) return false;\n\n\t\tconst currentLevel = LOG_LEVELS[this.config.logLevel || 'error'];\n\t\tconst messageLevel = LOG_LEVELS[level];\n\n\t\treturn messageLevel >= currentLevel;\n\t}\n\n\tprivate getColors(): Record<LogLevel, string> {\n\t\treturn this.config.isDarkMode ? LOG_COLORS_DARK : LOG_COLORS_LIGHT;\n\t}\n\n\tprivate getContextColor(): string {\n\t\treturn this.config.isDarkMode ? CONTEXT_COLOR_DARK : CONTEXT_COLOR_LIGHT;\n\t}\n\n\tprivate getTimestampColor(): string {\n\t\treturn this.config.isDarkMode ? TIMESTAMP_COLOR_DARK : TIMESTAMP_COLOR_LIGHT;\n\t}\n\n\tprivate storeLog(level: LogLevel, message: string, context?: LoggerContext, error?: Error): void {\n\t\tthis.logStore.push({\n\t\t\ttimestamp: Date.now(),\n\t\t\tlevel,\n\t\t\tmessage,\n\t\t\tcontext,\n\t\t\terror,\n\t\t});\n\n\t\t// Prevent memory bloat\n\t\tif (this.logStore.length > MAX_STORED_LOGS) {\n\t\t\tthis.logStore.shift();\n\t\t}\n\t}\n\n\t/**\n\t * Extract component name from message pattern like \"[ComponentName] message\"\n\t * and return formatted parts for colored logging\n\t */\n\tprivate formatMessageWithContext(message: string): { formatted: string; styles: string[] } {\n\t\tconst componentMatch = message.match(/^\\[([^\\]]+)\\]\\s(.*)$/);\n\t\tconst contextColor = this.getContextColor();\n\n\t\tif (componentMatch) {\n\t\t\tconst componentName = componentMatch[1];\n\t\t\tconst restOfMessage = componentMatch[2];\n\t\t\treturn {\n\t\t\t\tformatted: `%c[${componentName}]%c ${restOfMessage}`,\n\t\t\t\tstyles: [contextColor, ''],\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tformatted: `%c${message}`,\n\t\t\tstyles: [''],\n\t\t};\n\t}\n\n\t/**\n\t * Format complete log output with level, timestamp, context, and message\n\t * Returns array of format string and all styles for console output\n\t */\n\tprivate formatCompleteLogOutput(level: LogLevel, message: string, context?: LoggerContext): { format: string; styles: string[] } {\n\t\tconst colors = this.getColors();\n\t\tconst levelStyle = colors[level];\n\t\tconst contextColor = this.getContextColor();\n\t\tconst timestampColor = this.getTimestampColor();\n\n\t\tlet format = `%c[${level.toUpperCase()}]`;\n\t\tconst styles: string[] = [levelStyle];\n\n\t\t// Add timestamp if enabled\n\t\tif (this.config.showTimestamp || this.config.showDate) {\n\t\t\tconst now = new Date();\n\t\t\tconst isoString = now.toISOString();\n\t\t\tlet timeStr: string;\n\n\t\t\tif (this.config.showDate) {\n\t\t\t\tconst date = isoString.split('T')[0];\n\t\t\t\tconst time = isoString.split('T')[1].slice(0, 12);\n\t\t\t\ttimeStr = `${date} ${time}`;\n\t\t\t} else {\n\t\t\t\ttimeStr = isoString.split('T')[1].slice(0, 12);\n\t\t\t}\n\n\t\t\tformat += `%c [${timeStr}]`;\n\t\t\tstyles.push(timestampColor);\n\t\t}\n\n\t\t// Add context if provided\n\t\tif (context?.component) {\n\t\t\tformat += `%c [${context.component}]`;\n\t\t\tstyles.push(contextColor);\n\t\t}\n\n\t\t// Add message\n\t\tformat += `%c ${message}`;\n\t\tstyles.push('');\n\n\t\treturn { format, styles };\n\t}\n\n\ttrace(message: string, context?: LoggerContext): void {\n\t\tif (this.shouldLog('trace')) {\n\t\t\tconst logEntry = { level: 'trace' as LogLevel, message, context, timestamp: Date.now(), error: undefined };\n\t\t\tthis.storeLog('trace', message, context);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('trace', message, context);\n\n\t\t\t\tif (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.debug(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.debug(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t}\n\n\tdebug(message: string, context?: LoggerContext): void {\n\t\tif (this.shouldLog('debug')) {\n\t\t\tconst logEntry = { level: 'debug' as LogLevel, message, context, timestamp: Date.now(), error: undefined };\n\t\t\tthis.storeLog('debug', message, context);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('debug', message, context);\n\n\t\t\t\tif (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.debug(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.debug(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t}\n\n\tinfo(message: string, context?: LoggerContext): void {\n\t\tif (this.shouldLog('info')) {\n\t\t\tconst logEntry = { level: 'info' as LogLevel, message, context, timestamp: Date.now(), error: undefined };\n\t\t\tthis.storeLog('info', message, context);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('info', message, context);\n\n\t\t\t\tif (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.info(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.info(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t}\n\n\twarn(message: string, context?: LoggerContext): void {\n\t\tif (this.shouldLog('warn')) {\n\t\t\tconst logEntry = { level: 'warn' as LogLevel, message, context, timestamp: Date.now(), error: undefined };\n\t\t\tthis.storeLog('warn', message, context);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('warn', message, context);\n\n\t\t\t\tif (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.warn(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t\tthis.reportToExternal('warn', message, context);\n\t}\n\n\terror(message: string, error?: Error, context?: LoggerContext): void {\n\t\tif (this.shouldLog('error')) {\n\t\t\tconst logEntry = { level: 'error' as LogLevel, message, context, timestamp: Date.now(), error };\n\t\t\tthis.storeLog('error', message, context, error);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('error', message, context);\n\n\t\t\t\tif (error && context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.error(format, ...styles, error, context);\n\t\t\t\t} else if (error) {\n\t\t\t\t\tconsole.error(format, ...styles, error);\n\t\t\t\t} else if (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.error(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t\tthis.reportToExternal('error', message, context, error);\n\t}\n\n\tfatal(message: string, error?: Error, context?: LoggerContext): void {\n\t\tif (this.shouldLog('fatal')) {\n\t\t\tconst logEntry = { level: 'fatal' as LogLevel, message, context, timestamp: Date.now(), error };\n\t\t\tthis.storeLog('fatal', message, context, error);\n\n\t\t\tif (!this.config.silentMode) {\n\t\t\t\tconst { format, styles } = this.formatCompleteLogOutput('fatal', message, context);\n\n\t\t\t\tif (error && context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.error(format, ...styles, error, context);\n\t\t\t\t} else if (error) {\n\t\t\t\t\tconsole.error(format, ...styles, error);\n\t\t\t\t} else if (context && Object.keys(context).length > 1) {\n\t\t\t\t\tconsole.error(format, ...styles, context);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(format, ...styles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.persistLogToIndexedDB(logEntry);\n\t\t}\n\t\tthis.reportToExternal('fatal', message, context, error);\n\t}\n\n\tprivate reportToExternal(level: string, message: string, context?: LoggerContext, error?: Error): void {\n\t\t// Only report warn, error, and fatal to external services\n\t\tif (this.config.onError && error) {\n\t\t\tthis.config.onError(error, context || this.createContext('unknown'));\n\t\t}\n\n\t\tif (this.config.errorReporter && error) {\n\t\t\tthis.config.errorReporter.captureException(error, context);\n\t\t}\n\t}\n\n\tprivate createContext(component: string): LoggerContext {\n\t\treturn {\n\t\t\tcomponent,\n\t\t\taction: 'unknown',\n\t\t\ttimestamp: Date.now(),\n\t\t};\n\t}\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { LoggerService } from '../logger.service';\nimport type { LoggerConfig } from '../models/logger';\n\nexport function provideLogger(config?: Partial<LoggerConfig>): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: LoggerService,\n\t\t\tuseFactory: () => {\n\t\t\t\tconst logger = new LoggerService();\n\t\t\t\tlogger.configure(config || {});\n\t\t\t\treturn logger;\n\t\t\t},\n\t\t},\n\t]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;AAGG;AAII,MAAM,UAAU,GAA6B;AACnD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,KAAK,EAAE,CAAC;CACC;AAEV;AACO,MAAM,gBAAgB,GAA6B;IACzD,KAAK,EAAE,oCAAoC;IAC3C,KAAK,EAAE,oCAAoC;IAC3C,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,oCAAoC;IAC1C,KAAK,EAAE,oCAAoC;IAC3C,KAAK,EAAE,iFAAiF;CAC/E;AAEV;AACO,MAAM,eAAe,GAA6B;IACxD,KAAK,EAAE,oCAAoC;IAC3C,KAAK,EAAE,oCAAoC;IAC3C,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,oCAAoC;IAC1C,KAAK,EAAE,oCAAoC;IAC3C,KAAK,EAAE,iFAAiF;CAC/E;AAEV;AACO,MAAM,mBAAmB,GAAG,oCAA6C,CAAC;AAC1E,MAAM,kBAAkB,GAAG,oCAA6C,CAAC;AAEhF;AACO,MAAM,qBAAqB,GAAG,oCAA6C,CAAC;AAC5E,MAAM,oBAAoB,GAAG,oCAA6C,CAAC;AAElF;AACO,MAAM,cAAc,GAAG,cAAuB;AAC9C,MAAM,WAAW,GAAG,gBAAyB;AAC7C,MAAM,eAAe,GAAG,IAAa,CAAC;;MC7BhC,aAAa,CAAA;AACjB,IAAA,MAAM,GAAiB;AAC9B,QAAA,aAAa,EAAE,KAAK;AACpB,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,a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