import { Arr, Obj, Type } from '@ephox/katamari';
import * as BehaviourBlob from '../../behaviour/common/BehaviourBlob';
// This goes through the list of behaviours defined for a particular spec (removing anything
// that has been revoked), and returns the BehaviourType (e.g. Sliding)
const getBehaviours = (spec) => {
    const behaviours = Obj.get(spec, 'behaviours').getOr({});
    return Arr.bind(Obj.keys(behaviours), (name) => {
        const behaviour = behaviours[name];
        return Type.isNonNullable(behaviour) ? [behaviour.me] : [];
    });
};
const generateFrom = (spec, all) => BehaviourBlob.generateFrom(spec, all);
const generate = (spec) => {
    const all = getBehaviours(spec);
    return generateFrom(spec, all);
};
export { generate, generateFrom };
//# sourceMappingURL=CompBehaviours.js.map