import { Component, Input } from '@angular/core';
import { shuffle } from 'lodash';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../../../../../ui-kit/formgroup/cs-radio/cs-radio.component";
export class PreviewMultipleChoiceComponent {
    constructor() {
        this.choicesForPreviewMode = [];
    }
    ngOnInit() {
        this.choicesForPreviewMode = this.question.choices;
        if (this.question.randomize === true) {
            this.randomize();
        }
    }
    randomize() {
        this.choicesForPreviewMode = shuffle(this.choicesForPreviewMode);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PreviewMultipleChoiceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PreviewMultipleChoiceComponent, selector: "app-preview-multiple-choice", inputs: { question: "question" }, ngImport: i0, template: "<div class=\"preview-list\">\n    <ul class=\"vx-p-0 vx-m-0\">\n        <li class=\"vx-mb-3\" *ngFor=\"let choice of choicesForPreviewMode; let choiceIndex = index\">\n            <app-cs-radio>{{choice?.title ? choice?.title: 'Option' }}</app-cs-radio>\n        </li>\n       \n        <li class=\"vx-mb-3\" *ngIf=\"question?.hasOther\"> \n            <app-cs-radio> {{question.otherValue}}</app-cs-radio>\n        </li>\n    </ul>\n</div>", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/mixin/mixin.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-top.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";::ng-deep .preview-list ul li{list-style-type:none}::ng-deep .preview-list ul li cs-radio{width:100%;display:block}::ng-deep .preview-list ul li cs-radio .radio-item{position:relative;padding-left:1.5rem;width:100%}::ng-deep .preview-list ul li cs-radio .radio-item .radio,::ng-deep .preview-list ul li cs-radio .radio-item .radiomark{position:absolute!important;top:0!important;left:0!important}::ng-deep .preview-list ul li cs-radio .radio-item .value{margin-left:0!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.CsRadioComponentUI, selector: "app-cs-radio", inputs: ["disabled", "readonly", "name", "checked", "value"], outputs: ["checkedEvent"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PreviewMultipleChoiceComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-preview-multiple-choice', template: "<div class=\"preview-list\">\n    <ul class=\"vx-p-0 vx-m-0\">\n        <li class=\"vx-mb-3\" *ngFor=\"let choice of choicesForPreviewMode; let choiceIndex = index\">\n            <app-cs-radio>{{choice?.title ? choice?.title: 'Option' }}</app-cs-radio>\n        </li>\n       \n        <li class=\"vx-mb-3\" *ngIf=\"question?.hasOther\"> \n            <app-cs-radio> {{question.otherValue}}</app-cs-radio>\n        </li>\n    </ul>\n</div>", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/mixin/mixin.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-top.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";::ng-deep .preview-list ul li{list-style-type:none}::ng-deep .preview-list ul li cs-radio{width:100%;display:block}::ng-deep .preview-list ul li cs-radio .radio-item{position:relative;padding-left:1.5rem;width:100%}::ng-deep .preview-list ul li cs-radio .radio-item .radio,::ng-deep .preview-list ul li cs-radio .radio-item .radiomark{position:absolute!important;top:0!important;left:0!important}::ng-deep .preview-list ul li cs-radio .radio-item .value{margin-left:0!important}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { question: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJldmlldy1tdWx0aXBsZS1jaG9pY2UuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdngtd29ya2Zsb3ctZW5naW5lL3NyYy9saWIvc2hhcmVkQ29t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