import { __decorate, __metadata } from "tslib";
import '@material/web/button/elevated-button.js';
import { html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
let OAuth2DecisionErrorPage = class OAuth2DecisionErrorPage extends LitElement {
    constructor() {
        super(...arguments);
        this.data = {};
        this.user = {};
        this.domain = {};
        this.req = {};
        this.redirectURI = '';
        this.transactionID = '';
    }
    render() {
        return html `
      <h2>Application Binding Error</h2>

      <p>Hi ${this.user.name}!</p>
      <p><b>Application Not Found</b></p>
      <p>You better check you give a correct client id (appKey)</p>

      <p>Company: ${this.domain.subdomain}</p>
      <p>Application Client ID : ${this.req.clientID}</p>
      <p>Redirect URI : ${this.redirectURI}</p>
      <p>State : ${this.req.state}</p>

      <form>
        <input name="transaction_id" value="${this.transactionID}" hidden />
        <input name="subdomain" type="text" value="${this.domain.subdomain}" hidden />
        <input name="appKey" value="${this.req.clientID}" hidden />
        <input name="scope" value="${this.req.scope}" hidden />
        <input name="state" type="text" value="${this.req.state}" hidden />
        <input name="email" type="text" value="${this.user.email}" hidden />

        <md-elevated-button raised @click="${() => history.back()}">Move back</md-elevated-button>
      </form>
    `;
    }
    updated(changedProps) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j;
        if (changedProps.has('data')) {
            this.user = ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.oauth2) === null || _b === void 0 ? void 0 : _b.user) || this.user;
            this.domain = ((_c = this.data) === null || _c === void 0 ? void 0 : _c.domain) || this.domain;
            this.req = ((_e = (_d = this.data) === null || _d === void 0 ? void 0 : _d.oauth2) === null || _e === void 0 ? void 0 : _e.req) || this.req;
            this.redirectURI = ((_g = (_f = this.data) === null || _f === void 0 ? void 0 : _f.oauth2) === null || _g === void 0 ? void 0 : _g.redirectURI) || this.redirectURI;
            this.transactionID = ((_j = (_h = this.data) === null || _h === void 0 ? void 0 : _h.oauth2) === null || _j === void 0 ? void 0 : _j.transactionID) || this.transactionID;
        }
    }
};
__decorate([
    property({ type: Object }),
    __metadata("design:type", Object)
], OAuth2DecisionErrorPage.prototype, "data", void 0);
__decorate([
    property({ type: Object }),
    __metadata("design:type", Object)
], OAuth2DecisionErrorPage.prototype, "user", void 0);
__decorate([
    property({ type: Object }),
    __metadata("design:type", Object)
], OAuth2DecisionErrorPage.prototype, "domain", void 0);
__decorate([
    property({ type: Object }),
    __metadata("design:type", Object)
], OAuth2DecisionErrorPage.prototype, "req", void 0);
__decorate([
    property({ type: String }),
    __metadata("design:type", String)
], OAuth2DecisionErrorPage.prototype, "redirectURI", void 0);
__decorate([
    property({ type: String }),
    __metadata("design:type", String)
], OAuth2DecisionErrorPage.prototype, "transactionID", void 0);
OAuth2DecisionErrorPage = __decorate([
    customElement('oauth2-decision-error')
], OAuth2DecisionErrorPage);
//# sourceMappingURL=oauth2-decision-error-page.js.map