{"version":3,"sources":["jsdelivr-header.js","/npm/getmac@6.6.0/edition-es2022/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,WAAQ,EAEhB,MAAM,KAAO,QAAQ,MACf,SAAW,yCACX,UAAY,8BAKlB,SAAS,OAAO,GACZ,MAAM,GAAO,EAAI,KAAK,qBACtB,GAAI,EAAO,CACP,MAAM,EAAQ,EAAK,GACnB,IAAK,EACD,MAAM,IAAI,MAAM,aAAa,mBAEjC,IAAK,MAAM,KAAQ,EACf,IAAiC,IAA7B,UAAU,KAAK,EAAK,KACpB,OAAO,EAAK,IAGpB,MAAM,IAAI,MAAM,aAAa,+BACjC,CAEI,IAAK,MAAO,EAAK,KAAU,OAAO,QAAQ,GAGtC,GAAK,EAEL,IAAK,MAAM,KAAQ,EACf,IAAiC,IAA7B,UAAU,KAAK,EAAK,KACpB,OAAO,EAAK,IAK5B,MAAM,IAAI,MAAM,gCACpB,CAGA,SAAS,MAAM,GACX,OAAO,SAAS,KAAK,EACzB,CAJA,QAAQ,QAAU,OAKlB,QAAQ,MAAQ","file":"/npm/getmac@6.6.0/edition-es2022/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/getmac@6.6.0/edition-es2022/index.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\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isMAC = void 0;\n// Prepare\nconst os_1 = require(\"os\");\nconst macRegex = /(?:[a-z0-9]{1,2}[:-]){5}[a-z0-9]{1,2}/i;\nconst zeroRegex = /(?:[0]{1,2}[:-]){5}[0]{1,2}/;\n/**\n * Get the first proper MAC address\n * @param iface If provided, restrict MAC address fetching to this interface\n */\nfunction getMAC(iface) {\n    const list = (0, os_1.networkInterfaces)();\n    if (iface) {\n        const parts = list[iface];\n        if (!parts) {\n            throw new Error(`interface ${iface} was not found`);\n        }\n        for (const part of parts) {\n            if (zeroRegex.test(part.mac) === false) {\n                return part.mac;\n            }\n        }\n        throw new Error(`interface ${iface} had no valid mac addresses`);\n    }\n    else {\n        for (const [key, parts] of Object.entries(list)) {\n            // for some reason beyond me, this is needed to satisfy typescript\n            // fix https://github.com/bevry/getmac/issues/100\n            if (!parts)\n                continue;\n            for (const part of parts) {\n                if (zeroRegex.test(part.mac) === false) {\n                    return part.mac;\n                }\n            }\n        }\n    }\n    throw new Error('failed to get the MAC address');\n}\nexports.default = getMAC;\n/** Check if the input is a valid MAC address */\nfunction isMAC(macAddress) {\n    return macRegex.test(macAddress);\n}\nexports.isMAC = isMAC;\n"]}