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A,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;iBAClD;gBACD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC,EACI,IAAI,CACV,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"systemjs\"/>\n\n/**\n * A loader script for setting up the SystemJS loader.\n *\n * Note that loader scripts must be simple scripts, not modules.\n */\n\nintern.registerLoader(options => {\n const globalObj: any = typeof window !== 'undefined' ? window : global;\n const {\n internLoaderPath = 'node_modules/systemjs/dist/system.src.js',\n ...loaderConfig\n } = options;\n\n loaderConfig.baseURL = loaderConfig.baseURL || intern.config.basePath;\n\n if (intern.environment === 'browser') {\n return intern.loadScript(internLoaderPath).then(() => {\n return configAndLoad(SystemJS);\n });\n } else {\n // Use globalObj to get to require to improve testability\n const SystemJS = (globalObj.require || require)('systemjs');\n return configAndLoad(SystemJS);\n }\n\n function configAndLoad(loader: typeof SystemJS) {\n intern.log('Using SystemJS loader');\n\n intern.log('Configuring SystemJS with:', loaderConfig);\n loader.config(loaderConfig);\n\n return (modules: string[]) => {\n intern.log('Loading modules with SystemJS:', modules);\n return modules.reduce(\n (previous, suite) => {\n if (previous) {\n return previous.then(() => loader.import(suite));\n }\n return loader.import(suite);\n },\n <any>null\n );\n };\n }\n});\n"]}
\No newline at end of file