/**
The YUI module contains the components required for building the YUI seed file.
This includes the script loading mechanism, a simple queue, and the core
utilities for the library.

@module yui
@main yui
@submodule yui-base
**/

/*jshint eqeqeq: false*/
if (typeof YUI != 'undefined') {
    YUI._YUI = YUI;
}

/**
The YUI global namespace object. This is the constructor for all YUI instances.

This is a self-instantiable factory function, meaning you don't need to precede
it with the `new` operator. You can invoke it directly like this:

    YUI().use('*', function (Y) {
        // Y is a new YUI instance.
    });

But it also works like this:

    var Y = YUI();

The `YUI` constructor accepts an optional config object, like this:

    YUI({
        debug: true,
        combine: false
    }).use('node', function (Y) {
        // Y.Node is ready to use.
    });

See the API docs for the <a href="config.html">Config</a> class for the complete
list of supported configuration properties accepted by the YUI constuctor.

If a global `YUI` object is already defined, the existing YUI object will not be
overwritten, to ensure that defined namespaces are preserved.

Each YUI instance has full custom event support, but only if the event system is
available.

@class YUI
@uses EventTarget
@constructor
@global
@param {Object} [config]* Zero or more optional configuration objects. Config
    values are stored in the `Y.config` property. See the
    <a href="config.html">Config</a> docs for the list of supported properties.
**/

    /*global YUI*/
    /*global YUI_config*/
    var YUI = function() {
        var i = 0,
            Y = this,
            args = arguments,
            l = args.length,
            instanceOf = function(o, type) {
                return (o && o.hasOwnProperty && (o instanceof type));
            },
            gconf = (typeof YUI_config !== 'undefined') && YUI_config;

        if (!(instanceOf(Y, YUI))) {
            Y = new YUI();
        } else {
            // set up the core environment
            Y._init();

            /**
            Master configuration that might span multiple contexts in a non-
            browser environment. It is applied first to all instances in all
            contexts.

            @example

                YUI.GlobalConfig = {
                    filter: 'debug'
                };

                YUI().use('node', function (Y) {
                    // debug files used here
                });

                YUI({
                    filter: 'min'
                }).use('node', function (Y) {
                    // min files used here
                });

            @property {Object} GlobalConfig
            @global
            @static
            **/
            if (YUI.GlobalConfig) {
                Y.applyConfig(YUI.GlobalConfig);
            }

            /**
            Page-level config applied to all YUI instances created on the
            current page. This is applied after `YUI.GlobalConfig` and before
            any instance-level configuration.

            @example

                // Single global var to include before YUI seed file
                YUI_config = {
                    filter: 'debug'
                };

                YUI().use('node', function (Y) {
                    // debug files used here
                });

                YUI({
                    filter: 'min'
                }).use('node', function (Y) {
                    // min files used here
                });

            @property {Object} YUI_config
            @global
            **/
            if (gconf) {
                Y.applyConfig(gconf);
            }

            // bind the specified additional modules for this instance
            if (!l) {
                Y._afterConfig();
                Y._setup();
            }
        }

        if (l) {
            // Each instance can accept one or more configuration objects.
            // These are applied after YUI.GlobalConfig and YUI_Config,
            // overriding values set in those config files if there is a
            // matching property.
            for (; i < l; i++) {
                Y.applyConfig(args[i]);
            }

            Y._afterConfig();
            Y._setup();
        }

        Y.instanceOf = instanceOf;

        return Y;
    };

(function() {

    var proto, prop,
        VERSION = 'patched-v3.18.1',
        PERIOD = '.',
        BASE = 'http://yui.yahooapis.com/',
        /*
            These CSS class names can't be generated by
            getClassName since it is not available at the
            time they are being used.
        */
        DOC_LABEL = 'yui3-js-enabled',
        CSS_STAMP_EL = 'yui3-css-stamp',
        NOOP = function() {},
        SLICE = Array.prototype.slice,
        APPLY_TO_AUTH = { 'io.xdrReady': 1,   // the functions applyTo
                          'io.xdrResponse': 1,   // can call. this should
                          'SWF.eventHandler': 1 }, // be done at build time
        hasWin = (typeof window != 'undefined'),
        win = (hasWin) ? window : null,
        doc = (hasWin) ? win.document : null,
        docEl = doc && doc.documentElement,
        docClass = docEl && docEl.className,
        instances = {},
        time = new Date().getTime(),
        add = function(el, type, fn, capture) {
            if (el && el.addEventListener) {
                el.addEventListener(type, fn, capture);
            } else if (el && el.attachEvent) {
                el.attachEvent('on' + type, fn);
            }
        },
        remove = function(el, type, fn, capture) {
            if (el && el.removeEventListener) {
                // this can throw an uncaught exception in FF
                try {
                    el.removeEventListener(type, fn, capture);
                } catch (ex) {}
            } else if (el && el.detachEvent) {
                el.detachEvent('on' + type, fn);
            }
        },
        handleReady = function() {
            YUI.Env.DOMReady = true;
            if (hasWin) {
                remove(doc, 'DOMContentLoaded', handleReady);
            }
            if (doc && doc.body && YUI.Env.cssStampEl && (!doc.body.contains(YUI.Env.cssStampEl))) {
                doc.body.appendChild(YUI.Env.cssStampEl);
            }
        },
        handleLoad = function() {
            YUI.Env.windowLoaded = true;
            YUI.Env.DOMReady = true;
            if (hasWin) {
                remove(window, 'load', handleLoad);
            }
        },
        getLoader = function(Y, o) {
            var loader = Y.Env._loader,
                lCore = [ 'loader-base' ],
                G_ENV = YUI.Env,
                mods = G_ENV.mods;

            if (loader) {
                //loader._config(Y.config);
                loader.ignoreRegistered = false;
                loader.onEnd = null;
                loader.data = null;
                loader.required = [];
                loader.loadType = null;
            } else {
                loader = new Y.Loader(Y.config);
                Y.Env._loader = loader;
            }
            if (mods && mods.loader) {
                lCore = [].concat(lCore, YUI.Env.loaderExtras);
            }
            YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));

            return loader;
        },

        clobber = function(r, s) {
            for (var i in s) {
                if (s.hasOwnProperty(i)) {
                    r[i] = s[i];
                }
            }
        },

        ALREADY_DONE = { success: true };

//  Stamp the documentElement (HTML) with a class of "yui-loaded" to
//  enable styles that need to key off of JS being enabled.
if (docEl && docClass.indexOf(DOC_LABEL) == -1) {
    if (docClass) {
        docClass += ' ';
    }
    docClass += DOC_LABEL;
    docEl.className = docClass;
}

if (VERSION.indexOf('@') > -1) {
    VERSION = '3.5.0'; // dev time hack for cdn test
}

proto = {
    /**
    Applies a new configuration object to the config of this YUI instance. This
    will merge new group/module definitions, and will also update the loader
    cache if necessary. Updating `Y.config` directly will not update the cache.

    @method applyConfig
    @param {Object} o the configuration object.
    @since 3.2.0
    **/
    applyConfig: function(o) {

        o = o || NOOP;

        var attr,
            name,
            // detail,
            config = this.config,
            mods = config.modules,
            groups = config.groups,
            aliases = config.aliases,
            loader = this.Env._loader;

        for (name in o) {
            if (o.hasOwnProperty(name)) {
                attr = o[name];
                if (mods && name == 'modules') {
                    clobber(mods, attr);
                } else if (aliases && name == 'aliases') {
                    clobber(aliases, attr);
                } else if (groups && name == 'groups') {
                    clobber(groups, attr);
                } else if (name == 'win') {
                    config[name] = (attr && attr.contentWindow) || attr;
                    config.doc = config[name] ? config[name].document : null;
                } else if (name == '_yuid') {
                    // preserve the guid
                } else {
                    config[name] = attr;
                }
            }
        }

        if (loader) {
            loader._config(o);
        }

    },

    /**
    Old way to apply a config to this instance (calls `applyConfig` under the
    hood).

    @private
    @method _config
    @param {Object} o The config to apply
    **/
    _config: function(o) {
        this.applyConfig(o);
    },

    /**
    Initializes this YUI instance.

    @private
    @method _init
    **/
    _init: function() {
        var filter, el,
            Y = this,
            G_ENV = YUI.Env,
            Env = Y.Env,
            prop;

        /**
        The version number of this YUI instance.

        This value is typically updated by a script when a YUI release is built,
        so it may not reflect the correct version number when YUI is run from
        the development source tree.

        @property {String} version
        **/
        Y.version = VERSION;

        if (!Env) {
            Y.Env = {
                core: ['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3'],
                loaderExtras: ['loader-rollup', 'loader-yui3'],
                mods: {}, // flat module map
                versions: {}, // version module map
                base: BASE,
                cdn: BASE + VERSION + '/',
                // bootstrapped: false,
                _idx: 0,
                _used: {},
                _attached: {},
                _exported: {},
                _missed: [],
                _yidx: 0,
                _uidx: 0,
                _guidp: 'y',
                _loaded: {},
                // serviced: {},
                // Regex in English:
                // I'll start at the \b(yui).
                // 1. Look in the test string for "yui" or
                //    "yui-base" or "yui-davglass" or "yui-foobar" that comes after a word break.  That is, it
                //    can't match "foyui" or "i_heart_yui". This can be anywhere in the string.
                // 2. After #1 must come a forward slash followed by the string matched in #1, so
                //    "yui-base/yui-base" or "yui-pants/yui-pants".
                // 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min",
                //    so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt".
                // 4. This is followed by ".js", so "yui/yui.js".
                // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string,
                //    then capture the junk between the LAST "&" and the string in 1-4.  So
                //    "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js"
                //    will capture "3.3.0/build/"
                //
                // Regex Exploded:
                // (?:\?             Find a ?
                //   (?:[^&]*&)      followed by 0..n characters followed by an &
                //   *               in fact, find as many sets of characters followed by a & as you can
                //   ([^&]*)         capture the stuff after the last & in \1
                // )?                but it's ok if all this ?junk&more_junk stuff isn't even there
                // \b(               after a word break find either the string
                //    yui(?:-\w+)?   "yui" optionally followed by a -, then more characters
                // )                 and store the yui-* string in \2
                // \/\2              then comes a / followed by the yui-* string in \2
                // (?:-(min|debug))? optionally followed by "-min" or "-debug"
                // .js               and ending in ".js"
                _BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(aui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,
                parseBasePath: function(src, pattern) {
                    var match = src.match(pattern),
                        path, filter;

                    if (match) {
                        path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));

                        // this is to set up the path to the loader.  The file
                        // filter for loader should match the yui include.
                        filter = match[3];

                        // extract correct path for mixed combo urls
                        // http://yuilibrary.com/projects/yui3/ticket/2528423
                        if (match[1]) {
                            path += '?' + match[1];
                        }
                        path = {
                            filter: filter,
                            path: path
                        };
                    }
                    return path;
                },
                getBase: G_ENV && G_ENV.getBase ||
                        function(pattern) {
                            var nodes = (doc && doc.getElementsByTagName('script')) || [],
                                path = Env.cdn, parsed,
                                i, len, src;

                            for (i = 0, len = nodes.length; i < len; ++i) {
                                src = nodes[i].src;
                                if (src) {
                                    parsed = Y.Env.parseBasePath(src, pattern);
                                    if (parsed) {
                                        filter = parsed.filter;
                                        path = parsed.path;
                                        break;
                                    }
                                }
                            }

                            // use CDN default
                            return path;
                        }

            };

            Env = Y.Env;

            Env._loaded[VERSION] = {};

            if (G_ENV && Y !== YUI) {
                Env._yidx = ++G_ENV._yidx;
                Env._guidp = ('yui_' + VERSION + '_' +
                             Env._yidx + '_' + time).replace(/[^a-z0-9_]+/g, '_');
            } else if (YUI._YUI) {

                G_ENV = YUI._YUI.Env;
                Env._yidx += G_ENV._yidx;
                Env._uidx += G_ENV._uidx;

                for (prop in G_ENV) {
                    if (!(prop in Env)) {
                        Env[prop] = G_ENV[prop];
                    }
                }

                delete YUI._YUI;
            }

            Y.id = Y.stamp(Y);
            instances[Y.id] = Y;

        }

        Y.constructor = YUI;

        // configuration defaults
        Y.config = Y.config || {
            bootstrap: true,
            cacheUse: true,
            debug: true,
            doc: doc,
            fetchCSS: true,
            throwFail: true,
            useBrowserConsole: true,
            useNativeES5: true,
            win: win
        };

        //Register the CSS stamp element
        if (doc && !doc.getElementById(CSS_STAMP_EL)) {
            el = doc.createElement('div');
            el.innerHTML = '<div id="' + CSS_STAMP_EL + '" style="position: absolute !important; visibility: hidden !important"></div>';
            YUI.Env.cssStampEl = el.firstChild;
            if (doc.body) {
                doc.body.appendChild(YUI.Env.cssStampEl);
            } else {
                docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);
            }
        } else if (doc && doc.getElementById(CSS_STAMP_EL) && !YUI.Env.cssStampEl) {
            YUI.Env.cssStampEl = doc.getElementById(CSS_STAMP_EL);
        }

        Y.config.lang = Y.config.lang || 'en-US';

        Y.config.base = YUI.config.base ||
                (YUI.config.defaultBase && YUI.config.root && YUI.config.defaultBase + YUI.config.root) ||
                Y.Env.getBase(Y.Env._BASE_RE);

        if (!filter || (!('mindebug').indexOf(filter))) {
            filter = 'min';
        }
        filter = (filter) ? '-' + filter : filter;
        Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';

    },

    /**
    This method is called after all other configuration has been applied to
    the YUI instance.

    @method _afterConfig
    @private
    **/
    _afterConfig: function () {
        var Y = this;

        // We need to set up Y.config.global after the rest of the configuration
        // so that setting it in user configuration prevents the library from
        // using eval(). This is critical for Content Security Policy enabled
        // sites and other environments like Chrome extensions
        if (!Y.config.hasOwnProperty('global')) {
            Y.config.global = Function('return this')();
        }
    },

    /**
    Finishes the instance setup. Attaches whatever YUI modules were defined
    at the time that this instance was created.

    @method _setup
    @private
    **/
    _setup: function() {
        var i, Y = this,
            core = [],
            mods = YUI.Env.mods,
            extendedCore = Y.config.extendedCore || [],
            extras = Y.config.core || [].concat(YUI.Env.core).concat(extendedCore); //Clone it..

        for (i = 0; i < extras.length; i++) {
            if (mods[extras[i]]) {
                core.push(extras[i]);
            }
        }

        Y._attach(['yui-base']);
        Y._attach(core);

        if (Y.Loader) {
            getLoader(Y);
        }

    },

    /**
    Executes the named method on the specified YUI instance if that method is
    whitelisted.

    @method applyTo
    @param {String} id YUI instance id.
    @param {String} method Name of the method to execute. For example:
        'Object.keys'.
    @param {Array} args Arguments to apply to the method.
    @return {Mixed} Return value from the applied method, or `null` if the
        specified instance was not found or the method was not whitelisted.
    **/
    applyTo: function(id, method, args) {
        if (!(method in APPLY_TO_AUTH)) {
            this.log(method + ': applyTo not allowed', 'warn', 'yui');
            return null;
        }

        var instance = instances[id], nest, m, i;
        if (instance) {
            nest = method.split('.');
            m = instance;
            for (i = 0; i < nest.length; i = i + 1) {
                m = m[nest[i]];
                if (!m) {
                    this.log('applyTo not found: ' + method, 'warn', 'yui');
                }
            }
            return m && m.apply(instance, args);
        }

        return null;
    },

/**
Registers a YUI module and makes it available for use in a `YUI().use()` call or
as a dependency for other modules.

The easiest way to create a first-class YUI module is to use
<a href="http://yui.github.com/shifter/">Shifter</a>, the YUI component build
tool.

Shifter will automatically wrap your module code in a `YUI.add()` call along
with any configuration info required for the module.

@example

    YUI.add('davglass', function (Y) {
        Y.davglass = function () {
        };
    }, '3.4.0', {
        requires: ['harley-davidson', 'mt-dew']
    });

@method add
@param {String} name Module name.
@param {Function} fn Function containing module code. This function will be
    executed whenever the module is attached to a specific YUI instance.

    @param {YUI} fn.Y The YUI instance to which this module is attached.
    @param {String} fn.name Name of the module

@param {String} version Module version number. This is currently used only for
    informational purposes, and is not used internally by YUI.

@param {Object} [details] Module config.
    @param {Array} [details.requires] Array of other module names that must be
        attached before this module can be attached.
    @param {Array} [details.optional] Array of optional module names that should
        be attached before this module is attached if they've already been
        loaded. If the `loadOptional` YUI option is `true`, optional modules
        that have not yet been loaded will be loaded just as if they were hard
        requirements.
    @param {Array} [details.use] Array of module names that are included within
        or otherwise provided by this module, and which should be attached
        automatically when this module is attached. This makes it possible to
        create "virtual rollup" modules that simply attach a collection of other
        modules or submodules.

@return {YUI} This YUI instance.
**/
    add: function(name, fn, version, details) {
        details = details || {};
        var env = YUI.Env,
            mod = {
                name: name,
                fn: fn,
                version: version,
                details: details
            },
            //Instance hash so we don't apply it to the same instance twice
            applied = {},
            loader, inst, modInfo,
            i, versions = env.versions;

        env.mods[name] = mod;
        versions[version] = versions[version] || {};
        versions[version][name] = mod;

        for (i in instances) {
            if (instances.hasOwnProperty(i)) {
                inst = instances[i];
                if (!applied[inst.id]) {
                    applied[inst.id] = true;
                    loader = inst.Env._loader;
                    if (loader) {
                        modInfo = loader.getModuleInfo(name);
                        if (!modInfo || modInfo.temp) {
                            loader.addModule(details, name);
                        }
                    }
                }
            }
        }

        return this;
    },

    /**
    Executes the callback function associated with each required module,
    attaching the module to this YUI instance.

    @method _attach
    @param {Array} r The array of modules to attach
    @param {Boolean} [moot=false] If `true`, don't throw a warning if the module
        is not attached.
    @private
    **/
    _attach: function(r, moot) {
        var i, name, mod, details, req, use, after,
            mods = YUI.Env.mods,
            aliases = YUI.Env.aliases,
            Y = this, j,
            cache = YUI.Env._renderedMods,
            loader = Y.Env._loader,
            done = Y.Env._attached,
            exported = Y.Env._exported,
            len = r.length, loader, def, go,
            c = [],
            modArgs, esCompat, reqlen, modInfo,
            condition,
            __exports__, __imports__;

        //Check for conditional modules (in a second+ instance) and add their requirements
        //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass
        for (i = 0; i < len; i++) {
            name = r[i];
            mod = mods[name];
            c.push(name);
            if (loader && loader.conditions[name]) {
                for (j in loader.conditions[name]) {
                    if (loader.conditions[name].hasOwnProperty(j)) {
                        def = loader.conditions[name][j];
                        go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));
                        if (go) {
                            c.push(def.name);
                        }
                    }
                }
            }
        }
        r = c;
        len = r.length;

        for (i = 0; i < len; i++) {
            if (!done[r[i]]) {
                name = r[i];
                mod = mods[name];

                if (aliases && aliases[name] && !mod) {
                    Y._attach(aliases[name]);
                    continue;
                }
                if (!mod) {
                    modInfo = loader && loader.getModuleInfo(name);
                    if (modInfo) {
                        mod = modInfo;
                        moot = true;
                    }


                    //if (!loader || !loader.moduleInfo[name]) {
                    //if ((!loader || !loader.moduleInfo[name]) && !moot) {
                    if (!moot && name) {
                        if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
                            Y.Env._missed.push(name);
                            Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
                            Y.message('NOT loaded: ' + name, 'warn', 'yui');
                        }
                    }
                } else {
                    done[name] = true;
                    //Don't like this, but in case a mod was asked for once, then we fetch it
                    //We need to remove it from the missed list ^davglass
                    for (j = 0; j < Y.Env._missed.length; j++) {
                        if (Y.Env._missed[j] === name) {
                            Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');
                            Y.Env._missed.splice(j, 1);
                        }
                    }

                    // Optional dependencies normally work by modifying the
                    // dependency list of a module. If the dependency's test
                    // passes it is added to the list. If not, it's not loaded.
                    // This following check ensures that optional dependencies
                    // are not attached when they were already loaded into the
                    // page (when bundling for example)
                    if (loader && !loader._canBeAttached(name)) {
                        return true;
                    }

                    /*
                        If it's a temp module, we need to redo it's requirements if it's already loaded
                        since it may have been loaded by another instance and it's dependencies might
                        have been redefined inside the fetched file.
                    */
                    if (loader && cache && cache[name] && cache[name].temp) {
                        loader.getRequires(cache[name]);
                        req = [];
                        modInfo = loader.getModuleInfo(name);
                        for (j in modInfo.expanded_map) {
                            if (modInfo.expanded_map.hasOwnProperty(j)) {
                                req.push(j);
                            }
                        }
                        Y._attach(req);
                    }

                    details = mod.details;
                    req = details.requires;
                    esCompat = details.es;
                    use = details.use;
                    after = details.after;
                    //Force Intl load if there is a language (Loader logic) @todo fix this shit
                    if (details.lang) {
                        req = req || [];
                        req.unshift('intl');
                    }

                    if (req) {
                        reqlen = req.length;
                        for (j = 0; j < reqlen; j++) {
                            if (!done[req[j]]) {
                                if (!Y._attach(req)) {
                                    return false;
                                }
                                break;
                            }
                        }
                    }

                    if (after) {
                        for (j = 0; j < after.length; j++) {
                            if (!done[after[j]]) {
                                if (!Y._attach(after, true)) {
                                    return false;
                                }
                                break;
                            }
                        }
                    }

                    if (mod.fn) {
                        modArgs = [Y, name];
                        if (esCompat) {
                            __imports__ = {};
                            __exports__ = {};
                            // passing `exports` and `imports` onto the module function
                            modArgs.push(__imports__, __exports__);
                            if (req) {
                                reqlen = req.length;
                                for (j = 0; j < reqlen; j++) {
                                    __imports__[req[j]] = exported.hasOwnProperty(req[j]) ? exported[req[j]] : Y;
                                }
                            }
                        }
                        if (Y.config.throwFail) {
                            __exports__ = mod.fn.apply(esCompat ? undefined : mod, modArgs);
                        } else {
                            try {
                                __exports__ = mod.fn.apply(esCompat ? undefined : mod, modArgs);
                            } catch (e) {
                                Y.error('Attach error: ' + name, e, name);
                                return false;
                            }
                        }
                        if (esCompat) {
                            // store the `exports` in case others `es` modules requires it
                            exported[name] = __exports__;

                            // If an ES module is conditionally loaded and set
                            // to be used "instead" another module, replace the
                            // trigger module's content with the conditionally
                            // loaded one so the values returned by require()
                            // still makes sense
                            condition = mod.details.condition;
                            if (condition && condition.when === 'instead') {
                                exported[condition.trigger] = __exports__;
                            }
                        }
                    }

                    if (use) {
                        for (j = 0; j < use.length; j++) {
                            if (!done[use[j]]) {
                                if (!Y._attach(use)) {
                                    return false;
                                }
                                break;
                            }
                        }
                    }



                }
            }
        }

        return true;
    },

    /**
    Delays the `use` callback until another event has taken place such as
    `window.onload`, `domready`, `contentready`, or `available`.

    @private
    @method _delayCallback
    @param {Function} cb The original `use` callback.
    @param {String|Object} until Either an event name ('load', 'domready', etc.)
        or an object containing event/args keys for contentready/available.
    @return {Function}
    **/
    _delayCallback: function(cb, until) {

        var Y = this,
            mod = ['event-base'];

        until = (Y.Lang.isObject(until) ? until : { event: until });

        if (until.event === 'load') {
            mod.push('event-synthetic');
        }

        return function() {
            var args = arguments;
            Y._use(mod, function() {
                Y.on(until.event, function() {
                    args[1].delayUntil = until.event;
                    cb.apply(Y, args);
                }, until.args);
            });
        };
    },

    /**
    Attaches one or more modules to this YUI instance. When this is executed,
    the requirements of the desired modules are analyzed, and one of several
    things can happen:


      * All required modules have already been loaded, and just need to be
        attached to this YUI instance. In this case, the `use()` callback will
        be executed synchronously after the modules are attached.

      * One or more modules have not yet been loaded, or the Get utility is not
        available, or the `bootstrap` config option is `false`. In this case,
        a warning is issued indicating that modules are missing, but all
        available modules will still be attached and the `use()` callback will
        be executed synchronously.

      * One or more modules are missing and the Loader is not available but the
        Get utility is, and `bootstrap` is not `false`. In this case, the Get
        utility will be used to load the Loader, and we will then proceed to
        the following state:

      * One or more modules are missing and the Loader is available. In this
        case, the Loader will be used to resolve the dependency tree for the
        missing modules and load them and their dependencies. When the Loader is
        finished loading modules, the `use()` callback will be executed
        asynchronously.

    @example

        // Loads and attaches dd and its dependencies.
        YUI().use('dd', function (Y) {
            // ...
        });

        // Loads and attaches dd and node as well as all of their dependencies.
        YUI().use(['dd', 'node'], function (Y) {
            // ...
        });

        // Attaches all modules that have already been loaded.
        YUI().use('*', function (Y) {
            // ...
        });

        // Attaches a gallery module.
        YUI().use('gallery-yql', function (Y) {
            // ...
        });

        // Attaches a YUI 2in3 module.
        YUI().use('yui2-datatable', function (Y) {
            // ...
        });

    @method use
    @param {String|Array} modules* One or more module names to attach.
    @param {Function} [callback] Callback function to be executed once all
        specified modules and their dependencies have been attached.
    @param {YUI} callback.Y The YUI instance created for this sandbox.
    @param {Object} callback.status Object containing `success`, `msg` and
        `data` properties.
    @chainable
    **/
    use: function() {
        var args = SLICE.call(arguments, 0),
            callback = args[args.length - 1],
            Y = this,
            i = 0,
            name,
            Env = Y.Env,
            provisioned = true;

        // The last argument supplied to use can be a load complete callback
        if (Y.Lang.isFunction(callback)) {
            args.pop();
            if (Y.config.delayUntil) {
                callback = Y._delayCallback(callback, Y.config.delayUntil);
            }
        } else {
            callback = null;
        }
        if (Y.Lang.isArray(args[0])) {
            args = args[0];
        }

        if (Y.config.cacheUse) {
            while ((name = args[i++])) {
                if (!Env._attached[name]) {
                    provisioned = false;
                    break;
                }
            }

            if (provisioned) {
                if (args.length) {
                }
                Y._notify(callback, ALREADY_DONE, args);
                return Y;
            }
        }

        if (Y._loading) {
            Y._useQueue = Y._useQueue || new Y.Queue();
            Y._useQueue.add([args, callback]);
        } else {
            Y._use(args, function(Y, response) {
                Y._notify(callback, response, args);
            });
        }

        return Y;
    },

    /**
    Sugar for loading both legacy and ES6-based YUI modules.

    @method require
    @param {String} [modules*] List of module names to import or a single
        module name.
    @param {Function} callback Callback that gets called once all the modules
        were loaded. Each parameter of the callback is the export value of the
        corresponding module in the list. If the module is a legacy YUI module,
        the YUI instance is used instead of the module exports.
    @example
    ```
    YUI().require(['es6-set'], function (Y, imports) {
        var Set = imports.Set,
            set = new Set();
    });
    ```
    **/
    require: function () {
        var args = SLICE.call(arguments),
            callback;

        if (typeof args[args.length - 1] === 'function') {
            callback = args.pop();

            // only add the callback if one was provided
            // YUI().require('foo'); is valid
            args.push(function (Y) {
                var i, length = args.length,
                    exported = Y.Env._exported,
                    __imports__ = {};

                // Get only the imports requested as arguments
                for (i = 0; i < length; i++) {
                    if (exported.hasOwnProperty(args[i])) {
                        __imports__[args[i]] = exported[args[i]];
                    }
                }

                // Using `undefined` because:
                // - Using `Y.config.global` would force the value of `this` to be
                //   the global object even in strict mode
                // - Using `Y` goes against the goal of moving away from a shared
                //   object and start thinking in terms of imported and exported
                //   objects
                callback.call(undefined, Y, __imports__);
            });
        }
        // Do not return the Y object. This makes it hard to follow this
        // traditional pattern:
        //   var Y = YUI().use(...);
        // This is a good idea in the light of ES6 modules, to avoid working
        // in the global scope.
        // This also leaves the door open for returning a promise, once the
        // YUI loader is based on the ES6 loader which uses
        // loader.import(...).then(...)
        this.use.apply(this, args);
    },

    /**
    Handles Loader notifications about attachment/load errors.

    @method _notify
    @param {Function} callback Callback to pass to `Y.config.loadErrorFn`.
    @param {Object} response Response returned from Loader.
    @param {Array} args Arguments passed from Loader.
    @private
    **/
    _notify: function(callback, response, args) {
        if (!response.success && this.config.loadErrorFn) {
            this.config.loadErrorFn.call(this, this, callback, response, args);
        } else if (callback) {
            if (this.Env._missed && this.Env._missed.length) {
                response.msg = 'Missing modules: ' + this.Env._missed.join();
                response.success = false;
            }
            if (this.config.throwFail) {
                callback(this, response);
            } else {
                try {
                    callback(this, response);
                } catch (e) {
                    this.error('use callback error', e, args);
                }
            }
        }
    },

    /**
    Called from the `use` method queue to ensure that only one set of loading
    logic is performed at a time.

    @method _use
    @param {String} args* One or more modules to attach.
    @param {Function} [callback] Function to call once all required modules have
        been attached.
    @private
    **/
    _use: function(args, callback) {

        if (!this.Array) {
            this._attach(['yui-base']);
        }

        var len, loader, handleBoot,
            Y = this,
            G_ENV = YUI.Env,
            mods = G_ENV.mods,
            Env = Y.Env,
            used = Env._used,
            aliases = G_ENV.aliases,
            queue = G_ENV._loaderQueue,
            firstArg = args[0],
            YArray = Y.Array,
            config = Y.config,
            boot = config.bootstrap,
            missing = [],
            i,
            r = [],
            ret = true,
            fetchCSS = config.fetchCSS,
            process = function(names, skip) {

                var i = 0, a = [], name, len, m, req, use;

                if (!names.length) {
                    return;
                }

                if (aliases) {
                    len = names.length;
                    for (i = 0; i < len; i++) {
                        if (aliases[names[i]] && !mods[names[i]]) {
                            a = [].concat(a, aliases[names[i]]);
                        } else {
                            a.push(names[i]);
                        }
                    }
                    names = a;
                }

                len = names.length;

                for (i = 0; i < len; i++) {
                    name = names[i];
                    if (!skip) {
                        r.push(name);
                    }

                    // only attach a module once
                    if (used[name]) {
                        continue;
                    }

                    m = mods[name];
                    req = null;
                    use = null;

                    if (m) {
                        used[name] = true;
                        req = m.details.requires;
                        use = m.details.use;
                    } else {
                        // CSS files don't register themselves, see if it has
                        // been loaded
                        if (!G_ENV._loaded[VERSION][name]) {
                            missing.push(name);
                        } else {
                            used[name] = true; // probably css
                        }
                    }

                    // make sure requirements are attached
                    if (req && req.length) {
                        process(req);
                    }

                    // make sure we grab the submodule dependencies too
                    if (use && use.length) {
                        process(use, 1);
                    }
                }

            },

            handleLoader = function(fromLoader) {
                var response = fromLoader || {
                        success: true,
                        msg: 'not dynamic'
                    },
                    redo, origMissing,
                    ret = true,
                    data = response.data;

                Y._loading = false;

                if (data) {
                    origMissing = missing;
                    missing = [];
                    r = [];
                    process(data);
                    redo = missing.length;
                    if (redo) {
                        if ([].concat(missing).sort().join() ==
                                origMissing.sort().join()) {
                            redo = false;
                        }
                    }
                }

                if (redo && data) {
                    Y._loading = true;
                    Y._use(missing, function() {
                        if (Y._attach(data)) {
                            Y._notify(callback, response, data);
                        }
                    });
                } else {
                    if (data) {
                        ret = Y._attach(data);
                    }
                    if (ret) {
                        Y._notify(callback, response, args);
                    }
                }

                if (Y._useQueue && Y._useQueue.size() && !Y._loading) {
                    Y._use.apply(Y, Y._useQueue.next());
                }

            };


        // YUI().use('*'); // bind everything available
        if (firstArg === '*') {
            args = [];
            for (i in mods) {
                if (mods.hasOwnProperty(i)) {
                    args.push(i);
                }
            }
            ret = Y._attach(args);
            if (ret) {
                handleLoader();
            }
            return Y;
        }

        if ((mods.loader || mods['loader-base']) && !Y.Loader) {
            Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);
        }


        // use loader to expand dependencies and sort the
        // requirements if it is available.
        if (boot && Y.Loader && args.length) {
            loader = getLoader(Y);
            loader.require(args);
            loader.ignoreRegistered = true;
            loader._boot = true;
            loader.calculate(null, (fetchCSS) ? null : 'js');
            args = loader.sorted;
            loader._boot = false;
        }

        process(args);

        len = missing.length;


        if (len) {
            missing = YArray.dedupe(missing);
            len = missing.length;
        }


        // dynamic load
        if (boot && len && Y.Loader) {
            Y._loading = true;
            loader = getLoader(Y);
            loader.onEnd = handleLoader;
            loader.context = Y;
            loader.data = args;
            loader.ignoreRegistered = false;
            loader.require(missing);
            loader.insert(null, (fetchCSS) ? null : 'js');

        } else if (boot && len && Y.Get && !Env.bootstrapped) {

            Y._loading = true;

            handleBoot = function() {
                Y._loading = false;
                queue.running = false;
                Env.bootstrapped = true;
                G_ENV._bootstrapping = false;
                if (Y._attach(['loader'])) {
                    Y._use(args, callback);
                }
            };

            if (G_ENV._bootstrapping) {
                queue.add(handleBoot);
            } else {
                G_ENV._bootstrapping = true;
                Y.Get.script(config.base + config.loaderPath, {
                    onEnd: handleBoot
                });
            }

        } else {
            ret = Y._attach(args);
            if (ret) {
                handleLoader();
            }
        }

        return Y;
    },


    /**
    Utility method for safely creating namespaces if they don't already exist.
    May be called statically on the YUI global object or as a method on a YUI
    instance.

    When called statically, a namespace will be created on the YUI global
    object:

        // Create `YUI.your.namespace.here` as nested objects, preserving any
        // objects that already exist instead of overwriting them.
        YUI.namespace('your.namespace.here');

    When called as a method on a YUI instance, a namespace will be created on
    that instance:

        // Creates `Y.property.package`.
        Y.namespace('property.package');

    Dots in the input string cause `namespace` to create nested objects for each
    token. If any part of the requested namespace already exists, the current
    object will be left in place and will not be overwritten. This allows
    multiple calls to `namespace` to preserve existing namespaced properties.

    If the first token in the namespace string is "YAHOO", that token is
    discarded. This is legacy behavior for backwards compatibility with YUI 2.

    Be careful with namespace tokens. Reserved words may work in some browsers
    and not others. For instance, the following will fail in some browsers
    because the supported version of JavaScript reserves the word "long":

        Y.namespace('really.long.nested.namespace');

    Note: If you pass multiple arguments to create multiple namespaces, only the
    last one created is returned from this function.

    @method namespace
    @param {String} namespace* One or more namespaces to create.
    @return {Object} Reference to the last namespace object created.
    **/
    namespace: function() {
        var a = arguments, o, i = 0, j, d, arg;

        for (; i < a.length; i++) {
            o = this; //Reset base object per argument or it will get reused from the last
            arg = a[i];
            if (arg.indexOf(PERIOD) > -1) { //Skip this if no "." is present
                d = arg.split(PERIOD);
                for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {
                    o[d[j]] = o[d[j]] || {};
                    o = o[d[j]];
                }
            } else {
                o[arg] = o[arg] || {};
                o = o[arg]; //Reset base object to the new object so it's returned
            }
        }
        return o;
    },

    // this is replaced if the log module is included
    log: NOOP,
    message: NOOP,
    // this is replaced if the dump module is included
    dump: function (o) { return ''+o; },

    /**
    Reports an error.

    The reporting mechanism is controlled by the `throwFail` configuration
    attribute. If `throwFail` is falsy, the message is logged. If `throwFail` is
    truthy, a JS exception is thrown.

    If an `errorFn` is specified in the config it must return `true` to indicate
    that the exception was handled and keep it from being thrown.

    @method error
    @param {String} msg Error message.
    @param {Error|String} [e] JavaScript error object or an error string.
    @param {String} [src] Source of the error (such as the name of the module in
        which the error occurred).
    @chainable
    **/
    error: function(msg, e, src) {
        //TODO Add check for window.onerror here

        var Y = this, ret;

        if (Y.config.errorFn) {
            ret = Y.config.errorFn.apply(Y, arguments);
        }

        if (!ret) {
            throw (e || new Error(msg));
        } else {
            Y.message(msg, 'error', ''+src); // don't scrub this one
        }

        return Y;
    },

    /**
    Generates an id string that is unique among all YUI instances in this
    execution context.

    @method guid
    @param {String} [pre] Prefix.
    @return {String} Unique id.
    **/
    guid: function(pre) {
        var id = this.Env._guidp + '_' + (++this.Env._uidx);
        return (pre) ? (pre + id) : id;
    },

    /**
    Returns a unique id associated with the given object and (if *readOnly* is
    falsy) stamps the object with that id so it can be identified in the future.

    Stamping an object involves adding a `_yuid` property to it that contains
    the object's id. One exception to this is that in Internet Explorer, DOM
    nodes have a `uniqueID` property that contains a browser-generated unique
    id, which will be used instead of a YUI-generated id when available.

    @method stamp
    @param {Object} o Object to stamp.
    @param {Boolean} readOnly If truthy and the given object has not already
        been stamped, the object will not be modified and `null` will be
        returned.
    @return {String} Object's unique id, or `null` if *readOnly* was truthy and
        the given object was not already stamped.
    **/
    stamp: function(o, readOnly) {
        var uid;
        if (!o) {
            return o;
        }

        // IE generates its own unique ID for dom nodes
        // The uniqueID property of a document node returns a new ID
        if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
            uid = o.uniqueID;
        } else {
            uid = (typeof o === 'string') ? o : o._yuid;
        }

        if (!uid) {
            uid = this.guid();
            if (!readOnly) {
                try {
                    o._yuid = uid;
                } catch (e) {
                    uid = null;
                }
            }
        }
        return uid;
    },

    /**
    Destroys this YUI instance.

    @method destroy
    @since 3.3.0
    **/
    destroy: function() {
        var Y = this;
        if (Y.Event) {
            Y.Event._unload();
        }
        delete instances[Y.id];
        delete Y.Env;
        delete Y.config;
    }

    /**
    Safe `instanceof` wrapper that works around a memory leak in IE when the
    object being tested is `window` or `document`.

    Unless you are testing objects that may be `window` or `document`, you
    should use the native `instanceof` operator instead of this method.

    @method instanceOf
    @param {Object} o Object to check.
    @param {Object} type Class to check against.
    @since 3.3.0
    **/
};

    YUI.prototype = proto;

    // inheritance utilities are not available yet
    for (prop in proto) {
        if (proto.hasOwnProperty(prop)) {
            YUI[prop] = proto[prop];
        }
    }

    /**
    Applies a configuration to all YUI instances in this execution context.

    The main use case for this method is in "mashups" where several third-party
    scripts need to write to a global YUI config, but cannot share a single
    centrally-managed config object. This way they can all call
    `YUI.applyConfig({})` instead of overwriting the single global config.

    @example

        YUI.applyConfig({
            modules: {
                davglass: {
                    fullpath: './davglass.js'
                }
            }
        });

        YUI.applyConfig({
            modules: {
                foo: {
                    fullpath: './foo.js'
                }
            }
        });

        YUI().use('davglass', function (Y) {
            // Module davglass will be available here.
        });

    @method applyConfig
    @param {Object} o Configuration object to apply.
    @static
    @since 3.5.0
    **/
    YUI.applyConfig = function(o) {
        if (!o) {
            return;
        }
        //If there is a GlobalConfig, apply it first to set the defaults
        if (YUI.GlobalConfig) {
            this.prototype.applyConfig.call(this, YUI.GlobalConfig);
        }
        //Apply this config to it
        this.prototype.applyConfig.call(this, o);
        //Reset GlobalConfig to the combined config
        YUI.GlobalConfig = this.config;
    };

    // set up the environment
    YUI._init();

    if (hasWin) {
        add(doc, 'DOMContentLoaded', handleReady);

        // add a window load event at load time so we can capture
        // the case where it fires before dynamic loading is
        // complete.
        add(window, 'load', handleLoad);
    } else {
        handleReady();
        handleLoad();
    }

    YUI.Env.add = add;
    YUI.Env.remove = remove;

    /*global exports*/
    // Support the CommonJS method for exporting our single global
    if (typeof exports == 'object') {
        exports.YUI = YUI;
        /**
        * Set a method to be called when `Get.script` is called in Node.js
        * `Get` will open the file, then pass it's content and it's path
        * to this method before attaching it. Commonly used for code coverage
        * instrumentation. <strong>Calling this multiple times will only
        * attach the last hook method</strong>. This method is only
        * available in Node.js.
        * @method setLoadHook
        * @static
        * @param {Function} fn The function to set
        * @param {String} fn.data The content of the file
        * @param {String} fn.path The file path of the file
        */
        YUI.setLoadHook = function(fn) {
            YUI._getLoadHook = fn;
        };
        /**
        * Load hook for `Y.Get.script` in Node.js, see `YUI.setLoadHook`
        * @method _getLoadHook
        * @private
        * @param {String} data The content of the file
        * @param {String} path The file path of the file
        */
        YUI._getLoadHook = null;
    }

    YUI.Env[VERSION] = {};
}());


/**
Config object that contains all of the configuration options for
this `YUI` instance.

This object is supplied by the implementer when instantiating YUI. Some
properties have default values if they are not supplied by the implementer.

This object should not be updated directly because some values are cached. Use
`applyConfig()` to update the config object on a YUI instance that has already
been configured.

@class config
@static
**/

/**
If `true` (the default), YUI will "bootstrap" the YUI Loader and module metadata
if they're needed to load additional dependencies and aren't already available.

Setting this to `false` will prevent YUI from automatically loading the Loader
and module metadata, so you will need to manually ensure that they're available
or handle dependency resolution yourself.

@property {Boolean} bootstrap
@default true
**/

/**

@property {Object} filters
**/

/**
If `true`, YUI will use a combo handler to load multiple modules in as few
requests as possible.

The YUI CDN (which YUI uses by default) supports combo handling, but other
servers may not. If the server from which you're loading YUI does not support
combo handling, set this to `false`.

Providing a value for the `base` config property will cause `combine` to default
to `false` instead of `true`.

@property {Boolean} combine
@default true
*/

/**
Array of module names that should never be dynamically loaded.

@property {String[]} ignore
**/

/**
Array of module names that should always be loaded when required, even if
already present on the page.

@property {String[]} force
**/

/**
DOM element or id that should be used as the insertion point for dynamically
added `<script>` and `<link>` nodes.

@property {HTMLElement|String} insertBefore
**/

/**
Object hash containing attributes to add to dynamically added `<script>` nodes.

@property {Object} jsAttributes
**/

/**
Object hash containing attributes to add to dynamically added `<link>` nodes.

@property {Object} cssAttributes
**/

/**
Timeout in milliseconds before a dynamic JS or CSS request will be considered a
failure. If not set, no timeout will be enforced.

@property {Number} timeout
**/

/**
A hash of module definitions to add to the list of available YUI modules. These
modules can then be dynamically loaded via the `use()` method.

This is a hash in which keys are module names and values are objects containing
module metadata.

See `Loader.addModule()` for the supported module metadata fields. Also see
`groups`, which provides a way to configure the base and combo spec for a set of
modules.

@example

    modules: {
        mymod1: {
            requires: ['node'],
            fullpath: '/mymod1/mymod1.js'
        },

        mymod2: {
            requires: ['mymod1'],
            fullpath: '/mymod2/mymod2.js'
        },

        mymod3: '/js/mymod3.js',
        mycssmod: '/css/mycssmod.css'
    }

@property {Object} modules
**/

/**
Aliases are dynamic groups of modules that can be used as shortcuts.

@example

    YUI({
        aliases: {
            davglass: [ 'node', 'yql', 'dd' ],
            mine: [ 'davglass', 'autocomplete']
        }
    }).use('mine', function (Y) {
        // Node, YQL, DD & AutoComplete available here.
    });

@property {Object} aliases
**/

/**
A hash of module group definitions.

For each group you can specify a list of modules and the base path and
combo spec to use when dynamically loading the modules.

@example

    groups: {
        yui2: {
            // specify whether or not this group has a combo service
            combine: true,

            // The comboSeperator to use with this group's combo handler
            comboSep: ';',

            // The maxURLLength for this server
            maxURLLength: 500,

            // the base path for non-combo paths
            base: 'http://yui.yahooapis.com/2.8.0r4/build/',

            // the path to the combo service
            comboBase: 'http://yui.yahooapis.com/combo?',

            // a fragment to prepend to the path attribute when
            // when building combo urls
            root: '2.8.0r4/build/',

            // the module definitions
            modules:  {
                yui2_yde: {
                    path: "yahoo-dom-event/yahoo-dom-event.js"
                },
                yui2_anim: {
                    path: "animation/animation.js",
                    requires: ['yui2_yde']
                }
            }
        }
    }

@property {Object} groups
**/

/**
Path to the Loader JS file, relative to the `base` path.

This is used to dynamically bootstrap the Loader when it's needed and isn't yet
available.

@property {String} loaderPath
@default "loader/loader-min.js"
**/

/**
If `true`, YUI will attempt to load CSS dependencies and skins. Set this to
`false` to prevent YUI from loading any CSS, or set it to the string `"force"`
to force CSS dependencies to be loaded even if their associated JS modules are
already loaded.

@property {Boolean|String} fetchCSS
@default true
**/

/**
Default gallery version used to build gallery module urls.

@property {String} gallery
@since 3.1.0
**/

/**
Default YUI 2 version used to build YUI 2 module urls.

This is used for intrinsic YUI 2 support via the 2in3 project. Also see the
`2in3` config for pulling different revisions of the wrapped YUI 2 modules.

@property {String} yui2
@default "2.9.0"
@since 3.1.0
**/

/**
Revision number of YUI 2in3 modules that should be used when loading YUI 2in3.

@property {String} 2in3
@default "4"
@since 3.1.0
**/

/**
Alternate console log function that should be used in environments without a
supported native console. This function is executed with the YUI instance as its
`this` object.

@property {Function} logFn
@since 3.1.0
**/

/**
The minimum log level to log messages for. Log levels are defined
incrementally. Messages greater than or equal to the level specified will
be shown. All others will be discarded. The order of log levels in
increasing priority is:

    debug
    info
    warn
    error

@property {String} logLevel
@default 'debug'
@since 3.10.0
**/

/**
Callback to execute when `Y.error()` is called. It receives the error message
and a JavaScript error object if one was provided.

This function is executed with the YUI instance as its `this` object.

Returning `true` from this function will prevent an exception from being thrown.

@property {Function} errorFn
@param {String} errorFn.msg Error message
@param {Object} [errorFn.err] Error object (if one was provided).
@since 3.2.0
**/

/**
A callback to execute when Loader fails to load one or more resources.

This could be because of a script load failure. It could also be because a
module fails to register itself when the `requireRegistration` config is `true`.

If this function is defined, the `use()` callback will only be called when the
loader succeeds. Otherwise, `use()` will always executes unless there was a
JavaScript error when attaching a module.

@property {Function} loadErrorFn
@since 3.3.0
**/

/**
If `true`, Loader will expect all loaded scripts to be first-class YUI modules
that register themselves with the YUI global, and will trigger a failure if a
loaded script does not register a YUI module.

@property {Boolean} requireRegistration
@default false
@since 3.3.0
**/

/**
Cache serviced use() requests.

@property {Boolean} cacheUse
@default true
@since 3.3.0
@deprecated No longer used.
**/

/**
Whether or not YUI should use native ES5 functionality when available for
features like `Y.Array.each()`, `Y.Object()`, etc.

When `false`, YUI will always use its own fallback implementations instead of
relying on ES5 functionality, even when ES5 functionality is available.

@property {Boolean} useNativeES5
@default true
@since 3.5.0
**/

/**
 * Leverage native JSON stringify if the browser has a native
 * implementation.  In general, this is a good idea.  See the Known Issues
 * section in the JSON user guide for caveats.  The default value is true
 * for browsers with native JSON support.
 *
 * @property useNativeJSONStringify
 * @type Boolean
 * @default true
 * @since 3.8.0
 */

 /**
 * Leverage native JSON parse if the browser has a native implementation.
 * In general, this is a good idea.  See the Known Issues section in the
 * JSON user guide for caveats.  The default value is true for browsers with
 * native JSON support.
 *
 * @property useNativeJSONParse
 * @type Boolean
 * @default true
 * @since 3.8.0
 */

/**
Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)

@property {Object|String} delayUntil
@since 3.6.0
@example

You can use `load` or `domready` strings by default:

    YUI({
        delayUntil: 'domready'
    }, function (Y) {
        // This will not execute until 'domeready' occurs.
    });

Or you can delay until a node is available (with `available` or `contentready`):

    YUI({
        delayUntil: {
            event: 'available',
            args : '#foo'
        }
    }, function (Y) {
        // This will not execute until a node matching the selector "#foo" is
        // available in the DOM.
    });

**/
YUI.add('yui-base', function (Y, NAME) {

/*
 * YUI stub
 * @module yui
 * @submodule yui-base
 */
/**
 * The YUI module contains the components required for building the YUI
 * seed file.  This includes the script loading mechanism, a simple queue,
 * and the core utilities for the library.
 * @module yui
 * @submodule yui-base
 */

/**
 * Provides core language utilites and extensions used throughout YUI.
 *
 * @class Lang
 * @static
 */

var L = Y.Lang || (Y.Lang = {}),

STRING_PROTO = String.prototype,
TOSTRING     = Object.prototype.toString,

TYPES = {
    'undefined'        : 'undefined',
    'number'           : 'number',
    'boolean'          : 'boolean',
    'string'           : 'string',
    '[object Function]': 'function',
    '[object RegExp]'  : 'regexp',
    '[object Array]'   : 'array',
    '[object Date]'    : 'date',
    '[object Error]'   : 'error'
},

SUBREGEX         = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,

WHITESPACE       = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF",
WHITESPACE_CLASS = "[\x09-\x0D\x20\xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+",
TRIM_LEFT_REGEX  = new RegExp("^" + WHITESPACE_CLASS),
TRIM_RIGHT_REGEX = new RegExp(WHITESPACE_CLASS + "$"),
TRIMREGEX        = new RegExp(TRIM_LEFT_REGEX.source + "|" + TRIM_RIGHT_REGEX.source, "g"),

NATIVE_FN_REGEX  = /\{\s*\[(?:native code|function)\]\s*\}/i;

// -- Protected Methods --------------------------------------------------------

/**
Returns `true` if the given function appears to be implemented in native code,
`false` otherwise. Will always return `false` -- even in ES5-capable browsers --
if the `useNativeES5` YUI config option is set to `false`.

This isn't guaranteed to be 100% accurate and won't work for anything other than
functions, but it can be useful for determining whether a function like
`Array.prototype.forEach` is native or a JS shim provided by another library.

There's a great article by @kangax discussing certain flaws with this technique:
<http://perfectionkills.com/detecting-built-in-host-methods/>

While his points are valid, it's still possible to benefit from this function
as long as it's used carefully and sparingly, and in such a way that false
negatives have minimal consequences. It's used internally to avoid using
potentially broken non-native ES5 shims that have been added to the page by
other libraries.

@method _isNative
@param {Function} fn Function to test.
@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.
@static
@protected
@since 3.5.0
**/
L._isNative = function (fn) {
    return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));
};

// -- Public Methods -----------------------------------------------------------

/**
 * Determines whether or not the provided item is an array.
 *
 * Returns `false` for array-like collections such as the function `arguments`
 * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to
 * test for an array-like collection.
 *
 * @method isArray
 * @param o The object to test.
 * @return {boolean} true if o is an array.
 * @static
 */
L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {
    return L.type(o) === 'array';
};

/**
 * Determines whether or not the provided item is a boolean.
 * @method isBoolean
 * @static
 * @param o The object to test.
 * @return {boolean} true if o is a boolean.
 */
L.isBoolean = function(o) {
    return typeof o === 'boolean';
};

/**
 * Determines whether or not the supplied item is a date instance.
 * @method isDate
 * @static
 * @param o The object to test.
 * @return {boolean} true if o is a date.
 */
L.isDate = function(o) {
    return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);
};

/**
 * <p>
 * Determines whether or not the provided item is a function.
 * Note: Internet Explorer thinks certain functions are objects:
 * </p>
 *
 * <pre>
 * var obj = document.createElement("object");
 * Y.Lang.isFunction(obj.getAttribute) // reports false in IE
 * &nbsp;
 * var input = document.createElement("input"); // append to body
 * Y.Lang.isFunction(input.focus) // reports false in IE
 * </pre>
 *
 * <p>
 * You will have to implement additional tests if these functions
 * matter to you.
 * </p>
 *
 * @method isFunction
 * @static
 * @param o The object to test.
 * @return {boolean} true if o is a function.
 */
L.isFunction = function(o) {
    return L.type(o) === 'function';
};

/**
 * Determines whether or not the provided item is null.
 * @method isNull
 * @static
 * @param o The object to test.
 * @return {boolean} true if o is null.
 */
L.isNull = function(o) {
    return o === null;
};

/**
 * Determines whether or not the provided item is a legal number.
 * @method isNumber
 * @static
 * @param o The object to test.
 * @return {boolean} true if o is a number.
 */
L.isNumber = function(o) {
    return typeof o === 'number' && isFinite(o);
};

/**
 * Determines whether or not the provided item is of type object
 * or function. Note that arrays are also objects, so
 * <code>Y.Lang.isObject([]) === true</code>.
 * @method isObject
 * @static
 * @param o The object to test.
 * @param failfn {boolean} fail if the input is a function.
 * @return {boolean} true if o is an object.
 * @see isPlainObject
 */
L.isObject = function(o, failfn) {
    var t = typeof o;
    return (o && (t === 'object' ||
        (!failfn && (t === 'function' || L.isFunction(o))))) || false;
};

/**
 * Determines whether or not the provided value is a regexp.
 * @method isRegExp
 * @static
 * @param value The value or object to test.
 * @return {boolean} true if value is a regexp.
 */
L.isRegExp = function(value) {
    return L.type(value) === 'regexp';
};

/**
 * Determines whether or not the provided item is a string.
 * @method isString
 * @static
 * @param o The object to test.
 * @return {boolean} true if o is a string.
 */
L.isString = function(o) {
    return typeof o === 'string';
};

/**
 * Determines whether or not the provided item is undefined.
 * @method isUndefined
 * @static
 * @param o The object to test.
 * @return {boolean} true if o is undefined.
 */
L.isUndefined = function(o) {
    return typeof o === 'undefined';
};

/**
 * A convenience method for detecting a legitimate non-null value.
 * Returns false for null/undefined/NaN, true for other values,
 * including 0/false/''
 * @method isValue
 * @static
 * @param o The item to test.
 * @return {boolean} true if it is not null/undefined/NaN || false.
 */
L.isValue = function(o) {
    var t = L.type(o);

    switch (t) {
        case 'number':
            return isFinite(o);

        case 'null': // fallthru
        case 'undefined':
            return false;

        default:
            return !!t;
    }
};

/**
 * Returns the current time in milliseconds.
 *
 * @method now
 * @return {Number} Current time in milliseconds.
 * @static
 * @since 3.3.0
 */
L.now = Date.now || function () {
    return new Date().getTime();
};

/**
 * Performs `{placeholder}` substitution on a string. The object passed as the
 * second parameter provides values to replace the `{placeholder}`s.
 * `{placeholder}` token names must match property names of the object. For example,
 *
 *`var greeting = Y.Lang.sub("Hello, {who}!", { who: "World" });`
 *
 * `{placeholder}` tokens that are undefined on the object map will be left
 * in tact (leaving unsightly `{placeholder}`'s in the output string).
 *
 * @method sub
 * @param {string} s String to be modified.
 * @param {object} o Object containing replacement values.
 * @return {string} the substitute result.
 * @static
 * @since 3.2.0
 */
L.sub = function(s, o) {

    /**
    Finds the value of `key` in given object.
    If the key has a 'dot' notation e.g. 'foo.bar.baz', the function will
    try to resolve this path if it doesn't exist as a property
    @example
        value({ 'a.b': 1, a: { b: 2 } }, 'a.b'); // 1
        value({ a: { b: 2 } }          , 'a.b'); // 2
    @param {Object} obj A key/value pairs object
    @param {String} key
    @return {Any}
    @private
    **/
    function value(obj, key) {

        var subkey;

        if ( typeof obj[key] !== 'undefined' ) {
            return obj[key];
        }

        key    = key.split('.');         // given 'a.b.c'
        subkey = key.slice(1).join('.'); // 'b.c'
        key    = key[0];                 // 'a'

        // special case for null as typeof returns object and we don't want that.
        if ( subkey && typeof obj[key] === 'object' && obj[key] !== null ) {
            return value(obj[key], subkey);
        }
    }

    return s.replace ? s.replace(SUBREGEX, function (match, key) {
        var val = key.indexOf('.')>-1 ? value(o, key) : o[key];
        return typeof val === 'undefined' ? match : val;
    }) : s;
};

/**
 * Returns a string without any leading or trailing whitespace.  If
 * the input is not a string, the input will be returned untouched.
 * @method trim
 * @static
 * @param s {string} the string to trim.
 * @return {string} the trimmed string.
 */
L.trim = L._isNative(STRING_PROTO.trim) && !WHITESPACE.trim() ? function(s) {
    return s && s.trim ? s.trim() : s;
} : function (s) {
    try {
        return s.replace(TRIMREGEX, '');
    } catch (e) {
        return s;
    }
};

/**
 * Returns a string without any leading whitespace.
 * @method trimLeft
 * @static
 * @param s {string} the string to trim.
 * @return {string} the trimmed string.
 */
L.trimLeft = L._isNative(STRING_PROTO.trimLeft) && !WHITESPACE.trimLeft() ? function (s) {
    return s.trimLeft();
} : function (s) {
    return s.replace(TRIM_LEFT_REGEX, '');
};

/**
 * Returns a string without any trailing whitespace.
 * @method trimRight
 * @static
 * @param s {string} the string to trim.
 * @return {string} the trimmed string.
 */
L.trimRight = L._isNative(STRING_PROTO.trimRight) && !WHITESPACE.trimRight() ? function (s) {
    return s.trimRight();
} : function (s) {
    return s.replace(TRIM_RIGHT_REGEX, '');
};

/**
Returns one of the following strings, representing the type of the item passed
in:

 * "array"
 * "boolean"
 * "date"
 * "error"
 * "function"
 * "null"
 * "number"
 * "object"
 * "regexp"
 * "string"
 * "undefined"

Known issues:

 * `typeof HTMLElementCollection` returns function in Safari, but
    `Y.Lang.type()` reports "object", which could be a good thing --
    but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.

@method type
@param o the item to test.
@return {string} the detected type.
@static
**/
L.type = function(o) {
    return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
};
/**
@module yui
@submodule yui-base
*/

var Lang   = Y.Lang,
    Native = Array.prototype,

    hasOwn = Object.prototype.hasOwnProperty;

/**
Provides utility methods for working with arrays. Additional array helpers can
be found in the `collection` and `array-extras` modules.

`Y.Array(thing)` returns a native array created from _thing_. Depending on
_thing_'s type, one of the following will happen:

  * Arrays are returned unmodified unless a non-zero _startIndex_ is
    specified.
  * Array-like collections (see `Array.test()`) are converted to arrays.
  * For everything else, a new array is created with _thing_ as the sole
    item.

Note: elements that are also collections, such as `<form>` and `<select>`
elements, are not automatically converted to arrays. To force a conversion,
pass `true` as the value of the _force_ parameter.

@class Array
@constructor
@param {Any} thing The thing to arrayify.
@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like
  collection, a subset of items starting at the specified index will be
  returned.
@param {Boolean} [force=false] If `true`, _thing_ will be treated as an
  array-like collection no matter what.
@return {Array} A native array created from _thing_, according to the rules
  described above.
**/
function YArray(thing, startIndex, force) {
    var len, result;

    /*jshint expr: true*/
    startIndex || (startIndex = 0);

    if (force || YArray.test(thing)) {
        // IE throws when trying to slice HTMLElement collections.
        try {
            return Native.slice.call(thing, startIndex);
        } catch (ex) {
            result = [];

            for (len = thing.length; startIndex < len; ++startIndex) {
                result.push(thing[startIndex]);
            }

            return result;
        }
    }

    return [thing];
}

Y.Array = YArray;

/**
Dedupes an array of strings, returning an array that's guaranteed to contain
only one copy of a given string.

This method differs from `Array.unique()` in that it's optimized for use only
with arrays consisting entirely of strings or entirely of numbers, whereas
`unique` may be used with other value types (but is slower).

Using `dedupe()` with values other than strings or numbers, or with arrays
containing a mix of strings and numbers, may result in unexpected behavior.

@method dedupe
@param {String[]|Number[]} array Array of strings or numbers to dedupe.
@return {Array} Copy of _array_ containing no duplicate values.
@static
@since 3.4.0
**/
YArray.dedupe = Lang._isNative(Object.create) ? function (array) {
    var hash    = Object.create(null),
        results = [],
        i, item, len;

    for (i = 0, len = array.length; i < len; ++i) {
        item = array[i];

        if (!hash[item]) {
            hash[item] = 1;
            results.push(item);
        }
    }

    return results;
} : function (array) {
    var hash    = {},
        results = [],
        i, item, len;

    for (i = 0, len = array.length; i < len; ++i) {
        item = array[i];

        if (!hasOwn.call(hash, item)) {
            hash[item] = 1;
            results.push(item);
        }
    }

    return results;
};

/**
Executes the supplied function on each item in the array. This method wraps
the native ES5 `Array.forEach()` method if available.

@method each
@param {Array} array Array to iterate.
@param {Function} fn Function to execute on each item in the array. The function
  will receive the following arguments:
    @param {Any} fn.item Current array item.
    @param {Number} fn.index Current array index.
    @param {Array} fn.array Array being iterated.
@param {Object} [thisObj] `this` object to use when calling _fn_.
@return {YUI} The YUI instance.
@static
**/
YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {
    Native.forEach.call(array || [], fn, thisObj || Y);
    return Y;
} : function (array, fn, thisObj) {
    for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {
        if (i in array) {
            fn.call(thisObj || Y, array[i], i, array);
        }
    }

    return Y;
};

/**
Alias for `each()`.

@method forEach
@static
**/

/**
Returns an object using the first array as keys and the second as values. If
the second array is not provided, or if it doesn't contain the same number of
values as the first array, then `true` will be used in place of the missing
values.

@example

    Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);
    // => {a: 'foo', b: 'bar', c: true}

@method hash
@param {String[]} keys Array of strings to use as keys.
@param {Array} [values] Array to use as values.
@return {Object} Hash using the first array as keys and the second as values.
@static
**/
YArray.hash = function (keys, values) {
    var hash = {},
        vlen = (values && values.length) || 0,
        i, len;

    for (i = 0, len = keys.length; i < len; ++i) {
        if (i in keys) {
            hash[keys[i]] = vlen > i && i in values ? values[i] : true;
        }
    }

    return hash;
};

/**
Returns the index of the first item in the array that's equal (using a strict
equality check) to the specified _value_, or `-1` if the value isn't found.

This method wraps the native ES5 `Array.indexOf()` method if available.

@method indexOf
@param {Array} array Array to search.
@param {Any} value Value to search for.
@param {Number} [from=0] The index at which to begin the search.
@return {Number} Index of the item strictly equal to _value_, or `-1` if not
    found.
@static
**/
YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {
    return Native.indexOf.call(array, value, from);
} : function (array, value, from) {
    // http://es5.github.com/#x15.4.4.14
    var len = array.length;

    from = +from || 0;
    from = (from > 0 || -1) * Math.floor(Math.abs(from));

    if (from < 0) {
        from += len;

        if (from < 0) {
            from = 0;
        }
    }

    for (; from < len; ++from) {
        if (from in array && array[from] === value) {
            return from;
        }
    }

    return -1;
};

/**
Numeric sort convenience function.

The native `Array.prototype.sort()` function converts values to strings and
sorts them in lexicographic order, which is unsuitable for sorting numeric
values. Provide `Array.numericSort` as a custom sort function when you want
to sort values in numeric order.

@example

    [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);
    // => [4, 8, 15, 16, 23, 42]

@method numericSort
@param {Number} a First value to compare.
@param {Number} b Second value to compare.
@return {Number} Difference between _a_ and _b_.
@static
**/
YArray.numericSort = function (a, b) {
    return a - b;
};

/**
Executes the supplied function on each item in the array. Returning a truthy
value from the function will stop the processing of remaining items.

@method some
@param {Array} array Array to iterate over.
@param {Function} fn Function to execute on each item. The function will receive
  the following arguments:
    @param {Any} fn.value Current array item.
    @param {Number} fn.index Current array index.
    @param {Array} fn.array Array being iterated over.
@param {Object} [thisObj] `this` object to use when calling _fn_.
@return {Boolean} `true` if the function returns a truthy value on any of the
  items in the array; `false` otherwise.
@static
**/
YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {
    return Native.some.call(array, fn, thisObj);
} : function (array, fn, thisObj) {
    for (var i = 0, len = array.length; i < len; ++i) {
        if (i in array && fn.call(thisObj, array[i], i, array)) {
            return true;
        }
    }

    return false;
};

/**
Evaluates _obj_ to determine if it's an array, an array-like collection, or
something else. This is useful when working with the function `arguments`
collection and `HTMLElement` collections.

Note: This implementation doesn't consider elements that are also
collections, such as `<form>` and `<select>`, to be array-like.

@method test
@param {Object} obj Object to test.
@return {Number} A number indicating the results of the test:

  * 0: Neither an array nor an array-like collection.
  * 1: Real array.
  * 2: Array-like collection.

@static
**/
YArray.test = function (obj) {
    var result = 0;

    if (Lang.isArray(obj)) {
        result = 1;
    } else if (Lang.isObject(obj)) {
        try {
            // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here),
            // or functions without apply/call (Safari
            // HTMLElementCollection bug).
            if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) {
                result = 2;
            }
        } catch (ex) {}
    }

    return result;
};
/**
 * The YUI module contains the components required for building the YUI
 * seed file.  This includes the script loading mechanism, a simple queue,
 * and the core utilities for the library.
 * @module yui
 * @submodule yui-base
 */

/**
 * A simple FIFO queue.  Items are added to the Queue with add(1..n items) and
 * removed using next().
 *
 * @class Queue
 * @constructor
 * @param {MIXED} item* 0..n items to seed the queue.
 */
function Queue() {
    this._init();
    this.add.apply(this, arguments);
}

Queue.prototype = {
    /**
     * Initialize the queue
     *
     * @method _init
     * @protected
     */
    _init: function() {
        /**
         * The collection of enqueued items
         *
         * @property _q
         * @type Array
         * @protected
         */
        this._q = [];
    },

    /**
     * Get the next item in the queue. FIFO support
     *
     * @method next
     * @return {MIXED} the next item in the queue.
     */
    next: function() {
        return this._q.shift();
    },

    /**
     * Get the last in the queue. LIFO support.
     *
     * @method last
     * @return {MIXED} the last item in the queue.
     */
    last: function() {
        return this._q.pop();
    },

    /**
     * Add 0..n items to the end of the queue.
     *
     * @method add
     * @param {MIXED} item* 0..n items.
     * @return {object} this queue.
     */
    add: function() {
        this._q.push.apply(this._q, arguments);

        return this;
    },

    /**
     * Returns the current number of queued items.
     *
     * @method size
     * @return {Number} The size.
     */
    size: function() {
        return this._q.length;
    }
};

Y.Queue = Queue;

YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();

/**
The YUI module contains the components required for building the YUI seed file.
This includes the script loading mechanism, a simple queue, and the core
utilities for the library.

@module yui
@submodule yui-base
**/

var CACHED_DELIMITER = '__',

    hasOwn   = Object.prototype.hasOwnProperty,
    isObject = Y.Lang.isObject;

/**
Returns a wrapper for a function which caches the return value of that function,
keyed off of the combined string representation of the argument values provided
when the wrapper is called.

Calling this function again with the same arguments will return the cached value
rather than executing the wrapped function.

Note that since the cache is keyed off of the string representation of arguments
passed to the wrapper function, arguments that aren't strings and don't provide
a meaningful `toString()` method may result in unexpected caching behavior. For
example, the objects `{}` and `{foo: 'bar'}` would both be converted to the
string `[object Object]` when used as a cache key.

@method cached
@param {Function} source The function to memoize.
@param {Object} [cache={}] Object in which to store cached values. You may seed
  this object with pre-existing cached values if desired.
@param {any} [refetch] If supplied, this value is compared with the cached value
  using a `==` comparison. If the values are equal, the wrapped function is
  executed again even though a cached value exists.
@return {Function} Wrapped function.
@for YUI
**/
Y.cached = function (source, cache, refetch) {
    /*jshint expr: true*/
    cache || (cache = {});

    return function (arg) {
        var key = arguments.length > 1 ?
                Array.prototype.join.call(arguments, CACHED_DELIMITER) :
                String(arg);

        /*jshint eqeqeq: false*/
        if (!(key in cache) || (refetch && cache[key] == refetch)) {
            cache[key] = source.apply(source, arguments);
        }

        return cache[key];
    };
};

/**
Returns the `location` object from the window/frame in which this YUI instance
operates, or `undefined` when executing in a non-browser environment
(e.g. Node.js).

It is _not_ recommended to hold references to the `window.location` object
outside of the scope of a function in which its properties are being accessed or
its methods are being called. This is because of a nasty bug/issue that exists
in both Safari and MobileSafari browsers:
[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).

@method getLocation
@return {location} The `location` object from the window/frame in which this YUI
    instance operates.
@since 3.5.0
**/
Y.getLocation = function () {
    // It is safer to look this up every time because yui-base is attached to a
    // YUI instance before a user's config is applied; i.e. `Y.config.win` does
    // not point the correct window object when this file is loaded.
    var win = Y.config.win;

    // It is not safe to hold a reference to the `location` object outside the
    // scope in which it is being used. The WebKit engine used in Safari and
    // MobileSafari will "disconnect" the `location` object from the `window`
    // when a page is restored from back/forward history cache.
    return win && win.location;
};

/**
Returns a new object containing all of the properties of all the supplied
objects. The properties from later objects will overwrite those in earlier
objects.

Passing in a single object will create a shallow copy of it. For a deep copy,
use `clone()`.

@method merge
@param {Object} objects* One or more objects to merge.
@return {Object} A new merged object.
**/
Y.merge = function () {
    var i      = 0,
        len    = arguments.length,
        result = {},
        key,
        obj;

    for (; i < len; ++i) {
        obj = arguments[i];

        for (key in obj) {
            if (hasOwn.call(obj, key)) {
                result[key] = obj[key];
            }
        }
    }

    return result;
};

/**
Mixes _supplier_'s properties into _receiver_.

Properties on _receiver_ or _receiver_'s prototype will not be overwritten or
shadowed unless the _overwrite_ parameter is `true`, and will not be merged
unless the _merge_ parameter is `true`.

In the default mode (0), only properties the supplier owns are copied (prototype
properties are not copied). The following copying modes are available:

  * `0`: _Default_. Object to object.
  * `1`: Prototype to prototype.
  * `2`: Prototype to prototype and object to object.
  * `3`: Prototype to object.
  * `4`: Object to prototype.

@method mix
@param {Function|Object} receiver The object or function to receive the mixed
  properties.
@param {Function|Object} supplier The object or function supplying the
  properties to be mixed.
@param {Boolean} [overwrite=false] If `true`, properties that already exist
  on the receiver will be overwritten with properties from the supplier.
@param {String[]} [whitelist] An array of property names to copy. If
  specified, only the whitelisted properties will be copied, and all others
  will be ignored.
@param {Number} [mode=0] Mix mode to use. See above for available modes.
@param {Boolean} [merge=false] If `true`, objects and arrays that already
  exist on the receiver will have the corresponding object/array from the
  supplier merged into them, rather than being skipped or overwritten. When
  both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.
@return {Function|Object|YUI} The receiver, or the YUI instance if the
  specified receiver is falsy.
**/
Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {
    var alwaysOverwrite, exists, from, i, key, len, to;

    // If no supplier is given, we return the receiver. If no receiver is given,
    // we return Y. Returning Y doesn't make much sense to me, but it's
    // grandfathered in for backcompat reasons.
    if (!receiver || !supplier) {
        return receiver || Y;
    }

    if (mode) {
        // In mode 2 (prototype to prototype and object to object), we recurse
        // once to do the proto to proto mix. The object to object mix will be
        // handled later on.
        if (mode === 2) {
            Y.mix(receiver.prototype, supplier.prototype, overwrite,
                    whitelist, 0, merge);
        }

        // Depending on which mode is specified, we may be copying from or to
        // the prototypes of the supplier and receiver.
        from = mode === 1 || mode === 3 ? supplier.prototype : supplier;
        to   = mode === 1 || mode === 4 ? receiver.prototype : receiver;

        // If either the supplier or receiver doesn't actually have a
        // prototype property, then we could end up with an undefined `from`
        // or `to`. If that happens, we abort and return the receiver.
        if (!from || !to) {
            return receiver;
        }
    } else {
        from = supplier;
        to   = receiver;
    }

    // If `overwrite` is truthy and `merge` is falsy, then we can skip a
    // property existence check on each iteration and save some time.
    alwaysOverwrite = overwrite && !merge;

    if (whitelist) {
        for (i = 0, len = whitelist.length; i < len; ++i) {
            key = whitelist[i];

            // We call `Object.prototype.hasOwnProperty` instead of calling
            // `hasOwnProperty` on the object itself, since the object's
            // `hasOwnProperty` method may have been overridden or removed.
            // Also, some native objects don't implement a `hasOwnProperty`
            // method.
            if (!hasOwn.call(from, key)) {
                continue;
            }

            // The `key in to` check here is (sadly) intentional for backwards
            // compatibility reasons. It prevents undesired shadowing of
            // prototype members on `to`.
            exists = alwaysOverwrite ? false : key in to;

            if (merge && exists && isObject(to[key], true)
                    && isObject(from[key], true)) {
                // If we're in merge mode, and the key is present on both
                // objects, and the value on both objects is either an object or
                // an array (but not a function), then we recurse to merge the
                // `from` value into the `to` value instead of overwriting it.
                //
                // Note: It's intentional that the whitelist isn't passed to the
                // recursive call here. This is legacy behavior that lots of
                // code still depends on.
                Y.mix(to[key], from[key], overwrite, null, 0, merge);
            } else if (overwrite || !exists) {
                // We're not in merge mode, so we'll only copy the `from` value
                // to the `to` value if we're in overwrite mode or if the
                // current key doesn't exist on the `to` object.
                to[key] = from[key];
            }
        }
    } else {
        for (key in from) {
            // The code duplication here is for runtime performance reasons.
            // Combining whitelist and non-whitelist operations into a single
            // loop or breaking the shared logic out into a function both result
            // in worse performance, and Y.mix is critical enough that the byte
            // tradeoff is worth it.
            if (!hasOwn.call(from, key)) {
                continue;
            }

            // The `key in to` check here is (sadly) intentional for backwards
            // compatibility reasons. It prevents undesired shadowing of
            // prototype members on `to`.
            exists = alwaysOverwrite ? false : key in to;

            if (merge && exists && isObject(to[key], true)
                    && isObject(from[key], true)) {
                Y.mix(to[key], from[key], overwrite, null, 0, merge);
            } else if (overwrite || !exists) {
                to[key] = from[key];
            }
        }

        // If this is an IE browser with the JScript enumeration bug, force
        // enumeration of the buggy properties by making a recursive call with
        // the buggy properties as the whitelist.
        if (Y.Object._hasEnumBug) {
            Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);
        }
    }

    return receiver;
};
/**
 * The YUI module contains the components required for building the YUI
 * seed file.  This includes the script loading mechanism, a simple queue,
 * and the core utilities for the library.
 * @module yui
 * @submodule yui-base
 */

/**
 * Adds utilities to the YUI instance for working with objects.
 *
 * @class Object
 */

var Lang   = Y.Lang,
    hasOwn = Object.prototype.hasOwnProperty,

    UNDEFINED, // <-- Note the comma. We're still declaring vars.

/**
 * Returns a new object that uses _obj_ as its prototype. This method wraps the
 * native ES5 `Object.create()` method if available, but doesn't currently
 * pass through `Object.create()`'s second argument (properties) in order to
 * ensure compatibility with older browsers.
 *
 * @method ()
 * @param {Object} obj Prototype object.
 * @return {Object} New object using _obj_ as its prototype.
 * @static
 */
O = Y.Object = Lang._isNative(Object.create) ? function (obj) {
    // We currently wrap the native Object.create instead of simply aliasing it
    // to ensure consistency with our fallback shim, which currently doesn't
    // support Object.create()'s second argument (properties). Once we have a
    // safe fallback for the properties arg, we can stop wrapping
    // Object.create().
    return Object.create(obj);
} : (function () {
    // Reusable constructor function for the Object.create() shim.
    function F() {}

    // The actual shim.
    return function (obj) {
        F.prototype = obj;
        return new F();
    };
}()),

/**
 * Property names that IE doesn't enumerate in for..in loops, even when they
 * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to
 * manually enumerate these properties.
 *
 * @property _forceEnum
 * @type String[]
 * @protected
 * @static
 */
forceEnum = O._forceEnum = [
    'hasOwnProperty',
    'isPrototypeOf',
    'propertyIsEnumerable',
    'toString',
    'toLocaleString',
    'valueOf'
],

/**
 * `true` if this browser has the JScript enumeration bug that prevents
 * enumeration of the properties named in the `_forceEnum` array, `false`
 * otherwise.
 *
 * See:
 *   - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
 *   - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>
 *
 * @property _hasEnumBug
 * @type Boolean
 * @protected
 * @static
 */
hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),

/**
 * `true` if this browser incorrectly considers the `prototype` property of
 * functions to be enumerable. Currently known to affect Opera 11.50 and Android 2.3.x.
 *
 * @property _hasProtoEnumBug
 * @type Boolean
 * @protected
 * @static
 */
hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),

/**
 * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or
 * exists only on _obj_'s prototype. This is essentially a safer version of
 * `obj.hasOwnProperty()`.
 *
 * @method owns
 * @param {Object} obj Object to test.
 * @param {String} key Property name to look for.
 * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
 * @static
 */
owns = O.owns = function (obj, key) {
    return !!obj && hasOwn.call(obj, key);
}; // <-- End of var declarations.

/**
 * Alias for `owns()`.
 *
 * @method hasKey
 * @param {Object} obj Object to test.
 * @param {String} key Property name to look for.
 * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
 * @static
 */
O.hasKey = owns;

/**
 * Returns an array containing the object's enumerable keys. Does not include
 * prototype keys or non-enumerable keys.
 *
 * Note that keys are returned in enumeration order (that is, in the same order
 * that they would be enumerated by a `for-in` loop), which may not be the same
 * as the order in which they were defined.
 *
 * This method is an alias for the native ES5 `Object.keys()` method if
 * available and non-buggy. The Opera 11.50 and Android 2.3.x versions of
 * `Object.keys()` have an inconsistency as they consider `prototype` to be
 * enumerable, so a non-native shim is used to rectify the difference.
 *
 * @example
 *
 *     Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});
 *     // => ['a', 'b', 'c']
 *
 * @method keys
 * @param {Object} obj An object.
 * @return {String[]} Array of keys.
 * @static
 */
O.keys = Lang._isNative(Object.keys) && !hasProtoEnumBug ? Object.keys : function (obj) {
    if (!Lang.isObject(obj)) {
        throw new TypeError('Object.keys called on a non-object');
    }

    var keys = [],
        i, key, len;

    if (hasProtoEnumBug && typeof obj === 'function') {
        for (key in obj) {
            if (owns(obj, key) && key !== 'prototype') {
                keys.push(key);
            }
        }
    } else {
        for (key in obj) {
            if (owns(obj, key)) {
                keys.push(key);
            }
        }
    }

    if (hasEnumBug) {
        for (i = 0, len = forceEnum.length; i < len; ++i) {
            key = forceEnum[i];

            if (owns(obj, key)) {
                keys.push(key);
            }
        }
    }

    return keys;
};

/**
 * Returns an array containing the values of the object's enumerable keys.
 *
 * Note that values are returned in enumeration order (that is, in the same
 * order that they would be enumerated by a `for-in` loop), which may not be the
 * same as the order in which they were defined.
 *
 * @example
 *
 *     Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});
 *     // => ['foo', 'bar', 'baz']
 *
 * @method values
 * @param {Object} obj An object.
 * @return {Array} Array of values.
 * @static
 */
O.values = function (obj) {
    var keys   = O.keys(obj),
        i      = 0,
        len    = keys.length,
        values = [];

    for (; i < len; ++i) {
        values.push(obj[keys[i]]);
    }

    return values;
};

/**
 * Returns the number of enumerable keys owned by an object.
 *
 * @method size
 * @param {Object} obj An object.
 * @return {Number} The object's size.
 * @static
 */
O.size = function (obj) {
    try {
        return O.keys(obj).length;
    } catch (ex) {
        return 0; // Legacy behavior for non-objects.
    }
};

/**
 * Returns `true` if the object owns an enumerable property with the specified
 * value.
 *
 * @method hasValue
 * @param {Object} obj An object.
 * @param {any} value The value to search for.
 * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise.
 * @static
 */
O.hasValue = function (obj, value) {
    return Y.Array.indexOf(O.values(obj), value) > -1;
};

/**
 * Executes a function on each enumerable property in _obj_. The function
 * receives the value, the key, and the object itself as parameters (in that
 * order).
 *
 * By default, only properties owned by _obj_ are enumerated. To include
 * prototype properties, set the _proto_ parameter to `true`.
 *
 * @method each
 * @param {Object} obj Object to enumerate.
 * @param {Function} fn Function to execute on each enumerable property.
 *   @param {mixed} fn.value Value of the current property.
 *   @param {String} fn.key Key of the current property.
 *   @param {Object} fn.obj Object being enumerated.
 * @param {Object} [thisObj] `this` object to use when calling _fn_.
 * @param {Boolean} [proto=false] Include prototype properties.
 * @return {YUI} the YUI instance.
 * @chainable
 * @static
 */
O.each = function (obj, fn, thisObj, proto) {
    var key;

    for (key in obj) {
        if (proto || owns(obj, key)) {
            fn.call(thisObj || Y, obj[key], key, obj);
        }
    }

    return Y;
};

/**
 * Executes a function on each enumerable property in _obj_, but halts if the
 * function returns a truthy value. The function receives the value, the key,
 * and the object itself as paramters (in that order).
 *
 * By default, only properties owned by _obj_ are enumerated. To include
 * prototype properties, set the _proto_ parameter to `true`.
 *
 * @method some
 * @param {Object} obj Object to enumerate.
 * @param {Function} fn Function to execute on each enumerable property.
 *   @param {mixed} fn.value Value of the current property.
 *   @param {String} fn.key Key of the current property.
 *   @param {Object} fn.obj Object being enumerated.
 * @param {Object} [thisObj] `this` object to use when calling _fn_.
 * @param {Boolean} [proto=false] Include prototype properties.
 * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,
 *   `false` otherwise.
 * @static
 */
O.some = function (obj, fn, thisObj, proto) {
    var key;

    for (key in obj) {
        if (proto || owns(obj, key)) {
            if (fn.call(thisObj || Y, obj[key], key, obj)) {
                return true;
            }
        }
    }

    return false;
};

/**
 * Retrieves the sub value at the provided path,
 * from the value object provided.
 *
 * @method getValue
 * @static
 * @param o The object from which to extract the property value.
 * @param path {Array} A path array, specifying the object traversal path
 * from which to obtain the sub value.
 * @return {Any} The value stored in the path, undefined if not found,
 * undefined if the source is not an object.  Returns the source object
 * if an empty path is provided.
 */
O.getValue = function(o, path) {
    if (!Lang.isObject(o)) {
        return UNDEFINED;
    }

    var i,
        p = Y.Array(path),
        l = p.length;

    for (i = 0; o !== UNDEFINED && i < l; i++) {
        o = o[p[i]];
    }

    return o;
};

/**
 * Sets the sub-attribute value at the provided path on the
 * value object.  Returns the modified value object, or
 * undefined if the path is invalid.
 *
 * @method setValue
 * @static
 * @param o             The object on which to set the sub value.
 * @param path {Array}  A path array, specifying the object traversal path
 *                      at which to set the sub value.
 * @param val {Any}     The new value for the sub-attribute.
 * @return {Object}     The modified object, with the new sub value set, or
 *                      undefined, if the path was invalid.
 */
O.setValue = function(o, path, val) {
    var i,
        p = Y.Array(path),
        leafIdx = p.length - 1,
        ref = o;

    if (leafIdx >= 0) {
        for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {
            ref = ref[p[i]];
        }

        if (ref !== UNDEFINED) {
            ref[p[i]] = val;
        } else {
            return UNDEFINED;
        }
    }

    return o;
};

/**
 * Returns `true` if the object has no enumerable properties of its own.
 *
 * @method isEmpty
 * @param {Object} obj An object.
 * @return {Boolean} `true` if the object is empty.
 * @static
 * @since 3.2.0
 */
O.isEmpty = function (obj) {
    return !O.keys(Object(obj)).length;
};
/**
 * The YUI module contains the components required for building the YUI seed
 * file.  This includes the script loading mechanism, a simple queue, and the
 * core utilities for the library.
 * @module yui
 * @submodule yui-base
 */

/**
 * YUI user agent detection.
 * Do not fork for a browser if it can be avoided.  Use feature detection when
 * you can.  Use the user agent as a last resort.  For all fields listed
 * as @type float, UA stores a version number for the browser engine,
 * 0 otherwise.  This value may or may not map to the version number of
 * the browser using the engine.  The value is presented as a float so
 * that it can easily be used for boolean evaluation as well as for
 * looking for a particular range of versions.  Because of this,
 * some of the granularity of the version info may be lost.  The fields that
 * are @type string default to null.  The API docs list the values that
 * these fields can have.
 * @class UA
 * @static
 */

/**
* Static method on `YUI.Env` for parsing a UA string.  Called at instantiation
* to populate `Y.UA`.
*
* @static
* @method parseUA
* @param {String} [subUA=navigator.userAgent] UA string to parse
* @return {Object} The Y.UA object
*/
YUI.Env.parseUA = function(subUA) {

    var numberify = function(s) {
            var c = 0;
            return parseFloat(s.replace(/\./g, function() {
                return (c++ === 1) ? '' : '.';
            }));
        },

        win = Y.config.win,

        nav = win && win.navigator,

        o = {

        /**
         * Internet Explorer version number or 0.  Example: 6
         * @property ie
         * @type float
         * @static
         */
        ie: 0,

        /**
         * Opera version number or 0.  Example: 9.2
         * @property opera
         * @type float
         * @static
         */
        opera: 0,

        /**
         * Gecko engine revision number.  Will evaluate to 1 if Gecko
         * is detected but the revision could not be found. Other browsers
         * will be 0.  Example: 1.8
         * <pre>
         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
         * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
         * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
         * Firefox 3.0   <-- 1.9
         * Firefox 3.5   <-- 1.91
         * </pre>
         * @property gecko
         * @type float
         * @static
         */
        gecko: 0,

        /**
         * AppleWebKit version.  KHTML browsers that are not WebKit browsers
         * will evaluate to 1, other browsers 0.  Example: 418.9
         * <pre>
         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
         *                                   latest available for Mac OSX 10.3.
         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
         * Safari 2.0.4:         418     <-- preventDefault fixed
         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
         *                                   different versions of webkit
         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
         *                                   updated, but not updated
         *                                   to the latest patch.
         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native
         * SVG and many major issues fixed).
         * Safari 3.0.4 (523.12) 523.12  <-- First Tiger release - automatic
         * update from 2.x via the 10.4.11 OS patch.
         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
         *                                   yahoo.com user agent hack removed.
         * </pre>
         * http://en.wikipedia.org/wiki/Safari_version_history
         * @property webkit
         * @type float
         * @static
         */
        webkit: 0,

        /**
         * Safari will be detected as webkit, but this property will also
         * be populated with the Safari version number
         * @property safari
         * @type float
         * @static
         */
        safari: 0,

        /**
         * Chrome will be detected as webkit, but this property will also
         * be populated with the Chrome version number
         * @property chrome
         * @type float
         * @static
         */
        chrome: 0,

        /**
         * The mobile property will be set to a string containing any relevant
         * user agent information when a modern mobile browser is detected.
         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
         * devices with the WebKit-based browser, and Opera Mini.
         * @property mobile
         * @type string
         * @default null
         * @static
         */
        mobile: null,

        /**
         * Adobe AIR version number or 0.  Only populated if webkit is detected.
         * Example: 1.0
         * @property air
         * @type float
         */
        air: 0,
        /**
         * PhantomJS version number or 0.  Only populated if webkit is detected.
         * Example: 1.0
         * @property phantomjs
         * @type float
         */
        phantomjs: 0,
        /**
         * Detects Apple iPad's OS version
         * @property ipad
         * @type float
         * @static
         */
        ipad: 0,
        /**
         * Detects Apple iPhone's OS version
         * @property iphone
         * @type float
         * @static
         */
        iphone: 0,
        /**
         * Detects Apples iPod's OS version
         * @property ipod
         * @type float
         * @static
         */
        ipod: 0,
        /**
         * General truthy check for iPad, iPhone or iPod
         * @property ios
         * @type Boolean
         * @default null
         * @static
         */
        ios: null,
        /**
         * Detects Googles Android OS version
         * @property android
         * @type float
         * @static
         */
        android: 0,
        /**
         * Detects Kindle Silk
         * @property silk
         * @type float
         * @static
         */
        silk: 0,
        /**
         * Detects Ubuntu version
         * @property ubuntu
         * @type float
         * @static
         */
        ubuntu: 0,
        /**
         * Detects Kindle Silk Acceleration
         * @property accel
         * @type Boolean
         * @static
         */
        accel: false,
        /**
         * Detects Palms WebOS version
         * @property webos
         * @type float
         * @static
         */
        webos: 0,

        /**
         * Google Caja version number or 0.
         * @property caja
         * @type float
         */
        caja: nav && nav.cajaVersion,

        /**
         * Set to true if the page appears to be in SSL
         * @property secure
         * @type boolean
         * @static
         */
        secure: false,

        /**
         * The operating system.
         *
         * Possible values are `windows`, `macintosh`, `android`, `symbos`, `linux`, `rhino` and `ios`.
         *
         * @property os
         * @type string
         * @default null
         * @static
         */
        os: null,

        /**
         * The Nodejs Version
         * @property nodejs
         * @type float
         * @default 0
         * @static
         */
        nodejs: 0,
        /**
        * Window8/IE10 Application host environment
        * @property winjs
        * @type Boolean
        * @static
        */
        winjs: !!((typeof Windows !== "undefined") && Windows.System),
        /**
        * Are touch/msPointer events available on this device
        * @property touchEnabled
        * @type Boolean
        * @static
        */
        touchEnabled: false
    },

    ua = subUA || nav && nav.userAgent,

    loc = win && win.location,

    href = loc && loc.href,

    m;

    /**
    * The User Agent string that was parsed
    * @property userAgent
    * @type String
    * @static
    */
    o.userAgent = ua;


    o.secure = href && (href.toLowerCase().indexOf('https') === 0);

    if (ua) {

        if ((/windows|win32/i).test(ua)) {
            o.os = 'windows';
        } else if ((/macintosh|mac_powerpc/i).test(ua)) {
            o.os = 'macintosh';
        } else if ((/android/i).test(ua)) {
            o.os = 'android';
        } else if ((/symbos/i).test(ua)) {
            o.os = 'symbos';
        } else if ((/linux/i).test(ua)) {
            o.os = 'linux';
        } else if ((/rhino/i).test(ua)) {
            o.os = 'rhino';
        }

        // Modern KHTML browsers should qualify as Safari X-Grade
        if ((/KHTML/).test(ua)) {
            o.webkit = 1;
        }
        if ((/IEMobile|XBLWP7/).test(ua)) {
            o.mobile = 'windows';
        }
        if ((/Fennec/).test(ua)) {
            o.mobile = 'gecko';
        }
        // Modern WebKit browsers are at least X-Grade
        m = ua.match(/AppleWebKit\/([^\s]*)/);
        if (m && m[1]) {
            o.webkit = numberify(m[1]);
            o.safari = o.webkit;

            if (/PhantomJS/.test(ua)) {
                m = ua.match(/PhantomJS\/([^\s]*)/);
                if (m && m[1]) {
                    o.phantomjs = numberify(m[1]);
                }
            }

            // Mobile browser check
            if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {
                o.mobile = 'Apple'; // iPhone or iPod Touch

                m = ua.match(/OS ([^\s]*)/);
                if (m && m[1]) {
                    m = numberify(m[1].replace('_', '.'));
                }
                o.ios = m;
                o.os = 'ios';
                o.ipad = o.ipod = o.iphone = 0;

                m = ua.match(/iPad|iPod|iPhone/);
                if (m && m[0]) {
                    o[m[0].toLowerCase()] = o.ios;
                }
            } else {
                m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);
                if (m) {
                    // Nokia N-series, webOS, ex: NokiaN95
                    o.mobile = m[0];
                }
                if (/webOS/.test(ua)) {
                    o.mobile = 'WebOS';
                    m = ua.match(/webOS\/([^\s]*);/);
                    if (m && m[1]) {
                        o.webos = numberify(m[1]);
                    }
                }
                if (/ Android/.test(ua)) {
                    o.mobile = 'Android';
                    m = ua.match(/Android ([^\s]*);/);
                    if (m && m[1]) {
                        o.android = numberify(m[1]);
                    }

                }
                if (/Silk/.test(ua)) {
                    m = ua.match(/Silk\/([^\s]*)/);
                    if (m && m[1]) {
                        o.silk = numberify(m[1]);
                    }
                    if (!o.android) {
                        o.android = 2.34; //Hack for desktop mode in Kindle
                        o.os = 'Android';
                    }
                    if (/Accelerated=true/.test(ua)) {
                        o.accel = true;
                    }
                }
            }

            m = ua.match(/OPR\/(\d+\.\d+)/);

            if (m && m[1]) {
                // Opera 15+ with Blink (pretends to be both Chrome and Safari)
                o.opera = numberify(m[1]);
            } else {
                m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);

                if (m && m[1] && m[2]) {
                    o.chrome = numberify(m[2]); // Chrome
                    o.safari = 0; //Reset safari back to 0
                    if (m[1] === 'CrMo') {
                        o.mobile = 'chrome';
                    }
                } else {
                    m = ua.match(/AdobeAIR\/([^\s]*)/);
                    if (m) {
                        o.air = m[0]; // Adobe AIR 1.0 or better
                    }
                }
            }
        }

        m = ua.match(/Ubuntu\ (\d+\.\d+)/);
        if (m && m[1]) {

            o.os = 'linux';
            o.ubuntu = numberify(m[1]);

            m = ua.match(/\ WebKit\/([^\s]*)/);
            if (m && m[1]) {
                o.webkit = numberify(m[1]);
            }
            m = ua.match(/\ Chromium\/([^\s]*)/);
            if (m && m[1]) {
                o.chrome = numberify(m[1]);
            }
            if (/ Mobile$/.test(ua)) {
                o.mobile = 'Ubuntu';
            }
        }

        if (!o.webkit) { // not webkit
// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
            if (/Opera/.test(ua)) {
                m = ua.match(/Opera[\s\/]([^\s]*)/);
                if (m && m[1]) {
                    o.opera = numberify(m[1]);
                }
                m = ua.match(/Version\/([^\s]*)/);
                if (m && m[1]) {
                    o.opera = numberify(m[1]); // opera 10+
                }

                if (/Opera Mobi/.test(ua)) {
                    o.mobile = 'opera';
                    m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);
                    if (m && m[1]) {
                        o.opera = numberify(m[1]);
                    }
                }
                m = ua.match(/Opera Mini[^;]*/);

                if (m) {
                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
                }
            } else { // not opera or webkit
                m = ua.match(/MSIE ([^;]*)|Trident.*; rv:([0-9.]+)/);

                if (m && (m[1] || m[2])) {
                    o.ie = numberify(m[1] || m[2]);
                } else { // not opera, webkit, or ie
                    m = ua.match(/Gecko\/([^\s]*)/);

                    if (m) {
                        o.gecko = 1; // Gecko detected, look for revision
                        m = ua.match(/rv:([^\s\)]*)/);
                        if (m && m[1]) {
                            o.gecko = numberify(m[1]);
                            if (/Mobile|Tablet/.test(ua)) {
                                o.mobile = "ffos";
                            }
                        }
                    }
                }
            }
        }
    }

    //Check for known properties to tell if touch events are enabled on this device or if
    //the number of MSPointer touchpoints on this device is greater than 0.
    if (win && nav && !(o.chrome && o.chrome < 6)) {
        o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));
    }

    //It was a parsed UA, do not assign the global value.
    if (!subUA) {

        if (typeof process === 'object') {

            if (process.versions && process.versions.node) {
                //NodeJS
                o.os = process.platform;
                o.nodejs = numberify(process.versions.node);
            }
        }

        YUI.Env.UA = o;

    }

    return o;
};


Y.UA = YUI.Env.UA || YUI.Env.parseUA();

/**
Performs a simple comparison between two version numbers, accounting for
standard versioning logic such as the fact that "535.8" is a lower version than
"535.24", even though a simple numerical comparison would indicate that it's
greater. Also accounts for cases such as "1.1" vs. "1.1.0", which are
considered equivalent.

Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,
1 if _a_ is higher than _b_.

Versions may be numbers or strings containing numbers and dots. For example,
both `535` and `"535.8.10"` are acceptable. A version string containing
non-numeric characters, like `"535.8.beta"`, may produce unexpected results.

@method compareVersions
@param {Number|String} a First version number to compare.
@param {Number|String} b Second version number to compare.
@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is
    higher than _b_.
**/
Y.UA.compareVersions = function (a, b) {
    var aPart, aParts, bPart, bParts, i, len;

    if (a === b) {
        return 0;
    }

    aParts = (a + '').split('.');
    bParts = (b + '').split('.');

    for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {
        aPart = parseInt(aParts[i], 10);
        bPart = parseInt(bParts[i], 10);

        /*jshint expr: true*/
        isNaN(aPart) && (aPart = 0);
        isNaN(bPart) && (bPart = 0);

        if (aPart < bPart) {
            return -1;
        }

        if (aPart > bPart) {
            return 1;
        }
    }

    return 0;
};
YUI.Env.aliases = {
    "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
    "anim-shape-transform": ["anim-shape"],
    "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"],
    "attribute": ["attribute-base","attribute-complex"],
    "attribute-events": ["attribute-observable"],
    "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
    "axes": ["axis-numeric","axis-category","axis-time","axis-stacked"],
    "axes-base": ["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],
    "base": ["base-base","base-pluginhost","base-build"],
    "cache": ["cache-base","cache-offline","cache-plugin"],
    "charts": ["charts-base"],
    "collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],
    "color": ["color-base","color-hsl","color-harmony"],
    "controller": ["router"],
    "dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
    "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
    "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],
    "datatype": ["datatype-date","datatype-number","datatype-xml"],
    "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"],
    "datatype-number": ["datatype-number-parse","datatype-number-format"],
    "datatype-xml": ["datatype-xml-parse","datatype-xml-format"],
    "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
    "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"],
    "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
    "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],
    "event-custom": ["event-custom-base","event-custom-complex"],
    "event-gestures": ["event-flick","event-move"],
    "handlebars": ["handlebars-compiler"],
    "highlight": ["highlight-base","highlight-accentfold"],
    "history": ["history-base","history-hash","history-html5"],
    "io": ["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],
    "json": ["json-parse","json-stringify"],
    "loader": ["loader-base","loader-rollup","loader-yui3"],
    "loader-pathogen-encoder": ["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"],
    "node": ["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],
    "pluginhost": ["pluginhost-base","pluginhost-config"],
    "querystring": ["querystring-parse","querystring-stringify"],
    "recordset": ["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],
    "resize": ["resize-base","resize-proxy","resize-constrain"],
    "slider": ["slider-base","slider-value-range","clickable-rail","range-slider"],
    "template": ["template-base","template-micro"],
    "text": ["text-accentfold","text-wordbreak"],
    "widget": ["widget-base","widget-htmlparser","widget-skin","widget-uievents"]
};


}, 'patched-v3.18.1', {
    "use": [
        "yui-base",
        "get",
        "features",
        "intl-base",
        "yui-log",
        "yui-later",
        "loader-base",
        "loader-rollup",
        "loader-yui3"
    ]
});
YUI.add('get', function (Y, NAME) {

/*jslint boss:true, expr:true, laxbreak: true */

/**
Provides dynamic loading of remote JavaScript and CSS resources.

@module get
@class Get
@static
**/

var Lang = Y.Lang,

    CUSTOM_ATTRS, // defined lazily in Y.Get.Transaction._createNode()

    Get, Transaction;

Y.Get = Get = {
    // -- Public Properties ----------------------------------------------------

    /**
    Default options for CSS requests. Options specified here will override
    global defaults for CSS requests.

    See the `options` property for all available options.

    @property cssOptions
    @type Object
    @static
    @since 3.5.0
    **/
    cssOptions: {
        attributes: {
            rel: 'stylesheet'
        },

        doc         : Y.config.linkDoc || Y.config.doc,
        pollInterval: 50
    },

    /**
    Default options for JS requests. Options specified here will override global
    defaults for JS requests.

    See the `options` property for all available options.

    @property jsOptions
    @type Object
    @static
    @since 3.5.0
    **/
    jsOptions: {
        autopurge: true,
        doc      : Y.config.scriptDoc || Y.config.doc
    },

    /**
    Default options to use for all requests.

    Note that while all available options are documented here for ease of
    discovery, some options (like callback functions) only make sense at the
    transaction level.

    Callback functions specified via the options object or the `options`
    parameter of the `css()`, `js()`, or `load()` methods will receive the
    transaction object as a parameter. See `Y.Get.Transaction` for details on
    the properties and methods available on transactions.

    @static
    @since 3.5.0
    @property {Object} options

    @property {Boolean} [options.async=false] Whether or not to load scripts
        asynchronously, meaning they're requested in parallel and execution
        order is not guaranteed. Has no effect on CSS, since CSS is always
        loaded asynchronously.

    @property {Object} [options.attributes] HTML attribute name/value pairs that
        should be added to inserted nodes. By default, the `charset` attribute
        will be set to "utf-8" and nodes will be given an auto-generated `id`
        attribute, but you can override these with your own values if desired.

    @property {Boolean} [options.autopurge] Whether or not to automatically
        purge inserted nodes after the purge threshold is reached. This is
        `true` by default for JavaScript, but `false` for CSS since purging a
        CSS node will also remove any styling applied by the referenced file.

    @property {Object} [options.context] `this` object to use when calling
        callback functions. Defaults to the transaction object.

    @property {Mixed} [options.data] Arbitrary data object to pass to "on*"
        callbacks.

    @property {Document} [options.doc] Document into which nodes should be
        inserted. By default, the current document is used.

    @property {HTMLElement|String} [options.insertBefore] HTML element or id
        string of an element before which all generated nodes should be
        inserted. If not specified, Get will automatically determine the best
        place to insert nodes for maximum compatibility.

    @property {Function} [options.onEnd] Callback to execute after a transaction
        is complete, regardless of whether it succeeded or failed.

    @property {Function} [options.onFailure] Callback to execute after a
        transaction fails, times out, or is aborted.

    @property {Function} [options.onProgress] Callback to execute after each
        individual request in a transaction either succeeds or fails.

    @property {Function} [options.onSuccess] Callback to execute after a
        transaction completes successfully with no errors. Note that in browsers
        that don't support the `error` event on CSS `<link>` nodes, a failed CSS
        request may still be reported as a success because in these browsers
        it can be difficult or impossible to distinguish between success and
        failure for CSS resources.

    @property {Function} [options.onTimeout] Callback to execute after a
        transaction times out.

    @property {Number} [options.pollInterval=50] Polling interval (in
        milliseconds) for detecting CSS load completion in browsers that don't
        support the `load` event on `<link>` nodes. This isn't used for
        JavaScript.

    @property {Number} [options.purgethreshold=20] Number of nodes to insert
        before triggering an automatic purge when `autopurge` is `true`.

    @property {Number} [options.timeout] Number of milliseconds to wait before
        aborting a transaction. When a timeout occurs, the `onTimeout` callback
        is called, followed by `onFailure` and finally `onEnd`. By default,
        there is no timeout.

    @property {String} [options.type] Resource type ("css" or "js"). This option
        is set automatically by the `css()` and `js()` functions and will be
        ignored there, but may be useful when using the `load()` function. If
        not specified, the type will be inferred from the URL, defaulting to
        "js" if the URL doesn't contain a recognizable file extension.
    **/
    options: {
        attributes: {
            charset: 'utf-8'
        },

        purgethreshold: 20
    },

    // -- Protected Properties -------------------------------------------------

    /**
    Regex that matches a CSS URL. Used to guess the file type when it's not
    specified.

    @property REGEX_CSS
    @type RegExp
    @final
    @protected
    @static
    @since 3.5.0
    **/
    REGEX_CSS: /\.css(?:[?;].*)?$/i,

    /**
    Regex that matches a JS URL. Used to guess the file type when it's not
    specified.

    @property REGEX_JS
    @type RegExp
    @final
    @protected
    @static
    @since 3.5.0
    **/
    REGEX_JS : /\.js(?:[?;].*)?$/i,

    /**
    Contains information about the current environment, such as what script and
    link injection features it supports.

    This object is created and populated the first time the `_getEnv()` method
    is called.

    @property _env
    @type Object
    @protected
    @static
    @since 3.5.0
    **/

    /**
    Mapping of document _yuid strings to <head> or <base> node references so we
    don't have to look the node up each time we want to insert a request node.

    @property _insertCache
    @type Object
    @protected
    @static
    @since 3.5.0
    **/
    _insertCache: {},

    /**
    Information about the currently pending transaction, if any.

    This is actually an object with two properties: `callback`, containing the
    optional callback passed to `css()`, `load()`, or `js()`; and `transaction`,
    containing the actual transaction instance.

    @property _pending
    @type Object
    @protected
    @static
    @since 3.5.0
    **/
    _pending: null,

    /**
    HTML nodes eligible to be purged next time autopurge is triggered.

    @property _purgeNodes
    @type HTMLElement[]
    @protected
    @static
    @since 3.5.0
    **/
    _purgeNodes: [],

    /**
    Queued transactions and associated callbacks.

    @property _queue
    @type Object[]
    @protected
    @static
    @since 3.5.0
    **/
    _queue: [],

    // -- Public Methods -------------------------------------------------------

    /**
    Aborts the specified transaction.

    This will cause the transaction's `onFailure` callback to be called and
    will prevent any new script and link nodes from being added to the document,
    but any resources that have already been requested will continue loading
    (there's no safe way to prevent this, unfortunately).

    *Note:* This method is deprecated as of 3.5.0, and will be removed in a
    future version of YUI. Use the transaction-level `abort()` method instead.

    @method abort
    @param {Get.Transaction} transaction Transaction to abort.
    @deprecated Use the `abort()` method on the transaction instead.
    @static
    **/
    abort: function (transaction) {
        var i, id, item, len, pending;


        if (!transaction.abort) {
            id          = transaction;
            pending     = this._pending;
            transaction = null;

            if (pending && pending.transaction.id === id) {
                transaction   = pending.transaction;
                this._pending = null;
            } else {
                for (i = 0, len = this._queue.length; i < len; ++i) {
                    item = this._queue[i].transaction;

                    if (item.id === id) {
                        transaction = item;
                        this._queue.splice(i, 1);
                        break;
                    }
                }
            }
        }

        transaction && transaction.abort();
    },

    /**
    Loads one or more CSS files.

    The _urls_ parameter may be provided as a URL string, a request object,
    or an array of URL strings and/or request objects.

    A request object is just an object that contains a `url` property and zero
    or more options that should apply specifically to that request.
    Request-specific options take priority over transaction-level options and
    default options.

    URLs may be relative or absolute, and do not have to have the same origin
    as the current page.

    The `options` parameter may be omitted completely and a callback passed in
    its place, if desired.

    @example

        // Load a single CSS file and log a message on completion.
        Y.Get.css('foo.css', function (err) {
            if (err) {
            } else {
            }
        });

        // Load multiple CSS files and log a message when all have finished
        // loading.
        var urls = ['foo.css', 'http://example.com/bar.css', 'baz/quux.css'];

        Y.Get.css(urls, function (err) {
            if (err) {
            } else {
            }
        });

        // Specify transaction-level options, which will apply to all requests
        // within the transaction.
        Y.Get.css(urls, {
            attributes: {'class': 'my-css'},
            timeout   : 5000
        });

        // Specify per-request options, which override transaction-level and
        // default options.
        Y.Get.css([
            {url: 'foo.css', attributes: {id: 'foo'}},
            {url: 'bar.css', attributes: {id: 'bar', charset: 'iso-8859-1'}}
        ]);

    @method css
    @param {String|Object|Array} urls URL string, request object, or array
        of URLs and/or request objects to load.
    @param {Object} [options] Options for this transaction. See the
        `Y.Get.options` property for a complete list of available options.
    @param {Function} [callback] Callback function to be called on completion.
        This is a general callback and will be called before any more granular
        callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`
        object.

        @param {Array|null} callback.err Array of errors that occurred during
            the transaction, or `null` on success.
        @param {Get.Transaction} callback.transaction Transaction object.

    @return {Get.Transaction} Transaction object.
    @static
    **/
    css: function (urls, options, callback) {
        return this._load('css', urls, options, callback);
    },

    /**
    Loads one or more JavaScript resources.

    The _urls_ parameter may be provided as a URL string, a request object,
    or an array of URL strings and/or request objects.

    A request object is just an object that contains a `url` property and zero
    or more options that should apply specifically to that request.
    Request-specific options take priority over transaction-level options and
    default options.

    URLs may be relative or absolute, and do not have to have the same origin
    as the current page.

    The `options` parameter may be omitted completely and a callback passed in
    its place, if desired.

    Scripts will be executed in the order they're specified unless the `async`
    option is `true`, in which case they'll be loaded in parallel and executed
    in whatever order they finish loading.

    @example

        // Load a single JS file and log a message on completion.
        Y.Get.js('foo.js', function (err) {
            if (err) {
            } else {
            }
        });

        // Load multiple JS files, execute them in order, and log a message when
        // all have finished loading.
        var urls = ['foo.js', 'http://example.com/bar.js', 'baz/quux.js'];

        Y.Get.js(urls, function (err) {
            if (err) {
            } else {
            }
        });

        // Specify transaction-level options, which will apply to all requests
        // within the transaction.
        Y.Get.js(urls, {
            attributes: {'class': 'my-js'},
            timeout   : 5000
        });

        // Specify per-request options, which override transaction-level and
        // default options.
        Y.Get.js([
            {url: 'foo.js', attributes: {id: 'foo'}},
            {url: 'bar.js', attributes: {id: 'bar', charset: 'iso-8859-1'}}
        ]);

    @method js
    @param {String|Object|Array} urls URL string, request object, or array
        of URLs and/or request objects to load.
    @param {Object} [options] Options for this transaction. See the
        `Y.Get.options` property for a complete list of available options.
    @param {Function} [callback] Callback function to be called on completion.
        This is a general callback and will be called before any more granular
        callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`
        object.

        @param {Array|null} callback.err Array of errors that occurred during
            the transaction, or `null` on success.
        @param {Get.Transaction} callback.transaction Transaction object.

    @return {Get.Transaction} Transaction object.
    @since 3.5.0
    @static
    **/
    js: function (urls, options, callback) {
        return this._load('js', urls, options, callback);
    },

    /**
    Loads one or more CSS and/or JavaScript resources in the same transaction.

    Use this method when you want to load both CSS and JavaScript in a single
    transaction and be notified when all requested URLs have finished loading,
    regardless of type.

    Behavior and options are the same as for the `css()` and `js()` methods. If
    a resource type isn't specified in per-request options or transaction-level
    options, Get will guess the file type based on the URL's extension (`.css`
    or `.js`, with or without a following query string). If the file type can't
    be guessed from the URL, a warning will be logged and Get will assume the
    URL is a JavaScript resource.

    @example

        // Load both CSS and JS files in a single transaction, and log a message
        // when all files have finished loading.
        Y.Get.load(['foo.css', 'bar.js', 'baz.css'], function (err) {
            if (err) {
            } else {
            }
        });

    @method load
    @param {String|Object|Array} urls URL string, request object, or array
        of URLs and/or request objects to load.
    @param {Object} [options] Options for this transaction. See the
        `Y.Get.options` property for a complete list of available options.
    @param {Function} [callback] Callback function to be called on completion.
        This is a general callback and will be called before any more granular
        callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`
        object.

        @param {Array|null} err Array of errors that occurred during the
            transaction, or `null` on success.
        @param {Get.Transaction} Transaction object.

    @return {Get.Transaction} Transaction object.
    @since 3.5.0
    @static
    **/
    load: function (urls, options, callback) {
        return this._load(null, urls, options, callback);
    },

    // -- Protected Methods ----------------------------------------------------

    /**
    Triggers an automatic purge if the purge threshold has been reached.

    @method _autoPurge
    @param {Number} threshold Purge threshold to use, in milliseconds.
    @protected
    @since 3.5.0
    @static
    **/
    _autoPurge: function (threshold) {
        if (threshold && this._purgeNodes.length >= threshold) {
            this._purge(this._purgeNodes);
        }
    },

    /**
    Populates the `_env` property with information about the current
    environment.

    @method _getEnv
    @return {Object} Environment information.
    @protected
    @since 3.5.0
    @static
    **/
    _getEnv: function () {
        var doc = Y.config.doc,
            ua  = Y.UA;

        // Note: some of these checks require browser sniffs since it's not
        // feasible to load test files on every pageview just to perform a
        // feature test. I'm sorry if this makes you sad.
        return (this._env = {

            // True if this is a browser that supports disabling async mode on
            // dynamically created script nodes. See
            // https://developer.mozilla.org/En/HTML/Element/Script#Attributes

            // IE10 doesn't return true for the MDN feature test, so setting it explicitly,
            // because it is async by default, and allows you to disable async by setting it to false
            async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),

            // True if this browser fires an event when a dynamically injected
            // link node fails to load. This is currently true for Firefox 9+
            // and WebKit 535.24+
            cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0,

            // True if this browser fires an event when a dynamically injected
            // link node finishes loading. This is currently true for IE, Opera,
            // Firefox 9+, and WebKit 535.24+. Note that IE versions <9 fire the
            // DOM 0 "onload" event, but not "load". All versions of IE fire
            // "onload".
            // davglass: Seems that Chrome on Android needs this to be false.
            cssLoad: (
                    (!ua.gecko && !ua.webkit) || ua.gecko >= 9 ||
                    ua.compareVersions(ua.webkit, 535.24) >= 0
                ) && !(ua.chrome && ua.chrome <= 18),

            // True if this browser preserves script execution order while
            // loading scripts in parallel as long as the script node's `async`
            // attribute is set to false to explicitly disable async execution.
            preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10))
        });
    },

    _getTransaction: function (urls, options) {
        var requests = [],
            i, len, req, url;

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

        options = Y.merge(this.options, options);

        // Clone the attributes object so we don't end up modifying it by ref.
        options.attributes = Y.merge(this.options.attributes,
                options.attributes);

        for (i = 0, len = urls.length; i < len; ++i) {
            url = urls[i];
            req = {attributes: {}};

            // If `url` is a string, we create a URL object for it, then mix in
            // global options and request-specific options. If it's an object
            // with a "url" property, we assume it's a request object containing
            // URL-specific options.
            if (typeof url === 'string') {
                req.url = url;
            } else if (url.url) {
                // URL-specific options override both global defaults and
                // request-specific options.
                Y.mix(req, url, false, null, 0, true);
                url = url.url; // Make url a string so we can use it later.
            } else {
                continue;
            }

            Y.mix(req, options, false, null, 0, true);

            // If we didn't get an explicit type for this URL either in the
            // request options or the URL-specific options, try to determine
            // one from the file extension.
            if (!req.type) {
                if (this.REGEX_CSS.test(url)) {
                    req.type = 'css';
                } else {
                    if (!this.REGEX_JS.test(url)) {
                    }

                    req.type = 'js';
                }
            }

            // Mix in type-specific default options, but don't overwrite any
            // options that have already been set.
            Y.mix(req, req.type === 'js' ? this.jsOptions : this.cssOptions,
                false, null, 0, true);

            // Give the node an id attribute if it doesn't already have one.
            req.attributes.id || (req.attributes.id = Y.guid());

            // Backcompat for <3.5.0 behavior.
            if (req.win) {
                req.doc = req.win.document;
            } else {
                req.win = req.doc.defaultView || req.doc.parentWindow;
            }

            if (req.charset) {
                req.attributes.charset = req.charset;
            }

            requests.push(req);
        }

        return new Transaction(requests, options);
    },

    _load: function (type, urls, options, callback) {
        var transaction;

        // Allow callback as third param.
        if (typeof options === 'function') {
            callback = options;
            options  = {};
        }

        options || (options = {});
        options.type = type;

        options._onFinish = Get._onTransactionFinish;

        if (!this._env) {
            this._getEnv();
        }

        transaction = this._getTransaction(urls, options);

        this._queue.push({
            callback   : callback,
            transaction: transaction
        });

        this._next();

        return transaction;
    },

    _onTransactionFinish : function() {
        Get._pending = null;
        Get._next();
    },

    _next: function () {
        var item;

        if (this._pending) {
            return;
        }

        item = this._queue.shift();

        if (item) {
            this._pending = item;
            item.transaction.execute(item.callback);
        }
    },

    _purge: function (nodes) {
        var purgeNodes    = this._purgeNodes,
            isTransaction = nodes !== purgeNodes,
            index, node;

        while (node = nodes.pop()) { // assignment
            // Don't purge nodes that haven't finished loading (or errored out),
            // since this can hang the transaction.
            if (!node._yuiget_finished) {
                continue;
            }

            node.parentNode && node.parentNode.removeChild(node);

            // If this is a transaction-level purge and this node also exists in
            // the Get-level _purgeNodes array, we need to remove it from
            // _purgeNodes to avoid creating a memory leak. The indexOf lookup
            // sucks, but until we get WeakMaps, this is the least troublesome
            // way to do this (we can't just hold onto node ids because they may
            // not be in the same document).
            if (isTransaction) {
                index = Y.Array.indexOf(purgeNodes, node);

                if (index > -1) {
                    purgeNodes.splice(index, 1);
                }
            }
        }
    }
};

/**
Alias for `js()`.

@method script
@static
**/
Get.script = Get.js;

/**
Represents a Get transaction, which may contain requests for one or more JS or
CSS files.

This class should not be instantiated manually. Instances will be created and
returned as needed by Y.Get's `css()`, `js()`, and `load()` methods.

@class Get.Transaction
@constructor
@since 3.5.0
**/
Get.Transaction = Transaction = function (requests, options) {
    var self = this;

    self.id       = Transaction._lastId += 1;
    self.data     = options.data;
    self.errors   = [];
    self.nodes    = [];
    self.options  = options;
    self.requests = requests;

    self._callbacks = []; // callbacks to call after execution finishes
    self._queue     = [];
    self._reqsWaiting   = 0;

    // Deprecated pre-3.5.0 properties.
    self.tId = self.id; // Use `id` instead.
    self.win = options.win || Y.config.win;
};

/**
Arbitrary data object associated with this transaction.

This object comes from the options passed to `Get.css()`, `Get.js()`, or
`Get.load()`, and will be `undefined` if no data object was specified.

@property {Object} data
**/

/**
Array of errors that have occurred during this transaction, if any. Each error
object has the following properties:
`errors.error`: Error message.
`errors.request`: Request object related to the error.

@since 3.5.0
@property {Object[]} errors
**/

/**
Numeric id for this transaction, unique among all transactions within the same
YUI sandbox in the current pageview.

@property {Number} id
@since 3.5.0
**/

/**
HTMLElement nodes (native ones, not YUI Node instances) that have been inserted
during the current transaction.

@property {HTMLElement[]} nodes
**/

/**
Options associated with this transaction.

See `Get.options` for the full list of available options.

@property {Object} options
@since 3.5.0
**/

/**
Request objects contained in this transaction. Each request object represents
one CSS or JS URL that will be (or has been) requested and loaded into the page.

@property {Object} requests
@since 3.5.0
**/

/**
Id of the most recent transaction.

@property _lastId
@type Number
@protected
@static
**/
Transaction._lastId = 0;

Transaction.prototype = {
    // -- Public Properties ----------------------------------------------------

    /**
    Current state of this transaction. One of "new", "executing", or "done".

    @property _state
    @type String
    @protected
    **/
    _state: 'new', // "new", "executing", or "done"

    // -- Public Methods -------------------------------------------------------

    /**
    Aborts this transaction.

    This will cause the transaction's `onFailure` callback to be called and
    will prevent any new script and link nodes from being added to the document,
    but any resources that have already been requested will continue loading
    (there's no safe way to prevent this, unfortunately).

    @method abort
    @param {String} [msg="Aborted."] Optional message to use in the `errors`
        array describing why the transaction was aborted.
    **/
    abort: function (msg) {
        this._pending    = null;
        this._pendingCSS = null;
        this._pollTimer  = clearTimeout(this._pollTimer);
        this._queue      = [];
        this._reqsWaiting    = 0;

        this.errors.push({error: msg || 'Aborted'});
        this._finish();
    },

    /**
    Begins execting the transaction.

    There's usually no reason to call this manually, since Get will call it
    automatically when other pending transactions have finished. If you really
    want to execute your transaction before Get does, you can, but be aware that
    this transaction's scripts may end up executing before the scripts in other
    pending transactions.

    If the transaction is already executing, the specified callback (if any)
    will be queued and called after execution finishes. If the transaction has
    already finished, the callback will be called immediately (the transaction
    will not be executed again).

    @method execute
    @param {Function} callback Callback function to execute after all requests
        in the transaction are complete, or after the transaction is aborted.
    **/
    execute: function (callback) {
        var self     = this,
            requests = self.requests,
            state    = self._state,
            i, len, queue, req;

        if (state === 'done') {
            callback && callback(self.errors.length ? self.errors : null, self);
            return;
        } else {
            callback && self._callbacks.push(callback);

            if (state === 'executing') {
                return;
            }
        }

        self._state = 'executing';
        self._queue = queue = [];

        if (self.options.timeout) {
            self._timeout = setTimeout(function () {
                self.abort('Timeout');
            }, self.options.timeout);
        }

        self._reqsWaiting = requests.length;

        for (i = 0, len = requests.length; i < len; ++i) {
            req = requests[i];

            if (req.async || req.type === 'css') {
                // No need to queue CSS or fully async JS.
                self._insert(req);
            } else {
                queue.push(req);
            }
        }

        self._next();
    },

    /**
    Manually purges any `<script>` or `<link>` nodes this transaction has
    created.

    Be careful when purging a transaction that contains CSS requests, since
    removing `<link>` nodes will also remove any styles they applied.

    @method purge
    **/
    purge: function () {
        Get._purge(this.nodes);
    },

    // -- Protected Methods ----------------------------------------------------
    _createNode: function (name, attrs, doc) {
        var node = doc.createElement(name),
            attr, testEl;

        if (!CUSTOM_ATTRS) {
            // IE6 and IE7 expect property names rather than attribute names for
            // certain attributes. Rather than sniffing, we do a quick feature
            // test the first time _createNode() runs to determine whether we
            // need to provide a workaround.
            testEl = doc.createElement('div');
            testEl.setAttribute('class', 'a');

            CUSTOM_ATTRS = testEl.className === 'a' ? {} : {
                'for'  : 'htmlFor',
                'class': 'className'
            };
        }

        for (attr in attrs) {
            if (attrs.hasOwnProperty(attr)) {
                node.setAttribute(CUSTOM_ATTRS[attr] || attr, attrs[attr]);
            }
        }

        return node;
    },

    _finish: function () {
        var errors  = this.errors.length ? this.errors : null,
            options = this.options,
            thisObj = options.context || this,
            data, i, len;

        if (this._state === 'done') {
            return;
        }

        this._state = 'done';

        for (i = 0, len = this._callbacks.length; i < len; ++i) {
            this._callbacks[i].call(thisObj, errors, this);
        }

        data = this._getEventData();

        if (errors) {
            if (options.onTimeout && errors[errors.length - 1].error === 'Timeout') {
                options.onTimeout.call(thisObj, data);
            }

            if (options.onFailure) {
                options.onFailure.call(thisObj, data);
            }
        } else if (options.onSuccess) {
            options.onSuccess.call(thisObj, data);
        }

        if (options.onEnd) {
            options.onEnd.call(thisObj, data);
        }

        if (options._onFinish) {
            options._onFinish();
        }
    },

    _getEventData: function (req) {
        if (req) {
            // This merge is necessary for backcompat. I hate it.
            return Y.merge(this, {
                abort  : this.abort, // have to copy these because the prototype isn't preserved
                purge  : this.purge,
                request: req,
                url    : req.url,
                win    : req.win
            });
        } else {
            return this;
        }
    },

    _getInsertBefore: function (req) {
        var doc = req.doc,
            el  = req.insertBefore,
            cache, docStamp;

        if (el) {
            return typeof el === 'string' ? doc.getElementById(el) : el;
        }

        cache    = Get._insertCache;
        docStamp = Y.stamp(doc);

        if ((el = cache[docStamp])) { // assignment
            return el;
        }

        // Inserting before a <base> tag apparently works around an IE bug
        // (according to a comment from pre-3.5.0 Y.Get), but I'm not sure what
        // bug that is, exactly. Better safe than sorry?
        if ((el = doc.getElementsByTagName('base')[0])) { // assignment
            return (cache[docStamp] = el);
        }

        // Look for a <head> element.
        el = doc.head || doc.getElementsByTagName('head')[0];

        if (el) {
            // Create a marker node at the end of <head> to use as an insertion
            // point. Inserting before this node will ensure that all our CSS
            // gets inserted in the correct order, to maintain style precedence.
            el.appendChild(doc.createTextNode(''));
            return (cache[docStamp] = el.lastChild);
        }

        // If all else fails, just insert before the first script node on the
        // page, which is virtually guaranteed to exist.
        return (cache[docStamp] = doc.getElementsByTagName('script')[0]);
    },

    _insert: function (req) {
        var env          = Get._env,
            insertBefore = this._getInsertBefore(req),
            isScript     = req.type === 'js',
            node         = req.node,
            self         = this,
            ua           = Y.UA,
            cssTimeout, nodeType;

        if (!node) {
            if (isScript) {
                nodeType = 'script';
            } else if (!env.cssLoad && ua.gecko) {
                nodeType = 'style';
            } else {
                nodeType = 'link';
                delete req.attributes['charset'];
            }

            node = req.node = this._createNode(nodeType, req.attributes,
                req.doc);
        }

        function onError() {
            self._progress('Failed to load ' + req.url, req);
        }

        function onLoad() {
            if (cssTimeout) {
                clearTimeout(cssTimeout);
            }

            self._progress(null, req);
        }

        // Deal with script asynchronicity.
        if (isScript) {
            node.setAttribute('src', req.url);

            if (req.async) {
                // Explicitly indicate that we want the browser to execute this
                // script asynchronously. This is necessary for older browsers
                // like Firefox <4.
                node.async = true;
            } else {
                if (env.async) {
                    // This browser treats injected scripts as async by default
                    // (standard HTML5 behavior) but asynchronous loading isn't
                    // desired, so tell the browser not to mark this script as
                    // async.
                    node.async = false;
                }

                // If this browser doesn't preserve script execution order based
                // on insertion order, we'll need to avoid inserting other
                // scripts until this one finishes loading.
                if (!env.preservesScriptOrder) {
                    this._pending = req;
                }
            }
        } else {
            if (!env.cssLoad && ua.gecko) {
                // In Firefox <9, we can import the requested URL into a <style>
                // node and poll for the existence of node.sheet.cssRules. This
                // gives us a reliable way to determine CSS load completion that
                // also works for cross-domain stylesheets.
                //
                // Props to Zach Leatherman for calling my attention to this
                // technique.
                node.innerHTML = (req.attributes.charset ?
                    '@charset "' + req.attributes.charset + '";' : '') +
                    '@import "' + req.url + '";';
            } else {
                node.setAttribute('href', req.url);
            }
        }

        // Inject the node.
        if (isScript && ua.ie && (ua.ie < 9 || (document.documentMode && document.documentMode < 9))) {
            // Script on IE < 9, and IE 9+ when in IE 8 or older modes, including quirks mode.
            node.onreadystatechange = function () {
                if (/loaded|complete/.test(node.readyState)) {
                    node.onreadystatechange = null;
                    onLoad();
                }
            };
        } else if (!isScript && !env.cssLoad) {
            // CSS on Firefox <9 or WebKit.
            this._poll(req);
        } else {
            // Script or CSS on everything else. Using DOM 0 events because that
            // evens the playing field with older IEs.

            if (ua.ie >= 10) {

                // We currently need to introduce a timeout for IE10, since it
                // calls onerror/onload synchronously for 304s - messing up existing
                // program flow.

                // Remove this block if the following bug gets fixed by GA
                /*jshint maxlen: 1500 */
                // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload
                node.onerror = function() { setTimeout(onError, 0); };
                node.onload  = function() { setTimeout(onLoad, 0); };
            } else {
                node.onerror = onError;
                node.onload  = onLoad;
            }

            // If this browser doesn't fire an event when CSS fails to load,
            // fail after a timeout to avoid blocking the transaction queue.
            if (!env.cssFail && !isScript) {
                cssTimeout = setTimeout(onError, req.timeout || 3000);
            }
        }

        this.nodes.push(node);
        insertBefore.parentNode.insertBefore(node, insertBefore);
    },

    _next: function () {
        if (this._pending) {
            return;
        }

        // If there are requests in the queue, insert the next queued request.
        // Otherwise, if we're waiting on already-inserted requests to finish,
        // wait longer. If there are no queued requests and we're not waiting
        // for anything to load, then we're done!
        if (this._queue.length) {
            this._insert(this._queue.shift());
        } else if (!this._reqsWaiting) {
            this._finish();
        }
    },

    _poll: function (newReq) {
        var self       = this,
            pendingCSS = self._pendingCSS,
            isWebKit   = Y.UA.webkit,
            i, hasRules, j, nodeHref, req, sheets;

        if (newReq) {
            pendingCSS || (pendingCSS = self._pendingCSS = []);
            pendingCSS.push(newReq);

            if (self._pollTimer) {
                // A poll timeout is already pending, so no need to create a
                // new one.
                return;
            }
        }

        self._pollTimer = null;

        // Note: in both the WebKit and Gecko hacks below, a CSS URL that 404s
        // will still be treated as a success. There's no good workaround for
        // this.

        for (i = 0; i < pendingCSS.length; ++i) {
            req = pendingCSS[i];

            if (isWebKit) {
                // Look for a stylesheet matching the pending URL.
                sheets   = req.doc.styleSheets;
                j        = sheets.length;
                nodeHref = req.node.href;

                while (--j >= 0) {
                    if (sheets[j].href === nodeHref) {
                        pendingCSS.splice(i, 1);
                        i -= 1;
                        self._progress(null, req);
                        break;
                    }
                }
            } else {
                // Many thanks to Zach Leatherman for calling my attention to
                // the @import-based cross-domain technique used here, and to
                // Oleg Slobodskoi for an earlier same-domain implementation.
                //
                // See Zach's blog for more details:
                // http://www.zachleat.com/web/2010/07/29/load-css-dynamically/
                try {
                    // We don't really need to store this value since we never
                    // use it again, but if we don't store it, Closure Compiler
                    // assumes the code is useless and removes it.
                    hasRules = !!req.node.sheet.cssRules;

                    // If we get here, the stylesheet has loaded.
                    pendingCSS.splice(i, 1);
                    i -= 1;
                    self._progress(null, req);
                } catch (ex) {
                    // An exception means the stylesheet is still loading.
                }
            }
        }

        if (pendingCSS.length) {
            self._pollTimer = setTimeout(function () {
                self._poll.call(self);
            }, self.options.pollInterval);
        }
    },

    _progress: function (err, req) {
        var options = this.options;

        if (err) {
            req.error = err;

            this.errors.push({
                error  : err,
                request: req
            });

        }

        req.node._yuiget_finished = req.finished = true;

        if (options.onProgress) {
            options.onProgress.call(options.context || this,
                this._getEventData(req));
        }

        if (req.autopurge) {
            // Pre-3.5.0 Get always excludes the most recent node from an
            // autopurge. I find this odd, but I'm keeping that behavior for
            // the sake of backcompat.
            Get._autoPurge(this.options.purgethreshold);
            Get._purgeNodes.push(req.node);
        }

        if (this._pending === req) {
            this._pending = null;
        }

        this._reqsWaiting -= 1;

        this._next();
    }
};


}, 'patched-v3.18.1', {"requires": ["yui-base"]});
YUI.add('features', function (Y, NAME) {

var feature_tests = {};

/**
Contains the core of YUI's feature test architecture.
@module features
*/

/**
* Feature detection
* @class Features
* @static
*/

Y.mix(Y.namespace('Features'), {

    /**
    * Object hash of all registered feature tests
    * @property tests
    * @type Object
    */
    tests: feature_tests,

    /**
    * Add a test to the system
    *
    *   ```
    *   Y.Features.add("load", "1", {});
    *   ```
    *
    * @method add
    * @param {String} cat The category, right now only 'load' is supported
    * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3
    * @param {Object} o Object containing test properties
    * @param {String} o.name The name of the test
    * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance
    * @param {String} o.trigger The module that triggers this test.
    */
    add: function(cat, name, o) {
        feature_tests[cat] = feature_tests[cat] || {};
        feature_tests[cat][name] = o;
    },
    /**
    * Execute all tests of a given category and return the serialized results
    *
    *   ```
    *   caps=1:1;2:1;3:0
    *   ```
    * @method all
    * @param {String} cat The category to execute
    * @param {Array} args The arguments to pass to the test function
    * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0
    */
    all: function(cat, args) {
        var cat_o = feature_tests[cat],
            // results = {};
            result = [];
        if (cat_o) {
            Y.Object.each(cat_o, function(v, k) {
                result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));
            });
        }

        return (result.length) ? result.join(';') : '';
    },
    /**
    * Run a specific test and return a Boolean response.
    *
    *   ```
    *   Y.Features.test("load", "1");
    *   ```
    *
    * @method test
    * @param {String} cat The category of the test to run
    * @param {String} name The name of the test to run
    * @param {Array} args The arguments to pass to the test function
    * @return {Boolean} True or false if the test passed/failed.
    */
    test: function(cat, name, args) {
        args = args || [];
        var result, ua, test,
            cat_o = feature_tests[cat],
            feature = cat_o && cat_o[name];

        if (!feature) {
        } else {

            result = feature.result;

            if (Y.Lang.isUndefined(result)) {

                ua = feature.ua;
                if (ua) {
                    result = (Y.UA[ua]);
                }

                test = feature.test;
                if (test && ((!ua) || result)) {
                    result = test.apply(Y, args);
                }

                feature.result = result;
            }
        }

        return result;
    }
});

// Y.Features.add("load", "1", {});
// Y.Features.test("load", "1");
// caps=1:1;2:0;3:1;

/* This file is auto-generated by (yogi loader --yes --mix --start ../) */
/*jshint maxlen:900, eqeqeq: false */
var add = Y.Features.add;
// app-transitions-native
add('load', '0', {
    "name": "app-transitions-native",
    "test": function (Y) {
    var doc  = Y.config.doc,
        node = doc ? doc.documentElement : null;

    if (node && node.style) {
        return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);
    }

    return false;
},
    "trigger": "app-transitions"
});
// autocomplete-list-keys
add('load', '1', {
    "name": "autocomplete-list-keys",
    "test": function (Y) {
    // Only add keyboard support to autocomplete-list if this doesn't appear to
    // be an iOS or Android-based mobile device.
    //
    // There's currently no feasible way to actually detect whether a device has
    // a hardware keyboard, so this sniff will have to do. It can easily be
    // overridden by manually loading the autocomplete-list-keys module.
    //
    // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
    // doesn't fire the keyboard events used by AutoCompleteList, so there's
    // no point loading the -keys module even when a bluetooth keyboard may be
    // available.
    return !(Y.UA.ios || Y.UA.android);
},
    "trigger": "autocomplete-list"
});
// dd-gestures
add('load', '2', {
    "name": "dd-gestures",
    "trigger": "dd-drag",
    "ua": "touchEnabled"
});
// dom-style-ie
add('load', '3', {
    "name": "dom-style-ie",
    "test": function (Y) {

    var testFeature = Y.Features.test,
        addFeature = Y.Features.add,
        WINDOW = Y.config.win,
        DOCUMENT = Y.config.doc,
        DOCUMENT_ELEMENT = 'documentElement',
        ret = false;

    addFeature('style', 'computedStyle', {
        test: function() {
            return WINDOW && 'getComputedStyle' in WINDOW;
        }
    });

    addFeature('style', 'opacity', {
        test: function() {
            return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
        }
    });

    ret =  (!testFeature('style', 'opacity') &&
            !testFeature('style', 'computedStyle'));

    return ret;
},
    "trigger": "dom-style"
});
// editor-para-ie
add('load', '4', {
    "name": "editor-para-ie",
    "trigger": "editor-para",
    "ua": "ie",
    "when": "instead"
});
// event-base-ie
add('load', '5', {
    "name": "event-base-ie",
    "test": function(Y) {
    var imp = Y.config.doc && Y.config.doc.implementation;
    return (imp && (!imp.hasFeature('Events', '2.0')));
},
    "trigger": "node-base"
});
// graphics-canvas
add('load', '6', {
    "name": "graphics-canvas",
    "test": function(Y) {
    var DOCUMENT = Y.config.doc,
        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
},
    "trigger": "graphics"
});
// graphics-canvas-default
add('load', '7', {
    "name": "graphics-canvas-default",
    "test": function(Y) {
    var DOCUMENT = Y.config.doc,
        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
},
    "trigger": "graphics"
});
// graphics-svg
add('load', '8', {
    "name": "graphics-svg",
    "test": function(Y) {
    var DOCUMENT = Y.config.doc,
        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));

    return svg && (useSVG || !canvas);
},
    "trigger": "graphics"
});
// graphics-svg-default
add('load', '9', {
    "name": "graphics-svg-default",
    "test": function(Y) {
    var DOCUMENT = Y.config.doc,
        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));

    return svg && (useSVG || !canvas);
},
    "trigger": "graphics"
});
// graphics-vml
add('load', '10', {
    "name": "graphics-vml",
    "test": function(Y) {
    var DOCUMENT = Y.config.doc,
		canvas = DOCUMENT && DOCUMENT.createElement("canvas");
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
    "trigger": "graphics"
});
// graphics-vml-default
add('load', '11', {
    "name": "graphics-vml-default",
    "test": function(Y) {
    var DOCUMENT = Y.config.doc,
		canvas = DOCUMENT && DOCUMENT.createElement("canvas");
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
    "trigger": "graphics"
});
// history-hash-ie
add('load', '12', {
    "name": "history-hash-ie",
    "test": function (Y) {
    var docMode = Y.config.doc && Y.config.doc.documentMode;

    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
            !docMode || docMode < 8);
},
    "trigger": "history-hash"
});
// io-nodejs
add('load', '13', {
    "name": "io-nodejs",
    "trigger": "io-base",
    "ua": "nodejs"
});
// json-parse-shim
add('load', '14', {
    "name": "json-parse-shim",
    "test": function (Y) {
    var _JSON = Y.config.global.JSON,
        Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,
        nativeSupport = Y.config.useNativeJSONParse !== false && !!Native;

    function workingNative( k, v ) {
        return k === "ok" ? true : v;
    }

    // Double check basic functionality.  This is mainly to catch early broken
    // implementations of the JSON API in Firefox 3.1 beta1 and beta2
    if ( nativeSupport ) {
        try {
            nativeSupport = ( Native.parse( '{"ok":false}', workingNative ) ).ok;
        }
        catch ( e ) {
            nativeSupport = false;
        }
    }

    return !nativeSupport;
},
    "trigger": "json-parse"
});
// json-stringify-shim
add('load', '15', {
    "name": "json-stringify-shim",
    "test": function (Y) {
    var _JSON = Y.config.global.JSON,
        Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,
        nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native;

    // Double check basic native functionality.  This is primarily to catch broken
    // early JSON API implementations in Firefox 3.1 beta1 and beta2.
    if ( nativeSupport ) {
        try {
            nativeSupport = ( '0' === Native.stringify(0) );
        } catch ( e ) {
            nativeSupport = false;
        }
    }


    return !nativeSupport;
},
    "trigger": "json-stringify"
});
// scrollview-base-ie
add('load', '16', {
    "name": "scrollview-base-ie",
    "trigger": "scrollview-base",
    "ua": "ie"
});
// selector-css2
add('load', '17', {
    "name": "selector-css2",
    "test": function (Y) {
    var DOCUMENT = Y.config.doc,
        ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);

    return ret;
},
    "trigger": "selector"
});
// transition-timer
add('load', '18', {
    "name": "transition-timer",
    "test": function (Y) {
    var DOCUMENT = Y.config.doc,
        node = (DOCUMENT) ? DOCUMENT.documentElement: null,
        ret = true;

    if (node && node.style) {
        ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);
    }

    return ret;
},
    "trigger": "transition"
});
// widget-base-ie
add('load', '19', {
    "name": "widget-base-ie",
    "trigger": "widget-base",
    "ua": "ie"
});
// yql-jsonp
add('load', '20', {
    "name": "yql-jsonp",
    "test": function (Y) {
    /* Only load the JSONP module when not in nodejs or winjs
    TODO Make the winjs module a CORS module
    */
    return (!Y.UA.nodejs && !Y.UA.winjs);
},
    "trigger": "yql"
});
// yql-nodejs
add('load', '21', {
    "name": "yql-nodejs",
    "trigger": "yql",
    "ua": "nodejs"
});
// yql-winjs
add('load', '22', {
    "name": "yql-winjs",
    "trigger": "yql",
    "ua": "winjs"
});

}, 'patched-v3.18.1', {"requires": ["yui-base"]});
YUI.add('intl-base', function (Y, NAME) {

/**
 * The Intl utility provides a central location for managing sets of
 * localized resources (strings and formatting patterns).
 *
 * @class Intl
 * @uses EventTarget
 * @static
 */

var SPLIT_REGEX = /[, ]/;

Y.mix(Y.namespace('Intl'), {

 /**
    * Returns the language among those available that
    * best matches the preferred language list, using the Lookup
    * algorithm of BCP 47.
    * If none of the available languages meets the user's preferences,
    * then "" is returned.
    * Extended language ranges are not supported.
    *
    * @method lookupBestLang
    * @param {String[] | String} preferredLanguages The list of preferred
    * languages in descending preference order, represented as BCP 47
    * language tags. A string array or a comma-separated list.
    * @param {String[]} availableLanguages The list of languages
    * that the application supports, represented as BCP 47 language
    * tags.
    *
    * @return {String} The available language that best matches the
    * preferred language list, or "".
    * @since 3.1.0
    */
    lookupBestLang: function(preferredLanguages, availableLanguages) {

        var i, language, result, index;

        // check whether the list of available languages contains language;
        // if so return it
        function scan(language) {
            var i;
            for (i = 0; i < availableLanguages.length; i += 1) {
                if (language.toLowerCase() ===
                            availableLanguages[i].toLowerCase()) {
                    return availableLanguages[i];
                }
            }
        }

        if (Y.Lang.isString(preferredLanguages)) {
            preferredLanguages = preferredLanguages.split(SPLIT_REGEX);
        }

        for (i = 0; i < preferredLanguages.length; i += 1) {
            language = preferredLanguages[i];
            if (!language || language === '*') {
                continue;
            }
            // check the fallback sequence for one language
            while (language.length > 0) {
                result = scan(language);
                if (result) {
                    return result;
                } else {
                    index = language.lastIndexOf('-');
                    if (index >= 0) {
                        language = language.substring(0, index);
                        // one-character subtags get cut along with the
                        // following subtag
                        if (index >= 2 && language.charAt(index - 2) === '-') {
                            language = language.substring(0, index - 2);
                        }
                    } else {
                        // nothing available for this language
                        break;
                    }
                }
            }
        }

        return '';
    }
});


}, 'patched-v3.18.1', {"requires": ["yui-base"]});
YUI.add('yui-log', function (Y, NAME) {

/**
 * Provides console log capability and exposes a custom event for
 * console implementations. This module is a `core` YUI module,
 * <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>.
 *
 * @module yui
 * @submodule yui-log
 */

var INSTANCE = Y,
    LOGEVENT = 'yui:log',
    UNDEFINED = 'undefined',
    LEVELS = { debug: 1,
               info: 2,
               warn: 4,
               error: 8 };

/**
 * If the 'debug' config is true, a 'yui:log' event will be
 * dispatched, which the Console widget and anything else
 * can consume.  If the 'useBrowserConsole' config is true, it will
 * write to the browser console if available.  YUI-specific log
 * messages will only be present in the -debug versions of the
 * JS files.  The build system is supposed to remove log statements
 * from the raw and minified versions of the files.
 *
 * @method log
 * @for YUI
 * @param  {String}  msg  The message to log.
 * @param  {String}  cat  The log category for the message.  Default
 *                        categories are "info", "warn", "error", "debug".
 *                        Custom categories can be used as well. (opt).
 * @param  {String}  src  The source of the the message (opt).
 * @param  {boolean} silent If true, the log event won't fire.
 * @return {YUI}      YUI instance.
 */
INSTANCE.log = function(msg, cat, src, silent) {
    var bail, excl, incl, m, f, minlevel,
        Y = INSTANCE,
        c = Y.config,
        publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
    // suppress log message if the config is off or the event stack
    // or the event call stack contains a consumer of the yui:log event
    if (c.debug) {
        // apply source filters
        src = src || "";
        if (typeof src !== "undefined") {
            excl = c.logExclude;
            incl = c.logInclude;
            if (incl && !(src in incl)) {
                bail = 1;
            } else if (incl && (src in incl)) {
                bail = !incl[src];
            } else if (excl && (src in excl)) {
                bail = excl[src];
            }

            // Set a default category of info if the category was not defined.
            if ((typeof cat === 'undefined')) {
                cat = 'info';
            }

            // Determine the current minlevel as defined in configuration
            Y.config.logLevel = Y.config.logLevel || 'debug';
            minlevel = LEVELS[Y.config.logLevel.toLowerCase()];

            if (cat in LEVELS && LEVELS[cat] < minlevel) {
                // Skip this message if the we don't meet the defined minlevel
                bail = 1;
            }
        }
        if (!bail) {
            if (c.useBrowserConsole) {
                m = (src) ? src + ': ' + msg : msg;
                if (Y.Lang.isFunction(c.logFn)) {
                    c.logFn.call(Y, msg, cat, src);
                } else if (typeof console !== UNDEFINED && console.log) {
                    f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
                    console[f](m);
                } else if (typeof opera !== UNDEFINED) {
                    opera.postError(m);
                }
            }

            if (publisher && !silent) {

                if (publisher === Y && (!publisher.getEvent(LOGEVENT))) {
                    publisher.publish(LOGEVENT, {
                        broadcast: 2
                    });
                }

                publisher.fire(LOGEVENT, {
                    msg: msg,
                    cat: cat,
                    src: src
                });
            }
        }
    }

    return Y;
};

/**
 * Write a system message.  This message will be preserved in the
 * minified and raw versions of the YUI files, unlike log statements.
 * @method message
 * @for YUI
 * @param  {String}  msg  The message to log.
 * @param  {String}  cat  The log category for the message.  Default
 *                        categories are "info", "warn", "error", "debug".
 *                        Custom categories can be used as well. (opt).
 * @param  {String}  src  The source of the the message (opt).
 * @param  {boolean} silent If true, the log event won't fire.
 * @return {YUI}      YUI instance.
 */
INSTANCE.message = function() {
    return INSTANCE.log.apply(INSTANCE, arguments);
};


}, 'patched-v3.18.1', {"requires": ["yui-base"]});
YUI.add('yui-later', function (Y, NAME) {

/**
 * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module,
 * <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>.
 *
 * @module yui
 * @submodule yui-later
 */

var NO_ARGS = [];

/**
 * Executes the supplied function in the context of the supplied
 * object 'when' milliseconds later.  Executes the function a
 * single time unless periodic is set to true.
 * @for YUI
 * @method later
 * @param when {Number} the number of milliseconds to wait until the fn
 * is executed.
 * @param o the context object.
 * @param fn {Function|String} the function to execute or the name of
 * the method in the 'o' object to execute.
 * @param data [Array] data that is provided to the function.  This
 * accepts either a single item or an array.  If an array is provided,
 * the function is executed with one parameter for each array item.
 * If you need to pass a single array parameter, it needs to be wrapped
 * in an array [myarray].
 *
 * Note: native methods in IE may not have the call and apply methods.
 * In this case, it will work, but you are limited to four arguments.
 *
 * @param periodic {boolean} if true, executes continuously at supplied
 * interval until canceled.
 * @return {object} a timer object. Call the cancel() method on this
 * object to stop the timer.
 */
Y.later = function(when, o, fn, data, periodic) {
    when = when || 0;
    data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
    o = o || Y.config.win || Y;

    var cancelled = false,
        method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
        wrapper = function() {
            // IE 8- may execute a setInterval callback one last time
            // after clearInterval was called, so in order to preserve
            // the cancel() === no more runny-run, we have to jump through
            // an extra hoop.
            if (!cancelled) {
                if (!method.apply) {
                    method(data[0], data[1], data[2], data[3]);
                } else {
                    method.apply(o, data || NO_ARGS);
                }
            }
        },
        id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);

    return {
        id: id,
        interval: periodic,
        cancel: function() {
            cancelled = true;
            if (this.interval) {
                clearInterval(id);
            } else {
                clearTimeout(id);
            }
        }
    };
};

Y.Lang.later = Y.later;



}, 'patched-v3.18.1', {"requires": ["yui-base"]});
YUI.add('loader-base', function (Y, NAME) {

/**
 * The YUI loader core
 * @module loader
 * @submodule loader-base
 */

(function() {
    var VERSION = Y.version,
        BUILD = '/build/',
        ROOT = VERSION + '/',
        CDN_BASE = Y.Env.base,
        GALLERY_VERSION = 'gallery-2014.06.04-21-38',
        TNT = '2in3',
        TNT_VERSION = '4',
        YUI2_VERSION = '2.9.0',
        COMBO_BASE = CDN_BASE + 'combo?',
        META = {
            version: VERSION,
            root: ROOT,
            base: Y.Env.base,
            comboBase: COMBO_BASE,
            skin: {
                defaultSkin: 'sam',
                base: 'assets/skins/',
                path: 'skin.css',
                after: [
                    'cssreset',
                    'cssfonts',
                    'cssgrids',
                    'cssbase',
                    'cssreset-context',
                    'cssfonts-context'
                ]
            },
            groups: {},
            patterns: {}
        },
        groups = META.groups,
        yui2Update = function(tnt, yui2, config) {
            var root = TNT + '.' +
                    (tnt || TNT_VERSION) + '/' +
                    (yui2 || YUI2_VERSION) + BUILD,
                base = (config && config.base) ? config.base : CDN_BASE,
                combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;

            groups.yui2.base = base + root;
            groups.yui2.root = root;
            groups.yui2.comboBase = combo;
        },
        galleryUpdate = function(tag, config) {
            var root = (tag || GALLERY_VERSION) + BUILD,
                base = (config && config.base) ? config.base : CDN_BASE,
                combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;

            groups.gallery.base = base + root;
            groups.gallery.root = root;
            groups.gallery.comboBase = combo;
        };


    groups[VERSION] = {};

    groups.gallery = {
        ext: false,
        combine: true,
        comboBase: COMBO_BASE,
        update: galleryUpdate,
        patterns: {
            'gallery-': {},
            'lang/gallery-': {},
            'gallerycss-': {
                type: 'css'
            }
        }
    };

    groups.yui2 = {
        combine: true,
        ext: false,
        comboBase: COMBO_BASE,
        update: yui2Update,
        patterns: {
            'yui2-': {
                configFn: function(me) {
                    if (/-skin|reset|fonts|grids|base/.test(me.name)) {
                        me.type = 'css';
                        me.path = me.path.replace(/\.js/, '.css');
                        // this makes skins in builds earlier than
                        // 2.6.0 work as long as combine is false
                        me.path = me.path.replace(/\/yui2-skin/,
                                            '/assets/skins/sam/yui2-skin');
                    }
                }
            }
        }
    };

    galleryUpdate();
    yui2Update();

    if (YUI.Env[VERSION]) {
        Y.mix(META, YUI.Env[VERSION], false, [
            'modules',
            'groups',
            'skin'
        ], 0, true);
    }

    YUI.Env[VERSION] = META;
}());
/*jslint forin: true, maxlen: 350 */

/**
 * Loader dynamically loads script and css files.  It includes the dependency
 * information for the version of the library in use, and will automatically pull in
 * dependencies for the modules requested. It can also load the
 * files from the Yahoo! CDN, and it can utilize the combo service provided on
 * this network to reduce the number of http connections required to download
 * YUI files.
 *
 * @module loader
 * @main loader
 * @submodule loader-base
 */

var NOT_FOUND = {},
    NO_REQUIREMENTS = [],
    MAX_URL_LENGTH = 1024,
    GLOBAL_ENV = YUI.Env,
    GLOBAL_LOADED = GLOBAL_ENV._loaded,
    CSS = 'css',
    JS = 'js',
    INTL = 'intl',
    DEFAULT_SKIN = 'sam',
    VERSION = Y.version,
    ROOT_LANG = '',
    YObject = Y.Object,
    oeach = YObject.each,
    yArray = Y.Array,
    _queue = GLOBAL_ENV._loaderQueue,
    META = GLOBAL_ENV[VERSION],
    SKIN_PREFIX = 'skin-',
    L = Y.Lang,
    ON_PAGE = GLOBAL_ENV.mods,
    modulekey,
    _path = function(dir, file, type, nomin) {
        var path = dir + '/' + file;
        if (!nomin) {
            path += '-min';
        }
        path += '.' + (type || CSS);

        return path;
    };


    if (!YUI.Env._cssLoaded) {
        YUI.Env._cssLoaded = {};
    }


/**
 * The component metadata is stored in Y.Env.meta.
 * Part of the loader module.
 * @property meta
 * @for YUI
 */
Y.Env.meta = META;

/**
 * Loader dynamically loads script and css files.  It includes the dependency
 * info for the version of the library in use, and will automatically pull in
 * dependencies for the modules requested. It can load the
 * files from the Yahoo! CDN, and it can utilize the combo service provided on
 * this network to reduce the number of http connections required to download
 * YUI files. You can also specify an external, custom combo service to host
 * your modules as well.

        var Y = YUI();
        var loader = new Y.Loader({
            filter: 'debug',
            base: '../../',
            root: 'build/',
            combine: true,
            require: ['node', 'dd', 'console']
        });
        var out = loader.resolve(true);

 * If the Loader needs to be patched before it is used for the first time, it
 * should be done through the `doBeforeLoader` hook. Simply make the patch
 * available via configuration before YUI is loaded:

        YUI_config = YUI_config || {};
        YUI_config.doBeforeLoader = function (config) {
            var resolve = this.context.Loader.prototype.resolve;
            this.context.Loader.prototype.resolve = function () {
                // do something here
                return resolve.apply(this, arguments);
            };
        };

 * @constructor
 * @class Loader
 * @param {Object} config an optional set of configuration options.
 * @param {String} config.base The base dir which to fetch this module from
 * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`
 * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`
 * @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a>
 * @param {Object} config.filters Per-component filter specification.  If specified for a given component, this overrides the filter config.
 * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies
 * @param {Boolean} [config.async=true] Fetch files in async
 * @param {Array} config.ignore: A list of modules that should never be dynamically loaded
 * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page
 * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes
 * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes
 * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes
 * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes.  If not set, there is no timeout
 * @param {Object} config.context Execution context for all callbacks
 * @param {Function} config.onSuccess Callback for the 'success' event
 * @param {Function} config.onFailure Callback for the 'failure' event
 * @param {Function} config.onTimeout Callback for the 'timeout' event
 * @param {Function} config.onProgress Callback executed each time a script or css file is loaded
 * @param {Object} config.modules A list of module definitions.  See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata
 * @param {Object} config.groups A list of group definitions.  Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`.
 * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use.  The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers.  These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox.
 * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use.  Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward.
 * @param {Function} config.doBeforeLoader An optional hook that allows for the patching of the loader instance. The `Y` instance is available as `this.context` and the only argument to the function is the Loader configuration object.
 */
Y.Loader = function(o) {

    var self = this;

    //Catch no config passed.
    o = o || {};

    modulekey = META.md5;

    /**
     * Internal callback to handle multiple internal insert() calls
     * so that css is inserted prior to js
     * @property _internalCallback
     * @private
     */
    // self._internalCallback = null;

    /**
     * Callback that will be executed when the loader is finished
     * with an insert
     * @method onSuccess
     * @type function
     */
    // self.onSuccess = null;

    /**
     * Callback that will be executed if there is a failure
     * @method onFailure
     * @type function
     */
    // self.onFailure = null;

    /**
     * Callback executed each time a script or css file is loaded
     * @method onProgress
     * @type function
     */
    // self.onProgress = null;

    /**
     * Callback that will be executed if a timeout occurs
     * @method onTimeout
     * @type function
     */
    // self.onTimeout = null;

    /**
     * The execution context for all callbacks
     * @property context
     * @default {YUI} the YUI instance
     */
    self.context = Y;

    // Hook that allows the patching of loader
    if (o.doBeforeLoader) {
        o.doBeforeLoader.apply(self, arguments);
    }

    /**
     * Data that is passed to all callbacks
     * @property data
     */
    // self.data = null;

    /**
     * Node reference or id where new nodes should be inserted before
     * @property insertBefore
     * @type string|HTMLElement
     */
    // self.insertBefore = null;

    /**
     * The charset attribute for inserted nodes
     * @property charset
     * @type string
     * @deprecated , use cssAttributes or jsAttributes.
     */
    // self.charset = null;

    /**
     * An object literal containing attributes to add to link nodes
     * @property cssAttributes
     * @type object
     */
    // self.cssAttributes = null;

    /**
     * An object literal containing attributes to add to script nodes
     * @property jsAttributes
     * @type object
     */
    // self.jsAttributes = null;

    /**
     * The base directory.
     * @property base
     * @type string
     * @default http://yui.yahooapis.com/[YUI VERSION]/build/
     */
    self.base = Y.Env.meta.base + Y.Env.meta.root;

    /**
     * Base path for the combo service
     * @property comboBase
     * @type string
     * @default http://yui.yahooapis.com/combo?
     */
    self.comboBase = Y.Env.meta.comboBase;

    /*
     * Base path for language packs.
     */
    // self.langBase = Y.Env.meta.langBase;
    // self.lang = "";

    /**
     * If configured, the loader will attempt to use the combo
     * service for YUI resources and configured external resources.
     * @property combine
     * @type boolean
     * @default true if a base dir isn't in the config
     */
    self.combine = o.base &&
        (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);

    /**
    * The default seperator to use between files in a combo URL
    * @property comboSep
    * @type {String}
    * @default Ampersand
    */
    self.comboSep = '&';
    /**
     * Max url length for combo urls.  The default is 1024. This is the URL
     * limit for the Yahoo! hosted combo servers.  If consuming
     * a different combo service that has a different URL limit
     * it is possible to override this default by supplying
     * the maxURLLength config option.  The config option will
     * only take effect if lower than the default.
     *
     * @property maxURLLength
     * @type int
     */
    self.maxURLLength = MAX_URL_LENGTH;

    /**
     * Ignore modules registered on the YUI global
     * @property ignoreRegistered
     * @default false
     */
    self.ignoreRegistered = o.ignoreRegistered;

    /**
     * Root path to prepend to module path for the combo
     * service
     * @property root
     * @type string
     * @default [YUI VERSION]/build/
     */
    self.root = Y.Env.meta.root;

    /**
     * Timeout value in milliseconds.  If set, self value will be used by
     * the get utility.  the timeout event will fire if
     * a timeout occurs.
     * @property timeout
     * @type int
     */
    self.timeout = 0;

    /**
     * A list of modules that should not be loaded, even if
     * they turn up in the dependency tree
     * @property ignore
     * @type string[]
     */
    // self.ignore = null;

    /**
     * A list of modules that should always be loaded, even
     * if they have already been inserted into the page.
     * @property force
     * @type string[]
     */
    // self.force = null;

    self.forceMap = {};

    /**
     * Should we allow rollups
     * @property allowRollup
     * @type boolean
     * @default false
     */
    self.allowRollup = false;

    /**
     * A filter to apply to result urls.  This filter will modify the default
     * path for all modules.  The default path for the YUI library is the
     * minified version of the files (e.g., event-min.js).  The filter property
     * can be a predefined filter or a custom filter.  The valid predefined
     * filters are:
     * <dl>
     *  <dt>DEBUG</dt>
     *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
     *      This option will automatically include the Logger widget</dd>
     *  <dt>RAW</dt>
     *  <dd>Selects the non-minified version of the library (e.g., event.js).
     *  </dd>
     * </dl>
     * You can also define a custom filter, which must be an object literal
     * containing a search expression and a replace string:
     *
     *      myFilter: {
     *          'searchExp': "-min\\.js",
     *          'replaceStr': "-debug.js"
     *      }
     *
     * @property filter
     * @type string| {searchExp: string, replaceStr: string}
     */
    // self.filter = null;

    /**
     * per-component filter specification.  If specified for a given
     * component, this overrides the filter config.
     * @property filters
     * @type object
     */
    self.filters = {};

    /**
     * The list of requested modules
     * @property required
     * @type {string: boolean}
     */
    self.required = {};

    /**
     * If a module name is predefined when requested, it is checked againsts
     * the patterns provided in this property.  If there is a match, the
     * module is added with the default configuration.
     *
     * At the moment only supporting module prefixes, but anticipate
     * supporting at least regular expressions.
     * @property patterns
     * @type Object
     */
    // self.patterns = Y.merge(Y.Env.meta.patterns);
    self.patterns = {};

    /**
     * Internal loader instance metadata. Use accessor `getModuleInfo()` instead.
     */
    self.moduleInfo = {};

    self.groups = Y.merge(Y.Env.meta.groups);

    /**
     * Provides the information used to skin the skinnable components.
     * The following skin definition would result in 'skin1' and 'skin2'
     * being loaded for calendar (if calendar was requested), and
     * 'sam' for all other skinnable components:
     *
     *      skin: {
     *          // The default skin, which is automatically applied if not
     *          // overriden by a component-specific skin definition.
     *          // Change this in to apply a different skin globally
     *          defaultSkin: 'sam',
     *
     *          // This is combined with the loader base property to get
     *          // the default root directory for a skin. ex:
     *          // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
     *          base: 'assets/skins/',
     *
     *          // Any component-specific overrides can be specified here,
     *          // making it possible to load different skins for different
     *          // components.  It is possible to load more than one skin
     *          // for a given component as well.
     *          overrides: {
     *              calendar: ['skin1', 'skin2']
     *          }
     *      }
     * @property skin
     * @type {Object}
     */
    self.skin = Y.merge(Y.Env.meta.skin);

    /*
     * Map of conditional modules
     * @since 3.2.0
     */
    self.conditions = {};

    // map of modules with a hash of modules that meet the requirement
    // self.provides = {};

    self.config = o;
    self._internal = true;

    self._populateConditionsCache();

    /**
     * Set when beginning to compute the dependency tree.
     * Composed of what YUI reports to be loaded combined
     * with what has been loaded by any instance on the page
     * with the version number specified in the metadata.
     * @property loaded
     * @type {string: boolean}
     */
    self.loaded = GLOBAL_LOADED[VERSION];


    /**
    * Should Loader fetch scripts in `async`, defaults to `true`
    * @property async
    */

    self.async = true;

    self._inspectPage();

    self._internal = false;

    self._config(o);

    self.forceMap = (self.force) ? Y.Array.hash(self.force) : {};

    self.testresults = null;

    if (Y.config.tests) {
        self.testresults = Y.config.tests;
    }

    /**
     * List of rollup files found in the library metadata
     * @property rollups
     */
    // self.rollups = null;

    /**
     * Whether or not to load optional dependencies for
     * the requested modules
     * @property loadOptional
     * @type boolean
     * @default false
     */
    // self.loadOptional = false;

    /**
     * All of the derived dependencies in sorted order, which
     * will be populated when either calculate() or insert()
     * is called
     * @property sorted
     * @type string[]
     */
    self.sorted = [];

    /*
     * A list of modules to attach to the YUI instance when complete.
     * If not supplied, the sorted list of dependencies are applied.
     * @property attaching
     */
    // self.attaching = null;

    /**
     * Flag to indicate the dependency tree needs to be recomputed
     * if insert is called again.
     * @property dirty
     * @type boolean
     * @default true
     */
    self.dirty = true;

    /**
     * List of modules inserted by the utility
     * @property inserted
     * @type {string: boolean}
     */
    self.inserted = {};

    /**
     * List of skipped modules during insert() because the module
     * was not defined
     * @property skipped
     */
    self.skipped = {};

    // Y.on('yui:load', self.loadNext, self);

    self.tested = {};

    /*
     * Cached sorted calculate results
     * @property results
     * @since 3.2.0
     */
    //self.results = {};

    if (self.ignoreRegistered) {
        //Clear inpage already processed modules.
        self._resetModules();
    }

};

Y.Loader.prototype = {
    /**
    * Gets the module info from the local moduleInfo hash, or from the
    * default metadata and populate the local moduleInfo hash.
    * @method getModuleInfo
    * @param {string} name of the module
    * @public
    */
    getModuleInfo: function(name) {

        var m = this.moduleInfo[name],
            rawMetaModules, globalRenderedMods, internal, v;

        if (m) {
            return m;
        }

        rawMetaModules = META.modules;
        globalRenderedMods = GLOBAL_ENV._renderedMods;
        internal = this._internal;

        /*
        The logic here is:

        - if the `moduleInfo[name]` is avilable,
          then short circuit
        - otherwise, if the module is in the globalCache (cross Y instance),
          then port it from the global registry into `moduleInfo[name]`
        - otherwise, if the module has raw metadata (from meta modules)
          then add it to the global registry and to `moduleInfo[name]`

        */
        if (globalRenderedMods && globalRenderedMods.hasOwnProperty(name) && !this.ignoreRegistered) {
            this.moduleInfo[name] = Y.merge(globalRenderedMods[name]);
        } else {
            if (rawMetaModules.hasOwnProperty(name)) {
                this._internal = true; // making sure that modules from raw data are marked as internal
                v = this.addModule(rawMetaModules[name], name);
                // Inspect the page for the CSS module and mark it as loaded.
                if (v && v.type === CSS) {
                    if (this.isCSSLoaded(v.name, true)) {
                        this.loaded[v.name] = true;
                    }
                }
                this._internal = internal;
            }
        }
        return this.moduleInfo[name];
    },
    /**
    * Expand the names that are aliases to other modules.
    * @method _expandAliases
    * @param {string[]} list a module name or a list of names to be expanded
    * @private
    * @return {array}
    */
    _expandAliases: function(list) {
        var expanded = [],
            aliases = YUI.Env.aliases,
            i, name;
        list = Y.Array(list);
        for (i = 0; i < list.length; i += 1) {
            name = list[i];
            expanded.push.apply(expanded, aliases[name] ? aliases[name] : [name]);
        }
        return expanded;
    },
    /**
    * Populate the conditions cache from raw modules, this is necessary
    * because no other module will require a conditional module, instead
    * the condition has to be executed and then the module is analyzed
    * to be included in the final requirement list. Without this cache
    * conditional modules will be simply ignored.
    * @method _populateConditionsCache
    * @private
    */
    _populateConditionsCache: function() {
        var rawMetaModules = META.modules,
            cache = GLOBAL_ENV._conditions,
            i, j, t, trigger;

        // if we have conditions in cache and cache is enabled
        // we should port them to this loader instance
        if (cache && !this.ignoreRegistered) {
            for (i in cache) {
                if (cache.hasOwnProperty(i)) {
                    this.conditions[i] = Y.merge(cache[i]);
                }
            }
        } else {
            for (i in rawMetaModules) {
                if (rawMetaModules.hasOwnProperty(i) && rawMetaModules[i].condition) {
                    t = this._expandAliases(rawMetaModules[i].condition.trigger);
                    for (j = 0; j < t.length; j += 1) {
                        trigger = t[j];
                        this.conditions[trigger] = this.conditions[trigger] || {};
                        this.conditions[trigger][rawMetaModules[i].name || i] = rawMetaModules[i].condition;
                    }
                }
            }
            GLOBAL_ENV._conditions = this.conditions;
        }
    },
    /**
    * Reset modules in the module cache to a pre-processed state so additional
    * computations with a different skin or language will work as expected.
    * @method _resetModules
    * @private
    */
    _resetModules: function() {
        var self = this, i, o,
            mod, name, details;
        for (i in self.moduleInfo) {
            if (self.moduleInfo.hasOwnProperty(i) && self.moduleInfo[i]) {
                mod = self.moduleInfo[i];
                name = mod.name;
                details  = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);

                if (details) {
                    self.moduleInfo[name]._reset = true;
                    self.moduleInfo[name].requires = details.requires || [];
                    self.moduleInfo[name].optional = details.optional || [];
                    self.moduleInfo[name].supersedes = details.supercedes || [];
                }

                if (mod.defaults) {
                    for (o in mod.defaults) {
                        if (mod.defaults.hasOwnProperty(o)) {
                            if (mod[o]) {
                                mod[o] = mod.defaults[o];
                            }
                        }
                    }
                }
                mod.langCache = undefined;
                mod.skinCache = undefined;
                if (mod.skinnable) {
                    self._addSkin(self.skin.defaultSkin, mod.name);
                }
            }
        }
    },
    /**
    Regex that matches a CSS URL. Used to guess the file type when it's not
    specified.

    @property REGEX_CSS
    @type RegExp
    @final
    @protected
    @since 3.5.0
    **/
    REGEX_CSS: /\.css(?:[?;].*)?$/i,

    /**
    * Default filters for raw and debug
    * @property FILTER_DEFS
    * @type Object
    * @final
    * @protected
    */
    FILTER_DEFS: {
        RAW: {
            'searchExp': '-min\\.js',
            'replaceStr': '.js'
        },
        DEBUG: {
            'searchExp': '-min\\.js',
            'replaceStr': '-debug.js'
        },
        COVERAGE: {
            'searchExp': '-min\\.js',
            'replaceStr': '-coverage.js'
        }
    },
    /*
    * Check the pages meta-data and cache the result.
    * @method _inspectPage
    * @private
    */
    _inspectPage: function() {
        var self = this, v, m, req, mr, i;

        for (i in ON_PAGE) {
            if (ON_PAGE.hasOwnProperty(i)) {
                v = ON_PAGE[i];
                if (v.details) {
                    m = self.getModuleInfo(v.name);
                    req = v.details.requires;
                    mr = m && m.requires;

                   if (m) {
                       if (!m._inspected && req && mr.length !== req.length) {
                           // console.log('deleting ' + m.name);
                           delete m.expanded;
                       }
                   } else {
                       m = self.addModule(v.details, i);
                   }
                   m._inspected = true;
               }
            }
        }
    },
    /*
    * returns true if b is not loaded, and is required directly or by means of modules it supersedes.
    * @private
    * @method _requires
    * @param {String} mod1 The first module to compare
    * @param {String} mod2 The second module to compare
    */
   _requires: function(mod1, mod2) {

        var i, rm, after_map, s,
            m = this.getModuleInfo(mod1),
            other = this.getModuleInfo(mod2);

        if (!m || !other) {
            return false;
        }

        rm = m.expanded_map;
        after_map = m.after_map;

        // check if this module should be sorted after the other
        // do this first to short circut circular deps
        if (after_map && (mod2 in after_map)) {
            return true;
        }

        after_map = other.after_map;

        // and vis-versa
        if (after_map && (mod1 in after_map)) {
            return false;
        }

        // check if this module requires one the other supersedes
        s = other.supersedes;
        if (s) {
            for (i = 0; i < s.length; i++) {
                if (this._requires(mod1, s[i])) {
                    return true;
                }
            }
        }

        s = m.supersedes;
        if (s) {
            for (i = 0; i < s.length; i++) {
                if (this._requires(mod2, s[i])) {
                    return false;
                }
            }
        }

        // check if this module requires the other directly
        // if (r && yArray.indexOf(r, mod2) > -1) {
        if (rm && (mod2 in rm)) {
            return true;
        }

        // external css files should be sorted below yui css
        if (m.ext && m.type === CSS && !other.ext && other.type === CSS) {
            return true;
        }

        return false;
    },
    /**
    * Apply a new config to the Loader instance
    * @method _config
    * @private
    * @param {Object} o The new configuration
    */
    _config: function(o) {
        var i, j, val, a, f, group, groupName, self = this,
            mods = [], mod, modInfo;
        // apply config values
        if (o) {
            for (i in o) {
                if (o.hasOwnProperty(i)) {
                    val = o[i];
                    //TODO This should be a case
                    if (i === 'require') {
                        self.require(val);
                    } else if (i === 'skin') {
                        //If the config.skin is a string, format to the expected object
                        if (typeof val === 'string') {
                            self.skin.defaultSkin = o.skin;
                            val = {
                                defaultSkin: val
                            };
                        }

                        Y.mix(self.skin, val, true);
                    } else if (i === 'groups') {
                        for (j in val) {
                            if (val.hasOwnProperty(j)) {
                                groupName = j;
                                group = val[j];
                                self.addGroup(group, groupName);
                                if (group.aliases) {
                                    for (a in group.aliases) {
                                        if (group.aliases.hasOwnProperty(a)) {
                                            self.addAlias(group.aliases[a], a);
                                        }
                                    }
                                }
                            }
                        }

                    } else if (i === 'modules') {
                        // add a hash of module definitions
                        for (j in val) {
                            if (val.hasOwnProperty(j)) {
                                self.addModule(val[j], j);
                            }
                        }
                    } else if (i === 'aliases') {
                        for (j in val) {
                            if (val.hasOwnProperty(j)) {
                                self.addAlias(val[j], j);
                            }
                        }
                    } else if (i === 'gallery') {
                        if (this.groups.gallery.update) {
                            this.groups.gallery.update(val, o);
                        }
                    } else if (i === 'yui2' || i === '2in3') {
                        if (this.groups.yui2.update) {
                            this.groups.yui2.update(o['2in3'], o.yui2, o);
                        }
                    } else {
                        self[i] = val;
                    }
                }
            }
        }

        // fix filter
        f = self.filter;

        if (L.isString(f)) {
            f = f.toUpperCase();
            self.filterName = f;
            self.filter = self.FILTER_DEFS[f];
            if (f === 'DEBUG') {
                self.require('yui-log', 'dump');
            }
        }

        if (self.filterName && self.coverage) {
            if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {
                for (i = 0; i < self.coverage.length; i++) {
                    mod = self.coverage[i];
                    modInfo = self.getModuleInfo(mod);
                    if (modInfo && modInfo.use) {
                        mods = mods.concat(modInfo.use);
                    } else {
                        mods.push(mod);
                    }
                }
                self.filters = self.filters || {};
                Y.Array.each(mods, function(mod) {
                    self.filters[mod] = self.FILTER_DEFS.COVERAGE;
                });
                self.filterName = 'RAW';
                self.filter = self.FILTER_DEFS[self.filterName];
            }
        }

    },

    /**
     * Returns the skin module name for the specified skin name.  If a
     * module name is supplied, the returned skin module name is
     * specific to the module passed in.
     * @method formatSkin
     * @param {string} skin the name of the skin.
     * @param {string} mod optional: the name of a module to skin.
     * @return {string} the full skin module name.
     */
    formatSkin: function(skin, mod) {
        var s = SKIN_PREFIX + skin;
        if (mod) {
            s = s + '-' + mod;
        }

        return s;
    },

    /**
     * Adds the skin def to the module info
     * @method _addSkin
     * @param {string} skin the name of the skin.
     * @param {string} mod the name of the module.
     * @param {string} parent parent module if this is a skin of a
     * submodule or plugin.
     * @return {string} the module name for the skin.
     * @private
     */
    _addSkin: function(skin, mod, parent) {
        var pkg, name, nmod,
            sinf = this.skin,
            mdef = mod && this.getModuleInfo(mod),
            ext = mdef && mdef.ext;

        // Add a module definition for the module-specific skin css
        if (mod) {
            name = this.formatSkin(skin, mod);
            if (!this.getModuleInfo(name)) {
                pkg = mdef.pkg || mod;
                nmod = {
                    skin: true,
                    name: name,
                    group: mdef.group,
                    type: 'css',
                    after: sinf.after,
                    path: (parent || pkg) + '/' + sinf.base + skin +
                          '/' + mod + '.css',
                    ext: ext
                };
                if (mdef.base) {
                    nmod.base = mdef.base;
                }
                if (mdef.configFn) {
                    nmod.configFn = mdef.configFn;
                }
                this.addModule(nmod, name);

            }
        }

        return name;
    },
    /**
    * Adds an alias module to the system
    * @method addAlias
    * @param {Array} use An array of modules that makes up this alias
    * @param {String} name The name of the alias
    * @example
    *       var loader = new Y.Loader({});
    *       loader.addAlias([ 'node', 'yql' ], 'davglass');
    *       loader.require(['davglass']);
    *       var out = loader.resolve(true);
    *
    *       //out.js will contain Node and YQL modules
    */
    addAlias: function(use, name) {
        YUI.Env.aliases[name] = use;
        this.addModule({
            name: name,
            use: use
        });
    },
    /**
     * Add a new module group
     * @method addGroup
     * @param {Object} config An object containing the group configuration data
     * @param {String} config.name required, the group name
     * @param {String} config.base The base directory for this module group
     * @param {String} config.root The root path to add to each combo resource path
     * @param {Boolean} config.combine Should the request be combined
     * @param {String} config.comboBase Combo service base path
     * @param {Object} config.modules The group of modules
     * @param {String} name the group name.
     * @example
     *      var loader = new Y.Loader({});
     *      loader.addGroup({
     *          name: 'davglass',
     *          combine: true,
     *          comboBase: '/combo?',
     *          root: '',
     *          modules: {
     *              //Module List here
     *          }
     *      }, 'davglass');
     */
    addGroup: function(o, name) {
        var mods = o.modules,
            self = this,
            defaultBase = o.defaultBase || Y.config.defaultBase,
            i, v;

        name = name || o.name;
        o.name = name;
        self.groups[name] = o;

        if (!o.base && defaultBase && o.root) {
            o.base = defaultBase + o.root;
        }

        if (o.patterns) {
            for (i in o.patterns) {
                if (o.patterns.hasOwnProperty(i)) {
                    o.patterns[i].group = name;
                    self.patterns[i] = o.patterns[i];
                }
            }
        }

        if (mods) {
            for (i in mods) {
                if (mods.hasOwnProperty(i)) {
                    v = mods[i];
                    if (typeof v === 'string') {
                        v = { name: i, fullpath: v };
                    }
                    v.group = name;
                    self.addModule(v, i);
                }
            }
        }
    },

    /**
     * Add a new module to the component metadata.
     * @method addModule
     * @param {Object} config An object containing the module data.
     * @param {String} config.name Required, the component name
     * @param {String} config.type Required, the component type (js or css)
     * @param {String} config.path Required, the path to the script from `base`
     * @param {Array} config.requires Array of modules required by this component
     * @param {Array} [config.optional] Array of optional modules for this component
     * @param {Array} [config.supersedes] Array of the modules this component replaces
     * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one
     * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array
     * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup
     * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`
     * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in
     * @param {Object} [config.submodules] Hash of submodules
     * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration.
     * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]`
     * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to four fields:
     * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load
     * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded.
     * @param {String} [config.condition.ua] The UA name of <a href="UA.html">Y.UA</a> object that returns true when the module is to be loaded. e.g., `"ie"`, `"nodejs"`.
     * @param {String} [config.condition.when] Specifies the load order of the conditional module
     *  with regard to the position of the trigger module.
     *  This should be one of three values: `before`, `after`, or `instead`.  The default is `after`.
     * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`
     * @param {Function} [config.configFn] A function to exectute when configuring this module
     * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config.
     * @param {String[]} [config.optionalRequires] List of dependencies that
        may optionally be loaded by this loader. This is targeted mostly at
        polyfills, since they should not be in the list of requires because
        polyfills are assumed to be available in the global scope.
     * @param {Function} [config.test] Test to be called when this module is
        added as an optional dependency of another module. If the test function
        returns `false`, the module will be ignored and will not be attached to
        this YUI instance.
     * @param {String} [name] The module name, required if not in the module data.
     * @return {Object} the module definition or null if the object passed in did not provide all required attributes.
     */
    addModule: function(o, name) {
        name = name || o.name;

        if (typeof o === 'string') {
            o = { name: name, fullpath: o };
        }


        var subs, i, l, t, sup, s, smod, plugins, plug,
            j, langs, packName, supName, flatSup, flatLang, lang, ret,
            overrides, skinname, when, g, p,
            modInfo = this.moduleInfo[name],
            conditions = this.conditions, trigger;

        //Only merge this data if the temp flag is set
        //from an earlier pass from a pattern or else
        //an override module (YUI_config) can not be used to
        //replace a default module.
        if (modInfo && modInfo.temp) {
            //This catches temp modules loaded via a pattern
            // The module will be added twice, once from the pattern and
            // Once from the actual add call, this ensures that properties
            // that were added to the module the first time around (group: gallery)
            // are also added the second time around too.
            o = Y.merge(modInfo, o);
        }

        o.name = name;

        if (!o || !o.name) {
            return null;
        }

        if (!o.type) {
            //Always assume it's javascript unless the CSS pattern is matched.
            o.type = JS;
            p = o.path || o.fullpath;
            if (p && this.REGEX_CSS.test(p)) {
                o.type = CSS;
            }
        }

        if (!o.path && !o.fullpath) {
            o.path = _path(name, name, o.type);
        }
        o.supersedes = o.supersedes || o.use;

        o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;

        // Handle submodule logic
        subs = o.submodules;

        this.moduleInfo[name] = o;

        o.requires = o.requires || [];

        /*
        Only allowing the cascade of requires information, since
        optional and supersedes are far more fine grained than
        a blanket requires is.
        */
        if (this.requires) {
            for (i = 0; i < this.requires.length; i++) {
                o.requires.push(this.requires[i]);
            }
        }
        if (o.group && this.groups && this.groups[o.group]) {
            g = this.groups[o.group];
            if (g.requires) {
                for (i = 0; i < g.requires.length; i++) {
                    o.requires.push(g.requires[i]);
                }
            }
        }


        if (!o.defaults) {
            o.defaults = {
                requires: o.requires ? [].concat(o.requires) : null,
                supersedes: o.supersedes ? [].concat(o.supersedes) : null,
                optional: o.optional ? [].concat(o.optional) : null
            };
        }

        if (o.skinnable && o.ext && o.temp) {
            skinname = this._addSkin(this.skin.defaultSkin, name);
            o.requires.unshift(skinname);
        }

        if (o.requires.length) {
            o.requires = this.filterRequires(o.requires) || [];
        }

        if (!o.langPack && o.lang) {
            // Setup root package by default as a fallback
            // for languages that are not defined
            packName = this.getLangPackName(ROOT_LANG, name);
            smod = this.getModuleInfo(packName);

            if (!smod) {
                this._addLangPack(null, o, packName);
            }

            langs = yArray(o.lang);

            for (j = 0; j < langs.length; j++) {
                lang = langs[j];
                packName = this.getLangPackName(lang, name);
                smod = this.getModuleInfo(packName);
                if (!smod) {
                    smod = this._addLangPack(lang, o, packName);
                }
            }
        }


        if (subs) {
            sup = o.supersedes || [];
            l = 0;

            for (i in subs) {
                if (subs.hasOwnProperty(i)) {
                    s = subs[i];

                    s.path = s.path || _path(name, i, o.type);
                    s.pkg = name;
                    s.group = o.group;

                    if (s.supersedes) {
                        sup = sup.concat(s.supersedes);
                    }

                    smod = this.addModule(s, i);
                    sup.push(i);

                    if (smod.skinnable) {
                        o.skinnable = true;
                        overrides = this.skin.overrides;
                        if (overrides && overrides[i]) {
                            for (j = 0; j < overrides[i].length; j++) {
                                skinname = this._addSkin(overrides[i][j],
                                         i, name);
                                sup.push(skinname);
                            }
                        }
                        skinname = this._addSkin(this.skin.defaultSkin,
                                        i, name);
                        sup.push(skinname);
                    }

                    // looks like we are expected to work out the metadata
                    // for the parent module language packs from what is
                    // specified in the child modules.
                    if (s.lang && s.lang.length) {
                        // Setup root package by default as a fallback
                        // for languages that are not defined
                        packName = this.getLangPackName(ROOT_LANG, name);
                        smod = this.getModuleInfo(packName);

                        if (!smod) {
                            this._addLangPack(null, o, packName);
                        }

                        langs = yArray(s.lang);

                        for (j = 0; j < langs.length; j++) {
                            lang = langs[j];
                            packName = this.getLangPackName(lang, name);
                            supName = this.getLangPackName(lang, i);
                            smod = this.getModuleInfo(packName);

                            if (!smod) {
                                smod = this._addLangPack(lang, o, packName);
                            }

                            flatSup = flatSup || yArray.hash(smod.supersedes);

                            if (!(supName in flatSup)) {
                                smod.supersedes.push(supName);
                            }

                            o.lang = o.lang || [];

                            flatLang = flatLang || yArray.hash(o.lang);

                            if (!(lang in flatLang)) {
                                o.lang.push(lang);
                            }

// Add rollup file, need to add to supersedes list too

                            // default packages
                            packName = this.getLangPackName(ROOT_LANG, name);
                            supName = this.getLangPackName(ROOT_LANG, i);

                            smod = this.getModuleInfo(packName);

                            if (!smod) {
                                smod = this._addLangPack(lang, o, packName);
                            }

                            if (!(supName in flatSup)) {
                                smod.supersedes.push(supName);
                            }

// Add rollup file, need to add to supersedes list too

                        }
                    }

                    l++;
                }
            }
            //o.supersedes = YObject.keys(yArray.hash(sup));
            o.supersedes = yArray.dedupe(sup);
            if (this.allowRollup) {
                o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
            }
        }

        plugins = o.plugins;
        if (plugins) {
            for (i in plugins) {
                if (plugins.hasOwnProperty(i)) {
                    plug = plugins[i];
                    plug.pkg = name;
                    plug.path = plug.path || _path(name, i, o.type);
                    plug.requires = plug.requires || [];
                    plug.group = o.group;
                    this.addModule(plug, i);
                    if (o.skinnable) {
                        this._addSkin(this.skin.defaultSkin, i, name);
                    }

                }
            }
        }

        if (o.condition) {
            t = this._expandAliases(o.condition.trigger);
            for (i = 0; i < t.length; i++) {
                trigger = t[i];
                when = o.condition.when;
                conditions[trigger] = conditions[trigger] || {};
                conditions[trigger][name] = o.condition;
                // the 'when' attribute can be 'before', 'after', or 'instead'
                // the default is after.
                if (when && when !== 'after') {
                    if (when === 'instead') { // replace the trigger
                        o.supersedes = o.supersedes || [];
                        o.supersedes.push(trigger);
                    }
                    // before the trigger
                        // the trigger requires the conditional mod,
                        // so it should appear before the conditional
                        // mod if we do not intersede.
                } else { // after the trigger
                    o.after = o.after || [];
                    o.after.push(trigger);
                }
            }
        }

        if (o.supersedes) {
            o.supersedes = this.filterRequires(o.supersedes);
        }

        if (o.after) {
            o.after = this.filterRequires(o.after);
            o.after_map = yArray.hash(o.after);
        }

        // this.dirty = true;

        if (o.configFn) {
            ret = o.configFn(o);
            if (ret === false) {
                delete this.moduleInfo[name];
                delete GLOBAL_ENV._renderedMods[name];
                o = null;
            }
        }
        //Add to global cache
        if (o) {
            if (!GLOBAL_ENV._renderedMods) {
                GLOBAL_ENV._renderedMods = {};
            }
            GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);
            GLOBAL_ENV._conditions = conditions;
        }

        return o;
    },

    /**
     * Add a requirement for one or more module
     * @method require
     * @param {string[] | string*} what the modules to load.
     */
    require: function(what) {
        var a = (typeof what === 'string') ? yArray(arguments) : what;
        this.dirty = true;
        this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a)));

        this._explodeRollups();
    },
    /**
    * Grab all the items that were asked for, check to see if the Loader
    * meta-data contains a "use" array. If it doesm remove the asked item and replace it with
    * the content of the "use".
    * This will make asking for: "dd"
    * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
    * @private
    * @method _explodeRollups
    */
    _explodeRollups: function() {
        var self = this, m, m2, i, a, v, len, len2,
        r = self.required;

        if (!self.allowRollup) {
            for (i in r) {
                if (r.hasOwnProperty(i)) {
                    m = self.getModule(i);
                    if (m && m.use) {
                        len = m.use.length;
                        for (a = 0; a < len; a++) {
                            m2 = self.getModule(m.use[a]);
                            if (m2 && m2.use) {
                                len2 = m2.use.length;
                                for (v = 0; v < len2; v++) {
                                    r[m2.use[v]] = true;
                                }
                            } else {
                                r[m.use[a]] = true;
                            }
                        }
                    }
                }
            }
            self.required = r;
        }

    },
    /**
    * Explodes the required array to remove aliases and replace them with real modules
    * @method filterRequires
    * @param {Array} r The original requires array
    * @return {Array} The new array of exploded requirements
    */
    filterRequires: function(r) {
        if (r) {
            if (!Y.Lang.isArray(r)) {
                r = [r];
            }
            r = Y.Array(r);
            var c = [], i, mod, o, m;

            for (i = 0; i < r.length; i++) {
                mod = this.getModule(r[i]);
                if (mod && mod.use) {
                    for (o = 0; o < mod.use.length; o++) {
                        //Must walk the other modules in case a module is a rollup of rollups (datatype)
                        m = this.getModule(mod.use[o]);
                        if (m && m.use && (m.name !== mod.name)) {
                            c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
                        } else {
                            c.push(mod.use[o]);
                        }
                    }
                } else {
                    c.push(r[i]);
                }
            }
            r = c;
        }
        return r;
    },

    /**
    Returns `true` if the module can be attached to the YUI instance. Runs
    the module's test if there is one and caches its result.

    @method _canBeAttached
    @param {String} module Name of the module to check.
    @return {Boolean} Result of the module's test if it has one, or `true`.
    **/
    _canBeAttached: function (m) {
        m = this.getModule(m);
        if (m && m.test) {
            if (!m.hasOwnProperty('_testResult')) {
                m._testResult = m.test(Y);
            }
            return m._testResult;
        }
        // return `true` for modules not registered as Loader will know what
        // to do with them later on
        return true;
    },

    /**
     * Returns an object containing properties for all modules required
     * in order to load the requested module
     * @method getRequires
     * @param {object}  mod The module definition from moduleInfo.
     * @return {array} the expanded requirement list.
     */
    getRequires: function(mod) {

        if (!mod) {
            //console.log('returning no reqs for ' + mod.name);
            return NO_REQUIREMENTS;
        }

        if (mod._parsed) {
            //console.log('returning requires for ' + mod.name, mod.requires);
            return mod.expanded || NO_REQUIREMENTS;
        }

        //TODO add modue cache here out of scope..

        var i, m, j, length, add, packName, lang, testresults = this.testresults,
            name = mod.name, cond,
            adddef = ON_PAGE[name] && ON_PAGE[name].details,
            optReqs = mod.optionalRequires,
            d, go, def,
            r, old_mod,
            o, skinmod, skindef, skinpar, skinname,
            intl = mod.lang || mod.intl,
            ftests = Y.Features && Y.Features.tests.load,
            hash, reparse;

        // console.log(name);

        // pattern match leaves module stub that needs to be filled out
        if (mod.temp && adddef) {
            old_mod = mod;
            mod = this.addModule(adddef, name);
            mod.group = old_mod.group;
            mod.pkg = old_mod.pkg;
            delete mod.expanded;
        }

        // console.log('cache: ' + mod.langCache + ' == ' + this.lang);

        //If a skin or a lang is different, reparse..
        reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));

        if (mod.expanded && !reparse) {
            return mod.expanded;
        }

        // Optional dependencies are dependencies that may or may not be
        // available.
        // This feature was designed specifically to be used when transpiling
        // ES6 modules, in order to use polyfills and regular scripts that define
        // global variables without having to import them since they should be
        // available in the global scope.
        if (optReqs) {
            for (i = 0, length = optReqs.length; i < length; i++) {
                if (this._canBeAttached(optReqs[i])) {
                    mod.requires.push(optReqs[i]);
                }
            }
        }

        d = [];
        hash = {};
        r = this.filterRequires(mod.requires);
        if (mod.lang) {
            //If a module has a lang attribute, auto add the intl requirement.
            d.unshift('intl');
            r.unshift('intl');
            intl = true;
        }
        o = this.filterRequires(mod.optional);


        mod._parsed = true;
        mod.langCache = this.lang;
        mod.skinCache = this.skin.defaultSkin;

        for (i = 0; i < r.length; i++) {
            if (!hash[r[i]]) {
                d.push(r[i]);
                hash[r[i]] = true;
                m = this.getModule(r[i]);
                if (m) {
                    add = this.getRequires(m);
                    intl = intl || (m.expanded_map &&
                        (INTL in m.expanded_map));
                    for (j = 0; j < add.length; j++) {
                        d.push(add[j]);
                    }
                }
            }
        }

        // get the requirements from superseded modules, if any
        r = this.filterRequires(mod.supersedes);
        if (r) {
            for (i = 0; i < r.length; i++) {
                if (!hash[r[i]]) {
                    // if this module has submodules, the requirements list is
                    // expanded to include the submodules.  This is so we can
                    // prevent dups when a submodule is already loaded and the
                    // parent is requested.
                    if (mod.submodules) {
                        d.push(r[i]);
                    }

                    hash[r[i]] = true;
                    m = this.getModule(r[i]);

                    if (m) {
                        add = this.getRequires(m);
                        intl = intl || (m.expanded_map &&
                            (INTL in m.expanded_map));
                        for (j = 0; j < add.length; j++) {
                            d.push(add[j]);
                        }
                    }
                }
            }
        }

        if (o && this.loadOptional) {
            for (i = 0; i < o.length; i++) {
                if (!hash[o[i]]) {
                    d.push(o[i]);
                    hash[o[i]] = true;
                    m = this.getModuleInfo(o[i]);
                    if (m) {
                        add = this.getRequires(m);
                        intl = intl || (m.expanded_map &&
                            (INTL in m.expanded_map));
                        for (j = 0; j < add.length; j++) {
                            d.push(add[j]);
                        }
                    }
                }
            }
        }

        cond = this.conditions[name];

        if (cond) {
            //Set the module to not parsed since we have conditionals and this could change the dependency tree.
            mod._parsed = false;
            if (testresults && ftests) {
                oeach(testresults, function(result, id) {
                    var condmod = ftests[id].name;
                    if (!hash[condmod] && ftests[id].trigger === name) {
                        if (result && ftests[id]) {
                            hash[condmod] = true;
                            d.push(condmod);
                        }
                    }
                });
            } else {
                for (i in cond) {
                    if (cond.hasOwnProperty(i)) {
                        if (!hash[i]) {
                            def = cond[i];
                            //first see if they've specfied a ua check
                            //then see if they've got a test fn & if it returns true
                            //otherwise just having a condition block is enough
                            go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
                                        (def.test && def.test(Y, r)));

                            if (go) {
                                hash[i] = true;
                                d.push(i);
                                m = this.getModule(i);
                                if (m) {
                                    add = this.getRequires(m);
                                    for (j = 0; j < add.length; j++) {
                                        d.push(add[j]);
                                    }

                                }
                            }
                        }
                    }
                }
            }
        }

        // Create skin modules
        if (mod.skinnable) {
            skindef = this.skin.overrides;
            for (i in YUI.Env.aliases) {
                if (YUI.Env.aliases.hasOwnProperty(i)) {
                    if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {
                        skinpar = i;
                    }
                }
            }
            if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
                skinname = name;
                if (skindef[skinpar]) {
                    skinname = skinpar;
                }
                for (i = 0; i < skindef[skinname].length; i++) {
                    skinmod = this._addSkin(skindef[skinname][i], name);
                    if (!this.isCSSLoaded(skinmod, this._boot)) {
                        d.push(skinmod);
                    }
                }
            } else {
                skinmod = this._addSkin(this.skin.defaultSkin, name);
                if (!this.isCSSLoaded(skinmod, this._boot)) {
                    d.push(skinmod);
                }
            }
        }

        mod._parsed = false;

        if (intl) {

            if (mod.lang && !mod.langPack && Y.Intl) {
                lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
                packName = this.getLangPackName(lang, name);
                if (packName) {
                    d.unshift(packName);
                }
            }
            d.unshift(INTL);
        }

        mod.expanded_map = yArray.hash(d);

        mod.expanded = YObject.keys(mod.expanded_map);

        return mod.expanded;
    },
    /**
    * Check to see if named css module is already loaded on the page
    * @method isCSSLoaded
    * @param {String} name The name of the css file
    * @param {Boolean} skip To skip the short-circuit for ignoreRegister
    * @return Boolean
    */
    isCSSLoaded: function(name, skip) {
        //TODO - Make this call a batching call with name being an array
        if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {
            return false;
        }
        var el = YUI.Env.cssStampEl,
            ret = false,
            mod = YUI.Env._cssLoaded[name],
            style = el.currentStyle; //IE


        if (mod !== undefined) {
            return mod;
        }

        //Add the classname to the element
        el.className = name;

        if (!style) {
            style = Y.config.doc.defaultView.getComputedStyle(el, null);
        }

        if (style && style.display === 'none') {
            ret = true;
        }


        el.className = ''; //Reset the classname to ''

        YUI.Env._cssLoaded[name] = ret;

        return ret;
    },

    /**
     * Returns a hash of module names the supplied module satisfies.
     * @method getProvides
     * @param {string} name The name of the module.
     * @return {object} what this module provides.
     */
    getProvides: function(name) {
        var m = this.getModule(name), o, s;
            // supmap = this.provides;

        if (!m) {
            return NOT_FOUND;
        }

        if (m && !m.provides) {
            o = {};
            s = m.supersedes;

            if (s) {
                yArray.each(s, function(v) {
                    Y.mix(o, this.getProvides(v));
                }, this);
            }

            o[name] = true;
            m.provides = o;

        }

        return m.provides;
    },

    /**
     * Calculates the dependency tree, the result is stored in the sorted
     * property.
     * @method calculate
     * @param {object} o optional options object.
     * @param {string} type optional argument to prune modules.
     */
    calculate: function(o, type) {
        if (o || type || this.dirty) {

            if (o) {
                this._config(o);
            }

            if (!this._init) {
                this._setup();
            }

            this._explode();

            if (this.allowRollup) {
                this._rollup();
            } else {
                this._explodeRollups();
            }
            this._reduce();
            this._sort();
        }
    },
    /**
    * Creates a "psuedo" package for languages provided in the lang array
    * @method _addLangPack
    * @private
    * @param {String} lang The language to create
    * @param {Object} m The module definition to create the language pack around
    * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
    * @return {Object} The module definition
    */
    _addLangPack: function(lang, m, packName) {
        var name = m.name,
            packPath, conf,
            existing = this.getModuleInfo(packName);

        if (!existing) {

            packPath = _path((m.pkg || name), packName, JS, true);

            conf = {
                path: packPath,
                intl: true,
                langPack: true,
                ext: m.ext,
                group: m.group,
                supersedes: []
            };
            if (m.root) {
                conf.root = m.root;
            }
            if (m.base) {
                conf.base = m.base;
            }

            if (m.configFn) {
                conf.configFn = m.configFn;
            }

            this.addModule(conf, packName);

            if (lang) {
                Y.Env.lang = Y.Env.lang || {};
                Y.Env.lang[lang] = Y.Env.lang[lang] || {};
                Y.Env.lang[lang][name] = true;
            }
        }

        return this.getModuleInfo(packName);
    },

    /**
     * Investigates the current YUI configuration on the page.  By default,
     * modules already detected will not be loaded again unless a force
     * option is encountered.  Called by calculate()
     * @method _setup
     * @private
     */
    _setup: function() {
        var info = this.moduleInfo, name, i, j, m, l,
            packName;

        for (name in info) {
            if (info.hasOwnProperty(name)) {
                m = info[name];
                if (m) {

                    // remove dups
                    //m.requires = YObject.keys(yArray.hash(m.requires));
                    m.requires = yArray.dedupe(m.requires);

                    // Create lang pack modules
                    //if (m.lang && m.lang.length) {
                    if (m.lang) {
                        // Setup root package if the module has lang defined,
                        // it needs to provide a root language pack
                        packName = this.getLangPackName(ROOT_LANG, name);
                        this._addLangPack(null, m, packName);
                    }

                }
            }
        }


        //l = Y.merge(this.inserted);
        l = {};

        // available modules
        if (!this.ignoreRegistered) {
            Y.mix(l, GLOBAL_ENV.mods);
        }

        // add the ignore list to the list of loaded packages
        if (this.ignore) {
            Y.mix(l, yArray.hash(this.ignore));
        }

        // expand the list to include superseded modules
        for (j in l) {
            if (l.hasOwnProperty(j)) {
                Y.mix(l, this.getProvides(j));
            }
        }

        // remove modules on the force list from the loaded list
        if (this.force) {
            for (i = 0; i < this.force.length; i++) {
                if (this.force[i] in l) {
                    delete l[this.force[i]];
                }
            }
        }

        Y.mix(this.loaded, l);

        this._init = true;
    },

    /**
     * Builds a module name for a language pack
     * @method getLangPackName
     * @param {string} lang the language code.
     * @param {string} mname the module to build it for.
     * @return {string} the language pack module name.
     */
    getLangPackName: function(lang, mname) {
        return ('lang/' + mname + ((lang) ? '_' + lang : ''));
    },
    /**
     * Inspects the required modules list looking for additional
     * dependencies.  Expands the required list to include all
     * required modules.  Called by calculate()
     * @method _explode
     * @private
     */
    _explode: function() {
        //TODO Move done out of scope
        var r = this.required, m, reqs, done = {},
            self = this, name, expound;

        // the setup phase is over, all modules have been created
        self.dirty = false;

        self._explodeRollups();
        r = self.required;

        for (name in r) {
            if (r.hasOwnProperty(name)) {
                if (!done[name]) {
                    done[name] = true;
                    m = self.getModule(name);
                    if (m) {
                        expound = m.expound;

                        if (expound) {
                            r[expound] = self.getModule(expound);
                            reqs = self.getRequires(r[expound]);
                            Y.mix(r, yArray.hash(reqs));
                        }

                        reqs = self.getRequires(m);
                        Y.mix(r, yArray.hash(reqs));
                    }
                }
            }
        }

    },
    /**
    * The default method used to test a module against a pattern
    * @method _patternTest
    * @private
    * @param {String} mname The module being tested
    * @param {String} pname The pattern to match
    */
    _patternTest: function(mname, pname) {
        return (mname.indexOf(pname) > -1);
    },
    /**
    * Get's the loader meta data for the requested module
    * @method getModule
    * @param {String} mname The module name to get
    * @return {Object} The module metadata
    */
    getModule: function(mname) {
        //TODO: Remove name check - it's a quick hack to fix pattern WIP
        if (!mname) {
            return null;
        }

        var p, found, pname,
            m = this.getModuleInfo(mname),
            patterns = this.patterns;

        // check the patterns library to see if we should automatically add
        // the module with defaults
        if (!m || (m && m.ext)) {
            for (pname in patterns) {
                if (patterns.hasOwnProperty(pname)) {
                    p = patterns[pname];

                    //There is no test method, create a default one that tests
                    // the pattern against the mod name
                    if (!p.test) {
                        p.test = this._patternTest;
                    }

                    if (p.test(mname, pname)) {
                        // use the metadata supplied for the pattern
                        // as the module definition.
                        found = p;
                        break;
                    }
                }
            }
        }

        if (!m) {
            if (found) {
                if (p.action) {
                    p.action.call(this, mname, pname);
                } else {
                    // ext true or false?
                    m = this.addModule(Y.merge(found, {
                        test: void 0,
                        temp: true
                    }), mname);
                    if (m && found.configFn) {
                        m.configFn = found.configFn;
                    }
                }
            }
        } else {
            if (found && m && found.configFn && !m.configFn) {
                m.configFn = found.configFn;
                m.configFn(m);
            }
        }

        return m;
    },

    // impl in rollup submodule
    _rollup: function() { },

    /**
     * Remove superceded modules and loaded modules.  Called by
     * calculate() after we have the mega list of all dependencies
     * @method _reduce
     * @return {object} the reduced dependency hash.
     * @private
     */
    _reduce: function(r) {

        r = r || this.required;

        var i, j, s, m, type = this.loadType,
        ignore = this.ignore ? yArray.hash(this.ignore) : false;

        for (i in r) {
            if (r.hasOwnProperty(i)) {
                m = this.getModule(i);
                // remove if already loaded
                if (((this.loaded[i] || ON_PAGE[i]) &&
                        !this.forceMap[i] && !this.ignoreRegistered) ||
                        (type && m && m.type !== type)) {
                    delete r[i];
                }
                if (ignore && ignore[i]) {
                    delete r[i];
                }
                // remove anything this module supersedes
                s = m && m.supersedes;
                if (s) {
                    for (j = 0; j < s.length; j++) {
                        if (s[j] in r) {
                            delete r[s[j]];
                        }
                    }
                }
            }
        }

        return r;
    },
    /**
    * Handles the queue when a module has been loaded for all cases
    * @method _finish
    * @private
    * @param {String} msg The message from Loader
    * @param {Boolean} success A boolean denoting success or failure
    */
    _finish: function(msg, success) {

        _queue.running = false;

        var onEnd = this.onEnd;
        if (onEnd) {
            onEnd.call(this.context, {
                msg: msg,
                data: this.data,
                success: success
            });
        }
        this._continue();
    },
    /**
    * The default Loader onSuccess handler, calls this.onSuccess with a payload
    * @method _onSuccess
    * @private
    */
    _onSuccess: function() {
        var self = this, skipped = Y.merge(self.skipped), fn,
            failed = [], rreg = self.requireRegistration,
            success, msg, i, mod;

        for (i in skipped) {
            if (skipped.hasOwnProperty(i)) {
                delete self.inserted[i];
            }
        }

        self.skipped = {};

        for (i in self.inserted) {
            if (self.inserted.hasOwnProperty(i)) {
                mod = self.getModule(i);
                if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) {
                    failed.push(i);
                } else {
                    Y.mix(self.loaded, self.getProvides(i));
                }
            }
        }

        fn = self.onSuccess;
        msg = (failed.length) ? 'notregistered' : 'success';
        success = !(failed.length);
        if (fn) {
            fn.call(self.context, {
                msg: msg,
                data: self.data,
                success: success,
                failed: failed,
                skipped: skipped
            });
        }
        self._finish(msg, success);
    },
    /**
    * The default Loader onProgress handler, calls this.onProgress with a payload
    * @method _onProgress
    * @private
    */
    _onProgress: function(e) {
        var self = this, i;
        //set the internal cache to what just came in.
        if (e.data && e.data.length) {
            for (i = 0; i < e.data.length; i++) {
                e.data[i] = self.getModule(e.data[i].name);
            }
        }
        if (self.onProgress) {
            self.onProgress.call(self.context, {
                name: e.url,
                data: e.data
            });
        }
    },
    /**
    * The default Loader onFailure handler, calls this.onFailure with a payload
    * @method _onFailure
    * @private
    */
    _onFailure: function(o) {
        var f = this.onFailure, msg = [], i = 0, len = o.errors.length;

        for (i; i < len; i++) {
            msg.push(o.errors[i].error);
        }

        msg = msg.join(',');


        if (f) {
            f.call(this.context, {
                msg: msg,
                data: this.data,
                success: false
            });
        }

        this._finish(msg, false);

    },

    /**
    * The default Loader onTimeout handler, calls this.onTimeout with a payload
    * @method _onTimeout
    * @param {Get.Transaction} transaction The Transaction object from `Y.Get`
    * @private
    */
    _onTimeout: function(transaction) {
        var f = this.onTimeout;
        if (f) {
            f.call(this.context, {
                msg: 'timeout',
                data: this.data,
                success: false,
                transaction: transaction
            });
        }
    },

    /**
     * Sorts the dependency tree.  The last step of calculate()
     * @method _sort
     * @private
     */
    _sort: function() {
        var name,

            // Object containing module names.
            required = this.required,

            // Keep track of whether we've visited a module.
            visited = {};

        // Will contain modules names, in the correct order,
        // according to dependencies.
        this.sorted = [];

        for (name in required) {
            if (!visited[name] && required.hasOwnProperty(name)) {
                this._visit(name, visited);
            }
        }
    },

    /**
     * Recursively visits the dependencies of the module name
     * passed in, and appends each module name to the `sorted` property.
     * @param {String} name The name of a module.
     * @param {Object} visited Keeps track of whether a module was visited.
     * @method _visit
     * @private
     */
    _visit: function (name, visited) {
        var required, condition, moduleInfo, dependency, dependencies,
            trigger, isAfter, i, l;

        visited[name] = true;
        required = this.required;
        moduleInfo = this.moduleInfo[name];
        condition = this.conditions[name] || {};

        if (moduleInfo) {
            // Recurse on each dependency of this module,
            // figuring out its dependencies, and so on.
            dependencies = moduleInfo.expanded || moduleInfo.requires;

            for (i = 0, l = dependencies.length; i < l; ++i) {
                dependency = dependencies[i];
                trigger = condition[dependency];

                // We cannot process this dependency yet if it must
                // appear after our current module.
                isAfter = trigger && (!trigger.when || trigger.when === "after");

                // Is this module name in the required list of modules,
                // and have we not already visited it?
                if (required[dependency] && !visited[dependency] && !isAfter) {
                    this._visit(dependency, visited);
                }
            }
        }

        this.sorted.push(name);
    },

    /**
    * Handles the actual insertion of script/link tags
    * @method _insert
    * @private
    * @param {Object} source The YUI instance the request came from
    * @param {Object} o The metadata to include
    * @param {String} type JS or CSS
    * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
    */
    _insert: function(source, o, type, skipcalc) {


        // restore the state at the time of the request
        if (source) {
            this._config(source);
        }

        // build the dependency list
        // don't include type so we can process CSS and script in
        // one pass when the type is not specified.

        var modules = this.resolve(!skipcalc),
            self = this, comp = 0, actions = 0,
            mods = {}, deps, complete;

        self._refetch = [];

        if (type) {
            //Filter out the opposite type and reset the array so the checks later work
            modules[((type === JS) ? CSS : JS)] = [];
        }
        if (!self.fetchCSS) {
            modules.css = [];
        }
        if (modules.js.length) {
            comp++;
        }
        if (modules.css.length) {
            comp++;
        }

        //console.log('Resolved Modules: ', modules);

        complete = function(d) {
            actions++;
            var errs = {}, i = 0, o = 0, u = '', fn,
                modName, resMods;

            if (d && d.errors) {
                for (i = 0; i < d.errors.length; i++) {
                    if (d.errors[i].request) {
                        u = d.errors[i].request.url;
                    } else {
                        u = d.errors[i];
                    }
                    errs[u] = u;
                }
            }

            if (d && d.data && d.data.length && (d.type === 'success')) {
                for (i = 0; i < d.data.length; i++) {
                    self.inserted[d.data[i].name] = true;
                    //If the external module has a skin or a lang, reprocess it
                    if (d.data[i].lang || d.data[i].skinnable) {
                        delete self.inserted[d.data[i].name];
                        self._refetch.push(d.data[i].name);
                    }
                }
            }

            if (actions === comp) {
                self._loading = null;
                if (self._refetch.length) {
                    //Get the deps for the new meta-data and reprocess
                    for (i = 0; i < self._refetch.length; i++) {
                        deps = self.getRequires(self.getModule(self._refetch[i]));
                        for (o = 0; o < deps.length; o++) {
                            if (!self.inserted[deps[o]]) {
                                //We wouldn't be to this point without the module being here
                                mods[deps[o]] = deps[o];
                            }
                        }
                    }
                    mods = Y.Object.keys(mods);
                    if (mods.length) {
                        self.require(mods);
                        resMods = self.resolve(true);
                        if (resMods.cssMods.length) {
                            for (i=0; i <  resMods.cssMods.length; i++) {
                                modName = resMods.cssMods[i].name;
                                delete YUI.Env._cssLoaded[modName];
                                if (self.isCSSLoaded(modName)) {
                                    self.inserted[modName] = true;
                                    delete self.required[modName];
                                }
                            }
                            self.sorted = [];
                            self._sort();
                        }
                        d = null; //bail
                        self._insert(); //insert the new deps
                    }
                }
                if (d && d.fn) {
                    fn = d.fn;
                    delete d.fn;
                    fn.call(self, d);
                }
            }
        };

        this._loading = true;

        if (!modules.js.length && !modules.css.length) {
            actions = -1;
            complete({
                fn: self._onSuccess
            });
            return;
        }


        if (modules.css.length) { //Load CSS first
            Y.Get.css(modules.css, {
                data: modules.cssMods,
                attributes: self.cssAttributes,
                insertBefore: self.insertBefore,
                charset: self.charset,
                timeout: self.timeout,
                context: self,
                onProgress: function(e) {
                    self._onProgress.call(self, e);
                },
                onTimeout: function(d) {
                    self._onTimeout.call(self, d);
                },
                onSuccess: function(d) {
                    d.type = 'success';
                    d.fn = self._onSuccess;
                    complete.call(self, d);
                },
                onFailure: function(d) {
                    d.type = 'failure';
                    d.fn = self._onFailure;
                    complete.call(self, d);
                }
            });
        }

        if (modules.js.length) {
            Y.Get.js(modules.js, {
                data: modules.jsMods,
                insertBefore: self.insertBefore,
                attributes: self.jsAttributes,
                charset: self.charset,
                timeout: self.timeout,
                autopurge: false,
                context: self,
                async: self.async,
                onProgress: function(e) {
                    self._onProgress.call(self, e);
                },
                onTimeout: function(d) {
                    self._onTimeout.call(self, d);
                },
                onSuccess: function(d) {
                    d.type = 'success';
                    d.fn = self._onSuccess;
                    complete.call(self, d);
                },
                onFailure: function(d) {
                    d.type = 'failure';
                    d.fn = self._onFailure;
                    complete.call(self, d);
                }
            });
        }
    },
    /**
    * Once a loader operation is completely finished, process any additional queued items.
    * @method _continue
    * @private
    */
    _continue: function() {
        if (!(_queue.running) && _queue.size() > 0) {
            _queue.running = true;
            _queue.next()();
        }
    },

    /**
     * inserts the requested modules and their dependencies.
     * <code>type</code> can be "js" or "css".  Both script and
     * css are inserted if type is not provided.
     * @method insert
     * @param {object} o optional options object.
     * @param {string} type the type of dependency to insert.
     */
    insert: function(o, type, skipsort) {
        var self = this, copy = Y.merge(this);
        delete copy.require;
        delete copy.dirty;
        _queue.add(function() {
            self._insert(copy, o, type, skipsort);
        });
        this._continue();
    },

    /**
     * Executed every time a module is loaded, and if we are in a load
     * cycle, we attempt to load the next script.  Public so that it
     * is possible to call this if using a method other than
     * Y.register to determine when scripts are fully loaded
     * @method loadNext
     * @deprecated
     * @param {string} mname optional the name of the module that has
     * been loaded (which is usually why it is time to load the next
     * one).
     */
    loadNext: function() {
        return;
    },

    /**
     * Apply filter defined for this instance to a url/path
     * @method _filter
     * @param {string} u the string to filter.
     * @param {string} name the name of the module, if we are processing
     * a single module as opposed to a combined url.
     * @return {string} the filtered string.
     * @private
     */
    _filter: function(u, name, group) {
        var f = this.filter,
            hasFilter = name && (name in this.filters),
            modFilter = hasFilter && this.filters[name],
            groupName = group || (this.getModuleInfo(name) || {}).group || null;

        if (groupName && this.groups[groupName] && this.groups[groupName].filter) {
            modFilter = this.groups[groupName].filter;
            hasFilter = true;
        }

        if (u) {
            if (hasFilter) {
                f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;
            }
            if (f) {
                u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
            }
        }
        return u;
    },

    /**
     * Generates the full url for a module
     * @method _url
     * @param {string} path the path fragment.
     * @param {String} name The name of the module
     * @param {String} [base] The base url to use. Defaults to self.base
     * @return {string} the full url.
     * @private
     */
    _url: function(path, name, base) {
        return this._filter((base || this.base || '') + path, name);
    },
    /**
    * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
    * @method resolve
    * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
    * @param {Array} [sorted=loader.sorted] An override for the loader.sorted array
    * @return {Object} Object hash (js and css) of two arrays of file lists
    * @example This method can be used as an off-line dep calculator
    *
    *        var Y = YUI();
    *        var loader = new Y.Loader({
    *            filter: 'debug',
    *            base: '../../',
    *            root: 'build/',
    *            combine: true,
    *            require: ['node', 'dd', 'console']
    *        });
    *        var out = loader.resolve(true);
    *
    */
    resolve: function(calc, sorted) {
        var self     = this,
            resolved = { js: [], jsMods: [], css: [], cssMods: [] },
            addSingle,
            usePathogen = Y.config.comboLoader && Y.config.customComboBase;

        if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) {
            self._resetModules();
        }

        if (calc) {
            self.calculate();
        }
        sorted = sorted || self.sorted;

        addSingle = function(mod) {
            if (mod) {
                var group = (mod.group && self.groups[mod.group]) || NOT_FOUND,
                    url;

                //Always assume it's async
                if (group.async === false) {
                    mod.async = group.async;
                }

                url = (mod.fullpath) ? self._filter(mod.fullpath, mod.name) :
                      self._url(mod.path, mod.name, group.base || mod.base);

                if (mod.attributes || mod.async === false) {
                    url = {
                        url: url,
                        async: mod.async
                    };
                    if (mod.attributes) {
                        url.attributes = mod.attributes;
                    }
                }
                resolved[mod.type].push(url);
                resolved[mod.type + 'Mods'].push(mod);
            } else {
            }

        };

        /*jslint vars: true */
        var inserted     = (self.ignoreRegistered) ? {} : self.inserted,
            comboSources,
            maxURLLength,
            comboMeta,
            comboBase,
            comboSep,
            group,
            mod,
            len,
            i,
            hasComboModule = false;

        /*jslint vars: false */

        for (i = 0, len = sorted.length; i < len; i++) {
            mod = self.getModule(sorted[i]);
            if (!mod || inserted[mod.name]) {
                continue;
            }

            group = self.groups[mod.group];

            comboBase = self.comboBase;

            if (group) {
                if (!group.combine || mod.fullpath) {
                    //This is not a combo module, skip it and load it singly later.
                    addSingle(mod);
                    continue;
                }
                mod.combine = true;

                if (typeof group.root === 'string') {
                    mod.root = group.root;
                }

                comboBase    = group.comboBase || comboBase;
                comboSep     = group.comboSep;
                maxURLLength = group.maxURLLength;
            } else {
                if (!self.combine) {
                    //This is not a combo module, skip it and load it singly later.
                    addSingle(mod);
                    continue;
                }
            }

            if (!mod.combine && mod.ext) {
                addSingle(mod);
                continue;
            }
            hasComboModule = true;
            comboSources = comboSources || {};
            comboSources[comboBase] = comboSources[comboBase] ||
                { js: [], jsMods: [], css: [], cssMods: [] };

            comboMeta               = comboSources[comboBase];
            comboMeta.group         = mod.group;
            comboMeta.comboSep      = comboSep || self.comboSep;
            comboMeta.maxURLLength  = maxURLLength || self.maxURLLength;

            comboMeta[mod.type + 'Mods'].push(mod);
            if (mod.type === JS || mod.type === CSS) {
                resolved[mod.type + 'Mods'].push(mod);
            }
        }
        //only encode if we have something to encode
        if (hasComboModule) {
            if (usePathogen) {
                resolved = this._pathogenEncodeComboSources(resolved);
            } else {
                resolved = this._encodeComboSources(resolved, comboSources);
            }
        }
        return resolved;
    },

    /**
     * Encodes combo sources and appends them to an object hash of arrays from `loader.resolve`.
     *
     * @method _encodeComboSources
     * @param {Object} resolved The object hash of arrays in which to attach the encoded combo sources.
     * @param {Object} comboSources An object containing relevant data about modules.
     * @return Object
     * @private
     */
    _encodeComboSources: function(resolved, comboSources) {
        var fragSubset,
            modules,
            tmpBase,
            baseLen,
            frags,
            frag,
            type,
            mod,
            maxURLLength,
            comboBase,
            comboMeta,
            comboSep,
            i,
            len,
            self = this;

        for (comboBase in comboSources) {
            if (comboSources.hasOwnProperty(comboBase)) {
                comboMeta    = comboSources[comboBase];
                comboSep     = comboMeta.comboSep;
                maxURLLength = comboMeta.maxURLLength;
                for (type in comboMeta) {
                    if (type === JS || type === CSS) {
                        modules = comboMeta[type + 'Mods'];
                        frags = [];
                        for (i = 0, len = modules.length; i < len; i += 1) {
                            mod = modules[i];
                            frag = ((typeof mod.root === 'string') ? mod.root : self.root) + (mod.path || mod.fullpath);
                            frags.push(
                                self._filter(frag, mod.name)
                            );
                        }
                        tmpBase = comboBase + frags.join(comboSep);
                        baseLen = tmpBase.length;
                        if (maxURLLength <= comboBase.length) {
                            maxURLLength = MAX_URL_LENGTH;
                        }

                        if (frags.length) {
                            if (baseLen > maxURLLength) {
                                fragSubset = [];
                                for (i = 0, len = frags.length; i < len; i++) {
                                    fragSubset.push(frags[i]);
                                    tmpBase = comboBase + fragSubset.join(comboSep);

                                    if (tmpBase.length > maxURLLength) {
                                        frag = fragSubset.pop();
                                        tmpBase = comboBase + fragSubset.join(comboSep);
                                        resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
                                        fragSubset = [];
                                        if (frag) {
                                            fragSubset.push(frag);
                                        }
                                    }
                                }
                                if (fragSubset.length) {
                                    tmpBase = comboBase + fragSubset.join(comboSep);
                                    resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
                                }
                            } else {
                                resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
                            }
                        }
                    }
                }
            }
        }
        return resolved;
    },

    /**
    Shortcut to calculate, resolve and load all modules.

        var loader = new Y.Loader({
            ignoreRegistered: true,
            modules: {
                mod: {
                    path: 'mod.js'
                }
            },
            requires: [ 'mod' ]
        });
        loader.load(function() {
            console.log('All modules have loaded..');
        });


    @method load
    @param {Function} cb Executed after all load operations are complete
    */
    load: function(cb) {
        if (!cb) {
            return;
        }
        var self = this,
            out = self.resolve(true);

        self.data = out;

        self.onEnd = function() {
            cb.apply(self.context || self, arguments);
        };

        self.insert();
    }
};


}, 'patched-v3.18.1', {"requires": ["get", "features"]});
YUI.add('loader-rollup', function (Y, NAME) {

/**
 * Optional automatic rollup logic for reducing http connections
 * when not using a combo service.
 * @module loader
 * @submodule rollup
 */

/**
 * Look for rollup packages to determine if all of the modules a
 * rollup supersedes are required.  If so, include the rollup to
 * help reduce the total number of connections required.  Called
 * by calculate().  This is an optional feature, and requires the
 * appropriate submodule to function.
 * @method _rollup
 * @for Loader
 * @private
 */
Y.Loader.prototype._rollup = function() {
    var i, j, m, s, r = this.required, roll,
        info = this.moduleInfo, rolled, c, smod;

    // find and cache rollup modules
    if (this.dirty || !this.rollups) {
        this.rollups = {};
        for (i in info) {
            if (info.hasOwnProperty(i)) {
                m = this.getModule(i);
                // if (m && m.rollup && m.supersedes) {
                if (m && m.rollup) {
                    this.rollups[i] = m;
                }
            }
        }
    }

    // make as many passes as needed to pick up rollup rollups
    for (;;) {
        rolled = false;

        // go through the rollup candidates
        for (i in this.rollups) {
            if (this.rollups.hasOwnProperty(i)) {
                // there can be only one, unless forced
                if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {
                    m = this.getModule(i);
                    s = m.supersedes || [];
                    roll = false;

                    // @TODO remove continue
                    if (!m.rollup) {
                        continue;
                    }

                    c = 0;

                    // check the threshold
                    for (j = 0; j < s.length; j++) {
                        smod = info[s[j]];

                        // if the superseded module is loaded, we can't
                        // load the rollup unless it has been forced.
                        if (this.loaded[s[j]] && !this.forceMap[s[j]]) {
                            roll = false;
                            break;
                        // increment the counter if this module is required.
                        // if we are beyond the rollup threshold, we will
                        // use the rollup module
                        } else if (r[s[j]] && m.type === smod.type) {
                            c++;
                            roll = (c >= m.rollup);
                            if (roll) {
                                break;
                            }
                        }
                    }

                    if (roll) {
                        // add the rollup
                        r[i] = true;
                        rolled = true;

                        // expand the rollup's dependencies
                        this.getRequires(m);
                    }
                }
            }
        }

        // if we made it here w/o rolling up something, we are done
        if (!rolled) {
            break;
        }
    }
};


}, 'patched-v3.18.1', {"requires": ["loader-base"]});
YUI.add('loader-yui3', function (Y, NAME) {

/* This file is auto-generated by (yogi loader --yes --mix --start ../) */

/*jshint maxlen:900, eqeqeq: false */

/**
 * YUI 3 module metadata
 * @module loader
 * @submodule loader-yui3
 */
YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {};
Y.mix(YUI.Env[Y.version].modules, {
    "align-plugin": {
        "requires": [
            "node-screen",
            "node-pluginhost"
        ]
    },
    "anim": {
        "use": [
            "anim-base",
            "anim-color",
            "anim-curve",
            "anim-easing",
            "anim-node-plugin",
            "anim-scroll",
            "anim-xy"
        ]
    },
    "anim-base": {
        "requires": [
            "base-base",
            "node-style",
            "color-base"
        ]
    },
    "anim-color": {
        "requires": [
            "anim-base"
        ]
    },
    "anim-curve": {
        "requires": [
            "anim-xy"
        ]
    },
    "anim-easing": {
        "requires": [
            "anim-base"
        ]
    },
    "anim-node-plugin": {
        "requires": [
            "node-pluginhost",
            "anim-base"
        ]
    },
    "anim-scroll": {
        "requires": [
            "anim-base"
        ]
    },
    "anim-shape": {
        "requires": [
            "anim-base",
            "anim-easing",
            "anim-color",
            "matrix"
        ]
    },
    "anim-shape-transform": {
        "use": [
            "anim-shape"
        ]
    },
    "anim-xy": {
        "requires": [
            "anim-base",
            "node-screen"
        ]
    },
    "app": {
        "use": [
            "app-base",
            "app-content",
            "app-transitions",
            "lazy-model-list",
            "model",
            "model-list",
            "model-sync-rest",
            "model-sync-local",
            "router",
            "view",
            "view-node-map"
        ]
    },
    "app-base": {
        "requires": [
            "classnamemanager",
            "pjax-base",
            "router",
            "view"
        ]
    },
    "app-content": {
        "requires": [
            "app-base",
            "pjax-content"
        ]
    },
    "app-transitions": {
        "requires": [
            "app-base"
        ]
    },
    "app-transitions-css": {
        "type": "css"
    },
    "app-transitions-native": {
        "condition": {
            "name": "app-transitions-native",
            "test": function (Y) {
    var doc  = Y.config.doc,
        node = doc ? doc.documentElement : null;

    if (node && node.style) {
        return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);
    }

    return false;
},
            "trigger": "app-transitions"
        },
        "requires": [
            "app-transitions",
            "app-transitions-css",
            "parallel",
            "transition"
        ]
    },
    "array-extras": {
        "requires": [
            "yui-base"
        ]
    },
    "array-invoke": {
        "requires": [
            "yui-base"
        ]
    },
    "arraylist": {
        "requires": [
            "yui-base"
        ]
    },
    "arraylist-add": {
        "requires": [
            "arraylist"
        ]
    },
    "arraylist-filter": {
        "requires": [
            "arraylist"
        ]
    },
    "arraysort": {
        "requires": [
            "yui-base"
        ]
    },
    "async-queue": {
        "requires": [
            "event-custom"
        ]
    },
    "attribute": {
        "use": [
            "attribute-base",
            "attribute-complex"
        ]
    },
    "attribute-base": {
        "requires": [
            "attribute-core",
            "attribute-observable",
            "attribute-extras"
        ]
    },
    "attribute-complex": {
        "requires": [
            "attribute-base"
        ]
    },
    "attribute-core": {
        "requires": [
            "oop"
        ]
    },
    "attribute-events": {
        "use": [
            "attribute-observable"
        ]
    },
    "attribute-extras": {
        "requires": [
            "oop"
        ]
    },
    "attribute-observable": {
        "requires": [
            "event-custom"
        ]
    },
    "autocomplete": {
        "use": [
            "autocomplete-base",
            "autocomplete-sources",
            "autocomplete-list",
            "autocomplete-plugin"
        ]
    },
    "autocomplete-base": {
        "optional": [
            "autocomplete-sources"
        ],
        "requires": [
            "array-extras",
            "base-build",
            "escape",
            "event-valuechange",
            "node-base"
        ]
    },
    "autocomplete-filters": {
        "requires": [
            "array-extras",
            "text-wordbreak"
        ]
    },
    "autocomplete-filters-accentfold": {
        "requires": [
            "array-extras",
            "text-accentfold",
            "text-wordbreak"
        ]
    },
    "autocomplete-highlighters": {
        "requires": [
            "array-extras",
            "highlight-base"
        ]
    },
    "autocomplete-highlighters-accentfold": {
        "requires": [
            "array-extras",
            "highlight-accentfold"
        ]
    },
    "autocomplete-list": {
        "after": [
            "autocomplete-sources"
        ],
        "lang": [
            "en",
            "es",
            "hu",
            "it"
        ],
        "requires": [
            "autocomplete-base",
            "event-resize",
            "node-screen",
            "selector-css3",
            "shim-plugin",
            "widget",
            "widget-position",
            "widget-position-align"
        ],
        "skinnable": true
    },
    "autocomplete-list-keys": {
        "condition": {
            "name": "autocomplete-list-keys",
            "test": function (Y) {
    // Only add keyboard support to autocomplete-list if this doesn't appear to
    // be an iOS or Android-based mobile device.
    //
    // There's currently no feasible way to actually detect whether a device has
    // a hardware keyboard, so this sniff will have to do. It can easily be
    // overridden by manually loading the autocomplete-list-keys module.
    //
    // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
    // doesn't fire the keyboard events used by AutoCompleteList, so there's
    // no point loading the -keys module even when a bluetooth keyboard may be
    // available.
    return !(Y.UA.ios || Y.UA.android);
},
            "trigger": "autocomplete-list"
        },
        "requires": [
            "autocomplete-list",
            "base-build"
        ]
    },
    "autocomplete-plugin": {
        "requires": [
            "autocomplete-list",
            "node-pluginhost"
        ]
    },
    "autocomplete-sources": {
        "optional": [
            "io-base",
            "json-parse",
            "jsonp",
            "yql"
        ],
        "requires": [
            "autocomplete-base"
        ]
    },
    "axes": {
        "use": [
            "axis-numeric",
            "axis-category",
            "axis-time",
            "axis-stacked"
        ]
    },
    "axes-base": {
        "use": [
            "axis-numeric-base",
            "axis-category-base",
            "axis-time-base",
            "axis-stacked-base"
        ]
    },
    "axis": {
        "requires": [
            "dom",
            "widget",
            "widget-position",
            "widget-stack",
            "graphics",
            "axis-base"
        ]
    },
    "axis-base": {
        "requires": [
            "classnamemanager",
            "datatype-number",
            "datatype-date",
            "base",
            "event-custom"
        ]
    },
    "axis-category": {
        "requires": [
            "axis",
            "axis-category-base"
        ]
    },
    "axis-category-base": {
        "requires": [
            "axis-base"
        ]
    },
    "axis-numeric": {
        "requires": [
            "axis",
            "axis-numeric-base"
        ]
    },
    "axis-numeric-base": {
        "requires": [
            "axis-base"
        ]
    },
    "axis-stacked": {
        "requires": [
            "axis-numeric",
            "axis-stacked-base"
        ]
    },
    "axis-stacked-base": {
        "requires": [
            "axis-numeric-base"
        ]
    },
    "axis-time": {
        "requires": [
            "axis",
            "axis-time-base"
        ]
    },
    "axis-time-base": {
        "requires": [
            "axis-base"
        ]
    },
    "base": {
        "use": [
            "base-base",
            "base-pluginhost",
            "base-build"
        ]
    },
    "base-base": {
        "requires": [
            "attribute-base",
            "base-core",
            "base-observable"
        ]
    },
    "base-build": {
        "requires": [
            "base-base"
        ]
    },
    "base-core": {
        "requires": [
            "attribute-core"
        ]
    },
    "base-observable": {
        "requires": [
            "attribute-observable",
            "base-core"
        ]
    },
    "base-pluginhost": {
        "requires": [
            "base-base",
            "pluginhost"
        ]
    },
    "button": {
        "requires": [
            "button-core",
            "cssbutton",
            "widget"
        ]
    },
    "button-core": {
        "requires": [
            "attribute-core",
            "classnamemanager",
            "node-base",
            "escape"
        ]
    },
    "button-group": {
        "requires": [
            "button-plugin",
            "cssbutton",
            "widget"
        ]
    },
    "button-plugin": {
        "requires": [
            "button-core",
            "cssbutton",
            "node-pluginhost"
        ]
    },
    "cache": {
        "use": [
            "cache-base",
            "cache-offline",
            "cache-plugin"
        ]
    },
    "cache-base": {
        "requires": [
            "base"
        ]
    },
    "cache-offline": {
        "requires": [
            "cache-base",
            "json"
        ]
    },
    "cache-plugin": {
        "requires": [
            "plugin",
            "cache-base"
        ]
    },
    "calendar": {
        "requires": [
            "calendar-base",
            "calendarnavigator"
        ],
        "skinnable": true
    },
    "calendar-base": {
        "lang": [
            "ca",
            "ca-ES",
            "de",
            "en",
            "es",
            "es-AR",
            "eu-ES",
            "fr",
            "hu",
            "it",
            "ja",
            "nb-NO",
            "nl",
            "pt-BR",
            "ru",
            "zh-Hans",
            "zh-Hans-CN",
            "zh-Hant",
            "zh-Hant-HK",
            "zh-HANT-TW"
        ],
        "requires": [
            "widget",
            "datatype-date",
            "datatype-date-math",
            "cssgrids"
        ],
        "skinnable": true
    },
    "calendarnavigator": {
        "lang": [
            "en",
            "es",
            "es-AR",
            "eu-ES"
        ],
        "requires": [
            "plugin",
            "classnamemanager",
            "datatype-date",
            "node"
        ],
        "skinnable": true
    },
    "charts": {
        "use": [
            "charts-base"
        ]
    },
    "charts-base": {
        "requires": [
            "dom",
            "event-mouseenter",
            "event-touch",
            "graphics-group",
            "axes",
            "series-pie",
            "series-line",
            "series-marker",
            "series-area",
            "series-spline",
            "series-column",
            "series-bar",
            "series-areaspline",
            "series-combo",
            "series-combospline",
            "series-line-stacked",
            "series-marker-stacked",
            "series-area-stacked",
            "series-spline-stacked",
            "series-column-stacked",
            "series-bar-stacked",
            "series-areaspline-stacked",
            "series-combo-stacked",
            "series-combospline-stacked"
        ]
    },
    "charts-legend": {
        "requires": [
            "charts-base"
        ]
    },
    "classnamemanager": {
        "requires": [
            "yui-base"
        ]
    },
    "clickable-rail": {
        "requires": [
            "slider-base"
        ]
    },
    "collection": {
        "use": [
            "array-extras",
            "arraylist",
            "arraylist-add",
            "arraylist-filter",
            "array-invoke"
        ]
    },
    "color": {
        "use": [
            "color-base",
            "color-hsl",
            "color-harmony"
        ]
    },
    "color-base": {
        "requires": [
            "yui-base"
        ]
    },
    "color-harmony": {
        "requires": [
            "color-hsl"
        ]
    },
    "color-hsl": {
        "requires": [
            "color-base"
        ]
    },
    "color-hsv": {
        "requires": [
            "color-base"
        ]
    },
    "console": {
        "lang": [
            "en",
            "es",
            "hu",
            "it",
            "ja"
        ],
        "requires": [
            "yui-log",
            "widget"
        ],
        "skinnable": true
    },
    "console-filters": {
        "requires": [
            "plugin",
            "console"
        ],
        "skinnable": true
    },
    "content-editable": {
        "requires": [
            "node-base",
            "editor-selection",
            "stylesheet",
            "plugin"
        ]
    },
    "controller": {
        "use": [
            "router"
        ]
    },
    "cookie": {
        "requires": [
            "yui-base"
        ]
    },
    "createlink-base": {
        "requires": [
            "editor-base"
        ]
    },
    "cssbase": {
        "after": [
            "cssreset",
            "cssfonts",
            "cssgrids",
            "cssreset-context",
            "cssfonts-context",
            "cssgrids-context"
        ],
        "type": "css"
    },
    "cssbase-context": {
        "after": [
            "cssreset",
            "cssfonts",
            "cssgrids",
            "cssreset-context",
            "cssfonts-context",
            "cssgrids-context"
        ],
        "type": "css"
    },
    "cssbutton": {
        "type": "css"
    },
    "cssfonts": {
        "type": "css"
    },
    "cssfonts-context": {
        "type": "css"
    },
    "cssgrids": {
        "optional": [
            "cssnormalize"
        ],
        "type": "css"
    },
    "cssgrids-base": {
        "optional": [
            "cssnormalize"
        ],
        "type": "css"
    },
    "cssgrids-responsive": {
        "optional": [
            "cssnormalize"
        ],
        "requires": [
            "cssgrids",
            "cssgrids-responsive-base"
        ],
        "type": "css"
    },
    "cssgrids-units": {
        "optional": [
            "cssnormalize"
        ],
        "requires": [
            "cssgrids-base"
        ],
        "type": "css"
    },
    "cssnormalize": {
        "type": "css"
    },
    "cssnormalize-context": {
        "type": "css"
    },
    "cssreset": {
        "type": "css"
    },
    "cssreset-context": {
        "type": "css"
    },
    "dataschema": {
        "use": [
            "dataschema-base",
            "dataschema-json",
            "dataschema-xml",
            "dataschema-array",
            "dataschema-text"
        ]
    },
    "dataschema-array": {
        "requires": [
            "dataschema-base"
        ]
    },
    "dataschema-base": {
        "requires": [
            "base"
        ]
    },
    "dataschema-json": {
        "requires": [
            "dataschema-base",
            "json"
        ]
    },
    "dataschema-text": {
        "requires": [
            "dataschema-base"
        ]
    },
    "dataschema-xml": {
        "requires": [
            "dataschema-base"
        ]
    },
    "datasource": {
        "use": [
            "datasource-local",
            "datasource-io",
            "datasource-get",
            "datasource-function",
            "datasource-cache",
            "datasource-jsonschema",
            "datasource-xmlschema",
            "datasource-arrayschema",
            "datasource-textschema",
            "datasource-polling"
        ]
    },
    "datasource-arrayschema": {
        "requires": [
            "datasource-local",
            "plugin",
            "dataschema-array"
        ]
    },
    "datasource-cache": {
        "requires": [
            "datasource-local",
            "plugin",
            "cache-base"
        ]
    },
    "datasource-function": {
        "requires": [
            "datasource-local"
        ]
    },
    "datasource-get": {
        "requires": [
            "datasource-local",
            "get"
        ]
    },
    "datasource-io": {
        "requires": [
            "datasource-local",
            "io-base"
        ]
    },
    "datasource-jsonschema": {
        "requires": [
            "datasource-local",
            "plugin",
            "dataschema-json"
        ]
    },
    "datasource-local": {
        "requires": [
            "base"
        ]
    },
    "datasource-polling": {
        "requires": [
            "datasource-local"
        ]
    },
    "datasource-textschema": {
        "requires": [
            "datasource-local",
            "plugin",
            "dataschema-text"
        ]
    },
    "datasource-xmlschema": {
        "requires": [
            "datasource-local",
            "plugin",
            "datatype-xml",
            "dataschema-xml"
        ]
    },
    "datatable": {
        "use": [
            "datatable-core",
            "datatable-table",
            "datatable-head",
            "datatable-body",
            "datatable-base",
            "datatable-column-widths",
            "datatable-message",
            "datatable-mutable",
            "datatable-sort",
            "datatable-datasource"
        ]
    },
    "datatable-base": {
        "requires": [
            "datatable-core",
            "datatable-table",
            "datatable-head",
            "datatable-body",
            "base-build",
            "widget"
        ],
        "skinnable": true
    },
    "datatable-body": {
        "requires": [
            "datatable-core",
            "view",
            "classnamemanager"
        ]
    },
    "datatable-column-widths": {
        "requires": [
            "datatable-base"
        ]
    },
    "datatable-core": {
        "requires": [
            "escape",
            "model-list",
            "node-event-delegate"
        ]
    },
    "datatable-datasource": {
        "requires": [
            "datatable-base",
            "plugin",
            "datasource-local"
        ]
    },
    "datatable-foot": {
        "requires": [
            "datatable-core",
            "view"
        ]
    },
    "datatable-formatters": {
        "requires": [
            "datatable-body",
            "datatype-number-format",
            "datatype-date-format",
            "escape"
        ]
    },
    "datatable-head": {
        "requires": [
            "datatable-core",
            "view",
            "classnamemanager"
        ]
    },
    "datatable-highlight": {
        "requires": [
            "datatable-base",
            "event-hover"
        ],
        "skinnable": true
    },
    "datatable-keynav": {
        "requires": [
            "datatable-base"
        ]
    },
    "datatable-message": {
        "lang": [
            "en",
            "fr",
            "es",
            "hu",
            "it"
        ],
        "requires": [
            "datatable-base"
        ],
        "skinnable": true
    },
    "datatable-mutable": {
        "requires": [
            "datatable-base"
        ]
    },
    "datatable-paginator": {
        "lang": [
            "en",
            "fr"
        ],
        "requires": [
            "model",
            "view",
            "paginator-core",
            "datatable-foot",
            "datatable-paginator-templates"
        ],
        "skinnable": true
    },
    "datatable-paginator-templates": {
        "requires": [
            "template"
        ]
    },
    "datatable-scroll": {
        "requires": [
            "datatable-base",
            "datatable-column-widths",
            "dom-screen"
        ],
        "skinnable": true
    },
    "datatable-sort": {
        "lang": [
            "en",
            "fr",
            "es",
            "hu"
        ],
        "requires": [
            "datatable-base"
        ],
        "skinnable": true
    },
    "datatable-table": {
        "requires": [
            "datatable-core",
            "datatable-head",
            "datatable-body",
            "view",
            "classnamemanager"
        ]
    },
    "datatype": {
        "use": [
            "datatype-date",
            "datatype-number",
            "datatype-xml"
        ]
    },
    "datatype-date": {
        "use": [
            "datatype-date-parse",
            "datatype-date-format",
            "datatype-date-math"
        ]
    },
    "datatype-date-format": {
        "lang": [
            "ar",
            "ar-JO",
            "ca",
            "ca-ES",
            "da",
            "da-DK",
            "de",
            "de-AT",
            "de-DE",
            "el",
            "el-GR",
            "en",
            "en-AU",
            "en-CA",
            "en-GB",
            "en-IE",
            "en-IN",
            "en-JO",
            "en-MY",
            "en-NZ",
            "en-PH",
            "en-SG",
            "en-US",
            "es",
            "es-AR",
            "es-BO",
            "es-CL",
            "es-CO",
            "es-EC",
            "es-ES",
            "es-MX",
            "es-PE",
            "es-PY",
            "es-US",
            "es-UY",
            "es-VE",
            "fi",
            "fi-FI",
            "fr",
            "fr-BE",
            "fr-CA",
            "fr-FR",
            "hi",
            "hi-IN",
            "hu",
            "id",
            "id-ID",
            "it",
            "it-IT",
            "ja",
            "ja-JP",
            "ko",
            "ko-KR",
            "ms",
            "ms-MY",
            "nb",
            "nb-NO",
            "nl",
            "nl-BE",
            "nl-NL",
            "pl",
            "pl-PL",
            "pt",
            "pt-BR",
            "ro",
            "ro-RO",
            "ru",
            "ru-RU",
            "sv",
            "sv-SE",
            "th",
            "th-TH",
            "tr",
            "tr-TR",
            "vi",
            "vi-VN",
            "zh-Hans",
            "zh-Hans-CN",
            "zh-Hant",
            "zh-Hant-HK",
            "zh-Hant-TW"
        ]
    },
    "datatype-date-math": {
        "requires": [
            "yui-base"
        ]
    },
    "datatype-date-parse": {},
    "datatype-number": {
        "use": [
            "datatype-number-parse",
            "datatype-number-format"
        ]
    },
    "datatype-number-format": {},
    "datatype-number-parse": {
        "requires": [
            "escape"
        ]
    },
    "datatype-xml": {
        "use": [
            "datatype-xml-parse",
            "datatype-xml-format"
        ]
    },
    "datatype-xml-format": {},
    "datatype-xml-parse": {},
    "dd": {
        "use": [
            "dd-ddm-base",
            "dd-ddm",
            "dd-ddm-drop",
            "dd-drag",
            "dd-proxy",
            "dd-constrain",
            "dd-drop",
            "dd-scroll",
            "dd-delegate"
        ]
    },
    "dd-constrain": {
        "requires": [
            "dd-drag"
        ]
    },
    "dd-ddm": {
        "requires": [
            "dd-ddm-base",
            "event-resize"
        ]
    },
    "dd-ddm-base": {
        "requires": [
            "node",
            "base",
            "yui-throttle",
            "classnamemanager"
        ]
    },
    "dd-ddm-drop": {
        "requires": [
            "dd-ddm"
        ]
    },
    "dd-delegate": {
        "requires": [
            "dd-drag",
            "dd-drop-plugin",
            "event-mouseenter"
        ]
    },
    "dd-drag": {
        "requires": [
            "dd-ddm-base",
            "selector-css2"
        ]
    },
    "dd-drop": {
        "requires": [
            "dd-drag",
            "dd-ddm-drop"
        ]
    },
    "dd-drop-plugin": {
        "requires": [
            "dd-drop"
        ]
    },
    "dd-gestures": {
        "condition": {
            "name": "dd-gestures",
            "trigger": "dd-drag",
            "ua": "touchEnabled"
        },
        "requires": [
            "dd-drag",
            "event-synthetic",
            "event-gestures"
        ]
    },
    "dd-plugin": {
        "optional": [
            "dd-constrain",
            "dd-proxy"
        ],
        "requires": [
            "dd-drag"
        ]
    },
    "dd-proxy": {
        "requires": [
            "dd-drag"
        ]
    },
    "dd-scroll": {
        "requires": [
            "dd-drag"
        ]
    },
    "dial": {
        "lang": [
            "en",
            "es",
            "hu"
        ],
        "requires": [
            "widget",
            "dd-drag",
            "event-mouseenter",
            "event-move",
            "event-key",
            "transition",
            "intl"
        ],
        "skinnable": true
    },
    "dom": {
        "use": [
            "dom-base",
            "dom-screen",
            "dom-style",
            "selector-native",
            "selector"
        ]
    },
    "dom-base": {
        "requires": [
            "dom-core"
        ]
    },
    "dom-core": {
        "requires": [
            "oop",
            "features"
        ]
    },
    "dom-screen": {
        "requires": [
            "dom-base",
            "dom-style"
        ]
    },
    "dom-style": {
        "requires": [
            "dom-base"
        ]
    },
    "dom-style-ie": {
        "condition": {
            "name": "dom-style-ie",
            "test": function (Y) {

    var testFeature = Y.Features.test,
        addFeature = Y.Features.add,
        WINDOW = Y.config.win,
        DOCUMENT = Y.config.doc,
        DOCUMENT_ELEMENT = 'documentElement',
        ret = false;

    addFeature('style', 'computedStyle', {
        test: function() {
            return WINDOW && 'getComputedStyle' in WINDOW;
        }
    });

    addFeature('style', 'opacity', {
        test: function() {
            return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
        }
    });

    ret =  (!testFeature('style', 'opacity') &&
            !testFeature('style', 'computedStyle'));

    return ret;
},
            "trigger": "dom-style"
        },
        "requires": [
            "dom-style",
            "color-base"
        ]
    },
    "dump": {
        "requires": [
            "yui-base"
        ]
    },
    "editor": {
        "use": [
            "frame",
            "editor-selection",
            "exec-command",
            "editor-base",
            "editor-para",
            "editor-br",
            "editor-bidi",
            "editor-tab",
            "createlink-base"
        ]
    },
    "editor-base": {
        "requires": [
            "base",
            "frame",
            "node",
            "exec-command",
            "editor-selection"
        ]
    },
    "editor-bidi": {
        "requires": [
            "editor-base"
        ]
    },
    "editor-br": {
        "requires": [
            "editor-base"
        ]
    },
    "editor-inline": {
        "requires": [
            "editor-base",
            "content-editable"
        ]
    },
    "editor-lists": {
        "requires": [
            "editor-base"
        ]
    },
    "editor-para": {
        "requires": [
            "editor-para-base"
        ]
    },
    "editor-para-base": {
        "requires": [
            "editor-base"
        ]
    },
    "editor-para-ie": {
        "condition": {
            "name": "editor-para-ie",
            "trigger": "editor-para",
            "ua": "ie",
            "when": "instead"
        },
        "requires": [
            "editor-para-base"
        ]
    },
    "editor-selection": {
        "requires": [
            "node"
        ]
    },
    "editor-tab": {
        "requires": [
            "editor-base"
        ]
    },
    "escape": {
        "requires": [
            "yui-base"
        ]
    },
    "event": {
        "after": [
            "node-base"
        ],
        "use": [
            "event-base",
            "event-delegate",
            "event-synthetic",
            "event-mousewheel",
            "event-mouseenter",
            "event-key",
            "event-focus",
            "event-resize",
            "event-hover",
            "event-outside",
            "event-touch",
            "event-move",
            "event-flick",
            "event-valuechange",
            "event-tap"
        ]
    },
    "event-base": {
        "after": [
            "node-base"
        ],
        "requires": [
            "event-custom-base"
        ]
    },
    "event-base-ie": {
        "after": [
            "event-base"
        ],
        "condition": {
            "name": "event-base-ie",
            "test": function(Y) {
    var imp = Y.config.doc && Y.config.doc.implementation;
    return (imp && (!imp.hasFeature('Events', '2.0')));
},
            "trigger": "node-base"
        },
        "requires": [
            "node-base"
        ]
    },
    "event-contextmenu": {
        "requires": [
            "event-synthetic",
            "dom-screen"
        ]
    },
    "event-custom": {
        "use": [
            "event-custom-base",
            "event-custom-complex"
        ]
    },
    "event-custom-base": {
        "requires": [
            "oop"
        ]
    },
    "event-custom-complex": {
        "requires": [
            "event-custom-base"
        ]
    },
    "event-delegate": {
        "requires": [
            "node-base"
        ]
    },
    "event-flick": {
        "requires": [
            "node-base",
            "event-touch",
            "event-synthetic"
        ]
    },
    "event-focus": {
        "requires": [
            "event-synthetic"
        ]
    },
    "event-gestures": {
        "use": [
            "event-flick",
            "event-move"
        ]
    },
    "event-hover": {
        "requires": [
            "event-mouseenter"
        ]
    },
    "event-key": {
        "requires": [
            "event-synthetic"
        ]
    },
    "event-mouseenter": {
        "requires": [
            "event-synthetic"
        ]
    },
    "event-mousewheel": {
        "requires": [
            "node-base"
        ]
    },
    "event-move": {
        "requires": [
            "node-base",
            "event-touch",
            "event-synthetic"
        ]
    },
    "event-outside": {
        "requires": [
            "event-synthetic"
        ]
    },
    "event-resize": {
        "requires": [
            "node-base",
            "event-synthetic"
        ]
    },
    "event-simulate": {
        "requires": [
            "event-base"
        ]
    },
    "event-synthetic": {
        "requires": [
            "node-base",
            "event-custom-complex"
        ]
    },
    "event-tap": {
        "requires": [
            "node-base",
            "event-base",
            "event-touch",
            "event-synthetic"
        ]
    },
    "event-touch": {
        "requires": [
            "node-base"
        ]
    },
    "event-valuechange": {
        "requires": [
            "event-focus",
            "event-synthetic"
        ]
    },
    "exec-command": {
        "requires": [
            "frame"
        ]
    },
    "features": {
        "requires": [
            "yui-base"
        ]
    },
    "file": {
        "requires": [
            "file-flash",
            "file-html5"
        ]
    },
    "file-flash": {
        "requires": [
            "base"
        ]
    },
    "file-html5": {
        "requires": [
            "base"
        ]
    },
    "frame": {
        "requires": [
            "base",
            "node",
            "plugin",
            "selector-css3",
            "yui-throttle"
        ]
    },
    "gesture-simulate": {
        "requires": [
            "async-queue",
            "event-simulate",
            "node-screen"
        ]
    },
    "get": {
        "requires": [
            "yui-base"
        ]
    },
    "graphics": {
        "requires": [
            "node",
            "event-custom",
            "pluginhost",
            "matrix",
            "classnamemanager"
        ]
    },
    "graphics-canvas": {
        "condition": {
            "name": "graphics-canvas",
            "test": function(Y) {
    var DOCUMENT = Y.config.doc,
        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
},
            "trigger": "graphics"
        },
        "requires": [
            "graphics",
            "color-base"
        ]
    },
    "graphics-canvas-default": {
        "condition": {
            "name": "graphics-canvas-default",
            "test": function(Y) {
    var DOCUMENT = Y.config.doc,
        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
},
            "trigger": "graphics"
        }
    },
    "graphics-group": {
        "requires": [
            "graphics"
        ]
    },
    "graphics-svg": {
        "condition": {
            "name": "graphics-svg",
            "test": function(Y) {
    var DOCUMENT = Y.config.doc,
        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));

    return svg && (useSVG || !canvas);
},
            "trigger": "graphics"
        },
        "requires": [
            "graphics"
        ]
    },
    "graphics-svg-default": {
        "condition": {
            "name": "graphics-svg-default",
            "test": function(Y) {
    var DOCUMENT = Y.config.doc,
        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));

    return svg && (useSVG || !canvas);
},
            "trigger": "graphics"
        }
    },
    "graphics-vml": {
        "condition": {
            "name": "graphics-vml",
            "test": function(Y) {
    var DOCUMENT = Y.config.doc,
		canvas = DOCUMENT && DOCUMENT.createElement("canvas");
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
            "trigger": "graphics"
        },
        "requires": [
            "graphics",
            "color-base"
        ]
    },
    "graphics-vml-default": {
        "condition": {
            "name": "graphics-vml-default",
            "test": function(Y) {
    var DOCUMENT = Y.config.doc,
		canvas = DOCUMENT && DOCUMENT.createElement("canvas");
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
},
            "trigger": "graphics"
        }
    },
    "handlebars": {
        "use": [
            "handlebars-compiler"
        ]
    },
    "handlebars-base": {
        "requires": []
    },
    "handlebars-compiler": {
        "requires": [
            "handlebars-base"
        ]
    },
    "highlight": {
        "use": [
            "highlight-base",
            "highlight-accentfold"
        ]
    },
    "highlight-accentfold": {
        "requires": [
            "highlight-base",
            "text-accentfold"
        ]
    },
    "highlight-base": {
        "requires": [
            "array-extras",
            "classnamemanager",
            "escape",
            "text-wordbreak"
        ]
    },
    "history": {
        "use": [
            "history-base",
            "history-hash",
            "history-html5"
        ]
    },
    "history-base": {
        "requires": [
            "event-custom-complex"
        ]
    },
    "history-hash": {
        "after": [
            "history-html5"
        ],
        "requires": [
            "event-synthetic",
            "history-base",
            "yui-later"
        ]
    },
    "history-hash-ie": {
        "condition": {
            "name": "history-hash-ie",
            "test": function (Y) {
    var docMode = Y.config.doc && Y.config.doc.documentMode;

    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
            !docMode || docMode < 8);
},
            "trigger": "history-hash"
        },
        "requires": [
            "history-hash",
            "node-base"
        ]
    },
    "history-html5": {
        "optional": [
            "json"
        ],
        "requires": [
            "event-base",
            "history-base",
            "node-base"
        ]
    },
    "imageloader": {
        "requires": [
            "base-base",
            "node-style",
            "node-screen"
        ]
    },
    "intl": {
        "requires": [
            "intl-base",
            "event-custom"
        ]
    },
    "intl-base": {
        "requires": [
            "yui-base"
        ]
    },
    "io": {
        "use": [
            "io-base",
            "io-xdr",
            "io-form",
            "io-upload-iframe",
            "io-queue"
        ]
    },
    "io-base": {
        "requires": [
            "event-custom-base",
            "querystring-stringify-simple"
        ]
    },
    "io-form": {
        "requires": [
            "io-base",
            "node-base"
        ]
    },
    "io-nodejs": {
        "condition": {
            "name": "io-nodejs",
            "trigger": "io-base",
            "ua": "nodejs"
        },
        "requires": [
            "io-base"
        ]
    },
    "io-queue": {
        "requires": [
            "io-base",
            "queue-promote"
        ]
    },
    "io-upload-iframe": {
        "requires": [
            "io-base",
            "node-base"
        ]
    },
    "io-xdr": {
        "requires": [
            "io-base",
            "datatype-xml-parse"
        ]
    },
    "json": {
        "use": [
            "json-parse",
            "json-stringify"
        ]
    },
    "json-parse": {
        "requires": [
            "yui-base"
        ]
    },
    "json-parse-shim": {
        "condition": {
            "name": "json-parse-shim",
            "test": function (Y) {
    var _JSON = Y.config.global.JSON,
        Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,
        nativeSupport = Y.config.useNativeJSONParse !== false && !!Native;

    function workingNative( k, v ) {
        return k === "ok" ? true : v;
    }

    // Double check basic functionality.  This is mainly to catch early broken
    // implementations of the JSON API in Firefox 3.1 beta1 and beta2
    if ( nativeSupport ) {
        try {
            nativeSupport = ( Native.parse( '{"ok":false}', workingNative ) ).ok;
        }
        catch ( e ) {
            nativeSupport = false;
        }
    }

    return !nativeSupport;
},
            "trigger": "json-parse"
        },
        "requires": [
            "json-parse"
        ]
    },
    "json-stringify": {
        "requires": [
            "yui-base"
        ]
    },
    "json-stringify-shim": {
        "condition": {
            "name": "json-stringify-shim",
            "test": function (Y) {
    var _JSON = Y.config.global.JSON,
        Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,
        nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native;

    // Double check basic native functionality.  This is primarily to catch broken
    // early JSON API implementations in Firefox 3.1 beta1 and beta2.
    if ( nativeSupport ) {
        try {
            nativeSupport = ( '0' === Native.stringify(0) );
        } catch ( e ) {
            nativeSupport = false;
        }
    }


    return !nativeSupport;
},
            "trigger": "json-stringify"
        },
        "requires": [
            "json-stringify"
        ]
    },
    "jsonp": {
        "requires": [
            "get",
            "oop"
        ]
    },
    "jsonp-url": {
        "requires": [
            "jsonp"
        ]
    },
    "lazy-model-list": {
        "requires": [
            "model-list"
        ]
    },
    "loader": {
        "use": [
            "loader-base",
            "loader-rollup",
            "loader-yui3"
        ]
    },
    "loader-base": {
        "requires": [
            "get",
            "features"
        ]
    },
    "loader-pathogen-combohandler": {},
    "loader-pathogen-encoder": {
        "use": [
            "loader-base",
            "loader-rollup",
            "loader-yui3",
            "loader-pathogen-combohandler"
        ]
    },
    "loader-rollup": {
        "requires": [
            "loader-base"
        ]
    },
    "loader-yui3": {
        "requires": [
            "loader-base"
        ]
    },
    "matrix": {
        "requires": [
            "yui-base"
        ]
    },
    "model": {
        "requires": [
            "base-build",
            "escape",
            "json-parse"
        ]
    },
    "model-list": {
        "requires": [
            "array-extras",
            "array-invoke",
            "arraylist",
            "base-build",
            "escape",
            "json-parse",
            "model"
        ]
    },
    "model-sync-local": {
        "requires": [
            "model",
            "json-stringify"
        ]
    },
    "model-sync-rest": {
        "requires": [
            "model",
            "io-base",
            "json-stringify"
        ]
    },
    "node": {
        "use": [
            "node-base",
            "node-event-delegate",
            "node-pluginhost",
            "node-screen",
            "node-style"
        ]
    },
    "node-base": {
        "requires": [
            "event-base",
            "node-core",
            "dom-base",
            "dom-style"
        ]
    },
    "node-core": {
        "requires": [
            "dom-core",
            "selector"
        ]
    },
    "node-event-delegate": {
        "requires": [
            "node-base",
            "event-delegate"
        ]
    },
    "node-event-html5": {
        "requires": [
            "node-base"
        ]
    },
    "node-event-simulate": {
        "requires": [
            "node-base",
            "event-simulate",
            "gesture-simulate"
        ]
    },
    "node-flick": {
        "requires": [
            "classnamemanager",
            "transition",
            "event-flick",
            "plugin"
        ],
        "skinnable": true
    },
    "node-focusmanager": {
        "requires": [
            "attribute",
            "node",
            "plugin",
            "node-event-simulate",
            "event-key",
            "event-focus"
        ]
    },
    "node-load": {
        "requires": [
            "node-base",
            "io-base"
        ]
    },
    "node-menunav": {
        "requires": [
            "node",
            "classnamemanager",
            "plugin",
            "node-focusmanager"
        ],
        "skinnable": true
    },
    "node-pluginhost": {
        "requires": [
            "node-base",
            "pluginhost"
        ]
    },
    "node-screen": {
        "requires": [
            "dom-screen",
            "node-base"
        ]
    },
    "node-scroll-info": {
        "requires": [
            "array-extras",
            "base-build",
            "event-resize",
            "node-pluginhost",
            "plugin",
            "selector"
        ]
    },
    "node-style": {
        "requires": [
            "dom-style",
            "node-base"
        ]
    },
    "oop": {
        "requires": [
            "yui-base"
        ]
    },
    "overlay": {
        "requires": [
            "widget",
            "widget-stdmod",
            "widget-position",
            "widget-position-align",
            "widget-stack",
            "widget-position-constrain"
        ],
        "skinnable": true
    },
    "paginator": {
        "requires": [
            "paginator-core"
        ]
    },
    "paginator-core": {
        "requires": [
            "base"
        ]
    },
    "paginator-url": {
        "requires": [
            "paginator"
        ]
    },
    "panel": {
        "requires": [
            "widget",
            "widget-autohide",
            "widget-buttons",
            "widget-modality",
            "widget-position",
            "widget-position-align",
            "widget-position-constrain",
            "widget-stack",
            "widget-stdmod"
        ],
        "skinnable": true
    },
    "parallel": {
        "requires": [
            "yui-base"
        ]
    },
    "pjax": {
        "requires": [
            "pjax-base",
            "pjax-content"
        ]
    },
    "pjax-base": {
        "requires": [
            "classnamemanager",
            "node-event-delegate",
            "router"
        ]
    },
    "pjax-content": {
        "requires": [
            "io-base",
            "node-base",
            "router"
        ]
    },
    "pjax-plugin": {
        "requires": [
            "node-pluginhost",
            "pjax",
            "plugin"
        ]
    },
    "plugin": {
        "requires": [
            "base-base"
        ]
    },
    "pluginhost": {
        "use": [
            "pluginhost-base",
            "pluginhost-config"
        ]
    },
    "pluginhost-base": {
        "requires": [
            "yui-base"
        ]
    },
    "pluginhost-config": {
        "requires": [
            "pluginhost-base"
        ]
    },
    "promise": {
        "requires": [
            "timers"
        ]
    },
    "querystring": {
        "use": [
            "querystring-parse",
            "querystring-stringify"
        ]
    },
    "querystring-parse": {
        "requires": [
            "yui-base",
            "array-extras"
        ]
    },
    "querystring-parse-simple": {
        "requires": [
            "yui-base"
        ]
    },
    "querystring-stringify": {
        "requires": [
            "yui-base"
        ]
    },
    "querystring-stringify-simple": {
        "requires": [
            "yui-base"
        ]
    },
    "queue-promote": {
        "requires": [
            "yui-base"
        ]
    },
    "range-slider": {
        "requires": [
            "slider-base",
            "slider-value-range",
            "clickable-rail"
        ]
    },
    "recordset": {
        "use": [
            "recordset-base",
            "recordset-sort",
            "recordset-filter",
            "recordset-indexer"
        ]
    },
    "recordset-base": {
        "requires": [
            "base",
            "arraylist"
        ]
    },
    "recordset-filter": {
        "requires": [
            "recordset-base",
            "array-extras",
            "plugin"
        ]
    },
    "recordset-indexer": {
        "requires": [
            "recordset-base",
            "plugin"
        ]
    },
    "recordset-sort": {
        "requires": [
            "arraysort",
            "recordset-base",
            "plugin"
        ]
    },
    "resize": {
        "use": [
            "resize-base",
            "resize-proxy",
            "resize-constrain"
        ]
    },
    "resize-base": {
        "requires": [
            "base",
            "widget",
            "event",
            "oop",
            "dd-drag",
            "dd-delegate",
            "dd-drop"
        ],
        "skinnable": true
    },
    "resize-constrain": {
        "requires": [
            "plugin",
            "resize-base"
        ]
    },
    "resize-plugin": {
        "optional": [
            "resize-constrain"
        ],
        "requires": [
            "resize-base",
            "plugin"
        ]
    },
    "resize-proxy": {
        "requires": [
            "plugin",
            "resize-base"
        ]
    },
    "router": {
        "optional": [
            "querystring-parse"
        ],
        "requires": [
            "array-extras",
            "base-build",
            "history"
        ]
    },
    "scrollview": {
        "requires": [
            "scrollview-base",
            "scrollview-scrollbars"
        ]
    },
    "scrollview-base": {
        "requires": [
            "widget",
            "event-gestures",
            "event-mousewheel",
            "transition"
        ],
        "skinnable": true
    },
    "scrollview-base-ie": {
        "condition": {
            "name": "scrollview-base-ie",
            "trigger": "scrollview-base",
            "ua": "ie"
        },
        "requires": [
            "scrollview-base"
        ]
    },
    "scrollview-list": {
        "requires": [
            "plugin",
            "classnamemanager"
        ],
        "skinnable": true
    },
    "scrollview-paginator": {
        "requires": [
            "plugin",
            "classnamemanager"
        ]
    },
    "scrollview-scrollbars": {
        "requires": [
            "classnamemanager",
            "transition",
            "plugin"
        ],
        "skinnable": true
    },
    "selector": {
        "requires": [
            "selector-native"
        ]
    },
    "selector-css2": {
        "condition": {
            "name": "selector-css2",
            "test": function (Y) {
    var DOCUMENT = Y.config.doc,
        ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);

    return ret;
},
            "trigger": "selector"
        },
        "requires": [
            "selector-native"
        ]
    },
    "selector-css3": {
        "requires": [
            "selector-native",
            "selector-css2"
        ]
    },
    "selector-native": {
        "requires": [
            "dom-base"
        ]
    },
    "series-area": {
        "requires": [
            "series-cartesian",
            "series-fill-util"
        ]
    },
    "series-area-stacked": {
        "requires": [
            "series-stacked",
            "series-area"
        ]
    },
    "series-areaspline": {
        "requires": [
            "series-area",
            "series-curve-util"
        ]
    },
    "series-areaspline-stacked": {
        "requires": [
            "series-stacked",
            "series-areaspline"
        ]
    },
    "series-bar": {
        "requires": [
            "series-marker",
            "series-histogram-base"
        ]
    },
    "series-bar-stacked": {
        "requires": [
            "series-stacked",
            "series-bar"
        ]
    },
    "series-base": {
        "requires": [
            "graphics",
            "axis-base"
        ]
    },
    "series-candlestick": {
        "requires": [
            "series-range"
        ]
    },
    "series-cartesian": {
        "requires": [
            "series-base"
        ]
    },
    "series-column": {
        "requires": [
            "series-marker",
            "series-histogram-base"
        ]
    },
    "series-column-stacked": {
        "requires": [
            "series-stacked",
            "series-column"
        ]
    },
    "series-combo": {
        "requires": [
            "series-cartesian",
            "series-line-util",
            "series-plot-util",
            "series-fill-util"
        ]
    },
    "series-combo-stacked": {
        "requires": [
            "series-stacked",
            "series-combo"
        ]
    },
    "series-combospline": {
        "requires": [
            "series-combo",
            "series-curve-util"
        ]
    },
    "series-combospline-stacked": {
        "requires": [
            "series-combo-stacked",
            "series-curve-util"
        ]
    },
    "series-curve-util": {},
    "series-fill-util": {},
    "series-histogram-base": {
        "requires": [
            "series-cartesian",
            "series-plot-util"
        ]
    },
    "series-line": {
        "requires": [
            "series-cartesian",
            "series-line-util"
        ]
    },
    "series-line-stacked": {
        "requires": [
            "series-stacked",
            "series-line"
        ]
    },
    "series-line-util": {},
    "series-marker": {
        "requires": [
            "series-cartesian",
            "series-plot-util"
        ]
    },
    "series-marker-stacked": {
        "requires": [
            "series-stacked",
            "series-marker"
        ]
    },
    "series-ohlc": {
        "requires": [
            "series-range"
        ]
    },
    "series-pie": {
        "requires": [
            "series-base",
            "series-plot-util"
        ]
    },
    "series-plot-util": {},
    "series-range": {
        "requires": [
            "series-cartesian"
        ]
    },
    "series-spline": {
        "requires": [
            "series-line",
            "series-curve-util"
        ]
    },
    "series-spline-stacked": {
        "requires": [
            "series-stacked",
            "series-spline"
        ]
    },
    "series-stacked": {
        "requires": [
            "axis-stacked"
        ]
    },
    "shim-plugin": {
        "requires": [
            "node-style",
            "node-pluginhost"
        ]
    },
    "slider": {
        "use": [
            "slider-base",
            "slider-value-range",
            "clickable-rail",
            "range-slider"
        ]
    },
    "slider-base": {
        "requires": [
            "widget",
            "dd-constrain",
            "event-key"
        ],
        "skinnable": true
    },
    "slider-value-range": {
        "requires": [
            "slider-base"
        ]
    },
    "sortable": {
        "requires": [
            "dd-delegate",
            "dd-drop-plugin",
            "dd-proxy"
        ]
    },
    "sortable-scroll": {
        "requires": [
            "dd-scroll",
            "sortable"
        ]
    },
    "stylesheet": {
        "requires": [
            "yui-base"
        ]
    },
    "substitute": {
        "optional": [
            "dump"
        ],
        "requires": [
            "yui-base"
        ]
    },
    "swf": {
        "requires": [
            "event-custom",
            "node",
            "swfdetect",
            "escape"
        ]
    },
    "swfdetect": {
        "requires": [
            "yui-base"
        ]
    },
    "tabview": {
        "requires": [
            "widget",
            "widget-parent",
            "widget-child",
            "tabview-base",
            "node-pluginhost",
            "node-focusmanager"
        ],
        "skinnable": true
    },
    "tabview-base": {
        "requires": [
            "node-event-delegate",
            "classnamemanager"
        ]
    },
    "tabview-plugin": {
        "requires": [
            "tabview-base"
        ]
    },
    "template": {
        "use": [
            "template-base",
            "template-micro"
        ]
    },
    "template-base": {
        "requires": [
            "yui-base"
        ]
    },
    "template-micro": {
        "requires": [
            "escape"
        ]
    },
    "test": {
        "requires": [
            "event-simulate",
            "event-custom",
            "json-stringify"
        ]
    },
    "test-console": {
        "requires": [
            "console-filters",
            "test",
            "array-extras"
        ],
        "skinnable": true
    },
    "text": {
        "use": [
            "text-accentfold",
            "text-wordbreak"
        ]
    },
    "text-accentfold": {
        "requires": [
            "array-extras",
            "text-data-accentfold"
        ]
    },
    "text-data-accentfold": {
        "requires": [
            "yui-base"
        ]
    },
    "text-data-wordbreak": {
        "requires": [
            "yui-base"
        ]
    },
    "text-wordbreak": {
        "requires": [
            "array-extras",
            "text-data-wordbreak"
        ]
    },
    "timers": {
        "requires": [
            "yui-base"
        ]
    },
    "transition": {
        "requires": [
            "node-style"
        ]
    },
    "transition-timer": {
        "condition": {
            "name": "transition-timer",
            "test": function (Y) {
    var DOCUMENT = Y.config.doc,
        node = (DOCUMENT) ? DOCUMENT.documentElement: null,
        ret = true;

    if (node && node.style) {
        ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);
    }

    return ret;
},
            "trigger": "transition"
        },
        "requires": [
            "transition"
        ]
    },
    "tree": {
        "requires": [
            "base-build",
            "tree-node"
        ]
    },
    "tree-labelable": {
        "requires": [
            "tree"
        ]
    },
    "tree-lazy": {
        "requires": [
            "base-pluginhost",
            "plugin",
            "tree"
        ]
    },
    "tree-node": {},
    "tree-openable": {
        "requires": [
            "tree"
        ]
    },
    "tree-selectable": {
        "requires": [
            "tree"
        ]
    },
    "tree-sortable": {
        "requires": [
            "tree"
        ]
    },
    "uploader": {
        "requires": [
            "uploader-html5",
            "uploader-flash"
        ]
    },
    "uploader-flash": {
        "requires": [
            "swfdetect",
            "escape",
            "widget",
            "base",
            "cssbutton",
            "node",
            "event-custom",
            "uploader-queue"
        ]
    },
    "uploader-html5": {
        "requires": [
            "widget",
            "node-event-simulate",
            "file-html5",
            "uploader-queue"
        ]
    },
    "uploader-queue": {
        "requires": [
            "base"
        ]
    },
    "view": {
        "requires": [
            "base-build",
            "node-event-delegate"
        ]
    },
    "view-node-map": {
        "requires": [
            "view"
        ]
    },
    "widget": {
        "use": [
            "widget-base",
            "widget-htmlparser",
            "widget-skin",
            "widget-uievents"
        ]
    },
    "widget-anim": {
        "requires": [
            "anim-base",
            "plugin",
            "widget"
        ]
    },
    "widget-autohide": {
        "requires": [
            "base-build",
            "event-key",
            "event-outside",
            "widget"
        ]
    },
    "widget-base": {
        "requires": [
            "attribute",
            "base-base",
            "base-pluginhost",
            "classnamemanager",
            "event-focus",
            "node-base",
            "node-style"
        ],
        "skinnable": true
    },
    "widget-base-ie": {
        "condition": {
            "name": "widget-base-ie",
            "trigger": "widget-base",
            "ua": "ie"
        },
        "requires": [
            "widget-base"
        ]
    },
    "widget-buttons": {
        "requires": [
            "button-plugin",
            "cssbutton",
            "widget-stdmod"
        ]
    },
    "widget-child": {
        "requires": [
            "base-build",
            "widget"
        ]
    },
    "widget-htmlparser": {
        "requires": [
            "widget-base"
        ]
    },
    "widget-modality": {
        "requires": [
            "base-build",
            "event-outside",
            "widget"
        ],
        "skinnable": true
    },
    "widget-parent": {
        "requires": [
            "arraylist",
            "base-build",
            "widget"
        ]
    },
    "widget-position": {
        "requires": [
            "base-build",
            "node-screen",
            "widget"
        ]
    },
    "widget-position-align": {
        "requires": [
            "widget-position"
        ]
    },
    "widget-position-constrain": {
        "requires": [
            "widget-position"
        ]
    },
    "widget-skin": {
        "requires": [
            "widget-base"
        ]
    },
    "widget-stack": {
        "requires": [
            "base-build",
            "widget"
        ],
        "skinnable": true
    },
    "widget-stdmod": {
        "requires": [
            "base-build",
            "widget"
        ]
    },
    "widget-uievents": {
        "requires": [
            "node-event-delegate",
            "widget-base"
        ]
    },
    "yql": {
        "requires": [
            "oop"
        ]
    },
    "yql-jsonp": {
        "condition": {
            "name": "yql-jsonp",
            "test": function (Y) {
    /* Only load the JSONP module when not in nodejs or winjs
    TODO Make the winjs module a CORS module
    */
    return (!Y.UA.nodejs && !Y.UA.winjs);
},
            "trigger": "yql"
        },
        "requires": [
            "yql",
            "jsonp",
            "jsonp-url"
        ]
    },
    "yql-nodejs": {
        "condition": {
            "name": "yql-nodejs",
            "trigger": "yql",
            "ua": "nodejs"
        },
        "requires": [
            "yql"
        ]
    },
    "yql-winjs": {
        "condition": {
            "name": "yql-winjs",
            "trigger": "yql",
            "ua": "winjs"
        },
        "requires": [
            "yql"
        ]
    },
    "yui": {},
    "yui-base": {},
    "yui-later": {
        "requires": [
            "yui-base"
        ]
    },
    "yui-log": {
        "requires": [
            "yui-base"
        ]
    },
    "yui-throttle": {
        "requires": [
            "yui-base"
        ]
    }
});
YUI.Env[Y.version].md5 = '95eb05a1b097773b5af03e0680e7dda4';


}, 'patched-v3.18.1', {"requires": ["loader-base"]});
YUI.add('yui', function (Y, NAME) {}, 'patched-v3.18.1', {
    "use": [
        "yui-base",
        "get",
        "features",
        "intl-base",
        "yui-log",
        "yui-later",
        "loader-base",
        "loader-rollup",
        "loader-yui3"
    ]
});
YUI.add('aui-base-core', function (A, NAME) {

var Y = A;
YUI.Env.aliases = YUI.Env.aliases || {};
Y.mix(YUI.Env.aliases, {
    "aui-autosize": ["aui-autosize-iframe"],
    "aui-base": ["oop","yui-throttle","aui-classnamemanager","aui-debounce","aui-base-core","aui-base-lang","aui-node-base"],
    "aui-base-deprecated": ["aui-base","aui-node","aui-component","aui-delayed-task-deprecated","aui-selector","aui-event-base"],
    "aui-button": ["aui-button-core"],
    "aui-collection": ["aui-map","aui-set","aui-linkedset"],
    "aui-color-picker-deprecated": ["aui-color-picker-base-deprecated","aui-color-picker-grid-plugin-deprecated"],
    "aui-datasource-control-deprecated": ["aui-datasource-control-base-deprecated","aui-input-text-control-deprecated"],
    "aui-datatable": ["aui-datatable-edit","aui-datatable-highlight","aui-datatable-selection","aui-datatable-property-list"],
    "aui-datatable-edit": ["datatable-base","calendar","overlay","sortable","aui-datatype","aui-toolbar","aui-form-validator","aui-datatable-base-cell-editor","aui-datatable-base-options-cell-editor","aui-datatable-cell-editor-support","aui-datatable-core","aui-datatable-checkbox-cell-editor","aui-datatable-date-cell-editor","aui-datatable-dropdown-cell-editor","aui-datatable-radio-cell-editor","aui-datatable-text-cell-editor","aui-datatable-text-area-cell-editor"],
    "aui-datepicker-deprecated": ["aui-datepicker-base-deprecated","aui-datepicker-select-deprecated"],
    "aui-event": ["aui-event-base"],
    "aui-form-deprecated": ["aui-form-base-deprecated","aui-form-combobox-deprecated","aui-form-field-deprecated","aui-form-select-deprecated","aui-form-textarea-deprecated","aui-form-textfield-deprecated"],
    "aui-io": ["aui-io-request"],
    "aui-io-deprecated": ["aui-io-request","aui-io-plugin-deprecated"],
    "aui-node": ["aui-node-base"],
    "aui-overlay-deprecated": ["aui-overlay-base-deprecated","aui-overlay-context-deprecated","aui-overlay-context-panel-deprecated","aui-overlay-manager-deprecated","aui-overlay-mask-deprecated"],
    "aui-rating": ["aui-rating-base","aui-rating-thumb"],
    "aui-resize-deprecated": ["aui-resize-base-deprecated","aui-resize-constrain-deprecated"],
    "aui-scheduler": ["event-gestures","aui-scheduler-base","aui-scheduler-event-recorder","aui-scheduler-view-agenda","aui-scheduler-view-day","aui-scheduler-view-month","aui-scheduler-view-table-dd","aui-scheduler-view-table","aui-scheduler-view-week","aui-viewport"],
    "aui-search": ["aui-search-tst"],
    "aui-sortable": ["aui-sortable-layout","aui-sortable-list"],
    "aui-surface": ["aui-surface-app","aui-surface-screen"],
    "aui-toggler": ["aui-toggler-base","aui-toggler-delegate"],
    "aui-tooltip": ["aui-tooltip-base","aui-tooltip-delegate"],
    "aui-tpl-snippets-deprecated": ["aui-tpl-snippets-base-deprecated","aui-tpl-snippets-checkbox-deprecated","aui-tpl-snippets-input-deprecated","aui-tpl-snippets-select-deprecated","aui-tpl-snippets-textarea-deprecated"],
    "aui-tree": ["aui-tree-data","aui-tree-io","aui-tree-node","aui-tree-paginator","aui-tree-view"],
    "aui-widget": ["aui-widget-cssclass","aui-widget-toolbars"],
    "aui-widget-core": ["aui-widget-cssclass"]
});
/* This file is auto-generated by (yogi loader --yes --mix --js js/aui-loader.js --json js/aui-loader.json --start ../) */

/*jshint maxlen:900, eqeqeq: false */

/**
 * YUI 3 module metadata
 * @module loader
 * @submodule loader-yui3
 */
YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {};
Y.mix(YUI.Env[Y.version].modules, {
    "aui-ace-autocomplete-base": {
        "requires": [
            "aui-ace-editor"
        ]
    },
    "aui-ace-autocomplete-freemarker": {
        "requires": [
            "aui-ace-autocomplete-templateprocessor"
        ]
    },
    "aui-ace-autocomplete-list": {
        "requires": [
            "aui-ace-autocomplete-base",
            "overlay",
            "widget-autohide"
        ],
        "skinnable": true
    },
    "aui-ace-autocomplete-plugin": {
        "requires": [
            "aui-ace-autocomplete-list",
            "plugin"
        ]
    },
    "aui-ace-autocomplete-templateprocessor": {
        "requires": [
            "aui-ace-autocomplete-base"
        ]
    },
    "aui-ace-autocomplete-velocity": {
        "requires": [
            "aui-ace-autocomplete-templateprocessor"
        ]
    },
    "aui-ace-editor": {
        "requires": [
            "aui-node",
            "aui-component"
        ]
    },
    "aui-affix": {
        "requires": [
            "base",
            "node-screen",
            "aui-node"
        ]
    },
    "aui-alert": {
        "requires": [
            "aui-aria",
            "aui-classnamemanager",
            "aui-widget-cssclass",
            "aui-widget-transition",
            "timers",
            "widget",
            "widget-stdmod"
        ],
        "skinnable": true
    },
    "aui-aria": {
        "requires": [
            "plugin",
            "aui-component"
        ]
    },
    "aui-aria-table-sortable": {
        "requires": [
            "aui-aria"
        ]
    },
    "aui-arraysort": {
        "requires": [
            "arraysort"
        ]
    },
    "aui-audio": {
        "requires": [
            "aui-aria",
            "aui-node",
            "aui-component",
            "node-event-html5",
            "querystring-stringify-simple"
        ],
        "skinnable": true
    },
    "aui-autocomplete-deprecated": {
        "requires": [
            "aui-base-deprecated",
            "aui-overlay-base-deprecated",
            "datasource",
            "dataschema",
            "aui-form-combobox-deprecated"
        ],
        "skinnable": true
    },
    "aui-autosize": {
        "use": [
            "aui-autosize-iframe"
        ]
    },
    "aui-autosize-deprecated": {
        "requires": [
            "event-valuechange",
            "plugin",
            "aui-base-deprecated"
        ],
        "skinnable": true
    },
    "aui-autosize-iframe": {
        "requires": [
            "plugin",
            "aui-component",
            "aui-timer",
            "aui-node-base"
        ]
    },
    "aui-base": {
        "use": [
            "oop",
            "yui-throttle",
            "aui-classnamemanager",
            "aui-debounce",
            "aui-base-core",
            "aui-base-lang",
            "aui-node-base"
        ]
    },
    "aui-base-core": {},
    "aui-base-deprecated": {
        "use": [
            "aui-base",
            "aui-node",
            "aui-component",
            "aui-delayed-task-deprecated",
            "aui-selector",
            "aui-event-base"
        ]
    },
    "aui-base-html5-shiv": {
        "condition": {
            "name": "aui-base-html5-shiv",
            "trigger": "node-base",
            "ua": "ie"
        }
    },
    "aui-base-lang": {},
    "aui-boolean-data-editor": {
        "requires": [
            "aui-button-switch",
            "aui-data-editor"
        ]
    },
    "aui-button": {
        "use": [
            "aui-button-core"
        ]
    },
    "aui-button-core": {
        "requires": [
            "button",
            "button-group",
            "button-plugin",
            "aui-component",
            "aui-widget-cssclass",
            "aui-widget-toggle"
        ],
        "skinnable": true
    },
    "aui-button-item-deprecated": {
        "requires": [
            "aui-base-deprecated",
            "aui-state-interaction-deprecated",
            "widget-child"
        ],
        "skinnable": true
    },
    "aui-button-search-cancel": {
        "requires": [
            "array-invoke",
            "base",
            "base-build",
            "event-focus",
            "event-move",
            "event-resize",
            "node-screen",
            "node-event-delegate",
            "aui-node-base",
            "aui-classnamemanager",
            "aui-event-input"
        ]
    },
    "aui-button-switch": {
        "requires": [
            "aui-node-base",
            "base-build",
            "event-key",
            "transition",
            "widget"
        ],
        "skinnable": true
    },
    "aui-carousel": {
        "requires": [
            "anim",
            "aui-event",
            "aui-image-viewer-base",
            "aui-image-viewer-slideshow",
            "node-event-delegate",
            "node-focusmanager"
        ],
        "skinnable": true
    },
    "aui-carousel-mobile-touch": {
        "condition": {
            "name": "aui-carousel-mobile-touch",
            "test": function(A) {
    return A.UA.mobile && A.UA.touchEnabled;
},
            "trigger": "aui-carousel"
        },
        "requires": [
            "base-build",
            "aui-carousel"
        ]
    },
    "aui-carousel-swipe": {
        "condition": {
            "name": "aui-carousel-swipe",
            "trigger": "aui-carousel",
            "ua": "touchEnabled"
        },
        "requires": [
            "aui-carousel",
            "aui-widget-swipe",
            "base-build"
        ],
        "skinnable": true
    },
    "aui-char-counter": {
        "requires": [
            "aui-aria",
            "aui-node",
            "aui-event-input",
            "aui-component"
        ]
    },
    "aui-chart-deprecated": {
        "requires": [
            "datasource",
            "json",
            "aui-swf-deprecated"
        ]
    },
    "aui-classnamemanager": {
        "requires": [
            "classnamemanager"
        ]
    },
    "aui-collection": {
        "use": [
            "aui-map",
            "aui-set",
            "aui-linkedset"
        ]
    },
    "aui-color-palette": {
        "requires": [
            "array-extras",
            "aui-palette",
            "color-base",
            "node-core",
            "aui-widget-cssclass",
            "aui-widget-toggle"
        ],
        "skinnable": true
    },
    "aui-color-picker-base": {
        "requires": [
            "aui-color-palette",
            "aui-hsva-palette-modal",
            "event-outside"
        ],
        "skinnable": true
    },
    "aui-color-picker-base-deprecated": {
        "requires": [
            "dd-drag",
            "panel",
            "slider",
            "aui-button-item-deprecated",
            "aui-color-util-deprecated",
            "aui-form-base-deprecated",
            "aui-overlay-context-deprecated"
        ],
        "skinnable": true
    },
    "aui-color-picker-deprecated": {
        "use": [
            "aui-color-picker-base-deprecated",
            "aui-color-picker-grid-plugin-deprecated"
        ]
    },
    "aui-color-picker-grid-plugin-deprecated": {
        "requires": [
            "plugin",
            "aui-color-picker-base-deprecated"
        ],
        "skinnable": true
    },
    "aui-color-picker-popover": {
        "requires": [
            "aui-color-picker-base",
            "aui-popover",
            "aui-widget-cssclass",
            "aui-widget-toggle"
        ],
        "skinnable": true
    },
    "aui-color-util-deprecated": {
        "requires": []
    },
    "aui-component": {
        "requires": [
            "aui-classnamemanager",
            "aui-widget-cssclass",
            "aui-widget-toggle",
            "base-build",
            "widget-base"
        ]
    },
    "aui-css": {
        "type": "css"
    },
    "aui-data-editor": {
        "requires": [
            "aui-classnamemanager",
            "base-build",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-data-set-deprecated": {
        "requires": [
            "oop",
            "collection",
            "base"
        ]
    },
    "aui-datasource-control-base-deprecated": {
        "requires": [
            "datasource",
            "dataschema",
            "aui-base-deprecated"
        ]
    },
    "aui-datasource-control-deprecated": {
        "use": [
            "aui-datasource-control-base-deprecated",
            "aui-input-text-control-deprecated"
        ]
    },
    "aui-datatable": {
        "use": [
            "aui-datatable-edit",
            "aui-datatable-highlight",
            "aui-datatable-selection",
            "aui-datatable-property-list"
        ]
    },
    "aui-datatable-base-cell-editor": {
        "requires": [
            "datatable-base",
            "overlay"
        ],
        "skinnable": true
    },
    "aui-datatable-base-options-cell-editor": {
        "requires": [
            "aui-datatable-base-cell-editor",
            "escape"
        ],
        "skinnable": true
    },
    "aui-datatable-body": {
        "requires": [
            "aui-classnamemanager",
            "datatable-base",
            "event-key",
            "aui-event-base"
        ]
    },
    "aui-datatable-cell-editor-support": {
        "requires": [
            "datatable-base"
        ]
    },
    "aui-datatable-checkbox-cell-editor": {
        "requires": [
            "aui-datatable-base-options-cell-editor"
        ]
    },
    "aui-datatable-core": {
        "requires": [
            "aui-datatable-body",
            "datatable-base",
            "event-key",
            "aui-event-base"
        ],
        "skinnable": true
    },
    "aui-datatable-date-cell-editor": {
        "requires": [
            "aui-datatable-base-options-cell-editor"
        ]
    },
    "aui-datatable-dropdown-cell-editor": {
        "requires": [
            "aui-datatable-base-options-cell-editor"
        ]
    },
    "aui-datatable-edit": {
        "use": [
            "datatable-base",
            "calendar",
            "overlay",
            "sortable",
            "aui-datatype",
            "aui-toolbar",
            "aui-form-validator",
            "aui-datatable-base-cell-editor",
            "aui-datatable-base-options-cell-editor",
            "aui-datatable-cell-editor-support",
            "aui-datatable-core",
            "aui-datatable-checkbox-cell-editor",
            "aui-datatable-date-cell-editor",
            "aui-datatable-dropdown-cell-editor",
            "aui-datatable-radio-cell-editor",
            "aui-datatable-text-cell-editor",
            "aui-datatable-text-area-cell-editor"
        ]
    },
    "aui-datatable-highlight": {
        "requires": [
            "aui-datatable-selection"
        ],
        "skinnable": true
    },
    "aui-datatable-property-list": {
        "requires": [
            "datatable-scroll",
            "datatable-sort",
            "aui-datatable-core",
            "aui-datatable-edit",
            "aui-datatable-highlight",
            "aui-datatable-selection",
            "aui-widget-cssclass",
            "aui-widget-toggle"
        ],
        "skinnable": true
    },
    "aui-datatable-radio-cell-editor": {
        "requires": [
            "aui-datatable-base-options-cell-editor"
        ]
    },
    "aui-datatable-selection": {
        "requires": [
            "aui-datatable-core"
        ],
        "skinnable": true
    },
    "aui-datatable-text-area-cell-editor": {
        "requires": [
            "aui-datatable-base-options-cell-editor"
        ]
    },
    "aui-datatable-text-cell-editor": {
        "requires": [
            "aui-datatable-base-options-cell-editor"
        ]
    },
    "aui-datatype": {
        "requires": [
            "datatype",
            "aui-datatype-date-parse"
        ]
    },
    "aui-datatype-date-parse": {
        "requires": [
            "aui-base-lang",
            "datatype-date-format",
            "datatype-date-parse",
            "intl"
        ]
    },
    "aui-datepicker": {
        "requires": [
            "aui-aria",
            "aui-datepicker-delegate",
            "aui-datepicker-popover",
            "base",
            "base-build",
            "calendar"
        ],
        "skinnable": true
    },
    "aui-datepicker-base-deprecated": {
        "requires": [
            "calendar",
            "aui-datatype",
            "aui-overlay-context-deprecated"
        ],
        "skinnable": true
    },
    "aui-datepicker-delegate": {
        "requires": [
            "aui-datatype-date-parse",
            "aui-event-input",
            "event-focus",
            "node-event-delegate"
        ]
    },
    "aui-datepicker-deprecated": {
        "skinnable": true,
        "use": [
            "aui-datepicker-base-deprecated",
            "aui-datepicker-select-deprecated"
        ]
    },
    "aui-datepicker-native": {
        "requires": [
            "aui-datepicker-delegate",
            "aui-node-base",
            "base",
            "base-build"
        ]
    },
    "aui-datepicker-popover": {
        "requires": [
            "aui-classnamemanager",
            "aui-popover"
        ]
    },
    "aui-datepicker-select-deprecated": {
        "requires": [
            "aui-datepicker-base-deprecated",
            "aui-button-item-deprecated"
        ],
        "skinnable": true
    },
    "aui-debounce": {},
    "aui-delayed-task-deprecated": {
        "requires": [
            "yui-base"
        ]
    },
    "aui-diagram-builder": {
        "requires": [
            "aui-aria",
            "aui-map",
            "aui-property-builder",
            "aui-diagram-builder-connector",
            "aui-property-builder-settings",
            "aui-diagram-node-condition",
            "aui-diagram-node-end",
            "aui-diagram-node-fork",
            "aui-diagram-node-join",
            "aui-diagram-node-start",
            "aui-diagram-node-state",
            "aui-diagram-node-task",
            "overlay"
        ],
        "skinnable": true
    },
    "aui-diagram-builder-connector": {
        "requires": [
            "arraylist-add",
            "arraylist-filter",
            "escape",
            "json",
            "graphics",
            "dd"
        ],
        "skinnable": true
    },
    "aui-diagram-node": {
        "requires": [
            "aui-aria",
            "aui-diagram-node-manager-base",
            "escape",
            "overlay"
        ]
    },
    "aui-diagram-node-condition": {
        "requires": [
            "aui-diagram-node-state"
        ]
    },
    "aui-diagram-node-end": {
        "requires": [
            "aui-diagram-node-state"
        ]
    },
    "aui-diagram-node-fork": {
        "requires": [
            "aui-diagram-node-state"
        ]
    },
    "aui-diagram-node-join": {
        "requires": [
            "aui-diagram-node-state"
        ]
    },
    "aui-diagram-node-manager-base": {
        "requires": [
            "base"
        ]
    },
    "aui-diagram-node-start": {
        "requires": [
            "aui-diagram-node-state"
        ]
    },
    "aui-diagram-node-state": {
        "requires": [
            "aui-diagram-node"
        ]
    },
    "aui-diagram-node-task": {
        "requires": [
            "aui-diagram-node-state"
        ]
    },
    "aui-dialog-iframe-deprecated": {
        "requires": [
            "plugin",
            "array-invoke",
            "aui-base-deprecated",
            "aui-loading-mask-deprecated"
        ],
        "skinnable": true
    },
    "aui-dropdown": {
        "requires": [
            "event-delegate",
            "event-key",
            "event-outside",
            "node-focusmanager",
            "widget",
            "widget-stack",
            "aui-classnamemanager",
            "aui-node",
            "aui-widget-cssclass",
            "aui-widget-toggle",
            "aui-widget-trigger"
        ],
        "skinnable": true
    },
    "aui-editable-deprecated": {
        "requires": [
            "aui-base-deprecated",
            "aui-form-combobox-deprecated",
            "escape",
            "event-resize"
        ],
        "skinnable": true
    },
    "aui-event": {
        "use": [
            "aui-event-base"
        ]
    },
    "aui-event-base": {
        "requires": [
            "event-base"
        ]
    },
    "aui-event-delegate-change": {
        "condition": {
            "name": "aui-event-delegate-change",
            "trigger": "event-base-ie",
            "ua": "ie"
        },
        "requires": [
            "aui-event-base",
            "event-delegate",
            "event-synthetic"
        ]
    },
    "aui-event-delegate-submit": {
        "condition": {
            "name": "aui-event-delegate-submit",
            "trigger": "event-base-ie",
            "ua": "ie"
        },
        "requires": [
            "aui-event-base",
            "event-delegate",
            "event-synthetic"
        ]
    },
    "aui-event-input": {
        "condition": {
            "name": "aui-event-input",
            "test": function(A) {
    var supportsDOMEvent = A.supportsDOMEvent,
        testFeature = A.Features.test,
        addFeature = A.Features.add;

    if (testFeature('event', 'input') === undefined) {
        addFeature('event', 'input', {
            test: function() {
                return supportsDOMEvent(document.createElement('textarea'), 'input') && (!A.UA.ie || A.UA.ie > 9);
            }
        });
    }

    return !testFeature('event', 'input');
},
            "trigger": "aui-event-base"
        },
        "requires": [
            "aui-event-base",
            "event-delegate",
            "event-synthetic",
            "timers"
        ]
    },
    "aui-form-base-deprecated": {
        "requires": [
            "io-form",
            "querystring-parse",
            "aui-base-deprecated",
            "aui-data-set-deprecated",
            "aui-form-field-deprecated"
        ]
    },
    "aui-form-builder": {
        "requires": [
            "aui-modal",
            "aui-layout",
            "aui-form-builder-field-list",
            "aui-form-builder-field-toolbar",
            "aui-form-builder-field-type",
            "aui-form-builder-field-types",
            "aui-form-builder-layout-builder",
            "aui-form-builder-page-manager",
            "aui-form-builder-settings-modal",
            "event-focus",
            "event-tap"
        ],
        "skinnable": true
    },
    "aui-form-builder-available-field-deprecated": {
        "requires": [
            "aui-property-builder-available-field"
        ]
    },
    "aui-form-builder-deprecated": {
        "requires": [
            "aui-button",
            "aui-collection",
            "aui-form-builder-available-field-deprecated",
            "aui-form-builder-field-deprecated",
            "aui-form-builder-field-button-deprecated",
            "aui-form-builder-field-checkbox-deprecated",
            "aui-form-builder-field-fieldset-deprecated",
            "aui-form-builder-field-file-upload-deprecated",
            "aui-form-builder-field-multiple-choice-deprecated",
            "aui-form-builder-field-radio-deprecated",
            "aui-form-builder-field-select-deprecated",
            "aui-form-builder-field-text-deprecated",
            "aui-form-builder-field-textarea-deprecated",
            "aui-property-builder",
            "aui-property-builder-settings",
            "aui-sortable-list",
            "aui-tabview",
            "aui-tooltip-base",
            "escape",
            "transition"
        ],
        "skinnable": true
    },
    "aui-form-builder-field-base": {
        "requires": [
            "aui-classnamemanager",
            "aui-node-base",
            "aui-text-data-editor",
            "aui-toggler",
            "base",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-form-builder-field-button-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-checkbox-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-choice": {
        "requires": [
            "aui-boolean-data-editor",
            "aui-options-data-editor",
            "aui-tabs-data-editor",
            "aui-form-builder-field-base",
            "aui-form-field-choice"
        ]
    },
    "aui-form-builder-field-deprecated": {
        "requires": [
            "panel",
            "aui-datatype",
            "aui-datatable-edit",
            "aui-property-builder-field-support"
        ],
        "skinnable": true
    },
    "aui-form-builder-field-fieldset-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-file-upload-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-list": {
        "requires": [
            "aui-form-builder-field-type",
            "aui-form-builder-field-types",
            "aui-form-builder-layout-builder"
        ],
        "skinnable": true
    },
    "aui-form-builder-field-multiple-choice-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-radio-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-select-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-sentence": {
        "requires": [
            "aui-form-builder-field-base",
            "aui-form-field"
        ]
    },
    "aui-form-builder-field-text": {
        "requires": [
            "aui-boolean-data-editor",
            "aui-radio-group-data-editor",
            "aui-form-builder-field-base",
            "aui-form-field-text"
        ]
    },
    "aui-form-builder-field-text-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-textarea-deprecated": {
        "requires": [
            "aui-form-builder-field-deprecated"
        ]
    },
    "aui-form-builder-field-toolbar": {
        "requires": [
            "aui-classnamemanager",
            "base",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-form-builder-field-type": {
        "requires": [
            "base",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-form-builder-field-types": {
        "requires": [
            "aui-classnamemanager",
            "aui-form-builder-field-types-modal",
            "base",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-form-builder-field-types-modal": {
        "requires": [
            "aui-modal"
        ],
        "skinnable": true
    },
    "aui-form-builder-layout-builder": {
        "requires": [
            "aui-classnamemanager",
            "aui-layout-builder",
            "aui-modal",
            "base",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-form-builder-page-manager": {
        "requires": [
            "aui-pagination",
            "aui-popover",
            "aui-tabview",
            "base",
            "event-valuechange",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-form-builder-settings-modal": {
        "requires": [
            "aui-classnamemanager",
            "aui-modal",
            "base",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-form-combobox-deprecated": {
        "requires": [
            "aui-form-textarea-deprecated",
            "aui-toolbar"
        ],
        "skinnable": true
    },
    "aui-form-deprecated": {
        "use": [
            "aui-form-base-deprecated",
            "aui-form-combobox-deprecated",
            "aui-form-field-deprecated",
            "aui-form-select-deprecated",
            "aui-form-textarea-deprecated",
            "aui-form-textfield-deprecated"
        ]
    },
    "aui-form-field": {
        "requires": [
            "aui-classnamemanager",
            "aui-node-base",
            "base-build"
        ],
        "skinnable": true
    },
    "aui-form-field-choice": {
        "requires": [
            "aui-form-field-required"
        ],
        "skinnable": true
    },
    "aui-form-field-deprecated": {
        "requires": [
            "aui-base-deprecated",
            "aui-component"
        ]
    },
    "aui-form-field-required": {
        "requires": [
            "aui-form-field"
        ]
    },
    "aui-form-field-text": {
        "requires": [
            "aui-form-field-required"
        ],
        "skinnable": true
    },
    "aui-form-select-deprecated": {
        "requires": [
            "aui-form-field-deprecated"
        ]
    },
    "aui-form-textarea-deprecated": {
        "requires": [
            "node-pluginhost",
            "aui-autosize-deprecated",
            "aui-form-textfield-deprecated"
        ]
    },
    "aui-form-textfield-deprecated": {
        "requires": [
            "aui-form-field-deprecated"
        ]
    },
    "aui-form-validator": {
        "requires": [
            "escape",
            "selector-css3",
            "node-event-delegate",
            "aui-node",
            "aui-component",
            "aui-event-input"
        ]
    },
    "aui-hsv-palette": {
        "requires": [
            "aui-classnamemanager",
            "aui-widget-cssclass",
            "aui-widget-toggle",
            "aui-event-input",
            "base-build",
            "clickable-rail",
            "color-hsv",
            "dd-constrain",
            "slider",
            "widget"
        ],
        "skinnable": true
    },
    "aui-hsva-palette": {
        "requires": [
            "aui-hsv-palette"
        ],
        "skinnable": true
    },
    "aui-hsva-palette-modal": {
        "requires": [
            "aui-hsva-palette",
            "aui-modal"
        ],
        "skinnable": true
    },
    "aui-image-cropper": {
        "requires": [
            "resize-base",
            "resize-constrain",
            "dd-constrain",
            "aui-node-base",
            "aui-component"
        ],
        "skinnable": true
    },
    "aui-image-viewer": {
        "requires": [
            "widget",
            "widget-modality",
            "widget-position",
            "widget-position-align",
            "widget-position-constrain",
            "widget-stack",
            "widget-stdmod",
            "aui-event",
            "aui-image-viewer-base",
            "aui-image-viewer-multiple",
            "aui-image-viewer-slideshow",
            "aui-node-base",
            "aui-widget-cssclass",
            "aui-widget-toggle"
        ],
        "skinnable": true
    },
    "aui-image-viewer-base": {
        "requires": [
            "anim",
            "aui-aria",
            "aui-classnamemanager",
            "aui-node",
            "aui-widget-responsive",
            "base-build",
            "imageloader",
            "node-base",
            "widget",
            "widget-stack"
        ],
        "skinnable": true
    },
    "aui-image-viewer-media": {
        "requires": [
            "plugin",
            "aui-component",
            "aui-image-viewer"
        ]
    },
    "aui-image-viewer-multiple": {
        "requires": [
            "base-build",
            "node-base",
            "aui-classnamemanager",
            "aui-image-viewer-base"
        ],
        "skinnable": true
    },
    "aui-image-viewer-multiple-swipe": {
        "condition": {
            "name": "aui-image-viewer-multiple-swipe",
            "trigger": "aui-image-viewer-multiple",
            "ua": "touchEnabled"
        },
        "requires": [
            "aui-image-viewer-multiple",
            "aui-image-viewer-swipe"
        ]
    },
    "aui-image-viewer-slideshow": {
        "requires": [
            "node",
            "aui-classnamemanager"
        ]
    },
    "aui-image-viewer-swipe": {
        "condition": {
            "name": "aui-image-viewer-swipe",
            "trigger": "aui-image-viewer-base",
            "ua": "touchEnabled"
        },
        "requires": [
            "event-resize",
            "aui-image-viewer-base",
            "aui-widget-swipe"
        ]
    },
    "aui-input-text-control-deprecated": {
        "requires": [
            "aui-base-deprecated",
            "aui-datasource-control-base-deprecated",
            "aui-form-combobox-deprecated"
        ]
    },
    "aui-io": {
        "use": [
            "aui-io-request"
        ]
    },
    "aui-io-deprecated": {
        "use": [
            "aui-io-request",
            "aui-io-plugin-deprecated"
        ]
    },
    "aui-io-plugin-deprecated": {
        "requires": [
            "aui-overlay-base-deprecated",
            "aui-parse-content",
            "aui-io-request",
            "aui-loading-mask-deprecated"
        ]
    },
    "aui-io-request": {
        "requires": [
            "io-base",
            "json",
            "plugin",
            "querystring-stringify",
            "aui-component"
        ]
    },
    "aui-io-request-deprecated": {
        "requires": [
            "io-base",
            "json",
            "plugin",
            "querystring-stringify",
            "aui-base-deprecated"
        ]
    },
    "aui-layout": {
        "requires": [
            "aui-layout-col",
            "aui-layout-row",
            "aui-node-base",
            "base-build",
            "datatype-number-parse",
            "event-resize"
        ]
    },
    "aui-layout-builder": {
        "requires": [
            "aui-classnamemanager",
            "aui-layout",
            "aui-layout-builder-add-col",
            "aui-layout-builder-add-row",
            "aui-layout-builder-move",
            "aui-layout-builder-remove-row",
            "aui-layout-builder-resize-col",
            "aui-node-base",
            "base-build",
            "node-event-delegate",
            "node-screen",
            "node-style"
        ]
    },
    "aui-layout-builder-add-col": {
        "requires": [
            "event-key",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-layout-builder-add-row": {
        "requires": [
            "aui-node-base",
            "base-build",
            "node-scroll-info"
        ],
        "skinnable": true
    },
    "aui-layout-builder-move": {
        "requires": [
            "aui-node-base",
            "base-build"
        ],
        "skinnable": true
    },
    "aui-layout-builder-remove-row": {
        "requires": [
            "aui-node-base",
            "base-build"
        ],
        "skinnable": true
    },
    "aui-layout-builder-resize-col": {
        "requires": [
            "dd-constrain",
            "dd-delegate",
            "dd-drop-plugin",
            "dd-proxy",
            "event-mouseenter",
            "node-base"
        ],
        "skinnable": true
    },
    "aui-layout-col": {
        "requires": [
            "aui-classnamemanager",
            "aui-node-base",
            "base-build"
        ],
        "skinnable": true
    },
    "aui-layout-row": {
        "requires": [
            "array-invoke",
            "aui-node-base",
            "base-build"
        ],
        "skinnable": true
    },
    "aui-linkedset": {
        "requires": [
            "aui-set"
        ]
    },
    "aui-live-search-deprecated": {
        "requires": [
            "aui-base-deprecated"
        ]
    },
    "aui-loading-mask-deprecated": {
        "requires": [
            "plugin",
            "aui-overlay-mask-deprecated"
        ],
        "skinnable": true
    },
    "aui-map": {
        "requires": [
            "base-build"
        ]
    },
    "aui-menu": {
        "requires": [
            "base-build",
            "event-mouseenter",
            "event-resize",
            "widget",
            "widget-position",
            "widget-position-align",
            "widget-position-constrain",
            "widget-stack",
            "aui-classnamemanager",
            "aui-debounce",
            "aui-dropdown",
            "aui-menu-item"
        ],
        "skinnable": true
    },
    "aui-menu-item": {
        "requires": [
            "base-build",
            "node-base",
            "aui-classnamemanager",
            "aui-node",
            "aui-widget-shortcut"
        ]
    },
    "aui-messaging": {
        "requires": [
            "querystring",
            "aui-timer"
        ]
    },
    "aui-modal": {
        "requires": [
            "widget",
            "widget-autohide",
            "widget-buttons",
            "widget-modality",
            "widget-position",
            "widget-position-align",
            "widget-position-constrain",
            "widget-stack",
            "widget-stdmod",
            "dd-plugin",
            "dd-constrain",
            "timers",
            "aui-classnamemanager",
            "aui-widget-cssclass",
            "aui-widget-toggle",
            "aui-widget-toolbars"
        ],
        "skinnable": true
    },
    "aui-modal-resize": {
        "condition": {
            "name": "aui-modal-resize",
            "test": function(A) {
    return !A.UA.mobile;
},
            "trigger": "aui-modal"
        },
        "requires": [
            "aui-modal",
            "resize-plugin"
        ]
    },
    "aui-node": {
        "use": [
            "aui-node-base"
        ]
    },
    "aui-node-accessible": {
        "requires": [
            "aui-node-base",
            "event-custom-base"
        ]
    },
    "aui-node-base": {
        "requires": [
            "array-extras",
            "aui-base-lang",
            "aui-classnamemanager",
            "aui-debounce",
            "node"
        ]
    },
    "aui-node-html5": {
        "condition": {
            "name": "aui-node-html5",
            "trigger": "aui-node",
            "ua": "ie"
        },
        "requires": [
            "collection",
            "aui-node-base"
        ]
    },
    "aui-options-data-editor": {
        "requires": [
            "aui-data-editor",
            "dd-constrain",
            "dd-delegate",
            "dd-drop-plugin",
            "dd-proxy",
            "event-valuechange",
            "node-event-delegate"
        ],
        "skinnable": true
    },
    "aui-overlay-base-deprecated": {
        "requires": [
            "widget-position",
            "widget-stack",
            "widget-position-align",
            "widget-position-constrain",
            "widget-stdmod",
            "aui-component"
        ]
    },
    "aui-overlay-context-deprecated": {
        "requires": [
            "aui-overlay-manager-deprecated",
            "aui-delayed-task-deprecated",
            "aui-aria"
        ]
    },
    "aui-overlay-context-panel-deprecated": {
        "requires": [
            "anim",
            "aui-overlay-context-deprecated"
        ],
        "skinnable": true
    },
    "aui-overlay-deprecated": {
        "use": [
            "aui-overlay-base-deprecated",
            "aui-overlay-context-deprecated",
            "aui-overlay-context-panel-deprecated",
            "aui-overlay-manager-deprecated",
            "aui-overlay-mask-deprecated"
        ]
    },
    "aui-overlay-manager-deprecated": {
        "requires": [
            "overlay",
            "plugin",
            "aui-base-deprecated",
            "aui-overlay-base-deprecated"
        ]
    },
    "aui-overlay-mask-deprecated": {
        "requires": [
            "event-resize",
            "aui-base-deprecated",
            "aui-overlay-base-deprecated"
        ],
        "skinnable": true
    },
    "aui-pagination": {
        "requires": [
            "node-event-delegate",
            "aui-node",
            "aui-component",
            "widget-htmlparser"
        ],
        "skinnable": true
    },
    "aui-palette": {
        "requires": [
            "base-build",
            "event-hover",
            "widget",
            "aui-classnamemanager",
            "aui-base",
            "aui-widget-cssclass",
            "aui-widget-toggle"
        ],
        "skinnable": true
    },
    "aui-parse-content": {
        "requires": [
            "async-queue",
            "plugin",
            "io-base",
            "aui-component",
            "aui-node-base"
        ]
    },
    "aui-popover": {
        "requires": [
            "event-resize",
            "widget",
            "widget-autohide",
            "widget-buttons",
            "widget-modality",
            "widget-position",
            "widget-position-align",
            "widget-position-constrain",
            "widget-stack",
            "widget-stdmod",
            "aui-classnamemanager",
            "aui-widget-cssclass",
            "aui-widget-toggle",
            "aui-widget-toolbars",
            "aui-widget-transition",
            "aui-widget-trigger",
            "aui-widget-position-align-suggestion",
            "aui-component",
            "aui-node-base"
        ],
        "skinnable": true
    },
    "aui-progressbar": {
        "requires": [
            "aui-node",
            "aui-component",
            "aui-aria"
        ],
        "skinnable": true
    },
    "aui-promise": {
        "requires": [
            "array-invoke",
            "promise",
            "oop"
        ]
    },
    "aui-property-builder": {
        "requires": [
            "dd",
            "collection",
            "aui-property-builder-available-field",
            "aui-property-builder-field-support",
            "aui-property-builder-settings",
            "aui-tabview"
        ],
        "skinnable": true
    },
    "aui-property-builder-available-field": {
        "requires": [
            "base",
            "aui-component",
            "aui-node"
        ]
    },
    "aui-property-builder-field-support": {},
    "aui-property-builder-settings": {
        "requires": [
            "aui-tabview",
            "aui-datatable-property-list"
        ]
    },
    "aui-radio-group-data-editor": {
        "requires": [
            "aui-data-editor",
            "node-event-delegate"
        ],
        "skinnable": true
    },
    "aui-rating": {
        "use": [
            "aui-rating-base",
            "aui-rating-thumb"
        ]
    },
    "aui-rating-base": {
        "requires": [
            "aui-component",
            "aui-node-base",
            "widget-htmlparser",
            "widget-uievents"
        ],
        "skinnable": true
    },
    "aui-rating-thumb": {
        "requires": [
            "aui-rating-base"
        ]
    },
    "aui-resize-base-deprecated": {
        "requires": [
            "dd-drag",
            "dd-delegate",
            "dd-drop",
            "aui-base-deprecated"
        ],
        "skinnable": true
    },
    "aui-resize-constrain-deprecated": {
        "requires": [
            "dd-constrain",
            "plugin",
            "aui-resize-base-deprecated"
        ]
    },
    "aui-resize-deprecated": {
        "skinnable": true,
        "use": [
            "aui-resize-base-deprecated",
            "aui-resize-constrain-deprecated"
        ]
    },
    "aui-scale-data-editor": {
        "requires": [
            "aui-classnamemanager",
            "aui-data-editor",
            "event-valuechange"
        ]
    },
    "aui-scheduler": {
        "use": [
            "event-gestures",
            "aui-scheduler-base",
            "aui-scheduler-event-recorder",
            "aui-scheduler-view-agenda",
            "aui-scheduler-view-day",
            "aui-scheduler-view-month",
            "aui-scheduler-view-table-dd",
            "aui-scheduler-view-table",
            "aui-scheduler-view-week",
            "aui-viewport"
        ]
    },
    "aui-scheduler-base": {
        "requires": [
            "model",
            "model-list",
            "widget-stdmod",
            "color-hsl",
            "aui-event-base",
            "aui-node-base",
            "aui-component",
            "aui-datatype",
            "aui-button",
            "node-focusmanager"
        ],
        "skinnable": true
    },
    "aui-scheduler-event-recorder": {
        "requires": [
            "querystring",
            "io-form",
            "overlay",
            "aui-scheduler-base",
            "aui-popover"
        ],
        "skinnable": true
    },
    "aui-scheduler-touch": {
        "condition": {
            "name": "aui-scheduler-touch",
            "trigger": "aui-scheduler",
            "ua": "touchEnabled"
        },
        "requires": [
            "base-build",
            "aui-scheduler"
        ],
        "skinnable": true
    },
    "aui-scheduler-view-agenda": {
        "requires": [
            "aui-scheduler-base"
        ],
        "skinnable": true
    },
    "aui-scheduler-view-day": {
        "requires": [
            "dd-drag",
            "dd-delegate",
            "dd-drop",
            "dd-constrain",
            "aui-scheduler-view-table"
        ],
        "skinnable": true
    },
    "aui-scheduler-view-month": {
        "requires": [
            "aui-scheduler-view-table"
        ],
        "skinnable": true
    },
    "aui-scheduler-view-table": {
        "requires": [
            "overlay",
            "aui-scheduler-base"
        ],
        "skinnable": true
    },
    "aui-scheduler-view-table-dd": {
        "requires": [
            "dd-drag",
            "dd-delegate",
            "dd-drop",
            "aui-scheduler-view-table"
        ]
    },
    "aui-scheduler-view-week": {
        "requires": [
            "aui-scheduler-view-day"
        ],
        "skinnable": true
    },
    "aui-scroller-deprecated": {
        "requires": [
            "event-mouseenter",
            "aui-base-deprecated",
            "aui-simple-anim-deprecated"
        ],
        "skinnable": true
    },
    "aui-scrollspy": {
        "requires": [
            "base-build",
            "node-screen",
            "aui-classnamemanager"
        ]
    },
    "aui-search": {
        "use": [
            "aui-search-tst"
        ]
    },
    "aui-search-tst": {
        "requires": [
            "aui-component"
        ]
    },
    "aui-selector": {
        "requires": [
            "selector-css3",
            "aui-classnamemanager"
        ]
    },
    "aui-set": {
        "requires": [
            "aui-map"
        ]
    },
    "aui-simple-anim-deprecated": {
        "requires": [
            "aui-base-deprecated"
        ]
    },
    "aui-skin-deprecated": {
        "type": "css"
    },
    "aui-sortable": {
        "use": [
            "aui-sortable-layout",
            "aui-sortable-list"
        ]
    },
    "aui-sortable-layout": {
        "requires": [
            "dd-delegate",
            "dd-drag",
            "dd-drop",
            "dd-proxy",
            "aui-node",
            "aui-component"
        ],
        "skinnable": true
    },
    "aui-sortable-list": {
        "requires": [
            "dd-drag",
            "dd-drop",
            "dd-proxy",
            "dd-scroll",
            "aui-node",
            "aui-component"
        ]
    },
    "aui-state-interaction-deprecated": {
        "requires": [
            "aui-base-deprecated",
            "plugin"
        ]
    },
    "aui-surface": {
        "use": [
            "aui-surface-app",
            "aui-surface-screen"
        ]
    },
    "aui-surface-app": {
        "requires": [
            "event-delegate",
            "node-event-html5",
            "aui-surface-base",
            "aui-surface-screen",
            "aui-surface-screen-route"
        ]
    },
    "aui-surface-base": {
        "requires": [
            "base-build",
            "node-style",
            "timers",
            "aui-debounce",
            "aui-promise",
            "aui-parse-content"
        ]
    },
    "aui-surface-screen": {
        "requires": [
            "base-build"
        ]
    },
    "aui-surface-screen-html": {
        "requires": [
            "aui-base",
            "aui-io-request",
            "aui-promise",
            "aui-surface-screen",
            "aui-url"
        ]
    },
    "aui-surface-screen-route": {
        "requires": [
            "base-build"
        ]
    },
    "aui-swf-deprecated": {
        "requires": [
            "querystring-parse-simple",
            "querystring-stringify-simple",
            "aui-base-deprecated"
        ]
    },
    "aui-tabs-data-editor": {
        "requires": [
            "aui-data-editor",
            "aui-tabview"
        ]
    },
    "aui-tabview": {
        "requires": [
            "selector-css3",
            "tabview",
            "aui-component",
            "aui-widget-css"
        ],
        "skinnable": true
    },
    "aui-template-deprecated": {
        "requires": [
            "aui-base-deprecated"
        ]
    },
    "aui-text-data-editor": {
        "requires": [
            "aui-data-editor",
            "event-valuechange"
        ],
        "skinnable": true
    },
    "aui-text-data-unicode": {
        "requires": [
            "text"
        ]
    },
    "aui-text-unicode": {
        "requires": [
            "aui-text-data-unicode"
        ]
    },
    "aui-textboxlist-deprecated": {
        "requires": [
            "anim-node-plugin",
            "aui-autocomplete-deprecated",
            "aui-button-item-deprecated",
            "aui-data-set-deprecated",
            "escape",
            "node-focusmanager"
        ],
        "skinnable": true
    },
    "aui-timepicker": {
        "requires": [
            "autocomplete",
            "aui-datepicker-delegate",
            "aui-datepicker-popover"
        ],
        "skinnable": true
    },
    "aui-timepicker-native": {
        "requires": [
            "base",
            "base-build",
            "aui-node-base",
            "aui-datepicker-delegate",
            "aui-datepicker-native"
        ]
    },
    "aui-timer": {
        "requires": [
            "oop"
        ]
    },
    "aui-toggler": {
        "use": [
            "aui-toggler-base",
            "aui-toggler-delegate"
        ]
    },
    "aui-toggler-accessibility": {
        "requires": [
            "aui-toggler-base"
        ]
    },
    "aui-toggler-base": {
        "requires": [
            "transition",
            "aui-selector",
            "aui-event-base",
            "aui-node",
            "aui-component",
            "event-tap"
        ],
        "skinnable": true
    },
    "aui-toggler-delegate": {
        "requires": [
            "array-invoke",
            "node-event-delegate",
            "aui-toggler-base"
        ]
    },
    "aui-toolbar": {
        "requires": [
            "arraylist",
            "arraylist-add",
            "aui-component",
            "aui-button-core"
        ]
    },
    "aui-tooltip": {
        "use": [
            "aui-tooltip-base",
            "aui-tooltip-delegate"
        ]
    },
    "aui-tooltip-base": {
        "requires": [
            "aui-aria",
            "aui-classnamemanager",
            "aui-component",
            "aui-debounce",
            "aui-node-base",
            "aui-widget-cssclass",
            "aui-widget-toggle",
            "aui-widget-transition",
            "aui-widget-trigger",
            "aui-widget-position-align-suggestion",
            "event-hover",
            "event-resize",
            "escape",
            "widget",
            "widget-autohide",
            "widget-position",
            "widget-position-align",
            "widget-position-constrain",
            "widget-stack",
            "widget-stdmod"
        ],
        "skinnable": true
    },
    "aui-tooltip-delegate": {
        "requires": [
            "aui-tooltip-base",
            "node-event-delegate"
        ]
    },
    "aui-tooltip-deprecated": {
        "requires": [
            "aui-overlay-context-panel-deprecated"
        ],
        "skinnable": true
    },
    "aui-tpl-snippets-base-deprecated": {
        "requires": [
            "aui-template-deprecated"
        ]
    },
    "aui-tpl-snippets-checkbox-deprecated": {
        "requires": [
            "aui-tpl-snippets-base-deprecated"
        ]
    },
    "aui-tpl-snippets-deprecated": {
        "use": [
            "aui-tpl-snippets-base-deprecated",
            "aui-tpl-snippets-checkbox-deprecated",
            "aui-tpl-snippets-input-deprecated",
            "aui-tpl-snippets-select-deprecated",
            "aui-tpl-snippets-textarea-deprecated"
        ]
    },
    "aui-tpl-snippets-input-deprecated": {
        "requires": [
            "aui-tpl-snippets-base-deprecated"
        ]
    },
    "aui-tpl-snippets-select-deprecated": {
        "requires": [
            "aui-tpl-snippets-base-deprecated"
        ]
    },
    "aui-tpl-snippets-textarea-deprecated": {
        "requires": [
            "aui-tpl-snippets-base-deprecated"
        ]
    },
    "aui-tree": {
        "use": [
            "aui-tree-data",
            "aui-tree-io",
            "aui-tree-node",
            "aui-tree-paginator",
            "aui-tree-view"
        ]
    },
    "aui-tree-data": {
        "requires": [
            "aui-base-core",
            "aui-base-lang",
            "aui-node-base",
            "aui-timer",
            "aui-component"
        ]
    },
    "aui-tree-io": {
        "requires": [
            "aui-component",
            "aui-io"
        ]
    },
    "aui-tree-node": {
        "requires": [
            "json",
            "querystring-stringify",
            "aui-tree-data",
            "aui-tree-io",
            "aui-tree-paginator",
            "event-key"
        ]
    },
    "aui-tree-paginator": {
        "requires": [
            "yui-base"
        ]
    },
    "aui-tree-view": {
        "requires": [
            "dd-delegate",
            "dd-proxy",
            "widget",
            "aui-tree-node",
            "aui-tree-paginator",
            "aui-tree-io"
        ],
        "skinnable": true
    },
    "aui-undo-redo": {
        "requires": [
            "aui-base",
            "base",
            "base-build",
            "event-key",
            "promise"
        ]
    },
    "aui-url": {
        "requires": [
            "oop",
            "querystring-parse",
            "querystring-stringify"
        ]
    },
    "aui-video": {
        "requires": [
            "event-resize",
            "node-event-html5",
            "querystring-stringify-simple",
            "aui-aria",
            "aui-node",
            "aui-component",
            "aui-debounce"
        ],
        "skinnable": true
    },
    "aui-viewport": {
        "requires": [
            "aui-node",
            "aui-component"
        ]
    },
    "aui-widget": {
        "use": [
            "aui-widget-cssclass",
            "aui-widget-toolbars"
        ]
    },
    "aui-widget-core": {
        "use": [
            "aui-widget-cssclass"
        ]
    },
    "aui-widget-cssclass": {
        "requires": [
            "widget-base"
        ]
    },
    "aui-widget-position-align-suggestion": {
        "requires": [
            "widget-position-align",
            "widget-stdmod"
        ]
    },
    "aui-widget-responsive": {
        "requires": [
            "event-resize",
            "widget-base"
        ]
    },
    "aui-widget-shortcut": {
        "requires": [
            "base"
        ]
    },
    "aui-widget-swipe": {
        "requires": [
            "classnamemanager",
            "scrollview-base",
            "scrollview-paginator",
            "timers"
        ]
    },
    "aui-widget-toggle": {},
    "aui-widget-toolbars": {
        "requires": [
            "widget-stdmod",
            "aui-toolbar"
        ]
    },
    "aui-widget-transition": {
        "requires": [
            "transition"
        ]
    },
    "aui-widget-trigger": {
        "requires": [
            "node"
        ]
    }
});
YUI.Env[Y.version].md5 = 'd7c627eb00edd6b6f054d8f6e7147480';
/*
 * Alloy JavaScript Library
 * http://alloy.liferay.com/
 *
 * Copyright (c) 2010 Liferay Inc.
 * http://alloy.liferay.com/LICENSE.txt
 *
 * Nate Cavanaugh (nathan.cavanaugh@liferay.com)
 * Eduardo Lundgren (eduardo.lundgren@liferay.com)
 *
 * Attribution/Third-party licenses
 * http://alloy.liferay.com/ATTRIBUTION.txt
 */

// Simple version of
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/

A.UA.edge = (function() {
    var edgeVersion = A.UA.userAgent.match(/Edge\/(.[0-9.]+)/);

    if (edgeVersion) {
        return edgeVersion[1];
    }

    return 0;
})();

A.supportsDOMEvent = function(domNode, eventName) {
    eventName = 'on' + eventName;

    if (!(eventName in domNode)) {
        if (!domNode.setAttribute) {
            domNode = A.config.doc.createElement('div');
        }

        if (domNode.setAttribute) {
            domNode.setAttribute(eventName, '');
            return (typeof domNode[eventName] === 'function');
        }
    }

    domNode = null;

    return true;
};
(function() {
    var slice = Array.prototype.slice;

    YUI.prototype.ready = function() {
        var instance = this,
            xargs = arguments,
            index = xargs.length - 1,
            modules = slice.call(arguments, 0, index);

        modules.unshift('event-base');
        modules.push(function(instance) {
            var args = arguments;

            instance.on('domready', function() {
                xargs[index].apply(this, args);
            });
        });
        instance.use.apply(instance, modules);
    };
}());


}, '3.1.0-deprecated.79');
YUI.add('aui', function (A, NAME) {}, '3.1.0-deprecated.79');
YUI.Env.core.push.apply(YUI.Env.core, ["aui-base-core"]);
/**
 * 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.
 */

/**
 * @deprecated As of Athanasius (7.3.x), with no direct replacement
 */
(function () {
  var LiferayAUI = Liferay.AUI;
  var COMBINE = LiferayAUI.getCombine();
  var CORE_MODULES = YUI.Env.core;
  var INPUT_EL = document.createElement('input');
  var PATH_EDITOR_CKEDITOR = LiferayAUI.getEditorCKEditorPath();
  var PATH_JAVASCRIPT = '/o/frontend-js-aui-web';
  var SUPPORTS_INPUT_SELECTION = typeof INPUT_EL.selectionStart === 'number' && typeof INPUT_EL.selectionEnd === 'number';

  var testHistory = function testHistory(A) {
    var WIN = A.config.win;
    var HISTORY = WIN.history;
    return HISTORY && HISTORY.pushState && HISTORY.replaceState && ('onpopstate' in WIN || A.UA.gecko >= 2);
  };

  window.YUI_config = {
    base: Liferay.ThemeDisplay.getCDNBaseURL() + PATH_JAVASCRIPT + '/aui/',
    combine: COMBINE,
    comboBase: LiferayAUI.getComboPath(),
    filter: Liferay.AUI.getFilter(),
    groups: {
      editor: {
        base: PATH_EDITOR_CKEDITOR,
        combine: COMBINE,
        modules: {
          'inline-editor-ckeditor': {
            path: 'ckeditor/main.js'
          }
        },
        root: PATH_EDITOR_CKEDITOR
      },
      liferay: {
        base: Liferay.ThemeDisplay.getCDNBaseURL() + PATH_JAVASCRIPT + '/liferay/',
        combine: COMBINE,
        filter: Liferay.AUI.getFilterConfig(),
        modules: {
          'liferay-address': {
            path: 'address.js',
            requires: []
          },
          'liferay-alert': {
            path: 'alert.js',
            requires: ['aui-alert', 'aui-component', 'event-mouseenter', 'liferay-portlet-base', 'timers']
          },
          'liferay-asset-addon-entry-selector': {
            path: 'asset_addon_entry_selector.js',
            requires: ['aui-component', 'liferay-portlet-base', 'liferay-util-window']
          },
          'liferay-asset-categories-selector': {
            path: 'asset_categories_selector.js',
            requires: ['aui-tree', 'liferay-asset-tags-selector']
          },
          'liferay-asset-tags-selector': {
            path: 'asset_tags_selector.js',
            requires: ['array-extras', 'async-queue', 'aui-autocomplete-deprecated', 'aui-io-plugin-deprecated', 'aui-live-search-deprecated', 'aui-modal', 'aui-template-deprecated', 'aui-textboxlist-deprecated', 'datasource-cache', 'liferay-service-datasource']
          },
          'liferay-auto-fields': {
            path: 'auto_fields.js',
            requires: ['aui-base', 'aui-data-set-deprecated', 'aui-parse-content', 'base', 'liferay-form', 'liferay-menu', 'liferay-portlet-base', 'liferay-undo-manager', 'sortable']
          },
          'liferay-autocomplete-input': {
            path: 'autocomplete_input.js',
            requires: ['aui-base', 'autocomplete', 'autocomplete-filters', 'autocomplete-highlighters']
          },
          'liferay-autocomplete-input-caretindex': {
            condition: {
              name: 'liferay-autocomplete-input-caretindex',
              test: function test() {
                return SUPPORTS_INPUT_SELECTION;
              },
              trigger: 'liferay-autocomplete-textarea'
            },
            path: 'autocomplete_input_caretindex.js',
            requires: ['liferay-autocomplete-textarea']
          },
          'liferay-autocomplete-input-caretindex-sel': {
            condition: {
              name: 'liferay-autocomplete-input-caretindex-sel',
              test: function test() {
                return !SUPPORTS_INPUT_SELECTION;
              },
              trigger: 'liferay-autocomplete-textarea'
            },
            path: 'autocomplete_input_caretindex_sel.js',
            requires: ['liferay-autocomplete-textarea']
          },
          'liferay-autocomplete-input-caretoffset': {
            condition: {
              name: 'liferay-autocomplete-input-caretoffset',
              test: function test(A) {
                return !(A.UA.ie && A.UA.ie < 9);
              },
              trigger: 'liferay-autocomplete-textarea'
            },
            path: 'autocomplete_input_caretoffset.js',
            requires: ['liferay-autocomplete-textarea']
          },
          'liferay-autocomplete-input-caretoffset-sel': {
            condition: {
              name: 'liferay-autocomplete-input-caretoffset-sel',
              test: function test(A) {
                return A.UA.ie && A.UA.ie < 9;
              },
              trigger: 'liferay-autocomplete-textarea'
            },
            path: 'autocomplete_input_caretoffset_sel.js',
            requires: ['liferay-autocomplete-textarea']
          },
          'liferay-autocomplete-textarea': {
            path: 'autocomplete_textarea.js',
            requires: ['liferay-autocomplete-input']
          },
          'liferay-browser-selectors': {
            path: 'browser_selectors.js',
            requires: ['yui-base']
          },
          'liferay-cover-cropper': {
            path: 'cover_cropper.js',
            requires: ['aui-base', 'aui-component', 'dd-constrain', 'dd-drag', 'plugin']
          },
          'liferay-crop-region': {
            path: 'crop_region.js',
            requires: ['aui-base']
          },
          'liferay-dd-proxy': {
            path: 'dd_proxy.js',
            requires: ['dd-proxy']
          },
          'liferay-dynamic-select': {
            path: 'dynamic_select.js',
            requires: ['aui-base']
          },
          'liferay-form': {
            path: 'form.js',
            requires: ['aui-base', 'aui-form-validator']
          },
          'liferay-form-placeholders': {
            condition: {
              name: 'liferay-form-placeholders',
              test: function test() {
                return !('placeholder' in INPUT_EL);
              },
              trigger: 'liferay-form'
            },
            path: 'form_placeholders.js',
            requires: ['liferay-form', 'plugin']
          },
          'liferay-fullscreen-source-editor': {
            path: 'fullscreen_source_editor.js',
            requires: ['liferay-source-editor']
          },
          'liferay-history': {
            path: 'history.js',
            requires: ['history-hash', 'querystring-parse-simple']
          },
          'liferay-history-html5': {
            condition: {
              name: 'liferay-history-html5',
              test: testHistory,
              trigger: 'liferay-history'
            },
            path: 'history_html5.js',
            requires: ['history-html5', 'liferay-history', 'querystring-stringify-simple']
          },
          'liferay-history-manager': {
            path: 'history_manager.js',
            requires: ['liferay-history']
          },
          'liferay-hudcrumbs': {
            path: 'hudcrumbs.js',
            requires: ['aui-base', 'aui-debounce', 'event-resize']
          },
          'liferay-icon': {
            path: 'icon.js',
            requires: ['aui-base']
          },
          'liferay-inline-editor-base': {
            path: 'inline_editor_base.js',
            requires: ['aui-base', 'aui-overlay-base-deprecated']
          },
          'liferay-input-localized': {
            path: 'input_localized.js',
            requires: ['aui-base', 'aui-component', 'aui-event-input', 'aui-palette', 'aui-set', 'portal-available-languages']
          },
          'liferay-input-move-boxes': {
            path: 'input_move_boxes.js',
            plugins: {
              'liferay-input-move-boxes-touch': {
                condition: {
                  name: 'liferay-input-move-boxes-touch',
                  test: function test(A) {
                    return A.UA.touchEnabled && !!A.UA.mobile;
                  },
                  trigger: 'liferay-input-move-boxes'
                }
              }
            },
            requires: ['aui-base', 'aui-toolbar']
          },
          'liferay-input-move-boxes-touch': {
            path: 'input_move_boxes_touch.js',
            requires: ['aui-base', 'aui-template-deprecated', 'liferay-input-move-boxes', 'sortable']
          },
          'liferay-item-selector-dialog': {
            path: 'item_selector_dialog.js',
            requires: ['aui-component']
          },
          'liferay-item-selector-repository-entry-browser': {
            path: 'item_selector_repository_entry_browser.js',
            requires: ['liferay-item-selector-uploader', 'liferay-item-viewer', 'liferay-notice', 'liferay-portlet-base']
          },
          'liferay-item-selector-uploader': {
            path: 'item_selector_uploader.js',
            requires: ['aui-base', 'aui-progressbar', 'liferay-portlet-base', 'uploader']
          },
          'liferay-item-selector-url': {
            path: 'item_selector_url.js',
            requires: ['aui-event-input', 'liferay-item-viewer', 'liferay-portlet-base']
          },
          'liferay-item-viewer': {
            path: 'item_viewer.js',
            requires: ['aui-component', 'aui-image-viewer', 'liferay-portlet-url']
          },
          'liferay-language': {
            path: 'language.js'
          },
          'liferay-layout': {
            path: 'layout.js'
          },
          'liferay-layout-column': {
            path: 'layout_column.js',
            requires: ['aui-sortable-layout', 'dd']
          },
          'liferay-list-view': {
            path: 'list_view.js',
            requires: ['aui-base', 'transition']
          },
          'liferay-logo-editor': {
            path: 'logo_editor.js',
            requires: ['aui-image-cropper', 'liferay-portlet-base']
          },
          'liferay-logo-selector': {
            path: 'logo_selector.js',
            requires: ['aui-base']
          },
          'liferay-menu': {
            path: 'menu.js',
            requires: ['aui-debounce', 'aui-node']
          },
          'liferay-menu-filter': {
            path: 'menu_filter.js',
            requires: ['autocomplete-base', 'autocomplete-filters', 'autocomplete-highlighters']
          },
          'liferay-menu-toggle': {
            path: 'menu_toggle.js',
            requires: ['aui-node', 'event-outside', 'event-tap', 'liferay-menu-filter']
          },
          'liferay-message': {
            path: 'message.js',
            requires: ['aui-base']
          },
          'liferay-navigation': {
            path: 'navigation.js',
            requires: ['aui-component', 'event-mouseenter']
          },
          'liferay-navigation-interaction': {
            path: 'navigation_interaction.js',
            plugins: {
              'liferay-navigation-interaction-touch': {
                condition: {
                  name: 'liferay-navigation-interaction-touch',
                  test: function test(A) {
                    return A.UA.touchEnabled;
                  },
                  trigger: 'liferay-navigation-interaction'
                }
              }
            },
            requires: ['aui-base', 'aui-component', 'event-mouseenter', 'node-focusmanager', 'plugin']
          },
          'liferay-navigation-interaction-touch': {
            path: 'navigation_interaction_touch.js',
            requires: ['event-tap', 'event-touch', 'liferay-navigation-interaction']
          },
          'liferay-node': {
            path: 'node.js',
            requires: ['dom-base']
          },
          'liferay-notice': {
            path: 'notice.js',
            requires: ['aui-base', 'transition']
          },
          'liferay-notification': {
            path: 'notification.js',
            requires: ['liferay-alert']
          },
          'liferay-pagination': {
            path: 'pagination.js',
            requires: ['aui-pagination']
          },
          'liferay-panel-search': {
            path: 'panel_search.js',
            requires: ['aui-base', 'liferay-search-filter']
          },
          'liferay-poller': {
            path: 'poller.js',
            requires: ['aui-base', 'json']
          },
          'liferay-portlet-base': {
            path: 'portlet_base.js',
            requires: ['aui-base']
          },
          'liferay-portlet-url': {
            path: 'portlet_url.js',
            requires: ['aui-base']
          },
          'liferay-preview': {
            path: 'preview.js',
            requires: ['aui-base', 'aui-overlay-mask-deprecated', 'aui-toolbar', 'liferay-widget-zindex']
          },
          'liferay-progress': {
            path: 'progress.js',
            requires: ['aui-progressbar']
          },
          'liferay-ratings': {
            path: 'ratings.js',
            requires: ['aui-rating']
          },
          'liferay-resize-rtl': {
            condition: {
              test: function test() {
                return document.documentElement.dir === 'rtl';
              },
              trigger: 'resize-base'
            },
            path: 'resize_rtl.js'
          },
          'liferay-restore-entry': {
            path: 'restore_entry.js',
            requires: ['aui-io-plugin-deprecated', 'aui-modal', 'liferay-portlet-base']
          },
          'liferay-search-container': {
            path: 'search_container.js',
            requires: ['aui-base', 'aui-datatable-core']
          },
          'liferay-search-container-move': {
            path: 'search_container_move.js',
            requires: ['aui-component', 'dd-constrain', 'dd-delegate', 'dd-drag', 'dd-drop', 'dd-proxy', 'plugin']
          },
          'liferay-search-container-select': {
            path: 'search_container_select.js',
            requires: ['aui-component', 'aui-url', 'plugin']
          },
          'liferay-search-filter': {
            path: 'search_filter.js',
            requires: ['aui-base', 'autocomplete-base', 'autocomplete-filters']
          },
          'liferay-service-datasource': {
            path: 'service_datasource.js',
            requires: ['aui-base', 'datasource-local']
          },
          'liferay-session': {
            path: 'session.js',
            requires: ['aui-base', 'aui-component', 'aui-timer', 'cookie', 'plugin']
          },
          'liferay-sign-in-modal': {
            path: 'sign_in_modal.js',
            requires: ['aui-base', 'aui-component', 'aui-parse-content', 'liferay-form', 'liferay-portlet-url', 'liferay-util-window', 'plugin']
          },
          'liferay-social-bookmarks': {
            path: 'social_bookmarks.js',
            requires: ['aui-component', 'aui-node']
          },
          'liferay-sortable': {
            path: 'sortable.js',
            requires: ['liferay-dd-proxy', 'sortable']
          },
          'liferay-source-editor': {
            path: 'source_editor.js',
            requires: ['aui-ace-editor']
          },
          'liferay-storage-formatter': {
            path: 'storage_formatter.js',
            requires: ['aui-base', 'datatype-number-format']
          },
          'liferay-store': {
            path: 'store.js'
          },
          'liferay-toggler-interaction': {
            path: 'toggler_interaction.js',
            requires: ['liferay-toggler-key-filter']
          },
          'liferay-toggler-key-filter': {
            path: 'toggler_key_filter.js',
            requires: ['aui-event-base']
          },
          'liferay-token-list': {
            path: 'token_list.js',
            requires: ['aui-base', 'aui-template-deprecated']
          },
          'liferay-translation-manager': {
            path: 'translation_manager.js',
            requires: ['aui-base']
          },
          'liferay-tree-view-icons': {
            condition: {
              name: 'liferay-tree-view-icons',
              trigger: 'aui-tree-view'
            },
            path: 'tree_view_icons.js',
            requires: ['aui-tree-view']
          },
          'liferay-undo-manager': {
            path: 'undo_manager.js',
            requires: ['aui-data-set-deprecated', 'base']
          },
          'liferay-upload': {
            path: 'upload.js',
            requires: ['aui-template-deprecated', 'collection', 'liferay-portlet-base', 'uploader']
          },
          'liferay-util-window': {
            path: 'util_window.js',
            requires: ['aui-dialog-iframe-deprecated', 'aui-modal', 'aui-url', 'event-resize', 'liferay-widget-zindex']
          },
          'liferay-widget-size-animation-plugin': {
            path: 'widget_size_animation_plugin.js',
            requires: ['anim-easing', 'plugin', 'widget']
          },
          'liferay-widget-zindex': {
            path: 'widget_zindex.js',
            requires: ['aui-modal', 'plugin']
          },
          'liferay-xml-formatter': {
            path: 'xml_formatter.js',
            requires: ['aui-base']
          }
        },
        root: PATH_JAVASCRIPT + '/liferay/'
      },
      misc: {
        base: Liferay.ThemeDisplay.getCDNBaseURL() + PATH_JAVASCRIPT + '/misc/',
        combine: COMBINE,
        modules: {
          swfobject: {
            path: 'swfobject.js'
          },
          swfupload: {
            path: 'swfupload/swfupload.js'
          }
        },
        root: PATH_JAVASCRIPT + '/misc/'
      },
      portal: {
        base: Liferay.ThemeDisplay.getCDNBaseURL() + LiferayAUI.getJavaScriptRootPath() + '/liferay/',
        combine: false,
        modules: {
          'portal-available-languages': {
            path: LiferayAUI.getAvailableLangPath(),
            requires: ['liferay-language']
          }
        },
        root: PATH_JAVASCRIPT + '/liferay/'
      }
    },
    insertBefore: 'liferayPortalCSS',
    lang: themeDisplay.getBCP47LanguageId(),
    root: PATH_JAVASCRIPT + '/aui/',
    useBrowserConsole: false
  };
  CORE_MODULES.push('liferay-browser-selectors');
})();
//# sourceMappingURL=modules.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.
 */

/**
 * @deprecated As of Athanasius (7.3.x), with no direct replacement
 */
(function () {
  var ALLOY = YUI();

  if (ALLOY.html5shiv) {
    ALLOY.html5shiv();
  }

  var originalUse = ALLOY.use;

  ALLOY.use = function () {
    var args = Array.prototype.slice.call(arguments, 0);
    var currentURL = Liferay.currentURL;
    var originalCallback = args[args.length - 1];

    if (typeof originalCallback === 'function') {
      args[args.length - 1] = function () {
        if (Liferay.currentURL === currentURL) {
          originalCallback.apply(this, arguments);
        }
      };
    }

    return originalUse.apply(this, args);
  };

  window.AUI = function () {
    return ALLOY;
  };

  ALLOY.mix(AUI, YUI);
  AUI.$ = window.jQuery;
  AUI._ = window._;
})();
//# sourceMappingURL=aui_sandbox.js.map
YUI.add('attribute-base', function (Y, NAME) {

    /**
     * The attribute module provides an augmentable Attribute implementation, which
     * adds configurable attributes and attribute change events to the class being
     * augmented. It also provides a State class, which is used internally by Attribute,
     * but can also be used independently to provide a name/property/value data structure to
     * store state.
     *
     * @module attribute
     */

    /**
     * The attribute-base submodule provides core attribute handling support, with everything
     * aside from complex attribute handling in the provider's constructor.
     *
     * @module attribute
     * @submodule attribute-base
     */

    /**
     * <p>
     * Attribute provides configurable attribute support along with attribute change events. It is designed to be
     * augmented on to a host class, and provides the host with the ability to configure attributes to store and retrieve state,
     * along with attribute change events.
     * </p>
     * <p>For example, attributes added to the host can be configured:</p>
     * <ul>
     *     <li>As read only.</li>
     *     <li>As write once.</li>
     *     <li>With a setter function, which can be used to manipulate
     *     values passed to Attribute's <a href="#method_set">set</a> method, before they are stored.</li>
     *     <li>With a getter function, which can be used to manipulate stored values,
     *     before they are returned by Attribute's <a href="#method_get">get</a> method.</li>
     *     <li>With a validator function, to validate values before they are stored.</li>
     * </ul>
     *
     * <p>See the <a href="#method_addAttr">addAttr</a> method, for the complete set of configuration
     * options available for attributes.</p>
     *
     * <p><strong>NOTE:</strong> Most implementations will be better off extending the <a href="Base.html">Base</a> class,
     * instead of augmenting Attribute directly. Base augments Attribute and will handle the initial configuration
     * of attributes for derived classes, accounting for values passed into the constructor.</p>
     *
     * @class Attribute
     * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
     *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
     * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
     *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
     * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
     * @uses AttributeCore
     * @uses AttributeObservable
     * @uses EventTarget
     * @uses AttributeExtras
     */
    function Attribute() {
        Y.AttributeCore.apply(this, arguments);
        Y.AttributeObservable.apply(this, arguments);
        Y.AttributeExtras.apply(this, arguments);
    }

    Y.mix(Attribute, Y.AttributeCore, false, null, 1);
    Y.mix(Attribute, Y.AttributeExtras, false, null, 1);

    // Needs to be `true`, to overwrite methods from AttributeCore
    Y.mix(Attribute, Y.AttributeObservable, true, null, 1);

    /**
     * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>
     *
     * <p>You can return this value from your setter if you wish to combine validator and setter
     * functionality into a single setter function, which either returns the massaged value to be stored or
     * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>
     *
     * @property INVALID_VALUE
     * @type Object
     * @static
     * @final
     */
    Attribute.INVALID_VALUE = Y.AttributeCore.INVALID_VALUE;

    /**
     * The list of properties which can be configured for
     * each attribute (e.g. setter, getter, writeOnce etc.).
     *
     * This property is used internally as a whitelist for faster
     * Y.mix operations.
     *
     * @property _ATTR_CFG
     * @type Array
     * @static
     * @protected
     */
    Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeObservable._ATTR_CFG);

    /**
     * Utility method to protect an attribute configuration hash, by merging the
     * entire object and the individual attr config objects.
     *
     * @method protectAttrs
     * @static
     * @param {Object} attrs A hash of attribute to configuration object pairs.
     * @return {Object} A protected version of the `attrs` argument.
     */
    Attribute.protectAttrs = Y.AttributeCore.protectAttrs;

    Y.Attribute = Attribute;


}, 'patched-v3.18.1', {"requires": ["attribute-core", "attribute-observable", "attribute-extras"]});

YUI.add('attribute-complex', function (Y, NAME) {

    /**
     * Adds support for attribute providers to handle complex attributes in the constructor
     *
     * @module attribute
     * @submodule attribute-complex
     * @for Attribute
     * @deprecated AttributeComplex's overrides are now part of AttributeCore.
     */

    var Attribute = Y.Attribute;

    Attribute.Complex = function() {};
    Attribute.Complex.prototype = {

        /**
         * Utility method to split out simple attribute name/value pairs ("x")
         * from complex attribute name/value pairs ("x.y.z"), so that complex
         * attributes can be keyed by the top level attribute name.
         *
         * @method _normAttrVals
         * @param {Object} valueHash An object with attribute name/value pairs
         *
         * @return {Object} An object literal with 2 properties - "simple" and "complex",
         * containing simple and complex attribute values respectively keyed
         * by the top level attribute name, or null, if valueHash is falsey.
         *
         * @private
         */
        _normAttrVals : Attribute.prototype._normAttrVals,

        /**
         * Returns the initial value of the given attribute from
         * either the default configuration provided, or the
         * over-ridden value if it exists in the set of initValues
         * provided and the attribute is not read-only.
         *
         * @param {String} attr The name of the attribute
         * @param {Object} cfg The attribute configuration object
         * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
         *
         * @return {Any} The initial value of the attribute.
         *
         * @method _getAttrInitVal
         * @private
         */
        _getAttrInitVal : Attribute.prototype._getAttrInitVal

    };

    // Consistency with the rest of the Attribute addons for now.
    Y.AttributeComplex = Attribute.Complex;


}, 'patched-v3.18.1', {"requires": ["attribute-base"]});

YUI.add('attribute-core', function (Y, NAME) {

    /**
     * The State class maintains state for a collection of named items, with
     * a varying number of properties defined.
     *
     * It avoids the need to create a separate class for the item, and separate instances
     * of these classes for each item, by storing the state in a 2 level hash table,
     * improving performance when the number of items is likely to be large.
     *
     * @constructor
     * @class State
     */
    Y.State = function() {
        /**
         * Hash of attributes
         * @property data
         */
        this.data = {};
    };

    Y.State.prototype = {

        /**
         * Adds a property to an item.
         *
         * @method add
         * @param name {String} The name of the item.
         * @param key {String} The name of the property.
         * @param val {Any} The value of the property.
         */
        add: function(name, key, val) {
            var item = this.data[name];

            if (!item) {
                item = this.data[name] = {};
            }

            item[key] = val;
        },

        /**
         * Adds multiple properties to an item.
         *
         * @method addAll
         * @param name {String} The name of the item.
         * @param obj {Object} A hash of property/value pairs.
         */
        addAll: function(name, obj) {
            var item = this.data[name],
                key;

            if (!item) {
                item = this.data[name] = {};
            }

            for (key in obj) {
                if (obj.hasOwnProperty(key)) {
                    item[key] = obj[key];
                }
            }
        },

        /**
         * Removes a property from an item.
         *
         * @method remove
         * @param name {String} The name of the item.
         * @param key {String} The property to remove.
         */
        remove: function(name, key) {
            var item = this.data[name];

            if (item) {
                delete item[key];
            }
        },

        /**
         * Removes multiple properties from an item, or removes the item completely.
         *
         * @method removeAll
         * @param name {String} The name of the item.
         * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed.
         */
        removeAll: function(name, obj) {
            var data;

            if (!obj) {
                data = this.data;

                if (name in data) {
                    delete data[name];
                }
            } else {
                Y.each(obj, function(value, key) {
                    this.remove(name, typeof key === 'string' ? key : value);
                }, this);
            }
        },

        /**
         * For a given item, returns the value of the property requested, or undefined if not found.
         *
         * @method get
         * @param name {String} The name of the item
         * @param key {String} Optional. The property value to retrieve.
         * @return {Any} The value of the supplied property.
         */
        get: function(name, key) {
            var item = this.data[name];

            if (item) {
                return item[key];
            }
        },

        /**
         * For the given item, returns an object with all of the
         * item's property/value pairs. By default the object returned
         * is a shallow copy of the stored data, but passing in true
         * as the second parameter will return a reference to the stored
         * data.
         *
         * @method getAll
         * @param name {String} The name of the item
         * @param reference {boolean} true, if you want a reference to the stored
         * object
         * @return {Object} An object with property/value pairs for the item.
         */
        getAll : function(name, reference) {
            var item = this.data[name],
                key, obj;

            if (reference) {
                obj = item;
            } else if (item) {
                obj = {};

                for (key in item) {
                    if (item.hasOwnProperty(key)) {
                        obj[key] = item[key];
                    }
                }
            }

            return obj;
        }
    };
    /*For log lines*/
    /*jshint maxlen:200*/

    /**
     * The attribute module provides an augmentable Attribute implementation, which
     * adds configurable attributes and attribute change events to the class being
     * augmented. It also provides a State class, which is used internally by Attribute,
     * but can also be used independently to provide a name/property/value data structure to
     * store state.
     *
     * @module attribute
     */

    /**
     * The attribute-core submodule provides the lightest level of attribute handling support
     * without Attribute change events, or lesser used methods such as reset(), modifyAttrs(),
     * and removeAttr().
     *
     * @module attribute
     * @submodule attribute-core
     */
    var O = Y.Object,
        Lang = Y.Lang,

        DOT = ".",

        // Externally configurable props
        GETTER = "getter",
        SETTER = "setter",
        READ_ONLY = "readOnly",
        WRITE_ONCE = "writeOnce",
        INIT_ONLY = "initOnly",
        VALIDATOR = "validator",
        VALUE = "value",
        VALUE_FN = "valueFn",
        LAZY_ADD = "lazyAdd",

        // Used for internal state management
        ADDED = "added",
        BYPASS_PROXY = "_bypassProxy",
        INIT_VALUE = "initValue",
        LAZY = "lazy",

        INVALID_VALUE;

    /**
     * <p>
     * AttributeCore provides the lightest level of configurable attribute support. It is designed to be
     * augmented on to a host class, and provides the host with the ability to configure
     * attributes to store and retrieve state, <strong>but without support for attribute change events</strong>.
     * </p>
     * <p>For example, attributes added to the host can be configured:</p>
     * <ul>
     *     <li>As read only.</li>
     *     <li>As write once.</li>
     *     <li>With a setter function, which can be used to manipulate
     *     values passed to Attribute's <a href="#method_set">set</a> method, before they are stored.</li>
     *     <li>With a getter function, which can be used to manipulate stored values,
     *     before they are returned by Attribute's <a href="#method_get">get</a> method.</li>
     *     <li>With a validator function, to validate values before they are stored.</li>
     * </ul>
     *
     * <p>See the <a href="#method_addAttr">addAttr</a> method, for the complete set of configuration
     * options available for attributes.</p>
     *
     * <p>Object/Classes based on AttributeCore can augment <a href="AttributeObservable.html">AttributeObservable</a>
     * (with true for overwrite) and <a href="AttributeExtras.html">AttributeExtras</a> to add attribute event and
     * additional, less commonly used attribute methods, such as `modifyAttr`, `removeAttr` and `reset`.</p>
     *
     * @class AttributeCore
     * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
     *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
     * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
     *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
     * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
     */
    function AttributeCore(attrs, values, lazy) {
        // HACK: Fix #2531929
        // Complete hack, to make sure the first clone of a node value in IE doesn't doesn't hurt state - maintains 3.4.1 behavior.
        // Too late in the release cycle to do anything about the core problem.
        // The root issue is that cloning a Y.Node instance results in an object which barfs in IE, when you access it's properties (since 3.3.0).
        this._yuievt = null;

        this._initAttrHost(attrs, values, lazy);
    }

    /**
     * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>
     *
     * <p>You can return this value from your setter if you wish to combine validator and setter
     * functionality into a single setter function, which either returns the massaged value to be stored or
     * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>
     *
     * @property INVALID_VALUE
     * @type Object
     * @static
     * @final
     */
    AttributeCore.INVALID_VALUE = {};
    INVALID_VALUE = AttributeCore.INVALID_VALUE;

    /**
     * The list of properties which can be configured for
     * each attribute (e.g. setter, getter, writeOnce etc.).
     *
     * This property is used internally as a whitelist for faster
     * Y.mix operations.
     *
     * @property _ATTR_CFG
     * @type Array
     * @static
     * @protected
     */
    AttributeCore._ATTR_CFG = [SETTER, GETTER, VALIDATOR, VALUE, VALUE_FN, WRITE_ONCE, READ_ONLY, LAZY_ADD, BYPASS_PROXY];

    /**
     * Utility method to protect an attribute configuration hash, by merging the
     * entire object and the individual attr config objects.
     *
     * @method protectAttrs
     * @static
     * @param {Object} attrs A hash of attribute to configuration object pairs.
     * @return {Object} A protected version of the `attrs` argument.
     */
    AttributeCore.protectAttrs = function (attrs) {
        if (attrs) {
            attrs = Y.merge(attrs);
            for (var attr in attrs) {
                if (attrs.hasOwnProperty(attr)) {
                    attrs[attr] = Y.merge(attrs[attr]);
                }
            }
        }

        return attrs;
    };

    AttributeCore.prototype = {

        /**
         * Constructor logic for attributes. Initializes the host state, and sets up the inital attributes passed to the
         * constructor.
         *
         * @method _initAttrHost
         * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
         *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
         * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
         *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
         * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
         * @private
         */
        _initAttrHost : function(attrs, values, lazy) {
            this._state = new Y.State();
            this._initAttrs(attrs, values, lazy);
        },

        /**
         * <p>
         * Adds an attribute with the provided configuration to the host object.
         * </p>
         * <p>
         * The config argument object supports the following properties:
         * </p>
         *
         * <dl>
         *    <dt>value &#60;Any&#62;</dt>
         *    <dd>The initial value to set on the attribute</dd>
         *
         *    <dt>valueFn &#60;Function | String&#62;</dt>
         *    <dd>
         *    <p>A function, which will return the initial value to set on the attribute. This is useful
         *    for cases where the attribute configuration is defined statically, but needs to
         *    reference the host instance ("this") to obtain an initial value. If both the value and valueFn properties are defined,
         *    the value returned by the valueFn has precedence over the value property, unless it returns undefined, in which
         *    case the value property is used.</p>
         *
         *    <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>
         *    </dd>
         *
         *    <dt>readOnly &#60;boolean&#62;</dt>
         *    <dd>Whether or not the attribute is read only. Attributes having readOnly set to true
         *        cannot be modified by invoking the set method.</dd>
         *
         *    <dt>writeOnce &#60;boolean&#62; or &#60;string&#62;</dt>
         *    <dd>
         *        Whether or not the attribute is "write once". Attributes having writeOnce set to true,
         *        can only have their values set once, be it through the default configuration,
         *        constructor configuration arguments, or by invoking set.
         *        <p>The writeOnce attribute can also be set to the string "initOnly",
         *         in which case the attribute can only be set during initialization
         *        (when used with Base, this means it can only be set during construction)</p>
         *    </dd>
         *
         *    <dt>setter &#60;Function | String&#62;</dt>
         *    <dd>
         *    <p>The setter function used to massage or normalize the value passed to the set method for the attribute.
         *    The value returned by the setter will be the final stored value. Returning
         *    <a href="#property_Attribute.INVALID_VALUE">Attribute.INVALID_VALUE</a>, from the setter will prevent
         *    the value from being stored.
         *    </p>
         *
         *    <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>
         *    </dd>
         *
         *    <dt>getter &#60;Function | String&#62;</dt>
         *    <dd>
         *    <p>
         *    The getter function used to massage or normalize the value returned by the get method for the attribute.
         *    The value returned by the getter function is the value which will be returned to the user when they
         *    invoke get.
         *    </p>
         *
         *    <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>
         *    </dd>
         *
         *    <dt>validator &#60;Function | String&#62;</dt>
         *    <dd>
         *    <p>
         *    The validator function invoked prior to setting the stored value. Returning
         *    false from the validator function will prevent the value from being stored.
         *    </p>
         *
         *    <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>
         *    </dd>
         *
         *    <dt>lazyAdd &#60;boolean&#62;</dt>
         *    <dd>Whether or not to delay initialization of the attribute until the first call to get/set it.
         *    This flag can be used to over-ride lazy initialization on a per attribute basis, when adding multiple attributes through
         *    the <a href="#method_addAttrs">addAttrs</a> method.</dd>
         *
         * </dl>
         *
         * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with
         * the context ("this") set to the host object.</p>
         *
         * <p>Configuration properties outside of the list mentioned above are considered private properties used internally by attribute,
         * and are not intended for public use.</p>
         *
         * @method addAttr
         *
         * @param {String} name The name of the attribute.
         * @param {Object} config An object with attribute configuration property/value pairs, specifying the configuration for the attribute.
         *
         * <p>
         * <strong>NOTE:</strong> The configuration object is modified when adding an attribute, so if you need
         * to protect the original values, you will need to merge the object.
         * </p>
         *
         * @param {boolean} lazy (optional) Whether or not to add this attribute lazily (on the first call to get/set).
         *
         * @return {Object} A reference to the host object.
         *
         * @chainable
         */
        addAttr : function(name, config, lazy) {


            var host = this, // help compression
                state = host._state,
                data = state.data,
                value,
                added,
                hasValue;

            config = config || {};

            if (LAZY_ADD in config) {
                lazy = config[LAZY_ADD];
            }

            added = state.get(name, ADDED);

            if (lazy && !added) {
                state.data[name] = {
                    lazy : config,
                    added : true
                };
            } else {


                if (!added || config.isLazyAdd) {

                    hasValue = (VALUE in config);


                    if (hasValue) {

                        // We'll go through set, don't want to set value in config directly

                        // PERF TODO: VALIDATE: See if setting this to undefined is sufficient. We use to delete before.
                        // In certain code paths/use cases, undefined may not be the same as not present.
                        // If not, we can set it to some known fixed value (like INVALID_VALUE, say INITIALIZING_VALUE) for performance,
                        // to avoid a delete which seems to help a lot.

                        value = config.value;
                        config.value = undefined;
                    }

                    config.added = true;
                    config.initializing = true;

                    data[name] = config;

                    if (hasValue) {
                        // Go through set, so that raw values get normalized/validated
                        host.set(name, value);
                    }

                    config.initializing = false;
                }
            }

            return host;
        },

        /**
         * Checks if the given attribute has been added to the host
         *
         * @method attrAdded
         * @param {String} name The name of the attribute to check.
         * @return {boolean} true if an attribute with the given name has been added, false if it hasn't.
         *         This method will return true for lazily added attributes.
         */
        attrAdded: function(name) {
            return !!(this._state.get(name, ADDED));
        },

        /**
         * Returns the current value of the attribute. If the attribute
         * has been configured with a 'getter' function, this method will delegate
         * to the 'getter' to obtain the value of the attribute.
         *
         * @method get
         *
         * @param {String} name The name of the attribute. If the value of the attribute is an Object,
         * dot notation can be used to obtain the value of a property of the object (e.g. <code>get("x.y.z")</code>)
         *
         * @return {Any} The value of the attribute
         */
        get : function(name) {
            return this._getAttr(name);
        },

        /**
         * Checks whether or not the attribute is one which has been
         * added lazily and still requires initialization.
         *
         * @method _isLazyAttr
         * @private
         * @param {String} name The name of the attribute
         * @return {boolean} true if it's a lazily added attribute, false otherwise.
         */
        _isLazyAttr: function(name) {
            return this._state.get(name, LAZY);
        },

        /**
         * Finishes initializing an attribute which has been lazily added.
         *
         * @method _addLazyAttr
         * @private
         * @param {Object} name The name of the attribute
         * @param {Object} [lazyCfg] Optional config hash for the attribute. This is added for performance
         * along the critical path, where the calling method has already obtained lazy config from state.
         */
        _addLazyAttr: function(name, lazyCfg) {
            var state = this._state;

            lazyCfg = lazyCfg || state.get(name, LAZY);

            if (lazyCfg) {

                // PERF TODO: For App's id override, otherwise wouldn't be
                // needed. It expects to find it in the cfg for it's
                // addAttr override. Would like to remove, once App override is
                // removed.
                state.data[name].lazy = undefined;

                lazyCfg.isLazyAdd = true;

                this.addAttr(name, lazyCfg);
            }
        },

        /**
         * Sets the value of an attribute.
         *
         * @method set
         * @chainable
         *
         * @param {String} name The name of the attribute. If the
         * current value of the attribute is an Object, dot notation can be used
         * to set the value of a property within the object (e.g. <code>set("x.y.z", 5)</code>).
         * @param {Any} value The value to set the attribute to.
         * @param {Object} [opts] Optional data providing the circumstances for the change.
         * @return {Object} A reference to the host object.
         */
        set : function(name, val, opts) {
            return this._setAttr(name, val, opts);
        },

        /**
         * Allows setting of readOnly/writeOnce attributes. See <a href="#method_set">set</a> for argument details.
         *
         * @method _set
         * @protected
         * @chainable
         *
         * @param {String} name The name of the attribute.
         * @param {Any} val The value to set the attribute to.
         * @param {Object} [opts] Optional data providing the circumstances for the change.
         * @return {Object} A reference to the host object.
         */
        _set : function(name, val, opts) {
            return this._setAttr(name, val, opts, true);
        },

        /**
         * Provides the common implementation for the public set and protected _set methods.
         *
         * See <a href="#method_set">set</a> for argument details.
         *
         * @method _setAttr
         * @protected
         * @chainable
         *
         * @param {String} name The name of the attribute.
         * @param {Any} value The value to set the attribute to.
         * @param {Object} [opts] Optional data providing the circumstances for the change.
         * @param {boolean} force If true, allows the caller to set values for
         * readOnly or writeOnce attributes which have already been set.
         *
         * @return {Object} A reference to the host object.
         */
        _setAttr : function(name, val, opts, force)  {
            var allowSet = true,
                state = this._state,
                stateProxy = this._stateProxy,
                tCfgs = this._tCfgs,
                cfg,
                initialSet,
                strPath,
                path,
                currVal,
                writeOnce,
                initializing;

            if (name.indexOf(DOT) !== -1) {
                strPath = name;

                path = name.split(DOT);
                name = path.shift();
            }

            // On Demand - Should be rare - handles out of order valueFn, setter, getter references
            if (tCfgs && tCfgs[name]) {
                this._addOutOfOrder(name, tCfgs[name]);
            }

            cfg = state.data[name] || {};

            if (cfg.lazy) {
                cfg = cfg.lazy;
                this._addLazyAttr(name, cfg);
            }

            initialSet = (cfg.value === undefined);

            if (stateProxy && name in stateProxy && !cfg._bypassProxy) {
                // TODO: Value is always set for proxy. Can we do any better? Maybe take a snapshot as the initial value for the first call to set?
                initialSet = false;
            }

            writeOnce = cfg.writeOnce;
            initializing = cfg.initializing;

            if (!initialSet && !force) {

                if (writeOnce) {
                    allowSet = false;
                }

                if (cfg.readOnly) {
                    allowSet = false;
                }
            }

            if (!initializing && !force && writeOnce === INIT_ONLY) {
                allowSet = false;
            }

            if (allowSet) {
                // Don't need currVal if initialSet (might fail in custom getter if it always expects a non-undefined/non-null value)
                if (!initialSet) {
                    currVal =  this.get(name);
                }

                if (path) {
                    var copyVal = [currVal].reduce(
                        function(retVal, currVal) {
                            Object.keys(currVal).forEach(
                                function(item) {
                                    retVal[item] = currVal[item];
                                }
                            );
                        return retVal;
                        },
                        {}
                    );

                    var pathNode = copyVal;
                    var leafIdx = path.length - 1;

                    for (var i = 0; i < leafIdx && pathNode; i++) {
                        pathNode = pathNode[path[i]];
                    }

                    if (pathNode) {
                        delete pathNode[path[leafIdx]];
                    }

                    val = O.setValue(Y.clone(copyVal), path, val);

                    if (val === undefined) {
                        allowSet = false;
                    }
                }

                if (allowSet) {
                    if (!this._fireAttrChange || initializing) {
                        this._setAttrVal(name, strPath, currVal, val, opts, cfg);
                    } else {
                        // HACK - no real reason core needs to know about _fireAttrChange, but
                        // it adds fn hops if we want to break it out. Not sure it's worth it for this critical path
                        this._fireAttrChange(name, strPath, currVal, val, opts, cfg);
                    }
                }
            }

            return this;
        },

        /**
         * Utility method used by get/set to add attributes
         * encountered out of order when calling addAttrs().
         *
         * For example, if:
         *
         *     this.addAttrs({
         *          foo: {
         *              setter: function() {
         *                 // make sure this bar is available when foo is added
         *                 this.get("bar");
         *              }
         *          },
         *          bar: {
         *              value: ...
         *          }
         *     });
         *
         * @method _addOutOfOrder
         * @private
         * @param name {String} attribute name
         * @param cfg {Object} attribute configuration
         */
        _addOutOfOrder : function(name, cfg) {

            var attrs = {};
            attrs[name] = cfg;

            delete this._tCfgs[name];

            // TODO: The original code went through addAttrs, so
            // sticking with it for this pass. Seems like we could
            // just jump straight to _addAttr() and get some perf
            // improvement.
            this._addAttrs(attrs, this._tVals);
        },

        /**
         * Provides the common implementation for the public get method,
         * allowing Attribute hosts to over-ride either method.
         *
         * See <a href="#method_get">get</a> for argument details.
         *
         * @method _getAttr
         * @protected
         * @chainable
         *
         * @param {String} name The name of the attribute.
         * @return {Any} The value of the attribute.
         */
        _getAttr : function(name) {
            var fullName = name,
                tCfgs = this._tCfgs,
                path,
                getter,
                val,
                attrCfg;

            if (name.indexOf(DOT) !== -1) {
                path = name.split(DOT);
                name = path.shift();
            }

            // On Demand - Should be rare - handles out of
            // order valueFn, setter, getter references
            if (tCfgs && tCfgs[name]) {
                this._addOutOfOrder(name, tCfgs[name]);
            }

            attrCfg = this._state.data[name] || {};

            // Lazy Init
            if (attrCfg.lazy) {
                attrCfg = attrCfg.lazy;
                this._addLazyAttr(name, attrCfg);
            }

            val = this._getStateVal(name, attrCfg);

            getter = attrCfg.getter;

            if (getter && !getter.call) {
                getter = this[getter];
            }

            val = (getter) ? getter.call(this, val, fullName) : val;
            val = (path) ? O.getValue(val, path) : val;

            return val;
        },

        /**
         * Gets the stored value for the attribute, from either the
         * internal state object, or the state proxy if it exits
         *
         * @method _getStateVal
         * @private
         * @param {String} name The name of the attribute
         * @param {Object} [cfg] Optional config hash for the attribute. This is added for performance along the critical path,
         * where the calling method has already obtained the config from state.
         *
         * @return {Any} The stored value of the attribute
         */
        _getStateVal : function(name, cfg) {
            var stateProxy = this._stateProxy;

            if (!cfg) {
                cfg = this._state.getAll(name) || {};
            }

            return (stateProxy && (name in stateProxy) && !(cfg._bypassProxy)) ? stateProxy[name] : cfg.value;
        },

        /**
         * Sets the stored value for the attribute, in either the
         * internal state object, or the state proxy if it exits
         *
         * @method _setStateVal
         * @private
         * @param {String} name The name of the attribute
         * @param {Any} value The value of the attribute
         */
        _setStateVal : function(name, value) {
            var stateProxy = this._stateProxy;
            if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {
                stateProxy[name] = value;
            } else {
                this._state.add(name, VALUE, value);
            }
        },

        /**
         * Updates the stored value of the attribute in the privately held State object,
         * if validation and setter passes.
         *
         * @method _setAttrVal
         * @private
         * @param {String} attrName The attribute name.
         * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property ("x.y.z").
         * @param {Any} prevVal The currently stored value of the attribute.
         * @param {Any} newVal The value which is going to be stored.
         * @param {Object} [opts] Optional data providing the circumstances for the change.
         * @param {Object} [attrCfg] Optional config hash for the attribute. This is added for performance along the critical path,
         * where the calling method has already obtained the config from state.
         *
         * @return {Boolean} true if the new attribute value was stored, false if not.
         */
        _setAttrVal : function(attrName, subAttrName, prevVal, newVal, opts, attrCfg) {

            var host = this,
                allowSet = true,
                cfg = attrCfg || this._state.data[attrName] || {},
                validator = cfg.validator,
                setter = cfg.setter,
                initializing = cfg.initializing,
                prevRawVal = this._getStateVal(attrName, cfg),
                name = subAttrName || attrName,
                retVal,
                valid;

            if (validator) {
                if (!validator.call) {
                    // Assume string - trying to keep critical path tight, so avoiding Lang check
                    validator = this[validator];
                }
                if (validator) {
                    valid = validator.call(host, newVal, name, opts);

                    if (!valid && initializing) {
                        newVal = cfg.defaultValue;
                        valid = true; // Assume it's valid, for perf.
                    }
                }
            }

            if (!validator || valid) {
                if (setter) {
                    if (!setter.call) {
                        // Assume string - trying to keep critical path tight, so avoiding Lang check
                        setter = this[setter];
                    }
                    if (setter) {
                        retVal = setter.call(host, newVal, name, opts);

                        if (retVal === INVALID_VALUE) {
                            if (initializing) {
                                newVal = cfg.defaultValue;
                            } else {
                                allowSet = false;
                            }
                        } else if (retVal !== undefined){
                            newVal = retVal;
                        }
                    }
                }

                if (allowSet) {
                    if(!subAttrName && (newVal === prevRawVal) && !Lang.isObject(newVal)) {
                        allowSet = false;
                    } else {
                        // Store value
                        if (!(INIT_VALUE in cfg)) {
                            cfg.initValue = newVal;
                        }
                        host._setStateVal(attrName, newVal);
                    }
                }

            } else {
                allowSet = false;
            }

            return allowSet;
        },

        /**
         * Sets multiple attribute values.
         *
         * @method setAttrs
         * @param {Object} attrs  An object with attributes name/value pairs.
         * @param {Object} [opts] Optional data providing the circumstances for the change.
         * @return {Object} A reference to the host object.
         * @chainable
         */
        setAttrs : function(attrs, opts) {
            return this._setAttrs(attrs, opts);
        },

        /**
         * Implementation behind the public setAttrs method, to set multiple attribute values.
         *
         * @method _setAttrs
         * @protected
         * @param {Object} attrs  An object with attributes name/value pairs.
         * @param {Object} [opts] Optional data providing the circumstances for the change
         * @return {Object} A reference to the host object.
         * @chainable
         */
        _setAttrs : function(attrs, opts) {
            var attr;
            for (attr in attrs) {
                if ( attrs.hasOwnProperty(attr) ) {
                    this.set(attr, attrs[attr], opts);
                }
            }
            return this;
        },

        /**
         * Gets multiple attribute values.
         *
         * @method getAttrs
         * @param {String[]|Boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are
         * returned. If set to true, all attributes modified from their initial values are returned.
         * @return {Object} An object with attribute name/value pairs.
         */
        getAttrs : function(attrs) {
            return this._getAttrs(attrs);
        },

        /**
         * Implementation behind the public getAttrs method, to get multiple attribute values.
         *
         * @method _getAttrs
         * @protected
         * @param {String[]|Boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are
         * returned. If set to true, all attributes modified from their initial values are returned.
         * @return {Object} An object with attribute name/value pairs.
         */
        _getAttrs : function(attrs) {
            var obj = {},
                attr, i, len,
                modifiedOnly = (attrs === true);

            // TODO - figure out how to get all "added"
            if (!attrs || modifiedOnly) {
                attrs = O.keys(this._state.data);
            }

            for (i = 0, len = attrs.length; i < len; i++) {
                attr = attrs[i];

                if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {
                    // Go through get, to honor cloning/normalization
                    obj[attr] = this.get(attr);
                }
            }

            return obj;
        },

        /**
         * Configures a group of attributes, and sets initial values.
         *
         * <p>
         * <strong>NOTE:</strong> This method does not isolate the configuration object by merging/cloning.
         * The caller is responsible for merging/cloning the configuration object if required.
         * </p>
         *
         * @method addAttrs
         * @chainable
         *
         * @param {Object} cfgs An object with attribute name/configuration pairs.
         * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
         * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only.
         * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set.
         * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration.
         * See <a href="#method_addAttr">addAttr</a>.
         *
         * @return {Object} A reference to the host object.
         */
        addAttrs : function(cfgs, values, lazy) {
            if (cfgs) {
                this._tCfgs = cfgs;
                this._tVals = (values) ? this._normAttrVals(values) : null;
                this._addAttrs(cfgs, this._tVals, lazy);
                this._tCfgs = this._tVals = null;
            }

            return this;
        },

        /**
         * Implementation behind the public addAttrs method.
         *
         * This method is invoked directly by get if it encounters a scenario
         * in which an attribute's valueFn attempts to obtain the
         * value an attribute in the same group of attributes, which has not yet
         * been added (on demand initialization).
         *
         * @method _addAttrs
         * @private
         * @param {Object} cfgs An object with attribute name/configuration pairs.
         * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
         * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only.
         * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set.
         * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration.
         * See <a href="#method_addAttr">addAttr</a>.
         */
        _addAttrs : function(cfgs, values, lazy) {
            var tCfgs = this._tCfgs,
                tVals = this._tVals,
                attr,
                attrCfg,
                value;

            for (attr in cfgs) {
                if (cfgs.hasOwnProperty(attr)) {

                    // Not Merging. Caller is responsible for isolating configs
                    attrCfg = cfgs[attr];
                    attrCfg.defaultValue = attrCfg.value;

                    // Handle simple, complex and user values, accounting for read-only
                    value = this._getAttrInitVal(attr, attrCfg, tVals);

                    if (value !== undefined) {
                        attrCfg.value = value;
                    }

                    if (tCfgs[attr]) {
                        tCfgs[attr] = undefined;
                    }

                    this.addAttr(attr, attrCfg, lazy);
                }
            }
        },

        /**
         * Utility method to protect an attribute configuration
         * hash, by merging the entire object and the individual
         * attr config objects.
         *
         * @method _protectAttrs
         * @protected
         * @param {Object} attrs A hash of attribute to configuration object pairs.
         * @return {Object} A protected version of the attrs argument.
         * @deprecated Use `AttributeCore.protectAttrs()` or
         *   `Attribute.protectAttrs()` which are the same static utility method.
         */
        _protectAttrs : AttributeCore.protectAttrs,

        /**
         * Utility method to normalize attribute values. The base implementation
         * simply merges the hash to protect the original.
         *
         * @method _normAttrVals
         * @param {Object} valueHash An object with attribute name/value pairs
         *
         * @return {Object} An object literal with 2 properties - "simple" and "complex",
         * containing simple and complex attribute values respectively keyed
         * by the top level attribute name, or null, if valueHash is falsey.
         *
         * @private
         */
        _normAttrVals : function(valueHash) {
            var vals,
                subvals,
                path,
                attr,
                v, k;

            if (!valueHash) {
                return null;
            }

            vals = {};

            for (k in valueHash) {
                if (valueHash.hasOwnProperty(k)) {
                    if (k.indexOf(DOT) !== -1) {
                        path = k.split(DOT);
                        attr = path.shift();

                        subvals = subvals || {};

                        v = subvals[attr] = subvals[attr] || [];
                        v[v.length] = {
                            path : path,
                            value: valueHash[k]
                        };
                    } else {
                        vals[k] = valueHash[k];
                    }
                }
            }

            return { simple:vals, complex:subvals };
        },

        /**
         * Returns the initial value of the given attribute from
         * either the default configuration provided, or the
         * over-ridden value if it exists in the set of initValues
         * provided and the attribute is not read-only.
         *
         * @param {String} attr The name of the attribute
         * @param {Object} cfg The attribute configuration object
         * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
         *
         * @return {Any} The initial value of the attribute.
         *
         * @method _getAttrInitVal
         * @private
         */
        _getAttrInitVal : function(attr, cfg, initValues) {
            var val = cfg.value,
                valFn = cfg.valueFn,
                tmpVal,
                initValSet = false,
                readOnly = cfg.readOnly,
                simple,
                complex,
                i,
                l,
                path,
                subval,
                subvals;

            if (!readOnly && initValues) {
                // Simple Attributes
                simple = initValues.simple;
                if (simple && simple.hasOwnProperty(attr)) {
                    val = simple[attr];
                    initValSet = true;
                }
            }

            if (valFn && !initValSet) {
                if (!valFn.call) {
                    valFn = this[valFn];
                }
                if (valFn) {
                    tmpVal = valFn.call(this, attr);
                    val = tmpVal;
                }
            }

            if (!readOnly && initValues) {

                // Complex Attributes (complex values applied, after simple, in case both are set)
                complex = initValues.complex;

                if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {
                    subvals = complex[attr];
                    for (i = 0, l = subvals.length; i < l; ++i) {
                        path = subvals[i].path;
                        subval = subvals[i].value;
                        O.setValue(val, path, subval);
                    }
                }
            }

            return val;
        },

        /**
         * Utility method to set up initial attributes defined during construction,
         * either through the constructor.ATTRS property, or explicitly passed in.
         *
         * @method _initAttrs
         * @protected
         * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
         *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
         * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
         *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
         * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
         */
        _initAttrs : function(attrs, values, lazy) {
            // ATTRS support for Node, which is not Base based
            attrs = attrs || this.constructor.ATTRS;

            var Base = Y.Base,
                BaseCore = Y.BaseCore,
                baseInst = (Base && Y.instanceOf(this, Base)),
                baseCoreInst = (!baseInst && BaseCore && Y.instanceOf(this, BaseCore));

            if (attrs && !baseInst && !baseCoreInst) {
                this.addAttrs(Y.AttributeCore.protectAttrs(attrs), values, lazy);
            }
        }
    };

    Y.AttributeCore = AttributeCore;


}, 'patched-v3.18.1', {"requires": ["oop"]});

YUI.add('attribute-observable', function (Y, NAME) {

    /*For log lines*/
    /*jshint maxlen:200*/


    /**
     * The attribute module provides an augmentable Attribute implementation, which
     * adds configurable attributes and attribute change events to the class being
     * augmented. It also provides a State class, which is used internally by Attribute,
     * but can also be used independently to provide a name/property/value data structure to
     * store state.
     *
     * @module attribute
     */

    /**
     * The `attribute-observable` submodule provides augmentable attribute change event support
     * for AttributeCore based implementations.
     *
     * @module attribute
     * @submodule attribute-observable
     */
    var EventTarget = Y.EventTarget,

        CHANGE = "Change",
        BROADCAST = "broadcast";

    /**
     * Provides an augmentable implementation of attribute change events for
     * AttributeCore.
     *
     * @class AttributeObservable
     * @extensionfor AttributeCore
     * @uses EventTarget
     */
    function AttributeObservable() {
        // Perf tweak - avoid creating event literals if not required.
        this._ATTR_E_FACADE = {};

        EventTarget.call(this, {emitFacade:true});
    }

    AttributeObservable._ATTR_CFG = [BROADCAST];

    AttributeObservable.prototype = {

        /**
         * Sets the value of an attribute.
         *
         * @method set
         * @chainable
         *
         * @param {String} name The name of the attribute. If the
         * current value of the attribute is an Object, dot notation can be used
         * to set the value of a property within the object (e.g. <code>set("x.y.z", 5)</code>).
         *
         * @param {Any} value The value to set the attribute to.
         *
         * @param {Object} opts (Optional) Optional event data to be mixed into
         * the event facade passed to subscribers of the attribute's change event. This
         * can be used as a flexible way to identify the source of a call to set, allowing
         * the developer to distinguish between set called internally by the host, vs.
         * set called externally by the application developer.
         *
         * @return {Object} A reference to the host object.
         */
        set : function(name, val, opts) {
            return this._setAttr(name, val, opts);
        },

        /**
         * Allows setting of readOnly/writeOnce attributes. See <a href="#method_set">set</a> for argument details.
         *
         * @method _set
         * @protected
         * @chainable
         *
         * @param {String} name The name of the attribute.
         * @param {Any} val The value to set the attribute to.
         * @param {Object} opts (Optional) Optional event data to be mixed into
         * the event facade passed to subscribers of the attribute's change event.
         * @return {Object} A reference to the host object.
         */
        _set : function(name, val, opts) {
            return this._setAttr(name, val, opts, true);
        },

        /**
         * Sets multiple attribute values.
         *
         * @method setAttrs
         * @param {Object} attrs  An object with attributes name/value pairs.
         * @param {Object} opts  Properties to mix into the event payload. These are shared and mixed into each set
         * @return {Object} A reference to the host object.
         * @chainable
         */
        setAttrs : function(attrs, opts) {
            return this._setAttrs(attrs, opts);
        },

        /**
         * Implementation behind the public setAttrs method, to set multiple attribute values.
         *
         * @method _setAttrs
         * @protected
         * @param {Object} attrs  An object with attributes name/value pairs.
         * @param {Object} opts  Properties to mix into the event payload. These are shared and mixed into each set
         * @return {Object} A reference to the host object.
         * @chainable
         */
        _setAttrs : function(attrs, opts) {
            var attr;
            for (attr in attrs) {
                if ( attrs.hasOwnProperty(attr) ) {
                    this.set(attr, attrs[attr], opts);
                }
            }
            return this;
        },

        /**
         * Utility method to help setup the event payload and fire the attribute change event.
         *
         * @method _fireAttrChange
         * @private
         * @param {String} attrName The name of the attribute
         * @param {String} subAttrName The full path of the property being changed,
         * if this is a sub-attribute value being change. Otherwise null.
         * @param {Any} currVal The current value of the attribute
         * @param {Any} newVal The new value of the attribute
         * @param {Object} opts Any additional event data to mix into the attribute change event's event facade.
         * @param {Object} [cfg] The attribute config stored in State, if already available.
         */
        _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts, cfg) {
            var host = this,
                eventName = this._getFullType(attrName + CHANGE),
                state = host._state,
                facade,
                broadcast,
                e;

            if (!cfg) {
                cfg = state.data[attrName] || {};
            }

            if (!cfg.published) {

                // PERF: Using lower level _publish() for
                // critical path performance
                e = host._publish(eventName);

                e.emitFacade = true;
                e.defaultTargetOnly = true;
                e.defaultFn = host._defAttrChangeFn;

                broadcast = cfg.broadcast;
                if (broadcast !== undefined) {
                    e.broadcast = broadcast;
                }

                cfg.published = true;
            }

            if (opts) {
                facade = Y.merge(opts);
                facade._attrOpts = opts;
            } else {
                facade = host._ATTR_E_FACADE;
            }

            // Not using the single object signature for fire({type:..., newVal:...}), since
            // we don't want to override type. Changed to the fire(type, {newVal:...}) signature.

            facade.attrName = attrName;
            facade.subAttrName = subAttrName;
            facade.prevVal = currVal;
            facade.newVal = newVal;

            if (host._hasPotentialSubscribers(eventName)) {
                host.fire(eventName, facade);
            } else {
                this._setAttrVal(attrName, subAttrName, currVal, newVal, opts, cfg);
            }
        },

        /**
         * Default function for attribute change events.
         *
         * @private
         * @method _defAttrChangeFn
         * @param {EventFacade} e The event object for attribute change events.
         * @param {boolean} eventFastPath Whether or not we're using this as a fast path in the case of no listeners or not
         */
        _defAttrChangeFn : function(e, eventFastPath) {

            var opts = e._attrOpts;
            if (opts) {
                delete e._attrOpts;
            }

            if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal, opts)) {


                if (!eventFastPath) {
                    // Prevent "after" listeners from being invoked since nothing changed.
                    e.stopImmediatePropagation();
                }

            } else {
                if (!eventFastPath) {
                    e.newVal = this.get(e.attrName);
                }
            }
        }
    };

    // Basic prototype augment - no lazy constructor invocation.
    Y.mix(AttributeObservable, EventTarget, false, null, 1);

    Y.AttributeObservable = AttributeObservable;

    /**
    The `AttributeEvents` class extension was deprecated in YUI 3.8.0 and is now
    an alias for the `AttributeObservable` class extension. Use that class
    extnesion instead. This alias will be removed in a future version of YUI.

    @class AttributeEvents
    @uses EventTarget
    @deprecated Use `AttributeObservable` instead.
    @see AttributeObservable
    **/
    Y.AttributeEvents = AttributeObservable;


}, 'patched-v3.18.1', {"requires": ["event-custom"]});

YUI.add('attribute-extras', function (Y, NAME) {

    /**
     * The attribute module provides an augmentable Attribute implementation, which
     * adds configurable attributes and attribute change events to the class being
     * augmented. It also provides a State class, which is used internally by Attribute,
     * but can also be used independently to provide a name/property/value data structure to
     * store state.
     *
     * @module attribute
     */

    /**
     * The attribute-extras submodule provides less commonly used attribute methods, and can
     * be augmented/mixed into an implemention which used attribute-core.
     *
     * @module attribute
     * @submodule attribute-extras
     */
    var BROADCAST = "broadcast",
        PUBLISHED = "published",
        INIT_VALUE = "initValue",

        MODIFIABLE = {
            readOnly:1,
            writeOnce:1,
            getter:1,
            broadcast:1
        };

    /**
     * A augmentable implementation for AttributeCore, providing less frequently used
     * methods for Attribute management such as modifyAttrs(), removeAttr and reset()
     *
     * @class AttributeExtras
     * @extensionfor AttributeCore
     */
    function AttributeExtras() {}

    AttributeExtras.prototype = {

        /**
         * Updates the configuration of an attribute which has already been added.
         * <p>
         * The properties which can be modified through this interface are limited
         * to the following subset of attributes, which can be safely modified
         * after a value has already been set on the attribute:
         * </p>
         * <dl>
         *  <dt>readOnly;</dt>
         *  <dt>writeOnce;</dt>
         *  <dt>broadcast; and</dt>
         *  <dt>getter.</dt>
         * </dl>
         * <p>
         * Note: New attributes cannot be added using this interface. New attributes must be
         * added using {{#crossLink "AttributeCore/addAttr:method"}}addAttr{{/crossLink}}, or an
         * appropriate manner for a class which utilises Attributes (e.g. the
         * {{#crossLink "Base/ATTRS:property"}}ATTRS{{/crossLink}} property in
         * {{#crossLink "Base"}}Base{{/crossLink}}).
         * </p>
         * @method modifyAttr
         * @param {String} name The name of the attribute whose configuration is to be updated.
         * @param {Object} config An object with configuration property/value pairs, specifying the configuration properties to modify.
         */
        modifyAttr: function(name, config) {
            var host = this, // help compression
                prop, state;

            if (host.attrAdded(name)) {

                if (host._isLazyAttr(name)) {
                    host._addLazyAttr(name);
                }

                state = host._state;
                for (prop in config) {
                    if (MODIFIABLE[prop] && config.hasOwnProperty(prop)) {
                        state.add(name, prop, config[prop]);

                        // If we reconfigured broadcast, need to republish
                        if (prop === BROADCAST) {
                            state.remove(name, PUBLISHED);
                        }
                    }
                }
            } else {
            }
        },

        /**
         * Removes an attribute from the host object
         *
         * @method removeAttr
         * @param {String} name The name of the attribute to be removed.
         */
        removeAttr: function(name) {
            this._state.removeAll(name);
        },

        /**
         * Resets the attribute (or all attributes) to its initial value, as long as
         * the attribute is not readOnly, or writeOnce.
         *
         * @method reset
         * @param {String} name Optional. The name of the attribute to reset.  If omitted, all attributes are reset.
         * @return {Object} A reference to the host object.
         * @chainable
         */
        reset : function(name) {
            var host = this;  // help compression

            if (name) {
                if (host._isLazyAttr(name)) {
                    host._addLazyAttr(name);
                }
                host.set(name, host._state.get(name, INIT_VALUE));
            } else {
                Y.Object.each(host._state.data, function(v, n) {
                    host.reset(n);
                });
            }
            return host;
        },

        /**
         * Returns an object with the configuration properties (and value)
         * for the given attribute. If attrName is not provided, returns the
         * configuration properties for all attributes.
         *
         * @method _getAttrCfg
         * @protected
         * @param {String} name Optional. The attribute name. If not provided, the method will return the configuration for all attributes.
         * @return {Object} The configuration properties for the given attribute, or all attributes.
         */
        _getAttrCfg : function(name) {
            var o,
                state = this._state;

            if (name) {
                o = state.getAll(name) || {};
            } else {
                o = {};
                Y.each(state.data, function(v, n) {
                    o[n] = state.getAll(n);
                });
            }

            return o;
        }
    };

    Y.AttributeExtras = AttributeExtras;


}, 'patched-v3.18.1', {"requires": ["oop"]});

YUI.add('event-custom-base', function (Y, NAME) {

/**
 * Custom event engine, DOM event listener abstraction layer, synthetic DOM
 * events.
 * @module event-custom
 */

Y.Env.evt = {
    handles: {},
    plugins: {}
};

/**
 * Custom event engine, DOM event listener abstraction layer, synthetic DOM
 * events.
 * @module event-custom
 * @submodule event-custom-base
 */

/**
 * Allows for the insertion of methods that are executed before or after
 * a specified method
 * @class Do
 * @static
 */

var DO_BEFORE = 0,
    DO_AFTER = 1,

DO = {

    /**
     * Cache of objects touched by the utility
     * @property objs
     * @static
     * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
     * replaces the role of this property, but is considered to be private, and
     * is only mentioned to provide a migration path.
     *
     * If you have a use case which warrants migration to the _yuiaop property,
     * please file a ticket to let us know what it's used for and we can see if
     * we need to expose hooks for that functionality more formally.
     */
    objs: null,

    /**
     * <p>Execute the supplied method before the specified function.  Wrapping
     * function may optionally return an instance of the following classes to
     * further alter runtime behavior:</p>
     * <dl>
     *     <dt></code>Y.Do.Halt(message, returnValue)</code></dt>
     *         <dd>Immediatly stop execution and return
     *         <code>returnValue</code>.  No other wrapping functions will be
     *         executed.</dd>
     *     <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt>
     *         <dd>Replace the arguments that the original function will be
     *         called with.</dd>
     *     <dt></code>Y.Do.Prevent(message)</code></dt>
     *         <dd>Don't execute the wrapped function.  Other before phase
     *         wrappers will be executed.</dd>
     * </dl>
     *
     * @method before
     * @param fn {Function} the function to execute
     * @param obj the object hosting the method to displace
     * @param sFn {string} the name of the method to displace
     * @param c The execution context for fn
     * @param arg* {mixed} 0..n additional arguments to supply to the subscriber
     * when the event fires.
     * @return {EventHandle} handle for the subscription
     * @static
     */
    before: function(fn, obj, sFn, c) {
        var f = fn, a;
        if (c) {
            a = [fn, c].concat(Y.Array(arguments, 4, true));
            f = Y.rbind.apply(Y, a);
        }

        return this._inject(DO_BEFORE, f, obj, sFn);
    },

    /**
     * <p>Execute the supplied method after the specified function.  Wrapping
     * function may optionally return an instance of the following classes to
     * further alter runtime behavior:</p>
     * <dl>
     *     <dt></code>Y.Do.Halt(message, returnValue)</code></dt>
     *         <dd>Immediatly stop execution and return
     *         <code>returnValue</code>.  No other wrapping functions will be
     *         executed.</dd>
     *     <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt>
     *         <dd>Return <code>returnValue</code> instead of the wrapped
     *         method's original return value.  This can be further altered by
     *         other after phase wrappers.</dd>
     * </dl>
     *
     * <p>The static properties <code>Y.Do.originalRetVal</code> and
     * <code>Y.Do.currentRetVal</code> will be populated for reference.</p>
     *
     * @method after
     * @param fn {Function} the function to execute
     * @param obj the object hosting the method to displace
     * @param sFn {string} the name of the method to displace
     * @param c The execution context for fn
     * @param arg* {mixed} 0..n additional arguments to supply to the subscriber
     * @return {EventHandle} handle for the subscription
     * @static
     */
    after: function(fn, obj, sFn, c) {
        var f = fn, a;
        if (c) {
            a = [fn, c].concat(Y.Array(arguments, 4, true));
            f = Y.rbind.apply(Y, a);
        }

        return this._inject(DO_AFTER, f, obj, sFn);
    },

    /**
     * Execute the supplied method before or after the specified function.
     * Used by <code>before</code> and <code>after</code>.
     *
     * @method _inject
     * @param when {string} before or after
     * @param fn {Function} the function to execute
     * @param obj the object hosting the method to displace
     * @param sFn {string} the name of the method to displace
     * @param c The execution context for fn
     * @return {EventHandle} handle for the subscription
     * @private
     * @static
     */
    _inject: function(when, fn, obj, sFn) {
        // object id
        var id = Y.stamp(obj), o, sid;

        if (!obj._yuiaop) {
            // create a map entry for the obj if it doesn't exist, to hold overridden methods
            obj._yuiaop = {};
        }

        o = obj._yuiaop;

        if (!o[sFn]) {
            // create a map entry for the method if it doesn't exist
            o[sFn] = new Y.Do.Method(obj, sFn);

            // re-route the method to our wrapper
            obj[sFn] = function() {
                return o[sFn].exec.apply(o[sFn], arguments);
            };
        }

        // subscriber id
        sid = id + Y.stamp(fn) + sFn;

        // register the callback
        o[sFn].register(sid, fn, when);

        return new Y.EventHandle(o[sFn], sid);
    },

    /**
     * Detach a before or after subscription.
     *
     * @method detach
     * @param handle {EventHandle} the subscription handle
     * @static
     */
    detach: function(handle) {
        if (handle.detach) {
            handle.detach();
        }
    }
};

Y.Do = DO;

//////////////////////////////////////////////////////////////////////////

/**
 * Contains the return value from the wrapped method, accessible
 * by 'after' event listeners.
 *
 * @property originalRetVal
 * @static
 * @since 3.2.0
 */

/**
 * Contains the current state of the return value, consumable by
 * 'after' event listeners, and updated if an after subscriber
 * changes the return value generated by the wrapped function.
 *
 * @property currentRetVal
 * @static
 * @since 3.2.0
 */

//////////////////////////////////////////////////////////////////////////

/**
 * Wrapper for a displaced method with aop enabled
 * @class Do.Method
 * @constructor
 * @param obj The object to operate on
 * @param sFn The name of the method to displace
 */
DO.Method = function(obj, sFn) {
    this.obj = obj;
    this.methodName = sFn;
    this.method = obj[sFn];
    this.before = {};
    this.after = {};
};

/**
 * Register a aop subscriber
 * @method register
 * @param sid {string} the subscriber id
 * @param fn {Function} the function to execute
 * @param when {string} when to execute the function
 */
DO.Method.prototype.register = function (sid, fn, when) {
    if (when) {
        this.after[sid] = fn;
    } else {
        this.before[sid] = fn;
    }
};

/**
 * Unregister a aop subscriber
 * @method delete
 * @param sid {string} the subscriber id
 * @param fn {Function} the function to execute
 * @param when {string} when to execute the function
 */
DO.Method.prototype._delete = function (sid) {
    delete this.before[sid];
    delete this.after[sid];
};

/**
 * <p>Execute the wrapped method.  All arguments are passed into the wrapping
 * functions.  If any of the before wrappers return an instance of
 * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped
 * function nor any after phase subscribers will be executed.</p>
 *
 * <p>The return value will be the return value of the wrapped function or one
 * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or
 * <code>Y.Do.AlterReturn</code>.
 *
 * @method exec
 * @param arg* {any} Arguments are passed to the wrapping and wrapped functions
 * @return {any} Return value of wrapped function unless overwritten (see above)
 */
DO.Method.prototype.exec = function () {

    var args = Y.Array(arguments, 0, true),
        i, ret, newRet,
        bf = this.before,
        af = this.after,
        prevented = false;

    // execute before
    for (i in bf) {
        if (bf.hasOwnProperty(i)) {
            ret = bf[i].apply(this.obj, args);
            if (ret) {
                switch (ret.constructor) {
                    case DO.Halt:
                        return ret.retVal;
                    case DO.AlterArgs:
                        args = ret.newArgs;
                        break;
                    case DO.Prevent:
                        prevented = true;
                        break;
                    default:
                }
            }
        }
    }

    // execute method
    if (!prevented) {
        ret = this.method.apply(this.obj, args);
    }

    DO.originalRetVal = ret;
    DO.currentRetVal = ret;

    // execute after methods.
    for (i in af) {
        if (af.hasOwnProperty(i)) {
            newRet = af[i].apply(this.obj, args);
            // Stop processing if a Halt object is returned
            if (newRet && newRet.constructor === DO.Halt) {
                return newRet.retVal;
            // Check for a new return value
            } else if (newRet && newRet.constructor === DO.AlterReturn) {
                ret = newRet.newRetVal;
                // Update the static retval state
                DO.currentRetVal = ret;
            }
        }
    }

    return ret;
};

//////////////////////////////////////////////////////////////////////////

/**
 * Return an AlterArgs object when you want to change the arguments that
 * were passed into the function.  Useful for Do.before subscribers.  An
 * example would be a service that scrubs out illegal characters prior to
 * executing the core business logic.
 * @class Do.AlterArgs
 * @constructor
 * @param msg {String} (optional) Explanation of the altered return value
 * @param newArgs {Array} Call parameters to be used for the original method
 *                        instead of the arguments originally passed in.
 */
DO.AlterArgs = function(msg, newArgs) {
    this.msg = msg;
    this.newArgs = newArgs;
};

/**
 * Return an AlterReturn object when you want to change the result returned
 * from the core method to the caller.  Useful for Do.after subscribers.
 * @class Do.AlterReturn
 * @constructor
 * @param msg {String} (optional) Explanation of the altered return value
 * @param newRetVal {any} Return value passed to code that invoked the wrapped
 *                      function.
 */
DO.AlterReturn = function(msg, newRetVal) {
    this.msg = msg;
    this.newRetVal = newRetVal;
};

/**
 * Return a Halt object when you want to terminate the execution
 * of all subsequent subscribers as well as the wrapped method
 * if it has not exectued yet.  Useful for Do.before subscribers.
 * @class Do.Halt
 * @constructor
 * @param msg {String} (optional) Explanation of why the termination was done
 * @param retVal {any} Return value passed to code that invoked the wrapped
 *                      function.
 */
DO.Halt = function(msg, retVal) {
    this.msg = msg;
    this.retVal = retVal;
};

/**
 * Return a Prevent object when you want to prevent the wrapped function
 * from executing, but want the remaining listeners to execute.  Useful
 * for Do.before subscribers.
 * @class Do.Prevent
 * @constructor
 * @param msg {String} (optional) Explanation of why the termination was done
 */
DO.Prevent = function(msg) {
    this.msg = msg;
};

/**
 * Return an Error object when you want to terminate the execution
 * of all subsequent method calls.
 * @class Do.Error
 * @constructor
 * @param msg {String} (optional) Explanation of the altered return value
 * @param retVal {any} Return value passed to code that invoked the wrapped
 *                      function.
 * @deprecated use Y.Do.Halt or Y.Do.Prevent
 */
DO.Error = DO.Halt;


//////////////////////////////////////////////////////////////////////////

/**
 * Custom event engine, DOM event listener abstraction layer, synthetic DOM
 * events.
 * @module event-custom
 * @submodule event-custom-base
 */


// var onsubscribeType = "_event:onsub",
var YArray = Y.Array,

    AFTER = 'after',
    CONFIGS = [
        'broadcast',
        'monitored',
        'bubbles',
        'context',
        'contextFn',
        'currentTarget',
        'defaultFn',
        'defaultTargetOnly',
        'details',
        'emitFacade',
        'fireOnce',
        'async',
        'host',
        'preventable',
        'preventedFn',
        'queuable',
        'silent',
        'stoppedFn',
        'target',
        'type'
    ],

    CONFIGS_HASH = YArray.hash(CONFIGS),

    nativeSlice = Array.prototype.slice,

    YUI3_SIGNATURE = 9,
    YUI_LOG = 'yui:log',

    mixConfigs = function(r, s, ov) {
        var p;

        for (p in s) {
            if (CONFIGS_HASH[p] && (ov || !(p in r))) {
                r[p] = s[p];
            }
        }

        return r;
    };

/**
 * The CustomEvent class lets you define events for your application
 * that can be subscribed to by one or more independent component.
 *
 * @param {String} type The type of event, which is passed to the callback
 * when the event fires.
 * @param {object} defaults configuration object.
 * @class CustomEvent
 * @constructor
 */

 /**
 * The type of event, returned to subscribers when the event fires
 * @property type
 * @type string
 */

/**
 * By default all custom events are logged in the debug build, set silent
 * to true to disable debug outpu for this event.
 * @property silent
 * @type boolean
 */

Y.CustomEvent = function(type, defaults) {

    this._kds = Y.CustomEvent.keepDeprecatedSubs;

    this.id = Y.guid();

    this.type = type;
    this.silent = this.logSystem = (type === YUI_LOG);

    if (this._kds) {
        /**
         * The subscribers to this event
         * @property subscribers
         * @type Subscriber {}
         * @deprecated
         */

        /**
         * 'After' subscribers
         * @property afters
         * @type Subscriber {}
         * @deprecated
         */
        this.subscribers = {};
        this.afters = {};
    }

    if (defaults) {
        mixConfigs(this, defaults, true);
    }
};

/**
 * Static flag to enable population of the <a href="#property_subscribers">`subscribers`</a>
 * and  <a href="#property_subscribers">`afters`</a> properties held on a `CustomEvent` instance.
 *
 * These properties were changed to private properties (`_subscribers` and `_afters`), and
 * converted from objects to arrays for performance reasons.
 *
 * Setting this property to true will populate the deprecated `subscribers` and `afters`
 * properties for people who may be using them (which is expected to be rare). There will
 * be a performance hit, compared to the new array based implementation.
 *
 * If you are using these deprecated properties for a use case which the public API
 * does not support, please file an enhancement request, and we can provide an alternate
 * public implementation which doesn't have the performance cost required to maintiain the
 * properties as objects.
 *
 * @property keepDeprecatedSubs
 * @static
 * @for CustomEvent
 * @type boolean
 * @default false
 * @deprecated
 */
Y.CustomEvent.keepDeprecatedSubs = false;

Y.CustomEvent.mixConfigs = mixConfigs;

Y.CustomEvent.prototype = {

    constructor: Y.CustomEvent,

    /**
     * Monitor when an event is attached or detached.
     *
     * @property monitored
     * @type boolean
     */

    /**
     * If 0, this event does not broadcast.  If 1, the YUI instance is notified
     * every time this event fires.  If 2, the YUI instance and the YUI global
     * (if event is enabled on the global) are notified every time this event
     * fires.
     * @property broadcast
     * @type int
     */

    /**
     * Specifies whether this event should be queued when the host is actively
     * processing an event.  This will effect exectution order of the callbacks
     * for the various events.
     * @property queuable
     * @type boolean
     * @default false
     */

    /**
     * This event has fired if true
     *
     * @property fired
     * @type boolean
     * @default false;
     */

    /**
     * An array containing the arguments the custom event
     * was last fired with.
     * @property firedWith
     * @type Array
     */

    /**
     * This event should only fire one time if true, and if
     * it has fired, any new subscribers should be notified
     * immediately.
     *
     * @property fireOnce
     * @type boolean
     * @default false;
     */

    /**
     * fireOnce listeners will fire syncronously unless async
     * is set to true
     * @property async
     * @type boolean
     * @default false
     */

    /**
     * Flag for stopPropagation that is modified during fire()
     * 1 means to stop propagation to bubble targets.  2 means
     * to also stop additional subscribers on this target.
     * @property stopped
     * @type int
     */

    /**
     * Flag for preventDefault that is modified during fire().
     * if it is not 0, the default behavior for this event
     * @property prevented
     * @type int
     */

    /**
     * Specifies the host for this custom event.  This is used
     * to enable event bubbling
     * @property host
     * @type EventTarget
     */

    /**
     * The default function to execute after event listeners
     * have fire, but only if the default action was not
     * prevented.
     * @property defaultFn
     * @type Function
     */

    /**
     * Flag for the default function to execute only if the
     * firing event is the current target. This happens only
     * when using custom event delegation and setting the
     * flag to `true` mimics the behavior of event delegation
     * in the DOM.
     *
     * @property defaultTargetOnly
     * @type Boolean
     * @default false
     */

    /**
     * The function to execute if a subscriber calls
     * stopPropagation or stopImmediatePropagation
     * @property stoppedFn
     * @type Function
     */

    /**
     * The function to execute if a subscriber calls
     * preventDefault
     * @property preventedFn
     * @type Function
     */

    /**
     * The subscribers to this event
     * @property _subscribers
     * @type Subscriber []
     * @private
     */

    /**
     * 'After' subscribers
     * @property _afters
     * @type Subscriber []
     * @private
     */

    /**
     * If set to true, the custom event will deliver an EventFacade object
     * that is similar to a DOM event object.
     * @property emitFacade
     * @type boolean
     * @default false
     */

    /**
     * Supports multiple options for listener signatures in order to
     * port YUI 2 apps.
     * @property signature
     * @type int
     * @default 9
     */
    signature : YUI3_SIGNATURE,

    /**
     * The context the the event will fire from by default.  Defaults to the YUI
     * instance.
     * @property context
     * @type object
     */
    context : Y,

    /**
     * Specifies whether or not this event's default function
     * can be cancelled by a subscriber by executing preventDefault()
     * on the event facade
     * @property preventable
     * @type boolean
     * @default true
     */
    preventable : true,

    /**
     * Specifies whether or not a subscriber can stop the event propagation
     * via stopPropagation(), stopImmediatePropagation(), or halt()
     *
     * Events can only bubble if emitFacade is true.
     *
     * @property bubbles
     * @type boolean
     * @default true
     */
    bubbles : true,

    /**
     * Returns the number of subscribers for this event as the sum of the on()
     * subscribers and after() subscribers.
     *
     * @method hasSubs
     * @return Number
     */
    hasSubs: function(when) {
        var s = 0,
            a = 0,
            subs = this._subscribers,
            afters = this._afters,
            sib = this.sibling;

        if (subs) {
            s = subs.length;
        }

        if (afters) {
            a = afters.length;
        }

        if (sib) {
            subs = sib._subscribers;
            afters = sib._afters;

            if (subs) {
                s += subs.length;
            }

            if (afters) {
                a += afters.length;
            }
        }

        if (when) {
            return (when === 'after') ? a : s;
        }

        return (s + a);
    },

    /**
     * Monitor the event state for the subscribed event.  The first parameter
     * is what should be monitored, the rest are the normal parameters when
     * subscribing to an event.
     * @method monitor
     * @param what {string} what to monitor ('detach', 'attach', 'publish').
     * @return {EventHandle} return value from the monitor event subscription.
     */
    monitor: function(what) {
        this.monitored = true;
        var type = this.id + '|' + this.type + '_' + what,
            args = nativeSlice.call(arguments, 0);
        args[0] = type;
        return this.host.on.apply(this.host, args);
    },

    /**
     * Get all of the subscribers to this event and any sibling event
     * @method getSubs
     * @return {Array} first item is the on subscribers, second the after.
     */
    getSubs: function() {

        var sibling = this.sibling,
            subs = this._subscribers,
            afters = this._afters,
            siblingSubs,
            siblingAfters;

        if (sibling) {
            siblingSubs = sibling._subscribers;
            siblingAfters = sibling._afters;
        }

        if (siblingSubs) {
            if (subs) {
                subs = subs.concat(siblingSubs);
            } else {
                subs = siblingSubs.concat();
            }
        } else {
            if (subs) {
                subs = subs.concat();
            } else {
                subs = [];
            }
        }

        if (siblingAfters) {
            if (afters) {
                afters = afters.concat(siblingAfters);
            } else {
                afters = siblingAfters.concat();
            }
        } else {
            if (afters) {
                afters = afters.concat();
            } else {
                afters = [];
            }
        }

        return [subs, afters];
    },

    /**
     * Apply configuration properties.  Only applies the CONFIG whitelist
     * @method applyConfig
     * @param o hash of properties to apply.
     * @param force {boolean} if true, properties that exist on the event
     * will be overwritten.
     */
    applyConfig: function(o, force) {
        mixConfigs(this, o, force);
    },

    /**
     * Create the Subscription for subscribing function, context, and bound
     * arguments.  If this is a fireOnce event, the subscriber is immediately
     * notified.
     *
     * @method _on
     * @param fn {Function} Subscription callback
     * @param [context] {Object} Override `this` in the callback
     * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire()
     * @param [when] {String} "after" to slot into after subscribers
     * @return {EventHandle}
     * @protected
     */
    _on: function(fn, context, args, when) {


        var s = new Y.Subscriber(fn, context, args, when),
            firedWith;

        if (this.fireOnce && this.fired) {

            firedWith = this.firedWith;

            // It's a little ugly for this to know about facades,
            // but given the current breakup, not much choice without
            // moving a whole lot of stuff around.
            if (this.emitFacade && this._addFacadeToArgs) {
                this._addFacadeToArgs(firedWith);
            }

            if (this.async) {
                setTimeout(Y.bind(this._notify, this, s, firedWith), 0);
            } else {
                this._notify(s, firedWith);
            }
        }

        if (when === AFTER) {
            if (!this._afters) {
                this._afters = [];
            }
            this._afters.push(s);
        } else {
            if (!this._subscribers) {
                this._subscribers = [];
            }
            this._subscribers.push(s);
        }

        if (this._kds) {
            if (when === AFTER) {
                this.afters[s.id] = s;
            } else {
                this.subscribers[s.id] = s;
            }
        }

        return new Y.EventHandle(this, s);
    },

    /**
     * Listen for this event
     * @method subscribe
     * @param {Function} fn The function to execute.
     * @return {EventHandle} Unsubscribe handle.
     * @deprecated use on.
     */
    subscribe: function(fn, context) {
        var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
        return this._on(fn, context, a, true);
    },

    /**
     * Listen for this event
     * @method on
     * @param {Function} fn The function to execute.
     * @param {object} context optional execution context.
     * @param {mixed} arg* 0..n additional arguments to supply to the subscriber
     * when the event fires.
     * @return {EventHandle} An object with a detach method to detch the handler(s).
     */
    on: function(fn, context) {
        var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;

        if (this.monitored && this.host) {
            this.host._monitor('attach', this, {
                args: arguments
            });
        }
        return this._on(fn, context, a, true);
    },

    /**
     * Listen for this event after the normal subscribers have been notified and
     * the default behavior has been applied.  If a normal subscriber prevents the
     * default behavior, it also prevents after listeners from firing.
     * @method after
     * @param {Function} fn The function to execute.
     * @param {object} context optional execution context.
     * @param {mixed} arg* 0..n additional arguments to supply to the subscriber
     * when the event fires.
     * @return {EventHandle} handle Unsubscribe handle.
     */
    after: function(fn, context) {
        var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
        return this._on(fn, context, a, AFTER);
    },

    /**
     * Detach listeners.
     * @method detach
     * @param {Function} fn  The subscribed function to remove, if not supplied
     *                       all will be removed.
     * @param {Object}   context The context object passed to subscribe.
     * @return {Number} returns the number of subscribers unsubscribed.
     */
    detach: function(fn, context) {
        // unsubscribe handle
        if (fn && fn.detach) {
            return fn.detach();
        }

        var i, s,
            found = 0,
            subs = this._subscribers,
            afters = this._afters;

        if (subs) {
            for (i = subs.length; i >= 0; i--) {
                s = subs[i];
                if (s && (!fn || fn === s.fn)) {
                    this._delete(s, subs, i);
                    found++;
                }
            }
        }

        if (afters) {
            for (i = afters.length; i >= 0; i--) {
                s = afters[i];
                if (s && (!fn || fn === s.fn)) {
                    this._delete(s, afters, i);
                    found++;
                }
            }
        }

        return found;
    },

    /**
     * Detach listeners.
     * @method unsubscribe
     * @param {Function} fn  The subscribed function to remove, if not supplied
     *                       all will be removed.
     * @param {Object}   context The context object passed to subscribe.
     * @return {int|undefined} returns the number of subscribers unsubscribed.
     * @deprecated use detach.
     */
    unsubscribe: function() {
        return this.detach.apply(this, arguments);
    },

    /**
     * Notify a single subscriber
     * @method _notify
     * @param {Subscriber} s the subscriber.
     * @param {Array} args the arguments array to apply to the listener.
     * @protected
     */
    _notify: function(s, args, ef) {


        var ret;

        ret = s.notify(args, this);

        if (false === ret || this.stopped > 1) {
            return false;
        }

        return true;
    },

    /**
     * Logger abstraction to centralize the application of the silent flag
     * @method log
     * @param {string} msg message to log.
     * @param {string} cat log category.
     */
    log: function(msg, cat) {
    },

    /**
     * Notifies the subscribers.  The callback functions will be executed
     * from the context specified when the event was created, and with the
     * following parameters:
     *   <ul>
     *   <li>The type of event</li>
     *   <li>All of the arguments fire() was executed with as an array</li>
     *   <li>The custom object (if any) that was passed into the subscribe()
     *       method</li>
     *   </ul>
     * @method fire
     * @param {Object*} arguments an arbitrary set of parameters to pass to
     *                            the handler.
     * @return {boolean} false if one of the subscribers returned false,
     *                   true otherwise.
     *
     */
    fire: function() {

        // push is the fastest way to go from arguments to arrays
        // for most browsers currently
        // http://jsperf.com/push-vs-concat-vs-slice/2

        var args = [];
        args.push.apply(args, arguments);

        return this._fire(args);
    },

    /**
     * Private internal implementation for `fire`, which is can be used directly by
     * `EventTarget` and other event module classes which have already converted from
     * an `arguments` list to an array, to avoid the repeated overhead.
     *
     * @method _fire
     * @private
     * @param {Array} args The array of arguments passed to be passed to handlers.
     * @return {boolean} false if one of the subscribers returned false, true otherwise.
     */
    _fire: function(args) {

        if (this.fireOnce && this.fired) {
            return true;
        } else {

            // this doesn't happen if the event isn't published
            // this.host._monitor('fire', this.type, args);

            this.fired = true;

            if (this.fireOnce) {
                this.firedWith = args;
            }

            if (this.emitFacade) {
                return this.fireComplex(args);
            } else {
                return this.fireSimple(args);
            }
        }
    },

    /**
     * Set up for notifying subscribers of non-emitFacade events.
     *
     * @method fireSimple
     * @param args {Array} Arguments passed to fire()
     * @return Boolean false if a subscriber returned false
     * @protected
     */
    fireSimple: function(args) {
        this.stopped = 0;
        this.prevented = 0;
        if (this.hasSubs()) {
            var subs = this.getSubs();
            this._procSubs(subs[0], args);
            this._procSubs(subs[1], args);
        }
        if (this.broadcast) {
            this._broadcast(args);
        }
        return this.stopped ? false : true;
    },

    // Requires the event-custom-complex module for full funcitonality.
    fireComplex: function(args) {
        args[0] = args[0] || {};
        return this.fireSimple(args);
    },

    /**
     * Notifies a list of subscribers.
     *
     * @method _procSubs
     * @param subs {Array} List of subscribers
     * @param args {Array} Arguments passed to fire()
     * @param ef {}
     * @return Boolean false if a subscriber returns false or stops the event
     *              propagation via e.stopPropagation(),
     *              e.stopImmediatePropagation(), or e.halt()
     * @private
     */
    _procSubs: function(subs, args, ef) {
        var s, i, l;

        for (i = 0, l = subs.length; i < l; i++) {
            s = subs[i];
            if (s && s.fn) {
                if (false === this._notify(s, args, ef)) {
                    this.stopped = 2;
                }
                if (this.stopped === 2) {
                    return false;
                }
            }
        }

        return true;
    },

    /**
     * Notifies the YUI instance if the event is configured with broadcast = 1,
     * and both the YUI instance and Y.Global if configured with broadcast = 2.
     *
     * @method _broadcast
     * @param args {Array} Arguments sent to fire()
     * @private
     */
    _broadcast: function(args) {
        if (!this.stopped && this.broadcast) {

            var a = args.concat();
            a.unshift(this.type);

            if (this.host !== Y) {
                Y.fire.apply(Y, a);
            }

            if (this.broadcast === 2) {
                Y.Global.fire.apply(Y.Global, a);
            }
        }
    },

    /**
     * Removes all listeners
     * @method unsubscribeAll
     * @return {Number} The number of listeners unsubscribed.
     * @deprecated use detachAll.
     */
    unsubscribeAll: function() {
        return this.detachAll.apply(this, arguments);
    },

    /**
     * Removes all listeners
     * @method detachAll
     * @return {Number} The number of listeners unsubscribed.
     */
    detachAll: function() {
        return this.detach();
    },

    /**
     * Deletes the subscriber from the internal store of on() and after()
     * subscribers.
     *
     * @method _delete
     * @param s subscriber object.
     * @param subs (optional) on or after subscriber array
     * @param index (optional) The index found.
     * @private
     */
    _delete: function(s, subs, i) {
        var when = s._when;

        if (!subs) {
            subs = (when === AFTER) ? this._afters : this._subscribers;
        }

        if (subs) {
            i = YArray.indexOf(subs, s, 0);

            if (s && subs[i] === s) {
                subs.splice(i, 1);
            }
        }

        if (this._kds) {
            if (when === AFTER) {
                delete this.afters[s.id];
            } else {
                delete this.subscribers[s.id];
            }
        }

        if (this.monitored && this.host) {
            this.host._monitor('detach', this, {
                ce: this,
                sub: s
            });
        }

        if (s) {
            s.deleted = true;
        }
    }
};
/**
 * Stores the subscriber information to be used when the event fires.
 * @param {Function} fn       The wrapped function to execute.
 * @param {Object}   context  The value of the keyword 'this' in the listener.
 * @param {Array} args*       0..n additional arguments to supply the listener.
 *
 * @class Subscriber
 * @constructor
 */
Y.Subscriber = function(fn, context, args, when) {

    /**
     * The callback that will be execute when the event fires
     * This is wrapped by Y.rbind if obj was supplied.
     * @property fn
     * @type Function
     */
    this.fn = fn;

    /**
     * Optional 'this' keyword for the listener
     * @property context
     * @type Object
     */
    this.context = context;

    /**
     * Unique subscriber id
     * @property id
     * @type String
     */
    this.id = Y.guid();

    /**
     * Additional arguments to propagate to the subscriber
     * @property args
     * @type Array
     */
    this.args = args;

    this._when = when;

    /**
     * Custom events for a given fire transaction.
     * @property events
     * @type {EventTarget}
     */
    // this.events = null;

    /**
     * This listener only reacts to the event once
     * @property once
     */
    // this.once = false;

};

Y.Subscriber.prototype = {
    constructor: Y.Subscriber,

    _notify: function(c, args, ce) {
        if (this.deleted && !this.postponed) {
            if (this.postponed) {
                delete this.fn;
                delete this.context;
            } else {
                delete this.postponed;
                return null;
            }
        }
        var a = this.args, ret;
        switch (ce.signature) {
            case 0:
                ret = this.fn.call(c, ce.type, args, c);
                break;
            case 1:
                ret = this.fn.call(c, args[0] || null, c);
                break;
            default:
                if (a || args) {
                    args = args || [];
                    a = (a) ? args.concat(a) : args;
                    ret = this.fn.apply(c, a);
                } else {
                    ret = this.fn.call(c);
                }
        }

        if (this.once) {
            ce._delete(this);
        }

        return ret;
    },

    /**
     * Executes the subscriber.
     * @method notify
     * @param args {Array} Arguments array for the subscriber.
     * @param ce {CustomEvent} The custom event that sent the notification.
     */
    notify: function(args, ce) {
        var c = this.context,
            ret = true;

        if (!c) {
            c = (ce.contextFn) ? ce.contextFn() : ce.context;
        }

        // only catch errors if we will not re-throw them.
        if (Y.config && Y.config.throwFail) {
            ret = this._notify(c, args, ce);
        } else {
            try {
                ret = this._notify(c, args, ce);
            } catch (e) {
                Y.error(this + ' failed: ' + e.message, e);
            }
        }

        return ret;
    },

    /**
     * Returns true if the fn and obj match this objects properties.
     * Used by the unsubscribe method to match the right subscriber.
     *
     * @method contains
     * @param {Function} fn the function to execute.
     * @param {Object} context optional 'this' keyword for the listener.
     * @return {boolean} true if the supplied arguments match this
     *                   subscriber's signature.
     */
    contains: function(fn, context) {
        if (context) {
            return ((this.fn === fn) && this.context === context);
        } else {
            return (this.fn === fn);
        }
    },

    valueOf : function() {
        return this.id;
    }

};
/**
 * Return value from all subscribe operations
 * @class EventHandle
 * @constructor
 * @param {CustomEvent} evt the custom event.
 * @param {Subscriber} sub the subscriber.
 */
Y.EventHandle = function(evt, sub) {

    /**
     * The custom event
     *
     * @property evt
     * @type CustomEvent
     */
    this.evt = evt;

    /**
     * The subscriber object
     *
     * @property sub
     * @type Subscriber
     */
    this.sub = sub;
};

Y.EventHandle.prototype = {
    batch: function(f, c) {
        f.call(c || this, this);
        if (Y.Lang.isArray(this.evt)) {
            Y.Array.each(this.evt, function(h) {
                h.batch.call(c || h, f);
            });
        }
    },

    /**
     * Detaches this subscriber
     * @method detach
     * @return {Number} the number of detached listeners
     */
    detach: function() {
        var evt = this.evt, detached = 0, i;
        if (evt) {
            if (Y.Lang.isArray(evt)) {
                for (i = 0; i < evt.length; i++) {
                    detached += evt[i].detach();
                }
            } else {
                evt._delete(this.sub);
                detached = 1;
            }

        }

        return detached;
    },

    /**
     * Monitor the event state for the subscribed event.  The first parameter
     * is what should be monitored, the rest are the normal parameters when
     * subscribing to an event.
     * @method monitor
     * @param what {string} what to monitor ('attach', 'detach', 'publish').
     * @return {EventHandle} return value from the monitor event subscription.
     */
    monitor: function(what) {
        return this.evt.monitor.apply(this.evt, arguments);
    }
};

/**
 * Custom event engine, DOM event listener abstraction layer, synthetic DOM
 * events.
 * @module event-custom
 * @submodule event-custom-base
 */

/**
 * EventTarget provides the implementation for any object to
 * publish, subscribe and fire to custom events, and also
 * alows other EventTargets to target the object with events
 * sourced from the other object.
 * EventTarget is designed to be used with Y.augment to wrap
 * EventCustom in an interface that allows events to be listened to
 * and fired by name.  This makes it possible for implementing code to
 * subscribe to an event that either has not been created yet, or will
 * not be created at all.
 * @class EventTarget
 * @param opts a configuration object
 * @config emitFacade {boolean} if true, all events will emit event
 * facade payloads by default (default false)
 * @config prefix {String} the prefix to apply to non-prefixed event names
 */

var L = Y.Lang,
    PREFIX_DELIMITER = ':',
    CATEGORY_DELIMITER = '|',
    AFTER_PREFIX = '~AFTER~',
    WILD_TYPE_RE = /(.*?)(:)(.*?)/,

    _wildType = Y.cached(function(type) {
        return type.replace(WILD_TYPE_RE, "*$2$3");
    }),

    /**
     * If the instance has a prefix attribute and the
     * event type is not prefixed, the instance prefix is
     * applied to the supplied type.
     * @method _getType
     * @private
     */
    _getType = function(type, pre) {

        if (!pre || (typeof type !== "string") || type.indexOf(PREFIX_DELIMITER) > -1) {
            return type;
        }

        return pre + PREFIX_DELIMITER + type;
    },

    /**
     * Returns an array with the detach key (if provided),
     * and the prefixed event name from _getType
     * Y.on('detachcategory| menu:click', fn)
     * @method _parseType
     * @private
     */
    _parseType = Y.cached(function(type, pre) {

        var t = type, detachcategory, after, i;

        if (!L.isString(t)) {
            return t;
        }

        i = t.indexOf(AFTER_PREFIX);

        if (i > -1) {
            after = true;
            t = t.substr(AFTER_PREFIX.length);
        }

        i = t.indexOf(CATEGORY_DELIMITER);

        if (i > -1) {
            detachcategory = t.substr(0, (i));
            t = t.substr(i+1);
            if (t === '*') {
                t = null;
            }
        }

        // detach category, full type with instance prefix, is this an after listener, short type
        return [detachcategory, (pre) ? _getType(t, pre) : t, after, t];
    }),

    ET = function(opts) {

        var etState = this._yuievt,
            etConfig;

        if (!etState) {
            etState = this._yuievt = {
                events: {},    // PERF: Not much point instantiating lazily. We're bound to have events
                targets: null, // PERF: Instantiate lazily, if user actually adds target,
                config: {
                    host: this,
                    context: this
                },
                chain: Y.config.chain
            };
        }

        etConfig = etState.config;

        if (opts) {
            mixConfigs(etConfig, opts, true);

            if (opts.chain !== undefined) {
                etState.chain = opts.chain;
            }

            if (opts.prefix) {
                etConfig.prefix = opts.prefix;
            }
        }
    };

ET.prototype = {

    constructor: ET,

    /**
     * Listen to a custom event hosted by this object one time.
     * This is the equivalent to <code>on</code> except the
     * listener is immediatelly detached when it is executed.
     * @method once
     * @param {String} type The name of the event
     * @param {Function} fn The callback to execute in response to the event
     * @param {Object} [context] Override `this` object in callback
     * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
     * @return {EventHandle} A subscription handle capable of detaching the
     *                       subscription
     */
    once: function() {
        var handle = this.on.apply(this, arguments);
        handle.batch(function(hand) {
            if (hand.sub) {
                hand.sub.once = true;
            }
        });
        return handle;
    },

    /**
     * Listen to a custom event hosted by this object one time.
     * This is the equivalent to <code>after</code> except the
     * listener is immediatelly detached when it is executed.
     * @method onceAfter
     * @param {String} type The name of the event
     * @param {Function} fn The callback to execute in response to the event
     * @param {Object} [context] Override `this` object in callback
     * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
     * @return {EventHandle} A subscription handle capable of detaching that
     *                       subscription
     */
    onceAfter: function() {
        var handle = this.after.apply(this, arguments);
        handle.batch(function(hand) {
            if (hand.sub) {
                hand.sub.once = true;
            }
        });
        return handle;
    },

    /**
     * Takes the type parameter passed to 'on' and parses out the
     * various pieces that could be included in the type.  If the
     * event type is passed without a prefix, it will be expanded
     * to include the prefix one is supplied or the event target
     * is configured with a default prefix.
     * @method parseType
     * @param {String} type the type
     * @param {String} [pre] The prefix. Defaults to this._yuievt.config.prefix
     * @since 3.3.0
     * @return {Array} an array containing:
     *  * the detach category, if supplied,
     *  * the prefixed event type,
     *  * whether or not this is an after listener,
     *  * the supplied event type
     */
    parseType: function(type, pre) {
        return _parseType(type, pre || this._yuievt.config.prefix);
    },

    /**
     * Subscribe a callback function to a custom event fired by this object or
     * from an object that bubbles its events to this object.
     *
     *      this.on("change", this._onChange, this);
     *
     * Callback functions for events published with `emitFacade = true` will
     * receive an `EventFacade` as the first argument (typically named "e").
     * These callbacks can then call `e.preventDefault()` to disable the
     * behavior published to that event's `defaultFn`.  See the `EventFacade`
     * API for all available properties and methods. Subscribers to
     * non-`emitFacade` events will receive the arguments passed to `fire()`
     * after the event name.
     *
     * To subscribe to multiple events at once, pass an object as the first
     * argument, where the key:value pairs correspond to the eventName:callback.
     *
     *      this.on({
     *          "attrChange" : this._onAttrChange,
     *          "change"     : this._onChange
     *      });
     *
     * You can also pass an array of event names as the first argument to
     * subscribe to all listed events with the same callback.
     *
     *      this.on([ "change", "attrChange" ], this._onChange);
     *
     * Returning `false` from a callback is supported as an alternative to
     * calling `e.preventDefault(); e.stopPropagation();`.  However, it is
     * recommended to use the event methods whenever possible.
     *
     * @method on
     * @param {String} type The name of the event
     * @param {Function} fn The callback to execute in response to the event
     * @param {Object} [context] Override `this` object in callback
     * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
     * @return {EventHandle} A subscription handle capable of detaching that
     *                       subscription
     */
    on: function(type, fn, context) {

        var yuievt = this._yuievt,
            parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce,
            detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype,
            Node = Y.Node, n, domevent, isArr;

        // full name, args, detachcategory, after
        this._monitor('attach', parts[1], {
            args: arguments,
            category: parts[0],
            after: parts[2]
        });

        if (L.isObject(type)) {

            if (L.isFunction(type)) {
                return Y.Do.before.apply(Y.Do, arguments);
            }

            f = fn;
            c = context;
            args = nativeSlice.call(arguments, 0);
            ret = [];

            if (L.isArray(type)) {
                isArr = true;
            }

            after = type._after;
            delete type._after;

            Y.each(type, function(v, k) {

                if (L.isObject(v)) {
                    f = v.fn || ((L.isFunction(v)) ? v : f);
                    c = v.context || c;
                }

                var nv = (after) ? AFTER_PREFIX : '';

                args[0] = nv + ((isArr) ? v : k);
                args[1] = f;
                args[2] = c;

                ret.push(this.on.apply(this, args));

            }, this);

            return (yuievt.chain) ? this : new Y.EventHandle(ret);
        }

        detachcategory = parts[0];
        after = parts[2];
        shorttype = parts[3];

        // extra redirection so we catch adaptor events too.  take a look at this.
        if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) {
            args = nativeSlice.call(arguments, 0);
            args.splice(2, 0, Node.getDOMNode(this));
            return Y.on.apply(Y, args);
        }

        type = parts[1];

        if (Y.instanceOf(this, YUI)) {

            adapt = Y.Env.evt.plugins[type];
            args  = nativeSlice.call(arguments, 0);
            args[0] = shorttype;

            if (Node) {
                n = args[2];

                if (Y.instanceOf(n, Y.NodeList)) {
                    n = Y.NodeList.getDOMNodes(n);
                } else if (Y.instanceOf(n, Node)) {
                    n = Node.getDOMNode(n);
                }

                domevent = (shorttype in Node.DOM_EVENTS);

                // Captures both DOM events and event plugins.
                if (domevent) {
                    args[2] = n;
                }
            }

            // check for the existance of an event adaptor
            if (adapt) {
                handle = adapt.on.apply(Y, args);
            } else if ((!type) || domevent) {
                handle = Y.Event._attach(args);
            }

        }

        if (!handle) {
            ce = yuievt.events[type] || this.publish(type);
            handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);

            // TODO: More robust regex, accounting for category
            if (type.indexOf("*:") !== -1) {
                this._hasSiblings = true;
            }
        }

        if (detachcategory) {
            store[detachcategory] = store[detachcategory] || {};
            store[detachcategory][type] = store[detachcategory][type] || [];
            store[detachcategory][type].push(handle);
        }

        return (yuievt.chain) ? this : handle;

    },

    /**
     * subscribe to an event
     * @method subscribe
     * @deprecated use on
     */
    subscribe: function() {
        return this.on.apply(this, arguments);
    },

    /**
     * Detach one or more listeners the from the specified event
     * @method detach
     * @param type {string|Object}   Either the handle to the subscriber or the
     *                        type of event.  If the type
     *                        is not specified, it will attempt to remove
     *                        the listener from all hosted events.
     * @param fn   {Function} The subscribed function to unsubscribe, if not
     *                          supplied, all subscribers will be removed.
     * @param context  {Object}   The custom object passed to subscribe.  This is
     *                        optional, but if supplied will be used to
     *                        disambiguate multiple listeners that are the same
     *                        (e.g., you subscribe many object using a function
     *                        that lives on the prototype)
     * @return {EventTarget} the host
     */
    detach: function(type, fn, context) {

        var evts = this._yuievt.events,
            i,
            Node = Y.Node,
            isNode = Node && (Y.instanceOf(this, Node));

        // detachAll disabled on the Y instance.
        if (!type && (this !== Y)) {
            for (i in evts) {
                if (evts.hasOwnProperty(i)) {
                    evts[i].detach(fn, context);
                }
            }
            if (isNode) {
                Y.Event.purgeElement(Node.getDOMNode(this));
            }

            return this;
        }

        var parts = _parseType(type, this._yuievt.config.prefix),
        detachcategory = L.isArray(parts) ? parts[0] : null,
        shorttype = (parts) ? parts[3] : null,
        adapt, store = Y.Env.evt.handles, detachhost, cat, args,
        ce,

        keyDetacher = function(lcat, ltype, host) {
            var handles = lcat[ltype], ce, i;
            if (handles) {
                for (i = handles.length - 1; i >= 0; --i) {
                    ce = handles[i].evt;
                    if (ce.host === host || ce.el === host) {
                        handles[i].detach();
                    }
                }
            }
        };

        if (detachcategory) {

            cat = store[detachcategory];
            type = parts[1];
            detachhost = (isNode) ? Y.Node.getDOMNode(this) : this;

            if (cat) {
                if (type) {
                    keyDetacher(cat, type, detachhost);
                } else {
                    for (i in cat) {
                        if (cat.hasOwnProperty(i)) {
                            keyDetacher(cat, i, detachhost);
                        }
                    }
                }

                return this;
            }

        // If this is an event handle, use it to detach
        } else if (L.isObject(type) && type.detach) {
            type.detach();
            return this;
        // extra redirection so we catch adaptor events too.  take a look at this.
        } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) {
            args = nativeSlice.call(arguments, 0);
            args[2] = Node.getDOMNode(this);
            Y.detach.apply(Y, args);
            return this;
        }

        adapt = Y.Env.evt.plugins[shorttype];

        // The YUI instance handles DOM events and adaptors
        if (Y.instanceOf(this, YUI)) {
            args = nativeSlice.call(arguments, 0);
            // use the adaptor specific detach code if
            if (adapt && adapt.detach) {
                adapt.detach.apply(Y, args);
                return this;
            // DOM event fork
            } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) {
                args[0] = type;
                Y.Event.detach.apply(Y.Event, args);
                return this;
            }
        }

        // ce = evts[type];
        ce = evts[parts[1]];
        if (ce) {
            ce.detach(fn, context);
        }

        return this;
    },

    /**
     * detach a listener
     * @method unsubscribe
     * @deprecated use detach
     */
    unsubscribe: function() {
        return this.detach.apply(this, arguments);
    },

    /**
     * Removes all listeners from the specified event.  If the event type
     * is not specified, all listeners from all hosted custom events will
     * be removed.
     * @method detachAll
     * @param type {String}   The type, or name of the event
     */
    detachAll: function(type) {
        return this.detach(type);
    },

    /**
     * Removes all listeners from the specified event.  If the event type
     * is not specified, all listeners from all hosted custom events will
     * be removed.
     * @method unsubscribeAll
     * @param type {String}   The type, or name of the event
     * @deprecated use detachAll
     */
    unsubscribeAll: function() {
        return this.detachAll.apply(this, arguments);
    },

    /**
     * Creates a new custom event of the specified type.  If a custom event
     * by that name already exists, it will not be re-created.  In either
     * case the custom event is returned.
     *
     * @method publish
     *
     * @param type {String} the type, or name of the event
     * @param opts {object} optional config params.  Valid properties are:
     * @param [opts.broadcast=false] {Boolean} whether or not the YUI instance and YUI global
     *      are notified when the event is fired.
     * @param [opts.bubbles=true] {Boolean} Whether or not this event bubbles. Events can
     *      only bubble if `emitFacade` is true.
     * @param [opts.context=this] {Object} the default execution context for the listeners.
     * @param [opts.defaultFn] {Function} the default function to execute when this event
     *      fires if preventDefault was not called.
     * @param [opts.emitFacade=false] {Boolean} whether or not this event emits a facade.
     * @param [opts.prefix] {String} the prefix for this targets events, e.g., 'menu' in 'menu:click'.
     * @param [opts.fireOnce=false] {Boolean} if an event is configured to fire once,
     *      new subscribers after the fire will be notified immediately.
     * @param [opts.async=false] {Boolean} fireOnce event listeners will fire synchronously
     *      if the event has already fired unless `async` is `true`.
     * @param [opts.preventable=true] {Boolean} whether or not `preventDefault()` has an effect.
     * @param [opts.preventedFn] {Function} a function that is executed when `preventDefault()` is called.
     * @param [opts.queuable=false] {Boolean} whether or not this event can be queued during bubbling.
     * @param [opts.silent] {Boolean} if silent is true, debug messages are not provided for this event.
     * @param [opts.stoppedFn] {Function} a function that is executed when stopPropagation is called.
     * @param [opts.monitored] {Boolean} specifies whether or not this event should send notifications about
     *      when the event has been attached, detached, or published.
     * @param [opts.type] {String} the event type (valid option if not provided as the first parameter to publish).
     *
     * @return {CustomEvent} the custom event
     *
     */
    publish: function(type, opts) {

        var ret,
            etState = this._yuievt,
            etConfig = etState.config,
            pre = etConfig.prefix;

        if (typeof type === "string")  {
            if (pre) {
                type = _getType(type, pre);
            }
            ret = this._publish(type, etConfig, opts);
        } else {
            ret = {};

            Y.each(type, function(v, k) {
                if (pre) {
                    k = _getType(k, pre);
                }
                ret[k] = this._publish(k, etConfig, v || opts);
            }, this);

        }

        return ret;
    },

    /**
     * Returns the fully qualified type, given a short type string.
     * That is, returns "foo:bar" when given "bar" if "foo" is the configured prefix.
     *
     * NOTE: This method, unlike _getType, does no checking of the value passed in, and
     * is designed to be used with the low level _publish() method, for critical path
     * implementations which need to fast-track publish for performance reasons.
     *
     * @method _getFullType
     * @private
     * @param {String} type The short type to prefix
     * @return {String} The prefixed type, if a prefix is set, otherwise the type passed in
     */
    _getFullType : function(type) {

        var pre = this._yuievt.config.prefix;

        if (pre) {
            return pre + PREFIX_DELIMITER + type;
        } else {
            return type;
        }
    },

    /**
     * The low level event publish implementation. It expects all the massaging to have been done
     * outside of this method. e.g. the `type` to `fullType` conversion. It's designed to be a fast
     * path publish, which can be used by critical code paths to improve performance.
     *
     * @method _publish
     * @private
     * @param {String} fullType The prefixed type of the event to publish.
     * @param {Object} etOpts The EventTarget specific configuration to mix into the published event.
     * @param {Object} ceOpts The publish specific configuration to mix into the published event.
     * @return {CustomEvent} The published event. If called without `etOpts` or `ceOpts`, this will
     * be the default `CustomEvent` instance, and can be configured independently.
     */
    _publish : function(fullType, etOpts, ceOpts) {

        var ce,
            etState = this._yuievt,
            etConfig = etState.config,
            host = etConfig.host,
            context = etConfig.context,
            events = etState.events;

        ce = events[fullType];

        // PERF: Hate to pull the check out of monitor, but trying to keep critical path tight.
        if ((etConfig.monitored && !ce) || (ce && ce.monitored)) {
            this._monitor('publish', fullType, {
                args: arguments
            });
        }

        if (!ce) {
            // Publish event
            ce = events[fullType] = new Y.CustomEvent(fullType, etOpts);

            if (!etOpts) {
                ce.host = host;
                ce.context = context;
            }
        }

        if (ceOpts) {
            mixConfigs(ce, ceOpts, true);
        }

        return ce;
    },

    /**
     * This is the entry point for the event monitoring system.
     * You can monitor 'attach', 'detach', 'fire', and 'publish'.
     * When configured, these events generate an event.  click ->
     * click_attach, click_detach, click_publish -- these can
     * be subscribed to like other events to monitor the event
     * system.  Inividual published events can have monitoring
     * turned on or off (publish can't be turned off before it
     * it published) by setting the events 'monitor' config.
     *
     * @method _monitor
     * @param what {String} 'attach', 'detach', 'fire', or 'publish'
     * @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object.
     * @param o {Object} Information about the event interaction, such as
     *                  fire() args, subscription category, publish config
     * @private
     */
    _monitor: function(what, eventType, o) {
        var monitorevt, ce, type;

        if (eventType) {
            if (typeof eventType === "string") {
                type = eventType;
                ce = this.getEvent(eventType, true);
            } else {
                ce = eventType;
                type = eventType.type;
            }

            if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {
                monitorevt = type + '_' + what;
                o.monitored = what;
                this.fire.call(this, monitorevt, o);
            }
        }
    },

    /**
     * Fire a custom event by name.  The callback functions will be executed
     * from the context specified when the event was created, and with the
     * following parameters.
     *
     * The first argument is the event type, and any additional arguments are
     * passed to the listeners as parameters.  If the first of these is an
     * object literal, and the event is configured to emit an event facade,
     * that object is mixed into the event facade and the facade is provided
     * in place of the original object.
     *
     * If the custom event object hasn't been created, then the event hasn't
     * been published and it has no subscribers.  For performance sake, we
     * immediate exit in this case.  This means the event won't bubble, so
     * if the intention is that a bubble target be notified, the event must
     * be published on this object first.
     *
     * @method fire
     * @param type {String|Object} The type of the event, or an object that contains
     * a 'type' property.
     * @param arguments {Object*} an arbitrary set of parameters to pass to
     * the handler.  If the first of these is an object literal and the event is
     * configured to emit an event facade, the event facade will replace that
     * parameter after the properties the object literal contains are copied to
     * the event facade.
     * @return {Boolean} True if the whole lifecycle of the event went through,
     * false if at any point the event propagation was halted.
     */
    fire: function(type) {

        var typeIncluded = (typeof type === "string"),
            argCount = arguments.length,
            t = type,
            yuievt = this._yuievt,
            etConfig = yuievt.config,
            pre = etConfig.prefix,
            ret,
            ce,
            ce2,
            args;

        if (typeIncluded && argCount <= 3) {

            // PERF: Try to avoid slice/iteration for the common signatures

            // Most common
            if (argCount === 2) {
                args = [arguments[1]]; // fire("foo", {})
            } else if (argCount === 3) {
                args = [arguments[1], arguments[2]]; // fire("foo", {}, opts)
            } else {
                args = []; // fire("foo")
            }

        } else {
            args = nativeSlice.call(arguments, ((typeIncluded) ? 1 : 0));
        }

        if (!typeIncluded) {
            t = (type && type.type);
        }

        if (pre) {
            t = _getType(t, pre);
        }

        ce = yuievt.events[t];

        if (this._hasSiblings) {
            ce2 = this.getSibling(t, ce);

            if (ce2 && !ce) {
                ce = this.publish(t);
            }
        }

        // PERF: trying to avoid function call, since this is a critical path
        if ((etConfig.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {
            this._monitor('fire', (ce || t), {
                args: args
            });
        }

        // this event has not been published or subscribed to
        if (!ce) {
            if (yuievt.hasTargets) {
                return this.bubble({ type: t }, args, this);
            }

            // otherwise there is nothing to be done
            ret = true;
        } else {

            if (ce2) {
                ce.sibling = ce2;
            }

            ret = ce._fire(args);
        }

        return (yuievt.chain) ? this : ret;
    },

    getSibling: function(type, ce) {
        var ce2;

        // delegate to *:type events if there are subscribers
        if (type.indexOf(PREFIX_DELIMITER) > -1) {
            type = _wildType(type);
            ce2 = this.getEvent(type, true);
            if (ce2) {
                ce2.applyConfig(ce);
                ce2.bubbles = false;
                ce2.broadcast = 0;
            }
        }

        return ce2;
    },

    /**
     * Returns the custom event of the provided type has been created, a
     * falsy value otherwise
     * @method getEvent
     * @param type {String} the type, or name of the event
     * @param prefixed {String} if true, the type is prefixed already
     * @return {CustomEvent} the custom event or null
     */
    getEvent: function(type, prefixed) {
        var pre, e;

        if (!prefixed) {
            pre = this._yuievt.config.prefix;
            type = (pre) ? _getType(type, pre) : type;
        }
        e = this._yuievt.events;
        return e[type] || null;
    },

    /**
     * Subscribe to a custom event hosted by this object.  The
     * supplied callback will execute after any listeners add
     * via the subscribe method, and after the default function,
     * if configured for the event, has executed.
     *
     * @method after
     * @param {String} type The name of the event
     * @param {Function} fn The callback to execute in response to the event
     * @param {Object} [context] Override `this` object in callback
     * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
     * @return {EventHandle} A subscription handle capable of detaching the
     *                       subscription
     */
    after: function(type, fn) {

        var a = nativeSlice.call(arguments, 0);

        switch (L.type(type)) {
            case 'function':
                return Y.Do.after.apply(Y.Do, arguments);
            case 'array':
            //     YArray.each(a[0], function(v) {
            //         v = AFTER_PREFIX + v;
            //     });
            //     break;
            case 'object':
                a[0]._after = true;
                break;
            default:
                a[0] = AFTER_PREFIX + type;
        }

        return this.on.apply(this, a);

    },

    /**
     * Executes the callback before a DOM event, custom event
     * or method.  If the first argument is a function, it
     * is assumed the target is a method.  For DOM and custom
     * events, this is an alias for Y.on.
     *
     * For DOM and custom events:
     * type, callback, context, 0-n arguments
     *
     * For methods:
     * callback, object (method host), methodName, context, 0-n arguments
     *
     * @method before
     * @return detach handle
     */
    before: function() {
        return this.on.apply(this, arguments);
    }

};

Y.EventTarget = ET;

// make Y an event target
Y.mix(Y, ET.prototype);
ET.call(Y, { bubbles: false });

YUI.Env.globalEvents = YUI.Env.globalEvents || new ET();

/**
 * Hosts YUI page level events.  This is where events bubble to
 * when the broadcast config is set to 2.  This property is
 * only available if the custom event module is loaded.
 * @property Global
 * @type EventTarget
 * @for YUI
 */
Y.Global = YUI.Env.globalEvents;

// @TODO implement a global namespace function on Y.Global?

/**
`Y.on()` can do many things:

<ul>
    <li>Subscribe to custom events `publish`ed and `fire`d from Y</li>
    <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and
        `fire`d from any object in the YUI instance sandbox</li>
    <li>Subscribe to DOM events</li>
    <li>Subscribe to the execution of a method on any object, effectively
    treating that method as an event</li>
</ul>

For custom event subscriptions, pass the custom event name as the first argument
and callback as the second. The `this` object in the callback will be `Y` unless
an override is passed as the third argument.

    Y.on('io:complete', function () {
        Y.MyApp.updateStatus('Transaction complete');
    });

To subscribe to DOM events, pass the name of a DOM event as the first argument
and a CSS selector string as the third argument after the callback function.
Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`,
array, or simply omitted (the default is the `window` object).

    Y.on('click', function (e) {
        e.preventDefault();

        // proceed with ajax form submission
        var url = this.get('action');
        ...
    }, '#my-form');

The `this` object in DOM event callbacks will be the `Node` targeted by the CSS
selector or other identifier.

`on()` subscribers for DOM events or custom events `publish`ed with a
`defaultFn` can prevent the default behavior with `e.preventDefault()` from the
event object passed as the first parameter to the subscription callback.

To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
<a href="../classes/Do.html#methods_before">`Y.Do.before(...)`</a>.

NOTE: The formal parameter list below is for events, not for function
injection.  See `Y.Do.before` for that signature.

@method on
@param {String} type DOM or custom event name
@param {Function} fn The callback to execute in response to the event
@param {Object} [context] Override `this` object in callback
@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
@return {EventHandle} A subscription handle capable of detaching the
                      subscription
@see Do.before
@for YUI
**/

/**
Listen for an event one time.  Equivalent to `on()`, except that
the listener is immediately detached when executed.

See the <a href="#methods_on">`on()` method</a> for additional subscription
options.

@see on
@method once
@param {String} type DOM or custom event name
@param {Function} fn The callback to execute in response to the event
@param {Object} [context] Override `this` object in callback
@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
@return {EventHandle} A subscription handle capable of detaching the
                      subscription
@for YUI
**/

/**
Listen for an event one time.  Equivalent to `once()`, except, like `after()`,
the subscription callback executes after all `on()` subscribers and the event's
`defaultFn` (if configured) have executed.  Like `after()` if any `on()` phase
subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()`
subscribers will execute.

The listener is immediately detached when executed.

See the <a href="#methods_on">`on()` method</a> for additional subscription
options.

@see once
@method onceAfter
@param {String} type The custom event name
@param {Function} fn The callback to execute in response to the event
@param {Object} [context] Override `this` object in callback
@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
@return {EventHandle} A subscription handle capable of detaching the
                      subscription
@for YUI
**/

/**
Like `on()`, this method creates a subscription to a custom event or to the
execution of a method on an object.

For events, `after()` subscribers are executed after the event's
`defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber.

See the <a href="#methods_on">`on()` method</a> for additional subscription
options.

NOTE: The subscription signature shown is for events, not for function
injection.  See <a href="../classes/Do.html#methods_after">`Y.Do.after`</a>
for that signature.

@see on
@see Do.after
@method after
@param {String} type The custom event name
@param {Function} fn The callback to execute in response to the event
@param {Object} [context] Override `this` object in callback
@param {Any} [args*] 0..n additional arguments to supply to the subscriber
@return {EventHandle} A subscription handle capable of detaching the
                      subscription
@for YUI
**/


}, 'patched-v3.18.1', {"requires": ["oop"]});

YUI.add('event-custom-complex', function (Y, NAME) {


/**
 * Adds event facades, preventable default behavior, and bubbling.
 * events.
 * @module event-custom
 * @submodule event-custom-complex
 */

var FACADE,
    FACADE_KEYS,
    YObject = Y.Object,
    key,
    EMPTY = {},
    CEProto = Y.CustomEvent.prototype,
    ETProto = Y.EventTarget.prototype,

    mixFacadeProps = function(facade, payload) {
        var p;

        for (p in payload) {
            if (!(FACADE_KEYS.hasOwnProperty(p))) {
                facade[p] = payload[p];
            }
        }
    };

/**
 * Wraps and protects a custom event for use when emitFacade is set to true.
 * Requires the event-custom-complex module
 * @class EventFacade
 * @param e {Event} the custom event
 * @param currentTarget {HTMLElement} the element the listener was attached to
 */

Y.EventFacade = function(e, currentTarget) {

    if (!e) {
        e = EMPTY;
    }

    this._event = e;

    /**
     * The arguments passed to fire
     * @property details
     * @type Array
     */
    this.details = e.details;

    /**
     * The event type, this can be overridden by the fire() payload
     * @property type
     * @type string
     */
    this.type = e.type;

    /**
     * The real event type
     * @property _type
     * @type string
     * @private
     */
    this._type = e.type;

    //////////////////////////////////////////////////////

    /**
     * Node reference for the targeted eventtarget
     * @property target
     * @type Node
     */
    this.target = e.target;

    /**
     * Node reference for the element that the listener was attached to.
     * @property currentTarget
     * @type Node
     */
    this.currentTarget = currentTarget;

    /**
     * Node reference to the relatedTarget
     * @property relatedTarget
     * @type Node
     */
    this.relatedTarget = e.relatedTarget;

};

Y.mix(Y.EventFacade.prototype, {

    /**
     * Stops the propagation to the next bubble target
     * @method stopPropagation
     */
    stopPropagation: function() {
        this._event.stopPropagation();
        this.stopped = 1;
    },

    /**
     * Stops the propagation to the next bubble target and
     * prevents any additional listeners from being exectued
     * on the current target.
     * @method stopImmediatePropagation
     */
    stopImmediatePropagation: function() {
        this._event.stopImmediatePropagation();
        this.stopped = 2;
    },

    /**
     * Prevents the event's default behavior
     * @method preventDefault
     */
    preventDefault: function() {
        this._event.preventDefault();
        this.prevented = 1;
    },

    /**
     * Stops the event propagation and prevents the default
     * event behavior.
     * @method halt
     * @param immediate {boolean} if true additional listeners
     * on the current target will not be executed
     */
    halt: function(immediate) {
        this._event.halt(immediate);
        this.prevented = 1;
        this.stopped = (immediate) ? 2 : 1;
    }

});

CEProto.fireComplex = function(args) {

    var es,
        ef,
        q,
        queue,
        ce,
        ret = true,
        events,
        subs,
        ons,
        afters,
        afterQueue,
        postponed,
        prevented,
        preventedFn,
        defaultFn,
        self = this,
        host = self.host || self,
        next,
        oldbubble,
        stack = self.stack,
        yuievt = host._yuievt,
        hasPotentialSubscribers;

    if (stack) {

        // queue this event if the current item in the queue bubbles
        if (self.queuable && self.type !== stack.next.type) {

            if (!stack.queue) {
                stack.queue = [];
            }
            stack.queue.push([self, args]);

            return true;
        }
    }

    hasPotentialSubscribers = self.hasSubs() || yuievt.hasTargets || self.broadcast;

    self.target = self.target || host;
    self.currentTarget = host;

    self.details = args.concat();

    if (hasPotentialSubscribers) {

        es = stack || {

           id: self.id, // id of the first event in the stack
           next: self,
           silent: self.silent,
           stopped: 0,
           prevented: 0,
           bubbling: null,
           type: self.type,
           // defaultFnQueue: new Y.Queue(),
           defaultTargetOnly: self.defaultTargetOnly

        };

        subs = self.getSubs();
        ons = subs[0];
        afters = subs[1];

        self.stopped = (self.type !== es.type) ? 0 : es.stopped;
        self.prevented = (self.type !== es.type) ? 0 : es.prevented;

        if (self.stoppedFn) {
            // PERF TODO: Can we replace with callback, like preventedFn. Look into history
            events = new Y.EventTarget({
                fireOnce: true,
                context: host
            });
            self.events = events;
            events.on('stopped', self.stoppedFn);
        }


        self._facade = null; // kill facade to eliminate stale properties

        ef = self._createFacade(args);

        if (ons) {
            self._procSubs(ons, args, ef);
        }

        // bubble if this is hosted in an event target and propagation has not been stopped
        if (self.bubbles && host.bubble && !self.stopped) {
            oldbubble = es.bubbling;

            es.bubbling = self.type;

            if (es.type !== self.type) {
                es.stopped = 0;
                es.prevented = 0;
            }

            ret = host.bubble(self, args, null, es);

            self.stopped = Math.max(self.stopped, es.stopped);
            self.prevented = Math.max(self.prevented, es.prevented);

            es.bubbling = oldbubble;
        }

        prevented = self.prevented;

        if (prevented) {
            preventedFn = self.preventedFn;
            if (preventedFn) {
                preventedFn.apply(host, args);
            }
        } else {
            defaultFn = self.defaultFn;

            if (defaultFn && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) {
                defaultFn.apply(host, args);
            }
        }

        // broadcast listeners are fired as discreet events on the
        // YUI instance and potentially the YUI global.
        if (self.broadcast) {
            self._broadcast(args);
        }

        if (afters && !self.prevented && self.stopped < 2) {

            // Queue the after
            afterQueue = es.afterQueue;

            if (es.id === self.id || self.type !== yuievt.bubbling) {

                self._procSubs(afters, args, ef);

                if (afterQueue) {
                    while ((next = afterQueue.last())) {
                        next();
                    }
                }
            } else {
                postponed = afters;

                if (es.execDefaultCnt) {
                    postponed = Y.merge(postponed);

                    Y.each(postponed, function(s) {
                        s.postponed = true;
                    });
                }

                if (!afterQueue) {
                    es.afterQueue = new Y.Queue();
                }

                es.afterQueue.add(function() {
                    self._procSubs(postponed, args, ef);
                });
            }

        }

        self.target = null;

        if (es.id === self.id) {

            queue = es.queue;

            if (queue) {
                while (queue.length) {
                    q = queue.pop();
                    ce = q[0];
                    // set up stack to allow the next item to be processed
                    es.next = ce;
                    ce._fire(q[1]);
                }
            }

            self.stack = null;
        }

        ret = !(self.stopped);

        if (self.type !== yuievt.bubbling) {
            es.stopped = 0;
            es.prevented = 0;
            self.stopped = 0;
            self.prevented = 0;
        }

    } else {
        defaultFn = self.defaultFn;

        if(defaultFn) {
            ef = self._createFacade(args);

            if ((!self.defaultTargetOnly) || (host === ef.target)) {
                defaultFn.apply(host, args);
            }
        }
    }

    // Kill the cached facade to free up memory.
    // Otherwise we have the facade from the last fire, sitting around forever.
    self._facade = null;

    return ret;
};

/**
 * @method _hasPotentialSubscribers
 * @for CustomEvent
 * @private
 * @return {boolean} Whether the event has potential subscribers or not
 */
CEProto._hasPotentialSubscribers = function() {
    return this.hasSubs() || this.host._yuievt.hasTargets || this.broadcast;
};

/**
 * Internal utility method to create a new facade instance and
 * insert it into the fire argument list, accounting for any payload
 * merging which needs to happen.
 *
 * This used to be called `_getFacade`, but the name seemed inappropriate
 * when it was used without a need for the return value.
 *
 * @method _createFacade
 * @private
 * @param fireArgs {Array} The arguments passed to "fire", which need to be
 * shifted (and potentially merged) when the facade is added.
 * @return {EventFacade} The event facade created.
 */

// TODO: Remove (private) _getFacade alias, once synthetic.js is updated.
CEProto._createFacade = CEProto._getFacade = function(fireArgs) {

    var userArgs = this.details,
        firstArg = userArgs && userArgs[0],
        firstArgIsObj = (firstArg && (typeof firstArg === "object")),
        ef = this._facade;

    if (!ef) {
        ef = new Y.EventFacade(this, this.currentTarget);
    }

    if (firstArgIsObj) {
        // protect the event facade properties
        mixFacadeProps(ef, firstArg);

        // Allow the event type to be faked http://yuilibrary.com/projects/yui3/ticket/2528376
        if (firstArg.type) {
            ef.type = firstArg.type;
        }

        if (fireArgs) {
            fireArgs[0] = ef;
        }
    } else {
        if (fireArgs) {
            fireArgs.unshift(ef);
        }
    }

    // update the details field with the arguments
    ef.details = this.details;

    // use the original target when the event bubbled to this target
    ef.target = this.originalTarget || this.target;

    ef.currentTarget = this.currentTarget;
    ef.stopped = 0;
    ef.prevented = 0;

    this._facade = ef;

    return this._facade;
};

/**
 * Utility method to manipulate the args array passed in, to add the event facade,
 * if it's not already the first arg.
 *
 * @method _addFacadeToArgs
 * @private
 * @param {Array} The arguments to manipulate
 */
CEProto._addFacadeToArgs = function(args) {
    var e = args[0];

    // Trying not to use instanceof, just to avoid potential cross Y edge case issues.
    if (!(e && e.halt && e.stopImmediatePropagation && e.stopPropagation && e._event)) {
        this._createFacade(args);
    }
};

/**
 * Stop propagation to bubble targets
 * @for CustomEvent
 * @method stopPropagation
 */
CEProto.stopPropagation = function() {
    this.stopped = 1;
    if (this.stack) {
        this.stack.stopped = 1;
    }
    if (this.events) {
        this.events.fire('stopped', this);
    }
};

/**
 * Stops propagation to bubble targets, and prevents any remaining
 * subscribers on the current target from executing.
 * @method stopImmediatePropagation
 */
CEProto.stopImmediatePropagation = function() {
    this.stopped = 2;
    if (this.stack) {
        this.stack.stopped = 2;
    }
    if (this.events) {
        this.events.fire('stopped', this);
    }
};

/**
 * Prevents the execution of this event's defaultFn
 * @method preventDefault
 */
CEProto.preventDefault = function() {
    if (this.preventable) {
        this.prevented = 1;
        if (this.stack) {
            this.stack.prevented = 1;
        }
    }
};

/**
 * Stops the event propagation and prevents the default
 * event behavior.
 * @method halt
 * @param immediate {boolean} if true additional listeners
 * on the current target will not be executed
 */
CEProto.halt = function(immediate) {
    if (immediate) {
        this.stopImmediatePropagation();
    } else {
        this.stopPropagation();
    }
    this.preventDefault();
};

/**
 * Registers another EventTarget as a bubble target.  Bubble order
 * is determined by the order registered.  Multiple targets can
 * be specified.
 *
 * Events can only bubble if emitFacade is true.
 *
 * Included in the event-custom-complex submodule.
 *
 * @method addTarget
 * @chainable
 * @param o {EventTarget} the target to add
 * @for EventTarget
 */
ETProto.addTarget = function(o) {
    var etState = this._yuievt;

    if (!etState.targets) {
        etState.targets = {};
    }

    etState.targets[Y.stamp(o)] = o;
    etState.hasTargets = true;

    return this;
};

/**
 * Returns an array of bubble targets for this object.
 * @method getTargets
 * @return EventTarget[]
 */
ETProto.getTargets = function() {
    var targets = this._yuievt.targets;
    return targets ? YObject.values(targets) : [];
};

/**
 * Removes a bubble target
 * @method removeTarget
 * @chainable
 * @param o {EventTarget} the target to remove
 * @for EventTarget
 */
ETProto.removeTarget = function(o) {
    var targets = this._yuievt.targets;

    if (targets) {
        delete targets[Y.stamp(o, true)];

        if (YObject.size(targets) === 0) {
            this._yuievt.hasTargets = false;
        }
    }

    return this;
};

/**
 * Propagate an event.  Requires the event-custom-complex module.
 * @method bubble
 * @param evt {CustomEvent} the custom event to propagate
 * @return {boolean} the aggregated return value from Event.Custom.fire
 * @for EventTarget
 */
ETProto.bubble = function(evt, args, target, es) {

    var targs = this._yuievt.targets,
        ret = true,
        t,
        ce,
        i,
        bc,
        ce2,
        type = evt && evt.type,
        originalTarget = target || (evt && evt.target) || this,
        oldbubble;

    if (!evt || ((!evt.stopped) && targs)) {

        for (i in targs) {
            if (targs.hasOwnProperty(i)) {

                t = targs[i];

                ce = t._yuievt.events[type];

                if (t._hasSiblings) {
                    ce2 = t.getSibling(type, ce);
                }

                if (ce2 && !ce) {
                    ce = t.publish(type);
                }

                oldbubble = t._yuievt.bubbling;
                t._yuievt.bubbling = type;

                // if this event was not published on the bubble target,
                // continue propagating the event.
                if (!ce) {
                    if (t._yuievt.hasTargets) {
                        t.bubble(evt, args, originalTarget, es);
                    }
                } else {

                    if (ce2) {
                        ce.sibling = ce2;
                    }

                    // set the original target to that the target payload on the facade is correct.
                    ce.target = originalTarget;
                    ce.originalTarget = originalTarget;
                    ce.currentTarget = t;
                    bc = ce.broadcast;
                    ce.broadcast = false;

                    // default publish may not have emitFacade true -- that
                    // shouldn't be what the implementer meant to do
                    ce.emitFacade = true;

                    ce.stack = es;

                    // TODO: See what's getting in the way of changing this to use
                    // the more performant ce._fire(args || evt.details || []).

                    // Something in Widget Parent/Child tests is not happy if we
                    // change it - maybe evt.details related?
                    ret = ret && ce.fire.apply(ce, args || evt.details || []);

                    ce.broadcast = bc;
                    ce.originalTarget = null;

                    // stopPropagation() was called
                    if (ce.stopped) {
                        break;
                    }
                }

                t._yuievt.bubbling = oldbubble;
            }
        }
    }

    return ret;
};

/**
 * @method _hasPotentialSubscribers
 * @for EventTarget
 * @private
 * @param {String} fullType The fully prefixed type name
 * @return {boolean} Whether the event has potential subscribers or not
 */
ETProto._hasPotentialSubscribers = function(fullType) {

    var etState = this._yuievt,
        e = etState.events[fullType];

    if (e) {
        return e.hasSubs() || etState.hasTargets  || e.broadcast;
    } else {
        return false;
    }
};

FACADE = new Y.EventFacade();
FACADE_KEYS = {};

// Flatten whitelist
for (key in FACADE) {
    FACADE_KEYS[key] = true;
}


}, 'patched-v3.18.1', {"requires": ["event-custom-base"]});

YUI.add('oop', function (Y, NAME) {

/**
Adds object inheritance and manipulation utilities to the YUI instance. This
module is required by most YUI components.

@module oop
**/

var L            = Y.Lang,
    A            = Y.Array,
    OP           = Object.prototype,
    CLONE_MARKER = '_~yuim~_',

    hasOwn   = OP.hasOwnProperty,
    toString = OP.toString;

/**
Calls the specified _action_ method on _o_ if it exists. Otherwise, if _o_ is an
array, calls the _action_ method on `Y.Array`, or if _o_ is an object, calls the
_action_ method on `Y.Object`.

If _o_ is an array-like object, it will be coerced to an array.

This is intended to be used with array/object iteration methods that share
signatures, such as `each()`, `some()`, etc.

@method dispatch
@param {Object} o Array or object to dispatch to.
@param {Function} f Iteration callback.
    @param {Mixed} f.value Value being iterated.
    @param {Mixed} f.key Current object key or array index.
    @param {Mixed} f.object Object or array being iterated.
@param {Object} c `this` object to bind the iteration callback to.
@param {Boolean} proto If `true`, prototype properties of objects will be
    iterated.
@param {String} action Function name to be dispatched on _o_. For example:
    'some', 'each', etc.
@private
@return {Mixed} Returns the value returned by the chosen iteration action, which
    varies.
**/
function dispatch(o, f, c, proto, action) {
    if (o && o[action] && o !== Y) {
        return o[action].call(o, f, c);
    } else {
        switch (A.test(o)) {
            case 1:
                return A[action](o, f, c);
            case 2:
                return A[action](Y.Array(o, 0, true), f, c);
            default:
                return Y.Object[action](o, f, c, proto);
        }
    }
}

/**
Augments the _receiver_ with prototype properties from the _supplier_. The
receiver may be a constructor function or an object. The supplier must be a
constructor function.

If the _receiver_ is an object, then the _supplier_ constructor will be called
immediately after _receiver_ is augmented, with _receiver_ as the `this` object.

If the _receiver_ is a constructor function, then all prototype methods of
_supplier_ that are copied to _receiver_ will be sequestered, and the
_supplier_ constructor will not be called immediately. The first time any
sequestered method is called on the _receiver_'s prototype, all sequestered
methods will be immediately copied to the _receiver_'s prototype, the
_supplier_'s constructor will be executed, and finally the newly unsequestered
method that was called will be executed.

This sequestering logic sounds like a bunch of complicated voodoo, but it makes
it cheap to perform frequent augmentation by ensuring that suppliers'
constructors are only called if a supplied method is actually used. If none of
the supplied methods is ever used, then there's no need to take the performance
hit of calling the _supplier_'s constructor.

@method augment
@param {Function|Object} receiver Object or function to be augmented.
@param {Function} supplier Function that supplies the prototype properties with
  which to augment the _receiver_.
@param {Boolean} [overwrite=false] If `true`, properties already on the receiver
  will be overwritten if found on the supplier's prototype.
@param {String[]} [whitelist] An array of property names. If specified,
  only the whitelisted prototype properties will be applied to the receiver, and
  all others will be ignored.
@param {Array|any} [args] Argument or array of arguments to pass to the
  supplier's constructor when initializing.
@return {Function} Augmented object.
@for YUI
**/
Y.augment = function (receiver, supplier, overwrite, whitelist, args) {
    var rProto    = receiver.prototype,
        sequester = rProto && supplier,
        sProto    = supplier.prototype,
        to        = rProto || receiver,

        copy,
        newPrototype,
        replacements,
        sequestered,
        unsequester;

    args = args ? Y.Array(args) : [];

    if (sequester) {
        newPrototype = {};
        replacements = {};
        sequestered  = {};

        copy = function (value, key) {
            if (overwrite || !(key in rProto)) {
                if (toString.call(value) === '[object Function]') {
                    sequestered[key] = value;

                    newPrototype[key] = replacements[key] = function () {
                        return unsequester(this, value, arguments);
                    };
                } else {
                    newPrototype[key] = value;
                }
            }
        };

        unsequester = function (instance, fn, fnArgs) {
            // Unsequester all sequestered functions.
            for (var key in sequestered) {
                if (hasOwn.call(sequestered, key)
                        && instance[key] === replacements[key]) {

                    instance[key] = sequestered[key];
                }
            }

            // Execute the supplier constructor.
            supplier.apply(instance, args);

            // Finally, execute the original sequestered function.
            return fn.apply(instance, fnArgs);
        };

        if (whitelist) {
            Y.Array.each(whitelist, function (name) {
                if (name in sProto) {
                    copy(sProto[name], name);
                }
            });
        } else {
            Y.Object.each(sProto, copy, null, true);
        }
    }

    Y.mix(to, newPrototype || sProto, overwrite, whitelist);

    if (!sequester) {
        supplier.apply(to, args);
    }

    return receiver;
};

/**
 * Copies object properties from the supplier to the receiver. If the target has
 * the property, and the property is an object, the target object will be
 * augmented with the supplier's value.
 *
 * @method aggregate
 * @param {Object} receiver Object to receive the augmentation.
 * @param {Object} supplier Object that supplies the properties with which to
 *     augment the receiver.
 * @param {Boolean} [overwrite=false] If `true`, properties already on the receiver
 *     will be overwritten if found on the supplier.
 * @param {String[]} [whitelist] Whitelist. If supplied, only properties in this
 *     list will be applied to the receiver.
 * @return {Object} Augmented object.
 */
Y.aggregate = function(r, s, ov, wl) {
    return Y.mix(r, s, ov, wl, 0, true);
};

/**
 * Utility to set up the prototype, constructor and superclass properties to
 * support an inheritance strategy that can chain constructors and methods.
 * Static members will not be inherited.
 *
 * @method extend
 * @param {function} r   the object to modify.
 * @param {function} s the object to inherit.
 * @param {object} px prototype properties to add/override.
 * @param {object} sx static properties to add/override.
 * @return {object} the extended object.
 */
Y.extend = function(r, s, px, sx) {
    if (!s || !r) {
        Y.error('extend failed, verify dependencies');
    }

    var sp = s.prototype, rp = Y.Object(sp);
    r.prototype = rp;

    rp.constructor = r;
    r.superclass = sp;

    // assign constructor property
    if (s != Object && sp.constructor == OP.constructor) {
        sp.constructor = s;
    }

    // add prototype overrides
    if (px) {
        Y.mix(rp, px, true);
    }

    // add object overrides
    if (sx) {
        Y.mix(r, sx, true);
    }

    return r;
};

/**
 * Executes the supplied function for each item in
 * a collection.  Supports arrays, objects, and
 * NodeLists
 * @method each
 * @param {object} o the object to iterate.
 * @param {function} f the function to execute.  This function
 * receives the value, key, and object as parameters.
 * @param {object} c the execution context for the function.
 * @param {boolean} proto if true, prototype properties are
 * iterated on objects.
 * @return {YUI} the YUI instance.
 */
Y.each = function(o, f, c, proto) {
    return dispatch(o, f, c, proto, 'each');
};

/**
 * Executes the supplied function for each item in
 * a collection.  The operation stops if the function
 * returns true. Supports arrays, objects, and
 * NodeLists.
 * @method some
 * @param {object} o the object to iterate.
 * @param {function} f the function to execute.  This function
 * receives the value, key, and object as parameters.
 * @param {object} c the execution context for the function.
 * @param {boolean} proto if true, prototype properties are
 * iterated on objects.
 * @return {boolean} true if the function ever returns true,
 * false otherwise.
 */
Y.some = function(o, f, c, proto) {
    return dispatch(o, f, c, proto, 'some');
};

/**
Deep object/array copy. Function clones are actually wrappers around the
original function. Array-like objects are treated as arrays. Primitives are
returned untouched. Optionally, a function can be provided to handle other data
types, filter keys, validate values, etc.

**Note:** Cloning a non-trivial object is a reasonably heavy operation, due to
the need to recursively iterate down non-primitive properties. Clone should be
used only when a deep clone down to leaf level properties is explicitly
required. This method will also

In many cases (for example, when trying to isolate objects used as hashes for
configuration properties), a shallow copy, using `Y.merge()` is normally
sufficient. If more than one level of isolation is required, `Y.merge()` can be
used selectively at each level which needs to be isolated from the original
without going all the way to leaf properties.

@method clone
@param {object} o what to clone.
@param {boolean} safe if true, objects will not have prototype items from the
    source. If false, they will. In this case, the original is initially
    protected, but the clone is not completely immune from changes to the source
    object prototype. Also, cloned prototype items that are deleted from the
    clone will result in the value of the source prototype being exposed. If
    operating on a non-safe clone, items should be nulled out rather than
    deleted.
@param {function} f optional function to apply to each item in a collection; it
    will be executed prior to applying the value to the new object.
    Return false to prevent the copy.
@param {object} c optional execution context for f.
@param {object} owner Owner object passed when clone is iterating an object.
    Used to set up context for cloned functions.
@param {object} cloned hash of previously cloned objects to avoid multiple
    clones.
@return {Array|Object} the cloned object.
**/
Y.clone = function(o, safe, f, c, owner, cloned) {
    var o2, marked, stamp;

    // Does not attempt to clone:
    //
    // * Non-typeof-object values, "primitive" values don't need cloning.
    //
    // * YUI instances, cloning complex object like YUI instances is not
    //   advised, this is like cloning the world.
    //
    // * DOM nodes (#2528250), common host objects like DOM nodes cannot be
    //   "subclassed" in Firefox and old versions of IE. Trying to use
    //   `Object.create()` or `Y.extend()` on a DOM node will throw an error in
    //   these browsers.
    //
    // Instad, the passed-in `o` will be return as-is when it matches one of the
    // above criteria.
    if (!L.isObject(o) ||
            Y.instanceOf(o, YUI) ||
            (o.addEventListener || o.attachEvent)) {

        return o;
    }

    marked = cloned || {};

    switch (L.type(o)) {
        case 'date':
            return new Date(o);
        case 'regexp':
            // if we do this we need to set the flags too
            // return new RegExp(o.source);
            return o;
        case 'function':
            // o2 = Y.bind(o, owner);
            // break;
            return o;
        case 'array':
            o2 = [];
            break;
        default:

            // #2528250 only one clone of a given object should be created.
            if (o[CLONE_MARKER]) {
                return marked[o[CLONE_MARKER]];
            }

            stamp = Y.guid();

            o2 = (safe) ? {} : Y.Object(o);

            o[CLONE_MARKER] = stamp;
            marked[stamp] = o;
    }

    Y.each(o, function(v, k) {
        if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) {
            if (k !== CLONE_MARKER) {
                if (k == 'prototype') {
                    // skip the prototype
                // } else if (o[k] === o) {
                //     this[k] = this;
                } else {
                    this[k] =
                        Y.clone(v, safe, f, c, owner || o, marked);
                }
            }
        }
    }, o2);

    if (!cloned) {
        Y.Object.each(marked, function(v, k) {
            if (v[CLONE_MARKER]) {
                try {
                    delete v[CLONE_MARKER];
                } catch (e) {
                    v[CLONE_MARKER] = null;
                }
            }
        }, this);
        marked = null;
    }

    return o2;
};

/**
 * Returns a function that will execute the supplied function in the
 * supplied object's context, optionally adding any additional
 * supplied parameters to the beginning of the arguments collection the
 * supplied to the function.
 *
 * @method bind
 * @param {Function|String} f the function to bind, or a function name
 * to execute on the context object.
 * @param {object} c the execution context.
 * @param {any} args* 0..n arguments to include before the arguments the
 * function is executed with.
 * @return {function} the wrapped function.
 */
Y.bind = function(f, c) {
    var xargs = arguments.length > 2 ?
            Y.Array(arguments, 2, true) : null;
    return function() {
        var fn = L.isString(f) ? c[f] : f,
            args = (xargs) ?
                xargs.concat(Y.Array(arguments, 0, true)) : arguments;
        return fn.apply(c || fn, args);
    };
};

/**
 * Returns a function that will execute the supplied function in the
 * supplied object's context, optionally adding any additional
 * supplied parameters to the end of the arguments the function
 * is executed with.
 *
 * @method rbind
 * @param {Function|String} f the function to bind, or a function name
 * to execute on the context object.
 * @param {object} c the execution context.
 * @param {any} args* 0..n arguments to append to the end of
 * arguments collection supplied to the function.
 * @return {function} the wrapped function.
 */
Y.rbind = function(f, c) {
    var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null;
    return function() {
        var fn = L.isString(f) ? c[f] : f,
            args = (xargs) ?
                Y.Array(arguments, 0, true).concat(xargs) : arguments;
        return fn.apply(c || fn, args);
    };
};


}, 'patched-v3.18.1', {"requires": ["yui-base"]});

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.79');

/**
 * 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
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); }

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; }

/**
 * 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 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_SUB = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g;
  var SRC_HIDE_LINK = {
    src: 'hideLink'
  };
  var STR_RIGHT_SQUARE_BRACKET = ']';
  var TPL_LEXICON_ICON = '<svg class="lexicon-icon lexicon-icon-{0} {1}" focusable="false" role="image">' + '<use href="' + themeDisplay.getPathThemeImages() + '/clay/icons.svg#{0}" />' + '</svg>';
  var Window = {
    _map: {},
    getById: function getById(id) {
      var instance = this;
      return instance._map[id];
    }
  };
  var Util = {
    _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');
                });
              }

              var title = instance.get('node');
              instance._titleListener = title.on('mouseupoutside', function (event) {
                var editable = Util._getEditableInstance(title);

                if (!editable.get('boundingBox').contains(event.target)) {
                  editable.save();
                }
              });
            },
            stopEditing: function stopEditing() {
              var instance = this;

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

              if (instance._titleListener) {
                instance._titleListener.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 () {};
    },
    checkAll: function checkAll(form, name, allBox, selectClassName) {
      if (form) {
        form = Util.getDOM(form);

        if (typeof form === 'string') {
          form = document.querySelector(form);
        }

        allBox = Util.getDOM(allBox);

        if (typeof allBox === 'string') {
          allBox = document.querySelector(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;
        }

        var allBoxChecked = allBox.checked;
        var uploadedItems = Array.from(form.querySelectorAll(selector));
        uploadedItems.forEach(function (item) {
          if (!item.disabled) {
            item.checked = allBoxChecked;
          }
        });

        if (selectClassName) {
          var selectItem = form.querySelector(selectClassName);

          if (allBoxChecked) {
            selectItem.classList.add('info');
          } else {
            selectItem.classList.remove('info');
          }
        }
      }
    },
    checkAllBox: function checkAllBox(form, name, allBox) {
      var totalOn = 0;

      if (form) {
        form = Util.getDOM(form);

        if (typeof form === 'string') {
          form = document.querySelector(form);
        }

        allBox = Util.getDOM(allBox);

        if (typeof allBox === 'string') {
          allBox = document.querySelector(allBox) || form.querySelector("input[name=\"".concat(allBox, "\"]"));
        }

        var inputs = Array.from(form.querySelectorAll('input[type=checkbox]'));

        if (!Array.isArray(name)) {
          name = [name];
        }

        var totalBoxes = 0;
        inputs.forEach(function (input) {
          if (input.id !== allBox.id || input.id !== allBox.name && name.indexOf(input.name) > -1) {
            totalBoxes++;

            if (input.checked) {
              totalOn++;
            }
          }
        });
        allBox.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 = Util.getElement(el);

      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;
        }
      }
    },
    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 = document.getElementById(checkBoxId);
      var toggleBox = document.getElementById(toggleBoxId);

      if (checkBox && toggleBox) {
        toggleBox.disabled = checkDisabled && checkBox.checked;
        checkBox.addEventListener(EVENT_CLICK, function () {
          toggleBox.disabled = !toggleBox.disabled;
        });
      }
    },
    enableFormButtons: function enableFormButtons(inputs) {
      Util._submitLocked = null;
      Util.toggleDisabled(inputs, false);
    },

    /**
     * @deprecated As of Athanasius (7.3.x), with no direct replacement
     */
    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;
      });
    },
    forcePost: function forcePost(link) {
      var currentElement = Util.getElement(link);

      if (currentElement) {
        var url = currentElement.getAttribute('href'); // LPS-127302

        if (url === 'javascript:;') {
          return;
        }

        var newWindow = currentElement.getAttribute('target') == '_blank';
        var hrefFm = document.hrefFm;

        if (newWindow) {
          hrefFm.setAttribute('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 = typeof attributeGetter === 'function';
        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;
    },
    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;
      var tempElement = document.createElement('div');
      tempElement.innerHTML = instance.getLexiconIconTpl(icon, cssClass);
      return tempElement.firstChild;
    },
    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;
    },
    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 || '';
    },

    /**
     * @deprecated As of Athanasius (7.3.x), replaced by `window.innerWidth`
     */
    getWindowWidth: function getWindowWidth() {
      return window.innerWidth;
    },

    /**
     * @deprecated As of Athanasius (7.3.x), replaced by `typeof val === 'function'`
     */
    isFunction: function isFunction(val) {
      return typeof val === 'function';
    },
    listCheckboxesExcept: function listCheckboxesExcept(form, except, name, checked) {
      form = Util.getDOM(form);

      if (typeof form === 'string') {
        form = document.querySelector(form);
      }

      var selector = 'input[type=checkbox]';

      if (name) {
        selector += '[name=' + name + ']';
      }

      var checkboxes = Array.from(form.querySelectorAll(selector));
      return checkboxes.reduce(function (prev, item) {
        var value = item.value;

        if (value && item.name !== except && item.checked === checked && !item.disabled) {
          prev.push(value);
        }

        return prev;
      }, []).join();
    },
    listCheckedExcept: function listCheckedExcept(form, except, name) {
      return Util.listCheckboxesExcept(form, except, name, true);
    },
    listSelect: function listSelect(select, delimeter) {
      select = Util.getElement(select);
      return Array.from(select.querySelectorAll('option')).reduce(function (prev, item) {
        var val = item.value;

        if (val) {
          prev.push(val);
        }

        return prev;
      }, []).join(delimeter || ',');
    },
    listUncheckedExcept: function listUncheckedExcept(form, except, name) {
      return Util.listCheckboxesExcept(form, except, name, false);
    },
    openInDialog: function openInDialog(event, config) {
      event.preventDefault();
      var currentTarget = Util.getElement(event.currentTarget);
      config = A.mix(A.merge({}, currentTarget.dataset), config);

      if (!config.uri) {
        config.uri = currentTarget.dataset.href || currentTarget.getAttribute('href');
      }

      if (!config.title) {
        config.title = currentTarget.getAttribute('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();
    },

    /**
     * @deprecated As of Athanasius (7.3.x), with no direct replacement
     */
    randomInt: function randomInt() {
      return Math.ceil(Math.random() * new Date().getTime());
    },
    removeEntitySelection: function removeEntitySelection(entityIdString, entityNameString, removeEntityButton, namespace) {
      var elementByEntityId = document.getElementById("".concat(namespace).concat(entityIdString));

      if (elementByEntityId) {
        elementByEntityId.value = 0;
      }

      var elementByEntityName = document.getElementById("".concat(namespace).concat(entityNameString));

      if (elementByEntityName) {
        elementByEntityName.value = '';
      }

      Liferay.Util.toggleDisabled(removeEntityButton, true);
      Liferay.fire('entitySelectionRemoved');
    },
    reorder: function reorder(box, down) {
      box = Util.getElement(box);

      if (box) {
        if (box.getAttribute('selectedIndex') == -1) {
          box.setAttribute('selectedIndex', 0);
        } else {
          var selectedItems = Array.from(box.querySelectorAll('option:checked'));
          var items = Array.from(box.querySelectorAll('option'));

          if (down) {
            selectedItems.reverse().forEach(function (item) {
              var itemIndex = items.indexOf(item);
              var lastIndex = items.length - 1;

              if (itemIndex === lastIndex) {
                box.insertBefore(item, box.firstChild);
              } else {
                var nextItem = item.nextElementSibling.nextElementSibling;
                box.insertBefore(item, nextItem);
              }
            });
          } else {
            selectedItems.forEach(function (item) {
              var itemIndex = items.indexOf(item);

              if (itemIndex === 0) {
                box.appendChild(item);
              } else {
                box.insertBefore(item, item.previousElementSibling);
              }
            });
          }
        }
      }
    },
    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);
      var data = {
        doAsUserId: params.doAsUserId,
        p_auth: Liferay.authToken,
        p_l_id: params.plid,
        portletId: params.portletId,
        title: params.title
      };
      Liferay.Util.fetch(params.url, {
        body: Liferay.Util.objectToFormData(data),
        method: 'POST'
      });
    },
    selectFolder: function selectFolder(folderData, namespace) {
      var folderDataElement = document.getElementById(namespace + folderData.idString);

      if (folderDataElement) {
        folderDataElement.value = folderData.idValue;
      }

      var folderNameElement = document.getElementById(namespace + folderData.nameString);

      if (folderNameElement) {
        folderNameElement.value = this.unescape(folderData.nameValue);
      }

      var removeFolderButton = document.getElementById("".concat(namespace, "removeFolderButton"));

      if (removeFolderButton) {
        this.toggleDisabled(removeFolderButton, 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, spanId) {
      var span = document.getElementById(spanId);

      if (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.style.display = display;
      }
    },

    /**
     * @deprecated As of Athanasius (7.3.x), with no direct replacement
     */
    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();
    },

    /**
     * @deprecated As of Athanasius (7.3.x), replaced by `parseInt()`
     */
    toNumber: function toNumber(value) {
      return parseInt(value, 10) || 0;
    },
    toggleBoxes: function toggleBoxes(checkBoxId, toggleBoxId, displayWhenUnchecked, toggleChildCheckboxes) {
      var checkBox = document.getElementById(checkBoxId);
      var toggleBox = document.getElementById(toggleBoxId);

      if (checkBox && toggleBox) {
        var checked = checkBox.checked;

        if (displayWhenUnchecked) {
          checked = !checked;
        }

        if (checked) {
          toggleBox.classList.remove('hide');
        } else {
          toggleBox.classList.add('hide');
        }

        checkBox.addEventListener(EVENT_CLICK, function () {
          toggleBox.classList.toggle('hide');

          if (toggleChildCheckboxes) {
            var childCheckboxes = toggleBox.querySelectorAll('input[type=checkbox]');
            childCheckboxes.forEach(function (childCheckbox) {
              childCheckbox.checked = checkBox.checked;
            });
          }
        });
      }
    },
    toggleRadio: function toggleRadio(radioId, showBoxIds, hideBoxIds) {
      var radioButton = document.getElementById(radioId);

      if (radioButton) {
        var showBoxes;

        if (showBoxIds) {
          if (Array.isArray(showBoxIds)) {
            showBoxIds = showBoxIds.join(',#');
          }

          showBoxes = document.querySelectorAll('#' + showBoxIds);
          showBoxes.forEach(function (showBox) {
            if (radioButton.checked) {
              showBox.classList.remove('hide');
            } else {
              showBox.classList.add('hide');
            }
          });
        }

        radioButton.addEventListener('change', function () {
          if (showBoxes) {
            showBoxes.forEach(function (showBox) {
              showBox.classList.remove('hide');
            });
          }

          if (hideBoxIds) {
            if (Array.isArray(hideBoxIds)) {
              hideBoxIds = hideBoxIds.join(',#');
            }

            var hideBoxes = document.querySelectorAll('#' + hideBoxIds);
            hideBoxes.forEach(function (hideBox) {
              hideBox.classList.add('hide');
            });
          }
        });
      }
    },

    /*
     * @deprecated As of Athanasius (7.3.x), with no direct replacement
     */
    toggleSearchContainerButton: function toggleSearchContainerButton(buttonId, searchContainerId, form, ignoreFieldName) {
      A.one(searchContainerId).delegate(EVENT_CLICK, function () {
        Util.toggleDisabled(buttonId, !Util.listCheckedExcept(form, ignoreFieldName));
      }, 'input[type=checkbox]');
    },
    toggleSelectBox: function toggleSelectBox(selectBoxId, value, toggleBoxId) {
      var selectBox = document.getElementById(selectBoxId);
      var toggleBox = document.getElementById(toggleBoxId);

      if (selectBox && toggleBox) {
        var dynamicValue = typeof value === 'function';

        var toggle = function toggle() {
          var currentValue = selectBox.value;
          var visible = value == currentValue;

          if (dynamicValue) {
            visible = value(currentValue, value);
          }

          if (visible) {
            toggleBox.classList.remove('hide');
          } else {
            toggleBox.classList.add('hide');
          }
        };

        toggle();
        selectBox.addEventListener('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 iframeWindow = event.win;

    if (iframeWindow.Liferay.SPA) {
      var beforeScreenFlipHandler = iframeWindow.Liferay.on('beforeScreenFlip', function () {
        iframeWindow.document.body.classList.add('dialog-iframe-popup');
      });

      iframeWindow.onunload = function () {
        if (beforeScreenFlipHandler) {
          iframeWindow.Liferay.detach(beforeScreenFlipHandler);
        }
      };
    }

    var cancelEventHandler = iframeBody.delegate(EVENT_CLICK, function (event) {
      dialog.set('visible', false, event.currentTarget.hasClass('lfr-hide-dialog') ? SRC_HIDE_LINK : null);
      cancelEventHandler.detach();
      iframeDocument.purge(true);
    }, '.btn-cancel,.lfr-hide-dialog');
    Liferay.fire('modalIframeLoaded', {
      src: event.dialog.iframe.node.getAttribute('src')
    });
  }, ['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, 'selectEntityHandler', function (containerSelector, selectEventName, disableButton) {
    var container = A.one(containerSelector);

    if (!container) {
      return;
    }

    var openingLiferay = Util.getOpener().Liferay;
    var selectorButtons = container.getDOM().querySelectorAll('.selector-button');
    container.delegate(EVENT_CLICK, function (event) {
      var currentTarget = event.currentTarget.getDOM();

      if (currentTarget.disabled || currentTarget.dataset['preventSelection']) {
        return;
      }

      var confirmSelection = currentTarget.dataset['confirmSelection'] === 'true';

      if (!confirmSelection || confirm(currentTarget.dataset['confirmSelectionMessage'])) {
        if (disableButton) {
          selectorButtons.forEach(function (selectorButton) {
            selectorButton.disabled = false;
          });
          currentTarget.disabled = true;
        }

        var result = Util.getAttributes(currentTarget, 'data-');
        openingLiferay.fire(selectEventName, result);

        var _window = Util.getWindow();

        if (_window) {
          _window.hide();
        }
      }
    }, '.selector-button');
    openingLiferay.on('entitySelectionRemoved', function () {
      selectorButtons.forEach(function (selectorButton) {
        selectorButton.disabled = false;
      });
    });
  }, ['aui-base']);
  Liferay.provide(Util, 'portletTitleEdit', function (options) {
    var obj = options.obj;
    A.Event.defineOutside('mouseup');

    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', 'event-outside']);
  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(Util, '_openWindowProvider', function (config, callback) {
    var dialog = Window.getWindow(config);

    if (Lang.isFunction(callback)) {
      callback(dialog);
    }
  }, ['liferay-util-window']);
  Util.Window = Window;
  Liferay.Util = Util;
  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(), Liferay);
//# sourceMappingURL=util.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 () {
  var LiferayAUI = Liferay.AUI;
  var combine = LiferayAUI.getCombine();
  window.__CONFIG__ = {
    basePath: '',
    combine: combine,
    reportMismatchedAnonymousModules: 'warn',
    url: combine ? LiferayAUI.getComboPath() : Liferay.ThemeDisplay.getCDNBaseURL()
  };

  if (!combine) {
    __CONFIG__.defaultURLParams = {
      languageId: themeDisplay.getLanguageId()
    };
  }

  __CONFIG__.maps = Liferay.MAPS;
  __CONFIG__.modules = Liferay.MODULES;
  __CONFIG__.paths = Liferay.PATHS;
  __CONFIG__.resolvePath = Liferay.RESOLVE_PATH;
  __CONFIG__.namespace = 'Liferay';
  __CONFIG__.explainResolutions = Liferay.EXPLAIN_RESOLUTIONS;
  __CONFIG__.exposeGlobal = Liferay.EXPOSE_GLOBAL;
  __CONFIG__.logLevel = Liferay.LOG_LEVEL;
  __CONFIG__.waitTimeout = Liferay.WAIT_TIMEOUT;
})();
//# sourceMappingURL=config.js.map
!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}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="",n(n.s=1)}([function(e){e.exports=JSON.parse('{"author":{"name":"Liferay Frontend Infrastructure Team <pt-frontend-infrastructure@liferay.com>"},"bugs":{"url":"https://github.com/liferay/liferay-frontend-projects/issues?q=is%3Aissue+is%3Aopen+label%3Aamd-loader"},"description":"AMD Loader with support for combo URL and conditional loading","files":["README.md","bin","build","package.json","src","webpack.config.js"],"homepage":"https://github.com/liferay/liferay-frontend-projects/tree/master/projects/amd-loader","keywords":["Liferay","AMD","ES6","Loader"],"license":"LGPL-3.0","name":"@liferay/amd-loader","repository":{"directory":"projects/amd-loader","type":"git","url":"https://github.com/liferay/liferay-frontend-projects.git"},"scripts":{"build":"yarn build:loader && yarn build:demo","build:demo":"node bin/build-demo.js","build:loader":"node bin/build-loader.js","ci":"cd ../.. && yarn ci","clean":"rm -rf build","demo":"node bin/run-demo.js","format":"cd ../.. && yarn format","format:check":"cd ../.. && yarn format:check","lint":"cd ../.. && yarn lint","lint:fix":"cd ../.. && yarn lint:fix","postversion":"node ../npm-tools/packages/js-publish/bin/liferay-js-publish.js","prepublishOnly":"yarn build","preversion":"yarn ci","proxyPortal":"webpack-dev-server --config webpack.proxyPortal.js","test":"cd ../.. && yarn test"},"version":"4.3.1"}')},function(e,t,n){"use strict";n.r(t);var r=n(0);var o=function e(){throw function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),new Error("Don't construct ResolvablePromise objects directly: rely on ResolvablePromise.new() instead")};function i(e){if(e.fulfilled)throw new Error("Promise already fulfilled")}function a(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)}}o.new=function(){var e={},t=new Promise((function(t,n){e._resolve=t,e._reject=n}));return Object.assign(t,e,{fulfilled:!1,rejected:!1,rejection:void 0,resolution:void 0,resolved:!1}),t.resolve=function(e){return function(e,t){i(e),e.fulfilled=!0,e.resolved=!0,e.resolution=t,e._resolve(t)}(t,e)},t.reject=function(e){return function(e,t){i(e),e.fulfilled=!0,e.rejected=!0,e.rejection=t,e._reject(t)}(t,e)},"undefined"!=typeof jest&&t.catch((function(){})),t};var l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._dependencies=void 0,this._factory=void 0,this._implementation={},this._map=void 0,this._state={_define:o.new(),_fetch:o.new(),_implement:o.new()}}var t,n,r;return t=e,(n=[{key:"name",get:function(){return this._name},set:function(e){throw new Error("Name of module ".concat(this.name," is read-only"))}},{key:"dependencies",get:function(){return this._dependencies},set:function(e){if(this._dependencies)throw new Error("Dependencies of module ".concat(this.name," already set"));this._dependencies=e}},{key:"factory",get:function(){return this._factory},set:function(e){if(this._factory)throw new Error("Factory of module ".concat(this.name," already set"));this._factory=e}},{key:"implementation",get:function(){return this._implementation},set:function(e){this._implementation=e}},{key:"map",get:function(){return this._map},set:function(e){if(this._map)throw new Error("Local module map of module ".concat(this.name," already set"));this._map=e}},{key:"esModule",get:function(){return this._implementation.__esModule},set:function(e){Object.defineProperty(this._implementation,"__esModule",{configurable:!0,value:e,writable:!0})}},{key:"fetch",get:function(){return this._state._fetch}},{key:"fetched",get:function(){return this.fetch.resolved}},{key:"define",get:function(){return this._state._define}},{key:"defined",get:function(){return this.define.resolved}},{key:"implement",get:function(){return this._state._implement}},{key:"implemented",get:function(){return this.implement.resolved}}])&&a(t.prototype,n),r&&a(t,r),e}();function u(e){return(u="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 s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(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 h=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),this._modules={},this._maps={},this._paths={},this._config={maps:{},paths:{}},this._parse(t,"defaultURLParams",{}),this._parse(t,"explainResolutions",!1),this._parse(t,"showWarnings",!1),this._parse(t,"waitTimeout",7e3),this._parse(t,"basePath","/"),this._parse(t,"resolvePath","/o/js_resolve_modules"),this._parse(t,"combine",!1),this._parse(t,"url",""),this._parse(t,"urlMaxLength",2e3),this._parse(t,"logLevel","error")}var t,n,r;return t=e,(n=[{key:"addModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._modules[e])throw new Error("Module is already registered: ".concat(e));var n=new l(e);return Object.entries(t).forEach((function(e){var t=s(e,2),r=t[0],o=t[1];n[r]=o})),this._modules[e]=n,n}},{key:"addMappings",value:function(e){Object.assign(this._maps,e)}},{key:"addPaths",value:function(e){Object.assign(this._paths,e)}},{key:"getModules",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return void 0===t?Object.values(this._modules):t.map((function(t){return e.getModule(t)}))}},{key:"getModule",value:function(e){var t=this._modules[e];if(!t){var n=this._mapModule(e);t=this._modules[n]}return t}},{key:"getDependency",value:function(e,t){var n=this.getModule(e),r=this._modules[t];if(!r){var o=this._mapModule(t,n.map);r=this._modules[o]}return r}},{key:"_parse",value:function(e,t,n){this._config[t]=Object.prototype.hasOwnProperty.call(e,t)?e[t]:n}},{key:"_mapModule",value:function(e,t){return t&&(e=this._mapMatches(e,t)),Object.keys(this._maps).length>0&&(e=this._mapMatches(e,this._maps)),e}},{key:"_mapMatches",value:function(e,t){var n=t[e];return n?"object"===u(n)?n.value:n:((n=this._mapExactMatch(e,t))||(n=this._mapPartialMatch(e,t)),n||(n=this._mapWildcardMatch(e,t)),n||e)}},{key:"_mapExactMatch",value:function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(r.value&&r.exactMatch&&e===n)return r.value}}},{key:"_mapPartialMatch",value:function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(!r.exactMatch&&(r.value&&(r=r.value),e===n||0===e.indexOf(n+"/")))return r+e.substring(n.length)}}},{key:"_mapWildcardMatch",value:function(e,t){if("function"==typeof t["*"])return t["*"](e)}},{key:"explainResolutions",get:function(){return this._config.explainResolutions}},{key:"showWarnings",get:function(){return this._config.showWarnings}},{key:"waitTimeout",get:function(){return this._config.waitTimeout}},{key:"basePath",get:function(){return this._config.basePath}},{key:"resolvePath",get:function(){return this._config.resolvePath}},{key:"combine",get:function(){return this._config.combine}},{key:"url",get:function(){return this._config.url}},{key:"urlMaxLength",get:function(){return this._config.urlMaxLength}},{key:"logLevel",get:function(){return this._config.logLevel}},{key:"defaultURLParams",get:function(){return this._config.defaultURLParams}},{key:"paths",get:function(){return this._paths}}])&&d(t.prototype,n),r&&d(t,r),e}();function m(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 p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t,this._cachedResolutions={}}var t,n,r;return t=e,(n=[{key:"resolve",value:function(e){var t=this;if(void 0===e||0==e.length)throw new Error("Argument 'modules' cannot be undefined or empty");var n=this._config;return new Promise((function(r,o){var i=t._cachedResolutions[e];if(i)r(i);else{var a="modules=".concat(encodeURIComponent(e)),l="".concat(n.resolvePath,"?").concat(a),u={};l.length>n.urlMaxLength&&(l=n.resolvePath,u={body:a,method:"POST"}),fetch(l,u).then((function(e){return e.text()})).then((function(n){var o=JSON.parse(n);t._cachedResolutions[e]=o,r(o)})).catch(o)}}))}}])&&m(t.prototype,n),r&&m(t,r),e}();function g(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={off:0,error:1,warn:2,info:3,debug:4},v="liferay-amd-loader |",_=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t}var t,n,r;return t=e,(n=[{key:"error",value:function(){var e;if(this._applies("error")){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[v].concat(n))}}},{key:"warn",value:function(){var e;if(this._applies("warn")){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).warn.apply(e,[v].concat(n))}}},{key:"info",value:function(){var e;if(this._applies("info")){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).info.apply(e,[v].concat(n))}}},{key:"debug",value:function(){var e;if(this._applies("debug")){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).debug.apply(e,[v].concat(n))}}},{key:"resolution",value:function(){var e;if(this._config.explainResolutions){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).log.apply(e,[v].concat(n))}}},{key:"_applies",value:function(e){var t=y[this._config.logLevel];return y[e]<=t}}])&&g(t.prototype,n),r&&g(t,r),e}();function b(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 w=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t}var t,n,r;return t=e,(n=[{key:"build",value:function(e){var t=this,n=this._config,r=[],o=[],i=[],a=n.basePath;return a.length&&"/"!==a.charAt(a.length-1)&&(a+="/"),e.forEach((function(e){var l=n.getModule(e),u=t._getModulePath(l);n.combine?(r.push(u),o.push(l.name)):i.push({modules:[l.name],url:t._getURLWithParams(n.url+a+u)})})),r.length&&(i=i.concat(this._generateBufferURLs(o,r,{basePath:a,url:n.url,urlMaxLength:n.urlMaxLength})),r.length=0),i}},{key:"_generateBufferURLs",value:function(e,t,n){for(var r=n.basePath,o=[],i=n.urlMaxLength,a={modules:[e[0]],url:n.url+r+t[0]},l=1;l<t.length;l++){var u=e[l],s=t[l];a.url.length+r.length+s.length+1<i?(a.modules.push(u),a.url+="&"+r+s):(o.push(a),a={modules:[u],url:n.url+r+s})}return a.url=this._getURLWithParams(a.url),o.push(a),o}},{key:"_getModulePath",value:function(e){var t=this._config.paths,n=e.name;return Object.keys(t).forEach((function(e){n!==e&&0!==n.indexOf(e+"/")||(n=t[e]+n.substring(e.length))})),n.lastIndexOf(".js")!==n.length-3&&(n+=".js"),n}},{key:"_getURLWithParams",value:function(e){var t=this._config.defaultURLParams||{},n=Object.keys(t);if(!n.length)return e;var r=n.map((function(e){return e+"="+t[e]})).join("&");return e+(e.indexOf("?")>-1?"&":"?")+r}}])&&b(t.prototype,n),r&&b(t,r),e}();function k(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 M=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._document=t,this._config=n,this._log=r,this._urlBuilder=new w(n),this._injectedScripts={}}var t,n,r;return t=e,(n=[{key:"loadModules",value:function(e){var t=this,n=this._urlBuilder;if(0==e.length)return Promise.resolve();var r=n.build(e).map((function(e){return t._loadScript(e)}));return Promise.all(r)}},{key:"_loadScript",value:function(e){var t=this,n=this._config.getModules(e.modules),r=this._injectedScripts[e.url];return r||((r=this._document.createElement("script")).src=e.url,r.async=!1,r.onload=r.onreadystatechange=function(){t.readyState&&"complete"!==t.readyState&&"load"!==t.readyState||(r.onload=r.onreadystatechange=null,r.onerror=null,n.forEach((function(e){e.fetch.fulfilled?t._log.warn("Module '".concat(e.name,"' is being fetched from\n"),r.src,"but was already fetched from\n",e.fetch.resolved?e.fetch.resolution.src:e.fetch.rejection.script.src):e.fetch.resolve(r)})))},r.onerror=function(){r.onload=r.onreadystatechange=null,r.onerror=null;var t=Object.assign(new Error("Unable to load script from URL ".concat(e.url)),{modules:e.modules,script:r,url:e.url});n.forEach((function(e){return e.fetch.reject(t)}))},this._injectedScripts[e.url]=r,this._document.head.appendChild(r)),Promise.all(n.map((function(e){return e.fetch})))}}])&&k(t.prototype,n),r&&k(t,r),e}();function j(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a 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)}}var L=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;O(this,e),this._config=new h(t||window.__CONFIG__),this._log=new _(this._config),this._dependencyResolver=new p(this._config),this._urlBuilder=new w(this._config),this._scriptLoader=new M(n||window.document,this._config,this._log),this._requireCallId=0}var t,n,o;return t=e,(n=[{key:"version",value:function(){return r.version}},{key:"define",value:function(){for(var e=this._config,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0],i=e.getModule(o);if(i&&i.defined)this._log.warn("Module '".concat(o,"' is being redefined. Only the first"),"definition will be used");else{var a=n[1],l=n[2];if(2==n.length&&(l=a,a=["require","exports","module"]),"function"!=typeof l){var u=l;l=function(){return u}}if(!(i=e.getModule(o)))throw new Error("Trying to define a module that was not registered: ".concat(o,"\n")+"This usually means that someone is calling define() for a module that has not been previously required.");if(i.defined)throw new Error("Trying to define a module more than once: ".concat(o,"\n")+"This usually means that someone is calling define() more than once for the same module, which can lead to unexpected results.");this._log.resolution("Defining",i.name),i.factory=l,i.dependencies=a,i.define.resolve(n)}}},{key:"require",value:function(){for(var e,t,n,r,o,i,a=this,l=this._scriptLoader,u=this._config,s=this._requireCallId++,c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];if(1==f.length)e=f[0],t=void 0,n=void 0;else if(2==f.length){var h=f[f.length-1];"function"==typeof h?(e=f[0],t=h,n=void 0):null==h?(e=f[0],t=void 0,n=void 0):(e=f,t=void 0,n=void 0)}else{var m=f[f.length-1],p=!1;if("function"!=typeof m&&null!=m||(p=!0),p){var g=f[f.length-2],y=!1;"function"!=typeof g&&null!=g||(y=!0),y?(e=f.slice(0,f.length-2),t=g,n=m):(e=f.slice(0,f.length-1),t=m,n=void 0)}else e=f,t=void 0,n=void 0}if("string"==typeof e)e=[e];else if(1==e.length&&Array.isArray(e[0])){var v;e=(v=[]).concat.apply(v,j(e))}if(void 0===t&&(t=function(){}),void 0===n){var _=new Error("");n=function(t){var n="(n/a)";_.stack&&(n=_.stack.split("\n").map((function(e){return"        ".concat(e)})).join("\n"),n="\n".concat(n)),a._log.error("\n","A require() call has failed but no failure handler was","provided.\n","Note that even if the call stack of this error trace","looks like coming from the Liferay AMD Loader, it is not","an error in the Loader what has caused it, but an error","caused by the require() call.\n","The reason why the Loader is in the stack trace is","because it is printing the error so that it doesn't get","lost.\n","However, we recommend providing a failure handler in all","require() calls to be able to recover from errors better","and to avoid the appearance of this message.\n","\n","Some information about the require() call follows:\n","  · Require call id:",s,"\n","  · Required modules:",e,"\n","  · Missing modules:",t.missingModules?t.missingModules:"(n/a)","\n","  · Stack trace of the require() call:","".concat(n),"\n",t)}}t=this._interceptHandler(t,"success",s),n=this._interceptHandler(n,"failure",s);var b=!1;this._dependencyResolver.resolve(e).then((function(t){if(a._log.resolution("Require call",s,"resolved modules",e,"to",t),a._throwOnLegacyProtocolResolutionErrors(t),a._logServerMessages(e,t),t.errors&&t.errors.length>1)throw Object.assign(new Error("The server generated some errors while resolving modules"),{resolutionErrors:t.errors});return u.addMappings(t.configMap),u.addPaths(t.pathMap),r=t.resolvedModules,(o=a._getUnregisteredModuleNames(r)).forEach((function(e){var n={map:t.moduleMap[e]},r=t.moduleFlags?t.moduleFlags[e]:{};(r=r||{}).esModule&&(n.esModule=!0),u.addModule(e,n)})),i=a._setRejectTimeout(e,t,(function(){b=!0,n.apply(void 0,arguments)})),a._log.resolution("Fetching",o,"from require call",s),l.loadModules(o)})).then((function(){if(!b)return a._waitForModuleDefinitions(r)})).then((function(){if(!b){clearTimeout(i),a._setModuleImplementations(s,r);var n=a._getModuleImplementations(e);t.apply(void 0,j(n))}})).catch((function(e){b||(i&&clearTimeout(i),n(e))}))}},{key:"_interceptHandler",value:function(e,t,n){var r=this;return function(){r._log.resolution("Invoking",t,"handler for","require call",n);try{e.apply(void 0,arguments)}catch(e){r._log.error("\n","A require() call",t,"handler has thrown an error.\n","Note that even if the call stack of this error trace","looks like coming from the Liferay AMD Loader, it is not","an error in the Loader what has caused it, but an error","in the handler's code.\n","The reason why the Loader is in the stack trace is","because it is printing the error on behalf of the handler","so that it doesn't get lost.\n","However, we recommend wrapping all handler code inside a","try/catch to be able to recover from errors better and to","avoid the appearance of this message.\n","\n",e)}}}},{key:"_getUnregisteredModuleNames",value:function(e){var t=this._config;return e.filter((function(e){return!t.getModule(e)}))}},{key:"_logServerMessages",value:function(e,t){t.errors&&t.errors.length>0&&this._log.error("Errors returned from server for require(",e,"):",t.errors),t.warnings&&t.warnings.length>0&&this._log.warn("Warnings returned from server for require(",e,"):",t.warnings)}},{key:"_setRejectTimeout",value:function(e,t,n){var r=this._config;if(0!==r.waitTimeout)return setTimeout((function(){var o=t.resolvedModules.filter((function(e){var t=r.getModule(e);return!t||!t.implemented})),i=Object.assign(new Error("Load timeout for modules: "+e),{missingModules:o,modules:e,resolution:t});n(i)}),r.waitTimeout)}},{key:"_throwOnLegacyProtocolResolutionErrors",value:function(e){var t=e.resolvedModules.filter((function(e){return 0===e.indexOf(":ERROR:")})).map((function(e){return e.substr(7)}));if(t.length>0)throw Object.assign(new Error("The following problems where detected while resolving modules:\n"+t.map((function(e){return"    · ".concat(e)})).join("\n")),{resolutionErrors:t})}},{key:"_waitForModuleDefinitions",value:function(e){var t=this._config;return Promise.all(t.getModules(e).map((function(e){return e.define})))}},{key:"_waitForModuleImplementations",value:function(e){var t=this._config;return Promise.all(t.getModules(e).map((function(e){return e.implement})))}},{key:"_setModuleImplementations",value:function(e,t){var n=this,r=this._config;r.getModules(t).forEach((function(t){if(!t.implemented){if(t.implement.rejected)throw t.implement.rejection;n._log.resolution("Implementing",t.name,"from require call",e);try{var o={get exports(){return t.implementation},set exports(e){t.implementation=e}},i=t.dependencies.map((function(e){if("exports"===e)return o.exports;if("module"===e)return o;if("require"===e)return n._createLocalRequire(t);var i=r.getDependency(t.name,e);if(!i)throw new Error("Unsatisfied dependency: ".concat(e," ")+"found in module ".concat(t.name));if(!i.implementation&&!i.implemented)throw new Error('Module "'+i.name+'" has not been loaded yet for context: '+t.name);return i.implementation})),a=t.factory.apply(t,j(i));void 0!==a&&(t.implementation=a),t.implement.resolve(t.implementation)}catch(e){throw t.implement.fulfilled||t.implement.reject(e),e}}}))}},{key:"_createLocalRequire",value:function(e){var t=this,n=this._config,r=function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];if(i.length>0)return t.require.apply(t,[r].concat(i));var l=n.getDependency(e.name,r);if(!l||!("implementation"in l))throw new Error('Module "'+r+'" has not been loaded yet for context: '+e.name);return l.implementation};return r.toUrl=function(e){return t._urlBuilder.build([e])[0].url},r}},{key:"_getModuleImplementations",value:function(e){return this._config.getModules(e).map((function(e){return e.implementation}))}}])&&E(t.prototype,n),o&&E(t,o),e}();L.prototype.define.amd={};var x=window.__CONFIG__||{},S="string"==typeof x.namespace?x.namespace:void 0,R=void 0===x.exposeGlobal||x.exposeGlobal,A=new L(x);if(S){var T=window[S]?window[S]:{};T.Loader=A,window[S]=T}else window.Loader=A;R&&(window.Loader=A,window.require=L.prototype.require.bind(A),window.define=L.prototype.define.bind(A),window.define.amd={})}]);
//# sourceMappingURL=loader.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.
 */
(function (A, Liferay) {
  var CLICK_EVENTS = {};
  var Util = Liferay.Util;
  A.use('attribute', 'oop', function (A) {
    A.augment(Liferay, A.Attribute, true);
  });
  Liferay.provide(Liferay, 'delegateClick', function (id, fn) {
    var el = A.config.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;
  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: function defaultFn(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('#'));
        }

        if (authToken) {
          form.append('<input name="p_auth" type="hidden" value="' + authToken + '" />');
          searchParams.delete('p_auth');
          action = baseURL + '?' + searchParams.toString();
        }

        form.attr('action', action);
        Util.submitForm(form);
        form.attr('target', '');
        Util._submitLocked = null;
      }
    }
  });
  Liferay.after('closeWindow', function (event) {
    var id = event.id;
    var dialog = 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();
    }
  });
})(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 (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 _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;
  };
  /**
   * 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.error = callbackException;

      ioConfig.complete = function (response) {
        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)) {
      if (form.enctype == STR_MULTIPART) {
        ioConfig.contentType = 'multipart/form-data';
      }

      ioConfig.formData = new FormData(form);
    }
  };

  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 data = cmd;

    if (ioConfig.formData) {
      ioConfig.formData.append('cmd', cmd);
      data = ioConfig.formData;
    }

    return Liferay.Util.fetch(instance.URL_INVOKE, {
      body: data,
      headers: {
        contentType: ioConfig.contentType
      },
      method: 'POST'
    }).then(function (response) {
      return response.json();
    }).then(ioConfig.complete).catch(ioConfig.error);
  };

  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>'
  };
})(Liferay);
//# sourceMappingURL=liferay.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=27)}([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(34);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var o=s(r),i=s(n(35)),a=s(n(36)),u=s(n(39)),c=s(n(40)),l=s(n(41));function s(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=l.default,t.default=o.default},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";Object.defineProperty(t,"__esModule",{value:!0}),t.dom=void 0;var r=n(62);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){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(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"!==i(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())||u(e)||(e=0!==e.indexOf("/")?"".concat(Liferay.ThemeDisplay.getPortalURL(),"/").concat(e):Liferay.ThemeDisplay.getPortalURL()+e);var r=new URL(e),a=new URLSearchParams(r.search),c=t.p_p_id||a.get("p_p_id");if(Object.entries(t).length&&!c)throw new TypeError("Portlet ID must not be null if parameters are provided");var l="";Object.entries(t).length&&(l=(0,o.default)(c));return Object.keys(t).forEach((function(e){var r;r=n.has(e)?e:"".concat(l).concat(e),a.set(r,t[e])})),r.search=a.toString(),r};var r,o=(r=n(17))&&r.__esModule?r:{default:r};function i(e){return(i="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 a=/^[a-z][a-z0-9+.-]*:/i;function u(e){return a.test(e)}},function(e,t){function n(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 r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(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 o=r(r({},i),t);return o.headers=n,fetch(e,o)};var i={credentials:"include"}},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(53)),o=u(n(54)),i=u(n(20)),a=u(n(55));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){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={PHONE:768,TABLET:980}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=(0,o.default)(e);return"string"==typeof t?document.querySelector(t):t.jquery?t[0]:t};var r,o=(r=n(21))&&r.__esModule?r:{default:r}},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){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){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){"string"==typeof e?e=document.querySelectorAll(e):e._node?e=[e._node]:e._nodes?e=e._nodes:e.nodeType===Node.ELEMENT_NODE&&(e=[e]);e.forEach((function(e){e.disabled=t,t?e.classList.add("disabled"):e.classList.remove("disabled")}))}},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)&&!l(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=l,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 l(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,l=[],s=!1,f=-1;function d(){s&&c&&(s=!1,c.length?l=c.concat(l):f=-1,l.length&&p())}function p(){if(!s){var e=u(d);s=!0;for(var t=l.length;t;){for(c=l,l=[];++f<t;)c&&c[f].run();f=-1,t=l.length}c=null,s=!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 v(e,t){this.fun=e,this.array=t}function y(){}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];l.push(new v(e,t)),1!==l.length||s||u(p)},v.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=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,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){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=(0,((r=n(14))&&r.__esModule?r:{default:r}).default)((function(e){return e.split("").map((function(e){return e.charCodeAt()})).join("")}));t.default=o},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,l=Object.prototype,s=i["__core-js_shared__"],f=(a=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"",d=c.toString,p=l.hasOwnProperty,v=l.toString,y=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),h=u.splice,m=S(i,"Map"),b=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!(!T(e)||(t=e,f&&f in t))&&(function(e){var t=T(e)?v.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)?y:n).test(function(e){if(null!=e){try{return d.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 T(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}g.prototype.clear=function(){this.__data__=b?b(null):{}},g.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},g.prototype.get=function(e){var t=this.__data__;if(b){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return p.call(t,e)?t[e]:void 0},g.prototype.has=function(e){var t=this.__data__;return b?void 0!==t[e]:p.call(t,e)},g.prototype.set=function(e,t){return this.__data__[e]=b&&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():h.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(m||_),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(1))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=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,a=arguments.length>2?arguments[2]:void 0;return Object.entries(t).forEach((function(t){var u=i(t,2),c=u[0],l=u[1],s=a?"".concat(a,"[").concat(c,"]"):c;Array.isArray(l)?l.forEach((function(t){e(o({},s,t),n)})):!(0,r.isObject)(l)||l instanceof File?n.append(s,l):e(l,n,s)})),n};var r=n(0);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(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(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(n,"$1")};var n=/^(?:p_p_id)?_(.*)_.*$/},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("portletId must be a string");return"_".concat(e,"_")}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PortletConstants=void 0;var n={EDIT:"edit",HELP:"help",VIEW:"view",MAXIMIZED:"maximized",MINIMIZED:"minimized",NORMAL:"normal",FULL:"cacheLevelFull",PAGE:"cacheLevelPage",PORTLET:"cacheLevelPortlet"};t.PortletConstants=n;var r=n;t.default=r},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.validateState=t.validatePortletId=t.validateParameters=t.validateForm=t.validateArguments=t.getUrl=t.getUpdatedPublicRenderParameters=t.generatePortletModeAndWindowStateString=t.generateActionUrl=t.encodeFormAsString=t.decodeUpdateString=void 0;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=!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};t.decodeUpdateString=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));(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];a(n,i)||(r=!0)})),Object.keys(o.parameters).forEach((function(e){t.parameters[e]||(r=!0)}))}return r})(e,o,t)&&(n[t]=r.portlets[t])}))}catch(e){}return n};var u=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():"",l=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 s=encodeURIComponent(e+a)+"="+encodeURIComponent(l);n.push(s)}},o=0;o<t.elements.length;o++)r(o);return n.join("&")};t.encodeFormAsString=u;var c=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};t.generateActionUrl=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 i=u(e,n);"GET"===(n.method?n.method.toUpperCase():"GET")?(t.indexOf("?")>=0?t+="&".concat(i):t+="?".concat(i),r.url=t):(r.body=i,r.headers={"Content-Type":"application/x-www-form-urlencoded"})}return r};var l=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 u=a.state.parameters[n];void 0!==u&&(i+=c("p_r_p_"===r?o:"priv_r_p_"===r?t+"priv_r_p_"+n:t+n,u))}}return i},s=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};t.generatePortletModeAndWindowStateString=s;t.getUpdatedPublicRenderParameters=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(!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 u=n.parameters[r],c=i.state.parameters[r];o=a(u,c)}}return o}(e,t,n,o)){var u=i[o];r[u]=n.parameters[o]}}))}}return r};t.getUrl=function(e,t,n,r,o,i){var a="cacheLevelPage",u="",f="";if(e&&e.portlets){"RENDER"===t&&void 0===n&&(n=null);var d=e.portlets[n];if(d&&("RESOURCE"===t?(f=decodeURIComponent(d.encodedResourceURL),o&&(a=o),f+="&p_p_cacheability="+encodeURIComponent(a),i&&(f+="&p_p_resource_id="+encodeURIComponent(i))):"RENDER"===t&&null!==n?f=decodeURIComponent(d.encodedRenderURL):"RENDER"===t?f=decodeURIComponent(e.encodedCurrentURL):"ACTION"===t?(f=decodeURIComponent(d.encodedActionURL),f+="&p_p_hub="+encodeURIComponent("0")):"PARTIAL_ACTION"===t&&(f=decodeURIComponent(d.encodedActionURL),f+="&p_p_hub="+encodeURIComponent("1")),"RESOURCE"!==t||"cacheLevelFull"!==a)){if(n&&(f+=s(e,n)),n&&(u="",d.state&&d.state.parameters)){var p=d.state.parameters;Object.keys(p).forEach((function(t){(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})(e,n,t)||(u+=l(e,n,t,"priv_r_p_"))})),f+=u}if(e.prpMap){u="";var v={};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(v,t)||(v[t]=l(e,r[0],r[1],"p_r_p_",t),u+=v[t])}))})),f+=u}}}r&&(u="",Object.keys(r).forEach((function(e){u+=c(n+e,r[e])})),f+=u);return Promise.resolve(f)};t.validateArguments=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])))}};t.validateForm=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.")};var f=function(e){if(!(0,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"))}))};t.validateParameters=f;t.validatePortletId=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)};t.validateState=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};f(e.parameters);var n=e.portletMode;if(!(0,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(!(0,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";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){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e._node||e._nodes)return e.nodeType?e:e._node||null;return e}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r){var i=!1;if(t=(0,o.default)(t)){r||((r={left:(r=t.getBoundingClientRect()).left+window.scrollX,top:r.top+window.scrollY}).bottom=r.top+t.offsetHeight,r.right=r.left+t.offsetWidth),n||(n=window),n=(0,o.default)(n);var a={};if(a.left=n.scrollX,a.right=a.left+n.innerWidth,a.top=n.scrollY,a.bottom=a.top+n.innerHeight,i=r.bottom<=a.bottom&&r.left>=a.left&&r.right<=a.right&&r.top>=a.top){var u=n.frameElement;if(u){var c=u.getBoundingClientRect(),l=(c={left:c.left+window.scrollX,top:c.top+window.scrollY}).left-a.left;r.left+=l,r.right+=l;var s=c.top-a.top;r.top+=s,r.bottom+=s,i=e(t,n.parent,r)}}}return i};var r,o=(r=n(7))&&r.__esModule?r:{default:r}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=null;if((0,r.isDef)(e)&&"FORM"===e.nodeName&&(0,r.isString)(t)){var o=e.dataset.fmNamespace||"";n=e.elements[o+t]||null}return n};var r=n(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,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(5).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(2),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){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!(0,o.isDef)(e)||"FORM"!==e.nodeName||!(0,o.isObject)(t))return;Object.entries(t).forEach((function(t){var n,r,o=(r=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){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}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),a=o[0],u=o[1],c=(0,i.default)(e,a);c&&(c.value=u)}))};var r,o=n(0),i=(r=n(23))&&r.__esModule?r:{default:r}},function(e,t,n){function r(e){return(r="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)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"portlet",{enumerable:!0,get:function(){return v.default}});var o=Q(n(28)),i=Q(n(29)),a=Q(n(30)),u=Q(n(31)),c=Q(n(32)),l=Q(n(6)),s=n(33),f=n(42),d=n(43),p=n(44),v=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=G();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(45)),y=Q(n(52)),h=Q(n(56)),m=Q(n(57)),b=Q(n(58)),g=Q(n(4)),_=Q(n(59)),w=Q(n(23)),O=Q(n(15)),j=Q(n(60)),E=Q(n(26)),S=Q(n(68)),P=Q(n(69)),T=Q(n(70)),L=Q(n(21)),k=Q(n(7)),A=Q(n(16)),M=Q(n(17)),I=n(71),C=Q(n(22)),x=Q(n(72)),D=Q(n(73)),U=Q(n(74)),R=Q(n(75)),N=Q(n(76)),F=Q(n(77)),H=Q(n(78)),q=Q(n(3)),z=Q(n(79)),W=Q(n(80)),B=n(81),V=Q(n(13)),$=Q(n(10));function G(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return G=function(){return e},e}function Q(e){return e&&e.__esModule?e:{default:e}}Liferay=window.Liferay||{},Liferay.BREAKPOINTS=l.default,Liferay.component=s.component,Liferay.componentReady=s.componentReady,Liferay.destroyComponent=s.destroyComponent,Liferay.destroyComponents=s.destroyComponents,Liferay.destroyUnfulfilledPromises=s.destroyUnfulfilledPromises,Liferay.getComponentCache=s.getComponentCache,Liferay.initComponentCache=s.initComponentCache,Liferay.Address={getCountries:m.default,getRegions:b.default},Liferay.DynamicSelect=c.default,Liferay.Language={get:function(e){return e}},Liferay.LayoutExporter={all:f.hideLayoutPane,details:f.toggleLayoutDetails,icons:(0,f.getLayoutIcons)(),proposeLayout:f.proposeLayout,publishToLive:f.publishToLive,selected:f.showLayoutPane},Liferay.Portal={Tabs:{show:d.showTab},ToolTip:{show:p.showTooltip}},Liferay.Portlet=Liferay.Portlet||{},Liferay.Portlet.minimize=v.minimizePortlet,Liferay.Portlet.openModal=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/modal/Modal",(function(e){e.openPortletModal.apply(e,t)}))},Liferay.Portlet.openWindow=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/modal/Modal",(function(e){e.openPortletWindow.apply(e,t)}))},Liferay.SideNavigation=y.default,Liferay.Util=Liferay.Util||{},Liferay.Util.MAP_HTML_CHARS_ESCAPED=I.MAP_HTML_CHARS_ESCAPED,Liferay.Util.addParams=h.default,Liferay.Util.disableEsc=function(){document.all&&27===window.event.keyCode&&(window.event.returnValue=!1)},Liferay.Util.escape=o.default,Liferay.Util.escapeHTML=I.escapeHTML,Liferay.Util.fetch=g.default,Liferay.Util.focusFormField=_.default,Liferay.Util.formatStorage=S.default,Liferay.Util.formatXML=P.default,Liferay.Util.getCropRegion=T.default,Liferay.Util.getDOM=L.default,Liferay.Util.getElement=k.default,Liferay.Util.getFormElement=w.default,Liferay.Util.getPortletId=A.default,Liferay.Util.getPortletNamespace=M.default,Liferay.Util.groupBy=i.default,Liferay.Util.inBrowserView=C.default,Liferay.Util.isEqual=a.default,Liferay.Util.isPhone=x.default,Liferay.Util.isTablet=D.default,Liferay.Util.navigate=U.default,Liferay.Util.ns=N.default,Liferay.Util.objectToFormData=O.default,Liferay.Util.objectToURLSearchParams=F.default,Liferay.Util.normalizeFriendlyURL=R.default,Liferay.Util.PortletURL={createActionURL:H.default,createPortletURL:q.default,createRenderURL:z.default,createResourceURL:W.default},Liferay.Util.postForm=j.default,Liferay.Util.setFormValues=E.default,Liferay.Util.toCharCode=V.default,Liferay.Util.toggleDisabled=$.default,Liferay.Util.openModal=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/modal/Modal",(function(e){e.openModal.apply(e,t)}))},Liferay.Util.openSelectionModal=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/modal/Modal",(function(e){e.openSelectionModal.apply(e,t)}))},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:B.getSessionValue,set:B.setSessionValue},Liferay.Util.unescape=u.default,Liferay.Util.unescapeHTML=I.unescapeHTML},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]}),l=Object.prototype.toString,s=a.Symbol,f=s?s.prototype:void 0,d=f?f.toString:void 0;function p(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return d?d.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)?"":p(t))&&r.test(e)?e.replace(n,c):e}}).call(this,n(1))},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*$/,l=/^\./,s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[r]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v["[object Function]"]=v[o]=v["[object Number]"]=v[i]=v["[object RegExp]"]=v[a]=v["[object String]"]=v["[object WeakMap]"]=!1;var y="object"==typeof e&&e&&e.Object===Object&&e,h="object"==typeof self&&self&&self.Object===Object&&self,m=y||h||Function("return this")(),b=t&&!t.nodeType&&t,g=b&&"object"==typeof n&&n&&!n.nodeType&&n,_=g&&g.exports===b&&y.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 T(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var L,k,A,M=Array.prototype,I=Function.prototype,C=Object.prototype,x=m["__core-js_shared__"],D=(L=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",U=I.toString,R=C.hasOwnProperty,N=C.toString,F=RegExp("^"+U.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=m.Symbol,q=m.Uint8Array,z=C.propertyIsEnumerable,W=M.splice,B=(k=Object.keys,A=Object,function(e){return k(A(e))}),V=Pe(m,"DataView"),$=Pe(m,"Map"),G=Pe(m,"Promise"),Q=Pe(m,"Set"),X=Pe(m,"WeakMap"),Y=Pe(Object,"create"),K=xe(V),J=xe($),Z=xe(G),ee=xe(Q),te=xe(X),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 le(e){this.__data__=new ae(e)}function se(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&&!R.call(e,i)||o&&("length"==i||Le(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 de(e,t,n,r){return ye(e,(function(e,o,i){t(r,e,n(e),i)})),r}ie.prototype.clear=function(){this.__data__=Y?Y(null):{}},ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ie.prototype.get=function(e){var t=this.__data__;if(Y){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return R.call(t,e)?t[e]:void 0},ie.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:R.call(t,e)},ie.prototype.set=function(e,t){return this.__data__[e]=Y&&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():W.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($||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)},le.prototype.clear=function(){this.__data__=new ae},le.prototype.delete=function(e){return this.__data__.delete(e)},le.prototype.get=function(e){return this.__data__.get(e)},le.prototype.has=function(e){return this.__data__.has(e)},le.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ae){var r=n.__data__;if(!$||r.length<199)return r.push([e,t]),this;n=this.__data__=new ue(r)}return n.set(e,t),this};var pe,ve,ye=(pe=function(e,t){return e&&he(e,t,Xe)},function(e,t){if(null==e)return e;if(!ze(e))return pe(e,t);for(var n=e.length,r=ve?n:-1,o=Object(e);(ve?r--:++r<n)&&!1!==t(o[r],r,o););return e}),he=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 me(e,t){for(var n=0,r=(t=ke(t,e)?[t]:je(t)).length;null!=e&&n<r;)e=e[Ce(t[n++])];return n&&n==r?e:void 0}function be(e,t){return null!=e&&t in Object(e)}function ge(e,t,n,u,c){return e===t||(null==e||null==t||!Ve(e)&&!$e(t)?e!=e&&t!=t:function(e,t,n,u,c,l){var s=qe(e),f=qe(t),d="[object Array]",p="[object Array]";s||(d=(d=Te(e))==r?i:d);f||(p=(p=Te(t))==r?i:p);var v=d==i&&!S(e),y=p==i&&!S(t),h=d==p;if(h&&!v)return l||(l=new le),s||Qe(e)?Ee(e,t,n,u,c,l):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 l=P;case a:var s=2&u;if(l||(l=T),e.size!=t.size&&!s)return!1;var f=c.get(e);if(f)return f==t;u|=1,c.set(e,t);var d=Ee(l(e),l(t),r,i,u,c);return c.delete(e),d;case"[object Symbol]":if(re)return re.call(e)==re.call(t)}return!1}(e,t,d,n,u,c,l);if(!(2&c)){var m=v&&R.call(e,"__wrapped__"),b=y&&R.call(t,"__wrapped__");if(m||b){var g=m?e.value():e,_=b?t.value():t;return l||(l=new le),n(g,_,u,c,l)}}if(!h)return!1;return l||(l=new le),function(e,t,n,r,o,i){var a=2&o,u=Xe(e),c=u.length,l=Xe(t).length;if(c!=l&&!a)return!1;var s=c;for(;s--;){var f=u[s];if(!(a?f in t:R.call(t,f)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var p=!0;i.set(e,t),i.set(t,e);var v=a;for(;++s<c;){f=u[s];var y=e[f],h=t[f];if(r)var m=a?r(h,y,f,t,e,i):r(y,h,f,e,t,i);if(!(void 0===m?y===h||n(y,h,r,o,i):m)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=e.constructor,g=t.constructor;b==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,u,c,l)}(e,t,ge,n,u,c))}function _e(e){return!(!Ve(e)||function(e){return!!D&&D in e}(e))&&(We(e)||S(e)?F:d).test(xe(e))}function we(e){return"function"==typeof e?e:null==e?Ye:"object"==typeof e?qe(e)?function(e,t){if(ke(e)&&Ae(t))return Me(Ce(e),t);return function(n){var r=function(e,t,n){var r=null==e?void 0:me(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=ke(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)&&Be(i)&&Le(a,i)&&(qe(e)||He(e))}(e,t,be)}(n,e):ge(t,r,void 0,3)}}(e[0],e[1]):function(e){var t=function(e){var t=Xe(e),n=t.length;for(;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ae(o)]}return t}(e);if(1==t.length&&t[0][2])return Me(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],l=e[c],s=u[1];if(a&&u[2]){if(void 0===l&&!(c in e))return!1}else{var f=new le;if(r)var d=r(l,s,c,e,t,f);if(!(void 0===d?ge(s,l,r,3,f):d))return!1}}return!0}(n,e,t)}}(e):ke(t=e)?(n=Ce(t),function(e){return null==e?void 0:e[n]}):function(e){return function(t){return me(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 B(e);var t,n,r,o=[];for(var i in Object(e))R.call(e,i)&&"constructor"!=i&&o.push(i);return o}function je(e){return qe(e)?e:Ie(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 l=i.get(e);if(l&&i.get(t))return l==t;var s=-1,f=!0,d=1&o?new ce:void 0;for(i.set(e,t),i.set(t,e);++s<u;){var p=e[s],v=t[s];if(r)var y=a?r(v,p,s,t,e,i):r(p,v,s,e,t,i);if(void 0!==y){if(y)continue;f=!1;break}if(d){if(!E(t,(function(e,t){if(!d.has(t)&&(p===e||n(p,e,r,o,i)))return d.add(t)}))){f=!1;break}}else if(p!==v&&!n(p,v,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 Te=function(e){return N.call(e)};function Le(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||p.test(e))&&e>-1&&e%1==0&&e<t}function ke(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 Ae(e){return e==e&&!Ve(e)}function Me(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}(V&&"[object DataView]"!=Te(new V(new ArrayBuffer(1)))||$&&Te(new $)!=o||G&&"[object Promise]"!=Te(G.resolve())||Q&&Te(new Q)!=a||X&&"[object WeakMap]"!=Te(new X))&&(Te=function(e){var t=N.call(e),n=t==i?e.constructor:void 0,r=n?xe(n):void 0;if(r)switch(r){case K:return"[object DataView]";case J:return o;case Z:return"[object Promise]";case ee:return a;case te:return"[object WeakMap]"}return t});var Ie=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 l.test(e)&&n.push(""),e.replace(s,(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 xe(e){if(null!=e){try{return U.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var De,Ue,Re=(De=function(e,t,n){R.call(e,n)?e[n].push(t):e[n]=[t]},function(e,t){var n=qe(e)?j:de,r=Ue?Ue():{};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 $e(e)&&ze(e)}(e)&&R.call(e,"callee")&&(!z.call(e,"callee")||N.call(e)==r)}Ne.Cache=ue;var qe=Array.isArray;function ze(e){return null!=e&&Be(e.length)&&!We(e)}function We(e){var t=Ve(e)?N.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function Be(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ve(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $e(e){return!!e&&"object"==typeof e}function Ge(e){return"symbol"==typeof e||$e(e)&&"[object Symbol]"==N.call(e)}var Qe=O?function(e){return function(t){return e(t)}}(O):function(e){return $e(e)&&Be(e.length)&&!!v[N.call(e)]};function Xe(e){return ze(e)?se(e):Oe(e)}function Ye(e){return e}n.exports=Re}).call(this,n(1),n(9)(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*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[r]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l[o]=l["[object Number]"]=l[i]=l["[object RegExp]"]=l[a]=l["[object String]"]=l["[object WeakMap]"]=!1;var s="object"==typeof e&&e&&e.Object===Object&&e,f="object"==typeof self&&self&&self.Object===Object&&self,d=s||f||Function("return this")(),p=t&&!t.nodeType&&t,v=p&&"object"==typeof n&&n&&!n.nodeType&&n,y=v&&v.exports===p,h=y&&s.process,m=function(){try{return h&&h.binding&&h.binding("util")}catch(e){}}(),b=m&&m.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,T=Object.prototype,L=d["__core-js_shared__"],k=P.toString,A=T.hasOwnProperty,M=(O=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",I=T.toString,C=RegExp("^"+k.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=y?d.Buffer:void 0,D=d.Symbol,U=d.Uint8Array,R=T.propertyIsEnumerable,N=S.splice,F=D?D.toStringTag:void 0,H=Object.getOwnPropertySymbols,q=x?x.isBuffer:void 0,z=(j=Object.keys,E=Object,function(e){return j(E(e))}),W=me(d,"DataView"),B=me(d,"Map"),V=me(d,"Promise"),$=me(d,"Set"),G=me(d,"WeakMap"),Q=me(Object,"create"),X=we(W),Y=we(B),K=we(V),J=we($),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&&Ae(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 l in e)!t&&!A.call(e,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||_e(l,c))||u.push(l);return u}function ce(e,t){for(var n=e.length;n--;)if(Oe(e[n][0],t))return n;return-1}function le(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=A.call(e,F),n=e[F];try{e[F]=void 0;var r=!0}catch(e){}var o=I.call(e);r&&(t?e[F]=n:delete e[F]);return o}(e):function(e){return I.call(e)}(e)}function se(e){return ke(e)&&le(e)==r}function fe(e,t,n,u,c){return e===t||(null==e||null==t||!ke(e)&&!ke(t)?e!=e&&t!=t:function(e,t,n,u,c,l){var s=Ee(e),f=Ee(t),d=s?"[object Array]":ge(e),p=f?"[object Array]":ge(t),v=(d=d==r?i:d)==i,y=(p=p==r?i:p)==i,h=d==p;if(h&&Se(e)){if(!Se(t))return!1;s=!0,v=!1}if(h&&!v)return l||(l=new ae),s||Ae(e)?ve(e,t,n,u,c,l):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 U(e),new U(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 l=_;case a:var s=1&r;if(l||(l=w),e.size!=t.size&&!s)return!1;var f=c.get(e);if(f)return f==t;r|=2,c.set(e,t);var d=ve(l(e),l(t),r,i,u,c);return c.delete(e),d;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,d,n,u,c,l);if(!(1&n)){var m=v&&A.call(e,"__wrapped__"),b=y&&A.call(t,"__wrapped__");if(m||b){var g=m?e.value():e,O=b?t.value():t;return l||(l=new ae),c(g,O,n,u,l)}}if(!h)return!1;return l||(l=new ae),function(e,t,n,r,o,i){var a=1&n,u=ye(e),c=u.length,l=ye(t).length;if(c!=l&&!a)return!1;var s=c;for(;s--;){var f=u[s];if(!(a?f in t:A.call(t,f)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var p=!0;i.set(e,t),i.set(t,e);var v=a;for(;++s<c;){f=u[s];var y=e[f],h=t[f];if(r)var m=a?r(h,y,f,t,e,i):r(y,h,f,e,t,i);if(!(void 0===m?y===h||o(y,h,n,r,i):m)){p=!1;break}v||(v="constructor"==f)}if(p&&!v){var b=e.constructor,g=t.constructor;b==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,u,c,l)}(e,t,n,u,fe,c))}function de(e){return!(!Le(e)||function(e){return!!M&&M in e}(e))&&(Pe(e)?C:u).test(we(e))}function pe(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||T,t!==r)return z(e);var t,n,r,o=[];for(var i in Object(e))A.call(e,i)&&"constructor"!=i&&o.push(i);return o}function ve(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 l=i.get(e);if(l&&i.get(t))return l==t;var s=-1,f=!0,d=2&n?new ie:void 0;for(i.set(e,t),i.set(t,e);++s<u;){var p=e[s],v=t[s];if(r)var y=a?r(v,p,s,t,e,i):r(p,v,s,e,t,i);if(void 0!==y){if(y)continue;f=!1;break}if(d){if(!g(t,(function(e,t){if(a=t,!d.has(a)&&(p===e||o(p,e,n,r,i)))return d.push(t);var a}))){f=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function ye(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,Me,be)}function he(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 me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return de(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 A.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:A.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(B||re),string:new ne}},oe.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return he(this,e).get(e)},oe.prototype.has=function(e){return he(this,e).has(e)},oe.prototype.set=function(e,t){var n=he(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(!B||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 be=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 R.call(e,t)})))}:function(){return[]},ge=le;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 k.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oe(e,t){return e===t||e!=e&&t!=t}(W&&"[object DataView]"!=ge(new W(new ArrayBuffer(1)))||B&&ge(new B)!=o||V&&"[object Promise]"!=ge(V.resolve())||$&&ge(new $)!=a||G&&"[object WeakMap]"!=ge(new G))&&(ge=function(e){var t=le(e),n=t==i?e.constructor:void 0,r=n?we(n):"";if(r)switch(r){case X:return"[object DataView]";case Y:return o;case K:return"[object Promise]";case J:return a;case Z:return"[object WeakMap]"}return t});var je=se(function(){return arguments}())?se:function(e){return ke(e)&&A.call(e,"callee")&&!R.call(e,"callee")},Ee=Array.isArray;var Se=q||function(){return!1};function Pe(e){if(!Le(e))return!1;var t=le(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Te(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Le(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ke(e){return null!=e&&"object"==typeof e}var Ae=b?function(e){return function(t){return e(t)}}(b):function(e){return ke(e)&&Te(e.length)&&!!l[le(e)]};function Me(e){return null!=(t=e)&&Te(t.length)&&!Pe(t)?ue(e):pe(e);var t}n.exports=function(e,t){return fe(e,t)}}).call(this,n(1),n(9)(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]}),l=Object.prototype.toString,s=a.Symbol,f=s?s.prototype:void 0,d=f?f.toString:void 0;function p(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return d?d.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)?"":p(t))&&r.test(e)?e.replace(n,c):e}}).call(this,n(1))},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(10))&&r.__esModule?r:{default:r};function i(e){return(i="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 a(e,t){var n=e.indexOf('">'),r=e.substring(n);n=t.indexOf('">');var o=t.substring(n);return r<o?-1:r>o?1:0}function u(e){return function(e){return!!Array.isArray(e)||!(!e||"object"!==i(e)||"number"!=typeof e.length||e.tagName||e.scrollTo||e.document)}(e)?Array.from(e):[e]}function c(e,t,n){var r=e[t],i=document.getElementById(r.select);if(i){var c=u(r.selectVal),l=[];for(!1!==r.selectNullable&&l.push('<option selected value="0"></option>'),n.forEach((function(e){var t=e[r.selectId],n=e[r.selectDesc],o="";c.indexOf(t)>-1&&(o='selected="selected"'),l.push("<option ".concat(o,' value="').concat(t,'">').concat(n,"</option>"))})),r.selectSort&&l.sort(a);i.lastChild;)i.removeChild(i.lastChild);i.innerHTML=l.join(""),r.selectDisableOnEmpty&&(0,o.default)(i,!n.length)}}function l(e){e.forEach((function(t,n){var r,o=t.select,i=document.getElementById(o),a=t.selectData;i&&(i.setAttribute("data-componentType","dynamic_select"),n>0&&(r=e[n-1].selectVal),a((function(t){c(e,n,t)}),r),i.getAttribute("name")||i.setAttribute("name",o),i.addEventListener("change",(function(){!function(e,t){if(t+1<e.length){var n=document.getElementById(e[t].select);(0,e[t+1].selectData)((function(n){c(e,t+1,n)}),n&&n.value)}}(e,n)})))}))}t.default=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(t)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.initComponentCache=t.getComponentCache=t.destroyUnfulfilledPromises=t.destroyComponents=t.destroyComponent=t.componentReady=t.component=void 0;var r=n(0),o={},i={},a={},u={},c={},l=["p_p_id","p_p_lifecycle"],s=["ddmStructureKey","fileEntryTypeId","folderId","navigation","status"],f=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},d=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)}))},p=function(e){var t=new URL(window.location.href),n=new URL(e.path,window.location.href);if(l.every((function(e){return n.searchParams.get(e)===t.searchParams.get(e)}))){var i=Object.keys(a);i=i.filter((function(e){var i=a[e],u=o[e],c=s.every((function(e){var r=!1;if(u){var o="_".concat(u.portletId,"_").concat(e);r=n.searchParams.get(o)===t.searchParams.get(o)}return r}));return!!(0,r.isFunction)(i.isCacheable)&&i.isCacheable(n)&&c&&u&&u.cacheState&&i.element&&i.getState})),u=i.reduce((function(e,t){var n=a[t],r=o[t],i=n.getState(),u=r.cacheState.reduce((function(e,t){return e[t]=i[t],e}),{});return e[t]={html:n.element.innerHTML,state:u},e}),[]),Liferay.DOMTaskRunner.addTask({action:d,condition:function(e){return"liferay.component"===e.owner}}),Liferay.DOMTaskRunner.addTaskState({data:u,owner:"liferay.component"})}else u={}},v=function(e,t,n){var u;if(1===arguments.length){var l=a[e];l&&(0,r.isFunction)(l)&&(c[e]=l,l=l(),a[e]=l),u=l}else if(a[e]&&null!==t&&(delete o[e],delete i[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.')),u=a[e]=t,null===t)delete o[e],delete i[e];else{o[e]=n,Liferay.fire(e+":registered");var s=i[e];s?s.resolve(t):i[e]=f(t)}return u};t.component=v;t.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=i[t];o||(i[t]=o=f()),n=o.promise}return n};var y=function(e){var t=a[e];if(t){var n=t.destroy||t.dispose;n&&n.call(t),delete o[e],delete i[e],delete c[e],delete a[e]}};t.destroyComponent=y;t.destroyComponents=function(e){var t=Object.keys(a);e&&(t=t.filter((function(t){return e(a[t],o[t]||{})}))),t.forEach(y)};t.destroyUnfulfilledPromises=function(){i={}};t.getComponentCache=function(e){var t=u[e];return t?t.state:{}};t.initComponentCache=function(){Liferay.on("startNavigate",p)};var h=v;t.default=h},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(37).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(38),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(1))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,u,c=1,l={},s=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){v(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){v(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(){v(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(v,0,e)}:(a="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&v(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),r=function(t){e.postMessage(a+t,"*")}),d.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 l[c]=o,r(c),c++},d.clearImmediate=p}function p(e){delete l[e]}function v(e){if(s)setTimeout(v,0,e);else{var t=l[e];if(t){s=!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{p(e),s=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(1),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){Object.defineProperty(t,"__esModule",{value:!0}),t.hideLayoutPane=function(e){var t=(e=e||{}).obj,n=e.pane;t&&t.checked&&(n=document.querySelector(n))&&n.classList.add("hide")},t.getLayoutIcons=function(){return{minus:themeDisplay.getPathThemeImages()+"/arrows/01_minus.png",plus:themeDisplay.getPathThemeImages()+"/arrows/01_plus.png"}},t.proposeLayout=function(e){var t=(e=e||{}).namespace,n=e.reviewers,r='<div><form action="'+e.url+'" method="post">';if(n.length>0){r+='<textarea name="'+t+'description" style="height: 100px; width: 284px;"></textarea><br /><br />'+'Người\x20xem\x20xét'+' <select name="'+t+'reviewUserId">';for(var o=0;o<n.length;o++)r+='<option value="'+n[o].userId+'">'+n[o].fullName+"</option>";r+='</select><br /><br /><input type="submit" value="'+'Tiến\x20hành'+'" />'}else r+='Không\x20tìm\x20thấy\x20người\x20xem\x20xét\x2e'+"<br />"+'Vui\x20lòng\x20liên\x20hệ\x20tới\x20quản\x20trị\x20viên\x20để\x20cấp\x20quyền\x20xem\x20nội\x20dung\x2e'+"<br /><br />";r+="</form></div>",Liferay.Util.openWindow({dialog:{destroyOnHide:!0},title:r})},t.publishToLive=function(e){e=e||{},Liferay.Util.openWindow({dialog:{constrain:!0,modal:!0,on:{visibleChange:function(e){e.newVal||this.destroy()}}},title:e.title,uri:e.url})},t.showLayoutPane=function(e){var t=(e=e||{}).obj,n=e.pane;t&&t.checked&&(n=document.querySelector(n))&&n.classList.remove("hide")},t.toggleLayoutDetails=function(e){e=e||{};var t=document.querySelector(e.detail),n=document.querySelector(e.toggle);if(t&&n){var r=themeDisplay.getPathThemeImages()+"/arrows/01_plus.png";t.classList.contains("hide")?(t.classList.remove("hide"),r=themeDisplay.getPathThemeImages()+"/arrows/01_minus.png"):t.classList.add("hide"),n.setAttribute("src",r)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.showTab=function(e,t,n,r){var a=e+(0,o.default)(n),u=document.getElementById(a+"TabsId"),c=document.getElementById(a+"TabsSection");if(u&&c){var l={id:n,names:t,namespace:e,selectedTab:u,selectedTabSection:c};r&&"function"==typeof r&&r.call(this,e,t,n,l);try{Liferay.on("showTab",i),Liferay.fire("showTab",l)}finally{Liferay.detach("showTab",i)}}},t.applyTabSelectionDOMChanges=i;var r,o=(r=n(13))&&r.__esModule?r:{default:r};function i(e){var t=e.id,n=e.names,r=e.namespace,i=e.selectedTab,a=e.selectedTabSection,u=i.querySelector("a");if(i&&u){var c=i.parentElement.querySelector(".active");c&&c.classList.remove("active"),u.classList.add("active")}a&&a.classList.remove("hide");var l,s=document.getElementById(r+"dropdownTitle");s&&u&&(s.innerHTML=u.textContent),n.splice(n.indexOf(t),1);for(var f=0;f<n.length;f++)(l=document.getElementById(r+(0,o.default)(n[f])+"TabsSection"))&&l.classList.add("hide")}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.showTooltip=function(e,t){e.setAttribute("title",t),e.classList.add("lfr-portal-tooltip")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.minimizePortlet=function(e,t,n){n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({doAsUserId:themeDisplay.getDoAsUserIdEncoded(),plid:themeDisplay.getPlid()},n);var u=document.querySelector(e);if(u){var s=u.querySelector(".portlet-content-container");if(s){var f=s.classList.contains("hide");if(f?(s.classList.remove("hide"),u.classList.remove("portlet-minimized")):(s.classList.add("hide"),u.classList.add("portlet-minimized")),t){var d=f?'Thu\x20nhỏ':'Phục\x20hồi\x20lại';t.setAttribute("alt",d),t.setAttribute("title",d);var p=t.querySelector(".taglib-text-icon");p&&(p.innerHTML=d);var v=t.querySelector("i");v&&(v.classList.remove("icon-minus","icon-resize-vertical"),f?(v.classList.add("icon-minus"),v.classList.remove("icon-resize-vertical")):(v.classList.add("icon-resize-vertical"),v.classList.remove("icon-minus")))}var y=(0,i.default)(u.id),h=(0,o.default)({cmd:"minimize",doAsUserId:n.doAsUserId,p_auth:Liferay.authToken,p_l_id:n.plid,p_p_id:y,p_p_restore:f,p_v_l_s_g_id:themeDisplay.getSiteGroupId()});(0,r.default)(themeDisplay.getPathMain()+"/portal/update_layout",{body:h,method:"POST"}).then((function(e){if(e.ok&&f){var t={doAsUserId:n.doAsUserId,p_l_id:n.plid,p_p_boundary:!1,p_p_id:y,p_p_isolated:!0};(0,r.default)((0,a.default)(themeDisplay.getPathMain()+"/portal/render_portlet",t)).then((function(e){return e.text()})).then((function(e){var t=document.createRange();t.selectNode(u),u.innerHTML="";var n=t.createContextualFragment(e);u.appendChild(n)})).catch((function(e){0}))}})).catch((function(e){0}))}}},t.default=void 0;var r=u(n(4)),o=u(n(15)),i=u(n(16)),a=u(n(3));function u(e){return e&&e.__esModule?e:{default:e}}function c(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 l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s={register:u(n(46)).default};t.default=s},function(e,t,n){(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.register=void 0;var r,o=(r=n(47))&&r.__esModule?r:{default:r},i=n(19);var a=function(t){(0,i.validateArguments)(arguments,1,1,["string"]);var n=e.portlet.data.pageRenderState;return new Promise((function(e,r){(0,i.validatePortletId)(n,t)?e(new o.default(t)):r(new Error("Invalid portlet ID"))}))};t.register=a;var u=a;t.default=u}).call(this,n(1))},function(e,t,n){(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PortletInit=void 0;var r=n(0),o=l(n(48)),i=l(n(4)),a=l(n(51)),u=l(n(18)),c=n(19);function l(e){return e&&e.__esModule?e:{default:e}}function s(e){return(s="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 d(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 p(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 v(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){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 h,m=window.history&&window.history.pushState,b=!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?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},u.default),h||(h=e.portlet.data.pageRenderState,this._updateHistory(!0)),this.portletModes=h.portlets[this._portletId].allowedPM.slice(0),this.windowStates=h.portlets[this._portletId].allowedWS.slice(0)}var n,l,w;return n=t,(l=[{key:"_executeAction",value:function(e,t){var n=this;return new Promise((function(r,o){(0,c.getUrl)(h,"ACTION",n._portletId,e).then((function(e){var a=(0,c.generateActionUrl)(n._portletId,e,t);(0,i.default)(a.url,a).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(!(0,r.isString)(t))throw new TypeError("Invalid update string: ".concat(t));this._updatePageState(t,e).then((function(e){n._updatePortletStates(e)}),(function(t){b=!1,n._reportError(e,t)}))}},{key:"_setState",value:function(e){var t=this,n=(0,c.getUpdatedPublicRenderParameters)(h,this._portletId,e),r=[];Object.keys(n).forEach((function(e){var o=n[e],i=h.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 h.portlets[a].state.parameters[u]:h.portlets[a].state.parameters[u]=d(o),r.push(a)}}))}));var o=this._portletId;return h.portlets[o].state=e,r.push(o),r.forEach((function(e){h.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 b=!0,this._executeAction(e,t).then((function(e){return n._updatePortletStates(e).then((function(e){return b=!1,e}))}),(function(e){b=!1,n._reportError(n._portletId,e)}))}},{key:"_updateHistory",value:function(e){m&&(0,c.getUrl)(h,"RENDER",null,{}).then((function(t){var n=JSON.stringify(h);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=(0,c.decodeUpdateString)(h,e),r=[],o=!1;return Object.entries(n).forEach((function(e){var t=f(e,2),n=t[0],i=t[1];h.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?b=!1:e.forEach((function(e){t._updateStateForPortlet(e)})),n(e)}))}},{key:"_updateState",value:function(e){var t=this;if(b)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"};b=!0,this._setState(e).then((function(e){t._updatePortletStates(e)})).catch((function(e){b=!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(b=!0;_.length>0;){var e=_.shift(),t=e.handler,n=e.id;if(h.portlets[n]){var r=h.portlets[n].renderData,o=new a.default(h.portlets[n].state);r&&r.content?t("portlet.onStateChange",o,r):t("portlet.onStateChange",o)}}b=!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((0,r.isObject)(o)){if((0,c.validateParameters)(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&&(0,c.validateForm)(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(!(0,r.isString)(e)||!(0,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 i=(0,o.default)(),a={handle:i,handler:t,id:n,type:e};return g[i]=a,"portlet.onStateChange"===e&&this._updateStateForPortlet(this._portletId),i}},{key:"createResourceUrl",value:function(e,t,n){if(arguments.length>3)throw new TypeError("Too many arguments. 3 arguments are allowed.");if(e){if(!(0,r.isObject)(e))throw new TypeError("Invalid argument type. Resource parameters must be a parameters object.");(0,c.validateParameters)(e)}var o=null;if(t){if(!(0,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&&!(0,r.isString)(n))throw new TypeError("Invalid argument type. Resource ID argument must be a string.");return(0,c.getUrl)(h,"RESOURCE",this._portletId,e,o,n)}},{key:"dispatchClientEvent",value:function(e,t){if((0,c.validateArguments)(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 b}},{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]=d(e[n]))})),t}},{key:"newState",value:function(e){return new a.default(e)}},{key:"removeEventListener",value:function(e){if(arguments.length>1)throw new TypeError("Too many arguments passed to removeEventListener");if(!(0,r.isDefAndNotNull)(e))throw new TypeError("The event handle provided is ".concat(s(e)));var t=!1;if((0,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((0,c.validateArguments)(arguments,1,1,["object"]),h.portlets&&h.portlets[this._portletId]){var t=h.portlets[this._portletId];(0,c.validateState)(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(!(0,r.isObject)(e))throw new TypeError("Invalid argument type. Argument is of type ".concat(s(e)));(0,c.validateParameters)(e),n=e}if(!0===b)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"};b=!0;var o={setPageState:function(e){t._setPageState(t._portletId,e)},url:""};return(0,c.getUrl)(h,"PARTIAL_ACTION",this._portletId,n).then((function(e){return o.url=e,o}))}}])&&y(n.prototype,l),w&&y(n,w),t}();t.PortletInit=w;var O=w;t.default=O}).call(this,n(1))},function(e,t,n){var r,o,i=n(49),a=n(50),u=0,c=0;e.exports=function(e,t,n){var l=t&&n||0,s=t||[],f=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==d){var p=i();null==f&&(f=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=o=16383&(p[6]<<8|p[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:c+1,h=v-u+(y-c)/1e4;if(h<0&&void 0===e.clockseq&&(d=d+1&16383),(h<0||v>u)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=v,c=y,o=d;var m=(1e4*(268435455&(v+=122192928e5))+y)%4294967296;s[l++]=m>>>24&255,s[l++]=m>>>16&255,s[l++]=m>>>8&255,s[l++]=255&m;var b=v/4294967296*1e4&268435455;s[l++]=b>>>8&255,s[l++]=255&b,s[l++]=b>>>24&15|16,s[l++]=b>>>16&255,s[l++]=d>>>8|128,s[l++]=255&d;for(var g=0;g<6;++g)s[l+g]=f[g];return t||a(s)}},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){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RenderState=void 0;var r,o=n(0),i=(r=n(18))&&r.__esModule?r:{default:r};function a(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 u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(0,o.isObject)(t)?this.from(t):(this.parameters={},this.portletMode=i.default.VIEW,this.windowState=i.default.NORMAL)}var t,n,r;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){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(!(0,o.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(!(0,o.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(!(0,o.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(!(0,o.isString)(e))throw new TypeError("Portlet Mode must be a string");e!==i.default.EDIT&&e!==i.default.HELP&&e!==i.default.VIEW||(this.portletMode=e)}},{key:"setValue",value:function(e,t){if(!(0,o.isString)(e))throw new TypeError("Parameter name must be a string");if(!(0,o.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(!(0,o.isString)(e))throw new TypeError("Window State must be a string");e!==i.default.MAXIMIZED&&e!==i.default.MINIMIZED&&e!==i.default.NORMAL||(this.windowState=e)}}])&&a(t.prototype,n),r&&a(t,r),e}();t.RenderState=u;var c=u;t.default=c},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(5))&&r.__esModule?r:{default:r};function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(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 c(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 s={breakpoint:768,content:".sidenav-content",gutter:"0px",loadingIndicatorTPL:'<div class="loading-animation loading-animation-md"></div>',navigation:".sidenav-menu-slider",position:"left",type:"relative",typeMobile:"relative",url:null,width:"225px"},f=new WeakMap;function d(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 p(e){return e=d(e),f.get(e)}var v=[/^aria-/,/^data-/,/^type$/];function y(e,t){m(e,c({},t,!0))}function h(e,t){m(e,c({},t,!1))}function m(e,t){(e=d(e))&&Object.entries(t).forEach((function(t){var n=u(t,2),r=n[0],o=n[1];r.split(/\s+/).forEach((function(t){o?e.classList.add(t):e.classList.remove(t)}))}))}function b(e,t){return e=d(e),t.split(/\s+/).every((function(t){return e.classList.contains(t)}))}function g(e,t){(e=d(e))&&Object.entries(t).forEach((function(t){var n=u(t,2),r=n[0],o=n[1];e.style[r]=o}))}function _(e){return"number"==typeof e?e+"px":"string"==typeof e&&e.match(/^\s*\d+\s*$/)?e.trim()+"px":e}function w(e){return e.getBoundingClientRect().left+(e.ownerDocument.defaultView.pageOffsetX||0)}var O={};function j(e,t,n){if(e){O[t]||(O[t]={},document.body.addEventListener(t,(function(e){return function(e,t){Object.keys(O[e]).forEach((function(n){for(var r=!1,o=t.target;o&&!(r=o.matches&&o.matches(n));)o=o.parentNode;r&&O[e][n].emit("click",t)}))}(t,e)})));var r=O[t],i="string"==typeof e?e:function(e){if((e=d(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 v.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[i]||(r[i]=new o.default);var a=r[i].on(t,(function(e){e.defaultPrevented||n(e)}));return{dispose:function(){a.dispose()}}}return null}function E(e){return parseInt(e,10)||0}function S(e,t){e=d(e),this.init(e,t)}function P(){var e=document.querySelectorAll('[data-toggle="liferay-sidenav"]');Array.from(e).forEach(S.initialize)}S.TRANSITION_DURATION=500,S.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 b(document.querySelector(e.container),"sidenav-right")},_isSimpleSidenavClosed:function(){var e=this.options,t=e.openClass;return!b(document.querySelector(e.container),t)},_loadUrl:function(e,t){var n=this,r=e.querySelector(".sidebar-body");if(!n._fetchPromise&&r){for(;r.firstChild;)r.removeChild(r.firstChild);var o=document.createElement("div");y(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.error(e)}))}},_renderNav:function(){var e=this.options,t=document.querySelector(e.container),n=t.querySelector(e.navigation).querySelector(".sidenav-menu"),r=b(t,"closed"),o=this._isSidenavRight(),i=this._getSidenavWidth();r?(g(n,{width:_(i)}),o&&g(n,c({},e.rtl?"left":"right",_(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&&(m(t,{closed:!0,open:!1}),m(n,{active:!1,open:!1})),"right"===e.position&&y(t,"sidenav-right"),"relative"!==o&&y(t,"sidenav-fixed"),this._renderNav()),g(t,{display:""})},_subscribeClickSidenavClose:function(){var e=this,t=e.options.container;if(!e._sidenavCloseSubscription){var n="".concat(t," .sidenav-close");e._sidenavCloseSubscription=j(n,"click",(function(t){t.preventDefault(),e.toggle()}))}},_subscribeClickTrigger:function(){var e=this;if(!e._togglerSubscription){var t=e.toggler;e._togglerSubscription=j(t,"click",(function(t){e.toggle(),t.preventDefault()}))}},_subscribeSidenavTransitionEnd:function(e,t){setTimeout((function(){h(e,"sidenav-transition"),t()}),S.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){g(e,{height:"","min-height":""})}))},destroy:function(){this._sidenavCloseSubscription&&(this._sidenavCloseSubscription.dispose(),this._sidenavCloseSubscription=null),this._togglerSubscription&&(this._togglerSubscription.dispose(),this._togglerSubscription=null),f.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"),g(r,(c(n={},"padding-"+u,""),c(n,u,""),n)),g(o,{width:""}),a&&g(i,c({},u,_(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,l=e.toggler,s=l.dataset.target||l.getAttribute("href");if(e._emit("closedStart.lexicon.sidenav"),e._subscribeSidenavTransitionEnd(o,(function(){h(i,"sidenav-transition"),h(l,"sidenav-transition"),e._emit("closed.lexicon.sidenav")})),b(o,u))m(o,(c(r={},a,!0),c(r,u,!1),c(r,"sidenav-transition",!0),r));y(i,"sidenav-transition"),y(l,"sidenav-transition"),m(i,(c(n={},a,!0),c(n,u,!1),n));var f=document.querySelectorAll('[data-target="'.concat(s,'"], [href="').concat(s,'"]'));Array.from(f).forEach((function(e){m(e,c({active:!1},u,!1)),m(e,c({active:!1},u,!1))}))}},init:function(e,t){var n="liferay-sidenav"===e.dataset.toggle;(t=a(a({},s),t)).breakpoint=E(t.breakpoint),t.container=t.container||e.dataset.target||e.getAttribute("href"),t.gutter=E(t.gutter),t.rtl="rtl"===document.dir,t.width=E(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 o.default,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=_(Math.max(a,u));g(r,{"min-height":c}),g(o,{height:"100%","min-height":c}),g(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(),l=u+t.gutter,s=t.url;s&&this._loadUrl(i,s),g(o,{width:_(u)}),g(i,{width:_(u)});var f=t.rtl?"right":"left";a&&(f=t.rtl?"left":"right");var d=e?f:"padding-"+f;if("fixed"!==(e?t.typeMobile:t.type)){var p=b(n,"open")?w(o)-t.gutter:w(o)-l,v=w(r),y=E(getComputedStyle(r).width),h="";t.rtl&&a||!t.rtl&&"left"===t.position?(p=w(o)+l)>v&&(h=p-v):(t.rtl&&"left"===t.position||!t.rtl&&a)&&p<v+y&&(h=v+y-p)>=l&&(h=l),g(r,c({},d,_(h)))}},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,l=t.openClass,s=e.toggler,f=s.dataset.url;f&&e._loadUrl(a,f),e._emit("openStart.lexicon.sidenav"),e._subscribeSidenavTransitionEnd(i,(function(){h(a,"sidenav-transition"),h(s,"sidenav-transition"),e._emit("open.lexicon.sidenav")})),m(i,(c(n={},u,!1),c(n,l,!0),c(n,"sidenav-transition",!0),n)),m(a,(c(r={},u,!1),c(r,l,!0),c(r,"sidenav-transition",!0),r)),m(s,(c(o={active:!0},l,!0),c(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:b(r,"closed"),l=t._isSidenavRight();if(u?t._emit("openStart.lexicon.sidenav"):t._emit("closedStart.lexicon.sidenav"),t._subscribeSidenavTransitionEnd(r,(function(){var e=r.querySelector(".sidenav-menu");b(r,"closed")?(t.clearHeight(),m(i,{open:!1,"sidenav-transition":!1}),t._emit("closed.lexicon.sidenav")):(m(i,{open:!0,"sidenav-transition":!1}),t._emit("open.lexicon.sidenav")),t.mobile&&e.focus()})),u){t.setHeight(),g(o,{width:_(a)});var s=n.rtl?"left":"right";l&&g(o,c({},s,""))}y(r,"sidenav-transition"),y(i,"sidenav-transition"),u?t.showSidenav():t.hideSidenav(),m(r,{closed:!u,open:u}),m(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=b(t,"sidenav-transition")?!b(t,"closed"):b(t,"closed")}return!e}},S.destroy=function(e){var t=p(e);t&&t.destroy()},S.hide=function(e){var t=p(e);t&&t.hide()},S.initialize=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=d(e);var n=f.get(e);return n||(n=new S(e,t),f.set(e,n)),n},S.instance=p,"loading"!==document.readyState?P():document.addEventListener("DOMContentLoaded",(function(){P()}));var T=S;t.default=T},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(20),u=(r=a)&&r.__esModule?r:{default:r};var c=[0],l=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 s(this.events_&&this.events_[e]).concat(s(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_(s(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=s(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 s(e){return e=e||[],Array.isArray(e)?e:[e]}t.default=l},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){function n(e){return(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})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e||"object"!==n(e)&&"string"!=typeof e)throw new TypeError("Parameter params must be an object or string");if("string"!=typeof t)throw new TypeError("Parameter baseUrl must be a string");var r=t.startsWith("/")?new URL(t,location.href):new URL(t);if("object"===n(e))Object.entries(e).forEach((function(e){var t,n,o=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){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}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),i=o[0],a=o[1];r.searchParams.append(i,a)}));else{new URLSearchParams(e.trim()).forEach((function(e,t){e?r.searchParams.append(t,e):r.searchParams.append(t,"")}))}return r.toString()}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("function"!=typeof e)throw new TypeError("Parameter callback must be a function");Liferay.Service("/country/get-countries",{active:!0},e)}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("function"!=typeof e)throw new TypeError("Parameter callback must be a function");if("string"!=typeof t)throw new TypeError("Parameter selectKey must be a string");Liferay.Service("/region/get-regions",{active:!0,countryId:parseInt(t,10)},e)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e=(0,r.default)(e),(0,o.default)(e)){var t=function(e){var t=[];for(;e.parentElement;)e.parentElement.getAttribute("disabled")&&t.push(e.parentElement),e=e.parentElement;return t}(e),n=!e.getAttribute("disabled")&&e.offsetWidth>0&&e.offsetHeight>0&&!t.length,i=e.closest("form");if(!i||n)e.focus();else if(i){var a=i.getAttribute("data-fm-namespace")+"formReady";Liferay.on(a,(function t(n){i.getAttribute("name")===n.formName&&(e.focus(),Liferay.detach(a,t))}))}}};var r=i(n(7)),o=i(n(22));function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((e=o.default.toElement(e))&&"FORM"===e.nodeName)if(e.setAttribute("method","post"),(0,r.isObject)(t)){var n=t.data,a=t.url;if(!(0,r.isObject)(n))return;(0,i.default)(e,n),(0,r.isDef)(a)?(0,r.isString)(a)&&submitForm(e,a):submitForm(e)}else submitForm(e)};var r=n(0),o=a(n(61)),i=a(n(26));function a(e){return e&&e.__esModule?e:{default:e}}},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(2);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(64)),u=f(n(24)),c=f(n(25)),l=f(n(65)),s=f(n(66));function f(e){return e&&e.__esModule?e:{default:e}}n(67),t.domData=i.default,t.DomEventEmitterProxy=a.default,t.DomEventHandle=u.default,t.features=c.default,t.globalEval=l.default,t.globalEvalStyles=s.default,t.default=o.default},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]?d(e[n],t):p(e[n],t)},t.closest=y,t.append=h,t.buildFragment=m,t.contains=b,t.delegate=g,t.isNodeListLike=w,t.enterDocument=function(e){e&&h(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=m(t));if(!w(t)&&!(0,r.isDefAndNotNull)(e.firstChild))return h(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){s[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):T(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(s[t])return!0;(0,r.isString)(e)&&(c[e]||(c[e]=document.createElement(e)),e=c[e]);var n=e.tagName;l[n]&&l[n].hasOwnProperty(t)||(l[n]=l[n]||{},l[n][t]="on"+t in e);return l[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(63)),a=u(n(24));function u(e){return e&&e.__esModule?e:{default:e}}var c={},l={},s=t.customEvents={},f={blur:!0,error:!0,focus:!0,invalid:!0,load:!0,scroll:!0};function d(e,t){t.split(" ").forEach((function(t){t&&e.classList.add(t)}))}function p(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 v(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function y(e,t){for(;e&&!j(e,t);)e=e.parentNode;return e}function h(e,t){if((0,r.isString)(t)&&(t=m(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 m(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 b(e,t){return(0,r.isDocument)(e)?e.documentElement.contains(t):e.contains(t)}function g(e,t,n,a,u){var c=s[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){v(o.default.get(e,"delegating",{})[t].selectors,n,r)}(e,t,n,a):function(e,t,n){v(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=k,e.stopImmediatePropagation=L}(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&=A(o,t,n),r&=I(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=s[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 y(e.parentNode,t)}function P(e,t){t.split(" ").forEach((function(t){t&&e.classList.remove(t)}))}function T(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 L(){this.stopped=!0,this.stoppedImmediate=!0,Event.prototype.stopImmediatePropagation.call(this)}function k(){this.stopped=!0,Event.prototype.stopPropagation.call(this)}function A(e,t,n){var i=t.__metal_last_container__;return!(!(0,r.isDef)(i)||!b(i,e))||M(o.default.get(e,"listeners",{})[t.type],t,e,n)}function M(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 I(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&=M(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(5).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(2);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(5).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(2);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(2);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(2),a=n(25),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){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i(i({},u),t),o=n.addSpaceBeforeSuffix,a=n.decimalSeparator,c=n.denominator,l=n.suffixGB,s=n.suffixKB,f=n.suffixMB;if(!(0,r.isNumber)(e))throw new TypeError("Parameter size must be a number");var d=0,p=s;(e/=c)>=c&&(p=f,e/=c,d=1);e>=c&&(p=l,e/=c,d=1);var v=e.toFixed(d);"."!==a&&(v=v.replace(/\./,a));return v+(o?" ":"")+p};var r=n(0);function o(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 i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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}var u={addSpaceBeforeSuffix:!1,decimalSeparator:".",denominator:1024,suffixGB:"GB",suffixKB:"KB",suffixMB:"MB"}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i(i({},j),t),o=n.newLine,a=n.tagIndent;if(!(0,r.isString)(e))throw new TypeError("Parameter content must be a string");var S=[];e=(e=(e=(e=(e=(e=e.trim()).replace(u,(function(e){return S.push(e),"<~::~CDATA~::~>"}))).replace(w,"><")).replace(g,"~::~<")).replace(m,"~::~$1$2")).replace(O,(function(){return S.shift()}));var P=0,T=!1,L=e.split("~::~"),k=0,A="";return L.forEach((function(e,t){u.test(e)?A+=E(k,o,a)+e:l.test(e)?(A+=E(k,o,a)+e,P++,T=!0,(c.test(e)||f.test(e))&&(P--,T=0!==P)):c.test(e)?(A+=e,P--,T=0!==P):d.exec(L[t-1])&&p.exec(e)&&v.exec(L[t-1])==y.exec(e)[0].replace("/","")?(A+=e,T||--k):!h.test(e)||b.test(e)||_.test(e)?h.test(e)&&b.test(e)?A+=T?e:E(k,o,a)+e:b.test(e)?A+=T?e:E(--k,o,a)+e:_.test(e)?A+=T?e:E(k,o,a)+e:(s.test(e),A+=E(k,o,a)+e):A+=T?e:E(k++,o,a)+e,new RegExp("^"+o).test(A)&&(A=A.slice(o.length))})),A};var r=n(0);function o(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 i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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}var u=/<!\[CDATA\[[\0-\uFFFF]*?\]\]>/g,c=/-->|\]>/,l=/<!/,s=/<\?/,f=/!DOCTYPE/,d=/^<\w/,p=/^<\/\w/,v=/^<[\w:\-.,]+/,y=/^<\/[\w:\-.,]+/,h=/<\w/,m=/\s*(xmlns)(:|=)/g,b=/<\//,g=/</g,_=/\/>/,w=/>\s+</g,O=new RegExp("<~::~CDATA~::~>","g"),j={newLine:"\r\n",tagIndent:"\t"};function E(e,t,n){return t+new Array(e+1).join(n)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!(0,r.isObject)(e)||(0,r.isObject)(e)&&"IMG"!==e.tagName)throw new TypeError("Parameter imagePreview must be an image");if(!(0,r.isObject)(t))throw new TypeError("Parameter region must be an object");var n=e.naturalWidth/e.offsetWidth,o=e.naturalHeight/e.offsetHeight,i=t.height?t.height*o:e.naturalHeight,a=t.width?t.width*n:e.naturalWidth,u=t.x?Math.max(t.x*n,0):0,c=t.y?Math.max(t.y*o,0):0;return{height:i,width:a,x:u,y:c}};var r=n(0)},function(e,t){function n(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")}()}Object.defineProperty(t,"__esModule",{value:!0}),t.escapeHTML=function(e){return e.replace(a,(function(e){return r[e]}))},t.unescapeHTML=function(e){return e.replace(u,(function(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}))},t.MAP_HTML_CHARS_ESCAPED=void 0;var r={'"':"&#034;","&":"&amp;","'":"&#039;","/":"&#047;","<":"&lt;",">":"&gt;","`":"&#096;"};t.MAP_HTML_CHARS_ESCAPED=r;var o={};Object.entries(r).forEach((function(e){var t=n(e,2),r=t[0],i=t[1];o[i]=r}));var i=Object.keys(r),a=new RegExp("[".concat(i.join(""),"]"),"g"),u=/&([^;]+);/g},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return window.innerWidth<o.default.PHONE};var r,o=(r=n(6))&&r.__esModule?r:{default:r}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return window.innerWidth<o.default.TABLET};var r,o=(r=n(6))&&r.__esModule?r:{default:r}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,r,o,i=e;"URL"===(null==e||null===(n=e.constructor)||void 0===n?void 0:n.name)&&(i=String(e));(null===(r=Liferay.SPA)||void 0===r||null===(o=r.app)||void 0===o?void 0:o.canNavigate(i))?(Liferay.SPA.app.navigate(i),t&&Object.keys(t).forEach((function(e){Liferay.once(e,t[e])}))):function(e){var t;try{t=e.startsWith("/")?new URL(e,window.location.origin):new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}(i)&&(window.location.href=i)}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("parameter text must be a string");return e.replace(/[^a-z0-9_-]/gi,"-").replace(/^-+/,"").replace(/--+/,"-").toLowerCase()}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n;if("object"!==i(t))n=u(e,t);else{n={},Object.keys(t).forEach((function(r){var o=r;r=u(e,r),n[r]=t[o]}))}return n};var r,o=(r=n(14))&&r.__esModule?r:{default:r};function i(e){return(i="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 a,u=(a=function(e,t){return void 0!==t&&0!==t.lastIndexOf(e,0)&&(t="".concat(e).concat(t)),t},(0,o.default)(a,(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(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!(0,r.isObject)(e))throw new TypeError("Parameter obj must be an object");var t=new URLSearchParams;return Object.entries(e).forEach((function(e){var n=function(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")}()}(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};var r=n(0)},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.default)(e,a(a({},t),{},{p_p_lifecycle:"1"}))};var r,o=(r=n(3))&&r.__esModule?r:{default:r};function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(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,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.default)(e,a(a({},t),{},{p_p_lifecycle:"0"}))};var r,o=(r=n(3))&&r.__esModule?r:{default:r};function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(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,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.default)(e,a(a({},t),{},{p_p_lifecycle:"2"}))};var r,o=(r=n(3))&&r.__esModule?r:{default:r};function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(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,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getSessionValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=a("get");n.append("key",e),t.useHttpSession&&n.append("useHttpSession",!0);return(0,o.default)(u(),{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}))},t.setSessionValue=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=a("set");t&&"object"===i(t)&&(t="serialize://"+JSON.stringify(t));r.append(e,t),n.useHttpSession&&r.append("useHttpSession",!0);return(0,o.default)(u(),{body:r,method:"POST"})};var r,o=(r=n(4))&&r.__esModule?r:{default:r};function i(e){return(i="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 a(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 u(){return"".concat(Liferay.ThemeDisplay.getPortalURL()).concat(Liferay.ThemeDisplay.getPathMain(),"/portal/session_click")}}]));
//# sourceMappingURL=global.bundle.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; }

/**
 * 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 = _objectSpread(_objectSpread({}, Liferay.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 : 'Lỗi\x20không\x20xác\x20định\x2e\x20Hãy\x20tải\x20lại\x20trang\x2e';
      Liferay.Util.openToast({
        message: message,
        type: 'danger'
      });
    });
  }, ['aui-parse-content']);
  Liferay.provide(Portlet, 'close', function (portlet, skipConfirm, options) {
    var instance = this;
    portlet = A.one(portlet);

    if (portlet && (skipConfirm || confirm('Bạn\x20có\x20chắc\x20chắn\x20là\x20muốn\x20bỏ\x20thành\x20phần\x20này\x20đi\x20không\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, '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.touchEnabled) {
          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, ['Sự\x20thay\x20đổi\x20chỉ\x20được\x20nhìn\x20thấy\x20khi\x20bạn\x20tải\x20lại\x20trang\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.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
