var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { BaseFormComponent } from '@memberjunction/ng-base-forms';
import { RegisterClass } from '@memberjunction/global';
import { SharedService } from '@memberjunction/ng-shared';
import { CompositeKey } from '@memberjunction/core';
import { TestRunFeedbackFormComponent } from '../../generated/Entities/TestRunFeedback/testrunfeedback.form.component';
import * as i0 from "@angular/core";
import * as i1 from "@memberjunction/ng-shared";
import * as i2 from "@angular/router";
import * as i3 from "@angular/common";
import * as i4 from "@angular/forms";
import * as i5 from "@progress/kendo-angular-buttons";
function TestRunFeedbackFormComponentExtended_button_5_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 9);
    i0.ɵɵlistener("click", function TestRunFeedbackFormComponentExtended_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.openTestRun()); });
    i0.ɵɵelement(1, "i", 10);
    i0.ɵɵtext(2, " View Test Run ");
    i0.ɵɵelementEnd();
} }
let TestRunFeedbackFormComponentExtended = class TestRunFeedbackFormComponentExtended extends TestRunFeedbackFormComponent {
    constructor(elementRef, sharedService, router, route, cdr) {
        super(elementRef, sharedService, router, route, cdr);
        this.router = router;
        this.cdr = cdr;
    }
    openTestRun() {
        if (this.record.TestRunID) {
            SharedService.Instance.OpenEntityRecord('MJ: Test Runs', CompositeKey.FromID(this.record.TestRunID));
        }
    }
    static { this.ɵfac = function TestRunFeedbackFormComponentExtended_Factory(t) { return new (t || TestRunFeedbackFormComponentExtended)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1.SharedService), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TestRunFeedbackFormComponentExtended, selectors: [["mj-test-run-feedback-form"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 30, vars: 9, consts: [[1, "feedback-form"], [1, "feedback-header"], [1, "fas", "fa-comment-dots"], ["kendoButton", "", 3, "click", 4, "ngIf"], [1, "feedback-content"], [1, "field-group"], ["type", "number", "min", "1", "max", "5", 3, "ngModelChange", "ngModel"], ["type", "checkbox", 3, "ngModelChange", "ngModel"], ["rows", "6", 3, "ngModelChange", "ngModel"], ["kendoButton", "", 3, "click"], [1, "fas", "fa-external-link"]], template: function TestRunFeedbackFormComponentExtended_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h2");
            i0.ɵɵelement(3, "i", 2);
            i0.ɵɵtext(4, " Test Run Feedback");
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(5, TestRunFeedbackFormComponentExtended_button_5_Template, 3, 0, "button", 3);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(6, "div", 4)(7, "div", 5)(8, "label");
            i0.ɵɵtext(9, "Rating (1-5)");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(10, "input", 6);
            i0.ɵɵtwoWayListener("ngModelChange", function TestRunFeedbackFormComponentExtended_Template_input_ngModelChange_10_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.record.Rating, $event) || (ctx.record.Rating = $event); return $event; });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(11, "div", 5)(12, "label");
            i0.ɵɵtext(13, "Is Correct?");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(14, "input", 7);
            i0.ɵɵtwoWayListener("ngModelChange", function TestRunFeedbackFormComponentExtended_Template_input_ngModelChange_14_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.record.IsCorrect, $event) || (ctx.record.IsCorrect = $event); return $event; });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(15, "div", 5)(16, "label");
            i0.ɵɵtext(17, "Comments");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(18, "textarea", 8);
            i0.ɵɵtwoWayListener("ngModelChange", function TestRunFeedbackFormComponentExtended_Template_textarea_ngModelChange_18_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.record.Comments, $event) || (ctx.record.Comments = $event); return $event; });
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(19, "div", 5)(20, "label");
            i0.ɵɵtext(21, "Reviewer");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(22, "div");
            i0.ɵɵtext(23);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(24, "div", 5)(25, "label");
            i0.ɵɵtext(26, "Submitted At");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(27, "div");
            i0.ɵɵtext(28);
            i0.ɵɵpipe(29, "date");
            i0.ɵɵelementEnd()()()();
        } if (rf & 2) {
            i0.ɵɵadvance(5);
            i0.ɵɵproperty("ngIf", ctx.record.TestRunID);
            i0.ɵɵadvance(5);
            i0.ɵɵtwoWayProperty("ngModel", ctx.record.Rating);
            i0.ɵɵadvance(4);
            i0.ɵɵtwoWayProperty("ngModel", ctx.record.IsCorrect);
            i0.ɵɵadvance(4);
            i0.ɵɵtwoWayProperty("ngModel", ctx.record.Comments);
            i0.ɵɵadvance(5);
            i0.ɵɵtextInterpolate(ctx.record.ReviewerUser);
            i0.ɵɵadvance(5);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(29, 6, ctx.record.__mj_CreatedAt, "medium"));
        } }, dependencies: [i3.NgIf, i4.DefaultValueAccessor, i4.NumberValueAccessor, i4.CheckboxControlValueAccessor, i4.NgControlStatus, i4.MinValidator, i4.MaxValidator, i4.NgModel, i5.ButtonComponent, i3.DatePipe], styles: [".feedback-form[_ngcontent-%COMP%] { padding: 20px; }\n    .feedback-header[_ngcontent-%COMP%] { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }\n    .feedback-header[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%] { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 12px; }\n    .feedback-content[_ngcontent-%COMP%] { background: white; padding: 24px; border-radius: 8px; }\n    .field-group[_ngcontent-%COMP%] { margin-bottom: 20px; }\n    .field-group[_ngcontent-%COMP%]   label[_ngcontent-%COMP%] { display: block; margin-bottom: 8px; font-weight: 600; color: #333; }\n    .field-group[_ngcontent-%COMP%]   input[type=\"number\"][_ngcontent-%COMP%], .field-group[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%] { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; }\n    .field-group[_ngcontent-%COMP%]   input[type=\"checkbox\"][_ngcontent-%COMP%] { width: auto; }"], changeDetection: 0 }); }
};
TestRunFeedbackFormComponentExtended = __decorate([
    RegisterClass(BaseFormComponent, 'MJ: Test Run Feedbacks')
], TestRunFeedbackFormComponentExtended);
export { TestRunFeedbackFormComponentExtended };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TestRunFeedbackFormComponentExtended, [{
        type: Component,
        args: [{ selector: 'mj-test-run-feedback-form', template: `
    <div class="feedback-form">
      <div class="feedback-header">
        <h2><i class="fas fa-comment-dots"></i> Test Run Feedback</h2>
        <button kendoButton *ngIf="record.TestRunID" (click)="openTestRun()">
          <i class="fas fa-external-link"></i> View Test Run
        </button>
      </div>
      <div class="feedback-content">
        <div class="field-group">
          <label>Rating (1-5)</label>
          <input type="number" [(ngModel)]="record.Rating" min="1" max="5" />
        </div>
        <div class="field-group">
          <label>Is Correct?</label>
          <input type="checkbox" [(ngModel)]="record.IsCorrect" />
        </div>
        <div class="field-group">
          <label>Comments</label>
          <textarea [(ngModel)]="record.Comments" rows="6"></textarea>
        </div>
        <div class="field-group">
          <label>Reviewer</label>
          <div>{{ record.ReviewerUser }}</div>
        </div>
        <div class="field-group">
          <label>Submitted At</label>
          <div>{{ record.__mj_CreatedAt | date:'medium' }}</div>
        </div>
      </div>
    </div>
  `, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["\n    .feedback-form { padding: 20px; }\n    .feedback-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }\n    .feedback-header h2 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 12px; }\n    .feedback-content { background: white; padding: 24px; border-radius: 8px; }\n    .field-group { margin-bottom: 20px; }\n    .field-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #333; }\n    .field-group input[type=\"number\"], .field-group textarea { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; }\n    .field-group input[type=\"checkbox\"] { width: auto; }\n  "] }]
    }], () => [{ type: i0.ElementRef }, { type: i1.SharedService }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i0.ChangeDetectorRef }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TestRunFeedbackFormComponentExtended, { className: "TestRunFeedbackFormComponentExtended", filePath: "src/lib/custom/Tests/test-run-feedback-form.component.ts", lineNumber: 57 }); })();
export function LoadTestRunFeedbackFormComponentExtended() { }
LoadTestRunFeedbackFormComponentExtended();
//# sourceMappingURL=test-run-feedback-form.component.js.map