{"version":3,"sources":["jsdelivr-header.js","/npm/@design-systems/babel-plugin-include-styles@4.15.4/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,MAAM,QAAU,QAAQ,SAClB,kBAAoB,QAAQ,gBAAgB,QAAQ,sBACpD,SAAW,QAAQ,gBAAgB,QAAQ,aAIjD,SAAS,eAAc,MAAE,IAAS,MAAE,IAChC,MAAM,EAAc,IAAI,OAAO,KAAK,QACpC,IAAI,EAAa,IAAI,IAErB,SAAS,EAAiB,EAAM,GAC5B,IAAK,EAAY,KAAK,GAClB,OAEJ,GAAI,EAAW,MAAM,UAQjB,YANI,EAAW,IAAI,GACf,EAAK,SAGL,EAAW,IAAI,IAIvB,MAAM,EAAY,GAAG,kBACjB,SAAS,QAAQ,IACjB,EAAK,YAAY,EAAM,kBAAkB,GAAI,EAAM,cAAc,KAGrE,MAAM,EAAc,kBAAkB,QAAQ,GAC9C,IAAK,EACD,OAIJ,MAAM,aAAE,EAAe,CAAC,EAAC,KAAE,GAAS,QAAQ,GAEvC,EAAY,KAAK,IAGtB,OAAO,KAAK,GAAc,SAAS,GAAe,EAAiB,EAAM,IAC7E,CACA,MAAO,CAEH,IAAK,KACD,EAAa,IAAI,GAAK,EAE1B,QAAS,CACL,iBAAA,CAAkB,GAEd,EAAiB,EADE,EAAK,KAAK,OAAO,MAExC,GAGZ,CACA,QAAQ,QAAU","file":"/npm/@design-systems/babel-plugin-include-styles@4.15.4/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@design-systems/babel-plugin-include-styles@4.15.4/dist/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 });\nconst tslib_1 = require(\"tslib\");\nconst resolve_package_1 = tslib_1.__importDefault(require(\"./resolve-package\"));\nconst exists_1 = tslib_1.__importDefault(require(\"./exists\"));\n/**\n * Find imports of @design-system/cli components and automatically includes their styles.\n */\nfunction includeStyles({ types }, { scope }) {\n    const SCOPE_REGEX = new RegExp(`^@${scope}\\\\/`);\n    let cssImports = new Set();\n    /** Insert an import for a component */\n    function insertCssImports(path, importName) {\n        if (!SCOPE_REGEX.test(importName)) {\n            return;\n        }\n        if (importName.match(/\\.css$/)) {\n            // Only keep 1 import per imported css file\n            if (cssImports.has(importName)) {\n                path.remove();\n            }\n            else {\n                cssImports.add(importName);\n            }\n            return;\n        }\n        const cssImport = `${importName}/dist/main.css`;\n        if (exists_1.default(cssImport)) {\n            path.insertAfter(types.importDeclaration([], types.stringLiteral(cssImport)));\n        }\n        // After walk dependencies to find more css to include\n        const packageJson = resolve_package_1.default(importName);\n        if (!packageJson) {\n            return;\n        }\n        // After walk dependencies to find more css to include\n        // eslint-disable-next-line global-require, import/no-dynamic-require, @typescript-eslint/no-var-requires\n        const { dependencies = {}, name } = require(packageJson);\n        // In case we happen to find a package.json that is for the specified scope\n        if (!SCOPE_REGEX.test(name)) {\n            return;\n        }\n        Object.keys(dependencies).forEach((dependency) => insertCssImports(path, dependency));\n    }\n    return {\n        /** Initialization code */\n        pre: () => {\n            cssImports = new Set();\n        },\n        visitor: {\n            ImportDeclaration(path) {\n                const importName = path.node.source.value;\n                insertCssImports(path, importName);\n            }\n        }\n    };\n}\nexports.default = includeStyles;\n"]}