{"version":3,"sources":["jsdelivr-header.js","/npm/continuation-local-variable@1.0.4/continuation-local-variable.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,MAAM,YAAc,QAAQ,eACtB,GAAK,QAAQ,MACb,KAAO,QAAQ,QAErB,SAAS,SAAS,GAChB,GAAG,UAAU,EAAG,GAAG,KAAK,UAAU,OACpC,CAEA,MAAM,SACJ,WAAA,CAAY,GACV,IAAI,EAAO,KACX,EAAK,KAAO,EACZ,EAAK,KAAO,CAAC,EACb,EAAK,WAAQ,EACb,EAAK,KAAQ,YAAY,WAAW,CAClC,IAAA,CAAK,EAAS,EAAM,EAAgB,GAAY,EAAK,KAAK,EAAU,EACpE,MAAA,CAAO,GAAW,EAAK,QAAQ,EAAU,EACzC,KAAA,CAAM,GAAW,EAAK,QAAQ,EAAU,EACxC,OAAA,CAAQ,GAAW,EAAK,QAAQ,EAAU,IAE5C,EAAK,KAAK,QACZ,CAEA,GAAA,CAAI,GAAS,KAAK,MAAQ,CAAO,CAEjC,GAAA,CAAI,GAAS,OAAO,KAAK,KAAO,CAEhC,IAAA,CAAK,GAAW,KAAK,KAAK,GAAW,KAAK,KAAO,CAEjD,OAAA,CAAQ,GAAW,KAAK,MAAQ,KAAK,KAAK,EAAU,CAEpD,OAAA,CAAQ,UAAkB,KAAK,KAAK,EAAU,EAGhD,MAAM,UAAY,CAAC,EAEnB,OAAO,QAAU,CACf,OAAQ,SAAU,GAChB,MAAM,EAAW,IAAI,SAAS,GAE9B,OADA,UAAU,GAAQ,EACX,CACT,EACA,KAAM,SAAU,GACd,OAAO,UAAU,EACnB","file":"/npm/continuation-local-variable@1.0.4/continuation-local-variable.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/continuation-local-variable@1.0.4/continuation-local-variable.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nconst async_hooks = require('async_hooks');\nconst fs = require('fs');\nconst util = require('util');\n\nfunction debug(...args) {\n  fs.writeSync(1, `${util.format(...args)}\\n`);\n}\n\nclass Variable {\n  constructor(name) {\n    var self = this;\n    self.name = name;\n    self.memo = {};\n    self.value = undefined;\n    self.hook =  async_hooks.createHook({\n      init(asyncId, type, triggerAsyncId, resource) { self.save(asyncId); },\n      before(asyncId) { self.restore(asyncId); },\n      after(asyncId) { self.restore(asyncId); },\n      destroy(asyncId) { self.destroy(asyncId); }\n    });\n    self.hook.enable();\n  }\n\n  set(value) { this.value = value; }\n\n  get(value) { return this.value; }\n\n  save(asyncId) { this.memo[asyncId] = this.value; }\n\n  restore(asyncId) { this.value = this.memo[asyncId]; }\n\n  destroy(asyncId) { delete this.memo[asyncId]; }\n}\n\nconst VARIABLES = {};\n\nmodule.exports = {\n  create: function (name) {\n    const variable = new Variable(name);\n    VARIABLES[name] = variable;\n    return variable;\n  },\n  find: function (name) {\n    return VARIABLES[name];\n  }\n}\n\n\n\n"]}