/** Copyright (C) 2020-2026 Kedron Holdings LLC, All Rights Reserved. This file is part of Reactor.
 *  For info and license terms please see https://reactor.toggledbits.com/
 *  ------------------------------------------------------------------------------
*/
const a40_0x157bb9 = a40_0x482a;
function a40_0x3a7b() {
    const _0x3b7007 = [
        'unsubscribe',
        '744arUxCk',
        '54ZRWUpE',
        'exports',
        '9360354fboXrv',
        'log',
        'has',
        '7GeLvYH',
        '\x20already\x20exists.',
        '5220670vwcrlk',
        'disabled',
        '%1:\x20Reaction\x20base\x20method\x20_destroy',
        'actions',
        'get',
        'name',
        'debug',
        '825239iyrURZ',
        'trouble',
        'Structure',
        'add',
        '2308528bYuDTn',
        'actiondata',
        './Observer',
        './Observable',
        '1010223GMsmzr',
        'getName',
        'disconnect',
        'getActions',
        '514236kyQOTf',
        'enable',
        '__deleted',
        'Object\x20is\x20not\x20Reaction',
        'mixin',
        'Reaction\x20',
        '25285bkTmuj'
    ];
    a40_0x3a7b = function () {
        return _0x3b7007;
    };
    return a40_0x3a7b();
}
(function (_0x1850ae, _0x55ed65) {
    const _0x3ef50b = a40_0x482a, _0x5b5698 = _0x1850ae();
    while (!![]) {
        try {
            const _0x16e821 = -parseInt(_0x3ef50b(0xc4)) / 0x1 + -parseInt(_0x3ef50b(0xad)) / 0x2 + parseInt(_0x3ef50b(0xcc)) / 0x3 + -parseInt(_0x3ef50b(0xb5)) / 0x4 * (-parseInt(_0x3ef50b(0xb3)) / 0x5) + -parseInt(_0x3ef50b(0xb8)) / 0x6 * (parseInt(_0x3ef50b(0xbb)) / 0x7) + parseInt(_0x3ef50b(0xc8)) / 0x8 * (parseInt(_0x3ef50b(0xb6)) / 0x9) + parseInt(_0x3ef50b(0xbd)) / 0xa;
            if (_0x16e821 === _0x55ed65)
                break;
            else
                _0x5b5698['push'](_0x5b5698['shift']());
        } catch (_0x5e6534) {
            _0x5b5698['push'](_0x5b5698['shift']());
        }
    }
}(a40_0x3a7b, 0xd8e46));
const version = 0x6252, Logger = require('./Logger'), Observable = require(a40_0x157bb9(0xcb)), Observer = require(a40_0x157bb9(0xca)), util = require('./util');
var reactions = {};
function a40_0x482a(_0xe970e7, _0x2d1bc4) {
    _0xe970e7 = _0xe970e7 - 0xac;
    const _0x3a7b4d = a40_0x3a7b();
    let _0x482a86 = _0x3a7b4d[_0xe970e7];
    return _0x482a86;
}
class Reaction {
    constructor(_0x49539f, _0x2bab0f) {
        const _0x5b05f3 = a40_0x157bb9;
        this['id'] = _0x49539f, this[_0x5b05f3(0xc9)] = _0x2bab0f, this[_0x5b05f3(0xc5)] = ![], this[_0x5b05f3(0xb9)] = Logger['getLogger'](this, _0x5b05f3(0xc6));
    }
    static [a40_0x157bb9(0xba)](_0x6c9242) {
        return !!reactions[_0x6c9242];
    }
    static [a40_0x157bb9(0xc7)](_0x103221) {
        const _0x2f7b2c = a40_0x157bb9;
        if (!(_0x103221 instanceof Reaction))
            throw new TypeError(_0x2f7b2c(0xb0));
        const _0x3b2818 = _0x103221['getID']();
        if (reactions[_0x3b2818])
            throw new Error(_0x2f7b2c(0xb2) + String(_0x3b2818) + _0x2f7b2c(0xbc));
        return reactions[_0x3b2818] = _0x103221, _0x103221;
    }
    static [a40_0x157bb9(0xc1)](_0xfca7c8) {
        return reactions[_0xfca7c8];
    }
    ['getID']() {
        return this['id'];
    }
    [a40_0x157bb9(0xcd)]() {
        const _0x1dda43 = a40_0x157bb9;
        return this[_0x1dda43(0xc9)]?.['name'] || this['id'];
    }
    [a40_0x157bb9(0xac)]() {
        const _0x2977a7 = a40_0x157bb9;
        return this[_0x2977a7(0xc9)]?.[_0x2977a7(0xc0)] || [];
    }
    get [a40_0x157bb9(0xc2)]() {
        const _0x3a9e43 = a40_0x157bb9;
        return this[_0x3a9e43(0xcd)]();
    }
    get [a40_0x157bb9(0xc0)]() {
        return this['actiondata']?.['actions'] || [];
    }
    get [a40_0x157bb9(0xbe)]() {
        const _0x759d3e = a40_0x157bb9;
        return !!this[_0x759d3e(0xc9)]?.['disabled'];
    }
    ['disable']() {
        const _0x1d3365 = a40_0x157bb9;
        this[_0x1d3365(0xae)](![]);
    }
    [a40_0x157bb9(0xae)](_0x23db0d) {
        throw new ReferenceError('Subclass\x20failed\x20to\x20provide\x20enable()\x20implementation');
    }
    ['_destroy']() {
        const _0x3a3a01 = a40_0x157bb9;
        this['log'][_0x3a3a01(0xc3)](0x5, _0x3a3a01(0xbf), this), this['id'] && (this[_0x3a3a01(0xb4)](), this[_0x3a3a01(0xce)](), delete reactions[this['id']], delete this['actiondata'], this[_0x3a3a01(0xaf)] = this['id'], this['id'] = null);
    }
}
util[a40_0x157bb9(0xb1)](Reaction, Observer), util[a40_0x157bb9(0xb1)](Reaction, Observable), module[a40_0x157bb9(0xb7)] = Reaction;