{"version":3,"file":"index-BlRAn3qV.js","sources":["../../node_modules/@azure/logger/dist/browser/log.common.js","../../node_modules/@azure/logger/dist/browser/debug.js","../../node_modules/@azure/logger/dist/browser/index.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nexport function log(...args) {\n if (args.length > 0) {\n const firstArg = String(args[0]);\n if (firstArg.includes(\":error\")) {\n console.error(...args);\n }\n else if (firstArg.includes(\":warning\")) {\n console.warn(...args);\n }\n else if (firstArg.includes(\":info\")) {\n console.info(...args);\n }\n else if (firstArg.includes(\":verbose\")) {\n console.debug(...args);\n }\n else {\n console.debug(...args);\n }\n }\n}\n//# sourceMappingURL=log.common.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { log } from \"./log.js\";\nconst debugEnvVariable = (typeof process !== \"undefined\" && process.env && process.env.DEBUG) || undefined;\nlet enabledString;\nlet enabledNamespaces = [];\nlet skippedNamespaces = [];\nconst debuggers = [];\nif (debugEnvVariable) {\n enable(debugEnvVariable);\n}\nconst debugObj = Object.assign((namespace) => {\n return createDebugger(namespace);\n}, {\n enable,\n enabled,\n disable,\n log,\n});\nfunction enable(namespaces) {\n enabledString = namespaces;\n enabledNamespaces = [];\n skippedNamespaces = [];\n const wildcard = /\\*/g;\n const namespaceList = namespaces.split(\",\").map((ns) => ns.trim().replace(wildcard, \".*?\"));\n for (const ns of namespaceList) {\n if (ns.startsWith(\"-\")) {\n skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`));\n }\n else {\n enabledNamespaces.push(new RegExp(`^${ns}$`));\n }\n }\n for (const instance of debuggers) {\n instance.enabled = enabled(instance.namespace);\n }\n}\nfunction enabled(namespace) {\n if (namespace.endsWith(\"*\")) {\n return true;\n }\n for (const skipped of skippedNamespaces) {\n if (skipped.test(namespace)) {\n return false;\n }\n }\n for (const enabledNamespace of enabledNamespaces) {\n if (enabledNamespace.test(namespace)) {\n return true;\n }\n }\n return false;\n}\nfunction disable() {\n const result = enabledString || \"\";\n enable(\"\");\n return result;\n}\nfunction createDebugger(namespace) {\n const newDebugger = Object.assign(debug, {\n enabled: enabled(namespace),\n destroy,\n log: debugObj.log,\n namespace,\n extend,\n });\n function debug(...args) {\n if (!newDebugger.enabled) {\n return;\n }\n if (args.length > 0) {\n args[0] = `${namespace} ${args[0]}`;\n }\n newDebugger.log(...args);\n }\n debuggers.push(newDebugger);\n return newDebugger;\n}\nfunction destroy() {\n const index = debuggers.indexOf(this);\n if (index >= 0) {\n debuggers.splice(index, 1);\n return true;\n }\n return false;\n}\nfunction extend(namespace) {\n const newDebugger = createDebugger(`${this.namespace}:${namespace}`);\n newDebugger.log = this.log;\n return newDebugger;\n}\nexport default debugObj;\n//# sourceMappingURL=debug.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport debug from \"./debug.js\";\nconst registeredLoggers = new Set();\nconst logLevelFromEnv = (typeof process !== \"undefined\" && process.env && process.env.AZURE_LOG_LEVEL) || undefined;\nlet azureLogLevel;\n/**\n * The AzureLogger provides a mechanism for overriding where logs are output to.\n * By default, logs are sent to stderr.\n * Override the `log` method to redirect logs to another location.\n */\nexport const AzureLogger = debug(\"azure\");\nAzureLogger.log = (...args) => {\n debug.log(...args);\n};\nconst AZURE_LOG_LEVELS = [\"verbose\", \"info\", \"warning\", \"error\"];\nif (logLevelFromEnv) {\n // avoid calling setLogLevel because we don't want a mis-set environment variable to crash\n if (isAzureLogLevel(logLevelFromEnv)) {\n setLogLevel(logLevelFromEnv);\n }\n else {\n console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(\", \")}.`);\n }\n}\n/**\n * Immediately enables logging at the specified log level. If no level is specified, logging is disabled.\n * @param level - The log level to enable for logging.\n * Options from most verbose to least verbose are:\n * - verbose\n * - info\n * - warning\n * - error\n */\nexport function setLogLevel(level) {\n if (level && !isAzureLogLevel(level)) {\n throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(\",\")}`);\n }\n azureLogLevel = level;\n const enabledNamespaces = [];\n for (const logger of registeredLoggers) {\n if (shouldEnable(logger)) {\n enabledNamespaces.push(logger.namespace);\n }\n }\n debug.enable(enabledNamespaces.join(\",\"));\n}\n/**\n * Retrieves the currently specified log level.\n */\nexport function getLogLevel() {\n return azureLogLevel;\n}\nconst levelMap = {\n verbose: 400,\n info: 300,\n warning: 200,\n error: 100,\n};\n/**\n * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`.\n * @param namespace - The name of the SDK package.\n * @hidden\n */\nexport function createClientLogger(namespace) {\n const clientRootLogger = AzureLogger.extend(namespace);\n patchLogMethod(AzureLogger, clientRootLogger);\n return {\n error: createLogger(clientRootLogger, \"error\"),\n warning: createLogger(clientRootLogger, \"warning\"),\n info: createLogger(clientRootLogger, \"info\"),\n verbose: createLogger(clientRootLogger, \"verbose\"),\n };\n}\nfunction patchLogMethod(parent, child) {\n child.log = (...args) => {\n parent.log(...args);\n };\n}\nfunction createLogger(parent, level) {\n const logger = Object.assign(parent.extend(level), {\n level,\n });\n patchLogMethod(parent, logger);\n if (shouldEnable(logger)) {\n const enabledNamespaces = debug.disable();\n debug.enable(enabledNamespaces + \",\" + logger.namespace);\n }\n registeredLoggers.add(logger);\n return logger;\n}\nfunction shouldEnable(logger) {\n return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]);\n}\nfunction isAzureLogLevel(logLevel) {\n return AZURE_LOG_LEVELS.includes(logLevel);\n}\n//# sourceMappingURL=index.js.map"],"names":["log","args","firstArg","debugEnvVariable","define_process_env_default","enabledString","enabledNamespaces","skippedNamespaces","debuggers","enable","debugObj","namespace","createDebugger","enabled","disable","namespaces","wildcard","namespaceList","ns","instance","skipped","enabledNamespace","result","newDebugger","debug","destroy","extend","index","registeredLoggers","logLevelFromEnv","azureLogLevel","AzureLogger","AZURE_LOG_LEVELS","isAzureLogLevel","setLogLevel","level","logger","shouldEnable","getLogLevel","levelMap","createClientLogger","clientRootLogger","patchLogMethod","createLogger","parent","child","logLevel"],"mappings":"AAEO,SAASA,KAAOC,EAAM,CACzB,GAAIA,EAAK,OAAS,EAAG,CACjB,MAAMC,EAAW,OAAOD,EAAK,CAAC,CAAC,EAC3BC,EAAS,SAAS,QAAQ,EAC1B,QAAQ,MAAM,GAAGD,CAAI,EAEhBC,EAAS,SAAS,UAAU,EACjC,QAAQ,KAAK,GAAGD,CAAI,EAEfC,EAAS,SAAS,OAAO,EAC9B,QAAQ,KAAK,GAAGD,CAAI,EAEfC,EAAS,SAAS,UAAU,EACjC,QAAQ,MAAM,GAAGD,CAAI,EAGrB,QAAQ,MAAM,GAAGA,CAAI,CAEjC,CACA,6BClBA,MAAME,EAAoB,OAAO,QAAY,KAAeC,GAAeA,EAAY,OAAU,OACjG,IAAIC,EACAC,EAAoB,CAAC,EACrBC,EAAoB,CAAC,EACzB,MAAMC,EAAY,CAAC,EACfL,GACAM,EAAON,CAAgB,EAE3B,MAAMO,EAAW,OAAO,OAAQC,GACrBC,EAAeD,CAAS,EAChC,CACC,OAAAF,EACA,QAAAI,EACA,QAAAC,EACA,IAAAd,CACJ,CAAC,EACD,SAASS,EAAOM,EAAY,CACRV,EAAAU,EAChBT,EAAoB,CAAC,EACrBC,EAAoB,CAAC,EACrB,MAAMS,EAAW,MACXC,EAAgBF,EAAW,MAAM,GAAG,EAAE,IAAKG,GAAOA,EAAG,KAAK,EAAE,QAAQF,EAAU,KAAK,CAAC,EAC1F,UAAWE,KAAMD,EACTC,EAAG,WAAW,GAAG,EACCX,EAAA,KAAK,IAAI,OAAO,IAAIW,EAAG,OAAO,CAAC,CAAC,GAAG,CAAC,EAGtDZ,EAAkB,KAAK,IAAI,OAAO,IAAIY,CAAE,GAAG,CAAC,EAGpD,UAAWC,KAAYX,EACVW,EAAA,QAAUN,EAAQM,EAAS,SAAS,CAErD,CACA,SAASN,EAAQF,EAAW,CACpB,GAAAA,EAAU,SAAS,GAA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