import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/expansion";
import * as i3 from "@angular/material/tooltip";
import * as i4 from "@asoftwareworld/form-builder-pro/core";
export class AswMyWorkspace {
    indexedDB;
    pastRequests;
    loadRequest = new EventEmitter();
    load(req) {
        this.loadRequest.emit(req);
    }
    deleteApiRequest(request) {
        const transaction = this.indexedDB.transaction('myWorkspace', 'readwrite');
        const myWorkspaceStore = transaction.objectStore('myWorkspace');
        myWorkspaceStore.delete(request._id);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AswMyWorkspace, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: AswMyWorkspace, selector: "asw-my-workspace", inputs: { indexedDB: "indexedDB", pastRequests: "pastRequests" }, outputs: { loadRequest: "loadRequest" }, ngImport: i0, template: "<strong>{{'FormControl.MyWorkspace' | aswTranslate}}</strong>\r\n<div class=\"asw-pt-2\">\r\n    <mat-accordion class=\"asw-headers-align\">\r\n        <mat-expansion-panel hideToggle class=\"asw-border\">\r\n            <mat-expansion-panel-header #panelH  *ngFor=\"let request of pastRequests\" (click)=\"panelH._toggle(); load(request)\">\r\n                <mat-panel-title>\r\n                    <span [ngClass]=\"{ \r\n                        'get-color': request.method === 'GET',\r\n                        'post-color': request.method === 'POST',\r\n                        'put-color': request.method === 'PUT',\r\n                        'patch-color': request.method === 'PATCH',\r\n                        'delete-color': request.method === 'DELETE'\r\n                    }\">{{request.method}}</span>\r\n                </mat-panel-title>\r\n                <mat-panel-description matTooltip=\"{{request.endpoint}}\" \r\n                [matTooltipPosition]=\"'below'\">\r\n                    <span class=\"asw-panel-description\">{{request.endpoint}}</span>\r\n                    <!-- <button mat-icon-button type=\"button\" (click)=\"deleteApiRequest(request)\">\r\n                        <mat-icon>delete</mat-icon>\r\n                    </button> -->\r\n                </mat-panel-description>\r\n            </mat-expansion-panel-header>\r\n        </mat-expansion-panel>\r\n    </mat-accordion>\r\n</div>\r\n", styles: [".post-color{color:#49cc90}.put-color{color:#fca130}.get-color{color:#61affe}.patch-color{color:#50e3c2}.delete-color{color:#f93e3e}.asw-api-communicator-method{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-expansion-panel-header-title{flex:0 0 auto}.mat-expansion-panel-header-description{flex:1 1 auto;min-width:0}.asw-panel-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.asw-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i2.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i2.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i4.AswTranslatePipe, name: "aswTranslate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AswMyWorkspace, decorators: [{
            type: Component,
            args: [{ selector: 'asw-my-workspace', template: "<strong>{{'FormControl.MyWorkspace' | aswTranslate}}</strong>\r\n<div class=\"asw-pt-2\">\r\n    <mat-accordion class=\"asw-headers-align\">\r\n        <mat-expansion-panel hideToggle class=\"asw-border\">\r\n            <mat-expansion-panel-header #panelH  *ngFor=\"let request of pastRequests\" (click)=\"panelH._toggle(); load(request)\">\r\n                <mat-panel-title>\r\n                    <span [ngClass]=\"{ \r\n                        'get-color': request.method === 'GET',\r\n                        'post-color': request.method === 'POST',\r\n                        'put-color': request.method === 'PUT',\r\n                        'patch-color': request.method === 'PATCH',\r\n                        'delete-color': request.method === 'DELETE'\r\n                    }\">{{request.method}}</span>\r\n                </mat-panel-title>\r\n                <mat-panel-description matTooltip=\"{{request.endpoint}}\" \r\n                [matTooltipPosition]=\"'below'\">\r\n                    <span class=\"asw-panel-description\">{{request.endpoint}}</span>\r\n                    <!-- <button mat-icon-button type=\"button\" (click)=\"deleteApiRequest(request)\">\r\n                        <mat-icon>delete</mat-icon>\r\n                    </button> -->\r\n                </mat-panel-description>\r\n            </mat-expansion-panel-header>\r\n        </mat-expansion-panel>\r\n    </mat-accordion>\r\n</div>\r\n", styles: [".post-color{color:#49cc90}.put-color{color:#fca130}.get-color{color:#61affe}.patch-color{color:#50e3c2}.delete-color{color:#f93e3e}.asw-api-communicator-method{flex-shrink:0;width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:4px}.mat-expansion-panel-header-title{flex:0 0 auto}.mat-expansion-panel-header-description{flex:1 1 auto;min-width:0}.asw-panel-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.asw-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}\n"] }]
        }], propDecorators: { indexedDB: [{
                type: Input
            }], pastRequests: [{
                type: Input
            }], loadRequest: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXktd29ya3NwYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi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XQtYWNjb3JkaW9uIGNsYXNzPVwiYXN3LWhlYWRlcnMtYWxpZ25cIj5cclxuICAgICAgICA8bWF0LWV4cGFuc2lvbi1wYW5lbCBoaWRlVG9nZ2xlIGNsYXNzPVwiYXN3LWJvcmRlclwiPlxyXG4gICAgICAgICAgICA8bWF0LWV4cGFuc2lvbi1wYW5lbC1oZWFkZXIgI3BhbmVsSCAgKm5nRm9yPVwibGV0IHJlcXVlc3Qgb2YgcGFzdFJlcXVlc3RzXCIgKGNsaWNrKT1cInBhbmVsSC5fdG9nZ2xlKCk7IGxvYWQocmVxdWVzdClcIj5cclxuICAgICAgICAgICAgICAgIDxtYXQtcGFuZWwtdGl0bGU+XHJcbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gW25nQ2xhc3NdPVwieyBcclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldC1jb2xvcic6IHJlcXVlc3QubWV0aG9kID09PSAnR0VUJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc3QtY29sb3InOiByZXF1ZXN0Lm1ldGhvZCA9PT0gJ1BPU1QnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAncHV0LWNvbG9yJzogcmVxdWVzdC5tZXRob2QgPT09ICdQVVQnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF0Y2gtY29sb3InOiByZXF1ZXN0Lm1ldGhvZCA9PT0gJ1BBVENIJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZS1jb2xvcic6IHJlcXVlc3QubWV0aG9kID09PSAnREVMRVRFJ1xyXG4gICAgICAgICAgICAgICAgICAgIH1cIj57e3JlcXVlc3QubWV0aG9kfX08L3NwYW4+XHJcbiAgICAgICAgICAgICAgICA8L21hdC1wYW5lbC10aXRsZT5cclxuICAgICAgICAgICAgICAgIDxtYXQtcGFuZWwtZGVzY3JpcHRpb24gbWF0VG9vbHRpcD1cInt7cmVxdWVzdC5lbmRwb2ludH19XCIgXHJcbiAgICAgICAgICAgICAgICBbbWF0VG9vbHRpcFBvc2l0aW9uXT1cIidiZWxvdydcIj5cclxuICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImFzdy1wYW5lbC1kZXNjcmlwdGlvblwiPnt7cmVxdWVzdC5lbmRwb2ludH19PC9zcGFuPlxyXG4gICAgICAgICAgICAgICAgICAgIDwhLS0gPGJ1dHRvbiBtYXQtaWNvbi1idXR0b24gdHlwZT1cImJ1dHRvblwiIChjbGljayk9XCJkZWxldGVBcGlSZXF1ZXN0KHJlcXVlc3QpXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxtYXQtaWNvbj5kZWxldGU8L21hdC1pY29uPlxyXG4gICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPiAtLT5cclxuICAgICAgICAgICAgICAgIDwvbWF0LXBhbmVsLWRlc2NyaXB0aW9uPlxyXG4gICAgICAgICAgICA8L21hdC1leHBhbnNpb24tcGFuZWwtaGVhZGVyPlxyXG4gICAgICAgIDwvbWF0LWV4cGFuc2lvbi1wYW5lbD5cclxuICAgIDwvbWF0LWFjY29yZGlvbj5cclxuPC9kaXY+XHJcbiJdfQ==