<commit_before>(function () {
	
	/**
	 * Widget for controls
	 * @constructor
	 * @param {HTMLElement} container - A domElement where default control widget will be attached to
	 */
	PANOLENS.Widget = function ( container ) {

		THREE.EventDispatcher.call( this );

		this.container = container || document.body;

		this.barElement;
		this.fullscreenElement;
		this.navigationElement;
		this.vrElement;
		this.videoElement;

	}

	PANOLENS.Widget.prototype = Object.create( THREE.EventDispatcher.prototype );

	PANOLENS.Widget.prototype.constructor = PANOLENS.Widget;

	PANOLENS.Widget.prototype.addControlBar = function () {

		if ( !this.container ) {

			console.warn( 'Widget container not set' ); 
			return; 
		}

		var scope = this, bar, styleTranslate, styleOpacity;

		bar = document.createElement( 'div' );
		bar.style.width = '100%';
		bar.style.height = '44px';
		bar.style.float = 'left';
		bar.style.transform = bar.style.webkitTransform = bar.style.msTransform = 'translateY(-100%)';
		bar.style.background = 'rgba( 0, 0, 0, 0.3 )';
		bar.style.transition = 'all 0.5s ease';
		bar.isHidden = false;
		bar.toggle = function () {
			bar.isHidden = !bar.isHidden;
			styleTranslate = bar.isHidden ? 'translateY(0)' : 'translateY(-100%)';
			styleOpacity = bar.isHidden ? 0 : 1;
			bar.style.transform = bar.style.webkitTransform = bar.style.msTransform = styleTranslate;
			bar.style.opacity = styleOpacity;
		};

		this.container.appendChild( bar );

		// Event listener
		this.addEventListener( 'control-bar-toggle', bar.toggle );

		this.barElement = bar;

	};

	PANOLENS.Widget.prototype.addControlButton = function ( name ) {

		this.fullscreenElement = name === 'fullscreen' ? this.createFullscreenButton() : this.fullscreenElement;
		this.navigationElement = name === 'navigation' ? this.createCameraControlButton() : this.navigationElement;
		this.vrElement = name === 'vr' ? this.createVRButton() : this.vrElement;
		this.videoElement = name === 'video' ? this.createVideoControl() : this.videoElement;

		// Add Control Items
		this.fullscreenElement && this.barElement.appendChild( this.fullscreenElement );
		this.navigationElement && this.barElement.appendChild( this.navigationElement );
		this.vrElement && this.barElement.appendChild( this.vrElement );
		this.videoElement && this.barElement.appendChild( this.videoElement );

	};

	PANOLENS.Widget.prototype.createVRButton = function () {

		var scope = this, item;

		function onTap () {

			scope.dispatchEvent( { type: 'panolens-viewer-handler', method: 'toggleVR' } );

		}

		item = this.createCustomItem( { 

			style : { 

				backgroundImage : 'url("' + PANOLENS.DataImage.Cardboard + '")' 

			},

			onTap : onTap

		} );

		return item;

	}

	PANOLENS.Widget.prototype.createFullscreenButton = function () {

		var scope = this, item, isFullscreen = false;

		function onTap () {

			if ( !isFullscreen ) {
			    scope.container.requestFullscreen && scope.container.requestFullscreen();<commit_msg>Don't create fullscreen button if not supported<commit_after>(function () {
	
	/**
	 * Widget for controls
	 * @constructor
	 * @param {HTMLElement} container - A domElement where default control widget will be attached to
	 */
	PANOLENS.Widget = function ( container ) {

		THREE.EventDispatcher.call( this );

		this.container = container || document.body;

		this.barElement;
		this.fullscreenElement;
		this.navigationElement;
		this.vrElement;
		this.videoElement;

	}

	PANOLENS.Widget.prototype = Object.create( THREE.EventDispatcher.prototype );

	PANOLENS.Widget.prototype.constructor = PANOLENS.Widget;

	PANOLENS.Widget.prototype.addControlBar = function () {

		if ( !this.container ) {

			console.warn( 'Widget container not set' ); 
			return; 
		}

		var scope = this, bar, styleTranslate, styleOpacity;

		bar = document.createElement( 'div' );
		bar.style.width = '100%';
		bar.style.height = '44px';
		bar.style.float = 'left';
		bar.style.transform = bar.style.webkitTransform = bar.style.msTransform = 'translateY(-100%)';
		bar.style.background = 'rgba( 0, 0, 0, 0.3 )';
		bar.style.transition = 'all 0.5s ease';
		bar.isHidden = false;
		bar.toggle = function () {
			bar.isHidden = !bar.isHidden;
			styleTranslate = bar.isHidden ? 'translateY(0)' : 'translateY(-100%)';
			styleOpacity = bar.isHidden ? 0 : 1;
			bar.style.transform = bar.style.webkitTransform = bar.style.msTransform = styleTranslate;
			bar.style.opacity = styleOpacity;
		};

		this.container.appendChild( bar );

		// Event listener
		this.addEventListener( 'control-bar-toggle', bar.toggle );

		this.barElement = bar;

	};

	PANOLENS.Widget.prototype.addControlButton = function ( name ) {

		this.fullscreenElement = name === 'fullscreen' ? this.createFullscreenButton() : this.fullscreenElement;
		this.navigationElement = name === 'navigation' ? this.createCameraControlButton() : this.navigationElement;
		this.vrElement = name === 'vr' ? this.createVRButton() : this.vrElement;
		this.videoElement = name === 'video' ? this.createVideoControl() : this.videoElement;

		// Add Control Items
		this.fullscreenElement && this.barElement.appendChild( this.fullscreenElement );
		this.navigationElement && this.barElement.appendChild( this.navigationElement );
		this.vrElement && this.barElement.appendChild( this.vrElement );
		this.videoElement && this.barElement.appendChild( this.videoElement );

	};

	PANOLENS.Widget.prototype.createVRButton = function () {

		var scope = this, item;

		function onTap () {

			scope.dispatchEvent( { type: 'panolens-viewer-handler', method: 'toggleVR' } );

		}

		item = this.createCustomItem( { 

			style : { 

				backgroundImage : 'url("' + PANOLENS.DataImage.Cardboard + '")' 

			},

			onTap : onTap

		} );

		return item;

	}

	PANOLENS.Widget.prototype.createFullscreenButton = function () {

		var scope = this, item, isFullscreen = false;

		// Don't create button if no support
		if ( !document.fullscreenEnabled       && 
			 !document.webkitFullscreenEnabled &&
			 !document.mozFullScreenEnabled    &&
			 !document.msFullscreenEnabled ) {
			return;
		}

		function onTap () {

			if ( !isFullscreen ) {
			    scope.container.requestFullscreen && scope.container.requestFullscreen();
{'fraction_non_alphanumeric': 0.13402889245585875, 'fraction_numerical': 0.006741573033707865, 'mean_word_length': 3.8190255220417635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4292818', 'n_tokens_mistral': 2190, 'n_tokens_neox': 1903, 'n_words': 375}