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M,EAAE,MAAM,GAAI,CAAC,CAAC;QAClD,CAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAE,EAAE,UAAU,EAAE,CAAC,CAAC;KAC5E;AACF,CAAC,CAAC","sourcesContent":["import global from '@dojo/framework/shim/global';\nimport renderer, { tsx } from '@dojo/framework/core/vdom';\nimport Registry from '@dojo/framework/core/Registry';\nimport { registerThemeInjector } from '@dojo/framework/core/mixins/Themed';\nimport { registerRouterInjector } from '@dojo/framework/routing/RouterInjector';\nimport transition from '@dojo/framework/core/animations/cssTransitions';\nimport { ThemeWithVariants, Theme } from '@dojo/framework/core/interfaces';\n\nimport './main.css';\n\nimport routes from './routes';\nimport App from './App';\nimport { getThemeFromConfig } from './utils';\n\nexport interface ConfigThemes {\n\tlabel: string;\n\ttheme: Theme | ThemeWithVariants;\n}\n\nexport interface WidgetConfig {\n\tfilename?: string;\n\toverview: {\n\t\texample: WidgetExampleConfig;\n\t};\n\texamples?: WidgetExampleConfig[];\n}\n\nexport interface WidgetExampleConfig {\n\tfilename: string;\n\tmodule: any;\n\ttitle?: string;\n\tdescription?: any;\n\tsize?: string;\n\tsandbox?: boolean;\n\toverview?: true;\n}\n\nexport type WidgetConfigMap = { [index: string]: WidgetExampleConfig[] };\n\nexport interface Config {\n\tname: string;\n\tthemes: ConfigThemes[];\n\ttests?: any;\n\thome: string;\n\treadmePath: (widget: string) => string;\n\twidgetPath: (widget: string) => string;\n\texamplePath: (widget: string, filename: string) => string;\n\tcodesandboxPath?: (widget: string, filename: string, themeName?: string) => string;\n\twidgets?: { [index: string]: WidgetExampleConfig[] | WidgetConfig };\n}\n\nexport interface TransformedConfig {\n\tname: string;\n\tthemes: ConfigThemes[];\n\ttests?: any;\n\thome: string;\n\treadmePath: (widget: string) => string;\n\twidgetPath: (widget: string) => string;\n\texamplePath: (widget: string, filename: string) => string;\n\tcodesandboxPath?: (widget: string, filename: string, themeName?: string) => string;\n\twidgets?: WidgetConfigMap;\n}\n\nexport default ({ config }: { config: Config }) => {\n\tif (config.widgets && Object.keys(config.widgets).length) {\n\t\tconfig.widgets = Object.keys(config.widgets).reduce((transformedConfig, key) => {\n\t\t\tconst widgetConfig = config.widgets![key];\n\t\t\tif (Array.isArray(widgetConfig)) {\n\t\t\t\ttransformedConfig[key] = widgetConfig;\n\t\t\t} else {\n\t\t\t\ttransformedConfig[key] = [{ ...widgetConfig.overview.example, overview: true }];\n\t\t\t\tif (widgetConfig.examples) {\n\t\t\t\t\ttransformedConfig[key] = [...transformedConfig[key], ...widgetConfig.examples];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn transformedConfig;\n\t\t}, {} as { [index: string]: WidgetExampleConfig[] });\n\t}\n\n\tconst { tests } = config;\n\tif (global.intern && tests && tests.keys) {\n\t\tconst url = new URL(window.location.href);\n\t\tconst params = url.searchParams;\n\t\tconst widget = params.get('widget');\n\t\ttests.keys().forEach((id: string) => {\n\t\t\tif (widget && id.indexOf(widget) !== -1) {\n\t\t\t\ttests(id);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tconst theme = getThemeFromConfig(config);\n\t\tconst registry = new Registry();\n\t\tregisterThemeInjector(theme.theme, registry);\n\t\tregisterRouterInjector(routes, registry, {\n\t\t\tsetDocumentTitle: ({ params, title }) => {\n\t\t\t\tconst section = params.widget || title;\n\t\t\t\treturn `Parade${section ? ` - ${section}` : ''}`;\n\t\t\t}\n\t\t});\n\n\t\tconst r = renderer(() => <App config={config} />);\n\t\tr.mount({ registry, domNode: document.getElementById('app')!, transition });\n\t}\n};\n"]}