/** Copyright (C) 2020-2025 Kedron Holdings LLC, All Rights Reserved. This file is part of Reactor.
 *  For info and license terms please see https://reactor.toggledbits.com/
 *  ------------------------------------------------------------------------------
*/
const a39_0x4a840c = a39_0x8da0;
(function (_0x5dc773, _0x4097ed) {
    const _0x1d3d2a = a39_0x8da0, _0x3e78cd = _0x5dc773();
    while (!![]) {
        try {
            const _0x10bdfa = -parseInt(_0x1d3d2a(0x1ed)) / 0x1 * (-parseInt(_0x1d3d2a(0x1e1)) / 0x2) + parseInt(_0x1d3d2a(0x1d7)) / 0x3 * (-parseInt(_0x1d3d2a(0x1e3)) / 0x4) + -parseInt(_0x1d3d2a(0x1e8)) / 0x5 * (-parseInt(_0x1d3d2a(0x1d6)) / 0x6) + parseInt(_0x1d3d2a(0x1d1)) / 0x7 * (parseInt(_0x1d3d2a(0x1df)) / 0x8) + parseInt(_0x1d3d2a(0x1e5)) / 0x9 * (parseInt(_0x1d3d2a(0x1ce)) / 0xa) + -parseInt(_0x1d3d2a(0x1dc)) / 0xb * (parseInt(_0x1d3d2a(0x1d4)) / 0xc) + parseInt(_0x1d3d2a(0x1d8)) / 0xd * (-parseInt(_0x1d3d2a(0x1eb)) / 0xe);
            if (_0x10bdfa === _0x4097ed)
                break;
            else
                _0x3e78cd['push'](_0x3e78cd['shift']());
        } catch (_0x5a75b0) {
            _0x3e78cd['push'](_0x3e78cd['shift']());
        }
    }
}(a39_0x2666, 0xd20c0));
function a39_0x2666() {
    const _0x1d6258 = [
        'actions',
        '117490RYFvhZ',
        'disabled',
        'actiondata',
        '1145270EoMBZR',
        'enable',
        './Logger',
        '5913588DEnIHO',
        '\x20already\x20exists.',
        '124074ecrBCP',
        '9bcvcVf',
        '1983059uQDNTf',
        'Subclass\x20failed\x20to\x20provide\x20enable()\x20implementation',
        'disconnect',
        'getLogger',
        '22gdRxqD',
        '__deleted',
        './Observer',
        '8FbrXpP',
        'mixin',
        '214GCBtrI',
        'getName',
        '1226748tfCTgA',
        'name',
        '1251nehIhs',
        'trouble',
        '%1:\x20Reaction\x20base\x20method\x20_destroy',
        '265PZQtRP',
        'getID',
        'add',
        '112nDfHrh',
        'get',
        '10221HDRyWy',
        'has',
        'disable',
        'Structure',
        'log'
    ];
    a39_0x2666 = function () {
        return _0x1d6258;
    };
    return a39_0x2666();
}
const version = 0x6252, Logger = require(a39_0x4a840c(0x1d3)), Observable = require('./Observable'), Observer = require(a39_0x4a840c(0x1de)), util = require('./util');
function a39_0x8da0(_0x21e399, _0x5c024c) {
    const _0x266649 = a39_0x2666();
    return a39_0x8da0 = function (_0x8da003, _0x559f06) {
        _0x8da003 = _0x8da003 - 0x1cb;
        let _0x108fc7 = _0x266649[_0x8da003];
        return _0x108fc7;
    }, a39_0x8da0(_0x21e399, _0x5c024c);
}
var reactions = {};
class Reaction {
    constructor(_0x4ef4b6, _0x2606cc) {
        const _0x5ae81a = a39_0x4a840c;
        this['id'] = _0x4ef4b6, this[_0x5ae81a(0x1d0)] = _0x2606cc, this[_0x5ae81a(0x1e6)] = ![], this[_0x5ae81a(0x1cc)] = Logger[_0x5ae81a(0x1db)](this, _0x5ae81a(0x1cb));
    }
    static [a39_0x4a840c(0x1ee)](_0x370bfd) {
        return !!reactions[_0x370bfd];
    }
    static [a39_0x4a840c(0x1ea)](_0x4ce8a6) {
        const _0x4723a8 = a39_0x4a840c;
        if (!(_0x4ce8a6 instanceof Reaction))
            throw new TypeError('Object\x20is\x20not\x20Reaction');
        const _0xad7930 = _0x4ce8a6[_0x4723a8(0x1e9)]();
        if (reactions[_0xad7930])
            throw new Error('Reaction\x20' + String(_0xad7930) + _0x4723a8(0x1d5));
        return reactions[_0xad7930] = _0x4ce8a6, _0x4ce8a6;
    }
    static [a39_0x4a840c(0x1ec)](_0x149718) {
        return reactions[_0x149718];
    }
    ['getID']() {
        return this['id'];
    }
    [a39_0x4a840c(0x1e2)]() {
        const _0x1bf45d = a39_0x4a840c;
        return this['actiondata']?.[_0x1bf45d(0x1e4)] || this['id'];
    }
    ['getActions']() {
        const _0x10b6e2 = a39_0x4a840c;
        return this[_0x10b6e2(0x1d0)]?.[_0x10b6e2(0x1cd)] || [];
    }
    get [a39_0x4a840c(0x1e4)]() {
        const _0x4d598d = a39_0x4a840c;
        return this[_0x4d598d(0x1e2)]();
    }
    get [a39_0x4a840c(0x1cd)]() {
        return this['actiondata']?.['actions'] || [];
    }
    get [a39_0x4a840c(0x1cf)]() {
        const _0x2e95b7 = a39_0x4a840c;
        return !!this[_0x2e95b7(0x1d0)]?.[_0x2e95b7(0x1cf)];
    }
    [a39_0x4a840c(0x1ef)]() {
        const _0x3e3d53 = a39_0x4a840c;
        this[_0x3e3d53(0x1d2)](![]);
    }
    [a39_0x4a840c(0x1d2)](_0x3e4acc) {
        const _0x5287d8 = a39_0x4a840c;
        throw new ReferenceError(_0x5287d8(0x1d9));
    }
    ['_destroy']() {
        const _0x48217f = a39_0x4a840c;
        this['log']['debug'](0x5, _0x48217f(0x1e7), this), this['id'] && (this['unsubscribe'](), this[_0x48217f(0x1da)](), delete reactions[this['id']], delete this[_0x48217f(0x1d0)], this[_0x48217f(0x1dd)] = this['id'], this['id'] = null);
    }
}
util[a39_0x4a840c(0x1e0)](Reaction, Observer), util['mixin'](Reaction, Observable), module['exports'] = Reaction;