@mks2508/better-logger 3.0.0 → 3.1.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/.claude/settings.local.json +3 -1
- package/CHANGELOG.json +76 -1
- package/dist/Logger.d.ts +12 -12
- package/dist/Logger.d.ts.map +1 -1
- package/dist/chunks/{Logger-BCfx_yCK.js → Logger-BV0v1AyC.js} +2 -2
- package/dist/chunks/Logger-BV0v1AyC.js.map +1 -0
- package/dist/chunks/{Logger-C126NTrD.js → Logger-C086w3EM.js} +8 -8
- package/dist/chunks/Logger-C086w3EM.js.map +1 -0
- package/dist/chunks/environment-C_8J-zQ_.js +4 -0
- package/dist/chunks/environment-C_8J-zQ_.js.map +1 -0
- package/dist/chunks/{environment-TI2ByCPT.js → environment-DXHouGD4.js} +468 -100
- package/dist/chunks/environment-DXHouGD4.js.map +1 -0
- package/dist/chunks/{formatting-CuNUqGks.js → formatting-BNnVUPcw.js} +2 -2
- package/dist/chunks/{formatting-CuNUqGks.js.map → formatting-BNnVUPcw.js.map} +1 -1
- package/dist/chunks/{formatting-Blwy-f0W.js → formatting-Cg5YhB9Y.js} +2 -2
- package/dist/chunks/{formatting-Blwy-f0W.js.map → formatting-Cg5YhB9Y.js.map} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/exports.cjs +1 -1
- package/dist/exports.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +197 -15
- package/dist/index.js.map +1 -1
- package/dist/styling.cjs +1 -1
- package/dist/styling.js +3 -3
- package/dist/terminal/color-converter.d.ts +73 -0
- package/dist/terminal/color-converter.d.ts.map +1 -0
- package/dist/terminal/formatter.d.ts +20 -0
- package/dist/terminal/formatter.d.ts.map +1 -0
- package/dist/terminal/terminal-renderer.d.ts +20 -6
- package/dist/terminal/terminal-renderer.d.ts.map +1 -1
- package/dist/types/core.d.ts +17 -0
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/environment-detector.d.ts +10 -0
- package/dist/utils/environment-detector.d.ts.map +1 -1
- package/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/packages/styling/package.json +2 -2
- package/src/Logger.ts +12 -12
- package/src/index.ts +57 -2
- package/src/terminal/color-converter.ts +315 -0
- package/src/terminal/formatter.ts +236 -0
- package/src/terminal/terminal-renderer.ts +74 -79
- package/src/types/core.ts +22 -0
- package/src/types/index.ts +5 -0
- package/src/utils/environment-detector.ts +23 -1
- package/dist/chunks/Logger-BCfx_yCK.js.map +0 -1
- package/dist/chunks/Logger-C126NTrD.js.map +0 -1
- package/dist/chunks/environment-Ba5kShbx.js +0 -4
- package/dist/chunks/environment-Ba5kShbx.js.map +0 -1
- package/dist/chunks/environment-TI2ByCPT.js.map +0 -1
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
"Bash(wc:*)",
|
|
35
35
|
"mcp__plugin_context7_context7__resolve-library-id",
|
|
36
36
|
"mcp__plugin_context7_context7__get-library-docs",
|
|
37
|
-
"WebFetch(domain:www.nearform.com)"
|
|
37
|
+
"WebFetch(domain:www.nearform.com)",
|
|
38
|
+
"Bash(grep:*)",
|
|
39
|
+
"Bash(cat:*)"
|
|
38
40
|
],
|
|
39
41
|
"deny": [],
|
|
40
42
|
"ask": [],
|
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,81 @@
|
|
|
1
1
|
{
|
|
2
|
-
"current_version": "0.
|
|
2
|
+
"current_version": "0.16.0-alpha.1",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.16.0-alpha.1",
|
|
6
|
+
"date": "2025-12-28",
|
|
7
|
+
"type": "minor",
|
|
8
|
+
"title": "Versión Alpha - Nuevas funcionalidades incluyendo Custom Serializers: `logger y 4 más",
|
|
9
|
+
"changes": [
|
|
10
|
+
{
|
|
11
|
+
"type": "improvement",
|
|
12
|
+
"title": "chore: release 0.15.0-alpha.1 [skip ci]",
|
|
13
|
+
"description": "chore: release 0.15.0-alpha.1 [skip ci]"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "improvement",
|
|
17
|
+
"title": "Update package.json",
|
|
18
|
+
"description": "Update package.json"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "feature",
|
|
22
|
+
"title": "Custom Serializers: `logger",
|
|
23
|
+
"description": "Custom Serializers: `logger.addSerializer(Error, fn)` para transformar objetos"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "feature",
|
|
27
|
+
"title": "Hooks System: `logger",
|
|
28
|
+
"description": "Hooks System: `logger.on('beforeLog', fn)` para interceptar logs"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "feature",
|
|
32
|
+
"title": "Middleware: `logger",
|
|
33
|
+
"description": "Middleware: `logger.use((entry, next) => {...})` pipeline de procesamiento"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "feature",
|
|
37
|
+
"title": "Transports: `logger",
|
|
38
|
+
"description": "Transports: `logger.addTransport({target: 'file'})` para file/http/custom destinations"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "feature",
|
|
42
|
+
"title": "Badges: `logger",
|
|
43
|
+
"description": "Badges: `logger.badges(['v3']).info()` sistema de etiquetado flexible"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "improvement",
|
|
47
|
+
"title": "~50-100x menos memoria en child loggers (delegación vs herencia)",
|
|
48
|
+
"description": "~50-100x menos memoria en child loggers (delegación vs herencia)"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "improvement",
|
|
52
|
+
"title": "Style Cache con LRU + TTL para estilos computados",
|
|
53
|
+
"description": "Style Cache con LRU + TTL para estilos computados"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "improvement",
|
|
57
|
+
"title": "Serialización automática con detección de tipos",
|
|
58
|
+
"description": "Serialización automática con detección de tipos"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "breaking",
|
|
62
|
+
"title": "ScopedLogger usa delegación (no herencia)",
|
|
63
|
+
"description": "ScopedLogger usa delegación (no herencia)"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"type": "breaking",
|
|
67
|
+
"title": "Métodos component/api/scope ahora síncronos",
|
|
68
|
+
"description": "Métodos component/api/scope ahora síncronos"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"technical_notes": "Nuevos módulos enterprise:\n- SerializerRegistry (src/serializers/): serialización type-based con prioridad\n- HookManager (src/hooks/): sistema de hooks (beforeLog/afterLog/onError) y middleware pipeline\n- TransportManager + ConsoleTransport/FileTransport/HttpTransport (src/transports/)\n- StyleCache (src/styling/StyleCache.ts): cache LRU con TTL para estilos computados\n\nIntegración en Logger.ts:\n- Nuevas propiedades: serializerRegistry, hookManager, transportManager\n- Nuevos métodos: addSerializer(), removeSerializer(), on(), once(), off(), use()\n- Nuevos métodos transports: addTransport(), removeTransport(), flushTransports(), closeTransports()\n- Método log() modificado: serializa args, emite hooks, escribe a transports async\n\nTypes añadidos (src/types/):\n- serializers.ts: SerializerFn, SerializerContext, ISerializerRegistry\n- hooks.ts: HookLogEntry, HookEvent, HookCallback, MiddlewareFn, IHookManager\n- transports.ts: TransportRecord, TransportTarget, ITransport\n\nScopedLogger refactorizado: delegación en lugar de herencia (~50-100x menos memoria)",
|
|
72
|
+
"breaking_changes": [
|
|
73
|
+
"ScopedLogger usa delegación (no herencia)",
|
|
74
|
+
"Métodos component/api/scope ahora síncronos"
|
|
75
|
+
],
|
|
76
|
+
"commit_hash": "7a27ac9bfd84b56318b54ee37563eed404943e94",
|
|
77
|
+
"prefix": "alpha"
|
|
78
|
+
},
|
|
4
79
|
{
|
|
5
80
|
"version": "0.15.0-alpha.1",
|
|
6
81
|
"date": "2025-12-28",
|
package/dist/Logger.d.ts
CHANGED
|
@@ -202,7 +202,7 @@ export declare class Logger {
|
|
|
202
202
|
*
|
|
203
203
|
* @since 0.3.0
|
|
204
204
|
*/
|
|
205
|
-
hideTimestamp():
|
|
205
|
+
hideTimestamp(): this;
|
|
206
206
|
/**
|
|
207
207
|
* Muestra el timestamp en los logs
|
|
208
208
|
*
|
|
@@ -212,7 +212,7 @@ export declare class Logger {
|
|
|
212
212
|
*
|
|
213
213
|
* @since 0.3.0
|
|
214
214
|
*/
|
|
215
|
-
showTimestamp():
|
|
215
|
+
showTimestamp(): this;
|
|
216
216
|
/**
|
|
217
217
|
* Oculta la información de ubicación (archivo:línea) en los logs
|
|
218
218
|
*
|
|
@@ -222,7 +222,7 @@ export declare class Logger {
|
|
|
222
222
|
*
|
|
223
223
|
* @since 0.3.0
|
|
224
224
|
*/
|
|
225
|
-
hideLocation():
|
|
225
|
+
hideLocation(): this;
|
|
226
226
|
/**
|
|
227
227
|
* Muestra la información de ubicación (archivo:línea) en los logs
|
|
228
228
|
*
|
|
@@ -232,7 +232,7 @@ export declare class Logger {
|
|
|
232
232
|
*
|
|
233
233
|
* @since 0.3.0
|
|
234
234
|
*/
|
|
235
|
-
showLocation():
|
|
235
|
+
showLocation(): this;
|
|
236
236
|
/**
|
|
237
237
|
* Oculta los badges en los logs
|
|
238
238
|
*
|
|
@@ -243,7 +243,7 @@ export declare class Logger {
|
|
|
243
243
|
*
|
|
244
244
|
* @since 0.3.0
|
|
245
245
|
*/
|
|
246
|
-
hideBadges():
|
|
246
|
+
hideBadges(): this;
|
|
247
247
|
/**
|
|
248
248
|
* Muestra los badges en los logs
|
|
249
249
|
*
|
|
@@ -254,7 +254,7 @@ export declare class Logger {
|
|
|
254
254
|
*
|
|
255
255
|
* @since 0.3.0
|
|
256
256
|
*/
|
|
257
|
-
showBadges():
|
|
257
|
+
showBadges(): this;
|
|
258
258
|
/**
|
|
259
259
|
* Establece múltiples badges para los logs
|
|
260
260
|
*
|
|
@@ -818,12 +818,12 @@ export declare const cli: (command: string) => Promise<void>;
|
|
|
818
818
|
export declare const cleanup: () => void;
|
|
819
819
|
export declare const preset: (name: string) => void;
|
|
820
820
|
export declare const presets: () => string[];
|
|
821
|
-
export declare const hideTimestamp: () =>
|
|
822
|
-
export declare const showTimestamp: () =>
|
|
823
|
-
export declare const hideLocation: () =>
|
|
824
|
-
export declare const showLocation: () =>
|
|
825
|
-
export declare const hideBadges: () =>
|
|
826
|
-
export declare const showBadges: () =>
|
|
821
|
+
export declare const hideTimestamp: () => Logger;
|
|
822
|
+
export declare const showTimestamp: () => Logger;
|
|
823
|
+
export declare const hideLocation: () => Logger;
|
|
824
|
+
export declare const showLocation: () => Logger;
|
|
825
|
+
export declare const hideBadges: () => Logger;
|
|
826
|
+
export declare const showBadges: () => Logger;
|
|
827
827
|
export declare const badges: (badgeList: string[]) => Logger;
|
|
828
828
|
export declare const badge: (badgeName: string) => Logger;
|
|
829
829
|
export declare const clearBadges: () => Logger;
|
package/dist/Logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../src/Logger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACR,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,YAAY,EAEZ,WAAW,EAEX,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,eAAe,EAElB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAsBzD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAAE,gB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AAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./environment-Ba5kShbx.js"),t={maxDepth:5,circular:"placeholder",preserveUndefined:!1};class SerializerRegistry{serializers=/* @__PURE__ */new Map;config;constructor(e={}){this.config={...t,...e},this.registerDefaults()}registerDefaults(){this.add(Error,e=>({name:e.name,message:e.message,stack:e.stack?.split("\n").slice(0,10),...e.cause?{cause:this.serialize(e.cause)}:{}}),100),this.add(Date,e=>({iso:e.toISOString(),timestamp:e.getTime()}),90),this.add(RegExp,e=>({pattern:e.source,flags:e.flags}),90),this.add(Map,(e,t)=>{const r={};return e.forEach((e,o)=>{const s="object"==typeof o?JSON.stringify(o):String(o);r[s]=this.serializeInternal(e,{...t,depth:t.depth+1,path:[...t.path,s]})}),{__type:"Map",entries:r}},80),this.add(Set,(e,t)=>({__type:"Set",values:Array.from(e).map((e,r)=>this.serializeInternal(e,{...t,depth:t.depth+1,path:[...t.path,`[${r}]`]}))}),80),"undefined"!=typeof Buffer&&this.add(Buffer,e=>({__type:"Buffer",length:e.length,preview:e.slice(0,50).toString("hex")}),70)}add(e,t,r=50){this.serializers.set(e,{type:e,serializer:t,priority:r})}remove(e){return this.serializers.delete(e)}has(e){return this.serializers.has(e)}getAll(){return Array.from(this.serializers.values()).sort((e,t)=>(t.priority??50)-(e.priority??50))}findSerializer(e){const t=this.getAll();for(const r of t)if(e instanceof r.type)return r;return null}serializeInternal(e,t){if(null===e)return null;if(void 0===e)return this.config.preserveUndefined?void 0:"[undefined]";if("function"==typeof e)return`[Function: ${e.name||"anonymous"}]`;if("object"!=typeof e)return e;if(t.depth>=this.config.maxDepth)return"[Max Depth]";if(t.seen.has(e))switch(this.config.circular){case"error":throw new Error(`Circular reference at ${t.path.join(".")}`);case"skip":return;default:return"[Circular]"}t.seen.add(e);const r=this.findSerializer(e);if(r)return r.serializer(e,t);if(Array.isArray(e))return e.map((e,r)=>this.serializeInternal(e,{...t,depth:t.depth+1,path:[...t.path,`[${r}]`]}));const o={};for(const[s,i]of Object.entries(e))o[s]=this.serializeInternal(i,{...t,depth:t.depth+1,path:[...t.path,s]});return o}serialize(e,t){const r={...this.config,...t};return this.serializeInternal(e,{depth:0,maxDepth:r.maxDepth,path:[],seen:/* @__PURE__ */new WeakSet})}}function generateId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}class HookManager{hooks=/* @__PURE__ */new Map;middlewares=[];constructor(){this.hooks.set("beforeLog",[]),this.hooks.set("afterLog",[]),this.hooks.set("onError",[])}on(e,t,r=50){const o={id:generateId(),event:e,callback:t,priority:r,once:!1},s=this.hooks.get(e);return s.push(o),s.sort((e,t)=>t.priority-e.priority),()=>this.removeHook(e,o.id)}once(e,t,r=50){const o={id:generateId(),event:e,callback:t,priority:r,once:!0},s=this.hooks.get(e);return s.push(o),s.sort((e,t)=>t.priority-e.priority),()=>this.removeHook(e,o.id)}off(e,t){const r=this.hooks.get(e);if(!r)return!1;const o=r.findIndex(e=>e.callback===t);return o>=0&&(r.splice(o,1),!0)}removeHook(e,t){const r=this.hooks.get(e);if(r){const e=r.findIndex(e=>e.id===t);e>=0&&r.splice(e,1)}}use(e,t=50){const r={id:generateId(),fn:e,priority:t};return this.middlewares.push(r),this.middlewares.sort((e,t)=>t.priority-e.priority),()=>{const e=this.middlewares.findIndex(e=>e.id===r.id);e>=0&&this.middlewares.splice(e,1)}}async emit(e,t){const r=this.hooks.get(e)||[];let o={...t};const s=[];for(const n of r)try{const e=await n.callback(o);e&&(o={...o,...e}),n.once&&s.push(n.id)}catch(i){"onError"!==e&&await this.emit("onError",{...o,error:i,hookEvent:e})}return s.forEach(t=>this.removeHook(e,t)),o}async process(e){let t={...e};if(t=await this.emit("beforeLog",t),this.middlewares.length>0){let e=0;const executeNext=async()=>{if(e<this.middlewares.length){const r=this.middlewares[e++];r&&await r.fn(t,executeNext)}};await executeNext()}return t}async afterProcess(e){await this.emit("afterLog",e)}clear(){this.hooks.forEach(e=>e.length=0),this.middlewares.length=0}getStats(){return{hooks:{beforeLog:this.hooks.get("beforeLog")?.length||0,afterLog:this.hooks.get("afterLog")?.length||0,onError:this.hooks.get("onError")?.length||0},middlewares:this.middlewares.length}}}const r={debug:0,info:1,warn:2,error:3,critical:4};class TransportManager{transports=/* @__PURE__ */new Map;defaultLevel="info";constructor(e){e&&(this.defaultLevel=e)}add(e){const t=`transport-${Date.now()}-${Math.random().toString(36).substr(2,6)}`,o=e.level||this.defaultLevel;let s;if("string"==typeof e.target)throw new Error("String transport targets not supported. Use inline transport object.");s=e.target;const i={id:t,transport:s,options:e.options||{},level:o,levelValue:r[o]};return this.transports.set(t,i),t}remove(e){const t=this.transports.get(e);return!!t&&(t.transport.close?.(),this.transports.delete(e))}async write(e){const t=[];for(const r of this.transports.values()){if(e.levelValue<r.levelValue)continue;let o=e;if(r.options.transform){const t=r.options.transform(e);if(null===t)continue;o=t}const s=r.transport.write(o);s instanceof Promise&&t.push(s)}await Promise.all(t)}async flush(){const e=[];for(const t of this.transports.values())if(t.transport.flush){const r=t.transport.flush();r instanceof Promise&&e.push(r)}await Promise.all(e)}async close(){await this.flush();const e=[];for(const t of this.transports.values())if(t.transport.close){const r=t.transport.close();r instanceof Promise&&e.push(r)}await Promise.all(e),this.transports.clear()}get count(){return this.transports.size}list(){return Array.from(this.transports.keys())}}const o={default:{debug:{emoji:"🐞",label:"DEBUG",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",color:"#ffffff",border:"1px solid #667eea",shadow:"0 2px 4px rgba(102, 126, 234, 0.3)"},info:{emoji:"ℹ️",label:"INFO",background:"linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)",color:"#ffffff",border:"1px solid #74b9ff",shadow:"0 2px 4px rgba(116, 185, 255, 0.3)"},warn:{emoji:"⚠️",label:"WARN",background:"linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)",color:"#2d3436",border:"1px solid #fdcb6e",shadow:"0 2px 4px rgba(253, 203, 110, 0.3)"},error:{emoji:"❌",label:"ERROR",background:"linear-gradient(135deg, #e84393 0%, #d63031 100%)",color:"#ffffff",border:"1px solid #e84393",shadow:"0 2px 4px rgba(232, 67, 147, 0.3)"},success:{emoji:"✅",label:"SUCCESS",background:"linear-gradient(135deg, #00b894 0%, #00a085 100%)",color:"#ffffff",border:"1px solid #00b894",shadow:"0 2px 4px rgba(0, 184, 148, 0.3)"},critical:{emoji:"🔥",label:"CRITICAL",background:"linear-gradient(135deg, #ff3838 0%, #ff1744 100%)",color:"#ffffff",border:"2px solid #ff3838",shadow:"0 4px 8px rgba(255, 56, 56, 0.5)"}},dark:{debug:{emoji:"🌙",label:"DEBUG",background:"linear-gradient(135deg, #2d3748 0%, #4a5568 100%)",color:"#e2e8f0",border:"1px solid #4a5568",shadow:"0 2px 4px rgba(45, 55, 72, 0.8)"},info:{emoji:"💡",label:"INFO",background:"linear-gradient(135deg, #1a202c 0%, #2d3748 100%)",color:"#90cdf4",border:"1px solid #3182ce",shadow:"0 2px 4px rgba(26, 32, 44, 0.8)"},warn:{emoji:"⚡",label:"WARN",background:"linear-gradient(135deg, #744210 0%, #975a16 100%)",color:"#faf089",border:"1px solid #d69e2e",shadow:"0 2px 4px rgba(116, 66, 16, 0.8)"},error:{emoji:"💀",label:"ERROR",background:"linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)",color:"#feb2b2",border:"1px solid #e53e3e",shadow:"0 2px 4px rgba(116, 42, 42, 0.8)"},success:{emoji:"🎯",label:"SUCCESS",background:"linear-gradient(135deg, #276749 0%, #2f855a 100%)",color:"#9ae6b4",border:"1px solid #38a169",shadow:"0 2px 4px rgba(39, 103, 73, 0.8)"},critical:{emoji:"💥",label:"CRITICAL",background:"linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)",color:"#ffffff",border:"2px solid #ff0000",shadow:"0 4px 8px rgba(255, 0, 0, 0.9)"}},neon:{debug:{emoji:"⚡",label:"DEBUG",background:"linear-gradient(135deg, #0f3460 0%, #e94560 100%)",color:"#00ffff",border:"1px solid #00ffff",shadow:"0 0 10px rgba(0, 255, 255, 0.5)"},info:{emoji:"🔮",label:"INFO",background:"linear-gradient(135deg, #16213e 0%, #0f3460 100%)",color:"#00ff41",border:"1px solid #00ff41",shadow:"0 0 10px rgba(0, 255, 65, 0.5)"},warn:{emoji:"⚠️",label:"WARN",background:"linear-gradient(135deg, #533a03 0%, #e94560 100%)",color:"#ffff00",border:"1px solid #ffff00",shadow:"0 0 10px rgba(255, 255, 0, 0.5)"},error:{emoji:"💥",label:"ERROR",background:"linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)",color:"#ff073a",border:"1px solid #ff073a",shadow:"0 0 10px rgba(255, 7, 58, 0.8)"},success:{emoji:"✨",label:"SUCCESS",background:"linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)",color:"#39ff14",border:"1px solid #39ff14",shadow:"0 0 10px rgba(57, 255, 20, 0.8)"},critical:{emoji:"🌟",label:"CRITICAL",background:"linear-gradient(135deg, #000000 0%, #ff0080 100%)",color:"#ff0080",border:"2px solid #ff0080",shadow:"0 0 20px rgba(255, 0, 128, 1)"}},minimal:{debug:{emoji:"",label:"DEBUG",background:"#f7fafc",color:"#4a5568",border:"1px solid #e2e8f0",shadow:"none"},info:{emoji:"",label:"INFO",background:"#ebf8ff",color:"#2b6cb0",border:"1px solid #bee3f8",shadow:"none"},warn:{emoji:"",label:"WARN",background:"#fffbf0",color:"#c05621",border:"1px solid #fed7aa",shadow:"none"},error:{emoji:"",label:"ERROR",background:"#fef5f5",color:"#c53030",border:"1px solid #fca5a5",shadow:"none"},success:{emoji:"",label:"SUCCESS",background:"#f0fff4",color:"#2f855a",border:"1px solid #9ae6b4",shadow:"none"},critical:{emoji:"",label:"CRITICAL",background:"#fef5f5",color:"#e53e3e",border:"2px solid #f56565",shadow:"none"}},light:{debug:{emoji:"🔍",label:"DEBUG",background:"linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)",color:"#1565c0",border:"1px solid #90caf9",shadow:"0 1px 3px rgba(33, 150, 243, 0.2)"},info:{emoji:"ℹ️",label:"INFO",background:"linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)",color:"#7b1fa2",border:"1px solid #ce93d8",shadow:"0 1px 3px rgba(156, 39, 176, 0.2)"},warn:{emoji:"⚠️",label:"WARN",background:"linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)",color:"#f57c00",border:"1px solid #ffcc02",shadow:"0 1px 3px rgba(255, 152, 0, 0.2)"},error:{emoji:"❌",label:"ERROR",background:"linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)",color:"#d32f2f",border:"1px solid #f44336",shadow:"0 1px 3px rgba(244, 67, 54, 0.2)"},success:{emoji:"✅",label:"SUCCESS",background:"linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)",color:"#388e3c",border:"1px solid #4caf50",shadow:"0 1px 3px rgba(76, 175, 80, 0.2)"},critical:{emoji:"🚨",label:"CRITICAL",background:"linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)",color:"#c2185b",border:"2px solid #e91e63",shadow:"0 2px 6px rgba(233, 30, 99, 0.3)"}},cyberpunk:{debug:{emoji:"🤖",label:"DEBUG",background:"linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)",color:"#00d4aa",border:"1px solid #00d4aa",shadow:"0 0 15px rgba(0, 212, 170, 0.4)"},info:{emoji:"🔗",label:"INFO",background:"linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)",color:"#00b4d8",border:"1px solid #00b4d8",shadow:"0 0 15px rgba(0, 180, 216, 0.4)"},warn:{emoji:"⚡",label:"WARN",background:"linear-gradient(135deg, #f72585 0%, #b5179e 100%)",color:"#ffff3f",border:"1px solid #ffff3f",shadow:"0 0 15px rgba(255, 255, 63, 0.4)"},error:{emoji:"💀",label:"ERROR",background:"linear-gradient(135deg, #7209b7 0%, #480ca8 100%)",color:"#ff006e",border:"1px solid #ff006e",shadow:"0 0 15px rgba(255, 0, 110, 0.6)"},success:{emoji:"⚡",label:"SUCCESS",background:"linear-gradient(135deg, #003566 0%, #001d3d 100%)",color:"#00f5ff",border:"1px solid #00f5ff",shadow:"0 0 15px rgba(0, 245, 255, 0.4)"},critical:{emoji:"💥",label:"CRITICAL",background:"linear-gradient(135deg, #000000 0%, #ff0040 100%)",color:"#ff0040",border:"2px solid #ff0040",shadow:"0 0 25px rgba(255, 0, 64, 0.8)"}}},s={simple:{text:"🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀",style:"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;"},ascii:{text:"\n ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____ \n / _ \\ / __ \\| | / / / _ \\ | \\ | |/ ____| ____| _ \\ | | / _ \\ / ____| ___| _ | _ \\ \n / /_\\ \\ / / _` | |/ / / /_\\ \\ | \\| | | | |__ | | | | | | / / \\ \\| | __| |_ | |_| | |_) |\n | _ || | (_| | < | _ | | . ` | | | __| | | | | | | | | | | | |_ | _| | /| _ < \n | | | |\\ \\__,_|_|\\_\\ | | | | | |\\ | |___| |____| |_| | | |__\\ \\_/ /| |__| | |___| |\\ \\| |_) |\n \\_| |_/ \\____/ \\_| |_/ |_| \\_|\\_____|______|____/ |_____/\\___/ \\_____|_____|_| \\_|____/\n\n Advanced Logger v2.0.0 - Console Excellence",style:'font-family: "Courier New", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;'},unicode:{text:"\n╔══════════════════════════════════════════════════════════════════════════╗\n║ 🚀 ADVANCED LOGGER v2.0.0 ║\n║ State-of-the-art Console Styling ║ \n╚══════════════════════════════════════════════════════════════════════════╝",style:'font-family: "Courier New", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;'},svg:{text:" ",style:"\n background-image: url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>🚀 ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>\");\n background-repeat: no-repeat;\n background-size: 400px 80px;\n padding: 40px 200px;\n color: transparent;\n display: inline-block;\n border-radius: 8px;\n "},animated:{text:" 🚀 ADVANCED LOGGER v2.0.0 ",style:"\n background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);\n background-size: 400% 400%;\n color: white;\n padding: 15px 25px;\n border-radius: 10px;\n font-weight: bold;\n font-size: 14px;\n font-family: monospace;\n animation: gradientShift 3s ease infinite;\n display: inline-block;\n "}},i={default:{simple:"🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀",style:"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;"},dark:{simple:"🌙 ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence 🌙",style:"background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;"},neon:{simple:"⚡ ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience ⚡",style:"background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;"},minimal:{simple:"ADVANCED LOGGER v2.0.0 - Clean Console Styling",style:"background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;"},light:{simple:"☀️ ADVANCED LOGGER v2.0.0 - Bright Console Styling ☀️",style:"background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;"},cyberpunk:{simple:"🤖 ADVANCED LOGGER v2.0.0 - Neural Console Interface 🤖",style:"background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;"}};function displayInitBanner(e){const t=e||function(){const e=navigator.userAgent,t=/Chrome/.test(e),r=/Firefox/.test(e),o=/Safari/.test(e)&&!/Chrome/.test(e),s=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;return"undefined"!=typeof document&&"animationName"in document.createElement("div").style&&t?"animated":s&&(t||r)?"svg":t||r?"unicode":o?"ascii":"simple"}(),r=s[t];if("animated"===t){const e=document.createElement("style");e.textContent="\n @keyframes gradientShift {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n ",document.head.appendChild(e)}console.log(`%c${r.text}`,r.style),console.group("%c✨ Features","background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;"),["🎨 Advanced CSS Console Styling","📍 Automatic Stack Trace Parsing","🔧 Scoped Loggers & Prefixes","⚡ Performance Timers","🎯 Verbosity Filtering","🔌 Extensible Handlers","📱 Modern TypeScript Patterns","📤 Export & Clipboard Support"].forEach(e=>{console.log(`%c${e}`,"color: #6c757d; font-size: 13px;")}),console.groupEnd(),console.log("")}class BaseStyler{builder;constructor(t=new e.StyleBuilder){this.builder=t}primary(){return this.color("#007bff")}secondary(){return this.color("#6c757d")}accent(){return this.color("#17a2b8")}muted(){return this.color(e.getAdaptiveColor({light:"#6c757d",dark:"#a0aec0"}))}success(){return this.color("#28a745")}warning(){return this.color("#ffc107")}danger(){return this.color("#dc3545")}mono(){return this.builder.font('Monaco, Consolas, "Courier New", monospace'),this}system(){return this.builder.font('system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'),this}readable(){return this.builder.font('Georgia, "Times New Roman", serif'),this}compact(){return this.builder.padding("1px 4px").margin("0 1px"),this}spacious(){return this.builder.padding("6px 12px").margin("2px 4px"),this}inline(){return this.builder.display("inline-block"),this}glassmorphic(){return this.builder.css("backdrop-filter","blur(10px)").css("background","rgba(255, 255, 255, 0.1)").border("1px solid rgba(255, 255, 255, 0.2)").rounded("8px"),this}neon(){const e="#00ffff";return this.builder.color(e).border(`1px solid ${e}`).shadow(`0 0 10px ${e}, 0 0 20px ${e}`).css("text-shadow",`0 0 5px ${e}`),this}gradient(e="#667eea",t="#764ba2"){return this.builder.bg(`linear-gradient(135deg, ${e} 0%, ${t} 100%)`),this}bold(){return this.builder.bold(),this}color(e){return this.builder.color(e),this}build(){return this.builder.build()}}class TimestampStyler extends BaseStyler{default(){return this.muted().mono(),this.builder.size("11px"),this}hidden(){return this.builder.display("none"),this}minimal(){return this.muted().mono(),this.builder.size("10px").opacity(.7),this}size(e){return this.builder.size(e),this}}class LevelStyler extends BaseStyler{badge(){return this.builder.padding("2px 8px").rounded("4px").bold().color("#ffffff"),this}glowing(){return this.neon().badge()}flat(){return this.builder.padding("1px 6px").rounded("2px").border("1px solid currentColor").css("background","transparent"),this}uppercase(){return this.builder.uppercase(),this}}class PrefixStyler extends BaseStyler{dark(){return this.builder.bg(e.getAdaptiveColor({light:"#2d3748",dark:"#4a5568"})).color(e.getAdaptiveColor({light:"#e2e8f0",dark:"#f7fafc"})).padding("2px 6px").rounded("3px").bold().mono().size("11px"),this}light(){return this.builder.bg("#f8f9fa").color("#495057").padding("2px 6px").rounded("3px").bold().mono().size("11px").border("1px solid #dee2e6"),this}compact(){return this.builder.padding("1px 4px").size("10px").rounded("2px"),this}}class MessageStyler extends BaseStyler{readable(){return this.builder.color(e.getAdaptiveColor(e.ADAPTIVE_COLORS.messageText)).system().size("14px"),this}code(){return this.builder.mono().size("13px").color(e.getAdaptiveColor(e.ADAPTIVE_COLORS.messageText)).bg("rgba(0, 0, 0, 0.05)").padding("1px 4px").rounded("3px"),this}large(){return this.builder.size("16px").color(e.getAdaptiveColor(e.ADAPTIVE_COLORS.messageText)),this}}class LocationStyler extends BaseStyler{subtle(){return this.builder.color(e.getAdaptiveColor(e.ADAPTIVE_COLORS.location)).mono().size("11px").opacity(.7),this}hidden(){return this.builder.display("none"),this}clickable(){return this.subtle(),this.builder.css("text-decoration","underline").cursor("pointer"),this}}class LogStyleBuilder{logStyles={};logger;constructor(e){this.logger=e}timestamp(){return new TimestampStyleBuilderProxy(this)}level(){return new LevelStyleBuilderProxy(this)}prefix(){return new PrefixStyleBuilderProxy(this)}message(){return new MessageStyleBuilderProxy(this)}location(){return new LocationStyleBuilderProxy(this)}usePreset(e){return console.warn(`Preset '${e}' will be available in next implementation phase`),this}customize(e){return this.logStyles={...this.logStyles,...e},this}spacing(e){switch(this.logStyles.layout?this.logStyles.layout.spacing=e:this.logStyles.layout={spacing:e},e){case"compact":this.logStyles.layout.innerPadding="1px",this.logStyles.layout.outerMargin="0px";break;case"spacious":this.logStyles.layout.innerPadding="4px",this.logStyles.layout.outerMargin="2px";break;default:this.logStyles.layout.innerPadding="2px",this.logStyles.layout.outerMargin="1px"}return this}backdrop(e){return this.logStyles.backdrop=e,this}transparency(e){return this.logStyles.transparency=Math.max(0,Math.min(1,e)),this}apply(){this.logger._customLogStyles=this.logStyles,console.log("Applied log styles:",this.logStyles)}getConfig(){return{...this.logStyles}}_updatePartConfig(e,t){"layout"!==e&&"backdrop"!==e&&"transparency"!==e&&(this.logStyles[e]||(this.logStyles[e]={}),this.logStyles[e].style=t)}}class PartStyleBuilderProxy{parentBuilder;partName;constructor(e,t){this.parentBuilder=e,this.partName=t}and(){return this.parentBuilder}apply(){this.parentBuilder.apply()}applyStyles(e){const t=e.build();return this.parentBuilder._updatePartConfig(this.partName,t),this}}class TimestampStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"timestamp")}default(){return this.applyStyles((new TimestampStyler).default())}hidden(){return this.applyStyles((new TimestampStyler).hidden())}minimal(){return this.applyStyles((new TimestampStyler).minimal())}muted(){return this.applyStyles((new TimestampStyler).muted())}mono(){return this.applyStyles((new TimestampStyler).mono())}compact(){return this.applyStyles((new TimestampStyler).compact())}}class LevelStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"level")}badge(){return this.applyStyles((new LevelStyler).badge())}gradient(e,t){return this.applyStyles((new LevelStyler).gradient(e,t))}glowing(){return this.applyStyles((new LevelStyler).glowing())}flat(){return this.applyStyles((new LevelStyler).flat())}bold(){return this.applyStyles((new LevelStyler).bold())}uppercase(){return this.applyStyles((new LevelStyler).uppercase())}neon(){return this.applyStyles((new LevelStyler).neon())}}class PrefixStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"prefix")}dark(){return this.applyStyles((new PrefixStyler).dark())}light(){return this.applyStyles((new PrefixStyler).light())}compact(){return this.applyStyles((new PrefixStyler).compact())}muted(){return this.applyStyles((new PrefixStyler).muted())}mono(){return this.applyStyles((new PrefixStyler).mono())}}class MessageStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"message")}readable(){return this.applyStyles((new MessageStyler).readable())}code(){return this.applyStyles((new MessageStyler).code())}large(){return this.applyStyles((new MessageStyler).large())}system(){return this.applyStyles((new MessageStyler).system())}mono(){return this.applyStyles((new MessageStyler).mono())}}class LocationStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"location")}subtle(){return this.applyStyles((new LocationStyler).subtle())}hidden(){return this.applyStyles((new LocationStyler).hidden())}clickable(){return this.applyStyles((new LocationStyler).clickable())}muted(){return this.applyStyles((new LocationStyler).muted())}mono(){return this.applyStyles((new LocationStyler).mono())}}const n={default:{layout:{spacing:"normal",innerPadding:"2px",outerMargin:"1px"},timestamp:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"11px"},level:{show:!0,style:"badge",uppercase:!1,padding:"2px 8px"},prefix:{show:!0,style:"dark",padding:"2px 6px"},message:{show:!0,color:"auto",font:"system-ui, -apple-system, sans-serif",size:"14px"},location:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"11px"}},cyberpunk:{layout:{spacing:"compact",innerPadding:"1px",outerMargin:"0px"},timestamp:{show:!0,color:"#00ffff",font:"Monaco, Consolas, monospace",size:"10px",style:"neon"},level:{show:!0,style:"glowing",uppercase:!0,padding:"2px 8px"},prefix:{show:!0,color:"#ff0080",background:"rgba(255, 0, 128, 0.1)",border:"1px solid #ff0080",style:"neon"},message:{show:!0,color:"#00ff41",font:"Monaco, Consolas, monospace",size:"13px"},location:{show:!1},backdrop:"blur(2px)",transparency:.9},glassmorphism:{layout:{spacing:"spacious",innerPadding:"4px",outerMargin:"2px"},timestamp:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"11px",style:"glassmorphic"},level:{show:!0,style:"glassmorphic",uppercase:!1,padding:"4px 12px"},prefix:{show:!0,style:"glassmorphic",padding:"3px 8px"},message:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"14px"},location:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"11px",style:"glassmorphic"},backdrop:"blur(10px)",transparency:.8},minimal:{layout:{spacing:"compact",innerPadding:"0px",outerMargin:"0px"},timestamp:{show:!1},level:{show:!0,style:"flat",uppercase:!0,padding:"0px 4px",border:"none",background:"transparent"},prefix:{show:!0,style:"flat",padding:"0px 4px",border:"none",background:"transparent"},message:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"14px"},location:{show:!1}},debug:{layout:{spacing:"compact",innerPadding:"1px",outerMargin:"0px"},timestamp:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"10px"},level:{show:!0,style:"compact",uppercase:!0,padding:"1px 4px",font:"Monaco, Consolas, monospace",size:"10px"},prefix:{show:!0,style:"compact",padding:"1px 4px",font:"Monaco, Consolas, monospace",size:"10px"},message:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"12px"},location:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"10px",style:"clickable"}},production:{layout:{spacing:"normal",innerPadding:"2px",outerMargin:"1px"},timestamp:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"11px"},level:{show:!0,style:"badge",uppercase:!1,padding:"2px 6px"},prefix:{show:!1},message:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"14px"},location:{show:!1}}};function getAvailablePresets(){return Object.keys(n)}function hasPreset(e){return e in n}class ScopedLogger{parent;scopeName;badgeList=[];contextStack=[];_timers;constructor(e,t){this.parent=e,this.scopeName=t}get timers(){return this._timers||(this._timers=/* @__PURE__ */new Map),this._timers}getBindings(){return{scope:this.getScopePrefix(),badges:this.badgeList.length>0?[...this.badgeList]:void 0}}getScopePrefix(){return 0===this.contextStack.length?this.scopeName:[this.scopeName,...this.contextStack].join(":")}badges(e){return this.badgeList=[...e],this}badge(e){return this.badgeList.includes(e)||this.badgeList.push(e),this}clearBadges(){return this.badgeList=[],this}style(e){return this.parent.setTheme(e),this}context(e){return new ContextLogger(this,e)}time(e){this.timers.set(e,{label:`${this.scopeName}:${e}`,startTime:performance.now()})}timeEnd(e){const t=this.timers.get(e);if(!t)return void this.warn(`Timer '${e}' not found`);const r=performance.now()-t.startTime;return this.timers.delete(e),this.success(`Timer: ${e} - ${r.toFixed(2)}ms`),r}debug(...e){this.parent.logWithBindings(this.getBindings(),"debug",...e)}info(...e){this.parent.logWithBindings(this.getBindings(),"info",...e)}warn(...e){this.parent.logWithBindings(this.getBindings(),"warn",...e)}error(...e){this.parent.logWithBindings(this.getBindings(),"error",...e)}success(...e){const t=this.getBindings();this.parent.logWithBindings(t,"info",...e)}critical(...e){this.parent.logWithBindings(this.getBindings(),"critical",...e)}trace(...e){this.parent.logWithBindings(this.getBindings(),"debug",...e),console.trace(`[${this.scopeName}]`)}_pushContext(e){this.contextStack.push(e)}_popContext(){this.contextStack.pop()}}class APILogger extends ScopedLogger{constructor(e,t){super(e,`API:${t}`),this.badge("API")}slow(e,t){this.badge("SLOW");const r=t?`${e} (${t}ms)`:e;this.warn(r)}rateLimit(e){this.badge("RATE_LIMIT"),this.warn(e)}auth(e){this.badge("AUTH"),this.error(e)}deprecated(e){this.badge("DEPRECATED"),this.warn(e)}}class ComponentLogger extends ScopedLogger{constructor(e,t){super(e,t),this.badge("COMPONENT")}lifecycle(e,t){this.badge("LIFECYCLE");const r=t?`${e}: ${t}`:e;this.info(r)}stateChange(e,t,r){this.badge("STATE");const o=`${e} → ${t}`;r?this.info(o,r):this.info(o)}propsChange(e){this.badge("PROPS"),this.debug("Props changed:",e)}}class ContextLogger{parentLogger;contextName;constructor(e,t){this.parentLogger=e,this.contextName=t}run(e){this.parentLogger._pushContext(this.contextName);try{return e()}finally{this.parentLogger._popContext()}}async runAsync(e){this.parentLogger._pushContext(this.contextName);try{return await e()}finally{this.parentLogger._popContext()}}start(){this.parentLogger._pushContext(this.contextName)}end(){this.parentLogger._popContext()}debug(...e){this.parentLogger.debug(...e)}info(...e){this.parentLogger.info(...e)}warn(...e){this.parentLogger.warn(...e)}error(...e){this.parentLogger.error(...e)}success(...e){this.parentLogger.success(...e)}critical(...e){this.parentLogger.critical(...e)}}class ExportLogHandler{buffer=[];maxSize;groupDepth=0;currentGroup;constructor(t=e.BUFFER_LIMITS.DEFAULT_SIZE){this.maxSize=Math.min(Math.max(t,e.BUFFER_LIMITS.MIN_SIZE),e.BUFFER_LIMITS.MAX_SIZE)}handle(t,r,o,s){const i={id:e.generateLogId(),timestamp:s.timestamp,level:t,prefix:s.prefix,message:r,args:o,location:s.stackInfo,groupInfo:this.groupDepth>0?{depth:this.groupDepth,groupName:this.currentGroup}:void 0};this.buffer.push(i),this.buffer.length>this.maxSize&&this.buffer.shift()}setGroupInfo(e,t){this.groupDepth=e,this.currentGroup=t}getBufferStats(){const e=this.buffer.reduce((e,t)=>{const r=e[t.level]?e[t.level]:0;return e[t.level]=r+1,e},{});let t,r;if(this.buffer.length>0){const e=this.buffer[0],o=this.buffer[this.buffer.length-1];e&&e.timestamp&&(t=new Date(e.timestamp)),o&&o.timestamp&&(r=new Date(o.timestamp))}return{size:this.buffer.length,maxSize:this.maxSize,usage:this.buffer.length/this.maxSize*100,oldestLog:t,newestLog:r,levelCounts:{debug:e.debug?e.debug:0,info:e.info?e.info:0,warn:e.warn?e.warn:0,error:e.error?e.error:0,critical:e.critical?e.critical:0}}}clearBuffer(){this.buffer=[]}setBufferSize(t){this.maxSize=Math.min(Math.max(t,e.BUFFER_LIMITS.MIN_SIZE),e.BUFFER_LIMITS.MAX_SIZE),this.buffer.length>this.maxSize&&(this.buffer=this.buffer.slice(-this.maxSize))}filterLogs(t={}){let r=[...this.buffer];if(t.levels?.length&&(r=r.filter(e=>t.levels.includes(e.level))),t.prefixes?.length&&(r=r.filter(e=>e.prefix&&t.prefixes.includes(e.prefix))),t.excludePrefixes?.length&&(r=r.filter(e=>!e.prefix||!t.excludePrefixes.includes(e.prefix))),t.since){const o=e.parseTimeInput(t.since);r=r.filter(e=>new Date(e.timestamp)>=o)}if(t.until){const o=e.parseTimeInput(t.until);r=r.filter(e=>new Date(e.timestamp)<=o)}if(t.withStackTrace&&(r=r.filter(e=>e.location)),t.errorsOnly&&(r=r.filter(e=>"error"===e.level||"critical"===e.level)),t.search){const e=t.search.toLowerCase();r=r.filter(t=>t.message.toLowerCase().includes(e)||t.args.some(t=>String(t).toLowerCase().includes(e)))}return t.last&&(r=r.slice(-t.last)),t.first&&(r=r.slice(0,t.first)),r}exportJSON(e,t){const r=e.map(e=>({timestamp:e.timestamp,level:e.level,prefix:e.prefix,message:e.message,...t.minimal?{}:{args:e.args.slice(1),location:e.location,groupInfo:e.groupInfo}}));return t.compact?JSON.stringify(r):JSON.stringify(r,null,2)}exportCSV(t,r){const o=r.minimal?["Timestamp","Level","Prefix","Message"]:["Timestamp","Level","Prefix","Message","File","Line","Args"],s=t.map(t=>{const o=[e.formatDisplayTime(new Date(t.timestamp),"full"),t.level.toUpperCase(),t.prefix||"",`"${t.message.replace(/"/g,'""')}"`];return r.minimal||o.push(t.location?.file||"",t.location?.line?.toString()||"",`"${e.safeStringify(t.args.slice(1)).replace(/"/g,'""')}"`),o});return[o.join(","),...s.map(e=>e.join(","))].join("\n")}exportMarkdown(t,r){const o=/* @__PURE__ */new Date;let s=`# Log Export - ${e.formatDisplayTime(o,"full")}\n\n`;if(!r.minimal){const e=this.getBufferStats();s+="## Summary\n",s+=`- **Total logs**: ${t.length}\n`,s+=`- **Errors**: ${e.levelCounts.error+e.levelCounts.critical}\n`,s+=`- **Warnings**: ${e.levelCounts.warn}\n\n`}if("level"===r.groupBy){const r=t.reduce((e,t)=>{const r=t.level;e[r]||(e[r]=[]);const o=e[r];return o&&o.push(t),e},{});Object.entries(r).forEach(([t,r])=>{const o=this.getLevelEmoji(t);s+=`## ${o} ${t.toUpperCase()} (${r.length})\n\n`,r.forEach(t=>{const r=e.formatDisplayTime(new Date(t.timestamp),"time-only"),o=t.location?` (${t.location.file}:${t.location.line})`:"",i=t.prefix?` **${t.prefix}**:`:"";s+=`- \`${r}\`${i} ${t.message}${o}\n`}),s+="\n"})}else s+="## Logs\n\n",t.forEach(t=>{const r=e.formatDisplayTime(new Date(t.timestamp),"time-only"),o=this.getLevelEmoji(t.level),i=t.location?` (${t.location.file}:${t.location.line})`:"",n=t.prefix?` **${t.prefix}**:`:"";s+=`- \`${r}\` ${o}${n} ${t.message}${i}\n`});return s}exportPlain(t,r){return t.map(t=>{const o=e.formatDisplayTime(new Date(t.timestamp),r.minimal?"time-only":"short"),s=t.level.toUpperCase().padEnd(8),i=t.prefix?`[${t.prefix}] `:"",n=!r.minimal&&t.location?` (${t.location.file}:${t.location.line})`:"";return`${o} ${s} ${i}${t.message}${n}`}).join("\n")}exportHTML(t,r){const o=`Log Export - ${e.formatDisplayTime(/* @__PURE__ */new Date,"full")}`;let s=`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>${o}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 20px; line-height: 1.6; }\n .header { border-bottom: 2px solid #ddd; padding-bottom: 20px; margin-bottom: 20px; }\n .log-entry { margin: 5px 0; padding: 8px; border-radius: 4px; font-family: 'Monaco', 'Consolas', monospace; }\n .timestamp { color: #666; font-size: 0.9em; }\n .level { font-weight: bold; padding: 2px 6px; border-radius: 3px; margin: 0 8px; }\n .prefix { background: #2d3748; color: #e2e8f0; padding: 2px 6px; border-radius: 3px; margin: 0 8px; }\n .location { color: #718096; font-size: 0.9em; }\n .debug { background: #f0f4ff; }\n .info { background: #f0f9ff; }\n .warn { background: #fffbeb; }\n .error { background: #fef2f2; }\n .critical { background: #fef2f2; border-left: 4px solid #dc2626; }\n .level.debug { background: #667eea; color: white; }\n .level.info { background: #74b9ff; color: white; }\n .level.warn { background: #fdcb6e; color: #2d3436; }\n .level.error { background: #e84393; color: white; }\n .level.critical { background: #ff3838; color: white; }\n </style>\n</head>\n<body>\n <div class="header">\n <h1>${o}</h1>\n <p>Generated by Advanced Logger v2.0.0</p>\n </div>\n <div class="logs">`;return t.forEach(t=>{const r=e.formatDisplayTime(new Date(t.timestamp),"full"),o=t.location?` <span class="location">(${e.escapeHtml(t.location.file)}:${t.location.line})</span>`:"",i=t.prefix?` <span class="prefix">${e.escapeHtml(t.prefix)}</span>`:"";s+=`\n <div class="log-entry ${t.level}">\n <span class="timestamp">${r}</span>\n <span class="level ${t.level}">${t.level.toUpperCase()}</span>\n ${i}\n <span class="message">${e.escapeHtml(t.message)}</span>\n ${o}\n </div>`}),s+="\n </div>\n</body>\n</html>",s}getLevelEmoji(e){return{debug:"🐞",info:"ℹ️",warn:"⚠️",error:"❌",critical:"🔥"}[e]||""}export(e,t={},r={}){const o=this.filterLogs(t);let s;switch(e){case"json":s=this.exportJSON(o,r);break;case"csv":s=this.exportCSV(o,r);break;case"markdown":s=this.exportMarkdown(o,r);break;case"plain":s=this.exportPlain(o,r);break;case"html":s=this.exportHTML(o,r);break;default:throw new Error(`Unsupported export format: ${e}`)}return{format:e,data:s,metadata:{totalLogs:this.buffer.length,filteredLogs:o.length,exportedAt:/* @__PURE__ */(new Date).toISOString(),filters:t,options:r}}}async copyToClipboard(e,t={},r={}){const o=this.export(e,t,r);try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(o.data),!0;{const e=document.createElement("textarea");e.value=o.data,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.focus(),e.select();const t=document.execCommand("copy");return document.body.removeChild(e),t}}catch(s){return console.error("Failed to copy to clipboard:",s),!1}}getAllLogs(){return[...this.buffer]}async saveToFile(e,t={},r={}){try{const o=this.export(e,t,r),s=new Blob([o.data],{type:this.getMimeType(e)}),i=URL.createObjectURL(s),n=document.createElement("a"),a=this.generateFilename(e,t);return n.href=i,n.download=a,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(i),!0}catch(o){return console.error("Failed to save file:",o),!1}}getMimeType(e){return{json:"application/json",csv:"text/csv",markdown:"text/markdown",plain:"text/plain",html:"text/html"}[e]||"text/plain"}generateFilename(e,t){const r=/* @__PURE__ */(new Date).toISOString().replace(/[:.]/g,"-").slice(0,-5);return`logs${1===t.prefixes?.length?`_${t.prefixes[0]}`:""}_${r}.${"markdown"===e?"md":e}`}async streamToEndpoint(e,t={},r={}){try{const o=this.filterLogs(t),s=r.batchSize||100,i=r.format||"json";for(let t=0;t<o.length;t+=s){const n=o.slice(t,t+s),a=(this.export(i,{},{compact:!0}),{"Content-Type":"application/json"});r.apiKey&&(a.Authorization=`Bearer ${r.apiKey}`);const l=await fetch(e,{method:"POST",headers:a,body:JSON.stringify({logs:n,metadata:{batchIndex:Math.floor(t/s),totalBatches:Math.ceil(o.length/s),timestamp:/* @__PURE__ */(new Date).toISOString()}})});if(!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`)}return!0}catch(o){return console.error("Failed to stream logs:",o),!1}}exportWithMetadata(e,t={},r={}){const o=this.export(e,t,r),s=this.getBufferStats();return{...o,metadata:{...o.metadata,bufferStats:s,performance:{memoryUsage:this.estimateMemoryUsage(),processingTime:Date.now()},system:{userAgent:"undefined"!=typeof navigator?navigator.userAgent:"Node.js",timestamp:/* @__PURE__ */(new Date).toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}}}estimateMemoryUsage(){const e=this.buffer[0];return e?JSON.stringify(e).length*this.buffer.length:0}}class CommandProcessor{commands=/* @__PURE__ */new Map;aliases=/* @__PURE__ */new Map;plugins=/* @__PURE__ */new Map;history=[];maxHistorySize=100;isInteractiveMode=!1;registerCommand(e){if(this.commands.set(e.name,e),e.aliases)for(const t of e.aliases)this.aliases.set(t,e.name)}registerPlugin(e,t){if(this.plugins.has(e.name))throw new Error(`Plugin ${e.name} is already registered`);this.plugins.set(e.name,e);for(const r of e.commands)this.registerCommand(r);e.initialize&&t&&e.initialize(this,t)}unregisterPlugin(e){const t=this.plugins.get(e);if(t){for(const e of t.commands)if(this.commands.delete(e.name),e.aliases)for(const t of e.aliases)this.aliases.delete(t);t.cleanup&&t.cleanup(),this.plugins.delete(e)}}getCommands(){return Array.from(this.commands.values())}getCommand(e){let t=this.commands.get(e);if(t)return t;const r=this.aliases.get(e);return r?this.commands.get(r):void 0}getHistory(){return[...this.history]}clearHistory(){this.history=[]}getPlugins(){return Array.from(this.plugins.values())}enterInteractiveMode(e){this.isInteractiveMode=!0,e.info("🔧 Interactive CLI mode activated. Type /exit to quit, /help for commands."),"undefined"!=typeof window&&this.setupBrowserInteractiveMode(e)}exitInteractiveMode(){this.isInteractiveMode=!1}setupBrowserInteractiveMode(e){window.cli=t=>this.processCommand(`/${t}`,e),e.info('💡 Use cli("command") to execute CLI commands in browser console.')}async processCommand(e,t){if(!e.startsWith("/"))return t.error("Invalid command. Commands must start with /"),void this.addToHistory(e,!1);const r=e.slice(1).split(" "),o=r[0]||"",s=r.slice(1).join(" "),i=this.getCommand(o);if(!i){t.error(`Unknown command: ${o}. Type /help for available commands.`);const r=this.getSuggestions(o);return r.length>0&&t.info(`📋 Did you mean: ${r.slice(0,3).join(", ")}?`),void this.addToHistory(e,!1)}try{await i.execute(s||"",t),this.addToHistory(e,!0)}catch(n){t.error(`Command '${o}' failed:`,n),this.addToHistory(e,!1)}}addToHistory(e,t){this.history.unshift({command:e,timestamp:/* @__PURE__ */new Date,success:t}),this.history.length>this.maxHistorySize&&(this.history=this.history.slice(0,this.maxHistorySize))}getSuggestions(e){return Array.from(this.commands.keys()).filter(t=>t.startsWith(e))}}class ConfigCommand{name="config";description="Show or update logger configuration";usage="/config [json|key=value,...]";execute(e,t){if(e)try{if(e.startsWith("{")){const r=JSON.parse(e);this.applyConfig(r,t)}else{const r=e.split(",").map(e=>e.trim().split("=")),o={};r.forEach(([e,t])=>{e&&t&&(o[e.trim()]=t.trim().replace(/["']/g,""))}),this.applyConfig(o,t)}}catch(r){t.error("Invalid config format. Use JSON or key=value pairs:",r),t.info('Examples: /config {"theme":"dark"} or /config theme=neon,verbosity=debug')}else this.showStatus(t)}showStatus(e){const t={theme:e.getConfig().theme||"default",verbosity:e.getConfig().verbosity,colors:e.getConfig().enableColors,timestamps:e.getConfig().enableTimestamps,stackTrace:e.getConfig().enableStackTrace,globalPrefix:e.getConfig().globalPrefix||"none",bannerType:e.getConfig().bannerType||"simple",handlers:e.getHandlers().length};e.group("⚙️ Logger Configuration"),e.table(t),e.groupEnd()}applyConfig(e,t){const r=["theme","verbosity","enableColors","enableTimestamps","enableStackTrace","globalPrefix","bannerType"],o=[];Object.entries(e).forEach(([e,s])=>{r.includes(e)?"theme"===e&&"string"==typeof s?(t.setTheme(s),o.push(`${e}=${s}`)):"bannerType"===e&&"string"==typeof s?(t.setBannerType(s),o.push(`${e}=${s}`)):"verbosity"===e?(t.setVerbosity(s),o.push(`${e}=${s}`)):"globalPrefix"===e?(t.setGlobalPrefix(s),o.push(`${e}=${s}`)):(t.updateConfig({[e]:s}),o.push(`${e}=${s}`)):t.warn(`Invalid config key: ${e}`)}),o.length>0&&t.success(`Configuration updated: ${o.join(", ")}`)}}class ThemesCommand{name="themes";description="Show available theme presets";usage="/themes";execute(t,r){r.group("🎨 Available Themes"),Object.keys(o).forEach(t=>{const r=o[t],s=(new e.StyleBuilder).bg(r.info.background).color(r.info.color).padding("4px 8px").rounded("4px").border(r.info.border).build();console.log(`%c${t}`,s,`- ${t} theme preview`)}),r.groupEnd()}}class BannersCommand{name="banners";description="Show available banner types";usage="/banners";execute(e,t){t.group("🖼️ Available Banner Types"),Object.keys(s).forEach(e=>{const t=s[e];console.log(`%c${e}`,"font-weight: bold; color: #667eea;"),console.log("%cPreview:","color: #666; font-size: 12px;"),"simple"===e?console.log(`%c${t.text}`,t.style):"ascii"===e?console.log(`%c${t.text.split("\n").slice(1,4).join("\n")}...`,"font-family: monospace; color: #667eea; font-size: 10px;"):"unicode"===e?console.log(`%c${t.text}`,t.style):console.log(`%c${e} banner`,"color: #666; font-style: italic;")}),t.groupEnd()}}class BannerCommand{name="banner";description="Change or show current banner type";usage="/banner [type]";execute(e,t){e?e in s?(t.setBannerType(e),t.showBanner()):t.error(`Invalid banner type: ${e}. Available: ${Object.keys(s).join(", ")}`):t.showBanner()}}class StatusCommand{name="status";description="Show current logger status and configuration";usage="/status";execute(e,t){const r=t.getConfig(),o={theme:r.theme?r.theme:"default",verbosity:r.verbosity,colors:r.enableColors,timestamps:r.enableTimestamps,stackTrace:r.enableStackTrace,globalPrefix:r.globalPrefix?r.globalPrefix:"none",bannerType:r.bannerType?r.bannerType:"simple",handlers:t.getHandlers().length,bufferSize:r.bufferSize?r.bufferSize:1e3};t.group("⚙️ Logger Configuration"),t.table(o),t.groupEnd();const s=t.getExportHandler();if(s){const e=s.getBufferStats();t.group("📊 Buffer Statistics"),t.table({size:`${e.size}/${e.maxSize}`,usage:`${e.usage.toFixed(1)}%`,oldestLog:e.oldestLog?e.oldestLog.toISOString():"None",newestLog:e.newestLog?e.newestLog.toISOString():"None",errorCount:e.levelCounts.error+e.levelCounts.critical,warningCount:e.levelCounts.warn}),t.groupEnd()}}}class ResetCommand{name="reset";description="Reset logger configuration to defaults";usage="/reset";execute(e,t){t.resetConfig()}}class DemoCommand{name="demo";description="Show comprehensive feature demonstration";usage="/demo";execute(e,t){t.group("🎪 Advanced Logger Demo"),t.debug("Debug message with detailed information"),t.info("Informational message about system state"),t.warn("Warning about deprecated feature"),t.error("Error processing user request"),t.success("Operation completed successfully"),t.critical("Critical system failure detected"),t.group("📊 Advanced Features Demo"),t.table([{feature:"Styled Console",status:"✅ Active",performance:"Excellent"},{feature:"Theme System",status:"✅ Active",performance:"Great"},{feature:"CLI Interface",status:"✅ Active",performance:"Good"},{feature:"Export System",status:"✅ Active",performance:"Excellent"}]),t.time("demo-operation"),setTimeout(()=>{t.timeEnd("demo-operation")},100),t.logWithSVG("SVG Demo"),t.logAnimated("🌟 Animated Logger Demo 🌟",2),t.groupEnd(),t.groupEnd(),t.info("Demo completed! Check the console for styled output.")}}function parseArguments(t){const r={},o={};let s;if(!t.trim())return{filters:r,options:o};const i=t.match(/(?:[^\s"]+|"[^"]*")+/g)||[];for(let n=0;n<i.length;n++){const t=i[n];if(t)if(0!==n||t.startsWith("--")||!(t in e.EXPORT_FORMATS)){if(t.startsWith("--")){const[e,s]=t.slice(2).split("=");switch(e){case"level":case"levels":s&&(r.levels=s.split(",").map(e=>e.trim()));break;case"since":s&&(r.since=s);break;case"until":s&&(r.until=s);break;case"prefix":case"prefixes":s&&(r.prefixes=s.split(",").map(e=>e.trim()));break;case"exclude-prefix":case"exclude-prefixes":s&&(r.excludePrefixes=s.split(",").map(e=>e.trim()));break;case"last":s&&(r.last=parseInt(s,10));break;case"first":s&&(r.first=parseInt(s,10));break;case"search":s&&(r.search=s.replace(/['"]/g,""));break;case"with-stack":r.withStackTrace=!0;break;case"errors-only":r.errorsOnly=!0;break;case"group-by":s&&(r.groupBy=s,o.groupBy=s);break;case"minimal":o.minimal=!0;break;case"compact":o.compact=!0;break;case"styled":o.styled=!0}}}else s=t}return{filters:r,options:o,format:s}}class ExportCommand{name="export";description="Export logs to various formats";usage="/export <format> [--filter=value] [--option]";execute(t,r){const o=r.getExportHandler();if(!o)return void r.error("Export handler not available. Make sure ExportLogHandler is registered.");const{filters:s,options:i,format:n}=parseArguments(t);if(!n)return r.error("Format required. Available formats: "+Object.keys(e.EXPORT_FORMATS).join(", ")),r.info("Usage: /export <format> [--filter=value]"),void r.info("Example: /export json --level=error,warn --last=50");try{const e=o.export(n,s,i);r.success(`✅ Export completed: ${e.metadata.filteredLogs} logs exported in ${n} format`),e.data.length<1e3?(r.group(`📄 Preview (${n.toUpperCase()})`),console.log(e.data),r.groupEnd()):r.info(`📄 Export size: ${(e.data.length/1024).toFixed(2)}KB`),r.table({format:e.format,totalLogs:e.metadata.totalLogs,filtered:e.metadata.filteredLogs,exported:e.metadata.exportedAt})}catch(a){r.error("Export failed:",a)}}}class CopyCommand{name="copy";description="Copy logs to clipboard";usage="/copy <format> [--filter=value] [--option]";async execute(t,r){const o=r.getExportHandler();if(!o)return void r.error("Export handler not available. Make sure ExportLogHandler is registered.");const{filters:s,options:i,format:n}=parseArguments(t);if(!n)return r.error("Format required. Available formats: "+Object.keys(e.EXPORT_FORMATS).join(", ")),r.info("Usage: /copy <format> [--filter=value]"),void r.info("Example: /copy plain --level=error --last=25");try{if(await o.copyToClipboard(n,s,i)){const e=o.export(n,s,i);r.success(`📋 Copied ${e.metadata.filteredLogs} logs to clipboard (${n} format)`)}else r.error("Failed to copy to clipboard. Browser may not support clipboard API.")}catch(a){r.error("Copy failed:",a)}}}class BufferSizeCommand{name="buffer-size";description="Set log buffer size";usage="/buffer-size <size>";execute(e,t){const r=t.getExportHandler();if(!r)return void t.error("Export handler not available.");const o=parseInt(e.trim(),10);if(isNaN(o)||o<=0)return t.error("Invalid buffer size. Must be a positive number."),void t.info("Example: /buffer-size 2000");r.setBufferSize(o),t.success(`Buffer size set to ${o}`)}}class ClearBufferCommand{name="clear-buffer";description="Clear the log buffer";usage="/clear-buffer";execute(e,t){const r=t.getExportHandler();if(!r)return void t.error("Export handler not available.");const o=r.getBufferStats();r.clearBuffer(),t.success(`✅ Buffer cleared. Removed ${o.size} log entries.`)}}class BufferInfoCommand{name="buffer-info";description="Show buffer statistics and information";usage="/buffer-info";execute(e,t){const r=t.getExportHandler();if(!r)return void t.error("Export handler not available.");const o=r.getBufferStats();t.group("📊 Buffer Information"),t.table({size:`${o.size}/${o.maxSize}`,usage:`${o.usage.toFixed(1)}%`,oldestLog:o.oldestLog?.toLocaleString()||"None",newestLog:o.newestLog?.toLocaleString()||"None"}),t.group("📈 Log Level Counts"),t.table(o.levelCounts),t.groupEnd(),t.groupEnd()}}class HelpCommand{name="help";description="Show CLI help and available commands";usage="/help [command]";execute(t,r){const o=(new e.StyleBuilder).bg("linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%)").color("#495057").padding("15px 20px").rounded("8px").border("1px solid #dee2e6").font("Monaco, Consolas, monospace").size("13px").build();console.log('%c\n╭─────────────── ADVANCED LOGGER CLI COMMANDS ─────────────────╮\n│ │\n│ CONFIGURATION │\n│ /config Show current configuration │\n│ /config {json} Apply JSON configuration │\n│ /config key=val Apply key-value configuration │\n│ /themes Show available themes │\n│ /banners Show available banner types │\n│ /banner [type] Change/show banner type │\n│ /status Show logger status & buffer stats │\n│ /demo Show feature demonstration │\n│ /reset Reset to default configuration │\n│ │\n│ EXPORT & CLIPBOARD │\n│ /export <format> Export logs (json|csv|md|plain|html) │\n│ /copy <format> Copy logs to clipboard │\n│ /buffer-size N Set log buffer size │\n│ /buffer-info Show buffer statistics │\n│ /clear-buffer Clear stored logs │\n│ │\n│ EXPORT FILTERS (for export/copy commands) │\n│ --level error,warn Filter by log levels │\n│ --since 2h Logs from last 2 hours │\n│ --until 1h Logs until 1 hour ago │\n│ --prefix API,DB Filter by prefixes │\n│ --exclude-prefix INT Exclude prefixes │\n│ --last 50 Last 50 logs only │\n│ --first 25 First 25 logs only │\n│ --search "error" Search in log messages │\n│ --with-stack Only logs with stack traces │\n│ --errors-only Only error + critical logs │\n│ --group-by level Group by level/prefix/hour │\n│ │\n│ EXPORT OPTIONS │\n│ --minimal Minimal output format │\n│ --compact Remove extra whitespace │\n│ --styled Include styling (HTML format) │\n│ │\n├──────────────────── CONFIGURATION OPTIONS ─────────────────┤\n│ │\n│ theme: default | dark | light | neon | minimal | cyberpunk│\n│ bannerType: simple | ascii | unicode | svg | animated │\n│ verbosity: debug | info | warn | error | critical | silent│\n│ enableColors: true | false │\n│ enableTimestamps: true | false │\n│ enableStackTrace: true | false │\n│ globalPrefix: "string" │\n│ bufferSize: number (50-10000) │\n│ │\n├──────────────────────── EXAMPLES ──────────────────────────┤\n│ │\n│ Basic Configuration: │\n│ /config {"theme":"dark","verbosity":"debug"} │\n│ /config theme=neon,bufferSize=2000 │\n│ /banner animated Change to animated banner │\n│ │\n│ Export Examples: │\n│ /export json --level=error,warn --last=25 │\n│ /export csv --since=2h --prefix=API │\n│ /export markdown --group-by=level --errors-only │\n│ /export html --styled --since=1h │\n│ │\n│ Clipboard Examples: │\n│ /copy plain --minimal --last=10 │\n│ /copy json --search="authentication" --compact │\n│ /copy csv --since=30m --exclude-prefix=DEBUG │\n│ │\n│ Buffer Management: │\n│ /buffer-size 5000 Increase buffer to 5000 logs │\n│ /buffer-info Show detailed buffer statistics │\n│ /clear-buffer Clear all stored logs │\n│ │\n│ Time Formats: │\n│ --since=2h 2 hours ago │\n│ --since=30m 30 minutes ago │\n│ --since=1d 1 day ago │\n│ --since="2024-01-01T10:00:00Z" Specific ISO date │\n│ │\n╰─────────────────────────────────────────────────────────────╯',o),r.group("💡 Quick Tips"),["Use /demo to see all logger features in action","Logs are automatically stored in a circular buffer for export","Export formats: JSON (structured), CSV (Excel), Markdown (readable), Plain (simple), HTML (styled)","Time filters support relative (2h, 30m) and absolute (ISO) formats",'Combine multiple filters: /export json --level=error --since=1h --search="auth"',"Use /copy for quick clipboard access instead of /export"].forEach(e=>{r.info(`• ${e}`)}),r.groupEnd()}}class HistoryCommand{name="history";description="Show command execution history";usage="/history [limit] - Show recent commands (default: 10)";category="system";aliases=["hist","h"];execute(e,t){const r=t.cliProcessor;if(!r)return void t.error("CLI processor not available");const o=parseInt(e)||10,s=r.getHistory().slice(0,o);0!==s.length?(t.info(`📋 Last ${s.length} commands:`),s.forEach((e,r)=>{const o=e.success?"✅":"❌",s=e.timestamp.toLocaleTimeString();t.info(`${o} [${s}] ${e.command}`)})):t.info("📝 No command history available")}}class ClearHistoryCommand{name="clearhistory";description="Clear command execution history";usage="/clearhistory - Remove all command history";category="system";aliases=["clrhist"];execute(e,t){const r=t.cliProcessor;r?(r.clearHistory(),t.success("🗑️ Command history cleared")):t.error("CLI processor not available")}}class InteractiveCommand{name="interactive";description="Enter interactive CLI mode";usage="/interactive - Start interactive command mode";category="system";aliases=["i","repl"];execute(e,t){const r=t.cliProcessor;r?r.enterInteractiveMode(t):t.error("CLI processor not available")}}class PluginsCommand{name="plugins";description="List loaded CLI plugins";usage="/plugins - Show all registered plugins";category="system";aliases=["plug"];execute(e,t){const r=t.cliProcessor;if(!r)return void t.error("CLI processor not available");const o=r.getPlugins();0!==o.length?(t.info(`🔌 Loaded plugins (${o.length}):`),o.forEach(e=>{t.info(` 📦 ${e.name} v${e.version} - ${e.description}`),t.info(` Commands: ${e.commands.map(e=>e.name).join(", ")}`)})):t.info("🔌 No plugins registered")}}let a=o.default;class Logger{config;scopedPrefix;handlers=[];timers=/* @__PURE__ */new Map;groupDepth=0;exportHandler;cliProcessor;themeChangeListener;badgeList=[];displaySettings={showTimestamp:!0,showLocation:!0,showBadges:!0};serializerRegistry;hookManager;transportManager;constructor(t={}){this.config={...e.DEFAULT_CONFIG,...t},this.serializerRegistry=new SerializerRegistry,this.hookManager=new HookManager,this.config.bufferSize&&(this.exportHandler=new ExportLogHandler(this.config.bufferSize),this.handlers.push(this.exportHandler)),this.cliProcessor=function(){const e=new CommandProcessor;return e.registerCommand(new HelpCommand),e.registerCommand(new ConfigCommand),e.registerCommand(new ThemesCommand),e.registerCommand(new BannersCommand),e.registerCommand(new BannerCommand),e.registerCommand(new StatusCommand),e.registerCommand(new ResetCommand),e.registerCommand(new DemoCommand),e.registerCommand(new ExportCommand),e.registerCommand(new CopyCommand),e.registerCommand(new BufferSizeCommand),e.registerCommand(new ClearBufferCommand),e.registerCommand(new BufferInfoCommand),e.registerCommand(new HistoryCommand),e.registerCommand(new ClearHistoryCommand),e.registerCommand(new InteractiveCommand),e.registerCommand(new PluginsCommand),e}(),this.config.autoDetectTheme&&this.setupAutoThemeDetection()}setupAutoThemeDetection(){this.themeChangeListener&&(this.themeChangeListener(),this.themeChangeListener=null),this.themeChangeListener=e.setupThemeChangeListener(e=>{this.debug(`DevTools theme changed to: ${e}`)})}getConfig(){return{...this.config}}updateConfig(e){const t=this.config.autoDetectTheme;this.config={...this.config,...e},void 0!==e.autoDetectTheme&&e.autoDetectTheme!==t&&(e.autoDetectTheme?this.setupAutoThemeDetection():this.themeChangeListener&&(this.themeChangeListener(),this.themeChangeListener=null))}setGlobalPrefix(e){this.config.globalPrefix=e}setVerbosity(e){this.config.verbosity=e}setTheme(e){if(hasPreset(e))this.preset(e);else if(e in o){if(a=o[e],this.config.theme=e,e in i){const t=i[e];console.log(`%c${t.simple}`,t.style)}this.success(`Theme changed to: ${e}`)}else this.error(`Invalid theme: ${e}. Available:`,[...getAvailablePresets(),...Object.keys(o)])}setBannerType(e){this.config.bannerType=e,this.success(`Banner type changed to: ${e}`)}resetConfig(){this.themeChangeListener&&(this.themeChangeListener(),this.themeChangeListener=null),this.config={...e.DEFAULT_CONFIG},a=o.default,this.config.autoDetectTheme&&this.setupAutoThemeDetection(),this.success("Logger configuration reset to defaults")}cleanup(){this.themeChangeListener&&(this.themeChangeListener(),this.themeChangeListener=null),this.transportManager?.close().catch(()=>{})}preset(t){if(!hasPreset(t))return void this.error(`Unknown preset: ${t}. Available presets:`,getAvailablePresets());const r=function(e){return n[e]||null}(t);r&&(this.displaySettings.showTimestamp=r.timestamp?.show??!0,this.displaySettings.showLocation=r.location?.show??!0,this._activePreset=r,this._activePresetName=t,"browser"===e.getEnvironment()&&this.success(`Applied preset: ${t}`))}presets(){return getAvailablePresets()}hideTimestamp(){this.displaySettings.showTimestamp=!1,this.success("Timestamp hidden")}showTimestamp(){this.displaySettings.showTimestamp=!0,this.success("Timestamp shown")}hideLocation(){this.displaySettings.showLocation=!1,this.success("Location info hidden")}showLocation(){this.displaySettings.showLocation=!0,this.success("Location info shown")}hideBadges(){this.displaySettings.showBadges=!1,this.success("Badges hidden")}showBadges(){this.displaySettings.showBadges=!0,this.success("Badges shown")}badges(e){return this.badgeList=[...e],this}badge(e){return this.badgeList.includes(e)||this.badgeList.push(e),this}clearBadges(){return this.badgeList=[],this}component(e){return new ComponentLogger(this,e)}api(e){return new APILogger(this,e)}scope(e){return new ScopedLogger(this,e)}customize(e){void 0!==e.timestamp?.show&&(this.displaySettings.showTimestamp=e.timestamp.show),void 0!==e.location?.show&&(this.displaySettings.showLocation=e.location.show),e.prefix,this._customization=e,this.success("Customization applied")}styles(){return new LogStyleBuilder(this)}addHandler(e){this.handlers.push(e)}getHandlers(){return[...this.handlers]}getExportHandler(){return this.exportHandler}addSerializer(e,t,r){this.serializerRegistry.add(e,t,r)}removeSerializer(e){return this.serializerRegistry.remove(e)}getSerializerRegistry(){return this.serializerRegistry}on(e,t,r){return this.hookManager.on(e,t,r)}once(e,t,r){return this.hookManager.once(e,t,r)}off(e,t){return this.hookManager.off(e,t)}use(e,t){return this.hookManager.use(e,t)}getHookManager(){return this.hookManager}addTransport(e){return this.transportManager||(this.transportManager=new TransportManager),this.transportManager.add(e)}removeTransport(e){return this.transportManager?.remove(e)??!1}async flushTransports(){await(this.transportManager?.flush())}async closeTransports(){await(this.transportManager?.close())}getTransportManager(){return this.transportManager}shouldLog(e){if("silent"===this.config.verbosity)return!1;const t={debug:0,info:1,warn:2,error:3,critical:4};return t[e]>=t[this.config.verbosity]}getEffectivePrefix(){const e=[this.config.globalPrefix,this.scopedPrefix].filter(Boolean);return e.length>0?e.join(":"):void 0}log(t,...r){if(!this.shouldLog(t))return;const o=this.config.enableStackTrace?e.parseStackTrace():null,s=this.getEffectivePrefix(),i=e.formatTimestamp(),n=r.map(e=>this.serializerRegistry.serialize(e));let l=n.length>0?String(n[0]):"";if(this.badgeList.length>0&&this.displaySettings.showBadges){const e=this.badgeList.map(e=>`[${e}]`).join("");l=e+" "+l}const c=n.slice(1);let d={level:t,message:l,args:n,timestamp:i,prefix:s,stackInfo:o||void 0};this.hookManager.emit("beforeLog",d).then(e=>{l=e.message}).catch(()=>{});const[p,...g]=e.createStyledOutput(t,a,s,l,this.displaySettings.showLocation?o:null,this.config.autoDetectTheme,this._activePreset,this._activePresetName),h=" ".repeat(this.groupDepth)+p;c.length>0?console.log(h,...g,...c):console.log(h,...g),this.exportHandler&&this.exportHandler.setGroupInfo(this.groupDepth);const f={timestamp:i,level:t,prefix:s,stackInfo:o||void 0};if(this.handlers.forEach(e=>{try{e.handle(t,l,n,f)}catch(r){console.error("Log handler failed:",r)}}),this.transportManager){const e={level:t,levelValue:{debug:0,info:1,warn:2,error:3,critical:4}[t],time:Date.now(),msg:l,prefix:s,location:o?{file:o.file,line:o.line,column:o.column,function:o.function}:void 0};this.transportManager.write(e).catch(()=>{})}this.hookManager.emit("afterLog",d).catch(()=>{})}logWithBindings(e,t,...r){if(!this.shouldLog(t))return;let o="";e.badges?.length&&(o+=e.badges.map(e=>`[${e}]`).join("")),e.scope&&(o+=`[${e.scope}] `),o&&r.length>0&&(r[0]=o+String(r[0])),this.log(t,...r)}debug(...e){this.log("debug",...e)}info(...e){this.log("info",...e)}warn(...e){this.log("warn",...e)}error(...e){this.log("error",...e)}success(...t){if(!this.shouldLog("info"))return;const r=this.config.enableStackTrace?e.parseStackTrace():null,o=this.getEffectivePrefix(),s=t.length>0?String(t[0]):"",i=t.slice(1),[n,...l]=e.createStyledOutput("info",a,o,s,this.displaySettings.showLocation?r:null,this.config.autoDetectTheme,this._activePreset,this._activePresetName),c=a.success;let d="✅",p="SUCCESS";c&&(c.emoji&&(d=c.emoji),c.label&&(p=c.label));const g=n.replace(/ℹ️ INFO/,`${d} ${p}`),h=" ".repeat(this.groupDepth)+g;i.length>0?console.log(h,...l,...i):console.log(h,...l);const f={timestamp:e.formatTimestamp(),level:"info",prefix:o,stackInfo:r||void 0};this.handlers.forEach(e=>{try{e.handle("info",s,t,f)}catch(r){console.error("Log handler failed:",r)}})}trace(...e){this.log("debug",...e),this.shouldLog("debug")&&console.trace(...e)}critical(...e){this.log("critical",...e)}table(t,r){if(!this.shouldLog("info"))return;const o=this.getEffectivePrefix(),s=e.StylePresets.accent().build(),i="%c📊 TABLE"+(o?` [${o}]`:"");console.log(i,s),r?console.table(t,r):console.table(t)}group(t,r=!1){const o=(new e.StyleBuilder).bg("linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)").color("#1565c0").border("1px solid #90caf9").padding("4px 12px").rounded("6px").bold().build(),s=`%c📁 ${t}`;r?console.groupCollapsed(s,o):console.group(s,o),this.groupDepth++}groupEnd(){this.groupDepth>0&&(console.groupEnd(),this.groupDepth--)}time(t){const r={label:t,startTime:performance.now()};this.timers.set(t,r);const o=e.StylePresets.warning().build();console.log(`%c⏱️ Timer started: ${t}`,o)}timeEnd(t){const r=this.timers.get(t);if(!r)return void this.warn(`Timer '${t}' does not exist`);const o=performance.now()-r.startTime;this.timers.delete(t);const s=e.StylePresets.success().build();console.log(`%c⏱️ Timer ended: ${t} - ${o.toFixed(2)}ms`,s)}showBanner(e){displayInitBanner(e||this.config.bannerType)}logWithSVG(t,r,o={}){const{width:s=300,height:i=60,padding:n="30px 150px"}=o;let a="";a=r?`data:image/svg+xml,${encodeURIComponent(r)}`:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${s} ${i}'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='4'/><text x='${s/2}' y='${i/2+5}' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>${t}</text></svg>`)}`;const l=(new e.StyleBuilder).bg(`url("${a}") no-repeat center center`).padding(n).color("transparent").rounded("4px").build();console.log(`%c${t}`,l)}logAnimated(t,r=3){if(!document.getElementById("logger-animations")){const e=document.createElement("style");e.id="logger-animations",e.textContent="\n @keyframes loggerGradient {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n ",document.head.appendChild(e)}const o=(new e.StyleBuilder).bg("linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2)").css("background-size","400% 400%").color("#ffffff").padding("12px 20px").rounded("8px").bold().font("Monaco, Consolas, monospace").animation(`loggerGradient ${r}s ease infinite`).display("inline-block").build();console.log(`%c${t}`,o)}logGrouped(e,t){try{let r;r=Object.groupBy?Object.groupBy(e,t):e.reduce((e,r)=>{const o=t(r);return e[o]||(e[o]=[]),e[o].push(r),e},{}),Object.entries(r).forEach(([e,t])=>{this.group(`Group: ${e}`),this.table(t),this.groupEnd()})}catch{this.info("Grouped data:",e)}}async cli(e){this.cliProcessor?await this.cliProcessor.processCommand(e,this):this.error("CLI processor not initialized")}}let l=null;!function(){if(!l){l=new Logger({verbosity:"info",enableColors:!0,enableTimestamps:!0,enableStackTrace:!0,bufferSize:1e3});try{displayInitBanner()}catch(e){}}}(),exports.APILogger=APILogger,exports.BANNER_VARIANTS=s,exports.ComponentLogger=ComponentLogger,exports.ContextLogger=ContextLogger,exports.ExportLogHandler=ExportLogHandler,exports.HookManager=HookManager,exports.Logger=Logger,exports.ScopedLogger=ScopedLogger,exports.SerializerRegistry=SerializerRegistry,exports.THEME_BANNERS=i,exports.THEME_PRESETS=o,exports.TransportManager=TransportManager,exports.displayInitBanner=displayInitBanner;
|
|
2
|
-
//# sourceMappingURL=Logger-
|
|
1
|
+
"use strict";const e=require("./environment-C_8J-zQ_.js"),t={maxDepth:5,circular:"placeholder",preserveUndefined:!1};class SerializerRegistry{serializers=/* @__PURE__ */new Map;config;constructor(e={}){this.config={...t,...e},this.registerDefaults()}registerDefaults(){this.add(Error,e=>({name:e.name,message:e.message,stack:e.stack?.split("\n").slice(0,10),...e.cause?{cause:this.serialize(e.cause)}:{}}),100),this.add(Date,e=>({iso:e.toISOString(),timestamp:e.getTime()}),90),this.add(RegExp,e=>({pattern:e.source,flags:e.flags}),90),this.add(Map,(e,t)=>{const r={};return e.forEach((e,o)=>{const s="object"==typeof o?JSON.stringify(o):String(o);r[s]=this.serializeInternal(e,{...t,depth:t.depth+1,path:[...t.path,s]})}),{__type:"Map",entries:r}},80),this.add(Set,(e,t)=>({__type:"Set",values:Array.from(e).map((e,r)=>this.serializeInternal(e,{...t,depth:t.depth+1,path:[...t.path,`[${r}]`]}))}),80),"undefined"!=typeof Buffer&&this.add(Buffer,e=>({__type:"Buffer",length:e.length,preview:e.slice(0,50).toString("hex")}),70)}add(e,t,r=50){this.serializers.set(e,{type:e,serializer:t,priority:r})}remove(e){return this.serializers.delete(e)}has(e){return this.serializers.has(e)}getAll(){return Array.from(this.serializers.values()).sort((e,t)=>(t.priority??50)-(e.priority??50))}findSerializer(e){const t=this.getAll();for(const r of t)if(e instanceof r.type)return r;return null}serializeInternal(e,t){if(null===e)return null;if(void 0===e)return this.config.preserveUndefined?void 0:"[undefined]";if("function"==typeof e)return`[Function: ${e.name||"anonymous"}]`;if("object"!=typeof e)return e;if(t.depth>=this.config.maxDepth)return"[Max Depth]";if(t.seen.has(e))switch(this.config.circular){case"error":throw new Error(`Circular reference at ${t.path.join(".")}`);case"skip":return;default:return"[Circular]"}t.seen.add(e);const r=this.findSerializer(e);if(r)return r.serializer(e,t);if(Array.isArray(e))return e.map((e,r)=>this.serializeInternal(e,{...t,depth:t.depth+1,path:[...t.path,`[${r}]`]}));const o={};for(const[s,i]of Object.entries(e))o[s]=this.serializeInternal(i,{...t,depth:t.depth+1,path:[...t.path,s]});return o}serialize(e,t){const r={...this.config,...t};return this.serializeInternal(e,{depth:0,maxDepth:r.maxDepth,path:[],seen:/* @__PURE__ */new WeakSet})}}function generateId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}class HookManager{hooks=/* @__PURE__ */new Map;middlewares=[];constructor(){this.hooks.set("beforeLog",[]),this.hooks.set("afterLog",[]),this.hooks.set("onError",[])}on(e,t,r=50){const o={id:generateId(),event:e,callback:t,priority:r,once:!1},s=this.hooks.get(e);return s.push(o),s.sort((e,t)=>t.priority-e.priority),()=>this.removeHook(e,o.id)}once(e,t,r=50){const o={id:generateId(),event:e,callback:t,priority:r,once:!0},s=this.hooks.get(e);return s.push(o),s.sort((e,t)=>t.priority-e.priority),()=>this.removeHook(e,o.id)}off(e,t){const r=this.hooks.get(e);if(!r)return!1;const o=r.findIndex(e=>e.callback===t);return o>=0&&(r.splice(o,1),!0)}removeHook(e,t){const r=this.hooks.get(e);if(r){const e=r.findIndex(e=>e.id===t);e>=0&&r.splice(e,1)}}use(e,t=50){const r={id:generateId(),fn:e,priority:t};return this.middlewares.push(r),this.middlewares.sort((e,t)=>t.priority-e.priority),()=>{const e=this.middlewares.findIndex(e=>e.id===r.id);e>=0&&this.middlewares.splice(e,1)}}async emit(e,t){const r=this.hooks.get(e)||[];let o={...t};const s=[];for(const n of r)try{const e=await n.callback(o);e&&(o={...o,...e}),n.once&&s.push(n.id)}catch(i){"onError"!==e&&await this.emit("onError",{...o,error:i,hookEvent:e})}return s.forEach(t=>this.removeHook(e,t)),o}async process(e){let t={...e};if(t=await this.emit("beforeLog",t),this.middlewares.length>0){let e=0;const executeNext=async()=>{if(e<this.middlewares.length){const r=this.middlewares[e++];r&&await r.fn(t,executeNext)}};await executeNext()}return t}async afterProcess(e){await this.emit("afterLog",e)}clear(){this.hooks.forEach(e=>e.length=0),this.middlewares.length=0}getStats(){return{hooks:{beforeLog:this.hooks.get("beforeLog")?.length||0,afterLog:this.hooks.get("afterLog")?.length||0,onError:this.hooks.get("onError")?.length||0},middlewares:this.middlewares.length}}}const r={debug:0,info:1,warn:2,error:3,critical:4};class TransportManager{transports=/* @__PURE__ */new Map;defaultLevel="info";constructor(e){e&&(this.defaultLevel=e)}add(e){const t=`transport-${Date.now()}-${Math.random().toString(36).substr(2,6)}`,o=e.level||this.defaultLevel;let s;if("string"==typeof e.target)throw new Error("String transport targets not supported. Use inline transport object.");s=e.target;const i={id:t,transport:s,options:e.options||{},level:o,levelValue:r[o]};return this.transports.set(t,i),t}remove(e){const t=this.transports.get(e);return!!t&&(t.transport.close?.(),this.transports.delete(e))}async write(e){const t=[];for(const r of this.transports.values()){if(e.levelValue<r.levelValue)continue;let o=e;if(r.options.transform){const t=r.options.transform(e);if(null===t)continue;o=t}const s=r.transport.write(o);s instanceof Promise&&t.push(s)}await Promise.all(t)}async flush(){const e=[];for(const t of this.transports.values())if(t.transport.flush){const r=t.transport.flush();r instanceof Promise&&e.push(r)}await Promise.all(e)}async close(){await this.flush();const e=[];for(const t of this.transports.values())if(t.transport.close){const r=t.transport.close();r instanceof Promise&&e.push(r)}await Promise.all(e),this.transports.clear()}get count(){return this.transports.size}list(){return Array.from(this.transports.keys())}}const o={default:{debug:{emoji:"🐞",label:"DEBUG",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",color:"#ffffff",border:"1px solid #667eea",shadow:"0 2px 4px rgba(102, 126, 234, 0.3)"},info:{emoji:"ℹ️",label:"INFO",background:"linear-gradient(135deg, #74b9ff 0%, #0984e3 100%)",color:"#ffffff",border:"1px solid #74b9ff",shadow:"0 2px 4px rgba(116, 185, 255, 0.3)"},warn:{emoji:"⚠️",label:"WARN",background:"linear-gradient(135deg, #fdcb6e 0%, #e17055 100%)",color:"#2d3436",border:"1px solid #fdcb6e",shadow:"0 2px 4px rgba(253, 203, 110, 0.3)"},error:{emoji:"❌",label:"ERROR",background:"linear-gradient(135deg, #e84393 0%, #d63031 100%)",color:"#ffffff",border:"1px solid #e84393",shadow:"0 2px 4px rgba(232, 67, 147, 0.3)"},success:{emoji:"✅",label:"SUCCESS",background:"linear-gradient(135deg, #00b894 0%, #00a085 100%)",color:"#ffffff",border:"1px solid #00b894",shadow:"0 2px 4px rgba(0, 184, 148, 0.3)"},critical:{emoji:"🔥",label:"CRITICAL",background:"linear-gradient(135deg, #ff3838 0%, #ff1744 100%)",color:"#ffffff",border:"2px solid #ff3838",shadow:"0 4px 8px rgba(255, 56, 56, 0.5)"}},dark:{debug:{emoji:"🌙",label:"DEBUG",background:"linear-gradient(135deg, #2d3748 0%, #4a5568 100%)",color:"#e2e8f0",border:"1px solid #4a5568",shadow:"0 2px 4px rgba(45, 55, 72, 0.8)"},info:{emoji:"💡",label:"INFO",background:"linear-gradient(135deg, #1a202c 0%, #2d3748 100%)",color:"#90cdf4",border:"1px solid #3182ce",shadow:"0 2px 4px rgba(26, 32, 44, 0.8)"},warn:{emoji:"⚡",label:"WARN",background:"linear-gradient(135deg, #744210 0%, #975a16 100%)",color:"#faf089",border:"1px solid #d69e2e",shadow:"0 2px 4px rgba(116, 66, 16, 0.8)"},error:{emoji:"💀",label:"ERROR",background:"linear-gradient(135deg, #742a2a 0%, #9b2c2c 100%)",color:"#feb2b2",border:"1px solid #e53e3e",shadow:"0 2px 4px rgba(116, 42, 42, 0.8)"},success:{emoji:"🎯",label:"SUCCESS",background:"linear-gradient(135deg, #276749 0%, #2f855a 100%)",color:"#9ae6b4",border:"1px solid #38a169",shadow:"0 2px 4px rgba(39, 103, 73, 0.8)"},critical:{emoji:"💥",label:"CRITICAL",background:"linear-gradient(135deg, #1a1a1a 0%, #ff0000 100%)",color:"#ffffff",border:"2px solid #ff0000",shadow:"0 4px 8px rgba(255, 0, 0, 0.9)"}},neon:{debug:{emoji:"⚡",label:"DEBUG",background:"linear-gradient(135deg, #0f3460 0%, #e94560 100%)",color:"#00ffff",border:"1px solid #00ffff",shadow:"0 0 10px rgba(0, 255, 255, 0.5)"},info:{emoji:"🔮",label:"INFO",background:"linear-gradient(135deg, #16213e 0%, #0f3460 100%)",color:"#00ff41",border:"1px solid #00ff41",shadow:"0 0 10px rgba(0, 255, 65, 0.5)"},warn:{emoji:"⚠️",label:"WARN",background:"linear-gradient(135deg, #533a03 0%, #e94560 100%)",color:"#ffff00",border:"1px solid #ffff00",shadow:"0 0 10px rgba(255, 255, 0, 0.5)"},error:{emoji:"💥",label:"ERROR",background:"linear-gradient(135deg, #5c0a0a 0%, #ff073a 100%)",color:"#ff073a",border:"1px solid #ff073a",shadow:"0 0 10px rgba(255, 7, 58, 0.8)"},success:{emoji:"✨",label:"SUCCESS",background:"linear-gradient(135deg, #0a5c0a 0%, #39ff14 100%)",color:"#39ff14",border:"1px solid #39ff14",shadow:"0 0 10px rgba(57, 255, 20, 0.8)"},critical:{emoji:"🌟",label:"CRITICAL",background:"linear-gradient(135deg, #000000 0%, #ff0080 100%)",color:"#ff0080",border:"2px solid #ff0080",shadow:"0 0 20px rgba(255, 0, 128, 1)"}},minimal:{debug:{emoji:"",label:"DEBUG",background:"#f7fafc",color:"#4a5568",border:"1px solid #e2e8f0",shadow:"none"},info:{emoji:"",label:"INFO",background:"#ebf8ff",color:"#2b6cb0",border:"1px solid #bee3f8",shadow:"none"},warn:{emoji:"",label:"WARN",background:"#fffbf0",color:"#c05621",border:"1px solid #fed7aa",shadow:"none"},error:{emoji:"",label:"ERROR",background:"#fef5f5",color:"#c53030",border:"1px solid #fca5a5",shadow:"none"},success:{emoji:"",label:"SUCCESS",background:"#f0fff4",color:"#2f855a",border:"1px solid #9ae6b4",shadow:"none"},critical:{emoji:"",label:"CRITICAL",background:"#fef5f5",color:"#e53e3e",border:"2px solid #f56565",shadow:"none"}},light:{debug:{emoji:"🔍",label:"DEBUG",background:"linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)",color:"#1565c0",border:"1px solid #90caf9",shadow:"0 1px 3px rgba(33, 150, 243, 0.2)"},info:{emoji:"ℹ️",label:"INFO",background:"linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%)",color:"#7b1fa2",border:"1px solid #ce93d8",shadow:"0 1px 3px rgba(156, 39, 176, 0.2)"},warn:{emoji:"⚠️",label:"WARN",background:"linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%)",color:"#f57c00",border:"1px solid #ffcc02",shadow:"0 1px 3px rgba(255, 152, 0, 0.2)"},error:{emoji:"❌",label:"ERROR",background:"linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%)",color:"#d32f2f",border:"1px solid #f44336",shadow:"0 1px 3px rgba(244, 67, 54, 0.2)"},success:{emoji:"✅",label:"SUCCESS",background:"linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%)",color:"#388e3c",border:"1px solid #4caf50",shadow:"0 1px 3px rgba(76, 175, 80, 0.2)"},critical:{emoji:"🚨",label:"CRITICAL",background:"linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%)",color:"#c2185b",border:"2px solid #e91e63",shadow:"0 2px 6px rgba(233, 30, 99, 0.3)"}},cyberpunk:{debug:{emoji:"🤖",label:"DEBUG",background:"linear-gradient(135deg, #0d1b2a 0%, #415a77 100%)",color:"#00d4aa",border:"1px solid #00d4aa",shadow:"0 0 15px rgba(0, 212, 170, 0.4)"},info:{emoji:"🔗",label:"INFO",background:"linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%)",color:"#00b4d8",border:"1px solid #00b4d8",shadow:"0 0 15px rgba(0, 180, 216, 0.4)"},warn:{emoji:"⚡",label:"WARN",background:"linear-gradient(135deg, #f72585 0%, #b5179e 100%)",color:"#ffff3f",border:"1px solid #ffff3f",shadow:"0 0 15px rgba(255, 255, 63, 0.4)"},error:{emoji:"💀",label:"ERROR",background:"linear-gradient(135deg, #7209b7 0%, #480ca8 100%)",color:"#ff006e",border:"1px solid #ff006e",shadow:"0 0 15px rgba(255, 0, 110, 0.6)"},success:{emoji:"⚡",label:"SUCCESS",background:"linear-gradient(135deg, #003566 0%, #001d3d 100%)",color:"#00f5ff",border:"1px solid #00f5ff",shadow:"0 0 15px rgba(0, 245, 255, 0.4)"},critical:{emoji:"💥",label:"CRITICAL",background:"linear-gradient(135deg, #000000 0%, #ff0040 100%)",color:"#ff0040",border:"2px solid #ff0040",shadow:"0 0 25px rgba(255, 0, 64, 0.8)"}}},s={simple:{text:"🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀",style:"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold; font-size: 14px;"},ascii:{text:"\n ___ ____ _ __ ___ _ __ _____ _____ ____ __ ___ _____ _____ _____ ____ \n / _ \\ / __ \\| | / / / _ \\ | \\ | |/ ____| ____| _ \\ | | / _ \\ / ____| ___| _ | _ \\ \n / /_\\ \\ / / _` | |/ / / /_\\ \\ | \\| | | | |__ | | | | | | / / \\ \\| | __| |_ | |_| | |_) |\n | _ || | (_| | < | _ | | . ` | | | __| | | | | | | | | | | | |_ | _| | /| _ < \n | | | |\\ \\__,_|_|\\_\\ | | | | | |\\ | |___| |____| |_| | | |__\\ \\_/ /| |__| | |___| |\\ \\| |_) |\n \\_| |_/ \\____/ \\_| |_/ |_| \\_|\\_____|______|____/ |_____/\\___/ \\_____|_____|_| \\_|____/\n\n Advanced Logger v2.0.0 - Console Excellence",style:'font-family: "Courier New", Consolas, Monaco, monospace; color: #667eea; font-size: 11px; line-height: 1.2;'},unicode:{text:"\n╔══════════════════════════════════════════════════════════════════════════╗\n║ 🚀 ADVANCED LOGGER v2.0.0 ║\n║ State-of-the-art Console Styling ║ \n╚══════════════════════════════════════════════════════════════════════════╝",style:'font-family: "Courier New", Consolas, Monaco, monospace; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; border-radius: 8px; font-size: 12px; line-height: 1.3;'},svg:{text:" ",style:"\n background-image: url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='8'/><text x='200' y='30' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>🚀 ADVANCED LOGGER</text><text x='200' y='50' text-anchor='middle' fill='white' font-family='monospace' font-size='12'>State-of-the-art Console Styling</text><text x='200' y='65' text-anchor='middle' fill='white' font-family='monospace' font-size='10'>v2.0.0</text></svg>\");\n background-repeat: no-repeat;\n background-size: 400px 80px;\n padding: 40px 200px;\n color: transparent;\n display: inline-block;\n border-radius: 8px;\n "},animated:{text:" 🚀 ADVANCED LOGGER v2.0.0 ",style:"\n background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);\n background-size: 400% 400%;\n color: white;\n padding: 15px 25px;\n border-radius: 10px;\n font-weight: bold;\n font-size: 14px;\n font-family: monospace;\n animation: gradientShift 3s ease infinite;\n display: inline-block;\n "}},i={default:{simple:"🚀 ADVANCED LOGGER v2.0.0 - State-of-the-art Console Styling 🚀",style:"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 20px; border-radius: 8px; font-weight: bold;"},dark:{simple:"🌙 ADVANCED LOGGER v2.0.0 - Dark Mode Console Excellence 🌙",style:"background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #4a5568;"},neon:{simple:"⚡ ADVANCED LOGGER v2.0.0 - Cyberpunk Console Experience ⚡",style:"background: linear-gradient(135deg, #0f3460 0%, #e94560 100%); color: #00ffff; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00ffff;"},minimal:{simple:"ADVANCED LOGGER v2.0.0 - Clean Console Styling",style:"background: #f7fafc; color: #2d3748; padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 4px; font-weight: 500;"},light:{simple:"☀️ ADVANCED LOGGER v2.0.0 - Bright Console Styling ☀️",style:"background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); color: #495057; padding: 12px 20px; border-radius: 8px; font-weight: bold; border: 1px solid #dee2e6;"},cyberpunk:{simple:"🤖 ADVANCED LOGGER v2.0.0 - Neural Console Interface 🤖",style:"background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); color: #00d4aa; padding: 12px 20px; border-radius: 8px; font-weight: bold; text-shadow: 0 0 10px #00d4aa; border: 1px solid #00d4aa;"}};function displayInitBanner(e){const t=e||function(){const e=navigator.userAgent,t=/Chrome/.test(e),r=/Firefox/.test(e),o=/Safari/.test(e)&&!/Chrome/.test(e),s=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;return"undefined"!=typeof document&&"animationName"in document.createElement("div").style&&t?"animated":s&&(t||r)?"svg":t||r?"unicode":o?"ascii":"simple"}(),r=s[t];if("animated"===t){const e=document.createElement("style");e.textContent="\n @keyframes gradientShift {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n ",document.head.appendChild(e)}console.log(`%c${r.text}`,r.style),console.group("%c✨ Features","background: #f8f9fa; color: #495057; padding: 4px 8px; border-radius: 4px; font-weight: bold;"),["🎨 Advanced CSS Console Styling","📍 Automatic Stack Trace Parsing","🔧 Scoped Loggers & Prefixes","⚡ Performance Timers","🎯 Verbosity Filtering","🔌 Extensible Handlers","📱 Modern TypeScript Patterns","📤 Export & Clipboard Support"].forEach(e=>{console.log(`%c${e}`,"color: #6c757d; font-size: 13px;")}),console.groupEnd(),console.log("")}class BaseStyler{builder;constructor(t=new e.StyleBuilder){this.builder=t}primary(){return this.color("#007bff")}secondary(){return this.color("#6c757d")}accent(){return this.color("#17a2b8")}muted(){return this.color(e.getAdaptiveColor({light:"#6c757d",dark:"#a0aec0"}))}success(){return this.color("#28a745")}warning(){return this.color("#ffc107")}danger(){return this.color("#dc3545")}mono(){return this.builder.font('Monaco, Consolas, "Courier New", monospace'),this}system(){return this.builder.font('system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'),this}readable(){return this.builder.font('Georgia, "Times New Roman", serif'),this}compact(){return this.builder.padding("1px 4px").margin("0 1px"),this}spacious(){return this.builder.padding("6px 12px").margin("2px 4px"),this}inline(){return this.builder.display("inline-block"),this}glassmorphic(){return this.builder.css("backdrop-filter","blur(10px)").css("background","rgba(255, 255, 255, 0.1)").border("1px solid rgba(255, 255, 255, 0.2)").rounded("8px"),this}neon(){const e="#00ffff";return this.builder.color(e).border(`1px solid ${e}`).shadow(`0 0 10px ${e}, 0 0 20px ${e}`).css("text-shadow",`0 0 5px ${e}`),this}gradient(e="#667eea",t="#764ba2"){return this.builder.bg(`linear-gradient(135deg, ${e} 0%, ${t} 100%)`),this}bold(){return this.builder.bold(),this}color(e){return this.builder.color(e),this}build(){return this.builder.build()}}class TimestampStyler extends BaseStyler{default(){return this.muted().mono(),this.builder.size("11px"),this}hidden(){return this.builder.display("none"),this}minimal(){return this.muted().mono(),this.builder.size("10px").opacity(.7),this}size(e){return this.builder.size(e),this}}class LevelStyler extends BaseStyler{badge(){return this.builder.padding("2px 8px").rounded("4px").bold().color("#ffffff"),this}glowing(){return this.neon().badge()}flat(){return this.builder.padding("1px 6px").rounded("2px").border("1px solid currentColor").css("background","transparent"),this}uppercase(){return this.builder.uppercase(),this}}class PrefixStyler extends BaseStyler{dark(){return this.builder.bg(e.getAdaptiveColor({light:"#2d3748",dark:"#4a5568"})).color(e.getAdaptiveColor({light:"#e2e8f0",dark:"#f7fafc"})).padding("2px 6px").rounded("3px").bold().mono().size("11px"),this}light(){return this.builder.bg("#f8f9fa").color("#495057").padding("2px 6px").rounded("3px").bold().mono().size("11px").border("1px solid #dee2e6"),this}compact(){return this.builder.padding("1px 4px").size("10px").rounded("2px"),this}}class MessageStyler extends BaseStyler{readable(){return this.builder.color(e.getAdaptiveColor(e.ADAPTIVE_COLORS.messageText)).system().size("14px"),this}code(){return this.builder.mono().size("13px").color(e.getAdaptiveColor(e.ADAPTIVE_COLORS.messageText)).bg("rgba(0, 0, 0, 0.05)").padding("1px 4px").rounded("3px"),this}large(){return this.builder.size("16px").color(e.getAdaptiveColor(e.ADAPTIVE_COLORS.messageText)),this}}class LocationStyler extends BaseStyler{subtle(){return this.builder.color(e.getAdaptiveColor(e.ADAPTIVE_COLORS.location)).mono().size("11px").opacity(.7),this}hidden(){return this.builder.display("none"),this}clickable(){return this.subtle(),this.builder.css("text-decoration","underline").cursor("pointer"),this}}class LogStyleBuilder{logStyles={};logger;constructor(e){this.logger=e}timestamp(){return new TimestampStyleBuilderProxy(this)}level(){return new LevelStyleBuilderProxy(this)}prefix(){return new PrefixStyleBuilderProxy(this)}message(){return new MessageStyleBuilderProxy(this)}location(){return new LocationStyleBuilderProxy(this)}usePreset(e){return console.warn(`Preset '${e}' will be available in next implementation phase`),this}customize(e){return this.logStyles={...this.logStyles,...e},this}spacing(e){switch(this.logStyles.layout?this.logStyles.layout.spacing=e:this.logStyles.layout={spacing:e},e){case"compact":this.logStyles.layout.innerPadding="1px",this.logStyles.layout.outerMargin="0px";break;case"spacious":this.logStyles.layout.innerPadding="4px",this.logStyles.layout.outerMargin="2px";break;default:this.logStyles.layout.innerPadding="2px",this.logStyles.layout.outerMargin="1px"}return this}backdrop(e){return this.logStyles.backdrop=e,this}transparency(e){return this.logStyles.transparency=Math.max(0,Math.min(1,e)),this}apply(){this.logger._customLogStyles=this.logStyles,console.log("Applied log styles:",this.logStyles)}getConfig(){return{...this.logStyles}}_updatePartConfig(e,t){"layout"!==e&&"backdrop"!==e&&"transparency"!==e&&(this.logStyles[e]||(this.logStyles[e]={}),this.logStyles[e].style=t)}}class PartStyleBuilderProxy{parentBuilder;partName;constructor(e,t){this.parentBuilder=e,this.partName=t}and(){return this.parentBuilder}apply(){this.parentBuilder.apply()}applyStyles(e){const t=e.build();return this.parentBuilder._updatePartConfig(this.partName,t),this}}class TimestampStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"timestamp")}default(){return this.applyStyles((new TimestampStyler).default())}hidden(){return this.applyStyles((new TimestampStyler).hidden())}minimal(){return this.applyStyles((new TimestampStyler).minimal())}muted(){return this.applyStyles((new TimestampStyler).muted())}mono(){return this.applyStyles((new TimestampStyler).mono())}compact(){return this.applyStyles((new TimestampStyler).compact())}}class LevelStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"level")}badge(){return this.applyStyles((new LevelStyler).badge())}gradient(e,t){return this.applyStyles((new LevelStyler).gradient(e,t))}glowing(){return this.applyStyles((new LevelStyler).glowing())}flat(){return this.applyStyles((new LevelStyler).flat())}bold(){return this.applyStyles((new LevelStyler).bold())}uppercase(){return this.applyStyles((new LevelStyler).uppercase())}neon(){return this.applyStyles((new LevelStyler).neon())}}class PrefixStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"prefix")}dark(){return this.applyStyles((new PrefixStyler).dark())}light(){return this.applyStyles((new PrefixStyler).light())}compact(){return this.applyStyles((new PrefixStyler).compact())}muted(){return this.applyStyles((new PrefixStyler).muted())}mono(){return this.applyStyles((new PrefixStyler).mono())}}class MessageStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"message")}readable(){return this.applyStyles((new MessageStyler).readable())}code(){return this.applyStyles((new MessageStyler).code())}large(){return this.applyStyles((new MessageStyler).large())}system(){return this.applyStyles((new MessageStyler).system())}mono(){return this.applyStyles((new MessageStyler).mono())}}class LocationStyleBuilderProxy extends PartStyleBuilderProxy{constructor(e){super(e,"location")}subtle(){return this.applyStyles((new LocationStyler).subtle())}hidden(){return this.applyStyles((new LocationStyler).hidden())}clickable(){return this.applyStyles((new LocationStyler).clickable())}muted(){return this.applyStyles((new LocationStyler).muted())}mono(){return this.applyStyles((new LocationStyler).mono())}}const n={default:{layout:{spacing:"normal",innerPadding:"2px",outerMargin:"1px"},timestamp:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"11px"},level:{show:!0,style:"badge",uppercase:!1,padding:"2px 8px"},prefix:{show:!0,style:"dark",padding:"2px 6px"},message:{show:!0,color:"auto",font:"system-ui, -apple-system, sans-serif",size:"14px"},location:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"11px"}},cyberpunk:{layout:{spacing:"compact",innerPadding:"1px",outerMargin:"0px"},timestamp:{show:!0,color:"#00ffff",font:"Monaco, Consolas, monospace",size:"10px",style:"neon"},level:{show:!0,style:"glowing",uppercase:!0,padding:"2px 8px"},prefix:{show:!0,color:"#ff0080",background:"rgba(255, 0, 128, 0.1)",border:"1px solid #ff0080",style:"neon"},message:{show:!0,color:"#00ff41",font:"Monaco, Consolas, monospace",size:"13px"},location:{show:!1},backdrop:"blur(2px)",transparency:.9},glassmorphism:{layout:{spacing:"spacious",innerPadding:"4px",outerMargin:"2px"},timestamp:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"11px",style:"glassmorphic"},level:{show:!0,style:"glassmorphic",uppercase:!1,padding:"4px 12px"},prefix:{show:!0,style:"glassmorphic",padding:"3px 8px"},message:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"14px"},location:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"11px",style:"glassmorphic"},backdrop:"blur(10px)",transparency:.8},minimal:{layout:{spacing:"compact",innerPadding:"0px",outerMargin:"0px"},timestamp:{show:!1},level:{show:!0,style:"flat",uppercase:!0,padding:"0px 4px",border:"none",background:"transparent"},prefix:{show:!0,style:"flat",padding:"0px 4px",border:"none",background:"transparent"},message:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"14px"},location:{show:!1}},debug:{layout:{spacing:"compact",innerPadding:"1px",outerMargin:"0px"},timestamp:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"10px"},level:{show:!0,style:"compact",uppercase:!0,padding:"1px 4px",font:"Monaco, Consolas, monospace",size:"10px"},prefix:{show:!0,style:"compact",padding:"1px 4px",font:"Monaco, Consolas, monospace",size:"10px"},message:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"12px"},location:{show:!0,color:"auto",font:"Monaco, Consolas, monospace",size:"10px",style:"clickable"}},production:{layout:{spacing:"normal",innerPadding:"2px",outerMargin:"1px"},timestamp:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"11px"},level:{show:!0,style:"badge",uppercase:!1,padding:"2px 6px"},prefix:{show:!1},message:{show:!0,color:"auto",font:"system-ui, sans-serif",size:"14px"},location:{show:!1}}};function getAvailablePresets(){return Object.keys(n)}function hasPreset(e){return e in n}class ScopedLogger{parent;scopeName;badgeList=[];contextStack=[];_timers;constructor(e,t){this.parent=e,this.scopeName=t}get timers(){return this._timers||(this._timers=/* @__PURE__ */new Map),this._timers}getBindings(){return{scope:this.getScopePrefix(),badges:this.badgeList.length>0?[...this.badgeList]:void 0}}getScopePrefix(){return 0===this.contextStack.length?this.scopeName:[this.scopeName,...this.contextStack].join(":")}badges(e){return this.badgeList=[...e],this}badge(e){return this.badgeList.includes(e)||this.badgeList.push(e),this}clearBadges(){return this.badgeList=[],this}style(e){return this.parent.setTheme(e),this}context(e){return new ContextLogger(this,e)}time(e){this.timers.set(e,{label:`${this.scopeName}:${e}`,startTime:performance.now()})}timeEnd(e){const t=this.timers.get(e);if(!t)return void this.warn(`Timer '${e}' not found`);const r=performance.now()-t.startTime;return this.timers.delete(e),this.success(`Timer: ${e} - ${r.toFixed(2)}ms`),r}debug(...e){this.parent.logWithBindings(this.getBindings(),"debug",...e)}info(...e){this.parent.logWithBindings(this.getBindings(),"info",...e)}warn(...e){this.parent.logWithBindings(this.getBindings(),"warn",...e)}error(...e){this.parent.logWithBindings(this.getBindings(),"error",...e)}success(...e){const t=this.getBindings();this.parent.logWithBindings(t,"info",...e)}critical(...e){this.parent.logWithBindings(this.getBindings(),"critical",...e)}trace(...e){this.parent.logWithBindings(this.getBindings(),"debug",...e),console.trace(`[${this.scopeName}]`)}_pushContext(e){this.contextStack.push(e)}_popContext(){this.contextStack.pop()}}class APILogger extends ScopedLogger{constructor(e,t){super(e,`API:${t}`),this.badge("API")}slow(e,t){this.badge("SLOW");const r=t?`${e} (${t}ms)`:e;this.warn(r)}rateLimit(e){this.badge("RATE_LIMIT"),this.warn(e)}auth(e){this.badge("AUTH"),this.error(e)}deprecated(e){this.badge("DEPRECATED"),this.warn(e)}}class ComponentLogger extends ScopedLogger{constructor(e,t){super(e,t),this.badge("COMPONENT")}lifecycle(e,t){this.badge("LIFECYCLE");const r=t?`${e}: ${t}`:e;this.info(r)}stateChange(e,t,r){this.badge("STATE");const o=`${e} → ${t}`;r?this.info(o,r):this.info(o)}propsChange(e){this.badge("PROPS"),this.debug("Props changed:",e)}}class ContextLogger{parentLogger;contextName;constructor(e,t){this.parentLogger=e,this.contextName=t}run(e){this.parentLogger._pushContext(this.contextName);try{return e()}finally{this.parentLogger._popContext()}}async runAsync(e){this.parentLogger._pushContext(this.contextName);try{return await e()}finally{this.parentLogger._popContext()}}start(){this.parentLogger._pushContext(this.contextName)}end(){this.parentLogger._popContext()}debug(...e){this.parentLogger.debug(...e)}info(...e){this.parentLogger.info(...e)}warn(...e){this.parentLogger.warn(...e)}error(...e){this.parentLogger.error(...e)}success(...e){this.parentLogger.success(...e)}critical(...e){this.parentLogger.critical(...e)}}class ExportLogHandler{buffer=[];maxSize;groupDepth=0;currentGroup;constructor(t=e.BUFFER_LIMITS.DEFAULT_SIZE){this.maxSize=Math.min(Math.max(t,e.BUFFER_LIMITS.MIN_SIZE),e.BUFFER_LIMITS.MAX_SIZE)}handle(t,r,o,s){const i={id:e.generateLogId(),timestamp:s.timestamp,level:t,prefix:s.prefix,message:r,args:o,location:s.stackInfo,groupInfo:this.groupDepth>0?{depth:this.groupDepth,groupName:this.currentGroup}:void 0};this.buffer.push(i),this.buffer.length>this.maxSize&&this.buffer.shift()}setGroupInfo(e,t){this.groupDepth=e,this.currentGroup=t}getBufferStats(){const e=this.buffer.reduce((e,t)=>{const r=e[t.level]?e[t.level]:0;return e[t.level]=r+1,e},{});let t,r;if(this.buffer.length>0){const e=this.buffer[0],o=this.buffer[this.buffer.length-1];e&&e.timestamp&&(t=new Date(e.timestamp)),o&&o.timestamp&&(r=new Date(o.timestamp))}return{size:this.buffer.length,maxSize:this.maxSize,usage:this.buffer.length/this.maxSize*100,oldestLog:t,newestLog:r,levelCounts:{debug:e.debug?e.debug:0,info:e.info?e.info:0,warn:e.warn?e.warn:0,error:e.error?e.error:0,critical:e.critical?e.critical:0}}}clearBuffer(){this.buffer=[]}setBufferSize(t){this.maxSize=Math.min(Math.max(t,e.BUFFER_LIMITS.MIN_SIZE),e.BUFFER_LIMITS.MAX_SIZE),this.buffer.length>this.maxSize&&(this.buffer=this.buffer.slice(-this.maxSize))}filterLogs(t={}){let r=[...this.buffer];if(t.levels?.length&&(r=r.filter(e=>t.levels.includes(e.level))),t.prefixes?.length&&(r=r.filter(e=>e.prefix&&t.prefixes.includes(e.prefix))),t.excludePrefixes?.length&&(r=r.filter(e=>!e.prefix||!t.excludePrefixes.includes(e.prefix))),t.since){const o=e.parseTimeInput(t.since);r=r.filter(e=>new Date(e.timestamp)>=o)}if(t.until){const o=e.parseTimeInput(t.until);r=r.filter(e=>new Date(e.timestamp)<=o)}if(t.withStackTrace&&(r=r.filter(e=>e.location)),t.errorsOnly&&(r=r.filter(e=>"error"===e.level||"critical"===e.level)),t.search){const e=t.search.toLowerCase();r=r.filter(t=>t.message.toLowerCase().includes(e)||t.args.some(t=>String(t).toLowerCase().includes(e)))}return t.last&&(r=r.slice(-t.last)),t.first&&(r=r.slice(0,t.first)),r}exportJSON(e,t){const r=e.map(e=>({timestamp:e.timestamp,level:e.level,prefix:e.prefix,message:e.message,...t.minimal?{}:{args:e.args.slice(1),location:e.location,groupInfo:e.groupInfo}}));return t.compact?JSON.stringify(r):JSON.stringify(r,null,2)}exportCSV(t,r){const o=r.minimal?["Timestamp","Level","Prefix","Message"]:["Timestamp","Level","Prefix","Message","File","Line","Args"],s=t.map(t=>{const o=[e.formatDisplayTime(new Date(t.timestamp),"full"),t.level.toUpperCase(),t.prefix||"",`"${t.message.replace(/"/g,'""')}"`];return r.minimal||o.push(t.location?.file||"",t.location?.line?.toString()||"",`"${e.safeStringify(t.args.slice(1)).replace(/"/g,'""')}"`),o});return[o.join(","),...s.map(e=>e.join(","))].join("\n")}exportMarkdown(t,r){const o=/* @__PURE__ */new Date;let s=`# Log Export - ${e.formatDisplayTime(o,"full")}\n\n`;if(!r.minimal){const e=this.getBufferStats();s+="## Summary\n",s+=`- **Total logs**: ${t.length}\n`,s+=`- **Errors**: ${e.levelCounts.error+e.levelCounts.critical}\n`,s+=`- **Warnings**: ${e.levelCounts.warn}\n\n`}if("level"===r.groupBy){const r=t.reduce((e,t)=>{const r=t.level;e[r]||(e[r]=[]);const o=e[r];return o&&o.push(t),e},{});Object.entries(r).forEach(([t,r])=>{const o=this.getLevelEmoji(t);s+=`## ${o} ${t.toUpperCase()} (${r.length})\n\n`,r.forEach(t=>{const r=e.formatDisplayTime(new Date(t.timestamp),"time-only"),o=t.location?` (${t.location.file}:${t.location.line})`:"",i=t.prefix?` **${t.prefix}**:`:"";s+=`- \`${r}\`${i} ${t.message}${o}\n`}),s+="\n"})}else s+="## Logs\n\n",t.forEach(t=>{const r=e.formatDisplayTime(new Date(t.timestamp),"time-only"),o=this.getLevelEmoji(t.level),i=t.location?` (${t.location.file}:${t.location.line})`:"",n=t.prefix?` **${t.prefix}**:`:"";s+=`- \`${r}\` ${o}${n} ${t.message}${i}\n`});return s}exportPlain(t,r){return t.map(t=>{const o=e.formatDisplayTime(new Date(t.timestamp),r.minimal?"time-only":"short"),s=t.level.toUpperCase().padEnd(8),i=t.prefix?`[${t.prefix}] `:"",n=!r.minimal&&t.location?` (${t.location.file}:${t.location.line})`:"";return`${o} ${s} ${i}${t.message}${n}`}).join("\n")}exportHTML(t,r){const o=`Log Export - ${e.formatDisplayTime(/* @__PURE__ */new Date,"full")}`;let s=`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>${o}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 20px; line-height: 1.6; }\n .header { border-bottom: 2px solid #ddd; padding-bottom: 20px; margin-bottom: 20px; }\n .log-entry { margin: 5px 0; padding: 8px; border-radius: 4px; font-family: 'Monaco', 'Consolas', monospace; }\n .timestamp { color: #666; font-size: 0.9em; }\n .level { font-weight: bold; padding: 2px 6px; border-radius: 3px; margin: 0 8px; }\n .prefix { background: #2d3748; color: #e2e8f0; padding: 2px 6px; border-radius: 3px; margin: 0 8px; }\n .location { color: #718096; font-size: 0.9em; }\n .debug { background: #f0f4ff; }\n .info { background: #f0f9ff; }\n .warn { background: #fffbeb; }\n .error { background: #fef2f2; }\n .critical { background: #fef2f2; border-left: 4px solid #dc2626; }\n .level.debug { background: #667eea; color: white; }\n .level.info { background: #74b9ff; color: white; }\n .level.warn { background: #fdcb6e; color: #2d3436; }\n .level.error { background: #e84393; color: white; }\n .level.critical { background: #ff3838; color: white; }\n </style>\n</head>\n<body>\n <div class="header">\n <h1>${o}</h1>\n <p>Generated by Advanced Logger v2.0.0</p>\n </div>\n <div class="logs">`;return t.forEach(t=>{const r=e.formatDisplayTime(new Date(t.timestamp),"full"),o=t.location?` <span class="location">(${e.escapeHtml(t.location.file)}:${t.location.line})</span>`:"",i=t.prefix?` <span class="prefix">${e.escapeHtml(t.prefix)}</span>`:"";s+=`\n <div class="log-entry ${t.level}">\n <span class="timestamp">${r}</span>\n <span class="level ${t.level}">${t.level.toUpperCase()}</span>\n ${i}\n <span class="message">${e.escapeHtml(t.message)}</span>\n ${o}\n </div>`}),s+="\n </div>\n</body>\n</html>",s}getLevelEmoji(e){return{debug:"🐞",info:"ℹ️",warn:"⚠️",error:"❌",critical:"🔥"}[e]||""}export(e,t={},r={}){const o=this.filterLogs(t);let s;switch(e){case"json":s=this.exportJSON(o,r);break;case"csv":s=this.exportCSV(o,r);break;case"markdown":s=this.exportMarkdown(o,r);break;case"plain":s=this.exportPlain(o,r);break;case"html":s=this.exportHTML(o,r);break;default:throw new Error(`Unsupported export format: ${e}`)}return{format:e,data:s,metadata:{totalLogs:this.buffer.length,filteredLogs:o.length,exportedAt:/* @__PURE__ */(new Date).toISOString(),filters:t,options:r}}}async copyToClipboard(e,t={},r={}){const o=this.export(e,t,r);try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(o.data),!0;{const e=document.createElement("textarea");e.value=o.data,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.focus(),e.select();const t=document.execCommand("copy");return document.body.removeChild(e),t}}catch(s){return console.error("Failed to copy to clipboard:",s),!1}}getAllLogs(){return[...this.buffer]}async saveToFile(e,t={},r={}){try{const o=this.export(e,t,r),s=new Blob([o.data],{type:this.getMimeType(e)}),i=URL.createObjectURL(s),n=document.createElement("a"),a=this.generateFilename(e,t);return n.href=i,n.download=a,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(i),!0}catch(o){return console.error("Failed to save file:",o),!1}}getMimeType(e){return{json:"application/json",csv:"text/csv",markdown:"text/markdown",plain:"text/plain",html:"text/html"}[e]||"text/plain"}generateFilename(e,t){const r=/* @__PURE__ */(new Date).toISOString().replace(/[:.]/g,"-").slice(0,-5);return`logs${1===t.prefixes?.length?`_${t.prefixes[0]}`:""}_${r}.${"markdown"===e?"md":e}`}async streamToEndpoint(e,t={},r={}){try{const o=this.filterLogs(t),s=r.batchSize||100,i=r.format||"json";for(let t=0;t<o.length;t+=s){const n=o.slice(t,t+s),a=(this.export(i,{},{compact:!0}),{"Content-Type":"application/json"});r.apiKey&&(a.Authorization=`Bearer ${r.apiKey}`);const l=await fetch(e,{method:"POST",headers:a,body:JSON.stringify({logs:n,metadata:{batchIndex:Math.floor(t/s),totalBatches:Math.ceil(o.length/s),timestamp:/* @__PURE__ */(new Date).toISOString()}})});if(!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`)}return!0}catch(o){return console.error("Failed to stream logs:",o),!1}}exportWithMetadata(e,t={},r={}){const o=this.export(e,t,r),s=this.getBufferStats();return{...o,metadata:{...o.metadata,bufferStats:s,performance:{memoryUsage:this.estimateMemoryUsage(),processingTime:Date.now()},system:{userAgent:"undefined"!=typeof navigator?navigator.userAgent:"Node.js",timestamp:/* @__PURE__ */(new Date).toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}}}estimateMemoryUsage(){const e=this.buffer[0];return e?JSON.stringify(e).length*this.buffer.length:0}}class CommandProcessor{commands=/* @__PURE__ */new Map;aliases=/* @__PURE__ */new Map;plugins=/* @__PURE__ */new Map;history=[];maxHistorySize=100;isInteractiveMode=!1;registerCommand(e){if(this.commands.set(e.name,e),e.aliases)for(const t of e.aliases)this.aliases.set(t,e.name)}registerPlugin(e,t){if(this.plugins.has(e.name))throw new Error(`Plugin ${e.name} is already registered`);this.plugins.set(e.name,e);for(const r of e.commands)this.registerCommand(r);e.initialize&&t&&e.initialize(this,t)}unregisterPlugin(e){const t=this.plugins.get(e);if(t){for(const e of t.commands)if(this.commands.delete(e.name),e.aliases)for(const t of e.aliases)this.aliases.delete(t);t.cleanup&&t.cleanup(),this.plugins.delete(e)}}getCommands(){return Array.from(this.commands.values())}getCommand(e){let t=this.commands.get(e);if(t)return t;const r=this.aliases.get(e);return r?this.commands.get(r):void 0}getHistory(){return[...this.history]}clearHistory(){this.history=[]}getPlugins(){return Array.from(this.plugins.values())}enterInteractiveMode(e){this.isInteractiveMode=!0,e.info("🔧 Interactive CLI mode activated. Type /exit to quit, /help for commands."),"undefined"!=typeof window&&this.setupBrowserInteractiveMode(e)}exitInteractiveMode(){this.isInteractiveMode=!1}setupBrowserInteractiveMode(e){window.cli=t=>this.processCommand(`/${t}`,e),e.info('💡 Use cli("command") to execute CLI commands in browser console.')}async processCommand(e,t){if(!e.startsWith("/"))return t.error("Invalid command. Commands must start with /"),void this.addToHistory(e,!1);const r=e.slice(1).split(" "),o=r[0]||"",s=r.slice(1).join(" "),i=this.getCommand(o);if(!i){t.error(`Unknown command: ${o}. Type /help for available commands.`);const r=this.getSuggestions(o);return r.length>0&&t.info(`📋 Did you mean: ${r.slice(0,3).join(", ")}?`),void this.addToHistory(e,!1)}try{await i.execute(s||"",t),this.addToHistory(e,!0)}catch(n){t.error(`Command '${o}' failed:`,n),this.addToHistory(e,!1)}}addToHistory(e,t){this.history.unshift({command:e,timestamp:/* @__PURE__ */new Date,success:t}),this.history.length>this.maxHistorySize&&(this.history=this.history.slice(0,this.maxHistorySize))}getSuggestions(e){return Array.from(this.commands.keys()).filter(t=>t.startsWith(e))}}class ConfigCommand{name="config";description="Show or update logger configuration";usage="/config [json|key=value,...]";execute(e,t){if(e)try{if(e.startsWith("{")){const r=JSON.parse(e);this.applyConfig(r,t)}else{const r=e.split(",").map(e=>e.trim().split("=")),o={};r.forEach(([e,t])=>{e&&t&&(o[e.trim()]=t.trim().replace(/["']/g,""))}),this.applyConfig(o,t)}}catch(r){t.error("Invalid config format. Use JSON or key=value pairs:",r),t.info('Examples: /config {"theme":"dark"} or /config theme=neon,verbosity=debug')}else this.showStatus(t)}showStatus(e){const t={theme:e.getConfig().theme||"default",verbosity:e.getConfig().verbosity,colors:e.getConfig().enableColors,timestamps:e.getConfig().enableTimestamps,stackTrace:e.getConfig().enableStackTrace,globalPrefix:e.getConfig().globalPrefix||"none",bannerType:e.getConfig().bannerType||"simple",handlers:e.getHandlers().length};e.group("⚙️ Logger Configuration"),e.table(t),e.groupEnd()}applyConfig(e,t){const r=["theme","verbosity","enableColors","enableTimestamps","enableStackTrace","globalPrefix","bannerType"],o=[];Object.entries(e).forEach(([e,s])=>{r.includes(e)?"theme"===e&&"string"==typeof s?(t.setTheme(s),o.push(`${e}=${s}`)):"bannerType"===e&&"string"==typeof s?(t.setBannerType(s),o.push(`${e}=${s}`)):"verbosity"===e?(t.setVerbosity(s),o.push(`${e}=${s}`)):"globalPrefix"===e?(t.setGlobalPrefix(s),o.push(`${e}=${s}`)):(t.updateConfig({[e]:s}),o.push(`${e}=${s}`)):t.warn(`Invalid config key: ${e}`)}),o.length>0&&t.success(`Configuration updated: ${o.join(", ")}`)}}class ThemesCommand{name="themes";description="Show available theme presets";usage="/themes";execute(t,r){r.group("🎨 Available Themes"),Object.keys(o).forEach(t=>{const r=o[t],s=(new e.StyleBuilder).bg(r.info.background).color(r.info.color).padding("4px 8px").rounded("4px").border(r.info.border).build();console.log(`%c${t}`,s,`- ${t} theme preview`)}),r.groupEnd()}}class BannersCommand{name="banners";description="Show available banner types";usage="/banners";execute(e,t){t.group("🖼️ Available Banner Types"),Object.keys(s).forEach(e=>{const t=s[e];console.log(`%c${e}`,"font-weight: bold; color: #667eea;"),console.log("%cPreview:","color: #666; font-size: 12px;"),"simple"===e?console.log(`%c${t.text}`,t.style):"ascii"===e?console.log(`%c${t.text.split("\n").slice(1,4).join("\n")}...`,"font-family: monospace; color: #667eea; font-size: 10px;"):"unicode"===e?console.log(`%c${t.text}`,t.style):console.log(`%c${e} banner`,"color: #666; font-style: italic;")}),t.groupEnd()}}class BannerCommand{name="banner";description="Change or show current banner type";usage="/banner [type]";execute(e,t){e?e in s?(t.setBannerType(e),t.showBanner()):t.error(`Invalid banner type: ${e}. Available: ${Object.keys(s).join(", ")}`):t.showBanner()}}class StatusCommand{name="status";description="Show current logger status and configuration";usage="/status";execute(e,t){const r=t.getConfig(),o={theme:r.theme?r.theme:"default",verbosity:r.verbosity,colors:r.enableColors,timestamps:r.enableTimestamps,stackTrace:r.enableStackTrace,globalPrefix:r.globalPrefix?r.globalPrefix:"none",bannerType:r.bannerType?r.bannerType:"simple",handlers:t.getHandlers().length,bufferSize:r.bufferSize?r.bufferSize:1e3};t.group("⚙️ Logger Configuration"),t.table(o),t.groupEnd();const s=t.getExportHandler();if(s){const e=s.getBufferStats();t.group("📊 Buffer Statistics"),t.table({size:`${e.size}/${e.maxSize}`,usage:`${e.usage.toFixed(1)}%`,oldestLog:e.oldestLog?e.oldestLog.toISOString():"None",newestLog:e.newestLog?e.newestLog.toISOString():"None",errorCount:e.levelCounts.error+e.levelCounts.critical,warningCount:e.levelCounts.warn}),t.groupEnd()}}}class ResetCommand{name="reset";description="Reset logger configuration to defaults";usage="/reset";execute(e,t){t.resetConfig()}}class DemoCommand{name="demo";description="Show comprehensive feature demonstration";usage="/demo";execute(e,t){t.group("🎪 Advanced Logger Demo"),t.debug("Debug message with detailed information"),t.info("Informational message about system state"),t.warn("Warning about deprecated feature"),t.error("Error processing user request"),t.success("Operation completed successfully"),t.critical("Critical system failure detected"),t.group("📊 Advanced Features Demo"),t.table([{feature:"Styled Console",status:"✅ Active",performance:"Excellent"},{feature:"Theme System",status:"✅ Active",performance:"Great"},{feature:"CLI Interface",status:"✅ Active",performance:"Good"},{feature:"Export System",status:"✅ Active",performance:"Excellent"}]),t.time("demo-operation"),setTimeout(()=>{t.timeEnd("demo-operation")},100),t.logWithSVG("SVG Demo"),t.logAnimated("🌟 Animated Logger Demo 🌟",2),t.groupEnd(),t.groupEnd(),t.info("Demo completed! Check the console for styled output.")}}function parseArguments(t){const r={},o={};let s;if(!t.trim())return{filters:r,options:o};const i=t.match(/(?:[^\s"]+|"[^"]*")+/g)||[];for(let n=0;n<i.length;n++){const t=i[n];if(t)if(0!==n||t.startsWith("--")||!(t in e.EXPORT_FORMATS)){if(t.startsWith("--")){const[e,s]=t.slice(2).split("=");switch(e){case"level":case"levels":s&&(r.levels=s.split(",").map(e=>e.trim()));break;case"since":s&&(r.since=s);break;case"until":s&&(r.until=s);break;case"prefix":case"prefixes":s&&(r.prefixes=s.split(",").map(e=>e.trim()));break;case"exclude-prefix":case"exclude-prefixes":s&&(r.excludePrefixes=s.split(",").map(e=>e.trim()));break;case"last":s&&(r.last=parseInt(s,10));break;case"first":s&&(r.first=parseInt(s,10));break;case"search":s&&(r.search=s.replace(/['"]/g,""));break;case"with-stack":r.withStackTrace=!0;break;case"errors-only":r.errorsOnly=!0;break;case"group-by":s&&(r.groupBy=s,o.groupBy=s);break;case"minimal":o.minimal=!0;break;case"compact":o.compact=!0;break;case"styled":o.styled=!0}}}else s=t}return{filters:r,options:o,format:s}}class ExportCommand{name="export";description="Export logs to various formats";usage="/export <format> [--filter=value] [--option]";execute(t,r){const o=r.getExportHandler();if(!o)return void r.error("Export handler not available. Make sure ExportLogHandler is registered.");const{filters:s,options:i,format:n}=parseArguments(t);if(!n)return r.error("Format required. Available formats: "+Object.keys(e.EXPORT_FORMATS).join(", ")),r.info("Usage: /export <format> [--filter=value]"),void r.info("Example: /export json --level=error,warn --last=50");try{const e=o.export(n,s,i);r.success(`✅ Export completed: ${e.metadata.filteredLogs} logs exported in ${n} format`),e.data.length<1e3?(r.group(`📄 Preview (${n.toUpperCase()})`),console.log(e.data),r.groupEnd()):r.info(`📄 Export size: ${(e.data.length/1024).toFixed(2)}KB`),r.table({format:e.format,totalLogs:e.metadata.totalLogs,filtered:e.metadata.filteredLogs,exported:e.metadata.exportedAt})}catch(a){r.error("Export failed:",a)}}}class CopyCommand{name="copy";description="Copy logs to clipboard";usage="/copy <format> [--filter=value] [--option]";async execute(t,r){const o=r.getExportHandler();if(!o)return void r.error("Export handler not available. Make sure ExportLogHandler is registered.");const{filters:s,options:i,format:n}=parseArguments(t);if(!n)return r.error("Format required. Available formats: "+Object.keys(e.EXPORT_FORMATS).join(", ")),r.info("Usage: /copy <format> [--filter=value]"),void r.info("Example: /copy plain --level=error --last=25");try{if(await o.copyToClipboard(n,s,i)){const e=o.export(n,s,i);r.success(`📋 Copied ${e.metadata.filteredLogs} logs to clipboard (${n} format)`)}else r.error("Failed to copy to clipboard. Browser may not support clipboard API.")}catch(a){r.error("Copy failed:",a)}}}class BufferSizeCommand{name="buffer-size";description="Set log buffer size";usage="/buffer-size <size>";execute(e,t){const r=t.getExportHandler();if(!r)return void t.error("Export handler not available.");const o=parseInt(e.trim(),10);if(isNaN(o)||o<=0)return t.error("Invalid buffer size. Must be a positive number."),void t.info("Example: /buffer-size 2000");r.setBufferSize(o),t.success(`Buffer size set to ${o}`)}}class ClearBufferCommand{name="clear-buffer";description="Clear the log buffer";usage="/clear-buffer";execute(e,t){const r=t.getExportHandler();if(!r)return void t.error("Export handler not available.");const o=r.getBufferStats();r.clearBuffer(),t.success(`✅ Buffer cleared. Removed ${o.size} log entries.`)}}class BufferInfoCommand{name="buffer-info";description="Show buffer statistics and information";usage="/buffer-info";execute(e,t){const r=t.getExportHandler();if(!r)return void t.error("Export handler not available.");const o=r.getBufferStats();t.group("📊 Buffer Information"),t.table({size:`${o.size}/${o.maxSize}`,usage:`${o.usage.toFixed(1)}%`,oldestLog:o.oldestLog?.toLocaleString()||"None",newestLog:o.newestLog?.toLocaleString()||"None"}),t.group("📈 Log Level Counts"),t.table(o.levelCounts),t.groupEnd(),t.groupEnd()}}class HelpCommand{name="help";description="Show CLI help and available commands";usage="/help [command]";execute(t,r){const o=(new e.StyleBuilder).bg("linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%)").color("#495057").padding("15px 20px").rounded("8px").border("1px solid #dee2e6").font("Monaco, Consolas, monospace").size("13px").build();console.log('%c\n╭─────────────── ADVANCED LOGGER CLI COMMANDS ─────────────────╮\n│ │\n│ CONFIGURATION │\n│ /config Show current configuration │\n│ /config {json} Apply JSON configuration │\n│ /config key=val Apply key-value configuration │\n│ /themes Show available themes │\n│ /banners Show available banner types │\n│ /banner [type] Change/show banner type │\n│ /status Show logger status & buffer stats │\n│ /demo Show feature demonstration │\n│ /reset Reset to default configuration │\n│ │\n│ EXPORT & CLIPBOARD │\n│ /export <format> Export logs (json|csv|md|plain|html) │\n│ /copy <format> Copy logs to clipboard │\n│ /buffer-size N Set log buffer size │\n│ /buffer-info Show buffer statistics │\n│ /clear-buffer Clear stored logs │\n│ │\n│ EXPORT FILTERS (for export/copy commands) │\n│ --level error,warn Filter by log levels │\n│ --since 2h Logs from last 2 hours │\n│ --until 1h Logs until 1 hour ago │\n│ --prefix API,DB Filter by prefixes │\n│ --exclude-prefix INT Exclude prefixes │\n│ --last 50 Last 50 logs only │\n│ --first 25 First 25 logs only │\n│ --search "error" Search in log messages │\n│ --with-stack Only logs with stack traces │\n│ --errors-only Only error + critical logs │\n│ --group-by level Group by level/prefix/hour │\n│ │\n│ EXPORT OPTIONS │\n│ --minimal Minimal output format │\n│ --compact Remove extra whitespace │\n│ --styled Include styling (HTML format) │\n│ │\n├──────────────────── CONFIGURATION OPTIONS ─────────────────┤\n│ │\n│ theme: default | dark | light | neon | minimal | cyberpunk│\n│ bannerType: simple | ascii | unicode | svg | animated │\n│ verbosity: debug | info | warn | error | critical | silent│\n│ enableColors: true | false │\n│ enableTimestamps: true | false │\n│ enableStackTrace: true | false │\n│ globalPrefix: "string" │\n│ bufferSize: number (50-10000) │\n│ │\n├──────────────────────── EXAMPLES ──────────────────────────┤\n│ │\n│ Basic Configuration: │\n│ /config {"theme":"dark","verbosity":"debug"} │\n│ /config theme=neon,bufferSize=2000 │\n│ /banner animated Change to animated banner │\n│ │\n│ Export Examples: │\n│ /export json --level=error,warn --last=25 │\n│ /export csv --since=2h --prefix=API │\n│ /export markdown --group-by=level --errors-only │\n│ /export html --styled --since=1h │\n│ │\n│ Clipboard Examples: │\n│ /copy plain --minimal --last=10 │\n│ /copy json --search="authentication" --compact │\n│ /copy csv --since=30m --exclude-prefix=DEBUG │\n│ │\n│ Buffer Management: │\n│ /buffer-size 5000 Increase buffer to 5000 logs │\n│ /buffer-info Show detailed buffer statistics │\n│ /clear-buffer Clear all stored logs │\n│ │\n│ Time Formats: │\n│ --since=2h 2 hours ago │\n│ --since=30m 30 minutes ago │\n│ --since=1d 1 day ago │\n│ --since="2024-01-01T10:00:00Z" Specific ISO date │\n│ │\n╰─────────────────────────────────────────────────────────────╯',o),r.group("💡 Quick Tips"),["Use /demo to see all logger features in action","Logs are automatically stored in a circular buffer for export","Export formats: JSON (structured), CSV (Excel), Markdown (readable), Plain (simple), HTML (styled)","Time filters support relative (2h, 30m) and absolute (ISO) formats",'Combine multiple filters: /export json --level=error --since=1h --search="auth"',"Use /copy for quick clipboard access instead of /export"].forEach(e=>{r.info(`• ${e}`)}),r.groupEnd()}}class HistoryCommand{name="history";description="Show command execution history";usage="/history [limit] - Show recent commands (default: 10)";category="system";aliases=["hist","h"];execute(e,t){const r=t.cliProcessor;if(!r)return void t.error("CLI processor not available");const o=parseInt(e)||10,s=r.getHistory().slice(0,o);0!==s.length?(t.info(`📋 Last ${s.length} commands:`),s.forEach((e,r)=>{const o=e.success?"✅":"❌",s=e.timestamp.toLocaleTimeString();t.info(`${o} [${s}] ${e.command}`)})):t.info("📝 No command history available")}}class ClearHistoryCommand{name="clearhistory";description="Clear command execution history";usage="/clearhistory - Remove all command history";category="system";aliases=["clrhist"];execute(e,t){const r=t.cliProcessor;r?(r.clearHistory(),t.success("🗑️ Command history cleared")):t.error("CLI processor not available")}}class InteractiveCommand{name="interactive";description="Enter interactive CLI mode";usage="/interactive - Start interactive command mode";category="system";aliases=["i","repl"];execute(e,t){const r=t.cliProcessor;r?r.enterInteractiveMode(t):t.error("CLI processor not available")}}class PluginsCommand{name="plugins";description="List loaded CLI plugins";usage="/plugins - Show all registered plugins";category="system";aliases=["plug"];execute(e,t){const r=t.cliProcessor;if(!r)return void t.error("CLI processor not available");const o=r.getPlugins();0!==o.length?(t.info(`🔌 Loaded plugins (${o.length}):`),o.forEach(e=>{t.info(` 📦 ${e.name} v${e.version} - ${e.description}`),t.info(` Commands: ${e.commands.map(e=>e.name).join(", ")}`)})):t.info("🔌 No plugins registered")}}let a=o.default;class Logger{config;scopedPrefix;handlers=[];timers=/* @__PURE__ */new Map;groupDepth=0;exportHandler;cliProcessor;themeChangeListener;badgeList=[];displaySettings={showTimestamp:!0,showLocation:!0,showBadges:!0};serializerRegistry;hookManager;transportManager;constructor(t={}){this.config={...e.DEFAULT_CONFIG,...t},this.serializerRegistry=new SerializerRegistry,this.hookManager=new HookManager,this.config.bufferSize&&(this.exportHandler=new ExportLogHandler(this.config.bufferSize),this.handlers.push(this.exportHandler)),this.cliProcessor=function(){const e=new CommandProcessor;return e.registerCommand(new HelpCommand),e.registerCommand(new ConfigCommand),e.registerCommand(new ThemesCommand),e.registerCommand(new BannersCommand),e.registerCommand(new BannerCommand),e.registerCommand(new StatusCommand),e.registerCommand(new ResetCommand),e.registerCommand(new DemoCommand),e.registerCommand(new ExportCommand),e.registerCommand(new CopyCommand),e.registerCommand(new BufferSizeCommand),e.registerCommand(new ClearBufferCommand),e.registerCommand(new BufferInfoCommand),e.registerCommand(new HistoryCommand),e.registerCommand(new ClearHistoryCommand),e.registerCommand(new InteractiveCommand),e.registerCommand(new PluginsCommand),e}(),this.config.autoDetectTheme&&this.setupAutoThemeDetection()}setupAutoThemeDetection(){this.themeChangeListener&&(this.themeChangeListener(),this.themeChangeListener=null),this.themeChangeListener=e.setupThemeChangeListener(e=>{this.debug(`DevTools theme changed to: ${e}`)})}getConfig(){return{...this.config}}updateConfig(e){const t=this.config.autoDetectTheme;this.config={...this.config,...e},void 0!==e.autoDetectTheme&&e.autoDetectTheme!==t&&(e.autoDetectTheme?this.setupAutoThemeDetection():this.themeChangeListener&&(this.themeChangeListener(),this.themeChangeListener=null))}setGlobalPrefix(e){this.config.globalPrefix=e}setVerbosity(e){this.config.verbosity=e}setTheme(e){if(hasPreset(e))this.preset(e);else if(e in o){if(a=o[e],this.config.theme=e,e in i){const t=i[e];console.log(`%c${t.simple}`,t.style)}this.success(`Theme changed to: ${e}`)}else this.error(`Invalid theme: ${e}. Available:`,[...getAvailablePresets(),...Object.keys(o)])}setBannerType(e){this.config.bannerType=e,this.success(`Banner type changed to: ${e}`)}resetConfig(){this.themeChangeListener&&(this.themeChangeListener(),this.themeChangeListener=null),this.config={...e.DEFAULT_CONFIG},a=o.default,this.config.autoDetectTheme&&this.setupAutoThemeDetection(),this.success("Logger configuration reset to defaults")}cleanup(){this.themeChangeListener&&(this.themeChangeListener(),this.themeChangeListener=null),this.transportManager?.close().catch(()=>{})}preset(t){if(!hasPreset(t))return void this.error(`Unknown preset: ${t}. Available presets:`,getAvailablePresets());const r=function(e){return n[e]||null}(t);r&&(this.displaySettings.showTimestamp=r.timestamp?.show??!0,this.displaySettings.showLocation=r.location?.show??!0,this._activePreset=r,this._activePresetName=t,"browser"===e.getEnvironment()&&this.success(`Applied preset: ${t}`))}presets(){return getAvailablePresets()}hideTimestamp(){return this.displaySettings.showTimestamp=!1,this}showTimestamp(){return this.displaySettings.showTimestamp=!0,this}hideLocation(){return this.displaySettings.showLocation=!1,this}showLocation(){return this.displaySettings.showLocation=!0,this}hideBadges(){return this.displaySettings.showBadges=!1,this}showBadges(){return this.displaySettings.showBadges=!0,this}badges(e){return this.badgeList=[...e],this}badge(e){return this.badgeList.includes(e)||this.badgeList.push(e),this}clearBadges(){return this.badgeList=[],this}component(e){return new ComponentLogger(this,e)}api(e){return new APILogger(this,e)}scope(e){return new ScopedLogger(this,e)}customize(e){void 0!==e.timestamp?.show&&(this.displaySettings.showTimestamp=e.timestamp.show),void 0!==e.location?.show&&(this.displaySettings.showLocation=e.location.show),e.prefix,this._customization=e,this.success("Customization applied")}styles(){return new LogStyleBuilder(this)}addHandler(e){this.handlers.push(e)}getHandlers(){return[...this.handlers]}getExportHandler(){return this.exportHandler}addSerializer(e,t,r){this.serializerRegistry.add(e,t,r)}removeSerializer(e){return this.serializerRegistry.remove(e)}getSerializerRegistry(){return this.serializerRegistry}on(e,t,r){return this.hookManager.on(e,t,r)}once(e,t,r){return this.hookManager.once(e,t,r)}off(e,t){return this.hookManager.off(e,t)}use(e,t){return this.hookManager.use(e,t)}getHookManager(){return this.hookManager}addTransport(e){return this.transportManager||(this.transportManager=new TransportManager),this.transportManager.add(e)}removeTransport(e){return this.transportManager?.remove(e)??!1}async flushTransports(){await(this.transportManager?.flush())}async closeTransports(){await(this.transportManager?.close())}getTransportManager(){return this.transportManager}shouldLog(e){if("silent"===this.config.verbosity)return!1;const t={debug:0,info:1,warn:2,error:3,critical:4};return t[e]>=t[this.config.verbosity]}getEffectivePrefix(){const e=[this.config.globalPrefix,this.scopedPrefix].filter(Boolean);return e.length>0?e.join(":"):void 0}log(t,...r){if(!this.shouldLog(t))return;const o=this.config.enableStackTrace?e.parseStackTrace():null,s=this.getEffectivePrefix(),i=e.formatTimestamp(),n=r.map(e=>this.serializerRegistry.serialize(e));let l=n.length>0?String(n[0]):"";if(this.badgeList.length>0&&this.displaySettings.showBadges){const e=this.badgeList.map(e=>`[${e}]`).join("");l=e+" "+l}const c=n.slice(1);let d={level:t,message:l,args:n,timestamp:i,prefix:s,stackInfo:o||void 0};this.hookManager.emit("beforeLog",d).then(e=>{l=e.message}).catch(()=>{});const[p,...g]=e.createStyledOutput(t,a,s,l,this.displaySettings.showLocation?o:null,this.config.autoDetectTheme,this._activePreset,this._activePresetName),h=" ".repeat(this.groupDepth)+p;c.length>0?console.log(h,...g,...c):console.log(h,...g),this.exportHandler&&this.exportHandler.setGroupInfo(this.groupDepth);const f={timestamp:i,level:t,prefix:s,stackInfo:o||void 0};if(this.handlers.forEach(e=>{try{e.handle(t,l,n,f)}catch(r){console.error("Log handler failed:",r)}}),this.transportManager){const e={level:t,levelValue:{debug:0,info:1,warn:2,error:3,critical:4}[t],time:Date.now(),msg:l,prefix:s,location:o?{file:o.file,line:o.line,column:o.column,function:o.function}:void 0};this.transportManager.write(e).catch(()=>{})}this.hookManager.emit("afterLog",d).catch(()=>{})}logWithBindings(e,t,...r){if(!this.shouldLog(t))return;let o="";e.badges?.length&&(o+=e.badges.map(e=>`[${e}]`).join("")),e.scope&&(o+=`[${e.scope}] `),o&&r.length>0&&(r[0]=o+String(r[0])),this.log(t,...r)}debug(...e){this.log("debug",...e)}info(...e){this.log("info",...e)}warn(...e){this.log("warn",...e)}error(...e){this.log("error",...e)}success(...t){if(!this.shouldLog("info"))return;const r=this.config.enableStackTrace?e.parseStackTrace():null,o=this.getEffectivePrefix(),s=t.length>0?String(t[0]):"",i=t.slice(1),[n,...l]=e.createStyledOutput("info",a,o,s,this.displaySettings.showLocation?r:null,this.config.autoDetectTheme,this._activePreset,this._activePresetName),c=a.success;let d="✅",p="SUCCESS";c&&(c.emoji&&(d=c.emoji),c.label&&(p=c.label));const g=n.replace(/ℹ️ INFO/,`${d} ${p}`),h=" ".repeat(this.groupDepth)+g;i.length>0?console.log(h,...l,...i):console.log(h,...l);const f={timestamp:e.formatTimestamp(),level:"info",prefix:o,stackInfo:r||void 0};this.handlers.forEach(e=>{try{e.handle("info",s,t,f)}catch(r){console.error("Log handler failed:",r)}})}trace(...e){this.log("debug",...e),this.shouldLog("debug")&&console.trace(...e)}critical(...e){this.log("critical",...e)}table(t,r){if(!this.shouldLog("info"))return;const o=this.getEffectivePrefix(),s=e.StylePresets.accent().build(),i="%c📊 TABLE"+(o?` [${o}]`:"");console.log(i,s),r?console.table(t,r):console.table(t)}group(t,r=!1){const o=(new e.StyleBuilder).bg("linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%)").color("#1565c0").border("1px solid #90caf9").padding("4px 12px").rounded("6px").bold().build(),s=`%c📁 ${t}`;r?console.groupCollapsed(s,o):console.group(s,o),this.groupDepth++}groupEnd(){this.groupDepth>0&&(console.groupEnd(),this.groupDepth--)}time(t){const r={label:t,startTime:performance.now()};this.timers.set(t,r);const o=e.StylePresets.warning().build();console.log(`%c⏱️ Timer started: ${t}`,o)}timeEnd(t){const r=this.timers.get(t);if(!r)return void this.warn(`Timer '${t}' does not exist`);const o=performance.now()-r.startTime;this.timers.delete(t);const s=e.StylePresets.success().build();console.log(`%c⏱️ Timer ended: ${t} - ${o.toFixed(2)}ms`,s)}showBanner(e){displayInitBanner(e||this.config.bannerType)}logWithSVG(t,r,o={}){const{width:s=300,height:i=60,padding:n="30px 150px"}=o;let a="";a=r?`data:image/svg+xml,${encodeURIComponent(r)}`:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${s} ${i}'><defs><linearGradient id='grad' x1='0%' y1='0%' x2='100%' y2='0%'><stop offset='0%' style='stop-color:%23667eea'/><stop offset='100%' style='stop-color:%23764ba2'/></linearGradient></defs><rect width='100%' height='100%' fill='url(%23grad)' rx='4'/><text x='${s/2}' y='${i/2+5}' text-anchor='middle' fill='white' font-family='monospace' font-size='14' font-weight='bold'>${t}</text></svg>`)}`;const l=(new e.StyleBuilder).bg(`url("${a}") no-repeat center center`).padding(n).color("transparent").rounded("4px").build();console.log(`%c${t}`,l)}logAnimated(t,r=3){if(!document.getElementById("logger-animations")){const e=document.createElement("style");e.id="logger-animations",e.textContent="\n @keyframes loggerGradient {\n 0% { background-position: 0% 50%; }\n 50% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n ",document.head.appendChild(e)}const o=(new e.StyleBuilder).bg("linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2)").css("background-size","400% 400%").color("#ffffff").padding("12px 20px").rounded("8px").bold().font("Monaco, Consolas, monospace").animation(`loggerGradient ${r}s ease infinite`).display("inline-block").build();console.log(`%c${t}`,o)}logGrouped(e,t){try{let r;r=Object.groupBy?Object.groupBy(e,t):e.reduce((e,r)=>{const o=t(r);return e[o]||(e[o]=[]),e[o].push(r),e},{}),Object.entries(r).forEach(([e,t])=>{this.group(`Group: ${e}`),this.table(t),this.groupEnd()})}catch{this.info("Grouped data:",e)}}async cli(e){this.cliProcessor?await this.cliProcessor.processCommand(e,this):this.error("CLI processor not initialized")}}let l=null;!function(){if(!l){l=new Logger({verbosity:"info",enableColors:!0,enableTimestamps:!0,enableStackTrace:!0,bufferSize:1e3});try{displayInitBanner()}catch(e){}}}(),exports.APILogger=APILogger,exports.BANNER_VARIANTS=s,exports.ComponentLogger=ComponentLogger,exports.ContextLogger=ContextLogger,exports.ExportLogHandler=ExportLogHandler,exports.HookManager=HookManager,exports.Logger=Logger,exports.ScopedLogger=ScopedLogger,exports.SerializerRegistry=SerializerRegistry,exports.THEME_BANNERS=i,exports.THEME_PRESETS=o,exports.TransportManager=TransportManager,exports.displayInitBanner=displayInitBanner;
|
|
2
|
+
//# sourceMappingURL=Logger-BV0v1AyC.js.map
|