<commit_before>/*ngInject*/
export function setupRoutes($stateProvider, $urlRouterProvider) {
    $stateProvider
        .state('login', {
            url: '/login',
            template: '<mc-login></mc-login>'
        })
        .state('projects', {
            url: '/projects',
            abstract: true,
            template: '<div ui-view></div>'
        })
        .state('projects.list', {
            url: '/list',
            template: '<mc-projects></mc-projects>'
        })
        .state('projects.share', {
            url: '/share',
            template: '<mc-projects-share></mc-projects-share>'
        })
        .state('user', {
            url: '/user',
            abstract: true,
            template: '<div ui-view></div>'
        })
        .state('user.apikey', {
            url: '/apikey',
            template: '<mc-user-apikey></mc-user-apikey>'
        })
        .state('user.password', {
            url: '/password',
            template: '<mc-user-password></mc-user-password>'
        })
        .state('project', {
            url: '/project/:project_id',
            abstract: true,
            template: '<ui-view flex="100" layout="column"></ui-view>',
            resolve: {
                // Set the current project in the project service so all components
                // will resolve without having to worry if a promise has resolved.
                // The resolved object is ignored.
                _project: ["$stateParams", "projectsService", "project",
                    // Inject projects so that it resolves before looking up the project.
                    function($stateParams, projectsService, project) {
                        return projectsService.getProject($stateParams.project_id)
                            .then(function(proj) {
                                project.set(proj);
                                return proj;
                            });
                    }],

                _templates: ["processTemplates", "templates", "_project",
                    function(processTemplates, templates, project) {
                        var projectTemplates = processTemplates.templates(project.process_templates, project.id);
                        templates.set(projectTemplates);
                        return projectTemplates;
                    }]
            }
        })
        .state('project.home', {
            url: '/home',
            template: '<mc-project-home></mc-project-home>',
            // hack to update project view
            resolve: {
                // Set the current project in the project service so all components
                // will resolve without having to worry if a promise has resolved.
                // The resolved object is ignored.
                _project: ["$stateParams", "projectsService", "project",
                    // Inject projects so that it resolves before looking up the project.
                    function($stateParams, projectsService, project) {
                        return projectsService.getProject($stateParams.project_id)
                            .then(function(proj) {
                                project.set(proj);
                                return proj;
                            });
                    }]
            }
        })
        .state('project.search', {
            url: '/search/:query',
            template: '<mc-project-search></mc-project-search>'
        })
        .state('project.create', {
            url: '/create',
            abstract: true,
            template: '<ui-view flex layout="column"></ui-view>'
        })
        .state('project.experiment', {
            url: '/experiment/:experiment_id',
            template: `<mc-experiment></mc-experiment>`,
            controllerAs: 'ctrl',
            controller: ['experiment', 'currentExperiment', function(experiment, currentExperiment) {
                currentExperiment.set(experiment);
            }],
            resolve: {
                experiment: ['experimentsService', 'toast', 'toUITask', '$stateParams', 'currentExperiment',
                    function(experimentsService, toast, toUITask, $stateParams, currentExperiment) {
                        return experimentsService.getForProject($stateParams.project_id, $stateParams.experiment_id)
                            .then(
                                (e) => {
                                    e.tasks.forEach((task) => toUITask(task));
                                    currentExperiment.set(e);
                                    return e;
                                },
                                () => toast.error('Failed to retrieve experiment')
                            );
                    }
                ]
            }
        })
        .state('project.experiment.details', {
            url: '/details',
            template: '<mc-experiment-details experiment="ctrl.experiment"></mc-experiment-details>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.tasks', {
            url: '/tasks',
            template: '<mc-experiment-tasks></mc-experiment-tasks>'
        })
        .state('project.experiment.forecast', {
            url: '/forecast',
            template: '<mc-experiment-forecast experiment="ctrl.experiment"></mc-experiment-forecast>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.flagged', {
            url: '/flagged',
            template: '<mc-experiment-flagged experiment="ctrl.experiment"></mc-experiment-flagged>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.samples', {
            url: '/samples',
            template: '<mc-experiment-samples experiment="ctrl.experiment"></mc-experiment-samples>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.files', {
            url: '/files',
            template: '<mc-experiment-files experiment="ctrl.experiment"></mc-experiment-files>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.notes', {
            url: '/today',
            template: '<mc-experiment-notes experiment="ctrl.experiment"></mc-experiment-notes>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.create.process', {
            url: '/process/:template_id/:process_id',
            template: '<mc-process-create></mc-process-create>',
            resolve: {
                _template: ['templates', 'template', '$stateParams', 'projectsService',
                    function(templates, template, $stateParams, projectsService) {
                        if ($stateParams.process_id) {
                            return projectsService.getProjectProcess($stateParams.project_id, $stateParams.process_id)
                                .then(function(process) {
                                    var t = templates.loadTemplateFromProcess($stateParams.template_id, process);
                                    template.set(t);
                                    return t;
                                });
                        } else {
                            var t = templates.getTemplate($stateParams.template_id);
                            template.set(t);
                            return t;
                        }
                    }]
            }
        })
        .state('project.experiments', {<commit_msg>url for project.experiment.notes should be /notes and not /today.<commit_after>/*ngInject*/
export function setupRoutes($stateProvider, $urlRouterProvider) {
    $stateProvider
        .state('login', {
            url: '/login',
            template: '<mc-login></mc-login>'
        })
        .state('projects', {
            url: '/projects',
            abstract: true,
            template: '<div ui-view></div>'
        })
        .state('projects.list', {
            url: '/list',
            template: '<mc-projects></mc-projects>'
        })
        .state('projects.share', {
            url: '/share',
            template: '<mc-projects-share></mc-projects-share>'
        })
        .state('user', {
            url: '/user',
            abstract: true,
            template: '<div ui-view></div>'
        })
        .state('user.apikey', {
            url: '/apikey',
            template: '<mc-user-apikey></mc-user-apikey>'
        })
        .state('user.password', {
            url: '/password',
            template: '<mc-user-password></mc-user-password>'
        })
        .state('project', {
            url: '/project/:project_id',
            abstract: true,
            template: '<ui-view flex="100" layout="column"></ui-view>',
            resolve: {
                // Set the current project in the project service so all components
                // will resolve without having to worry if a promise has resolved.
                // The resolved object is ignored.
                _project: ["$stateParams", "projectsService", "project",
                    // Inject projects so that it resolves before looking up the project.
                    function($stateParams, projectsService, project) {
                        return projectsService.getProject($stateParams.project_id)
                            .then(function(proj) {
                                project.set(proj);
                                return proj;
                            });
                    }],

                _templates: ["processTemplates", "templates", "_project",
                    function(processTemplates, templates, project) {
                        var projectTemplates = processTemplates.templates(project.process_templates, project.id);
                        templates.set(projectTemplates);
                        return projectTemplates;
                    }]
            }
        })
        .state('project.home', {
            url: '/home',
            template: '<mc-project-home></mc-project-home>',
            // hack to update project view
            resolve: {
                // Set the current project in the project service so all components
                // will resolve without having to worry if a promise has resolved.
                // The resolved object is ignored.
                _project: ["$stateParams", "projectsService", "project",
                    // Inject projects so that it resolves before looking up the project.
                    function($stateParams, projectsService, project) {
                        return projectsService.getProject($stateParams.project_id)
                            .then(function(proj) {
                                project.set(proj);
                                return proj;
                            });
                    }]
            }
        })
        .state('project.search', {
            url: '/search/:query',
            template: '<mc-project-search></mc-project-search>'
        })
        .state('project.create', {
            url: '/create',
            abstract: true,
            template: '<ui-view flex layout="column"></ui-view>'
        })
        .state('project.experiment', {
            url: '/experiment/:experiment_id',
            template: `<mc-experiment></mc-experiment>`,
            controllerAs: 'ctrl',
            controller: ['experiment', 'currentExperiment', function(experiment, currentExperiment) {
                currentExperiment.set(experiment);
            }],
            resolve: {
                experiment: ['experimentsService', 'toast', 'toUITask', '$stateParams', 'currentExperiment',
                    function(experimentsService, toast, toUITask, $stateParams, currentExperiment) {
                        return experimentsService.getForProject($stateParams.project_id, $stateParams.experiment_id)
                            .then(
                                (e) => {
                                    e.tasks.forEach((task) => toUITask(task));
                                    currentExperiment.set(e);
                                    return e;
                                },
                                () => toast.error('Failed to retrieve experiment')
                            );
                    }
                ]
            }
        })
        .state('project.experiment.details', {
            url: '/details',
            template: '<mc-experiment-details experiment="ctrl.experiment"></mc-experiment-details>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.tasks', {
            url: '/tasks',
            template: '<mc-experiment-tasks></mc-experiment-tasks>'
        })
        .state('project.experiment.forecast', {
            url: '/forecast',
            template: '<mc-experiment-forecast experiment="ctrl.experiment"></mc-experiment-forecast>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.flagged', {
            url: '/flagged',
            template: '<mc-experiment-flagged experiment="ctrl.experiment"></mc-experiment-flagged>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.samples', {
            url: '/samples',
            template: '<mc-experiment-samples experiment="ctrl.experiment"></mc-experiment-samples>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.files', {
            url: '/files',
            template: '<mc-experiment-files experiment="ctrl.experiment"></mc-experiment-files>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.experiment.notes', {
            url: '/notes',
            template: '<mc-experiment-notes experiment="ctrl.experiment"></mc-experiment-notes>',
            controllerAs: 'ctrl',
            controller: ['experiment', function(experiment) {
                this.experiment = experiment;
            }]
        })
        .state('project.create.process', {
            url: '/process/:template_id/:process_id',
            template: '<mc-process-create></mc-process-create>',
            resolve: {
                _template: ['templates', 'template', '$stateParams', 'projectsService',
                    function(templates, template, $stateParams, projectsService) {
                        if ($stateParams.process_id) {
                            return projectsService.getProjectProcess($stateParams.project_id, $stateParams.process_id)
                                .then(function(process) {
                                    var t = templates.loadTemplateFromProcess($stateParams.template_id, process);
                                    template.set(t);
                                    return t;
                                });
                        } else {
                            var t = templates.getTemplate($stateParams.template_id);
                            template.set(t);
                            return t;
                        }
                    }]
            }
        })
        .state('project.experiments', {
{'fraction_non_alphanumeric': 0.1226840565577767, 'fraction_numerical': 0.0003656752803510483, 'mean_word_length': 1.3698729058347776, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1043763', 'n_tokens_mistral': 3858, 'n_tokens_neox': 3739, 'n_words': 720}