<commit_before>/*
 * Copyright 2014 WebFilings, LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

define(function(require) {
    'use strict';

    var BrowserInfo = require('wf-js-common/BrowserInfo');
    var DestroyUtil = require('wf-js-common/DestroyUtil');
    var DOMUtil = require('wf-js-common/DOMUtil');
    var EventTypes = require('wf-js-uicomponents/awesome_map/EventTypes');
    var Gesture = require('wf-js-uicomponents/awesome_map/Gesture');
    var Hammer = require('hammerjs');
    var InteractionEvent = require('wf-js-uicomponents/awesome_map/InteractionEvent');
    var MouseAdapter = require('wf-js-common/MouseAdapter');
    var Observable = require('wf-js-common/Observable');
    var Utils = require('wf-js-common/Utils');

    /**
     * Module that facilitates testing dependencies, as the methods can be mocked.
     */
    var dependencies = {
        createHammerInstance: function(host) {
            /* jshint camelcase:false */
            return new Hammer(host, {
                hold_threshold: 10,
                hold_timeout: 250,
                swipe_velocity: 1,
                transform_min_scale: 0.05
            });
        },
        createMouseAdapter: function(host) {
            return new MouseAdapter(host);
        },
        getWindow: function() {
            return window;
        }
    };

    /**
     * Creates a new EventSynthesizer with the given configuration.
     *
     * @classdesc
     *
     * An EventSynthesizer captures all the interaction events affecting
     * the host element and normalizes them into discrete actionable events.
     *
     * @name EventSynthesizer
     * @constructor
     *
     * @param {Object} configuration
     *
     * @param {HTMLElement} configuration.host
     *        The element that hosts the event synthesizer.
     *
     * @param {HTMLElement} [configuration.cancelMouseWheelEvents=true]
     *        Cancel mouse wheel events when handled so that browser window does not shift.
     *
     * @example
     *
     * var host = document.getElementById('host');
     * var eventSynthesizer = new EventSynthesizer({ host: host });
     * eventSynthesizer.onEventSynthesized(function(interactionEvent) { });
     */
    var EventSynthesizer = function(configuration) {
        this._validateConfiguration(configuration);

        //---------------------------------------------------------
        // Observables
        //---------------------------------------------------------

        /**
         * Observable for subscribing to interaction events.
         * @method EventSynthesizer#onEventSynthesized
         * @param {Function} callback
         *        Invoked with (source, {
         *            event: {@link InteractionEvent}
         *        })
         */
        this.onEventSynthesized = Observable.newObservable();

        //---------------------------------------------------------
        // Private properties
        //---------------------------------------------------------

        /**<commit_msg>Fix jsdoclet<commit_after>/*
 * Copyright 2014 WebFilings, LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

define(function(require) {
    'use strict';

    var BrowserInfo = require('wf-js-common/BrowserInfo');
    var DestroyUtil = require('wf-js-common/DestroyUtil');
    var DOMUtil = require('wf-js-common/DOMUtil');
    var EventTypes = require('wf-js-uicomponents/awesome_map/EventTypes');
    var Gesture = require('wf-js-uicomponents/awesome_map/Gesture');
    var Hammer = require('hammerjs');
    var InteractionEvent = require('wf-js-uicomponents/awesome_map/InteractionEvent');
    var MouseAdapter = require('wf-js-common/MouseAdapter');
    var Observable = require('wf-js-common/Observable');
    var Utils = require('wf-js-common/Utils');

    /**
     * Module that facilitates testing dependencies, as the methods can be mocked.
     */
    var dependencies = {
        createHammerInstance: function(host) {
            /* jshint camelcase:false */
            return new Hammer(host, {
                hold_threshold: 10,
                hold_timeout: 250,
                swipe_velocity: 1,
                transform_min_scale: 0.05
            });
        },
        createMouseAdapter: function(host) {
            return new MouseAdapter(host);
        },
        getWindow: function() {
            return window;
        }
    };

    /**
     * Creates a new EventSynthesizer with the given configuration.
     *
     * @classdesc
     *
     * An EventSynthesizer captures all the interaction events affecting
     * the host element and normalizes them into discrete actionable events.
     *
     * @name EventSynthesizer
     * @constructor
     *
     * @param {Object} configuration
     *
     * @param {HTMLElement} configuration.host
     *        The element that hosts the event synthesizer.
     *
     * @param {boolean} [configuration.cancelMouseWheelEvents=true]
     *        Cancel mouse wheel events when handled so that browser window does not shift.
     *
     * @example
     *
     * var host = document.getElementById('host');
     * var eventSynthesizer = new EventSynthesizer({ host: host });
     * eventSynthesizer.onEventSynthesized(function(interactionEvent) { });
     */
    var EventSynthesizer = function(configuration) {
        this._validateConfiguration(configuration);

        //---------------------------------------------------------
        // Observables
        //---------------------------------------------------------

        /**
         * Observable for subscribing to interaction events.
         * @method EventSynthesizer#onEventSynthesized
         * @param {Function} callback
         *        Invoked with (source, {
         *            event: {@link InteractionEvent}
         *        })
         */
        this.onEventSynthesized = Observable.newObservable();

        //---------------------------------------------------------
        // Private properties
        //---------------------------------------------------------

        /**
{'fraction_non_alphanumeric': 0.15445210296806863, 'fraction_numerical': 0.004782669855113237, 'mean_word_length': 1.9115479115479115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '912000', 'n_tokens_mistral': 1842, 'n_tokens_neox': 1738, 'n_words': 499}