"use strict";
/**
 * Lock event handler
 *
 *  Copyright (C) 2010-2019 R-T Specialty, LLC.
 *
 *  This file is part of the Liza Data Collection Framework
 *
 *  Liza is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.LockEventHandler = void 0;
/**
 * Handles lock events
 */
var LockEventHandler = /** @class */ (function () {
    /**
     * Initializes with client that will delegate the event
     *
     * @param client - client object
     */
    function LockEventHandler(_client) {
        this._client = _client;
    }
    /**
     * Handles locking
     *
     * @param type - event id; ignored
     * @param c    - continuation to invoke on completion
     * @param data - event data
     */
    LockEventHandler.prototype.handle = function (_type, c, data) {
        var lock_msg = data.value || 'quote server';
        this._client.getQuote().setExplicitLock(lock_msg);
        this._client.getUi().updateLocked();
        this._client.getUi().showLockedNotification(this._client.isInternal());
        c();
        return this;
    };
    return LockEventHandler;
}());
exports.LockEventHandler = LockEventHandler;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTG9ja0V2ZW50SGFuZGxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkxvY2tFdmVudEhhbmRsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHOzs7QUFNSDs7R0FFRztBQUNIO0lBQ0U7Ozs7T0FJRztJQUNILDBCQUErQixPQUFlO1FBQWYsWUFBTyxHQUFQLE9BQU8sQ0FBUTtJQUFHLENBQUM7SUFFbEQ7Ozs7OztPQU1HO0lBQ0gsaUNBQU0sR0FBTixVQUFPLEtBQXVCLEVBQUUsQ0FBYSxFQUFFLElBQWtCO1FBQy9ELElBQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxLQUFLLElBQUksY0FBYyxDQUFDO1FBRTlDLElBQUksQ0FBQyxPQUFPLENBQUMsUUFBUSxFQUFFLENBQUMsZUFBZSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBQ2xELElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLENBQUMsWUFBWSxFQUFFLENBQUM7UUFDcEMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLEVBQUUsQ0FBQyxzQkFBc0IsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUM7UUFFdkUsQ0FBQyxFQUFFLENBQUM7UUFFSixPQUFPLElBQUksQ0FBQztJQUNkLENBQUM7SUFDSCx1QkFBQztBQUFELENBQUMsQUExQkQsSUEwQkM7QUExQlksNENBQWdCIn0=