/** 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/
 *  ------------------------------------------------------------------------------
*/
function a41_0x29fb() {
    const _0x50c57b = [
        'Reaction\x20',
        '%1:\x20Reaction\x20base\x20method\x20_destroy',
        'enable',
        '9jQxEQm',
        '5270688VxOexd',
        '4UIVgRG',
        './util',
        'getLogger',
        'has',
        '\x20already\x20exists.',
        '9170BBsGrP',
        'Subclass\x20failed\x20to\x20provide\x20enable()\x20implementation',
        '_destroy',
        '27128irFuCC',
        '378709mcBeSX',
        '42819ZvlcQE',
        'actiondata',
        '__deleted',
        'getID',
        'trouble',
        'exports',
        '1752SolIzk',
        'getName',
        '515cjjdai',
        'Object\x20is\x20not\x20Reaction',
        '873798RSKltD',
        'disabled',
        'disable',
        'log',
        'getActions',
        '7XmbOuT',
        './Observer',
        '4521JJgLtx',
        'get',
        'mixin',
        'actions',
        'name',
        'add',
        'disconnect',
        'Structure'
    ];
    a41_0x29fb = function () {
        return _0x50c57b;
    };
    return a41_0x29fb();
}
const a41_0x34af5d = a41_0x79b7;
(function (_0x439543, _0x3553e8) {
    const _0x5211dd = a41_0x79b7, _0xb0c187 = _0x439543();
    while (!![]) {
        try {
            const _0x3d6203 = parseInt(_0x5211dd(0xcd)) / 0x1 + parseInt(_0x5211dd(0xc4)) / 0x2 * (-parseInt(_0x5211dd(0xce)) / 0x3) + parseInt(_0x5211dd(0xd4)) / 0x4 * (parseInt(_0x5211dd(0xd6)) / 0x5) + -parseInt(_0x5211dd(0xd8)) / 0x6 * (parseInt(_0x5211dd(0xdd)) / 0x7) + parseInt(_0x5211dd(0xcc)) / 0x8 * (parseInt(_0x5211dd(0xea)) / 0x9) + -parseInt(_0x5211dd(0xc9)) / 0xa * (-parseInt(_0x5211dd(0xdf)) / 0xb) + -parseInt(_0x5211dd(0xc3)) / 0xc;
            if (_0x3d6203 === _0x3553e8)
                break;
            else
                _0xb0c187['push'](_0xb0c187['shift']());
        } catch (_0x4ab4fb) {
            _0xb0c187['push'](_0xb0c187['shift']());
        }
    }
}(a41_0x29fb, 0x2e8ea));
const version = 0x6252, Logger = require('./Logger'), Observable = require('./Observable'), Observer = require(a41_0x34af5d(0xde)), util = require(a41_0x34af5d(0xc5));
var reactions = {};
class Reaction {
    constructor(_0x3e8efe, _0x4ae561) {
        const _0x16e88b = a41_0x34af5d;
        this['id'] = _0x3e8efe, this[_0x16e88b(0xcf)] = _0x4ae561, this[_0x16e88b(0xd2)] = ![], this[_0x16e88b(0xdb)] = Logger[_0x16e88b(0xc6)](this, _0x16e88b(0xe6));
    }
    static [a41_0x34af5d(0xc7)](_0x26a3ed) {
        return !!reactions[_0x26a3ed];
    }
    static [a41_0x34af5d(0xe4)](_0x3094e7) {
        const _0x5d34e5 = a41_0x34af5d;
        if (!(_0x3094e7 instanceof Reaction))
            throw new TypeError(_0x5d34e5(0xd7));
        const _0x25741c = _0x3094e7[_0x5d34e5(0xd1)]();
        if (reactions[_0x25741c])
            throw new Error(_0x5d34e5(0xe7) + String(_0x25741c) + _0x5d34e5(0xc8));
        return reactions[_0x25741c] = _0x3094e7, _0x3094e7;
    }
    static [a41_0x34af5d(0xe0)](_0x47116c) {
        return reactions[_0x47116c];
    }
    [a41_0x34af5d(0xd1)]() {
        return this['id'];
    }
    [a41_0x34af5d(0xd5)]() {
        return this['actiondata']?.['name'] || this['id'];
    }
    [a41_0x34af5d(0xdc)]() {
        const _0x4077d9 = a41_0x34af5d;
        return this[_0x4077d9(0xcf)]?.[_0x4077d9(0xe2)] || [];
    }
    get [a41_0x34af5d(0xe3)]() {
        return this['getName']();
    }
    get [a41_0x34af5d(0xe2)]() {
        const _0xef03d1 = a41_0x34af5d;
        return this[_0xef03d1(0xcf)]?.[_0xef03d1(0xe2)] || [];
    }
    get ['disabled']() {
        const _0x4d0191 = a41_0x34af5d;
        return !!this[_0x4d0191(0xcf)]?.[_0x4d0191(0xd9)];
    }
    [a41_0x34af5d(0xda)]() {
        this['enable'](![]);
    }
    [a41_0x34af5d(0xe9)](_0x56833a) {
        const _0x494920 = a41_0x34af5d;
        throw new ReferenceError(_0x494920(0xca));
    }
    [a41_0x34af5d(0xcb)]() {
        const _0xe43f30 = a41_0x34af5d;
        this[_0xe43f30(0xdb)]['debug'](0x5, _0xe43f30(0xe8), this), this['id'] && (this['unsubscribe'](), this[_0xe43f30(0xe5)](), delete reactions[this['id']], delete this[_0xe43f30(0xcf)], this[_0xe43f30(0xd0)] = this['id'], this['id'] = null);
    }
}
function a41_0x79b7(_0x46030d, _0x251d35) {
    _0x46030d = _0x46030d - 0xc3;
    const _0x29fbfb = a41_0x29fb();
    let _0x79b762 = _0x29fbfb[_0x46030d];
    return _0x79b762;
}
util[a41_0x34af5d(0xe1)](Reaction, Observer), util[a41_0x34af5d(0xe1)](Reaction, Observable), module[a41_0x34af5d(0xd3)] = Reaction;