"use strict";
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;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@angular/core");
const store_1 = require("@ngrx/store");
const project_1 = require("../redux/project");
var State;
(function (State) {
    State[State["Connecting"] = 0] = "Connecting";
    State[State["AwaitingLogin"] = 1] = "AwaitingLogin";
    State[State["AwaitingGameClient"] = 2] = "AwaitingGameClient";
})(State = exports.State || (exports.State = {}));
/**
 * The Channel Select Dialog prompts the user to enter a channel ID to connect
 * to, rather than their own. It's "hidden" behind a shift-click of the launch
 * button. If you're reading this, congratz, you found a secret :) We just
 * don't want to make this too accessible for people to muddle around
 * in others' controls.
 *
 * Resolves to true/false whether the user wants to connect immediately.
 */
let ChannelSelectDialog = class ChannelSelectDialog {
    constructor(store, project) {
        this.store = store;
        this.project = project;
        /**
         * Channel ID the user will be connected to.
         */
        this.connectionChannel = this.store.select(s => s.connect.channelOverride);
    }
    setConnectionChannel(channelID) {
        this.project.setConnectionChannel(channelID);
    }
};
ChannelSelectDialog = __decorate([
    core_1.Component({
        selector: 'editor-channel-select-dialog',
        templateUrl: './channel-select-dialog.component.html',
        changeDetection: core_1.ChangeDetectionStrategy.OnPush,
    }),
    __metadata("design:paramtypes", [store_1.Store, project_1.ProjectService])
], ChannelSelectDialog);
exports.ChannelSelectDialog = ChannelSelectDialog;
