{"version":3,"file":"addon.cjs","names":["gyp"],"sources":["../export/addon.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport gyp from \"@mapbox/node-pre-gyp\";\nimport type { AddonSymbol } from \"./addon-def\";\n\nconst nodeFileUrl = import.meta.url;\nconst nodeDirname = dirname(fileURLToPath(nodeFileUrl));\nconst nodeRequire = createRequire(nodeFileUrl);\n\nconst { find: findAddon } = gyp;\n\n// Pre-gyp reads binary section from package.json and constructs a path to addon\n// https://github.com/mapbox/node-pre-gyp/blob/a541932680034f5de9e7365ef8d9a0d7a11cc1a9/lib/package.js#L35\n// Require calls dlopen under the hood\n// https://nodejs.org/api/process.html#processdlopenmodule-filename-flags\n// DLOpen then searches for napi_register_module_v1 in addon export table\n// https://github.com/search?q=repo%3Anodejs%2Fnode%20NAPI_MODULE_INITIALIZER&type=code\n// And neon exports napi_register_module_v1 from #[neon::main]\n// https://github.com/neon-bindings/neon/blob/b1728fa21e968ccde9611ac9955cf6d638be16e6/crates/neon/src/context/internal.rs#L76\nconst AddonSymbol = nodeRequire(findAddon(resolve(nodeDirname, \"../package.json\"))) as AddonSymbol;\n\nexport { AddonSymbol };\n"],"mappings":";;;;;;;AAMA,MAAM,cAAA,QAAA,MAAA,CAAA,cAAA,WAAA,CAAA;AACN,MAAM,eAAA,GAAA,UAAA,UAAA,GAAA,SAAA,eAAoC,YAAY,CAAC;AACvD,MAAM,eAAA,GAAA,YAAA,eAA4B,YAAY;AAE9C,MAAM,EAAE,MAAM,cAAcA,qBAAAA;AAU5B,MAAM,cAAc,YAAY,WAAA,GAAA,UAAA,SAAkB,aAAa,kBAAkB,CAAC,CAAC"}