{"version":3,"sources":["jsdelivr-header.js","/npm/@graphql-codegen/import-types-preset@4.0.0/cjs/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,YAAS,EACjB,MAAM,QAAU,QAAQ,SAClB,MAAQ,QAAQ,gBAAgB,QAAQ,yBACxC,iBAAmB,QAAQ,mCACjC,QAAQ,OAAS,CACb,sBAAuB,IACnB,IAAK,EAAQ,aAAa,UACtB,MAAM,IAAI,MAAM,oJAEpB,MAAM,EAAuB,EAAQ,aAAa,sBAAwB,QACpE,EAAY,IACX,EAAQ,UACX,IAAK,MAAM,SAET,EAAU,IAAI,EAAQ,SACtB,EAAS,IACR,EAAQ,OAEX,qBAAsB,EAEtB,yBAA0B,EAC1B,kBAAmB,IAYvB,OAVA,EAAQ,UAAU,KAAI,IAClB,IAAI,EAAI,iBAAiB,cAAc,EAAa,SAAU,EAAO,kBAAkB,KAAI,GAAK,EAAE,OAAO,EAAQ,WAAY,CACzH,MAAM,EAAa,EAAQ,OAAO,eAAiB,cAAgB,SACnE,EAAQ,QAAQ,CACZ,IAAK,CACD,QAAS,GAAG,UAAmB,WAA8B,EAAQ,aAAa,kBAG9F,KAEG,CACH,CACI,SAAU,EAAQ,cAClB,UACA,YACA,SACA,OAAQ,EAAQ,OAChB,UAAW,EAAQ,UACnB,UAAW,EAAQ,WAE1B,GAGT,QAAQ,QAAU,QAAQ","file":"/npm/@graphql-codegen/import-types-preset@4.0.0/cjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@graphql-codegen/import-types-preset@4.0.0/cjs/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.preset = void 0;\nconst tslib_1 = require(\"tslib\");\nconst add_1 = tslib_1.__importDefault(require(\"@graphql-codegen/add\"));\nconst plugin_helpers_1 = require(\"@graphql-codegen/plugin-helpers\");\nexports.preset = {\n    buildGeneratesSection: options => {\n        if (!options.presetConfig.typesPath) {\n            throw new Error(`Preset \"import-types\" requires you to specify \"typesPath\" configuration and point it to your base types file (generated by \"typescript\" plugin)!`);\n        }\n        const importTypesNamespace = options.presetConfig.importTypesNamespace || 'Types';\n        const pluginMap = {\n            ...options.pluginMap,\n            add: add_1.default,\n        };\n        const plugins = [...options.plugins];\n        const config = {\n            ...options.config,\n            // This is for the operations plugin\n            namespacedImportName: importTypesNamespace,\n            // This is for the client-side runtime plugins\n            importOperationTypesFrom: importTypesNamespace,\n            externalFragments: [],\n        };\n        options.documents.map(documentFile => {\n            if ((0, plugin_helpers_1.isUsingTypes)(documentFile.document, config.externalFragments.map(m => m.name), options.schemaAst)) {\n                const importType = options.config.useTypeImports ? 'import type' : 'import';\n                plugins.unshift({\n                    add: {\n                        content: `${importType} * as ${importTypesNamespace} from '${options.presetConfig.typesPath}';\\n`,\n                    },\n                });\n            }\n        });\n        return [\n            {\n                filename: options.baseOutputDir,\n                plugins,\n                pluginMap,\n                config,\n                schema: options.schema,\n                schemaAst: options.schemaAst,\n                documents: options.documents,\n            },\n        ];\n    },\n};\nexports.default = exports.preset;\n"]}