<commit_before>var Lang = A.Lang,

	getClassName = A.ClassNameManager.getClassName,

	NAME = 'component',

	CSS_COMPONENT = getClassName(NAME),

	CSS_HELPER_HIDDEN = getClassName('helper', 'hidden');

var Component = function(config) {
	var instance = this;

	instance._originalConfig = config;

	Component.superclass.constructor.apply(this, arguments);
};

Component.NAME = 'component';

Component.ATTRS = {
	cssClass: {
		lazyAdd: false,
		value: null
	},
	hideClass: {
		value: CSS_HELPER_HIDDEN
	},
	owner: {
		validator: function(value) {
			var instance = this;

			return value instanceof A.Widget || value === null;
		}
	},
	relayEvents: {
		value: true
	},
	render: {
		value: false,
		writeOnce: true
	}
};

A.extend(
	Component,
	A.Widget,
	{
		initializer: function(config) {
			var instance = this;

			if (config) {
				instance._uiSetCssClass(config.cssClass);
			}

			instance._setOwnerComponent(instance.get('ownerComponent'));
			instance._setRelayEvents(instance.get('relayEvents'));

			instance._setComponentClassNames();

			instance.after('cssClassChange', instance._afterCssClassChange);
			instance.after('destroy', instance._afterComponentDestroy);
			instance.after('ownerChange', instance._afterComponentOwnerChange);
			instance.after('relayEventsChange', instance._afterComponentRelayEventsChange);
			instance.after('visibleChange', instance._afterComponentVisibleChange);
		},

		clone: function(config) {
			var instance = this;

			config = config || {};

			config.id = config.id || A.guid();

			A.mix(config, instance._originalConfig);

			return new instance.constructor(config);
		},

		toggle: function() {
			var instance = this;

			return instance.set('visible', !instance.get('visible'));
		},

		_afterComponentDestroy: function(event) {
			var instance = this;

			try {
				instance.get('boundingBox').remove();
			}
			catch (e) {}
		},

		_afterComponentOwnerChange: function(event) {
			var instance = this;

			instance._setOwnerComponent(event.newVal);
		},

		_afterComponentRelayEventsChange: function(event) {
			var instance = this;

			instance._setRelayEvents(event.newVal);
		},

		_afterComponentVisibleChange: function(event) {
			var instance = this;

			var hideClass = instance.get('hideClass');

			if (hideClass !== false) {
				var boundingBox = instance.get('boundingBox');

				var action = 'addClass';

				if (event.newVal) {
					action = 'removeClass';
				}

				boundingBox[action](hideClass || CSS_HELPER_HIDDEN);
			}
		},

		_afterCssClassChange: function(event) {
			var instance = this;

			instance._uiSetCssClass(event.newVal, event.prevVal);
		},

		_relayEvents: function() {
			var instance = this;

			Component.superclass.fire.apply(instance, arguments);

			var ownerComponent = instance._ownerComponent;

			if (ownerComponent) {
				ownerComponent.fire.apply(ownerComponent, arguments);
			}
		},

		_setComponentClassNames: function() {
			var instance = this;

			var classes = instance._getClasses();
			var name;
			var buffer = [];

			for (var i = classes.length - 4; i >= 0; i--) {
				var name = classes[i].NAME.toLowerCase();

				buffer.push(getClassName(name, 'content'));
			}<commit_msg>Fixing adding of "undefined-content" in classnames<commit_after>var Lang = A.Lang,

	getClassName = A.ClassNameManager.getClassName,

	NAME = 'component',

	CSS_COMPONENT = getClassName(NAME),

	CSS_HELPER_HIDDEN = getClassName('helper', 'hidden');

var Component = function(config) {
	var instance = this;

	instance._originalConfig = config;

	Component.superclass.constructor.apply(this, arguments);
};

Component.NAME = 'component';

Component.ATTRS = {
	cssClass: {
		lazyAdd: false,
		value: null
	},
	hideClass: {
		value: CSS_HELPER_HIDDEN
	},
	owner: {
		validator: function(value) {
			var instance = this;

			return value instanceof A.Widget || value === null;
		}
	},
	relayEvents: {
		value: true
	},
	render: {
		value: false,
		writeOnce: true
	}
};

A.extend(
	Component,
	A.Widget,
	{
		initializer: function(config) {
			var instance = this;

			if (config && config.cssClass) {
				instance._uiSetCssClass(config.cssClass);
			}

			instance._setOwnerComponent(instance.get('ownerComponent'));
			instance._setRelayEvents(instance.get('relayEvents'));

			instance._setComponentClassNames();

			instance.after('cssClassChange', instance._afterCssClassChange);
			instance.after('destroy', instance._afterComponentDestroy);
			instance.after('ownerChange', instance._afterComponentOwnerChange);
			instance.after('relayEventsChange', instance._afterComponentRelayEventsChange);
			instance.after('visibleChange', instance._afterComponentVisibleChange);
		},

		clone: function(config) {
			var instance = this;

			config = config || {};

			config.id = config.id || A.guid();

			A.mix(config, instance._originalConfig);

			return new instance.constructor(config);
		},

		toggle: function() {
			var instance = this;

			return instance.set('visible', !instance.get('visible'));
		},

		_afterComponentDestroy: function(event) {
			var instance = this;

			try {
				instance.get('boundingBox').remove();
			}
			catch (e) {}
		},

		_afterComponentOwnerChange: function(event) {
			var instance = this;

			instance._setOwnerComponent(event.newVal);
		},

		_afterComponentRelayEventsChange: function(event) {
			var instance = this;

			instance._setRelayEvents(event.newVal);
		},

		_afterComponentVisibleChange: function(event) {
			var instance = this;

			var hideClass = instance.get('hideClass');

			if (hideClass !== false) {
				var boundingBox = instance.get('boundingBox');

				var action = 'addClass';

				if (event.newVal) {
					action = 'removeClass';
				}

				boundingBox[action](hideClass || CSS_HELPER_HIDDEN);
			}
		},

		_afterCssClassChange: function(event) {
			var instance = this;

			instance._uiSetCssClass(event.newVal, event.prevVal);
		},

		_relayEvents: function() {
			var instance = this;

			Component.superclass.fire.apply(instance, arguments);

			var ownerComponent = instance._ownerComponent;

			if (ownerComponent) {
				ownerComponent.fire.apply(ownerComponent, arguments);
			}
		},

		_setComponentClassNames: function() {
			var instance = this;

			var classes = instance._getClasses();
			var name;
			var buffer = [];

			for (var i = classes.length - 4; i >= 0; i--) {
				name = classes[i].NAME.toLowerCase();

				buffer.push(getClassName(name, 'content'));
			}
{'fraction_non_alphanumeric': 0.13211066210755362, 'fraction_numerical': 0.0006216972334473111, 'mean_word_length': 3.984508133230054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6630558', 'n_tokens_mistral': 2356, 'n_tokens_neox': 1964, 'n_words': 385}