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MAHA,EAAM,IAAI,MAAM,+CACZ,EAAM,KAAI,SAAU,GAAK,OAAO,EAAK,MAAQ,CAAE,IAAG,KAAK,QACvD,MAAQ,EACN,CACR,CACA,OAAO,QAAU,QAAU,SAS3B,QAAQ,YAAc,SAAsB,GAC1C,IAGI,EAHA,EAAU,MAAM,kBAChB,EAAU,MAAM,gBAChB,EAAQ,CAAC,EA4Bb,OAzBA,MAAM,gBAAkB,GAExB,MAAM,kBAAoB,SAAU,EAAG,GACrC,IAAK,IAAI,EAAE,EAAG,EAAE,EAAG,OAAQ,EAAE,EAAG,IAE9B,IADA,EAAW,EAAG,GAAG,iBACA,WAAY,CAC3B,IAAI,EAKF,OAJE,GAAI,IAAa,EACf,MAKR,CAEJ,EAGA,MAAM,kBAAkB,GAIxB,MAAM,kBAAoB,EAC1B,MAAM,gBAAkB,EAEjB,CACT,EAWA,QAAQ,QAAU,SAAkB,GAGlC,IAFA,IACI,EADA,EAAM,QAAQ,KAEL,CAKX,GAJY,MAAR,IAEF,EAAM,QAAQ,OAEZ,OAAO,KAAK,EAAK,kBAAoB,OAAO,KAAK,EAAK,iBAExD,OAAO,EAET,GAAI,IAAS,EAEX,MAAM,IAAI,MAAM,2CAA6C,EAC7C,0CAGlB,EAAO,EACP,EAAM,KAAK,EAAK,KAClB,CACF","file":"/npm/@brightproductions/bindings@1.2.1/bindings.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@brightproductions/bindings@1.2.1/bindings.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\n/**\n * Module dependencies.\n */\n\nvar fs = require('fs')\n  , path = require('path')\n  , join = path.join\n  , dirname = path.dirname\n  , exists = fs.existsSync || path.existsSync\n  , defaults = {\n        arrow: process.env.NODE_BINDINGS_ARROW || ' → '\n      , compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled'\n      , platform: process.platform\n      , arch: process.arch\n      , version: process.versions.node\n      , bindings: 'bindings.node'\n      , try: [\n          // node-gyp's linked version in the \"build\" dir\n          [ 'module_root', 'build', 'bindings' ]\n          // node-waf and gyp_addon (a.k.a node-gyp)\n        , [ 'module_root', 'build', 'Debug', 'bindings' ]\n        , [ 'module_root', 'build', 'Release', 'bindings' ]\n          // Debug files, for development (legacy behavior, remove for node v0.9)\n        , [ 'module_root', 'out', 'Debug', 'bindings' ]\n        , [ 'module_root', 'Debug', 'bindings' ]\n          // Release files, but manually compiled (legacy behavior, remove for node v0.9)\n        , [ 'module_root', 'out', 'Release', 'bindings' ]\n        , [ 'module_root', 'Release', 'bindings' ]\n          // Legacy from node-waf, node <= 0.4.x\n        , [ 'module_root', 'build', 'default', 'bindings' ]\n          // Production \"Release\" buildtype binary (meh...)\n        , [ 'module_root', 'compiled', 'version', 'platform', 'arch', 'bindings' ]\n        ]\n    }\n\n/**\n * The main `bindings()` function loads the compiled bindings for a given module.\n * It uses V8's Error API to determine the parent filename that this function is\n * being invoked from, which is then used to find the root directory.\n */\n\nfunction bindings (opts) {\n\n  // Argument surgery\n  if (typeof opts == 'string') {\n    opts = { bindings: opts }\n  } else if (!opts) {\n    opts = {}\n  }\n  opts.__proto__ = defaults\n\n  // Get the module root\n  if (!opts.module_root) {\n    opts.module_root = exports.getRoot(exports.getFileName())\n  }\n\n  // Ensure the given bindings name ends with .node\n  if (path.extname(opts.bindings) != '.node') {\n    opts.bindings += '.node'\n  }\n\n  var tries = []\n    , i = 0\n    , l = opts.try.length\n    , n\n    , b\n    , err\n\n  for (; i<l; i++) {\n    n = join.apply(null, opts.try[i].map(function (p) {\n      return opts[p] || p\n    }))\n    tries.push(n)\n    try {\n      b = opts.path ? require.resolve(n) : require(n)\n      if (!opts.path) {\n        b.path = n\n      }\n      return b\n    } catch (e) {\n      if (!/not find/i.test(e.message)) {\n        throw e\n      }\n    }\n  }\n\n  err = new Error('Could not locate the bindings file. Tried:\\n'\n    + tries.map(function (a) { return opts.arrow + a }).join('\\n'))\n  err.tries = tries\n  throw err\n}\nmodule.exports = exports = bindings\n\n\n/**\n * Gets the filename of the JavaScript file that invokes this function.\n * Used to help find the root directory of a module.\n * Optionally accepts an filename argument to skip when searching for the invoking filename\n */\n\nexports.getFileName = function getFileName (calling_file) {\n  var origPST = Error.prepareStackTrace\n    , origSTL = Error.stackTraceLimit\n    , dummy = {}\n    , fileName\n\n  Error.stackTraceLimit = 10\n\n  Error.prepareStackTrace = function (e, st) {\n    for (var i=0, l=st.length; i<l; i++) {\n      fileName = st[i].getFileName()\n      if (fileName !== __filename) {\n        if (calling_file) {\n            if (fileName !== calling_file) {\n              return\n            }\n        } else {\n          return\n        }\n      }\n    }\n  }\n\n  // run the 'prepareStackTrace' function above\n  Error.captureStackTrace(dummy)\n  dummy.stack\n\n  // cleanup\n  Error.prepareStackTrace = origPST\n  Error.stackTraceLimit = origSTL\n\n  return fileName\n}\n\n/**\n * Gets the root directory of a module, given an arbitrary filename\n * somewhere in the module tree. The \"root directory\" is the directory\n * containing the `package.json` file.\n *\n *   In:  /home/nate/node-native-module/lib/index.js\n *   Out: /home/nate/node-native-module\n */\n\nexports.getRoot = function getRoot (file) {\n  var dir = dirname(file)\n    , prev\n  while (true) {\n    if (dir === '.') {\n      // Avoids an infinite loop in rare cases, like the REPL\n      dir = process.cwd()\n    }\n    if (exists(join(dir, 'package.json')) || exists(join(dir, 'node_modules'))) {\n      // Found the 'package.json' file or 'node_modules' dir; we're done\n      return dir\n    }\n    if (prev === dir) {\n      // Got to the top\n      throw new Error('Could not find module root given file: \"' + file\n                    + '\". Do you have a `package.json` file? ')\n    }\n    // Try the parent dir next\n    prev = dir\n    dir = join(dir, '..')\n  }\n}\n"]}