<commit_before>/** @format */
import * as treeUtil from "./util"

var collapsedImg = require("../../../img/collapsed.png")

export const ccTreeComponent = {
    template: `
    <div ng-class="{ 'cc-level-indent' : $ctrl.indent }">
        <div
            ng-if="!$ctrl.node.isRoot && $ctrl.node.contents"
            class="tree"
            ng-class="{ collapsed: !$ctrl.node.extended, extended: $ctrl.node.extended, disabled: $ctrl.node.limitedAccess }"
            >
            <img ng-click="$ctrl.toggleFolderVisibility($ctrl.node)" src="${collapsedImg}" alt="extend" class="ext cursor-pointer">
            <label 
                class="boxlabel cursor-pointer"
                ng-click="$ctrl.toggleFolderSelection($event, $ctrl.node)">
                <span class="checkbox" ng-class="{ checked: $ctrl.node.selected == 'all', unchecked: $ctrl.node.selected == 'none', intermediate: $ctrl.node.selected == 'some' }"></span>
                <span>{{ $ctrl.node.title }}</span>
                <span class="numberOfChildren">({{$ctrl.node.numberOfChildren}})</span>
            </label>
            <i 
                ng-click="$ctrl.showInfo($event, $ctrl.node)" 
                class="fa fa-lg fa-info-circle text-gray-700 float-right mr-2 mt-1 rounded-full bg-white text-blue-500"></i>
        </div>
        <div
            ng-if="!$ctrl.node.contents"
            class="boxdiv"
            ng-class="{ 'disabled cursor-default': !$ctrl.node.userHasAccess }"
            style="margin-left:16px; background-color: rgb(221, 233, 255)"
            ng-click="$ctrl.toggleCorpusSelection($event, $ctrl.node)"
            >
            <label class="px-2" 'cursor-pointer': $ctrl.node.userHasAccess }>
                <span class="checkbox" ng-class="{ checked: $ctrl.node.selected, unchecked: !$ctrl.node.selected }"></span>
                <span>{{$ctrl.node.title}}</span>
            </label>
            <i 
                ng-click="$ctrl.showInfo($event, $ctrl.node)" 
                class="fa fa-lg fa-info-circle text-gray-700 float-right mr-2 mt-1 rounded-full bg-white text-blue-500"></i>
        </div>

        <div ng-if="$ctrl.node.extended || $ctrl.node.isRoot" ng-repeat="node in $ctrl.children">
            <cc-tree node="node" indent="!$ctrl.node.isRoot" on-select="$ctrl.onChildSelect()" on-select-only="$ctrl.selectOnly(corporaIds)" on-show-info="$ctrl.onShowInfoLocal(node)" />
        </div>
    </div>
    `,
    bindings: {
        node: "<",
        indent: "<",
        onSelect: "&",
        onSelectOnly: "&",
        onShowInfo: "&",
    },
    controller: [
        function () {
            let $ctrl = this

            $ctrl.$onInit = function () {
                $ctrl.children = $ctrl.node ? _.concat($ctrl.node.subFolders || [], $ctrl.node.contents || []) : []
            }

            $ctrl.toggleFolderVisibility = (folder) => {<commit_msg>fix #93<commit_after>/** @format */
import * as treeUtil from "./util"

var collapsedImg = require("../../../img/collapsed.png")

export const ccTreeComponent = {
    template: `
    <div ng-class="{ 'cc-level-indent' : $ctrl.indent }">
        <div
            ng-if="!$ctrl.node.isRoot && $ctrl.node.contents"
            class="tree"
            ng-class="{ collapsed: !$ctrl.node.extended, extended: $ctrl.node.extended, disabled: $ctrl.node.limitedAccess }"
            >
            <img ng-click="$ctrl.toggleFolderVisibility($ctrl.node)" src="${collapsedImg}" alt="extend" class="ext cursor-pointer">
            <label 
                class="boxlabel cursor-pointer"
                ng-click="$ctrl.toggleFolderSelection($event, $ctrl.node)">
                <span class="checkbox" ng-class="{ checked: $ctrl.node.selected == 'all', unchecked: $ctrl.node.selected == 'none', intermediate: $ctrl.node.selected == 'some' }"></span>
                <span>{{ $ctrl.node.title }}</span>
                <span class="numberOfChildren">({{$ctrl.node.numberOfChildren}})</span>
            </label>
            <i 
                ng-click="$ctrl.showInfo($event, $ctrl.node)" 
                class="fa fa-lg fa-info-circle text-gray-700 float-right mr-2 mt-1 rounded-full bg-white text-blue-500"></i>
        </div>
        <div
            ng-if="!$ctrl.node.contents"
            class="boxdiv"
            ng-class="{ 'disabled cursor-default': !$ctrl.node.userHasAccess }"
            style="margin-left:16px; background-color: rgb(221, 233, 255)"
            ng-click="$ctrl.toggleCorpusSelection($event, $ctrl.node)"
            >
            <label class="px-2" 'cursor-pointer': $ctrl.node.userHasAccess }>
                <span class="checkbox" ng-class="{ checked: $ctrl.node.selected, unchecked: !$ctrl.node.selected }"></span>
                <span>{{$ctrl.node.title}}</span>
            </label>
            <i ng-if="$ctrl.node.limitedAccess && $ctrl.node.userHasAccess" class="fa fa-unlock"></i>
            <i 
                ng-click="$ctrl.showInfo($event, $ctrl.node)" 
                class="fa fa-lg fa-info-circle text-gray-700 float-right mr-2 mt-1 rounded-full bg-white text-blue-500"></i>
        </div>

        <div ng-if="$ctrl.node.extended || $ctrl.node.isRoot" ng-repeat="node in $ctrl.children">
            <cc-tree node="node" indent="!$ctrl.node.isRoot" on-select="$ctrl.onChildSelect()" on-select-only="$ctrl.selectOnly(corporaIds)" on-show-info="$ctrl.onShowInfoLocal(node)" />
        </div>
    </div>
    `,
    bindings: {
        node: "<",
        indent: "<",
        onSelect: "&",
        onSelectOnly: "&",
        onShowInfo: "&",
    },
    controller: [
        function () {
            let $ctrl = this

            $ctrl.$onInit = function () {
                $ctrl.children = $ctrl.node ? _.concat($ctrl.node.subFolders || [], $ctrl.node.contents || []) : []
            }

            $ctrl.toggleFolderVisibility = (folder) => {
{'fraction_non_alphanumeric': 0.181787291879035, 'fraction_numerical': 0.009853890587835541, 'mean_word_length': 2.129718234981393, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5619539', 'n_tokens_mistral': 1857, 'n_tokens_neox': 1751, 'n_words': 302}