YUI.add('aui-base-lang', function (A, NAME) {

(function() {
    var Lang = A.Lang,
        aArray = A.Array,
        AObject = A.Object,

        isArray = Lang.isArray,
        isNumber = Lang.isNumber,
        isString = Lang.isString,
        isUndefined = Lang.isUndefined,

        owns = AObject.owns;

    A.fn = function(fn, context, args) {
        var wrappedFn,
            dynamicLookup;

        // Explicitly set function arguments
        if (!isNumber(fn)) {
            var xargs = arguments;

            if (xargs.length > 2) {
                xargs = aArray(xargs, 2, true);
            }

            dynamicLookup = (isString(fn) && context);

            wrappedFn = function() {
                var method = (!dynamicLookup) ? fn : context[fn];

                return method.apply(context || fn, xargs);
            };
        }
        else {
            // Set function arity
            var argLength = fn;

            fn = context;
            context = args;
            dynamicLookup = (isString(fn) && context);

            wrappedFn = function() {
                var method = (!dynamicLookup) ? fn : context[fn],
                    returnValue;

                context = context || method;

                if (argLength > 0) {
                    returnValue = method.apply(context, aArray(arguments, 0, true).slice(0, argLength));
                }
                else {
                    returnValue = method.call(context);
                }

                return returnValue;
            };
        }

        return wrappedFn;
    };

    A.mix(Lang, {
        constrain: function(num, min, max) {
            return Math.min(Math.max(num, min), max);
        },

        emptyFn: function() {},

        emptyFnFalse: function() {
            return false;
        },

        emptyFnTrue: function() {
            return true;
        },

        isGuid: function(id) {
            return String(id).indexOf(A.Env._guidp) === 0;
        },

        isInteger: function(val) {
            return typeof val === 'number' &&
                isFinite(val) &&
                val > -9007199254740992 &&
                val < 9007199254740992 &&
                Math.floor(val) === val;
        },

        isNode: function(val) {
            return A.instanceOf(val, A.Node);
        },

        isNodeList: function(val) {
            return A.instanceOf(val, A.NodeList);
        },

        toFloat: function(value, defaultValue) {
            return parseFloat(value) || defaultValue || 0;
        },

        toInt: function(value, radix, defaultValue) {
            return parseInt(value, radix || 10) || defaultValue || 0;
        }
    });

    A.mix(aArray, {
        remove: function(a, from, to) {
            var rest = a.slice((to || from) + 1 || a.length);
            a.length = (from < 0) ? (a.length + from) : from;

            return a.push.apply(a, rest);
        },

        removeItem: function(a, item) {
            var index = aArray.indexOf(a, item);

            if (index > -1) {
                return aArray.remove(a, index);
            }

            return a;
        }
    });

    var LString = A.namespace('Lang.String'),

        DOC = A.config.doc,
        REGEX_DASH = /-([a-z])/gi,
        REGEX_ESCAPE_REGEX = /([.*+?^$(){}|[\]\/\\])/g,
        REGEX_NL2BR = /\r?\n/g,
        REGEX_STRIP_SCRIPTS = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/gi,
        REGEX_STRIP_TAGS = /<\/?[^>]+>/gi,
        REGEX_UNCAMELIZE = /([a-zA-Z][a-zA-Z])([A-Z])([a-z])/g,
        REGEX_UNCAMELIZE_REPLACE_SEPARATOR = /([a-z])([A-Z])/g,
        STR_ELLIPSIS = '...',

        htmlUnescapedValues = [],

        MAP_HTML_CHARS_ESCAPED = {
            '&': '&amp;',
            '<': '&lt;',
            '>': '&gt;',
            '"': '&#034;',
            '\'': '&#039;',
            '/': '&#047;',
            '`': '&#096;'
        },
        htmlChar,
        MAP_HTML_CHARS_UNESCAPED = {};

    for (htmlChar in MAP_HTML_CHARS_ESCAPED) {
        if (MAP_HTML_CHARS_ESCAPED.hasOwnProperty(htmlChar)) {
            var escapedValue = MAP_HTML_CHARS_ESCAPED[htmlChar];

            MAP_HTML_CHARS_UNESCAPED[escapedValue] = htmlChar;

            htmlUnescapedValues.push(htmlChar);
        }
    }

    var REGEX_HTML_ESCAPE = new RegExp('[' + htmlUnescapedValues.join('') + ']', 'g'),
        REGEX_HTML_UNESCAPE = /&([^;]+);/g;

    A.mix(LString, {
        camelize: A.cached(
            function(str, separator) {
                var regex = REGEX_DASH;

                str = String(str);

                if (separator) {
                    regex = new RegExp(separator + '([a-z])', 'gi');
                }

                return str.replace(regex, LString._camelize);
            }
        ),

        capitalize: A.cached(
            function(str) {
                if (str) {
                    str = String(str);

                    str = str.charAt(0).toUpperCase() + str.substr(1).toLowerCase();
                }

                return str;
            }
        ),

        contains: function(str, searchString) {
            return str.indexOf(searchString) !== -1;
        },

        defaultValue: function(str, defaultValue) {
            if (isUndefined(str) || str === '') {
                if (isUndefined(defaultValue)) {
                    defaultValue = '';
                }

                str = defaultValue;
            }

            return str;
        },

        endsWith: function(str, suffix) {
            var length = (str.length - suffix.length);

            return ((length >= 0) && (str.indexOf(suffix, length) === length));
        },

        escapeHTML: function(str) {
            return str.replace(REGEX_HTML_ESCAPE, LString._escapeHTML);
        },

        // Courtesy of: http://simonwillison.net/2006/Jan/20/escape/
        escapeRegEx: function(str) {
            return str.replace(REGEX_ESCAPE_REGEX, '\\$1');
        },

        nl2br: function(str) {
            return String(str).replace(REGEX_NL2BR, '<br />');
        },

        padNumber: function(num, length, precision) {
            var str = precision ? Number(num).toFixed(precision) : String(num);
            var index = str.indexOf('.');

            if (index === -1) {
                index = str.length;
            }

            return LString.repeat('0', Math.max(0, length - index)) + str;
        },

        pluralize: function(count, singularVersion, pluralVersion) {
            var suffix;

            if (count === 1) {
                suffix = singularVersion;
            }
            else {
                suffix = pluralVersion || singularVersion + 's';
            }

            return count + ' ' + suffix;
        },

        prefix: function(prefix, str) {
            str = String(str);

            if (str.indexOf(prefix) !== 0) {
                str = prefix + str;
            }

            return str;
        },

        remove: function(str, substitute, all) {
            var re = new RegExp(LString.escapeRegEx(substitute), all ? 'g' : '');

            return str.replace(re, '');
        },

        removeAll: function(str, substitute) {
            return LString.remove(str, substitute, true);
        },

        repeat: function(str, length) {
            return new Array(length + 1).join(str);
        },

        round: function(value, precision) {
            value = Number(value);

            if (isNumber(precision)) {
                precision = Math.pow(10, precision);
                value = Math.round(value * precision) / precision;
            }

            return value;
        },

        startsWith: function(str, prefix) {
            return (str.lastIndexOf(prefix, 0) === 0);
        },

        stripScripts: function(str) {
            if (str) {
                str = String(str).replace(REGEX_STRIP_SCRIPTS, '');
            }

            return str;
        },

        stripTags: function(str) {
            if (str) {
                str = String(str).replace(REGEX_STRIP_TAGS, '');
            }

            return str;
        },

        substr: function(str, start, length) {
            return String(str).substr(start, length);
        },

        uncamelize: A.cached(
            function(str, separator) {
                separator = separator || ' ';

                str = String(str);

                str = str.replace(REGEX_UNCAMELIZE, '$1' + separator + '$2$3');
                str = str.replace(REGEX_UNCAMELIZE_REPLACE_SEPARATOR, '$1' + separator + '$2');

                return str;
            }
        ),

        toLowerCase: function(str) {
            return String(str).toLowerCase();
        },

        toUpperCase: function(str) {
            return String(str).toUpperCase();
        },

        trim: Lang.trim,

        truncate: function(str, length, where) {
            str = String(str);

            var ellipsisLength = STR_ELLIPSIS.length,
                strLength = str.length;

            if (length > 3) {
                if (str && (strLength > length)) {
                    where = where || 'end';

                    if (where === 'end') {
                        str = str.substr(0, (length - ellipsisLength)) + STR_ELLIPSIS;
                    }
                    else if (where === 'middle') {
                        var middlePointA = Math.floor((length - ellipsisLength) / 2),
                            middlePointB = middlePointA;

                        if (length % 2 === 0) {
                            middlePointA = Math.ceil((length - ellipsisLength) / 2);
                            middlePointB = Math.floor((length - ellipsisLength) / 2);
                        }

                        str = str.substr(0, middlePointA) + STR_ELLIPSIS + str.substr(strLength - middlePointB);
                    }
                    else if (where === 'start') {
                        str = STR_ELLIPSIS + str.substr(strLength - length + ellipsisLength);
                    }
                }
            }
            else {
                str = STR_ELLIPSIS;
            }

            return str;
        },

        undef: function(str) {
            if (isUndefined(str)) {
                str = '';
            }

            return str;
        },

        // inspired from Google unescape entities
        unescapeEntities: function(str) {
            if (LString.contains(str, '&')) {
                if (DOC && !LString.contains(str, '<')) {
                    str = LString._unescapeEntitiesUsingDom(str);
                }
                else {
                    str = LString.unescapeHTML(str);
                }
            }

            return str;
        },

        unescapeHTML: function(str) {
            return str.replace(REGEX_HTML_UNESCAPE, LString._unescapeHTML);
        },

        _camelize: function(match0, match1) {
            return match1.toUpperCase();
        },

        _escapeHTML: function(match) {
            return MAP_HTML_CHARS_ESCAPED[match];
        },

        _unescapeHTML: function(match, entity) {
            var value = MAP_HTML_CHARS_UNESCAPED[match] || match;

            if (!value && entity.charAt(0) === '#') {
                var charCode = Number('0' + value.substr(1));

                if (!isNaN(charCode)) {
                    value = String.fromCharCode(charCode);
                }
            }

            return value;
        },

        _unescapeEntitiesUsingDom: function(str) {
            var el = DOC.createElement('a');

            el.innerHTML = str;

            if (el.normalize) {
                el.normalize();
            }

            str = el.firstChild.nodeValue;

            el.innerHTML = '';

            return str;
        }
    });

    /*
     * Maps an object to an array, using the return value of fn as the values
     * for the new array.
     */
    AObject.map = function(obj, fn, context) {
        var map = [],
            i;

        for (i in obj) {
            if (owns(obj, i)) {
                map[map.length] = fn.call(context, obj[i], i, obj);
            }
        }

        return map;
    };

    /*
     * Maps an array or object to a resulting array, using the return value of
     * fn as the values for the new array. Like A.each, this function can accept
     * an object or an array.
     */
    A.map = function(obj) {
        var module = AObject;

        if (isArray(obj)) {
            module = aArray;
        }

        return module.map.apply(this, arguments);
    };
}());


}, '3.1.0-deprecated.95');

YUI.add('aui-classnamemanager', function (A, NAME) {

var ClassNameManager = A.ClassNameManager,
    _getClassName = ClassNameManager.getClassName;

A.getClassName = A.cached(
    function() {
        var args = A.Array(arguments, 0, true);

        args[args.length] = true;

        return _getClassName.apply(ClassNameManager, args);
    }
);


}, '3.1.0-deprecated.95', {"requires": ["classnamemanager"]});

YUI.add('aui-component', function (A, NAME) {

/**
 * The Component Utility
 *
 * @module aui-component
 */

var Lang = A.Lang,
    AArray = A.Array,

    concat = function(arr, arr2) {
        return (arr || []).concat(arr2 || []);
    },

    _INSTANCES = {},
    _CONSTRUCTOR_OBJECT = A.config.win.Object.prototype.constructor,

    ClassNameManager = A.ClassNameManager,

    _getClassName = ClassNameManager.getClassName,
    _getWidgetClassName = A.Widget.getClassName,

    getClassName = A.getClassName,

    CSS_HIDE = getClassName('hide');

/**
 * A base class for `A.Component`, providing:
 *
 * - Widget Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)
 *
 * @class A.Component
 * @extends Widget
 * @uses A.WidgetCssClass, A.WidgetToggle
 * @param {Object} config Object literal specifying widget configuration
 *     properties.
 * @constructor
 */
var Component = A.Base.create('component', A.Widget, [
        A.WidgetCssClass,
        A.WidgetToggle
    ], {
    initializer: function(config) {
        var instance = this;

        instance._originalConfig = config;

        instance._setRender(config);

        _INSTANCES[instance.get('id')] = instance;
    },

    /**
     * Clone the current `A.Component`.
     *
     * @method clone
     * @param {Object} config
     * @return {Widget} Cloned instance.
     */
    clone: function(config) {
        var instance = this;

        config = config || {};

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

        A.mix(config, instance._originalConfig);

        return new instance.constructor(config);
    },

    /**
     * Set the visibility on the UI.
     *
     * @method _uiSetVisible
     * @param value
     * @protected
     */
    _uiSetVisible: function(value) {
        var instance = this;

        var superUISetVisible = Component.superclass._uiSetVisible;

        if (superUISetVisible) {
            superUISetVisible.apply(instance, arguments);
        }

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

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

            boundingBox.toggleClass(hideClass || CSS_HIDE, !value);
        }
    },

    /**
     * Applies standard class names to the `boundingBox` and `contentBox`.
     *
     * @method _renderBoxClassNames
     * @protected
     */
    _renderBoxClassNames: function() {
        var instance = this;

        var boundingBoxNode = instance.get('boundingBox')._node;
        var contentBoxNode = instance.get('contentBox')._node;

        var boundingBoxNodeClassName = boundingBoxNode.className;
        var contentBoxNodeClassName = contentBoxNode.className;

        var boundingBoxBuffer = (boundingBoxNodeClassName) ? boundingBoxNodeClassName.split(' ') : [];
        var contentBoxBuffer = (contentBoxNodeClassName) ? contentBoxNodeClassName.split(' ') : [];

        var classes = instance._getClasses();

        var classLength = classes.length;

        var auiClassesLength = classLength - 4;

        var classItem;
        var classItemName;

        boundingBoxBuffer.push(_getWidgetClassName());

        for (var i = classLength - 3; i >= 0; i--) {
            classItem = classes[i];

            classItemName = String(classItem.NAME).toLowerCase();

            boundingBoxBuffer.push(classItem.CSS_PREFIX || _getClassName(classItemName));

            if (i <= auiClassesLength) {
                classItemName = classItemName;

                contentBoxBuffer.push(getClassName(classItemName, 'content'));
            }
        }

        contentBoxBuffer.push(instance.getClassName('content'));

        if (boundingBoxNode === contentBoxNode) {
            contentBoxNodeClassName = AArray.dedupe(contentBoxBuffer.concat(boundingBoxBuffer)).join(' ');
        }
        else {
            boundingBoxNode.className = AArray.dedupe(boundingBoxBuffer).join(' ');

            contentBoxNodeClassName = AArray.dedupe(contentBoxBuffer).join(' ');
        }

        contentBoxNode.className = contentBoxNodeClassName;
    },

    /**
     * Renders the `A.Component` based upon a passed in interaction.
     *
     * @method _renderInteraction
     * @param event
     * @param parentNode
     * @protected
     */
    _renderInteraction: function(event, parentNode) {
        var instance = this;

        instance.render(parentNode);

        var renderHandles = instance._renderHandles;

        for (var i = renderHandles.length - 1; i >= 0; i--) {
            var handle = renderHandles.pop();

            handle.detach();
        }
    },

    /**
     * Sets the interaction and render behavior based upon an object (intercepts
     * the default rendering behavior).
     *
     * @method _setRender
     * @param config
     * @protected
     */
    _setRender: function(config) {
        var instance = this;

        var render = config && config.render;

        if (render && render.constructor === _CONSTRUCTOR_OBJECT) {
            var eventType = render.eventType || 'mousemove';
            var parentNode = render.parentNode;
            var selector = render.selector || parentNode;

            if (selector) {
                instance._renderHandles = [];

                var renderHandles = instance._renderHandles;

                if (!Lang.isArray(eventType)) {
                    eventType = [eventType];
                }

                var renderInteraction = A.rbind(instance._renderInteraction, instance, parentNode);

                var interactionNode = A.one(selector);

                for (var i = eventType.length - 1; i >= 0; i--) {
                    renderHandles[i] = interactionNode.once(eventType[i], renderInteraction);
                }

                delete config.render;
            }
        }
    }
}, {
    /**
     * Static property used to define the default attribute configuration for
     * the Component.
     *
     * @property ATTRS
     * @type Object
     * @static
     */
    ATTRS: {
        /**
         * Indicates if use of the WAI-ARIA Roles and States should be enabled
         * for the Widget.
         *
         * @attribute useARIA
         * @default false
         * @type Boolean
         * @writeOnce
         */
        useARIA: {
            writeOnce: true,
            value: false,
            validator: Lang.isBoolean
        },

        /**
         * CSS class added to hide the `boundingBox` when
         * [visible](A.Component.html#attr_visible) is set to `false`.
         *
         * @attribute hideClass
         * @default 'aui-hide'
         * @type String
         */
        hideClass: {
            value: CSS_HIDE
        },

        /**
         * If `true` the render phase will be autimatically invoked preventing
         * the `.render()` manual call.
         *
         * @attribute render
         * @default false
         * @type Boolean | Node
         * @writeOnce
         */
        render: {
            value: false,
            writeOnce: true
        }
    }
});

/**
 * Static property used to define the map to store Component instances by id.
 *
 * @property _INSTANCES
 * @type Object
 * @static
 */
Component._INSTANCES = _INSTANCES;

/**
 * Gets component's instance by id.
 *
 * @method getById
 * @param id
 */
Component.getById = function(id) {
    return _INSTANCES[id];
};

var DEFAULT_UI_ATTRS = A.Widget.prototype._UI_ATTRS;

/**
 * Applies a CSS prefix on a component.
 *
 * @method _applyCssPrefix
 * @param component
 * @protected
 */
Component._applyCssPrefix = function(component) {
    if (component && component.NAME && !('CSS_PREFIX' in component)) {
        component.CSS_PREFIX = A.getClassName(String(component.NAME).toLowerCase());
    }

    return component;
};

/**
 * Applies standard extensions from a given config to create a new class using
 * the static `Base.build` method.
 *
 * @method create
 * @param config
 */
Component.create = function(config) {
    config = config || {};

    var extendsClass = config.EXTENDS || A.Component;

    var component = config.constructor;

    if (!A.Object.owns(config, 'constructor')) {
        component = function() {
            component.superclass.constructor.apply(this, arguments);
        };
    }

    var configProto = config.prototype;

    if (configProto) {
        if (config.UI_ATTRS || config.BIND_UI_ATTRS || config.SYNC_UI_ATTRS) {
            var BIND_UI_ATTRS = concat(config.BIND_UI_ATTRS, config.UI_ATTRS);
            var SYNC_UI_ATTRS = concat(config.SYNC_UI_ATTRS, config.UI_ATTRS);

            var extendsProto = extendsClass.prototype;
            var extendsUIAttrs = (extendsProto && extendsProto._UI_ATTRS) || DEFAULT_UI_ATTRS;

            BIND_UI_ATTRS = concat(extendsUIAttrs.BIND, BIND_UI_ATTRS);
            SYNC_UI_ATTRS = concat(extendsUIAttrs.SYNC, SYNC_UI_ATTRS);

            var configProtoUIAttrs = configProto._UI_ATTRS;

            if (!configProtoUIAttrs) {
                configProtoUIAttrs = configProto._UI_ATTRS = {};
            }

            if (BIND_UI_ATTRS.length) {
                configProtoUIAttrs.BIND = BIND_UI_ATTRS;
            }

            if (SYNC_UI_ATTRS.length) {
                configProtoUIAttrs.SYNC = SYNC_UI_ATTRS;
            }
        }
    }

    var augmentsClasses = config.AUGMENTS;

    if (augmentsClasses && !Lang.isArray(augmentsClasses)) {
        augmentsClasses = [augmentsClasses];
    }

    A.mix(component, config);

    delete component.prototype;

    A.extend(component, extendsClass, configProto);

    if (augmentsClasses) {
        component = A.Base.build(config.NAME, component, augmentsClasses, {
            dynamic: false
        });
    }

    Component._applyCssPrefix(component);

    return component;
};

/**
 * Static property provides a string to identify the CSS prefix.
 *
 * @property CSS_PREFIX
 * @type String
 * @static
 */
Component.CSS_PREFIX = getClassName('component');

var Base = A.Base;

/**
 * Applies extensions to a class using the static `Base.build` method.
 *
 * @method build
 */
Component.build = function() {
    var component = Base.build.apply(Base, arguments);

    Component._applyCssPrefix(component);

    return component;
};

A.Component = Component;


}, '3.1.0-deprecated.95', {
    "requires": [
        "aui-classnamemanager",
        "aui-widget-cssclass",
        "aui-widget-toggle",
        "base-build",
        "widget-base"
    ]
});

YUI.add('aui-debounce', function (A, NAME) {

var Lang = A.Lang,
    aArray = A.Array,
    isString = Lang.isString,
    isUndefined = Lang.isUndefined,

    DEFAULT_ARGS = [];

var toArray = function(arr, fallback, index, arrayLike) {
    return !isUndefined(arr) ? aArray(arr, index || 0, (arrayLike !== false)) : fallback;
};

A.debounce = function(fn, delay, context, args) {
    var id;
    var tempArgs;
    var wrapped;

    if (isString(fn) && context) {
        fn = A.bind(fn, context);
    }

    delay = delay || 0;

    args = toArray(arguments, DEFAULT_ARGS, 3);

    var clearFn = function() {
        clearInterval(id);

        id = null;
    };

    var base = function() {
        clearFn();

        var result = fn.apply(context, tempArgs || args || DEFAULT_ARGS);

        tempArgs = null;

        return result;
    };

    var delayFn = function(delayTime, newArgs, newContext, newFn) {
        wrapped.cancel();

        delayTime = !isUndefined(delayTime) ? delayTime : delay;

        fn = newFn || fn;
        context = newContext || context;

        if (newArgs !== args) {
            tempArgs = toArray(newArgs, DEFAULT_ARGS, 0, false).concat(args);
        }

        if (delayTime > 0) {
            id = setInterval(base, delayTime);
        }
        else {
            return base();
        }
    };

    var cancelFn = function() {
        if (id) {
            clearFn();
        }
    };

    var setDelay = function(delay) {
        cancelFn();

        delay = delay || 0;
    };

    wrapped = function() {
        var currentArgs = arguments.length ? arguments : args;

        return wrapped.delay(delay, currentArgs, context || this);
    };

    wrapped.cancel = cancelFn;
    wrapped.delay = delayFn;
    wrapped.setDelay = setDelay;

    return wrapped;
};


}, '3.1.0-deprecated.95');

YUI.add('aui-delayed-task-deprecated', function (A, NAME) {

/**
 * The DelayedTask Utility - Executes the supplied function in the context of
 * the supplied object 'when' milliseconds later
 *
 * @module aui-delayed-task
 */

/**
 * A base class for DelayedTask, providing:
 * <ul>
 *    <li>Executes the supplied function in the context of the supplied object 'when' milliseconds later</li>
 * </ul>
 *
 * Quick Example:<br/>
 *
 * <pre><code>var delayed = new A.DelayedTask({
 *	 function() {
 *     // This callback will be executed when the <code>DelayedTask</code> be invoked
 *	 },
 *	 scope
 *  });
 *
 * 	// executes after 1000ms the callback
 *  delayed.delay(1000);
 * </code></pre>
 *
 * Check the list of <a href="DelayedTask.html#configattributes">Configuration Attributes</a> available for
 * DelayedTask.
 *
 * @param config {Object} Object literal specifying widget configuration properties.
 *
 * @class DelayedTask
 * @param {function} fn Callback
 * @param {Object} scope Context object. Optional.
 * @param args 0..n additional arguments that should be provided to the listener.
 * @constructor
 */
var DelayedTask = function(fn, scope, args) {
    var instance = this;

    /**
     * Stores the passed <code>args</code> attribute.
     *
     * @property _args
     * @type Object
     * @protected
     */
    instance._args = args;

    /**
     * Stores the passed <code>delay</code> attribute.
     *
     * @property _delay
     * @default 0
     * @type Number
     * @protected
     */
    instance._delay = 0;

    /**
     * Stores the passed <code>fn</code> attribute.
     *
     * @property _fn
     * @type function
     * @protected
     */
    instance._fn = fn;

    /**
     * Stores the timer <code>id</code> given from the <code>setInterval</code>.
     *
     * @property _id
     * @default null
     * @type Number
     * @protected
     */
    instance._id = null;

    /**
     * Stores the passed <code>scope</code> attribute.
     *
     * @property _scope
     * @default instance
     * @type Object
     * @protected
     */
    instance._scope = scope || instance;

    /**
     * Stores the current timestamp given from
     * <a href="DelayedTask.html#method__getTime">_getTime</a>.
     *
     * @property _time
     * @default 0
     * @type Number
     * @protected
     */
    instance._time = 0;

    instance._base = function() {
        var now = instance._getTime();

        if (now - instance._time >= instance._delay) {
            clearInterval(instance._id);

            instance._id = null;

            instance._fn.apply(instance._scope, instance._args || []);
        }
    };
};

DelayedTask.prototype = {
    /**
     * <p>This function is responsible to execute the user callback, passed in
     * the <code>constructor</code> after <code>delay</code> milliseconds.</p>
     *
     * Example:
     *
     * <pre><code>// executes after 1000ms the callback
     * delayed.delay(1000);</code></pre>
     *
     * @method delay
     * @param {Number} delay Delay in milliseconds.
     * @param {function} newFn Callback.
     * @param {Object} newScope Context object. Optional.
     * @param newArgs 0..n additional arguments that should be provided to the listener.
     */
    delay: function(delay, newFn, newScope, newArgs) {
        var instance = this;

        if (instance._id && instance._delay != delay) {
            instance.cancel();
        }

        instance._delay = delay || instance._delay;
        instance._time = instance._getTime();

        instance._fn = newFn || instance._fn;
        instance._scope = newScope || instance._scope;
        instance._args = newArgs || instance._args;

        if (!A.Lang.isArray(instance._args)) {
            instance._args = [instance._args];
        }

        if (!instance._id) {
            if (instance._delay > 0) {
                instance._id = setInterval(instance._base, instance._delay);
            }
            else {
                instance._base();
            }
        }
    },

    /**
     * Cancel the delayed task in case it's running (i.e., clearInterval from
     * the current running <a href="DelayedTask.html#property__id">_id</a>).
     *
     * @method cancel
     */
    cancel: function() {
        var instance = this;

        if (instance._id) {
            clearInterval(instance._id);

            instance._id = null;
        }
    },

    /**
     * Get the current timestamp (i.e., now).
     *
     * @method _getTime
     * @protected
     * @return {Number} Current timestamp
     */
    _getTime: function() {
        var instance = this;

        return (+new Date());
    }
};

A.DelayedTask = DelayedTask;


}, '3.1.0-deprecated.95', {"requires": ["yui-base"]});

YUI.add('aui-event-base', function (A, NAME) {

/**
 * The Event Base.
 *
 * @module aui-event
 * @submodule aui-event-base
 */

var aArray = A.Array,
    DOMEventFacade = A.DOMEventFacade,
    DOMEventFacadeProto = DOMEventFacade.prototype;

var KeyMap = {
    BACKSPACE: 8,
    TAB: 9,
    NUM_CENTER: 12,

    ENTER: 13,
    RETURN: 13,

    SHIFT: 16,
    CTRL: 17,
    ALT: 18,

    PAUSE: 19,
    CAPS_LOCK: 20,
    ESC: 27,
    SPACE: 32,

    PAGE_UP: 33,
    PAGE_DOWN: 34,

    END: 35,
    HOME: 36,

    LEFT: 37,
    UP: 38,
    RIGHT: 39,
    DOWN: 40,

    PRINT_SCREEN: 44,
    INSERT: 45,
    DELETE: 46,

    ZERO: 48,
    ONE: 49,
    TWO: 50,
    THREE: 51,
    FOUR: 52,
    FIVE: 53,
    SIX: 54,
    SEVEN: 55,
    EIGHT: 56,
    NINE: 57,

    A: 65,
    B: 66,
    C: 67,
    D: 68,
    E: 69,
    F: 70,
    G: 71,
    H: 72,
    I: 73,
    J: 74,
    K: 75,
    L: 76,
    M: 77,
    N: 78,
    O: 79,
    P: 80,
    Q: 81,
    R: 82,
    S: 83,
    T: 84,
    U: 85,
    V: 86,
    W: 87,
    X: 88,
    Y: 89,
    Z: 90,

    CONTEXT_MENU: 93,

    NUM_ZERO: 96,
    NUM_ONE: 97,
    NUM_TWO: 98,
    NUM_THREE: 99,
    NUM_FOUR: 100,
    NUM_FIVE: 101,
    NUM_SIX: 102,
    NUM_SEVEN: 103,
    NUM_EIGHT: 104,
    NUM_NINE: 105,

    NUM_MULTIPLY: 106,
    NUM_PLUS: 107,
    NUM_MINUS: 109,
    NUM_PERIOD: 110,
    NUM_DIVISION: 111,

    F1: 112,
    F2: 113,
    F3: 114,
    F4: 115,
    F5: 116,
    F6: 117,
    F7: 118,
    F8: 119,
    F9: 120,
    F10: 121,
    F11: 122,
    F12: 123,

    NUM_LOCK: 144,

    WIN_KEY: 224,
    WIN_IME: 229,

    NON_MODIFYING_KEYS: [
        'ALT',
        'CAPS_LOCK',
        'CTRL',
        'DOWN',
        'END',
        'ESC',
        'F1',
        'F10',
        'F11',
        'F12',
        'F2',
        'F3',
        'F4',
        'F5',
        'F6',
        'F7',
        'F8',
        'F9',
        'HOME',
        'LEFT',
        'NUM_LOCK',
        'PAGE_DOWN',
        'PAGE_UP',
        'PAUSE',
        'PRINT_SCREEN',
        'RIGHT',
        'SHIFT',
        'SPACE',
        'UP',
        'WIN_KEY'
    ],

    hasModifier: function(event) {
        return event &&
            (event.ctrlKey ||
            event.altKey ||
            event.shiftKey ||
            event.metaKey);
    },

    isKey: function(keyCode, name) {
        var instance = this;

        return name && ((instance[name] || instance[name.toUpperCase()]) === keyCode);
    },

    isKeyInRange: function(keyCode, start, end) {
        var instance = this;

        var result = false;

        if (start && end) {
            var startKey = instance[start] || instance[start.toUpperCase()];
            var endKey = instance[end] || instance[end.toUpperCase()];

            result = startKey && endKey &&
                (keyCode >= startKey && keyCode <= endKey);
        }

        return result;
    },

    isKeyInSet: function(keyCode) {
        var instance = this;

        var args = aArray(arguments, 1, true);

        return instance._isKeyInSet(keyCode, args);
    },

    isNavKey: function(keyCode) {
        var instance = this;

        return instance.isKeyInRange(keyCode, 'PAGE_UP', 'DOWN') || instance.isKeyInSet(keyCode, 'ENTER', 'TAB', 'ESC');
    },

    isSpecialKey: function(keyCode, eventType) {
        var instance = this;

        var isCtrlPress = (eventType === 'keypress' && instance.ctrlKey);

        return isCtrlPress ||
            instance.isNavKey(keyCode) ||
            instance.isKeyInRange(keyCode, 'SHIFT', 'CAPS_LOCK') ||
            instance.isKeyInSet(keyCode, 'BACKSPACE', 'PRINT_SCREEN', 'INSERT', 'WIN_IME');
    },

    isModifyingKey: function(keyCode) {
        var instance = this;

        return !instance._isKeyInSet(keyCode, instance.NON_MODIFYING_KEYS);
    },

    _isKeyInSet: function(keyCode, arr) {
        var instance = this;

        var i = arr.length;

        var result = false;

        var keyName;
        var key;

        while (i--) {
            keyName = arr[i];
            key = keyName && (instance[keyName] || instance[String(keyName).toUpperCase()]);

            if (keyCode === key) {
                result = true;

                break;
            }
        }

        return result;
    }
};

A.mix(
    DOMEventFacadeProto, {
        /**
         * Checks if an event is triggered by a keyboard key like `CTRL`, `ALT`
         * or `SHIFT`.
         *
         * @method hasModifier
         * @return {Boolean}
         */
        hasModifier: function() {
            var instance = this;

            return KeyMap.hasModifier(instance);
        },

        /**
         * Checks if an event is triggered by a keyboard key.
         *
         * @method isKey
         * @param name
         * @return {Boolean}
         */
        isKey: function(name) {
            var instance = this;

            return KeyMap.isKey(instance.keyCode, name);
        },

        /**
         * Checks if an event is triggered by a keyboard key located between two
         * other keys.
         *
         * @method isKeyInRange
         * @param start
         * @param end
         * @return {Boolean}
         */
        isKeyInRange: function(start, end) {
            var instance = this;

            return KeyMap.isKeyInRange(instance.keyCode, start, end);
        },

        /**
         * Checks if an event is triggered by a keyboard key contained in the
         * key set.
         *
         * @method isKeyInSet
         * @return {Boolean}
         */
        isKeyInSet: function() {
            var instance = this;

            var args = aArray(arguments, 0, true);

            return KeyMap._isKeyInSet(instance.keyCode, args);
        },

        /**
         * Checks if an event is triggered by `ENTER`, `TAB`, `ESC` keyboard
         * keys or by a key located between `PAGE UP` and `DOWN`.
         *
         * @method isModifyingKey
         */
        isModifyingKey: function() {
            var instance = this;

            return KeyMap.isModifyingKey(instance.keyCode);
        },

        /**
         * Checks if an event is triggered by navigation keys like `PAGE UP`
         * and `DOWN` keys.
         *
         * @method isNavKey
         * @return {Boolean}
         */
        isNavKey: function() {
            var instance = this;

            return KeyMap.isNavKey(instance.keyCode);
        },

        /**
         * Checks if an event is triggered by a special keyboard key like
         * `SHIFT`, `CAPS LOCK`, etc.
         *
         * @method isSpecialKey
         * @return {Boolean}
         */
        isSpecialKey: function() {
            var instance = this;

            return KeyMap.isSpecialKey(instance.keyCode, instance.type);
        }
    }
);

A.Event.KeyMap = KeyMap;

A.Event.supportsDOMEvent = A.supportsDOMEvent;


}, '3.1.0-deprecated.95', {"requires": ["event-base"]});

YUI.add('aui-event-input', function (A, NAME) {

/**
 * An object that encapsulates text changed events for textareas and input
 * element of type text and password. This event only occurs when the element
 * is focused.
 *
 * @module aui-event
 * @submodule aui-event-input
 */

var DOM_EVENTS = A.Node.DOM_EVENTS;

// Input event feature check should be done on textareas. WebKit before
// version 531 (3.0.182.2) did not support input events for textareas.
// See http://dev.chromium.org/developers/webkit-version-table
if (A.Features.test('event', 'input')) {
    // http://yuilibrary.com/projects/yui3/ticket/2533063
    DOM_EVENTS.input = 1;
    return;
}

DOM_EVENTS.cut = 1;
DOM_EVENTS.dragend = 1;
DOM_EVENTS.paste = 1;

var KeyMap = A.Event.KeyMap,

    _HANDLER_DATA_KEY = '~~aui|input|event~~',
    _INPUT_EVENT_TYPE = ['keydown', 'paste', 'drop', 'cut'],
    _SKIP_FOCUS_CHECK_MAP = {
        cut: 1,
        drop: 1,
        paste: 1
    };

/**
 * Defines a new `input` event in the DOM event system.
 *
 * @event input
 */
A.Event.define('input', {

    /**
     * Implementation logic for event subscription.
     *
     * @method on
     * @param node
     * @param subscription
     * @param notifier
     */
    on: function(node, subscription, notifier) {
        var instance = this;

        subscription._handler = node.on(
            _INPUT_EVENT_TYPE, A.bind(instance._dispatchEvent, instance, subscription, notifier));
    },

    /**
     * Implementation logic for subscription via `node.delegate`.
     *
     * @method delegate
     * @param node
     * @param subscription
     * @param notifier
     * @param filter
     */
    delegate: function(node, subscription, notifier, filter) {
        var instance = this;

        subscription._handles = [];
        subscription._handler = node.delegate('focus', function(event) {
            var element = event.target,
                handler = element.getData(_HANDLER_DATA_KEY);

            if (!handler) {
                handler = element.on(
                    _INPUT_EVENT_TYPE,
                    A.bind(instance._dispatchEvent, instance, subscription, notifier));

                subscription._handles.push(handler);
                element.setData(_HANDLER_DATA_KEY, handler);
            }
        }, filter);
    },

    /**
     * Implementation logic for cleaning up a detached subscription.
     *
     * @method detach
     * @param node
     * @param subscription
     * @param notifier
     */
    detach: function(node, subscription) {
        subscription._handler.detach();
    },

    /**
     * Implementation logic for cleaning up a detached delegate subscription.
     *
     * @method detachDelegate
     * @param node
     * @param subscription
     * @param notifier
     */
    detachDelegate: function(node, subscription) {
        A.Array.each(subscription._handles, function(handle) {
            var element = A.one(handle.evt.el);
            if (element) {
                element.setData(_HANDLER_DATA_KEY, null);
            }
            handle.detach();
        });
        subscription._handler.detach();
    },

    /**
     * Dispatches an `input` event.
     *
     * @method _dispatchEvent
     * @param subscription
     * @param notifier
     * @param event
     * @protected
     */
    _dispatchEvent: function(subscription, notifier, event) {
        var instance = this,
            input,
            valueBeforeKey;

        input = event.target;

        // Since cut, drop and paste events fires before the element is focused,
        // skip focus checking.
        if (_SKIP_FOCUS_CHECK_MAP[event.type] ||
            (input.get('ownerDocument').get('activeElement') === input)) {

            if (KeyMap.isModifyingKey(event.keyCode)) {
                if (subscription._timer) {
                    subscription._timer.cancel();
                    subscription._timer = null;
                }

                valueBeforeKey = KeyMap.isKey(event.keyCode, 'WIN_IME') ? null : input.get('value');

                subscription._timer = A.soon(
                    A.bind('_fireEvent', instance, subscription, notifier, event, valueBeforeKey)
                );
            }
        }
    },

    /**
     * Fires an event.
     *
     * @method _fireEvent
     * @param subscription
     * @param notifier
     * @param event
     * @param valueBeforeKey
     * @protected
     */
    _fireEvent: function(subscription, notifier, event, valueBeforeKey) {
        var input = event.target;

        subscription._timer = null;

        if (input.get('value') !== valueBeforeKey) {
            notifier.fire(event);
        }
    }
});


}, '3.1.0-deprecated.95', {"requires": ["aui-event-base", "event-delegate", "event-synthetic", "timers"]});

YUI.add('aui-form-validator', function (A, NAME) {

/**
 * The Form Validator Component
 *
 * @module aui-form-validator
 */

// API inspired on the amazing jQuery Form Validation -
// http://jquery.bassistance.de/validate/

var Lang = A.Lang,
    AObject = A.Object,
    isBoolean = Lang.isBoolean,
    isDate = Lang.isDate,
    isEmpty = AObject.isEmpty,
    isFunction = Lang.isFunction,
    isNode = Lang.isNode,
    isObject = Lang.isObject,
    isString = Lang.isString,
    trim = Lang.trim,

    defaults = A.namespace('config.FormValidator'),

    getRegExp = A.DOM._getRegExp,

    getCN = A.getClassName,

    CSS_FORM_GROUP = getCN('form', 'group'),
    CSS_HAS_ERROR = getCN('has', 'error'),
    CSS_ERROR_FIELD = getCN('error', 'field'),
    CSS_HAS_SUCCESS = getCN('has', 'success'),
    CSS_SUCCESS_FIELD = getCN('success', 'field'),
    CSS_HELP_BLOCK = getCN('help', 'block'),
    CSS_STACK = getCN('form-validator', 'stack'),

    TPL_MESSAGE = '<div role="alert"></div>',
    TPL_STACK_ERROR = '<div class="' + [CSS_STACK, CSS_HELP_BLOCK].join(' ') + '"></div>';

if (!Element.prototype.matches) {
    Element.prototype.matches = Element.prototype.msMatchesSelector;
}

A.mix(defaults, {
    STRINGS: {
        DEFAULT: 'Please fix {field}.',
        acceptFiles: 'Please enter a value with a valid extension ({0}) in {field}.',
        alpha: 'Please enter only alpha characters in {field}.',
        alphanum: 'Please enter only alphanumeric characters in {field}.',
        date: 'Please enter a valid date in {field}.',
        digits: 'Please enter only digits in {field}.',
        email: 'Please enter a valid email address in {field}.',
        equalTo: 'Please enter the same value again in {field}.',
        iri: 'Please enter a valid IRI in {field}.',
        max: 'Please enter a value less than or equal to {0} in {field}.',
        maxLength: 'Please enter no more than {0} characters in {field}.',
        min: 'Please enter a value greater than or equal to {0} in {field}.',
        minLength: 'Please enter at least {0} characters in {field}.',
        number: 'Please enter a valid number in {field}.',
        range: 'Please enter a value between {0} and {1} in {field}.',
        rangeLength: 'Please enter a value between {0} and {1} characters long in {field}.',
        required: '{field} is required.',
        url: 'Please enter a valid URL in {field}.'
    },

    REGEX: {
        alpha: /^[a-z_]+$/i,

        alphanum: /^\w+$/,

        digits: /^\d+$/,

        // Regex from Scott Gonzalez Email Address Validation:
        // http://projects.scottsplayground.com/email_address_validation/
        email: new RegExp('^((([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|' +
            '[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#' +
            '\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF' +
            '\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20' +
            '|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\' +
            'x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])' +
            '|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-' +
            '\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\' +
            'x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\' +
            'uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\' +
            'uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\' +
            'uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\' +
            'uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\' +
            'uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\' +
            'uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\' +
            'u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\' +
            'u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$', 'i'),

        // Regex from Scott Gonzalez IRI:
        // http://projects.scottsplayground.com/iri/demo/
        iri: new RegExp('^([a-z]([a-z]|\\d|\\+|-|\\.)*):(\\/\\/(((([a-z]|\\d|' +
            '-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[' +
            '\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:)*@)?((\\[(|(v[\\da-f]{1' +
            ',}\\.(([a-z]|\\d|-|\\.|_|~)|[!\\$&\'\\(\\)\\*\\+,;=]|:)+))\\])' +
            '|((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1' +
            '\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d' +
            '|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|' +
            '(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-' +
            '\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=])*)(:\\d*)?)' +
            '(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\' +
            'uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)*)' +
            '*|(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\' +
            'uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)+' +
            '(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\' +
            'uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|' +
            '@)*)*)?)|((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\' +
            'uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\' +
            '+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\' +
            'uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\' +
            '(\\)\\*\\+,;=]|:|@)*)*)|((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\' +
            'uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\' +
            '$&\'\\(\\)\\*\\+,;=]|:|@)){0})(\\?((([a-z]|\\d|-|\\.|_|~|' +
            '[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]' +
            '{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|' +
            '\\?)*)?(\\#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\' +
            'uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\' +
            '+,;=]|:|@)|\\/|\\?)*)?$', 'i'),

        number: /^[+\-]?(\d+([.,]\d+)?)+([eE][+-]?\d+)?$/,

        // Regex from Scott Gonzalez Common URL:
        // http://projects.scottsplayground.com/iri/demo/common.html
        url: new RegExp('^(https?|ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\' +
            'u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})' +
            '|[!\\$&\'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|' +
            '2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25' +
            '[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.' +
            '(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d' +
            '|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\' +
            'd|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|' +
            '-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*' +
            '([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\' +
            '.)*(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|' +
            '(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]' +
            '|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])' +
            '*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)' +
            '(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\' +
            'uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]' +
            '|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF' +
            '\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)*)' +
            '*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\' +
            'uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|' +
            ':|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(\\#((([a-z]|\\d|-|\\.|_|~|' +
            '[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})' +
            '|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$', 'i')
    },

    RULES: {
        acceptFiles: function(val, node, ruleValue) {
            var regex = null;

            if (isString(ruleValue)) {
                var extensions = ruleValue.replace(/\./g, '').split(/,\s*|\b\s*/);

                extensions = A.Array.map(extensions, A.Escape.regex);

                regex = getRegExp('[.](' + extensions.join('|') + ')$', 'i');
            }

            return regex && regex.test(val);
        },

        date: function(val) {
            var date = new Date(val);

            return (isDate(date) && (date !== 'Invalid Date') && !isNaN(date));
        },

        equalTo: function(val, node, ruleValue) {
            var comparator = A.one(ruleValue);

            return comparator && (trim(comparator.val()) === val);
        },

        hasValue: function(val, node) {
            var instance = this;

            if (A.FormValidator.isCheckable(node)) {
                var name = node.get('name'),
                    elements = A.all(instance.getFieldsByName(name));

                return (elements.filter(':checked').size() > 0);
            }
            else {
                return !!val;
            }
        },

        max: function(val, node, ruleValue) {
            return (Lang.toFloat(val) <= ruleValue);
        },

        maxLength: function(val, node, ruleValue) {
            return (val.length <= ruleValue);
        },

        min: function(val, node, ruleValue) {
            return (Lang.toFloat(val) >= ruleValue);
        },

        minLength: function(val, node, ruleValue) {
            return (val.length >= ruleValue);
        },

        range: function(val, node, ruleValue) {
            var num = Lang.toFloat(val);

            return (num >= ruleValue[0]) && (num <= ruleValue[1]);
        },

        rangeLength: function(val, node, ruleValue) {
            var length = val.length;

            return (length >= ruleValue[0]) && (length <= ruleValue[1]);
        },

        required: function(val, node, ruleValue) {
            var instance = this;

            if (ruleValue === true) {
                return defaults.RULES.hasValue.apply(instance, [val, node]);
            }
            else {
                return true;
            }
        }
    }
});

/**
 * A base class for `A.FormValidator`.
 *
 * @class A.FormValidator
 * @extends Base
 * @param {Object} config Object literal specifying widget configuration
 *     properties.
 * @constructor
 * @include http://alloyui.com/examples/form-validator/basic-markup.html
 * @include http://alloyui.com/examples/form-validator/basic.js
 */
var FormValidator = A.Component.create({

    /**
     * Static property provides a string to identify the class.
     *
     * @property NAME
     * @type String
     * @static
     */
    NAME: 'form-validator',

    /**
     * Static property used to define the default attribute
     * configuration for the `A.FormValidator`.
     *
     * @property ATTRS
     * @type Object
     * @static
     */
    ATTRS: {

        /**
         * The widget's outermost node, used for sizing and positioning.
         *
         * @attribute boundingBox
         */
        boundingBox: {
            setter: A.one
        },

        /**
         * Container for the CSS error class.
         *
         * @attribute containerErrorClass
         * @type String
         */
        containerErrorClass: {
            value: CSS_HAS_ERROR,
            validator: isString
        },

        /**
         * Container for the CSS valid class.
         *
         * @attribute containerValidClass
         * @type String
         */
        containerValidClass: {
            value: CSS_HAS_SUCCESS,
            validator: isString
        },

        /**
         * Defines the CSS error class.
         *
         * @attribute errorClass
         * @type String
         */
        errorClass: {
            value: CSS_ERROR_FIELD,
            validator: isString
        },

        /**
         * If `true` the validation rules are extracted from the DOM.
         *
         * @attribute extractRules
         * @default true
         * @type Boolean
         */
        extractRules: {
            value: true,
            validator: isBoolean
        },

        /**
         * Container for a field.
         *
         * @attribute fieldContainer
         * @type String
         */
        fieldContainer: {
            value: '.' + CSS_FORM_GROUP
        },

        /**
         * Collection of strings used on a field.
         *
         * @attribute fieldStrings
         * @default {}
         * @type Object
         */
        fieldStrings: {
            value: {},
            validator: isObject
        },

        /**
         * The CSS class for `<label>`.
         *
         * @attribute labelCssClass
         * @default 'control-label'
         * @type String
         */
        labelCssClass: {
            validator: isString,
            value: 'control-label'
        },

        /**
         * Container for the form message.
         *
         * @attribute messageContainer
         * @default '<div role="alert"></div>'
         */
        messageContainer: {
            getter: function(val) {
                return A.Node.create(val).clone();
            },
            value: TPL_MESSAGE
        },

        /**
         * Collection of rules to validate fields.
         *
         * @attribute rules
         * @default {}
         * @type Object
         */
        rules: {
            getter: function(val) {
                var instance = this;
                if (!instance._rulesAlreadyExtracted) {
                    instance._extractRulesFromMarkup(val);
                }
                return val;
            },
            validator: isObject,
            value: {}
        },

        /**
         * Defines if the text will be selected or not after validation.
         *
         * @attribute selectText
         * @default true
         * @type Boolean
         */
        selectText: {
            value: true,
            validator: isBoolean
        },

        /**
         * Defines if the validation messages will be showed or not.
         *
         * @attribute showMessages
         * @default true
         * @type Boolean
         */
        showMessages: {
            value: true,
            validator: isBoolean
        },

        /**
         * Defines if all validation messages will be showed or not.
         *
         * @attribute showAllMessages
         * @default false
         * @type Boolean
         */
        showAllMessages: {
            value: false,
            validator: isBoolean
        },

        /**
         * List of CSS selectors for targets that will not get validated
         *
         * @attribute skipValidationTargetSelectors
         * @default 'a[class=btn-cancel'
         */
        skipValidationTargetSelector: {
            value: 'a[class~=btn-cancel]'
        },

        /**
         * Defines a container for the stack errors.
         *
         * @attribute stackErrorContainer
         */
        stackErrorContainer: {
            getter: function(val) {
                return A.Node.create(val).clone();
            },
            value: TPL_STACK_ERROR
        },

        /**
         * Collection of strings used to label elements of the UI.
         *
         * @attribute strings
         * @type Object
         */
        strings: {
            valueFn: function() {
                return defaults.STRINGS;
            }
        },

        /**
         * If `true` the field will be validated on blur event.
         *
         * @attribute validateOnBlur
         * @default true
         * @type Boolean
         */
        validateOnBlur: {
            value: true,
            validator: isBoolean
        },

        /**
         * If `true` the field will be validated on input event.
         *
         * @attribute validateOnInput
         * @default false
         * @type Boolean
         */
        validateOnInput: {
            value: false,
            validator: isBoolean
        },

        /**
         * Defines the CSS valid class.
         *
         * @attribute validClass
         * @type String
         */
        validClass: {
            value: CSS_SUCCESS_FIELD,
            validator: isString
        }
    },

    /**
     * Creates custom rules from user input.
     *
     * @method _setCustomRules
     * @param object
     * @protected
     */
    _setCustomRules: function(object) {
        A.each(
            object,
            function(rule, fieldName) {
                A.config.FormValidator.RULES[fieldName] = rule.condition;
                A.config.FormValidator.STRINGS[fieldName] = rule.errorMessage;
            }
        );
    },

    /**
     * Ability to add custom validation rules.
     *
     * @method customRules
     * @param object
     * @public
     * @static
     */
    addCustomRules: function(object) {
        var instance = this;

        if (isObject(object)) {
            instance._setCustomRules(object);
        }
    },

    /**
     * Checks if a node is a checkbox or radio input.
     *
     * @method isCheckable
     * @param node
     * @private
     * @return {Boolean}
     */
    isCheckable: function(node) {
        var nodeType = node.get('type').toLowerCase();

        return (nodeType === 'checkbox' || nodeType === 'radio');
    },

    /**
     * Static property used to define which component it extends.
     *
     * @property EXTENDS
     * @type Object
     * @static
     */
    EXTENDS: A.Base,

    prototype: {

        /**
         * Construction logic executed during `A.FormValidator` instantiation.
         * Lifecycle.
         *
         * @method initializer
         * @protected
         */
        initializer: function() {
            var instance = this;

            instance.errors = {};
            instance._blurHandlers = null;
            instance._fileBlurHandlers = null;
            instance._fileInputHandlers = null;
            instance._inputHandlers = null;
            instance._rulesAlreadyExtracted = false;
            instance._stackErrorContainers = {};

            instance.bindUI();
            instance._uiSetValidateOnBlur(instance.get('validateOnBlur'));
            instance._uiSetValidateOnInput(instance.get('validateOnInput'));
        },

        /**
         * Bind the events on the `A.FormValidator` UI. Lifecycle.
         *
         * @method bindUI
         * @protected
         */
        bindUI: function() {
            var instance = this,
                boundingBox = instance.get('boundingBox');

            var onceFocusHandler = boundingBox.delegate('focus', function() {
                instance._setARIARoles();
                onceFocusHandler.detach();
            }, 'input,select,textarea,button');

            instance.publish({
                errorField: {
                    defaultFn: instance._defErrorFieldFn
                },
                validField: {
                    defaultFn: instance._defValidFieldFn
                },
                validateField: {
                    defaultFn: instance._defValidateFieldFn
                }
            });

            boundingBox.on({
                reset: A.bind(instance._onFormReset, instance),
                submit: A.bind(instance._onFormSubmit, instance)
            });

            instance.after({
                extractRulesChange: instance._afterExtractRulesChange,
                validateOnBlurChange: instance._afterValidateOnBlurChange,
                validateOnInputChange: instance._afterValidateOnInputChange
            });
        },

        /**
         * Adds a validation error in the field.
         *
         * @method addFieldError
         * @param {Node} field
         * @param ruleName
         */
        addFieldError: function(field, ruleName) {
            var instance = this,
                errors = instance.errors,
                name = field.get('name');

            if (!errors[name]) {
                errors[name] = [];
            }

            errors[name].push(ruleName);
        },

        /**
         * Deletes the field from the errors property object.
         *
         * @method clearFieldError
         * @param {Node|String} field
         */
        clearFieldError: function(field) {
            var fieldName = isNode(field) ? field.get('name') : field;

            if (isString(fieldName)) {
                delete this.errors[fieldName];
            }
        },

        /**
         * Executes a function to each rule.
         *
         * @method eachRule
         * @param fn
         */
        eachRule: function(fn) {
            var instance = this;

            A.each(
                instance.get('rules'),
                function(rule, fieldName) {
                    if (isFunction(fn)) {
                        fn.apply(instance, [rule, fieldName]);
                    }
                }
            );
        },

        /**
         * Gets the ancestor of a given field.
         *
         * @method findFieldContainer
         * @param {Node} field
         * @return {Node}
         */
        findFieldContainer: function(field) {
            var instance = this,
                fieldContainer = instance.get('fieldContainer'),
                retVal = field.ancestor();

            if (fieldContainer && field.ancestor(fieldContainer)) {
                retVal = field.ancestor(fieldContainer);
            }

            return retVal;
        },

        /**
         * Focus on the invalid field.
         *
         * @method focusInvalidField
         */
        focusInvalidField: function() {
            var instance = this,
                boundingBox = instance.get('boundingBox'),
                field = boundingBox.one('.' + CSS_ERROR_FIELD);

            if (field) {
                field = instance.findFieldContainer(field);

                if (instance.get('selectText')) {
                    field.selectText();
                }

                field.focus();

                field.scrollIntoView(false);

                window.scrollBy(0, field.getDOM().scrollHeight);
            }
        },

        /**
         * Gets a field from the form.
         *
         * @method getField
         * @param {Node|String} field
         * @return {Node}
         */
        getField: function(field) {
            var instance = this;

            if (isString(field)) {
                field = instance.getFieldsByName(field);

                if (field && field.length && !field.name) {
                    field = field[0];
                }
            }

            return A.one(field);
        },

        /**
         * Gets a list of fields based on its name.
         *
         * @method getFieldsByName
         * @param fieldName
         * @return {NodeList}
         */
        getFieldsByName: function(fieldName) {
            var instance = this,
                domBoundingBox = instance.get('boundingBox').getDOM();

            return domBoundingBox.elements[fieldName];
        },

        /**
         * Gets a list of fields with errors.
         *
         * @method getFieldError
         * @param {Node} field
         * @return {String}
         */
        getFieldError: function(field) {
            var instance = this;

            return instance.errors[field.get('name')];
        },

        /**
         * Gets the stack error container of a field.
         *
         * @method getFieldStackErrorContainer
         * @param {Node|String} field
         * @return {Node}
         */
        getFieldStackErrorContainer: function(field) {
            var instance = this,
                name = isNode(field) ? field.get('name') : field,
                stackContainers = instance._stackErrorContainers;

            if (!stackContainers[name]) {
                stackContainers[name] = instance.get('stackErrorContainer');
            }

            return stackContainers[name];
        },

        /**
         * Gets the error message of a field.
         *
         * @method getFieldErrorMessage
         * @param {Node} field
         * @param rule
         * @return {String}
         */
        getFieldErrorMessage: function(field, rule) {
            var instance = this,
                fieldName = field.get('name'),
                fieldStrings = instance.get('fieldStrings')[fieldName] || {},
                fieldRules = instance.get('rules')[fieldName],
                fieldLabel = instance._findFieldLabel(field),
                strings = instance.get('strings'),
                substituteRulesMap = {};

            if (fieldLabel) {
                substituteRulesMap.field = fieldLabel;
            }

            if (rule in fieldRules) {
                var ruleValue = A.Array(fieldRules[rule]);

                A.each(
                    ruleValue,
                    function(value, index) {
                        substituteRulesMap[index] = [value].join('');
                    }
                );
            }

            var message = (fieldStrings[rule] || strings[rule] || strings.DEFAULT);

            return Lang.sub(message, substituteRulesMap);
        },

        /**
         * Returns `true` if there are errors.
         *
         * @method hasErrors
         * @return {Boolean}
         */
        hasErrors: function() {
            var instance = this;

            return !isEmpty(instance.errors);
        },

        /**
         * Highlights a field with error or success.
         *
         * @method highlight
         * @param {Node} field
         * @param valid
         */
        highlight: function(field, valid) {
            var instance = this,
                fieldContainer,
                fieldName,
                namedFieldNodes;

            if (field) {
                fieldContainer = instance.findFieldContainer(field);

                fieldName = field.get('name');

                if (this.validatable(field)) {
                    namedFieldNodes = A.all(instance.getFieldsByName(fieldName));

                    namedFieldNodes.each(
                        function(node) {
                            instance._highlightHelper(
                                node,
                                instance.get('errorClass'),
                                instance.get('validClass'),
                                valid
                            );
                        }
                    );

                    if (fieldContainer) {
                        instance._highlightHelper(
                            fieldContainer,
                            instance.get('containerErrorClass'),
                            instance.get('containerValidClass'),
                            valid
                        );
                    }
                }
                else if (!field.val()) {
                    instance.resetField(fieldName);
                }
            }
        },

        /**
         * Normalizes rule value.
         *
         * @method normalizeRuleValue
         * @param ruleValue
         * @param {Node} field
         */
        normalizeRuleValue: function(ruleValue, field) {
            var instance = this;

            return isFunction(ruleValue) ? ruleValue.apply(instance, [field]) : ruleValue;
        },

        /**
         * Removes the highlight of a field.
         *
         * @method unhighlight
         * @param {Node} field
         */
        unhighlight: function(field) {
            var instance = this;

            instance.highlight(field, true);
        },

        /**
         * Prints the stack error messages into a container.
         *
         * @method printStackError
         * @param {Node} field
         * @param {Node} container
         * @param {Array} errors
         */
        printStackError: function(field, container, errors) {
            var instance = this;

            if (!instance.get('showAllMessages')) {
                if (A.Array.indexOf(errors, 'required') !== -1) {
                    errors = ['required'];
                }
                else {
                    errors = errors.slice(0, 1);
                }
            }

            container.empty();

            A.Array.each(
                errors,
                function(error) {
                    var message = instance.getFieldErrorMessage(field, error),
                        messageEl = instance.get('messageContainer').addClass(error);

                    container.append(
                        messageEl.html(message)
                    );
                }
            );
        },

        /**
         * Resets the CSS class and content of all fields.
         *
         * @method resetAllFields
         */
        resetAllFields: function() {
            var instance = this;

            instance.eachRule(
                function(rule, fieldName) {
                    instance.resetField(fieldName);
                }
            );
        },

        /**
         * Resets the CSS class and error status of a field.
         *
         * @method resetField
         * @param {Node|String} field
         */
        resetField: function(field) {
            var instance = this,
                fieldName,
                fieldRules,
                namedFieldNodes,
                stackContainer;

            fieldName = isNode(field) ? field.get('name') : field;

            if (fieldName) {
                fieldRules = instance.get('rules')[fieldName];

                if (fieldRules) {
                    instance.clearFieldError(fieldName);

                    stackContainer = instance.getFieldStackErrorContainer(fieldName);

                    stackContainer.remove();

                    namedFieldNodes = A.all(instance.getFieldsByName(fieldName));

                    namedFieldNodes.each(
                        function(node) {
                            instance.resetFieldCss(node);
                            node.removeAttribute('aria-errormessage');
                            node.removeAttribute('aria-invalid');
                        }
                    );
                }
            }
        },

        /**
         * Removes the CSS classes of a field.
         *
         * @method resetFieldCss
         * @param {Node} field
         */
        resetFieldCss: function(field) {
            var instance = this,
                fieldContainer = instance.findFieldContainer(field);

            var removeClasses = function(elem, classAttrs) {
                if (elem) {
                    A.each(classAttrs, function(attrName) {
                        elem.removeClass(
                            instance.get(attrName)
                        );
                    });
                }
            };

            removeClasses(field, ['validClass', 'errorClass']);
            removeClasses(fieldContainer, ['containerValidClass', 'containerErrorClass']);
        },

        /**
         * Checks if a field can be validated or not.
         *
         * @method validatable
         * @param {Node} field
         * @return {Boolean}
         */
        validatable: function(field) {
            var instance = this,
                validatable = false,
                fieldRules = instance.get('rules')[field.get('name')];

            if (fieldRules) {
                validatable = instance.normalizeRuleValue(fieldRules.required, field) ||
                    defaults.RULES.hasValue.apply(instance, [field.val(), field]);
            }

            return !!validatable;
        },

        /**
         * Validates all fields.
         *
         * @method validate
         */
        validate: function() {
            var instance = this;

            instance.eachRule(
                function(rule, fieldName) {
                    instance.validateField(fieldName);
                }
            );

            instance.focusInvalidField();
        },

        /**
         * Validates a single field.
         *
         * @method validateField
         * @param {Node|String} field
         */
        validateField: function(field) {
            var fieldNode,
                validatable;

            this.resetField(field);
            fieldNode = isString(field) ? this.getField(field) : field;

            if (isNode(fieldNode)) {
                validatable = this.validatable(fieldNode);

                if (validatable) {
                    this.fire('validateField', {
                        validator: {
                            field: fieldNode
                        }
                    });
                }
            }
        },

        /**
         * Fires after `extractRules` attribute change.
         *
         * @method _afterExtractRulesChange
         * @param event
         * @protected
         */
        _afterExtractRulesChange: function(event) {
            var instance = this;

            instance._uiSetExtractRules(event.newVal);
        },

        /**
         * Fires after `validateOnBlur` attribute change.
         *
         * @method _afterValidateOnBlurChange
         * @param event
         * @protected
         */
        _afterValidateOnBlurChange: function(event) {
            var instance = this;

            instance._uiSetValidateOnBlur(event.newVal);
        },

        /**
         * Fires after `validateOnInput` attribute change.
         *
         * @method _afterValidateOnInputChange
         * @param event
         * @protected
         */
        _afterValidateOnInputChange: function(event) {
            var instance = this;

            instance._uiSetValidateOnInput(event.newVal);
        },

        /**
         * Defines an error field.
         *
         * @method _defErrorFieldFn
         * @param event
         * @protected
         */
        _defErrorFieldFn: function(event) {
            var instance = this,
                field,
                label,
                stackContainer,
                target,
                validator;

            label = instance.get('labelCssClass');
            validator = event.validator;
            field = validator.field;

            instance.highlight(field);

            if (instance.get('showMessages')) {
                target = field;

                stackContainer = instance.getFieldStackErrorContainer(field);

                if (A.FormValidator.isCheckable(target)) {
                    target = field.ancestor('.' + CSS_HAS_ERROR).get('lastChild');
                }

                var id = field.get('id') + 'Helper';

                stackContainer.set('id', id);

                target.placeAfter(stackContainer);

                instance.printStackError(
                    field,
                    stackContainer,
                    validator.errors
                );
            }
        },

        /**
         * Defines a valid field.
         *
         * @method _defValidFieldFn
         * @param event
         * @protected
         */
        _defValidFieldFn: function(event) {
            var instance = this;

            var field = event.validator.field;

            instance.unhighlight(field);
        },

        /**
         * Defines the validation of a field.
         *
         * @method _defValidateFieldFn
         * @param event
         * @protected
         */
        _defValidateFieldFn: function(event) {
            var instance = this;

            var field = event.validator.field;
            var fieldRules = instance.get('rules')[field.get('name')];

            A.each(
                fieldRules,
                function(ruleValue, ruleName) {
                    var rule = defaults.RULES[ruleName];
                    var fieldValue = trim(field.val());

                    ruleValue = instance.normalizeRuleValue(ruleValue, field);

                    if (isFunction(rule) && !rule.apply(instance, [fieldValue, field, ruleValue])) {

                        instance.addFieldError(field, ruleName);
                    }
                }
            );

            var fieldErrors = instance.getFieldError(field);

            if (fieldErrors) {
                instance.fire('errorField', {
                    validator: {
                        field: field,
                        errors: fieldErrors
                    }
                });
            }
            else {
                instance.fire('validField', {
                    validator: {
                        field: field
                    }
                });
            }
        },

        /**
         * Finds the label text of a field if existing.
         *
         * @method _findFieldLabel
         * @param {Node} field
         * @return {String}
         */
        _findFieldLabel: function(field) {
            var labelCssClass = '.' + this.get('labelCssClass'),
                label = A.one('label[for=' + field.get('id') + ']') ||
                    field.ancestor().previous(labelCssClass);

            if (!label) {
                label = field.ancestor('.' + CSS_HAS_ERROR);

                if (label) {
                    label = label.one(labelCssClass);
                }
            }

            if (label) {
                return label.get('text');
            }
        },

        /**
         * Sets the error/success CSS classes based on the validation of a
         * field.
         *
         * @method _highlightHelper
         * @param {Node} field
         * @param {String} errorClass
         * @param {String} validClass
         * @param {Boolean} valid
         * @protected
         */
        _highlightHelper: function(field, errorClass, validClass, valid) {
            var instance = this;

            if (valid) {
                field.removeClass(errorClass).addClass(validClass);

                if (validClass === CSS_SUCCESS_FIELD) {
                    field.removeAttribute('aria-errormessage');
                    field.removeAttribute('aria-invalid');
                }
            }
            else {
                field.removeClass(validClass).addClass(errorClass);

                if (errorClass === CSS_ERROR_FIELD) {
                    field.set('aria-errormessage', field.get('id') + 'Helper');
                    field.set('aria-invalid', true);
                }
            }
        },

        /**
         * Extracts form rules from the DOM.
         *
         * @method _extractRulesFromMarkup
         * @param rules
         * @protected
         */
        _extractRulesFromMarkup: function(rules) {
            var instance = this,
                domBoundingBox = instance.get('boundingBox').getDOM(),
                elements = domBoundingBox.elements,
                defaultRulesKeys = AObject.keys(defaults.RULES),
                defaultRulesJoin = defaultRulesKeys.join('|'),
                regex = getRegExp('field-(' + defaultRulesJoin + ')', 'g'),
                i,
                length,
                ruleNameMatch = [],
                ruleMatcher = function(m1, m2) {
                    ruleNameMatch.push(m2);
                };

            for (i = 0, length = elements.length; i < length; i++) {
                var el = elements[i],
                    fieldName = el.name;

                el.className.replace(regex, ruleMatcher);

                if (ruleNameMatch.length) {
                    var fieldRules = rules[fieldName],
                        j,
                        ruleNameLength;

                    if (!fieldRules) {
                        fieldRules = {};
                        rules[fieldName] = fieldRules;
                    }
                    for (j = 0, ruleNameLength = ruleNameMatch.length; j < ruleNameLength; j++) {
                        var rule = ruleNameMatch[j];

                        if (!(rule in fieldRules)) {
                            fieldRules[rule] = true;
                        }
                    }
                    ruleNameMatch.length = 0;
                }
            }

            instance._rulesAlreadyExtracted = true;
        },

        /**
         * Triggers when there's an input in the field.
         *
         * @method _onFieldInput
         * @param event
         * @protected
         */
        _onFieldInput: function(event) {
            var instance = this;

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

            if (!event.relatedTarget || !event.relatedTarget.getDOMNode().matches(skipValidationTargetSelector)) {
                setTimeout(
                    function() {
                        instance.validateField(event.target);
                    },
                    300
                );
            }
        },

        /**
         * Triggers when the form is submitted.
         *
         * @method _onFormSubmit
         * @param event
         * @protected
         */
        _onFormSubmit: function(event) {
            var instance = this;

            var data = {
                validator: {
                    formEvent: event
                }
            };

            instance.validate();

            if (instance.hasErrors()) {
                data.validator.errors = instance.errors;

                instance.fire('submitError', data);

                event.halt();
            }
            else {
                instance.fire('submit', data);
            }
        },

        /**
         * Triggers when the form is reseted.
         *
         * @method _onFormReset
         * @param event
         * @protected
         */
        _onFormReset: function() {
            var instance = this;

            instance.resetAllFields();
        },

        /**
         * Sets the aria roles.
         *
         * @method _setARIARoles
         * @protected
         */
        _setARIARoles: function() {
            var instance = this;

            instance.eachRule(
                function(rule, fieldName) {
                    var field = instance.getField(fieldName);

                    var required = instance.normalizeRuleValue(rule.required, field);

                    if (required) {
                        if (field && !field.attr('aria-required')) {
                            field.attr('aria-required', true);
                        }
                    }
                }
            );
        },

        /**
         * Sets the `extractRules` attribute on the UI.
         *
         * @method _uiSetExtractRules
         * @param val
         * @protected
         */
        _uiSetExtractRules: function(val) {
            var instance = this;
            if (val) {
                instance._extractRulesFromMarkup(instance.get('rules'));
            }
        },

        /**
         * Sets the `validateOnInput` attribute on the UI.
         *
         * @method _uiSetValidateOnInput
         * @param val
         * @protected
         */
        _uiSetValidateOnInput: function(val) {
            var instance = this,
                boundingBox = instance.get('boundingBox');

            if (val) {
                if (!instance._inputHandlers) {
                    instance._inputHandlers = boundingBox.delegate('input', instance._onFieldInput,
                        'input:not([type="file"]),select,textarea,button', instance);
                }

                if (!instance._fileInputHandlers) {
                    instance._fileInputHandlers = boundingBox.delegate('change', instance._onFieldInput,
                        'input[type="file"]', instance);
                }
            }
            else {
                if (instance._inputHandlers) {
                    instance._inputHandlers.detach();
                }

                if (instance._fileInputHandlers) {
                    instance._fileInputHandlers.detach();
                }
            }
        },

        /**
         * Sets the `validateOnBlur` attribute on the UI.
         *
         * @method _uiSetValidateOnBlur
         * @param val
         * @protected
         */
        _uiSetValidateOnBlur: function(val) {
            var instance = this,
                boundingBox = instance.get('boundingBox');

            if (val) {
                if (!instance._blurHandlers) {
                    instance._blurHandlers = boundingBox.delegate('blur', instance._onFieldInput,
                        'input:not([type="file"]),select,textarea,button', instance);
                }

                if (!instance._fileBlurHandlers) {
                    instance._fileBlurHandlers = boundingBox.delegate('change', instance._onFieldInput,
                        'input[type="file"]', instance);
                }
            }
            else {
                if (instance._blurHandlers) {
                    instance._blurHandlers.detach();
                }

                if (instance._fileBlurHandlers) {
                    instance._fileBlurHandlers.detach();
                }
            }
        }
    }
});

A.each(
    defaults.REGEX,
    function(regex, key) {
        defaults.RULES[key] = function(val) {
            return defaults.REGEX[key].test(val);
        };
    }
);

A.FormValidator = FormValidator;

}, '3.1.0-deprecated.95', {
    "requires": [
        "escape",
        "selector-css3",
        "node-event-delegate",
        "aui-node",
        "aui-component",
        "aui-event-input"
    ]
});

YUI.add('aui-node-base', function (A, NAME) {

/**
 * A set of utility methods to the Node.
 *
 * @module aui-node
 * @submodule aui-node-base
 */

var Lang = A.Lang,
    isArray = Lang.isArray,
    isFunction = Lang.isFunction,
    isObject = Lang.isObject,
    isString = Lang.isString,
    isUndefined = Lang.isUndefined,
    isValue = Lang.isValue,

    AArray = A.Array,
    ANode = A.Node,
    ANodeList = A.NodeList,

    getClassName = A.getClassName,
    getRegExp = A.DOM._getRegExp,

    CONFIG = A.config,
    DOC = CONFIG.doc,
    WIN = CONFIG.win,

    NODE_PROTO = ANode.prototype,
    NODE_PROTO_HIDE = NODE_PROTO._hide,
    NODE_PROTO_SHOW = NODE_PROTO._show,
    NODELIST_PROTO = ANodeList.prototype,

    ARRAY_EMPTY_STRINGS = ['', ''],

    CSS_HIDE = getClassName('hide'),
    CSS_UNSELECTABLE_VALUE = 'none',
    CSS_SELECTABLE_VALUE = 'text',

    SUPPORT_CLONED_EVENTS = false,

    MAP_BORDER = {
        b: 'borderBottomWidth',
        l: 'borderLeftWidth',
        r: 'borderRightWidth',
        t: 'borderTopWidth'
    },
    MAP_MARGIN = {
        b: 'marginBottom',
        l: 'marginLeft',
        r: 'marginRight',
        t: 'marginTop'
    },
    MAP_PADDING = {
        b: 'paddingBottom',
        l: 'paddingLeft',
        r: 'paddingRight',
        t: 'paddingTop'
    };

/* Parts of this file are used from jQuery (http://jquery.com)
 * Dual-licensed under MIT/GPL
 */
var div = DOC.createElement('div');

div.style.display = 'none';
div.innerHTML = '   <table></table>&nbsp;';

if (div.attachEvent && div.fireEvent) {
    div.attachEvent(
        'onclick',
        function detach() {
            SUPPORT_CLONED_EVENTS = true;

            div.detachEvent('onclick', detach);
        }
    );

    div.cloneNode(true).fireEvent('onclick');
}

var SUPPORT_OPTIONAL_TBODY = !div.getElementsByTagName('tbody').length;

var REGEX_LEADING_WHITE_SPACE = /^\s+/,
    REGEX_IE8_ACTION = /\=([^=\x27\x22>\s]+\/)>/g,
    REGEX_TAGNAME = /<([\w:]+)/;

div = null;

var _setUnselectable = function(element, unselectable, noRecurse) {
    var descendants,
        value = unselectable ? 'on' : '',
        i,
        descendant;

    element.setAttribute('unselectable', value);

    if (!noRecurse) {
        descendants = element.getElementsByTagName('*');

        for (i = 0;
            (descendant = descendants[i]); i++) {
            descendant.setAttribute('unselectable', value);
        }
    }
};

/**
 * Augments the [YUI3 Node](Node.html) with more util methods.
 *
 * Check the [live demo](http://alloyui.com/examples/node/).
 *
 * @class A.Node
 * @uses Node
 * @constructor
 * @include http://alloyui.com/examples/node/basic-markup.html
 * @include http://alloyui.com/examples/node/basic.js
 */
A.mix(NODE_PROTO, {

    /**
     * Returns the current ancestors of the node element filtered by a
     * className. This is an optimized method for finding ancestors by a
     * specific CSS class name.
     *
     * Example:
     *
     * ```
     * A.one('#nodeId').ancestorsByClassName('aui-hide');
     * ```
     *
     * @method ancestorsByClassName
     * @param {String} className A selector to filter the ancestor elements
     *     against.
     * @param {Boolean} testSelf optional Whether or not to include the element
     * in the scan
     * @return {NodeList}
     */
    ancestorsByClassName: function(className, testSelf) {
        var instance = this;

        var ancestors = [];
        var cssRE = new RegExp('\\b' + className + '\\b');
        var currentEl = instance.getDOM();

        if (!testSelf) {
            currentEl = currentEl.parentNode;
        }

        while (currentEl && currentEl.nodeType !== 9) {
            if (currentEl.nodeType === 1 && cssRE.test(currentEl.className)) {
                ancestors.push(currentEl);
            }

            currentEl = currentEl.parentNode;
        }

        return A.all(ancestors);
    },

    /**
     * Gets or sets the value of an attribute for the first element in the set
     * of matched elements. If only the `name` is passed it works as a getter.
     *
     * Example:
     *
     * ```
     * var node = A.one('#nodeId');
     * node.attr('title', 'Setting a new title attribute');
     * // Alert the value of the title attribute: 'Setting a new title attribute'
     * alert( node.attr('title') );
     * ```
     *
     * @method attr
     * @param {String} name The name of the attribute
     * @param {String} value The value of the attribute to be set. Optional.
     * @return {String}
     */
    attr: function(name, value) {
        var instance = this,
            i;

        if (!isUndefined(value)) {
            var el = instance.getDOM();

            if (name in el) {
                instance.set(name, value);
            }
            else {
                instance.setAttribute(name, value);
            }

            return instance;
        }
        else {
            if (isObject(name)) {
                for (i in name) {
                    if (name.hasOwnProperty(i)) {
                        instance.attr(i, name[i]);
                    }
                }

                return instance;
            }

            var currentValue = instance.get(name);

            if (!Lang.isValue(currentValue)) {
                currentValue = instance.getAttribute(name);
            }

            return currentValue;
        }
    },

    /**
     * Normalizes the behavior of cloning a node, which by default should not
     * clone the events that are attached to it.
     *
     * Example:
     *
     * ```
     * var node = A.one('#nodeId');
     * node.clone().appendTo('body');
     * ```
     *
     * @method clone
     * @return {Node}
     */
    clone: (function() {
        var clone;

        if (SUPPORT_CLONED_EVENTS) {
            clone = function() {
                var el = this.getDOM();
                var clone;

                if (el.nodeType !== 3) {
                    var outerHTML = this.outerHTML();

                    outerHTML = outerHTML.replace(REGEX_IE8_ACTION, '="$1">').replace(REGEX_LEADING_WHITE_SPACE,
                        '');

                    clone = ANode.create(outerHTML);
                }
                else {
                    clone = A.one(el.cloneNode());
                }

                return clone;
            };
        }
        else {
            clone = function() {
                return this.cloneNode(true);
            };
        }

        return clone;
    }()),

    /**
     * Centralizes the current Node instance with the passed `val` Array, Node,
     * String, or Region, if not specified, the body will be used.
     *
     * Example:
     *
     * ```
     * var node = A.one('#nodeId');
     * // Center the `node` with the `#container`.
     * node.center('#container');
     * ```
     *
     * @method center
     * @chainable
     * @param {Array|Node|Region|String} val Array, Node, String, or Region to
     *     center with.
     */
    center: function(val) {
        var instance = this,
            nodeRegion = instance.get('region'),
            x,
            y;

        if (isArray(val)) {
            x = val[0];
            y = val[1];
        }
        else {
            var region;

            if (isObject(val) && !A.instanceOf(val, ANode)) {
                region = val;
            }
            else {
                region = (A.one(val) || A.getBody()).get('region');
            }

            x = region.left + (region.width / 2);
            y = region.top + (region.height / 2);
        }

        instance.setXY([x - (nodeRegion.width / 2), y - (nodeRegion.height / 2)]);
    },

    /**
     * Removes not only child (and other descendant) elements, but also any text
     * within the set of matched elements. This is because, according to the DOM
     * specification, any string of text within an element is considered a child
     * node of that element.
     *
     * Example:
     *
     * ```
     * var node = A.one('#nodeId');
     * node.empty();
     * ```
     *
     * @method empty
     * @chainable
     */
    empty: function() {
        var instance = this;

        instance.all('>*').remove().purge();

        var el = ANode.getDOMNode(instance);

        while (el.firstChild) {
            el.removeChild(el.firstChild);
        }

        return instance;
    },

    /**
     * Retrieves the DOM node bound to a Node instance. See
     * [getDOMNode](Node.html#method_getDOMNode).
     *
     * @method getDOM
     * @return {HTMLNode} The DOM node bound to the Node instance.
     */
    getDOM: function() {
        var instance = this;

        return ANode.getDOMNode(instance);
    },

    /**
     * Returns the combined width of the border for the specified sides.
     *
     * @method getBorderWidth
     * @param {String} sides Can be t, r, b, l or any combination of those to
     *     represent the top, right, bottom, or left sides.
     * @return {Number}
     */
    getBorderWidth: function(sides) {
        var instance = this;

        return instance._getBoxStyleAsNumber(sides, MAP_BORDER);
    },

    /**
     * Gets the current center position of the node in page coordinates.
     *
     * @method getCenterXY
     * @for Node
     * @return {Array} The XY position of the node
     */
    getCenterXY: function() {
        var instance = this;
        var region = instance.get('region');

        return [(region.left + region.width / 2), (region.top + region.height / 2)];
    },

    /**
     * Returns the combined size of the margin for the specified sides.
     *
     * @method getMargin
     * @param {String} sides Can be t, r, b, l or any combination of those to
     *     represent the top, right, bottom, or left sides.
     * @return {Number}
     */
    getMargin: function(sides) {
        var instance = this;

        return instance._getBoxStyleAsNumber(sides, MAP_MARGIN);
    },

    /**
     * Returns the combined width of the border for the specified sides.
     *
     * @method getPadding
     * @param {String} sides Can be t, r, b, l or any combination of those to
     *     represent the top, right, bottom, or left sides.
     * @return {Number}
     */
    getPadding: function(sides) {
        var instance = this;

        return instance._getBoxStyleAsNumber(sides, MAP_PADDING);
    },

    /**
     * Sets the id of the Node instance if the object does not have one. The
     * generated id is based on a guid created by the
     * [stamp](YUI.html#method_stamp) method.
     *
     * @method guid
     * @return {String} The current id of the node
     */
    guid: function() {
        var instance = this;
        var currentId = instance.get('id');

        if (!currentId) {
            currentId = A.stamp(instance);

            instance.set('id', currentId);
        }

        return currentId;
    },

    /**
     * Creates a hover interaction.
     *
     * @method hover
     * @param {String} overFn
     * @param {String} outFn
     * @return {Node} The current Node instance
     */
    hover: function(overFn, outFn) {
        var instance = this;

        var hoverOptions;
        var defaultHoverOptions = instance._defaultHoverOptions;

        if (isObject(overFn, true)) {
            hoverOptions = overFn;

            hoverOptions = A.mix(hoverOptions, defaultHoverOptions);

            overFn = hoverOptions.over;
            outFn = hoverOptions.out;
        }
        else {
            hoverOptions = A.mix({
                    over: overFn,
                    out: outFn
                },
                defaultHoverOptions
            );
        }

        instance._hoverOptions = hoverOptions;

        hoverOptions.overTask = A.debounce(instance._hoverOverTaskFn, null, instance);
        hoverOptions.outTask = A.debounce(instance._hoverOutTaskFn, null, instance);

        return new A.EventHandle(
   [
    instance.on(hoverOptions.overEventType, instance._hoverOverHandler, instance),
    instance.on(hoverOptions.outEventType, instance._hoverOutHandler, instance)
   ]
        );
    },

    /**
     * Gets or sets the HTML contents of the node. If the `value` is passed it's
     * set the content of the element, otherwise it works as a getter for the
     * current content.
     *
     * Example:
     *
     * ```
     * var node = A.one('#nodeId');
     * node.html('Setting new HTML');
     * // Alert the value of the current content
     * alert( node.html() );
     * ```
     *
     * @method html
     * @param {String} value A string of html to set as the content of the node
     *     instance.
     */
    html: function() {
        var args = arguments,
            length = args.length;

        if (length) {
            this.set('innerHTML', args[0]);
        }
        else {
            return this.get('innerHTML');
        }

        return this;
    },

    /**
     * Gets the outerHTML of a node, which islike innerHTML, except that it
     * actually contains the HTML of the node itself.
     *
     * @method outerHTML
     * @return {string} The outerHTML of the given element.
     */
    outerHTML: function() {
        var instance = this;
        var domEl = instance.getDOM();

        // IE, Opera and WebKit all have outerHTML.
        if ('outerHTML' in domEl) {
            return domEl.outerHTML;
        }

        var temp = ANode.create('<div></div>').append(
            this.clone()
        );

        try {
            return temp.html();
        }
        catch (e) {}
        finally {
            temp = null;
        }
    },

    /**
     * Inserts a `newNode` after the node instance (i.e., as the next sibling).
     * If the reference node has no parent, then does nothing.
     *
     * Example:
     *
     * ```
     * var titleNode = A.one('#titleNode');
     * var descriptionNode = A.one('#descriptionNode');
     * // the description is usually shown after the title
     * titleNode.placeAfter(descriptionNode);
     * ```
     *
     * @method placeAfter
     * @chainable
     * @param {Node} newNode Node to insert.
     */
    placeAfter: function(newNode) {
        var instance = this;

        return instance._place(newNode, instance.get('nextSibling'));
    },

    /**
     * Inserts a `newNode` before the node instance (i.e., as the previous
     * sibling). If the reference node has no parent, then does nothing.
     *
     * Example:
     *
     * ```
     * var descriptionNode = A.one('#descriptionNode');
     * var titleNode = A.one('#titleNode');
     * // the title is usually shown before the description
     * descriptionNode.placeBefore(titleNode);
     * ```
     *
     * @method placeBefore
     * @chainable
     * @param {Node} newNode Node to insert.
     */
    placeBefore: function(newNode) {
        var instance = this;

        return instance._place(newNode, instance);
    },

    /**
     * Inserts the node instance to the begining of the `selector` node (i.e.,
     * insert before the `firstChild` of the `selector`).
     *
     * Example:
     *
     * ```
     * var node = A.one('#nodeId');
     * node.prependTo('body');
     * ```
     *
     * @method prependTo
     * @chainable
     * @param {Node|String} selector A selector, element, HTML string, Node
     */
    prependTo: function(selector) {
        var instance = this;

        A.one(selector).prepend(instance);

        return instance;
    },

    /**
     * Adds one or more CSS classes to an element and remove the class(es) from
     * the siblings of the element.
     *
     * @method radioClass
     * @chainable
     * @param {String} cssClass
     */
    radioClass: function(cssClass) {
        var instance = this;

        var siblings = instance.siblings();

        if (isString(cssClass)) {
            siblings.removeClass(cssClass);

            instance.addClass(cssClass);
        }
        else if (isArray(cssClass)) {
            var siblingNodes = siblings.getDOM();

            var regex = getRegExp('(?:^|\\s+)(?:' + cssClass.join('|') + ')(?=\\s+|$)', 'g'),
                node,
                i;

            for (i = siblingNodes.length - 1; i >= 0; i--) {
                node = siblingNodes[i];
                node.className = node.className.replace(regex, '');
            }

            instance.addClass(cssClass.join(' '));
        }

        return instance;
    },

    /**
     * Generates an unique identifier and reset the id attribute of the node
     * instance using the new value. Invokes the [guid](Node.html#method_guid).
     *
     * @method resetId
     * @chainable
     * @param {String} prefix Optional prefix for the guid.
     */
    resetId: function(prefix) {
        var instance = this;

        instance.attr('id', A.guid(prefix));

        return instance;
    },

    /**
     * Selects a substring of text inside of the input element.
     *
     * @method selectText
     * @param {Number} start The index to start the selection range from
     * @param {Number} end The index to end the selection range at
     */
    selectText: function(start, end) {
        var instance = this;

        var textField = instance.getDOM();
        var length = instance.val().length;

        end = isValue(end) ? end : length;
        start = isValue(start) ? start : 0;

        // Some form elements could throw a (NS_ERROR_FAILURE)
        // [nsIDOMNSHTMLInputElement.setSelectionRange] error when invoke the
        // setSelectionRange on firefox. Wrapping in a try/catch to prevent the
        // error be thrown
        try {
            if (textField.setSelectionRange) {
                textField.setSelectionRange(start, end);
            }
            else if (textField.createTextRange) {
                var range = textField.createTextRange();

                range.moveStart('character', start);
                range.moveEnd('character', end - length);

                range.select();
            }
            else {
                textField.select();
            }

            if (textField !== DOC.activeElement) {
                textField.focus();
            }
        }
        catch (e) {}

        return instance;
    },

    /**
     * Enables text selection for this element (normalized across browsers).
     *
     * @method selectable
     * @param noRecurse
     * @chainable
     */
    selectable: function(noRecurse) {
        var instance = this;

        instance.setStyles({
            '-webkit-user-select': CSS_SELECTABLE_VALUE,
            '-khtml-user-select': CSS_SELECTABLE_VALUE,
            '-moz-user-select': CSS_SELECTABLE_VALUE,
            '-ms-user-select': CSS_SELECTABLE_VALUE,
            '-o-user-select': CSS_SELECTABLE_VALUE,
            'user-select': CSS_SELECTABLE_VALUE
        });

        if (A.UA.ie || A.UA.opera) {
            _setUnselectable(instance._node, false, noRecurse);
        }

        return instance;
    },

    /**
     * Stops the specified event(s) from bubbling and optionally prevents the
     * default action.
     *
     * Example:
     *
     * ```
     * var anchor = A.one('a#anchorId');
     * anchor.swallowEvent('click');
     * ```
     *
     * @method swallowEvent
     * @chainable
     * @param {String|Array} eventName An event or array of events to stop from
     *     bubbling
     * @param {Boolean} preventDefault (optional) true to prevent the default
     *     action too
     */
    swallowEvent: function(eventName, preventDefault) {
        var instance = this;

        var fn = function(event) {
            event.stopPropagation();

            if (preventDefault) {
                event.preventDefault();

                event.halt();
            }

            return false;
        };

        if (isArray(eventName)) {
            AArray.each(
                eventName,
                function(name) {
                    instance.on(name, fn);
                }
            );

            return this;
        }
        else {
            instance.on(eventName, fn);
        }

        return instance;
    },

    /**
     * Gets or sets the combined text contents of the node instance, including
     * it's descendants. If the `text` is passed it's set the content of the
     * element, otherwise it works as a getter for the current content.
     *
     * Example:
     *
     * ```
     * var node = A.one('#nodeId');
     * node.text('Setting new text content');
     * // Alert the value of the current content
     * alert( node.text() );
     * ```
     *
     * @method text
     * @param {String} text A string of text to set as the content of the node
     *     instance.
     */
    text: function(text) {
        var instance = this;
        var el = instance.getDOM();

        if (!isUndefined(text)) {
            text = A.DOM._getDoc(el).createTextNode(text);

            return instance.empty().append(text);
        }

        return instance._getText(el.childNodes);
    },

    /**
     * Displays or hide the node instance.
     *
     * NOTE: This method assume that your node were hidden because of the
     * 'aui-hide' css class were being used. This won't manipulate the inline
     * `style.display` property.
     *
     * @method toggle
     * @chainable
     * @param {Boolean} on Whether to force the toggle. Optional.
     * @param {Function} callback A function to run after the visibility change.
     *     Optional.
     */
    toggle: function() {
        var instance = this;

        instance._toggleView.apply(instance, arguments);

        return instance;
    },

    /**
     * Disables text selection for this element (normalized across browsers).
     *
     * @method unselectable
     * @param noRecurse
     * @chainable
     */
    unselectable: function(noRecurse) {
        var instance = this;

        instance.setStyles({
            '-webkit-user-select': CSS_UNSELECTABLE_VALUE,
            '-khtml-user-select': CSS_UNSELECTABLE_VALUE,
            '-moz-user-select': CSS_UNSELECTABLE_VALUE,
            '-ms-user-select': CSS_UNSELECTABLE_VALUE,
            '-o-user-select': CSS_UNSELECTABLE_VALUE,
            'user-select': CSS_UNSELECTABLE_VALUE
        });

        if (A.UA.ie || A.UA.opera) {
            _setUnselectable(instance._node, true, noRecurse);
        }

        return instance;
    },

    /**
     * Gets or sets the value attribute of the node instance. If the `value` is
     * passed it's set the value of the element, otherwise it works as a getter
     * for the current value.
     *
     * Example:
     *
     * ```
     * var input = A.one('#inputId');
     * input.val('Setting new input value');
     * // Alert the value of the input
     * alert( input.val() );
     * ```
     *
     * @method val
     * @param {String} value Value to be set. Optional.
     */
    val: function(value) {
        var instance = this;

        if (isUndefined(value)) {
            return instance.get('value');
        }
        else {
            return instance.set('value', value);
        }
    },

    /**
     * Returns the combined size of the box style for the specified sides.
     *
     * @method _getBoxStyleAsNumber
     * @param {String} sides Can be t, r, b, l or any combination of
     * those to represent the top, right, bottom, or left sides.
     * @param {String} map An object mapping mapping the "sides" param to the a
     *     CSS value to retrieve
     * @return {Number}
     * @private
     */
    _getBoxStyleAsNumber: function(sides, map) {
        var instance = this;

        var sidesArray = sides.match(/\w/g),
            value = 0,
            side,
            sideKey,
            i;

        for (i = sidesArray.length - 1; i >= 0; i--) {
            sideKey = sidesArray[i];
            side = 0;

            if (sideKey) {
                side = parseFloat(instance.getComputedStyle(map[sideKey]));
                side = Math.abs(side);

                value += side || 0;
            }
        }

        return value;
    },

    /**
     * Extracts text content from the passed nodes.
     *
     * @method _getText
     * @private
     * @param {Native NodeList} childNodes
     */
    _getText: function(childNodes) {
        var instance = this;

        var length = childNodes.length,
            childNode,
            str = [],
            i;

        for (i = 0; i < length; i++) {
            childNode = childNodes[i];

            if (childNode && childNode.nodeType !== 8) {
                if (childNode.nodeType !== 1) {
                    str.push(childNode.nodeValue);
                }

                if (childNode.childNodes) {
                    str.push(instance._getText(childNode.childNodes));
                }
            }
        }

        return str.join('');
    },

    /**
     * Overrides Y.Node._hide. Adds aui-hide to the node's cssClass
     *
     * @method _hide
     * @private
     */
    _hide: function() {
        var instance = this;

        instance.addClass(CSS_HIDE);

        return NODE_PROTO_HIDE.apply(instance, arguments);
    },

    /**
     * The event handler for the "out" function that is fired for events
     * attached via the hover method.
     *
     * @method _hoverOutHandler
     * @private
     * @param {EventFacade} event
     */
    _hoverOutHandler: function(event) {
        var instance = this;

        var hoverOptions = instance._hoverOptions;

        hoverOptions.outTask.delay(hoverOptions.outDelay, event);
    },

    /**
     * The event handler for the "over" function that is fired for events
     * attached via the hover method.
     *
     * @method _hoverOverHandler
     * @private
     * @param {EventFacade} event
     */
    _hoverOverHandler: function(event) {
        var instance = this;

        var hoverOptions = instance._hoverOptions;

        hoverOptions.overTask.delay(hoverOptions.overDelay, event);
    },

    /**
     * Cancels the over task, and fires the users custom "out" function for the
     * hover method
     *
     * @method _hoverOverHandler
     * @private
     * @param {EventFacade} event
     */
    _hoverOutTaskFn: function(event) {
        var instance = this;

        var hoverOptions = instance._hoverOptions;

        hoverOptions.overTask.cancel();

        hoverOptions.out.apply(hoverOptions.context || event.currentTarget, arguments);
    },

    /**
     * Cancels the out task, and fires the users custom "over" function for the
     * hover method
     *
     * @method _hoverOverHandler
     * @private
     * @param {EventFacade} event
     */
    _hoverOverTaskFn: function(event) {
        var instance = this;

        var hoverOptions = instance._hoverOptions;

        hoverOptions.outTask.cancel();

        hoverOptions.over.apply(hoverOptions.context || event.currentTarget, arguments);
    },

    /**
     * Places a node or html string at a specific location
     *
     * @method _place
     * @private
     * @param {Node|String} newNode
     * @param {Node} refNode
     */
    _place: function(newNode, refNode) {
        var instance = this;

        var parent = instance.get('parentNode');

        if (parent) {
            if (isString(newNode)) {
                newNode = ANode.create(newNode);
            }

            parent.insertBefore(newNode, refNode);
        }

        return instance;
    },

    /**
     * Overrides Y.Node._show. Removes aui-hide from the node's cssClass
     *
     * @method _show
     * @private
     */
    _show: function() {
        var instance = this;

        instance.removeClass(CSS_HIDE);

        return NODE_PROTO_SHOW.apply(instance, arguments);
    },

    _defaultHoverOptions: {
        overEventType: 'mouseenter',
        outEventType: 'mouseleave',
        overDelay: 0,
        outDelay: 0,
        over: Lang.emptyFn,
        out: Lang.emptyFn
    }
}, true);

NODE_PROTO.__isHidden = NODE_PROTO._isHidden;

NODE_PROTO._isHidden = function() {
    var instance = this;

    return NODE_PROTO.__isHidden.call(instance) || instance.hasClass(instance._hideClass || CSS_HIDE);
};

/**
 * Returns the width of the content, not including the padding, border or
 * margin. If a width is passed, the node's overall width is set to that size.
 *
 * Example:
 *
 * ```
 * var node = A.one('#nodeId');
 * node.width(); //return content width
 * node.width(100); // sets box width
 * ```
 *
 * @method width
 * @return {number}
 */

/**
 * Returns the height of the content, not including the padding, border or
 * margin. If a height is passed, the node's overall height is set to that size.
 *
 * Example:
 *
 * ```
 * var node = A.one('#nodeId');
 * node.height(); //return content height
 * node.height(100); // sets box height
 * ```
 *
 * @method height
 * @return {number}
 */

/**
 * Returns the size of the box from inside of the border, which is the
 * `offsetWidth` plus the padding on the left and right.
 *
 * Example:
 *
 * ```
 * var node = A.one('#nodeId');
 * node.innerWidth();
 * ```
 *
 * @method innerWidth
 * @return {number}
 */

/**
 * Returns the size of the box from inside of the border, which is offsetHeight
 * plus the padding on the top and bottom.
 *
 * Example:
 *
 * ```
 * var node = A.one('#nodeId');
 * node.innerHeight();
 * ```
 *
 * @method innerHeight
 * @return {number}
 */

/**
 * Returns the outer width of the box including the border, if true is passed as
 * the first argument, the margin is included.
 *
 * Example:
 *
 * ```
 * var node = A.one('#nodeId');
 * node.outerWidth();
 * node.outerWidth(true); // includes margin
 * ```
 *
 * @method outerWidth
 * @return {number}
 */

/**
 * Returns the outer height of the box including the border, if true is passed
 * as the first argument, the margin is included.
 *
 * Example:
 *
 * ```
 * var node = A.one('#nodeId');
 * node.outerHeight();
 * node.outerHeight(true); // includes margin
 * ```
 *
 * @method outerHeight
 * @return {number}
 */

A.each(
 ['Height', 'Width'],
    function(item, index) {
        var sides = index ? 'lr' : 'tb';

        var dimensionType = item.toLowerCase();

        NODE_PROTO[dimensionType] = function(size) {
            var instance = this;

            var returnValue = instance;

            if (isUndefined(size)) {
                var node = instance._node;
                var dimension;

                if (node) {
                    if ((!node.tagName && node.nodeType === 9) || node.alert) {
                        dimension = instance.get('region')[dimensionType];
                    }
                    else {
                        dimension = instance.get('offset' + item);

                        if (!dimension) {
                            var originalDisplay = instance.getStyle('display');
                            var originalPosition = instance.getStyle('position');
                            var originalVisibility = instance.getStyle('visibility');

                            instance.setStyles({
                                display: 'block !important',
                                position: 'absolute !important',
                                visibility: 'hidden !important'
                            });

                            dimension = instance.get('offset' + item);

                            instance.setStyles({
                                display: originalDisplay,
                                position: originalPosition,
                                visibility: originalVisibility
                            });
                        }

                        if (dimension) {
                            dimension -= (instance.getPadding(sides) + instance.getBorderWidth(sides));
                        }
                    }
                }

                returnValue = dimension;
            }
            else {
                instance.setStyle(dimensionType, size);
            }

            return returnValue;
        };

        NODE_PROTO['inner' + item] = function() {
            var instance = this;

            return instance[dimensionType]() + instance.getPadding(sides);
        };

        NODE_PROTO['outer' + item] = function(margin) {
            var instance = this;

            var innerSize = instance['inner' + item]();
            var borderSize = instance.getBorderWidth(sides);

            var size = innerSize + borderSize;

            if (margin) {
                size += instance.getMargin(sides);
            }

            return size;
        };
    }
);

if (!SUPPORT_OPTIONAL_TBODY) {
    A.DOM._ADD_HTML = A.DOM.addHTML;

    A.DOM.addHTML = function(node, content, where) {
        var nodeName = (node.nodeName && node.nodeName.toLowerCase()) || '';

        var tagName = '';

        if (!isUndefined(content)) {
            if (isString(content)) {
                tagName = (REGEX_TAGNAME.exec(content) || ARRAY_EMPTY_STRINGS)[1];
            }
            else if (content.nodeType && content.nodeType === 11 && content.childNodes.length) { // a doc frag
                tagName = content.childNodes[0].nodeName;
            }
            else if (content.nodeName) { // a node
                tagName = content.nodeName;
            }

            tagName = tagName && tagName.toLowerCase();
        }

        if (nodeName === 'table' && tagName === 'tr') {
            node = node.getElementsByTagName('tbody')[0] || node.appendChild(node.ownerDocument.createElement('tbody'));

            var whereNodeName = ((where && where.nodeName) || '').toLowerCase();

            // Assuming if the "where" is a tbody node,
            // we're trying to prepend to a table. Attempt to
            // grab the first child of the tbody.
            if (whereNodeName === 'tbody' && where.childNodes.length > 0) {
                where = where.firstChild;
            }
        }

        return A.DOM._ADD_HTML(node, content, where);
    };
}

/**
 * Augments the [YUI3 NodeList](NodeList.html) with more util methods.
 *
 * Checks the list of [Methods](NodeList.html#methods) available for AUI
 * NodeList.
 *
 * @class A.NodeList
 * @constructor
 * @uses A.Node
 */
ANodeList.importMethod(
    NODE_PROTO, [
  'after',

  'appendTo',

  'attr',

  'before',

  'empty',

  'getX',

  'getXY',

  'getY',

  'hover',

  'html',

  'innerHeight',

  'innerWidth',

  'outerHeight',

  'outerHTML',

  'outerWidth',

  'prepend',

  'prependTo',

  'purge',

  'selectText',

  'selectable',

  'setX',

  'setXY',

  'setY',

  'text',

  'toggle',

  'unselectable',

  'val'
 ]
);

A.mix(
    NODELIST_PROTO, {
        /**
         * See [Node all](Node.html#method_all).
         *
         * @method all
         */
        all: function(selector) {
            var instance = this,
                newNodeList = [],
                nodes = instance._nodes,
                length = nodes.length,
                subList,
                i;

            for (i = 0; i < length; i++) {
                subList = A.Selector.query(selector, nodes[i]);

                if (subList && subList.length) {
                    newNodeList.push.apply(newNodeList, subList);
                }
            }

            newNodeList = AArray.unique(newNodeList);

            return A.all(newNodeList);
        },

        /**
         * Returns the first element in the node list collection.
         *
         * @method first
         * @return {Node}
         */
        first: function() {
            var instance = this;

            return instance.item(0);
        },

        /**
         * See [Node getDOMNode](Node.html#method_getDOMNode).
         *
         * @method getDOM
         */
        getDOM: function() {
            return ANodeList.getDOMNodes(this);
        },

        /**
         * Returns the last element in the node list collection.
         *
         * @method last
         * @return {Node}
         */
        last: function() {
            var instance = this;

            return instance.item(instance._nodes.length - 1);
        },

        /**
         * See [Node one](Node.html#method_one).
         *
         * @method one
         */
        one: function(selector) {
            var instance = this,
                newNode = null,
                nodes = instance._nodes,
                length = nodes.length,
                i;

            for (i = 0; i < length; i++) {
                newNode = A.Selector.query(selector, nodes[i], true);

                if (newNode) {
                    newNode = A.one(newNode);

                    break;
                }
            }

            return newNode;
        }
    }
);

NODELIST_PROTO.__filter = NODELIST_PROTO.filter;

NODELIST_PROTO.filter = function(value, context) {
    var instance = this;

    var newNodeList;

    if (isFunction(value)) {
        var nodes = [];

        instance.each(
            function(item, index, collection) {
                if (value.call(context || item, item, index, collection)) {
                    nodes.push(item._node);
                }
            }
        );

        newNodeList = A.all(nodes);
    }
    else {
        newNodeList = NODELIST_PROTO.__filter.call(instance, value);
    }

    return newNodeList;
};

A.mix(
    ANodeList, {
        /**
         * Converts the passed `html` into a `NodeList` and returns the result.
         *
         * @method create
         * @param {String} html
         * @return {NodeList}
         */
        create: function(html) {
            var docFrag = A.getDoc().invoke('createDocumentFragment');

            return docFrag.append(html).get('childNodes');
        }
    }
);

A.mix(
    A, {
        /**
         * Gets the body node. Shortcut to `A.one('body')`.
         *
         * @method getBody
         */
        getBody: function() {
            var instance = this;

            if (!instance._bodyNode) {
                instance._bodyNode = A.one(DOC.body);
            }

            return instance._bodyNode;
        },

        /**
         * Gets the document node. Shortcut to `A.one(document)`.
         *
         * @method getDoc
         */
        getDoc: function() {
            var instance = this;

            if (!instance._documentNode) {
                instance._documentNode = A.one(DOC);
            }

            return instance._documentNode;
        },

        /**
         * Gets the window node. Shortcut to `A.one(window)`.
         *
         * @method getWin
         */
        getWin: function() {
            var instance = this;

            if (!instance._windowNode) {
                instance._windowNode = A.one(WIN);
            }

            return instance._windowNode;
        }
    }
);


}, '3.1.0-deprecated.95', {"requires": ["array-extras", "aui-base-lang", "aui-classnamemanager", "aui-debounce", "node"]});

YUI.add('aui-node-html5', function (A, NAME) {

/**
 * Provides support for HTML shiv natively on the Alloy DOM methods. The HTML5
 * shiv just affects IE.
 *
 * @module aui-node
 * @submodule aui-node-html5
 */

if (A.UA.ie) {
    /**
     * An object that encapsulates util methods for HTML5 shiving.
     *
     * **What is a "shiv"?**
     *
     * To the world, a shiv is a slang term for a sharp object used as a
     * knife-like weapon. To Internet Explorer, a shiv is a script that, when
     * executed, forces the browser to recognize HTML5 elements.
     *
     * @class A.HTML5
     */
    var HTML5 = A.namespace('HTML5'),
        DOM_create = A.DOM._create;

    if (!HTML5._fragHTML5Shived) {
        /**
         * A global DocumentFragment already HTML5 shived, for performance
         * reasons. (i.e., all nodes and its HTML5 children appended to this
         * fragment iherits the styles on IE).
         *
         * @property _fragHTML5Shived
         * @type {DocumentFragment}
         * @protected
         */
        HTML5._fragHTML5Shived = A.html5shiv(
            A.config.doc.createDocumentFragment()
        );
    }

    A.mix(
        HTML5, {
            /**
             * Receives a `frag` and a HTML content. This method shivs the HTML5
             * nodes appended to a Node or fragment which is not on the document
             * yet.
             *
             * @method IECreateFix
             * @param {Node|DocumentFragment} frag Fragment to be fixed.
             * @param {String} content HTML to be set (using innerHTML) on the
             *     `frag`.
             * @return {Node|DocumentFragment}
             */
            IECreateFix: function(frag, content) {
                var shivedFrag = HTML5._fragHTML5Shived;

                shivedFrag.appendChild(frag);

                frag.innerHTML = content;

                shivedFrag.removeChild(frag);

                return frag;
            },

            /**
             * AOP listener to the A.DOM._create method. This method intercepts
             * all the calls to the A.DOM._create and append the generated
             * fragment to [A.HTML._fragHTML5Shived](A.HTML5.html#property__frag
             * HTML5Shived), this fixes the IE bug for painting the HTML5 nodes
             * on the HTML fragment.
             *
             * @method _doBeforeCreate
             * @param {String} html HTML content
             * @param {String} doc
             * @param {String} tag
             * @protected
             * @return {DocumentFragment}
             */
            _doBeforeCreate: function(html) {
                var createdFrag = DOM_create.apply(this, arguments);

                var shivedFrag = HTML5.IECreateFix(createdFrag, html);

                return new A.Do.Halt(null, shivedFrag);
            }
        }
    );

    A.Do.before(HTML5._doBeforeCreate, A.DOM, '_create', A.DOM);
}
/**
 * The Node Utility.
 *
 * @module aui-node
 * @submodule aui-node-html5-print
 */

var CONFIG = A.config,
    DOC = CONFIG.doc,
    WIN = CONFIG.win,
    UA = A.UA,
    IE = UA.ie,

    isShivDisabled = function() {
        return WIN.AUI_HTML5_IE === false;
    };

if (!IE || IE >= 9 || isShivDisabled()) {
    return;
}

var BUFFER_CSS_TEXT = [],

    LOCATION = WIN.location,

    DOMAIN = LOCATION.protocol + '//' + LOCATION.host,

    HTML = DOC.documentElement,

    HTML5_ELEMENTS = A.HTML5_ELEMENTS,
    HTML5_ELEMENTS_LENGTH = HTML5_ELEMENTS.length,
    HTML5_ELEMENTS_LIST = HTML5_ELEMENTS.join('|'),

    REGEX_CLONE_NODE_CLEANUP = new RegExp('<(/?):(' + HTML5_ELEMENTS_LIST + ')', 'gi'),
    REGEX_ELEMENTS = new RegExp('(' + HTML5_ELEMENTS_LIST + ')', 'gi'),
    REGEX_ELEMENTS_FAST = new RegExp('\\b(' + HTML5_ELEMENTS_LIST + ')\\b', 'i'),

    REGEX_PRINT_MEDIA = /print|all/,

    REGEX_RULE = new RegExp('(^|[^\\n{}]*?\\s)(' + HTML5_ELEMENTS_LIST + ').*?{([^}]*)}', 'gim'),
    REGEX_TAG = new RegExp('<(\/*)(' + HTML5_ELEMENTS_LIST + ')', 'gi'),

    SELECTOR_REPLACE_RULE = '.' + 'printfix-' + '$1',

    STR_EMPTY = '',

    STR_URL_DOMAIN = 'url(' + DOMAIN,

    TAG_REPLACE_ORIGINAL = '<$1$2',
    TAG_REPLACE_FONT = '<$1font';

var html5shiv = A.html5shiv,
    // Yes, IE does this wackiness; converting an object
    // to a string should never result in undefined, but
    // IE's styleSheet object sometimes becomes inaccessible
    // after trying to print the second time
    isStylesheetDefined = function(obj) {
        return obj && (obj + STR_EMPTY !== undefined);
    },

    toggleNode = function(node, origNode, prop) {
        var state = origNode[prop];

        if (state) {
            node.setAttribute(prop, state);
        }
        else {
            node.removeAttribute(prop);
        }
    };

html5shiv(DOC);

var printFix = function() {
    var destroy;

    var afterPrint = function() {
        if (isShivDisabled()) {
            destroy();
        }
        else {
            printFix.onAfterPrint();
        }
    };

    var beforePrint = function() {
        if (isShivDisabled()) {
            destroy();
        }
        else {
            printFix.onBeforePrint();
        }
    };

    destroy = function() {
        WIN.detachEvent('onafterprint', afterPrint);
        WIN.detachEvent('onbeforeprint', beforePrint);
    };

    var init = function() {
        WIN.attachEvent('onafterprint', afterPrint);
        WIN.attachEvent('onbeforeprint', beforePrint);
    };

    init();

    printFix.destroy = destroy;
    printFix.init = init;
};

A.mix(
    printFix, {
        /**
         * Fires after a print.
         *
         * @method onAfterPrint
         */
        onAfterPrint: function() {
            var instance = this;

            instance.restoreHTML();

            var styleSheet = instance._getStyleSheet();

            styleSheet.styleSheet.cssText = '';
        },

        /**
         * Fires before a print.
         *
         * @method onBeforePrint
         */
        onBeforePrint: function() {
            var instance = this;

            var styleSheet = instance._getStyleSheet();
            var cssRules = instance._getAllCSSText();

            styleSheet.styleSheet.cssText = instance.parseCSS(cssRules);

            instance.writeHTML();
        },

        /**
         * Navigates through the CSS joining rules and replacing content.
         *
         * @method parseCSS
         * @param cssText
         * @return {String}
         */
        parseCSS: function(cssText) {
            var css = '';
            var rules = cssText.match(REGEX_RULE);

            if (rules) {
                css = rules.join('\n').replace(REGEX_ELEMENTS, SELECTOR_REPLACE_RULE);
            }

            return css;
        },

        /**
         * Restores the HTML from the `bodyClone` and `bodyEl` attributes.
         *
         * @method restoreHTML
         */
        restoreHTML: function() {
            var instance = this;

            var bodyClone = instance._getBodyClone();
            var bodyEl = instance._getBodyEl();

            var newNodes = bodyClone.getElementsByTagName('IFRAME');
            var originalNodes = bodyEl.getElementsByTagName('IFRAME');

            var length = originalNodes.length;

            // Moving IFRAME nodes back to their original position
            if (length === newNodes.length) {
                while (length--) {
                    var newNode = newNodes[length];
                    var originalNode = originalNodes[length];

                    originalNode.swapNode(newNode);
                }
            }

            bodyClone.innerHTML = '';

            HTML.removeChild(bodyClone);
            HTML.appendChild(bodyEl);
        },

        /**
         * Generates the HTML for print.
         *
         * @method writeHTML
         */
        writeHTML: function() {
            var instance = this;

            var i = -1;
            var j;

            var bodyEl = instance._getBodyEl();

            var html5Element;

            var cssClass;

            var nodeList;
            var nodeListLength;
            var node;
            var buffer = [];

            while (++i < HTML5_ELEMENTS_LENGTH) {
                html5Element = HTML5_ELEMENTS[i];

                nodeList = DOC.getElementsByTagName(html5Element);
                nodeListLength = nodeList.length;

                j = -1;

                while (++j < nodeListLength) {
                    node = nodeList[j];

                    cssClass = node.className;

                    if (cssClass.indexOf('printfix-') === -1) {
                        buffer[0] = 'printfix-' + html5Element;
                        buffer[1] = cssClass;

                        node.className = buffer.join(' ');
                    }
                }
            }

            var docFrag = instance._getDocFrag();
            var bodyClone = instance._getBodyClone();

            docFrag.appendChild(bodyEl);
            HTML.appendChild(bodyClone);

            bodyClone.className = bodyEl.className;
            bodyClone.id = bodyEl.id;

            var originalNodes = bodyEl.getElementsByTagName('*');
            var length = originalNodes.length;

            // IE will throw a mixed content warning when using https
            // and calling clone node if the body contains elements with
            // an inline background-image style that is relative to the domain.
            if (UA.secure) {
                var bodyElStyle = bodyEl.style;

                var elStyle;
                var backgroundImage;

                bodyElStyle.display = 'none';

                for (i = 0; i < length; i++) {
                    elStyle = originalNodes[i].style;

                    backgroundImage = elStyle.backgroundImage;

                    if (backgroundImage &&
                        backgroundImage.indexOf('url(') > -1 &&
                        backgroundImage.indexOf('https') === -1) {

                        elStyle.backgroundImage = backgroundImage.replace('url(', STR_URL_DOMAIN);
                    }
                }

                bodyElStyle.display = '';
            }

            var bodyElClone = bodyEl.cloneNode(true);

            var newNodes = bodyElClone.getElementsByTagName('*');

            if (length === newNodes.length) {
                while (length--) {
                    var newNode = newNodes[length];
                    var newNodeName = newNode.nodeName;

                    if (newNodeName === 'INPUT' || newNodeName === 'OPTION' || newNodeName === 'IFRAME') {
                        var originalNode = originalNodes[length];
                        var originalNodeName = originalNode.nodeName;

                        if (originalNodeName === newNodeName) {
                            var prop = null;

                            if (newNodeName === 'OPTION') {
                                prop = 'selected';
                            }
                            else if (newNodeName === 'INPUT' && (newNode.type === 'checkbox' || newNode.type ===
                                'radio')) {
                                prop = 'checked';
                            }
                            else if (newNodeName === 'IFRAME') {
                                newNode.src = '';
                            }

                            if (prop !== null) {
                                toggleNode(newNode, originalNode, prop);
                            }
                        }
                    }
                }
            }

            var bodyHTML = bodyElClone.innerHTML;

            bodyHTML = bodyHTML.replace(REGEX_CLONE_NODE_CLEANUP, TAG_REPLACE_ORIGINAL).replace(REGEX_TAG,
                TAG_REPLACE_FONT);

            bodyClone.innerHTML = bodyHTML;

            // Post processing the DOM in order to move IFRAME nodes

            newNodes = bodyClone.getElementsByTagName('IFRAME');
            originalNodes = bodyEl.getElementsByTagName('IFRAME');

            length = originalNodes.length;

            if (length === newNodes.length) {
                while (length--) {
                    var newNodeIframe = newNodes[length];
                    var originalNodeIframe = originalNodes[length];

                    // According to quirksmode.org, swapNode is supported on all major IE versions
                    originalNodeIframe.swapNode(newNodeIframe);
                }
            }
        },

        /**
         * Gets all CSS text from all stylesheets.
         *
         * @method _getAllCSSText
         * @protected
         * @return {Array}
         */
        _getAllCSSText: function() {
            var instance = this;

            var buffer = [];
            var styleSheets = instance._getAllStyleSheets(DOC.styleSheets, 'all');
            var rule;
            var cssText;
            var styleSheet;

            for (var i = 0; styleSheet = styleSheets[i]; i++) {
                var rules = styleSheet.rules;

                if (rules && rules.length) {
                    for (var j = 0, ruleLength = rules.length; j < ruleLength; j++) {
                        rule = rules[j];

                        if (!rule.href) {
                            cssText = instance._getCSSTextFromRule(rule);

                            buffer.push(cssText);
                        }
                    }
                }
            }

            return buffer.join(' ');
        },

        /**
         * Extracts the CSS text from a rule.
         *
         * @method _getCSSTextFromRule
         * @param rule
         * @protected
         * @return {String}
         */
        _getCSSTextFromRule: function(rule) {
            var cssText = '';

            var ruleStyle = rule.style;
            var ruleCSSText;
            var ruleSelectorText;

            if (ruleStyle && (ruleCSSText = ruleStyle.cssText) && (ruleSelectorText = rule.selectorText) &&
                REGEX_ELEMENTS_FAST.test(ruleSelectorText)) {
                BUFFER_CSS_TEXT.length = 0;

                BUFFER_CSS_TEXT.push(ruleSelectorText, '{', ruleCSSText, '}');

                cssText = BUFFER_CSS_TEXT.join(' ');
            }

            return cssText;
        },

        /**
         * Gets all stylesheets from a page.
         *
         * @method _getAllStyleSheets
         * @param styleSheet, mediaType, level, buffer
         * @protected
         * @return {Array}
         */
        _getAllStyleSheets: function(styleSheet, mediaType, level, buffer) {
            var instance = this;

            level = level || 1;

            buffer = buffer || [];

            var i;

            if (isStylesheetDefined(styleSheet)) {
                var imports = styleSheet.imports;

                mediaType = styleSheet.mediaType || mediaType;

                if (REGEX_PRINT_MEDIA.test(mediaType)) {
                    var length;

                    // IE can crash when trying to access imports more than 3 levels deep
                    if (level <= 3 && isStylesheetDefined(imports) && imports.length) {
                        for (i = 0, length = imports.length; i < length; i++) {
                            instance._getAllStyleSheets(imports[i], mediaType, level + 1, buffer);
                        }
                    }
                    else if (styleSheet.length) {
                        for (i = 0, length = styleSheet.length; i < length; i++) {
                            instance._getAllStyleSheets(styleSheet[i], mediaType, level, buffer);
                        }
                    }
                    else {
                        var rules = styleSheet.rules;
                        var ruleStyleSheet;

                        if (rules && rules.length) {
                            for (i = 0, length = rules.length; i < length; i++) {
                                ruleStyleSheet = rules[i].styleSheet;

                                if (ruleStyleSheet) {
                                    instance._getAllStyleSheets(ruleStyleSheet, mediaType, level, buffer);
                                }
                            }
                        }
                    }

                    if (!styleSheet.disabled && styleSheet.rules) {
                        buffer.push(styleSheet);
                    }
                }
            }

            mediaType = 'all';

            return buffer;
        },

        /**
         * Gets the `<body>` element.
         *
         * @method _getBodyEl
         * @protected
         * @return {Element}
         */
        _getBodyEl: function() {
            var instance = this;

            var bodyEl = instance._bodyEl;

            if (!bodyEl) {
                bodyEl = DOC.body;

                instance._bodyEl = bodyEl;
            }

            return bodyEl;
        },

        /**
         * Gets a clone of the `<body>` element.
         *
         * @method _getBodyClone
         * @protected
         * @return {Element}
         */
        _getBodyClone: function() {
            var instance = this;

            var bodyClone = instance._bodyClone;

            if (!bodyClone) {
                bodyClone = DOC.createElement('body');

                instance._bodyClone = bodyClone;
            }

            return bodyClone;
        },

        /**
         * Gets a document fragment object.
         *
         * @method _getDocFrag
         * @protected
         * @return {DocumentFragment}
         */
        _getDocFrag: function() {
            var instance = this;

            var docFrag = instance._docFrag;

            if (!docFrag) {
                docFrag = DOC.createDocumentFragment();

                html5shiv(docFrag);

                instance._docFrag = docFrag;
            }

            return docFrag;
        },

        /**
         * Gets the stylesheet from the DOM.
         *
         * @method _getStyleSheet
         * @protected
         * @return {Node}
         */
        _getStyleSheet: function() {
            var instance = this;

            var styleSheet = instance._styleSheet;

            if (!styleSheet) {
                styleSheet = DOC.createElement('style');

                var head = DOC.documentElement.firstChild;

                head.insertBefore(styleSheet, head.firstChild);

                styleSheet.media = 'print';
                styleSheet.className = 'printfix';

                instance._styleSheet = styleSheet;
            }

            return styleSheet;
        }
    }
);

A.namespace('HTML5').printFix = printFix;

printFix();


}, '3.1.0-deprecated.95', {"requires": ["collection", "aui-node-base"]});

YUI.add('aui-selector', function (A, NAME) {

/**
 * The Selector Utility.
 *
 * @module aui-selector
 */

var SELECTOR = A.Selector,

    CSS_BOOTSTRAP_SR_ONLY = A.getClassName('sr-only'),
    CSS_HIDE = A.getClassName('hide'),
    REGEX_CLIP_RECT_ZERO = new RegExp(/rect\((0(px)?(,)?(\s)?){4}\)/i),
    REGEX_HIDDEN_CLASSNAMES = new RegExp(CSS_HIDE),
    REGEX_SR_ONLY_CLASSNAMES = new RegExp(CSS_BOOTSTRAP_SR_ONLY);

SELECTOR._isNodeHidden = function(node) {
    var width = node.offsetWidth;
    var height = node.offsetHeight;
    var ignore = node.nodeName.toLowerCase() === 'tr';
    var className = node.className;
    var nodeStyle = node.style;

    var hidden = false;

    if (!ignore) {
        if (width === 0 && height === 0) {
            hidden = true;
        }
        else if (width > 0 && height > 0) {
            hidden = false;
        }
    }

    hidden = hidden || (nodeStyle.display === 'none' || nodeStyle.visibility === 'hidden') ||
        (nodeStyle.position === 'absolute' && REGEX_CLIP_RECT_ZERO.test(nodeStyle.clip)) ||
        REGEX_HIDDEN_CLASSNAMES.test(className) || REGEX_SR_ONLY_CLASSNAMES.test(className);

    return hidden;
};

var testNodeType = function(type) {
    return function(node) {
        return node.type === type;
    };
};

/**
 * Augment the [YUI3 Selector](Selector.html) with more util methods.
 *
 * @class A.Selector
 * @uses Selector
 * @constructor
 */
A.mix(
    SELECTOR.pseudos, {
        /**
         * Checks if the node is a button element or contains `type="button"`.
         *
         * @method button
         * @param node
         * @return {Boolean}
         */
        button: function(node) {
            return node.type === 'button' || node.nodeName.toLowerCase() === 'button';
        },

        /**
         * Checks if the node contains `type="checkbox"`.
         *
         * @method checkbox
         * @return {Boolean}
         */
        checkbox: testNodeType('checkbox'),

        /**
         * Checks if the node is checked or not.
         *
         * @method checked
         * @param node
         * @return {Boolean}
         */
        checked: function(node) {
            return node.checked === true;
        },

        /**
         * Checks if the node is disabled or not.
         *
         * @method disabled
         * @param node
         * @return {Boolean}
         */
        disabled: function(node) {
            return node.disabled === true;
        },

        /**
         * Checks if the node is empty or not.
         *
         * @method empty
         * @param node
         * @return {Boolean}
         */
        empty: function(node) {
            return !node.firstChild;
        },

        /**
         * Checks if the node is enabled or not.
         *
         * @method enabled
         * @param node
         * @return {Boolean}
         */
        enabled: function(node) {
            return node.disabled === false && node.type !== 'hidden';
        },

        /**
         * Checks if the node contains `type="file"`.
         *
         * @method file
         * @return {Boolean}
         */
        file: testNodeType('file'),

        /**
         * Checks if the node is a header (e.g. `<h1>`, `<h2>`, ...) or not.
         *
         * @method header
         * @param node
         * @return {Boolean}
         */
        header: function(node) {
            return /h\d/i.test(node.nodeName);
        },

        /**
         * Checks if the node is hidden or not.
         *
         * @method hidden
         * @param node
         * @return {Boolean}
         */
        hidden: function(node) {
            return SELECTOR._isNodeHidden(node);
        },

        /**
         * Checks if the node contains `type="image"`.
         *
         * @method image
         * @return {Boolean}
         */
        image: testNodeType('image'),

        /**
         * Checks if the node is an input (e.g. `<textarea>`, `<input>`, ...) or not.
         *
         * @method input
         * @param node
         * @return {Boolean}
         */
        input: function(node) {
            return /input|select|textarea|button/i.test(node.nodeName);
        },

        /**
         * Checks if the node contains a child or not.
         *
         * @method parent
         * @param node
         * @return {Boolean}
         */
        parent: function(node) {
            return !!node.firstChild;
        },

        /**
         * Checks if the node contains `type="password"`.
         *
         * @method password
         * @return {Boolean}
         */
        password: testNodeType('password'),

        /**
         * Checks if the node contains `type="radio"`.
         *
         * @method radio
         * @return {Boolean}
         */
        radio: testNodeType('radio'),

        /**
         * Checks if the node contains `type="reset"`.
         *
         * @method reset
         * @return {Boolean}
         */
        reset: testNodeType('reset'),

        /**
         * Checks if the node is selected or not.
         *
         * @method selected
         * @param node
         * @return {Boolean}
         */
        selected: function(node) {
            node.parentNode.selectedIndex;
            return node.selected === true;
        },

        /**
         * Checks if the node contains `type="submit"`.
         *
         * @method submit
         * @return {Boolean}
         */
        submit: testNodeType('submit'),

        /**
         * Checks if the node contains `type="text"`.
         *
         * @method text
         * @return {Boolean}
         */
        text: testNodeType('text'),

        /**
         * Checks if the node is visible or not.
         *
         * @method visible
         * @param node
         * @return {Boolean}
         */
        visible: function(node) {
            return !SELECTOR._isNodeHidden(node);
        }
    }
);


}, '3.1.0-deprecated.95', {"requires": ["selector-css3", "aui-classnamemanager"]});

YUI.add('aui-timer', function (A, NAME) {

/**
 * Utility for timing logics used to manage [JavaScript Timer
 * Congestion](http://fitzgeraldnick.com/weblog/40/) problems.
 *
 * @module aui-timer
 */

var Lang = A.Lang,
    now = Lang.now,
    isEmpty = A.Object.isEmpty,

    aArray = A.Array;

/**
 * A base class for Timer.
 *
 * @class A.Timer
 * @constructor
 */
var Timer = {

    /**
     * Cancels repeated action which was set up using `setInterval` function.
     *
     * @method clearInterval
     * @param id
     */
    clearInterval: function(id) {
        var instance = Timer;

        instance.unregister(true, id);
    },

    /**
     * Clears the delay set by `setTimeout` function.
     *
     * @method clearTimeout
     * @param id
     */
    clearTimeout: function(id) {
        var instance = Timer;

        instance.unregister(false, id);
    },

    /**
     * Defines the fixed time delay between each interval.
     *
     * @method intervalTime
     * @param newInterval
     * @return {Number}
     */
    intervalTime: function(newInterval) {
        var instance = Timer;

        if (arguments.length) {
            instance._INTERVAL = newInterval;
        }

        return instance._INTERVAL;
    },

    /**
     * Checks if the task is repeatable or not.
     *
     * @method isRepeatable
     * @param task
     * @return {Boolean}
     */
    isRepeatable: function(task) {
        return task.repeats;
    },

    /**
     * Calls a function after a specified delay.
     *
     * @method setTimeout
     * @param fn
     * @param ms
     * @param context
     */
    setTimeout: function(fn, ms, context) {
        var instance = Timer;

        var args = aArray(arguments, 3, true);

        return instance.register(false, fn, ms, context, args);
    },

    /**
     * Calls a function repeatedly, with a fixed time delay between each call to
     * that function.
     *
     * @method setInterval
     * @param fn
     * @param ms
     * @param context
     */
    setInterval: function(fn, ms, context) {
        var instance = Timer;

        var args = aArray(arguments, 3, true);

        return instance.register(true, fn, ms, context, args);
    },

    /**
     * Adds a new task to the timer.
     *
     * @method register
     * @param repeats
     * @param fn
     * @param ms
     * @param context
     * @param args
     */
    register: function(repeats, fn, ms, context, args) {
        var instance = Timer;

        var id = (++A.Env._uidx);

        args = args || [];

        args.unshift(fn, context);

        instance._TASKS[id] = instance._create(
            repeats, instance._getNearestInterval(ms), A.rbind.apply(A, args)
        );

        instance._lazyInit();

        return id;
    },

    /**
     * Runs the task function.
     *
     * @method run
     * @param task
     */
    run: function(task) {
        task.lastRunTime = now();

        return task.fn();
    },

    /**
     * Removes a task from the timer.
     *
     * @method unregister
     * @param repeats
     * @param id
     */
    unregister: function(repeats, id) {
        var instance = Timer;

        var tasks = instance._TASKS;

        var task = tasks[id];

        instance._lazyDestroy();

        return task && task.repeats === repeats && delete tasks[id];
    },

    /**
     * Creates a collection of timer definitions.
     *
     * @method _create
     * @param repeats
     * @param ms
     * @param fn
     * @protected
     * @return {Object}
     */
    _create: function(repeats, ms, fn) {
        return {
            fn: fn,
            lastRunTime: now(),
            next: ms,
            repeats: repeats,
            timeout: ms
        };
    },

    /**
     * Subtracts the current time with the last run time. The result of this
     * operation is subtracted with the task timeout.
     *
     * @method _decrementNextRunTime
     * @param tasks
     * @protected
     */
    _decrementNextRunTime: function(task) {
        return task.next = task.timeout - (now() - task.lastRunTime);
    },

    /**
     * Calculates the nearest interval by using the modulus of the argument with
     * the interval as reference.
     *
     * @method _getNearestInterval
     * @param num
     * @protected
     * @return {Number}
     */
    _getNearestInterval: function(num) {
        var instance = Timer;

        var interval = instance._INTERVAL;

        var delta = num % interval;

        var nearestInterval;

        if (delta < interval / 2) {
            nearestInterval = num - delta;
        }
        else {
            nearestInterval = num + interval - delta;
        }

        return nearestInterval;
    },

    /**
     * Checks if the timer is initialized and empty, then calls the
     * `clearTimeout` function using the global interval id.
     *
     * @method _lazyDestroy
     * @protected
     */
    _lazyDestroy: function() {
        var instance = Timer;

        if (instance._initialized && isEmpty(instance._TASKS)) {
            clearTimeout(instance._globalIntervalId);

            instance._initialized = false;
        }
    },

    /**
     * Checks if the timer is initialized and contains a task, then calls the
     * `setTimeout` function and stores the global interval id.
     *
     * @method _lazyInit
     * @protected
     */
    _lazyInit: function() {
        var instance = Timer;

        if (!instance._initialized && !isEmpty(instance._TASKS)) {
            instance._lastRunTime = now();

            instance._globalIntervalId = setTimeout(
                instance._runner, instance._INTERVAL
            );

            instance._initialized = true;
        }
    },

    /**
     * Goes through all pending tasks and initializes its timer or unregisters
     * it depending on the task status.
     *
     * @method _loop
     * @param i
     * @param pendingTasks
     * @param length
     * @protected
     */
    _loop: function(i, pendingTasks, length) {
        var instance = Timer;

        var interval = instance._INTERVAL;
        var tasks = instance._TASKS;

        var halfInterval = interval / 2;

        for (var start = now(); i < length && now() - start < 50; i++) {
            var taskId = pendingTasks[i];
            var task = tasks[taskId];

            if (task && instance._decrementNextRunTime(task) < halfInterval) {
                instance.run(task);

                if (instance.isRepeatable(task)) {
                    instance._resetNextRunTime(task);
                }
                else {
                    instance.unregister(false, taskId);
                }
            }
        }

        if (instance._initialized) {
            if (i < length) {
                instance._globalIntervalId = setTimeout(instance._loop, 10);
            }
            else {
                instance._globalIntervalId = setTimeout(
                    instance._runner, interval
                );
            }
        }
    },

    /**
     * Gets the arguments to call the `_loop` method.
     *
     * @method _runner
     * @protected
     */
    _runner: function() {
        var instance = Timer;

        var i = 0;
        var pendingTasks = A.Object.keys(instance._TASKS);
        var length = pendingTasks.length;

        instance._loop(i, pendingTasks, length);
    },

    /**
     * Resets the next run time.
     *
     * @method _resetNextRunTime
     * @param task
     * @protected
     */
    _resetNextRunTime: function(task) {
        return task.next = task.timeout;
    },

    _INTERVAL: 50,
    _TASKS: {},

    _lastRunTime: 0,
    _globalIntervalId: 0,
    _initialized: false
};

/**
 * Cancels repeated action which was set up using `setInterval` function.
 *
 * @method A.clearInterval
 * @static
 * @param id
 */
A.clearInterval = Timer.clearInterval;

/**
 * Clears the delay set by `setTimeout` function.
 *
 * @method A.clearTimeout
 * @static
 * @param id
 */
A.clearTimeout = Timer.clearTimeout;

/**
 * Calls a function repeatedly, with a fixed time delay between each call to
 * that function.
 *
 * @method A.setInterval
 * @static
 * @param fn
 * @param ms
 * @param context
 */
A.setInterval = Timer.setInterval;

/**
 * Calls a function after a specified delay.
 *
 * @method A.setTimeout
 * @static
 * @param fn
 * @param ms
 * @param context
 */
A.setTimeout = Timer.setTimeout;

A.Timer = Timer;


}, '3.1.0-deprecated.95', {"requires": ["oop"]});

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function () {
  var A = AUI().use('oop');
  var usedModules = {};
  var Dependency = {
    _getAOP: function _getAOP(obj, methodName) {
      return obj._yuiaop && obj._yuiaop[methodName];
    },
    _proxy: function _proxy(obj, methodName, methodFn, context, guid, modules, _A) {
      var args;
      var queue = Dependency._proxyLoaders[guid];

      Dependency._replaceMethod(obj, methodName, methodFn, context);

      while (args = queue.next()) {
        methodFn.apply(context, args);
      }

      for (var i = modules.length - 1; i >= 0; i--) {
        usedModules[modules[i]] = true;
      }
    },
    _proxyLoaders: {},
    _replaceMethod: function _replaceMethod(obj, methodName, methodFn) {
      var AOP = Dependency._getAOP(obj, methodName);

      var proxy = obj[methodName];

      if (AOP) {
        proxy = AOP.method;
        AOP.method = methodFn;
      } else {
        obj[methodName] = methodFn;
      }

      A.mix(methodFn, proxy);
    },
    provide: function provide(obj, methodName, methodFn, modules, proto) {
      if (!Array.isArray(modules)) {
        modules = [modules];
      }

      var before;
      var guid = A.guid();

      if (A.Lang.isObject(methodFn, true)) {
        var config = methodFn;
        methodFn = config.fn;
        before = config.before;

        if (!A.Lang.isFunction(before)) {
          before = null;
        }
      }

      if (proto && A.Lang.isFunction(obj)) {
        obj = obj.prototype;
      }

      var AOP = Dependency._getAOP(obj, methodName);

      if (AOP) {
        delete obj._yuiaop[methodName];
      }

      var proxy = function proxy() {
        var args = arguments;
        var context = obj;

        if (proto) {
          context = this;
        }

        if (modules.length == 1) {
          if (modules[0] in usedModules) {
            Dependency._replaceMethod(obj, methodName, methodFn, context);

            methodFn.apply(context, args);
            return;
          }
        }

        var firstLoad = false;
        var queue = Dependency._proxyLoaders[guid];

        if (!queue) {
          firstLoad = true;
          Dependency._proxyLoaders[guid] = new A.Queue();
          queue = Dependency._proxyLoaders[guid];
        }

        queue.add(args);

        if (firstLoad) {
          modules.push(A.bind(Dependency._proxy, Liferay, obj, methodName, methodFn, context, guid, modules));
          A.use.apply(A, modules);
        }
      };

      proxy.toString = function () {
        return methodFn.toString();
      };

      obj[methodName] = proxy;
    }
  };
  Liferay.Dependency = Dependency;
  Liferay.provide = Dependency.provide;
})();
//# sourceMappingURL=dependency.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (Liferay) {
  var DOMTaskRunner = {
    _scheduledTasks: [],
    _taskStates: [],
    addTask: function addTask(task) {
      var instance = this;

      instance._scheduledTasks.push(task);
    },
    addTaskState: function addTaskState(state) {
      var instance = this;

      instance._taskStates.push(state);
    },
    reset: function reset() {
      var instance = this;
      instance._taskStates.length = 0;
      instance._scheduledTasks.length = 0;
    },
    runTasks: function runTasks(node) {
      var instance = this;
      var scheduledTasks = instance._scheduledTasks;
      var taskStates = instance._taskStates;
      var tasksLength = scheduledTasks.length;
      var taskStatesLength = taskStates.length;

      for (var i = 0; i < tasksLength; i++) {
        var task = scheduledTasks[i];
        var taskParams = task.params;

        for (var j = 0; j < taskStatesLength; j++) {
          var state = taskStates[j];

          if (task.condition(state, taskParams, node)) {
            task.action(state, taskParams, node);
          }
        }
      }
    }
  };
  Liferay.DOMTaskRunner = DOMTaskRunner;
})(Liferay);
//# sourceMappingURL=dom_task_runner.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
Liferay.on = function () {};

Liferay.fire = function () {};

Liferay.detach = function () {};

(function (A, Liferay) {
  var CLICK_EVENTS = {};
  var DOC = A.config.doc;
  Liferay.provide(Liferay, 'delegateClick', function (id, fn) {
    var el = DOC.getElementById(id);

    if (!el || el.id != id) {
      return;
    }

    var guid = A.one(el).addClass('lfr-delegate-click').guid();
    CLICK_EVENTS[guid] = fn;

    if (!Liferay._baseDelegateHandle) {
      Liferay._baseDelegateHandle = A.getBody().delegate('click', Liferay._baseDelegate, '.lfr-delegate-click');
    }
  }, ['aui-base']);

  Liferay._baseDelegate = function (event) {
    var id = event.currentTarget.attr('id');
    var fn = CLICK_EVENTS[id];

    if (fn) {
      fn.apply(this, arguments);
    }
  };

  Liferay._CLICK_EVENTS = CLICK_EVENTS;
  A.use('attribute', 'oop', function (A) {
    A.augment(Liferay, A.Attribute, true);
  });
})(AUI(), Liferay);
//# sourceMappingURL=events.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (A, Liferay) {
  var Language = {};

  Language.get = function (key) {
    return key;
  };

  A.use('io-base', function (A) {
    Language.get = A.cached(function (key, extraParams) {
      var url = themeDisplay.getPathContext() + '/language/' + themeDisplay.getLanguageId() + '/' + key + '/';

      if (extraParams) {
        if (typeof extraParams == 'string') {
          url += extraParams;
        } else if (Array.isArray(extraParams)) {
          url += extraParams.join('/');
        }
      }

      var headers = {
        'X-CSRF-Token': Liferay.authToken
      };
      var value = '';
      A.io(url, {
        headers: headers,
        method: 'GET',
        on: {
          complete: function complete(i, o) {
            value = o.responseText;
          }
        },
        sync: true
      });
      return value;
    });
  });
  Liferay.Language = Language;
})(AUI(), Liferay);
//# sourceMappingURL=language.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (Liferay) {
  Liferay.lazyLoad = function () {
    var failureCallback;

    var isFunction = function isFunction(val) {
      return typeof val === 'function';
    };

    var modules;
    var successCallback;

    if (Array.isArray(arguments[0])) {
      modules = arguments[0];
      successCallback = isFunction(arguments[1]) ? arguments[1] : null;
      failureCallback = isFunction(arguments[2]) ? arguments[2] : null;
    } else {
      modules = [];

      for (var i = 0; i < arguments.length; ++i) {
        if (typeof arguments[i] === 'string') {
          modules[i] = arguments[i];
        } else if (isFunction(arguments[i])) {
          successCallback = arguments[i];
          failureCallback = isFunction(arguments[++i]) ? arguments[i] : null;
          break;
        }
      }
    }

    return function () {
      var args = [];

      for (var i = 0; i < arguments.length; ++i) {
        args.push(arguments[i]);
      }

      Liferay.Loader.require(modules, function () {
        for (var i = 0; i < arguments.length; ++i) {
          args.splice(i, 0, arguments[i]);
        }

        successCallback.apply(successCallback, args);
      }, failureCallback);
    };
  };
})(Liferay);
//# sourceMappingURL=lazy_load.js.map
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
Liferay = window.Liferay || {};

(function ($, Liferay) {
  var isFunction = function isFunction(val) {
    return typeof val === 'function';
  };

  var isNode = function isNode(node) {
    return node && (node._node || node.jquery || node.nodeType);
  };

  var REGEX_METHOD_GET = /^get$/i;
  var STR_MULTIPART = 'multipart/form-data';

  Liferay.namespace = function namespace(obj, path) {
    if (path === undefined) {
      path = obj;
      obj = this;
    }

    var parts = path.split('.');

    for (var part; parts.length && (part = parts.shift());) {
      if (obj[part] && obj[part] !== Object.prototype[part]) {
        obj = obj[part];
      } else {
        obj = obj[part] = {};
      }
    }

    return obj;
  };

  $.ajaxSetup({
    data: {},
    type: 'POST'
  });
  $.ajaxPrefilter(function (options) {
    if (options.crossDomain) {
      options.contents.script = false;
    }

    if (options.url) {
      options.url = Liferay.Util.getURLWithSessionId(options.url);
    }
  });
  var jqueryInit = $.prototype.init;

  $.prototype.init = function (selector, context, root) {
    if (selector === '#') {
      selector = '';
    }

    return new jqueryInit(selector, context, root);
  };

  $(document).on('show.bs.collapse', function (event) {
    var target = $(event.target);
    var ancestor = target.parents('.panel-group');

    if (target.hasClass('panel-collapse') && ancestor.length) {
      var openChildren = ancestor.find('.panel-collapse.in').not(target);

      if (openChildren.length && ancestor.find('[data-parent="#' + ancestor.attr('id') + '"]').length) {
        openChildren.removeClass('in');
      }
    }

    if (target.hasClass('in')) {
      target.addClass('show');
      target.removeClass('in');
      target.collapse('hide');
      return false;
    }
  });
  $(document).on('show.bs.dropdown', function () {
    Liferay.fire('dropdownShow', {
      src: 'BootstrapDropdown'
    });
  });
  Liferay.on('dropdownShow', function (event) {
    if (event.src !== 'BootstrapDropdown') {
      $('.dropdown.show .dropdown-toggle[data-toggle="dropdown"]').dropdown('toggle');
    }
  });
  /**
   * OPTIONS
   *
   * Required
   * service {string|object}: Either the service name, or an object with the keys as the service to call, and the value as the service configuration object.
   *
   * Optional
   * data {object|node|string}: The data to send to the service. If the object passed is the ID of a form or a form element, the form fields will be serialized and used as the data.
   * successCallback {function}: A function to execute when the server returns a response. It receives a JSON object as it's first parameter.
   * exceptionCallback {function}: A function to execute when the response from the server contains a service exception. It receives a the exception message as it's first parameter.
   */

  var Service = function Service() {
    var args = Service.parseInvokeArgs(Array.prototype.slice.call(arguments, 0));
    return Service.invoke.apply(Service, args);
  };

  Service.URL_INVOKE = themeDisplay.getPathContext() + '/api/jsonws/invoke';

  Service.bind = function () {
    var args = Array.prototype.slice.call(arguments, 0);
    return function () {
      var newArgs = Array.prototype.slice.call(arguments, 0);
      return Service.apply(Service, args.concat(newArgs));
    };
  };

  Service.parseInvokeArgs = function (args) {
    var instance = this;
    var payload = args[0];
    var ioConfig = instance.parseIOConfig(args);

    if (typeof payload === 'string') {
      payload = instance.parseStringPayload(args);
      instance.parseIOFormConfig(ioConfig, args);
      var lastArg = args[args.length - 1];

      if (_typeof(lastArg) === 'object' && lastArg.method) {
        ioConfig.method = lastArg.method;
      }
    }

    return [payload, ioConfig];
  };

  Service.parseIOConfig = function (args) {
    var payload = args[0];
    var ioConfig = payload.io || {};
    delete payload.io;

    if (!ioConfig.success) {
      var callbacks = args.filter(isFunction);
      var callbackException = callbacks[1];
      var callbackSuccess = callbacks[0];

      if (!callbackException) {
        callbackException = callbackSuccess;
      }

      ioConfig.complete = function (xhr) {
        var response = xhr.responseJSON;

        if (response !== null && !Object.prototype.hasOwnProperty.call(response, 'exception')) {
          if (callbackSuccess) {
            callbackSuccess.call(this, response);
          }
        } else if (callbackException) {
          var exception = response ? response.exception : 'The server returned an empty response';
          callbackException.call(this, exception, response);
        }
      };
    }

    if (!Object.prototype.hasOwnProperty.call(ioConfig, 'cache') && REGEX_METHOD_GET.test(ioConfig.type)) {
      ioConfig.cache = false;
    }

    if (Liferay.PropsValues.NTLM_AUTH_ENABLED && Liferay.Browser.isIe()) {
      ioConfig.type = 'GET';
    }

    return ioConfig;
  };

  Service.parseIOFormConfig = function (ioConfig, args) {
    var form = args[1];

    if (isNode(form)) {
      ioConfig.form = form;

      if (ioConfig.form.enctype == STR_MULTIPART) {
        ioConfig.contentType = false;
        ioConfig.processData = false;
      }
    }
  };

  Service.parseStringPayload = function (args) {
    var params = {};
    var payload = {};
    var config = args[1];

    if (!isFunction(config) && !isNode(config)) {
      params = config;
    }

    payload[args[0]] = params;
    return payload;
  };

  Service.invoke = function (payload, ioConfig) {
    var instance = this;
    var cmd = JSON.stringify(payload);
    var p_auth = Liferay.authToken;
    ioConfig = _objectSpread({
      data: {
        cmd: cmd,
        p_auth: p_auth
      },
      dataType: 'JSON'
    }, ioConfig);

    if (ioConfig.form) {
      if (ioConfig.form.enctype == STR_MULTIPART && isFunction(window.FormData)) {
        ioConfig.data = new FormData(ioConfig.form);
        ioConfig.data.append('cmd', cmd);
        ioConfig.data.append('p_auth', p_auth);
      } else {
        $(ioConfig.form).serializeArray().forEach(function (item) {
          ioConfig.data[item.name] = item.value;
        });
      }

      delete ioConfig.form;
    }

    return $.ajax(instance.URL_INVOKE, ioConfig);
  };

  function getHttpMethodFunction(httpMethodName) {
    return function () {
      var args = Array.prototype.slice.call(arguments, 0);
      var method = {
        method: httpMethodName
      };
      args.push(method);
      return Service.apply(Service, args);
    };
  }

  Service.get = getHttpMethodFunction('get');
  Service.del = getHttpMethodFunction('delete');
  Service.post = getHttpMethodFunction('post');
  Service.put = getHttpMethodFunction('put');
  Service.update = getHttpMethodFunction('update');
  Liferay.Service = Service;
  Liferay.Template = {
    PORTLET: '<div class="portlet"><div class="portlet-topper"><div class="portlet-title"></div></div><div class="portlet-content"></div><div class="forbidden-action"></div></div>'
  };
})(AUI.$, Liferay);

(function (A, Liferay) {
  A.mix(A.namespace('config.io'), {
    method: 'POST',
    uriFormatter: function uriFormatter(value) {
      return Liferay.Util.getURLWithSessionId(value);
    }
  }, true);
})(AUI(), Liferay);
//# sourceMappingURL=liferay.js.map
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (A, $, Liferay) {
  A.use('aui-base-lang');
  var AArray = A.Array;
  var Lang = A.Lang;
  var EVENT_CLICK = 'click';
  var MAP_TOGGLE_STATE = {
    "false": {
      cssClass: 'controls-hidden',
      iconCssClass: 'hidden',
      state: 'hidden'
    },
    "true": {
      cssClass: 'controls-visible',
      iconCssClass: 'view',
      state: 'visible'
    }
  };
  var REGEX_PORTLET_ID = /^(?:p_p_id)?_(.*)_.*$/;
  var REGEX_SUB = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g;
  var SRC_HIDE_LINK = {
    src: 'hideLink'
  };
  var STR_CHECKED = 'checked';
  var STR_RIGHT_SQUARE_BRACKET = ']';
  var TPL_LEXICON_ICON = '<svg class="lexicon-icon lexicon-icon-{0} {1}" focusable="false" role="image">' + '<use data-href="' + themeDisplay.getPathThemeImages() + '/lexicon/icons.svg#{0}" />' + '</svg>';
  var Window = {
    _map: {},
    getById: function getById(id) {
      var instance = this;
      return instance._map[id];
    }
  };
  var Util = {
    _defaultSubmitFormFn: function _defaultSubmitFormFn(event) {
      var form = event.form;
      var hasErrors = false;

      if (event.validate) {
        var liferayForm = Liferay.Form.get(form.attr('id'));

        if (liferayForm) {
          var validator = liferayForm.formValidator;

          if (A.instanceOf(validator, A.FormValidator)) {
            validator.validate();
            hasErrors = validator.hasErrors();

            if (hasErrors) {
              validator.focusInvalidField();
            }
          }
        }
      }

      if (!hasErrors) {
        var action = event.action || form.getAttribute('action');
        var singleSubmit = event.singleSubmit;
        var inputs = form.all('button[type=submit], input[type=button], input[type=image], input[type=reset], input[type=submit]');
        Util.disableFormButtons(inputs, form);

        if (singleSubmit === false) {
          Util._submitLocked = A.later(1000, Util, Util.enableFormButtons, [inputs, form]);
        } else {
          Util._submitLocked = true;
        }

        var baseURL;
        var queryString;
        var searchParamsIndex = action.indexOf('?');

        if (searchParamsIndex === -1) {
          baseURL = action;
          queryString = '';
        } else {
          baseURL = action.slice(0, searchParamsIndex);
          queryString = action.slice(searchParamsIndex + 1);
        }

        var searchParams = new URLSearchParams(queryString);
        var authToken = searchParams.get('p_auth') || '';

        if (authToken.includes('#')) {
          authToken = authToken.substring(0, authToken.indexOf('#'));
        }

        form.append('<input name="p_auth" type="hidden" value="' + authToken + '" />');

        if (authToken) {
          searchParams["delete"]('p_auth');
          action = baseURL + '?' + searchParams.toString();
        }

        form.attr('action', action);
        Util.submitForm(form);
        form.attr('target', '');
        Util._submitLocked = null;
      }
    },
    _getEditableInstance: function _getEditableInstance(title) {
      var editable = Util._EDITABLE;

      if (!editable) {
        editable = new A.Editable({
          after: {
            contentTextChange: function contentTextChange(event) {
              var instance = this;

              if (!event.initial) {
                var title = instance.get('node');
                var portletTitleEditOptions = title.getData('portletTitleEditOptions');
                Util.savePortletTitle({
                  doAsUserId: portletTitleEditOptions.doAsUserId,
                  plid: portletTitleEditOptions.plid,
                  portletId: portletTitleEditOptions.portletId,
                  title: event.newVal
                });
              }
            },
            startEditing: function startEditing() {
              var instance = this;
              var Layout = Liferay.Layout;

              if (Layout) {
                instance._dragListener = Layout.getLayoutHandler().on('drag:start', function () {
                  instance.fire('save');
                });
              }
            },
            stopEditing: function stopEditing() {
              var instance = this;

              if (instance._dragListener) {
                instance._dragListener.detach();
              }
            }
          },
          cssClass: 'lfr-portlet-title-editable',
          node: title
        });
        editable.get('cancelButton').icon = 'times';
        editable.get('saveButton').icon = 'check';
        Util._EDITABLE = editable;
      }

      return editable;
    },
    addInputCancel: function addInputCancel() {
      A.use('aui-button-search-cancel', function (A) {
        new A.ButtonSearchCancel({
          trigger: 'input[type=password], input[type=search], input.clearable, input.search-query'
        });
      });

      Util.addInputCancel = function () {};
    },
    addParams: function addParams(params, url) {
      if (_typeof(params) === 'object') {
        var paramKeys = Object.keys(params);
        params = paramKeys.map(function (key) {
          return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
        }).join('&');
      } else {
        params = String(params).trim();
      }

      var loc = url || location.href;
      var finalUrl = loc;

      if (params) {
        var anchorHash;

        if (loc.indexOf('#') > -1) {
          var locationPieces = loc.split('#');
          loc = locationPieces[0];
          anchorHash = locationPieces[1];
        }

        if (loc.indexOf('?') == -1) {
          params = '?' + params;
        } else {
          params = '&' + params;
        }

        if (loc.indexOf(params) == -1) {
          finalUrl = loc + params;

          if (anchorHash) {
            finalUrl += '#' + anchorHash;
          }

          if (!url) {
            location.href = finalUrl;
          }
        }
      }

      return finalUrl;
    },
    checkAll: function checkAll(form, name, allBox, selectClassName) {
      if (form) {
        form = Util.getDOM(form);
        allBox = Util.getDOM(allBox);
        var selector;

        if (Array.isArray(name)) {
          selector = 'input[name=' + name.join('], input[name=') + STR_RIGHT_SQUARE_BRACKET;
        } else {
          selector = 'input[name=' + name + STR_RIGHT_SQUARE_BRACKET;
        }

        form = $(form);
        var allBoxChecked = $(allBox).prop(STR_CHECKED);
        form.find(selector).each(function (index, item) {
          item = $(item);

          if (!item.prop('disabled')) {
            item.prop(STR_CHECKED, allBoxChecked);
          }
        });

        if (selectClassName) {
          form.find(selectClassName).toggleClass('info', allBoxChecked);
        }
      }
    },
    checkAllBox: function checkAllBox(form, name, allBox) {
      var totalOn = 0;

      if (form) {
        form = Util.getDOM(form);
        allBox = Util.getDOM(allBox);
        form = $(form);
        var allBoxNodes = $(allBox);

        if (!allBoxNodes.length) {
          allBoxNodes = form.find('input[name="' + allBox + '"]');
        }

        var totalBoxes = 0;
        var inputs = form.find('input[type=checkbox]');

        if (!Array.isArray(name)) {
          name = [name];
        }

        inputs.each(function (index, item) {
          item = $(item);

          if (!item.is(allBoxNodes) && name.indexOf(item.attr('name')) > -1) {
            totalBoxes++;

            if (item.prop(STR_CHECKED)) {
              totalOn++;
            }
          }
        });
        allBoxNodes.prop(STR_CHECKED, totalBoxes == totalOn);
      }

      return totalOn;
    },
    checkTab: function checkTab(box) {
      if (document.all && window.event.keyCode == 9) {
        box.selection = document.selection.createRange();
        setTimeout(function () {
          Util.processTab(box.id);
        }, 0);
      }
    },
    disableElements: function disableElements(el) {
      var currentElement = $(el)[0];

      if (currentElement) {
        var children = currentElement.getElementsByTagName('*');

        var emptyFnFalse = function emptyFnFalse() {
          return false;
        };

        for (var i = children.length - 1; i >= 0; i--) {
          var item = children[i];
          item.style.cursor = 'default';
          item.onclick = emptyFnFalse;
          item.onmouseover = emptyFnFalse;
          item.onmouseout = emptyFnFalse;
          item.onmouseenter = emptyFnFalse;
          item.onmouseleave = emptyFnFalse;
          item.action = '';
          item.disabled = true;
          item.href = 'javascript:;';
          item.onsubmit = emptyFnFalse;
          $(item).off();
        }
      }
    },
    disableEsc: function disableEsc() {
      if (document.all && window.event.keyCode == 27) {
        window.event.returnValue = false;
      }
    },
    disableFormButtons: function disableFormButtons(inputs, form) {
      inputs.attr('disabled', true);
      inputs.setStyle('opacity', 0.5);

      if (A.UA.gecko) {
        A.getWin().on('unload', function () {
          inputs.attr('disabled', false);
        });
      } else if (A.UA.safari) {
        A.use('node-event-html5', function (A) {
          A.getWin().on('pagehide', function () {
            Util.enableFormButtons(inputs, form);
          });
        });
      }
    },
    disableToggleBoxes: function disableToggleBoxes(checkBoxId, toggleBoxId, checkDisabled) {
      var checkBox = $('#' + checkBoxId);
      var toggleBox = $('#' + toggleBoxId);
      toggleBox.prop('disabled', checkDisabled && checkBox.prop(STR_CHECKED));
      checkBox.on(EVENT_CLICK, function () {
        toggleBox.prop('disabled', !toggleBox.prop('disabled'));
      });
    },
    enableFormButtons: function enableFormButtons(inputs) {
      Util._submitLocked = null;
      Util.toggleDisabled(inputs, false);
    },
    escapeCDATA: function escapeCDATA(str) {
      return str.replace(/<!\[CDATA\[|\]\]>/gi, function (match) {
        var str = '';

        if (match == ']]>') {
          str = ']]&gt;';
        } else if (match == '<![CDATA[') {
          str = '&lt;![CDATA[';
        }

        return str;
      });
    },
    focusFormField: function focusFormField(el) {
      var doc = $(document);
      var interacting = false;
      el = Util.getDOM(el);
      el = $(el);
      doc.on('click.focusFormField', function () {
        interacting = true;
        doc.off('click.focusFormField');
      });

      if (!interacting && Util.inBrowserView(el)) {
        var form = el.closest('form');
        var focusable = !el.is(':disabled') && !el.is(':hidden') && !el.parents(':disabled').length;

        if (!form.length || focusable) {
          el.focus();
        } else {
          var portletName = form.data('fm-namespace');
          var formReadyEventName = portletName + 'formReady';

          var formReadyHandler = function formReadyHandler(event) {
            var elFormName = form.attr('name');
            var formName = event.formName;

            if (elFormName === formName) {
              el.focus();
              Liferay.detach(formReadyEventName, formReadyHandler);
            }
          };

          Liferay.on(formReadyEventName, formReadyHandler);
        }
      }
    },
    forcePost: function forcePost(link) {
      link = Util.getDOM(link);
      link = $(link);

      if (link.length) {
        var url = link.attr('href'); // LPS-127302

        if (url === 'javascript:;') {
          return;
        }

        var newWindow = link.attr('target') == '_blank';
        var hrefFm = $(document.hrefFm);

        if (newWindow) {
          hrefFm.attr('target', '_blank');
        }

        submitForm(hrefFm, url, !newWindow);
        Util._submitLocked = null;
      }
    },
    getAttributes: function getAttributes(el, attributeGetter) {
      var result = null;

      if (el) {
        el = Util.getDOM(el);

        if (el.jquery) {
          el = el[0];
        }

        result = {};
        var getterFn = this.isFunction(attributeGetter);
        var getterString = typeof attributeGetter === 'string';
        var attrs = el.attributes;
        var length = attrs.length;

        while (length--) {
          var attr = attrs[length];
          var name = attr.nodeName.toLowerCase();
          var value = attr.nodeValue;

          if (getterString) {
            if (name.indexOf(attributeGetter) === 0) {
              name = name.substr(attributeGetter.length);
            } else {
              continue;
            }
          } else if (getterFn) {
            value = attributeGetter(value, name, attrs);

            if (value === false) {
              continue;
            }
          }

          result[name] = value;
        }
      }

      return result;
    },
    getColumnId: function getColumnId(str) {
      var columnId = str.replace(/layout-column_/, '');
      return columnId;
    },
    getDOM: function getDOM(el) {
      if (el._node || el._nodes) {
        el = el.getDOM();
      }

      return el;
    },
    getGeolocation: function getGeolocation(success, fallback, options) {
      if (success && navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function (position) {
          success(position.coords.latitude, position.coords.longitude, position);
        }, fallback, options);
      } else if (fallback) {
        fallback();
      }
    },
    getLexiconIcon: function getLexiconIcon(icon, cssClass) {
      var instance = this;
      return $(instance.getLexiconIconTpl(icon, cssClass))[0];
    },
    getLexiconIconTpl: function getLexiconIconTpl(icon, cssClass) {
      return Liferay.Util.sub(TPL_LEXICON_ICON, icon, cssClass || '');
    },
    getOpener: function getOpener() {
      var openingWindow = Window._opener;

      if (!openingWindow) {
        var topUtil = Liferay.Util.getTop().Liferay.Util;
        var windowName = Liferay.Util.getWindowName();
        var dialog = topUtil.Window.getById(windowName);

        if (dialog) {
          openingWindow = dialog._opener;
          Window._opener = openingWindow;
        }
      }

      return openingWindow || window.opener || window.parent;
    },
    getPortletId: function getPortletId(portletId) {
      return String(portletId).replace(REGEX_PORTLET_ID, '$1');
    },
    getTop: function getTop() {
      var topWindow = Util._topWindow;

      if (!topWindow) {
        var parentWindow = window.parent;
        var parentThemeDisplay;

        while (parentWindow != window) {
          try {
            if (typeof parentWindow.location.href == 'undefined') {
              break;
            }

            parentThemeDisplay = parentWindow.themeDisplay;
          } catch (e) {
            break;
          }

          if (!parentThemeDisplay || window.name === 'simulationDeviceIframe') {
            break;
          } else if (!parentThemeDisplay.isStatePopUp() || parentWindow == parentWindow.parent) {
            topWindow = parentWindow;
            break;
          }

          parentWindow = parentWindow.parent;
        }

        if (!topWindow) {
          topWindow = window;
        }

        Util._topWindow = topWindow;
      }

      return topWindow;
    },
    getURLWithSessionId: function getURLWithSessionId(url) {
      if (!themeDisplay.isAddSessionIdToURL()) {
        return url;
      } // LEP-4787


      var x = url.indexOf(';');

      if (x > -1) {
        return url;
      }

      var sessionId = ';jsessionid=' + themeDisplay.getSessionId();
      x = url.indexOf('?');

      if (x > -1) {
        return url.substring(0, x) + sessionId + url.substring(x);
      } // In IE6, http://www.abc.com;jsessionid=XYZ does not work, but
      // http://www.abc.com/;jsessionid=XYZ does work.


      x = url.indexOf('//');

      if (x > -1) {
        var y = url.lastIndexOf('/');

        if (x + 1 == y) {
          return url + '/' + sessionId;
        }
      }

      return url + sessionId;
    },
    getWindow: function getWindow(id) {
      if (!id) {
        id = Util.getWindowName();
      }

      return Util.getTop().Liferay.Util.Window.getById(id);
    },
    getWindowName: function getWindowName() {
      return window.name || Window._name || '';
    },
    getWindowWidth: function getWindowWidth() {
      return window.innerWidth > 0 ? window.innerWidth : screen.width;
    },
    inBrowserView: function inBrowserView(node, win, nodeRegion) {
      var viewable = false;
      node = $(node);

      if (node.length) {
        if (!nodeRegion) {
          nodeRegion = node.offset();
          nodeRegion.bottom = nodeRegion.top + node.outerHeight();
          nodeRegion.right = nodeRegion.left + node.outerWidth();
        }

        if (!win) {
          win = window;
        }

        win = $(win);
        var winRegion = {};
        winRegion.left = win.scrollLeft();
        winRegion.right = winRegion.left + win.width();
        winRegion.top = win.scrollTop();
        winRegion.bottom = winRegion.top + win.height();
        viewable = nodeRegion.bottom <= winRegion.bottom && nodeRegion.left >= winRegion.left && nodeRegion.right <= winRegion.right && nodeRegion.top >= winRegion.top;

        if (viewable) {
          var frameEl = $(win.prop('frameElement'));

          if (frameEl.length) {
            var frameOffset = frameEl.offset();
            var xOffset = frameOffset.left - winRegion.left;
            nodeRegion.left += xOffset;
            nodeRegion.right += xOffset;
            var yOffset = frameOffset.top - winRegion.top;
            nodeRegion.top += yOffset;
            nodeRegion.bottom += yOffset;
            viewable = Util.inBrowserView(node, win.prop('parent'), nodeRegion);
          }
        }
      }

      return viewable;
    },
    isFunction: function isFunction(val) {
      return typeof val === 'function';
    },
    isPhone: function isPhone() {
      var instance = this;
      return instance.getWindowWidth() < Liferay.BREAKPOINTS.PHONE;
    },
    isTablet: function isTablet() {
      var instance = this;
      return instance.getWindowWidth() < Liferay.BREAKPOINTS.TABLET;
    },
    listCheckboxesExcept: function listCheckboxesExcept(form, except, name, checked) {
      form = Util.getDOM(form);
      var selector = 'input[type=checkbox]';

      if (name) {
        selector += '[name=' + name + ']';
      }

      return $(form).find(selector).toArray().reduce(function (prev, item) {
        item = $(item);
        var val = item.val();

        if (val && item.attr('name') != except && item.prop('checked') == checked && !item.prop('disabled')) {
          prev.push(val);
        }

        return prev;
      }, []).join();
    },
    listCheckedExcept: function listCheckedExcept(form, except, name) {
      return Util.listCheckboxesExcept(form, except, name, true);
    },
    listSelect: function listSelect(select, delimeter) {
      select = Util.getDOM(select);
      return $(select).find('option').toArray().reduce(function (prev, item) {
        var val = $(item).val();

        if (val) {
          prev.push(val);
        }

        return prev;
      }, []).join(delimeter || ',');
    },
    listUncheckedExcept: function listUncheckedExcept(form, except, name) {
      return Util.listCheckboxesExcept(form, except, name, false);
    },
    normalizeFriendlyURL: function normalizeFriendlyURL(text) {
      var newText = text.replace(/[^a-zA-Z0-9_-]/g, '-');

      if (newText[0] === '-') {
        newText = newText.replace(/^-+/, '');
      }

      newText = newText.replace(/--+/g, '-');
      return newText.toLowerCase();
    },
    openInDialog: function openInDialog(event, config) {
      event.preventDefault();
      var currentTarget = Util.getDOM(event.currentTarget);
      currentTarget = $(currentTarget);
      config = A.mix(A.merge({}, currentTarget.data()), config);

      if (!config.uri) {
        config.uri = currentTarget.data('href') || currentTarget.attr('href');
      }

      if (!config.title) {
        config.title = currentTarget.attr('title');
      }

      Liferay.Util.openWindow(config);
    },
    openWindow: function openWindow(config, callback) {
      config.openingWindow = window;
      var top = Util.getTop();
      var topUtil = top.Liferay.Util;

      topUtil._openWindowProvider(config, callback);
    },
    processTab: function processTab(id) {
      document.all[id].selection.text = String.fromCharCode(9);
      document.all[id].focus();
    },
    randomInt: function randomInt() {
      return Math.ceil(Math.random() * new Date().getTime());
    },
    removeEntitySelection: function removeEntitySelection(entityIdString, entityNameString, removeEntityButton, namespace) {
      $('#' + namespace + entityIdString).val(0);
      $('#' + namespace + entityNameString).val('');
      Liferay.Util.toggleDisabled(removeEntityButton, true);
      Liferay.fire('entitySelectionRemoved');
    },
    reorder: function reorder(box, down) {
      box = Util.getDOM(box);
      box = $(box);

      if (box.prop('selectedIndex') == -1) {
        box.prop('selectedIndex', 0);
      } else {
        var selectedItems = box.find('option:selected');

        if (down) {
          selectedItems.get().reverse().forEach(function (item) {
            item = $(item);
            var itemIndex = item.prop('index');
            var lastIndex = box.find('option').length - 1;

            if (itemIndex === lastIndex) {
              box.prepend(item);
            } else {
              item.insertAfter(item.next());
            }
          });
        } else {
          selectedItems.get().forEach(function (item) {
            item = $(item);
            var itemIndex = item.prop('index');

            if (itemIndex === 0) {
              box.append(item);
            } else {
              item.insertBefore(item.prev());
            }
          });
        }
      }
    },
    rowCheckerCheckAllBox: function rowCheckerCheckAllBox(ancestorTable, ancestorRow, checkboxesIds, checkboxAllIds, cssClass) {
      Util.checkAllBox(ancestorTable, checkboxesIds, checkboxAllIds);

      if (ancestorRow) {
        ancestorRow.toggleClass(cssClass);
      }
    },
    savePortletTitle: function savePortletTitle(params) {
      params = _objectSpread({
        doAsUserId: 0,
        plid: 0,
        portletId: 0,
        title: '',
        url: themeDisplay.getPathMain() + '/portal/update_portlet_title'
      }, params);
      $.ajax(params.url, {
        data: {
          doAsUserId: params.doAsUserId,
          p_auth: Liferay.authToken,
          p_l_id: params.plid,
          portletId: params.portletId,
          title: params.title
        }
      });
    },
    selectEntityHandler: function selectEntityHandler(container, selectEventName, disableButton) {
      container = $(container);
      var openingLiferay = Util.getOpener().Liferay;
      var selectorButtons = container.find('.selector-button');
      container.on('click', '.selector-button', function (event) {
        var target = $(event.target);

        if (!target.attr('data-prevent-selection')) {
          var currentTarget = $(event.currentTarget);
          var confirmSelection = currentTarget.attr('data-confirm-selection') === 'true';
          var confirmSelectionMessage = currentTarget.attr('data-confirm-selection-message');

          if (!confirmSelection || confirm(confirmSelectionMessage)) {
            if (disableButton !== false) {
              selectorButtons.prop('disabled', false);
              currentTarget.prop('disabled', true);
            }

            var result = Util.getAttributes(currentTarget, 'data-');
            openingLiferay.fire(selectEventName, result);
            Util.getWindow().hide();
          }
        }
      });
      openingLiferay.on('entitySelectionRemoved', function () {
        selectorButtons.prop('disabled', false);
      });
    },
    selectFolder: function selectFolder(folderData, namespace) {
      $('#' + namespace + folderData.idString).val(folderData.idValue);
      var name = Liferay.Util.unescape(folderData.nameValue);
      $('#' + namespace + folderData.nameString).val(name);
      var button = $('#' + namespace + 'removeFolderButton');
      Liferay.Util.toggleDisabled(button, false);
    },
    setCursorPosition: function setCursorPosition(el, position) {
      var instance = this;
      instance.setSelectionRange(el, position, position);
    },
    setSelectionRange: function setSelectionRange(el, selectionStart, selectionEnd) {
      el = Util.getDOM(el);

      if (el.jquery) {
        el = el[0];
      }

      if (el.setSelectionRange) {
        el.focus();
        el.setSelectionRange(selectionStart, selectionEnd);
      } else if (el.createTextRange) {
        var textRange = el.createTextRange();
        textRange.collapse(true);
        textRange.moveEnd('character', selectionEnd);
        textRange.moveEnd('character', selectionStart);
        textRange.select();
      }
    },
    showCapsLock: function showCapsLock(event, span) {
      var keyCode = event.keyCode ? event.keyCode : event.which;
      var shiftKeyCode = keyCode === 16;
      var shiftKey = event.shiftKey ? event.shiftKey : shiftKeyCode;
      var display = 'none';

      if (keyCode >= 65 && keyCode <= 90 && !shiftKey || keyCode >= 97 && keyCode <= 122 && shiftKey) {
        display = '';
      }

      $('#' + span).css('display', display);
    },
    sortByAscending: function sortByAscending(a, b) {
      a = a[1].toLowerCase();
      b = b[1].toLowerCase();

      if (a > b) {
        return 1;
      }

      if (a < b) {
        return -1;
      }

      return 0;
    },
    sub: function sub(string, data) {
      if (arguments.length > 2 || _typeof(data) !== 'object' && typeof data !== 'function') {
        data = Array.prototype.slice.call(arguments, 1);
      }

      return string.replace ? string.replace(REGEX_SUB, function (match, key) {
        return data[key] === undefined ? match : data[key];
      }) : string;
    },
    submitCountdown: 0,
    submitForm: function submitForm(form) {
      form.submit();
    },
    toNumber: function toNumber(value) {
      return parseInt(value, 10) || 0;
    },
    toggleBoxes: function toggleBoxes(checkBoxId, toggleBoxId, displayWhenUnchecked, toggleChildCheckboxes) {
      var checkBox = $('#' + checkBoxId);
      var toggleBox = $('#' + toggleBoxId);
      var checked = checkBox.prop(STR_CHECKED);

      if (displayWhenUnchecked) {
        checked = !checked;
      }

      toggleBox.toggleClass('hide', !checked);
      checkBox.on(EVENT_CLICK, function () {
        toggleBox.toggleClass('hide');

        if (toggleChildCheckboxes) {
          var childCheckboxes = toggleBox.find('input[type=checkbox]');
          childCheckboxes.prop(STR_CHECKED, checkBox.prop(STR_CHECKED));
        }
      });
    },
    toggleDisabled: function toggleDisabled(button, state) {
      button = Util.getDOM(button);
      button = $(button);
      button.each(function (index, item) {
        item = $(item);
        item.prop('disabled', state);
        item.toggleClass('disabled', state);
      });
    },
    toggleRadio: function toggleRadio(radioId, showBoxIds, hideBoxIds) {
      var radioButton = $('#' + radioId);
      var showBoxes;

      if (showBoxIds) {
        if (Array.isArray(showBoxIds)) {
          showBoxIds = showBoxIds.join(',#');
        }

        showBoxes = $('#' + showBoxIds);
        showBoxes.toggleClass('hide', !radioButton.prop(STR_CHECKED));
      }

      radioButton.on('change', function () {
        if (showBoxes) {
          showBoxes.removeClass('hide');
        }

        if (hideBoxIds) {
          if (Array.isArray(hideBoxIds)) {
            hideBoxIds = hideBoxIds.join(',#');
          }

          $('#' + hideBoxIds).addClass('hide');
        }
      });
    },
    toggleSearchContainerButton: function toggleSearchContainerButton(buttonId, searchContainerId, form, ignoreFieldName) {
      $(searchContainerId).on(EVENT_CLICK, 'input[type=checkbox]', function () {
        Util.toggleDisabled(buttonId, !Util.listCheckedExcept(form, ignoreFieldName));
      });
    },
    toggleSelectBox: function toggleSelectBox(selectBoxId, value, toggleBoxId) {
      var selectBox = $('#' + selectBoxId);
      var toggleBox = $('#' + toggleBoxId);
      var dynamicValue = this.isFunction(value);

      var toggle = function toggle() {
        var currentValue = selectBox.val();
        var visible = value == currentValue;

        if (dynamicValue) {
          visible = value(currentValue, value);
        }

        toggleBox.toggleClass('hide', !visible);
      };

      toggle();
      selectBox.on('change', toggle);
    }
  };
  Liferay.provide(Util, 'afterIframeLoaded', function (event) {
    var nodeInstances = A.Node._instances;
    var docEl = event.doc;
    var docUID = docEl._yuid;

    if (docUID in nodeInstances) {
      delete nodeInstances[docUID];
    }

    var iframeDocument = A.one(docEl);
    var iframeBody = iframeDocument.one('body');
    var dialog = event.dialog;
    var lfrFormContent = iframeBody.one('.lfr-form-content');
    iframeBody.addClass('dialog-iframe-popup');

    if (lfrFormContent && iframeBody.one('.button-holder.dialog-footer')) {
      iframeBody.addClass('dialog-with-footer');
      var stagingAlert = iframeBody.one('.portlet-body > .lfr-portlet-message-staging-alert');

      if (stagingAlert) {
        stagingAlert.remove();
        lfrFormContent.prepend(stagingAlert);
      }
    }

    iframeBody.addClass(dialog.iframeConfig.bodyCssClass);
    event.win.focus();

    var detachEventHandles = function detachEventHandles() {
      AArray.invoke(eventHandles, 'detach');
      iframeDocument.purge(true);
    };

    var eventHandles = [iframeBody.delegate('submit', detachEventHandles, 'form'), iframeBody.delegate(EVENT_CLICK, function (event) {
      dialog.set('visible', false, event.currentTarget.hasClass('lfr-hide-dialog') ? SRC_HIDE_LINK : null);
      detachEventHandles();
    }, '.btn-cancel,.lfr-hide-dialog')];
  }, ['aui-base']);
  Liferay.provide(Util, 'openDDMPortlet', function (config, callback) {
    var defaultValues = {
      eventName: 'selectStructure'
    };
    config = A.merge(defaultValues, config);
    var params = {
      classNameId: config.classNameId,
      classPK: config.classPK,
      doAsGroupId: config.doAsGroupId || themeDisplay.getScopeGroupId(),
      eventName: config.eventName,
      groupId: config.groupId,
      mvcPath: config.mvcPath || '/view.jsp',
      p_p_state: 'pop_up',
      portletResourceNamespace: config.portletResourceNamespace,
      resourceClassNameId: config.resourceClassNameId,
      scopeTitle: config.title,
      structureAvailableFields: config.structureAvailableFields,
      templateId: config.templateId
    };

    if ('mode' in config) {
      params.mode = config.mode;
    }

    if ('navigationStartsOn' in config) {
      params.navigationStartsOn = config.navigationStartsOn;
    }

    if ('redirect' in config) {
      params.redirect = config.redirect;
    }

    if ('refererPortletName' in config) {
      params.refererPortletName = config.refererPortletName;
    }

    if ('refererWebDAVToken' in config) {
      params.refererWebDAVToken = config.refererWebDAVToken;
    }

    if ('searchRestriction' in config) {
      params.searchRestriction = config.searchRestriction;
      params.searchRestrictionClassNameId = config.searchRestrictionClassNameId;
      params.searchRestrictionClassPK = config.searchRestrictionClassPK;
    }

    if ('showAncestorScopes' in config) {
      params.showAncestorScopes = config.showAncestorScopes;
    }

    if ('showBackURL' in config) {
      params.showBackURL = config.showBackURL;
    }

    if ('showCacheableInput' in config) {
      params.showCacheableInput = config.showCacheableInput;
    }

    if ('showHeader' in config) {
      params.showHeader = config.showHeader;
    }

    if ('showManageTemplates' in config) {
      params.showManageTemplates = config.showManageTemplates;
    }

    var url = Liferay.Util.PortletURL.createRenderURL(config.basePortletURL, params);
    config.uri = url.toString();
    var dialogConfig = config.dialog;

    if (!dialogConfig) {
      dialogConfig = {};
      config.dialog = dialogConfig;
    }

    var eventHandles = [];

    if (callback) {
      eventHandles.push(Liferay.once(config.eventName, callback));
    }

    var detachSelectionOnHideFn = function detachSelectionOnHideFn(event) {
      Liferay.fire(config.eventName);

      if (!event.newVal) {
        new A.EventHandle(eventHandles).detach();
      }
    };

    Util.openWindow(config, function (dialogWindow) {
      eventHandles.push(dialogWindow.after(['destroy', 'visibleChange'], detachSelectionOnHideFn));
    });
  }, ['aui-base']);
  Liferay.provide(Util, 'openDocument', function (webDavUrl, onSuccess, onError) {
    if (A.UA.ie) {
      try {
        var executor = new A.config.win.ActiveXObject('SharePoint.OpenDocuments');
        executor.EditDocument(webDavUrl);

        if (Lang.isFunction(onSuccess)) {
          onSuccess();
        }
      } catch (e) {
        if (Lang.isFunction(onError)) {
          onError(e);
        }
      }
    }
  }, ['aui-base']);
  Liferay.provide(Util, 'portletTitleEdit', function (options) {
    var obj = options.obj;

    if (obj) {
      var title = obj.one('.portlet-title-text');

      if (title && !title.hasClass('not-editable')) {
        title.addClass('portlet-title-editable');
        title.on(EVENT_CLICK, function (event) {
          var editable = Util._getEditableInstance(title);

          var rendered = editable.get('rendered');

          if (rendered) {
            editable.fire('stopEditing');
          }

          editable.set('node', event.currentTarget);

          if (rendered) {
            editable.syncUI();
          }

          editable._startEditing(event);

          if (!rendered) {
            var defaultIconsTpl = A.ToolbarRenderer.prototype.TEMPLATES.icon;
            A.ToolbarRenderer.prototype.TEMPLATES.icon = Liferay.Util.getLexiconIconTpl('{cssClass}');

            editable._comboBox.icons.destroy();

            editable._comboBox._renderIcons();

            A.ToolbarRenderer.prototype.TEMPLATES.icon = defaultIconsTpl;
          }
        });
        title.setData('portletTitleEditOptions', options);
      }
    }
  }, ['aui-editable-deprecated']);
  Liferay.provide(Util, 'editEntity', function (config, callback) {
    var dialog = Util.getWindow(config.id);
    var eventName = config.eventName || config.id;
    var eventHandles = [Liferay.on(eventName, callback)];

    var detachSelectionOnHideFn = function detachSelectionOnHideFn(event) {
      if (!event.newVal) {
        new A.EventHandle(eventHandles).detach();
      }
    };

    if (dialog) {
      eventHandles.push(dialog.after(['destroy', 'visibleChange'], detachSelectionOnHideFn));
      dialog.show();
    } else {
      var destroyDialog = function destroyDialog(event) {
        var dialogId = config.id;
        var dialogWindow = Util.getWindow(dialogId);

        if (dialogWindow && Util.getPortletId(dialogId) === event.portletId) {
          dialogWindow.destroy();
          Liferay.detach('destroyPortlet', destroyDialog);
        }
      };

      var editURL = new Liferay.Util.PortletURL.createPortletURL(config.uri, A.merge({
        eventName: eventName
      }, config.urlParams));
      config.uri = editURL.toString();
      config.dialogIframe = A.merge({
        bodyCssClass: 'dialog-with-footer'
      }, config.dialogIframe || {});
      Util.openWindow(config, function (dialogWindow) {
        eventHandles.push(dialogWindow.after(['destroy', 'visibleChange'], detachSelectionOnHideFn));
        Liferay.on('destroyPortlet', destroyDialog);
      });
    }
  }, ['aui-base', 'liferay-util-window']);
  Liferay.provide(Util, 'selectEntity', function (config, callback) {
    var dialog = Util.getWindow(config.id);
    var eventName = config.eventName || config.id;
    var eventHandles = [Liferay.on(eventName, callback)];
    var selectedData = config.selectedData;

    if (selectedData) {
      config.dialog.destroyOnHide = true;
    }

    var detachSelectionOnHideFn = function detachSelectionOnHideFn(event) {
      if (!event.newVal) {
        new A.EventHandle(eventHandles).detach();
      }
    };

    var syncAssets = function syncAssets(event) {
      var currentWindow = event.currentTarget.node.get('contentWindow.document');
      var selectorButtons = currentWindow.all('.lfr-search-container-wrapper .selector-button');

      if (selectedData) {
        A.each(selectorButtons, function (item) {
          var assetEntryId = item.attr('data-entityid') || item.attr('data-entityname');
          var assetGroupId = item.attr('data-groupid');

          if (assetGroupId) {
            assetEntryId = assetGroupId + '-' + assetEntryId;
          }

          var disabled = selectedData.includes(assetEntryId);

          if (disabled) {
            item.attr('data-prevent-selection', true);
          } else {
            item.removeAttribute('data-prevent-selection');
          }

          Util.toggleDisabled(item, disabled);
        });
      }
    };

    if (dialog) {
      eventHandles.push(dialog.after(['destroy', 'visibleChange'], detachSelectionOnHideFn));
      dialog.show();
    } else {
      var destroyDialog = function destroyDialog(event) {
        var dialogId = config.id;
        var dialogWindow = Util.getWindow(dialogId);

        if (dialogWindow && Util.getPortletId(dialogId) === event.portletId) {
          dialogWindow.destroy();
          Liferay.detach('destroyPortlet', destroyDialog);
        }
      };

      Util.openWindow(config, function (dialogWindow) {
        eventHandles.push(dialogWindow.after(['destroy', 'visibleChange'], detachSelectionOnHideFn), dialogWindow.iframe.after(['load'], syncAssets));
        Liferay.on('destroyPortlet', destroyDialog);
      });
    }
  }, ['aui-base', 'liferay-util-window']);
  Liferay.provide(Util, 'toggleControls', function (node) {
    var docBody = A.getBody();
    node = node || docBody;
    var trigger = node.one('.toggle-controls');

    if (trigger) {
      var controlsVisible = Liferay._editControlsState === 'visible';
      var currentState = MAP_TOGGLE_STATE[controlsVisible];
      var icon = trigger.one('.lexicon-icon');

      if (icon) {
        currentState.icon = icon;
      }

      docBody.addClass(currentState.cssClass);
      Liferay.fire('toggleControls', {
        enabled: controlsVisible
      });
      trigger.on('tap', function () {
        controlsVisible = !controlsVisible;
        var prevState = currentState;
        currentState = MAP_TOGGLE_STATE[controlsVisible];
        docBody.toggleClass(prevState.cssClass);
        docBody.toggleClass(currentState.cssClass);
        var editControlsIconClass = currentState.iconCssClass;
        var editControlsState = currentState.state;

        if (icon) {
          var newIcon = currentState.icon;

          if (!newIcon) {
            newIcon = Util.getLexiconIcon(editControlsIconClass);
            newIcon = A.one(newIcon);
            currentState.icon = newIcon;
          }

          icon.replace(newIcon);
          icon = newIcon;
        }

        Liferay._editControlsState = editControlsState;
        Liferay.Util.Session.set('com.liferay.frontend.js.web_toggleControls', editControlsState);
        Liferay.fire('toggleControls', {
          enabled: controlsVisible,
          src: 'ui'
        });
      });
    }
  }, ['event-tap']);
  Liferay.provide(window, 'submitForm', function (form, action, singleSubmit, validate) {
    if (!Util._submitLocked) {
      if (form.jquery) {
        form = form[0];
      }

      Liferay.fire('submitForm', {
        action: action,
        form: A.one(form),
        singleSubmit: singleSubmit,
        validate: validate !== false
      });
    }
  }, ['aui-base', 'aui-form-validator', 'aui-url', 'liferay-form']);
  Liferay.publish('submitForm', {
    defaultFn: Util._defaultSubmitFormFn
  });
  Liferay.provide(Util, '_openWindowProvider', function (config, callback) {
    var dialog = Window.getWindow(config);

    if (Lang.isFunction(callback)) {
      callback(dialog);
    }
  }, ['liferay-util-window']);
  Liferay.after('closeWindow', function (event) {
    var id = event.id;
    var dialog = Liferay.Util.getTop().Liferay.Util.Window.getById(id);

    if (dialog && dialog.iframe) {
      var dialogWindow = dialog.iframe.node.get('contentWindow').getDOM();
      var openingWindow = dialogWindow.Liferay.Util.getOpener();
      var redirect = event.redirect;

      if (redirect) {
        openingWindow.Liferay.Util.navigate(redirect);
      } else {
        var refresh = event.refresh;

        if (refresh && openingWindow) {
          var data;

          if (!event.portletAjaxable) {
            data = {
              portletAjaxable: false
            };
          }

          openingWindow.Liferay.Portlet.refresh('#p_p_id_' + refresh + '_', data);
        }
      }

      dialog.hide();
    }
  });
  Util.Window = Window;
  Liferay.Util = Util;
  Liferay.BREAKPOINTS = {
    PHONE: 768,
    TABLET: 980
  };
  Liferay.STATUS_CODE = {
    BAD_REQUEST: 400,
    INTERNAL_SERVER_ERROR: 500,
    OK: 200,
    SC_DUPLICATE_FILE_EXCEPTION: 490,
    SC_FILE_ANTIVIRUS_EXCEPTION: 494,
    SC_FILE_CUSTOM_EXCEPTION: 499,
    SC_FILE_EXTENSION_EXCEPTION: 491,
    SC_FILE_NAME_EXCEPTION: 492,
    SC_FILE_SIZE_EXCEPTION: 493,
    SC_UPLOAD_REQUEST_SIZE_EXCEPTION: 495
  }; // 0-200: Theme Developer
  // 200-400: Portlet Developer
  // 400+: Liferay

  Liferay.zIndex = {
    ALERT: 430,
    DOCK: 10,
    DOCK_PARENT: 20,
    DRAG_ITEM: 460,
    DROP_AREA: 440,
    DROP_POSITION: 450,
    MENU: 5000,
    OVERLAY: 1000,
    POPOVER: 1600,
    TOOLTIP: 10000,
    WINDOW: 1200
  };
})(AUI(), AUI.$, Liferay);
//# sourceMappingURL=util.js.map
!function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/o/frontend-js-web/liferay/",n(n.s=43)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.string=t.object=t.Disposable=t.async=t.array=void 0;var r=n(24);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=l(r),i=l(n(25)),a=l(n(26)),u=l(n(29)),c=l(n(30)),s=l(n(31));function l(e){return e&&e.__esModule?e:{default:e}}t.array=i.default,t.async=a.default,t.Disposable=u.default,t.object=c.default,t.string=s.default,t.default=o.default},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return f})),n.d(t,"e",(function(){return y})),n.d(t,"f",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"h",(function(){return g})),n.d(t,"i",(function(){return _}));var r=n(0);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a=function(e,t){var n=e&&e.portlets?e.portlets:{};try{var r=JSON.parse(t);if(r.portlets)Object.keys(n).forEach((function(t){var o=r.portlets[t].state,i=n[t].state;if(!o||!i)throw new Error("Invalid update string.\nold state=".concat(i,"\nnew state=").concat(o));v(e,o,t)&&(n[t]=r.portlets[t])}))}catch(e){}return n},u=function(e,t){var n="";return Array.isArray(t)&&(0===t.length?n+="&"+encodeURIComponent(e)+"=":t.forEach((function(t){n+="&"+encodeURIComponent(e),n+=null===t?"=":"="+encodeURIComponent(t)}))),n},c=function(e,t,n){var r={credentials:"same-origin",method:"POST",url:t};if(n)if("multipart/form-data"===n.enctype){var o=new FormData(n);r.body=o}else{var a=function(e,t){for(var n=[],r=function(r){var o=t.elements[r],a=o.name,u=o.nodeName.toUpperCase(),c="INPUT"===u?o.type.toUpperCase():"",s=o.value;if(a&&!o.disabled&&"FILE"!==c)if("SELECT"===u&&o.multiple)i(o.options).forEach((function(t){if(t.checked){var r=t.value,o=encodeURIComponent(e+a)+"="+encodeURIComponent(r);n.push(o)}}));else if("CHECKBOX"!==c&&"RADIO"!==c||o.checked){var l=encodeURIComponent(e+a)+"="+encodeURIComponent(s);n.push(l)}},o=0;o<t.elements.length;o++)r(o);return n.join("&")}(e,n);"GET"===(n.method?n.method.toUpperCase():"GET")?(t.indexOf("?")>=0?t+="&".concat(a):t+="?".concat(a),r.url=t):(r.body=a,r.headers={"Content-Type":"application/x-www-form-urlencoded"})}return r},s=function(e,t,n,r,o){var i="";if(e.portlets&&e.portlets[t]){var a=e.portlets[t];if(a&&a.state&&a.state.parameters){var c=a.state.parameters[n];void 0!==c&&(i+=u("p_r_p_"===r?o:"priv_r_p_"===r?t+"priv_r_p_"+n:t+n,c))}}return i},l=function(e,t,n){var r={};if(e&&e.portlets){var o=e.portlets[t];if(o&&o.pubParms){var i=o.pubParms;Object.keys(i).forEach((function(o){if(!d(e,t,n,o)){var a=i[o];r[a]=n.parameters[o]}}))}}return r},f=function(e,t,n,r,o,i){var a="cacheLevelPage",c="",l="";if(e&&e.portlets){"RENDER"===t&&void 0===n&&(n=null);var f=e.portlets[n];if(f&&("RESOURCE"===t?(l=decodeURIComponent(f.encodedResourceURL),o&&(a=o),l+="&p_p_cacheability="+encodeURIComponent(a),i&&(l+="&p_p_resource_id="+encodeURIComponent(i))):"RENDER"===t&&null!==n?l=decodeURIComponent(f.encodedRenderURL):"RENDER"===t?l=decodeURIComponent(e.encodedCurrentURL):"ACTION"===t?(l=decodeURIComponent(f.encodedActionURL),l+="&p_p_hub="+encodeURIComponent("0")):"PARTIAL_ACTION"===t&&(l=decodeURIComponent(f.encodedActionURL),l+="&p_p_hub="+encodeURIComponent("1")),"RESOURCE"!==t||"cacheLevelFull"!==a)){if(n&&(l+=function(e,t){var n="";if(e.portlets){var r=e.portlets[t];if(r.state){var o=r.state;n+="&p_p_mode="+encodeURIComponent(o.portletMode),n+="&p_p_state="+encodeURIComponent(o.windowState)}}return n}(e,n)),n&&(c="",f.state&&f.state.parameters)){var p=f.state.parameters;Object.keys(p).forEach((function(t){h(e,n,t)||(c+=s(e,n,t,"priv_r_p_"))})),l+=c}if(e.prpMap){c="";var d={};Object.keys(e.prpMap).forEach((function(t){Object.keys(e.prpMap[t]).forEach((function(n){var r=e.prpMap[t][n].split("|");Object.hasOwnProperty.call(d,t)||(d[t]=s(e,r[0],r[1],"p_r_p_",t),c+=d[t])}))})),l+=c}}}r&&(c="",Object.keys(r).forEach((function(e){c+=u(n+e,r[e])})),l+=c);return Promise.resolve(l)},p=function(e,t){var n=!1;void 0===e&&void 0===t&&(n=!0),void 0!==e&&void 0!==t||(n=!1),e.length!==t.length&&(n=!1);for(var r=e.length-1;r>=0;r--)e[r]!==t[r]&&(n=!1);return n},d=function(e,t,n,r){var o=!1;if(e&&e.portlets){var i=e.portlets[t];if(n.parameters[r]&&i.state.parameters[r]){var a=n.parameters[r],u=i.state.parameters[r];o=p(a,u)}}return o},h=function(e,t,n){var r=!1;if(e&&e.portlets){var o=e.portlets[t];if(o&&o.pubParms)r=Object.keys(o.pubParms).includes(n)}return r},v=function(e,t,n){var r=!1;if(e&&e.portlets&&e.portlets[n]){var o=e.portlets[n].state;if(!t.portletMode||!t.windowState||!t.parameters)throw new Error("Error decoding state: ".concat(t));if(t.porletMode!==o.portletMode||t.windowState!==o.windowState)r=!0;else Object.keys(t.parameters).forEach((function(e){var n=t.parameters[e],i=o.parameters[e];p(n,i)||(r=!0)})),Object.keys(o.parameters).forEach((function(e){t.parameters[e]||(r=!0)}))}return r},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(e.length<t)throw new TypeError("Too few arguments provided: Number of arguments: ".concat(e.length));if(e.length>n)throw new TypeError("Too many arguments provided: ".concat([].join.call(e,", ")));if(Array.isArray(r))for(var i=Math.min(e.length,r.length)-1;i>=0;i--){if(o(e[i])!==r[i])throw new TypeError("Parameter ".concat(i," is of type ").concat(o(e[i])," rather than the expected type ").concat(r[i]));if(null===e[i]||void 0===e[i])throw new TypeError("Argument is ".concat(o(e[i])))}},b=function(e){if(!(e instanceof HTMLFormElement))throw new TypeError("Element must be an HTMLFormElement");var t=e.method?e.method.toUpperCase():void 0;if(t&&"GET"!==t&&"POST"!==t)throw new TypeError("Invalid form method ".concat(t,". Allowed methods are GET & POST"));var n=e.enctype;if(n&&"application/x-www-form-urlencoded"!==n&&"multipart/form-data"!==n)throw new TypeError("Invalid form enctype ".concat(n,". Allowed: 'application/x-www-form-urlencoded' & 'multipart/form-data'"));if(n&&"multipart/form-data"===n&&"POST"!==t)throw new TypeError("Invalid method with multipart/form-data. Must be POST");if(!n||"application/x-www-form-urlencoded"===n)for(var r=e.elements.length,o=0;o<r;o++)if("INPUT"===e.elements[o].nodeName.toUpperCase()&&"FILE"===e.elements[o].type.toUpperCase())throw new TypeError("Must use enctype = 'multipart/form-data' with input type FILE.")},m=function(e){if(!Object(r.isDefAndNotNull)(e))throw new TypeError("The parameter object is: ".concat(o(e)));Object.keys(e).forEach((function(t){if(!Array.isArray(e[t]))throw new TypeError("".concat(t," parameter is not an array"));if(!e[t].length)throw new TypeError("".concat(t," parameter is an empty array"))}))},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.portlets&&Object.keys(e.portlets).includes(t)},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(e.parameters);var n=e.portletMode;if(!Object(r.isString)(n))throw new TypeError("Invalid parameters. portletMode is ".concat(o(n)));var i=t.allowedPM;if(!i.includes(n.toLowerCase()))throw new TypeError("Invalid portletMode=".concat(n," is not in ").concat(i));var a=e.windowState;if(!Object(r.isString)(a))throw new TypeError("Invalid parameters. windowState is ".concat(o(a)));var u=t.allowedWS;if(!u.includes(a.toLowerCase()))throw new TypeError("Invalid windowState=".concat(a," is not in ").concat(u))}},function(e,t,n){"use strict";t.a={EDIT:"edit",HELP:"help",VIEW:"view",MAXIMIZED:"maximized",MINIMIZED:"minimized",NORMAL:"normal",FULL:"cacheLevelFull",PAGE:"cacheLevelPage",PORTLET:"cacheLevelPortlet"}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return u}));var a={credentials:"include"};function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Headers({"x-csrf-token":Liferay.authToken});new Headers(t.headers||{}).forEach((function(e,t){n.set(t,e)}));var r=o({},a,{},t);return r.headers=n,fetch(e,r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dom=void 0;var r=n(37);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r);t.default=o,t.dom=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventHandler=t.EventHandle=t.EventEmitterProxy=t.EventEmitter=void 0;var r=u(n(34)),o=u(n(35)),i=u(n(13)),a=u(n(36));function u(e){return e&&e.__esModule?e:{default:e}}t.default=r.default,t.EventEmitter=r.default,t.EventEmitterProxy=o.default,t.EventHandle=i.default,t.EventHandler=a.default},function(e,t,n){(function(t){var n=/^\[object .+?Constructor\]$/,r="object"==typeof t&&t&&t.Object===Object&&t,o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();var a,u=Array.prototype,c=Function.prototype,s=Object.prototype,l=i["__core-js_shared__"],f=(a=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"",p=c.toString,d=s.hasOwnProperty,h=s.toString,v=RegExp("^"+p.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=u.splice,b=S(i,"Map"),m=S(Object,"create");function g(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function O(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function j(e){return!(!k(e)||(t=e,f&&f in t))&&(function(e){var t=k(e)?h.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?v:n).test(function(e){if(null!=e){try{return p.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function E(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function S(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}function P(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(P.Cache||w),n}function k(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}g.prototype.clear=function(){this.__data__=m?m(null):{}},g.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},g.prototype.get=function(e){var t=this.__data__;if(m){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return d.call(t,e)?t[e]:void 0},g.prototype.has=function(e){var t=this.__data__;return m?void 0!==t[e]:d.call(t,e)},g.prototype.set=function(e,t){return this.__data__[e]=m&&void 0===t?"__lodash_hash_undefined__":t,this},_.prototype.clear=function(){this.__data__=[]},_.prototype.delete=function(e){var t=this.__data__,n=O(t,e);return!(n<0)&&(n==t.length-1?t.pop():y.call(t,n,1),!0)},_.prototype.get=function(e){var t=this.__data__,n=O(t,e);return n<0?void 0:t[n][1]},_.prototype.has=function(e){return O(this.__data__,e)>-1},_.prototype.set=function(e,t){var n=this.__data__,r=O(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},w.prototype.clear=function(){this.__data__={hash:new g,map:new(b||_),string:new g}},w.prototype.delete=function(e){return E(this,e).delete(e)},w.prototype.get=function(e){return E(this,e).get(e)},w.prototype.has=function(e){return E(this,e).has(e)},w.prototype.set=function(e,t){return E(this,e).set(e,t),this},P.Cache=w,e.exports=P}).call(this,n(3))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0);var i="__metal_data__",a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"get",value:function(e,t,n){return e[i]||(e[i]={}),t?(!(0,o.isDef)(e[i][t])&&(0,o.isDef)(n)&&(e[i][t]=n),e[i][t]):e[i]}},{key:"has",value:function(e){return!!e[i]}},{key:"set",value:function(e,t,n){return e[i]||(e[i]={}),t&&(0,o.isDef)(n)?(e[i][t]=n,e[i][t]):e[i]}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(0),o=n(2);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Object(r.isObject)(t)?this.from(t):(this.parameters={},this.portletMode=o.a.VIEW,this.windowState=o.a.NORMAL)}var t,n,a;return t=e,(n=[{key:"clone",value:function(){return new e(this)}},{key:"from",value:function(e){var t=this;this.parameters={},Object.keys(e.parameters).forEach((function(n){Object.hasOwnProperty.call(e.parameters,n)&&Array.isArray(e.parameters[n])&&(t.parameters[n]=e.parameters[n].slice(0))})),this.setPortletMode(e.portletMode),this.setWindowState(e.windowState)}},{key:"getPortletMode",value:function(){return this.portletMode}},{key:"getValue",value:function(e,t){if(!Object(r.isString)(e))throw new TypeError("Parameter name must be a string");var n=this.parameters[e];return Array.isArray(n)&&(n=n[0]),void 0===n&&void 0!==t&&(n=t),n}},{key:"getValues",value:function(e,t){if(!Object(r.isString)(e))throw new TypeError("Parameter name must be a string");var n=this.parameters[e];return n||t}},{key:"getWindowState",value:function(){return this.windowState}},{key:"remove",value:function(e){if(!Object(r.isString)(e))throw new TypeError("Parameter name must be a string");void 0!==this.parameters[e]&&delete this.parameters[e]}},{key:"setPortletMode",value:function(e){if(!Object(r.isString)(e))throw new TypeError("Portlet Mode must be a string");e!==o.a.EDIT&&e!==o.a.HELP&&e!==o.a.VIEW||(this.portletMode=e)}},{key:"setValue",value:function(e,t){if(!Object(r.isString)(e))throw new TypeError("Parameter name must be a string");if(!Object(r.isString)(t)&&null!==t&&!Array.isArray(t))throw new TypeError("Parameter value must be a string, an array or null");Array.isArray(t)||(t=[t]),this.parameters[e]=t}},{key:"setValues",value:function(e,t){this.setValue(e,t)}},{key:"setWindowState",value:function(e){if(!Object(r.isString)(e))throw new TypeError("Window State must be a string");e!==o.a.MAXIMIZED&&e!==o.a.MINIMIZED&&e!==o.a.NORMAL||(this.windowState=e)}}])&&i(t.prototype,n),a&&i(t,a),e}();t.a=a},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.abstractMethod=function(){throw Error("Unimplemented abstract method")},t.disableCompatibilityMode=function(){r=void 0},t.enableCompatibilityMode=a,t.getCompatibilityModeData=function(){void 0===r&&"undefined"!=typeof window&&window.__METAL_COMPATIBILITY__&&a(window.__METAL_COMPATIBILITY__);return r},t.getFunctionName=function(e){if(!e.name){var t=e.toString();e.name=t.substring(9,t.indexOf("("))}return e.name},t.getStaticProperty=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u,o=n+"_MERGED";if(!t.hasOwnProperty(o)){var i=t.hasOwnProperty(n)?t[n]:null;t.__proto__&&!t.__proto__.isPrototypeOf(Function)&&(i=r(i,e(t.__proto__,n,r))),t[o]=i}return t[o]},t.getUid=function(e,t){if(e){var n=e[i];return t&&!e.hasOwnProperty(i)&&(n=null),n||(e[i]=o++)}return o++},t.identityFunction=function(e){return e},t.isBoolean=function(e){return"boolean"==typeof e},t.isDef=c,t.isDefAndNotNull=function(e){return c(e)&&!s(e)},t.isDocument=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&9===e.nodeType},t.isDocumentFragment=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&11===e.nodeType},t.isElement=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&1===e.nodeType},t.isFunction=function(e){return"function"==typeof e},t.isNull=s,t.isNumber=function(e){return"number"==typeof e},t.isWindow=function(e){return null!==e&&e===e.window},t.isObject=function(e){var t=void 0===e?"undefined":n(e);return"object"===t&&null!==e||"function"===t},t.isPromise=function(e){return e&&"object"===(void 0===e?"undefined":n(e))&&"function"==typeof e.then},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isServerSide=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{checkEnv:!0},n=void 0!==e&&!e.browser;n&&t.checkEnv&&(n=void 0!==e.env&&!0);return n},t.nullFunction=function(){};var r=void 0,o=1,i=t.UID_PROPERTY="core_"+(1e9*Math.random()>>>0);function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r=e}function u(e,t){return e||t}function c(e){return void 0!==e}function s(e){return null===e}}).call(this,n(12))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,s=[],l=!1,f=-1;function p(){l&&c&&(l=!1,c.length?s=c.concat(s):f=-1,s.length&&d())}function d(){if(!l){var e=u(p);l=!0;for(var t=s.length;t;){for(c=s,s=[];++f<t;)c&&c[f].run();f=-1,t=s.length}c=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new h(e,t)),1!==s.length||l||u(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){function t(e,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.emitter_=e,o.event_=n,o.listener_=r,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"disposeInternal",value:function(){this.removeListener(),this.emitter_=null,this.listener_=null}},{key:"removeListener",value:function(){this.emitter_.isDisposed()||this.emitter_.removeListener(this.event_,this.listener_)}}]),t}(n(0).Disposable);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return i.capture_=o,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"removeListener",value:function(){this.emitter_.removeEventListener(this.event_,this.listener_,this.capture_)}}]),t}(n(6).EventHandle);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5),i=n(0);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"checkAnimationEventName",value:function(){return void 0===e.animationEventName_&&(e.animationEventName_={animation:e.checkAnimationEventName_("animation"),transition:e.checkAnimationEventName_("transition")}),e.animationEventName_}},{key:"checkAnimationEventName_",value:function(t){var n=["Webkit","MS","O",""],r=i.string.replaceInterval(t,0,1,t.substring(0,1).toUpperCase()),o=[r+"End",r+"End",r+"End",t+"end"];e.animationElement_||(e.animationElement_=document.createElement("div"));for(var a=0;a<n.length;a++)if(void 0!==e.animationElement_.style[n[a]+r])return n[a].toLowerCase()+o[a];return t+"end"}},{key:"checkAttrOrderChange",value:function(){if(void 0===e.attrOrderChange_){var t=document.createElement("div");(0,o.append)(t,'<div data-component="" data-ref=""></div>'),e.attrOrderChange_='<div data-component="" data-ref=""></div>'!==t.innerHTML}return e.attrOrderChange_}}]),e}();a.animationElement_=void 0,a.animationEventName_=void 0,a.attrOrderChange_=void 0,t.default=a},function(e,t,n){(function(t){var n=/[&<>"'`]/g,r=RegExp(n.source),o="object"==typeof t&&t&&t.Object===Object&&t,i="object"==typeof self&&self&&self.Object===Object&&self,a=o||i||Function("return this")();var u,c=(u={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(e){return null==u?void 0:u[e]}),s=Object.prototype.toString,l=a.Symbol,f=l?l.prototype:void 0,p=f?f.toString:void 0;function d(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}e.exports=function(e){var t;return(e=null==(t=e)?"":d(t))&&r.test(e)?e.replace(n,c):e}}).call(this,n(3))},function(e,t,n){(function(e,n){var r="[object Arguments]",o="[object Map]",i="[object Object]",a="[object Set]",u=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,s=/^\./,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,d=/^(?:0|[1-9]\d*)$/,h={};h["[object Float32Array]"]=h["[object Float64Array]"]=h["[object Int8Array]"]=h["[object Int16Array]"]=h["[object Int32Array]"]=h["[object Uint8Array]"]=h["[object Uint8ClampedArray]"]=h["[object Uint16Array]"]=h["[object Uint32Array]"]=!0,h[r]=h["[object Array]"]=h["[object ArrayBuffer]"]=h["[object Boolean]"]=h["[object DataView]"]=h["[object Date]"]=h["[object Error]"]=h["[object Function]"]=h[o]=h["[object Number]"]=h[i]=h["[object RegExp]"]=h[a]=h["[object String]"]=h["[object WeakMap]"]=!1;var v="object"==typeof e&&e&&e.Object===Object&&e,y="object"==typeof self&&self&&self.Object===Object&&self,b=v||y||Function("return this")(),m=t&&!t.nodeType&&t,g=m&&"object"==typeof n&&n&&!n.nodeType&&n,_=g&&g.exports===m&&v.process,w=function(){try{return _&&_.binding("util")}catch(e){}}(),O=w&&w.isTypedArray;function j(e,t,n,r){for(var o=-1,i=e?e.length:0;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function E(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function S(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function P(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function k(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var T,A,L,I=Array.prototype,x=Function.prototype,C=Object.prototype,M=b["__core-js_shared__"],D=(T=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",R=x.toString,U=C.hasOwnProperty,N=C.toString,F=RegExp("^"+R.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=b.Symbol,q=b.Uint8Array,z=C.propertyIsEnumerable,B=I.splice,W=(A=Object.keys,L=Object,function(e){return A(L(e))}),$=Pe(b,"DataView"),V=Pe(b,"Map"),G=Pe(b,"Promise"),Q=Pe(b,"Set"),K=Pe(b,"WeakMap"),X=Pe(Object,"create"),J=Me($),Y=Me(V),Z=Me(G),ee=Me(Q),te=Me(K),ne=H?H.prototype:void 0,re=ne?ne.valueOf:void 0,oe=ne?ne.toString:void 0;function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ue(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ce(e){var t=-1,n=e?e.length:0;for(this.__data__=new ue;++t<n;)this.add(e[t])}function se(e){this.__data__=new ae(e)}function le(e,t){var n=qe(e)||He(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,o=!!r;for(var i in e)!t&&!U.call(e,i)||o&&("length"==i||Te(i,r))||n.push(i);return n}function fe(e,t){for(var n=e.length;n--;)if(Fe(e[n][0],t))return n;return-1}function pe(e,t,n,r){return ve(e,(function(e,o,i){t(r,e,n(e),i)})),r}ie.prototype.clear=function(){this.__data__=X?X(null):{}},ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ie.prototype.get=function(e){var t=this.__data__;if(X){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return U.call(t,e)?t[e]:void 0},ie.prototype.has=function(e){var t=this.__data__;return X?void 0!==t[e]:U.call(t,e)},ie.prototype.set=function(e,t){return this.__data__[e]=X&&void 0===t?"__lodash_hash_undefined__":t,this},ae.prototype.clear=function(){this.__data__=[]},ae.prototype.delete=function(e){var t=this.__data__,n=fe(t,e);return!(n<0)&&(n==t.length-1?t.pop():B.call(t,n,1),!0)},ae.prototype.get=function(e){var t=this.__data__,n=fe(t,e);return n<0?void 0:t[n][1]},ae.prototype.has=function(e){return fe(this.__data__,e)>-1},ae.prototype.set=function(e,t){var n=this.__data__,r=fe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ue.prototype.clear=function(){this.__data__={hash:new ie,map:new(V||ae),string:new ie}},ue.prototype.delete=function(e){return Se(this,e).delete(e)},ue.prototype.get=function(e){return Se(this,e).get(e)},ue.prototype.has=function(e){return Se(this,e).has(e)},ue.prototype.set=function(e,t){return Se(this,e).set(e,t),this},ce.prototype.add=ce.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ce.prototype.has=function(e){return this.__data__.has(e)},se.prototype.clear=function(){this.__data__=new ae},se.prototype.delete=function(e){return this.__data__.delete(e)},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ae){var r=n.__data__;if(!V||r.length<199)return r.push([e,t]),this;n=this.__data__=new ue(r)}return n.set(e,t),this};var de,he,ve=(de=function(e,t){return e&&ye(e,t,Ke)},function(e,t){if(null==e)return e;if(!ze(e))return de(e,t);for(var n=e.length,r=he?n:-1,o=Object(e);(he?r--:++r<n)&&!1!==t(o[r],r,o););return e}),ye=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),u=a.length;u--;){var c=a[e?u:++o];if(!1===n(i[c],c,i))break}return t}}();function be(e,t){for(var n=0,r=(t=Ae(t,e)?[t]:je(t)).length;null!=e&&n<r;)e=e[Ce(t[n++])];return n&&n==r?e:void 0}function me(e,t){return null!=e&&t in Object(e)}function ge(e,t,n,u,c){return e===t||(null==e||null==t||!$e(e)&&!Ve(t)?e!=e&&t!=t:function(e,t,n,u,c,s){var l=qe(e),f=qe(t),p="[object Array]",d="[object Array]";l||(p=(p=ke(e))==r?i:p);f||(d=(d=ke(t))==r?i:d);var h=p==i&&!S(e),v=d==i&&!S(t),y=p==d;if(y&&!h)return s||(s=new se),l||Qe(e)?Ee(e,t,n,u,c,s):function(e,t,n,r,i,u,c){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new q(e),new q(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Fe(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case o:var s=P;case a:var l=2&u;if(s||(s=k),e.size!=t.size&&!l)return!1;var f=c.get(e);if(f)return f==t;u|=1,c.set(e,t);var p=Ee(s(e),s(t),r,i,u,c);return c.delete(e),p;case"[object Symbol]":if(re)return re.call(e)==re.call(t)}return!1}(e,t,p,n,u,c,s);if(!(2&c)){var b=h&&U.call(e,"__wrapped__"),m=v&&U.call(t,"__wrapped__");if(b||m){var g=b?e.value():e,_=m?t.value():t;return s||(s=new se),n(g,_,u,c,s)}}if(!y)return!1;return s||(s=new se),function(e,t,n,r,o,i){var a=2&o,u=Ke(e),c=u.length,s=Ke(t).length;if(c!=s&&!a)return!1;var l=c;for(;l--;){var f=u[l];if(!(a?f in t:U.call(t,f)))return!1}var p=i.get(e);if(p&&i.get(t))return p==t;var d=!0;i.set(e,t),i.set(t,e);var h=a;for(;++l<c;){f=u[l];var v=e[f],y=t[f];if(r)var b=a?r(y,v,f,t,e,i):r(v,y,f,e,t,i);if(!(void 0===b?v===y||n(v,y,r,o,i):b)){d=!1;break}h||(h="constructor"==f)}if(d&&!h){var m=e.constructor,g=t.constructor;m!=g&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof g&&g instanceof g)&&(d=!1)}return i.delete(e),i.delete(t),d}(e,t,n,u,c,s)}(e,t,ge,n,u,c))}function _e(e){return!(!$e(e)||function(e){return!!D&&D in e}(e))&&(Be(e)||S(e)?F:p).test(Me(e))}function we(e){return"function"==typeof e?e:null==e?Xe:"object"==typeof e?qe(e)?function(e,t){if(Ae(e)&&Le(t))return Ie(Ce(e),t);return function(n){var r=function(e,t,n){var r=null==e?void 0:be(e,t);return void 0===r?n:r}(n,e);return void 0===r&&r===t?function(e,t){return null!=e&&function(e,t,n){t=Ae(t,e)?[t]:je(t);var r,o=-1,i=t.length;for(;++o<i;){var a=Ce(t[o]);if(!(r=null!=e&&n(e,a)))break;e=e[a]}if(r)return r;return!!(i=e?e.length:0)&&We(i)&&Te(a,i)&&(qe(e)||He(e))}(e,t,me)}(n,e):ge(t,r,void 0,3)}}(e[0],e[1]):function(e){var t=function(e){var t=Ke(e),n=t.length;for(;n--;){var r=t[n],o=e[r];t[n]=[r,o,Le(o)]}return t}(e);if(1==t.length&&t[0][2])return Ie(t[0][0],t[0][1]);return function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var c=(u=n[o])[0],s=e[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in e))return!1}else{var f=new se;if(r)var p=r(s,l,c,e,t,f);if(!(void 0===p?ge(l,s,r,3,f):p))return!1}}return!0}(n,e,t)}}(e):Ae(t=e)?(n=Ce(t),function(e){return null==e?void 0:e[n]}):function(e){return function(t){return be(t,e)}}(t);var t,n}function Oe(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||C,t!==r)return W(e);var t,n,r,o=[];for(var i in Object(e))U.call(e,i)&&"constructor"!=i&&o.push(i);return o}function je(e){return qe(e)?e:xe(e)}function Ee(e,t,n,r,o,i){var a=2&o,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e);if(s&&i.get(t))return s==t;var l=-1,f=!0,p=1&o?new ce:void 0;for(i.set(e,t),i.set(t,e);++l<u;){var d=e[l],h=t[l];if(r)var v=a?r(h,d,l,t,e,i):r(d,h,l,e,t,i);if(void 0!==v){if(v)continue;f=!1;break}if(p){if(!E(t,(function(e,t){if(!p.has(t)&&(d===e||n(d,e,r,o,i)))return p.add(t)}))){f=!1;break}}else if(d!==h&&!n(d,h,r,o,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function Se(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Pe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _e(n)?n:void 0}var ke=function(e){return N.call(e)};function Te(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||d.test(e))&&e>-1&&e%1==0&&e<t}function Ae(e,t){if(qe(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ge(e))||(c.test(e)||!u.test(e)||null!=t&&e in Object(t))}function Le(e){return e==e&&!$e(e)}function Ie(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}($&&"[object DataView]"!=ke(new $(new ArrayBuffer(1)))||V&&ke(new V)!=o||G&&"[object Promise]"!=ke(G.resolve())||Q&&ke(new Q)!=a||K&&"[object WeakMap]"!=ke(new K))&&(ke=function(e){var t=N.call(e),n=t==i?e.constructor:void 0,r=n?Me(n):void 0;if(r)switch(r){case J:return"[object DataView]";case Y:return o;case Z:return"[object Promise]";case ee:return a;case te:return"[object WeakMap]"}return t});var xe=Ne((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Ge(e))return oe?oe.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return s.test(e)&&n.push(""),e.replace(l,(function(e,t,r,o){n.push(r?o.replace(f,"$1"):t||e)})),n}));function Ce(e){if("string"==typeof e||Ge(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Me(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var De,Re,Ue=(De=function(e,t,n){U.call(e,n)?e[n].push(t):e[n]=[t]},function(e,t){var n=qe(e)?j:pe,r=Re?Re():{};return n(e,De,we(t),r)});function Ne(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(Ne.Cache||ue),n}function Fe(e,t){return e===t||e!=e&&t!=t}function He(e){return function(e){return Ve(e)&&ze(e)}(e)&&U.call(e,"callee")&&(!z.call(e,"callee")||N.call(e)==r)}Ne.Cache=ue;var qe=Array.isArray;function ze(e){return null!=e&&We(e.length)&&!Be(e)}function Be(e){var t=$e(e)?N.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function We(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $e(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ve(e){return!!e&&"object"==typeof e}function Ge(e){return"symbol"==typeof e||Ve(e)&&"[object Symbol]"==N.call(e)}var Qe=O?function(e){return function(t){return e(t)}}(O):function(e){return Ve(e)&&We(e.length)&&!!h[N.call(e)]};function Ke(e){return ze(e)?le(e):Oe(e)}function Xe(e){return e}n.exports=Ue}).call(this,n(3),n(10)(e))},function(e,t,n){(function(e,n){var r="[object Arguments]",o="[object Map]",i="[object Object]",a="[object Set]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s[r]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s[o]=s["[object Number]"]=s[i]=s["[object RegExp]"]=s[a]=s["[object String]"]=s["[object WeakMap]"]=!1;var l="object"==typeof e&&e&&e.Object===Object&&e,f="object"==typeof self&&self&&self.Object===Object&&self,p=l||f||Function("return this")(),d=t&&!t.nodeType&&t,h=d&&"object"==typeof n&&n&&!n.nodeType&&n,v=h&&h.exports===d,y=v&&l.process,b=function(){try{return y&&y.binding&&y.binding("util")}catch(e){}}(),m=b&&b.isTypedArray;function g(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function _(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function w(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var O,j,E,S=Array.prototype,P=Function.prototype,k=Object.prototype,T=p["__core-js_shared__"],A=P.toString,L=k.hasOwnProperty,I=(O=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",x=k.toString,C=RegExp("^"+A.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?p.Buffer:void 0,D=p.Symbol,R=p.Uint8Array,U=k.propertyIsEnumerable,N=S.splice,F=D?D.toStringTag:void 0,H=Object.getOwnPropertySymbols,q=M?M.isBuffer:void 0,z=(j=Object.keys,E=Object,function(e){return j(E(e))}),B=be(p,"DataView"),W=be(p,"Map"),$=be(p,"Promise"),V=be(p,"Set"),G=be(p,"WeakMap"),Q=be(Object,"create"),K=we(B),X=we(W),J=we($),Y=we(V),Z=we(G),ee=D?D.prototype:void 0,te=ee?ee.valueOf:void 0;function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ie(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new oe;++t<n;)this.add(e[t])}function ae(e){var t=this.__data__=new re(e);this.size=t.size}function ue(e,t){var n=Ee(e),r=!n&&je(e),o=!n&&!r&&Se(e),i=!n&&!r&&!o&&Le(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=u.length;for(var s in e)!t&&!L.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||_e(s,c))||u.push(s);return u}function ce(e,t){for(var n=e.length;n--;)if(Oe(e[n][0],t))return n;return-1}function se(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=L.call(e,F),n=e[F];try{e[F]=void 0;var r=!0}catch(e){}var o=x.call(e);r&&(t?e[F]=n:delete e[F]);return o}(e):function(e){return x.call(e)}(e)}function le(e){return Ae(e)&&se(e)==r}function fe(e,t,n,u,c){return e===t||(null==e||null==t||!Ae(e)&&!Ae(t)?e!=e&&t!=t:function(e,t,n,u,c,s){var l=Ee(e),f=Ee(t),p=l?"[object Array]":ge(e),d=f?"[object Array]":ge(t),h=(p=p==r?i:p)==i,v=(d=d==r?i:d)==i,y=p==d;if(y&&Se(e)){if(!Se(t))return!1;l=!0,h=!1}if(y&&!h)return s||(s=new ae),l||Le(e)?he(e,t,n,u,c,s):function(e,t,n,r,i,u,c){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!u(new R(e),new R(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Oe(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case o:var s=_;case a:var l=1&r;if(s||(s=w),e.size!=t.size&&!l)return!1;var f=c.get(e);if(f)return f==t;r|=2,c.set(e,t);var p=he(s(e),s(t),r,i,u,c);return c.delete(e),p;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,p,n,u,c,s);if(!(1&n)){var b=h&&L.call(e,"__wrapped__"),m=v&&L.call(t,"__wrapped__");if(b||m){var g=b?e.value():e,O=m?t.value():t;return s||(s=new ae),c(g,O,n,u,s)}}if(!y)return!1;return s||(s=new ae),function(e,t,n,r,o,i){var a=1&n,u=ve(e),c=u.length,s=ve(t).length;if(c!=s&&!a)return!1;var l=c;for(;l--;){var f=u[l];if(!(a?f in t:L.call(t,f)))return!1}var p=i.get(e);if(p&&i.get(t))return p==t;var d=!0;i.set(e,t),i.set(t,e);var h=a;for(;++l<c;){f=u[l];var v=e[f],y=t[f];if(r)var b=a?r(y,v,f,t,e,i):r(v,y,f,e,t,i);if(!(void 0===b?v===y||o(v,y,n,r,i):b)){d=!1;break}h||(h="constructor"==f)}if(d&&!h){var m=e.constructor,g=t.constructor;m!=g&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof g&&g instanceof g)&&(d=!1)}return i.delete(e),i.delete(t),d}(e,t,n,u,c,s)}(e,t,n,u,fe,c))}function pe(e){return!(!Te(e)||function(e){return!!I&&I in e}(e))&&(Pe(e)?C:u).test(we(e))}function de(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||k,t!==r)return z(e);var t,n,r,o=[];for(var i in Object(e))L.call(e,i)&&"constructor"!=i&&o.push(i);return o}function he(e,t,n,r,o,i){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e);if(s&&i.get(t))return s==t;var l=-1,f=!0,p=2&n?new ie:void 0;for(i.set(e,t),i.set(t,e);++l<u;){var d=e[l],h=t[l];if(r)var v=a?r(h,d,l,t,e,i):r(d,h,l,e,t,i);if(void 0!==v){if(v)continue;f=!1;break}if(p){if(!g(t,(function(e,t){if(a=t,!p.has(a)&&(d===e||o(d,e,n,r,i)))return p.push(t);var a}))){f=!1;break}}else if(d!==h&&!o(d,h,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function ve(e){return function(e,t,n){var r=t(e);return Ee(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ie,me)}function ye(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function be(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return pe(n)?n:void 0}ne.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return L.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:L.call(t,e)},ne.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?"__lodash_hash_undefined__":t,this},re.prototype.clear=function(){this.__data__=[],this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=ce(t,e);return!(n<0)&&(n==t.length-1?t.pop():N.call(t,n,1),--this.size,!0)},re.prototype.get=function(e){var t=this.__data__,n=ce(t,e);return n<0?void 0:t[n][1]},re.prototype.has=function(e){return ce(this.__data__,e)>-1},re.prototype.set=function(e,t){var n=this.__data__,r=ce(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},oe.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(W||re),string:new ne}},oe.prototype.delete=function(e){var t=ye(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return ye(this,e).get(e)},oe.prototype.has=function(e){return ye(this,e).has(e)},oe.prototype.set=function(e,t){var n=ye(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ie.prototype.add=ie.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ie.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.clear=function(){this.__data__=new re,this.size=0},ae.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof re){var r=n.__data__;if(!W||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oe(r)}return n.set(e,t),this.size=n.size,this};var me=H?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(H(e),(function(t){return U.call(e,t)})))}:function(){return[]},ge=se;function _e(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||c.test(e))&&e>-1&&e%1==0&&e<t}function we(e){if(null!=e){try{return A.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oe(e,t){return e===t||e!=e&&t!=t}(B&&"[object DataView]"!=ge(new B(new ArrayBuffer(1)))||W&&ge(new W)!=o||$&&"[object Promise]"!=ge($.resolve())||V&&ge(new V)!=a||G&&"[object WeakMap]"!=ge(new G))&&(ge=function(e){var t=se(e),n=t==i?e.constructor:void 0,r=n?we(n):"";if(r)switch(r){case K:return"[object DataView]";case X:return o;case J:return"[object Promise]";case Y:return a;case Z:return"[object WeakMap]"}return t});var je=le(function(){return arguments}())?le:function(e){return Ae(e)&&L.call(e,"callee")&&!U.call(e,"callee")},Ee=Array.isArray;var Se=q||function(){return!1};function Pe(e){if(!Te(e))return!1;var t=se(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ae(e){return null!=e&&"object"==typeof e}var Le=m?function(e){return function(t){return e(t)}}(m):function(e){return Ae(e)&&ke(e.length)&&!!s[se(e)]};function Ie(e){return null!=(t=e)&&ke(t.length)&&!Pe(t)?ue(e):de(e);var t}n.exports=function(e,t){return fe(e,t)}}).call(this,n(3),n(10)(e))},function(e,t,n){(function(t){var n=/&(?:amp|lt|gt|quot|#39|#96);/g,r=RegExp(n.source),o="object"==typeof t&&t&&t.Object===Object&&t,i="object"==typeof self&&self&&self.Object===Object&&self,a=o||i||Function("return this")();var u,c=(u={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},function(e){return null==u?void 0:u[e]}),s=Object.prototype.toString,l=a.Symbol,f=l?l.prototype:void 0,p=f?f.toString:void 0;function d(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==s.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}e.exports=function(e){var t;return(e=null==(t=e)?"":d(t))&&r.test(e)?e.replace(n,c):e}}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=n(21),o=n(1);t.a=function(t){Object(o.e)(arguments,1,1,["string"]);var n=e.portlet.data.pageRenderState;return new Promise((function(e,i){Object(o.h)(n,t)?e(new r.a(t)):i(new Error("Invalid portlet ID"))}))}}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=n(0),o=n(22),i=n.n(o),a=n(4),u=n(9),c=n(2),s=n(1);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function p(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var y,b=window.history&&window.history.pushState,m=!1,g={},_=[],w=function(){function t(n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._portletId=n,this.constants=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},c.a),y||(y=e.portlet.data.pageRenderState,this._updateHistory(!0)),this.portletModes=y.portlets[this._portletId].allowedPM.slice(0),this.windowStates=y.portlets[this._portletId].allowedWS.slice(0)}var n,o,w;return n=t,(o=[{key:"_executeAction",value:function(e,t){var n=this;return new Promise((function(r,o){Object(s.d)(y,"ACTION",n._portletId,e).then((function(e){var i=Object(s.b)(n._portletId,e,t);Object(a.a)(i.url,i).then((function(e){return e.text()})).then((function(e){var t=n._updatePageStateFromString(e,n._portletId);r(t)})).catch((function(e){o(e)}))}))}))}},{key:"_hasListener",value:function(e){return Object.keys(g).map((function(e){return g[e].id})).includes(e)}},{key:"_reportError",value:function(e,t){Object.keys(g).map((function(n){var r=g[n];return r.id===e&&"portlet.onError"===r.type&&setTimeout((function(){r.handler("portlet.onError",t)})),!1}))}},{key:"_setPageState",value:function(e,t){var n=this;if(!Object(r.isString)(t))throw new TypeError("Invalid update string: ".concat(t));this._updatePageState(t,e).then((function(e){n._updatePortletStates(e)}),(function(t){m=!1,n._reportError(e,t)}))}},{key:"_setState",value:function(e){var t=this,n=Object(s.c)(y,this._portletId,e),r=[];Object.keys(n).forEach((function(e){var o=n[e],i=y.prpMap[e];Object.keys(i).forEach((function(e){if(e!==t._portletId){var n=i[e].split("|"),a=n[0],u=n[1];void 0===o?delete y.portlets[a].state.parameters[u]:y.portlets[a].state.parameters[u]=p(o),r.push(a)}}))}));var o=this._portletId;return y.portlets[o].state=e,r.push(o),r.forEach((function(e){y.portlets[e].renderData.content=null})),this._updateHistory(),Promise.resolve(r)}},{key:"_setupAction",value:function(e,t){var n=this;if(this.isInProgress())throw{message:"Operation is already in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};return m=!0,this._executeAction(e,t).then((function(e){return n._updatePortletStates(e).then((function(e){return m=!1,e}))}),(function(e){m=!1,n._reportError(n._portletId,e)}))}},{key:"_updateHistory",value:function(e){b&&Object(s.d)(y,"RENDER",null,{}).then((function(t){var n=JSON.stringify(y);if(e)history.replaceState(n,"");else try{history.pushState(n,"",t)}catch(e){}}))}},{key:"_updatePageState",value:function(e){var t=this;return new Promise((function(n,r){try{n(t._updatePageStateFromString(e,t._portletId))}catch(e){r(new Error("Partial Action decode status: ".concat(e.message)))}}))}},{key:"_updatePageStateFromString",value:function(e,t){var n=Object(s.a)(y,e),r=[],o=!1;return Object.entries(n).forEach((function(e){var t=f(e,2),n=t[0],i=t[1];y.portlets[n]=i,r.push(n),o=!0})),o&&t&&this._updateHistory(),r}},{key:"_updatePortletStates",value:function(e){var t=this;return new Promise((function(n){0===e.length?m=!1:e.forEach((function(e){t._updateStateForPortlet(e)})),n(e)}))}},{key:"_updateState",value:function(e){var t=this;if(m)throw{message:"Operation in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};m=!0,this._setState(e).then((function(e){t._updatePortletStates(e)})).catch((function(e){m=!1,t._reportError(t._portletId,e)}))}},{key:"_updateStateForPortlet",value:function(e){var t=_.map((function(e){return e.handle}));Object.entries(g).forEach((function(n){var r=f(n,2),o=r[0],i=r[1];"portlet.onStateChange"===i.type&&(i.id!==e||t.includes(o)||_.push(i))})),_.length>0&&setTimeout((function(){for(m=!0;_.length>0;){var e=_.shift(),t=e.handler,n=e.id;if(y.portlets[n]){var r=y.portlets[n].renderData,o=new u.a(y.portlets[n].state);r&&r.content?t("portlet.onStateChange",o,r):t("portlet.onStateChange",o)}}m=!1}))}},{key:"action",value:function(){for(var e=null,t=0,n=null,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return i.forEach((function(o){if(o instanceof HTMLFormElement){if(null!==n)throw new TypeError("Too many [object HTMLFormElement] arguments: ".concat(o,", ").concat(n));n=o}else if(Object(r.isObject)(o)){if(Object(s.g)(o),null!==e)throw new TypeError("Too many parameters arguments");e=o}else if(void 0!==o){var i=Object.prototype.toString.call(o);throw new TypeError("Invalid argument type. Argument ".concat(t+1," is of type ").concat(i))}t++})),n&&Object(s.f)(n),this._setupAction(e,n).then((function(e){Promise.resolve(e)})).catch((function(e){Promise.reject(e)}))}},{key:"addEventListener",value:function(e,t){if(arguments.length>2)throw new TypeError("Too many arguments passed to addEventListener");if(!Object(r.isString)(e)||!Object(r.isFunction)(t))throw new TypeError("Invalid arguments passed to addEventListener");var n=this._portletId;if(e.startsWith("portlet.")&&"portlet.onStateChange"!==e&&"portlet.onError"!==e)throw new TypeError("The system event type is invalid: ".concat(e));var o=i()(),a={handle:o,handler:t,id:n,type:e};return g[o]=a,"portlet.onStateChange"===e&&this._updateStateForPortlet(this._portletId),o}},{key:"createResourceUrl",value:function(e,t,n){if(arguments.length>3)throw new TypeError("Too many arguments. 3 arguments are allowed.");if(e){if(!Object(r.isObject)(e))throw new TypeError("Invalid argument type. Resource parameters must be a parameters object.");Object(s.g)(e)}var o=null;if(t){if(!Object(r.isString)(t))throw new TypeError("Invalid argument type. Cacheability argument must be a string.");if("cacheLevelPage"!==t&&"cacheLevelPortlet"!==t&&"cacheLevelFull"!==t)throw new TypeError("Invalid cacheability argument: ".concat(t));o=t}if(o||(o="cacheLevelPage"),n&&!Object(r.isString)(n))throw new TypeError("Invalid argument type. Resource ID argument must be a string.");return Object(s.d)(y,"RESOURCE",this._portletId,e,o,n)}},{key:"dispatchClientEvent",value:function(e,t){if(Object(s.e)(arguments,2,2,["string"]),e.match(new RegExp("^portlet[.].*")))throw new TypeError("The event type is invalid: "+e);return Object.keys(g).reduce((function(n,r){var o=g[r];return e.match(o.type)&&(o.handler(e,t),n++),n}),0)}},{key:"isInProgress",value:function(){return m}},{key:"newParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return Object.keys(e).forEach((function(n){Array.isArray(e[n])&&(t[n]=p(e[n]))})),t}},{key:"newState",value:function(e){return new u.a(e)}},{key:"removeEventListener",value:function(e){if(arguments.length>1)throw new TypeError("Too many arguments passed to removeEventListener");if(!Object(r.isDefAndNotNull)(e))throw new TypeError("The event handle provided is ".concat(l(e)));var t=!1;if(Object(r.isObject)(g[e])&&g[e].id===this._portletId){delete g[e];for(var n=_.length,o=0;o<n;o++){var i=_[o];i&&i.handle===e&&_.splice(o,1)}t=!0}if(!t)throw new TypeError("The event listener handle doesn't match any listeners.")}},{key:"setRenderState",value:function(e){if(Object(s.e)(arguments,1,1,["object"]),y.portlets&&y.portlets[this._portletId]){var t=y.portlets[this._portletId];Object(s.i)(e,t),this._updateState(e)}}},{key:"startPartialAction",value:function(e){var t=this,n=null;if(arguments.length>1)throw new TypeError("Too many arguments. 1 arguments are allowed");if(void 0!==e){if(!Object(r.isObject)(e))throw new TypeError("Invalid argument type. Argument is of type ".concat(l(e)));Object(s.g)(e),n=e}if(!0===m)throw{message:"Operation in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};m=!0;var o={setPageState:function(e){t._setPageState(t._portletId,e)},url:""};return Object(s.d)(y,"PARTIAL_ACTION",this._portletId,n).then((function(e){return o.url=e,o}))}}])&&v(n.prototype,o),w&&v(n,w),t}();t.a=w}).call(this,n(3))},function(e,t,n){var r,o,i=n(32),a=n(33),u=0,c=0;e.exports=function(e,t,n){var s=t&&n||0,l=t||[],f=(e=e||{}).node||r,p=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==p){var d=i();null==f&&(f=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==p&&(p=o=16383&(d[6]<<8|d[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:c+1,y=h-u+(v-c)/1e4;if(y<0&&void 0===e.clockseq&&(p=p+1&16383),(y<0||h>u)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=h,c=v,o=p;var b=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;l[s++]=b>>>24&255,l[s++]=b>>>16&255,l[s++]=b>>>8&255,l[s++]=255&b;var m=h/4294967296*1e4&268435455;l[s++]=m>>>8&255,l[s++]=255&m,l[s++]=m>>>24&15|16,l[s++]=m>>>16&255,l[s++]=p>>>8|128,l[s++]=255&p;for(var g=0;g<6;++g)l[s+g]=f[g];return t||a(l)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalEvalStyles=t.globalEval=t.features=t.DomEventHandle=t.DomEventEmitterProxy=t.domData=void 0;var r=n(5);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=f(r),i=f(n(8)),a=f(n(39)),u=f(n(14)),c=f(n(15)),s=f(n(40)),l=f(n(41));function f(e){return e&&e.__esModule?e:{default:e}}n(42),t.domData=i.default,t.DomEventEmitterProxy=a.default,t.DomEventHandle=u.default,t.features=c.default,t.globalEval=s.default,t.globalEvalStyles=l.default,t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.core=void 0;var r=n(11);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r);t.default=o,t.core=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"equal",value:function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}},{key:"firstDefinedValue",value:function(e){for(var t=0;t<e.length;t++)if(void 0!==e[t])return e[t]}},{key:"flatten",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0;r<t.length;r++)Array.isArray(t[r])?e.flatten(t[r],n):n.push(t[r]);return n}},{key:"remove",value:function(t,n){var r,o=t.indexOf(n);return(r=o>=0)&&e.removeAt(t,o),r}},{key:"removeAt",value:function(e,t){return 1===Array.prototype.splice.call(e,t,1).length}},{key:"slice",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=[],o=t;o<n;o++)r.push(e[o]);return r}}]),e}();t.default=o},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),o={throwException:function(e){o.nextTick((function(){throw e}))},run:function(e,t){o.run.workQueueScheduled_||(o.nextTick(o.run.processWorkQueue),o.run.workQueueScheduled_=!0),o.run.workQueue_.push(new o.run.WorkItem_(e,t))}};o.run.workQueueScheduled_=!1,o.run.workQueue_=[],o.run.processWorkQueue=function(){for(;o.run.workQueue_.length;){var e=o.run.workQueue_;o.run.workQueue_=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.fn.call(n.scope)}catch(e){o.throwException(e)}}}o.run.workQueueScheduled_=!1},o.run.WorkItem_=function(e,t){this.fn=e,this.scope=t},o.nextTick=function(t,n){var i=t;n&&(i=t.bind(n)),i=o.nextTick.wrapCallback_(i),o.nextTick.setImmediate_||("function"==typeof e&&(0,r.isServerSide)({checkEnv:!1})?o.nextTick.setImmediate_=e:o.nextTick.setImmediate_=o.nextTick.getSetImmediateEmulator_()),o.nextTick.setImmediate_(i)},o.nextTick.setImmediate_=null,o.nextTick.getSetImmediateEmulator_=function(){var e=void 0;if("function"==typeof MessageChannel&&(e=MessageChannel),void 0===e&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&(e=function(){var e=document.createElement("iframe");e.style.display="none",e.src="",e.title="",document.documentElement.appendChild(e);var t=e.contentWindow,n=t.document;n.open(),n.write(""),n.close();var r="callImmediate"+Math.random(),o=t.location.protocol+"//"+t.location.host,i=function(e){e.origin!==o&&e.data!==r||this.port1.onmessage()}.bind(this);t.addEventListener("message",i,!1),this.port1={},this.port2={postMessage:function(){t.postMessage(r,o)}}}),void 0!==e){var t=new e,n={},r=n;return t.port1.onmessage=function(){var e=(n=n.next).cb;n.cb=null,e()},function(e){r.next={cb:e},r=r.next,t.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("script")?function(e){var t=document.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,t.parentNode.removeChild(t),t=null,e(),e=null},document.documentElement.appendChild(t)}:function(e){setTimeout(e,0)}},o.nextTick.wrapCallback_=function(e){return e},t.default=o}).call(this,n(27).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(28),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(3))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,u,c=1,s={},l=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(a="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),r=function(t){e.postMessage(a+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return s[c]=o,r(c),c++},p.clearImmediate=d}function d(e){delete s[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=s[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(3),n(12))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.disposed_=!1}return r(e,[{key:"dispose",value:function(){this.disposed_||(this.disposeInternal(),this.disposed_=!0)}},{key:"disposeInternal",value:function(){}},{key:"isDisposed",value:function(){return this.disposed_}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"mixin",value:function(e){for(var t=void 0,n=void 0,r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];for(var a=0;a<o.length;a++)for(t in n=o[a])e[t]=n[t];return e}},{key:"getObjectByName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,n=e.split(".");return n.reduce((function(e,t){return e[t]}),t)}},{key:"map",value:function(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++)n[r[o]]=t(r[o],e[r[o]]);return n}},{key:"shallowEqual",value:function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(e[n[o]]!==t[n[o]])return!1;return!0}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"caseInsensitiveCompare",value:function(e,t){var n=String(e).toLowerCase(),r=String(t).toLowerCase();return n<r?-1:n===r?0:1}},{key:"collapseBreakingSpaces",value:function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")}},{key:"escapeRegex",value:function(e){return String(e).replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")}},{key:"getRandomString",value:function(){var e=2147483648;return Math.floor(Math.random()*e).toString(36)+Math.abs(Math.floor(Math.random()*e)^Date.now()).toString(36)}},{key:"hashCode",value:function(e){for(var t=0,n=0,r=e.length;n<r;n++)t=31*t+e.charCodeAt(n),t%=4294967296;return t}},{key:"replaceInterval",value:function(e,t,n,r){return e.substring(0,t)+r+e.substring(n)}}]),e}();t.default=o},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=n(13),u=(r=a)&&r.__esModule?r:{default:r};var c=[0],s=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.events_=null,e.listenerHandlers_=null,e.shouldUseFacade_=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"addHandler_",value:function(e,t){return e?(Array.isArray(e)||(e=[e]),e.push(t)):e=t,e}},{key:"addListener",value:function(e,t,n){this.validateListener_(t);for(var r=this.toEventsArray_(e),o=0;o<r.length;o++)this.addSingleListener_(r[o],t,n);return new u.default(this,e,t)}},{key:"addSingleListener_",value:function(e,t,n,r){this.runListenerHandlers_(e),(n||r)&&(t={default:n,fn:t,origin:r}),this.events_=this.events_||{},this.events_[e]=this.addHandler_(this.events_[e],t)}},{key:"buildFacade_",value:function(e){if(this.getShouldUseFacade()){var t={preventDefault:function(){t.preventedDefault=!0},target:this,type:e};return t}}},{key:"disposeInternal",value:function(){this.events_=null}},{key:"emit",value:function(e){var t=this.getRawListeners_(e);if(0===t.length)return!1;var n=i.array.slice(arguments,1);return this.runListeners_(t,n,this.buildFacade_(e)),!0}},{key:"getRawListeners_",value:function(e){return l(this.events_&&this.events_[e]).concat(l(this.events_&&this.events_["*"]))}},{key:"getShouldUseFacade",value:function(){return this.shouldUseFacade_}},{key:"listeners",value:function(e){return this.getRawListeners_(e).map((function(e){return e.fn?e.fn:e}))}},{key:"many",value:function(e,t,n){for(var r=this.toEventsArray_(e),o=0;o<r.length;o++)this.many_(r[o],t,n);return new u.default(this,e,n)}},{key:"many_",value:function(e,t,n){var r=this;t<=0||r.addSingleListener_(e,(function o(){0==--t&&r.removeListener(e,o),n.apply(r,arguments)}),!1,n)}},{key:"matchesListener_",value:function(e,t){return(e.fn||e)===t||e.origin&&e.origin===t}},{key:"off",value:function(e,t){if(this.validateListener_(t),!this.events_)return this;for(var n=this.toEventsArray_(e),r=0;r<n.length;r++)this.events_[n[r]]=this.removeMatchingListenerObjs_(l(this.events_[n[r]]),t);return this}},{key:"on",value:function(){return this.addListener.apply(this,arguments)}},{key:"onListener",value:function(e){this.listenerHandlers_=this.addHandler_(this.listenerHandlers_,e)}},{key:"once",value:function(e,t){return this.many(e,1,t)}},{key:"removeAllListeners",value:function(e){if(this.events_)if(e)for(var t=this.toEventsArray_(e),n=0;n<t.length;n++)this.events_[t[n]]=null;else this.events_=null;return this}},{key:"removeMatchingListenerObjs_",value:function(e,t){for(var n=[],r=0;r<e.length;r++)this.matchesListener_(e[r],t)||n.push(e[r]);return n.length>0?n:null}},{key:"removeListener",value:function(){return this.off.apply(this,arguments)}},{key:"runListenerHandlers_",value:function(e){var t=this.listenerHandlers_;if(t){t=l(t);for(var n=0;n<t.length;n++)t[n](e)}}},{key:"runListeners_",value:function(e,t,n){n&&t.push(n);for(var r=[],o=0;o<e.length;o++){var i=e[o].fn||e[o];e[o].default?r.push(i):i.apply(this,t)}if(!n||!n.preventedDefault)for(var a=0;a<r.length;a++)r[a].apply(this,t)}},{key:"setShouldUseFacade",value:function(e){return this.shouldUseFacade_=e,this}},{key:"toEventsArray_",value:function(e){return(0,i.isString)(e)&&(c[0]=e,e=c),e}},{key:"validateListener_",value:function(e){if(!(0,i.isFunction)(e))throw new TypeError("Listener must be a function")}}]),t}(i.Disposable);function l(e){return e=e||[],Array.isArray(e)?e:[e]}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.blacklist_=r,i.originEmitter_=e,i.pendingEvents_=null,i.proxiedEvents_=null,i.targetEmitter_=n,i.whitelist_=o,i.startProxy_(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"addListener_",value:function(e,t){return this.originEmitter_.on(e,t)}},{key:"disposeInternal",value:function(){this.removeListeners_(),this.proxiedEvents_=null,this.originEmitter_=null,this.targetEmitter_=null}},{key:"emitOnTarget_",value:function(){var e;(e=this.targetEmitter_).emit.apply(e,arguments)}},{key:"proxyEvent",value:function(e){this.shouldProxyEvent_(e)&&this.tryToAddListener_(e)}},{key:"removeListeners_",value:function(){if(this.proxiedEvents_){for(var e=Object.keys(this.proxiedEvents_),t=0;t<e.length;t++)this.proxiedEvents_[e[t]].removeListener();this.proxiedEvents_=null}this.pendingEvents_=null}},{key:"setOriginEmitter",value:function(e){var t=this,n=this.originEmitter_&&this.proxiedEvents_?Object.keys(this.proxiedEvents_):this.pendingEvents_;this.originEmitter_=e,n&&(this.removeListeners_(),n.forEach((function(e){return t.proxyEvent(e)})))}},{key:"shouldProxyEvent_",value:function(e){return!(this.whitelist_&&!this.whitelist_[e])&&((!this.blacklist_||!this.blacklist_[e])&&(!this.proxiedEvents_||!this.proxiedEvents_[e]))}},{key:"startProxy_",value:function(){this.targetEmitter_.onListener(this.proxyEvent.bind(this))}},{key:"tryToAddListener_",value:function(e){this.originEmitter_?(this.proxiedEvents_=this.proxiedEvents_||{},this.proxiedEvents_[e]=this.addListener_(e,this.emitOnTarget_.bind(this,e))):(this.pendingEvents_=this.pendingEvents_||[],this.pendingEvents_.push(e))}}]),t}(n(0).Disposable);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.eventHandles_=[],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"add",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<arguments.length;r++)this.eventHandles_.push(t[r])}},{key:"disposeInternal",value:function(){this.eventHandles_=null}},{key:"removeAllListeners",value:function(){for(var e=0;e<this.eventHandles_.length;e++)this.eventHandles_[e].removeListener();this.eventHandles_=[]}}]),t}(n(0).Disposable);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.customEvents=void 0,t.addClasses=function(e,t){if(!(0,r.isObject)(e)||!(0,r.isString)(t))return;e.length||(e=[e]);for(var n=0;n<e.length;n++)"classList"in e[n]?p(e[n],t):d(e[n],t)},t.closest=v,t.append=y,t.buildFragment=b,t.contains=m,t.delegate=g,t.isNodeListLike=w,t.enterDocument=function(e){e&&y(document.body,e)},t.exitDocument=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},t.hasClass=function(e,t){return"classList"in e?function(e,t){return-1===t.indexOf(" ")&&e.classList.contains(t)}(e,t):function(e,t){return(" "+e.className+" ").indexOf(" "+t+" ")>=0&&1===t.split(" ").length}(e,t)},t.isEmpty=function(e){return 0===e.childNodes.length},t.match=j,t.next=function(e,t){do{if((e=e.nextSibling)&&j(e,t))return e}while(e);return null},t.on=E,t.once=function(e,t,n){var r=E(e,t,(function(){return r.removeListener(),n.apply(this,arguments)}));return r},t.parent=S,t.prepend=function(e,t){(0,r.isString)(t)&&(t=b(t));if(!w(t)&&!(0,r.isDefAndNotNull)(e.firstChild))return y(e,t);if(w(t))for(var n=Array.prototype.slice.call(t),o=n.length-1;o>=0;o--)e.insertBefore(n[o],e.firstChild);else e.insertBefore(t,e.firstChild);return t},t.registerCustomEvent=function(e,t){l[e]=t},t.removeChildren=function(e){var t=void 0;for(;t=e.firstChild;)e.removeChild(t)},t.removeClasses=function(e,t){if(!(0,r.isObject)(e)||!(0,r.isString)(t))return;e.length||(e=[e]);for(var n=0;n<e.length;n++)"classList"in e[n]?P(e[n],t):k(e[n],t)},t.replace=function(e,t){e&&t&&e!==t&&e.parentNode&&e.parentNode.replaceChild(t,e)},t.supportsEvent=function(e,t){if(l[t])return!0;(0,r.isString)(e)&&(c[e]||(c[e]=document.createElement(e)),e=c[e]);var n=e.tagName;s[n]&&s[n].hasOwnProperty(t)||(s[n]=s[n]||{},s[n][t]="on"+t in e);return s[n][t]},t.toElement=function(e){return(0,r.isElement)(e)||(0,r.isDocument)(e)||(0,r.isDocumentFragment)(e)?e:(0,r.isString)(e)?document.querySelector(e):null},t.toggleClasses=function(e,t){if(!(0,r.isObject)(e)||!(0,r.isString)(t))return;"classList"in e?function(e,t){t.split(" ").forEach((function(t){e.classList.toggle(t)}))}(e,t):function(e,t){var n=" "+e.className+" ";t=t.split(" ");for(var r=0;r<t.length;r++){var o=" "+t[r]+" ",i=n.indexOf(o);if(-1===i)n=""+n+t[r]+" ";else{var a=n.substring(0,i),u=n.substring(i+o.length);n=a+" "+u}}e.className=n.trim()}(e,t)},t.triggerEvent=function(e,t,n){if(_(e,t,n)){var o=document.createEvent("HTMLEvents");o.initEvent(t,!0,!0),r.object.mixin(o,n),e.dispatchEvent(o)}};var r=n(0),o=u(n(8)),i=u(n(38)),a=u(n(14));function u(e){return e&&e.__esModule?e:{default:e}}var c={},s={},l=t.customEvents={},f={blur:!0,error:!0,focus:!0,invalid:!0,load:!0,scroll:!0};function p(e,t){t.split(" ").forEach((function(t){t&&e.classList.add(t)}))}function d(e,t){var n=" "+e.className+" ",r="";t=t.split(" ");for(var o=0;o<t.length;o++){var i=t[o];-1===n.indexOf(" "+i+" ")&&(r+=" "+i)}r&&(e.className=e.className+r)}function h(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function v(e,t){for(;e&&!j(e,t);)e=e.parentNode;return e}function y(e,t){if((0,r.isString)(t)&&(t=b(t)),w(t))for(var n=Array.prototype.slice.call(t),o=0;o<n.length;o++)e.appendChild(n[o]);else e.appendChild(t);return t}function b(e){var t=document.createElement("div");t.innerHTML="<br>"+e,t.removeChild(t.firstChild);for(var n=document.createDocumentFragment();t.firstChild;)n.appendChild(t.firstChild);return n}function m(e,t){return(0,r.isDocument)(e)?e.documentElement.contains(t):e.contains(t)}function g(e,t,n,a,u){var c=l[t];return c&&c.delegate&&(t=c.originalEvent,a=c.handler.bind(c,a)),u&&((a=a.bind()).defaultListener_=!0),function(e,t){var n=o.default.get(e,"delegating",{});n[t]||(n[t]={handle:E(e,t,O,!!f[t]),selectors:{}})}(e,t),(0,r.isString)(n)?function(e,t,n,r){h(o.default.get(e,"delegating",{})[t].selectors,n,r)}(e,t,n,a):function(e,t,n){h(o.default.get(e,"listeners",{}),t,n)}(n,t,a),new i.default((0,r.isString)(n)?e:n,t,a,(0,r.isString)(n)?n:null)}function _(e,t,n){if(n&&"click"===t&&2===n.button)return!1;return!("click"===t&&["BUTTON","INPUT","SELECT","TEXTAREA","FIELDSET"].indexOf(e.tagName)>-1)||!(e.disabled||S(e,"fieldset[disabled]"))}function w(e){return(0,r.isDefAndNotNull)(e)&&"number"==typeof e.length&&"function"==typeof e.item}function O(e){!function(e){e.stopPropagation=A,e.stopImmediatePropagation=T}(e);var t=!0,n=e.currentTarget,r=[];return t&=function(e,t,n){var r=!0,o=t.target,i=e.parentNode;for(;o&&o!==i&&!t.stopped;)_(o,t.type,t)&&(t.delegateTarget=o,r&=L(o,t,n),r&=x(e,o,t,n)),o=o.parentNode;return r}(n,e,r),t&=function(e,t){for(var n=!0,r=0;r<e.length&&!t.defaultPrevented;r++)t.delegateTarget=e[r].element,n&=e[r].fn(t);return n}(r,e),e.delegateTarget=null,e.__metal_last_container__=n,t}function j(e,t){if(!e||1!==e.nodeType)return!1;var n=Element.prototype,r=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector;return r?r.call(e,t):function(e,t){var n=e.parentNode;if(n)for(var r=n.querySelectorAll(t),o=0;o<r.length;++o)if(r[o]===e)return!0;return!1}(e,t)}function E(e,t,n,o){if((0,r.isString)(e))return g(document,t,e,n);var i=l[t];return i&&i.event&&(t=i.originalEvent,n=i.handler.bind(i,n)),e.addEventListener(t,n,o),new a.default(e,t,n,o)}function S(e,t){return v(e.parentNode,t)}function P(e,t){t.split(" ").forEach((function(t){t&&e.classList.remove(t)}))}function k(e,t){var n=" "+e.className+" ";t=t.split(" ");for(var r=0;r<t.length;r++)n=n.replace(" "+t[r]+" "," ");e.className=n.trim()}function T(){this.stopped=!0,this.stoppedImmediate=!0,Event.prototype.stopImmediatePropagation.call(this)}function A(){this.stopped=!0,Event.prototype.stopPropagation.call(this)}function L(e,t,n){var i=t.__metal_last_container__;return!(!(0,r.isDef)(i)||!m(i,e))||I(o.default.get(e,"listeners",{})[t.type],t,e,n)}function I(e,t,n,r){var o=!0;e=e||[];for(var i=0;i<e.length&&!t.stoppedImmediate;i++)e[i].defaultListener_?r.push({element:n,fn:e[i]}):o&=e[i](t);return o}function x(e,t,n,r){for(var i=!0,a=o.default.get(e,"delegating",{})[n.type].selectors,u=Object.keys(a),c=0;c<u.length&&!n.stoppedImmediate;c++){if(j(t,u[c]))i&=I(a[u[c]],n,t,r)}return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=n(8),u=(r=a)&&r.__esModule?r:{default:r};var c=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return i.selector_=o,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"removeListener",value:function(){var e=u.default.get(this.emitter_,"delegating",{}),t=u.default.get(this.emitter_,"listeners",{}),n=this.selector_,r=(0,i.isString)(n)?e[this.event_].selectors:t,o=(0,i.isString)(n)?n:this.event_;i.array.remove(r[o]||[],this.listener_),r[o]&&0===r[o].length&&delete r[o]}}]),t}(n(6).EventHandle);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=n(5);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var c=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"addListener_",value:function(e,n){if(this.originEmitter_.addEventListener){if(this.isDelegateEvent_(e)){var r=e.indexOf(":",9),a=e.substring(9,r),u=e.substring(r+1);return(0,i.delegate)(this.originEmitter_,a,u,n)}return(0,i.on)(this.originEmitter_,e,n)}return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"addListener_",this).call(this,e,n)}},{key:"isDelegateEvent_",value:function(e){return"delegate:"===e.substr(0,9)}},{key:"isSupportedDomEvent_",value:function(e){return!this.originEmitter_||!this.originEmitter_.addEventListener||(this.isDelegateEvent_(e)&&-1!==e.indexOf(":",9)||(0,i.supportsEvent)(this.originEmitter_,e))}},{key:"shouldProxyEvent_",value:function(e){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"shouldProxyEvent_",this).call(this,e)&&this.isSupportedDomEvent_(e)}}]),t}(n(6).EventEmitterProxy);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(5);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"run",value:function(e,t){var n=document.createElement("script");return n.text=e,t?t(n):document.head.appendChild(n),(0,i.exitDocument)(n),n}},{key:"runFile",value:function(e,t,n){var r=document.createElement("script");r.src=e;var o=function(){(0,i.exitDocument)(r),t&&t()};return(0,i.once)(r,"load",o),(0,i.once)(r,"error",o),n?n(r):document.head.appendChild(r),r}},{key:"runScript",value:function(t,n,r){var a=function(){n&&n()};if(!t.type||"text/javascript"===t.type)return(0,i.exitDocument)(t),t.src?e.runFile(t.src,n,r):(o.async.nextTick(a),e.run(t.text,r));o.async.nextTick(a)}},{key:"runScriptsInElement",value:function(t,n,r){var i=t.querySelectorAll("script");i.length?e.runScriptsInOrder(i,0,n,r):n&&o.async.nextTick(n)}},{key:"runScriptsInOrder",value:function(t,n,r,i){e.runScript(t.item(n),(function(){n<t.length-1?e.runScriptsInOrder(t,n+1,r,i):r&&o.async.nextTick(r)}),i)}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(5);var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"run",value:function(e,t){var n=document.createElement("style");return n.innerHTML=e,t?t(n):document.head.appendChild(n),n}},{key:"runFile",value:function(t,n,r){var o=document.createElement("link");return o.rel="stylesheet",o.href=t,e.runStyle(o,n,r),o}},{key:"runStyle",value:function(e,t,n){var r=function(){t&&t()};if(!e.rel||"stylesheet"===e.rel||"canonical"===e.rel||"alternate"===e.rel)return"STYLE"===e.tagName||"canonical"===e.rel||"alternate"===e.rel?o.async.nextTick(r):((0,i.once)(e,"load",r),(0,i.once)(e,"error",r)),n?n(e):document.head.appendChild(e),e;o.async.nextTick(r)}},{key:"runStylesInElement",value:function(t,n,r){var i=t.querySelectorAll("style,link");if(0===i.length&&n)o.async.nextTick(n);else for(var a=0,u=function(){n&&++a===i.length&&o.async.nextTick(n)},c=0;c<i.length;c++)e.runStyle(i[c],u,r)}}]),e}();t.default=a},function(e,t,n){"use strict";var r,o=n(0),i=n(5),a=n(15),u=(r=a)&&r.__esModule?r:{default:r};(0,o.isServerSide)()||function(){var e={mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"};Object.keys(e).forEach((function(t){(0,i.registerCustomEvent)(t,{delegate:!0,handler:function(e,n){var r=n.relatedTarget,o=n.delegateTarget;if(!r||r!==o&&!(0,i.contains)(o,r))return n.customType=t,e(n)},originalEvent:e[t]})}));var t={animation:"animationend",transition:"transitionend"};Object.keys(t).forEach((function(e){var n=t[e];(0,i.registerCustomEvent)(n,{event:!0,delegate:!0,handler:function(e,t){return t.customType=n,e(t)},originalEvent:u.default.checkAnimationEventName()[e]})}))}()},function(e,t,n){"use strict";n.r(t);var r=n(16),o=n.n(r),i=n(17),a=n.n(i),u=n(18),c=n.n(u),s=n(19),l=n.n(s),f=n(0),p={},d={},h={},v={},y={},b=["p_p_id","p_p_lifecycle"],m=["ddmStructureKey","fileEntryTypeId","folderId","navigation","status"],g=function(e){var t,n;e?t={promise:Promise.resolve(e),resolve:function(){}}:t={promise:new Promise((function(e){n=e})),resolve:n};return t},_=function(e,t,n){var r=e.data;Object.keys(r).forEach((function(e){var t=n.querySelector("#".concat(e));t&&(t.innerHTML=r[e].html)}))},w=function(e){var t=new URL(window.location.href),n=new URL(e.path,window.location.href);if(b.every((function(e){return n.searchParams.get(e)===t.searchParams.get(e)}))){var r=Object.keys(h);r=r.filter((function(e){var r=h[e],o=p[e],i=m.every((function(e){var r=!1;if(o){var i="_".concat(o.portletId,"_").concat(e);r=n.searchParams.get(i)===t.searchParams.get(i)}return r}));return!!Object(f.isFunction)(r.isCacheable)&&r.isCacheable(n)&&i&&o&&o.cacheState&&r.element&&r.getState})),v=r.reduce((function(e,t){var n=h[t],r=p[t],o=n.getState(),i=r.cacheState.reduce((function(e,t){return e[t]=o[t],e}),{});return e[t]={html:n.element.innerHTML,state:i},e}),[]),Liferay.DOMTaskRunner.addTask({action:_,condition:function(e){return"liferay.component"===e.owner}}),Liferay.DOMTaskRunner.addTaskState({data:v,owner:"liferay.component"})}else v={}},O=function(e,t,n){var r;if(1===arguments.length){var o=h[e];o&&Object(f.isFunction)(o)&&(y[e]=o,o=o(),h[e]=o),r=o}else if(h[e]&&null!==t&&(delete p[e],delete d[e],console.warn('Component with id "'+e+'" is being registered twice. This can lead to unexpected behaviour in the "Liferay.component" and "Liferay.componentReady" APIs, as well as in the "*:registered" events.')),r=h[e]=t,null===t)delete p[e],delete d[e];else{p[e]=n,Liferay.fire(e+":registered");var i=d[e];i?i.resolve(t):d[e]=g(t)}return r},j=function(e){var t=h[e];if(t){var n=t.destroy||t.dispose;n&&n.call(t),delete p[e],delete d[e],delete y[e],delete h[e]}},E={register:n(20).a},S=n(6),P=n.n(S);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var I=new WeakMap;function x(e){if(e&&e.jquery){if(e.length>1)throw new Error("getElement(): Expected at most one element, got ".concat(e.length));e=e.get(0)}return!e||e instanceof HTMLElement||(e=e.element),e}function C(e){return e=x(e),I.get(e)}var M=[/^aria-/,/^data-/,/^type$/];function D(e,t){U(e,A({},t,!0))}function R(e,t){U(e,A({},t,!1))}function U(e,t){(e=x(e))&&Object.entries(t).forEach((function(t){var n=T(t,2),r=n[0],o=n[1];r.split(/\s+/).forEach((function(t){o?e.classList.add(t):e.classList.remove(t)}))}))}function N(e,t){return e=x(e),t.split(/\s+/).every((function(t){return e.classList.contains(t)}))}function F(e,t){(e=x(e))&&Object.entries(t).forEach((function(t){var n=T(t,2),r=n[0],o=n[1];e.style[r]=o}))}function H(e){return"number"==typeof e?e+"px":"string"==typeof e&&e.match(/^\s*\d+\s*$/)?e.trim()+"px":e}function q(e){return e.getBoundingClientRect().left+(e.ownerDocument.defaultView.pageOffsetX||0)}var z={};function B(e,t,n){if(e){z[t]||(z[t]={},document.body.addEventListener(t,(function(e){return function(e,t){Object.keys(z[e]).forEach((function(n){for(var r=!1,o=t.target;o&&!(r=o.matches&&o.matches(n));)o=o.parentNode;r&&z[e][n].emit("click",t)}))}(t,e)})));var r=z[t],o="string"==typeof e?e:function(e){if((e=x(e)).id)return"#".concat(e.id);for(var t=e.parentNode;t&&!t.id;)t=t.parentNode;var n=Array.from(e.attributes).map((function(e){var t=e.name,n=e.value;return M.some((function(e){return e.test(t)}))?"[".concat(t,"=").concat(JSON.stringify(n),"]"):null})).filter(Boolean).sort();return[t?"#".concat(t.id," "):"",e.tagName.toLowerCase()].concat(L(n)).join("")}(e);r[o]||(r[o]=new P.a);var i=r[o].on(t,(function(e){e.defaultPrevented||n(e)}));return{dispose:function(){i.dispose()}}}return null}function W(e){return parseInt(e,10)||0}function $(e,t){e=x(e),this.init(e,t)}$.TRANSITION_DURATION=500,$.prototype={_bindUI:function(){this._subscribeClickTrigger(),this._subscribeClickSidenavClose()},_emit:function(e){this._emitter.emit(e,this)},_getSidenavWidth:function(){var e=this.options.widthOriginal,t=e,n=window.innerWidth;return n<e+40&&(t=n-40),t},_getSimpleSidenavType:function(){var e=this.options,t=this._isDesktop(),n=e.type,r=e.typeMobile;return t&&"fixed-push"===n?"desktop-fixed-push":t||"fixed-push"!==r?"fixed":"mobile-fixed-push"},_isDesktop:function(){return window.innerWidth>=this.options.breakpoint},_isSidenavRight:function(){var e=this.options;return N(document.querySelector(e.container),"sidenav-right")},_isSimpleSidenavClosed:function(){var e=this.options,t=e.openClass;return!N(document.querySelector(e.container),t)},_loadUrl:function(e,t){var n=this,r=e.querySelector(".sidebar-body");if(!n._fetchPromise&&r){var o=document.createElement("div");D(o,"sidenav-loading"),o.innerHTML=n.options.loadingIndicatorTPL,r.appendChild(o),n._fetchPromise=Liferay.Util.fetch(t),n._fetchPromise.then((function(e){if(!e.ok)throw new Error("Failed to fetch ".concat(t));return e.text()})).then((function(e){var t=document.createRange();t.selectNode(r);var i=t.createContextualFragment(e);r.removeChild(o),r.appendChild(i),n.setHeight()})).catch((function(e){console.log(e)}))}},_renderNav:function(){var e=this.options,t=document.querySelector(e.container),n=t.querySelector(e.navigation).querySelector(".sidenav-menu"),r=N(t,"closed"),o=this._isSidenavRight(),i=this._getSidenavWidth();r?(F(n,{width:H(i)}),o&&F(n,A({},e.rtl?"left":"right",H(i)))):(this.showSidenav(),this.setHeight())},_renderUI:function(){var e=this.options,t=document.querySelector(e.container),n=this.toggler,r=this.mobile,o=r?e.typeMobile:e.type;this.useDataAttribute||(r&&(U(t,{closed:!0,open:!1}),U(n,{active:!1,open:!1})),"right"===e.position&&D(t,"sidenav-right"),"relative"!==o&&D(t,"sidenav-fixed"),this._renderNav()),F(t,{display:""})},_subscribeClickSidenavClose:function(){var e=this,t=e.options.container;if(!e._sidenavCloseSubscription){var n="".concat(t," .sidenav-close");e._sidenavCloseSubscription=B(n,"click",(function(t){t.preventDefault(),e.toggle()}))}},_subscribeClickTrigger:function(){var e=this;if(!e._togglerSubscription){var t=e.toggler;e._togglerSubscription=B(t,"click",(function(t){e.toggle(),t.preventDefault()}))}},_subscribeSidenavTransitionEnd:function(e,t){setTimeout((function(){R(e,"sidenav-transition"),t()}),$.TRANSITION_DURATION)},clearHeight:function(){var e=this.options,t=document.querySelector(e.container);t&&[t.querySelector(e.content),t.querySelector(e.navigation),t.querySelector(".sidenav-menu")].forEach((function(e){F(e,{height:"","min-height":""})}))},destroy:function(){this._sidenavCloseSubscription&&(this._sidenavCloseSubscription.dispose(),this._sidenavCloseSubscription=null),this._togglerSubscription&&(this._togglerSubscription.dispose(),this._togglerSubscription=null),I.delete(this.toggler)},hide:function(){this.useDataAttribute?this.hideSimpleSidenav():this.toggleNavigation(!1)},hideSidenav:function(){var e=this.options,t=document.querySelector(e.container);if(t){var n,r=t.querySelector(e.content),o=t.querySelector(e.navigation),i=o.querySelector(".sidenav-menu"),a=this._isSidenavRight(),u=e.rtl?"right":"left";a&&(u=e.rtl?"left":"right"),F(r,(A(n={},"padding-"+u,""),A(n,u,""),n)),F(o,{width:""}),a&&F(i,A({},u,H(this._getSidenavWidth())))}},hideSimpleSidenav:function(){var e=this,t=e.options;if(!e._isSimpleSidenavClosed()){var n,r,o=document.querySelector(t.content),i=document.querySelector(t.container),a=t.closedClass,u=t.openClass,c=e.toggler,s=c.dataset.target||c.getAttribute("href");if(e._emit("closedStart.lexicon.sidenav"),e._subscribeSidenavTransitionEnd(o,(function(){R(i,"sidenav-transition"),R(c,"sidenav-transition"),e._emit("closed.lexicon.sidenav")})),N(o,u))U(o,(A(r={},a,!0),A(r,u,!1),A(r,"sidenav-transition",!0),r));D(i,"sidenav-transition"),D(c,"sidenav-transition"),U(i,(A(n={},a,!0),A(n,u,!1),n));var l=document.querySelectorAll('[data-target="'.concat(s,'"], [href="').concat(s,'"]'));Array.from(l).forEach((function(e){U(e,A({active:!1},u,!1)),U(e,A({active:!1},u,!1))}))}},init:function(e,t){var n="liferay-sidenav"===e.dataset.toggle;(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){A(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},V,{},t)).breakpoint=W(t.breakpoint),t.container=t.container||e.dataset.target||e.getAttribute("href"),t.gutter=W(t.gutter),t.rtl="rtl"===document.dir,t.width=W(t.width),t.widthOriginal=t.width,n&&(t.closedClass=e.dataset.closedClass||"closed",t.content=e.dataset.content,t.loadingIndicatorTPL=e.dataset.loadingIndicatorTpl||t.loadingIndicatorTPL,t.openClass=e.dataset.openClass||"open",t.type=e.dataset.type,t.typeMobile=e.dataset.typeMobile,t.url=e.dataset.url,t.width=""),this.toggler=e,this.options=t,this.useDataAttribute=n,this._emitter=new P.a,this._bindUI(),this._renderUI()},on:function(e,t){return this._emitter.on(e,t)},setHeight:function(){var e=this.options,t=document.querySelector(e.container),n=this.mobile?e.typeMobile:e.type;if("fixed"!==n&&"fixed-push"!==n){var r=t.querySelector(e.content),o=t.querySelector(e.navigation),i=t.querySelector(".sidenav-menu"),a=r.getBoundingClientRect().height,u=o.getBoundingClientRect().height,c=H(Math.max(a,u));F(r,{"min-height":c}),F(o,{height:"100%","min-height":c}),F(i,{height:"100%","min-height":c})}},show:function(){this.useDataAttribute?this.showSimpleSidenav():this.toggleNavigation(!0)},showSidenav:function(){var e=this.mobile,t=this.options,n=document.querySelector(t.container),r=n.querySelector(t.content),o=n.querySelector(t.navigation),i=o.querySelector(".sidenav-menu"),a=this._isSidenavRight(),u=this._getSidenavWidth(),c=u+t.gutter,s=t.url;s&&this._loadUrl(i,s),F(o,{width:H(u)}),F(i,{width:H(u)});var l=t.rtl?"right":"left";a&&(l=t.rtl?"left":"right");var f=e?l:"padding-"+l;if("fixed"!==(e?t.typeMobile:t.type)){var p=N(n,"open")?q(o)-t.gutter:q(o)-c,d=q(r),h=W(getComputedStyle(r).width),v="";t.rtl&&a||!t.rtl&&"left"===t.position?(p=q(o)+c)>d&&(v=p-d):(t.rtl&&"left"===t.position||!t.rtl&&a)&&p<d+h&&(v=d+h-p)>=c&&(v=c),F(r,A({},f,H(v)))}},showSimpleSidenav:function(){var e=this,t=e.options;if(e._isSimpleSidenavClosed()){var n,r,o,i=document.querySelector(t.content),a=document.querySelector(t.container),u=t.closedClass,c=t.openClass,s=e.toggler,l=s.dataset.url;l&&e._loadUrl(a,l),e._emit("openStart.lexicon.sidenav"),e._subscribeSidenavTransitionEnd(i,(function(){R(a,"sidenav-transition"),R(s,"sidenav-transition"),e._emit("open.lexicon.sidenav")})),U(i,(A(n={},u,!1),A(n,c,!0),A(n,"sidenav-transition",!0),n)),U(a,(A(r={},u,!1),A(r,c,!0),A(r,"sidenav-transition",!0),r)),U(s,(A(o={active:!0},c,!0),A(o,"sidenav-transition",!0),o))}},toggle:function(){this.useDataAttribute?this.toggleSimpleSidenav():this.toggleNavigation()},toggleNavigation:function(e){var t=this,n=t.options,r=document.querySelector(n.container),o=r.querySelector(".sidenav-menu"),i=t.toggler,a=n.width,u="boolean"==typeof e?e:N(r,"closed"),c=t._isSidenavRight();if(u?t._emit("openStart.lexicon.sidenav"):t._emit("closedStart.lexicon.sidenav"),t._subscribeSidenavTransitionEnd(r,(function(){var e=r.querySelector(".sidenav-menu");N(r,"closed")?(t.clearHeight(),U(i,{open:!1,"sidenav-transition":!1}),t._emit("closed.lexicon.sidenav")):(U(i,{open:!0,"sidenav-transition":!1}),t._emit("open.lexicon.sidenav")),t.mobile&&e.focus()})),u){t.setHeight(),F(o,{width:H(a)});var s=n.rtl?"left":"right";c&&F(o,A({},s,""))}D(r,"sidenav-transition"),D(i,"sidenav-transition"),u?t.showSidenav():t.hideSidenav(),U(r,{closed:!u,open:u}),U(i,{active:u,open:u})},toggleSimpleSidenav:function(){this._isSimpleSidenavClosed()?this.showSimpleSidenav():this.hideSimpleSidenav()},visible:function(){var e;if(this.useDataAttribute)e=this._isSimpleSidenavClosed();else{var t=document.querySelector(this.options.container);e=N(t,"sidenav-transition")?!N(t,"closed"):N(t,"closed")}return!e}},$.destroy=function(e){var t=C(e);t&&t.destroy()},$.hide=function(e){var t=C(e);t&&t.hide()},$.initialize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=x(e);var n=I.get(e);return n||(n=new $(e,t),I.set(e,n)),n},$.instance=C;var V={breakpoint:768,content:".sidenav-content",gutter:"15px",loadingIndicatorTPL:'<div class="loading-animation loading-animation-md"></div>',navigation:".sidenav-menu-slider",position:"left",type:"relative",typeMobile:"relative",url:null,width:"225px"};function G(){var e=document.querySelectorAll('[data-toggle="liferay-sidenav"]');Array.from(e).forEach($.initialize)}"loading"!==document.readyState?G():document.addEventListener("DOMContentLoaded",(function(){G()}));var Q=$;var K=n(4);function X(e,t){var n=null;if(Object(f.isDef)(e)&&"FORM"===e.nodeName&&Object(f.isString)(t)){var r=e.dataset.fmNamespace||"";n=e.elements[r+t]||null}return n}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Z=n(23),ee=n.n(Z);function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ne(e,t){Object(f.isDef)(e)&&"FORM"===e.nodeName&&Object(f.isObject)(t)&&Object.entries(t).forEach((function(t){var n=te(t,2),r=n[0],o=n[1],i=X(e,r);i&&(i.value=o)}))}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){ie(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ae={addSpaceBeforeSuffix:!1,decimalSeparator:".",denominator:1024,suffixGB:"GB",suffixKB:"KB",suffixMB:"MB"};function ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(n),!0).forEach((function(t){se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var le=/<!\[CDATA\[[\0-\uFFFF]*?\]\]>/g,fe=/-->|\]>/,pe=/<!/,de=/<\?/,he=/!DOCTYPE/,ve=/^<\w/,ye=/^<\/\w/,be=/^<[\w:\-.,]+/,me=/^<\/[\w:\-.,]+/,ge=/<\w/,_e=/\s*(xmlns)(:|=)/g,we=/<\//,Oe=/</g,je=/\/>/,Ee=/>\s+</g,Se=new RegExp("<~::~CDATA~::~>","g"),Pe={newLine:"\r\n",tagIndent:"\t"};function ke(e,t,n){return t+new Array(e+1).join(n)}function Te(e){if("string"!=typeof e)throw new TypeError("portletId must be a string");return"_".concat(e,"_")}var Ae=n(7),Le=n.n(Ae);function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var xe,Ce=(xe=function(e,t){return void 0!==t&&0!==t.lastIndexOf(e,0)&&(t="".concat(e).concat(t)),t},Le()(xe,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?Array.prototype.join.call(t,"_"):String(t[0])})));function Me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Re=/^[a-z][a-z0-9+.-]*:/i;function Ue(e){return Re.test(e)}function Ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new TypeError("basePortletURL parameter must be a string");if(!t||"object"!==De(t))throw new TypeError("parameters argument must be an object");var n=new Set(["doAsGroupId","doAsUserId","doAsUserLanguageId","p_auth","p_auth_secret","p_f_id","p_j_a_id","p_l_id","p_l_reset","p_p_auth","p_p_cacheability","p_p_i_id","p_p_id","p_p_isolated","p_p_lifecycle","p_p_mode","p_p_resource_id","p_p_state","p_p_state_rcv","p_p_static","p_p_url_type","p_p_width","p_t_lifecycle","p_v_l_s_g_id","refererGroupId","refererPlid","saveLastPath","scroll"]);0===e.indexOf(Liferay.ThemeDisplay.getPortalURL())||Ue(e)||(e=0!==e.indexOf("/")?"".concat(Liferay.ThemeDisplay.getPortalURL(),"/").concat(e):Liferay.ThemeDisplay.getPortalURL()+e);var r=new URL(e),o=new URLSearchParams(r.search),i=t.p_p_id||o.get("p_p_id");if(Object.entries(t).length&&!i)throw new TypeError("Portlet ID must not be null if parameters are provided");var a="";return Object.entries(t).length&&(a=Te(i)),Object.keys(t).forEach((function(e){var r;r=n.has(e)?e:"".concat(a).concat(e),o.set(r,t[e])})),r.search=o.toString(),r}function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(n),!0).forEach((function(t){qe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(n),!0).forEach((function(t){We(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(n),!0).forEach((function(t){Ge(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qe(e){return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ke(e){var t=Liferay.ThemeDisplay.getDoAsUserIdEncoded(),n=new FormData;return n.append("cmd",e),n.append("p_auth",Liferay.authToken),t&&n.append("doAsUserId",t),n}function Xe(){return"".concat(Liferay.ThemeDisplay.getPortalURL()).concat(Liferay.ThemeDisplay.getPathMain(),"/portal/session_click")}var Je=Le()((function(e){return e.split("").map((function(e){return e.charCodeAt()})).join("")}));n.d(t,"portlet",(function(){return E})),Liferay.component=O,Liferay.componentReady=function e(){var t,n;if(1===arguments.length)t=arguments[0];else{t=[];for(var r=0;r<arguments.length;r++)t[r]=arguments[r]}if(Array.isArray(t))n=Promise.all(t.map((function(t){return e(t)})));else{var o=d[t];o||(d[t]=o=g()),n=o.promise}return n},Liferay.destroyComponent=j,Liferay.destroyComponents=function(e){var t=Object.keys(h);e&&(t=t.filter((function(t){return e(h[t],p[t]||{})}))),t.forEach(j)},Liferay.destroyUnfulfilledPromises=function(){d={}},Liferay.getComponentCache=function(e){var t=v[e];return t?t.state:{}},Liferay.initComponentCache=function(){Liferay.on("startNavigate",w)},Liferay.Address={getCountries:function(e){if(!Object(f.isFunction)(e))throw new TypeError("Parameter callback must be a function");Liferay.Service("/country/get-countries",{active:!0},e)},getRegions:function(e,t){if(!Object(f.isFunction)(e))throw new TypeError("Parameter callback must be a function");if(!Object(f.isString)(t))throw new TypeError("Parameter selectKey must be a string");Liferay.Service("/region/get-regions",{active:!0,countryId:parseInt(t,10)},e)}},Liferay.SideNavigation=Q,Liferay.Util.escape=o.a,Liferay.Util.fetch=K.a,Liferay.Util.formatStorage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=oe({},ae,{},t),r=n.addSpaceBeforeSuffix,o=n.decimalSeparator,i=n.denominator,a=n.suffixGB,u=n.suffixKB,c=n.suffixMB;if(!Object(f.isNumber)(e))throw new TypeError("Parameter size must be a number");var s=0,l=u;(e/=i)>=i&&(l=c,e/=i,s=1),e>=i&&(l=a,e/=i,s=1);var p=e.toFixed(s);return"."!==o&&(p=p.replace(/\./,o)),p+(r?" ":"")+l},Liferay.Util.formatXML=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ce({},Pe,{},t),r=n.newLine,o=n.tagIndent;if(!Object(f.isString)(e))throw new TypeError("Parameter content must be a string");var i=[];e=(e=(e=(e=(e=(e=e.trim()).replace(le,(function(e){return i.push(e),"<~::~CDATA~::~>"}))).replace(Ee,"><")).replace(Oe,"~::~<")).replace(_e,"~::~$1$2")).replace(Se,(function(){return i.shift()}));var a=0,u=!1,c=e.split("~::~"),s=0,l="";return c.forEach((function(e,t){le.test(e)?l+=ke(s,r,o)+e:pe.test(e)?(l+=ke(s,r,o)+e,a++,u=!0,(fe.test(e)||he.test(e))&&(a--,u=0!==a)):fe.test(e)?(l+=e,a--,u=0!==a):ve.exec(c[t-1])&&ye.exec(e)&&be.exec(c[t-1])==me.exec(e)[0].replace("/","")?(l+=e,u||--s):!ge.test(e)||we.test(e)||je.test(e)?ge.test(e)&&we.test(e)?l+=u?e:ke(s,r,o)+e:we.test(e)?l+=u?e:ke(--s,r,o)+e:je.test(e)?l+=u?e:ke(s,r,o)+e:(de.test(e),l+=ke(s,r,o)+e):l+=u?e:ke(s++,r,o)+e,new RegExp("^"+r).test(l)&&(l=l.slice(r.length))})),l},Liferay.Util.getCropRegion=function(e,t){if(!Object(f.isObject)(e)||Object(f.isObject)(e)&&"IMG"!==e.tagName)throw new TypeError("Parameter imagePreview must be an image");if(!Object(f.isObject)(t))throw new TypeError("Parameter region must be an object");var n=e.naturalWidth/e.offsetWidth,r=e.naturalHeight/e.offsetHeight;return{height:t.height?t.height*r:e.naturalHeight,width:t.width?t.width*n:e.naturalWidth,x:t.x?Math.max(t.x*n,0):0,y:t.y?Math.max(t.y*r,0):0}},Liferay.Util.getFormElement=X,Liferay.Util.getPortletNamespace=Te,Liferay.Util.groupBy=a.a,Liferay.Util.isEqual=c.a,Liferay.Util.navigate=function(e,t){Liferay.SPA&&Liferay.SPA.app&&Liferay.SPA.app.canNavigate(e)?(Liferay.SPA.app.navigate(e),t&&Object.keys(t).forEach((function(e){Liferay.once(e,t[e])}))):window.location.href=e},Liferay.Util.ns=function(e,t){var n;"object"!==Ie(t)?n=Ce(e,t):(n={},Object.keys(t).forEach((function(r){var o=r;r=Ce(e,r),n[r]=t[o]})));return n},Liferay.Util.objectToFormData=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new FormData,r=arguments.length>2?arguments[2]:void 0;return Object.entries(t).forEach((function(t){var o=Y(t,2),i=o[0],a=o[1],u=r?"".concat(r,"[").concat(i,"]"):i;Array.isArray(a)?a.forEach((function(t){e(J({},u,t),n)})):!Object(f.isObject)(a)||a instanceof File?n.append(u,a):e(a,n,u)})),n},Liferay.Util.objectToURLSearchParams=function(e){if(!Object(f.isObject)(e))throw new TypeError("Parameter obj must be an object");var t=new URLSearchParams;return Object.entries(e).forEach((function(e){var n=Me(e,2),r=n[0],o=n[1];if(Array.isArray(o))for(var i=0;i<o.length;i++)t.append(r,o[i]);else t.append(r,o)})),t},Liferay.Util.PortletURL={createActionURL:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ne(e,He({},t,{p_p_lifecycle:"1"}))},createPortletURL:Ne,createRenderURL:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ne(e,Be({},t,{p_p_lifecycle:"0"}))},createResourceURL:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ne(e,Ve({},t,{p_p_lifecycle:"2"}))}},Liferay.Util.postForm=function(e,t){if((e=ee.a.toElement(e))&&"FORM"===e.nodeName)if(e.setAttribute("method","post"),Object(f.isObject)(t)){var n=t.data,r=t.url;if(!Object(f.isObject)(n))return;ne(e,n),Object(f.isDef)(r)?Object(f.isString)(r)&&submitForm(e,r):submitForm(e)}else submitForm(e)},Liferay.Util.setFormValues=ne,Liferay.Util.toCharCode=Je,Liferay.Util.openToast=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Liferay.Loader.require("frontend-js-web/liferay/toast/commands/OpenToast.es",(function(e){e.openToast.apply(e,t)}))},Liferay.Util.Session={get:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Ke("get");return n.append("key",e),t.useHttpSession&&n.append("useHttpSession",!0),Object(K.a)(Xe(),{body:n,method:"POST"}).then((function(e){return e.text()})).then((function(e){if(e.startsWith("serialize://")){var t=e.substring("serialize://".length);e=JSON.parse(t)}return e}))},set:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Ke("set");return t&&"object"===Qe(t)&&(t="serialize://"+JSON.stringify(t)),r.append(e,t),n.useHttpSession&&r.append("useHttpSession",!0),Object(K.a)(Xe(),{body:r,method:"POST"})}},Liferay.Util.unescape=l.a}]));
//# sourceMappingURL=global.bundle.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (A, Liferay) {
  var Tabs = Liferay.namespace('Portal.Tabs');
  var ToolTip = Liferay.namespace('Portal.ToolTip');
  var BODY_CONTENT = 'bodyContent';
  var TRIGGER = 'trigger';

  Liferay.Portal.Tabs._show = function (event) {
    var names = event.names;
    var namespace = event.namespace;
    var selectedIndex = event.selectedIndex;
    var tabItem = event.tabItem;
    var tabLink = tabItem.one('a');
    var tabSection = event.tabSection;

    if (tabItem) {
      var previousTabItem = tabItem.siblings().one('.active');

      if (previousTabItem) {
        previousTabItem.removeClass('active');
      }

      tabLink.addClass('active');
    }

    if (tabSection) {
      tabSection.show();
    }

    var tabTitle = A.one('#' + event.namespace + 'dropdownTitle');

    if (tabTitle) {
      tabTitle.html(tabLink.text());
    }

    names.splice(selectedIndex, 1);
    var el;

    for (var i = 0; i < names.length; i++) {
      el = A.one('#' + namespace + Liferay.Util.toCharCode(names[i]) + 'TabsSection');

      if (el) {
        el.hide();
      }
    }
  };

  Liferay.provide(Tabs, 'show', function (namespace, names, id, callback) {
    var namespacedId = namespace + Liferay.Util.toCharCode(id);
    var tab = A.one('#' + namespacedId + 'TabsId');
    var tabSection = A.one('#' + namespacedId + 'TabsSection');

    if (tab && tabSection) {
      var details = {
        id: id,
        names: names,
        namespace: namespace,
        selectedIndex: names.indexOf(id),
        tabItem: tab,
        tabSection: tabSection
      };

      if (callback && A.Lang.isFunction(callback)) {
        callback.call(this, namespace, names, id, details);
      }

      Liferay.fire('showTab', details);
    }
  }, ['aui-base']);
  Liferay.publish('showTab', {
    defaultFn: Liferay.Portal.Tabs._show
  });

  ToolTip._getText = function (id) {
    var node = A.one('#' + id);
    var text = '';

    if (node) {
      var toolTipTextNode = node.next('.taglib-text');

      if (toolTipTextNode) {
        text = toolTipTextNode.html();
      }
    }

    return text;
  };

  ToolTip.hide = function () {
    var instance = this;
    var cached = instance._cached;

    if (cached) {
      cached.hide();
    }
  };

  Liferay.provide(ToolTip, 'show', function (obj, text, tooltipConfig) {
    var instance = this;
    var cached = instance._cached;
    var hideTooltipTask = instance._hideTooltipTask;

    if (!cached) {
      var config = A.merge({
        cssClass: 'tooltip-help',
        html: true,
        opacity: 1,
        stickDuration: 100,
        visible: false,
        zIndex: Liferay.zIndex.TOOLTIP
      }, tooltipConfig);
      cached = new A.Tooltip(config).render();
      cached.after('visibleChange', A.bind('_syncUIPosAlign', cached));
      hideTooltipTask = A.debounce('_onBoundingBoxMouseleave', cached.get('stickDuration'), cached);
      instance._hideTooltipTask = hideTooltipTask;
      instance._cached = cached;
    } else {
      cached.setAttrs(tooltipConfig);
    }

    hideTooltipTask.cancel();

    if (obj.jquery) {
      obj = obj[0];
    }

    obj = A.one(obj);

    if (text == null) {
      text = instance._getText(obj.guid());
    }

    cached.set(BODY_CONTENT, text);
    cached.set(TRIGGER, obj);
    var boundingBox = cached.get('boundingBox');
    boundingBox.detach('hover');
    obj.detach('hover');
    obj.on('hover', A.bind('_onBoundingBoxMouseenter', cached), hideTooltipTask);
    boundingBox.on('hover', function () {
      hideTooltipTask.cancel();
      obj.once('mouseenter', hideTooltipTask.cancel);
    }, hideTooltipTask);
    cached.show();
  }, ['aui-tooltip-base']);
})(AUI(), Liferay);
//# sourceMappingURL=portal.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
(function (A, Liferay) {
  var Lang = A.Lang;
  var Util = Liferay.Util;
  var STR_HEAD = 'head';
  var TPL_NOT_AJAXABLE = '<div class="alert alert-info">{0}</div>';
  var Portlet = {
    _defCloseFn: function _defCloseFn(event) {
      event.portlet.remove(true);

      if (!event.nestedPortlet) {
        var formData = Liferay.Util.objectToFormData({
          cmd: 'delete',
          doAsUserId: event.doAsUserId,
          p_auth: Liferay.authToken,
          p_l_id: event.plid,
          p_p_id: event.portletId,
          p_v_l_s_g_id: themeDisplay.getSiteGroupId()
        });
        Liferay.Util.fetch(themeDisplay.getPathMain() + '/portal/update_layout', {
          body: formData,
          method: 'POST'
        }).then(function (response) {
          if (response.ok) {
            Liferay.fire('updatedLayout');
          }
        });
      }
    },
    _loadMarkupHeadElements: function _loadMarkupHeadElements(response) {
      var markupHeadElements = response.markupHeadElements;

      if (markupHeadElements && markupHeadElements.length) {
        var head = A.one(STR_HEAD);
        head.append(markupHeadElements);
        var container = A.Node.create('<div />');
        container.plug(A.Plugin.ParseContent);
        container.setContent(markupHeadElements);
      }
    },
    _loadPortletFiles: function _loadPortletFiles(response, loadHTML) {
      var footerCssPaths = response.footerCssPaths || [];
      var headerCssPaths = response.headerCssPaths || [];
      var javascriptPaths = response.headerJavaScriptPaths || [];
      javascriptPaths = javascriptPaths.concat(response.footerJavaScriptPaths || []);
      var body = A.getBody();
      var head = A.one(STR_HEAD);

      if (headerCssPaths.length) {
        A.Get.css(headerCssPaths, {
          insertBefore: head.get('firstChild').getDOM()
        });
      }

      var lastChild = body.get('lastChild').getDOM();

      if (footerCssPaths.length) {
        A.Get.css(footerCssPaths, {
          insertBefore: lastChild
        });
      }

      var responseHTML = response.portletHTML;

      if (javascriptPaths.length) {
        A.Get.script(javascriptPaths, {
          onEnd: function onEnd() {
            loadHTML(responseHTML);
          }
        });
      } else {
        loadHTML(responseHTML);
      }
    },
    _mergeOptions: function _mergeOptions(portlet, options) {
      options = options || {};
      options.doAsUserId = options.doAsUserId || themeDisplay.getDoAsUserIdEncoded();
      options.plid = options.plid || themeDisplay.getPlid();
      options.portlet = portlet;
      options.portletId = portlet.portletId;
      return options;
    },
    _staticPortlets: {},
    destroyComponents: function destroyComponents(portletId) {
      Liferay.destroyComponents(function (_component, componentConfig) {
        return portletId === componentConfig.portletId;
      });
    },
    isStatic: function isStatic(portletId) {
      var instance = this;
      var id = Util.getPortletId(portletId.id || portletId);
      return id in instance._staticPortlets;
    },
    list: [],
    readyCounter: 0,
    refreshLayout: function refreshLayout(_portletBoundary) {},
    register: function register(portletId) {
      var instance = this;

      if (instance.list.indexOf(portletId) < 0) {
        instance.list.push(portletId);
      }
    }
  };
  Liferay.provide(Portlet, 'add', function (options) {
    var instance = this;
    Liferay.fire('initLayout');
    var doAsUserId = options.doAsUserId || themeDisplay.getDoAsUserIdEncoded();
    var plid = options.plid || themeDisplay.getPlid();
    var portletData = options.portletData;
    var portletId = options.portletId;
    var portletItemId = options.portletItemId;
    var placeHolder = options.placeHolder;

    if (!placeHolder) {
      placeHolder = A.Node.create('<div class="loading-animation" />');
    } else {
      placeHolder = A.one(placeHolder);
    }

    var beforePortletLoaded = options.beforePortletLoaded;
    var onCompleteFn = options.onComplete;

    var onComplete = function onComplete(portlet, portletId) {
      if (onCompleteFn) {
        onCompleteFn(portlet, portletId);
      }

      instance.list.push(portlet.portletId);

      if (portlet) {
        portlet.attr('data-qa-id', 'app-loaded');
      }

      Liferay.fire('addPortlet', {
        portlet: portlet
      });
    };

    var container = null;

    if (Liferay.Layout && Liferay.Layout.INITIALIZED) {
      container = Liferay.Layout.getActiveDropContainer();
    }

    if (!container) {
      return;
    }

    var currentColumnId = Util.getColumnId(container.attr('id'));
    var portletPosition = 0;

    if (options.placeHolder) {
      var column = placeHolder.get('parentNode');

      if (!column) {
        return;
      }

      placeHolder.addClass('portlet-boundary');
      var columnPortlets = column.all('.portlet-boundary');
      var nestedPortlets = column.all('.portlet-nested-portlets');
      portletPosition = columnPortlets.indexOf(placeHolder);
      var nestedPortletOffset = 0;
      nestedPortlets.some(function (nestedPortlet) {
        var nestedPortletIndex = columnPortlets.indexOf(nestedPortlet);

        if (nestedPortletIndex !== -1 && nestedPortletIndex < portletPosition) {
          nestedPortletOffset += nestedPortlet.all('.portlet-boundary').size();
        } else if (nestedPortletIndex >= portletPosition) {
          return true;
        }
      });
      portletPosition -= nestedPortletOffset;
      currentColumnId = Util.getColumnId(column.attr('id'));
    }

    var url = themeDisplay.getPathMain() + '/portal/update_layout';
    var data = {
      cmd: 'add',
      dataType: 'JSON',
      doAsUserId: doAsUserId,
      p_auth: Liferay.authToken,
      p_l_id: plid,
      p_p_col_id: currentColumnId,
      p_p_col_pos: portletPosition,
      p_p_i_id: portletItemId,
      p_p_id: portletId,
      p_p_isolated: true,
      p_v_l_s_g_id: themeDisplay.getSiteGroupId(),
      portletData: portletData
    };
    var firstPortlet = container.one('.portlet-boundary');
    var hasStaticPortlet = firstPortlet && firstPortlet.isStatic;

    if (!options.placeHolder && !options.plid) {
      if (!hasStaticPortlet) {
        container.prepend(placeHolder);
      } else {
        firstPortlet.placeAfter(placeHolder);
      }
    }

    data.currentURL = Liferay.currentURL;
    instance.addHTML({
      beforePortletLoaded: beforePortletLoaded,
      data: data,
      onComplete: onComplete,
      placeHolder: placeHolder,
      url: url
    });
  }, ['aui-base']);
  Liferay.provide(Portlet, 'addHTML', function (options) {
    var instance = this;
    var portletBoundary = null;
    var beforePortletLoaded = options.beforePortletLoaded;
    var data = options.data;
    var dataType = 'HTML';
    var onComplete = options.onComplete;
    var placeHolder = options.placeHolder;
    var url = options.url;

    if (data && Lang.isString(data.dataType)) {
      dataType = data.dataType;
    }

    dataType = dataType.toUpperCase();

    var addPortletReturn = function addPortletReturn(html) {
      var container = placeHolder.get('parentNode');
      var portletBound = A.Node.create('<div></div>');
      portletBound.plug(A.Plugin.ParseContent);
      portletBound.setContent(html);
      portletBound = portletBound.one('> *');
      var portletId;

      if (portletBound) {
        var id = portletBound.attr('id');
        portletId = Util.getPortletId(id);
        portletBound.portletId = portletId;
        placeHolder.hide();
        placeHolder.placeAfter(portletBound);
        placeHolder.remove();
        instance.refreshLayout(portletBound);

        if (window.location.hash) {
          window.location.href = window.location.hash;
        }

        portletBoundary = portletBound;
        var Layout = Liferay.Layout;

        if (Layout && Layout.INITIALIZED) {
          Layout.updateCurrentPortletInfo(portletBoundary);

          if (container) {
            Layout.syncEmptyColumnClassUI(container);
          }

          Layout.syncDraggableClassUI();
          Layout.updatePortletDropZones(portletBoundary);
        }

        if (onComplete) {
          onComplete(portletBoundary, portletId);
        }
      } else {
        placeHolder.remove();
      }

      return portletId;
    };

    if (beforePortletLoaded) {
      beforePortletLoaded(placeHolder);
    }

    Liferay.Util.fetch(url, {
      body: Liferay.Util.objectToURLSearchParams(data),
      method: 'POST'
    }).then(function (response) {
      if (dataType === 'JSON') {
        return response.json();
      } else {
        return response.text();
      }
    }).then(function (response) {
      if (dataType === 'HTML') {
        addPortletReturn(response);
      } else if (response.refresh) {
        addPortletReturn(response.portletHTML);
      } else {
        Portlet._loadMarkupHeadElements(response);

        Portlet._loadPortletFiles(response, addPortletReturn);
      }

      if (!data || !data.preventNotification) {
        Liferay.fire('updatedLayout');
      }
    })["catch"](function (error) {
      var message = typeof error === 'string' ? error : 'There\x20was\x20an\x20unexpected\x20error\x2e\x20Please\x20refresh\x20the\x20current\x20page\x2e';
      Liferay.Util.openToast({
        message: message,
        title: 'Error',
        type: 'danger'
      });
    });
  }, ['aui-parse-content']);
  Liferay.provide(Portlet, 'close', function (portlet, skipConfirm, options) {
    var instance = this;
    portlet = A.one(portlet);

    if (portlet && (skipConfirm || confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20this\x20component\x3f'))) {
      var portletId = portlet.portletId;
      var portletIndex = instance.list.indexOf(portletId);

      if (portletIndex >= 0) {
        instance.list.splice(portletIndex, 1);
      }

      options = Portlet._mergeOptions(portlet, options);
      Portlet.destroyComponents(portletId);
      Liferay.fire('destroyPortlet', options);
      Liferay.fire('closePortlet', options);
    } else {
      A.config.win.focus();
    }
  }, []);
  Liferay.provide(Portlet, 'destroy', function (portlet, options) {
    portlet = A.one(portlet);

    if (portlet) {
      var portletId = portlet.portletId || Util.getPortletId(portlet.attr('id'));
      Portlet.destroyComponents(portletId);
      Liferay.fire('destroyPortlet', Portlet._mergeOptions(portlet, options));
    }
  }, ['aui-node-base']);
  Liferay.provide(Portlet, 'minimize', function (portlet, el, options) {
    options = options || {};
    var doAsUserId = options.doAsUserId || themeDisplay.getDoAsUserIdEncoded();
    var plid = options.plid || themeDisplay.getPlid();
    portlet = A.one(portlet);

    if (portlet) {
      var content = portlet.one('.portlet-content-container');

      if (content) {
        var restore = content.hasClass('hide');
        content.toggle();
        portlet.toggleClass('portlet-minimized');
        var link = A.one(el);

        if (link) {
          var title = restore ? 'Minimize' : 'Restore';
          link.attr('alt', title);
          link.attr('title', title);
          var linkText = link.one('.taglib-text-icon');

          if (linkText) {
            linkText.html(title);
          }

          var icon = link.one('i');

          if (icon) {
            icon.removeClass('icon-minus icon-resize-vertical');

            if (restore) {
              icon.addClass('icon-minus');
            } else {
              icon.addClass('icon-resize-vertical');
            }
          }
        }

        var formData = Liferay.Util.objectToFormData({
          cmd: 'minimize',
          doAsUserId: doAsUserId,
          p_auth: Liferay.authToken,
          p_l_id: plid,
          p_p_id: portlet.portletId,
          p_p_restore: restore,
          p_v_l_s_g_id: themeDisplay.getSiteGroupId()
        });
        Liferay.Util.fetch(themeDisplay.getPathMain() + '/portal/update_layout', {
          body: formData,
          method: 'POST'
        }).then(function (response) {
          if (response.ok && restore) {
            var data = {
              doAsUserId: doAsUserId,
              p_l_id: plid,
              p_p_boundary: false,
              p_p_id: portlet.portletId,
              p_p_isolated: true
            };
            portlet.plug(A.Plugin.ParseContent);
            portlet.load(themeDisplay.getPathMain() + '/portal/render_portlet?' + A.QueryString.stringify(data));
          }
        });
      }
    }
  }, ['aui-parse-content', 'node-load', 'querystring-stringify']);
  Liferay.provide(Portlet, 'onLoad', function (options) {
    var instance = this;
    var canEditTitle = options.canEditTitle;
    var columnPos = options.columnPos;
    var isStatic = options.isStatic == 'no' ? null : options.isStatic;
    var namespacedId = options.namespacedId;
    var portletId = options.portletId;
    var refreshURL = options.refreshURL;
    var refreshURLData = options.refreshURLData;

    if (isStatic) {
      instance.registerStatic(portletId);
    }

    var portlet = A.one('#' + namespacedId);

    if (portlet && !portlet.portletProcessed) {
      portlet.portletProcessed = true;
      portlet.portletId = portletId;
      portlet.columnPos = columnPos;
      portlet.isStatic = isStatic;
      portlet.refreshURL = refreshURL;
      portlet.refreshURLData = refreshURLData; // Functions to run on portlet load

      if (canEditTitle) {
        // https://github.com/yui/yui3/issues/1808
        var events = 'focus';

        if (!A.UA.touch) {
          events = ['focus', 'mousemove'];
        }

        var handle = portlet.on(events, function () {
          Util.portletTitleEdit({
            doAsUserId: themeDisplay.getDoAsUserIdEncoded(),
            obj: portlet,
            plid: themeDisplay.getPlid(),
            portletId: portletId
          });
          handle.detach();
        });
      }
    }

    Liferay.fire('portletReady', {
      portlet: portlet,
      portletId: portletId
    });
    instance.readyCounter++;

    if (instance.readyCounter === instance.list.length) {
      Liferay.fire('allPortletsReady', {
        portletId: portletId
      });
    }
  }, ['aui-base', 'aui-timer', 'event-move']);
  Liferay.provide(Portlet, 'refresh', function (portlet, data) {
    var instance = this;
    portlet = A.one(portlet);

    if (portlet) {
      data = data || portlet.refreshURLData || {};

      if (!Object.prototype.hasOwnProperty.call(data, 'portletAjaxable')) {
        data.portletAjaxable = true;
      }

      var id = portlet.attr('portlet');
      var url = portlet.refreshURL;
      var placeHolder = A.Node.create('<div class="loading-animation" id="p_p_id' + id + '" />');

      if (data.portletAjaxable && url) {
        portlet.placeBefore(placeHolder);
        portlet.remove(true);
        Portlet.destroyComponents(portlet.portletId);
        var params = {};
        var urlPieces = url.split('?');

        if (urlPieces.length > 1) {
          params = A.QueryString.parse(urlPieces[1]);
          delete params.dataType;
          url = urlPieces[0];
        }

        instance.addHTML({
          data: A.mix(params, data, true),
          onComplete: function onComplete(portlet, portletId) {
            portlet.refreshURL = url;

            if (portlet) {
              portlet.attr('data-qa-id', 'app-refreshed');
            }

            Liferay.fire(portlet.portletId + ':portletRefreshed', {
              portlet: portlet,
              portletId: portletId
            });
          },
          placeHolder: placeHolder,
          url: url
        });
      } else if (!portlet.getData('pendingRefresh')) {
        portlet.setData('pendingRefresh', true);
        var nonAjaxableContentMessage = Lang.sub(TPL_NOT_AJAXABLE, ['This\x20change\x20will\x20only\x20be\x20shown\x20after\x20you\x20refresh\x20the\x20current\x20page\x2e']);
        var portletBody = portlet.one('.portlet-body');
        portletBody.placeBefore(nonAjaxableContentMessage);
        portletBody.hide();
      }
    }
  }, ['aui-base', 'querystring-parse']);
  Liferay.provide(Portlet, 'registerStatic', function (portletId) {
    var instance = this;
    var Node = A.Node;

    if (Node && portletId instanceof Node) {
      portletId = portletId.attr('id');
    } else if (portletId.id) {
      portletId = portletId.id;
    }

    var id = Util.getPortletId(portletId);
    instance._staticPortlets[id] = true;
  }, ['aui-base']);
  Liferay.provide(Portlet, 'openWindow', function (options) {
    var bodyCssClass = options.bodyCssClass;
    var destroyOnHide = options.destroyOnHide;
    var namespace = options.namespace;
    var portlet = options.portlet;
    var subTitle = options.subTitle;
    var title = options.title;
    var uri = options.uri;
    portlet = A.one(portlet);

    if (portlet && uri) {
      var portletTitle = portlet.one('.portlet-title') || portlet.one('.portlet-title-default');
      var titleHtml = title;

      if (portletTitle) {
        if (portlet.one('#cpPortletTitle')) {
          titleHtml = portletTitle.one('.portlet-title-text').outerHTML() + ' - ' + titleHtml;
        } else {
          titleHtml = portletTitle.text() + ' - ' + titleHtml;
        }
      }

      if (subTitle) {
        titleHtml += '<div class="portlet-configuration-subtitle small"><span class="portlet-configuration-subtitle-text">' + subTitle + '</span></div>';
      }

      Liferay.Util.openWindow({
        cache: false,
        dialog: {
          destroyOnHide: destroyOnHide
        },
        dialogIframe: {
          bodyCssClass: bodyCssClass,
          id: namespace + 'configurationIframe',
          uri: uri
        },
        id: namespace + 'configurationIframeDialog',
        title: titleHtml,
        uri: uri
      }, function (dialog) {
        dialog.once('drag:init', function () {
          dialog.dd.addInvalid('.portlet-configuration-subtitle-text');
        });
      });
    }
  }, ['liferay-util-window']);
  Liferay.publish('closePortlet', {
    defaultFn: Portlet._defCloseFn
  });
  Liferay.publish('allPortletsReady', {
    fireOnce: true
  }); // Backwards compatability

  Portlet.ready = function (fn) {
    Liferay.on('portletReady', function (event) {
      fn(event.portletId, event.portlet);
    });
  };

  Liferay.Portlet = Portlet;
})(AUI(), Liferay);
//# sourceMappingURL=portlet.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
Liferay.Workflow = {
  ACTION_PUBLISH: 1,
  ACTION_SAVE_DRAFT: 2,
  STATUS_ANY: -1,
  STATUS_APPROVED: 0,
  STATUS_DENIED: 4,
  STATUS_DRAFT: 2,
  STATUS_EXPIRED: 3,
  STATUS_PENDING: 1
};
//# sourceMappingURL=workflow.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
AUI.add('liferay-form', function (A) {
  var AArray = A.Array;
  var Lang = A.Lang;
  var DEFAULTS_FORM_VALIDATOR = A.config.FormValidator;
  var defaultAcceptFiles = DEFAULTS_FORM_VALIDATOR.RULES.acceptFiles;
  var TABS_SECTION_STR = 'TabsSection';
  var REGEX_EMAIL = /^[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:\w(?:[\w-]*\w)?\.)+(\w(?:[\w-]*\w))$/;
  var REGEX_NUMBER = /^[+-]?(\d+)([.|,]\d+)*([eE][+-]?\d+)?$/;
  var REGEX_URL = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(https?:\/\/|www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))((.*):(\d*)\/?(.*))?)/;

  var acceptFiles = function acceptFiles(val, node, ruleValue) {
    if (ruleValue && ruleValue.split(',').includes('*')) {
      return true;
    }

    return defaultAcceptFiles(val, node, ruleValue);
  };

  var email = function email(val) {
    return REGEX_EMAIL.test(val);
  };

  var maxFileSize = function maxFileSize(_val, node, ruleValue) {
    var nodeType = node.get('type').toLowerCase();

    if (nodeType === 'file') {
      return ruleValue === 0 || node._node.files[0].size <= ruleValue;
    }

    return true;
  };

  var number = function number(val, _node, _ruleValue) {
    return REGEX_NUMBER && REGEX_NUMBER.test(val);
  };

  var url = function url(val, _node, _ruleValue) {
    return REGEX_URL && REGEX_URL.test(val);
  };

  A.mix(DEFAULTS_FORM_VALIDATOR.RULES, {
    acceptFiles: acceptFiles,
    email: email,
    maxFileSize: maxFileSize,
    number: number,
    url: url
  }, true);
  A.mix(DEFAULTS_FORM_VALIDATOR.STRINGS, {
    DEFAULT: 'Please\x20fix\x20this\x20field\x2e',
    acceptFiles: 'Please\x20enter\x20a\x20file\x20with\x20a\x20valid\x20extension\x20\x28\x7b0\x7d\x29\x2e',
    alpha: 'Please\x20enter\x20only\x20alpha\x20characters\x2e',
    alphanum: 'Please\x20enter\x20only\x20alphanumeric\x20characters\x2e',
    date: 'Please\x20enter\x20a\x20valid\x20date\x2e',
    digits: 'Please\x20enter\x20only\x20digits\x2e',
    email: 'Please\x20enter\x20a\x20valid\x20email\x20address\x2e',
    equalTo: 'Please\x20enter\x20the\x20same\x20value\x20again\x2e',
    max: 'Please\x20enter\x20a\x20value\x20less\x20than\x20or\x20equal\x20to\x20\x7b0\x7d\x2e',
    maxFileSize: 'Please\x20enter\x20a\x20file\x20with\x20a\x20valid\x20file\x20size\x20no\x20larger\x20than\x20\x7b0\x7d\x2e',
    maxLength: 'Please\x20enter\x20no\x20more\x20than\x20\x7b0\x7d\x20characters\x2e',
    min: 'Please\x20enter\x20a\x20value\x20greater\x20than\x20or\x20equal\x20to\x20\x7b0\x7d\x2e',
    minLength: 'Please\x20enter\x20at\x20least\x20\x7b0\x7d\x20characters\x2e',
    number: 'Please\x20enter\x20a\x20valid\x20number\x2e',
    range: 'Please\x20enter\x20a\x20value\x20between\x20\x7b0\x7d\x20and\x20\x7b1\x7d\x2e',
    rangeLength: 'Please\x20enter\x20a\x20value\x20between\x20\x7b0\x7d\x20and\x20\x7b1\x7d\x20characters\x20long\x2e',
    required: 'This\x20field\x20is\x20required\x2e',
    url: 'Please\x20enter\x20a\x20valid\x20URL\x2e'
  }, true);
  var Form = A.Component.create({
    _INSTANCES: {},
    ATTRS: {
      fieldRules: {
        setter: function setter(val) {
          var instance = this;

          instance._processFieldRules(val);

          return val;
        }
      },
      id: {},
      namespace: {},
      onSubmit: {
        valueFn: function valueFn() {
          var instance = this;
          return instance._onSubmit;
        }
      },
      validateOnBlur: {
        validator: Lang.isBoolean,
        value: true
      }
    },
    EXTENDS: A.Base,
    get: function get(id) {
      var instance = this;
      return instance._INSTANCES[id];
    },
    prototype: {
      _afterGetFieldsByName: function _afterGetFieldsByName(fieldName) {
        var instance = this;
        var editorString = 'Editor';

        if (fieldName.lastIndexOf(editorString) === fieldName.length - editorString.length) {
          var formNode = instance.formNode;
          return new A.Do.AlterReturn('Return editor dom element', formNode.one('#' + fieldName));
        }
      },
      _bindForm: function _bindForm() {
        var instance = this;
        var formNode = instance.formNode;
        var formValidator = instance.formValidator;
        formValidator.on('submit', A.bind('_onValidatorSubmit', instance));
        formValidator.on('submitError', A.bind('_onSubmitError', instance));
        formNode.delegate(['blur', 'focus'], A.bind('_onFieldFocusChange', instance), 'button,input,select,textarea');
        formNode.delegate(['blur', 'input'], A.bind('_onEditorBlur', instance), 'div[contenteditable="true"]');
        A.Do.after('_afterGetFieldsByName', formValidator, 'getFieldsByName', instance);
      },
      _defaultSubmitFn: function _defaultSubmitFn(event) {
        var instance = this;

        if (!event.stopped) {
          submitForm(instance.form);
        }
      },
      _findRuleIndex: function _findRuleIndex(fieldRules, fieldName, validatorName) {
        var ruleIndex = -1;
        AArray.some(fieldRules, function (element, index) {
          if (element.fieldName === fieldName && element.validatorName === validatorName) {
            ruleIndex = index;
            return true;
          }
        });
        return ruleIndex;
      },
      _focusInvalidFieldTab: function _focusInvalidFieldTab() {
        var instance = this;
        var formNode = instance.formNode;
        var field = formNode.one('.' + instance.formValidator.get('errorClass'));

        if (field) {
          var fieldWrapper = field.ancestor('form > div');
          var formTabs = formNode.one('.lfr-nav');

          if (fieldWrapper && formTabs) {
            var tabs = formTabs.all('.nav-item');
            var tabsNamespace = formTabs.getAttribute('data-tabs-namespace');
            var tabNames = AArray.map(tabs._nodes, function (tab) {
              return tab.getAttribute('data-tab-name');
            });
            var fieldWrapperId = fieldWrapper.getAttribute('id').slice(0, -TABS_SECTION_STR.length);
            var fieldTabId = AArray.find(tabs._nodes, function (tab) {
              return tab.getAttribute('id').indexOf(fieldWrapperId) !== -1;
            });
            Liferay.Portal.Tabs.show(tabsNamespace, tabNames, fieldTabId.getAttribute('data-tab-name'));
          }
        }
      },
      _onEditorBlur: function _onEditorBlur(event) {
        var instance = this;
        var formValidator = instance.formValidator;
        formValidator.validateField(event.target);
      },
      _onFieldFocusChange: function _onFieldFocusChange(event) {
        var row = event.currentTarget.ancestor('.field');

        if (row) {
          row.toggleClass('field-focused', event.type === 'focus');
        }
      },
      _onSubmit: function _onSubmit(event) {
        var instance = this;
        event.preventDefault();
        setTimeout(function () {
          instance._defaultSubmitFn(event);
        }, 0);
      },
      _onSubmitError: function _onSubmitError() {
        var instance = this;
        var collapsiblePanels = instance.formNode.all('.panel-collapse');
        collapsiblePanels.each(function (panel) {
          var errorFields = panel.get('children').all('.has-error');

          if (errorFields.size() > 0 && !panel.hasClass('in')) {
            var panelNode = panel.getDOM();
            AUI.$(panelNode).collapse('show');
          }
        });
      },
      _onValidatorSubmit: function _onValidatorSubmit(event) {
        var instance = this;
        var onSubmit = instance.get('onSubmit');
        onSubmit.call(instance, event.validator.formEvent);
      },
      _processFieldRule: function _processFieldRule(rules, strings, rule) {
        var instance = this;
        var value = true;
        var fieldName = rule.fieldName;
        var validatorName = rule.validatorName;
        var field = this.formValidator.getField(fieldName);

        if (field) {
          var fieldNode = field.getDOMNode();
          A.Do.after('_setFieldAttribute', fieldNode, 'setAttribute', instance, fieldName);
          A.Do.after('_removeFieldAttribute', fieldNode, 'removeAttribute', instance, fieldName);
        }

        if ((rule.body || rule.body === 0) && !rule.custom) {
          value = rule.body;
        }

        var fieldRules = rules[fieldName];

        if (!fieldRules) {
          fieldRules = {};
          rules[fieldName] = fieldRules;
        }

        fieldRules[validatorName] = value;

        if (rule.custom) {
          DEFAULTS_FORM_VALIDATOR.RULES[validatorName] = rule.body;
        }

        var errorMessage = rule.errorMessage;

        if (errorMessage) {
          var fieldStrings = strings[fieldName];

          if (!fieldStrings) {
            fieldStrings = {};
            strings[fieldName] = fieldStrings;
          }

          fieldStrings[validatorName] = errorMessage;
        }
      },
      _processFieldRules: function _processFieldRules(fieldRules) {
        var instance = this;

        if (!fieldRules) {
          fieldRules = instance.get('fieldRules');
        }

        var fieldStrings = {};
        var rules = {};

        for (var rule in fieldRules) {
          instance._processFieldRule(rules, fieldStrings, fieldRules[rule]);
        }

        var formValidator = instance.formValidator;

        if (formValidator) {
          formValidator.set('fieldStrings', fieldStrings);
          formValidator.set('rules', rules);
        }
      },
      _removeFieldAttribute: function _removeFieldAttribute(name, fieldName) {
        if (name === 'disabled') {
          this.formValidator.validateField(fieldName);
        }
      },
      _setFieldAttribute: function _setFieldAttribute(name, value, fieldName) {
        if (name === 'disabled') {
          this.formValidator.resetField(fieldName);
        }
      },
      _validatable: function _validatable(field) {
        var result;

        if (field.test(':disabled')) {
          result = new A.Do.Halt();
        }

        return result;
      },
      addRule: function addRule(fieldName, validatorName, errorMessage, body, custom) {
        var instance = this;
        var fieldRules = instance.get('fieldRules');

        var ruleIndex = instance._findRuleIndex(fieldRules, fieldName, validatorName);

        if (ruleIndex == -1) {
          fieldRules.push({
            body: body || '',
            custom: custom || false,
            errorMessage: errorMessage || '',
            fieldName: fieldName,
            validatorName: validatorName
          });

          instance._processFieldRules(fieldRules);
        }
      },
      initializer: function initializer() {
        var instance = this;
        var id = instance.get('id');
        var form = document[id];
        var formNode = A.one(form);
        instance.form = form;
        instance.formNode = formNode;

        if (formNode) {
          var formValidator = new A.FormValidator({
            boundingBox: formNode,
            validateOnBlur: instance.get('validateOnBlur')
          });
          A.Do.before('_focusInvalidFieldTab', formValidator, 'focusInvalidField', instance);
          A.Do.before('_validatable', formValidator, 'validatable', instance);
          instance.formValidator = formValidator;

          instance._processFieldRules();

          instance._bindForm();
        }
      },
      removeRule: function removeRule(fieldName, validatorName) {
        var instance = this;
        var fieldRules = instance.get('fieldRules');

        var ruleIndex = instance._findRuleIndex(fieldRules, fieldName, validatorName);

        if (ruleIndex != -1) {
          var rule = fieldRules[ruleIndex];
          instance.formValidator.resetField(rule.fieldName);
          fieldRules.splice(ruleIndex, 1);

          instance._processFieldRules(fieldRules);
        }
      }
    },

    /*
     * @deprecated since 7.2, unused
     */
    register: function register(config) {
      var instance = this;
      var form = new Liferay.Form(config);
      var formName = config.id || config.namespace;
      instance._INSTANCES[formName] = form;
      Liferay.fire('form:registered', {
        form: form,
        formName: formName
      });
      return form;
    }
  });
  Liferay.Form = Form;
}, '', {
  requires: ['aui-base', 'aui-form-validator']
});
//# sourceMappingURL=form.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

/**
 * The Form Placeholders Component.
 *
 * @deprecated since 7.2, unused
 * @module liferay-form-placeholders
 */
AUI.add('liferay-form-placeholders', function (A) {
  var ANode = A.Node;
  var CSS_PLACEHOLDER = 'text-placeholder';
  var MAP_IGNORE_ATTRS = {
    id: 1,
    name: 1,
    type: 1
  };
  var SELECTOR_PLACEHOLDER_INPUTS = 'input[placeholder], textarea[placeholder]';
  var STR_BLANK = '';
  var STR_DATA_TYPE_PASSWORD_PLACEHOLDER = 'data-type-password-placeholder';
  var STR_FOCUS = 'focus';
  var STR_PASSWORD = 'password';
  var STR_PLACEHOLDER = 'placeholder';
  var STR_SPACE = ' ';
  var STR_TYPE = 'type';
  var Placeholders = A.Component.create({
    EXTENDS: A.Plugin.Base,
    NAME: 'placeholders',
    NS: STR_PLACEHOLDER,
    prototype: {
      _initializePasswordNode: function _initializePasswordNode(field) {
        var placeholder = ANode.create('<input name="' + field.attr('name') + '_pass_placeholder" type="text" />');
        Liferay.Util.getAttributes(field, function (value, name) {
          var result = false;

          if (!MAP_IGNORE_ATTRS[name]) {
            if (name === 'class') {
              value += STR_SPACE + CSS_PLACEHOLDER;
            }

            placeholder.setAttribute(name, value);
          }

          return result;
        });
        placeholder.val(field.attr(STR_PLACEHOLDER));
        placeholder.attr(STR_DATA_TYPE_PASSWORD_PLACEHOLDER, true);
        field.placeBefore(placeholder);
        field.hide();
      },
      _removePlaceholders: function _removePlaceholders() {
        var instance = this;
        var formNode = instance.host.formNode;
        var placeholderInputs = formNode.all(SELECTOR_PLACEHOLDER_INPUTS);
        placeholderInputs.each(function (item) {
          if (item.val() == item.attr(STR_PLACEHOLDER)) {
            item.val(STR_BLANK);
          }
        });
      },
      _toggleLocalizedPlaceholders: function _toggleLocalizedPlaceholders(event, currentTarget) {
        var placeholder = currentTarget.attr(STR_PLACEHOLDER);

        if (placeholder) {
          var value = currentTarget.val();

          if (event.type === STR_FOCUS) {
            if (value === placeholder) {
              currentTarget.removeClass(CSS_PLACEHOLDER);
            }
          } else if (!value) {
            currentTarget.val(placeholder);
            currentTarget.addClass(CSS_PLACEHOLDER);
          }
        }
      },
      _togglePasswordPlaceholders: function _togglePasswordPlaceholders(event, currentTarget) {
        var placeholder = currentTarget.attr(STR_PLACEHOLDER);

        if (placeholder) {
          if (event.type === STR_FOCUS) {
            if (currentTarget.hasAttribute(STR_DATA_TYPE_PASSWORD_PLACEHOLDER)) {
              currentTarget.hide();
              var passwordField = currentTarget.next();
              passwordField.show();
              setTimeout(function () {
                Liferay.Util.focusFormField(passwordField);
              }, 0);
            }
          } else if (currentTarget.attr(STR_TYPE) === STR_PASSWORD) {
            var value = currentTarget.val();

            if (!value) {
              currentTarget.hide();
              currentTarget.previous().show();
            }
          }
        }
      },
      _togglePlaceholders: function _togglePlaceholders(event) {
        var instance = this;
        var currentTarget = event.currentTarget;

        if (currentTarget.hasAttribute(STR_DATA_TYPE_PASSWORD_PLACEHOLDER) || currentTarget.attr(STR_TYPE) === STR_PASSWORD) {
          instance._togglePasswordPlaceholders(event, currentTarget);
        } else if (currentTarget.hasClass('language-value')) {
          instance._toggleLocalizedPlaceholders(event, currentTarget);
        } else {
          var placeholder = currentTarget.attr(STR_PLACEHOLDER);

          if (placeholder) {
            var value = currentTarget.val();

            if (event.type === STR_FOCUS) {
              if (value === placeholder) {
                currentTarget.val(STR_BLANK);
                currentTarget.removeClass(CSS_PLACEHOLDER);
              }
            } else if (!value) {
              currentTarget.val(placeholder);
              currentTarget.addClass(CSS_PLACEHOLDER);
            }
          }
        }
      },
      initializer: function initializer() {
        var instance = this;
        var host = instance.get('host');
        var formNode = host.formNode;

        if (formNode) {
          var placeholderInputs = formNode.all(SELECTOR_PLACEHOLDER_INPUTS);
          placeholderInputs.each(function (item) {
            if (!item.val()) {
              if (item.attr(STR_TYPE) === STR_PASSWORD) {
                instance._initializePasswordNode(item);
              } else {
                item.addClass(CSS_PLACEHOLDER);
                item.val(item.attr(STR_PLACEHOLDER));
              }
            }
          });
          instance.host = host;
          instance.beforeHostMethod('_onValidatorSubmit', instance._removePlaceholders, instance);
          instance.beforeHostMethod('_onFieldFocusChange', instance._togglePlaceholders, instance);
        }
      }
    }
  });
  Liferay.Form.Placeholders = Placeholders;
  A.Base.plug(Liferay.Form, Placeholders);
}, '', {
  requires: ['liferay-form', 'plugin']
});
//# sourceMappingURL=form_placeholders.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

/**
 * The Icon Component.
 *
 * @deprecated since 7.2, unused
 * @module liferay-icon
 */
AUI.add('liferay-icon', function (A) {
  var _ICON_REGISTRY = {};
  var Icon = {
    _forcePost: function _forcePost(event) {
      if (!Liferay.SPA || !Liferay.SPA.app) {
        Liferay.Util.forcePost(event.currentTarget);
        event.preventDefault();
      }
    },
    _getConfig: function _getConfig(event) {
      return _ICON_REGISTRY[event.currentTarget.attr('id')];
    },
    _handleDocClick: function _handleDocClick(event) {
      var instance = this;

      var config = instance._getConfig(event);

      if (config) {
        event.preventDefault();

        if (config.useDialog) {
          instance._useDialog(event);
        } else {
          instance._forcePost(event);
        }
      }
    },
    _handleDocMouseOut: function _handleDocMouseOut(event) {
      var instance = this;

      var config = instance._getConfig(event);

      if (config && config.srcHover) {
        instance._onMouseHover(event, config.src);
      }
    },
    _handleDocMouseOver: function _handleDocMouseOver(event) {
      var instance = this;

      var config = instance._getConfig(event);

      if (config && config.srcHover) {
        instance._onMouseHover(event, config.srcHover);
      }
    },
    _onMouseHover: function _onMouseHover(event, src) {
      var img = event.currentTarget.one('img');

      if (img) {
        img.attr('src', src);
      }
    },
    _useDialog: function _useDialog(event) {
      Liferay.Util.openInDialog(event, {
        dialog: {
          destroyOnHide: true
        },
        dialogIframe: {
          bodyCssClass: 'dialog-with-footer'
        }
      });
    },
    register: function register(config) {
      var instance = this;
      var doc = A.one(A.config.doc);
      _ICON_REGISTRY[config.id] = config;

      if (!instance._docClickHandler) {
        instance._docClickHandler = doc.delegate('click', instance._handleDocClick, '.lfr-icon-item', instance);
      }

      if (!instance._docHoverHandler) {
        instance._docHoverHandler = doc.delegate('hover', instance._handleDocMouseOver, instance._handleDocMouseOut, '.lfr-icon-item', instance);
      }

      Liferay.once('screenLoad', function () {
        delete _ICON_REGISTRY[config.id];
      });
    }
  };
  Liferay.Icon = Icon;
}, '', {
  requires: ['aui-base', 'liferay-util-window']
});
//# sourceMappingURL=icon.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
AUI.add('liferay-menu', function (A) {
  var Util = Liferay.Util;
  var ARIA_ATTR_ROLE = 'role';
  var ATTR_CLASS_NAME = 'className';
  var AUTO = 'auto';
  var CSS_BTN_PRIMARY = 'btn-primary';
  var CSS_EXTENDED = 'lfr-extended';
  var CSS_OPEN = 'open';
  var CSS_PORTLET = '.portlet';
  var DEFAULT_ALIGN_POINTS = ['tl', 'bl'];
  var EVENT_CLICK = 'click';
  var PARENT_NODE = 'parentNode';
  var STR_BOTTOM = 'b';
  var STR_LEFT = 'l';
  var STR_LTR = 'ltr';
  var STR_RIGHT = 'r';
  var STR_RTL = 'rtl';
  var STR_TOP = 't';
  var MAP_ALIGN_HORIZONTAL_OVERLAY = {
    left: STR_RIGHT,
    right: STR_LEFT
  };
  var MAP_ALIGN_HORIZONTAL_OVERLAY_RTL = {
    left: STR_LEFT,
    right: STR_RIGHT
  };
  var MAP_ALIGN_HORIZONTAL_TRIGGER = {
    left: STR_LEFT,
    right: STR_RIGHT
  };
  var MAP_ALIGN_HORIZONTAL_TRIGGER_RTL = {
    left: STR_RIGHT,
    right: STR_LEFT
  };
  var MAP_ALIGN_VERTICAL_OVERLAY = {
    down: STR_TOP,
    up: STR_BOTTOM
  };
  var MAP_ALIGN_VERTICAL_TRIGGER = {
    down: STR_BOTTOM,
    up: STR_TOP
  };
  var MAP_LIVE_SEARCH = {};
  var REGEX_DIRECTION = /\bdirection-(down|left|right|up)\b/;
  var REGEX_MAX_DISPLAY_ITEMS = /max-display-items-(\d+)/;
  var SELECTOR_ANCHOR = 'a';
  var SELECTOR_LIST_ITEM = 'li';
  var SELECTOR_SEARCH_CONTAINER = '.lfr-menu-list-search-container';
  var TPL_MENU = '<div class="open" />';

  var Menu = function Menu() {
    var instance = this;
    instance._handles = [];

    if (!Menu._INSTANCE) {
      Menu._INSTANCE = instance;
    }
  };

  Menu.prototype = {
    _closeActiveMenu: function _closeActiveMenu() {
      var instance = this;
      var menu = instance._activeMenu;

      if (menu) {
        var handles = instance._handles;
        A.Array.invoke(handles, 'detach');
        handles.length = 0;
        var overlay = instance._overlay;

        if (overlay) {
          overlay.hide();
        }

        var trigger = instance._activeTrigger;
        instance._activeMenu = null;
        instance._activeTrigger = null;

        if (trigger.hasClass(CSS_EXTENDED)) {
          trigger.removeClass(CSS_BTN_PRIMARY);
        } else {
          trigger.get(PARENT_NODE).removeClass(CSS_OPEN);
          var portlet = trigger.ancestor(CSS_PORTLET);

          if (portlet) {
            portlet.removeClass(CSS_OPEN);
          }
        }
      }
    },
    _getAlignPoints: A.cached(function (cssClass) {
      var alignPoints = DEFAULT_ALIGN_POINTS;
      var defaultOverlayHorizontalAlign = STR_RIGHT;
      var defaultTriggerHorizontalAlign = STR_LEFT;
      var mapAlignHorizontalOverlay = MAP_ALIGN_HORIZONTAL_OVERLAY;
      var mapAlignHorizontalTrigger = MAP_ALIGN_HORIZONTAL_TRIGGER;
      var langDir = Liferay.Language.direction[themeDisplay.getLanguageId()] || STR_LTR;

      if (langDir === STR_RTL) {
        defaultOverlayHorizontalAlign = STR_LEFT;
        defaultTriggerHorizontalAlign = STR_RIGHT;
        mapAlignHorizontalOverlay = MAP_ALIGN_HORIZONTAL_OVERLAY_RTL;
        mapAlignHorizontalTrigger = MAP_ALIGN_HORIZONTAL_TRIGGER_RTL;
      }

      if (cssClass.indexOf(AUTO) === -1) {
        var directionMatch = cssClass.match(REGEX_DIRECTION);
        var direction = directionMatch && directionMatch[1] || AUTO;

        if (direction != 'down') {
          var overlayHorizontal = mapAlignHorizontalOverlay[direction] || defaultOverlayHorizontalAlign;
          var overlayVertical = MAP_ALIGN_VERTICAL_OVERLAY[direction] || STR_TOP;
          var triggerHorizontal = mapAlignHorizontalTrigger[direction] || defaultTriggerHorizontalAlign;
          var triggerVertical = MAP_ALIGN_VERTICAL_TRIGGER[direction] || STR_TOP;
          alignPoints = [overlayVertical + overlayHorizontal, triggerVertical + triggerHorizontal];
        }
      }

      return alignPoints;
    }),
    _getMenu: function _getMenu(trigger) {
      var instance = this;
      var overlay = instance._overlay;

      if (!overlay) {
        var MenuOverlay = A.Component.create({
          AUGMENTS: [A.WidgetCssClass, A.WidgetPosition, A.WidgetStdMod, A.WidgetModality, A.WidgetPositionAlign, A.WidgetPositionConstrain, A.WidgetStack],
          CSS_PREFIX: 'overlay',
          EXTENDS: A.Widget,
          NAME: 'overlay'
        });
        overlay = new MenuOverlay({
          align: {
            node: trigger,
            points: DEFAULT_ALIGN_POINTS
          },
          constrain: true,
          hideClass: false,
          preventOverlap: true,
          zIndex: Liferay.zIndex.MENU
        }).render();
        Liferay.once('beforeScreenFlip', function () {
          overlay.destroy();
          instance._overlay = null;
        });
        instance._overlay = overlay;
      } else {
        overlay.set('align.node', trigger);
      }

      var listContainer = trigger.getData('menuListContainer');
      var menu = trigger.getData('menu');
      var menuHeight = trigger.getData('menuHeight');
      var liveSearch = menu && MAP_LIVE_SEARCH[menu.guid()];

      if (liveSearch) {
        liveSearch.reset();
      }

      var listItems;

      if (!menu || !listContainer) {
        listContainer = trigger.next('ul');
        listItems = listContainer.all(SELECTOR_LIST_ITEM);
        menu = A.Node.create(TPL_MENU);
        listContainer.placeBefore(menu);
        listItems.last().addClass('last');
        menu.append(listContainer);
        trigger.setData('menuListContainer', listContainer);
        trigger.setData('menu', menu);

        instance._setARIARoles(trigger, menu, listContainer);

        if (trigger.hasClass('select')) {
          listContainer.delegate('click', function (event) {
            var selectedListItem = event.currentTarget;
            var selectedListItemIcon = selectedListItem.one('i');
            var triggerIcon = trigger.one('i');

            if (selectedListItemIcon && triggerIcon) {
              var selectedListItemIconClass = selectedListItemIcon.attr('class');
              triggerIcon.attr('class', selectedListItemIconClass);
            }

            var selectedListItemMessage = selectedListItem.one('.lfr-icon-menu-text');
            var triggerMessage = trigger.one('.lfr-icon-menu-text');

            if (selectedListItemMessage && triggerMessage) {
              triggerMessage.setContent(selectedListItemMessage.text());
            }
          }, SELECTOR_LIST_ITEM);
        }
      }

      overlay.setStdModContent(A.WidgetStdMod.BODY, menu);

      if (!menuHeight) {
        menuHeight = instance._getMenuHeight(trigger, menu, listItems || listContainer.all(SELECTOR_LIST_ITEM));
        trigger.setData('menuHeight', menuHeight);

        if (menuHeight !== AUTO) {
          listContainer.setStyle('maxHeight', menuHeight);
        }
      }

      instance._getFocusManager();

      return menu;
    },
    _getMenuHeight: function _getMenuHeight(trigger, menu, listItems) {
      var instance = this;
      var cssClass = trigger.attr(ATTR_CLASS_NAME);
      var height = AUTO;

      if (cssClass.indexOf('lfr-menu-expanded') === -1) {
        var params = REGEX_MAX_DISPLAY_ITEMS.exec(cssClass);
        var maxDisplayItems = params && parseInt(params[1], 10);

        if (maxDisplayItems && listItems.size() > maxDisplayItems) {
          instance._getLiveSearch(trigger, trigger.getData('menu'));

          height = 0;
          var heights = listItems.slice(0, maxDisplayItems).get('offsetHeight');

          for (var i = heights.length - 1; i >= 0; i--) {
            height += heights[i];
          }
        }
      }

      return height;
    },
    _positionActiveMenu: function _positionActiveMenu() {
      var instance = this;
      var menu = instance._activeMenu;
      var trigger = instance._activeTrigger;

      if (menu) {
        var cssClass = trigger.attr(ATTR_CLASS_NAME);
        var overlay = instance._overlay;
        var align = overlay.get('align');
        var listNode = menu.one('ul');
        var listNodeHeight = listNode.get('offsetHeight');
        var listNodeWidth = listNode.get('offsetWidth');
        var modalMask = false;
        align.points = instance._getAlignPoints(cssClass);
        menu.addClass('lfr-icon-menu-open');

        if (Util.isPhone() || Util.isTablet()) {
          overlay.hide();
          modalMask = true;
        }

        overlay.setAttrs({
          align: align,
          centered: false,
          height: listNodeHeight,
          modal: modalMask,
          width: listNodeWidth
        });

        if (!Util.isPhone() && !Util.isTablet()) {
          var focusManager = overlay.bodyNode.focusManager;

          if (focusManager) {
            focusManager.focus(0);
          }
        }

        overlay.show();

        if (cssClass.indexOf(CSS_EXTENDED) > -1) {
          trigger.addClass(CSS_BTN_PRIMARY);
        } else {
          trigger.get(PARENT_NODE).addClass(CSS_OPEN);
          var portlet = trigger.ancestor(CSS_PORTLET);

          if (portlet) {
            portlet.addClass(CSS_OPEN);
          }
        }
      }
    },
    _setARIARoles: function _setARIARoles(trigger, menu) {
      var links = menu.all(SELECTOR_ANCHOR);
      var searchContainer = menu.one(SELECTOR_SEARCH_CONTAINER);
      var listNode = menu.one('ul');
      var ariaLinksAttr = 'menuitem';
      var ariaListNodeAttr = 'menu';

      if (searchContainer) {
        ariaListNodeAttr = 'listbox';
        ariaListNodeAttr = 'option';
      }

      listNode.setAttribute(ARIA_ATTR_ROLE, ariaListNodeAttr);
      links.set(ARIA_ATTR_ROLE, ariaLinksAttr);
      trigger.attr({
        'aria-haspopup': true,
        role: 'button'
      });
      listNode.setAttribute('aria-labelledby', trigger.guid());
    }
  };

  Menu.handleFocus = function (id) {
    var node = A.one(id);

    if (node) {
      node.delegate('mouseenter', A.rbind(Menu._targetLink, node, 'focus'), SELECTOR_LIST_ITEM);
      node.delegate('mouseleave', A.rbind(Menu._targetLink, node, 'blur'), SELECTOR_LIST_ITEM);
    }
  };

  var buffer = [];

  Menu.register = function (id) {
    var menuNode = document.getElementById(id);

    if (menuNode) {
      if (!Menu._INSTANCE) {
        new Menu();
      }

      buffer.push(menuNode);

      Menu._registerTask();
    }
  };

  Menu._registerTask = A.debounce(function () {
    if (buffer.length) {
      var nodes = A.all(buffer);
      nodes.on(EVENT_CLICK, A.bind('_registerMenu', Menu));
      buffer.length = 0;
    }
  }, 100);

  Menu._targetLink = function (event, action) {
    var anchor = event.currentTarget.one(SELECTOR_ANCHOR);

    if (anchor) {
      anchor[action]();
    }
  };

  Liferay.provide(Menu, '_getFocusManager', function () {
    var menuInstance = Menu._INSTANCE;
    var focusManager = menuInstance._focusManager;

    if (!focusManager) {
      var bodyNode = menuInstance._overlay.bodyNode;
      bodyNode.plug(A.Plugin.NodeFocusManager, {
        circular: true,
        descendants: 'li:not(.hide) a,input',
        focusClass: 'focus',
        keys: {
          next: 'down:40',
          previous: 'down:38'
        }
      });
      bodyNode.on('key', function () {
        var activeTrigger = menuInstance._activeTrigger;

        if (activeTrigger) {
          menuInstance._closeActiveMenu();

          activeTrigger.focus();
        }
      }, 'down:27,9');
      focusManager = bodyNode.focusManager;
      bodyNode.delegate('mouseenter', function (event) {
        if (focusManager.get('focused')) {
          focusManager.focus(event.currentTarget.one(SELECTOR_ANCHOR));
        }
      }, SELECTOR_LIST_ITEM);
      focusManager.after('activeDescendantChange', function (event) {
        var descendants = focusManager.get('descendants');
        var selectedItem = descendants.item(event.newVal);

        if (selectedItem) {
          var overlayList = bodyNode.one('ul');

          if (overlayList) {
            overlayList.setAttribute('aria-activedescendant', selectedItem.guid());
          }
        }
      });
      menuInstance._focusManager = focusManager;
    }

    focusManager.refresh();
  }, ['node-focusmanager'], true);
  Liferay.provide(Menu, '_getLiveSearch', function (_trigger, menu) {
    var id = menu.guid();
    var liveSearch = MAP_LIVE_SEARCH[id];

    if (!liveSearch) {
      var listNode = menu.one('ul');
      var results = [];
      listNode.all('li').each(function (node) {
        results.push({
          name: node.one('.taglib-text-icon').text().trim(),
          node: node
        });
      });
      liveSearch = new Liferay.MenuFilter({
        content: listNode,
        minQueryLength: 0,
        queryDelay: 0,
        resultFilters: 'phraseMatch',
        resultTextLocator: 'name',
        source: results
      });
      liveSearch.get('inputNode').swallowEvent('click');
      MAP_LIVE_SEARCH[id] = liveSearch;
    }
  }, ['liferay-menu-filter'], true);
  Liferay.provide(Menu, '_registerMenu', function (event) {
    var menuInstance = Menu._INSTANCE;
    var handles = menuInstance._handles;
    var trigger = event.currentTarget;
    var activeTrigger = menuInstance._activeTrigger;

    if (activeTrigger) {
      if (activeTrigger != trigger) {
        activeTrigger.removeClass(CSS_BTN_PRIMARY);
        activeTrigger.get(PARENT_NODE).removeClass(CSS_OPEN);
        var portlet = activeTrigger.ancestor(CSS_PORTLET);

        if (portlet) {
          portlet.removeClass(CSS_OPEN);
        }
      } else {
        menuInstance._closeActiveMenu();

        return;
      }
    }

    if (!trigger.hasClass('disabled')) {
      var menu = menuInstance._getMenu(trigger);

      menuInstance._activeMenu = menu;
      menuInstance._activeTrigger = trigger;

      if (!handles.length) {
        var listContainer = trigger.getData('menuListContainer');
        A.Event.defineOutside('touchend');
        handles.push(A.getWin().on('resize', A.debounce(menuInstance._positionActiveMenu, 200, menuInstance)), A.getDoc().on(EVENT_CLICK, menuInstance._closeActiveMenu, menuInstance), listContainer.on('touchendoutside', function (event) {
          event.preventDefault();

          menuInstance._closeActiveMenu();
        }, menuInstance), Liferay.on('dropdownShow', function (event) {
          if (event.src !== 'LiferayMenu') {
            menuInstance._closeActiveMenu();
          }
        }));
        var DDM = A.DD && A.DD.DDM;

        if (DDM) {
          handles.push(DDM.on('ddm:start', menuInstance._closeActiveMenu, menuInstance));
        }
      }

      menuInstance._positionActiveMenu();

      Liferay.fire('dropdownShow', {
        src: 'LiferayMenu'
      });
      event.halt();
    }
  }, ['aui-widget-cssclass', 'event-outside', 'event-touch', 'widget', 'widget-modality', 'widget-position', 'widget-position-align', 'widget-position-constrain', 'widget-stack', 'widget-stdmod']);
  Liferay.Menu = Menu;
}, '', {
  requires: ['array-invoke', 'aui-debounce', 'aui-node', 'portal-available-languages']
});
//# sourceMappingURL=menu.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
AUI.add('liferay-notice', function (A) {
  var ADOM = A.DOM;
  var ANode = A.Node;
  var Do = A.Do;
  var Lang = A.Lang;
  var CSS_ALERTS = 'has-alerts';
  var STR_CLICK = 'click';
  var STR_EMPTY = '';
  var STR_HIDE = 'hide';
  var STR_PX = 'px';
  var STR_SHOW = 'show';
  /**
   * @deprecated
   *
   * OPTIONS
   *
   * Required
   * content {string}: The content of the toolbar.
   *
   * Optional
   * animationConfig {Object}: The Transition config, defaults to {easing: 'ease-out', duration: 2, top: '50px'}. If 'left' property is not specified, it will be automatically calculated.
   * closeText {string}: Use for the "close" button. Set to false to not have a close button. If set to false but in the provided markup (via content property) there is an element with class "close", a click listener on this element will be added. As result, the notice will be closed.
   * noticeClass {string}: A class to add to the notice toolbar.
   * timeout {Number}: The timeout in milliseconds, after it the notice will be automatically closed. Set it to -1, or do not add this property to disable this functionality.
   * toggleText {object}: The text to use for the "hide" and "show" button. Set to false to not have a hide button.
   * type {String}: One of 'warning' or 'notice'. If not set, default notice type will be 'notice'
   * useAnimation {boolean}: To animate show/hide of the notice, defaults to true. If useAnimation is set to true, but there is no timeout, 5000 will be used as timeout.
   *
   * Callbacks
   * onClose {function}: Called when the toolbar is closed.
   */

  var Notice = function Notice(options) {
    var instance = this;
    options = options || {};
    instance._closeText = options.closeText;
    instance._node = options.node;
    instance._noticeType = options.type || 'notice';
    instance._noticeClass = 'alert-notice';
    instance._onClose = options.onClose;
    instance._useCloseButton = true;

    if (options.useAnimation) {
      instance._noticeClass += ' popup-alert-notice';

      if (!Lang.isNumber(options.timeout)) {
        options.timeout = 5000;
      }
    }

    instance._animationConfig = options.animationConfig || {
      duration: 2,
      easing: 'ease-out',
      top: '50px'
    };
    instance._useAnimation = options.useAnimation;
    instance._timeout = options.timeout;
    instance._body = A.getBody();
    instance._useToggleButton = false;
    instance._hideText = STR_EMPTY;
    instance._showText = STR_EMPTY;

    if (options.toggleText !== false) {
      instance.toggleText = A.mix(options.toggleText, {
        hide: null,
        show: null
      });
      instance._useToggleButton = true;
    }

    if (instance._noticeType == 'warning') {
      instance._noticeClass = 'alert-danger popup-alert-warning';
    }

    if (options.noticeClass) {
      instance._noticeClass += ' ' + options.noticeClass;
    }

    instance._content = options.content || STR_EMPTY;

    instance._createHTML();

    return instance._notice;
  };

  Notice.prototype = {
    _addCloseButton: function _addCloseButton(notice) {
      var instance = this;
      var closeButton;

      if (instance._closeText !== false) {
        instance._closeText = instance._closeText || 'Close';
      } else {
        instance._useCloseButton = false;
        instance._closeText = STR_EMPTY;
      }

      if (instance._useCloseButton) {
        var html = '<button class="btn btn-default submit popup-alert-close">' + instance._closeText + '</button>';
        closeButton = notice.append(html);
      } else {
        closeButton = notice.one('.close');
      }

      if (closeButton) {
        closeButton.on(STR_CLICK, instance.close, instance);
      }
    },
    _addToggleButton: function _addToggleButton(notice) {
      var instance = this;

      if (instance._useToggleButton) {
        instance._hideText = instance._toggleText.hide || 'Hide';
        instance._showText = instance._toggleText.show || 'Show';
        var toggleButton = ANode.create('<a class="toggle-button" href="javascript:;"><span>' + instance._hideText + '</span></a>');
        var toggleSpan = toggleButton.one('span');
        var visible = 0;
        var hideText = instance._hideText;
        var showText = instance._showText;
        toggleButton.on(STR_CLICK, function () {
          var text = showText;

          if (visible === 0) {
            text = hideText;
            visible = 1;
          } else {
            visible = 0;
          }

          notice.toggle();
          toggleSpan.text(text);
        });
        notice.append(toggleButton);
      }
    },
    _afterNoticeShow: function _afterNoticeShow() {
      var instance = this;

      instance._preventHide();

      var notice = instance._notice;

      if (instance._useAnimation) {
        var animationConfig = instance._animationConfig;
        var left = animationConfig.left;
        var top = animationConfig.top;

        if (!left) {
          var noticeRegion = ADOM.region(ANode.getDOMNode(notice));
          left = ADOM.winWidth() / 2 - noticeRegion.width / 2;
          top = -noticeRegion.height;
          animationConfig.left = left + STR_PX;
        }

        notice.setXY([left, top]);
        notice.transition(instance._animationConfig, function () {
          instance._hideHandle = A.later(instance._timeout, notice, STR_HIDE);
        });
      } else if (instance._timeout > -1) {
        instance._hideHandle = A.later(instance._timeout, notice, STR_HIDE);
      }

      Liferay.fire('noticeShow', {
        notice: instance,
        useAnimation: instance._useAnimation
      });
    },
    _beforeNoticeHide: function _beforeNoticeHide() {
      var instance = this;
      var returnVal;

      if (instance._useAnimation) {
        var animationConfig = A.merge(instance._animationConfig, {
          top: -instance._notice.get('offsetHeight') + STR_PX
        });

        instance._notice.transition(animationConfig, function () {
          instance._notice.toggle(false);
        });

        returnVal = new Do.Halt(null);
      }

      Liferay.fire('noticeHide', {
        notice: instance,
        useAnimation: instance._useAnimation
      });
      return returnVal;
    },
    _beforeNoticeShow: function _beforeNoticeShow() {
      var instance = this;

      instance._notice.toggle(true);
    },
    _createHTML: function _createHTML() {
      var instance = this;
      var content = instance._content;
      var node = A.one(instance._node);
      var notice = node || ANode.create('<div class="alert alert-warning" dynamic="true"></div>');

      if (content) {
        notice.html(content);
      }

      instance._noticeClass.split(' ').forEach(function (item) {
        notice.addClass(item);
      });

      instance._addCloseButton(notice);

      instance._addToggleButton(notice);

      if (!node || node && !node.inDoc()) {
        instance._body.prepend(notice);
      }

      instance._body.addClass(CSS_ALERTS);

      Do.before(instance._beforeNoticeHide, notice, STR_HIDE, instance);
      Do.before(instance._beforeNoticeShow, notice, STR_SHOW, instance);
      Do.after(instance._afterNoticeShow, notice, STR_SHOW, instance);
      instance._notice = notice;
    },
    _preventHide: function _preventHide() {
      var instance = this;

      if (instance._hideHandle) {
        instance._hideHandle.cancel();

        instance._hideHandle = null;
      }
    },
    close: function close() {
      var instance = this;
      var notice = instance._notice;
      notice.hide();

      instance._body.removeClass(CSS_ALERTS);

      if (instance._onClose) {
        instance._onClose();
      }
    },
    setClosing: function setClosing() {
      var instance = this;
      var alerts = A.all('.popup-alert-notice, .popup-alert-warning');

      if (alerts.size()) {
        instance._useCloseButton = true;

        if (!instance._body) {
          instance._body = A.getBody();
        }

        instance._body.addClass(CSS_ALERTS);

        alerts.each(instance._addCloseButton, instance);
      }
    }
  };
  Liferay.Notice = Notice;
}, '', {
  requires: ['aui-base']
});
//# sourceMappingURL=notice.js.map
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
AUI.add('liferay-poller', function (A) {
  var AObject = A.Object;

  var _browserKey = Liferay.Util.randomInt();

  var _enabled = false;
  var _encryptedUserId = null;
  var _supportsComet = false;
  var _delayAccessCount = 0;
  var _delayIndex = 0;
  var _delays = [1, 2, 3, 4, 5, 7, 10];

  var _getEncryptedUserId = function _getEncryptedUserId() {
    return _encryptedUserId;
  };

  var _frozen = false;
  var _locked = false;

  var _maxDelay = _delays.length - 1;

  var _portletIdsMap = {};
  var _metaData = {
    browserKey: _browserKey,
    companyId: themeDisplay.getCompanyId(),
    portletIdsMap: _portletIdsMap,
    startPolling: true
  };
  var _customDelay = null;
  var _portlets = {};
  var _requestDelay = _delays[0];
  var _sendQueue = [];
  var _suspended = false;
  var _timerId = null;

  var _url = themeDisplay.getPathContext() + '/poller';

  var _receiveChannel = _url + '/receive';

  var _sendChannel = _url + '/send';

  var _closeCurlyBrace = '}';
  var _openCurlyBrace = '{';
  var _escapedCloseCurlyBrace = '[$CLOSE_CURLY_BRACE$]';
  var _escapedOpenCurlyBrace = '[$OPEN_CURLY_BRACE$]';

  var _cancelRequestTimer = function _cancelRequestTimer() {
    clearTimeout(_timerId);
    _timerId = null;
  };

  var _createRequestTimer = function _createRequestTimer() {
    _cancelRequestTimer();

    if (_enabled) {
      if (Poller.isSupportsComet()) {
        _receive();
      } else {
        _timerId = setTimeout(_receive, Poller.getDelay());
      }
    }
  };

  var _freezeConnection = function _freezeConnection() {
    _frozen = true;

    _cancelRequestTimer();
  };

  var _getReceiveUrl = function _getReceiveUrl() {
    return _receiveChannel;
  };

  var _getSendUrl = function _getSendUrl() {
    return _sendChannel;
  };

  var _processResponse = function _processResponse(id, obj) {
    var response = JSON.parse(obj.responseText);
    var send = false;

    if (Array.isArray(response)) {
      var meta = response.shift();

      for (var i = 0; i < response.length; i++) {
        var chunk = response[i].payload;
        var chunkData = chunk.data;
        var portletId = chunk.portletId;
        var portlet = _portlets[portletId];

        if (portlet) {
          var currentPortletId = _portletIdsMap[portletId];

          if (chunkData && currentPortletId) {
            chunkData.initialRequest = portlet.initialRequest;
          }

          portlet.listener.call(portlet.scope || Poller, chunkData, chunk.chunkId);

          if (chunkData && chunkData.pollerHintHighConnectivity) {
            _requestDelay = _delays[0];
            _delayIndex = 0;
          }

          if (portlet.initialRequest && currentPortletId) {
            send = true;
            portlet.initialRequest = false;
          }
        }
      }

      if ('startPolling' in _metaData) {
        delete _metaData.startPolling;
      }

      if (send) {
        _send();
      }

      if (!meta.suspendPolling) {
        _thawConnection();
      } else {
        _freezeConnection();
      }
    }
  };

  var _receive = function _receive() {
    if (!_suspended && !_frozen) {
      _metaData.userId = _getEncryptedUserId();
      _metaData.timestamp = new Date().getTime();
      AObject.each(_portlets, _updatePortletIdsMap);
      var requestStr = JSON.stringify([_metaData]);
      var body = new URLSearchParams();
      body.append('pollerRequest', requestStr);
      Liferay.Util.fetch(_getReceiveUrl(), {
        body: body,
        method: 'POST'
      }).then(function (response) {
        return response.text();
      }).then(function (responseText) {
        _processResponse(null, {
          responseText: responseText
        });
      });
    }
  };

  var _releaseLock = function _releaseLock() {
    _locked = false;
  };

  var _sendComplete = function _sendComplete() {
    _releaseLock();

    _send();
  };

  var _send = function _send() {
    if (_enabled && !_locked && _sendQueue.length && !_suspended && !_frozen) {
      _locked = true;

      var data = _sendQueue.shift();

      _metaData.userId = _getEncryptedUserId();
      _metaData.timestamp = new Date().getTime();
      AObject.each(_portlets, _updatePortletIdsMap);
      var requestStr = JSON.stringify([_metaData].concat(data));
      var body = new URLSearchParams();
      body.append('pollerRequest', requestStr);
      Liferay.Util.fetch(_getSendUrl(), {
        body: body,
        method: 'POST'
      }).then(function (response) {
        return response.text();
      }).then(_sendComplete);
    }
  };

  var _thawConnection = function _thawConnection() {
    _frozen = false;

    _createRequestTimer();
  };

  var _updatePortletIdsMap = function _updatePortletIdsMap(item, index) {
    _portletIdsMap[index] = item.initialRequest;
  };

  var Poller = {
    addListener: function addListener(key, listener, scope) {
      _portlets[key] = {
        initialRequest: true,
        listener: listener,
        scope: scope
      };

      if (!_enabled) {
        _enabled = true;

        _receive();
      }
    },
    cancelCustomDelay: function cancelCustomDelay() {
      _customDelay = null;
    },
    getDelay: function getDelay() {
      if (_customDelay !== null) {
        _requestDelay = _customDelay;
      } else if (_delayIndex <= _maxDelay) {
        _requestDelay = _delays[_delayIndex];
        _delayAccessCount++;

        if (_delayAccessCount == 3) {
          _delayIndex++;
          _delayAccessCount = 0;
        }
      }

      return _requestDelay * 1000;
    },
    getReceiveUrl: _getReceiveUrl,
    getSendUrl: _getSendUrl,
    init: function init(options) {
      var instance = this;
      instance.setEncryptedUserId(options.encryptedUserId);
      instance.setSupportsComet(options.supportsComet);
    },
    isSupportsComet: function isSupportsComet() {
      return _supportsComet;
    },
    processResponse: _processResponse,
    removeListener: function removeListener(key) {
      if (key in _portlets) {
        delete _portlets[key];
      }

      if (AObject.keys(_portlets).length === 0) {
        _enabled = false;

        _cancelRequestTimer();
      }
    },
    resume: function resume() {
      _suspended = false;

      _createRequestTimer();
    },
    setCustomDelay: function setCustomDelay(delay) {
      if (delay === null) {
        _customDelay = delay;
      } else {
        _customDelay = delay / 1000;
      }
    },
    setDelay: function setDelay(delay) {
      _requestDelay = delay / 1000;
    },
    setEncryptedUserId: function setEncryptedUserId(encryptedUserId) {
      _encryptedUserId = encryptedUserId;
    },
    setSupportsComet: function setSupportsComet(supportsComet) {
      _supportsComet = supportsComet;
    },
    setUrl: function setUrl(url) {
      _url = url;
    },
    submitRequest: function submitRequest(key, data, chunkId) {
      if (!_frozen && key in _portlets) {
        for (var i in data) {
          if (Object.prototype.hasOwnProperty.call(data, i)) {
            var content = data[i];

            if (content.replace) {
              content = content.replace(_openCurlyBrace, _escapedOpenCurlyBrace);
              content = content.replace(_closeCurlyBrace, _escapedCloseCurlyBrace);
              data[i] = content;
            }
          }
        }

        var requestData = {
          data: data,
          portletId: key
        };

        if (chunkId) {
          requestData.chunkId = chunkId;
        }

        _sendQueue.push(requestData);

        _send();
      }
    },
    suspend: function suspend() {
      _cancelRequestTimer();

      _suspended = true;
    },
    url: _url
  };
  A.getWin().on('focus', function () {
    _metaData.startPolling = true;

    _thawConnection();
  });
  Liferay.Poller = Poller;
}, '', {
  requires: ['aui-base', 'json']
});
//# sourceMappingURL=poller.js.map
